Saravanan666/pypi-org huggingface dataset:
Package: hnclient
Hacker News ClientThe Hacker News Client is a Python-based tool designed to seamlessly engage with the official Hacker News Firebase API. This client incorporates a built-in request-cache mechanism for each API call, allowing for the efficient handling of complete data dumps without the need for redundant subsequent calls. This feature significantly optimizes your data wrangling processes, saving you time and resources.Installpip install hnclientQuick StartFirst step is to initializeHackerNewsClientprior to making an API request. By default, client requests are cached. To disable cache, set thedisable_cacheargument toTrue:fromhnclientimportHackerNewsClientclient=HackerNewsClient()To fetch stories from Hacker News, begin by using thegetstoriesmethod.:bulb: You can select specific story section by passing its name into thestoryargument. Here are few  examples:Top,Best,Ask,Show.:bulb: You can also set the sorting order for all stories by their Hacker News score with thedescendingargument. Default isFalse.fromhnclientimportHackerNewsClientclient=HackerNewsClient()data=client.get_stories("top",descending=False)print(data)The program above will print out a list of dictionaries where each dictionary holds the following metadata per story: :point_down:{'author': 'tristanho',
 'comments': 156,
 'id': 34006202,
 'score': 318,
 'text': 'Hey HN, cofounder of Readwise here. We&#x27;ve been working on this '
          'cross-platform reader app for about 2 years, excited to finally...'   ,
 'time': 1671140643,
 'title': 'Show HN: Readwise Reader, an all-in-one reading app',
 'url': 'https://readwise.io/read'}Data WranglingCollect a list of a specific metadata object. The available list of objects can be found in the printed dictionary above. For the example below, we are obtaining a list of all URLS pertaining to theTopstories:fromhnclientimportHackerNewsClientclient=HackerNewsClient()data=client.get_stories("top")urls=client.get_item("url",data)print(urls)outputs:['https://github.com/ifeelalright1970/ytmp',
     'https://mimosa.so/',
     'https://www.screen.studio/',
     'https://www.pinetarpoker.com',
    ...]Select a random story from the client payload. For the example below, we are obtaiing a story pertaining from theBeststories.fromhnclientimportHackerNewsClientclient=HackerNewsClient()data=client.get_stories("best")random=client.get_random_story(data)print(random)
