Saravanan666/pypi-org huggingface dataset:
Package: loctraceback
loctracebackWant to see more precisely where you are or were at in a traceback or
callstack your Python code has several places in a line it could have
errored? Even if the code was something created at runtime with sayevalorexecor if there was no source code that can be found?Then this package is for you.Some examples of the kinds of code this module can disambiguate:i/j/k# which divide?prev[prev[0]]# which prev ?[e[0]foriind[j]ifgot[i]==e[i]]# lots going on hereexec(some_code%10,namespace)# code at runtimeSome example output given by running code inexample:Division example:Traceback(mostrecentcalllast):File"tb-div.py",line9,in<module>atoffset52a/b/ca/b/c-ZeroDivisionError:floatdivisionbyzeroList comprehension example:File"tb-comp.py",line9,in<listcomp>atoffset18[e[0]foriind[j]ifgot[i]==e[i]]return[e[0]foriin.0ifgot[i]==e[i]]------IndexError:listindexoutofrangeexecexample:Traceback(mostrecentcalllast):File"tb-exec.py",line11,in<module>atoffset39exec(s)exec(s)-------File"<string>",line4,in<module>atoffset18z=x/y-ZeroDivisionError:divisionbyzeroIsolating function in call stack example:File"call-fib.py",line8,infibatoffset58returnfib(n-1)+fib(n-2)returnfib(n-1)+fib(n-2)----------File"call-fib.py",line10,in<module>atoffset54print("fib({})={}".format(2,fib(2)))------This modules extends the Python 3.6 API traceback module by adding in
fragment decomplation info for more precise location information.Although the API is from Python 3.6, the code runs on 3.3 or greater.
Back-porting to ther Python versions is left as an exercise to the
reader.Seethese slidesfor
information on the technology behind this.
Package: locuaz
Looping Uniquely Catered Amino Acid SequencesFree software: MIT licenseDocumentation:https://locuaz.readthedocs.io.InstallCreate a conda environment YAML file named, for example,usr_deps.yaml:name: locuaz
channels:
  - conda-forge
dependencies:
  - conda-forge::python>=3.10
  - conda-forge::ambertools>=22.0.0
  - conda-forge::tensorflow
  - conda-forge::openbabel
  - conda-forge::pygraphvizby running:mamba env create -f usr_deps.yamlThen, activate the environment and install the protocol through pip:pip install locuazCheck theInstallationsection on the docs for more info.Post-InstallUsing DLPacker based mutatorsIf you wish to usedDLPackerbasedMutators(dlpanddlpr), DLPacker weights have to be downloaded.
