Saravanan666/pypi-org huggingface dataset:
Package: haystack-threshold-node
haystack_threshold_nodeThis component filters documents based on a threshold percentage, ensuring only the documents above the threshold get passed down the pipeline.
This allows you to query your document store for a larger top_k, but then filter the results down to those which are above a set confidence score.Installationpip install haystack-threshold-nodeUsageInclude it in your pipeline - example as follows:importloggingimportrefromdatasetsimportload_datasetfromhaystack.document_storesimportInMemoryDocumentStorefromhaystack.nodesimportPromptNode,PromptTemplate,AnswerParser,BM25Retrieverfromhaystack.pipelinesimportPipelinefromhaystack_lemmatize_nodeimportLemmatizeDocumentslogging.basicConfig(format="%(levelname)s-%(name)s-%(message)s",level=logging.WARNING)logging.getLogger("haystack").setLevel(logging.INFO)document_store=InMemoryDocumentStore(use_bm25=True)dataset=load_dataset("bilgeyucel/seven-wonders",split="train")document_store.write_documents(dataset)retriever=BM25Retriever(document_store=document_store,top_k=10)lfqa_prompt=PromptTemplate(name="lfqa",prompt_text="Given the context please answer the question using your own words. Generate a comprehensive, summarized answer. If the information is not included in the provided context, reply with 'Provided documents didn't contain the necessary information to provide the answer'\n\nContext:{documents}\n\nQuestion:{query}\n\nAnswer:",output_parser=AnswerParser(),)prompt_node=PromptNode(model_name_or_path="text-davinci-003",default_prompt_template=lfqa_prompt,max_length=500,api_key="sk-OPENAIKEY",)# The value you pass for threshold is the lowest % score you will accept. Whole numbers only.# In this example, the threshold is set to 80%.threshold=DocumentThreshold(threshold=80)pipe=Pipeline()pipe.add_node(component=retriever,name="Retriever",inputs=["Query"])pipe.add_node(component=threshold,name="Threshold",inputs=["Retriever"])pipe.add_node(component=prompt_node,name="prompt_node",inputs=["Threshold"])query="What does the Rhodes Statue look like?"output=pipe.run(query)print(output['answers'][0].answer)
Package: haystack-translate-node
haystack_translate_nodeAn Azure Translation node for Haystack - you will need this configured in your Azure subscription:https://learn.microsoft.com/en-us/azure/cognitive-services/translator/translator-overviewInclude in your pipeline as follows:git clone the repo somewhere, change to the directory, thenpip install '.'Include in your pipeline as follows:fromhaystack_translate_nodeimportTranslateAnswer,TranslateQuerytranslate_query=TranslateQuery(api_key="<yourapikey>",location="<yourazureregion>",azure_translate_endpoint="<yourazureendpoint>",base_lang="en")translate_answer=TranslateAnswer(api_key="<yourapikey>",location="<yourazureregion>",azure_translate_endpoint="<yourazureendpoint>",base_lang="en")pipel=Pipeline()pipel.add_node(component=translate_query,name="TranslateQuery",inputs=["Query"])pipel.add_node(component=retriever,name="Retriever",inputs=["TranslateQuery"])pipel.add_node(component=prompt_node,name="prompt_node",inputs=["Retriever"])pipel.add_node(component=translate_answer,name="TranslateAnswer",inputs=["prompt_node"])location,azure_translate_endpoint, andbase_langare optional, and will default touksouth,https://api.cognitive.microsofttranslator.com/, andenrespectively.TranslateQuery will determine the language of the query, and assign it to thein_langJSON value.TranslateQuery will take the original query, in any language, and assign it to thein_queryJSON value.TranslateQuery will overwrite the originalqueryJSON value with the translated English valueYou can then query yourbase_langcorpus using thequeryvalue as normal using a standard Haystack Retriever node, which will place your results inresults.TranslateAnswer translate thebase_langresult stored inresultsback to the language stored inin_langand subsequently store it in theout_answerJSON value.
Package: hazard-feed
=====
Hazard_feedHazard_feed is a Django app to get storm warnings fromhttp://www.pogoda.byconduct Web-based polls and send notifications
by email to subscribed recipents.Quick startAdd "hazard_feed", "corsheaders' and others to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'corsheaders',
'django_rq',
'tinymce',
'rest_framework',
'drf_yasg',
'hazard_feed',
]Define next email settings in settings.py or your environment viriables:
WEATHER_EMAIL_SMTP_HOST
WEATHER_EMAIL_SMTP_PORT
WEATHER_USE_TSL
WEATHER_EMAIL_HOST_USER
WEATHER_EMAIL_HOST_PASSWORDDefine in settings.py
WEATHER_EMAIL_FROMAdd "corsheaders' settings to your settings.pyCORS_ORIGIN_ALLOW_ALL = TrueDefine django_rq settingsStart rqworker and rqschedulerFor websocket works add channels redis and configure
it as channels documentationRunpython manage.py migrateto create the azard_feed models.
Package: hazedumper
Python pkg for HazeDumperInstallpip install hazedumperExampleimportpymemimportpymem.processfromhazedumperimport\dwLocalPlayer,m_iHealthdefmain():pm=pymem.Pymem("csgo.exe")client=pymem.process.module_from_name(pm.process_handle,"client.dll").lpBaseOfDllplayer=pm.read_int(client+dwLocalPlayer)#get local playerhealth=pm.read_int(player+m_iHealth)#get healthprint(health)#output: 100if__name__=='__main__':main()by @cxldxice with вќ¤
Package: hazel
hazelHazel is a capsule static blog generator in PythonComprehensive documentation:https://hazel.readthedocs.org/en/latest/LicenseMIT.StatusAlphaGetting StartInstallation using pip:pip install hazelTarget a directory:cd your-blog-pathInitiate your blog:hazel initWrite your first blog post:hazel write my-first-postGenerate your blog:hazel generateMore comprehensive documentation includes personal configuration of blog and the standard of template will be provided in several days.
Package: hazelcast-remote-controller
Hazelcast Remote Controller Python LibraryHazelcast python client for Remote Controller Project which is a cluster lifecycle manager
for native client tests. Server container and language clients provide easy management of
server side from clientsCreate a cluster with a provided xml configStart a Member in the configured clusterShutdown a memberTerminate a memberRemote script execution on the containerProject uses Apache Thrift to provide multi language support.InstallationYou can install the Hazelcast python client via the following command:$ pip install hazelcast-remote-controlleror:$ python setup.py installMail GroupPlease join the mail group if you are interested in using or developing Hazelcast.http://groups.google.com/group/hazelcastLicenseHazelcast is available under the Apache 2 License. Please see theLicensing appendixfor more information.CopyrightCopyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.Visitwww.hazelcast.comfor more info.
Package: hazma
Hazma is a tool for studying indirect detection of sub-GeV dark. Its main uses are:Computing gamma-ray and electron/positron spectra from dark matter annihilations;Setting limits on sub-GeV dark matter using existing gamma-ray data;Determining the discovery reach of future gamma-ray detectors;Deriving accurate CMB constraints.Hazma comes withseveralsub-GeV dark matter models, for which it provides functions to compute dark matter annihilation cross sections and mediator decay widths. A variety of low-level tools are provided to make it straightforward todefine new models.InstallationHazma can be installed from PyPI using:pip install hazmaAlternatively, you can download Hazma directly from this page, navigate to the package directory using the command line and runpip install .orpython setup.py installSince Hazma utilizes C to rapidly compute gamma ray, electron and positron spectra, you will need to have the cython package installed.Another way to run Hazma is by using docker. If you have docker installed on your machine, clone the Hazma repository and in the Hazma directory, run:docker build --rm -t jupyter/hazma .This will build the docker image calledjupyter/hazma. Then to start a jupyter notebook, run:docker run -it -p 8888:8888 -v /path/to/hazma/tutorials:/home/jovyan/work --rm --name jupyter jupyter/hazmaThis will start a jupyter kernel.Other informationIf you use Hazma in your own research, please citeour paper:@article{Coogan:2019qpu,
      author         = "Coogan, Adam and Morrison, Logan and Profumo, Stefano",
      title          = "{Hazma: A Python Toolkit for Studying Indirect Detection
                        of Sub-GeV Dark Matter}",
      year           = "2019",
      eprint         = "1907.11846",
      archivePrefix  = "arXiv",
      primaryClass   = "hep-ph"
}Logo design: David Reiman and Adam Coogan; icon from Freepik fromflaticon.com.
Package: hazus
hazusThis is the source for the Hazus Python Package. The intention is to create a free and open-source distribution of the logic and methods used in FEMA's Natural Disaster Loss Estimation Software, Hazus (https://www.fema.gov/hazus). The methods used are independent of any UI so that they can be incorporated across software, systems, and models. The open-source platform allows transparency in how Hazus conducts loss estimation modeling and invites researchers, scientists, and analysts to contribute and build better models for the nation and the world.This Python Package is in its infancy and currently exists as a framework for development. Partial builds of the flood and hurricane modules are anticipated for 2020. If you would like to contribute, please contactFEMA-NHRAP@dhs.fema.gov.Official DocumentationHazus Python Package DocumentationLicensingThis code is distributed under the GPL v3 license and is ilegal to be used in commercial applications, but is otherwise free to use and modify in applications disitrubted not for profit. See LICENSE for more detailed information.
Package: hazwaz
hazwaz is a python3 library to write command line scripts.ContributingHazwaz ishosted on sourcehut:bug trackergit repositoryCILicenseCopyright (C) 2022 Elena GrandiThis program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero
General Public License for more details.You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
Package: hazy
# Hazy ToolbeltThe Hazy Toolbelt is the command line interface (CLI) to the [Hazy](https://hazy.com) web service. It’s developed in Python and the code is published under the [MIT License](https://github.com/hazy/toolbelt/blob/master/LICENSE) at [github.com/hazy/toolbelt](https://github.com/hazy/toolbelt).## Status - WIPThis toolbelt and the JSON API that it targets are both under active development and are not ready for general use yet.## Install### UseThe toolbelt is designed to be used as a pre-built standalone binary. One way to get up and running is to download the latest binary for your architecture from the [releases page](https://github.com/hazy/toolbelt/releases) and put the binary file somewhere on your PATH.Alternatively on OSX you can install using Homebrew:`sh brew tap hazy/toolbelt brew install hazy `Or if you’re using Python3, you can install directly from PyPI:`sh pip install hazy `### DevelopYou can install the toolbelt for local development by installing the dependencies into a Python3 environment and developing the egg:`sh pip install-rrequirements.txt python setup.py develop `This will install ahazybinary in your local Python environment’s bin folder. You can check that this is on your path with e.g.:`sh which hazy `### BuildNote that as of time of writing (7th August 2018) PyInstaller is verified as working with Python 3.6 and has some issues under 3.7.You can build a standalonehazybinary (for your architecture) using PyInstaller. This requires additional dependencies.First ensure you have [Pandoc](https://pandoc.org/installing.html), for example using Homebrew:`sh brew install pandoc `Then install the additional python dependencies:`sh pip install-rmaintainer-requirements.txt`You can then build using:`sh ./_build.sh `This will write a standalone binary to./dist/hazy. You can optionally copy this to/usr/local/bin/hazyusing:`sh ./_link.sh `### ReleaseYou can publish a new version of the toolbelt to PyPI by bumping the version number in./VERSIONand running:`sh ./_release.sh `TODO:[ ] update release script to publish binaries[ ] build binaries for multiple platforms## UsageRun thehazycommand without arguments or with the–helpflag for usage information:`sh hazy--help`You can drill down into usage information for the resources / command groups and for individual commands, e.g.:`sh hazy auth--helphazy auth login--help`Further [documentation is available on the Hazy website](https://hazy.com/docs).## TestRunning the tests requiresnoseandcoverage, included in themaintainer-requirements.txt.Then, run e.g.:`sh nosetests--with-coverage--cover-packagehazy `
Package: hb
Hash BrownA simple command-line utility for calculating checksums.Installpip install hbUsageCalculate the sha1 of a file:$ hb -a sha1 hello.txt
sha1 (hello.txt) = 493a253abf93d705d67edeb463134a5c8752fc9dCheck to see if file matches a given checksum:$ hb -a md5 hello.txt -g 77060c267470021a97392b815138733e
md5 (hello.txt) = 77060c267470021a97392b815138733e OK

