Saravanan666/pypi-org huggingface dataset:
Package: pyecf
Elliptic Curve FactorizationДанный модуль предназначен для нахождения всех делителей числа
(факторизация, разложение на простые множители). В качестве метода факторизации
используетсяалгоритм, предложенный Хендриком Ленстрой в 1987 году.Использование через скриптСклонируйте репозиторий, и установите зависимости используя:poetrygitclonehttps://github.com/NikitaYurasov/ECF.gitcdECF
poetryinstallpipgitclonehttps://github.com/NikitaYurasov/ECF.gitcdECF
pipinstall-rrequirements.txtИ выполните следующую команду:pythonpyecf.py-n9671406556917033397649407# или любое другое числоИспользование как пакетУстановите пакет используя pip (или любой другой менеджер зависимостей)pipinstallpyecfВнутри проекта использование может выглядеть так:frompyecfimportLenstraAlgorithmn=9671406556917033397649407algo=LenstraAlgorithm(n)factors=algo.factorize()# factors - отсортированный список делителейОписание алгоритмаПусть требуется найти делить числа. Считаем, что у числасуществует делитель(). Сгенерируем тройку чиселдля случайной эллиптической кривойнад, гдеи с условием, что кривая не сингулярна (). Случайной точкой на кривой выберем.Пусть также задано число, обозначающее степень, в которое будем возводить начальную точку:, гдеи-- некоторые целые положительные числа.Следующим шагом выполняется возведение в степень на выбранной кривой:, где операция + определена по следующему алгоритму:Алгоритм сложенияТребуется сложить две точкии:Если, то; если, то.Иначе, пустьa. Найти. Если, то-- делитель. Конец алгоритма.b. Если, то НОД даетКонец алгоритма.c. Если, тогда. Требуется найти.Если,-- делитель, конец алгоритма.В противном случае, если, считаем, что, конец алгоритма.Если, тои.Стоит заметить, что если в ходе алгоритма получается сингулярная кривая, выбор кривой необходимо повторить. Если в ходе алгоритма делитель не нашелся, алгоритм стоит запустить еще раз.Нахождение всех делителей числаПусть заданы два массива: пустой массив для простых делителей и массив с составными делителями.
На первом шаге, во втором массиве находится число.По всем числам из массива составных делителей пока он не пустой:Берем первое число;Проверяем на простоту (тест Миллера-Рабина): если число простое, заносим его в массив
простых чисел, и удаляем первое число из массива составных чисел;Если не простое, проверяем на четность: если число четное, в список простых делителей заносим
2, в список составных -в конец;Если не четное, аналогично проверяем делимость на 3;В противном случае используем алгоритм Ленстры для поиска делителя, пока он не будет найден.
Когда делитель найден, добавляем его ив список составных делителей в конец.Результатом алгоритма будут все числа из списка простых делителей.Скорость работыВремя работы данного алгоритма зависит не от самого факторизуемого числа, а то размера наименьшего делителя.Время работы:
Package: pyECG
pyECG is an opensource Python package which supports read/write of common ECG dataset formats.
Current supported formats are:PhysiobankWFDB(.hea/.dat)iShine-formatted Holter ECG files (.ecg/.ann)Getting StartedThese instructions will get you a copy of the project up and running on your local machine for development and testing
purposes. See deployment for notes on how to deploy the project on a live system.PrerequisitesTo setup pyECG, you need:Python 3.6ishneholterlib==2017.4.11numpy==1.16.2wfdb==2.2.1Installingpip install pyECGBasic UsagefrompyecgimportECGRecord# To load a wfdb formatted ECG recordhea_path="/path/to/your/hea/file"record=ECGRecord.from_wfdb(hea_path)# To load a ishine formatted ECG recordhea_path="/path/to/your/ecg/file"record=ECGRecord.from_ishine(hea_path)time=record.timesignal=record.get_lead(lead_name)print(signal.lead_name)LicenseCopyright 2019 Michael Tao-Yi LeePermission 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.
Package: pyech
OverviewA simple package that streamlines the download-read-wrangling process needed to analyze theEncuesta Continua de Hogaressurvey carried out by the Instituto Nacional de Estadística (Uruguay).Here's what PyECH can do:Download survey compressed files.Unrar, rename and move the SAV (SPSS) file to a specified path.Read surveys from SAV files, keeping variable and value labels.Download and process variable dictionaries.Search through variable dictionaries.Summarize variables.Calculate variable n-tiles.Convert variables to real terms or USD.PyECH does not attempt to estimate any indicators in particular, or facilitate any kind of modelling, or concatenate surveys from multiple years. Instead, it aims at providing a hassle-free experience with as simple a syntax as possible.Surprisingly, PyECH covers a lot of what people tend to do with the ECH survey without having to deal with software licensing.For R users, check outech.InstallationpipinstallpyechDependenciesIn order to unpack downloaded survey files you will need to have unrar in your system. This should be covered if you have WinRAR or 7zip installed. Otherwisesudo apt-get install unraror what's appropiate for your system.UsageFull documentation, including this readme.Run the examples notebook in your browser |Loading a survey is as simple as usingECH.load, which will download it if it cannot be found atdirpath(by default the current working directory).frompyechimportECHsurvey=ECH()survey.load(year=2019,weights="pesoano")Optionally,loadacceptsfrom_repo=True, which downloads survey data from the PyECH Github repository (HDFS+JSON). Loading data this way is significantly faster.ECH.loadalso downloads the corresponding variable dictionary, which can be easily searched.survey.search_dictionary("ingreso",ignore_case=True,regex=True)This will return a pandas DataFrame where every row matches the search term in any of its columns.Calculating aggregations is as simple as usingECH.summarize.survey.summarize("ht11",by="dpto",aggfunc="mean",household_level=True)Which returns a pandas DataFrame with the mean of "ht11" grouped byECH.splitterandby(both are optional). Cases are weighted by the column defined inECH.load.
Package: pyecharts-extras
Latest version works with pyecharts 1.3.1+.Please launch the binder to get an interactive jupyter notebook running.1. Time Series EventUsage of TimeYAxisDateXAxis:importpyecharts.optionsasoptsfrompyecharts_extras.date_timeimportTimeYAxisDateXAxis,DateAxisOpts,TimeAxisOptsfromdatetimeimportdatetimedata=[datetime(2020,9,1,3,11,11),...]data2=[datetime(2020,9,1,1,11,11),...]chart=TimeYAxisDateXAxis(init_opts=opts.InitOpts(height="1000px"))chart.set_global_opts(xaxis_opts=DateAxisOpts(axis_data=all_dates),yaxis_opts=TimeAxisOpts(),tooltip_opts=opts.TooltipOpts(is_show=False))chart.add_data('A',data,symbol_size=10)chart.add_data('B',data2,symbol_size=20)chart.render_notebook()2. ChoroplethMapInstallationYou can install pyecharts-extras via pip:$pipinstallpyecharts-extrasor clone it and install it:$gitclonehttps://github.com/pyecharts/pyecharts-extras.git$cdpyecharts-extras$pythonsetup.pyinstallChange log0.0.5 - 12.09.2020Fixedtime date scatter plot failed to display different sets of data0.0.4 - 06.09.2020Addedit scatters event over time vs date chart so as to spot patterns in events.0.0.3 - 15.07.2019Updatedit use pyecharts 1.3 to draw ChoroplethMap0.0.2 - 09.06.2019Updatedit use pyecharts 1.x to draw ChoroplethMap0.0.1 - 17.04.2019first releaseit draws ChoroplethMap
Package: pyecharts-javascripthon
Introductionpyecharts-javascripthon helps translate Python functions into javascript ones. It usesjavascripthonanddukpyto blend Python codes into javascript runtime. It supports python 2.7, 3.4, 3.5 and 3.6. It works
on Linux, MacOS and Windows platforms.Sample python function:defrenderItem(params,api):values=[api.value(0),api.value(1)]coord=api.coord(values)size=api.size([1,1],values)return{"type":'sector',"shape":{"cx":params['coordSys']['cx'],"startAngle":coord[3]-size[1]/2}}Compiled python functions:functionrenderItem(params,api){varcoord,size,values;values=[api.value(0),api.value(1)];coord=api.coord(values);size=api.size([1,1],values);return{"type":"sector","shape":{"cx":params["coordSys"]["cx"],"startAngle":(coord[3]-(size[1]/2))}};}From Python 2.7 to Python 3.4Internet access is required because it uses javascripthon api as a free service. Down the line,
community sponsorship will be required to cover the running cost of the service.Because the service is still under development, the default api key and api host are subjected
to change. When it does happen please declare these environment variables to continue:for unix alike systems:exportSCRIPTHON_API_ENDPOINT=http://new_ip_address_or_domain_name/translateexportSCRIPTION_API_TOKEN=new_api_keyfor windows systems:setSCRIPTHON_API_ENDPOINT=http://new_ip_address_or_domain_name/translatesetSCRIPTION_API_TOKEN=new_api_keyPython 3.5 - 3.6No internet access is required.Usage1. Only Python 3.5+ code can be transcompiled. If you use python 2.7 or 3.4, you are obliged
to use generic Python codes so that python 2.7 and 3.4 interpreter do not complain.For browsers DOM object, please visitpyecharts_javascripthon.dom.API (Dummy objects)The following are the dummy objects and functions to help you bypass python interpreter.DOM objectswindow,Document,Date,Math,JSON,console,screenfrompyecharts_javascripthon.domimportwindow# for window objectfrompyecharts_javascripthon.domimportDocument# for Document objectfrompyecharts_javascripthon.domimportDate# for Date objectfrompyecharts_javascripthon.domimportMath# for Math modulefrompyecharts_javascripthon.domimportJSON# for JSON modulefrompyecharts_javascripthon.domimportscreen# for screen objectfrompyecharts_javascripthon.domimportconsole# for console objectGlobal functionsfrompyecharts_javascripthon.domimportalert# provide alert dialog to the userYou are welcome to submit PRs to add more objects and functions.Creditsjavascripthon:Alberto BertiDukpy:Alessandro MolinaandSviatoslav SydorenkoInstallationYou can install pyecharts-javascripthon via pip:$pipinstallpyecharts-javascripthonor clone it and install it:$gitclonehttps://github.com/pyecharts/pyecharts-javascripthon.git$cdpyecharts-javascripthon$pythonsetup.pyinstallChange log0.0.6 - 12.05.2018Update its dependency on javascripthon to 0.10.0.0.5 - 04.2018First release
Package: pyecharts-jupyter-installer
InstallationYou can install pyecharts-jupyter-installer via pip:$pipinstallpyecharts-jupyter-installeror clone it and install it:$gitclonehttps://github.com/pyecharts/pyecharts-jupyter-installer.git$cdpyecharts-jupyter-installer$pythonsetup.pyinstallChange log0.0.2 - 12/02/2018UpdatedWell tested working version
Package: pyecharts-plus
pyecharts_plus======|Python2| |Python3|pyecharts_plus is an open source api providing some charts which pyecharts don't have.**Installation**.. code:: bashpip install pyecharts_plus.. |Python2| image:: https://img.shields.io/badge/python-2.7-ff69b4.svg.. |Python3| image:: https://img.shields.io/badge/python-3.5-red.svg
Package: pyechelle
PyEchellePyEchelle is a simulation tool, to generate realistic 2D spectra, in particular cross-dispersed echelle spectra.
However, it is not limited to echelle spectrographs, but allows simulating arbitrary spectra for any fiber-fed or slit
spectrograph, where a model file is available. Optical aberrations are treated accurately, the simulated spectra include
photon and read-out noise.PyEchelle uses numba for implementing fast Python-based simulation code. It also comes withCUDA supportfor major
speed improvements.Example usageYou can use PyEchelle directly from the console:pyechelle--spectrographMaroonX--fiber2-4--sourcesPhoenix--phoenix_t_eff3500-t10--rv100-omdwarf.fitIf you rather script in python, you can do the same as above with the following python script:frompyechelle.simulatorimportSimulatorfrompyechelle.sourcesimportPhoenixfrompyechelle.spectrographimportZEMAXsim=Simulator(ZEMAX("MaroonX"))sim.set_ccd(1)sim.set_fibers([2,3,4])sim.set_sources(Phoenix(t_eff=3500))sim.set_exposure_time(10.)sim.set_radial_velocities(100.)sim.set_output('mdwarf.fits',overwrite=True)sim.run()Both times, a PHOENIX M-dwarf spectrum with the given stellar parameters, and a RV shift of 100m/s for the MAROON-X
spectrograph is simulated.The output is a 2D raw frame (.fits) and will look similar to:Check out theDocumentationfor more examples.Pyechelle is the successor ofEchelle++which has a similar
functionality but was written in C++. This package was rewritten in python for better maintainability, easier package
distribution and for smoother cross-platform development.InstallationAs simple aspipinstallpyechelleCheck out theDocumentationfor alternative installation instruction.UsageSeepyechelle-hfor all available command line options.SeeDocumentationfor more examples.Concept:The basic idea is that any spectrograph can be modelled with a set of wavelength-dependent transformation matrices and
point spread functions which describe the spectrographs' optics:First, wavelength-dependentaffine transformation matricesare extracted from the ZEMAX model of the spectrograph.
As the underlying geometric transformations (scaling, rotation, shearing, translation) vary smoothly across an echelle
order, these matrices can be interpolated for any intermediate wavelength.Second, a wavelength-dependentpoint spread functions (PSFs)is applied on the transformed slit images to properly
account for optical aberrations. Again, the PSF is only slowly varying across an echelle order, allowing for
interpolation at intermediate wavelength.Both, the matrices and the PSFs have to be extracted from ZEMAX only once. It is therefore possible to simulate
spectra without access to ZEMAXCitationPlease cite thispaperif you find this work useful in your research.
Package: py-echo
py-echoecho your code with colors, backgrounds, and stylesInstallationpipinstallpy-echoUsagefromechoimportecho#Fully stylizedecho("Hello World!",# text"red",# color"green",# background"bold",# style"this is my first ",# unstylized string before" printed with py-echo!!"# unstylized string after))#only colorecho("Hello World!",# text"red",# color"",# background"",# style"",# unstylized string before""# unstylized string after))#Manual usefromechoimportbackgrounds,colors,styles,closeprint(backgrounds['blue']+colors['black']+styles['underline']+"Hello World!"+close)Avaliable ParametersColorsblackredgreenorangebluepurplecyanlightgreydarkgreylightredlightgreenyellowlightbluepinklightcyanBackgroundsblackredgreenorangebluepurplecyanlightgreyStylesbolddisableunderlinereverseinvisible
Package: pyechorobotics
pyechoroboticsAllows control and reads status of robot lawn mowers by echorobotics.Used byHome Assistant Echorobotics integration.Example:importsysimportechoroboticsapiimportaiohttpimportasyncioimportloggingasyncdefmain():asyncwithaiohttp.ClientSession(cookies=echoroboticsapi.create_cookies(user_id="your-user-id",user_token="user-user-token"))assession:api=echoroboticsapi.Api(session,robot_ids=["your-robot-id"])print(awaitapi.last_statuses())print(awaitapi.set_mode("chargeAndWork"))if__name__=="__main__":logging.basicConfig(stream=sys.stdout,level=logging.DEBUG)loop=asyncio.new_event_loop()loop.run_until_complete(main())Unfortunately, the API doesn't tell is which mode ("chargeAndWork", "work" or "chargeAndStay") the robot is in.
We can make an educated guess though, depending on what we set ourselves, history events and the status.
This is what SmartMode does:importsysimportechoroboticsapiimportaiohttpimportasyncioimportloggingasyncdefmain():asyncwithaiohttp.ClientSession(cookies=echoroboticsapi.create_cookies(user_id="your-user-id",user_token="user-user-token"))assession:api=echoroboticsapi.Api(session,robot_ids=["your-robot-id"])smartmode=echoroboticsapi.SmartMode("your-robot-id")api.register_smart_mode(smartmode)print(awaitapi.history_list())print(awaitapi.last_statuses())print(smartmode.get_robot_mode())if__name__=="__main__":logging.basicConfig(stream=sys.stdout,level=logging.DEBUG)loop=asyncio.new_event_loop()loop.run_until_complete(main())See also src/main.pySmartFetchWhile callinglast_statuses()andhistory_list()regularly (suggestion every 2min and 15min), this is somewhat wasteful of bandwidth.
Especiallyhistory_list()uses some 60KiB of data volume. If calling this every 15mins is an issue for you, you may be interested in
SmartFetch.importsysimportechoroboticsapiimportaiohttpimportasyncioimportloggingasyncdefmain():asyncwithaiohttp.ClientSession(cookies=echoroboticsapi.create_cookies(user_id="your-user-id",user_token="user-user-token"))assession:api=echoroboticsapi.Api(session,robot_ids=["your-robot-id"])smartmode=echoroboticsapi.SmartMode("your-robot-id")api.register_smart_mode(smartmode)smartfetch=echoroboticsapi.SmartFetch(api)last_statuses=awaitsmartfetch.smart_fetch()print(last_statuses)print(smartmode.get_robot_mode())if__name__=="__main__":logging.basicConfig(stream=sys.stdout,level=logging.DEBUG)loop=asyncio.new_event_loop()loop.run_until_complete(main())Dev notesTo make a new release, use GitHub website and draft a release manually.
Make sure the version number in pyproject.toml matches the new tag.
GitHub Actions will publish it to pypi.Adding a new stateIf a new state is found, it must be added tomodels.py.
Also checknotify_laststatuses_received()insmart_mode.pyif it should be recognized as a specific Mode.Finally, in home-assistant-echorobotics-integration, increment the version number in the manifest.json.
Also check the translations in echorobotics/translations, and any custom dashboard code.
Package: pyEchosign
AboutA Python module for connecting to the Adobe Echosign REST API, without
the hassle of dealing with the JSON formatting for requests/responses
and the REST endpoints and their varying requirementsDocumentationThe most up to date documentation can be found onpyEchosign’s RTD
page.Maintained on GitLabThis project is maintained onGitLaband mirrored toGitHub.
Issues opened on the latter are still addressed.NotesJSON DeserializationMost classes contain two methods to facilitate the process of receiving
JSON from the REST API and turning that into Python classes. One,json_to_X()will handle the JSON formatting for a single instance,
while the second -json_to_Xs()processes JSON for multiple
instances. Generally, the latter is simply returning a list
comprehension that calls the former.While this is primarily useful for internal purposes - every method
retrieving anAgreementfrom the API will callAgreement.json_to_agreement()for example - the methods are not
private and available for use. Any changes to their interface will only
be made following deprecation warnings.Internal Methods and ClassesAll protected and private methods; and any classes, functions, or
methods found underpyEchosign.utilsare subject to change without
deprecation warnings however.
Package: pyECLAT
pyECLATUnlike the a priori method, the ECLAT method is not based on the calculation of confidence and lift, therefore the ECLAT method is based on the calculation of the support conjunctions of the variables.pyECLAT is a simple package for associating variables based on the support of the different items of a dataframe.This method returns two dictionaries, one with the frequency of occurrence of the items conjunctions and the other with the support of the items conjunctions.InstallVia pippip3 install pyECLATVia githubgit clone https://github.com/jeffrichardchemistry/pyECLAT
cd pyECLAT
python3 setup.py installDependenciesnumpy>=1.17.4, pandas>=0.25.3, tqdm>=4.41.1How to useThis package has two dataframes as example, its possible to use:from pyECLAT import Example1, Example2
ex1 = Example1().get()
ex2 = Example2().get()The working dataframe should look like the one below. In this case, each line represents a customer's purchase at a supermarket.01230milkbeerbreadbutter1coffebreadbutterNaN2coffebreadbutterNaN3milkcoffebreadbutter4beerNaNNaNNaN5butterNaNNaNNaN6breadNaNNaNNaN7beanNaNNaNNaN8ricebeanNaNNaN9riceNaNNaNNaNThis package works directly with a pandas dataframe without column's name.Example: Making your dataframeimport pandas as pd
dataframe = pd.read_csv('dir/of/file.csv', header=None)Run ECLAT method:from pyECLAT import ECLAT
eclat_instance = ECLAT(data=dataframe, verbose=True) #verbose=True to see the loading barAfter gettingeclat_instance, a binary dataframe is automatically generated, among other resources that can be accessed:eclat_instance.df_bin   #generate a binary dataframe, that can be used for other analyzes.
eclat_instance.uniq_    #a list with all the names of the different itemseclat_instance.support, eclat_instance.fitand eclat_instance.fit_allare the functions to perform the calculations. Example:get_ECLAT_indexes, get_ECLAT_supports = eclat_instance.fit(min_support=0.08,
                                                           min_combination=1,
                                                           max_combination=3,
                                                           separator=' & ',
                                                           verbose=True)It is possible to access the documentation, as well as the description, of each method using:help(eclat_instance.fit)
