Saravanan666/pypi-org huggingface dataset:
Package: plaincities
plaincities is a library of places in many languages. It is based ongeonamesdatabase.Installationpip install plaincitiesUsageLoad options:fromplaincitiesimportGlobeglobe=Globe(load_all=True)globe=Globe(continents_to_load=['AF','AS'])globe=Globe(countries_to_load=['IN','MX'])globe=Globe()india=globe['IN']india.load_cities()Hierarchy & Administrative Divisions:fromplaincitiesimportGlobeglobe=Globe(countries_to_load=['MY'])malaysia=globe['MY']medium_cities=list(malaysia.cities.filter(lambdax:x.population>100000andx.population<1000000andx.districtisnotNone))['/'.join([c.state.name,c.district.name,c.name,c.admin_division.name])forcinmedium_cities][0:10]['Johor/Daerah Batu Pahat/Batu Pahat/Place',
'Johor/Daerah Johor Baharu/Kampung Pasir Gudang Baru/Place',
'Johor/Daerah Johor Baharu/Skudai/Section',
'Johor/Daerah Johor Baharu/Johor Bahru/City',
'Johor/Daerah Keluang/Kluang/Place',
'Johor/Daerah Muar/Muar town/Place',
'Selangor/Petaling/Shah Alam/Place',
'Selangor/Klang/Klang/Place',
'Sabah/Kota Kinabalu/Kota Kinabalu/City',
'Sabah/Lahad Datu/Lahad Datu/Place']Coordinates:globe=Globe(countries_to_load=['IN'])india=globe['IN']kochi=india.cities.find('Kochi')(kochi.latitude,kochi.longitude)(9.93988, 76.26022)globe=Globe(countries_to_load=['IN'])india=globe['IN']varanasi=india.cities.find('Varanasi')new_delhi=india.cities.find('New Delhi')f'~{round(varanasi.distance_to(new_delhi)/1000)}km.''~682 km.'Timezones:globe=Globe(countries_to_load=['MX'])mexico=globe['MX']merida=mexico.cities.find('Merida')merida.timezone.key'America/Merida'Switching languages:fromplaincitiesimportGlobeglobe=Globe(language='zh',countries_to_load=['CN'])china=globe['CN']beijing=china.cities.find('北京')(china.name,beijing.name,beijing.ascii_name)('中国', '北京', 'Beijing')Suggestions:fromplaincitiesimportGlobeglobe=Globe(countries_to_load=['GR'])greece=countries['GR']list(greece.cities.suggest('Tesaloniki',threshold=0.7))['Heraklion', 'Thessaloniki']Generating language filesDefault installation supports English, Turkish, French, Spanish, Chinese, Russian and Arabic.
If you need other languages, you need to download the following files from thegeonames websiteand put them into the same folder:countryInfo.txt, alternateNamesv2.zip, admin1CodesASCII.txt, admin2Codes.txt, cities(N).zipfromplaincitiesimportgeneratorGenerator('data','new_values').generate_values('cities15000.txt',languages=['ko'],default_language='ko')fromplaincitiesimportGlobeglobe=Globe(countries_to_load=['TH'],path='new_values')thailand=countries['TH']thailand.name'태국'Contact:ufuk.kocolu@proton.me
Package: plain-json-logging
plain-json-loggingis a simple logging for a JSON data.Installation:$ pip install plain-json-loggingUsage:fromplain_json_loggingimportPlainJsonLogginglogging=newPlainJsonLogging()logging.error('this is error.)logging.warn('this is warn.')logging.info('foo').info('bar').info('baz')The result is found instderrlike this:{"timestamp":"2020-01-10T00:06:24.855159","level":"ERROR","message":"this is error."}{"timestamp":"2020-01-10T00:06:24.855159","level":"WARN","message":"this is warn."}{"timestamp":"2020-01-10T00:06:24.855159","level":"INFO","message":"foo"}{"timestamp":"2020-01-10T00:06:24.855159","level":"INFO","message":"bar"}{"timestamp":"2020-01-10T00:06:24.855159","level":"INFO","message":"baz"}Options:fromplain_json_loggingimportPlainJsonLogginglogging=newPlainJsonLogging(file=sys.stdout,strftime='%Y-%m-%d%H:%M:%S.%f%z',timezone='America/Chicago',timedelta=+540,# 9 hourstimestampname='@timestamp',messagename='@message',levelname='lev',levelinfo=0,levelwarn=1,levelerror=2,constextra={name:'Example'})The following parameters can modify how the logging behaves:file:the writablefile object. Default:sys.stderr.strftime:theformat. Defalut:datetime.datetimedefault.timezone:theTZ database name. Default:UTC.timedelta:thetimedelta. Theminuteis a unit. Default:0.timestampname:the name fortimestamp. Default:timestamp.messagename:the name formessage. Default:message.levelname:the name forlevel. Default:level.levelinfo:the value for the levelinfo. Default:INFO.levelwarn:the value for the levelwarn. Default:WARN.levelerror:the value for the levelerror. Default:ERROR.constextra:the default additional items for each log
(the value must be a dictionary object): Default:None.API:PlainJsonLogginghas the following three methods:infowarnerrorAll the methods returns thePlainJsonLogginginstance itself.
Therefore,method chainingcan be used for logging:fromplain_json_loggingimportPlainJsonLogginglogging=newPlainJsonLogging()logging.info('foo').info('bar').info('baz')Extra Payload:All the methods can receives extra payload.fromplain_json_loggingimportPlainJsonLogginglogging=newPlainJsonLogging(file=sys.stdout,strftime='%Y-%m-%d%H:%M:%S.%f%z',timezone='Asia/Tokyo',timedelta=0,timestampname='@timestamp',messagename='@message',levelname='lev',levelinfo=0,levelwarn=1,levelerror=2,constextra={name:'Example'},)logging.info('this is info.',{'infoData':'this is a extra payload for info.'})logging.warn('this is warn.',{'warnData':'this is a extra payload for warn.'})logging.error('this is error.',{'errData':'this is a extra payload for error.'})The result is found instdoutlike this:{"@timestamp":"2020-01-13 07:17:06.370000+0900","lev":0,"@message":"this is info.","name":"Example","infoData":"this is a extra payload for info."}{"@timestamp":"2020-01-13 07:17:06.370000+0900","lev":1,"@message":"this is warn.","name":"Example","warnData":"this is a extra payload for warn."}{"@timestamp":"2020-01-13 07:17:06.370000+0900","lev":2,"@message":"this is error.","name":"Example","errData":"this is a extra payload for error."}
Package: plain-logger
plain_logger - Make logging simple and easyAn easy to use helper pip package to help you log details at any point in code.AssumptionsAssuming python is installed on your system.InstallationInstallplain_loggeron your system using :pip install plain_loggerUsageLogInfoLogs data with 'INFO' tag.LogWarnLogs data with 'WARN' tag.LogErrorLogs data with 'ERROR' tag.LogDebugLogs data with 'DEBUG' tag.LogMessageLogs data with a custom tag.Examplefrom Logger.Logger import Logger

def foo():
    try:
        fname = "John"
        lname = "Doe"
        Logger.LogInfo ("Name = {} {}".format(fname, lname))

        x = 0
        Logger.LogDebug("x = {}".format(x))

        y = -1
        Logger.LogWarn("Something may be wrong.")

        raise ValueError('A very specific bad thing happened.')

    except Exception as e:
        Logger.LogError("Exception occurred: {}".format(str(e)))

foo()Output:[2019-02-09 22:31:55] INFO : Test
[2019-02-09 22:31:55] WARN : Test
[2019-02-09 22:31:55] ERROR : Test
[2019-02-09 22:31:55] DEBUG : Test
[2019-02-09 22:31:55] DEBUG : Test, TAG
[2019-02-09 22:31:55] INFO : Name = John Doe
[2019-02-09 22:31:55] DEBUG : x = 0
[2019-02-09 22:31:55] WARN : Something may be wrong.
[2019-02-09 22:31:55] ERROR : Exception occurred: A very specific bad thing happened.
Package: plainml
PlainMLPainless Machine Learning for python based onscikit-learn.Installpip install plainmlExamplefromplainmlimportKnnModel,load_iris,train_test_splitdt=load_iris()data=dt.datatarget=dt.targetx_train,x_test,y_train,y_test=train_test_split(data,target,test_size=0.2)model=KnnModel(x_train,y_train)model.fit()print(model.score(x_test,y_test))print(model.predict([[5.1,3.5,1.4,0.2]]))model.save(file_name='iris_knn.pkl')LicenseMIT
Package: plain_obj
A faster alternative to namedtuple.Basic UsageCreationimportplain_objConfig=plain_obj.new_type('Config','is_debug, skips_dist, run_tests')config=Config(True,False,True)ifconfig.is_debug:print("This is a verbose debugging message.")Make a dictconfig.as_dict()Unpackingis_debug,_,run_tests=configWhen to useplain_objinstead ofnamedtuple?When faster creation time matters to you.Comparingplain_objwithnamedtupleinPython 2.7:In[3]:%timeitcollections.namedtuple('Point',['x','y','z'])1000loops,bestof3:338µsperloopIn[4]:%timeitplain_obj.new_type('Point',['x','y','z'])10000loops,bestof3:97.8µsperloopIn[5]:Point=collections.namedtuple('Point',['x','y','z'])In[6]:NewPoint=plain_obj.new_type('Point',['x','y','z'])In[7]:%timeitPoint(1,2,3)Theslowestruntook7.99timeslongerthanthefastest.Thiscouldmeanthatanintermediateresultisbeingcached.1000000loops,bestof3:507nsperloopIn[8]:%timeitNewPoint(1,2,3)Theslowestruntook6.70timeslongerthanthefastest.Thiscouldmeanthatanintermediateresultisbeingcached.1000000loops,bestof3:462nsperloopIn[9]:p=Point(1,2,3)In[10]:new_p=NewPoint(1,2,3)In[11]:%timeitp.x,p.y,p.zTheslowestruntook9.92timeslongerthanthefastest.Thiscouldmeanthatanintermediateresultisbeingcached.1000000loops,bestof3:408nsperloopIn[12]:%timeitnew_p.x,new_p.y,new_p.zTheslowestruntook11.70timeslongerthanthefastest.Thiscouldmeanthatanintermediateresultisbeingcached.10000000loops,bestof3:163nsperloopComparingplain_objwithnamedtupleinPython 3.6:In[3]:%timeitcollections.namedtuple('Point',['x','y','z'])382µs±3.82µsperloop(mean±std.dev.of7runs,1000loopseach)In[4]:%timeitplain_obj.new_type('Point',['x','y','z'])53.5µs±1.2µsperloop(mean±std.dev.of7runs,10000loopseach)In[5]:Point=collections.namedtuple('Point',['x','y','z'])In[6]:NewPoint=plain_obj.new_type('Point',['x','y','z'])In[7]:%timeitPoint(1,2,3)521ns±2.5nsperloop(mean±std.dev.of7runs,1000000loopseach)In[8]:%timeitNewPoint(1,2,3)438ns±5.53nsperloop(mean±std.dev.of7runs,1000000loopseach)In[9]:p=Point(1,2,3)In[10]:new_p=NewPoint(1,2,3)In[11]:%timeitp.x,p.y,p.z282ns±2.52nsperloop(mean±std.dev.of7runs,1000000loopseach)In[12]:%timeitnew_p.x,new_p.y,new_p.z148ns±1.7nsperloop(mean±std.dev.of7runs,10000000loopseach)As you can see, it’s faster in all cases includingtype creation,object instantiationandattribute access.
Package: plainquotes
Auto plain nested quotesThe purpose of this package is to provide a simple way to get a correct scaped nested quoted string from an unescaped one. The input string uses a combination of single and double quotes. The output one is always using one type of quotes but scaping it wherever needed.Getting startedInstallation via pip:pipinstallplainquotesUsing it:fromplainquotesimportplain_quotesprint(plain_quotes("""'This is a "simpler" quoted string'"""))Output:'This is a \'simpler\'quotedstring'
Package: plain-transformers
Simple way to use transformer modelsFeaturesMultimodal Transformer (text, text -> text; for example for Automatic Post-Editing task);Label smoothing loss;Unlikelihood loss (sentence-level and for full context),arxiv;LayerDrop technique for transformer encoder/decoder layers,arxiv;Pre/Post LayerNorm encoders (Decoders in process),arxiv;ADMIN Initialization (in future),arxiv;Top-k/Top-p sampling with temperature,arxiv;Installationpip install plain-transformersUsageMultimodal transformer example with two tokenizers:Step one: import model and some usefull staff;importtorchfromplain_transformers.modelsimportMultimodalTransformerfromplain_transformers.layersimportMultimodalTransformerDecoderfromplain_transformers.layersimportTransformerEncoderfromplain_transformersimportBPEWrapperfromplain_transformers.initializationsimportnormal_initialization,initialize_weightsfromplain_transformers.samplers.nucleus_samplerimportNucleusSamplerimportyoutokentomeasyttmStep two: train and load tokenizers;# train your encoder tokenizeryttm.BPE.train(...,model='encoder_tokenizer.model')# train your decoder tokenizeryttm.BPE.train(...,model='decoder_tokenizer.model')# load tokenizersencoder_tokenizer=BPEWrapper(model='encoder_tokenizer.model')decoder_tokenizer=BPEWrapper(model='decoder_tokenizer.model')Step three: init out model configuration;cfg={'d_model':768,'first_encoder':{'first_encoder_vocab_size':encoder_tokenizer.vocab_size(),'first_encoder_max_length':512,'first_encoder_pad_token_id':encoder_tokenizer.pad_id,'first_encoder_token_type_vocab_size':2,'first_encoder_n_heads':8,'first_encoder_dim_feedforward':2048,'first_encoder_num_layers':3,'first_encoder_type':'post_ln'},'second_encoder':{'second_encoder_vocab_size':encoder_tokenizer.vocab_size(),'second_encoder_max_length':512,'second_encoder_pad_token_id':encoder_tokenizer.pad_id,'second_encoder_token_type_vocab_size':2,'second_encoder_n_heads':8,'second_encoder_dim_feedforward':2048,'second_encoder_num_layers':3,'second_encoder_type':'post_ln'},'decoder':{'decoder_max_length':512,'decoder_vocab_size':decoder_tokenizer.vocab_size(),'decoder_pad_token_id':decoder_tokenizer.pad_id,'decoder_token_type_vocab_size':2,'decoder_n_heads':8,'decoder_dim_feedforward':2048,'decoder_num_layers':3,'decoder_type':'post_ln'},}Step four: initialize model and apply weight initialisation (with default parameterstd=0.02);model=MultimodalTransformer(TransformerEncoder,TransformerEncoder,MultimodalTransformerDecoder,cfg['d_model'],**cfg['first_encoder'],**cfg['second_encoder'],**cfg['decoder'],share_decoder_head_weights=True,share_encoder_decoder_embeddings=False,share_encoder_embeddings=True,)initialize_weights(model,normal_initialization,init_range=0.02)Step five: train our model like ordinary seq2seq;train(model,...)Step six: initialize Sampler and generate model answer;sampler=NucleusSampler(model,encoder_tokenizer=(encoder_tokenizer,encoder_tokenizer),decoder_tokenizer=decoder_tokenizer)sampler.generate('Hello Bob, what are you doing?',second_input_text='Fine, thanks!',top_k=5)ExampleYou can find working example of NMThere.
Package: plaited
plaited 🪢plaited is aPandocfilterthat usesJupyterkernelsto generate code notebooks.
It's a flexible tool for publishing documents that include code execution in a variety of languages and formats.
It is a fork ofKnitty, which is a fork ofStitch, which used code fromknitpyandnbconvert.Installationplaited is available on TestPyPI:pip install -i https://test.pypi.org/simple/ plaitedI will publish it to PyPI once it is more mature.Getting Startedplaited is plug-and-play with Pandoc:pandoc--filterplaited-oout.htmlinput.mdMotivationWhy another code notebook generator?Ultimately, plaited is a personal project that I work on for my own benefit.
After reading about Codebraid, Stitch, and Knitty, I wanted a similar tool that meets the following criteria:Pandoc filterembrace Pandoc AST, allowing other filters, templates, or Pandoc itself to make any formatting decisionsusePanfluteto manage document elementsJupyter clientembraceJupyter kernelsas the means of code executionuseJupyter Clientto interface with the kernelsmodern Python packageaim to write hackable, maintainable codeuse modern setuptools configurationContributingYou are more than welcome to submit a pull request to this repository, or open an issue, or send me an email…I'd love to hear from you!Thanksplaited builds upon the work of hundreds of people! Here are a handful of them:John MacFarlaneand other contributors toPandocSergio Correiaand other contributors toPanfluteTom Augspurger, who wroteStitchPeter Zagubisalo, who createdKnittyJan Katins, who wroteknitpySimilar tools that influenced this project:KnitrbyYihui XieCodebraidbyGeoffrey M. Poorepandoc-plotbyLaurent P. René de CotretJupyter BookLicenseThere seems to have been a misunderstanding by previous developers of this project regarding license compatibility.StitchandKnitty, by Tom Augspurger and Peter Zagubisalo respectively, were released using theMIT License.
Their code is adapted from theknitpyandIPythonprojects, both released under BSD licenses.
I am not a lawyer, but I do not believe that BSD licenses are compatible with the MIT license.
I hope that by relicensing this project under the Modified (3-Clause) BSD License, work by all prior contributors is being used according to their original licenses.
This is not legal advice, and I welcome any feedback regarding the licensure of this repository.
Package: plams
PLAMS is a library providing powerful, flexible and easily extendable Python interface to molecular modeling programs. It takes care of input preparation, job execution, file management and output data extraction. It helps with building advanced data workflows that can be executed in parallel, either locally or by submitting to a resource manager queue.Please check the project’s GitHub page for more information:https://github.com/SCM-NV/PLAMSPLAMS is an Open Source project supported bySoftware for Chemistry & Materials B.V.
Package: plan
Cron jobs in Python.Plan is easySave in a schedule.py:fromplanimportPlancron=Plan()cron.command('ls /tmp',every='1.day',at='12:00')cron.command('pwd',every='2.month')cron.command('date',every='weekend')if__name__=="__main__":cron.run()And run it:$pipinstallplan$pythonschedule.pyLinksdocumentationgithubdevelopment version
Package: plana
PlanaPlana is part of the Rayse library for hp-FEA.InstallationUse the package managerpipto install Plana:pipinstallplanaLicensePlana is licensed underGNU LGPLv3.This software relies on thePyO3library undertheApache-2.0license for ffi and ontherayoncrate under theMITandApache-2.0licenses for parallelism.
Package: planadversity
[![Stories in Ready](https://badge.waffle.io/powellc/planadversity.png?label=ready&title=Ready)](https://waffle.io/powellc/planadversity)[![Build Status](https://travis-ci.org/powellc/planadversity.svg?branch=master)](https://travis-ci.org/powellc/planadversity)Hack LabsOur mission at Hack Labs is to create a program where young people are provided
with inspiration and guidance to create and make things using software and
hardware.TechnologyWe’d love to be able to provide kids from the middle school level on up with a
chance to play with the following technologies, amongst pretty much anything
else:ArduinoRaspberry PiLinux as a desktopPythonRubyPHPC/C++Android/Java development
Package: planajob
This is a sales order and purchasin packageversion 5.1.2 corrects a bug which was in version 5.1.1version 5.2.1 is for windows. My screen reso is 1024x768 which is not really big enough
if you can set a bigger screen then set line 893 to a bigger height
for windows delete line 18 is not required so delete it or comment it out
Similarly lines 758, 896 and 898planajob6 is the same functions as version 5 but it uses a nicer menu systemit includes list of cutomer details and suppliers
you can enter sales and purchase orders
invoice print out is includedDownload to a directory of your choice and cd to that directory.edit line 17 of planajob3.py to point to your directorytype python planajob5.py or whatever the .py file is called.the main menu will appearclick on setup and again setup on the sub menu This will set up the database file in your directoryThe other menu options should be obvious but note that when addin a new record you will see a box with a number of lineEnter the details as promptedthere are 4 type of transactions:listings eg of customer details
adding a record eg a new stock record
Issuing or receiving stock
printing an invoicewhen listin, if the page is too long then click on any blank part of the screen and use the up/down keys on the keyboard
you can use gedit to edit or print the output
when adding a new record you will find that some records cannot be duplicated eg stock.
If you enter a duplicate you will see a warning at the bottom. just click ok and try again
issuing or receiving stock will update the stock record and also the issued field in the order
printing an invoice is where you would like to use gedit to print outAny problems please email toterryhugheskirkcudbright@yahoo.co.uk
Package: planarfibers
PlanarFibersThis repository contains a Python package calledplanarfiberswhich contains selected contributions of the paper@article{BauerBoehlke2022,author={Julian Karl Bauer and Thomas Böhlke},title={On the dependence of orientation averaging mean field homogenization on planar fourth-order fiber orientation tensors},journal={Mechanics of Materials},volume={170},pages={104307},year={2022},issn={0167-6636},doi={https://doi.org/10.1016/j.mechmat.2022.104307},url={https://www.sciencedirect.com/science/article/pii/S0167663622000886},keywords={Fiber orientation tensor, Anisotropy, Elasticity, Small strain, Mean field homogenization, Fiber reinforced composites, Closure approximation},}Please seelicense,acknowledgmentand cite thepaper given aboveand the latestZenodo-DOI.InstallationClonethis repository to your machineOpen a terminal and navigate to your local cloneInstall the package from the local clone into the currentenvironmentin develop mode:pythonsetup.pydevelopNote:Develop vs. installExamplesBoth example notebooks and example scripts are renderedhereand given as sourcehere.AcknowledgmentThe research documented in this repository has been funded by the German Research Foundation (DFG) within the
International Research Training Group“Integrated engineering of continuous-discontinuous long fiber reinforced polymer structures“ (GRK 2078).
The support by theGerman Research Foundation (DFG)is gratefully acknowledged.
Package: planarpy
PlanarPyA fast hp-FEA program for the membrane Poisson equationc(Δu) = -fusing variable order triangle elements (orders 1-20) with heterogeneous p-refinement.InstallationUse the package managerpipto install PlanarPy.pipinstallplanarpyUsageThe Mesh object requires a list of point tuples, pts = [(x0,y0), (x1,y1), ...], a list triangle node tuples, cells
= [(0,1,2), (2,5,6), ...], and a base power, pow = 2, to initialize.Define groups using boolean functions. Always use both coordinates x,y for all function definitions. Groups are used to
define Dirichlet boundary conditions and may also be used to set volume forces on part of the domain. If no group is
chosen when setting a volume force, a default group is used.fromplanarpyimportMesh,Dom,sin,cos# it is up to the user to define points and cells# either manually or by using a foreign library.# here the domain is assumed to be [-10, 10]x[-10, 10]# enable the reverse Cuthill Mckee algorithm (rcm) for# increased memory alignmentmesh=Mesh(pts,cells,1,rcm=True)# define groupsouter=mesh.def_group(lambdax,y:x==-10.orx==10.ory==-10.ory==10.)left_half=mesh.def_group(lambdax,y:x<=0.)# p-refinementmesh.adapt_p(left_half,10)# domain setupdom=Dom(mesh)# define Dirichlet boundarydom.set_boundary(outer)# get the amount of free and constrained degrees of freedompos_dofs,neg_dofs=dom.dofs()# set material constant cdom.set_consts(1.)# set boundary condition, default is 0dom.embed_bcond(lambdax,y:[sin(x)+cos(y)],outer)# set force in the domaindom.set_force(lambdax,y:[sin(x)+cos(y)])# solvedom.solve()# measure error with an exact solutionerr=dom.err(lambdax,y:[sin(x)+cos(y)])PlottingPlanarPy offers three functions in order to extract graphical data in the form of lines# mesh plotsys=dom.plot_sys()# displacement plot with 5 segments per linedisp=dom.plot_disp()# displacement plot with a given# number of segments per linesmooth=dom.plot_smooth(50)The functions return three lists, x, y, z, for line coordinates.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicensePlanarPy is licensed underGNU LGPLv3.This software relies on thePyO3library under
theApache-2.0license for ffi and on
therayoncrate under theMITandApache-2.0licenses for parallelism.