Saravanan666/pypi-org huggingface dataset:
Package: upollo-python
Upollo Python ClientTheUpolloPython library can be used identify users before they login or if they visit from multiple devices.The Python library runs on your server and can be paired with the web or mobile to protect logins or payments.Get your API KeysSign up for our beta atupollo.ai/betato get your Private API key.Getting startedImport the package and create a client with your api key.fromupolloimportupolloprivateApiKey="ADD_PRIVATE_API_KEY_HERE"upolloClient=upollo.Upollo(privateApiKey)Validate a UserTo validate a user you need a token from the javascript library. See theUpollo Javascript Client Guidefor how to get the token.You also need a userId and possibly their email address or phone number, whichever is available to improve detection. You can use an email address as the id if you don't have another id.fromupolloimportupollofromupolloimportupollo_public_pb2upolloToken="GET FROM THE WEB CLIENT"userInfo=upollo_public_pb2.UserInfo(user_id="u_1234",# provide your user id if you have it.user_name="foo",# provide user name if you have it.user_email="foo@bar.com",# provide the email address if you have it.user_phone="+6100000000",# provide the phone number if you have it)eventType=upollo_public_pb2.EVENT_TYPE_LOGINanalysis=upolloClient.verify(upolloToken,userInfo)flagTypes=list(map(lambdaf:f.type,analysis.flags))isAccountSharing=upollo_public_pb2.ACCOUNT_SHARINGinflagTypesisRepeatedTrial=upollo_public_pb2.REPEATED_SIGNUPinflagTypesifisAccountSharing:print("user is account sharing")ifisRepeatedTrial:print("user is repeating trial")
Package: upoly
UpolyAn Asyncio based, high performance, REST client libary for interacting
with the polygon REST api.AbstractThe two main python rest-client libs for polygon.io(alpaca-trade-api,
polygonio) do not provide an effective means to gather more than 50,000 trade
bars at once. This library aims to address that by providing an easy and
performant solution to getting results from timespans where the resultset
exceeds 50,000 trade bars.InstallationThis library makes use of some high performance packages written inC/Rust(uvloop, orjson) so it may requiresudo apt install python3-devon Ubuntu or similar on
other OS's. It is currently only compatible with Python 3.8.x but aims to be
compatible with 3.9 once it's dependendencies support 3.9
and all future CPython versions moving forward.pip/poetry w/ venv#!/bin/env bashpython3.8-mvenv.venv&&source.venv/bin/activate