Get themhereorhere. These weights have to be extracted to a dedicated folder and its path has to be specified in the
input config under thepathskey, on themutatoroption. Check thedocsfor more info.CitingCreditsBiobbMDAnalysisFreeSASAMIT LicenseCopyright (c) [2023] [Patricio Barletta]Permission 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: locuplot
LocuplotLocuplot is a python application to generate graph based on locust statistics reporting.UsageInstallLocuplot is available on pypi registry, you can:pipinstalllocuplotUsageThere is a help commandlocuplot -hTo use this project, there is 3 arguments to give.locuplot -d example\stats -p sample -e distArguments list:-d | --directory => Specify the folder where the locust stats are.-p | --prefix    => The prefix you gave to locust for generated stats-e | --export    => The export directory you want png and html generated files (default to./dist)Local setupMake sure to installpoetryfirst. Then, make apoetry installin the project
root directory.To execute locuplot locally, use this commands:poetryrunlocuplot-dexample\stats-psampleFor further information you can display the helper like this:poetryrunlocuplot-hCommandsThese custom commands are launched via poetry and an awesome plugin namedtaskipy. Go check out this project !Non exhaustive custom commands:CommandDescriptionpoetry run task locustRun sample locust testpoetry run task jupyterLaunch jupyter notebook with example statistics
Package: locus
locusIn what followspythonis an alias forpython3.6orpypy3.6or any later version (python3.7,pypy3.7and so on).InstallationInstall the latestpip&setuptoolspackages versionspython-mpipinstall--upgradepipsetuptoolsUserDownload and install the latest stable version fromPyPIrepositorypython-mpipinstall--upgradelocusDeveloperDownload the latest version fromGitHubrepositorygitclonehttps://github.com/lycantropos/locus.gitcdlocusInstall dependenciespython-mpipinstall-rrequirements.txtInstallpythonsetup.pyinstallUsage>>>fromground.baseimportget_context>>>context=get_context()>>>Box,Point,Segment=context.box_cls,context.point_cls,context.segment_cls>>>fromlocusimportkd>>>points=list(map(Point,range(-10,11),range(0,20)))>>>kd_tree=kd.Tree(points)>>>kd_tree.nearest_index(Point(0,0))==5True>>>kd_tree.nearest_point(Point(0,0))==Point(-5,5)True>>>kd_tree.n_nearest_indices(2,Point(0,0))==[6,5]True>>>kd_tree.n_nearest_points(2,Point(0,0))==[Point(-4,6),Point(-5,5)]True>>>kd_tree.find_box_indices(Box(-1,1,0,10))==[9,10]True>>>kd_tree.find_box_points(Box(-1,1,0,10))==[Point(-1,9),Point(0,10)]True>>>fromlocusimportr>>>boxes=list(map(Box,range(-10,11),range(0,20),range(-20,0),range(-10,11)))>>>r_tree=r.Tree(boxes)>>>r_tree.nearest_index(Point(0,0))==10True>>>r_tree.nearest_box(Point(0,0))==Box(0,10,-10,0)True>>>r_tree.n_nearest_indices(2,Point(0,0))==[10,11]True>>>r_tree.n_nearest_boxes(2,Point(0,0))==[Box(0,10,-10,0),Box(1,11,-9,1)]True>>>r_tree.find_subsets_indices(Box(0,10,-10,10))==[10]True>>>r_tree.find_subsets(Box(0,10,-10,10))==[Box(0,10,-10,0)]True>>>r_tree.find_supersets_indices(Box(0,10,-10,0))==[10]True>>>r_tree.find_supersets(Box(0,10,-10,0))==[Box(0,10,-10,0)]TrueDevelopmentBumping versionPreparationInstallbump2version.Pre-releaseChoose which version number category to bump followingsemver
specification.Test bumping versionbump2version--dry-run--verbose$CATEGORYwhere$CATEGORYis the target version number category name, possible
values arepatch/minor/major.Bump versionbump2version--verbose$CATEGORYThis will set version tomajor.minor.patch-alpha.ReleaseTest bumping versionbump2version--dry-run--verbosereleaseBump versionbump2version--verbosereleaseThis will set version tomajor.minor.patch.Running testsInstall dependenciespython-mpipinstall-rrequirements-tests.txtPlainpytestInsideDockercontainer:withCPythondocker-compose--filedocker-compose.cpython.ymlupwithPyPydocker-compose--filedocker-compose.pypy.ymlupBashscript:withCPython./run-tests.shor./run-tests.shcpythonwithPyPy./run-tests.shpypyPowerShellscript:withCPython.\run-tests.ps1or.\run-tests.ps1cpythonwithPyPy.\run-tests.ps1pypy
Package: locuscomplexity
Economic ComplexityThis package is the implementation of the Economic Complexity and FitnessSeehttps://locusanalytics.github.io/EconCmplx/for full documentation.Getting StartedInstallationThe package can be downloaded and installed using pip.pip install locuscomplexityYou will then be able to import the package in your Python scripts.import locuscomplexity as lcYou can also import specific parts of the package.import locuscomplexity.complexity as lcmplx
import locuscomplexity.fitness as lfitPrerequisitesThis package is coded in Python 3.
Using pip install, all Python libraries required to use it should be automatically installed on your machine.How to use the Locus Economic Complexity packageInput dataThe input data needs to follow a specific format. the module requires a Dataframe that contains two dimensions. For example, the first dimension can be the area codes, such as County Fips codes, the second can be 4x6 Locus Functions or Functional markers for which we know the employment level for a year.
The following table could be an input if we want to compute the complexity of counties based on the distribution of employment by 4x6 Locus Functions.Fips codes1 A2 A3 A...4 E4 F10011207542788456741100345674128453692365185715945634584563257Using the original OEC algorithmIf we note df our input Dataframe, we can compute the complexity scores of both the counties and the Locus functions directly using the complexity_indices function. The first argument is the input Dataframe, the second is the name of the column that contains the first dimension.area_complexity, functions_complexity = locuscomplexity.complexity.complexity_indices(
            df, 'Fips codes')Using the Fitness algorithmUsing the fitness algorithm the matrix m needs to be computed separately. We can then compute area fitness scores and functional complexity using the fitness and complexity functions. The arguments are the same as in the previous method.m = locuscomplexity.complexity.build_m(df_data, 'Fips codes')