Package: hnews
Hackernews_CLI_v2A command line interface to browse content of Hacker News, built with Python. Unlike other CLIs for HackerNews, this one isn't a wrapper over it's Official API, rather the contents are scraped from the HTML page, thus is more efficient and fast. It lessens the server-client interaction thus saving bandwidth.usagepip install hnewshnews -h to browse functionalities
Package: hnget
hnget - Hacker News web scraperA commandline program for browsingHacker News.Usagehnget --fetch (--f)Print the top 30 posts on Hacker News, enumerated.--fetchtakes an optional integer value to specify different pages of the results.hnget --open (--o) [NUMS...]Open stories in default web browser. Multiple values are
accepted. Default web browser can be set with$BROWSER.hnget --comments (--o) [NUMS...]Like--open, but view the comment page(s) instead.hnget --fetch --bestView the top posts for the week instead of the current front page.InstallationWith Pypi:$ pip install hngetManually:$git clone https://github.com/jsbmg/hnget$cd hnget$pip install . pyproject.toml
Package: hNMF
hierarchical-nmf-pythonfork ofhttps://github.com/rudvlf0413/hierarchical-nmf-pythonwith familiar SKLearn interfaceInstallationpipinstallhnmfUsage20 Newsgroupsfromsklearn.datasetsimportfetch_20newsgroupsfromsklearn.feature_extraction.textimportTfidfVectorizerfromhnmf.modelimportHierarchicalNMFn_features=1000n_leaves=20data,_=fetch_20newsgroups(shuffle=True,random_state=1,remove=('headers','footers','quotes'),return_X_y=True)# Use tf-idf features for NMF.tfidf=TfidfVectorizer(max_df=0.95,min_df=2,max_features=n_features,stop_words='english')X=tfidf.fit_transform(data)id2feature={i:tokenfori,tokeninenumerate(tfidf.get_feature_names_out())}# hNMFmodel=HierarchicalNMF(k=n_leaves)model.fit(X)model.cluster_features(id2feature=id2feature)ReferencePapers:Fast rank-2 nonnegative matrix factorization for hierarchical document clusteringOriginal version of codes (matlab):https://github.com/dakuang/hiernmf2
Package: hnn
Hybrid Programming Framework简介HNN编程框架基于PyTorch进行开发，提供了编写ANN、SNN、HNN模型的编程接口，同时可以支持通过此编程框架描述的ANN、SNN模型的自动化量化（HNN的自动化量化仍在开发中），可以支持后训练静态量化和量化感知训练。下面对SNN和HNN编程进行简要说明：SNN编程由一系列基本SNN操作组成，通过这些基本操作可以组成灵活的、功能丰富的扩展LIF神经元模型，用户也可以基于这些基本操作实现自定义的神经元模型。HNN编程中的HNN主要指[1]中以Hybrid Unit (HU)为转换单元来连接ANN和SNN网络的混合网络，编程框架中实现了可扩展的HU，用户可使用编程框架中提供的各种HU或自定义HU。此框架的开发过程中考虑了与BiMap的融合，通过此编程框架描述的网络可以进一步被BiMap中的编译系统编译部署到支持的类脑计算芯片上。HNN编程框架的详细开发及使用文档请见工程文档。基本使用通过pip安装：pipinstallhnn注：目前因为ONNX版本兼容问题，Pytorch需要使用1.11.0版本examples文件夹下为通过此编程框架写出的一些ANN、SNN、HNN模型，以需要量化的SNN为例，SNN模型需要继承src.snn中的QModel类，并通过QConv2d,QLinear,QLIF等算子来搭建网络：fromsrc.snnimportQModel,QLinear,QLIFclassSNN(QModel):def__init__(self,in_channels,T,num_classes=10):super(SNN,self).__init__(time_window_size=T)self.linear=QLinear(in_features=in_channels,out_features=num_classes)self.lif=QLIF(v_th=1,v_leaky_alpha=0.9,v_leaky_beta=0,v_reset=0)参考引用如果使用到本编程框架的HNN部分，请引用[1]：@article{Zhao2022,
doi = {10.1038/s41467-022-30964-7},
url = {https://doi.org/10.1038/s41467-022-30964-7},
year = {2022},
month = jun,
publisher = {Springer Science and Business Media {LLC}},
volume = {13},
number = {1},
author = {Rong Zhao and Zheyu Yang and Hao Zheng and Yujie Wu and Faqiang Liu and Zhenzhi Wu and Lukai Li and Feng Chen and Seng Song and Jun Zhu and Wenli Zhang and Haoyu Huang and Mingkun Xu and Kaifeng Sheng and Qianbo Yin and Jing Pei and Guoqi Li and Youhui Zhang and Mingguo Zhao and Luping Shi},
title = {A framework for the general design and computation of hybrid neural networks},
journal = {Nature Communications}
}本工程的SNN和HNN编程部分参考或复用了部分SpikingJelly的代码：@misc{SpikingJelly,
    title = {SpikingJelly},
    author = {Fang, Wei and Chen, Yanqi and Ding, Jianhao and Chen, Ding and Yu, Zhaofei and Zhou, Huihui and Timothée Masquelier and Tian, Yonghong and other contributors},
    year = {2020},
    howpublished = {\url{https://github.com/fangwei123456/spikingjelly}},
    note = {Accessed: YYYY-MM-DD},
}
Package: hnn-core
hnn-coreThis is a leaner and cleaner version of the code based off theHNN repository.Contributors are very welcome. Please read ourcontributing guideif you are interested.Dependencieshnn-core requires Python (>=3.7) and the following packages:numpyscipymatplotlibNeuron (>=7.7)Optional dependenciesGUIipywidgets (<=7.7.1)voila (<=0.3.6)Parallel processingjoblib (for simulating trials simultaneously)mpi4py (for simulating the cells in parallel for a single trial). Also depends on:openmpi or other mpi platform installed on systempsutilInstallationWe recommend theAnaconda Python distribution.
To installhnn-core, simply do:$ pip install hnn_coreand it will installhnn-corealong with the dependencies which are not already installed.Note that if you installed Neuron using the traditional installer package, it is recommended
to remove it first and unsetPYTHONPATHandPYTHONHOMEif they were set. This is
because the pip installer works better with virtual environments such as the ones provided byconda.If you want to track the latest developments ofhnn-core, you can install the current version of the code (nightly) with:$ pip install --upgrade https://api.github.com/repos/jonescompneurolab/hnn-core/zipball/masterTo check if everything worked fine, you can do:$ python -c 'import hnn_core'and it should not give any error messages.GUI installationTo install the GUI dependencies along withhnn-core, a simple tweak to the above command is needed:$ pip install hnn_core[gui]Note if you are zsh in macOS the command is:$ pip install hnn_core'[gui]'To start the GUI, please do:$ hnn-guiParallel backendsFor further instructions on installation and usage of parallel backends for using more
than one CPU core, refer to ourparallel backend guide.Note for Windows usersInstall Neuron using theprecompiled installersbeforeinstallinghnn-core. Make sure that:$ python -c 'import neuron;'does not throw any errors before running the install command.
If you encounter errors, please get help fromNEURON forum.
Finally, do:$ pip install hnn_core[gui]Documentation and examplesOnce you have tested thathnn_coreand its dependencies were installed,
we recommend downloading and executing theexample scriptsprovided on thedocumentation pages(as well as in theGitHub repository).Note thatpythonplots are by default non-interactive (blocking): each plot must thus be closed before the code execution continues. We recommend using and ‘interactive’ python interpreter such asipython:$ ipython --matplotliband executing the scripts using the%run-magic:%run plot_simulate_evoked.pyWhen executed in this manner, the scripts will execute entirely, after which all plots will be shown. For an even more interactive experience, in which you execute code and interrogate plots in sequential blocks, we recommend editors such asVS CodeandSpyder.Bug reportsUse thegithub issue trackerto
report bugs. For user questions and scientific discussions, please join theHNN Google group.Interested in Contributing?Read ourcontributing guide.RoadmapRead ourroadmap.
Package: hnne
A fast hierarchical dimensionality reduction algorithm.h-NNE is a general purpose dimensionality reduction algorithm such as t-SNE and UMAP. It stands out for its speed,
simplicity and the fact that it provides a hierarchy of clusterings as part of its projection process. The algorithm is
inspired by theFINCHclustering algorithm. For more information on the structure of the algorithm, please look atour
corresponding paper in ArXiv:M. Saquib Sarfraz*, Marios Koulakis*, Constantin Seibold, Rainer Stiefelhagen.
Hierarchical Nearest Neighbor Graph Embedding for Efficient Dimensionality Reduction. CVPR 2022.More details are available in theproject documentation.InstallationThe project is available in PyPI. To install run:pip install hnneHow to use h-NNEThe HNNE class implements the common methods of the sklearn interface.Simple projection exampleimportnumpyasnpfromhnneimportHNNEdata=np.random.random(size=(1000,256))hnne=HNNE(dim=2)projection=hnne.fit_transform(data)Projecting on new pointshnne=HNNE()projection=hnne.fit_transform(data)new_data_projection=hnne.transform(new_data)DemosThe following demo notebooks are available:Basic UsageMultiple ProjectionsClustering for FreeMonitor Quality of Network EmbeddingsCitationIf you make use of this project in your work, it would be appreciated if you cite the hnne paper:@article{hnne,title={Hierarchical Nearest Neighbor Graph Embedding for Efficient Dimensionality Reduction},author={M. Saquib Sarfraz, Marios Koulakis, Constantin Seibold, Rainer Stiefelhagen},booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},year={2022}}If you make use of the clustering properties of the algorithm please also cite:@inproceedings{finch,author={M. Saquib Sarfraz and Vivek Sharma and Rainer Stiefelhagen},title={Efficient Parameter-free Clustering Using First Neighbor Relations},booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},pages={8934--8943},year={2019}}
Package: hnr-downloader
DescriptionHnr Downloaderis a free software for managing downloading files from web
using http or https .It was designed by Dergen Lee. Once I searched for a downloader, no one suited
my request. So I develop this simply software, just for my own use, and maybe
you.FeaturesResumable: if the source support, the soft may start download from last position.Separate Proxy: Each download task may set its own proxy sever.Recording: Record every download task info for review or redownload.RequirementsPython 3Project depends on Python 3wxPythonA cross-platform GUI toolkit for the Python language.Requests
An elegant and simple HTTP library for Python, built for human beings.SeeINSTALLfile for installation instructions.ConfigsLanguageThe software’s default language is simplified chinene. English and taiwan chinese
are supported, too. The languang config is in i18nlang.json file.Usagepyhtonw hnr_downloader.pyLicenseHnr Downloaderis released under the terms of the Apache License, Version 2.0Please read thelicense.txtfile for details.AuthorsDeren Lee (derganlee@163.com)
Package: hns-console-logging
hns_console_loggingJust a simple script to create a logger object for logging to console. It is intended to be used with services running
as docker container. By using the logging facility in docker container, you don't need to write logs to the file, you
can use the logs written to file by docker daemon.Installationpip install hns-console-loggingUsageimporthns_console_logginglogger=hns_console_logging.get_logger('test_module')logger.info('Info msg')You can change the default log format and log level.Default log format:%(asctime)s %(levelname)s %(name)s %(funcName)s [PID:%(process)d TID:%(thread)d] %(message)sDefault log level:INFODefault formatter class:logging.FormatterTo change log format, please refer:https://docs.python.org/3/library/logging.html#logrecord-attributes
Package: hnscraper
Hackernews-ScrapingBusiness Requirements:Scrape TheHackernews.com and store the result (Description, Image, Title, Url) in mongo dbMaintain two relations - 1 with the url and title of the blog and other one with url and its meta data like (Description, Image, Title, Author)Requirements:python3pippython libraries:
_ requests
_ BeautifulSoup4
_ pymongo
_ jupyterlab * notebookMongoDBgitTo run the application on your local machine:Clone the repository:Type the following in your terminalgit clone https://github.com/pushp1997/Hackernews-Scraping.gitChange the directory into the repositorycd ./Hackernews-ScrapingCreate python virtual environmentpython3 -m venv ./scrapeVenvActivate the virtual environment createdOn linux / MacOS :source ./scrapeVenv/bin/activateOn Windows (cmd) :"./scrapeVenv/Scripts/activate.bat"On Windows (powershell) :"./scrapeVenv/Scripts/activate.ps1"Install python requirementspip install -r requirements.txtOpen the ipynb using jupyter notebookjupyter notebook "Hackernews Scraper.ipynb"Run the notebook, you will be asked to provide inputs for no of pages to scrape to get the post and your MongoDB database URI to store the posts data.Open mongodb shell connecting to the same URI you provided to the ipynb notebook while running it.Change the databaseuse hackernewsPrint the documents in the 'url-title' collectiondb["url-title"].find().pretty()Print the documents in the 'url-others' collectiondb["url-others"].find().pretty()
Package: hn-sentiment
HackerNews Sentiment AnalysisUse VaderSentiment to analyze the sentiment of a post on HackerNews.Documentation:https://namuan.github.io/hn-sentimentSource Code:https://github.com/namuan/hn-sentimentPyPI:https://pypi.org/project/hn-sentiment/Pre-requisitesInstallationpipinstallhn-sentimentAcknowledgementsVaderSentimentDevelopmentClone this repositoryRequirements:Python 3.7+PoetryCreate a virtual environment and install the dependenciespoetryinstallActivate the virtual environmentpoetryshellValidating buildmakebuildRelease processA release is automatically published when a new version is bumped usingmake bump.
See.github/workflows/build.ymlfor more details.
Once the release is published,.github/workflows/publish.ymlwill automatically publish it to PyPI.DisclaimerThis project is not affiliated with PlantUML.
Package: hns-logicmonitor-api
hns_logicmonitor_apiLogicmonitor API.This is mainly built to get data from logicmonitor, especially the optical stats about ONTs. Any other method apart fromgetwould need
to be implemented in theLMBaseclassInstallationpip install hns-logicmonitor-apiUsagefromhns_logicmonitor_apiimportLogicMonitorwithLogicMonitor(account_name='account',access_id='test_id',api_key='test_api_key',global_timeout=5)aslogic_monitor:# Call API here
Package: hns-notification
hns_notificationThin wrapper around various notification systems.Notifications availableOpsgenieInstallationpip install hns-notificationOpsgenie usageBelow code snippet shows how to create alert on opsgenie.# Import Opsgenie Classfromhns_notification.opsgenieimportOpsgenie# Your API keyapi_key='api_key'# Instantiate Opsgenie classops_genie=Opsgenie(api_key)# Create the alert, pass the alert message body.# This always add a `_alert_timestamp` field to the details options in alert body# Check https://docs.opsgenie.com/docs/python-sdk-alert#section-create-alert for details on accepted alert body fields.ops_genie.create_alert({'message':'sample_msg','alias':'some-alias','responders':[{'name':'SampleTeam','type':'team'}],'visible_to':[{'name':'Sample','type':'team'}],'actions':['Restart','AnExampleAction'],'tags':['OverwriteQuietHours'],'details':{'key1':'value1','key2':'value2'},'entity':'An example entity','priority':'P3','description':'Sample of SDK v2'})
Package: hns-utils
hns_utilsJust some common helpful utility functionsInstallationpip install hns-utilsImportfrom hns_utils import <function_name>DependenciesThe functions here are for convenience. The packages required by
them would need to be installed before a function can be used. If
a function requires a third party package then that is listed in the
docstring on the function. Install that package first and then use
the function.
Package: hntop
Unofficial Python wrapper over Hacker News’ official Firebase API.Install> pip install hntopUsage ExamplesGet Item>>>fromhnapiimportHnApi>>>con=HnApi()>>>item=con.get_item(8863)>>>item.get('title')u'My YC app: Dropbox - Throw away your USB drive'>>>item.get('by')u'dhouston'Get User>>>fromhnapiimportHnApi>>>user=HnApi().get_user('pg')>>>user.get('about')u'Bug Fixer.'>>>user.get('karma')155046>>>user.typeu'user'Top Stories>>>fromhnapiimportHnApi>>>top=HnApi().get_top()>>>top[8959672,8960995,8961086,8960029,8960773,8959207,8960504,8960280,8960486,8959875,8955426,8958731,8961438,8961093,8959138]Max Item>>>fromhnapiimportHnApi>>>con=HnApi()>>>max_item_id=con.get_max_item()>>>max_item_id8967822>>>max_item=con.get_item(max_item_id)>>>max_item.get('type')u'comment'>>>max_item.get('text')u'Interesting. Being partially colour blind I would have thought that the original was much greener, while the re-release is a lot bluer and..'DocumentationDocumentationLicenseApache
Package: hntpy
hntpyIntroductionhntpy is a Python wrapper for Helium API to simplify requests and interaction with Helium blockchain. The aim of this project is to enable retrieval of Helium data from the API in a Pythonic way.For comprehensive documentation (with examples), review the full usagedocs.For more detail on exact API responses/data, please see the officicalHelium documentation.This project is continually under development. If you notice a bug, or have a feature request, please submit a Github issuehere.InstallTo use the latest version of this Python package, download from PyPi:pip install hntpyExample UsageBelow are a couple of examples to show how thehntpypackage can be used. For comprehensive documentation, including all function definitions, argument examples, and more, view thefull docs.fromhntpyimportAccount,Hotspot,Validator# ===================================## sample account functionalityaccount=Account(address="51-character-account-address")# get validators and hotspots associated with an accountvalidators=account.validators()hotspots=account.hotspots()# get a generator of rewards, in a given time window, for an account (optionally can also return a list)rewards_generator=account.rewards(min_time="2022-01-01",max_time="2022-06-01",gen=True)forbatchinrewards_generator:forrewardinbatch:# do some processing with the reward here...# ===================================## sample hotspot functionalityhotspot=Hotspot(address="51-character-hotspot-address")# get roles (activity) for a hotspot, can optionally provide timeframe and response limitroles=hotspot.roles(min_time="2022-01-01",limit=100)# get the total reward sum for the hotspot, optionally in a given timeframerewards=hotspot.rewards(min_time="2022-01-01",max_time="2022-06-01")# get hotspots that the given hotspot witnessed over the last 5 dayswitnessed=hotspot.witnessed()# ===================================## sample validator functionalityvalidator=Validator(address="51-character-validator-address")# get roles (activity) for a hotspot, can optionally provide timeframe and response limitroles=validator.roles(limit=200)Return typesThe Helium API returns either JSON objects (loaded asdicts) of data, orlistsof data. All of the functions in thehntpypackage that make requests to the Helium API return either:listdictGeneratorTypeFor requests that have the potential to return large amounts of data, there is the option to provide agen=Trueargument to the method, which will yield the data in batches (rather than compile and return one single large list). By default,genparameter is set toFalsefor all methods.To see available return types for specific methods, see method definitions in the respective module's documentation page.
Package: hnv
# python-hnv[![Build Status](https://travis-ci.org/cloudbase/python-hnvclient.svg?branch=master)](https://travis-ci.org/cloudbase/python-hnvclient)Python client for the HNV (Hyper-V Network Virtualization) REST API.- License: Apache License, Version 2.0## Python APIThe Python interface matches the underlying REST API and can be employed in 3rd party projects.```python>>> from hnv import client>>> logical_networks = client.LogicalNetworks.get()>>> for logical_network in logical_networks:...     print(logical_network.resource_id)..."63606911-e053-42cf-842e-29f67c90d5c6""c4cd42ff-5efb-4006-ac56-479730557926""cd804db3-df59-4f57-8a7d-11cc3f3c4d98">>> logical_network = client.LogicalNetworks.get(resource_id="cd804db3-df59-4f57-8a7d-11cc3f3c4d98")>>> logical_network<hnv.client.LogicalNetworks object at 0x7fcd79419910>>>> logical_network.provisioning_stateu'Succeeded'>>> logical_network.subnetworks[<hnv.client.LogicalSubnetworks object at 0x7fcd79419150>]>>> logical_network.subnetworks[0].resource_idu'4390e3d8-c527-4534-882f-906c47ffd0bb'```or```pythonfrom __future__ import print_functionimport jsonimport sysfrom hnv import configfrom hnv import clientdef view_logical_networks():"""List all the available logical networks."""logical_networks = client.LogicalNetworks.get()print("Logical networks:")for logical_network in logical_networks:print("\t - ", logical_network.resource_ref)print("\t\t", "Logical subnetworks:")for logical_subnetwork in logical_network.subnetworks:print("\t\t - %s (%s)" % (logical_subnetwork.resource_id,logical_subnetwork.address_prefix))print("\t\t", "Virtual networks:")for virtual_network in logical_network.virtual_networks:print("\t\t - %s" % virtual_network.resource_ref)def create_virtual_network():"""Create a new virtual network on the first logical network."""print("Creating a new virtual network.")address_space = client.AddressSpace(address_prefixes=["192.168.133.0/24"])logical_network = client.Resource(resource_ref=client.LogicalNetworks.get()[0].resource_ref)virtual_network = client.VirtualNetworks(resource_id="hvn-test",address_space=address_space,logical_network=logical_network,)virtual_network.commit()print("The raw content of the new Virtual Network")print(json.dumps(virtual_network.dump(), indent=4))def remove_virtual_network():"""Remove the new virtual network."""print("Remove the new virtual network")client.VirtualNetworks.remove(resource_id="hvn-test")def main():"""Logical networks sample entry point."""config.CONFIG(sys.argv[1:])view_logical_networks()create_virtual_network()view_logical_networks()remove_virtual_network()view_logical_networks()```