$ hb -a md5 hello.txt -g 0123456789abcdef
md5 (hello.txt) = 0123456789abcdef BADChecksums can be read from a file:$ hb -c checksums.txt
sha512 (hello.txt) = 493a253abf93d705d67edeb463134a5c8752fc9d OK
sha512 (world.txt) = 683e4ee04e75e71a6dca42807001f00be1fcb2a3 OK
sha512 (image.jpg) = f3a53e6c2743645f08faedadd7a2c57cbc38632f OK
sha512 (video.mp4) = 03ba9191fc4cd74f218df58542643fbc07dca532 OKHash Brown outputs its results in BSD style.  The checksum files are also BSD style.All files are read in binary mode.Globbing and recursive globbing are supported via*and**respectively.Dotfiles are not included when globbing and need to be specified explicitly.Options-a, --algorithm [blake2b|blake2s|md5|sha1|sha224|sha256|sha384|sha512|adler32|crc32]
-c, --check                     Read checksums from a file.
-g, --given TEXT                See if the given checksum `TEXT` matches the
                                computed checksum. (use with -a)
-p, --parallel                  Process files in parallel.
-q, --quiet                     Hide results that are OK. (use with -c)
-t, --timer                     Display elapsed time in seconds.
--version                       Show the version and exit.
-h, --help                      Show this message and exit.
Package: hbac-bias-detection
Using HBAC to detect biased data segmentsHierarchical Bias-Aware Clustering (HBAC) on regression models.Input: a trained model and a model's test data.Output: analysis of biased/discriminated data segment according to HBAC:Comparing distributions of discriminated and remaining data.Segment predictor: trains a XGBoost binary classifier to evaluate distinguishability of discriminated and remaining data with descriptive features.# Initialize HBAChbac=HBAC_analyser()# In this case, input includes model path, X data and Y datahbac.hbac_on_model(model_path,X_test,y_test)hbac.pca_plot()discrimated_cluster,bias=hbac.get_max_bias_cluster(print_results=True)# Get discriminated data in panda dfhbac.all_unscaled_discriminated# Displaying results in dataframeshbac.clustered_data# Mean per feature 'discrimnated' cluster vs 'remaining' clustershbac.mean_clusters# Plot 3 most different features' distributionshbac.plot_distributions(plot_top_features=3)# Train XGBoost a binary classifier to predict whther a datapoint will be discrimnated or not, without using error as feature.hbac.segment_predictor(plot_roc_auc=True,shap_analysis=True)Also seeexample.ipynb.For the use of HBAC on classification models, seehttps://github.com/Sm2468/msc_thesis/tree/master/hbac%20scripts, on which this project was based.
Package: hb-account-statement-banque-postale-csv
This module implements the import ofbanque postale’s csv file as statementInstallDependencies for ArchLinuxsudo pacman -S cairo pkgconf gobject-introspectionDependencies for debiansudo apt-get install libcairo2-dev libgirepository1.0-devInstall the package# installs python deps
pip install -e .
# createdb postgresql database
createdb banque_postale_csv
# initialize database
trytond-admin -c trytond-dev.conf -d banque_postale_csv --all
# install module hb_tryton
trytond-admin -c trytond-dev.conf -d banque_postale_csv -u hb_account_statement_banque_postale_csv --activate-dependenciesUsageThis module use the wexisting wizard to import statementNoteIf the the modulehb_bank_statement_machine_learningis installed then
the party and account will be predict form the number on the lineCHANGELOG0.3.1 (2022-06-06)Format change, the script is modified to import old and new format, the old format will be removed in the next release0.2.0 (2022-06-20)Fixed date during importFixed default account, if no account is defined use the account of the journal0.1.0 (2021-09-28)Implemented the import as statementUsed the machine learning
Package: hbagecalculator
HB AGE CALCULATORTHIS IS A SIMPLE AGE CALCULTOR MODULE YOU CAN EASILY USE ITInstallationpip install hbagecalculatorUsage# INPUT METHOD (TO GET YEAR)importhbagecalculatorimportdatetimeYear=int(input("ENTER THE YEAR YOU WERE BORN : "))age=datetime.datetime.now().year-Yearprint("YOUR ARE ",age,"YEARS OLD")
Package: hbase
hbaseHbase REST API client built using uplinkMain FeaturesA transparent and user friendly HBase REST API clientEasy to extend by subclassing and utilizing uplink's Consumer classA great alternative to HBase Thrift clientInstallation$pipinstallhbase---> 100%UsageBuild an instance to interact with the web service, check out theHBase client referencefor a full list of available methods.fromhbaseimportHBasehbase=HBase(base_url="http://localhost:8000")Then, executing an HTTP request is as simply as invoking a method.# Get all rows using the wildcard, or supply exact row_id for single rowhbase.get_row(table="example_table",row_id="*")The returned object is a friendly Pydantic model which will automatically decode the response from base64:CellSet(Row=[Row(key="decoded_key",Cell=[Cell(column="decoded_column",timestamp=39082034,value="decoded_value"),...]),...])Similarly you can perform other CRUD operations on HBase, such as inserting a row, note that the data will automatically be encoded into base64 for you free of charge!hbase.insert_rows(test_table_name,rows={"row-1":{"col1":"dat1","col2":"dat2"},"row-2":{"col1":"dat1","col2":"dat2"}})hbase.insert_row(test_table_name,row_id="row-3",column_data={"col1":"dat1","col2":"dat2"})For sending non-blocking requests, HBase uses Uplink, which comes with support for aiohttp and twisted.CreditsUplink- A Declarative HTTP Client for PythonHBase REST API documentation- Used to help build out the packageLicenseMozilla Public License Version
Package: hbase-driver
hbase-driverNative Hbase driver in Python. (No thrift)Introductionwritten in pure Pythonnative HBase protocol support (HBase 2.X+)Support both admin operations and regionserver calls.Installation (pip)pip3 install hbase-driverGet Startedimporttimefromhbasedriver.clientimportClientfromhbasedriver.operationsimportPut,Get,Scan,Deletefromhbasedriver.exceptions.RemoteExceptionimportTableExistsExceptionfromhbasedriver.operations.column_family_builderimportColumnFamilyDescriptorBuilder# lets say your hbase instance runs on 127.0.0.1 (zk quorum address)client=Client(["127.0.0.1"])# Define column familiescf1_builder=ColumnFamilyDescriptorBuilder(b"cf1")cf1_builder.set_compression_type(b"SNAPPY")cf1_builder.set_max_versions(5)cf1_builder.set_time_to_live(86400)cf1_builder.set_block_size(65536)cf1_descriptor=cf1_builder.build()cf2_builder=ColumnFamilyDescriptorBuilder(b"cf2")cf2_builder.set_compression_type(b"LZO")cf2_builder.set_max_versions(3)cf2_builder.set_time_to_live(3600)cf2_builder.set_block_size(32768)cf2_descriptor=cf2_builder.build()column_families=[cf1_descriptor,cf2_descriptor]try:client.create_table(b"",b"test_table_master",column_families,split_keys=[b"111111",b"222222",b"333333"])exceptTableExistsException:passtable=client.get_table("","mytable")# puttable.put(Put(b'row1').add_column(b'cf1',b'qf',b'666'))table.put(Put(b'row1').add_column(b'cf1',b'qf2',b'999'))table.put(Put(b'row1').add_column(b'cf2',b'qf',b'777'))table.put(Put(b'row2').add_column(b'cf1',b'qf123',b'777'))# getresult=table.get(Get(b"row1").add_column(b'cf1',b'qf'))print("get result =",result)assertb'666'==result.get(b'cf1',b'qf')# scanscan_result=table.scan(Scan(b"row1").add_family(b'cf1'))# retrieve all results from the iterator.scan_result=list(scan_result)print("scan result below:")forrowinscan_result:print(row)# deletetable.delete(Delete(b"row1"))# this will delete the whole row# check cf deletedresult=table.get(Get(b"row1").add_column(b'cf1',b'qf'))assertresultisNone# disable tableclient.master.disable_table(None,b"mytable")time.sleep(1)client.master.delete_table(None,b"mytable")Master (metadata) operationsfromhbasedriver.clientimportClientclient=Client(["127.0.0.1"])# describe tableres=client.master.describe_table(None,"mytable")print(res)# table_name {#     namespace: "default"#     qualifier: "test_table_master"#   }#   attributes {#     first: "IS_META"#     second: "false"#   }#   attributes {#     first: "hbase.store.file-tracker.impl"#     second: "DEFAULT"#   }#   column_families {#     name: "cf1"#     attributes {#       first: "INDEX_BLOCK_ENCODING"#       second: "NONE"#     }# ..........ImplementedCreate, Disable, Delete tablePutGetDELETEScanTODOsFiltersMore params in the operations.
Package: hbase-python
(The development of this package has not finished.)hbase-python is a python package used to work HBase.It is now tested under HBase 1.2.6.Before using HBase, we are familiar with MongoDB and pymongo.
While, when coming to HBase, we found it is not easy to access the database via python.
So, I spent some days to start this project and hope it can be helpful to our daily research work.
The thought of this package comes from “happybase” and “starbase”, and I am trying to make the API behaves like
“pymongo”.DependenciesPython 3.4+requestsInstallationThe package can be installed from PyPI repository:pip3installhbase-pythonExamplesGet a row by key:importhbasezk='sis3.ustcdm.org:2181,sis4.ustcdm.org:2181'if__name__=='__main__':withhbase.ConnectionPool(zk).connect()asconn:table=conn['mytest']['videos']row=table.get('00001')print(row)exit()Scan a table:importhbasezk='sis3.ustcdm.org:2181,sis4.ustcdm.org:2181'if__name__=='__main__':withhbase.ConnectionPool(zk).connect()asconn:table=conn['mytest']['videos']forrowintable.scan():print(row)exit()Put a record to a table:importhbasezk='sis3.ustcdm.org:2181,sis4.ustcdm.org:2181'if__name__=='__main__':withhbase.ConnectionPool(zk).connect()asconn:table=conn['mytest']['videos']table.put(hbase.Row('0001',{'cf:name':b'Lily','cf:age':b'20'}))exit()Write a file to a table:importhbasezk='sis3.ustcdm.org:2181,sis4.ustcdm.org:2181'if__name__=='__main__':withhbase.ConnectionPool(zk).connect()asconn:table=conn['mytest']['videos']table.write_file(video_file)# default filename is "test_video.mp4"exit()