poetryaddupoly# orpipinstallupolyUsageReccomend to create a copy of./env.sampleas./env. Make sure.envis listed
in.gitignore.# ./.env
POLYGON_KEY_ID=REPACEWITHPOLYGONORALPACAKEYHEREMany alternatives to.envexist. One such alternative is exporting
like so:#!/bin/env bashexportPOLYGON_KEY_ID=REPACEWITHPOLYGONORALPACAKEYHEREor adding to your shell startup script, either.zshrcor.bashrcto have
it be globally available to all projects.#/home/youruseraccount/.bashrc...exportPOLYGON_KEY_ID=REPACEWITHPOLYGONORALPACAKEYHERE
...# ./yourscript.pyimportpytzfromdotenvimportload_dotenvimportpandasaspd# load Polygon key from .env fileload_dotenv()# alternatively run from cli with:# POLYGON_KEY_ID=@#*$sdfasd python yourscript.py# Not recommend but can be set with os.environ["POLYGON_KEY_ID"] as wellfromupolyimportasync_polygon_aggsNY=pytz.timezone("America/New_York")# Must be a NY, pandas Timestampstart=pd.Timestamp("2015-01-01",tz=NY)end=pd.Timestamp("2020-01-01",tz=NY)df=async_polygon_aggs("AAPL",start,end)TODOunit testsregression testsintegration tests/tradeendpoint functionality for tick data
Package: upolygon
uPolygonLibrary of handy polygon related functions to speed up machine learning projects.It was born as a replacement forcv2.fillPolywhen generating masks for instance segmentation, without having to bring in all of opencv.TODOdraw_polygonfind_contourspolygon_areapoint_in_polygonUsageThis library expects all polygons to be model as a list of paths, each path is a list of alternating x and y coordinates ([x1,y1,x2,y2,...]).A simple triangle would be declared as:triangle=[[50,50,100,0,0,0]]Complex polygons (holes and/or disjoints) follow the even-odd rule.draw_polygondraw_polygon(mask: array[:, :], paths: path[]) -> array[:, :]fromupolygonimportdraw_polygonimportnumpyasnpmask=np.zeros((100,100),dtype=np.int32)draw_polygon(mask,[[50,50,100,0,0,0]],1)Equivalent of callingcv2.fillPoly(mask, [np.array([[50,50], [100,0], [0,0]])], 1)orcv2.drawContours(mask, [np.array([[50,50], [100,0], [0,0]])], -1, 1, cv2.FILLED)when using opencv.uPolygon is ~ 6 times faster than opencv for large random polygons with many intersecting lines.
For smaller polygons or few intersections, uPolygon is half as fast as opencv.find_contoursfind_contours(mask: array[:, :]) -> (array[:, :], path[:], path[:])0 is treated as background, 1 is treated as foreground.fromupolygonimportfind_contoursimportnumpyasnpmask=np.array([[0,0,0,0,0],[0,1,1,1,0],[0,1,1,1,0],[0,1,1,1,0]],dtype=np.uint8)_labels,external_paths,internal_paths=find_contours(mask)Similar to OpenCV'scv2.findContoursbut lacking hierarchies. Also similar to BoofCV'sLinearContourLabelChang2004which is based on the samealgorithm.Note that currently the input mask to find_contour needs to be uint8.rle_encoderle_encode(mask: array[:,:]) -> listTakes a 2-dim binary mask and generates a run length encoding according to the coco specs~ 15 times faster than written in plain pythonDevelopmentThis is a Cython project and thus has some additional development dependencies to compile code into binaries, as well as extra steps to build/use the projectDependenciesgcc:Ubuntu/debian:sudo apt install build-essentialArch:yay -Sy base-develMac/OS:brew install gccCythonpip install CythonLocal TestingTo ensure building correctly, set the Cython environment variableexport USE_CYTHON=trueTo install and test locally, build with the following commandpython setup.py installwhich will locate the virtual environment activated, build and then install the local version to that python environment.
Alternatively,python setup.py build_ext --inplacewill build and install to the working directory for importing from local.Each change to the code needs to be rebuilt before it can be used.Interactive debuggingTODO
Package: uppaal-py
uppaal-pyPython library for reading, writing, analyzing, and modifying UPPAAL timed automata files. Works with Python >= 3.8.Disclaimeruppaal-py is a work-in-progress library. For bugs, missing features or documentation please create an issue or send me an email. API is subject to change.DependencieslxmlNetworkXortoolsInstallationVia pip:pip install uppaal-pyLicenseMITFeaturesReading and writing UPPAAL files.LP based path realizability analysis.Finding set of furthest reachable locations with respect to a set of target (unsafe) locations.Working with variables of typeintand a subset of expressions involvingintsfor guards, invariants, and updates during transitions allowed in UPPAAL in addition to clocks during computations.TODO:Methods for calling UPPAAL/verifyta.Migrate tolibutapfor parsing files.Parameter synthesis for safety property.lxml type annotationsand type annotations for the remaining functions.Auto-generated documentation.Non-featuresAnalysis involving network of TA — product of two or more TA can be implemented in the future, though.Symbolic model checking, UPPAAL does that.
Package: up-paraspace
Integration of Paraspace with the Unified Planning LibraryThe aim of this project is to make theParaspaceplanning engine available
in theunified_planning libraryby theAIPlan4EU project.  Paraspace is a
simple, flexible and extensible solver for timeline-based planning problems
using Z3 and a novel abstraction refinement algorithm.InstallationInstalling from PyPi is recommended because pre-built packages of Paraspace's
Python integration are available for Windows and Linux.pip install unified-planning up-paraspaceUsagefrom unified_planning.shortcuts import *
import up_paraspace

