Saravanan666/pypi-org huggingface dataset:
Package: extern
ExternExtern is an opinionated version of Python'ssubprocess, making it just that
little bit more convenient to run shell commands from within Python code. Extern
is Python-3 only, and is no longer compatible with Python-2, as of version
0.4.0.It is reasonably straightforward:>>> import extern
>>> extern.run("echo it works") #=> returns 'it works\n'
>>> extern.run("echo 1 2 5 |cat") #=> returns '1 2 5\n'When a command that fails is run e.g.>>> extern.run("cat /not_a_file")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/extern/__init__.py", line 29, in run
extern.ExternCalledProcessError: Command cat /not_a_file returned non-zero exit status 1.
STDERR was: cat: /not_a_file: No such file or directory
STDOUT was:an exception is raised just likesubprocess. However, the error message
generated includes STDERR and STDOUT, which is more convenient for debugging. For reference, thesubprocessequivalent:>>> subprocess.check_output(['bash','-c','cat /not_a_file'])
cat: /not_a_file: No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['bash', '-c', 'cat /not_a_file']' returned non-zero exit status 1The useful thing is thatExterncollects STDERR and only reports it when there is a non-zero exit status, discarding it otherwise.IMPORTANT: use of this library with untrusted strings presents a security risk in the same way aslittle bobby tables, andshell=Trueinsubprocess.###Multiple commands run simultaneously>>> extern.run_many(['echo once','echo twice','echo thrice'])
#=> ['once\n', 'twice\n', 'thrice\n']Progress can also be observed:>>> extern.run_many(['echo once','echo twice','echo thrice'], progress_stream=sys.stderr)
Finished processing 3 of 3 (100.00%) items.
#=> ['once\n', 'twice\n', 'thrice\n']STDINcan be provided torun():extern.run('cat',stdin='dog') #=> 'dog'###Which
There is also awhichfunction, useful for determing where (and if) a program
exists on the command line:>>> import extern
>>> extern.which('cat') #=> '/bin/cat'
>>> extern.which('dog') #=> NoneInstallationYou can also install it directly from the Python Package Index with this command:sudo pip install externLicenceSee file LICENCE.txt in this folderContributeExtern is an open-source software. Everyone is welcome to contribute !
Package: external
Run tasks on external processes to overcome Python's global interpreter lock.Inspired bygoogle-research/batch-ppoExternalProcessInstallationpipinstallexternalUsageimportexternal@externalclassCounter():def__init__(self,count=0):self.count=countdefincrement(self):self.count+=1withCounter(count=1)asc:assertc.count.get()==1c.increment()assertc.count.get()==2try:c.decrement()exceptAttributeErrorase:print(e)# 'Counter' object has no attribute 'decrement'assertc.count.get()==2
Package: external-arrow
EXTERNAL ARROWThis repository is an example for registering external plugins with kwiver and diva wheelREQUIREMENTSlibgl1-mesa-devlibexpat1-devlibgtk2.0-devliblapack-devlibpython3-devkwiverdiva-frameworkINSTALLATIONEXTERNAL ARROWpip install external-arrowVERIFYING REGISTRATIONplugin_explorer --algo image_object_detector

Plugins that implement type "image_object_detector"
---------------------
Info on algorithm type "image_object_detector" implementation "TestObjectDetector"
  Plugin name: TestObjectDetector
        Test to verify if a python algorithm can be registered externally
---------------------
Info on algorithm type "image_object_detector" implementation "external_arrow.arrow.test_object_detector"
  Plugin name: external_arrow.arrow.test_object_detector
        Version: 1.0
        Test to verify if a cpp algorithm can be registered externall
---------------------
Info on algorithm type "image_object_detector" implementation "create_detection_grid"
  Plugin name: create_detection_grid
	    Create a grid of detections across the input image.
---------------------
Info on algorithm type "image_object_detector" implementation "example_detector"
  Plugin name: example_detector
	    Simple example detector that just creates a user-specified bounding box.
---------------------
Info on algorithm type "image_object_detector" implementation "hough_circle"
  Plugin name: hough_circle
        Hough circle detector
