Saravanan666/pypi-org huggingface dataset:
Package: parsys-requests-unixsocket
Userequeststo talk HTTP via a UNIX domain socketUsageExplicitYou can use it by instantiating a specialSessionobject:importjsonimportrequests_unixsocketsession=requests_unixsocket.Session()r=session.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info')registry_config=r.json()['RegistryConfig']print(json.dumps(registry_config,indent=4))Implicit (monkeypatching)Monkeypatching allows you to use the functionality in this module, while making
minimal changes to your code. Note that in the above example we had to
instantiate a specialrequests_unixsocket.Sessionobject and call thegetmethod on that object. Callingrequests.get(url)(the easiest way
to use requests and probably very common), would not work. But we can make it
work by doing monkeypatching.You can monkeypatch globally:importrequests_unixsocketrequests_unixsocket.monkeypatch()r=requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info')assertr.status_code==200or you can do it temporarily using a context manager:importrequests_unixsocketwithrequests_unixsocket.monkeypatch():r=requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info')assertr.status_code==200Abstract namespace socketsTo connect to anabstract namespace
socket(Linux only), prefix the name with a NULL byte (i.e.:0) - e.g.:importrequests_unixsocketsession=requests_unixsocket.Session()res=session.get('http+unix://\0test_socket/get')print(res.text)For an example program that illustrates this, seeexamples/abstract_namespace.pyin the git repo. Since abstract namespace
sockets are specific to Linux, the program will only work on Linux.See alsohttps://github.com/httpie/httpie-unixsocket- a plugin forHTTPiethat allows you to interact with UNIX domain sockets
Package: partcad
partcadPartCAD is the first package manager for CAD files.
This python module is the core part of PartCAD.This module can be used in python scripts to instantiate parts,
assemblies and scenes implemented as PartCAD packages.
Such instances can be used inCadQueryandbuild123dscripts.
They can also be used in custom web, mobile and desktop applications
that are rendering CAD models.For command line PartCAD tools, see the Python modulepartcad-cliinstead.Seethe main PartCAD repofor more information.
Package: partd
Key-value byte store with appendable valuesPartd stores key-value pairs.
Values are raw bytes.
We append on old values.Partd excels at shuffling operations.OperationsPartD has two main operations,appendandget.ExampleCreate a Partd backed by a directory:>>> import partd
>>> p = partd.File('/path/to/new/dataset/')Append key-byte pairs to dataset:>>> p.append({'x': b'Hello ', 'y': b'123'})
>>> p.append({'x': b'world!', 'y': b'456'})Get bytes associated to keys:>>> p.get('x')         # One key
b'Hello world!'

>>> p.get(['y', 'x'])  # List of keys
[b'123456', b'Hello world!']Destroy partd dataset:>>> p.drop()That’s it.ImplementationsWe can back a partd by an in-memory dictionary:>>> p = Dict()For larger amounts of data or to share data between processes we back a partd
by a directory of files.  This uses file-based locks for consistency.:>>> p = File('/path/to/dataset/')However this can fail for many small writes.  In these cases you may wish to buffer one partd with another, keeping a fixed maximum of data in the buffering partd.  This writes the larger elements of the first partd to the second partd when space runs low:>>> p = Buffer(Dict(), File(), available_memory=2e9)  # 2GB memory bufferYou might also want to have many distributed process write to a single partd
consistently.  This can be done with a serverServer Process:>>> p = Buffer(Dict(), File(), available_memory=2e9)  # 2GB memory buffer
>>> s = Server(p, address='ipc://server')Worker processes:>>> p = Client('ipc://server')  # Client machine talks to remote serverEncodings and CompressionOnce we can robustly and efficiently append bytes to a partd we consider
compression and encodings.  This is generally available with theEncodepartd, which accepts three functions, one to apply on bytes as they are
written, one to apply to bytes as they are read, and one to join bytestreams.
Common configurations already exist for common data and compression formats.We may wish to compress and decompress data transparently as we interact with a
partd.  Objects likeBZ2,Blosc,ZLibandSnappyexist and take
another partd as an argument.:>>> p = File(...)
>>> p = ZLib(p)These work exactly as before, the (de)compression happens automatically.Common data formats like Python lists, numpy arrays, and pandas
dataframes are also supported out of the box.:>>> p = File(...)
>>> p = NumPy(p)
>>> p.append({'x': np.array([...])})This lets us forget about bytes and think instead in our normal data types.CompositionIn principle we want to compose all of these choices togetherWrite policy:Dict,File,Buffer,ClientEncoding:Pickle,Numpy,Pandas, …Compression:Blosc,Snappy, …Partd objects compose by nesting.  Here we make a partd that writes pickle
encoded BZ2 compressed bytes directly to disk:>>> p = Pickle(BZ2(File('foo')))We could construct more complex systems that include compression,
serialization, buffering, and remote access.:>>> server = Server(Buffer(Dict(), File(), available_memory=2e0))