problem = Problem('myproblem')
# specify the problem (e.g. fluents, initial state, actions, goal)
...

planner = OneshotPlanner(name="paraspace")
result = planner.solve(problem)
print(result)Building/publishingThis section is intended for package maintainers.Up-paraspace is a pure Python package that does not need to build any native
code.  Thepyparaspacepackage that it depends on has a more involved build
process. Building and publishing is done withhatch. Run:hatch publish
Package: uppy
Command-line updater for all project dependencies.uppy is a command-line tool that updates all of your project dependencies.
Handles dependencies frompackage.jsonGitHub actionspre-commitUsage with example output:uppy /path/to/project.pre-commit-config.yaml:

  https://github.com/charliermarsh/ruff-pre-commit   v0.0.231   ❯   v0.0.265
  https://github.com/psf/black                       22.12.0    ❯   23.3.0
  https://github.com/pre-commit/mirrors-prettier     v2.7.0     ❯   v2.7.1

.github/workflows/tests.yml:

  actions/checkout                     v3
  pre-commit/action                    v3.0.0
  actions/checkout                     v3
  actions/setup-python                 v4
  actions/setup-python                 v4
  nschloe/action-cached-lfs-checkout   v1

.github/workflows/release.yml:

  nschloe/action-cached-lfs-checkout     v1
  actions/setup-python                   v4
  pypa/gh-action-pypi-publish            release/v1
  actions/checkout                       v3
  actions/setup-python                   v4
  JamesIves/github-pages-deploy-action   v4
  actions/checkout                       v3
  JamesIves/github-pages-deploy-action   v4

Update? [Y/n]InstallationInstall uppyfrom PyPIwithpip install uppyHow to get a licenseLicenses for personal and academic use can be purchasedhere.
You'll receive a confirmation email with a license key.
Install the key withplm add <your-license-key>on your machine and you're good to go.For commerical use, please contactsupport@mondaytech.com.
Package: uprate
A fully typed, simple ratelimit library.AboutUprate is a robust, simple ratelimit library.While providing a simple to use api, it is also highly scalable
and provides absolute control for fine-tuning.Hence, Uprate
can be used in all stages of your app from prototyping to production! 🚀Hereis a simple example.Why?There are two ways ratelimits are implemented in python for server-sideMake everything from scratchUse a framework dependent ratelimit library.The problem in the first way is obvious, it's harder, consumes more time.Using a framework dependent ratelimit library is more feasible, but often
these libraries don't provide features like external stores, multiple ratelimits
and manual key specification. While there are some awesome ratelimit libraries for
framwork X, not everyone uses framework X 😕.Ratelimits in client-sided coded also face similar problems. Often APIs enforce multiple
ratelimits. Making a ratelimiter from scratch for your API wrapper
or a small scale data collector takes up valuable dev time, which is why uprate aims to also
provide tools for client-sided code.DocumentationThe documentation can be found athttps://uprate.readthedocs.io/en/latest/Getting StartedInstallationYou can install the latest stable version from pypi bypip install uprateoryou can install the dev version from githubpip install git+https://github.com/WizzyGeek/uprate.git@master#egg=uprateUsageimport uprateAnd you are good to go! 🤘ExampleHere is a simple example that demonstrates Uprate's Awesomeness.importuprate@uprate.ratelimit(1/(uprate.Seconds(2)+uprate.Minutes(1)))deflimited():...limited()try:# Within 62 secondslimited()exceptuprate.RateLimitError:print("called function too fast")Andso much more!Thanks to@someonetookmycodefor the graphical assets© WizzyGeek 2021
Package: upref
upref 🐸Upref is a small python module to grab and save some user data like login, password, url (mainly string data). After some projects, I want a simple method to find the right login and url from the user and save it in the personnal data of the user.InstallationInstalling upref with pip:$ pip install uprefBasic UsageHere is the first example. The code fetch the URL from the user parameterimport upref