area_fitness = locuscomplexity.fitness.fitness(m, 'Fips codes')
functions_complexity = locuscomplexity.fitness.complexity(m)OutputBoth methods return the complexity scores for the first and second dimension. We standardized the output for both methods.The complexity (or fitness) scores for the first dimension are returned in a two column Dataframe.fFips codes2.110011.510030.4551857The output for complexity scores on the second dimension has a similar structure.indexq1 A1.61 B3.44 F0.7DocumentationPlease read theTechnical Brieffor details on the project.AuthorsVinharng ChewOlivia DalglishEmeline Floc'hAaron Lee
Package: locusdb
LocusLocus is a local, simple, append-only, in-memory vector database based on hnswlib.InstallationpipinstalllocusdbExample CodeSome example code to illustrate Locus' functionality.importnumpyasnpfromlocusdbimportConfig,Vector,Index# create a new configurationconfig=Config(max_elements=1000,ef_construction=200,M=16,dim=128,space="cosine",storage_location="index.db")# create a new index instanceindex=Index(dimensions=config.dim,config=config)# create some random vectorsvectors=[]foriinrange(10):embedding=np.random.randn(config.dim)data={"id":i,"message":f"test message{i}"}vector=Vector(embedding=embedding,data=data)vectors.append(vector)# add the vectors to the indexforvectorinvectors:index.add_vector(vector)# retrieve the closest vectors to a query embeddingquery_embedding=np.random.randn(config.dim)results=index.retrieve(query_embedding,number_of_results=3)print(f"Matches:{results}")print(f"Items in index:{index.count}")# store the index on diskindex._store_on_disk()# load the index from disknew_index=Index.from_file(config.storage_location)
Package: locust_csv2openmetrics
AboutConsole app and Python API for convertinglocust’s load test CSV formatted
reports into theOpenMetricstext format.To use this tool effectively please setup your locust load tests tostore test
statistics in CSV format, which will then generate a number of files:{CSV_PREFIX}_stats.csv,{CSV_PREFIX}_stats_history.csv,{CSV_PREFIX}_failures.csvand{CSV_PREFIX}_exceptions.csv. Out of the
files above, locust_csv2openmetrics is meant to work with only the{CSV_PREFIX}_stats.csvfile.InstallationTo install locust_csv2openmetrics run:$ pip install locust_csv2openmetricsConsole app usageQuick start:$ locust_csv2openmetrics <filename>Show help:$ locust_csv2openmetrics --helpPython API usageQuick start:>>> import locust_csv2openmetrics as lom

>>> collector = lom.collect_locust_stats("examples/locust_stats.csv")
>>> lom.write_openmetrics_to_textfile("./metrics.txt", lom.REGISTRY)ContributeIf you find any bugs, or wish to propose new featuresplease let us know.If you’d like to contribute, simply forkthe repository, commit your changes
and send a pull/merge request.Development processBefore you start you’ll need Make, Python and Poetry.This project doesn’t require system wide installation, simply clone the
repository and initialize its development runtime environment to get started:$ git clone git@gitlab.com:360dialog/open-source/locust_csv2openmetrics.git
$ cd locust_csv2openmetrics
$ poetry install --with dev --syncIf you do not wish to install Make, Python or Poetry on your system you can use
the dockerized version of this project instead, by replacing all of yourmakecalls, such as:$ poetry run make [quiet=1] [PYTHONWARNINGS=all] [TARGET] ...with:$ ./dockerized.sh [quiet=1] [PYTHONWARNINGS=all] [TARGET] ...Show help:$ poetry run make help