help(eclat_instance.fit_all)
help(eclat_instance.support)
Package: pyeco
useful python thingsadd classclass _type_sign(Enum):SIGN=1UNSIGN=2envfrom pyeco import *from pyeco import _type_signfunction: dec2hex(_dec,_nbits)_dec -> input decimal:8 bits[-128,127],16 bits[-32768,32767],32 bits[-2147483648,2147483647]_nbits -> _dec's number bits: 8,16,32output -> dec to hex formatexample:print(dec2hex(-127,8))function: hex2dec(_hex,_nbits,_s)_hex -> input hex:_nbits -> _dec's number bits: 8,16,32_s -> _type_sign.UNSIGN/_type_sign.SIGN output decimaloutput -> hex to decimal formatexample:print(hex2dec(0x81010181,32,_type_sign.UNSIGN))function: dec2bin(_dec,_nbits)_dec -> input decimal_nbits -> _dec's number bits: 8,16,32output -> dec to binary formatexample:print(dec2bin(-128,16))function: bin2dec(_bin,_nbits,_s)_bin -> input binary:_nbits -> _dec's number bits: 8,16,32_s -> _type_sign.UNSIGN/_type_sign.SIGN output decimaloutput -> bin to decimal formatexample:print(bin2dec("11111111111111111111111110000000",32,_type_sign.UNSIGN))function: hex2bin(_hex,_nbits)_hex -> input hex:_nbits -> _dec's number bits: 8,16,32output -> hex to binary formatexample:print(hex2bin(0x81010181,32))function: bin2hex(_bin,_nbits)_bin -> input hex:_nbits -> _dec's number bits: 8,16,32output -> binary to hex formatexample:print(bin2hex("1100000000000011",16))envfrom pyeco import *from pyeco import _adr_sizebindiff(_file1,_file2,_nbits,_size,_flag,_base_adr)_file1 - first file,_file2 - second file,_nbits - word's number bits: 8,16,32,_size - how much words to compare_flag - screen adress by _nbits words or bytes_base_adr - base adress, need for real dats locationoutput -> binary difference between _file1 and _file2example:bindiff("e:/spil.bin","e:/u-boot.bin",32,int(0xce0/4),_adr_size.BYTE,0xe6300000)envfrom pyeco import *function: max_array(in_array)in_array - входной массивoutput -> вычисляет MAX значение числа из массива in_array и выводит на консольexample:import numpy as npin_array = np.array([-176,3,148,-10,36,238,-76])max_array(in_array)