Saravanan666/pypi-org huggingface dataset:
Package: sanic-zipkin
# sanic-zipkinsanic plugin/extension to integrate aiozipkin (opentracing reporting)## Features* adding "Request span" by default* if Request is from another micro-service endpoint, span will be attached (Inject/Extract) to that endpoint* use "logger" decorator to create span for "methods" calls* use "sz_rpc" method to create sub-span for RPC calls, attaching to parent span## Install and Initialize```pip install sanic-zipkin# app.pyfrom sanic_zipkin import SanicZipkin, logger, sz_rpcsz = SanicZipkin(app)```## Examples1. run `examples/servic_a.py` and `examples/service_b.py`2. use Docker to run zipkin or jaeger:`docker run -d -p9411:9411 openzipkin/zipkin:latest`or`docker run -d -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp -p5778:5778 -p16686:16686 -p14268:14268 -p9411:9411 jaegertracing/all-in-one`3. access the endpoint:- `curl localhost:8000/` to see plugin's basic usage```from sanic_zipkin import SanicZipkin, logger, sz_rpcapp = Sanic(__name__)# initilize plugin, default parameters:#        zipkin_address = 'http://127.0.0.1:9411/api/v2/spans'#        service = __name__#        host = '127.0.0.1'#        port = 8000sz = SanicZipkin(app, service='service-a')@app.route("/")async def index(request):return response.json({"hello": "from index"})```This "/" endpoint will add trace span to zipkin automatically- `curl localhost:8000/2` to see how to decorate methods and chain-calls```@logger()async def db_access(context, data):await asyncio.sleep(0.1)print(f'db_access done. data: {data}')return@sz.route("/2")async def method_call(request, context):await db_access(context, 'this is method_call data')return response.json({"hello": 'method_call'})```Use "@logger" decorator to generate span for methods. Note: in this case, you need to use "@sz.route", and pass `context` parameter to method calls.- `curl localhost:8000/3` to see how RPC calls working, both GET/POST is supported```@logger()async def decorate_demo(context, data):await db_access(context, data)data = {'payload': 'rpc call data of decorate_demo'}rsp = await sz_rpc(context, backend_service2, data, method='GET')print(rsp.status, await rsp.text())return@sz.route("/3")async def rpc_call(request, context):await decorate_demo(context, 'this is index4 data')data = {'payload': 'rpc call data of rpc_call'}rsp = await sz_rpc(context, backend_service1, data) # default method='POST'print(rsp.status, await rsp.text())return response.json({"hello": 'rpc_call'})```method `sz_rpc` just wrapper span injection to RPC POST/GET calls. In peer server, span-context will be automatically extracted and generate a chain-view in zipkin.4. check the tracing output in Zipkin/Jaeger UICHANGES=======0.1.2 (2019-01-31)------------------basic features:* Initial release* adding "Request span" by default* if Request is from another micro-service endpoint, span will be attached to that endpoint* use "logger" decorator to create span for "methods" calls* use "sz_rpc" method to create sub-span for RPC calls, attaching to parent span
Package: saniti
# Saniti**Sanitise lists of text documents quickly, easily and whilst maintaining your sanity**The aim was to streamline processing lists of documents into the same outputs into simply specifying the list of texts and defining the sanitization pipeline.### Usage:**As a function-ish**```import sanitioriginal_text = ["I like to moves it, move its", "I likeing to move it!", "the of"]text = saniti.saniti(original_text, ["token", "destop", "depunct", "unempty", "stem", "out_corp_dict"]) #sanitise the text while initalising the classprint(text.text){'dictionary': <gensim.corpora.dictionary.Dictionary object at 0x000002BA9F5FFEF0>, 'corpus': [[(0, 1), (1, 1), (2, 2)], [(0, 1), (1, 1), (2, 1)], []]}```**As a class**```import sanitisani1 = saniti.saniti() # initialise the santising classtext = sani1.process(original_text, ["token", "destop", "depunct", "unempty", "lemma", "out_tag_doc"]) # sanitise the textprint(text)[TaggedDocument(words=['I', 'like', 'move', 'move'], tags=['I like move move']), TaggedDocument(words=['I', 'likeing', 'move'], tags=['I likeing move']), TaggedDocument(words=[], tags=[''])]```## Pipeline Components* "token" - tokenise texts* "depunct" - remove punctuation* "unempty" - remove empty words within documents* "lemma" - lemmatize text* "destop" - remove stopwords* "stem" - stem texts* "out_tag_doc" - turns the texts into gensim tagged documents for Doc2Vec* "out_corp_dict" - turns the texts into gensim corpus and dictionary
Package: sanitize
# Sanitize[![Build Status](https://secure.travis-ci.org/Alir3z4/python-sanitize.png)](http://travis-ci.org/Alir3z4/python-sanitize)
[![Coverage Status](https://coveralls.io/repos/Alir3z4/python-sanitize/badge.png)](https://coveralls.io/r/Alir3z4/python-sanitize)
[![Downloads](https://pypip.in/d/sanitize/badge.png)](https://pypi.python.org/pypi/sanitize/)
[![Version](https://pypip.in/v/sanitize/badge.png)](https://pypi.python.org/pypi/sanitize/)
[![Egg?](https://pypip.in/egg/sanitize/badge.png)](https://pypi.python.org/pypi/sanitize/)
[![Wheel?](https://pypip.in/wheel/sanitize/badge.png)](https://pypi.python.org/pypi/sanitize/)
[![Format](https://pypip.in/format/sanitize/badge.png)](https://pypi.python.org/pypi/sanitize/)
[![License](https://pypip.in/license/sanitize/badge.png)](https://pypi.python.org/pypi/sanitize/)sanitizeis a Python module for making sure various things (e.g. HTML) are safe to use.
It was originally written by Mark Pilgrim and is distributed under the BSD license.Usage` >>> from sanitize import HTML >>>HTML('<b>hello')'<b>hello</b>'>>>HTML('<img>')'<img />' >>>HTML(("<b><b><b>hello")... )'<b><b><b>hello</b></b></b>'>>>HTML('<imgsrc="foo"/')'' >>>HTML('<inputtype="checkbox"checked>')'<inputtype="checkbox"checked="checked"/>' >>> # dangerous tags (a small sample) ... >>>HTML('safe<appletcode="foo.class"codebase="http://example.com/"></applet><b>description</b>')'safe<b>description</b>'>>>HTML('safe<framesetrows="*"><framesrc="http://example.com/"></frameset><b>description</b>')'safe<b>description</b>'>>> # bad protocols (a small sample) >>>HTML('<ahref="java'+ chr(1) +'script:foo">bar</a>')'<ahref="#foo">bar</a>'>>>HTML('<ahref="vbscript:foo">bar</a>')'<ahref="#foo">bar</a>'>>> `To see more usage examples seetests/test_sanitize_html.py.Installationpython-sanitizeis available on pypihttp://pypi.python.org/pypi/python-sanitizeSo easily install it bypip:` pip install sanitize `Or byeasy_install:` $ easy_install sanitize `Another way is by cloningpython-sanitize’s git repository` $ git clonegit://github.com/Alir3z4/python-sanitize.git`Then install it by running` $ python setup.py install `TestsTo run unit tests:` $ python setup.py test `LicenseSanitizeis distributed under BSD license.
Package: sanitize-filename
A simple, dependency-free, blacklist-based filename sanitizer, for when you want to keep the original filename.Note that a blacklist based sanitizer willneverbe as safe as a whitelist based one. In most cases, your best option is to create a safe filename yourself. Your second safest option is to use a whitelist approach (allowing only certain characters). This sanitizer is useful when you want to keep the original filename, including non ascii characters, whenever possible.Installationpipinstallsanitize_filenameUsagefromsanitize_filenameimportsanitizefilename=input("Enter a file name:")filename=sanitize(filename)Examples:>sanitize("A/B/C.txt")'ABC.txt'>sanitize("this𓀦filenameḜisあactually...valid.txt")'this𓀦filenameḜisあactually...valid.txt'>sanitize("def.")'def'>sanitize("NUL")'__NUL'>sanitize("..")'__'Changelog1.2.0Get rid of os dependent checks; ensure uniform behaviourNow works on long filenames where the non-extensions part consists of only dots1.1.0Try to preserve filename extensions if possible1.0.1First release (as 1.0.1 due to a version number mix-up in 1.0.0)1.0.0-dev3Black list low code point characters (<32)1.0.0-dev1First version
Package: sanitycheckhaha
Wibble - a template for simple python packagesA minimalist template for a python package.Provides the bl and the blarg commands,
and does basic continuous integraton testing on github.Make a copy of the project, and fix the replacements below.Things to replacegrep -ri word .will find thewordin all the filesfind . | grep wordwill find thewordin any filenamesretospect- changed to your github user namewibble- change to the name of your projectwobble- change to the internal package name you want to usefafa- change to whatever your commandline command should be if you are providing a scriptupdate the pyproject.py file to have your name and the right description.
Package: sanjose-twitter
# Get Latest Trends from Twitter[![Hit Count](http://hits.dwyl.io/sanjose/sanjose-twitter.svg)](http://hits.dwyl.io/sanjose/sanjose-twitter)[![Build Status](https://travis-ci.org/josepipher/sanjose-twitter.svg?branch=master)](https://travis-ci.org/josepipher/sanjose-twitter)## Prerequisite:Prepare a **config.py** file in the working directory :--------------------------------------------------------------------These tokens are needed for user authentication.Credentials can be generates via Twitter's Application Management:https://apps.twitter.com/app/newconsumer_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"consumer_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"access_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"access_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"To install,```linuxpip install sanjose-twitter```To run command,```linuxsanjose-twitter -h```
Package: sanka
sankaa function decorator for surfacing dead codeQuick startThe "examples/" directory is home tosankause cases.examples/
├── actionpack/
│   ├── example.py
│   └── requirements.txt
└── ...A docker image capable of running an example can be built using anoxcommand:EXAMPLE=actionpack nox -s imagewhere the example referenced in the image can be specified using the "EXAMPLE" environment variable.
To run a container, execute something like the following:docker run -e RUN_DURATION_SECONDS=10 -e CALL_DELAY_SECONDS=5 sanka:0.3.0SetupEnsurenoxis installed.pip install noxRunnoxto installsankaand run tests.Usagethe basicsDecorate any funciton with@sanka.@sankadeffunction():passThe decorator instance tracks function calls so the call count can be gotten as follows:function(YaDead)  #=> returns number of times `function` was calledcallbacksOne can also pass a callback argument to the@sankadecorator:fromstringimportTemplatereport=Template('Called $f called $this_many times')callback:Callable[[int],None]=lambdatally:print("Ya, mon."iftally==0elsereport.substitute(f=str(function),this_many=tally))@sanka(callback=callback)deffunction():passThe callback is expected to be a single-parameter function that accepts anint.
Thisintis the latest tally for the number of times the decorated function has been called.
To access the call count for the docorated function, just ask@sankaif it's "dead":function(YaDead)and as per the example you'd get this response if the function had never been called:Ya, mon.callback controlBy default, callbacks are only executed whenYaDeadis passed.
The callback can be executedon every function callif desired.@sanka(callback=callback,only_callback_when_dead=False)deffunction():passNow, every timefunctionis called, thecallbackwill also be called.
Package: sankaku
sankakuFor real men of cultureAboutAsynchronous API wrapper forSankaku Complexwithtype-hinting, pydanticdata validationand an optionallogging supportwith loguru.FeaturesType-hintsDeserialization of raw json data thanks to pydantic modelsEnumerations for API request parameters to provide better user experienceUseful linksDocumentationAPI ReferenceSource codeRequirementsPython 3.8+aiohttppydanticloguruaiohttp-retrytyping_extensions; python_version < '3.10'InstallationInstallation with pipTo install sankaku via pip write following line of code in your terminal:pip install sankakuInstallation with DockerTo install the sankaku via Docker, you can follow these steps:Step 1: Install DockerEnsure that Docker is installed on your machine. If Docker is not already
installed, you can download and install it from the officialDocker website.Step 2: Use docker to install sankakuOpen a command prompt. Navigate to the directory where you want
to install sankaku. Type the following command:git clone https://github.com/zerex290/sankaku.git
cd sankaku
docker run -it --name sankaku -w /opt -v$(pwd):/opt python:3 bashUsage exampleIt's very simple to use and doesn't require to always keep opened browser page
with documentation because all methods are self-explanatory:importasynciofromsankakuimportSankakuClientasyncdefmain():client=SankakuClient()post=awaitclient.get_post(25742064)print(f"Rating:{post.rating}| Created:{post.created_at}")# "Rating: Rating.QUESTIONABLE | Created: 2021-08-01 23:18:52+03:00"awaitclient.login(access_token="token")# Or you can authorize by credentials:# await client.login(login="nickname or email", password="password")# Get the first 100 posts which have been added to favorites of the# currently logged-in user:asyncforpostinclient.get_favorited_posts(100):print(post)# Get every 3rd book from book pages, starting with 100th and ending with# 400th book:asyncforbookinclient.browse_books(100,401,3):# range specified inprint(book)# same way as with 'range()'asyncio.run(main())ContributingFeel free to contribute to sankaku after readingCONTRIBUTINGfile.
Package: sankee
sankeeVisualize changes in classified time series data with interactive Sankey plots in Google Earth EngineDescriptionUseEarth Engineto visualize changes in land cover, plant health, burn severity, or any other time series of classified imagery with interactive Sankey plots. Use a library ofbuilt-in datasetsfor convenience or define your owncustom datasetsfor flexibility.InstallationPippipinstallsankeeCondacondainstall-cconda-forgesankeeQuickstartPremade DatasetsVisualize annual changes in land cover usingpopular LULC datasetswith a couple lines of code. Just choose a dataset, an area of interest, and a list of years to generate a Sankey diagram from a premade dataset. Below, we can look at 30 years of vegetation recovery in the area devastated by the Mt. St. Helens eruption.importsankeeimporteeee.Initialize()sankee.datasets.LCMS_LC.sankify(years=[1990,2000,2010,2020],region=ee.Geometry.Point([-122.192688,46.25917]).buffer(2000),max_classes=3,title="Mt. St. Helens Recovery")Check out theexample notebookfor an interactive demo.Custom DatasetsAny classified images can be used by defining the dataset parameters (which pixel values correspond to which labels and colors). For example, we can look at classifiedDynamic Worldscenes just two weeks apart that show substantial snow loss on Mountain Jefferson during the 2021 Heat Dome in the Pacific Northwest.importsankeeimporteeee.Initialize()# Load a set of classified imagesimg_list=[ee.Image("GOOGLE/DYNAMICWORLD/V1/20210616T185919_20210616T190431_T10TEQ"),ee.Image("GOOGLE/DYNAMICWORLD/V1/20210706T185919_20210706T190638_T10TEQ")]# Which band contains the classified data?band="label"# What labels correspond to which pixel values?labels={0:"Water",1:"Trees",2:"Grass",3:"Flooded",4:"Crops",5:"Shrub / Scrub",6:"Build",7:"Bare",8:"Snow / Ice",}# What colors should be applied to which pixel values?palette={0:"#419BDF",1:"#397D49",2:"#88B053",3:"#7A87C6",4:"#E49635",5:"#DFC35A",6:"#C4281B",7:"#A59B8F",8:"#B39FE1"}plot=sankee.sankify(image_list=img_list,band=band,labels=labels,palette=palette,region=ee.Geometry.Point([-121.80183,44.67655]).buffer(3000),max_classes=3,title="Mt. Jefferson Snow Loss - June 2021")Integration with geemapsankeepremade datasets are usable through thegeemapinteractive GUI. Check out thedocumentationandvideo tutorialsby@giswqs.ContributingIf you find bugs or have feature requests, please open an issue!Top
Package: sankeydata
# sankeydataThis repo is part of the [floWeaver
project](https://github.com/ricklupton/floweaver), aiming to define a common
data format for storing and exchanging Sankey diagram data. It aims to cover
both the logical structure (without exact coordinates and geometry) and the
detailed layout of a diagram.There are two parts to this repo:A [JSON schema document](./src/json-sankey-schema.json), formally describing
the file format.A Python packagesankeydataproviding Python data structures and
serialisation to the JSON format.## ContributingContributions are welcome: we want to make sure this format is useful to a range
of users and compatible with different tools. For now, see the roadmap and
contribution guide in the [floWeaver
repository](https://github.com/ricklupton/floweaver).
Package: sankeyfy
# Sankeyfy - Data wrangling for easy Sankey VisualizationsThe Sankeyfy package aims to simplify the creation of a Sankeyvisualization through a straightforward function call. Simplyrun the "sankeyfy" function on your dataframe, and it will outputthe necessary dataframes for a Sankey chart.I built this for specifically for use with the **Plotly**  API,but this should also be useful for its sources or other D3 libraries.The function accounts for the following scenarios, and attemptsto leverage sensible default behavior (but feel free to give feedbackor contribute!):1. *Default Scenario:* **Pre-aggregated format*** Input is a table of categorical variables/columns with asingle aggregate column (counts/count distinct, etc.)2. **Raw Format*** Input is a raw table where each row is an observation andthe columns are all categorical variables.* Currently assumes there is a unique id field, will add defaultfunctionality for this laterPlease feel free to give me any feedback or contribute with a PR,and hopefully this saves your some time trying to build out some coolSankey visuals!## To Do:1. DONE - Create Default NULL behavior as an option (Fill with an "unknown" category that you can feed the value for)2. DONE - Build functionality to create an ID field if one isn't provided...Copyright 2018, MIT License
Package: sankir-sdf
Steps to run (GCP)Install sankir-sdfpip3installsankir-sdfCreate aconfig.jsoncontaining following fields:{"cloud":"AWS|GCP|AZURE","bucket_name":"sankir-storage-prospark","input_path":"data/retail-data/q1","output_path":"processed-retail-data/","reconciliation":"recon.reconciliation"}SetGOOGLE_APPLICATION_CREDENTIALSenvironment variableexportGOOGLE_APPLICATION_CREDENTIALS=/path/to/creds.jsonPut sankir-sdf in pathexportPATH=$PATH:$HOME/.local/binRun the program with:sankir-sdf/path/to/config.json
Package: sanpai
Sanpai is a tool for inspecting and diffing SANs on x509 certificates.ModulesFor converting a directory to a dict, use convert_dir:>>>fromsanpaiimportsan>>>domains=san.inspect(pem_file="path/to/cert.pem")>>>type(domains)<type'list'>ScriptsFrom command line, retrieve newline-separated list of domains attached to a cert:$sanpai/path/to/cert.pemsubdomain.example.comexample.org*.wilcard.ioCompare two certs:$sanpai/path/to/cert1.pem--diff/path/to/cert2.pem-subdomain.example.com+www.example.org!example.org...InstallationTo install Sanpai, simply:$pipinstallsanpai
Package: sanpo
sanposanpois a command line tool to sanitize PO files from gettext for version
control.The problemThegettexttool collects text to be
translated from source code in PO files that can be sent to translators. These
files contain metadata about the project that can be helpful when using an
email based workflow.When creating a PO file the first time, these metadata look like this:"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-06 16:16+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"However, when having the PO file under version control, these metadata get in
the way. Most of them are available from the commit history. And when
runninggettextautomatically as part of the build process, thePO-Revision-Dategets updated every time even if none of the messages
changed, resulting in spuriously modified PO files without any actual
changes worth committing.The solutionBecause your localized software does not use the PO files directly but the MO
files compiled from them, the unhelpful metadata can be removed. Which is
exactly whatsanpodoes.A typical build chain would look like this:gettext - collect PO filemsgfmt - compile into MO filesanpo - remove unhelpful metadata from POcommit possible changes in PO filesanposimple takes one or more PO files as argument, for example:sanpolocale/de/LC_MESSAGES/django.polocale/en/LC_MESSAGES/django.polocale/hu/LC_MESSAGES/django.poAfter this, the remaining metadata are:"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"Using the special pattern**folders can be scanned recursively.To sanitize PO files for all languages in a certain folder, use for example:sanpolocale/**/django.poDjangoForDjangoprojects, the typical workflow
is:django-admin makemessagesdjango-admin compilemessagessanpocommit possible changes in PO file
Package: sanpy-ephys
SanPy is software for whole-cell current clamp analysisSanPy is designed to analyze action potentials and extract a number of parameters including spike time, voltage threshold, half-widths, interval statistics, and lots more.SanPy is optimized for a wide range of whole-cell current-clamp recordings including cardiac myocytes and neurons.Please see theSanPy documentation.SanPy preprint on bioRxivGuarina L, Johnson TL, Griffith T, Santana LF, Cudmore RH (2023) SanPy: A whole-cell electrophysiology analysis pipeline. bioRxiv 2023.05.06.539660; doi:https://doi.org/10.1101/2023.05.06.539660]ContactIf you find the code in this repository interesting, please email Robert Cudmore at UC Davis (rhcudmore@ucdavis.edu) and we can get you started. We are looking for users and collaborators.