Saravanan666/pypi-org huggingface dataset:
Package: horatio
Horatio :sunglasses:Time your python scripts easily and with style. This tool usesfslogto format its output.The same classes can be used either throughwithor as a@decorator.pip install horatioExampleimporthoratioimportfslogimporttime@horatio.section("Factorial computation",tail="Took{}")deffact(n):ifn==1:fslog.log("Reached base case")return1fslog.log("This is not the base case")withhoratio.step("Sleeping for a second"):time.sleep(1)res=n*fact(n-1)returnreshoratio.unit="s"# or "ms", "us", "m", "h"fact(4)Will produce the followingoutput:┌─ Factorial computation
│  This is not the base case
│  Sleeping for a second ... done in 1.001 s
│  ┌─ Factorial computation
│  │  This is not the base case
│  │  Sleeping for a second ... done in 1.003 s
│  │  ┌─ Factorial computation
│  │  │  This is not the base case
│  │  │  Sleeping for a second ... done in 1.002 s
│  │  │  ┌─ Factorial computation
│  │  │  │  Reached base case
│  │  │  └─ Took 0.000 s
│  │  └─ Took 1.003 s
│  └─ Took 2.006 s
└─ Took 3.007 sFeatureshoratio.step()Prints the description and the elapsed time in the same line. It is suggested for code sections that don't print any output.As a context:withhoratio.step("Inverting the matrix"):B=np.linalg.inv(A)As a decorator:@horatio.step("Inverting the matrix"):definv(A):returnnp.linalg.inv(A)Will produce something likeInvering the matrix ... took 0.123 s.horatio.section()It's useful when timing complex code with nested calls to other timed functions.As a decorator:@horatio.section():definv(A):returnnp.linalg.inv(A)As a context:@horatio.section()defparse(file_name):fslog.log("File name:",file_name)returnNone@horatio.section()defcount_words(d):return0@horatio.section()defmain():d=parse("words.txt")n=count_words(d)fslog.log(n)Will produce something like┌─ main
│  ┌─ parse
│  │  File name: words.txt
│  └─ parse: 0.123 s
│  ┌─ count_words
│  └─ count_words: 4.567 s
└─ main: 4.701 shoratio.flat()It's useful when timing code that prints text and we want the output to be flat (no indentation).As a decorator:@horatio.flat():definv(A):returnnp.linalg.inv(A)As a context:withhoratio.flat("inv"):B=np.linalg.inv(A)Will produce something like[*] inv
[*] inv: 0.123 s
Package: horcrux
HorcruxA Python implementation of Shamir's Secret Sharing, based of Hashicorp's implementation for Vault.Shamir's Secret SharingShamir's Secret Sharing in an efficient algorithm for distributing private information. A secret is transformed intosharesfrom which the secret can be reassembled once athresholdnumber are combined.Examplefromshamirimportcombine,splitdefhello()->None:"""Split a byte-string and recombine its parts."""secret:bytes=b"Hello, World!"shares:int=5threshold:int=3parts:list[bytearray]=split(secret,shares,threshold)combined:bytearray=combine(parts[:3])print(combined.decode("utf-8"))if__name__=="__main__":hello()
Package: horcruxes
horcruxesTotally unorignal, butsmaller and faster.horcruxesis a python package to split a file intonencrypted horcruxes, such that anykcan be used to recreate the original file./â€”â€”â€”â€”> filth.mp4_1_of_5.hcx 
                   /â€”â€”â€”â€”â€”> filth.mp4_2_of_5.hcx â€”â€”â€”â€”â€”\ 
  filth.mp4   â€”â€”â€”â€”<â€”â€”â€”â€”â€”â€”> filth.mp4_3_of_5.hcx â€”â€”â€”â€”â€”â€”>â€”â€”â€”> filth.mp4
                   \â€”â€”â€”â€”â€”> filth.mp4_4_of_5.hcx â€”â€”â€”â€”â€”/
                    \â€”â€”â€”â€”> filth.mp4_5_of_5.hcx 

                              (n=5, k=3)How's it do that?A secret is created and made into several shares usingShamir's Secret Sharing. Then, the secret is used to encrypt the content of the input file using AES-256.Each horcrux file contains a short header and zero or more blocks of encrypted data. This data is then arranged in a "(k, 1) repetition code of blocks striped over n files".