---------------------
Info on algorithm type "image_object_detector" implementation "detect_heat_map"
  Plugin name: detect_heat_map
	    OCV implementation to create detections from heatmapsTestObjectDetectorandexternal_arrow.arrow.test_object_detectorare python and c++ arrows registered by external_arrowREGISTERING ARROW/PROCESSES FROM EXTERNAL PACKAGEKwiver uses entrypoints to register vital arrows and sprokit processes.LanguageEntrypointC++kwiver.cpp_search_pathspythonkwiver.python_plugin_registrationPYTHON ARROW/PROCESSThe python process and arrows are registered usingkwiver.python_plugin_registrationin setup.py. Every process and arrows in the external package must be registered individually by specifying a unique key-value pair associated with the entrypoint . For example'kwiver.python_plugin_registration':
[ 'simple_detector=external_arrow.arrow.test_object_detector']whereexternal_arrow.arrow.test_object_detectoris python arrow containing__vital_algorithm_register__C++ ARROW/PROCESSThe c++ process and arrows are registered usingkwiver.cpp_search_pathsin setup.py.  For registering c++ libraries, kwiver requires absolute path to the directory where the c++ libraries are present in the package. For example'kwiver.cpp_search_paths':
['simple_detector=external_arrow.register_cpp_arrow:get_cpp_path']whereexternal_arrow.register_cpp_arrow:get_cpp_pathis a python function that returns the directory where c++ libraries forexternal_arroware present in the package.Note: Kwiver wheel does not provide the development environment for c++ extension that depend on kwiver. A c++vital arrowandsprokit processbased extension would be built against the static build offletchandkwiver.
Package: external-counter-dilshan
Python API for USB external display moduleThis Python API is designed to work with USB based external display module
available inhere.
This library works with Python 3.6 or newer versions and it supports many
operating systems, including Linux, Windows, and Mac.Python API library uses the serial communication channel established by
the display module for communication. To use this library display module
must be in "API mode".This package also has a configuration utility which is useful to
configure some parameters of the display unit such as idle mode message,
system time, etc.The complete documentation of this API is available atGitHub Wiki.
Package: external-data-structures
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.
Description:Keywords: dictionary,dicts,s3,redis,sets
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=2.7
Package: externaldns-solidserver
External DNS driver for EfficientIP SolidServerThis project allow you to register VM port or floating IP in an EfficientIP SolidServer IPAM usingNeutron DNS integration with an external serviceInstallationVia pip :pipinstallexternaldns-solidserverConfigurationAdd following lines to neutron.conf :[solidserver]url=http://solidserver_url/rest/space=solidserver_spaceuser=solidserver_userpassword=soliserver_password[default]external_dns_driver=solidserverRestartneutron_server. Check use cases onNeutron documentation.
Package: external-github-contributors
External GitHub contributorsThis is a simple script to get a list of external contributors that authored commits on a
GitHub-hosted project within a range defined by two given Git references.InstallThis project can be installed viapip:pip install external-github-contributorsInstall from sourceThis project usesPoetryto manage its dependencies. Poetry
needs to be installed in order to be able to follow the installation and usage
instructions.Clone the repository and install the dependencies:git clone https://github.com/babolivier/external-github-contributors.git
cd external-github-contributors
poetry installUsageIf you have installed this project usingpip, runpython -m external_github_contributors.If you have installed this project from source, in your local checkout of this repository,
runpoetry run external_github_contributors [args].A complete synopsis is available below:usage: external_github_contributors [-h] --team TEAM --repo REPO [--token TOKEN] [--md] oldest_ref most_recent_ref

Simple script to list external contributors to a project who authored contributions between two specific references.

positional arguments:
  oldest_ref       The oldest of the two refs to compare.
  most_recent_ref  The most recent of the two refs to compare.

