Saravanan666/pypi-org huggingface dataset:
Package: adval
The code is Python 3What is Adversarial Validation?
The objective of any predictive modelling project is to create a model using the training data,
and afterwards apply this model to the test data.
However, for the best results it is essential that
the training data is a representative sample of the data
we intend to use it on (i.e.the test data),
otherwise our model will, at best, under-perform, or at worst, be completely useless.*Adversarial Validation*is a very clever and
very simple way to let us know if our test data and our training data are similar;
we combine ourtrainandtestdata,
labeling them with say a0for the training data and a1for the test data,
mix them up, then see if we are able to correctly re-identify them using a binary classifier.If we cannot correctly classify them,i.e.we obtain an area under the
[receiver operating characteristic curve](https://en.wikipedia.org/wiki/Receiver_operating_characteristic) (ROC)
of 0.5 then they are indistinguishable and we are good to go.However, if we can classify them (ROC > 0.5) then we have a problem,
either with the whole dataset or more likely with some features in particular,
which are probably from  different distributions in the test and train datasets.
If we have a problem,
we can look at the feature that was most out of place.
The problem may be that there were values that were only seen in,
say, training data, but not in the test data.
If the contribution to the ROC is very high from one feature,
it may well be a good idea to remove that feature from the model.Adversarial Validation to reduce overfitting
The key to avoid overfitting is to create a situation
where the local cross-vlidation (CV) score is representative of the competition score.
When we have a ROC of 0.5 then your local data is representative of the test data,
thus your local CV score should now be representative of the Public LB score.Procedure:drop the training data target columnlabel thetestandtraindata with0and1(it doesn’t really matter which is which)combine the training and test data into one big datasetperform the binary classification, for example using XGboostlook at our AUC ROC scoreInstallationFast install:pip install advalExample on Mobile Price Classification Datasetfromadval.validationimportadVal# In this dataset:# target = "price_range"# 95 = Â½ threshold similarity ratio you want# Id Column = "id"# run modulek=adVal(train,test,95,"price_range","id")# get auc_scorek.auc_score()
Package: advanced-analysis-package
#advanced_analysis_packageThis is a python package to perform analysis , outlier treatment and variable reduction on pandas dataframe. List of functions include:-analyze - a. edd - replica of sas edd maco with new features of coelation and p values when dependent variable is given.return a pandas dataframe. b. graphical_analysis - gives bivariate ananlysis of variable with respect to dependent variable. Display and saves plots and tables at equied path. c. numerical_categorical_division - return list of numeric and categoical variables in pandas dataframe
variable_treatment a. exponential_smoothning - outlier treatment for variable b.capping_and_flooring - outlier teatment for variable c.make_dummies - create dummies for categorical variable(one hot encoding) d.make_dummies_binary - create binary dummies for variable
variable_reduction a. inter_correlation_clusters - return clusters of variables based on cutoff correlation b. varclus - return list of columns 1 from each cluster c. vif_reduction - return list of columns to be dropped by vif_eduction method d. backward_selection - returns list of columns to be dropped by backwad selection
Package: advancedcalc
AdvancedCalcAn Advanced Calculator to Calculate Advanced Methods like Average, Trignometry, HCF, LCM easilyInstallationAdvancedCalc requires an installation of python 3.6 or greater, as well as pip. Pip is typically bundled with python installations, and you can find options for how to install python athttps://python.org.To Install from pypi with pip:pipinstalladvancedcalcSometime, the pypi release becomes slightly outdated. To install from the source with pip:pipinstallgit+https://github.com/programmerayush7/advancedcalc/Quick StartAdding NumbersimportAdvancedCalccalculator=AdvancedCalc.Calculator# returns 10sum=calculator.add(5,5)print(sum)Subtracting NumbersimportAdvancedCalccalculator=AdvancedCalc.Calculator# returns 5answer=calculator.add(10,5)print(answer)Usingauto_arrangeParameterTheauto_arrangeparameter is usually used to pretend to get negative answers (eg. -1, -6, etc.).Withoutauto_arrangeimportAdvancedCalccalculator=AdvancedCalc.Calculator# returns -1answer=calculator.subtract(4,5)print(answer)Withauto_arrangeimportAdvancedCalccalculator=AdvancedCalc.Calculator# returns 1answer=calculator.add(4,5,auto_arrange=True)print(answer)Multiplying NumbersMultiply 2 Numbers using this FunctionimpportAdvancedCalccalculator=AdvancedCalc.Calculator# returns 25product=calculator.add(5,5)print(product)Dividing NumbersDivide 2 Numbers using this FunctionimportAdvancedCalccalculator=AdvancedCalc.Calculator# returns 2quotient=calculator.add(10,5)print(quotient)Finding RemaindersFind the Remainder from the Division of 2 Numbers using this functionimportAdvancedCalccalculator=AdvancedCalc.Calculator# returns 2remainder=calculator.remainder(10,4)print(remainder)Advanced FunctionsAverage Of NumbersFind the Average of Numbers in a ListfromAdvancedCalcimportAdvancednumbers=[1,2,3,4,5]# Returns 3average=Advanced.average(numbers)print(average)CubeFind the Cube of a Number using this functionfromAdvancedCalcimportAdvanced# returns 8cube=Advanced.cube(2)print(cube)Percentagelets try finding 10 percent of 200
Note: This Function returns a float, so if you want a number, you can convert it into an int.fromAdvancedCalcimportAdvanced# returns 20.0percent=Advanced.percent(10,200)print(percent)FactorsFind all Factors of a Specific Numbers using this functionfromAdvancedCalcimportAdvanced# returns a list of factorsfactors=Advanced.factors(10)print(factors)HFCFind the Highest Common Factor of 2 NumbersfromAdvancedCalcimportAdvanced# returns 10hfc=Advanced.hfc(10,20)print(hfc)LCMFind the LCM of 2 Numbers using this Function.fromAdvancedCalcimportAdvanced# returns 11lcm=Advanced.lcm(5,6)print(lcm)Changelog0.0.3Added Advanced FunctionsModified Simple FunctionsModified README.mdFixed Installing with PIP Error
Package: advanced-database-replace
Advanced Database ReplaceShort descriptionA utility management library which runs an advanced
search&replace action against a specified database's records
(event if they are serialized).Long descriptionThis project aims to take search&replace to the next level by applying
search&replace even to serialized records in the database. This type of project
is especially effective against e.g. Wordpress databases since they may
contain serialized PHP array records.PrerequisitesA MySql database.This project installed with:pipinstalladvanced_database_replaceor:./install.shUsageReplacing all occurrences on all tablesfromadvanced_database_replace.database_replaceimportDatabaseReplacefromadvanced_database_replace.database_credentialsimportDatabaseCredentialsdb_credentials=DatabaseCredentials()db_replacer=DatabaseReplace(credentials=db_credentials)db_replacer.replace_all('my-old-record','my-new-record')Replacing all occurrences on a specific tablefromadvanced_database_replace.database_replaceimportDatabaseReplacefromadvanced_database_replace.database_credentialsimportDatabaseCredentialsdb_credentials=DatabaseCredentials()db_replacer=DatabaseReplace(credentials=db_credentials)db_replacer.replace('my-old-record','my-new-record','my-table')Using custom serializerSince (as mentioned in the description) this find&replace project handles serialized
data, by default it assumes PHP serialization, however, you can provide a custom
serializer.fromadvanced_database_replace.database_replaceimportDatabaseReplacefromadvanced_database_replace.database_credentialsimportDatabaseCredentialsclassMyCustomSerializer:@staticmethoddefdumps(*args,**kwargs):pass@staticmethoddefloads(*args,**kwargs):passdb_credentials=DatabaseCredentials()db_replacer=DatabaseReplace(credentials=db_credentials,serializer=MyCustomSerializer())db_replacer.replace_all('my-old-record','my-new-record')Release history1.0.0Initial.
Package: advanced-dtypes
advanced-dtypesAdvanced DataTypes is a package for Python that provides access faster, feature-rich data types not provided in the standard library, motivated by my thoughts of "why is that not a thing?"
The aim of the project is to fill out the holes in the standard library data types' feature-set while improving upon the performance of the existing feature-set.Constant StoreConstant Store is a class that provides a namespace within which to store constants on a class attribute basis. Class definition is very simple:fromadvanced_dtypesimportConstStoreclassExample(ConstStore):NAME_1="some_value"NAME_2=23The class is built to populate a set and dictionary on import, which drives many of the features of the class, as well as the __slots__ attribute, which helps boost performance.
Since the class attributes are maintained, names can be directly dot-referenced.>>Example.NAME_1=="some_value"True>>type(Example.NAME_1)==strTrueConstStorealso provides an interface for the following functionality:>>len(Example)2>>23inExampleTrue>>Example(23)NAME_2>>Example["NAME_2"]23>>[valueforvalueinExample]["some_value",23]You should be aware, however, that non-hashable objects will have slower performance in lookups such asin,Class(value)andClass[name].Fast EnumFastEnumis simply a faster implementation of the existing standard libraryEnum.Definition is exactly the same as a standard enum:fromadvanced_dtypesimportFastEnumclassExample(FastEnum):NAME_1="some_value"NAME_2=23Similarly, standard enum functionality remains:>>Example.NAME_1<Example.NAME_1:some_value>>>Example.NAME_1.nameNAME_1>>Example.NAME_1.valuesome_value>>Example("some_value")<Example.NAME_1:some_value>>>Example["NAME_1"]<Example.NAME_1:some_value>>>len(Example)2>>[itemforiteminExample][<Example.NAME_1:some_value>,<Example.NAME_2:23>]>>Example.NAME_1==Example.NAME_1TrueThe only functional addition in this instance is equality checking of members against values directly:>>Example.NAME_1=="some_value"TrueHow To Installpipinstalladvanced-dtypes
Package: advancedfirebase
Advanced FirebaseAdvanced Firebase ia a library that adds more functional to standart firebase sdk.InstallationUse the package managerpipto install Advanced Firebase.pipinstalladvancedfirebaseMODULESDBThis module is only for use with Realtime Database.All functions:GetGetkeyUpdateSetParseExample database*{'fruits:{⠀⠀⠀⠀'apple':{⠀⠀⠀⠀⠀⠀'color': 'red'⠀⠀⠀⠀⠀⠀}⠀⠀⠀⠀'banana':{⠀⠀⠀⠀⠀⠀'color': 'yellow'⠀⠀⠀⠀⠀⠀}⠀⠀⠀⠀'kiwi':{⠀⠀⠀⠀⠀⠀'color': 'green'⠀⠀⠀⠀⠀⠀}⠀⠀⠀⠀}}*This is database that used in examplesProject initializefromadvancedfirebaseimportdbdb.init('url','credentials.json')GetArgs: pathout=db.get('/fruits/apple')print(out)OUTPUT:{'color':'red'}GetkeyArgs: path, keyout=db.getkey('/fruits/apple','color')print(out)OUTPUT:
redUpdateArgs: path, objobject={'apple':{'color':'green','size':'large'}}db.update('/fruits/',object)Result:{'fruits:{⠀⠀⠀⠀'apple':{⠀⠀⠀⠀⠀⠀'color': 'green',⠀⠀⠀⠀⠀⠀'size': 'large'⠀⠀⠀⠀⠀⠀}⠀⠀⠀⠀'banana':{⠀⠀⠀⠀⠀⠀'color': 'yellow'⠀⠀⠀⠀⠀⠀}⠀⠀⠀⠀'kiwi':{⠀⠀⠀⠀⠀⠀'color': 'green'⠀⠀⠀⠀⠀⠀}⠀⠀⠀⠀}}Setobject={'apple':{'color':'green','size':'large'}}db.set('/fruits/',object)Result:{'fruits:{⠀⠀⠀⠀'apple':{⠀⠀⠀⠀⠀⠀'color': 'green',⠀⠀⠀⠀⠀⠀'size': 'large'⠀⠀⠀⠀⠀⠀}⠀⠀⠀}}Parsereq=db.get('/fruits/apple')print(req)print(db.parse(req,'color'))OUTPUT:{'color':'red'}redMade by Artem Lukashenkov1.1.4
Package: advancedlogging
Builds futher on python’s logging by adding loggers for classes.Free software: MIT licenseInstallationpip install advancedloggingYou can also install the in-development version with:pip install https://github.com/fonganthonym/python-advancedlogging/archive/main.zipDocumentationhttps://python-advancedlogging.readthedocs.io/DevelopmentTo run all the tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog1.0.0 (2021-05-11)First release on PyPI.
Package: advancedmaths
Advanced Math is a library to calculate math problems.InstallStable Version:pipinstall-Uadvanced-mathBeta Version:pipinstall--pre-Uadvanced-mathFractionsA twin prime is a prime number that is either 2 less or 2 more than another prime number.Example: Find all twin primes below 1000.fromfind_primesimportfind_twinsprint(find_twins(1000))
Package: advanced-pid
advanced-pidAn advanced PID controller in Python. The derivative term can also be used in
practice thanks to built-in first-order filter. Detailed information can be
foundhere.Usage is very simple:fromadvanced_pidimportPID# Create PID controllerpid=PID(Kp=2.0,Ki=0.1,Kd=1.0,Tf=0.05)# Control loopwhileTrue:# Get current measurement from systemtimestamp,measurement=system.get_measurement()# Calculate control signal by using PID controllerreference=1.0control=pid(timestamp,reference-measurement)# Feed control signal to systemsystem.set_input(control)Complete API documentation can be foundhere.UsageBiggest advantage of advanced-pid, the derivative term has a built-in first-order
filter.advanced-pid package includes a toy mass-spring-damper system model for testing:fromadvanced_pidimportPIDfromadvanced_pid.modelsimportMassSpringDamperfrommatplotlibimportpyplotaspltfromnumpyimportdiff# Create a mass-spring-damper system modelsystem=MassSpringDamper(mass=1.0,spring_const=1.0,damping_const=0.2)system.set_initial_value(initial_position=1.0,initial_velocity=0.0)# Create PID controllerpid=PID(Kp=1.0,Ki=0.0,Kd=2.0,Tf=0.5)# Control looptime,meas,cont=[],[],[]foriinrange(800):# Get current measurement from systemtimestamp,measurement=system.get_measurement()# Calculate control signal by using PID controllercontrol=pid(timestamp,-measurement)# Feed control signal to systemsystem.set_input(control)# Record for plottingtime.append(timestamp)meas.append(measurement)cont.append(control)# Plot resultfig,(ax1,ax2,ax3)=plt.subplots(3,1)fig.suptitle('Mass-Spring-Damper system')ax1.set_ylabel('Measured Position [m]')ax1.plot(time,meas,'b')ax1.grid()ax2.set_ylabel('Force [N]')ax2.plot(time,cont,'g')ax2.grid()ax3.set_xlabel('Time [s]')ax3.set_ylabel('Derivative Term')ax3.plot(time[1:],diff(meas)/diff(time),'r')ax3.grid()plt.show()As It can be seen in the figure, derivative term cannot be use without a filter:InstallationTo install, run:pip3 install advanced-pidTestsTo run tests, run:python -m unittest tests.test_pidLicenseLicensed under theMIT License.
Package: advanced-pw-gen
pw_genA simple password generator written in Python 3.11UsageOptions:pw_length=16# Length of the password (integer)pw_type="upper,lower,number,symbol,legible"# Type of the password (string)Types:upper=Uppercaseletterslower=Lowercaselettersnumber=Numberssymbol=Symbolslegible=Legiblecharacters(no0,O,1,l,I)Example:frompw_genimportPasswordpw=Password(pw_length=16,pw_type="upper,lower,number,special,legible")print(pw.password())Output:Xy4@9#3$7%8&1!23
Package: advancedpythonmalware
AdvancedPythonMalware is a Python Library for creating simple malwares. It can make GDI, Spam Boxes, or Even delete SYSTEM32!List Of Classes And Commands
GDI.tunnel() – Creates a tunnel effect like in the memz virus
GDI.screen_glitch(repeat_time, r, g, b) – Creates screen glitches. Takes in (repeat_time, r, g, b) repeat_time is many times to glitch. and then the r, g, and b values give it the color.
Base.warning(nameofmalware, command) – Creates a malware warning. Takes in nameofmalware and command. Nameofmalware, is the name of your malware. And will use that to make a custom messagebox. Command is what function you will run if the user presses ok, AKA The malware command.
destructive.DeleteMBR() – Overwrites the Master Boot Record of the PC
destructive.TakeownSystem32() – Takes full ownership of system32 so you can delete files and so on.
destructive.DeleteCriticalFiles(repeat) – Trys to delete critical files in System32. The repeat argument is how many times you want it to try.
destructive.BSOD() – Blue screens the PC.
annoying.repeatingPopup(message, title) - Self explanitory. Creates a popup with specified message and text that cannot be closed.
annoying.shutdown(time, message) – Shuts down the computer with specified time and specified message.
annoying.restart(time, message) – Restarts the computer with specified time and specified message.Lets make some malware!!!!DISCLAIMER!!!
1. DO NOT USE THIS FOR MALICIOUS PURPOSES. OTHER THEN TESTING AND FUN.
2. DO NOT USE ANY OF THE COMMANDS IN THE “destructive” CLASS ON YOUR MAIN PC, AS OTHER THEN THE BSOD, THEY WILL CAUSE HARM AND MAYBE EVEN DESTROY IT.
3. DO NOT SPREAD ANY MALWARE MADE WITH THIS LIBRARY.
4. DO NOT DO THIS TO ANYONE WITHOUT THEIR CONSENT.
5. HAVE FUN :)©️ 2022 UnusualMonkey, LLC. All rights reserved.The Change Log1.0.0 (7/26/22)First ReleaseAdded basic malware functions.Check the README for more.
Package: advanced-quotes
advanced_quotesYour all-access pass to the world's largest quotations database. Random , daily quotes , over 40 thousand authors, various topics. Inside your comfy python development environment!FeaturesRetrieve random quotes.Retrieve daily quotes.View a specific author's full set of quotes and info.View a specific topic's full set of quotes .A topic/author index so you can search for them.Well documented with examples.Note:  This is heavily based on classes, you must be familiar with those.Getting startedDownload the module using pip :$ pip install advanced-quotesNote: This may differentiate depending on your use caseImport the module, use whatever you need. Also, you'll be accessing the module usingadvanced_quotesinstead ofadvanced-quotesDocumentationThis module is fully documented on the dedicatedwebsite.CopyrightCopyright (c) 2020 Copyright Holder All Rights Reserved.Data provided byBrainyQuote
Package: advanced-scrapy-proxies
advanced-scrapy-proxiesadvanced-scrapy-proxies is a Python library for dealing with proxies in your Scrapy project.
Starting fromAivarsk's scrapy proxy(no more updated since 2018) i'm adding more features to manage lists of proxies generated dinamically.InstallationUse the package managerpipto install advanced-scrapy-proxies.pipinstalladvanced-scrapy-proxiesUsagesettings.pyDOWNLOADER_MIDDLEWARES={'scrapy.downloadermiddlewares.retry.RetryMiddleware':90,'advanced-scrapy-proxies.RandomProxy':100,'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware':110}## Proxy mode# -1: NO_PROXY, middleware is configured but does nothing. Useful when needed to automate the selection of the mode# 0: RANDOMIZE_PROXY_EVERY_REQUESTS, every requrest use a different proxy# 1: RANDOMIZE_PROXY_ONCE, selects one proxy for the whole execution from the input list# 2: SET_CUSTOM_PROXY, use the proxy specified with option CUSTOM_PROXY# 3: REMOTE_PROXY_LIST, use the proxy list at the specified URLPROXY_MODE=3PROXY_LIST='https://yourproxylisturl/list.txt'As every scrapy project, you can override the settings in settings.py when calling the scraper.##PROXY_MODE=-1, the spider does not use the proxy list provided.scrapycrawlmyspider-sPROXY_MODE=-1-sPROXY_LIST='myproxylist.txt'##PROXY_MODE=0, the spider use the proxy list provided, choosing for every request a different proxy.scrapycrawlmyspider-sPROXY_MODE=0-sPROXY_LIST='myproxylist.txt'##PROXY_MODE=1, the spider use the proxy list provided, choosing only one proxy for the whole execution.scrapycrawlmyspider-sPROXY_MODE=1-sPROXY_LIST='myproxylist.txt'##PROXY_MODE=2, the spider uses the proxy provided.scrapycrawlmyspider-sPROXY_MODE=2-sPROXY_LIST='http://myproxy.com:80'##PROXY_MODE=3, the spider uses the proxy list at the url provided. The list is read at every request made by the spider, so it can be updated during the execution.scrapycrawlmyspider-sPROXY_MODE=3-sPROXY_LIST='http://myproxy.com:80'Planned new features and updatesMinor updatesadding more tests on the format of the input variablesrewriting error messagesNew featuresAdding a cooldown list: instead of deleting proxy after a failed attempt to get data, use a cooldown list where they are not used for a limited time in the scraper but ready to be reused when the cooldown finishes.Adding support for reading urls of the lists behind user and passwordUpdating proxy list at every request even for PROXY_MODE=0ContributingPull 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.LicenseGNU GPLv2
Package: advancedselector
Advanced SelectorHas the ability to use multiple selection types:Single selectMultiple selectionCross platform implementationThe library make use of thegetchlib on Linux andmsvcrton WindowsTry it!WindowsMake sure to havePythonandGitinstalled.Open a powershell and run:# Clone the repositorygitclonehttps://github.com/kougen/py-advanced-selector# Change dircdpy-advanced-selector# Create a virtual envpy-mvenvvenv# Enter the venv./venv/Scripts/activate# Install the dependenciespipinstall-rrequirements.txt# Start the sample.pypytest\sample.py
Package: advanced-sqlalchemy-manager
Managers for SQLAlchemy.Manager for model, methods were added during runtime to query.Installation$ [sudo] pip install advanced-sqlalchemy-managerDocumentationManagedQueryManaged query that replaces sqlalchemy.query classExample:fromsqlalchemy.ormimportsessionmakerfromsqlalchemyimportcreate_enginefromsqlalchemy.ormimportdeclarative_basefromsqlalchemyimportColumn,Integer,StringfromalchmanagerimportManagedQuery,BaseQueryManagerengine=create_engine('sqlite:///:memory:')session_factory=sessionmaker(query_cls=ManagedQuery,bind=engine)session=session_factory()Base=declarative_base()classPerson(Base):__tablename__='persons'id=Column(Integer,primary_key=True)name=Column(String(50),nullable=False)age=Column(Integer,nullable=False)classPersonQueryManager(BaseQueryManager):__model__=Person@staticmethoddefolder_than(query:ManagedQuery,age:int)->ManagedQuery:returnquery.filter(Person.age>age)@staticmethoddefyounger_than(query:ManagedQuery,age:int):returnquery.filter(Person.age<age)@staticmethoddeffirst_of_exact_age(query:ManagedQuery,age:int):returnquery.filter(Person.age==age).first()filtered_persons=session.query(Person).older_than(30).filter(Person.name.contains('_')).younger_than(60).all()person_25_years_old=session.query(Person).first_of_exact_age(25)ManagedSessionManaged session.
Use decoratorload_manager()to register query managers into session.
Registered that way session managers will be usable on any model.Example:fromsqlalchemy.ormimportsessionmakerfromsqlalchemyimportcreate_enginefromsqlalchemy.ormimportdeclarative_basefromsqlalchemyimportColumn,Integer,String,BooleanfromalchmanagerimportManagedQuery,ManagedSession,BaseQueryManagerengine=create_engine('sqlite:///:memory:')session_factory=sessionmaker(class_=ManagedSession,bind=engine)session=session_factory()Base=declarative_base()classPerson(Base):__tablename__='persons'id=Column(Integer,primary_key=True)name=Column(String(50),nullable=False)age=Column(Integer,nullable=False)classBook(Base):__tablename__='books'id=Column(Integer,primary_key=True)title=Column(String)is_public=Column(Boolean,nullable=False,default=False)@session.load_manager()classBookQueryManager(BaseQueryManager):@staticmethoddefis_book_public(query:ManagedQuery)->ManagedQuery:returnquery.filter(Book.is_public.is_(True))count_of_filtered_books=session.query(Book).is_book_public().count()# This will produce broken query because is_public does not exists in Person modelpersons=session.query(Person).is_book_public().count()