>>> client = Pickle(Snappy(Client(server.address)))
>>> client.append({'x': [1, 2, 3]})
Package: partftpy
this is a fork oftftpywithcopyparty-specific changesavailableon pypi99% of the code here is copyright 2010-2021, Michael P. Soulier (msoulier@digitaltorque.ca)significant changesfrom tftpy import TftpServer=>from partftpy.TftpServer import TftpServer4e873925to make it possible to monkeypatch stuff insideTftpServer, for example swapping out theosmodule with a virtual filesystem, which copyparty doescrude alternative tofknittel's proper VFSbut copyparty was already doing this for impacket so for my purposes it's finesupports specifying a portrange to use for data transfer instead of selecting an ephemeral portb8844c03good for firewallssupport IPv6 by merging#98 (Add ipv6 support for server and client)b3e3c39asupport utf-8 filenames73d12fc0spec says netascii but many clients do this instead, including curlyolo fix for#140 (crash on small packets)79ac8460other changesless info logsb7e71855restored python 2.7 supportc0d19ada
Package: parth
ParthHeuristic Vulnerable Parameter ScannerIntroductionSome HTTP parameter names are more commonly associated with one functionality than the others. For example, the parameter?url=usually contains URLs as the value and hence often falls victim to file inclusion, open redirect and SSRF attacks. Parth can go through your burp history, a list of URLs or it's own discovered URLs to find such parameter names and the risks commonly associated with them. Parth is designed to aid web security testing by helping in prioritization of components for testing.UsageImport targets from a fileThis option works for all 3 supported import types: Burp Suite history, newline delimited text file or a HTTP request text file.parth -i example.historyImport targets from stdincat urls | parthAn exclusive option--pipeis available when importing targets from stdin. It can be used to output URLs vulnerable to a specific vulnerabily.cat urls | parth --pipe xssSupported Issues:lfi, ssrf, sqli, xss, open_redirect, rceFind URLs for a domainThis option will make use of CommonCrawl, Open Threat Exchange and Waybackmachine to find URLs of the target domain.parth -t example.comIgnore duplicate parameter namesSame parameter names across all URLs are ignored.parth -ut example.comSave parameter namesThis option will write all the parameter names found in a file with nameparams-{target}.txtfor later use.parth -pt example.comJSON OutputThe following command will save the result as a JSON object in the specified file.parth -t example.com -o example.jsonCreditsThe database of parameter names and the risks associated with them is mainly created from the public work of various people of the community such as@Jhaddix.
Package: partharjun
partharjun LibraryDarkWeb Userbot PyrogramDisclaimer️                       ⚠️ WARNING FOR YOU ️ ️⚠️
   partharjun is used to help your account activities on Telegram
   We are not responsible for what you misuse in this repository
   !  Be careful when using this repository!
   If one of the members misuses this repository, we are forced to ban you
   Never ever abuse this repositoryInstallingpip3 install partharjunExample [EVAL]frompartharjun.carbonimportmake_carbonwrite="i'am Arjunarth"carbon=awaitmake_carbon(write)awaitc.send_photo(m.chat.id,carbon)
Package: parthial
NOT YET SUITABLE FOR PUBLIC USEParthialParthial is a simple Python implementation of a generic Lisp interpreter. It is
intended for use in user-scriptable server-side applications such as IRC bots.FeaturesSafe evaluationEvaluation puts (configurably) strict limitations on recursion depth, number of
allocated values, and number of steps taken. Thesetbuilt-in cannot mutate
parent scopes (so closures are immutable), and every other language feature
available in the package is purely functional.Simple APILisp values are represented by directly analogous Python objects;(a b c)is justLispList([LispSymbol('a'),LispSymbol('b'),LispSymbol('c')]).
It’s easy to define new built-ins, too:# part of the default_globals scope
# suppresses evaluation of its arguments (quotes them)
@built_in(default_globals, 'if', quotes=True)
def lisp_if(self, ctx, cond, i, t):
    cond = ctx.eval(cond)
    if cond:
        return ctx.eval(i)
    else:
        return ctx.eval(t)SerializationPyYAML serializers and deserializers are provided for all Lisp value types, as
