Saravanan666/pypi-org huggingface dataset:
Package: randomcolor
randomcolorA port ofDavid Merfield's randomColor(currently davidmerfield/randomColor@0.4.4) to python. Tested against python versions 3.6, 3.7, 3.8, 3.9, pypy, and pypy3.UsageGenerating a completely random color:importrandomcolorrand_color=randomcolor.RandomColor()print(rand_color.generate())Generating 3 random blue colors:print(rand_color.generate(hue="blue",count=3))Refer to thetests for examplesandREADME at davidmerfield/randomColorfor full usage details.TestsRunpython setup.py testto run the test suite with stored expected colors
generated from a seeded randomcolor object.Runpython tests/test_randomcolor_visual.pyto generate an html page with random
colors generated from using this package. Openrandomcolors.htmlto confirm
that the colors fall within the parameters pased in. This is in addition to unit
tests since it's much easier to visually confirm that the colors generated
are correct than determine correctness programatically.
Package: randomCoordinates
This Is A Very Simple Library That Generates Random Coordinates (longitude And Latitude), In Difrent Formats.Change Log0.0.1 (22/01/2022)First Release0.1.0 - 0.1.5 (22/01/2022)Bugfix0.1.6 (22/01/2022)Tracked down the issue0.1.7 (23/01/2022)Added Help Funtion (.help())
Package: randomcsv
RandomCSVThis library let's you generate CSV files with a specific structure, but
random data. These CSVs can be used as test data when developing data pipelines.Usagefromrandomcsvimport*generator=CsvGenerator()# adds a column filled with integers, starting at 100, incrementinggenerator.add_column(IntColumn("Integers",start=100))# adds a column filled with strings, currently first names from the firstNames.txt dictionarygenerator.add_column(StringColumn("Names"))# add a column filled with random float values between 10 and 20 rounded to 2 digits.generator.add_column(RandomNumberColumn("Random",low=10,high=20,digits=2))# adds a column, values are randomly picked from the provided listgenerator.add_column(CategoryColumn("Categories",[1,2,3,4]))# adds a column with name "Calculated", based on Columns Integers and Class# the arguments of the given function must match order and type of the values of the columnsgenerator.calculate_column("Calculated",["Integers","Categories"],lambdanumber,category:f'{number}{category}')# creates pandas DataFrame with 5 rowsdata_frame=generator.generate_data_frame(5)# creates CSV file in directory "output"generator.create_csv(5,"test.csv")
Package: random-csv-generator
Tool for rendering plausible real-life csv data.How do I install this package?As usual, just download it using pip:pipinstallrandom_csv_generatorTests CoverageSince some software handling coverages sometime
get slightly different results, here’s three of them:Tool for rendering plausible real-life csv data.Usage examplesCurrently the generated CSV contains FAKE data about italian
persons and some FAKE financial informations.fromrandom_csv_generatorimagerandom_csvdf=random_csv(300)# To generate a CSV with 300 rowsregionprovincesurnamenamesexbirth_municipalitybirth_provincebirth_regionbirth_capbirth_province_codebirthdateaddresshouse_numbercapmunicipalityprovince_codecodice_fiscaletotal_debitpayed_debitToscanaSienaVeroneseGiorgioMCastelnovo BarianoRovigoVeneto45030RO2000-12-08Via Traversa Stazione1553034Colle Di Val D’elsaSIVRNGRG00T08C215S15.347,00 €1.763,00 €LombardiaBresciaBarsottiLauraFSanta LucePisaToscana56040PI1981-04-16Via Martiri Della Libertà29125030RoncadelleBSBRSLRA81D56I217W24.015,00 €12.250,00 €CalabriaVibo ValentiaLandiEdoardoMCertaldoFirenzeToscana50052FI1999-07-31Corso Umberto I25089822Serra San BrunoVVLNDDRD99L31C540R73.788,00 €70.486,00 €LazioFrosinoneRossiGiuseppe Oreste MassimoMBaricellaBolognaEmilia Romagna40052BO1953-09-10Borgo San Nicola1143020PastenaFRRSSGPP53P10A665N17.640,00 €15.303,00 €UmbriaPerugiaPirasMaurizioMSadaliCagliariSardegna08030CA1957-06-14Piazza D. Alighieri36061Castiglione Del LagoPGPRSMRZ57H14H659Q11.106,00 €10.210,00 €
Package: random-data-gen
RandomDataGen - Random Data Generator PackageThis is a package to generate random transactional data. You can use this package to study Pandas operations or clustering methods like RFM.With this package you can create a table with transactional data containing:consumer_id: ID identifying the customer that does the transaction;transaction_created_at: Date of transaction;transaction_payment_value: Monetary value of transaction.All the fields are customizable.How the data is generatedTheconsumer_idfield is generated by a range function, returning a sequence of integers from 1 ton_consumers:consumer_ids=range(1,n_consumers+1)Thetransaction_created_atfield is generated by a Pandas function called date_range. You can view more about this functions in thislink:created_at_list=list(pd.date_range(start=first_transaction_date,end=last_transaction_date,periods=n_rows)Thetransaction_payment_valueis sample from a normal distribution with mean equals the mean_spend parameter and the stardand deviation  equals the std_spend parameter:list(np.random.normal(transaction_mean_value,transaction_std_value,n_rows))How to useYou can start the use of RandomDataGen with this example code:fromrandom_data_gen.data_generatorimportTransactionalDataGeneratorTRGenerator=TransactionalDataGenerator(n_rows=1000,n_consumers=100,transaction_mean_value=100,transaction_std_value=10,first_transaction_date="2020-01-01",last_transaction_date="2021-01-01",)df=TRGenerator()In this snippet we defined a dataframe with 1000 rows, 100 unique users, a mean spend in transactions of 100u.m., a standard deviation in transactional spend of 10u.m., the first transaction date (2020-01-01) and the last transaction date (2021-01-01).The dataframe returned is in the form:| consumer_id |     transaction_created_at    | transaction_payment_value |
|:-----------:|:-----------------------------:|:-------------------------:|
|     234     | 2020-01-01 00:00:00.000000000 |           120.10          |
|      43     | 2020-01-01 08:47:34.054054054 |           87.10           |
|     321     | 2021-10-23 10:27:12.092356134 |           12.98           |
|     3123    | 2020-12-30 21:37:17.837837840 |           12.84           |The shape of this dataframe is defined by the parametern_rows.ContributeTo contribute you need to installPoetry.After installing, you need to clone this repo and run the following command:poetry install -nBefore sending the code to the repo, you need to run:make formatTo apply the project style to the new code.And after that, run:make checkThis command will check your code with flake8 and pytest.
Package: random-dice-roller
This randomised dice roller uses the random module (which is pre-installed)
ways to use :import random_dice_roller as rdrrdr.roll_dicev()        # for visual dice and not in numbers
print(rdr.roll_dice_MaxMin(minimum_number=1,maximum_number=100))    # for any numbers int
print(rdr.roll_dice())   # to roll the normal dice(1 to 6) in a number formatChange log0.0.2(19/5/2021)Minor Function name Changes.
Package: random-dict
Simple python package to generate random dictionaries of given types.How do I install this package?As usual, just download it using pip:pipinstallrandom_dictTests CoverageSince some software handling coverages sometime get slightly different results, here’s three of them:Usage examplesGenerator random_string_dictThis function will generate a dictionary with given at mostmax_depthandmax_heightof typestring.fromrandom_dictimportrandom_string_dictfromrandomimportrandintrandom_string_dict(randint(1,10),randint(1,10))Generator random_bool_dictThis function will generate a dictionary with given at mostmax_depthandmax_heightof typebool.fromrandom_dictimportrandom_bool_dictfromrandomimportrandintrandom_bool_dict(randint(1,10),randint(1,10))Generator random_float_dictThis function will generate a dictionary with given at mostmax_depthandmax_heightof typefloat.fromrandom_dictimportrandom_float_dictfromrandomimportrandintrandom_float_dict(randint(1,10),randint(1,10))Generator random_int_dictThis function will generate a dictionary with given at mostmax_depthandmax_heightof typeint.fromrandom_dictimportrandom_int_dictfromrandomimportrandintrandom_int_dict(randint(1,10),randint(1,10))Generator random_dictThis function will generate a dictionary with given at mostmax_depthandmax_heightof mixed types.fromrandom_dictimportrandom_dictfromrandomimportrandintrandom_dict(randint(1,10),randint(1,10))Some generated examples can be found within the examples folder.
Package: random-dog
random-dograndom-dog is a module for getting dog images, it uses dogAPI:https://dog.ceo/dog-api/The module creation was inspired by random-cat module (https://github.com/gravmatt/random-cat)Python 2 and 3 compatibleInstallationInstall throughpip.$ pip install random-dogor get from source$ git clone https://github.com/Prasnal/random-dog
$ cd random-dog
$ python setup.py installUsageThe dog module has just one functiongetDog()with two optional arguments.Argumentsdirectory- default is the current directoryfilename- default is a unique idimport dog

# dog.getDog(directory=None, filename=None)

dog.getDog(directory='/users/tor', filename='dog')

# /users/tor/dog.jpgThe function return the image name (absolute path if directory is specified) of the image.Command LineYou can also request an image on the terminal.$ randomdog [file]

# Example:

$ randomdog /users/tor/dog.jpgThe argumentfileis optional.The command return the filename/absolute path of the image to the standard output (stdout).LicenceThe MIT License (MIT)
Package: randomdotorg
randomdotorg.py is a python module to implement python’s random number interface
by fetching data from random.org, which is is a true random number service
that generates randomness via atmospheric noise.Example of use:>>> r = randomdotorg.RandomDotOrg('ExampleCode') # Pass the name of your program
>>> r.get_quota() # method to get allowed bit quota for this ip
999171
>>> print r.randrange(2, 33, 3)
14Methods supported by the standard library random module are supported, except
for save/load state and seeding which won’t make sense for a true random number
generator.
Package: randomemojis
What is the RandomEmojis project?Welcome! This project is a custom python command line application using the click library built by the dudes that made flask. This application generates random emoji(s) and can even show the emojis link. WOW!1!!Getting StartedRequirementspython 3.7+ and pip is required to use/download randomemojisInstallation# Productionpipinstallrandomemojis# Testinggitclonehttps://github.com/yusuf8ahmed/RandomEmojisUsage# Productionemojis3# Testingpythonemojis3Advance InfoUsage:emojis[OPTIONS][NUMBER]Emojis:generatesrandomemojisduh

Options:-l,--linkdisplaygeneratedemoji(s)url-v,--verboseshowverbosemessages--helpShowthismessageandexit.
Package: random-face
Random FaceA simple python library for fast image generation of people who do not exist.For more details, please refer to thepaper.RequirementsLinux, Windows, MacOSPython 3.8.+CPU compatible with OpenVINO.Install packagepipinstallrandom_faceInstall the latest versiongitclonehttps://github.com/bes-dev/random_face.gitcdrandom_face
pipinstall-rrequirements.txt
pythondownload_model.py
pipinstall.Demopython-mrandom_face.demoExampleimportcv2importrandom_faceengine=random_face.get_engine()face=engine.get_random_face()cv2.imshow("face",face)cv2.waitKey()Citation@misc{belousov2021mobilestylegan,
      title={MobileStyleGAN: A Lightweight Convolutional Neural Network for High-Fidelity Image Synthesis},
      author={Sergei Belousov},
      year={2021},
      eprint={2104.04767},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
Package: randomfactory
randomfactoryrandomfactoryis a helper function for generating random output that is used in testcase.Installation$pipinstallrandomfactoryrandomfactory supports Python 3.8 and newer.Usagefromrandomfactoryimport*# Generate a random integer between 0 and 100test_int=generate_integer(0,100)print(test_int)# 42# Generate a random alphabettest_alphabet=generate_alphabet()print(test_alphabet)# 'a'# Generate a random string with length 10test_string=generate_string(10)print(test_string)# 'abcdefghij'# Generate a random string with length 10 and only contains 'a', 'b', 'c'test_string=generate_string(10,['a','b','c'])print(test_string)# 'abacacabba'# Generate a random wordtest_word=generate_word(10)print(test_word)# 'abcdefghij'# Generate an arraytest_array=generate_array(10,0,100)print(test_array)# [42, 42, 32, 23, 42, 42, 13, 42, 42, 42]# Generate 2d arraytest_2d_array=generate_2d_array(3,2,0,100)print(test_2d_array)# [[12, 42], [15, 22], [42, 31]]# Generate an array that contains only unique elementstest_unique_array=generate_unique_array(4,0,100)print(test_unique_array)# [42, 32, 23, 13]# Generate a subset of an arraytest_subset=generate_subseq([1,2,3,4,5],3)print(test_subset)# [1, 3, 4]
Package: random-filters
Random filters: Python packaging for generate random filters to use in your projectInstallationpipinstallrandom-filtersUsageimportrandom_filtersasrf# checkboxrf.checkbox()# comboboxrf.combobox_hierarchy({"Estado":["SP","SP","SP","SC","SC","SC"],"Cidade":["São Paulo","Itatiba","Campinas","Chapecó","Xaxim","Xanxerê"]})# daterf.date('2019-01-01','2019-12-31')# date_partitionrf.date_partition(2)# storerf.store(2)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Package: randomForestRules-lukassykora
Random Forest RulesGet the representation of all rules found by sklearn RandomForestClassifier. It works in following way:On each feature, it applies one-hot encoding that makes each column binary.Random Forest runs on the features and a target attribute.All trees are extracted from the Random Forest Regressor.Decision Trees are split to classification rules.GIT repositoryhttps://github.com/lukassykora/randomForestRulesInstallationpip install randomForestRules-lukassykoraJupyter NotebookAudiologyExamplefromrandomForestRulesimportRandomForestRulesimportpandasaspddf=pd.read_csv("data/audiology.csv")df.columns=df.columns.str.replace("_","-")# underscore not allowed# All feature columnscols=[]forcolindf.columns:ifcol!='binaryClass':cols.append(col)# InitializerandomForest=RandomForestRules()# Load datarandomForest.load_pandas(df)# FitrandomForest.fit(antecedent=cols,consequent='binaryClass',supp=0.005,conf=50)# Get resultframe=randomForest.get_frame()
Package: random-forestry
This is an experimental fork of Rforestry, for the package repo, see (https://github.com/forestry-labs/Rforestry)Rforestry: Random Forests, Linear Trees, and Gradient Boosting for Inference and InterpretabilitySören Künzel, Theo Saarinen, Simon Walter, Sam Antonyan, Edward Liu, Allen Tang, Jasjeet SekhonIntroductionRforestry is a fast implementation of Honest Random Forests, Gradient Boosting,
and Linear Random Forests, with an emphasis on inference and interpretability.How to install - R PackageThe GFortran compiler has to be up to date. GFortran Binaries can be foundhere.Thedevtoolspackage has to be installed. You can install it using,install.packages("devtools").The package contains compiled code, and you must have a development environment to install the development version. You can usedevtools::has_devel()to check whether you do. If no development environment exists, Windows users download and installRtoolsand macOS users download and installXcode.The latest development version can then be installed usingdevtools::install_github("forestry-labs/Rforestry"). For Windows users, you'll need to skip 64-bit compilationdevtools::install_github("forestry-labs/Rforestry", INSTALL_opts = c('--no-multiarch'))due to an outstanding gcc issue.How to install - Python PackageThe python package must be compiled before it can be used.
Note that to compile and link the C++ version of forestry, one must be using either OSX or Linux and must have a C++ compiler installed.
For example, one can run:mkdir build
cd build
cmake .
makePython Package UsageThen the python code can be called:importnumpyasnpimportpandasaspdfromrandomimportrandrangefromRforestryimportRandomForestfromsklearn.datasetsimportload_irisfromsklearn.model_selectionimporttrain_test_splitdata=load_iris()df=pd.DataFrame(data['data'],columns=data['feature_names'])df['target']=data['target']X=df.loc[:,df.columns!='sepal length (cm)']y=df['sepal length (cm)']X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.33,random_state=42)fr=RandomForest(ntree=500)print("Fitting the forest")fr.fit(X_train,y_train)print("Predicting with the forest")forest_preds=fr.predict(X_test)Plotting the forestFor visualizing the trees, make sure to install thedtreevizpython library.fromdtreeviz.treesimport*fromforestry_shadowimportShadowForestryTreeshadow_forestry=ShadowForestryTree(fr,X,y,X.columns.values,'sepal length (cm)',tree_id=0)viz=dtreeviz(shadow_forestry,scale=3.0,target_name='sepal length (cm)',feature_names=X.columns.values)viz.view()R Package Usageset.seed(292315)
test_idx <- sample(nrow(iris), 3)
x_train <- iris[-test_idx, -1]
y_train <- iris[-test_idx, 1]
x_test <- iris[test_idx, -1]rf <- forestry(x = x_train, y = y_train, nthread = 2)predict(rf, x_test)
Package: random-fourier-features-pytorch
Random Fourier Features PytorchRandom Fourier Features Pytorch is an implementation of "Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains" by Tancik et al. designed to fit seamlessly into any PyTorch project.InstallationUse the package managerpipto install the package.pipinstallrandom-fourier-features-pytorchUsageSee thedocumentationfor more details, but here are a few simple usage examples:Gaussian EncodingimporttorchimportrffX=torch.randn((256,256,2))encoding=rff.layers.GaussianEncoding(sigma=10.0,input_size=2,encoded_size=256)Xp=encoding(X)Basic EncodingimporttorchimportrffX=torch.randn((256,256,2))encoding=rff.layers.BasicEncoding()Xp=encoding(X)Positional EncodingimporttorchimportrffX=torch.randn((256,256,2))encoding=rff.layers.PositionalEncoding(sigma=1.0,m=10)Xp=encoding(X)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.CitationIf you end up using this repository, please cite it as:@article{long2021rffpytorch,title={Random Fourier Features Pytorch},author={Joshua M. Long},journal={GitHub. Note: https://github.com/jmclong/random-fourier-features-pytorch},year={2021}}also cite the original work@misc{tancik2020fourier,title={Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains},author={Matthew Tancik and Pratul P. Srinivasan and Ben Mildenhall and Sara Fridovich-Keil and Nithin Raghavan and Utkarsh Singhal and Ravi Ramamoorthi and Jonathan T. Barron and Ren Ng},year={2020},eprint={2006.10739},archivePrefix={arXiv},primaryClass={cs.CV}}LicenseThis is released under the MIT license found in theLICENSEfile.
Package: random-gen
random-genA random number generator that will randomly generate numbers from a given input list and probability distribution.
E.g.>>fromrandom_genimportRandomGen>>>>r=RandomGen((1,2,3),(0.5,0.1,0.4))# input number list, probability distribution>>generated_numbers=[r.next_num()for_inrange(0,11)]>>>>importcollections>>collections.Counter(generated_numbers)# See distribution of numbers generatedCounter({1:7,2:1,3:3})As you can see, the distribution of numbers is roughly in line with the probability distribution passed to RandomGen.
This implementation is taken from cpython random.choices() -https://github.com/python/cpython/blob/master/Lib/random.py#L397and optimised for known cumulative weights and k.This works by using the cumulative probabilities of the random number list. Randomly generated probabilities (usingrandom.random)
are multiplied by the total sum of the probabilities. This probability is then inserted into the list of cumulative
probabilities usingbisect.bisectand that insert position used to return the relative random number (from the inputrandom_nums).
As the probability has been proportioned along the probability distribution (because it's multiplied
by the total sum of the probabilities) it is more likely to return numbers that have a larger probability.PrerequisitesPython 3.6Running>>fromrandom_genimportRandomGen>>random_nums=(1,2,3)>>probabilities=(0.5,0.1,0.4)>>r=RandomGen(random_nums,probabilities)>>r.next_num()1TestsTo run the tests:pytest tests/test_random_gen.pyHow to make RandomGen more 'pythonic'We could subclass the standard PythonGeneratorclass and use the dunder methods to providenext_numthrough__next__or simply provide a generator function calledrandom_genwhich yields each result when called.I would also advise usingrandom.choicesdirectly rather than wrapped in a class if the use cases are less than ~10000
inputs (otherwise performance suffers). This would be simpler and more readable.Performance# input numbers provided# output numbers generatedspeed (secs)function callsmemory consumption for next_num (mb)1001000.00530411100010000.00230041110000100000.0183000412.41000001000000.1723000043310000010000001.953000004199Further OptimisationsMemory consumption needs investigation. Is there an alternative efficient method for bisecting the cumulative probability array
without using a list?Arrays/efficient storage for large sets of numbers if needed.Investigate performance of bisect.
Package: random-genetic-forest
# Random-Genetic-ForestThe Random-Genetic Forest(RGF) is a variation of the original Random Forest machine learning algorithm. The RGF algorithm uses genetic algorithms to potential optimize accuracy and/or create non-parametric learning models. This implementation is a Spark module that allows for use in Big Data problems. The RGF Python module consumes datasets using Pyspark dataframes and creates RGF models.