Saravanan666/pypi-org huggingface dataset:
Package: actproxy
actproxyPython package providingactproxy.comAPI access and proxy rotation methods for requests (synchronous) and aiohttp
(asyncio). Can also be used independently. Supports socks5, http/https, and ipv4/ipv6 as per actproxy's services.Quick-Start (AIOHTTP)importactproxyfromaiohttpimportClientSessionasyncdefmain():actproxy_api_keys=["xxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxx"]# Initialize API. Also returns your proxies.awaitactproxy.aioinit(actproxy_api_keys)# Use a new AIOHTTP connector which rotates & uses the next proxy.asyncwithClientSession(connector=actproxy.aiohttp_rotate())assession:url="http://dummy.restapiexample.com/api/v1/employees"asyncwithsession.get(url)asresp:ifresp.status==200:resp_json=awaitresp.json()print(resp_json)Quick-Start (Requests)importactproxyimportrequestsactproxy_api_keys=["xxxxxxxxxxxxxxxxxxxxxxxx","xxxxxxxxxxxxxxxxxxxxxxxx"]# Initialize API. Also returns your proxies.actproxy.init(actproxy_api_keys)url="http://dummy.restapiexample.com/api/v1/employees"resp=requests.get(url,proxies=actproxy.rotate())ifresp.status_code==200:resp_json=resp.json()print(resp_json)Methodsactproxy.aioinit(api_keys:List=None,output_format:DumpFormat='json',get_userpass:Boolean=True)->Union[FlatList,str,None]Fetches your proxies from ActProxy & returns them. Must be run before the other aiohttp
functions.actproxy.init(api_keys:List[str],output_format:DumpFormat='json',get_userpass:Any=True)->Union[FlatList,str,None]Fetches your proxies from ActProxy & returns
them. Must be run before the other synchronous functions.actproxy.aiohttp_rotate(protocol:ProxyProto/str,return_proxy:Boolean=False)->Union[ProxyConnector,Tuple[Data,ProxyConnector]]Returns an aiohttp connector which uses the next proxy from your list.actproxy.async_rotate_fetch(url:str,protocol:ProxyProto/str='socks5',return_proxy:Boolean=False)->DataRotate proxies and perform a GET request. Returns a Data object ofresponse.status_code,response.text, andresponse.headers.actproxy.rotate(protocol:ProxyProto='socks5')->DataReturns the next proxy from your list. Return variable is suitable for use with requests[socks].actproxy.random_proxy(protocol:ProxyProto='socks5')->DataReturns a random proxy from your list. Return variable is suitable for use with
requests[socks].actproxy.aiohttp_random(protocol:ProxyProto='socks5',return_proxy:Boolean=False)->Union[ProxyConnector,Tuple[Data,ProxyConnector]]Returns an aiohttp connector which uses uses a random proxy from your list.actproxy.one_hot_proxy()->DataSimilar to rotate() but returns a single proxy dict/object for use in places other than
aiohttp or requests.Changelog0.1.9-11/09/2020: New asyncio rotation methods based on python_socks.0.1.8-10/28/2020: Fixed versioning typo.0.1.7-10/28/2020: Relax Python version constraint (3.8-4.0).0.1.6-10/24/2020: Lock aiohttp version fixingaiohttp #51120.1.5-10/24/2020: Rotator bug fix. CSV fix. Better type-hints & coverage.0.1.4-10/23/2020: Support multiple API keys. Unit tests. Fixes.0.1.3-9/29/2020: Minor fixes and addition of docstrings.0.1.2-9/28/2020: Initial release version.
Package: actr
Python ACT-R (fork)A Python implementation of the ACT-R cognitive architecture developed at the Carleton Cognitive Modelling (CCM) Lab.The original pip package is calledpython_actr.ForkThis fork ofpython_actrby Andy Maloney is not affiliated with the CCM lab.I created it because the main repository isn't being updated and I need a stable, running version via pip for mygactarproject.Changes are noted in theCHANGELOG.The pip package for this fork is namedactr.CompatibilityAlthough this pip package is namedactr, it still usespython_actras its package name.This keeps this pip package compatible with the officialpython_actrone, howeveryou should only have one of them installed at a time. As far as I can tell, there's no way to enforce this using pip, so if thepython_actrpackage is already installed, run:pipuninstallpython_actrInstall(Before installing, please see note above about compatibility with thepython_actrpackage.)pip3installactrUseWhen writing code, you use it the same way you use thepython_actrpackage:frompython_actrimport*To run a file, make sure the package is installed with pip (see above), then you can just run it like this:python3tutorials/hello_world.pyRun TestsmaketestI know there are a bunch of failures - these exist inpython_actras well & I am not planning to investigate at this time...
Package: actrecipemagicfile
actrecipemagicfile (A CFFI fork of python-magic)actrecipemagicfileis a Python interface to the libmagic file type identification library. libmagic identifies file types by checking their headers against a predefined list. This functionality is accessible from the command line using the Unix commandfile.Usage>>>importmagicfileasmagic>>>magic.from_file("testdata/test.pdf")'PDF document, version 1.2'>>>magic.from_buffer(open("testdata/test.pdf").read(1024))'PDF document, version 1.2'>>>magic.from_file("testdata/test.pdf",mime=True)'application/pdf'There is also aMagicclass that provides more direct control,
including overriding the magic database file and turning on character
encoding detection.  This is not recommended for general use.  In
particular, it's not safe for sharing across multiple threads and
will fail throw if this is attempted.>>>f=magic.Magic(uncompress=True)>>>f.from_file('testdata/test.gz')'ASCII text (gzip compressed data, was "test", last modified: Sat Jun 2821:32:522008,fromUnix)'You can also combine the flag options:>>>f=magic.Magic(mime=True,uncompress=True)>>>f.from_file('testdata/test.gz')'text/plain'Licenseactrecipemagicfileis distributed under the MIT license.  See the included
LICENSE file for details.Note: This package is mostly used in an internal project.
Package: actseg
Reference Action Segmentation Evaluation CodeThis repository contains the reference code for action segmentation evaluation.If you have a bug-fix/improvement or if you want to add a new features please send a pull request or open an issue.InstallationTheactseglibrary is available onPyPI.pipinstallactsegDevelopmentmakeinit
maketestExample UsageAll the metrics have the same api.fromactseg.evalimportMoFAccuracy,Editpred1=[0,0,0,1,0,1,1,1,0]pred2=[1,2,3,0,0,1,2,3,0,0,0,1,2,3,0,0,0,0]target1=[0,0,1,1,2,1,1,0,0]target2=[1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3]metrics=[MoFAccuracy(),Edit()]forp,tinzip([pred1,pred2],[target1,target2]):forminmetrics:m(targets=t,predictions=p)forminmetrics:print(m)# MoF: 0.3333333333333333# Edit: 52.5MetricsFrame-wise MetricsMoF (Accuracy)F1ScoreIoDIoUSegment-wise MetricsEdit (Edit distance or matching score)Specifying Ignore ClassFor some Metrics it is possible to specify the indices of classes to ignore (e.g. Background) by
passingignore_idsparameter to the constructor.AcknowledgementPlease seesrc/actseg/externalfor external sources used in this project.
Package: actspotter
Theactspotteris a library / tensorflow model for detecting activities. It allows to classify body activities in images or videos. The package is limited to videos and images with only one person by design.The following classes are available:nonepull_up_uppull_up_downpull_up_nonepush_up_uppush_up_downpush_up_nonesit_up_upsit_up_downsit_up_noneThe package is currently in early development.Future plansTensorflow model deployment will be integrated soon. Currently this package allows to classify push-ups, sit-ups and pull-ups. In future version kicks and others body activities will follow.It is also planned to provide a signal processing layer that allows to easily detect connected activites and count them.Another application will be to integrate with keyboard drivers so that activities could be used for controlling video games (e.g. by kicks).InstallationInstall this library in avirtualenvusing pip.virtualenvis a tool to
create isolated Python environments. The basic problem it addresses is one of
dependencies and versions, and indirectly permissions.Withvirtualenv, it’s possible to install this library without needing system
install permissions, and without clashing with the installed system
dependencies.Supported Python VersionsPython >= 3.6Mac/Linuxpip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install actspotterWindowspip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install actspotterExample UsageRequirement: cv2 (opencv) installed.Classification of images:importcv2importtensorflowastffromactspotterimportImageClassifier,classify_image_input_dimension,class_namesdef_resize(frame,dim=classify_image_input_dimension):frame=cv2.resize(frame,dim,interpolation=cv2.INTER_AREA)returnframedef_to_tf_array(frame,dim=classify_image_input_dimension):frame=_resize(frame,dim)frame=cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)frame=tf.convert_to_tensor(frame,dtype=tf.float32)returnframeimages=[to_tf_array(cv2.imread("test.jpg")),]print(class_names)print(image_classifier.classify_images(images))Classification of a video:importcv2importtensorflowastffromactspotterimportVideoClassifier,classify_image_input_dimensiondef_resize(frame,dim=classify_image_input_dimension):returnframedef_to_tf_array(frame,dim=classify_image_input_dimension):frame=_resize(frame,dim)frame=cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)frame=tf.convert_to_tensor(frame,dtype=tf.float32)returnframecap=cv2.VideoCapture(0)video_classifier=VideoClassifier(buffer_size=4)video_classifier.start()whilecap.isOpened():ret,frame=cap.read()ifret==True:video_classifier.add_image(to_tf_array(frame))state=video_classifier.get_last_classification()print(state)frame=resize(frame,dim=(600,600))cv2.putText(frame,f"{state}",(10,40),0,2,255)cv2.imshow("Frame",frame)waitkey=cv2.waitKey(25)&0xFFifwaitkey==ord("q"):breakvideo_classifier.exit()cap.release()cv2.destroyAllWindows()
Package: act-types
ACT typesIntroductionThese scripts are used to add types to theACTdata model (object types and fact types).InstallationThis project requires that you have a running installation of theact-platform.Install from pippipinstallact-typesBreaking changes2.0 Updated data modelThis version includes breaking changes to the data model. It is advised to do a reimport of all data and import using act-worker with version >= 2.0.0.The following changes are implemented:act-types and act-graph-datamodel is moved to act-admin and act-utils.Local developmentUse pip to install inlocal development mode. act-types (and act-api) uses namespacing, so it is not compatible with usingsetup.py installorsetup.py develop.In repository, run:pip3install--user-e.It is also necessary to install in local development mode to correctly resolve the files that are read by the--default-*options when doing local changes. These are read from etc under act.types and if the package is installed with "pip install act-types" it will always read the files from the installed package, even though you do changes in a local checked out repository.
Package: actuapy
Copyright (c) 2019 Rei MizutaPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description: # Setuppyenv1.2.7Python3.6.5anaconda3-5.2.0# Usage` bash python setup.py install # for install python setup.py test # for test `Platform: UNKNOWN
Description-Content-Type: text/markdown
Package: actuarialCalculations
This package includes financial math calculations for actuarial calculations such as annuity calculations, amortization schedule, sinking fund calculations and constructing tables with those formulas.Installationpip install actuarialCalculationsAnnuity CalculationsCalcuating present value:
Assuming our user would like to know the downpayment amount with provided kwargs below;Logic:
terms, period and interest amount rate. Price - (presentValue* _N _ Repay Amount ) = Down paymentCalculating the future value:
Assuming our user pays at the end of the given period, so our program should accumulate the value with gthe iven interest rate;Logic:
Accumulated Down payment(1+i)**N = Accumulated Price(1+i)*N - (AccumulatedValue_N _ Repay Amount)Calculating The Down Payment with Given Time Value:
Assuming our user wants to calculate the downpayment with the given period of timeLogic:
Accumulated Down payment = Accumulated Price ** T -(presentValue * Repay Amount ) ** T- (AccumulatedValue * Repay Amount)**-(N+T) / (1+i)**TUSAGE.. code:: python'''
Present Value method takes 5 parameters as intergers and returns downpayment amount
'''
presentValue = PresentValue(
    InterestRate, effectiveInterestTerms, fixedPeriod, repayAmount, price)