well as for definition environments (built-ins are serialized by name, so a
global scope must be supplied at deserialization). Allocation limitations are
kept track of across serializtion, so it’s safe and easy to give users a
persistent mutable environment.ShortcomingsNo optimizationsParthial is not a general-purpose interpreter.There is no compilation or
optimization. It probably shouldn’t be used to run any program that wouldn’t be
appropriate, performance-wise, to implement as a shell script.No code reviews (yet)Nobody other than the original author has looked the code yet. For now, it’d be
unwise to actually expose an interpreter to the Internet at large, in case of
security holes.No[t much] documentation (so far)Working on it…No tests (for now)The warning at the top is there for a reason.
Package: parthsql
parthsqlA mini SQL query engine written in PythonFree software: ISC licenseDocumentation:https://parthsql.readthedocs.org.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History1.0.0 (2016-02-02)Completed project. The repo is deemed completed and development is stalled.0.1.0 (2015-12-13)First release on PyPI.
Package: partial-apply
Partial application of functions and method names, supporting placeholder values for positional arguments.Unlikefunctools.partial(), placeholder values are supported so that positional arguments for partial application do not need to be supplied solely from left to right. Keyword arguments are handled equivalently tofunctools.partial(). It is also possible to “partially apply” a method name, producing a function which looks up the method to call on the object supplied as its first argument.Dependencies:Python 2.7 or 3.4+.Installation:$ pip installpartial-applyDocumentation:Sphinx generated API documentation is available in thedocssubdirectory of this repository and is also published onGitHub Pages.ExamplesAn example of placeholder use:frompartial_applyimportEmpty,PartialFn,PartialMethodisint=PartialFn(isinstance,Empty,int)This makes a functionisint()that takes one positional argument and returnsTrueif it is anintandFalseotherwise. That is, callingisint(1)is equivalent to callingisinstance(1, int). The supplied positional arguments fill inEmptyplaceholder slots from left to right before reverting tofunctools.partial()-style appending.An example ofPartialMethoduse:count_true=PartialMethod('count',True)count_true((False,True))# returns 1count_true([False,True])# returns 1This makes a functioncount_true()that counts the number ofTruevalues in a sequence. It looks up the sequence methodcounton the first argument and calls it with the single argumentTrue. The calls shown are equivalent to(False,True).count(True)and[False,True].count(True). Sincecount_true()only stores the method name and not the method itself, it works on any type with acount()method.LikePartialFn,PartialMethodsupports placeholder positional arguments andfunctools.partial()-like keyword arguments.
Package: partialCopy
partialCopyA tool to copy big data to multiple smaller disksMotivationAs the storage becomes larger in big projects, we need to a tool to break large folders (100 TBs) to smaller chunks, so we can migrate to another location or storing it on tapes.How does it work?The tool finds the best placement for the files and it creates a files list in --save-to directory which can be passed rsync using--files-fromparameter.Installationsudo pip install partialCopyUsageusage: pcp.py [-h] [--dest DEST | --dest-size DEST_SIZE] [-s SAVE_TO] [-f]
              [-n] [-ma MODIFIED_AFTER] [-fp FIND_PARAMS]
              src

positional arguments:
  src                   Source Directory

optional arguments:
  -h, --help            show this help message and exit
  --dest DEST           Destionation mountpoint
  --dest-size DEST_SIZE
                        Destination size, given in bytes or using 1 letter
                        unit B,K,M,G,T,P
  -s SAVE_TO, --save-to SAVE_TO
                        Where to save rsync list,default
                        '$src/pcp_rsync_list/'
  -f, --force           Rewrite all lists again
  -n, --new             Find New Files
  -ma MODIFIED_AFTER, --modified-after MODIFIED_AFTER
                        Find files modified after certain time (YYYY-mm-dd)
  -fp FIND_PARAMS, --find-params FIND_PARAMS
                        Parameters to find commandChangesAllowing to provide size rather than mount point.Finds only new files using-nparameter.Finds files modified after a certain date using-maparameter.Allows rewriting all lists using-fflag.ContributorsZeeshan Ali Shah