options:
  -h, --help       show this help message and exit
  --team TEAM      The team listing internal contributors to exclude. In the format ORG_NAME/teams/TEAM_SLUG.
  --repo REPO      The repository to list contributors of. In the format ORG_NAME/REPO_NAME.
  --token TOKEN    The GitHub access token to use when making request to the API. Must have the read:org scope.
                   If not provided as a command-line argument, must be in the GITHUB_TOKEN environment variable.
  --md             If provided, prints the contributors as markdown links. The text for the link is the user's
                   display name (e.g. full name) as configured in their GitHub profile. This option requires an
                   additional API call for each contributor, and therefore introduces additional delay.As an example, here's a run of the script to get the list of external contributors that
committed to thematrix-org/synapserepository
between Synapse 1.68 and Synapse 1.69:python -m external_github_contributors --team=matrix-org/teams/core-team --repo=matrix-org/synapse v1.68.0 v1.69.0
10 external contributors found after looking at 114 commits:
- ...In this example, the GitHub access token is stored in the environment.ContributePlease report bugs as issues on this repository, although fixing them will be done on a
best-effort basis. Pull requests are welcome.
Package: external-logging-handlers
Async handlers to throw logs to telegram and discord via Telegram Bot
API and Discord WebhookNote!These handlers are asynchronous, so theorder of the logs is not guaranteed!Usage:Specify these environment variables:TELEGRAM_CHANNEL_ID- telegram user of channel idTELEGRAM_TOKEN- token, that you can obtain from BotFatherSERVER_NAME- Machine name (useful, if you want to receive logs
from different machines)DISCORD_WEBHOOK_URL- Webhook url for discordSpecial discord parametersOpen Discord
docsSENDER_NAMEREGULAR_MESSAGE_TEXTEMBEDS_TITLEYou also can configure handlers directlyfromcustom_handlers.logging_handlersimportDiscordHandler,TelegramHandlerimportloggingfromloggingimportFormatterlogger=logging.getLogger(__name__)logger.setLevel("DEBUG")handler=TelegramHandler(token="ABCD",channel_id="1234567890",formatter=Formatter("%(asctime)s- "))handler.setLevel("DEBUG")logger.addHandler(handler)d_handler=DiscordHandler(sender_name="Again testing",regular_message_text="regular message",embeds_title="Embedded title",)d_handler.setLevel("DEBUG")logger.addHandler(d_handler)logger.error("Error log message")logger.info("Info log message")logger.debug("Debug log message")logger.warning("Warning log message")logger.critical("Critical log message")
Package: external-proc
external_proc python moduleExternal process memory managerInstallationEnsure you have at least Python 3.6+pip install external_proc
or
pip install git+Usage examplesMore examples in 'tests' directoryOpen/Close processfromexternal_procimport*p=ExtProcess.open(PROCESS_NAMEorPROCESS_ID)p.close()### or ###withExtProcess.ctx_open(PROCESS_NAMEorPROCESS_ID)asp:passRead/Write valueswithExtProcess.ctx_open(process_name)asp:# writep.write.list_bytes(address,[0x90,0x90])p.write.bytes(address,b'\x90\x90')p.write.str(address,'string')p.write.wstr(address,'unicode string')p.write.uint8(address,1)p.write.uint16(address,1)p.write.uint32(address,1)p.write.uint64(address,1)p.write.int8(address,-1)p.write.int16(address,-1)p.write.int32(address,-1)p.write.int64(address,-1)p.write.float(address,0.01)p.write.double(address,0.01)# readv=p.read.list_bytes(address,BYTES_COUNT)v=p.read.bytes(address,BYTES_COUNT)v=p.read.str(address,MAX_BYTES_COUNT)# read string to first \x00v=p.read.wstr(address,MAX_BYTES_COUNT)# read string to first \x00v=p.read.uint8(address)# signed 1 byte valuev=p.read.uint16(address)# signed 2 byte valuev=p.read.uint32(address)# signed 4 byte valuev=p.read.uint64(address)# signed 8 byte valuev=p.read.int8(address)# unsigned 1 byte valuev=p.read.int16(address)# unsigned 2 byte valuev=p.read.int32(address)# unsigned 4 byte valuev=p.read.int64(address)# unsigned 8 byte valuev=p.read.float(address)# 4 bytev=p.read.double(address)# 8 bytePointers# Pointer types:#   ListBytes#   Bytes#   Str#   Wstr#   Uint8#   Uint16#   Uint32#   Uint64#   Int8#   Int16#   Int32#   Int64#   Float#   Double#   Invalidptr=p.make_ptr(address,PtrType.Int32)address=ptr.get_address()# return current addressptr.set_value(333)value=ptr.get_value()# get address from multilevel pointersptr=p.make_ptr(0x6426E0,core.PtrType.Uint32)\.go_ptr(0xC)\.go_ptr(0x14)\.go_ptr()\.go_ptr(0x18)# PtrTypes: ListBytes, Bytes, Str, Wstr#   require additional argument#   for get_value(BYTES_COUNT or MAX_BYTES_COUNT for strings)Simple dll injector x32/x64withExtProcess.ctx_open(process_name)asp:dll_path=os.path.abspath('lib.dll')loadlib_func=get_proc_address('kernel32','LoadLibraryA',x64=p.is_x64_process())param=p.alloc()p.write.str(param,dll_path)withp.ctx_create_thread(loadlib,param,wait_thread=True)asth_id:passSignature scanner. IDA Styleexe_module=p.get_module()client_module=p.get_module('client.dll')# .text:00428873 8D 4D F0          lea ecx, [ebp+var_10]# .text:00428876 E8 05 4E FE FF    call 0x40D680# E8 ? ? ? ? - it's instruction call 0x40D680signature="8D 4D F0 E8 ? ? ? ?"# equal: find_pattern(signature) + 3sig_in_all_module:Ptr=client_module.find_pattern(signature,add_offset=3)sig_in_code_section:Ptr=client_module.section('.text').find_pattern(signature,3)# for read relative offset from call instruction you can simple do thisadr=sig_in_code_section.go_call_ptr().get_address()# same for jmp, je and etc inctructions: .go_jmp_ptr(), .go_jmp_short_ptr()
Package: external-requests
External RequestsA class based alternative to making HTTP requests in Python.InstallationInstallation can be done with pip:pip install external-requestsBasic UsageIn order to use external requests, you must implement one of the abstract classes provided by the package, create an
instance of your new class, and call the request function.fromtypingimportListfromexternal_requests.base_requests.external_requestimportExternalRequestfromexternal_requests.request_methodsimportRequestMethodsclassExampleRequest(ExternalRequest):@propertydef_base_url(self)->str:return'http://some-url.com'@propertydef_route(self)->str:return'/my-route'@propertydef_request_method(self)->RequestMethods:returnRequestMethods.GET@propertydef_expected_status_codes(self)->List[int]:return[200]ExampleRequest().request()Want to avoid duplication between similar requests? You can replace the ExternalRequest base class with one of
the alternative, request-specific classes which implement both the request method and expected status code properties.
There is a request-specific class for all seven primary HTTP request methods: GET, POST, PUT, PATCH, DELETE, HEAD
and OPTIONS.Working With ParametersParameters can be injected into the request when creating an instance of it. This is done using kwargs which are saved
on the object in theinitfunction by default. It is recommended that you also state the parameters on the
class for readability, although this is not required.fromexternal_requests.method_requests.get_requestimportGetRequestclassExampleRequest(GetRequest):route_param:str@propertydef_base_url(self)->str:return'http://some-url.com'@propertydef_route(self)->str:returnf'/my-route/{self.route_param}'ExampleRequest(route_param='value').request()Requests With BodiesIn order to both simplify and create standardization in requests with bodies, the SerializationSchema class
(based on marshmallow) is available. In order to use it, simply create an instance of your needed schema, inherit from
SerializationSchema, and return an instance of your schema in your request's _body_schema property.frommarshmallowimportfieldsfromexternal_requests.method_requests.post_requestimportPostRequestfromexternal_requests.serialization_schemaimportSerializationSchemaclassExampleSchema(SerializationSchema):name=fields.Str(data_key='name')other_attribute=fields.Str(data_key='otherAttribute')classExampleRequest(PostRequest):name:strother_attribute:str@propertydef_body_schema(self)->SerializationSchema:returnExampleSchema(name=self.name,other_attribute=self.other_attribute)@propertydef_base_url(self)->str:return'http://some-url.com'@propertydef_route(self)->str:return'/my-route'ExampleRequest(name='name',other_attribute='other').request()The project's code can be found herehttps://gitlab.com/VenfiOranai/external-requests
Package: external-user-local
External User Local Python PackageThe External User Local Python Package is a library designed to manage access tokens for external users. It provides functions to insert, update, retrieve, and delete access tokens from a database. This library is intended to be used in conjunction with your own project.Installation-pip install external-user-local 0.0.25
-add to requirements.txt external-user-local== 0.0.25Importing the Libraryfrom library import library_DB import Accsess_Token_LibraryUsage Example: assuming system_id=1Initialize the access token libraryall methods are static, no initialize requiredInsert a new access tokenExternalUser.insert_or_update_external_user_access_token("example_user", 123,1, "example_token","example_expiry","example refresh")
notice! refresh and expiry arent a mandatoryUpdate an existing access tokenExternalUser.update_user_external(123, "updated_token")Retrieve an access token by profile IDaccess_token = ExternalUser.get_access_token_by_profile_id(123)Retrieve an access token by user nameaccess_token = ExternalUser.get_access_token_by_user_name("example_user",1)Delete an access token by profile IDExternalUser.delete_access_token_by_profile_id(123)Update an existing access token by usernameExternalUser.update_user_external_by_user_name("example_user",1, "new_token")
Package: external-variables
A simple python module to help to handle with ENV variables and files with paramters ( .env, .config, .properties ...)Installingpip install external-variablesUsagefrom envpy import get_variables

