Saravanan666/pypi-org huggingface dataset:
Package: backto1
backto1backto1is a small command line tool for converting JSON export packages
from openLCA 2 back to the version 1 format.UsageYou need to have Python >= 3.11 installed in order to run this tool. It can
be installed then viapip:$pipinstallbackto1To see if it is correctly installed, run$backto1help# or$python-mbackto1helpThe usage is quite simple, you pass an openLCA 2 package as input into the
tool and optionally, after the-oflag the path of the output file that should
be created (by default the output is stored under[input file]_backto1.zip):backto1-o[outputfile][inputfile]
Package: backtracked
backtrackedA python wrapper for the QueUp API.You can find the docshere.ExamplefrombacktrackedimportClient,Presence,Messageimportloggingc=Client()logging.basicConfig(level=logging.DEBUG,format="%(levelname)s-%(name)s:%(message)s")@c.eventasyncdefon_ready():print("Logged in as{0.username}".format(c.user))awaitc.join_room("my-awesome-room")@c.eventasyncdefon_chat(message:Message):ifmessage.content=="~online":awaitmessage.room.change_presence(Presence.enter)elifmessage.content=="~ping":awaitmessage.room.send_message("Pong!")c.run(email="bot@example.com",password="my_bot_password")
Package: backtracker
BackTracker ClassThe BackTracker class is a Python implementation of the backtracking algorithm, designed for solving problems where a sequence of decisions leads to a solution. This generic framework can be adapted to various problems, such as puzzles, crosswords, combinatorial problems, etc.This is based onSteven Skiena.GitHub Page:https://github.com/ryan-najafi/backtrackerFeaturesGeneric backtracking implementation.
Customizable for a wide range of problems.
Allows defining problem-specific solution processing, candidate generation, and move making/unmaking.Installationpip install backtracker==0.0.7UsageTo use the BackTracker class, you need to define functions for:Checking if a current state is a solution (is_solution).
Processing a complete solution (process_solution).
Generating candidate moves (get_candidates).
Making a move (make_move).
Unmaking a move (unmake_move).Here's an example demonstrating how to use the BackTracker class to generate combinations of elements:from backtracker import backtracker as bt

from backtracker import BackTracker

a = []
level = 0

def is_solution(a, k, input):
    return len(a) == len(input)

def process_solution(a, k, input):
    result = []
    for i, item in enumerate(a):
        if item:
            result.append(input[i])
    return ''.join(result)

def get_candidates(a, k, input):
    return [False, True]

def make_move(a, k, input, c):
    a.append(c)

def unmake_move(a, k, input, c):
    a.pop()

input = list('abc')
back_tracker = BackTracker(a=a, level=0, input=input, 
                           is_solution=is_solution, 
                           process_solution=process_solution, 
                           get_candidates=get_candidates, 
                           make_move=make_move, 
                           unmake_move=unmake_move)

for sol in back_tracker.get_next_solution():
    print(sol)In this example, the BackTracker class is used to generate all combinations of the elements in the list 'abc'. The is_solution, process_solution, get_candidates, make_move, and unmake_move functions are defined to suit this specific problem.ContributingContributions to enhance BackTracker are welcome. Please adhere to the standard Python coding guidelines.LicenseThis project is open-source and available under the MIT License.