# dockerized version:
$ ./dockerized.sh help

Usage: make [quiet=1] [PYTHONWARNINGS=all] [TARGET] ...

Targets:
  help                                  Display this help message
  test.unit                             Run the unit tests
  test.one                              Run only a specific unit test (module, module.TestCase or module.TestCase.test_method)
  test                                  Run the entire test suite (unit tests, coverage, ...)Run the test suite,pleasedo this often during development:$ poetry run make quiet=1 PYTHONWARNINGS=all test

# dockerized version:
$ ./dockerized.sh quiet=1 PYTHONWARNINGS=all testRelease processThis project’s release process is currently manual in its nature and attempts
to mimic Django’s release process, as described in:https://docs.djangoproject.com/en/4.2/internals/release-process/https://docs.djangoproject.com/en/4.2/internals/git/Its Python packages are hosted on PyPI, and this is how to build+publish its
Python package on a new release:$ poetry publish --build
Package: locust-fixed-interval
locust_fixed_intervalAboutA Locust TaskSet that sends requests at a constant rate (with a fixed time
interval). Based onLocust issue
#646.The instance 'interval' attribute defines the time interval between successive
requests per user in seconds (default 1.0). This value must be greater than
the average HTTP request roundtrip time.  For example, if your request takes
1.9 seconds to get to the server and back, and the execution of your code and
the Locust framework code additionally requires 0.1 second between requests,
you should set 'interval' to a value over 2.0 seconds. If you need a higher
request rate, increase the number of simulated users.Example usageclassMyTaskSet(FixedIntervalTaskSet):defsetup(self):self.interval=2.5@taskdeftask1(self):#...classMyLocust(HttpLocust):task_set=MyTaskSet
Package: locust-graphql-client
GraphQL Client for LocustLocust is a python performance test library. Locust supports http client out of the box.
This library provides the GraphQL Client for Locust.This GraphQL Client is based on Prisma's Simple GraphQL Client for Python (https://github.com/prisma/python-graphql-client)APIclassGraphQLClient:defexecute(self,label,query,variables=None,type='graphql'):####Argumentstype = Locust Request Type. Default value is 'graphql'label = Locust Namequery = GraphQL Queryvariables = GraphQL Variables. Default value is NoneUsagefromlocustimportHttpLocust,TaskSet,taskfromlocustgraphqlclientimportGraphQLLocustclassUserBehavior(TaskSet):defon_start(self):""" on_start is called when a Locust start before any task is scheduled """self.login()defon_stop(self):""" on_stop is called when the TaskSet is stopping """self.logout()deflogin(self):query='''mutation login($username: String!, $password: String!) {login(username: $username, password: $password) {access_token}}'''variables={'username':'gm','password':'centric8'}result=self.client.execute("login",query,variables)# Inject the Access Token in the Client, so subsequent requests can be madeself.client.inject_token(result['data']['login']['access_token'])deflogout(self):# Reset the Access Token in the Client, so no subsequent requests can be madeself.client.inject_token('')@task(2)defindex(self):query='''query products {products {idnameimage}}'''result=self.client.execute("products",query)@task(1)defprofile(self):query='''query me {me {idusernamefirstNamelastName}}'''result=self.client.execute("me",query)classWebsiteUser(GraphQLLocust):task_set=UserBehaviormin_wait=5000max_wait=9000
Package: locust-influx
locust_influxSend information aboutlocustrequests
toInfluxDBand follow the progress throughGrafanacharts.Test and taste it locallyStart an InfluxDB container locally:docker run -d --name influxdb -d -p 8086:8086 influxdbStart a Grafana container locally:docker run -d --name grafana -d -p 3000:3000 grafana/grafanaCrete a newpython virtual environmentand installlocust_influx:pip install locust_influxRun the example locustfile contained in this repo (Change the host to point to desired one):locust -f ./locustfile.py --no-web --clients 10 --hatch-rate 1 --run-time 60s --host http://localhost:8080Open your local Grafana in the browser athttp://localhost:3000/Import the example dashboard fromlocust_dashboard.jsonfile.
Package: locust-influxdb-listener
locust-influxdb-listenerPackage that uses locust 'event' hooks to push locust related events to an influxDB database.PrerequisitesThis package requires locustIO v1.5.0 or greater.InstallationInstall using your favorite package installer:pipinstalllocust-influxdb-listener# oreasy_installlocust-influxdb-listenerUsageImport the library and use theevent.inithook to register the listener....fromlocust_influxdb_listenerimportInfluxDBListener,InfluxDBSettings@events.init.add_listenerdefon_locust_init(environment,**_kwargs):"""Hook event that enables starting an influxdb connection"""# this settings matches the given docker-compose fileinfluxDBSettings=InfluxDBSettings(host='localhost',port='8086',user='admin',pwd='pass',database='test-project'# optional global tags to be added to each metric sent to influxdbadditional_tags={'environment':'test','some_other_tag':'tag_value',})# start listerner with the given configurationInfluxDBListener(env=environment,influxDbSettings=influxDBSettings)...ExampleYou can find a working example under theexamples folderInfluxDB with GrafanaWe have included a working exampledocker-compose.ymlfile that can be used to spin a reporting setup in case you don't have one.(Make sure you havedockeranddocker-composeinstalled and just run:docker-composeupConfigurationOnce grafana is running (by default on port: 3000)https://localhost:3000, you need to:Connect to influxdb as the datasource:Host:https://influxdb:8086User: adminPassword: passImport a new dashboard. We have provided a custom dashboard for youlocust-grafana-dashboard.jsonthat just works out of the box with the locust-events that the listener will emmit.
Package: locust-je-test-pep621
LocustLocust is an easy to use, scriptable and scalable performance testing tool. You define the behaviour of your users in regular Python code, instead of being constrained by a UI or domain specific language that only pretends to be real code. This makes Locust infinitely expandable and very developer friendly.To get started right away, head over to thedocumentation.FeaturesWrite user test scenarios in plain old PythonIf you want your users to loop, perform some conditional behaviour or do some calculations, you just use the regular programming constructs provided by Python. Locust runs every user inside its own greenlet (a lightweight process/coroutine). This enables you to write your tests like normal (blocking) Python code instead of having to use callbacks or some other mechanism. Because your scenarios are “just python” you can use your regular IDE, and version control your tests as regular code (as opposed to some other tools that use XML or binary formats)fromlocustimportHttpUser,task,betweenclassQuickstartUser(HttpUser):wait_time=between(1,2)defon_start(self):self.client.post("/login",json={"username":"foo","password":"bar"})@taskdefhello_world(self):self.client.get("/hello")self.client.get("/world")@task(3)defview_item(self):foritem_idinrange(10):self.client.get(f"/item?id={item_id}",name="/item")Distributed & Scalable - supports hundreds of thousands of usersLocust makes it easy to run load tests distributed over multiple machines. It is event-based (usinggevent), which makes it possible for a single process to handle many thousands concurrent users. While there may be other tools that are capable of doing more requests per second on a given hardware, the low overhead of each Locust user makes it very suitable for testing highly concurrent workloads.Web-based UILocust has a user friendly web interface that shows the progress of your test in real-time. You can even change the load while the test is running. It can also be run without the UI, making it easy to use for CI/CD testing.Can test any systemEven though Locust primarily works with web sites/services, it can be used to test almost any system or protocol. Justwrite a clientfor what you want to test, orexplore some created by the community.HackableLocust's code base is intentionally kept small and doesn't solve everything out of the box. Instead, we try to make it easy to adapt to any situation you may come across, using regular Python code. There is nothing stopping you from:Send real time reporting data to TimescaleDB and visualize it in GrafanaWrap calls to handle the peculiarities of your REST APIUse a totally custom load shape/profile...LinksWebsite:locust.ioDocumentation:docs.locust.ioSupport/Questions:StackOverflowCode/issues:GitHubChat/discussion:locustio.slackAuthorsCarl Byström(@cgbystromon Twitter)Jonatan Heyman(@jonatanheymanon Twitter)Joakim Hamrén(@Jahaajaon Twitter)Hugo Heyman(@hugoheymanon Twitter)Lars HolmbergLicenseOpen source licensed under the MIT license (seeLICENSEfile for details).