Saravanan666/pypi-org huggingface dataset:
Package: impact-input
ImpactInPython Class for managing IMPACT-Z/T input files. Includes the ability to read and write input files as well as replace string variables found within the file with numeric values.InstallationThe class can be installed from PyPI, using the following command:pipinstallimpact_inputRead in Input FileReads in the input file specified by filename. Includes the ability to remove comments (i.e lines beginning with ! or anything occuring after a /) using exclude_comments. By defaultexclude_comments = True.fromimpact_inputimportImpactInimpact_file=ImpactIn(filename="ImpactT_original.in")Get all VariablesReturns a list of all variables found in the input file. Variable names cannot start with a number.impact_file.variables()Replace Variables with ValuesReplace the list of variables with the numerical values in the respective order they appear in the list (e.g. gunPhaseF1 becomes 0 below).replace_var=["gunPhaseF1","gunPhaseF2"]val=[0,180]impact_edit=impact_file.replace(varnames=replace_var,varvals=val)Write New Input File IMPACTWrite an input file with the specified filename. Note it is best practice to make the new file have a different name than the initial input so as not to overwite it. As the IMPACT-Z/T executables require the input file to be named "ImpactZ.in" or "ImpactT.in", the initial input file should have a name other than those two options.impact_edit.write(filename='ImpactT.in')ExamplesExamples python scripts that use the ImpactIn class to run a phase scan and find the phase with the maximum energy gain for a RF gun can be foundhere.
Package: impaction-ai
impaction.ai Python SDKThis is the official server-side Python SDK forimpaction.ai. This library allows you to easily send your data to impaction.ai.Visit thefull documentationto see the detailed usage.InstallationInstall the Python SDK with pip:pipinstallimpaction-aiContributionIf you have any issues with the SDK, feel free to open Github issues and we'll get to it as soon as possible.We welcome your contributions and suggestions!
Package: impactlab-tools
Python tools for Climate Impact Lab developersDocumentation:http://impactlab-tools.readthedocs.io.FeaturesOut-of-the-box aggregation & weighting using Impactlab regions & datasetsComputes distributions across ACP and GCP modelsProvides tools for using Climate Impact Lab server configuration filesIntegrates seamlessly into pandas and xarray workflowsUsageFor detailed usage instructions, see thereadthedocs documentationInstallationpip installimpactlab-toolsRequirementsThis package requires Python 3.
Installing with pip will ensure all dependencies are installed correctly.Latest Release NotesSeewhatsnewTodoSeeissuesto see and add to our todos.CreditsThis package was created byJustin SimcockandMichael Delgadoof theClimate Impact Lab. Check us out ongithub.
Package: impactlab-user
UsageInteractive setup for your machine:$pipinstall--upgradeimpactlab_user$impactlab-usersetupallYou’ll need to be ready to configure all Climate Impact Lab tools, specifically:OSDC griffin access keys (get these from griffin)AWS access keys (get these from Mike or Justin)Individual subcommands can be run by specifying them:setupsubcommands:allawsbrcdatafsosdcosdc_datassh_keys
Package: impact-stack-auth-wsgi-middleware
WSGI authentication middlewareThis app is just one piece in our biggerauthorization scheme for microservices.
Its purpose is make migrating to session cookies simpler by ensuring that backend microservices only need to deal with JWTs that contain all the needed claims.Architecture decisionsThe session UUIDs are stored in a redis database that can be reached by the wrapped Flask app.The session UUIDs are passed as cookie values.The redis database contains a JWT for each valid session UUID. The middleware doesn’t care about the actual contents of the JWT it just needs to be there.The session UUIDs in the cookie are signed usingitsdangerous. The middleware only handles session UUIDs with a valid signature.Usagefromimpact_stack.auth_wsgi_middlewareimportAuthMiddlewareapp=Flask(__name__)AuthMiddleware.init_app(app)Configuration variablesThe middleware reads its configuration from the Flaskapp.configdictionary. All variables are prefixed withAUTH_….variabledescriptionAUTH_SECRET_KEYThe secret key used to verify the cookie value’s signature. It defaults toSECRET_KEY.AUTH_SIGNATURE_ALGORITHMA hash function to use as digest method for signing the session IDs. Defaults tohashlib.sha256AUTH_COOKIE_NAMEName of the cookie from which the the session UUID is read. Defaults tosession_uuid.AUTH_REDIS_URLURL to a redis database (see theredis-py documentationfor more information)).AUTH_REDIS_CLIENT_CLASSThe redis client class used by the middleware. Mostly needed for testing. Defaults toredis.RedisAUTH_HEADER_TYPEPrefix used when adding the JWT to the HTTP Authorization header. Defaults to the value ofJWT_HEADER_TYPEwhich in turn defaults to'Bearer'.
Package: impact-stack-observability
Observability for Impact StackA package providing observability features for Flask apps.Health checksTheHealthFlask extension provides health checks via an HTTP API.The list of checks is extendable per app.How it worksWhen called the requested checks run and returnTrueorFalse. Whenallchecks returnTruethe service/app is considered healthy (i.e. in therunningstate), otherwise it is considered to be in adegradedstate.Checks are expected to be a Python callable, which takes no arguments and
returns a boolean.UsageCreate an implementation module, e.g in ahealth.pyfile:"""Instantiate and configure checks."""fromimpact_stack.observabilityimporthealthashealth_health=health_.Health()health.register_check("true",health_.checks.check_true,add_to_defaults=False)@health.register_check("foo",add_to_defaults=False)defcheck_foo():"""Check for availability of foo."""returnTrueInapp.py:importflaskfrom.importhealthapp=flask.Flask(__name__)health.health.init_app(app)No configuration is read fromapp.config. You are supposed to configure and
optionally extend the Health extension in the implementation module.Checking the liveliness of the appYou can do a simple liveliness check at/health/ping(default), which will
just return a200 OKtext response.Checking the service healthA more comprehensive health check is available at/health/(default).
This returns a JSON response with following structure (prettyfied):{"health":"running","available_checks":["true","foo"],"checks":{"foo":true}}Thehealthfield can be of:running: All requested checks returnedtruedegraded: At least one of the checks returnedfalseSpecific checks can be requested with thechecksparameter:/health/?checks=_defaults: Run all the checks registered as defaults, same
as omitting thechecksparameter alltogether/health/?checks=true,foo: Run the listed checksHeaders to prevent caching of the health responses are set.Provided checksSome generic checks are providing in this module.check_trueandcheck_falseDummy checks which return justtrueresp.falsecheck_db(RequiresFlask-SQLAlchemy.)Checks if the DB (using the default SQLAlchemy engine) is available by trying aSELECT 1base_check_api_liveliness(Needs instantiation.)Base check for checking the liveliness of an (external) HTTP API.Example usage:importfunctoolsfromimpact_stack.observabilityimporthealthashealthcheck_example=functools.partial(health_.checks.base_check_api_liveliness,"GET","https://api.example.com/v1/health/ping",200,# expected response status code2.0,# timeout)health.register_check("example",check_example)AuthorizationA simple mechanism to prevent unrestricted calls to the/health/endpoint is
using a shared secret in the HTTP calls.Set the required config variableHEALTH_URL_SECRETto a (random) string and
use the GET paramauthin calls to the endpoint.
Returns401if the secret does not match.
Raises aRuntimeErrorif not set.If theHEALTH_URL_SECRETis set toNone, checking the secret is disabled.
Package: impala
Author:Roman NeuhauserContact:neuhauser@sigpipe.czCopyright:This document is in the public domain.OverviewImpala is aPEP302protocol (sys.meta_pathhook for theimportstatement) implementation allowing the user to import packages and
modules from arbitrarily named directories and files.MotivationComfort and freedom in developmentInstalled interface available without installationLet’s say I’m developing a Python package calledpyoneer.  I want to
lay the source code out like this:README.txt
src/
  __init__.py
  some.py
  more.py
tests/
  ...The question then is, how do Iimport pyoneerin the test files
(<workdir>/tests/...) and have it load<workdir>/src/__init__.py?
The defaultimportmechanism requires packages to live in eponymous
directories.What’s the fuss about, you ask?  I should simply rename thesrcdirectory topyoneeror maybesrc/pyoneer, no?Indeed, this would be tolerable, at least with top-level packages.
However, if I’m working on something that will be available asfoo.bar.bazafter installation, I certainly don’t want to wade
through the desolatesrc/foo/barto get to the source code.Maybe I couldimport srcin the tests instead?  Well, tests are
a form of documentation, and doubly so withdoctest.  “Proper”
documentation (README.txt, etc) can also contain snippets which
should be verifiable without the CUT being installed.Impalato the rescue!from os.path import abspath, dirname
import impala

root = abspath(dirname(__file__))

impala.register(dict(
  pyoneer = '%s/src' % root
))

import pyoneerDescriptionimpala.register(aliases)aliasesis adictmapping from fully-qualified module/package
names to paths to load from.  To import a packagepfrom path/a/b/c,aliasesmust include the keypwith associated value/a/b/c, and/a/b/c/__init__.pymust be a valid package entry
point.  To import a modulemfrom path/f/g/h.py,aliasesmust
include the keymwith associated value/f/g/h.py.Example:from os.path import abspath, dirname
import impala

r = dirname(abspath(__file__))

impala.register({
  'p': '%s/a/b/c' % r,
  'p.q': '%s/f/g/h' % r,
  'p.q.m': '%s/k.py' % r,
})

import p
import p.q
import p.q.mLicensepy-impalais distributed under theMIT license.  SeeLICENSEfor details.InstallationUsingpipfromPyPI, the Python Package Index:pip install impalaFrom acheckoutor extracted tarball:python setup.py installDevelopmentSource code and issue tracker are at Github:https://github.com/roman-neuhauser/py-impala
Package: impala-shell
Impala Interactive ShellYou can use the Impala shell tool (impala-shell) to connect to an Impala
service. The shell allows you to set up databases and tables, insert data,
and issue queries. For ad hoc queries and exploration, you can submit SQL
statements in an interactive session. The impala-shell interpreter accepts
all the same SQL statements listed inImpala SQL Statements,
plus some shell-only commands that you can use for tuning performance and
diagnosing problems.To automate your work, you can specify command-line options to process a single
statement or a script file. (Other avenues for Impala automation via python
are provided by Impyla or ODBC.)Installing$ pip install impala-shellOnline documentationImpala Shell DocumentationApache Impala DocumentationQuickstartNon-interactive modeProcessing a single query, e.g.,show tables:$ impala-shell -i impalad-host.domain.com -d some_database -q 'show tables'Processing a text file with a series of queries:$ impala-shell -i impalad-host.domain.com -d some_database -f /path/to/queries.sqlLaunching the interactive shellTo connect to an impalad host at the default service port (21000):$ impala-shell -i impalad-host.domain.com
Starting Impala Shell without Kerberos authentication
Connected to impalad-host.domain.com:21000
Server version: impalad version 2.11.0-SNAPSHOT RELEASE (build d4596f9ca3ea32a8008cdc809a7ac9a3dea47962)
***********************************************************************************
Welcome to the Impala shell.
(Impala Shell v3.0.0-SNAPSHOT (73e90d2) built on Thu Mar  8 00:59:00 PST 2018)

The '-B' command line flag turns off pretty-printing for query results. Use this
flag to remove formatting from results you want to save for later, or to benchmark
Impala.
***********************************************************************************
[impalad-host.domain.com:21000] >Launching the interactive shell (secure mode)To connect to a secure host using kerberos and SSL:$ impala-shell -k --ssl -i impalad-secure-host.domain.comDisconnectingTo exit the shell when running interactively, pressCtrl-Dat the shell prompt.
Package: impall
🛎 Test-import all modules 🛎Individually and separately imports each Python module or file in a project and
reports warnings or failures at the end.Running impall as a unit testJust inherit from the base class and it will
automatically find and import each file, like this.import impall

class ImpAllTest(impall.ImpAllTest):
    pass(You can copythis fileinto your project if you like.)Tests are customized by overriding one of these following properties in the
derived class.CLEAR_SYS_MODULES, EXCLUDE, FAILING, INCLUDE, MODULES, PATHS,
RAISE_EXCEPTIONS, and WARNINGS_ACTION.For example, to turn warnings into errors, set the property
WARNINGS_ACTION in the derived class definition, like this.class ImpAllTest(impall.ImpAllTest):
    WARNINGS_ACTION = 'error'Running impall as a command-line utility$ impall --warnings_action=error
$ impall -w errorThe properties INCLUDE, EXCLUDE, and PROJECT_PATH can be
lists of strings, or a string separated with colons like
'foo.mod1:foo.mod2'INCLUDE and EXCLUDE match modules, and also allow * as a wildcard.
A single * matches any module segment, and a double ** matches any
remaining segments. For example,INCLUDE = 'foo', 'bar.*', 'baz.**'matchesfoobut notfoo.foomatchesbar.foobut notbarorbar.foo.barmatchesbaz.fooas well asbaz.foo.barbut notbazA note on side-effectsto reduce side-effects,sys.modulesis restored to its original
condition after each import if CLEAR_SYS_MODULES is true, but there might be
other side-effects from loading some specific module.Use the EXCLUDE property to exclude modules with undesirable side
effects. In general, it is probably a bad idea to have significant
side-effects just from loading a module.API Documentation
Package: impaper
text2png通过文本生成图片，会自动计算折行，默认使用自带的等距更纱黑体（简体中文）字体安装pip install impaper使用默认提供了一个能够生成黑底白字的文本渲染器：fromimpaperimportSimpleTextDrawerstd=SimpleTextDrawer()std.conf.typesetting.indentation=">>>"im=std.draw("abcdefg,abcdefg,abcdefg\n""你好世界，你好世界，你好世界。\n""你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，你好世界，")生成结果：SimpleTextDrawer 的可配置项直接修改其属性即可，在文档字符串中有描述：self.fontsize: 字号，默认14self.fg_color: 字体颜色，默认白色 0xffself.bg_color: 背景颜色，默认黑色 0x00self.ts.line_width: 折行宽度，单位是字，默认 48self.ts.indentation: 折行缩进符号，字符串，默认两个空格self.conf.font.path: 重新指定一个字体，需要输入 TTF 格式的字体路径self.conf.layout.margin: 上右下左顺序的四元组，单位 px，默认全 6pxself.conf.layout.padding: 上右下左顺序的四元组，单位 px，默认全 2pxself.conf.layout.spacing: 行距，单位 px，默认 2px
Package: impar
Implementaciones de impuestos argentinosimparutiliza el concepto de contextos de fechas (DateContext) para separar
implementaciones diferentes de los impuestos. Esto se debe a que los impuestos
pueden calcularse de manera diferente dependiendo la fecha que se realizan.Por ejemplo si quiere calcularse elimpuesto a las gananciasal 29 de
diciembre del 2013:>>> import datetime
>>> import impar
>>> ctx = impar.DateContext(datetime.date(2013, 12, 29))
>>> ganancias = ctx.get("ganancias")
>>> ganancias.ganancias(20000, ganancias.CAT_EMPRESA)
700.0Si por otro lado se quiere calcular la ganancia a fecha actual:>>> import impar
>>> ctx = impar.DateContext()
>>> ganancias = ctx.get("ganancias")
>>> ganancias.ganancias(20000, ganancias.CAT_EMPRESA)
700.0No hubo cambios en el impuesto por eso los valores y parametros son iguales.Notas:El contexto se determina como la implementacion inmediatemente anterior
o a la fecha del impuesto dado (puede verificar la fecha de implementacion
del calculo conctc.date_of("ganancias").No todos los impuestos estan disponibles para todas las fechas.
Package: imparaai-BFHScheckers-for-BFHS-programming
A Python3 library that you can use to play a game of checkers/draughts. This is just a set of classes that you can use in your code, it's not an interactive shell checkersgame.#Note:
This is a modified version of theImparaai checkers library.
Alongside the base module (which I forked from the repository at the above link), the Colorama and PrettyTable dependencies are also in use.
The only addition I have made to this module is a graphical representation of the board.AssumptionsThe rules used are for competitive American checkers or English draughts. This means an 8x8 board withforce capturesand regular kings.Each position on the board is numbered 1 to 32. Each move is represented as an array with two values: starting position and ending position. So if you're starting a new game, one of the available moves is[9, 13]for player 1. If there's a capture move, the ending position is the position the capturing piece will land on (i.e. two rows from its original row), which might look like[13, 22].Each piece movement is completely distinct, even if the move is part of a multiple capture series. InPortable Draughts Notationmutli-capture series are usually represented by a5-32(for a particularly long series of jumps), but in certain situations there could be multiple pathways to achieve that final position. This game requires an explicit spelling out of each distinct move in the multi-capture series.UsageCreate a new game:fromBFHScheckers.gameimportGamegame=Game()See whose turn it is:game.whose_turn()#1 or 2Get the possible moves:game.get_possible_moves()#[[9, 13], [9, 14], [10, 14], [10, 15], [11, 15], [11, 16], [12, 16]]Make a move:game.move([9,13])Check if the game is over:game.is_over()#True or FalseFind out who won:game.get_winner()#None or 1 or 2Review the move history:game.moves#[[int, int], [int, int], ...]Change the consecutive noncapture move limit (default40according to therules):game.consecutive_noncapture_move_limit=20game.move_limit_reached()#True or FalseReview the pieces on the board:forpieceingame.board.pieces:piece.player#1 or 2piece.other_player#1 or 2piece.king#True or Falsepiece.captured#True or Falsepiece.position#1-32piece.get_possible_capture_moves()#[[int, int], [int, int], ...]piece.get_possible_positional_moves()#[[int, int], [int, int], ...]Get a string representation of the pieces on the board:str(game.board)Output:TestingRunpython3 -m unittest discoverfrom the root.
Package: imparaai-checkers
A Python3 library that you can use to play a game of checkers/draughts. This is just a set of classes that you can use in your code, it's not an interactive shell checkersgame.Version:1.4.2AssumptionsThe rules used are for competitive American checkers or English draughts. This means an 8x8 board with force captures and regular kings.Each position on the board is numbered 1 to 32. Each move is represented as an array with two values: starting position and ending position. So if you're starting a new game, one of the available moves is[9, 13]for player 1. If there's a capture move, the ending position is the position the capturing piece will land on (i.e. two rows from its original row), which might look like[13, 22].Each piece movement is completely distinct, even if the move is part of a multiple capture series. InPortable Draughts Notationmutli-capture series are usually represented by a5-32(for a particularly long series of jumps), but in certain situations there could be multiple pathways to achieve that final position. This game requires an explicit spelling out of each distinct move in the multi-capture series.UsageCreate a new game:fromcheckers.gameimportGamegame=Game()See whose turn it is:game.whose_turn()#1 or 2Get the possible moves:game.get_possible_moves()#[[9, 13], [9, 14], [10, 14], [10, 15], [11, 15], [11, 16], [12, 16]]Make a move:game.move([9,13])Check if the game is over:game.is_over()#True or FalseFind out who won:game.get_winner()#None or 1 or 2Review the move history:game.moves#[[int, int], [int, int], ...]Change the consecutive noncapture move limit (default40according to therules):game.consecutive_noncapture_move_limit=20game.move_limit_reached()#True or FalseReview the pieces on the board:forpieceingame.board.pieces:piece.player#1 or 2piece.other_player#1 or 2piece.king#True or Falsepiece.captured#True or Falsepiece.position#1-32piece.get_possible_capture_moves()#[[int, int], [int, int], ...]piece.get_possible_positional_moves()#[[int, int], [int, int], ...]TestingRunpython3 -m unittest discoverfrom the root.
Package: imparaai-checkers-for-BFHS-programming
A Python3 library that you can use to play a game of checkers/draughts. This is just a set of classes that you can use in your code, it's not an interactive shell checkersgame.#Note:
This is a modified version of theImparaai checkers library.
Alongside the base module (which I forked from the repository at the above link), the Colorama and PrettyTable dependencies are also in use.
The only addition I have made to this module is a graphical representation of the board.AssumptionsThe rules used are for competitive American checkers or English draughts. This means an 8x8 board withforce capturesand regular kings.Each position on the board is numbered 1 to 32. Each move is represented as an array with two values: starting position and ending position. So if you're starting a new game, one of the available moves is[9, 13]for player 1. If there's a capture move, the ending position is the position the capturing piece will land on (i.e. two rows from its original row), which might look like[13, 22].Each piece movement is completely distinct, even if the move is part of a multiple capture series. InPortable Draughts Notationmutli-capture series are usually represented by a5-32(for a particularly long series of jumps), but in certain situations there could be multiple pathways to achieve that final position. This game requires an explicit spelling out of each distinct move in the multi-capture series.UsageCreate a new game:fromcheckers.gameimportGamegame=Game()See whose turn it is:game.whose_turn()#1 or 2Get the possible moves:game.get_possible_moves()#[[9, 13], [9, 14], [10, 14], [10, 15], [11, 15], [11, 16], [12, 16]]Make a move:game.move([9,13])Check if the game is over:game.is_over()#True or FalseFind out who won:game.get_winner()#None or 1 or 2Review the move history:game.moves#[[int, int], [int, int], ...]Change the consecutive noncapture move limit (default40according to therules):game.consecutive_noncapture_move_limit=20game.move_limit_reached()#True or FalseReview the pieces on the board:forpieceingame.board.pieces:piece.player#1 or 2piece.other_player#1 or 2piece.king#True or Falsepiece.captured#True or Falsepiece.position#1-32piece.get_possible_capture_moves()#[[int, int], [int, int], ...]piece.get_possible_positional_moves()#[[int, int], [int, int], ...]Get a string representation of the pieces on the board:str(game.board)Output:TestingRunpython3 -m unittest discoverfrom the root.
Package: impartial
impartialimpartialis a lightweight extension offunctools.partialthat allows modifying positional and keyword arguments in a functional style.The main idea is that any function wrapped withimpartialgets a methodwith_<keyword>(value)for every keyword argument of that function.
Eachwith_<keyword>(value)method returns a newimpartialfunction with that keyword being modified.>>>fromimpartialimportimpartial>>>@impartial...defpower(x,exponent):...returnx**exponent...>>>powerimpartial(<functionpowerat0x10d54e790>)>>>square=power.with_exponent(2)# behaves like functools.partial(square, exponent=2)>>>squareimpartial(<functionpowerat0x10d54e790>,exponent=2)>>>square(3)9Features:thewith_<keyword>(value)methods can be arbitrarilychainedimpartialfunctions areimmutable: any "modification" of arguments returns a newimpartialfunctionverylightweight(~50 LOC and no dependencies)fullycompatiblewithfunctools.partial(impartialis a subclass offunctools.partial)can be used as adecoratorTo install this package, run:pip install impartial