Package: backtracking
Backtracking AlgorithmA framework for backtracking algorithm, as an interface and a solving function.This framework is designed to be used for any backtracking algorithm, and it is not limited to a specific problem.You need to implement the (quite simple) interface, and then you can use the solve() function to solve your problem and return all (or one) solutions.The methods to implement are:get_initial_state(): returns the initial state of the problemget_valid_action_set(self, state : State): returns the set of valid actions from the given statedo_action(self, action: Action, state: State): returns the new state after doing the given actionis_state_solution(self, state: State): returns True if the given state is a solution, False otherwiseInstallationInstall from PyPI:pipinstallbacktrackingInstall from source:gitclonegit@github.com:tboulet/backtracking_algorithm.gitcdbacktracking_algorithm
pipinstall-e.Code examplefrombacktrackingimportBacktrackingSolver,State,Action# The 'State' and 'Action' are just aliases for 'Any' type, for more clarityclassMyProblemSolver(BacktrackingSolver):defget_initial_state(self)->State:passdefget_valid_action_set(self,state:State)->List[Action]:passdefdo_action(self,action:Action,state:State)->State:passdefundo_action(self,action:Action,state:State)->State:# Optional, only if you want to use the 'use_only_one_state' parameterpassdefis_state_solution(self,state:State)->bool:passsolver=MyProblemSolver()solutions=solver.solve(find_all_solutions=True,use_only_one_state=False)print("Found",len(solutions),"solutions:")forsolutioninsolutions:print(solution)Example : N-Queens ProblemAn example of the N-Queens problem is provided in theexamples\n_queens.pyfile.The N-Queens problem is a classic problem in which you have to place N queens on a NxN chessboard, such that no queen can attack another queen.To run it :pythonexamples\n_queens.py
Package: backtracks
backtracksbacktracksis a python package to fit relative astrometry with background helical motion tracks, to discern directly imaged planets from contaminant sourcesThe code is written and developed by Gilles Otten (@gotten), William Balmer (@wbalmer), and Tomas Stolker (@tomasstolker).DocumentationDocumentation can be found athttp://backtracks.readthedocs.io.TutorialAJupyter notebookwill show you how to usebacktracksby reproducing the result inNielsen et al. (2017)andWagner et al. (2022)for the case of the former exoplanet candidate around HD 131339 A.DetailseDR3 Distance prior summary file fromBailer-Jones et al. (2021).Example of HD 131399Ab uses data fromWagner et al. (2022)andNielsen et al. (2017). Thank you to Kevin Wagner for providing the latest astrometry!Log-likelihood and some utility functions borrowed heavily fromorbitize!(BSD 3-clause).PPF of multivariate normal borrowed frompints(BSD 3-clause).InstallationCurrently requires and python 3.9-3.11 ish andastropy,corner,dynesty,matplotlib,numpy,novas,novas_de405, and their dependencies. Note thatnovasis not supported on Windows. You can create a working environment using conda+pip via a few lines of code:$condacreatepython=3.11-nbacktrack$condaactivatebacktrack$condainstallpip$pipinstallbacktracksOr, to clone the repo and install in development mode (we recommend this, as the code is a work in progress and you can easily fix bugs you will likely encounter this way):$condacreatepython=3.11-nbacktrack$condaactivatebacktrack$condainstallpip$gitclonehttps://github.com/wbalmer/backtrack.git$cdbacktrack$pipinstall-e.Then, test your installation:>>>frombacktracksimportSystem
Package: backtrader_contrib
backtrader_contribFeatures:This is the repostory for foreign contributions tobacktrader.Pull Requests can be accepted with the following LICENSES:GPLv3MITBSD 3-ClauseApache 2.0How does it workThe package will scan.pyfile inside the corresponding subpackages (likeanalyzers,indicators, etc) and will import the classes which are
subclasses of the corresponding subpackages (Analyzer,Indicator)Errors will be silently ignoredSuccessfully imported elements will be added to the corresponding subpackage ofbacktrader. I.e.: anything insidebacktrader_contrib.indicatorswill be
monkey-patched (added) tobacktrader.indicatorsThe package will auto-replace itself and returnbacktraderInstallation::pip install backtrader_contribUsageAs simple as:import backtrader_contrib as btAnd carry on usingbtas if you had directly importedbacktrader
Package: backtrader-contrib-lucidinvestor
backtrader_contribThis is the repository for third-party contributions tobacktradermaintained by LucidInvestor atLucidInvestor’s public gitlab instance.The package will scan.pyfile inside the corresponding subpackages (likeanalyzers,indicators, etc) and will import the classes which are
subclasses of the corresponding subpackages (Analyzer,Indicator)Errors will be silently ignored.Successfully imported elements will be added to the corresponding subpackage ofbacktrader, i.e. anything insidebacktrader_contrib.indicatorswill be
monkey-patched (added) tobacktrader.indicatorsThe package will auto-replace itself and returnbacktraderThird-party Trading FrameworkLucidInvestorThe LucidInvestor platform framework has been contributed inbacktrader_contrib/framework/lucid/README.rst.
LUCID follows an open-core business model, contributing to Backtrader while enhancing it with proprietary add-ons
bundled in a commercial Software-as-a-Service offering athttps://lucidinvestor.ca/.InstallationUse pip:pip install backtrader_contrib-lucidinvestorUsageAs simple as:import backtrader_contrib as btAnd carry on usingbtas if you had directly importedbacktraderContributePull Requests can be accepted with the following LICENSES:GPLv3MITBSD 3-ClauseApache 2.0TicketsThe ticket system is available atLucidInvestor’s public gitlab instance.creditsoriginal author: Daniel Rodriguez (danjrod@gmail.com)original unmaintained github:https://github.com/mementum/backtraderalternative unmaintained github:https://github.com/backtrader2/backtrader
Package: backtrader-mootdx
backtrader_mootdxPython Boilerplate contains all the boilerplate you need to create a Python package.Free software: MIT licenseDocumentation:https://backtrader-mootdx.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2022-12-05)First release on PyPI.
Package: backtrader-plotly
backtrader_plotlyPlotbacktrader's result usingplotlyinstead of the defaultmatplotlibThis is an experimental package, and it is done by replacing originalmatplotlibmethod calls.Installation$ pip install backtrader-plotly==1.5.0FeaturesSupport for Multiple Strategies Plotting (Added from 1.5.0.dev1)Support for Filled Area Plotting and Toggling (Added from 1.4.0)New Scheme Arguments (Added from 1.3.0)Additional scheme arguments are added to provide extra controlName of ArgumentDefault ValueDescriptiondecimal_places5It is used to control the number of decimal places of price shown on the plot. For instance, forex price usually consists of 5 decimal places.max_legend_text_width16It is used to limit the legend text width to prevent it from occupying the page.UsageComplete Working Example Here# import the package after installationfrombacktrader_plotly.plotterimportBacktraderPlotlyfrombacktrader_plotly.schemeimportPlotSchemeimportplotly.io# do whatever you want with `backtrader`importbacktraderasbt# for instancecerebro=bt.Cerebro()# add strategiescerebro.addstrategy(IchimokuStrategy)cerebro.addstrategy(SMACrossStrategy)# after adding data and strategycerebro.run()# define plot scheme with new additional scheme argumentsscheme=PlotScheme(decimal_places=5,max_legend_text_width=16)figs=cerebro.plot(BacktraderPlotly(show=False,scheme=scheme))# directly manipulate object using methods provided by `plotly`fori,each_runinenumerate(figs):forj,each_strategy_figinenumerate(each_run):# open plot in browsereach_strategy_fig.show()# save the html of the plot to a variablehtml=plotly.io.to_html(each_strategy_fig,full_html=False)# write html to diskplotly.io.write_html(each_strategy_fig,f'{i}_{j}.html',full_html=True)
Package: backtrader-plotting
backtrader_plottingLibrary to add extended plotting capabilities tobacktrader(https://www.backtrader.com/). Currently the only available backend isBokeh(https://bokeh.org/).FeaturesInteractive plotsLive trading support (needs custombacktrader- refer to the Wiki for further information)Data replaying supportInteractivebacktraderoptimization result browser (only supported for single-strategy runs)Customziable tab panelsHighly configurableDifferent skinnable themesEasy to useNeeds Python >= 3.6.DemosFind runnable function demonstrations in folderdemosor try the live demos here:https://verybadsoldier.github.io/backtrader_plotting/Installationpip install backtrader_plottingQuickstartfrombacktrader_plottingimportBokehfrombacktrader_plotting.schemesimportTradimo<yourbacktradercode>b=Bokeh(style='bar',plot_mode='single',scheme=Tradimo())cerebro.plot(b)Minimal Exampleimportdatetimeimportbacktraderasbtfrombacktrader_plottingimportBokehclassTestStrategy(bt.Strategy):params=(('buydate',21),('holdtime',6),)defnext(self):iflen(self.data)==self.p.buydate:self.buy(self.datas[0],size=None)iflen(self.data)==self.p.buydate+self.p.holdtime:self.sell(self.datas[0],size=None)if__name__=='__main__':cerebro=bt.Cerebro()cerebro.addstrategy(TestStrategy,buydate=3)data=bt.feeds.YahooFinanceCSVData(dataname="datas/orcl-1995-2014.txt",# Do not pass values before this datefromdate=datetime.datetime(2000,1,1),# Do not pass values after this datetodate=datetime.datetime(2001,2,28),reverse=False,)cerebro.adddata(data)cerebro.run()b=Bokeh(style='bar',plot_mode='single')cerebro.plot(b)Plotting Optimization ResultsAnother way to use this package is to use theOptBrowserto browse abacktraderoptimization result:...cerebro.optstrategy(TestStrategy,buydate=range(1,10,1))cerebro.addanalyzer(bt.analyzers.SharpeRatio)...res=cerebro.run()bo=Bokeh()browser=OptBrowser(bo,result)browser.start()This will start a Bokeh application (standalone webserver) displaying all optimization results. Different results can be selected and viewed.It is possible possible to add further user-provided columns.
When dealing with huge amounts of optimization results the number of results can be limited and the remaining results can be sorted by a user-provided function to allow for simple selection of the best results.DocumentationPlease refert to the Wiki for further documentation:https://github.com/verybadsoldier/backtrader_plotting/wiki
Package: backtranslate
# Back translation
This library provides functions for back translation from amino acids to
nucleotides.from __future__ import unicode_literalsfrom backtranslate.backtranslate import BackTranslate# Create a class instance, optionally giving the translation table id.
bt = BackTranslate()
# Find all substitutions that transform the codon ‘TTG’ into a stop codon.
substitutions = bt.with_dna(‘TGG’, ‘*’)Sometimes we do not have access to the DNA sequence so we have to find
possible substitutions from the amino acids directly.# Find all substitutions that transform a Tryptophan into a stop codon.
substitutions = bt.without_dna(‘W’, ‘*’)To find out which substitution predictions can be improved by adding codon
information, use the following function.bt.improvable()To get substitutions in a readable format, we can use the following:from backtranslate.util import subst_to_cds# Transform the substitutions to CDS coordinates.
variants = subst_to_cds(substitutions, 12)## Command line interface
Use the commandbacktranslateto find substitutions that explain an amino
acid change:$ backtranslate with_dna -o 210 data/mhv.fa - 1 Leu
1       A       C
1       A       TIf no reference is available, use thewithout_dnasubcommand:$ backtranslate without_dna - Asp 92 Tyr
274     G       TThe commandfind_stopsfinds a list of positions and substitutions that lead
to stop codons. This list of destructive substitutions are useful when
analysing a pool of viral transcripts. Counting the appropriate nucleotides at
the given positions gives insight into how many transcripts are active.$ backtranslate find_stops -o 210 data/mhv.fa -
216     A       T
225     A       T
230     C       A
230     C       G
243     A       T
…
Package: back-up
back-upDescriptionback-upis a utility for backing up directories (and their content).I wrote it on impulse after discovering that my many hours' savegame files had been deleted for unknown reasons 😄FeaturesCan be called at fixed intervals but will not waste disk space if the latest backup is already up to date.Is really simple otherwise.Is configured with a YAML configuration file.Installationpipinstallback-upConfigurationback-upreads the configuration from file~/.config/back-up/back-up.yaml. That is where you should specify all the directories you want backed up. Seesample back-up.yaml filefor available options.It is also possible, albeit usually impractical, to specify all the parameters on the command line.Usageusage: back-up [-h] [--backups-dir PATH] [--log-file PATH]
               [--logging-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}]
               [--to-backup NAME=PATH [NAME=PATH ...]] [--config-file PATH]
               [--archive-format FORMAT]

