Saravanan666/pypi-org huggingface dataset:
Package: pylookfor
pylookforA lightweight module searching methods in the current python environment by keywords.Method - pylookfor.lookforpylookfor.lookfor(key: str, num_print=0, modules=[])Searching methods in the current python environment by keywords.Print modules, methods and the first line of their documents if any of them contain the keywords.Parameterskey: strThe keywords.num_print: int, optionalThe number of the methods that printed.
Default: 0 means no limit.modules: list, optionalSearch methods in these modules.
Default: [] means search all the modules.ExampleExample1Like 'lookfor' in Matlab, it can print modules, methods and the first line of their documents if any of them contain the keywords.importpylookforaslflf.lookfor('sort',num_print=5)Output:--------------------Modules----------------------
isort - Defines the public isort interface
isort._future - No Documentation Found.
isort.deprecated - No Documentation Found.
isort.stdlibs - No Documentation Found.
networkx.algorithms.assortativity - No Documentation Found.
networkx.algorithms.assortativity.tests - No Documentation Found.
sortedcollections - Python Sorted Collections
sortedcontainers - Sorted Containers -- Sorted List, Sorted Dict, Sorted Set
--------------------Methods----------------------
builtins.sorted - Return a new list containing all items from the iterable in ascending order.
anaconda_navigator.utils.sort_versions - Sort a list of version number strings.
cytoolz.sorted - Return a new list containing all items from the iterable in ascending order.
isort.check_file - Checks any imports within the provided file, returning `False` if any unsorted or
isort.check_stream - Checks any imports within the provided code stream, returning `False` if any unsorted orExample2It can search methods in specify modules.importpylookforaslflf.lookfor('sort',modules=['scipy‘,’numpy'],num_print=10)Output:--------------------Methods----------------------
scipy.argsort - scipy.argsort is deprecated and will be removed in SciPy 2.0.0, use numpy.argsort instead
scipy.lexsort - scipy.lexsort is deprecated and will be removed in SciPy 2.0.0, use numpy.lexsort instead
scipy.msort - scipy.msort is deprecated and will be removed in SciPy 2.0.0, use numpy.msort instead
scipy.searchsorted - scipy.searchsorted is deprecated and will be removed in SciPy 2.0.0, use numpy.searchsorted instead
scipy.sort - scipy.sort is deprecated and will be removed in SciPy 2.0.0, use numpy.sort instead
scipy.sort_complex - scipy.sort_complex is deprecated and will be removed in SciPy 2.0.0, use numpy.sort_complex instead
numpy.argsort - Returns the indices that would sort an array.
numpy.lexsort - lexsort(keys, axis=-1)
numpy.msort - Return a copy of an array sorted along the first axis.
numpy.searchsorted - Find indices where elements should be inserted to maintain order.
Package: py-look-for-timeouts
[![Build Status](https://travis-ci.org/uber/py-look-for-timeouts.png)](https://travis-ci.org/uber/py-look-for-timeouts)py_look_for_timeoutslooks for network calls without timeouts on them, using various heuristics. It knows and cares about urllib, httplib, twilio, and requests calls.For a similar program which looks for SQL injection vulnerabilities, look at [py-find-injection](https://github.com/uber/py-find-injection)
Package: py-lookingglass
Python looking glass wsgi implementationRequires:Python 2.6+Standard python modules:telnetlibossocketcgiwsgi_reftracebackrandomargparsejsonExternal:paramikoSetup:To run out of the box just clone the repo or install usingpip installpy-lookingglassoreasy_installpy-lookingglass, then:# python-mlg-hOr you can use it as WSGI callbacklg.lookingglass(name="LookingGlass",cmds={'profile':{'command_name','actualcommand'}},hosts=[('password','ip',int(port),int(connection_type),'name','profile')])Any additional hacks can be applied before init of classCheckhelp(lg.lookingglass)for more infoShould also install executable py-lookingglass
Package: pylookout
pyLookoutA simple Python program to check Linux system's
resource utilization and service availability.Currently it can:Check CPU, RAM and Disk spaceSend notifications via SendGrid and SimplepushPlanned functionality:Send notifications via Telegram, WhatsApp and IRC.Check container status.Report new active SSH sessions.Monitor logs to find suspicious activity.Run continuously as a service in the background.InstallationTo install the app, clone the repository and install with pip:gitclonehttps://github.com/Lab-Brat/pyLookout.gitcdpyLookout
python-mpipinstall.UsageTo send notifications pyLookout reads API keys from
the environment.SendGrid requires to specify sending and destination
email addresses, and also an API key:SENDGRID_TO
SENDGRID_FROM
SENDGRID_API_KEYSimplepush requires only the API key and sends notifications
to the app"SIMPLEPUSHTo run the program, first install it with pip.
It will create an executable in/home/$USER/.local/bin/,
(which should be in $PATH), and launch it:pylookoutIt will gather server metrics and send a notificationa
via preferred method if a certain total utilization percentage
is reached (75% by default).Add it to crontab to run on a schedule.
Package: pylookwhat
Sometimes when we need to reference other project’s settings to do something, we can use execfile to parse file get variable inside. But a few things can make it difficult:Dependency package(s) are not installedRelative module(s) not in sys.pathLocal module name confused due to scoping.Use pylookwhat to solve theseimport pylookwhat

what = {}
lookwhat = [ 'A', 'B'  ]
filename = 'what.py'
pylookwhat.lookwhat( filename, what, lookwhat  )

print whatwhat.pyA = { "Hello": "World" }
B = [ 1, 2, 3 ]PatchModify variables in script. Backup file will be named with datetime.python -m pylookwhat patch target.py source.py falsetarget.pyA="Hello"
B=123source.pyA = "Hello World"Patched target.pyA = "Hello World"
B=1231.0.3Fix missing text when patch with dict variables
Package: pylookyloo
PyLookylooThis is the client API forLookyloo.InstallationpipinstallpylookylooUsageCommand lineYou can use thelookyloocommand to enqueue a URL.usage:lookyloo[-h][--urlURL]--queryQUERY

EnqueueaURLonLookyloo.

optionalarguments:-h,--helpshowthishelpmessageandexit--urlURLURLoftheinstance(defaultstohttps://lookyloo.circl.lu/,thepublicinstance).--queryQUERYURLtoenqueue.--listingShouldthereportbepubliclylisted.--redirectsGetredirectsforagivencapture.

TheresponseisthepermanentURLwhereyoucanseetheresultofthecapture.LibrarySeeAPI Reference
Package: pylookyloomonitoring
Python client and module for Lookyloo MonitoringThere is no public monitoring instance for now, so you will need to
installyour own instance.InstallationpipinstallpylookyloomonitoringUsageCommand lineYou can use thelookyloo_monitor:usage:lookyloo_monitor[-h]--urlURL(--monitor_urlMONITOR_URL|--compareCOMPARE)TalktoaLookylooMonitoringinstance.

options:-h,--helpshowthishelpmessageandexit--urlURLURLoftheinstance.--monitor_urlMONITOR_URLURLtomonitor.Itwillbemoniteredhourly.--compareCOMPAREUUIDofthemonitoring.LibrarySeeAPI Reference
Package: pyloom
🧶 Pyloom🪡 A event sourcing framework for building large language model applications 🪡Pyloom is a framework designed to streamline the development of intricate LLM applications. Drawing inspiration fromevent sourcing, Pyloom applies this concept to the LLM agent development, offering a range of powerful features that enables better dev experience.Developing intricate and non-deterministic LLM agents involves making multiple LLM calls and intricate control structures, similar to constructing a Marble
Machine (🔮). If an error arises, developers are frequently compelled to rerun the entire agent workflow. Developers care not only the agent's final outcome but also the steps it takes to arrive there. At times, We want to see how tweaks like extra tools or adjusted prompts in-between can affect the final outcome.Pyloom is crafted to address these challenges.Features"Git for Agent":Pyloom tracks state changes and the evolution of the agent at each step.Agent Replay:With Pyloom, developers can replay and navigate through the agent's flow. Once encouter an error in the agent flow, you can fix the issue and restart from the exact point of failure.Event Sourcing:Pyloom employs event sourcing, representing agent actions as events. By replaying the event stream, the agent's state can be reconstructed. Furthermore, developer can apply the same event streams to different agents and compare performance.Reproduce Production Issues:Leveraging event sourcing, Pyloom facilitates the reproducing of production errors by replaying the identical event streams in development environment.Pyloom can be used with other LLM frameworks like langchain and guidance.InstallationYou can install Pyloom using pip:pipinstallpyloomQuick StarttutorialContributingWe are extremely open to contributions in various forms: bug fixes, new features, improved documentation, and pull requests. Your input is valuable to us!
Package: pyloopenergy
PyLoopEnergyThis provides a python API toLoop Energywho provide electricity and gas monitors.It uses their service to provide readings that are updated every 10 seconds for electricity, and every 15 minutes for gas.To use the service you need the the client serial number and secret keys for your devices.You can get this by logging into your-loop.com, opening your browser's console, and typing inDrupal.settings.navetas_realtime.(There is more detailed documentation about how to do this herehttps://home-assistant.io/components/sensor.loop_energy/)You should keep your secret keys,secret!Thanks to Marcos Scriven for producing a node implementation that I've shamelessly copied.https://github.com/marcosscriven/loopData is returned in kw.DependenciesPyLoopEnergy depends on socketIO-client. It needs version 0.5.6 which supports socket.IO version 0.9, rather than 1.0.How to use>> import pyloopenergy
>> elec_serial = 'your serial'
>> elec_secret = 'your_secret'
>> le = pyloopenergy.LoopEnergy(elec_serial, elec_secret)
>> le.electricity_useage

0.602

>> le.terminate()Notes:Data is fetched asynchronously, solemay not be populated if you callelectricity_useagestraight after creating it. The API provides callback functions on update (there is a simple example below).It can take 15s to terminate the monitoring thread after callingterminate.Simple subscription exampleimport pyloopenergy
import time

def gas_trace():
    print("Gas =", le.gas_useage)

def elec_trace():
    print("Electricity =", le.electricity_useage)

elec_serial = '00000';
elec_secret = 'YYYYYY';

gas_serial = '11111';
gas_secret = 'ZZZZZ';

le = pyloopenergy.LoopEnergy(elec_serial, elec_secret, gas_serial, gas_secret)
le.subscribe_gas(gas_trace)
le.subscribe_elecricity(elec_trace)

time.sleep(120)
le.terminate()
time.sleep(60)This produces the following output.Electricity = 1.13
Gas = 0.0
Electricity = 1.116Gas Meter Types and Calorific valuesThe library supports metric and imperial gas meters (reading cubic metres or 100s of cubic feet)The default is a metric meter, but you can specify an imperial or metric meter.le = pyloopenergy.LoopEnergy(elec_serial, elec_secret, gas_serial, gas_secret, pyloopenergy.IMPERIAL)

le = pyloopenergy.LoopEnergy(elec_serial, elec_secret, gas_serial, gas_secret, pyloopenergy.METRIC)To convert from a volume reading into kw, the library needs to know how much energy is in each metre of gas. The default is 39.11, but you can use the real number from your supplier if you like.le = pyloopenergy.LoopEnergy(elec_serial, elec_secret, gas_serial, gas_secret, pyloopenergy.IMPERIAL, 39.1)

le = pyloopenergy.LoopEnergy(elec_serial, elec_secret, gas_serial, gas_secret, pyloopenergy.METRIC, 39.1)
Package: pyloopkey
Loopkey ClientLoopkey Client is a library meant to facilitate making requests to Loopkey integrations, which include the regular and corporate integrations. Several of the requests for each service are available in the library, but not all of them.FeaturesThe library includes these features:Client: Allows logging in to Loopkey servers with phone and password if no authentication token is given.Access Group: Manipulates Access Groups for corporate integrationBooking: Manipulates Bookings for corporate integrationCorporate Smartlock: Manipulates smartlock for corporate integrationRegular Smartlock: Manipulates Access Groups for regular integrationCorporations: Manipulates Corporations for corporate integrationGateway: Manipulates Gateway for corporate integrationRole: Manipulates Role for corporate integrationSite: Manipulates Site for corporate integrationAlso, the library has unitests for each requests it includes.
Package: pyloopkit-test
PyLoopKitA set of Python tools for building closed-loop insulin delivery apps (Python port of LoopKit)Link to Tidepool Loop repository version used for algorithmLink of Tidepool LoopKit repository version used for algorithmTo use this projectPlease reviewthe documentationfor usage instructions, input data requirements, and other important details.To recreate the Virtual EnvironmentThis environment was developed with Anaconda. You'll need to installMinicondaorAnacondafor your platform.In a terminal, navigate to the directory where the environment.yml
is located (likely the PyLoopKit folder).Runconda env create; this will download all of the package dependencies
and install them in a virtual environment named py-loop. PLEASE NOTE: this
may take up to 30 minutes to complete.To use the Virtual EnvironmentIn Bash runsource activate py-loop, or in the Anaconda Prompt
runconda activate py-loopto start the environment.Rundeactivateto stop the environment.
Package: pylops-mpi
PyLops MPIpylops-mpi is a Python library built on top ofPyLops, designed to enable distributed and parallel processing of
large-scale linear algebra operations and computations.InstallationTo install pylops-mpi, you need to have MPI (Message Passing Interface) installed on your system.Download and Install MPI: Visit the official MPI website to download an appropriate MPI implementation for your system.
Follow the installation instructions provided by the MPI vendor.Open MPIMPICHIntel MPIVerify MPI Installation: After installing MPI, verify its installation by opening a terminal or command prompt
and running the following command:mpiexec --versionInstall pylops-mpi: Once MPI is installed and verified, you can proceed to installpylops-mpi.You can install withmakeandpip:make installYou can install withmakeandconda:make install_condaRun Pylops-MPIOnce you have installed the prerequisites and pylops-mpi, you can run pylops-mpi using thempiexeccommand.
Here's an example on how to run the command:mpiexec -n <NUM_PROCESSES> python <script_name>.pyExampleThe DistributedArray can be used to either broadcast or scatter the NumPy array across different
ranks or processes.frompylops_mpiimportDistributedArray,Partitionglobal_shape=(10,5)# Initialize a DistributedArray with partition set to Broadcastdist_array_broadcast=DistributedArray(global_shape=global_shape,partition=Partition.BROADCAST)# Initialize a DistributedArray with partition set to Scatterdist_array_scatter=DistributedArray(global_shape=global_shape,partition=Partition.SCATTER)Additionally, the DistributedArray can be used to scatter the array along any
specified axis.# Partition axis = 0dist_array_0=DistributedArray(global_shape=global_shape,partition=Partition.SCATTER,axis=0)# Partition axis = 1dist_array_1=DistributedArray(global_shape=global_shape,partition=Partition.SCATTER,axis=1)The DistributedArray class provides ato_distclass method that accepts a NumPy array as input and converts it into an
instance of theDistributedArrayclass. This method is used to transform a regular NumPy array into a DistributedArray that can be distributed
and processed across multiple nodes or processes.importnumpyasnpnp.random.seed(42)dist_arr=DistributedArray.to_dist(x=np.random.normal(100,100,global_shape),partition=Partition.SCATTER,axis=0)The DistributedArray also provides fundamental mathematical operations, like element-wise addition, subtraction, and multiplication,
as well as dot product and thenp.linalg.normfunction in a distributed fashion,
thus utilizing the efficiency of the MPI protocol. This enables efficient computation and processing of large-scale distributed arrays.Running TestsThe test scripts are located in the tests folder.
Use the following command to run the tests:mpiexec -n <NUM_PROCESSES> pytest --with-mpiThe--with-mpioption tells pytest to enable thepytest-mpiplugin,
allowing the tests to utilize the MPI functionality.DocumentationThe official documentation of Pylops-MPI is availablehere.
Visit the official docs to learn more about pylops-mpi.ContributorsRohan Babbar, rohanbabbar04Matteo Ravasi, mrava87
Package: pylor
pylorLibrary for outputting colorful textSupports 16 foreground and 16 background colorsTable fromWikipediaQuickStartUse:pip install pylorto install the module.Importsimportpylorfrompylorimportcolors# Imports class full of colors to choose fromfrompylorimportdecorations# Imports class full of decorationsfrompylorimportcursor# Imports class for cursor movementTesting the installationimportpylorprint(pylor.test())# This will print the project logoFunctionscolor()The color function is used to create colored strings.Arguments:StringForeground colorBackground color[Optional]Example:importpylorfrompylorimportcolorsprint(pylor.color("Hello world!",colors.foreground.red))Returns stringcolorNoReset()The color function is used to create colored strings, does not set the color back to default (continues to color any future output).Arguments:StringForeground colorBackground color[Optional]Example:importpylorfrompylorimportcolorsprint(pylor.colorNoReset("Hello world!",colors.foreground.red))Returns stringformatting()Function used for formatting text.Arguments:StringFormatting typeExample:importpylorfrompylorimportdecorationsprint(pylor.formatting("Hello world!",decorations.bold))Returns stringformattingNoReset()Function used for formatting text, does not set the color back to default (continues to decorate any future output).Arguments:StringFormatting typeExample:importpylorfrompylorimportdecorationsprint(pylor.formatting("Hello world!",decorations.bold))Returns stringreset()Function used for resetting the color after using colorNoReset()Arguments:NoneExample:importpylorprint(pylor.reset())Returns stringtest()Function for testing the installation of the package, returns the project logo.Arguments:NoneExample:importpylorprint(pylor.test())Returns stringCodesColorsForegroundcolors.foreground.red
black
green
yellow
blue
magenta
cyan
white
brightBlack
brightRed
brightGreen
brightYellow
brightBlue
brightMagenta
brightCyan
brightWhiteBackgroundcolors.background.red
black
green
yellow
blue
magenta
cyan
white
brightBlack
brightRed
brightGreen
brightYellow
brightBlue
brightMagenta
brightCyan
brightWhiteDecorationsdecorations.bold
underline
reverseCursorcursor.up
down
right
leftExceptionsNotAColorException for when the argument given is not an ANSI code.Example of code that would trigger this Exception:importpylorfrompylorimportcolorsprint(pylor.color("Hello world!","red"))# This is an example of bad code, do not use this, it will not work.correct code:importpylorfrompylorimportcolorsprint(pylor.color("Hello world!",colors.foreground.red))SameTypeException for when the background/foreground colors are used twice.Example of code that would trigger this Exception:importpylorfrompylorimportcolorsprint(pylor.color("Hello world!",colors.foreground.red,colors.foreground.green))# This is an example of bad code, do not use this, it will not work.correct code:importpylorfrompylorimportcolorsprint(pylor.color("Hello world!",colors.foreground.red,colors.background.red))
Package: pyloras
LoRASLocalized Random Affine ShadowsamplingThis repo provides a python implementation of an imbalanced dataset oversampling
technique known as Localized Random Affine Shadowsampling (LoRAS). It also provides
implementations of several other over/under-sampling algorithms not yet available in
theimbalanced-learnpackage. These implementations piggybacks off ofimbalanced-learnand thus aim to be as compatible as possible with it.DependenciesPython >= 3.8numpy >= 1.17.3imbalanced-learn < 1.0.0InstallationUsingpip:$pipinstall-UpylorasAlternatively, one can install from source with the following shell commands:$gitclonehttps://github.com/zoj613/pyloras.git
$cdpyloras/
$pipinstall.UsagefromcollectionsimportCounterfrompylorasimportLORASfromsklearn.datasetsimportmake_classificationX,y=make_classification(n_samples=20000,n_features=5,n_informative=5,n_redundant=0,n_repeated=0,n_classes=3,n_clusters_per_class=1,weights=[0.01,0.05,0.94],class_sep=0.8,random_state=0)lrs=LORAS(random_state=0,manifold_learner_params={'perplexity':35,'n_iter':250})print(sorted(Counter(y).items()))# [(0, 270), (1, 1056), (2, 18674)]X_resampled,y_resampled=lrs.fit_resample(X,y)print(sorted(Counter(y_resampled.astype(int)).items()))# [(0, 18674), (1, 18674), (2, 18674)]# one can also use any custom 2d manifold learner via the ``manifold_learner` parameterfromumapimportUMAPLORAS(manifold_learner=UMAP()).fit_resample(X,y)VisualizationBelow is a comparision ofimbalanced-learn'sSMOTEimplementation withLORASon the dummy data used inthis doc pageusing the default parameters.The plots can be reproduced by running:$ python scripts/compare_oversamplers.py --n_neighbors=<optional> --n_shadow=<optional> --n_affine=<optional>ReferencesBej, S., Davtyan, N., Wolfien, M. et al. LoRAS: an oversampling approach for imbalanced datasets. Mach Learn 110, 279–301 (2021).https://doi.org/10.1007/s10994-020-05913-4Bej, S., Schultz, K., Srivastava, P., Wolfien, M., & Wolkenhauer, O. (2021). A multi-schematic classifier-independent oversampling approach for imbalanced datasets. ArXiv, abs/2107.07349.A. Tripathi, R. Chakraborty and S. K. Kopparapu, "A Novel Adaptive Minority Oversampling Technique for Improved Classification in Data Imbalanced Scenarios," 2020 25th International Conference on Pattern Recognition (ICPR), 2021, pp. 10650-10657, doi: 10.1109/ICPR48806.2021.9413002.
Package: pylorauna
Sauna Lorrainebad API Wrapper 🧖🏽‍♀️In Bern, CH there's a super sweet sauna down at the Aare.Their current capacity can be seen on theirwebsiteor through this little API wrapper.Example usagefrompylorauna.loraunaimportLoraunaClientclient=LoraunaClient()data=client.get_data()print(data.capacity_message)# $ Mir hei no bis Endi Oktober Summerpouse.
Package: pylordeckcodes
PyLoRDeckCodesA python implementation for the Legends of Runeterra deck encoder/decoder,originally written in C# by Riot Games.Installationpip install pylordeckcodesUsagefrom pylordeckcodes import CardCodeAndCount, get_deck_from_code, get_code_from_deckCardCodeAndCountobjects simply have 2 fields:card_codeandcount, in that order.Decodingget_deck_from_code(code_string, return_type="objects")The return type defaults to a list ofCardCodeAndCountobjects.Other possible options are:"strings": returns a list of strings in the form"c:00XX000", where"c"is the count and"00XX000"represents the card code."string": returns a single string of formatted counts and codes, separated by new lines. For example,"3:01DE002\n3:01PZ040\n2:01NX042"Encodingget_code_from_deck(deck)Returns a regular deck code string, without Base32 padding and such.deckcan either be:A list ofCardCodeAndCountobjectsA list of strings in the form"c:00XX000", where"c"is the count and"00XX000"represents the card code.A multi-line string of formatted counts and codes. For example,'''3:01DE002
3:01PZ040
2:01NX042'''
Package: pylore
PyLOREPACKAGE STILL IN DEVELOPMENTInstallationTo install pylore run:$pipinstallpyloreUsagefrompylore.loreimportLORELORE()Developing PyLORETo install PyLORE, along with the tools you need to develop and run tests, run the following in your virtualenv:$pipinstall-e.[dev]