Saravanan666/pypi-org huggingface dataset:
Package: interpret-community
Microsoft Interpret Community SDK for PythonThis package has been tested with Python 3.7, 3.8 and 3.9The Interpret Community SDK builds on Interpret, an open source python package from Microsoft Research for training interpretable models, and helps to explain blackbox systems by adding additional extensions from the community to interpret ML models.Interpret-Community is an experimental repository that hosts a wide range of community developed machine learning interpretability techniques. This repository makes it easy for anyone involved in the development of a machine learning system to improve transparency around their machine learning models. Data scientists, machine learning engineers, and researchers can easily add their own interpretability techniques via the set of extension hooks built into the peer repository, Interpret, and expand this repository to include their custom-made interpretability techniques.Highlights of the package include:The TabularExplainer can be used to give local and global feature importancesThe best explainer is automatically chosen for the user based on the modelLocal feature importances are for each evaluation rowGlobal feature importances summarize the most importance features at the model-levelThe API supports both dense (numpy or pandas) and sparse (scipy) datasetsThere are utilities provided to convert engineered explanations, based on preprocessed data before training a model, to raw explanations on the original datasetFor more advanced users, individual explainers can be usedThe KernelExplainer, GPUKernelExplainer, PFIExplainer and MimicExplainer are for BlackBox modelsThe MimicExplainer is faster but less accurate than the KernelExplainer, and supports various surrogate model typesThe TreeExplainer is for tree-based modelsThe LinearExplainer is for linear modelsThe DeepExplainer is for DNN tensorflow or pytorch modelsThe PFIExplainer can quickly compute global importance valuesLIMEExplainer builds local linear approximations of the model's behavior by perturbing each instanceGPUKernelExplainer is GPU-accelerated implementation of SHAP's KernelExplainer as a part of RAPIDS's cuML library, and is optimized for GPU models, like those in cuML. It can be used with CPU-based estimators too.An adapter to convert any feature importance values to an interpret-community style explanationPlease see the github website for the documentation and sample notebooks:https://github.com/interpretml/interpret-communityAuto-generated sphinx API documentation can be found here:https://interpret-community.readthedocs.io/en/latest/index.htmlMore information on the ExplanationDashboard can be found here:https://github.com/microsoft/responsible-ai-toolbox
Package: interpreted
interpretedA Python interpreter, written from scratch in Python.This interpreter is made solely as the base for my talk,
"Writing a Python interpreter from scratch, in half an hour."InstallationpipinstallinterpretedUsage$catfoo.pyprint("2 + 2 is", 2 + 2)def greet(name='User'):print('Hello,', name + '!')greet()$interpretedfoo.py2 + 2 is 4Hello, User!Local Development / TestingCreate and activate a virtual environmentRunpip install -r requirements-dev.txtto do an editable installRunpytestto run testsType CheckingRunmypy .Create and upload a package to PyPIMake sure to bump the version insetup.cfg.Then run the following commands:rm-rfbuilddist
pythonsetup.pysdistbdist_wheelThen upload it to PyPI usingtwine:twineuploaddist/*
Package: interpreter-command
Interpreter CommandAn overcomplicated solution to the question "How could we easily make multiple autonomous routines?"The interpreter command provides a way to create a Domain Specific Language (DSL) that can run any sequence
of commands at runtime. Ostensibly, this to write a command sequence for autonomous execution; however, this
can be used to create a command sequence for any purpose (whether the hit to efficiency is worth it is up to
the user).InstallationPythonWindows:py -3 install interpreter-commandMacOS/Linux:python3installinterpreter-commandC++/Java:TBD when I've written the thingsUsageAll you need to do to create an InterpretCommand is to instantiate the
class in your language of choice, register commands to it, and
register your fully-realized InterpretCommand object the same way you
would register any other command. At any time, you can load a new
program and replace the current one.Python# WARNING: This example will not work as-isimportwpilibimportinterpretercommandasicimportcommands2classMyRobot(wpilib.TimedRobot):# ...defrobotInit(self):# Creating the interpreterself.interpreter=ic.InterpretCommand()# Registering the commandsself.interpreter.register("say",commands2.PrintCommand)self.interpreter.register("drive",SomeDriveCommand,drive_subsystem)# parameters: x, y, z# ...defautonomousInit(self):self.interpreter.schedule()defteleopInit(self):self.interpreter.cancel()Now you could write a program likesay "hello"
say "world"
drive 0, 0.4, 0which would print "hello\nworld", then drive the robot in the Y
direction at 40% speed until the command is canceled, assumingSomeDriveCommanddoes nothing but drive continuously using its
inputs.LicenseThis project is licensed under the MIT License. If this doesn't work for you, feel free to create an issue requesting it.CaveatThis library is specifically designed to work withRobotPyandWPILib. The concept may work well with other robotics
frameworks, but this library is not compatible.
Package: interpreters-3-12
SetupTo use this directory you must first build the development
version of CPython on your machine by following the instructionshere. (This can seem intimidating but the instructions
are very clear and meticulous and you are likely to succeed on your
first try).Once you install the CPython development version (make sure you make
any necessary path adjustments), when you runpython --versionyou should see something like this:Python 3.12.0a7+Testing the ExamplesAfter cloning this repo, usepiporpipxto (globally) install thehatchbuild system.Move to the root directory of the cloned repo and run:hatch shellThis configures and enters a virtual environment. Now move to theexamplesdirectory and you can run:pytest
ruff check .
mypy .
Package: interpret-segmentation
Interpret SegmentationA one-stop shop for the interpretability of image segmentation models.
This code was extracted from my bachelors thesis:https://github.com/andef4/thesis-codeAvailable algorithms:Hausdorff Distance MasksRISEDocumentationThe documentation is available on Read the Docs:https://interpret-segmentation.readthedocs.io/en/latest/.DevelopmentTo hack on interpret-segmentation, do the following:Clone the git repositoryCreate a new virtualenv and activate it, e.g.python3 -m venv venv/; source venv/bin/activateInside the git repository, install the library in development mode including development dependencies:pip install -e .[dev]Install the flake8 pre-commit hook withpre-commit
Package: interpy
Interpyextends Pythonto supportRuby likestring interpolation#{}. Quick example:print "Hello #{your_name}"It ishightly optimized, and directly compiled to bytecode, so you
will have the same Python speed when using it.InstallationThe installation of this package is quite simple, you only have to runpip install interpy.UsageAll python files with string interpolation must have the following first
line# coding: interpyExample:# coding: interpypackage="Interpy"print"Enjoy #{package}!"How it worksThis package is inspired in Dropbox `pyxl template engine`_.ParsingInterpy uses support for specifying source code encodings as described
inPEP 263to do what it does. The functionality was originally
provided so that python developers could write code in non-ascii
languages (eg. chinese variable names). Interpy creates a custom
encoding called interpy which allows it to convert interpolated strings
into regular python before the file is compiled. Once the interpy codec
is registered, any file starting with# coding: interpyis run
through the interpy parser before compilation.CompilingThe above example would be compiled to this (inbytecode):# coding: interpypackage="Interpy"print"Enjoy "+str(package)+"!"CompatibilityThis package is fully compatible with Python 2+, Python 3+ and PyPyWhy?I really enjoyed Ruby String interpolation, and"".format(...)or"" %(...)seems very verbose to me.I’m lazy by nature;)
Package: interpylate
interpylateinterpylate is a Python library for N-linear regular grid interpolation. It provides a flexible and efficient method to interpolate N-dimensional arrays using a N-linear approach.It can be useful for image interpolation and its 3D (or more) equivalent.InstallationpipinstallinterpylateUsagefrominterpylateimportNLinearRegularGridInterpolator# Create an instance of the interpolatorinterpolator=NLinearRegularGridInterpolator(dim)# Evaluate the interpolation at specified coordinatesinterpolated_values=interpolator.evaluate(NDarray,continuous_inds)# Compute the gradient of the interpolated arraygradient=interpolator.grad(NDarray,continuous_inds,evaluate_too=False)# Compute the hessian of the interpolated arrayhessian=interpolator.hess(NDarray,continuous_inds,grad_too=False,evaluate_too=False)DocumentationFor detailed documentation, please refer to the interpylatedocumentation.ExamplesYou can find usage examples in theexamplesdirectory of the interpylate GitHub repository.ContributingContributions to interpylate are welcome! If you have any bug reports, feature requests, or want to contribute code, please visit theGitHub repository.Licenseinterpylate is licensed under the CeCILL License. SeeLICENSEfor more information.
Package: interrail
InterrailThis python library is an unofficial wrapper around the api ofInterrailwhich can be used to plan train trips through europe.Installationpip install interrailUsagefrominterrail.apiimport*# To search for a station use get_stop_locationamsterdam=get_stop_location("Amsterdam Centraal")paris=get_stop_location("Paris")# To plan a trip between two stations use get_triptrip=get_trip(origin=amsterdam,dest=paris,departure_time=datetime.now())To see what fieldsStopLocationandTripprovide, referencedata.py.Note thatget_stop_location/get_triponly return the first entry that the api provides. To view all entries useget_stop_locations/get_trips.ContributingCurrently, this wrapper is far from complete and probably contains bugs. Feel free to contribute using issues/prs.
Package: interruptible-list
A interruptible listBuild a list from a iterable, interruptible by KeyboardInterrupt (SIGINT), and
monitorable by SIGUSR1 and SIGUSR2.The functioninterruptible_listact as list() constructor, and build a list from
an iterable, except:When a SIGINT (CTRL-C, KeyboardInterrupt) is received, the construction
is stopped, and the current list is returned.When a SIGUSR1 is received, the last item is pickled in a file or a callback
is called on the last item, and the construction of the list continues.When a SIGUSR2 is received, the whole current list is pickled in an file or
a callback is called on the whole current list, and the construction of the
list continues.ExamplesAll examples are illustrated with a slow version ofrange(60).importtimedefmygen():foriinrange(60):time.sleep(1)yieldiBasic interruptible list:frominterruptible_listimportinterruptible_listL=interruptible_list(mygen())With callback onSIGUSR1to display the last item onstderrimportsysfrominterruptible_listimportinterruptible_listdefmycallback(x):print(x,file=sys.stderr)L=interruptible_list(mygen(),callback_last=mycallback)With callback onSIGUSR2to display the mean on the current list onstderr:importsysfrominterruptible_listimportinterruptible_listdefmycallback_mean(thelist):mean=sum(thelist)/len(thelist)print(mean,file=sys.stderr)L=interruptible_list(mygen(),callback_whole=mycallback_mean)With save onSIGUSR1andSIGUSR2. Last item (USR1) or the whole current list
(USR2) is pickled when the signal is received.frominterruptible_listimportinterruptible_listL=interruptible_list(mygen(),save_last=True,save_whole=True)
Package: interruptingcow
Interruptingcow is a generic utility that can relatively gracefully interrupt
your Python code when it doesn’t execute within a specific number of seconds:from interruptingcow import timeout

try:
    with timeout(5, exception=RuntimeError):
        # perform a potentially very slow operation
        pass
except RuntimeError:
    print "didn't finish within 5 seconds"Timeouts are specified in seconds (as floats with theoretical microsecond
precision).Installation$ pip install interruptingcowReentrantInterruptingcow is fully reentrant, which means that you can have nested
timeouts:from interruptingcow import timeout

class Outer(RuntimeError): pass

class Inner(RuntimeError): pass

try:
    with timeout(20.0, Outer):
        try:
            with timeout(1.0, Inner):
                # some expensive operation
                try_the_expensive_thing()
        except Inner:
            do_the_cheap_thing_instead()

except Outer:
    print 'Program as a whole failed to return in 20 secs'Nested timeouts allow a large outer timeout to contain smaller timeouts. If the
inner timeout is larger than the outer timeout, it is treated as a no-op.Function DecoratorsInterruptingcow can be used both as inline with-statements, as shown in the
above examples, as well as function decorator:from interruptingcow import timeout

@timeout(.5)
def foo():
    with timeout(.3):
        # some expensive operation
        passQuotasYou can allocate a quota of time and then share it across multiple invocations
totimeout(). This is especially useful if you need to use timeouts inside
a loop:from interruptingcow import timeout, Quota

quota = Quota(1.0)
for i in something:
    try:
        with timeout(quota, RuntimeError):
            # perform a slow operation
            pass
    except RuntimeError:
        # do a cheaper thing insteadHere the first iterations of the loop will be able to perform the expensive
operation, until the shared quota of 1 second runs out and then the remaining
iterations will perform the cheaper alternative.A single quota instance can also be shared across all calls totimeout()your application makes (including nested calls), to give place an upper bound
on the total runtime, regardless of how many calls totimeout()you have.CaveatsInterruptingcow usessignal(SIGALRM)to let the operating system interrupt
program execution. This has the following limitations:Python signal handlers only apply to the main thread, so you cannot use this
from other threadsYou must not use this in a program that usesSIGALRMitself (this
includes certain profilers)
Package: intersect
Intersection Of two curves in Pure numpyInspired fromthismatlab implementation, wrote this python implementation of how to detect intersection of two curves.Example usagefromintersectimportintersectiona,b=1,2phi=np.linspace(3,10,100)x1=a*phi-b*np.sin(phi)y1=a-b*np.cos(phi)x2=phiy2=np.sin(phi)+2x,y=intersection(x1,y1,x2,y2)plt.plot(x1,y1,c="r")plt.plot(x2,y2,c="g")plt.plot(x,y,"*k")plt.show()
Package: intersection
IntersectionTelegrambased version of a text based game where two players try to find the same word.Start👋 Hello and welcome to The Intersection Game!This is a two-player game so you must find another player to start a game.To do so you must use the /play command. Typing /play will put you inside a game; if another player also uses /play soon after you, the game will start with this person as the other player.If you specify a password (e.g./play 123) you will only play against a player who uses the same password.On each round, each player must enter their word. The goal is to enter the same word based on the two previously entered ones. Words may only be used once per game.Have fun!HelpHere is the list of what you can do:/start - Displays the start message and the rules./help - Displays a description of available commands./play [password] - Starts a new game with the optional password. Places you in the waiting room if no password is provided./stop - Terminates your current game.Simply send me your next word when within a game (won't take accents and capitals into account).Run instanceInstall usingpip install intersectionSpecify the environnement variableINTERSECTION_TELEGRAM_BOT_TOKEN(seeHow to create a Telegram bot)Start the bot using theintersection-gamecommand
Package: intersectioncalc
Finds rectangle intersectionspip install intersectioncalcTested against Windows 10 / Python 3.10 / Anaconda - should work on MacOS / LinuxFindsrectangleintersectionsinaDataFrameandpopulatesanewcolumnwithresults.ThefunctionutilizesNumExprforcalculations,whichcansignificantlyimproveperformancewhendealingwithlargedatasetsofrectanglesArgs:df(pd.DataFrame):InputDataFramecontainingrectanglecoordinates.columns(tupleorlist,optional):Namesofcolumnscontainingrectanglecoordinates(start_x,start_y,end_x,end_y).Defaultsto("start_x","start_y","end_x","end_y").new_column(str,int,float,optional):Nameofthenewcolumntostoreintersectionresults.Defaultsto"aa_intersecting".dtype(np.float32|np.float64|np.int32|np.int64,optional):Datatypeforcalculations.Defaultstonp.int32.convert_to_tuples(bool,optional):IfTrue,convertsintersectionresultstotuples.DefaultstoFalse.Returns:pd.DataFrame:InputDataFramewiththenew_columnpopulatedwithintersectionresults.fromintersectioncalcimportfind_rectangle_intersectionsimporttimeimportpandasaspdimportnumpyasnpmin_x=1max_x=100min_y=1max_y=100size=50000min_width=1max_width=1000min_height=1max_height=1000df=pd.DataFrame([(startx:=np.random.randint(min_x,max_x,size=size)),(starty:=np.random.randint(min_y,max_y,size=size)),startx+np.random.randint(min_width,max_width,size=size),starty+np.random.randint(min_height,max_height,size=size),]).T.rename(columns={0:"start_x",1:"start_y",2:"end_x",3:"end_y"})start=time.perf_counter()df=find_rectangle_intersections(df,columns=("start_x","start_y","end_x","end_y"),new_column="aa_intersecting",dtype=np.int32,convert_to_tuples=False,)print(time.perf_counter()-start)
Package: intersection-grouper
Groups lists by common intersectionspipinstallintersection-grouperfromintersection_grouperimportgroup_lists_with_intersectionslistgroup=[[5,3,4,5],[5,11,12,3],[52,34],[34,111,112],[1000,300],[300,5000],]x=group_lists_with_intersections(listgroup,keep_duplicates=True)print(x)[(34,34,52,111,112),(300,300,1000,5000),(3,3,4,5,5,5,11,12)]x2=group_lists_with_intersections(listgroup,keep_duplicates=False)print(x2)[(34,52,111,112),(300,1000,5000),(3,4,5,11,12)]
Package: intersection.py
intersection.pyAn easy to use API wrapper with some basic functionality you would expect an API wrapper to have.Key FeaturesUser, Map, Comment and Highscore classes with their corresponding features.Functions used to get said objects from different sources.It's not really optimized but should work just fine.InstallingYou can either use pip or copy the github repository.pip (replace "version" with the version you want to download or alternatively just don't specify it.):pipinstallintersection.py==versionRequired packagesThe only other package this API wrapper requires isrequests. In order to download it run this command:pipinstallrequestsQuick exampleimportintersectionmy_user=intersection.user.get_details_for_user(userId=2452411)print(my_user.name)my_maps=my_user.get_user_maps()formapinmy_maps:print(map.name)comment=map.get_comments(limit=1)iflen(comment):print("Latest comment: "+comment[0].comment)ifmap.gameModeGroup==2:highscore=map.get_highscores(count=1)print("Highscore: "+highscore[0].score)JSON examplefromintersection.extimporturlmy_user=url.get_details_for_user(userId=2452411)print(my_user["name"])my_maps=url.list_maps_by_user(userId=my_user["objectId"])formapinmy_maps:print(map["name"])comment=url.list_comments_on_map(mapId=map["objectId"],limit=1)iflen(comment):print("Latest comment: "+comment[0]["comment"])ifmap["gameModeGroup"]==2:highscore=url.list_high_scores_on_map(mapId=map["objectId"],count=1)print("Highscore: "+highscore[0]["score"])External linksPYPI Page (pip installation)JavaScript versionmade byRanggaGultomGithub Repository
Package: intersectlib
intersectlibintersectlib is a library created to find intersections and remainders between two ranges and transform those.FeaturesFind range intersectionsFind remaining sourceTransform intersectionsInstallationInstall intersectlib using pippipinstallintersectlibUsage/Examples# find the intersection between two rangesfind_intersections(source:tuple|range,destination:tuple|range)find_intersections((2,10),range(5,12))>>(5,10)find_intersections((2,10),(20,30))>>None# find the remainders when the intersection is removedfind_remainders(source:tuple|range,destination:tuple|range)find_remainders((2,10),range(5,12))>>[(2,5),(10,12)]find_remainders((2,10),(1,12))>>[]# both of the functions abovefind_intersection_and_remainders(source:tuple|range,destination:tuple|range)find_intersection_and_remainders((2,10),range(5,12))>>(5,10),[(2,5),(10,12)]# find a new intersection and transform ittransform_new_intersection(source:tuple|range,destination:tuple|range,value_to_add:int)transform_new_intersection((2,10),range(5,12),5)>>(10,15)# transform an already existing intersectiontransform_existing_intersection(intersection:tuple|range,value_to_add:tuple|range)transform_existing_intersection((5,10),5)>>(10,15)transform_existing_intersection((5,10),-3)>>(2,7)Authors@RduckerSupportFor support:emailduckerricardo@gmail.com.message me on discord: randomduck08post an issue at:https://github.com/Rducker0208/intersectlib/issues
Package: intersectshape
Reverse geocoding from a shapefile of polygons.How ?TheReverseGeolocShapefileclass improves theshapefile.Readerclass by
adding aintersectionmethod to find polygons that intersects with a single
point.I use a simple spatial index that store the bounding box of each polygons.
I save these informations into a.sidx.npyfile next to the.dbf/.shpfiles.Works with Python 3.6+ (I’m using f-string).DocumentationTheintersectionmethod of theReverseGeolocShapefileclass return a list
of row index.Usageimport intersectshape

shp = intersectshape.ReverseGeolocShapefile('/path/of/shapefile.shp')

# You can use all methods of shapefile.Reader object like...
row = shp.record(5)
geo = shp.shape(2)

# Find polygons that intersects a point
x, y = 200, 500  # must be at the same projection system
ids = shp.intersection(x, y)
print(ids)
# return [] or [0, 5, 9, 7] for example.LicenseThis code are under theGNU GPL v3licence.Data of French communal polygons (Geofla shapefile located in thedatafolder) are underEtalab Open License.
Package: interspace
InterspaceGives us different distance between two vectors which are given in as an input.InstallationpipinstallinterspaceDifferent Distance FunctionsMinkowski distance(p-Norm Distance)minkowski(vector_1, vector_2, p=1)Euclidean distance (2-norm distance)euclidean(vector_1, vector_2)Manhattan distance/Taxicab normmanhattan(vector_1, vector_2)Cosine Similaritycosine_similarity(vector_1, vector_2)Haversine formulahaversine(coord1, coord2, R = 6372800)Hamming distancehamming(int, int); hamming(str, str) # where, length of both the strings should be sameMahalanobis distancemahalanobis(vector_1, vector_2, inverse_of_the_covariance_matrix)Usageimportinterspace# Calculate Euclidean Distaceinterspace.euclidean([1,2,3],[4,5,6])##Output: 5.196152422706632# Compute the great-circle distance between two points on a sphere# given their longitudes and latitudes.interspace.haversine((42.5170365,15.2778599),(51.5073219,-0.1276474))##Output: 1532329.6237517272