Utility for backing up directories.

optional arguments:
  -h, --help            show this help message and exit
  --backups-dir PATH    set the directory to dump the backups to; this is the
                        'general' backups directory, i.e. specific directories
                        that you back up will have their own subdirectories in
                        there
  --log-file PATH       set the file to dump logs to
  --logging-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}
                        set logging verbosity
  --to-backup NAME=PATH [NAME=PATH ...]
                        set the directories to back up; PATH is the directory
                        to back up, NAME is an arbitrary identifier used to
                        organize the backup files in the backup directory, so
                        it's easier to find the thing you want to restore;
                        sample value: 'DOCUMENTS=~/Documents' (the tilde will
                        be expanded appropriately, backups will be dumped
                        under '<backups_dir>/DOCUMENTS/...')
  --config-file PATH    where to take config from; command line arguments have
                        priority though; default: '~/.config/back-up/back-
                        up.yaml'
  --archive-format FORMAT
                        what format to store the backups in; default: 'zip'TODOAdd some sort of cleanup capability for really old backups.
Package: backup2s3
backup2s3=========Backup files and mysql databases to Amazon S3Requirements------------- mysql-clientInstallation------------Using PIP via PyPI::pip install backup2s3Using PIP via Github::pip install git+https://github.com/wavedocs/backup2s3#egg=backup2s3Usage-----Create new IAM User- In the IAM Management Console on Amazon, click Create New User and follow on-screen instructions.- Click Create User Policy on the user page, then select Custom Policy, then paste the following text in the text area. Replace INSERT_YOUR_BUCKET_NAME with the bucket name you have previously created, and submit the form:```{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Action": ["s3:*"],"Resource": ["arn:aws:s3:::INSERT_YOUR_BUCKET_NAME","arn:aws:s3:::INSERT_YOUR_BUCKET_NAME/*"]}]}```Сopy and edit the config```$ cp /etc/backup2s3-sample.yml /etc/backup2s3.yml```Run backup files and mysql databases```/usr/bin/backup2s3Usage: backup2s3 [options]Options:-a, --all Backup files and mysql db-f, --files Backup files-d, --databases Backup mysql databases-h, --help Print man
Package: backup-all-my-flickr-photos
backup-all-my-flickr-photosThis scripts simply downloads all your Flickr photos and videos into a
directory.Installation instructions:pip3 install backup_all_my_flickr_photosIt is recommended to create a Python 3 environment withVirtualenvfirst.Run:backup-all-my-flickr-photos [--delete] <destination_directory>This will download all the photos and videos in your account to the
destination directory specified.On the the first run, you will be prompted to provide an API key and
secret, and to authorise the application. The script will guide you
through this process. The information will get saved to~/.config/backup-all-my-flickr-photos/.The files in the destination folder will be given an appropriate file
extension and will be named with the name of the photo/movie (if it has
a name), followed by an ID number. No other metadata is saved.Options:--delete:If you specified the--deleteflag, it will also delete files in the
destination directory that do not correspond to photos or videos in your
Flickr account.--albums:In addition to downloading all the photos and videos, this will create a
directory for each album in the destination directory. Each directory will
contain symlinks to the photos and videos that that album contains. This option
cannot be used on Windows, because Windows does not support symlinks.--skip-errorsor-s:If an error occurs during the download of a photo or video, usually the script
automatically retries the download a few times. If it still fails, then an
error is printed and the script quits. Use this option if you want it to skip
to the next photo or video.
Package: backupcpy
backupcpybackupcpyis a tiny and elegant backup archive assembler implemented in less than 300 lines of Python code. It is
designed to assemble lists of files and create archives. That is all it does.Simple YAML based configuration.Support for collections of files producing separate archives.Point-in-time tarballs (.tar.gz, tar.xz, tar.bz2).Support for uncompressed archives (plain tarballs).Ability to ignore files using Unix shell-style wildcards.RequirementsYou should have Python3 and pip3 installed on your system. Python 2 is not supported and will not work.InstallationYou can installbackupcpyusing pip -sudo pip3 install backupcpyBackup manifestBackup manifest is a file that contains lists directory and file paths you want to archive - collections.
Each collection can have any number of files and directories attached to it and each collection produces a
single backup archive.By default, backupcpy will look for a file called.backupcpy.ymlin your home directory. You can tell it to
use a different file using--manifestcommand line option.Manifest entries will also have some basic placeholders available for you to use.Example manifest# Example configuration file for backupcpy## Available placeholders:# {{now}} - current datetime in format %Y%m%d-%H%M%S-%f# {{cwd}} - current working directory# {{home}} - home directory of the current user# {{user}} - username of the current user# Global ignore - matches in ALL collections# The format is Unix shell-style wildcards.# Ignore is matched against absolute resolved path of each file.# This works slightly differently than .gitignore.ignore:-'*node_modules*'# Anywhere in the path# Collections of things to backupcollections:personal:# What compression to use 'none', 'gz', 'xz', 'bz2'compress:'gz'# Where to store backup archives (absolute path)target:'/mnt/backup-drive'# Ignore for current collectionignore:-'*.git*'-'*.idea*'# Items to backup - files, directories.# Defined using glob format.# Tilde is ignored - use {{home}} instead.items:-'{{home}}/Documents/**'-'{{home}}/Images/**'-'{{home}}/MyProjects/**'Usagebackupcpy [-h] [--manifest MANIFEST] [--verbose] [--debug] [--quiet] collection [collection ...]To create backup archives you need to invoke thebackupcpycommand line tool and provide it with list of names of the
collections you want to create archives for.You can optionally change status output modes and provide a different location for the backup manifest.For example:backupcpy personal projects otherWhy?I needed a simple tool to assemble point-in-time backups. I usebackupcpyto assemble backup archives which are
then automatically rsync'd to hot and cold networked storage.If you are looking for a fully fledged backup system, you might want to look atBorg,Baculaorgit-annex.LicenseLicensed under terms and conditions of Apache 2.0 license.