Saravanan666/pypi-org huggingface dataset:
Package: simple-fisheye-calibrator
simple_fisheye_calibratorSimple GUI-based correction of fisheye images. The correction parameters specified on the screen can be diverted to opencv's fisheye correction parameters. Supports execution via Docker.Fisheye image before calibration(Sample) Fisheye image after calibration1. Install1-1. Launching with Docker (with USB Camera / HostPC GUI, Docker Image size: 1.4GB)simple_capturexhost+local:&&\dockerrun-it--rm\-v`pwd`:/home/user/workdir\-v/tmp/.X11-unix/:/tmp/.X11-unix:rw\--device/dev/video0:/dev/video0:mwr\--net=host\-eXDG_RUNTIME_DIR=$XDG_RUNTIME_DIR\-eDISPLAY=$DISPLAY\--privileged\pinto0309/simple_fisheye_calibrator:0.0.11\/bin/bash-c'sudo simple_capture'# 1. Capture one test image from the USB camera with "c" on the keyboard# 2. Exit the capture application with "q" on the keyboardsimple_fisheye_calibrator# Still imagexhost+local:&&\dockerrun-it--rm\-v`pwd`:/home/user/workdir\-v/tmp/.X11-unix/:/tmp/.X11-unix:rw\--device/dev/video0:/dev/video0:mwr\--net=host\-eXDG_RUNTIME_DIR=$XDG_RUNTIME_DIR\-eDISPLAY=$DISPLAY\--privileged\pinto0309/simple_fisheye_calibrator:0.0.11\simple_fisheye_calibrator--file_pathfisheye_test.jpgor# USB Camera: video0xhost+local:&&\dockerrun-it--rm\-v`pwd`:/home/user/workdir\-v/tmp/.X11-unix/:/tmp/.X11-unix:rw\--device/dev/video0:/dev/video0:mwr\--net=host\-eXDG_RUNTIME_DIR=$XDG_RUNTIME_DIR\-eDISPLAY=$DISPLAY\--privileged\pinto0309/simple_fisheye_calibrator:0.0.11\/bin/bash-c'sudo simple_fisheye_calibrator --file_path 0'1-2. Installation on the host PC$pip3install-Usimple_fisheye_calibrator2. Usage$simple_capture# 1. Capture one test image from the USB camera with "c" on the keyboard# 2. Exit the capture application with "q" on the keyboard# Still image$simple_fisheye_calibrator--file_pathxxx.jpg# USB Camera: video0$simple_fisheye_calibrator--file_path0or$sudopip3installcvuiPillowopencv_pythonnumpy--upgrade
$gitclonehttps://github.com/PINTO0309/simple_fisheye_calibrator.git&&\cdsimple_fisheye_calibrator

$python3simple_fisheye_calibrator/simple_capture.py# 1. Capture one test image from the USB camera with "c" on the keyboard# 2. Exit the capture application with "q" on the keyboard# USB Camera: video0$python3simple_fisheye_calibrator/simple_fisheye_calibrator.py--file_path03. Parameterusage:
simple_fisheye_calibrator.py \
  [-h] \
  [--file_path FILE_PATH] \
  [--window_size_width WINDOW_SIZE_WIDTH] \
  [--window_size_height WINDOW_SIZE_HEIGHT]

optional arguments:
  -h, --help
      show this help message and exit
  --file_path FILE_PATH
      File path of the still image (e.g. xxx.jpg) or device number of the camera (e.g. 0)
  --window_size_width WINDOW_SIZE_WIDTH
      Default window size width
  --window_size_height WINDOW_SIZE_HEIGHT
      Default window size height