user_data = upref.get_pref(
    {"url": {"label": "The application url"}},
    "example01")

print("URL is {}".format(user_data['url']))This code create a file in the user folder. And this file will be read again during the next run.url:
  label: The application url
  value: http://www.test.org/Code exampleimport upref
data = upref.get_pref(
    {
        'login': {'label': "Your login"},
        'passwd': {'label': "Your secret password",
                'type': "Password"},
    },
    name="example02")
print("Your login is %s" % data['login'])
print("Your password (not so secret) is %s" % data['passwd'])At the first execution, there is a window to grab the data. The second execution, there will be no windows, the data are only read from the file.All data are saved in a yaml file at %APPDATA%/.upref/example02.conf or ~/.local/share/.upref/example02.conf.login:
  label: Your login
  value: My login
passwd:
  label: Your secret password
  value: PasswordFeaturesRead and save small amount of data (url, login, )Small gui to ask data from the userText option is avaibleLicenseThe upref is licensed under the terms of the MIT license and is available for free.MIT © Florent
Package: uprefix
The uprefix module provides an import hook for Python 3 which removes
‘u’ prefixes on Unicode literal strings in Python source code.It is intended to assist users when porting Python 2.x code to 3.x.There’s no separate documentation - all you need is given below.Requirements & InstallationThe uprefix module requires Python 3.1 or greater, and can be
installed with the standard Python installation procedure:python setup.py installThere is a set of unit tests which you can invoke withpython setup.py testbefore running the installation.UsageOnce installed on the path, the import hook is invoked as follows:>>> import uprefix
>>> uprefix.register_hook()You can unregister the hook by>>> uprefix.unregister_hook()The latest version of uprefix can be found athttps://bitbucket.org/vinay.sajip/uprefix/
Package: uprime
uprimeA python implementation the u'-chart.The u'-chart is a control chart for attributes data that can handle large and variable sample sizes by counteracting overdispersion as described in the following paper: David B. Laney (2002) Improved Control Charts for Attributes, Quality Engineering, 14:4, 531-537, DOI: 10.1081/QEN-120003555.The u'-chart is used to evaluate an attribute statistic over a period of time to determine whether or not the variation in the statistic can be explained by random variation alone.This module includes customizable options that facilitates its use as an alerting system.Author: Robert AstelTL;DR: Implementation of u'-prime control chart rules that can be used for creating alerts on statistics with high/variable sample sizes.Get StartedInstallpip install uprimeUsagefromuprimeimportUprime# Four required arguments:# 1. Pandas Dataframe# 2. Name of the column by which the data can be chronologically sorted# 3. Name of the column that contains the number of occurrences of the attribute of interest#    The number of occurrences should always be an integer.  Non-integer values will be rounded.# 4. Name of the column that contains the size of the subgroup (A.K.A. sample)#    The subgroup size should always be an integer.  Non-integer values will be rounded.up=Uprime(df,'sort_column_name','occurrences_column_name','subgroup_size_column_name')# Perform u'-chart calculations# Return a Pandas DataFrame that contains all necessary data to plot a u'-chart or trigger alertsup_df=up.frame()Examplesmethod = rolling, periods = 30This configuration performs u'-chart calculations using the previous rolling 30 periods for each subgroup.This is different from the defaultmethod = 'all', which uses all subgroups in the DataFrame df to perform the calculations`.up=Uprime(df,'sort_column_name','occurrences_column_name','subgroup_size_column_name',method='rolling',periods=30)Moreexamples, including usage of other optional arguments and built in charting function.ContributingRead ourCONTRIBUTING.mdto learn about our development process.Licenseuprime is licensed under theApache License 2.0
Package: uproot3
uproot (originally μproot, for “micro-Python ROOT”) is a reader and a writer of theROOT file formatusing only Python and Numpy. Unlike the standard C++ ROOT implementation, uproot is only an I/O library, primarily intended to stream data into machine learning libraries in Python. Unlike PyROOT and root_numpy, uproot does not depend on C++ ROOT. Instead, it uses Numpy to cast blocks of data from the ROOT file as Numpy arrays.Python does not necessarily mean slow. As long as the data blocks (“baskets”) are large, this “array at a time” approach can even be faster than “event at a time” C++. Below, the rate of reading data into arrays with uproot is shown to be faster than C++ ROOT (left) and root_numpy (right), as long as the baskets are tens of kilobytes or larger (for a variable number of muons per event in an ensemble of different physics samples; higher is better).uproot is not maintained by the ROOT project team, so post bug reports here asGitHub issues, not on a ROOT forum. Thanks!InstallationInstall uproot like any other Python package:pipinstalluproot3# maybe with sudo or --user, or in virtualenvThe pip installer automatically installs strict dependencies; the conda installer also installs optional dependencies (except for Pandas).Strict dependencies:numpy(1.13.1+)Awkward Array 0.xuproot3-methodscachetoolsOptional dependencies:lz4to read/write lz4-compressed ROOT filesxxhashto read/write lz4-compressed ROOT fileslzmato read/write lzma-compressed ROOT files in Python 2xrootdto access remote files through XRootDrequeststo access remote files through HTTPpandasto fill Pandas DataFrames instead of Numpy arraysReminder: you do not need C++ ROOT to run uproot.TutorialSee theproject homepagefor atutorial.Runthat tutorialon Binder.Tutorial contents:IntroductionWhat is Uproot?Exploring a fileCompressed objects in ROOT filesExploring a TTreeSome terminologyReading arrays from a TTreeCaching dataAutomatically managed cachesCaching at all levels of abstractionLazy arraysLazy array of many filesLazy arrays with cachingLazy arrays as lightweight skimsLazy arrays in DaskIterationFilenames and entry numbers while iteratingLimiting the number of entries to be readControlling lazy chunk and iteration step sizesCaching and iterationChanging the output container typeFilling Pandas DataFramesSelecting and interpreting branchesTBranch interpretationsReading data into a preexisting arrayPassing many new interpretations in one callMultiple values per event: fixed size arraysMultiple values per event: leaf-listsMultiple values per event: jagged arraysJagged array performanceSpecial physics objects: Lorentz vectorsVariable-width values: stringsArbitrary objects in TTreesDoubly nested jagged arrays (i.e. std::vector<std::vector<T>>)Parallel array readingHistograms, TProfiles, TGraphs, and othersCreating and writing data to ROOT filesWriting histogramsWriting TTrees
Package: uproot3-methods
This package is typically used as a dependency foruproot 3.x, to define methods on the classes that are automatically generated from ROOT files. This includes histograms (TH*) and physics objects like TLorentzVectors. The reason it’s a separate library is so that we can add physics-specific functionality on a shorter timescale than we can update Uproot 3 itself, which is purely an I/O package.Occasionally, this library is used without Uproot 3, as a way to make arrays of TLorentzVectors.Note:this package is incompatible withawkward>=1.0anduproot>=4.0! For Lorentz vectors, usevector. Since the versions of Awkward Array and Uproot that this is compatible with are deprecated,this library is deprecatedas well.InstallationInstall uproot3-methods like any other Python package:pipinstalluproot3-methods# maybe with sudo or --user, or in virtualenvDependencies:numpy(1.13.1+)Awkward Array 0.x
Package: uproot-methods
This package is typically used as a dependency foruproot, to define methods on the classes that are automatically generated from ROOT files. This includes histograms (TH*) and physics objects like TLorentzVectors. The reason it’s a separate library is so that we can add physics-specific functionality on a shorter timescale than we can update uproot itself, which is purely an I/O package.Occasionally, this library is used without uproot, as a way to make arrays of TLorentzVectors.InstallationInstall uproot-methods like any other Python package:pipinstalluproot-methods# maybe with sudo or --user, or in virtualenvor install withconda:condaconfig--addchannelsconda-forge# if you haven't added conda-forge alreadycondainstalluproot-methodsBoth installers automatically install the dependencies.Dependencies:numpy(1.13.1+)awkward-array(0.11.0+)
Package: uproot-tree-utils
uproot_tree_utilsA small collection of utilities for handling ROOT TTrees with uproot.UsageThere are two functions currently in the package. The first isclone_tree:clone_tree(tree,new_filename,new_treename=None,branches=None,selection=None,new_branches=None)The required argumentstreeandnew_filenameare the TTree object to copy from (as retrieved by uproot) and the file to copy to, respectively. The simplest usage looks likeimportuprootfromuproot_tree_utilsimportclone_treefile=uproot.open('some_root_file.root')clone_tree(file['the_treename'],'a_new_filename.root')This will simply copy the entire tree from the original file to a new file (with no other objects).new_treenamecan be used to give the new tree a different name. The default is the original tree's name.branchescan be a list of strings representing the branches to copy. Only the selected branches will be in the new file.selectionis an optional array determining which events to copy. This can be a boolean mask or integers corresponding to the desired event indices.new_branchesallows the user to pass a dictionary of new branches to insert into the tree. The format for the dictionary should be{'new_branchname': array_with_branch_data}.The other function available iswrite_tree:write_tree(branches,filename,treename)This function will create a new tree entirely composed of arrays passed to it.branchesis a dictionary with items of the form'branchname': array_with_branch_datafilenameis the name of a new file to put the tree intreenameis the name of the new treeLimitationsNot all branch types can be written by uproot.Currently supported branch types:Char_t/charShort_t/shortInt_t/intFloat_t/floatDouble_t/doubleLong64_t/long longBool_t/boolstd::vector<short>std::vector<int>std::vector<float>std::vector<double>Character strings, unsigned integers,vector<char>, andvector<bool>are not yet supported. There are also some known bugs withvector<long>andvector<long long>. Further nesting of vectors (e.g.vector<vector<int> >) is not supported by uproot's tree writing.
Package: uproxy
uproxyA perfect python based proxy server with both IPV6/IPV4 supportQuick startpip install uproxypython -m uproxy.UProxyconfig your proxy client with server:8000Why I love uproxy more even it’s a little slow than othersDNS configure is not always allowed, but proxy is most of time!Https is auto supported because HTTP CONNECT is supportedSafe from DNS cache poisoningEasy to deploy on gateway to just serve for lan clientQuick Config a server just server for lanpip install uproxy?Create a start script in some place(like ~/bin/start_uproxy), like#!/bin/bashpython-muproxy-b[lanaddresslike192.168.1.1or127.0.0.1]Auto run by cron after reboot (create job by crontab -e),@reboot /sbin/start-stop-daemon -S -x ~/bin/start_uproxy -bLan client config http proxy by [lan address like 192.168.1.1]:[port num like 8000]Combine with ssh port forwardssh -L 8000:127.0.0.1:8000remoter_user@remotehostRelease Workflowpython setup.py sdistpython -m twine upload dist/*ref:https://blog.jetbrains.com/pycharm/2017/05/how-to-publish-your-package-on-pypi/https://packaging.python.org/guides/migrating-to-pypi-org/Welcome to contributeAny pull request is welcome.Love My Software:https://www.paypal.me/medlab:)