get_variables(readFile:bool=True, requiredFile:bool=False, readOS:bool=True, filepath:str=f'{os.getcwd()}', filename:str='.env', prefix:str='')The methodget_variableswill read the variables from a 'enviroment file' and/or 'enviroment vars' from host system.The normal behaivior is the method will try to read a 'console current path .env file' if exist and after will check on host if had any enviroment variable with the same name and overide de file value.Can be change if a enviroment file is or not required. If required will raise a error if the file was not found.If the readFile or readOS is False the method will ignore the override step.Also the values can be filter by the use of prefix.
Package: externc
ExternC - Embedding C code in pythonExampleimportexternc# ExternC modifies builtins, so no `externc.` necessaryfn=c("""// remember to properly escape backslashes!printf("Hello from C\\n");Py_RETURN_NONE;""")fn()# "Hello from C"Benchmarkc.py:importexterncc(r"""for(inti=0;i<1000000000;i++){if(i%(2<<16)==0){printf("%d\n",i);}}Py_RETURN_NONE;""")()python.py:foriinrange(1000000000):if(i%(2<<16)==0):print(i)$timepythonc.py
...

real0m2.615s
user0m1.593s
sys0m0.518s$timepythonpython.py
...

real3m25.695s
user3m25.423s
sys0m0.194sThe difference is quite obviousUse casesUse ExternCfor interfacing with C APIsfor working with raw pointersfor working with capsuleswhen speed is more important than stabilityDo notuse ExternCwhen your code must be version independentwhen your code must be stable (exception: you have used C a lot before)when your code must be distributablewhen your code must run anywhere but the PC you wrote and tested it onin productionTechnicalitiesThe C function is registered asMETH_VARARGS | METH_KEYWORDS.
It is of signaturePyObject* (PyObject*, PyObject*, PyObject),
which is known in the Python extension environment asPyCFunctionWithKeywords.
The arguments have the namesself,argsandkwargs, while
the function is namedfuncand the generated moduleexternc_#where#is a hexadecimal number that is incremented by one with
every call tocwithout an explicit module name.
The function name and the module name
can be modified by passing thefuncnameandnamekeyword arguments toc, respectively.funcnameis also used as the
name of the function to be exported from the module.The default compiler used isclangwith a few default
options. Thecompilerssubmodule can be used to configureclangwith feature flags, linked files and additional include directories or
define another compiler, which can be passed tocvia thecompilerargument.