'''
Accumulated Value method takes 5 parameters as intergers and returns downpayment amount (future value)
'''
accumulatedValue = AccumulatedValue(
    InterestRate, effectiveInterestTerms, fixedPeriod, repayAmount, price)

'''
Calculate Given Time method takes 5 parameters as intergers and returns downpayment amount at any given time.
'''
calculateGivenTime = CalculateGivenTime(
    InterestRate, effectiveInterestTerms, fixedPeriod, repayAmount, price)Amortization Schedule Calculationmethod takes 4 parametersInterest rate
Years
Frequency of the interest that hits in that period of time
Loan AmountUSAGE.. code:: python'''Create an instance of CalctulateAmortization class and pass the parameters as intergers '''
calculate = CalctulateAmortization(interestRate, years, frequency, loanAmount)
'''To run the calculations we need to call execute funtion '''
calculate.execute()Sinking Fund Calculationmethod takes 4 parametersInterest rate
Years
Frequency of the interest that hits in that period of time
AmountUSAGE.. code:: python''' Create an instance of CalculateSinkingFund class and pass the parameters as integers'''
calculate = CalculateSinkingFund(interestRate, years, frequency, amount)
'''To run the calculations we need to call execute funtion '''
calculate.execute()CONTACTThe package is created by Sadik Erisen. Please send email tofserisen@gmail.comif you have questions or comments.LICENCEMIT
Package: actuarialmath
This Python package implements fundamental methods for modeling life contingent risks, and closely follows the coverage of traditional topics in actuarial exams and standard texts such as the “Fundamentals of Actuarial Math - Long-term” exam syllabus by the Society of Actuaries, and “Actuarial Mathematics for Life Contingent Risks” by Dickson, Hardy and Waters.OverviewThe package comprises three sets of classes, which:Implement general actuarial methodsBasic interest theory and probability lawsSurvival functions, expected future lifetimes and fractional agesInsurance, annuity, premiums, policy values, and reserves calculationsAdjust results forExtra mortality risks1/mthly payment frequency using UDD or Woolhouse approachesSpecify and load a particular form of assumptionsRecursion inputsLife table, select life table, or standard ultimate life tableMortality laws, such as constant force of maturity, beta and uniform distributions, or Makeham’s and Gompertz’s lawsQuick Startpip install actuarialmathalso requiresnumpy,scipy,matplotlibandpandas.Start Python (version >= 3.10) or Jupyter-notebookSelect a suitable subclass to initialize with your actuarial assumptions, such asMortalityLaws(or a special law likeConstantForce),LifeTable,SULT,SelectLifeorRecursion.Call appropriate methods to compute intermediate or final results, or tosolveparameter values implicitly.Adjust the answers withExtraRiskorMthly(or itsUDDorWoolhouse) classes.Examples# SOA FAM-L sample question 5.7
from actuarialmath import Recursion, Woolhouse
# initialize Recursion class with actuarial inputs
life = Recursion().set_interest(i=0.04)\
                  .set_A(0.188, x=35)\
                  .set_A(0.498, x=65)\
                  .set_p(0.883, x=35, t=30)
