Enables increment operators in Python with a bytecode hack

Enable ++x and –x expressions in Python What’s this? By default, Python supports neither pre-increments (like ++x) nor post-increments (like x++). However, the first ones are syntactically correct since Python parses them as two subsequent +x operations, where + is the unary plus operator (same with –x and the unary minus). They both have no effect, since in practice -(-x) == +(+x) == x. This module turns the ++x-like expressions into x += 1 at the bytecode level. Increments and […]

Read more

Data from popular CS:GO website hltv.org

🎮 Data from popular CS:GO website hltv.org Install Usage The public methods can be reached using HLTVClient from hltv_data import HLTVClient hltv_client = HLTVClient() Current ranking hltv_client.get_ranking() Response: [ {“position”: 1, “name”: “Natus Vincere”, “points”: 1000}, {“position”: 2, “name”: “Gambit”,

Read more

Demonstration that AWS IAM policy evaluation docs are incorrect

The flowchart from the AWS IAM policy evaluation documentation page, as of 2021-09-12, and dating back to at least 2018-12-27, is the following: The flowchart indicates that an Allow in a resource policy causes a final decision of Allow, before permissions boundaries have a chance to cause an implicit Deny. This would mean a resource policy could unilaterally grant access to a principal, circumventing its permissions boundary. However, this is only partially correct. Resource policies cannot unilaterally grant access to […]

Read more

Middleware that Prints the number of DB queries to the runserver console

Inspired by this post by David Szotten, this project gives you a middleware that prints DB query counts in Django’s runserver console output. Installation pip install django-querycount Just add querycount.middleware.QueryCountMiddleware to your MIDDLEWARE. Notice that django-querycount is hard coded to work only in DEBUG mode set to true Settings There are two possible settings for this app: The first defines threshold values used to color output, while the second allows you customize requests that will be ignored by the middleware. […]

Read more

Polyp-PVT: Polyp Segmentation with Pyramid Vision Transformers

by Bo Dong, Wenhai Wang, Deng-Ping Fan, Jinpeng Li, Huazhu Fu, & Ling Shao. This repo is the official implementation of “Polyp-PVT: Polyp Segmentation with Pyramid Vision Transformers”. 1. Introduction Polyp-PVT is initially described in arxiv. Most polyp segmentation methods use CNNs as their backbone, leading to two key issues when exchanging information between the encoder and decoder: 1) taking into account the differences in contribution between different-level features; and 2) designing effective mechanism for fusing these features. Different from […]

Read more

A prometheus exporter for qBitorrent/Transmission/Deluge

A prometheus exporter for qBitorrent/Transmission/Deluge. Get metrics from multiple servers and offers them in a prometheus format. How to use it You can install this exporter with the following command: pip3 install downloader-exporter Then you can run it with downloader-exporter -c CONFIG_FILE_PATH -p 9000 Another option is run it in a docker container. docker run -d -v CONFIG_FILE_PATH:/config/config.yml -e EXPORTER_PORT=9000 -p 9000:9000 leishi1313/downloader-exporter Add this to your prometheus.yml – job_name: “downloader_exporter”    

Read more

Python library to discover, parse, analyze and change Cisco switched networks

Netwalk is a Python library born out of a large remadiation project aimed at making network device discovery and management as fast and painless as possible. Installation Can be installed via pip with pip install git+ssh://[email protected]/icovada/netwalk.git A collection of scripts with extra features and examples is stored in the extras folder Code quality A lot of the code is covered by tests. More will be added in the future Fabric This object type defines an entire switched network and can […]

Read more
1 556 557 558 559 560 1,023