Package: simplefit
simplefitA python package that cleans the data, does basic EDA and returns scores for basic classification and regression modelsOverviewThis package helps data scientists to clean the data, perform basic EDA, visualize graphical interpretations and analyse performance of the baseline model and basic Classification or Regression models, namely Logistic Regression, Ridge on their data.FunctionsFunction NameInputOutputDescriptioncleanerdataframelist of 3 dataframesLoads and cleans the dataset, removes NA rows, strip extra white spaces, etc  and returns clean dataframeplot_distributionsdataframe,bins,dist_cols,class_labelAltair histogram plot objectcreates numerical distribution plots on either all the numeric columns or the ones provided to itplot_corrdataframe,corrAltair correlation plot objectcreates correlation plot for all the columns in the dataframeplot_splomdataframe,pair_colsAltair SPLOM plot objectcreates SPLOM plot for all the numeric columns in the dataframe or the ones passed by the userregressortrain_df,target_col,numeric_feats,categorical_feats,text_col,cvdataframePreprocesses the data, fits baseline model(Dummy Regressor) andRidgewith default setup and returns model scores in the form of a dataframeclassifiertrain_df,target_col,numeric_feats,categorical_feats,text_col,cvdataframePreprocesses the data, fits baseline model(Dummy Classifier) andLogistic Regressionwith default setup and returns model scores in the form of a dataframeOur Package in the Python EcosystemThere exists a subset of our package as standalone packages, namelyauto-eda,eda-report,quick-eda,s11-classifier. But these packages only do the EDA or just the classification usingXGBoostClassifier. But with our package, we aim to do all the basic steps of a ML pipeline and save the data scientist's time and effort by cleaning, preprocessing, returning grpahical visualisations from EDA and providing an insight about the basic model performances, after which the user can decide which other models to use.Installation$pipinstallgit+https://github.com/UBC-MDS/simplefitUsageContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.ContributorsThis python package was developed by the following Master of Data Science program candidates at the University of the British Columbia:Mohammadreza Mirzazadeh@rezam747Zihan Zhou@zzhzoeNavya Dahiya@nd265Sanchit Singh@Sanchit120496Licensesimplefitwas created by Reza Zoe Navya Sanchit. It is licensed under the terms of the MIT license.Creditssimplefitwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.
Package: simple-flatten-json
Usagesimple_json_flatten_py is a Python library for flattening complex JSONsFrom{"a":[{"b":37},{"c":64}],"g":26}To{
  "a_b":37,
  "a_c":64,
  "g":26
}fromsimple_flatten_json_pyimportsimple_flatten_json# Sample JSON datadata={"cat":[{"fish":"tuna"},{"chicken":3},{"medicine":{"pills":5}}]}# returns a flattened json# {"cat_0_fish": "tuna",  "cat_1_chicken": 3,"cat_2_medicine_pills": 20}print(simple_flatten_json.flatten_json(data))
Package: simpleflow
Simpleflow[![Pypi Status](https://badge.fury.io/py/simpleflow.png)](https://badge.fury.io/py/simpleflow) [![Build Status](https://travis-ci.org/botify-labs/simpleflow.svg?branch=main)](https://travis-ci.org/botify-labs/simpleflow)Simpleflow is a Python library that provides abstractions to write programs in
thedistributed dataflow paradigm.
It coordinates the execution of distributed tasks withAmazon SWF.It relies onfuturesto describe the dependencies between tasks. AFutureobject
models the asynchronous execution of a computation that may end.  It tries to mimic
the interface of the Pythonconcurrent.futureslibrary.FeaturesProvides aFutureabstraction to define dependencies between tasks.Define asynchronous tasks from callables.Handle workflows with Amazon SWF.Implement replay behavior like the Amazon Flow framework.Handle retry of tasks that failed.Automatically register decorated tasks.Encodes/decodes large fields to S3 objects transparently (aka "jumbo fields").Handle the completion of a decision with more than 100 tasks.Provides a local executor to check a workflow without Amazon SWF (seesimpleflow --localcommand).Provides decider and activity worker process for execution with Amazon SWF.Ships with thesimpleflowcommand.simpleflow --helpfor more information
about the commands it supports.You can read more in theFeaturessection of the documentation.OverviewPlease read and even run thedemoscript to have a quick glance ofsimpleflowcommands. To run thedemoyou will need to start decider
and activity worker processes.Start a decider with:$ simpleflow decider.start --domain TestDomain --task-list test examples.basic.BasicWorkflowStart an activity worker with:$ simpleflow worker.start --domain TestDomain --task-list quickstartThen execute./extras/demo.More informationRead the main documentation athttps://botify-labs.github.io/simpleflow/.
Package: simple-fpa
A package for the "Nonparametric inference on counterfactuals in sealed first-price auctions" paper by Pasha Andreyanov and Grigory Franguridi.It contains a class that fits the auction data using a symmetric first-price auction model with either additive or multiplicative heterogeneity, and predicts latent valuations and counterfactuals.The interface of the package consists of 4 steps.pass a dataframe with auctionid and bid column namespass covariate (continuous and discrete) column names and create bid residuals and fitted valuesfit the non-parametric modelpredict latent bids, and also expected total surplus, potential bidder surplus and revenue, as functions of exclusion levelArxiv and Github repositoryhttps://arxiv.org/abs/2106.13856https://github.com/pandreyanov/pashas_simple_fpaSample codePackage can be installed via pip from terminalpipinstallsimple_fpaImport typical auction datafromsimple_fpaimportModel,load_haileimportpandasaspdimportnumpyasnpimportmatplotlibasmplimportmatplotlib.pyplotaspltfrompylabimportrcParamsrcParams.update({"text.usetex":True,"font.family":"serif","font.serif":["Arial"],"lines.linewidth":1,"figure.dpi":200})data=load_haile()Residualize the bids, print summarymodel=Model(data=data,auctionid_columns=['auctionid'],bid_column='actual_bid')cont_covs=['adv_value','hhi','volume_total_1']disc_covs=['year','forest']model.residualize(cont_covs,disc_covs,'multiplicative')# we can pick a smaller subset of auctionsmodel.data=model.data[model.data.auctionid.isin(list(set(model.data.auctionid.values))[:1000])].copy()# we can pick certain numbers of biddersmodel.data=model.data[model.data._bidders.isin([2,3,4,5])].copy()model.summary()Trim the residuals, fit the model and predict latent valuationsmodel.trim_residuals(10)model.fit(smoothing_rate=0.34,trim_percent=5,boundary='reflect')model.predict()Plot statisticsmodel.make_ci_asy(95,hyp='twosided')model.plot_stats()Make confidence intervals and confidence bandsmodel.make_cicb(95,draws=1000,hyp='twosided')Find optimal exclusion levelmodel.find_optimal_u()Plot counterfactualsmodel.plot_counterfactuals()Inspect the datamodel.data.sample(5)PredictionsThe counterfactuals are populated into the original dataset, ordered by the magnitude of bid redisuals. Some observations will not have a prediction, as they will be ignored (trimmed) in the non-parametric estimation. I use underscore in front of all variables created by the package._resid: bid residuals_fitted: bid fitted values_trimmed: variable takes 1 if observations were omitted (trimmed) and 0 otherwise_u: u-quantile levels, takes values between 0 and 1_hat_q: estimate of quantile density of bid residuals_hat_v: estimate of quantile function of value residuals_latent_resid: same as_hat_v_hat_ts: total surplus as function of exclusion level u_hat_bs: (one) potential bidder surplus as function of exclusion level u_hat_rev: auctioneer revenue as function of exclusion level uq_ci,v_ci,_bs_ci,_ts_ci,_rev_ci: simulated confidence intervalsq_cb,v_cb,_bs_cb,_ts_cb,_rev_cb: simulated confidence bandsq_cia,v_cia,_bs_cia,_rev_cia: asymptotic (theoretical) confidence intervals
Package: simple-fpdf
Simple FPDFA simplified version of the FPDF package.Aim of this packageThis package aims to make it easier to generate a PDF, without concerning yourself with the difficulties of keeping track of the (x,y) position inside the document.A simple row-column system is used to generate a PDF and insert text.
Since this extends the FPDF package, all the FPDF functionalities are still included.Getting startedInstallInstall with pip.pipinstallsimple-fpdfImportImport the package and SimpleFPDF.fromsimple_fpdfimportSimpleFPDFHow to useInitialize SimpleFPDFSimpleFPDF is initialized the same as a normal FPDF. You can also use thewidthandheightparameters. If noformat,widthorheightis specified, A4 will be used.pdf=SimpleFPDF(orientation='P',unit='mm',format="A4")pdf=SimpleFPDF(orientation='P',unit='mm',width=210,height=297)Defining the rows and columnsSimpleFPDF makes use of a simple row-column system where all the rows on the page have an equal height.
Before adding a page, you need to define how many rows a page will have, and how many columns these rows will contain.page_1_rows=[{'columns':1},# row 1, has one column{'columns':1},# row 2, has one column{'columns':2},# row 3, has two columns{'columns':3}# row 4, has three columns]Adding a pageAdd a page using the known.add_page()method. This method expects a new parameter:rows.
Rows need to be an array with the row definitions as specified above.pdf.add_page(rows=page_1_rows)Writing textOnce you have a page and their rows and columns, you can simply start writing text to it using.write_text(). This function takes three required parameters:row,columnandtxt.
Optionally, you can also specify thepageby giving its number. If no page is given, the current page is used.pdf.write_text(txt='This is my heading',row=1)pdf.write_text(txt='This is my second row',row=2)pdf.write_text(txt='This is my thirth row, first column',row=3,column=1)pdf.write_text(txt='This is my thirth row, second column',row=3,column=2)pdf.write_text(txt='This is my fourth row, first column',row=4,column=1)pdf.write_text(txt='This is my fourth row, second column',row=4,column=2)pdf.write_text(txt='This is my fourth row, thirth column',row=4,column=3)OutputGenerate the pdf using the.output()method.pdf.output('my_pdf.pdf')Advanced settingsSince SimpleFPDF aims to be as simple as possible, not much customisation is possible.
There are a few settings you can use.top-marginYou can specify thetop-marginfor a row. This will add a margin to the top of a row, using the unit specified at creation.rows=[{'columns':1,'top-margin':30},# row 1, has one column and a top-margin of 30mm{'columns':1},# row 2, has one column{'columns':2,'top-margin'},# row 3, has two columns and a top-margin of 15mm{'columns':3}# row 4, has three columns]
Package: simple-frequency-counter
SIMPLE FREQUENCY COUNTERCalculate word occurences in txt files inside a given folder.Usagefromsimple_frequency_counter.counterimportFrequenciesGeneratorfg=FrequenciesGenerator('my_test_folder')# print occurences of the word 'example' in 'text1.txt'fg.get_frequency('example','text1.txt')# print occurences of the word 'example' in all filesfg.get_frequency('example')# print similarity between two file depending on word overlapfg.calculate_similarity('text2.txt','text1.txt')
Package: simplefsapp-moc
Table of ContentsAbstractSynopsisDescriptionArgumentsRunUsing PyPIUsingdocker runExamplesAbstractA demo/testing simplefsapp for the MOC compute environment.Synopsispython simplefsapp_moc.py                                       \
    [-v <level>] [--verbosity <level>]                          \
    [--version]                                                 \
    [--man]                                                     \
    [--meta]                                                    \
    <outputDir>Descriptionsimplefsapp_moc.pyis a testing/demo application for an FS-type application on the Massachusetts Open Cloud (MOC) remote computing environment.The application simply “touches” new files in its output directory which are the names of the files in the ‘–dir <path>’ target  directory.Arguments[-v <level>] [--verbosity <level>]
Verbosity level for app. Not used currently.

[--version]
If specified, print version number.

[--man]
If specified, print (this) man page.

[--meta]
If specified, print plugin meta data.

[--dir <path>]
A directory on the process filesystem (if run outside ChRIS) or a
path inside openstorage (if run within ChRIS) to examine.

[--sleepLength <sleepLength>]
If specified, sleep for <sleepLength> seconds before starting
script processing. This is to simulate a possibly long running
process.RunThisplugincan be run in two modes: natively as a python package or as a containerized docker image.Using PyPITo run from PyPI, simply do apipinstallsimplefsapp_mocand run withsimplefsapp_moc.py--man/tmpto get inline help. The app should also understand being called with only two positional argumentssimplefsapp_moc.py/destination/directoryUsingdocker runTo run usingdocker, be sure to assign an output directory to/outgoing.Make sure that the$(pwd)/outdirectory is world writable!Now, prefix all calls withdockerrun--rm-v$(pwd)/out:/outgoing\fnndsc/pl-simplefsapp_mocsimplefsapp_moc.py\Thus, getting inline help is:mkdirinout&&chmod777outdockerrun--rm-v$(pwd)/in:/incoming-v$(pwd)/out:/outgoing\fnndsc/pl-simplefsapp_mocsimplefsapp_moc.py\--man\/outgoingExamples
Package: simple-fsm
Finite State Machine [ FSM ]A simple 'pythonic' FSM implementation.  Decorate your actions with state transition.
Create an instance of an FSM using state transition table.  Push events into event queue.
Process state machine usingnextgenerator.State Transition TableDecorate your actions with state transitions.  Let's say you have a simple two state
machine and one event that can between both states.import fsm

table = fsm.Table()

@table('STATE1', 'doit', 'STATE2')
def action1(*args, **kwargs):
    pass

@table('STATE2', 'doit', 'STATE1')
def action2(*args, **kwargs):
    pass

print(table.dump())OUTPUTSTATE1 --doit--> STATE2
STATE2 --doit--> STATE1FSM InstanceDefine an instance of your FSM using the state transition table and an initial state.
To execute your state machine, youpushevents to your event queue and process via thenextmethod.myfsm = fsm.FSM(table, 'STATE1')

myfsm.push('doit')
myfsm.push('doit')

for _ in myfsm.next():
    print(myfsm.state)OUTPUTSTATE2
STATE1Sincenextis a generator, you will need to process via generator syntax.  Doing it
this way permits events to be pushed at any point into the FSM.ActionsThe actionfnis called for each state transition. Sometimes you'll want to pass annotated
data through the FSM.  Thenextmethod provides that with*args, **kwargs.  You may
push an event with custom**kwargsdata which will be merged into the action call**kwargs.  Finally, every action called will have antransition_FSMpassed in as kwargs
as well.
Package: simple-fstring
simple-fstringA simple basic f-string like behavior in Python 2Installation$ pip install simple-fstringUsagefrom fstring import f
a = 1
b = 2
c = u"哈哈"
d = "哈哈"
print f("${a + b}")  # 3
print f(u"我是c${c}")  # 我是c哈哈
print f("我是d${d}")  # 我是d哈哈
print f("我是d${c}c")  # 鎴戞槸d哈哈c
print f(u"我是c${d}d")  # 我是c鍝堝搱d
print f("$${}")  # ${}
print f("${{'a':'dict test'\}.get('a')}")  # dict test
print f("${{'a':'dict test'}.get('a')}")  # {'a':'dict test'.get('a')}
# specify expr namespace
print f("${a + b}", globals_ns={"a": 10, "b": 20}, locals_ns={"a": 1})  # 21LicenseMIT
Package: simple-fuzzysearch
Tiny and blazing-fast fuzzy search in Python.Fuzzy searching allows for flexibly matching a string with partial input, useful for filtering data very quickly based on lightweight user input.Port offuzzysearch in JavaScriptinto Python.InstallJust install using pip:$ pip install simple-fuzzysearchfuzzysearch(needle, haystack)Returns true if needle matches haystack using a fuzzy-searching algorithm.
Note that this program doesn’t implement levenshtein distance, but rather a simplified version where there’s no approximation.
The method will return true only if each character in the needle can be found in the haystack and occurs after the preceding matches.fromfuzzysearchimportfuzzysearchfuzzysearch('twl','cartwheel')# <- truefuzzysearch('cart','cartwheel')# <- truefuzzysearch('cw','cartwheel')# <- truefuzzysearch('ee','cartwheel')# <- truefuzzysearch('art','cartwheel')# <- truefuzzysearch('eeel','cartwheel')# <- falsefuzzysearch('dog','cartwheel')#  <- falseLicenseMIT
Package: simplega
simplegasimplegais a simple python implementation of genetic algorithm and it is available through PyPI.Installpython3-mpipinstallsimplegaUsageImport the packagefromsimplegaimportChromosome,Population,GA,GAHelper# orfromsimplegaimport*Create a fitness function that suits your problemdefmaximize(chromosome):returnsum([ord(gene)forgeneinchromosome.dna])Create a new instance of GA specifying the fitness function to be usedga=GA(maximize)Perform the steps of the genetic algorithm and retrieve the fittest chromosomega.run()print(ga.get_fittest())All the script - really simple:fromsimplegaimport*defmaximize(chromosome):returnsum([ord(gene)forgeneinchromosome.dna])ga=GA(maximize)ga.run()print(ga.get_fittest())Advanced usageYou can customize your instance of GA, replacing any or all of its default valuesga=GA(fitness_function,genes=[chr(n)forninrange(65,91)],chromosome_size=10,population_size=100,generations=100,crossover_points=1,elitism_rate=0.05,crossover_rate=0.85,mutation_rate=0.01,)You can print the fittest chromosome of each generation withga.run(True)ContributingPlease submit bugfixes, enhancements, unit tests, usecases and examples with a pull request.
Package: simplegan
SimpleGANFramework to ease training of generative modelsSimpleGAN is a framework based onTensorFlowto make training of generative models easier. SimpleGAN provides high level APIs with customizability options to user which allows them to train a generative models with few lines of code or the user can reuse modules from the exisiting architectures to run custom training loops and experiments.RequirementsMake sure you have the following packages installedtensorflowtqdmimagioopencvtensorflow-datasetsInstallationLatest stable release:$pipinstallsimpleganLatest Development release:$pipinstallgit+https://github.com/grohith327/simplegan.gitGetting StartedDCGANfromsimplegan.ganimportDCGAN## initialize modelgan=DCGAN()## load train datatrain_ds=gan.load_data(use_mnist=True)## get samples from the data objectsamples=gan.get_sample(train_ds,n_samples=5)## train the modelgan.fit(train_ds=train_ds)## get generated samples from modelgenerated_samples=gan.generate_samples(n_samples=5)Custom training loops for GANsfromsimplegan.ganimportPix2Pix## initialize modelgan=Pix2Pix()## get generator module of Pix2Pixgenerator=gan.generator()## A tf.keras model## get discriminator module of Pix2Pixdiscriminator=gan.discriminator()## A tf.keras model## training loopwithtf.GradientTape()astape:""" Custom training loops """Convolutional Autoencoderfromsimplegan.autoencoderimportConvolutionalAutoencoder## initialize autoencoderautoenc=ConvolutionalAutoencoder()## load train and test datatrain_ds,test_ds=autoenc.load_data(use_cifar10=True)## get sample from data objecttrain_sample=autoenc.get_sample(data=train_ds,n_samples=5)test_sample=autoenc.get_sample(data=test_ds,n_samples=1)## train the autoencoderautoenc.fit(train_ds=train_ds,epochs=5,optimizer='RMSprop',learning_rate=0.002)## get generated test samples from modelgenerated_samples=autoenc.generate_samples(test_ds=test_ds.take(1))To have a look at more examples in detail, checkhereDocumentationCheck out thedocs pageProvided modelsModelGenerated ImagesVanilla AutoencoderNoneConvolutional AutoencoderVariational Autoencoder [Paper]Vector Quantized - Variational Autoencoder [Paper]Vanilla GAN [Paper]DCGAN [Paper]WGAN [Paper]CGAN [Paper]InfoGAN [Paper]Pix2Pix [Paper]CycleGAN [Paper]3DGAN(VoxelGAN) [Paper]Self-Attention GAN(SAGAN) [Paper]ContributingWe appreciate all contributions. If you are planning to perform bug-fixes, add new features or models, please file an issue and discuss before making a pull request.Citation@software{simplegan,
    author = {{Rohith Gandhi et al.}},
    title = {simplegan},
    url = {https://simplegan.readthedocs.io},
    version = {0.2.8},
}ContributorsRohith GandhiPrem Kumar
Package: simple-gcode-sender
A simple gcode senderFeatures:fast (buffered)simple to useeasy to tune to your device (one simple & clean Python file)works well on a raspberry pi (tested with "old" Python versions)Usage:sgs <gcode_filename> <serial_device>Note: if you see any output, it means there are errors occurring, try tweaking those two values:BUFFER_SIZE=10# you can try to reduce thisBUFFER_FULL_PAUSE_DURATION=0.01# you can try to increase thatOn the other hand, if you have a really fast hardware, you can do the opposite until you get some errors (prioritizeBUFFER_FULL_PAUSE_DURATIONoverBUFFER_SIZE: buffered data may get replayed on error which may lead to undesired behavior (duplicate gcodes).