Package: partialdispatch
partialdispatchThis repository, which is to publish a python packages, is under development and currently undocumented.If you're interested in it, please get in touch, but but be aware this is very much "building in (semi)-public", until a proper documented version is up.DrawbacksCurrently only works on hash equalityThe argumentliteral=Truemust be passed when:Value is callableValue is a typeValue is None
Package: partialhash
Library to partialy hash files.Installationpip install partialhashUsage# from examples/usage.pyimportbinasciiimportpartialhashpath="examples/random.data"# sha256 hash of full filedigest=partialhash.compute(path)# file path or file like objectprint(binascii.hexlify(digest))# sha256 hash of first 1024 bytesdigest=partialhash.compute(path,length=1024)print(binascii.hexlify(digest))# sha256 hash, skipping the first 512 bytesdigest=partialhash.compute(path,offset=512)print(binascii.hexlify(digest))# sha256 hash of seed + file datadigest=partialhash.compute(path,seed=b'seeddata')print(binascii.hexlify(digest))# sha256 hash of 256 byte sample with given seed# which data is sampled depends on given seeddigest=partialhash.sample(path,256,seed=b'seeddata')print(binascii.hexlify(digest))# sha256 hash of three 256 byte samples with given seed# sample data will not overlap until sample size exceeds file sizedigest=partialhash.sample(path,256,sample_count=3,seed=b'seeddata')print(binascii.hexlify(digest))
Package: partialize
Python partial on steroidsLike pythonfunctools.partialbut with change/extend access to args and kwargs.
Also a great tool even if no partial is needed but the function takes args/kwargs that often depends on logic.Easiest used as a decoratorfrompartializeimportpartialize@partializedefdummy(a,b,c=None):return'hello world'partial_dummy=dummy.partial(1)partial_dummy.b=2partial_dummy(c=3)or invoked inline…partial_dummy=partialize(dummy)partial_dummy.a=1partial_dummy.update(b=2)partial_dummy()partial_dummy(c=3)Use it on functions that needs logic to affect arguments passed, instead of building and passing adictas kwargs
which often gets quite messy and hard to read.Dict kwargs example:frompartializeimportpartialize@partializedefsearch_products(site,query=None,brand=None,tags=None):passkwargs={}iflogic:kwargs['query']=qifmore_logic:kwargs['brand']='brand name'products=search_products(site,**kwargs)Partialize example:search=search_products.partial(site)iflogic:search.query=qifmore_logic:search.brand='brand name'products=search()Note:function argument names are validated when set, unlike dict string keys.
Package: partialjson
PartialJsonParse Partial and incomplete JSON in pythonParse Partial and incomplete JSON in python with just 3 lines of python code.Examplefrompartialjson.json_parserimportJSONParserparser=JSONParser()incomplete_json='{"name": "John", "age": 30, "is_student": false, "courses": ["Math", "Science"'print(parser.parse(incomplete_json))# {'name': 'John', 'age': 30, 'is_student': False, 'courses': ['Math', 'Science']}Installation$pipinstallpartialjsonAlso can be found onpypiHow can I use it?Install the package by pip package manager.After installing, you can use it and call the library.Star HistoryIssuesFeel free to submit issues and enhancement requests or contact me viavida.page/nima.ContributingPlease refer to each project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.Forkthe repo on GitHubClonethe project to your own machineUpdate the Versioninsideinit.pyCommitchanges to your own branchPushyour work back up to your forkSubmit aPull requestso that we can review your changes
Package: partial-readonly
partial readonlypartial_readonlyprovide a decorator for conveniently making some fields read-only in dataclass. No dependencies other than the Python Standard Library.UsageQuick StartWithpartail_readonly, we can easily make some of the fields indataclassread-only by creating property related to them.(Notice: We still can't make the origin field read-only, cause it still need to be set while calling__init__)For example, the following codefromdataclassesimportdataclass@dataclassclassData:id:int=0name:str=''@propertydeffull_name(self):returnself.namecan be written like this by usingpartial_readonlyfromdataclassesimportdataclass@dataclassclassData:id:int=0_name:'str alias=full_name'=''DetailsMark a field read-only by adding an underline prefix_id: intmeansidis read-onlyBy default, the relative property named like field without underline prefix_id: intwill generate a property namedidUse string annotation and addalias=alias_you_wantat the end, and you'll have a property namedalias_you_want_id: 'int alias=security_idwill generate a property namedsecurity_idInstallationTo installpartial_readonly, simply usepip:pip install partial_readonlyOr useeasy_install:easy_install partial_readonlyDeep downMaking property read-only by set a getter[ and ban a setter]Using AST to build a getter for new propertyThe idea about abusing annotation comes fromzmitchell/annotation-abuseWhy partial_readonlyLastest python offer us dataclass for creating some class in convenient way.But it's not convenient when we want not all the fields be readonly.RequirementsPython >= 3.7PostscriptI built this for practicing AST and publish.I think it work fine.There are some more easily implementation.If you sharing some idea about this feature I'll be greatful!LicenseMIT License

Copyright (c) 2018 book987

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: partial-s3-to-es
Partial Restore from S3 logs to ElasticsearchRestore selected logs from S3 to ElasticsearchFree software: MIT licenseDocumentation:https://partial-s3-to-es.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-01-09)First release on PyPI.
Package: partial-sh
Partial-shExamplesExample single lineCommand:echo'{"name":"Jay Neal", "address": "42 Main St 94111"}'|pt-i"Split firstname and lastname"-i"remove the address"Output:{"first_name":"Jay","last_name":"Neal"}Example multi linesCreatedata.jsonlJSON Linesfile:cat<<EOF>data.jsonl{"name":"John Doe","date_of_birth":"1980-01-01","address":"123 Main St"}{"name":"Jane Smith","date_of_birth":"1990-02-15","address":"456 Main St"}{"name":"Jay Neal","date_of_birth":"1993-07-27","address":"42 Main St 94111"}{"name":"Lisa Ray","date_of_birth":"1985-03-03","address":"789 Elm St"}EOFTransform the data:catdata.jsonl|pt-i"Split firstname and lastname"-i"remove the address"Output:{"date_of_birth":"1980-01-01","first_name":"John","last_name":"Doe"}{"date_of_birth":"1990-02-15","first_name":"Jane","last_name":"Smith"}{"date_of_birth":"1993-07-27","first_name":"Jay","last_name":"Neal"}{"date_of_birth":"1985-03-03","first_name":"Lisa","last_name":"Ray"}
Package: partial-tagger
Sequence Tagger for Partially Annotated Dataset in PyTorchThis is a CRF tagger for partially annotated dataset in PyTorch. You can easily utilize
marginal log likelihood for CRF (Tsuboi, et al., 2008). The implementation of this library is based on Rush, 2020.UsageFirst, import some modules as follows.frompartial_tagger.crf.nnimportCRFfrompartial_tagger.crfimportfunctionalasFInitializeCRFby giving it the number of tags.num_tags=2crf=CRF(num_tags)Prepare incomplete tag sequence (partial annotation) and convert it to a tag bitmap.This tag bitmap represents the target value for CRF.# 0-1 indicates a true tag# -1 indicates that a tag is unknownincomplete_tags=torch.tensor([[0,1,0,1,-1,-1,-1,1,0,1]])tag_bitmap=F.to_tag_bitmap(incomplete_tags,num_tags=num_tags,partial_index=-1)Compute marginal log likelihood from logits.batch_size=1sequence_length=10# Dummy logitslogits=torch.randn(batch_size,sequence_length,num_tags)log_potentials=crf(logits)loss=F.marginal_log_likelihood(log_potentials,tag_bitmap).sum().neg()InstallationTo install this package:pipinstallpartial-taggerReferencesYuta Tsuboi, Hisashi Kashima, Shinsuke Mori, Hiroki Oda, and Yuji Matsumoto. 2008.Training Conditional Random Fields Using Incomplete Annotations. InProceedings of the 22nd International Conference on Computational Linguistics (Coling 2008), pages 897–904, Manchester, UK. Coling 2008 Organizing Committee.Alexander Rush. 2020.Torch-Struct: Deep Structured Prediction Library. InProceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 335–342, Online. Association for Computational Linguistics.