Saravanan666/pypi-org huggingface dataset:
Package: python-logging-proxy
#python-logging-proxy - Python Micro Interceptor Proxy with loggingA small and sweet logging man-in-the-middle proxy workig from pymiproxy.##Introductionpython-logging-proxy is an addition on top of pymiproxy which gtives logging to
a sqlite database, which can then be used as you like.##Installation RequirementsThe following modules are required:pyOpenSSLpyMIProxy##InstallationJust run the following command at the command prompt:`bash $ sudo pip installpython-logging-proxy`##UsageTo start python-logging-proxy run:`bash $ python-mpython_logging_proxy `This will log to the command line and also to a sqlite database##Extending or Implementing python_logging_proxyPlease see the documentation forpymiproxyand for the python standard libraryloggermodule. The proxy itself can be extended exactly aspymiproxy,
either by registering an interceptor or method overloading. As for the logging
it is possible to add filters, handlers etc to the LoggingProxyHandler.logger
class property.##KudosThanks to the great documentation at python.org, and Nadeem Douba for pymiproxy,
which provides a good chunk the functionality I wanted when I started this
project.##ContributingPlease feel free to add issues to the github project, fork, pull, push, and
otherwise fold spindle and mutilate - as per the License below. For help with
usage and extenseion please feel free to get in touch either through issues,
or by email.##LicenseThe MIT License (MIT)Copyright (c) 2013 Alistair BroomheadPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Package: python-logging-tools
python logging toolspython package for logginginstallationpip install python-logging-toolsusage:importpython_logging_toolslog=python_logging_tools.LoggingTools("Name",logging.INFO)log.debug("message")output:
[INFO]> [Name] - message```package:this package simplifies logging in python
logging tools packagelogging levels are supportedcolors are supported
Package: python_log_indenter
A python helper class that provides automatic indenting for logging.Documentation:http://python-log-indenter.readthedocs.org/en/latest/Source code at:https://github.com/dstrohl/Python_log_indenterThis will allow you to turn logs that would normally look like this:root    DEBUG   Loading system
root    DEBUG   Checking for the right record
root    DEBUG   Checking record 1
root    DEBUG   Checking name
root    DEBUG   Not the right record
root    DEBUG   Checking record 2
root    DEBUG   checking name
root    DEBUG   Name checks, checking phone number
root    DEBUG   Phone number checks, VALID record!
root    DEBUG   Returning record 2Into something like this:root    DEBUG   Loading system
root    DEBUG       Checking for the right record
root    DEBUG           Checking record 1
root    DEBUG               Checking name
root    DEBUG                   Not the right record
root    DEBUG           Checking record 2
root    DEBUG               checking name
root    DEBUG                   Name checks, checking phone number
root    DEBUG               Phone number checks, VALID record!
root    DEBUG           Returning record 2
Package: python-logrus
logrusBetter logging made easy with support for structlog and the standard logging module.project status badges:version badges:Installation 🗹To installpython-logrususingpip, run the following
commands in your terminal:python3-mpipinstall--userpython-logrus# install logrusIf you don't have pip installed, thisPython installation guidecan guide
you through the process.Useful Links 🔗API Reference: A developer's reference of the API exposed by this
project.cc-python: Thecookiecutterthat was used to generate this project.
Changes made to this cookiecutter are periodically synced with this project
usingcruft.CHANGELOG.md: We use this file to document all notable changes made to
this project.CONTRIBUTING.md: This document contains guidelines for developers
interested in contributing to this project.Create a New Issue: Create a new GitHub issue for this project.Documentation: This project's full documentation.
Package: python-log-sanitizer
python_log_sanitizerPython log sanitizerInstalationPipenvpipenv install python_log_sanitizerPippip install python_log_sanitizerUsageTo run this example please installpython-json-logger:pip install python-json-loggerLOG_CONFIG={"version":1,"formatters":{"json":{"class":"pythonjsonlogger.jsonlogger.JsonFormatter","format":"[%(asctime)s]%(levelname)sin%(module)s:%(message)s"}},"filters":{"sanitizer":{"()":"python_log_sanitizer.SanitizerFilter","patterns":["extra"],"placeholder":"*"}},"handlers":{"json":{"class":"logging.StreamHandler","formatter":"json"}},"loggers":{"root":{"level":"INFO","handlers":["json"],"filters":["sanitizer"]}}}importloggingfromloggingimportconfigconfig.dictConfig(LOG_CONFIG)# load log config from dictlogger=logging.getLogger("root")# get root logger instancelogger.info("farofa",extra={"extra":"farofa"})# log message with extra argumentsExample output:{"asctime":"2018-11-04 23:01:55,804","levelname":"INFO","module":"<ipython-input-8-f8c68848bfbe>","message":"farofa","extra":"*"}
Package: python-logstash-async
Python Logstash Async is an asynchronous Python logging handler to submit
log events to a remote Logstash instance.Unlike most other Python Logstash logging handlers, this package works asynchronously
by collecting log events from Python’s logging subsystem and then transmitting the
collected events in a separate worker thread to Logstash.
This way, the main application (or thread) where the log event occurred, doesn’t need to
wait until the submission to the remote Logstash instance succeeded.This is especially useful for applications like websites or web services or any kind of
request serving API where response times matter.For more details, configuration options and usage examples please see the
documentation athttp://python-logstash-async.readthedocs.io/en/latest/.InstallationThe easiest method is to install directly from pypi using pip:pip install python-logstash-asyncIf you prefer, you can download python-logstash-async and install it
directly from source:python setup.py installGet the SourceThe source code is available athttps://github.com/eht16/python-logstash-async/.ContributingFound a bug or got a feature request? Please report it athttps://github.com/eht16/python-logstash-async/issues.AuthorEnrico Tröger <enrico.troeger@uvena.de>
Package: python-logstash-async2
Python Logstash Async is an asynchronous Python logging handler to submit
log events to a remote Logstash instance.Unlike most other Python Logstash logging handlers, this package works asynchronously
by collecting log events from Python’s logging subsystem and then transmitting the
collected events in a separate worker thread to Logstash.
This way, the main application (or thread) where the log event occurred, doesn’t need to
wait until the submission to the remote Logstash instance succeeded.This is especially useful for applications like websites or web services or any kind of
request serving API where response times matter.For more details, configuration options and usage examples please see the
documentation athttp://python-logstash-async.readthedocs.io/en/latest/.InstallationThe easiest method is to install directly from pypi using pip:pip install python-logstash-asyncIf you prefer, you can download python-logstash-async and install it
directly from source:python setup.py installGet the SourceThe source code is available athttps://github.com/eht16/python-logstash-async/.ContributingFound a bug or got a feature request? Please report it athttps://github.com/eht16/python-logstash-async/issues.AuthorEnrico Tröger <enrico.troeger@uvena.de>
Package: python-lokalise-api
Lokalise API v2 official Python interfaceOfficial Python 3 interface for theLokalise APIv2that represents returned data as Python objects.Quick startThis plugin requires Python 3.7 and above. Install it:pip install python-lokalise-apiObtain a Lokalise API token (in yourPersonal profile) and use it:importlokaliseclient=lokalise.Client('YOUR_API_TOKEN')project=client.project('123.abc')print(project.name)client.upload_file(project.project_id,{"data":'ZnI6DQogIHRlc3Q6IHRyYW5zbGF0aW9u',"filename":'python_upload.yml',"lang_iso":'en'})translation_keys=client.keys(project.project_id,{"page":2,"limit":3,"disable_references":"1"})translation_keys.items[0].key_name['web']# => "sign_up"You can also useOAuth 2 tokens:client=lokalise.OAuthClient('YOUR_OAUTH2_API_TOKEN')project=client.project('123.abc')DocumentationFind detailed documentation atpython-lokalise-api.readthedocs.io.LicenseThis plugin is licensed under theBSD 3 Clause License.Copyright (c)Lokalise groupandIlya Krukowski
Package: python-loki-client
python-loki-clientWARNING: This is a beta release of the loki-client, the client is incomplete.A client library for accessing Grafana Loki APIs.InstallationTo install the client:pipinstallpython-loki-clientImplemented endpointsThis client is still incomplete and implements only the following endpoints:GET /loki/api/v1/queryGET /loki/api/v1/query_rangeUsageFirst, create a client:fromgrafana_loki_clientimportClientclient=Client(base_url="https://loki.grafana.com")Now call your endpoint and use your models:fromgrafana_loki_client.modelsimportMyDataModelfromgrafana_loki_client.api.my_tagimportget_my_data_modelfromgrafana_loki_client.typesimportResponsemy_data:MyDataModel=get_my_data_model.sync(client=client)# or if you need more info (e.g. status_code)response:Response[MyDataModel]=get_my_data_model.sync_detailed(client=client)Or do the same thing with an async version:fromgrafana_loki_client.modelsimportMyDataModelfromgrafana_loki_client.api.my_tagimportget_my_data_modelfromgrafana_loki_client.typesimportResponsemy_data:MyDataModel=awaitget_my_data_model.asyncio(client=client)response:Response[MyDataModel]=awaitget_my_data_model.asyncio_detailed(client=client)By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.client=Client(base_url="https://internal_loki.grafana.com",verify_ssl="/path/to/certificate_bundle.pem",)You can also disable certificate validation altogether, but beware thatthis is a security risk.client=Client(base_url="https://internal_loki.grafana.com",verify_ssl=False)Things to know:Every path/method combo becomes a Python module with four functions:sync: Blocking request that returns parsed data (if successful) orNonesync_detailed: Blocking request that always returns aRequest, optionally withparsedset if the request was successful.asyncio: Likesyncbut the async instead of blockingasyncio_detailed: Likesync_detailedby async instead of blockingAll path/query params, and bodies become method arguments.If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)Any endpoint which did not have a tag will be ingrafana_loki_client.api.defaultGenerate codeThis client is automatically generated from the OpenAPI 3.x specs manually defined ingrafana_loki_openapi.yaml.APIs are manually declared in the YAML file by reading the GrafanaLoki API's documentation.A code generator tool will use the OpenAPI document to generates a sync/async client.To generare an updated copy of the client:poetryinstall
poetryrunmakegenerate
Package: python-long-weekends
pipinstallpython-long-weekendsA simple python library to spot holiday “bridges” and long weekends.
When a public holiday falls on a Tuesday or a Thursday,
people typically take Monday or Friday off work to enjoy long vacations.
Italians call those days “ponti” (“bridges”).
To the best of my knowledge, there is no English translation for this term
apart from a generic “long weekend”.This library spots single working days that are preceded
and followed by a weekend and/or a public holiday, and classifies them as “bridges”.
Based on the identified “bridges”, this library also labels “long weekends”,
here defined as a series of 3 or more days that are either weekend,
holidays, or holiday “bridges”.This library is intended to help generate informative features for
energy consumption prediction models.Inspired byhttps://stackoverflow.com/a/57865434/7059626(thank you @jezrael).Example UsageSimply invokespot_holiday_bridgesand pass start and end dates, plus a list of public holiday dates.
If a public holiday falls on the day beforestartor the day afterend,
it is important to include it in the list of holidays
to make sure that the algorithm works correctly at the borders.Thisnotebookuses the example below and shows how to generate a colored calendar.>>>importholidaysasholidays_api>>>fromlong_weekends.long_weekendsimportspot_holiday_bridges>>>start='2021-01-01'>>>end='2021-12-31'>>>holidays=holidays_api.CH(prov='TI',years=[2020,2021,2022])>>>bridges,long_weekends=spot_holiday_bridges(start=start,end=end,holidays=holidays)>>>bridges[Timestamp('2021-05-14 00:00:00'),Timestamp('2021-06-04 00:00:00'),Timestamp('2021-06-28 00:00:00')]>>>long_weekends[Timestamp('2021-01-01 00:00:00'),Timestamp('2021-01-02 00:00:00'),Timestamp('2021-01-03 00:00:00'),Timestamp('2021-03-19 00:00:00'),Timestamp('2021-03-20 00:00:00'),Timestamp('2021-03-21 00:00:00'),Timestamp('2021-04-02 00:00:00'),Timestamp('2021-04-03 00:00:00'),Timestamp('2021-04-04 00:00:00'),Timestamp('2021-04-05 00:00:00'),Timestamp('2021-05-13 00:00:00'),Timestamp('2021-05-14 00:00:00'),Timestamp('2021-05-15 00:00:00'),Timestamp('2021-05-16 00:00:00'),Timestamp('2021-05-22 00:00:00'),Timestamp('2021-05-23 00:00:00'),Timestamp('2021-05-24 00:00:00'),Timestamp('2021-06-03 00:00:00'),Timestamp('2021-06-04 00:00:00'),Timestamp('2021-06-05 00:00:00'),Timestamp('2021-06-06 00:00:00'),Timestamp('2021-06-26 00:00:00'),Timestamp('2021-06-27 00:00:00'),Timestamp('2021-06-28 00:00:00'),Timestamp('2021-06-29 00:00:00'),Timestamp('2021-10-30 00:00:00'),Timestamp('2021-10-31 00:00:00'),Timestamp('2021-11-01 00:00:00')]LicenseCode and documentation are available according to the MIT License
(seeLICENSE).
Package: python-look
LOOK: A Wrapper For A Visual Attention ModelSimple wrapper code to run inference on images using the model and code from theLooking Repo from VITA-EPFL.The Looking Repo is an official implementation of the paperDo pedestrians pay attention? Eye contact detection for autonomous drivingImage taken from :https://jooinn.com/people-walking-on-pedestrian-lane-during-daytime.html. Results obtained with the model trained on JackRabbot, Nuscenes, JAAD and Kitti. The model file is available atmodels/predictorand can be reused for testing with the predictor.Table of contentsRequirementsPredictorExample commandCite VITA-EPFL's workRequirementspip install python-lookUse3.6.9 <= python < 3.9. Runpip3 install -r requirements.txtto get the dependenciesPLEASE DOWNLOAD THE MODELHEREAND PLACE IN THE SAME LOCATION(or name the location when create the instance of the class)Custom Training And Model EvaluationPlease refer to theoriginal repofor training custom models and evaluation of models.PredictorGet predictions from the pretrained model using any image with the predictor API. The API extracts the human keypoints on the fly usingOpenPifPaf.The predictor supports eye contact detection using human keypoints only.Run InferenceCreate an instance of the Predictor (with default or custom settings)import look
  pred = look.Predictor()Run predict on an RGB OpenCV format imagepred.predict(image)Call for results, in either data or an image with overlayed informationoutput_image = pred.get_output_image()Predictor Initialization ParametersParameterDefault ValueDescriptiontransparency0.4transparency of the overlayed posesfloatlooking_threshold0.5eye contact thresholdfloatmodejointsprediction modestringdevice'0'CUDA devicestringpifpaf_vershufflenetv2k30PIFPAF ARG: backbone model to usestringmodel_pathmodels/predictorTo use custom trained modelstringbatch_size1PIFPAF ARG: processing batch sizeintlong_edgeNonePIFPAF ARG: rescale the long side of the image (aspect ratio maintained)intloader_workersNonePIFPAF ARG: number of workers for data loadingintdisable_cudaFalsePIFPAF ARG: disable CUDAboolExample Code To Run:import cv2
import look

pred = look.Predictor()

cap = cv2.VideoCapture(0)

if cap.isOpened() == False:
    print("Camera feed is not open")
    exit()

width = int(cap.get(3))
height = int(cap.get(4))

print(f'Image Size: {width} X {height}')

while True:
    ret, frame = cap.read()

    if ret == True:
        pred.predict(frame)
        frame = pred.get_output_image()

        cv2.imshow('frame', frame)

        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    
    else:
        print('Could not get frame from video')
        break

cap.release()
cv2.destroyAllWindows()CreditsCredits toOpenPifPaffor the pose detection part.Cite VITA-EPFL's workIf you use our work for your research please cite VITA-EPFL :)@misc{belkada2021pedestrians,
      title={Do Pedestrians Pay Attention? Eye Contact Detection in the Wild}, 
      author={Younes Belkada and Lorenzo Bertoni and Romain Caristan and Taylor Mordan and Alexandre Alahi},
      year={2021},
      eprint={2112.04212},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
Package: python-lorem
Lorem ipsum generator.In publishing and graphic design, lorem ipsum is a placeholder text commonly
used to demonstrate the visual form of a document or a typeface without
relying on meaningful content.Theloremmodule provides a generic access to generating the lorem ipsum text
from its very original text:Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
est laborum.Usage of theloremmodule is rather simple. Depending on your needs, theloremmodule provides generation ofwords,sentences, andparagraphs.Get Random WordsTheloremmodule provides two different ways for getting random words.word-- generate a list of random wordsword(count=1,func=None,args=[],kwargs={})->Iterable[str]get_word-- return random wordsget_word(count=1,sep=' ',func=None,args=[],kwargs={})->strGet Random SentencesTheloremmodule provides two different ways for getting random sentences.sentence-- generate a list of random sentencessentence(count=1,comma=(0,2),word_range=(4,8))->Iterable[str]get_sentence-- return random sentencesget_sentence(count=1,comma=(0,2),word_range=(4,8),sep=' ')->Union[str]Get Random ParagraphsTheloremmodule provides two different ways for getting random paragraphs.paragraph-- generate a list of random paragraphsparagraph(count=1,comma=(0,2),word_range=(4,8),sentence_range=(5,10))->Iterable[str]get_paragraph-- return random paragraphsget_paragraph(count=1,comma=(0,2),word_range=(4,8),sentence_range=(5,10),sep=os.linesep)->Union[str]
Package: python-lorem-pixel
Python Lorem PixelAuthor: Tim Santortsantor@xstudios.agencyOverviewGrab any number of images from Lorem Pixel easily.UsageSimple:lorem-pixel 512x512 10Advanced:lorem-pixel 512x512 10 -c city -o downloadsNOTE: For all available options, runlorem-pixel-h.Version History0.0.1- Initial release0.0.2- Added missing dependency to setup.py1.0.0- Python 2 and 3 compatibleIssuesIf you experience any issues, please create anissueon
Bitbucket.
Package: python-lru
python-lruLeast Recently Used (LRU) Cache implementationUsageInstantiate a cache collection object specifying storage parameters.  The cache object
itself is thread safe.  However, depending on the storage backend, it may not be safe
to open a cache store multiple times.from lru import LRUCache, ItemNotCached

# Open cache store (all arguments are optional)
cache = LRUCache(
    storage = MemoryStorage() or ShelvedStorage(path=''),
    max_size = 1000000,
    sizeof = lambda o: len(str(o)),
    max_age = timedelta(minutes=15))

# Add items with keys
cache['name'] = "Bob"
cache['age'] = 12

# Check for items in cache
try:
    age = cache['age']
except ItemNotCached:
    print("No age")Cache ObjectsCached data can be any variable, and must be cached using a string key.
It's up to you to ensure that you don't mutate objects returned from the cache, as
storage won't automatically update from changes.Cache ParametersThe LRUCache container  parameters are:storage: Where to store cached data.  See Storages.sizeof: Callable to estimate the size of an object being cached.max_size: Maximum size before starting to forget cached items.max_age: All cached items will expire after this amount of time.storage: Object to use to store cached dataStoragesThere are a few storage classes provided.  All are inherited from CacheStorageMemoryStorage: Caches data in memoryShelvedStorage: Caches data inshelve.  Really only useful if you're caching large objects.Sqlite3Storage: Slowest storage engine, but possibly accessible from multiple processes?