# modfy the standard results with Woolhouse mthly approximation
mthly = Woolhouse(m=2, life=life, three_term=False)
# compute the desired temporary annuity value
print(1000 * mthly.temporary_annuity(35, t=30)) #   solution = 17376.7# SOA FAM-L sample question 7.20
from actuarialmath import SULT, Contract
life = SULT()
# compute the required FPT policy value
S = life.FPT_policy_value(35, t=1, b=1000)  # is always 0 in year 1!
# input the given policy contract terms
contract = Contract(benefit=1000,
                    initial_premium=.3,
                    initial_policy=300,
                    renewal_premium=.04,
                    renewal_policy=30)
# compute gross premium using the equivalence principle
G = life.gross_premium(A=life.whole_life_insurance(35), **contract.premium_terms)
# compute the required policy value
R = life.gross_policy_value(35, t=1, contract=contract.set_contract(premium=G))
print(R-S)   # solution = -277.19ResourcesJupyter notebookorrun in Colab, to solve all sample SOA FAM-L exam questionsUser Guide, ordownload pdfAPI referenceGithub repoandissues
Package: actuariat-python
actuariat_pythonMaterials for training sessions used at
l’Institut des Actuaires.GitHub/actuariat_pythondocumentationBlogThis extension is not actively developed. Most of the content is added toensae_teaching_csandpapierstat.
Most of the content is in French.Historycurrent - 2021-01-05 - 0.00Mb0.0.0 - 2021-01-05 - 0.00Mb13: move CI to python 3.9 (2021-01-05)12: move CI to python 3.7 (2019-04-20)10: replace basemap by cartopy (2018-08-26)11: replace flake8 by code_style (2018-04-14)9: écrire la correction de l’examen 2017 (2017-06-15)8: remplacer le lien sur la table de mortalité (2017-02-25)7: fixer le test unitaire sur sur le gerry mandering (2017-02-23)5: concevoir un énoncé pour un examen (2017-02-23)4: terminer la correction du gerry mandering (2017-02-23)3: ajouter une séance sur la manipulation de grosses données avec comme exemple des statistiques d’utilisation de wikipedia (2016-12-27)1: unit test using matplotlib is failing (2016-06-18)
Package: act-utils
ACT UtilitiesIntroductionThis repository contains utility scripts for theACT Platform.InstallationThis project requires that you have a running installation of theact-platform.Install from pippipinstallact-utilsact-graph-datamodel usageBuild a graph (graphviz) of the ACT data model.act-graph-datamodel--help
usage:act-graph-datamodel[-h][--uidUID][--http_usernameHTTP_USERNAME][--http_passwordHTTP_PASSWORD][--parent_idPARENT_ID][--confluence_urlCONFLUENCE_URL][--confluence_userCONFLUENCE_USER][--confluence_passwordCONFLUENCE_PASSWORD]urlLocal developmentUse pip to install inlocal development mode. act-utils (and act-api) uses namespacing, so it is not compatible with usingsetup.py installorsetup.py develop.In repository, run:pip3install--user-e.
Package: actymath
actymathActuarial formulae and commutation functions for life insurance products (with a fast Pandas backend)Read this firstThis started out as a package to build up the various actuarial formulae using the Pandas backend for speed.The way it works is to create a 'grid' of actuarial calculation vectors in a pandas DataFrame that you can use for a single policy or a single cohort.When you ask for a particular actuarial formula or calculation to be created, it will spawn the columns needed to generate it.Everything is using Pandas in the backend, so you can use any normal Pandas machinery you like.This is very much 'in development'.UsageInstallationInstall using pippip install actymathGetting startedThisgetting started notebookillustrates how to use the package with a simple example.Actuarial formulaThe formula definitions are calledcolumnsin this package as they spawn columns in a pandas DataFrame.These formulae can be explored in theactymath/columns directory.Mortality tablesCurrently only a few old standard mortality tables are implemented, but there is support for 1D and 2D mortality tableshere.New 1D and 2D mortality tables can be loaded in from CSV or pandas DataFrames.ContributingFeel free to contribute or suggest improvements.Add suggested improvements as a GitHub issue on this projectPull requests also welcomed, particularly for any fixes, new tables or useful actuarial formulaeDeveloper setupClone this repository usinggit clone git@github.com:ttamg/actymath.gitDependencies usepoetryso make sure you havepoetry already installedon you development machine.With poetry, you create a new virtual environment for yourself and activate it usingpoetry shellTo install all the dependencies in your new virtual environment, usepoetry installRunning testsWe usepytestfor all testing. Run the test pack usingpytest
Package: actyon
actyonAction with a Y! Why? Causeasyncis in the box.actyonoffers an approach on a multiplexed flux pattern using coroutines (PEP 492).InstallpipinstallactyonDocumentationSeeDocumentationExamplesGithub API(Actyon)Counter(Flux)Traffic Light(State Machine)IdeaAn actyon is defining an isolated execution run.Producers are called onall combinationsof input dependencies.Consumers are called onall results at once.Dependencies are available in any kind of structure.Dependencies are injected according to function signatures.Missing dependencies are ignored, unless no producer can be executed.ImplicationsSynchronization points areStartConclusion of all producersEndProducers are called asynchronously at onceConsumers are called asynchronously at onceTyping is mandatoryCoroutines for producers and consumers are mandatoryPython 3.8+ is requiredNerd SectionGreat, but who needs this?First of all, this is an open source project for everybody to use, distribute, adjust or simply carve out whatever you need. For me it's a case study on dependency injection and coroutines, so don't expect this to be a masterpiece.Are you serious? Python is not Java, we don't need DI.Aside from answer N° 1, I want to make clear I'm not a java developer getting started with python. I love python and its capabilities. So making python even greater and more accessible to the people is the key to me. Maybe DI is a step towards that, maybe it's not. Still, this code may provide other developers with an idea to accomplish exactly that.Gotcha. Why did you decide on this approach?Once you start developing software, you want it to simplify things. That's the whole definition of a software developer by the way: we are lazy by definition. Anyway, this code shows how you can multiplex tasks and sync them on the interface level. Your tasks are executed asynchronously all together, results are gathered and in the end they are being processed further - again, asynchronously all together. The decorator functionality allows for the application of the SOLID principle, which is pretty neat:Single-responsibility principleOpen–closed principleLiskov substitution principleInterface segregation principleDependency inversion principleIn this code the bottom two are quite shallow and not really applicable, but let's not get stuck with this. Another key feature of the functional interface is the simplicity. Define an action, use the decorators on whatever functions you have and just execute it. It even got a nice console output when you addhook=actyon.DisplayHook()to theActyon's constructor. Try it out, but caution: parallel actyon execution will break the rendering.