Saravanan666/pypi-org huggingface dataset:
Package: banditpam
QuickstartRunpip install banditpamand then check out theexamples.If you use this software, please cite:
Mo Tiwari, Martin Jinye Zhang, James Mayclin, Sebastian Thrun, Chris Piech, Ilan Shomorony. “BanditPAM: Almost Linear Time k-medoids Clustering via Multi-Armed Bandits” Advances in Neural Information Processing Systems (NeurIPS) 2020.IntroductionClustering algorithms are ubiquitous in modern data science applications. Compared to the commonly used k-means clustering, k-medoids clustering
requires the cluster centers to be actual datapoints and supports arbitrary dissimilarity functions
in addition to standard distance metrics. This enables greater interpretability of the cluster centers and the clustering of structured
objects. Despite these advantages, k-medoids clustering has been far less popular than k-means due to its computational cost.
We present BanditPAM, a randomized algorithm inspired by techniques from multi-armed bandits,
that scales almost linearly with dataset size and runs significantly faster than prior algorithms while still matching the best prior algorithms in clustering quality.
Prior k-medoids algorithms such as PAM and FastPAM scale quadratically in the dataset size and are significantly slower than k-means, which scales linearly in dataset size.
This algorithm, BanditPAM, almost matches k-means in complexity and is significantly faster than prior state-of-the-art with runtime O(nlogn).DetailsIn this package, we provide a high-performance implementation of BanditPAM, a state-of-the-art k-medoids algorithm.
BanditPAM:matches the best prior work in clustering quality but scales as O(nlogn) instead of O(n^2) in each iteration, andsupports arbitrary dissimilarity functions between points – these functions need not even be proper metricsThis implementation is written in C++ for performance, but is callable from Python via Python bindings. The algorithm is empirically
validated on several large, real-word datasets with a reduction in the number of distance evaluations of up to 200x while returning the same results as
prior state-of-the-art.Further ReadingFull paper3-minute summary videoBlog postCodePyPIDocumentation
Package: bandit-sarif-formatter
SARIF formatter for BanditOverviewbandit_sarif_formatteris areport formatterforBandit, a security analyzer for Python.
It produces output in theStatic Analysis Results Interchange Format (SARIF) Version 2.1.0file format,
anOASISCommittee Specification.To learn more about SARIF and find resources for working with it, you can visit theSARIF Home Page.BuildingTo build thebandit_sarif_formatterpackage, see thePython Packaging Authority’s instructions forPackaging Python Projects, in particular the section “Generating distribution archives.”Briefly: run the following commands from the project root directory:python -m pip install --user --upgrade setuptools wheel
python setup.py sdist bdist_wheelThesource distribution(.tar.gz)
andwheel-stylebuilt distribution(.whl) packages
appear in thedist/directory.PublishingTo publish thebandit_sarif_formatterpackage, see the section “Uploading the distribution archives” and “Next steps” inPackaging Python Projects.Briefly: log in tohttps://pypi.orgwith theTODOaccount, and then run the following commands from the project root directory:python -m pip install --user --upgrade twine
python -m twine upload dist/*InstallingTo install thebandit_sarif_formatterpackage, run the command:python -m pip install bandit_sarif_formatterUsingTo generate SARIF output from Bandit, run the command:bandit --format sarif [targets [targets ...]] --output out.sarifContributingThis project welcomes contributions and suggestions.  Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visithttps://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct.
For more information see theCode of Conduct FAQor
contactopencode@microsoft.comwith any additional questions or comments.
Package: banditsbook
Bandit Code for the Book "Reinforcement Learning"This repository was forked fromJohn Myles White's "BanditsBook" repository.I have removed all the non-python code and added a setup.py file to allow for pip installs. Everything else is the same.Installingpip install banditsbookGetting Startedfrom arms.bernoulli import BernoulliArm
from testing_framework.tests import test_algorithm
from algorithms.epsilon_greedy.standard import EpsilonGreedy
num_sims = 1000
horizon = 10

arm0 = BernoulliArm(0.2)
arm1 = BernoulliArm(0.2)
arms = [arm0, arm1]
algo1 = EpsilonGreedy(0.1, [], [])
sim_nums, times, chosen_arms, rewards, cumulative_rewards = test_algorithm(
    algo1, arms, num_sims, horizon)
print(rewards)See the original repository for more information:https://github.com/johnmyleswhite/BanditsBookIcons made byGood Warefromwww.flaticon.com
Package: bandit-tools
Bandit ToolsList of apps designed to help Bandit userscustom_report.pypython -m bandit_tools.custom_reportusage: bandit_custom_report [-h] [-o OUTPUT] [-p TEMPLATE_PATH] [-t TEMPLATE]
                        [-b BASE_URI]
                        report

Tool for Bandit Custom HTML report This tools allows to create a customize
HTML Bandit from json one using Jinja2 to compose the HTML

positional arguments:
  report                the report on JSON format

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        output file
  -p TEMPLATE_PATH, --path TEMPLATE_PATH
                        The template path where files will be storage
  -t TEMPLATE, --template TEMPLATE
                        Template to render by default my_report.html
  -b BASE_URI, --base BASE_URI
                        The URI for add on the base html tagbaseline_tools.pypython -m bandit_tools.baseline_toolsusage: baseline_tools [-h] [-z] [-f] [-M] [-m MIXED] [-o OUTPUT] baseline

Tool for Bandit baseline

positional arguments:
  baseline              baseline file work with

optional arguments:
  -h, --help            show this help message and exit
  -z, --zip             Minimize the result, remove all 0 hits files
  -f, --fix             Fix format and data on manual json files
  -M, --machine         Json format without indent
  -m MIXED, --mixed MIXED
                        second baseline mixed with
  -o OUTPUT, --output OUTPUT
                        output file--fixThe fix option will be recalculate the "_total" field on "metrics"
and order the "results" field.--mixThe mix option will be recived a secondreport.jsonand
calculate the new file withbaseline + report.jsonso new "_total" field on "metrics" will be created with proper informationKNOWN ISSUESIf you have the same risky code on two lines in the same file, the--mixoption will be remove one of them, cause it is detected as duplicated hit.
Package: banditvis
This Bandit Visualization module provides an easy-to-use library for
implementing and visualizing various Bandit algorithms and environments
in machine learning. If you are looking for the following, this library
is not for you:You want something fast and efficientYou want a tool to run very large simulationsIt is good to use if you want toVisualize your algorithms in various waysQuickly make nice looking graphsHave the support of a super-straightforward minilanguageHave a command-line tool and a module you can importThe library is implemented in python3. This library is dependent also on
the following modules, and you must have them installed to run this:pyyaml (text parsing)numpy (math)scipy (stats)matplotlib (creating graphs)Run files usingbanditvis path/to/your/file.txtGet syntax help withbanditvis -h
Package: bandl
bandl is open source library, provides apis for equity stock, derivatives, commodities, and cryptocurrencies.InstallationUse the package managerpipto install bandl.pipinstallbandlInstallationUsageTo import NSE Data ModuleTo get Option chain data from New NSE websiteTo get Option chain dataTo get stock historical data.To get FII/DII data.To get Stock data from NasdaqTo get Stock data from Yahoo FinanceTo get Crypto Currencies data from BinanceTo get Crypto Currencies data from CoinbaseContributingLicenseUsageTo Get Stock/Option Data form NSEfrombandl.nse_dataimportNseDatand=NseData()# returns 'NseData object'. can be use to get nse data.To get Option chain data from New NSE websitestrikes=nd.get_oc_strike_prices("NIFTY")oc_data=nd.get_option_data("NIFTY",strikes=strikes)To get Option chain data from old websiteexpiry_dates=nd.get_oc_exp_dates(symbol)#return available expiry datesnd.get_option_chain_excel(symbol,expiry_date,filepath)#dumps option chain to file_path# or get in pandas dateframebn_df=nd.get_option_chain_df(symbol,expiry_date,dayfirst=False)#returns option chain in pandas data frame.To get stock historical data.data_frame=nd.get_data(symbol,series="EQ",start=None,end=None,periods=None,dayfirst=False)#returns historical data in pandas data framesTo get FII/DII data.part_oi_df=nd.get_part_oi_df(start=None,end=None,periods=None,dayfirst=False,workers=None)To get Stock data from Nasdaqfrombandl.nasdaqimportNasdaqtestObj=Nasdaq()# returns 'Nasdaq class object'.dfs=testObj.get_data("AAPL",periods=15)# returns last 15 days dataTo get Stock data from Yahoo Financefrombandl.yfinanceimportYfinancetestObj=Yfinance()# returns 'Yfinance class object'.#if US stock, then pass is_indian=Falsedfs=testObj.get_data("AAPL",is_indian=False)#by default, returns last years data#to get indian stock datadfs=testObj.get_data("SBIN",start="21-Jan-2020")#retruns data from 21Jan 2020 to till todayTo get Crypto Currencies data from Binancefrombandl.binanceimportBinancetestObj=Binance()# returns 'Binance class object'.#to get all crypto tickerstkrs=testObj.get_tickers()#by default, returns all tickersdfs=testObj.get_data("ETHBTC",start="21-Jan-2020")#retruns data from 21Jan 2020 to till todayTo get Crypto Currencies data from Coinbasefrombandl.coinbaseimportCoinbasetestObj=Coinbase()# returns 'Binance class object'.dfs=testObj.get_data("BTC-USD",start="21-Jan-2020",end="21-Jan-2021")#retruns data from 21Jan 2020 to 21-Jan-2021ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Kindly follow PEP 8 Coding Style guidelines. Refer:https://www.python.org/dev/peps/pep-0008/Please make sure to update tests as appropriate.LicenseMIT
Package: bandlab-master
bandlab-masterbandlab-masteris a Python script that uploads a song to yourBandLabaccount, masters it with default settings, and downloads it as WAV. Eventually, I will update this to delete the temporary project once its master downloads.balndlab-masteruses my amazingly clever (and probably terrible)webdriver-extended.RequirementsChromium/Google ChromechromedriverUsagebandlab-master [file_to_master](Wow, that was confusing.)Make sure your BandLab credentials are in~/.bandlab/.creds, username on first line and password on second.
Package: bandmap
BandmapWhat is it?I've written what can be considered a companion application. It's not new, or novel, and certainly not attractive. It's a terminal application. But I needed one, and I wanted it to do specific things. At it's heart, it's main feature is showing RBN spots for CW.FeaturesIt polls the RBN site for active spotting servers. Gets the gridsquare of those servers, and compares it to your gridsquare. It then calculates the distance to each server from you, and builds a lists of those servers. This way you can define a listening radius. There is no real benefit to looking at spots from a server in Norway if you're in South Texas.If you have flrig setup it will highlight spots near your VFO.It can look at your active Winter Field Day log and highlight those spots you have already worked, so you can focus on other stations.You can give it a list of bands you wish it to cover. No use in seeing spots on 160 if you don't have an antenna for 160.It will dynamically resize and prune the list of spots if they don't fit in the window, tossing the oldest ones.It can limit the returned spots to those in the general portion of the band. No use in cluttering the screen with spots you're not allowed to work if you're not an Extra/Advanced class.Recent changes[23.1.30] Restructured, pep8 cleanup, isolated DB code.[23.1.29] Fixed DB errorInstall, Update, Remove# Installpipinstallbandmap# Update withpipinstall-Ubandmap# Remove withpipuninstallbandmapCommand line options-h, --help            show this help message and exit
  -c CALL, --call CALL  Your callsign
  -m MYGRID, --mygrid MYGRID
                        Your gridsquare
  -d DISTANCE, --distance DISTANCE
                        Limit to radius in miles from you to spotter, default
                        is: 500
  -g, --general         Limit spots to general portion of the band.
  -a AGE, --age AGE     Drop spots older than (age) seconds. Default is: 600
  -r RBN, --rbn RBN     RBN server. Default is: telnet.reversebeacon.net
  -p RBNPORT, --rbnport RBNPORT
                        RBN server port. Default is: 7000
  -b BANDS [BANDS ...], --bands BANDS [BANDS ...]
                        Space separated list of bands to receive spots about.
                        Default is: 160 80 40 20 15 10 6
  -f FLRIGHOST, --flrighost FLRIGHOST
                        Hostname/IP of flrig. Default is: localhost
  -P FLRIGPORT, --flrigport FLRIGPORT
                        flrig port. Default is: 12345
  -l LOG, --log LOG     Log DB file to monitor. Default is: WFD.dbSo at the least you'd want to start it with options specific to you. I myself would use:bandmap-cK6GTE-mDM13AT-gIt can work with my other loggers. If you use the K1USNSST logger you can launch the bandmap with something like-l ~/SST.dbtacked on the end, to have it monitor that log file.
Package: bandoleers
This package contains useful command line tools that make deployment and
local data bootstrapping less painful.prep-it:This simple utility iterates over data files in a sub-tree and loads
them into various backends such as RabbitMQ, Consul, and PostgreSQL.wait-for:This simple utility pings a URL periodically until it responds
successfully.  It supports HTTP and Postgres URLs out of
the box.Quickstart Development Guide$python3.4-mvenvenv$../env/bin/activate(env)$pipinstall-qrrequires/development.txt
Package: bandolier
BandolierBandolier is a library to make it easier to deal with OpenAI ChatGPT functions.There are two key classes:Bandolier tracks the information on your functions and helps you build the
prompts you need to expose the functions to the chat interface.Conversation stores your message history.  Bandolier uses the Conversation to
build prompts with appropriate history. You can use a different Conversation
in each call to Bandolier to make it easier to manage multiple conversation
streams.ExamplefrombandolierimportBandolier,Conversation,annotate_arguments,annotate_description# First set up your functions@annotate_arguments({"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA.",},"unit":{"type":"string","description":"The unit to return the temperature in, e.g. F or C.","default":"F",},})@annotate_description("Get the weather for a location.")defget_weather(location,unit="F"):# api call here...return{"temperature":72,unit:unit,"conditions":["sunny","windy"]}# can also use docstring for descriptiondefget_location():"""Get the user's location."""# api call here...return"San Francisco, CA"defmain():# Set up the bandolier function configurationbandolier=Bandolier()bandolier.add_function(get_weather)bandolier.add_function(get_location)# create a new conversational conversationconversation=Conversation()conversation.add_system_message("You are a helpful assistant.")whileTrue:user_input=input("You: ")conversation.add_user_message(user_input)# the messages returned here are for UI purposes.  The conversation has already been# updated with new messages.messages=bandolier.run(conversation)formessageinmessages:# this message indicates function output, and you probably don't need to do anything with it.ifmessage.role=="function":continue# messages from the server can have content and/or function_call bothifmessage.content:print(f"{message.role}:{message.content}")if"function_call"inmessage:print(f"{message.role}:{message.function_call.name}")if__name__=="__main__":main()If you want more control, there are two other ways to use the Library. You can specify
a different model version:bandolier=Bandolier(model="gpt-4")Or you can specify your own completion function.defcompletion(model,messages,functions=None):request={"model":model,"messages":messages,"temperature":0.0,}iffunctions:request["functions"]=functionsresponse=openai.ChatCompletion.create(**request)returnresponse["choices"][0]bandolier=Bandolier(completion_fn=completion)Or you can handle all the communication yourself, and only use Bandolier
as a way to annotate your functions.defdate():"""returns today's date"""returndatetime.date.isoformat(datetime.datetime.now())bandolier=Bandolier()bandolier.add_function(date)functions=Bandolier.get_function_metadata()result=openai.ChatCompletion.create({"messages":..."functions":functions,...})
Package: bandplot
bandplotThebandplotis used for electron band structure, DOS or phonon band structure, DOS plotting fromvaspkitorphonopyresults. The code will provide two scripts,bandplotfor band structure or DOS plotting fromvaspkit*.datfiles, andpbandplotfor phonon band structure or DOS plotting fromphonopy*.datfiles.bandplotTo executebandplot-hfor the parameters to use.Example:bandplot-h
bandplot-iBAND.dat-oBAND.png-lgmkg-dPDOS*-z
bandplot-iBAND1.datBAND2.dat-gTiO\$_2\$PBEHSE
bandplot-b-lgmkg-y-33bandplot-r-iPBAND*.dat-pC,O-s,ppbandplotTo executepbandplot-hfor the parameters to use.Example:pbandplot-h
pbandplot-iBAND.dat-oBAND.png-lgmkg-dprojected_dos.dat-z
pbandplot-b23100-lgmkg-y-2110pbandplot-iBAND1.datBAND2.dat-b20100
Package: bandripper
bandripperRip albums from bandcamp using the command line.Only works for public tracks.Quality is limited to mp3 at 128 kbps.InstallationInstall with:pip install bandripperUsageOptions>bandripper -h
usage: bandripper [-h] [-n] [-o] [urls ...]

positional arguments:
  urls                  The bandcamp url(s) for the album or artist. If the url is to an artists main page, all albums will be downloaded. The tracks will be saved to a subdirectory of your current directory. If a track can't be streamed (i.e. private) it won't be downloaded.
                        Multiple urls can be passed.

options:
  -h, --help            show this help message and exit
  -n, --no_track_number
                        By default the track number will be added to the front of the track title. Pass this switch to disable the behavior.
  -o, --overwrite       Pass this flag to overwrite existing files. Otherwise don't download tracks that already exist locally.e.g.>bandripper https://blacklungwinter.bandcamp.com/releases
 [______________________________________________________________________________________________________________]-100.00% Downloading Uproot
Finished downloading Bodies of EarthHearts of Space by Blacklung Winter in 3s 107ms 7us.
>dir "./Blacklung Winter/Bodies of EarthHearts of Space"
03/22/2023  01:46 PM           228,335 Bodies of EarthHearts of Space.jpg
03/22/2023  01:46 PM         3,008,887 01 - Bodies of EarthHearts of Space.mp3
03/22/2023  01:46 PM         3,441,057 02 - Dead in the Water.mp3
03/22/2023  01:46 PM         2,792,802 03 - Yin and Yang.mp3
03/22/2023  01:46 PM         3,326,954 04 - Neurotoxin.mp3
03/22/2023  01:46 PM         3,836,446 05 - Uproot.mp3
Package: bands
bandsAnother python messaging libraryThere are ton of python message passing / signal dispatching libraries out
there. Blinker, pysignal, dispatch, pydispatcher, louie, the list goes on and
on. All of these libraries are fine. This library is okay too.Featuresbound and unbound ChannelsPluggable DispatchersBands - groups of Channels with their own dispatcherWorking with an unbound Channel>>>importbands>>>defon_alert(message):...returnmessage.upper()>>>alert=bands.channel('alert')>>>alert.connect(on_alert)>>>alert.send('alert!!')['ALERT!!']Alternatively you can send your message viabands.send…>>>bands.send('alert','ALERT!!')['ALERT!!']The send method forwards*argsand**kwargsto all of the Channel’s
receivers.Working with bound Channel’sAChannelisboundwhen it’sparentattribute is set. If you usebands.channelas a class attribute, each instance of your class will have
it’s own boundChannel. This is very similar to the way Python methods work,
except with bound Channels you’re gauranteed to get the same
bound Channel instance everytime you access it.>>>importbands>>>classComponent(object):...started=bands.channel('started')...def__init__(self,name):...self.name=name...self.started.connect(self.on_started)...defon_started(self):...returnself.name+'.on_started'>>>Component.started# doctest:+ELLIPSIS<unboundChannelat0x...>(identifier='started')>>>c1=Component('one')>>>c1.started# doctest:+ELLIPSIS<boundChannelat0x...>(identifier='started')>>>c2=Component('two')>>>c2.started# doctest:+ELLIPSIS<boundChannelat0x...>(identifier='started')>>>c1.started.send()['one.on_started']>>>c2.started.send()['two.on_started']>>>Component.started.send()['one.on_started','two.on_started']>>>bands.send('started')['one.on_started','two.on_started']From the above example, we can see that each bound Channel has it’s own
subscribers. Additionally, if you call send on the unbound Channel, all bound
channel receivers will also be notified. We can also use bands.send to send
messages by identifier.Working with a BandABandis a group of channels with aDispatcherused to actually execute a
Channel’s receivers. Messages sent to oneBandwill not reach anotherBand’s Channels or receivers.The api functions,bands.channelandbands.send, delegate their calls to
the active band. The active band defaults to the default Band accessible via
the DEFAULT_BAND constant. You can set the active band withbands.use_band,
and get the active band withbands.get_band. It may be wise to have a Band
per application or library.>>>importbands>>>my_band=bands.Band()>>>chan=my_band.channel('one')You can also provide your own Dispatcher to my_band. Here is an example of a
LoggingDispatcher.>>>importbands>>>importlogging>>>classLoggingDispatcher(bands.Dispatcher):...def__init__(self,name):...self.log=logging.getLogger(name)...defbefore_dispatch(self,ctx):...self.log.debug('Sending%s'%ctx.identifier)>>>my_band=bands.Band(LoggingDispatcher('my_band'))The above LoggingDispatcher will log a debug message before every message is
dispatched to a channel’s receivers.Installation> pip install bands
Package: bandsos
BandSOS Coastal Flood Forecasting PlatformExperimented on the Bengal delta in Bangladesh, BanD-SOS aims to establish a pre-operational service for forecasting
cyclonic flooding and the associated societal risk. This service will have two components: a forecast of the coastal
flooding hazard in real time that uses a state-of-the-art coupled hydrodynamic-wave modelling platform, and a coupling
of this forecast with a mapping of the vulnerability of the exposed areas. The project is a collaboration with Bangladesh
Water Development Board (BWDB) - the government engineering organization of Bangladesh which manages the water resource
infrastructure and tasked with providing the flood forecasting to the vast community of Bangladesh.This repository contains the softwares and scripts necessary for running the BandSOS platform. Please consult thefull documentationhow to setup the bandsos platform in practice.