As an example, for n=5, k=3, where the file has been divided into seven blocks, the following file structure is created:File 1File 2File 3File 4File 5aaabbbcccdddeeefffggg----Any three files together contain at least a single copy of every block without having to create 5 copies of each block.PerformanceThis module shows considerably faster and smaller results thanthe one I stole the idea from.Tested on a 1GB file, n=10, k=8:File sizeMineOtherRatioSize per horcrux300MB1GB3.3Size for k horcruxes2.4GB8GB3.3Size of n horcruxes3 GB10 GB3.3The size per horcrux per horcrux is given byoriginal size * (n-k+1)/n. The closer k is to n, the larger the size reduction.Slower IO (HDD)TestMineOtherRatiosplit23.37s706.43s30.22bind14.93s50.17s3.36Fast IO (SSD)TestMineOtherRatiosplit52.29s130.52s2.49bind9.67s11.731.213This tool shows faster results in both cases, largely due to the fewer IO operations required, but also because AES is ridiculously optimized.Other improvementsIt's now true to the actual Harry Potter lore, as you can create horcruxes with k=1.But why?Getting itThe entire repo is just a pip package, but it's also on PyPI:pip install horcruxesCreditsIt's an absolutely unoriginal idea.https://github.com/jesseduffield/horcruxâ€” same as mine, but slowerhttp://point-at-infinity.org/ssss/â€” similar concept, not meant for fileshttps://github.com/kndyry/horcruxâ€” not entirely the same, this one requiresn=k
Package: horde
## AboutHorde is a torrent-based file distribution system, forked from [Herd](https://github.com/russss/Herd)
and based on [Murder](https://github.com/lg/murder).
It allows for quick and easy transfer of small and large files. You can probably use
it for other things too.Horde requires no extra modules on Python and includes everything needed for destinations including
its own (lightly modified) copy of BitTornado.## Differences from Herd[Herd](https://github.com/russss/Herd) is a command line python client interface that uses eventlet
and has to be ran from the command line.  This project also has limitations around large file transfers,
peer seeding and python integration.## Differences from Murder[Murder](https://github.com/lg/murder) was Twitter’s original BitTorrent-based file
distribution system. It’s pretty dependent on Capistrano and requires that a separate
tracker process is started before you run the deploy task.Horde spawns its own tracker in the background which makes it really trivial to integrate into whatever
deployment system you like.## RequirementsHorde needs Python > 2.5 and argparse.  If your using python 2.7+ nothing else is needed as argparse
was added to the standard library.Argparse(if needed) can be installed with easy_install or pip:pip install argparse
easy_install argparseHorde also currently requires that key based passwordless authentication is enabled on all of your
target destinations.## Installgit clonehttps://github.com/naterh/Hordecd Horde && sudo python setup.py installorsudo pip install horde## UsageWith a hosts file that includes a list of the hosts you want to copy to:horde myfile.tar.gz /path/to/destination.tar.gz hosts_fileUsing a hosts list that is a single string comma separated:horde myfile.tar.gz /path/to/destination.tar.gz –hostlist “host1,host2,host3”More options:horde –help## Python IntegrationHorde can also be imported as a python module.  This makes integration into existing projects
much more bueno.  One would simply need to:import horde.horde as horde
horde.run_with_opts(‘localfile’, ‘remotefile’, hostlist=’server1,server2’)## Credits[Nate House](https://github.com/naterh)[Russ Garrett](http://github.com/russss)[Laurie Denness](http://github.com/lozzd)
Package: horde-client
Easy-to-use Python Interface for KoboldAI Horde.Report BugÂ·Request FeatureAboutThis project provides Python Client to interact withKoboldAI Hordeservice, which is a crowdsourced distributed cluster program that offers Image generation and Text Generation workers. Through this utility package, you can leverage these services from your application.Simple & Easy-to-useSupport for Text & Image GenerationLangChain IntegrationAsynchronous ClientNote: There is an official Python SDK under development from Haidra-org:https://github.com/Haidra-Org/horde-sdk.Security Note: Do NOT send any private information while connecting to the public KoboldAI service. There is no control on how the data is processed. However, if you have private & secured KoboldAI Endpoints then feel free to experiment yourself.QuickstartInstall Horde Client with pip:pip install horde-clientSample Code:fromhorde_clientimportHordeClient,TextGenParams# Initialize Clientclient=HordeClient(# To access public KoboldAI serviceinsecure=True)# Promptprompt="""### Instruction:Tell me a knock knock joke.### Response:"""# Setup Text Generation Parametersparams=TextGenParams(max_context_length=512,temperature=0.8)# Run Generation (Sync)text_gen_ouput=client.text_gen(prompt,params=params)print(text_gen_ouput.generations[0].text)# Knock knock!# Who's there?# Interrupting cow.# Interrupting cow who?# Mooooooo!RoadmapText Generation SupportLangChain/LlaMaIndex IntegrationImage Generation SupportAsynchronous ClientReadthedocs integrationTestsMissing Something? Raise arequestContributingAny contributions you make aregreatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull Request
Package: horde-clipfree
WARNING: DO NOT CONSUME THIS LIBRARYThis library is a result of ahlky sending a DMCA for 8 AGPL3 filesmissing an unnecessary attribution (see AGPL3 Section 7b), instead of asking informally like a reasonable person.As we cannot ensure that hlky won't abuse DMCA provisos again to fuel the vendeta they have against the AI Horde and violate the spirit of Free/Open Source software when it suits them, we cannot in good conscience suggest anyone else use this library.This library has been created to externalize the files in question until we can replace themLikewise, this library is rought extricated and only meant to be used in the context of hordelib
Package: horde-model-reference
Horde Model ReferenceThis package provides some tools to help manage the models which power theAI-Horde.Reference info (.json files)For now, the legacy reference format will be availible as before at theoriginal official repoused in the past.stable_diffusion.jsonYou can find a schema for an individual record in the filestable_diffusion.schema.jsonin the root of this repository. Also seestable_diffusion.example.jsonfor a small example containing two records will all of the fields populated.stable_diffusion.json changesYou can see two records which include entries for every field, and the associated metadata instable_diffusion.example.jsonat the root of this repository.Some key takeaways for the newstable_diffusion.json:The following keys have been removed:typedownload_allavailablethe sub-keyfile_pathunderdownloadthe entire keyfilesunderconfighas been removed.(configstill contains adownloadkey, which is a list of all files to download.)baseline's old values have been normalized. The currently valid values are as follows:stable_diffusion_1stable_diffusion_2_768stable_diffusion_2_512stable_diffusion_xlstable_cascadeAn MD5 sum is no longer included. All models (of all types) will have an SHA included from now on.downloadentries optionally contain a new key,known_slow_download, which indicates this download host is known to be slow at times.Moving forward, you can expect the schema to honor at least the existing values. There is a strong possibility additional fields will be added.Python libraryThis repo is also a python library designed to help you integrate the scheme the AI-Horde project uses to manage its models into your project.General infoYou can install this module through pip:python -m pip install horde_model_referenceThis library has a number of python classes which may assist you in working with the model reference. The following files may be of interest:horde_model_reference\model_reference_records.pyContains pydantic definitions, and some meta information, for all record types.horde_model_reference\meta_consts.pyContains many commonly used strings, enums, and certain useful dict lookups.horde_model_reference\path_consts.pyContains certain potentially useful paths, path constructors and folder/file name information relevant to the package.Note that a number of useful imports have been made availible at thehorde_model_referenceimport level.Horde Moderators/Support StaffValidatingWhen making changes to stable_diffusion.json, you can now validate, format, and standardize it for consistency. You can do this by invoking the following:validate_sd stable_diffusion.jsonThis will give you a success message if the file is standardized. If it is not, you can invoke the following:validate_sd stable_diffusion.json --write validated_and_formatted.jsonThis will write the appropriately normalized json out to the path specified by--write. It will only write a file out if the input file is valid json and conforms to the established schema.
Package: horde-safety
horde-safetyProvides safety features used by the horde, especially to do with image generation.NoteThis library is made with the default AI Horde worker in mind, and relies on the environment variableAIWORKER_CACHE_HOMEto establish isolation of the clip models on disk. If you do not want to rely on a horde specific folder structure, defineTRANSFORMERS_CACHEto define where you'd prefer the models to be. If neither are defined, the default huggingface folder location for the system used, typically~/.cache, depending on other environnement variables,see the official huggingface docsfor more info.InstallingMake sure pytorch is installed, preferably with CUDA/ROCM support.pipinstallhorde_safetyUseThis library currently relies onclip_interrogator. Thecheck_for_csamfunction requires an instance ofclip_interrogator.Interrogatorto be passed. You can pass in on yourself, or use the helper functionget_interrogator_no_blip(note that calling this function immediately loads the CLIP model). Use thedeviceparameter to choose the device to load to and use for interrogation. If you want to only use the CPU but have CUDA pytorch installed, useget_interrogator_no_blip(device="cpu").importPIL.Imagefromhorde_safety.deep_danbooru_modelimportget_deep_danbooru_modelfromhorde_safety.interrogateimportget_interrogator_no_blipfromhorde_safety.nsfw_checker_classimportNSFWChecker,NSFWResultinterrogator=get_interrogator_no_blip()# Will trigger a download if not on disk (~1.2 gb)deep_danbooru_model=get_deep_danbooru_model()# Will trigger a download if not on disk (~614 mb)nsfw_checker=NSFWChecker(interrogator,deep_danbooru_model,# Optional, significantly improves results for anime images)image:PIL.Image.Image=PIL.Image.open("image.jpg")prompt:str|None=None# if this is an image generation, you can provide the prompt heremodel_info:dict|None=None# if this is an image generation, you can provide the model info herensfw_result:NSFWResult|None=nsfw_checker.check_for_nsfw(image,prompt=prompt,model_info=model_info)ifnsfw_resultisNone:print("No NSFW result (Did it fail to load the image?)")exit(1)ifnsfw_result.is_anime:print("Anime detected!")ifnsfw_result.is_nsfw:print("NSFW detected!")ifnsfw_result.is_csam:print("CSAM detected!")exit(1)If you reject a job as a horde worker for CSAM, you should report'state': 'csam'in the generate submit payload.
Package: horde-sdk
horde_sdkNotehorde_sdk is inbeta. Everything is subject to change. Please feel free to report bugs or make suggestions on ourgithub issue pageAboutThis library simplifies interfacing with any API created byHaidra- the community organization
behind the free projects such as AI-Horde (homepage,github).
The goal is to minimize the amount of time it takes to develop applications in python that use our free, volunteer driven, services which include:Stable Diffusion Image Generation (driven byComfyUI)Image captioningImage rating (currently ratings are fordiffusiondb, others coming in the future)Text Generation using LLMs (driven byKoboldAI)From anything to requesting your own images, or rolling your ownworkersoftware, this package may suit your needs.DocumentationSee the complete documentation athttps://horde-sdk.readthedocs.io/en/latest/.
Package: horimote
Horimote ======Horimote is an API wrapper for the set-top boxes SMT C7400 and SMT
C7401. In the Netherlands these boxes are sold by a big Dutch cable
operator under the name Horizon Box. The name Einder is a Dutch synonym
for horizon.I'd like to thankOrangeTux&kuijpfor theireinderwork onhorizoncontrol. This is just another shameless Python rip off. Focus on Horzion Box from Unitymedia Germany.Installation$ pip install horimoteUsagehorimote.Clientcontrols the set-top box by sending bytes. These bytes
represent the buttons of a remote control. You can find all supported
keys inhorimote.keys. The example shows how to send
keys.import time

import logging
from horimote import Client
from horimote import keys

# Enable logging.
logging.basicConfig(level=logging.DEBUG)

# Replace IP with the IP of your set-top box. The port parameter is optional,
# by default its 5900.
c = Client("192.168.1.245", port=5900)

c.power_on()

# Wait a few seconds to let the set-top box have some time to start.
time.sleep(5)

# Select channel 501.
c.send_key(keys.NUM_5)
c.send_key(keys.NUM_0)
c.send_key(keys.NUM_1)

# For selecting a channel horimote.Client offers a small helper function.
c.select_channel(501)

# No watch some TV...

c.power_off()
c.disconnect()Thehorimote.Clientcan also be used as a context manager:from horimote import Client

with Client("192.168.1.245") as c:
    c.select_channel(501)LicenseThis software is licensed under theMIT license.
Package: horimotemce
Horimote MCEListen for MCE remote button presses detected byInputLIRCand send them tohorimote.It is used to detect IR keypresses generated from a Windows MCE compatible remote (or a suitably configured Logitech Harmony Hub) and send them to a Samsung SMT-G7400/G7401 box, commonly branded as the Virgin Media/upc/Unitymedia Horizon box used by several European cable operators. This allows commands that cannot be sent via IR (eg. DVD and Guide buttons) to be emulated via the SMT-G7400/G7401 IP interface.InstallationThis package should run on most Linux installations (including Raspbian/Rasperry Pi OS) and requires the following:an MCE IR receiver that is supported by inputlirc.inputlircpackage installed and configured on the underlying operating system to read and process input from the MCE IR receiverInstall the module via PyPi:pip install horimotemceRun the daemon usinghorimotemce.OptionsOptionDefaultDescription-v|--verbosenoneSet logging verbosity (repeat to increase)-V|--versionShow currently installed version
Package: horizon
Horizon is a Django-based project aimed at providing a complete OpenStack
Dashboard along with an extensible framework for building new dashboards
from reusable components. Theopenstack_dashboardmodule is a reference
implementation of a Django site that uses thehorizonapp to provide
web-based interactions with the various OpenStack projects.Project documentation:https://docs.openstack.org/horizon/latest/Release management:https://launchpad.net/horizonBlueprints and feature specifications:https://blueprints.launchpad.net/horizonIssue tracking:https://bugs.launchpad.net/horizonRelease notes:https://docs.openstack.org/releasenotes/horizon/Using HorizonSeedoc/source/install/index.rstabout how to install Horizon
in your OpenStack setup. It describes the example steps and
has pointers for more detailed settings and configurations.It is also available atInstallation Guide.Getting Started for Developersdoc/source/quickstart.rstorQuickstart Guidedescribes how to setup Horizon development environment and start development.Building Contributor DocumentationThis documentation is written by contributors, for contributors.The source is maintained in thedoc/sourcedirectory usingreStructuredTextand built bySphinxTo build the docs, use:$ tox -e docsResults are in thedoc/build/htmldirectory
Package: horizon_api_mask
Horizon Dashboard API MaskPlugin replace IP and protocol in EndpointsTableUsefull if you have OpenStack API behind proxies.ReuiredPython 2.6 +Horizon Icehouse +Installationpipinstallhorizon-api-maskRequired ConfigurationINSTALLED_APPS+=('api_mask',)HORIZON_CONFIG['customization_module']='api_mask.overrides'Optional ConfigurationAPI_MASK_URL='public-domain.com'# default is socket.getfqdn()API_MASK_PROTOCOL='https'# default is https
Package: horizon-benchmark-dashboard
Horizon Rally Dashboard for quick and easy running benchmark scenarios and viewing their results.InstallationAddbenchmark_dashboardto INSTALLED_APPS tuple.The default path for scenario definitions is at/srv/rally/scenarios, but it altered withRALLY_ROOTvariable inlocal_settings.pyof your Horizon installation.RALLY_ROOT='/srv/rally/scenarios'RALLY_DB="mysql://rally:password@127.0.0.1/rally"RALLY_PLUGINS=['rally.plugins.openstack','rally.plugins.common']# or load allRALLY_PLUGINS=['rally.plugins',]Create or clone your scenario definitions to default location/srv/rally/scenariosor setRALLY_ROOTvariable to your location.UsageServing scenariosls-la/srv/rally/scenarios/tasks/scenarios/nova/boot-and-delete-multiple.yamlboot-and-delete-server-with-keypairs.yamlboot-and-delete-server-with-secgroups.yamlboot-and-delete.yamlboot-from-volume-and-delete.yamlboot-snapshot-boot-delete.yamlcreate-and-delete-secgroups.yamlLong running tasksNow a new Thread is created for every task, which may cause Horizon overload, but async task behaviour can be overwritten:defrun_async(method):# call Celery or whateverThread(target=method,args=[]).start()Set the method tobenchmark_dashboard.utils.asyncto enable acynchronous task.Read morehttps://rally.readthedocs.org/en/latest/http://docs.openstack.org/developer/horizon/topics/tutorial.html
Package: horizon-bsn
OpenStack Boilerplate contains all the boilerplate you need to create an OpenStack package.Please feel here a long description which must be at least 3 lines wrapped on
80 cols, so that distribution package maintainers can use it in their packages.
Note that this is a hard requirement.Free software: Apache licenseDocumentation:http://docs.openstack.org/developer/horizon-bsnSource:http://git.openstack.org/cgit/openstack/horizon-bsnBugs:http://bugs.launchpad.net/horizon-bsnFeaturesTODO