Saravanan666/pypi-org huggingface dataset:
Package: indentpy
indentpyPython script to change indentations of files.DependenciesThis package requires the following programs to be installed:PythonInstallationThe installation can be done by cloning this Github repository and running the./install.shscript.Cloning the Github repository:git clone https://github.com/Thijsvanede/indentpy.gitInstalling the script:chmod +x ./install.sh
./install.shUsageThe python script can be used in several ways:As a command line program after installation.As a command line program from source.As a python library.For all use cases we give a usage example.Inputting special charactersWhen you wish to specify special characters like\tor\n, these can be put into abashterminal by the combinationctrl+vfollowed by the key for that character. Examples:\t:ctrl+vfollowed bytab\n:ctrl+vfollowed byenter\r\n:ctrl+vfollowed bycrtl+rfollowed byctrl+vfollowed byenterCommand-line (Installed)The usage of indent is explained in the help file below.Usage: indent [-h] [-w WRITE] [-o ORIG] [-t TO] [-d DELIM] file [file ...]

Change indentation of file(s).

positional arguments:
    file    File(s) for which to change indentation.

optional arguments:
    -h    Show this help text.
    -d    Line delimiter in original file    (optional, default='\n').
    -o    Indentation style in original file (optional, default='\t').
    -t    Indentation style in desired  file (optional, default='    ').
    -w    File to write output to (optional, default writes to inputfile).ExampleThe following example takesinfile.py, transforms the original\tindentation to 4 spaces and finally writes it tooutfile.py.indent -w outfile.py -o '	' -t '    ', infile.pyCommand-line (From source)To run the program from source, you can use bothPython 2andPython 3. The usage ofindent/indent.pyis explained in the help file below.usage: indent.py [-h] [-w WRITE] [-o ORIG] [-t TO] [-d DELIM] file [file ...]

Indentation change tool.

positional arguments:
  file                      File(s) for which to change indentation.

optional arguments:
  -h, --help                show this help message and exit
  -w WRITE, --write WRITE   File to write output to (optional, if none is given,
                            change contents of file.
  -o ORIG, --orig ORIG      Indentation style in original file (optional, if none
                            is given, use '\t').
  -t TO, --to TO            Indentation style in desired file (optional, if none
                            is given, use 4 spaces).
  -d DELIM, --delim DELIM   Line delimiter in original file (optional, if none is
                            given, use '\n')ExampleThe following example takesinfile.py, transforms the original\tindentation to 4 spaces and finally writes it tooutfile.py.python indent/indent.py -w outfile.py -o '	' -t '    ', infile.pyPythonTODO
Package: indent-template
indent_template下の方に日本語の説明がありますOverviewA tool to replace strings without breaking indent.description is under construction.Usageimportindent_template# String before replacementtemplate_str="""def func():ls = VALUE_HEREprint(str(ls + VALUE_HERE))"""# String after replacementrep_str="""["hoge","fuga"]"""# Replacing strings without breaking indentation [indent_template]result_str=indent_template.replace(template_str,# String before replacement{"VALUE_HERE":rep_str}# Replacement pattern)# Result confirmationprint(result_str)Resultdef func():
	ls = [
		"hoge",
		"fuga"
	]
	print(str(ls + [
		"hoge",
		"fuga"
	]))概要インデントを崩さずに文字列の置き換えが実施できます。プログラミング言語やjsonなどをプログラムで出力する際などに便利です。説明は執筆途上です使用例importindent_template# 置き換え元の文字列template_str="""def func():ls = VALUE_HEREprint(str(ls + VALUE_HERE))"""# 置き換え後文字列rep_str="""["hoge","fuga"]"""# インデントを崩さずに文字列を置き換える [indent_template]result_str=indent_template.replace(template_str,# 置き換え元の文字列{"VALUE_HERE":rep_str}# 置き換えパターン)# 結果確認print(result_str)結果def func():
	ls = [
		"hoge",
		"fuga"
	]
	print(str(ls + [
		"hoge",
		"fuga"
	]))
Package: independency
IndependencyIndependency is a DI container library. Unlike many other Python DI containers Independency operates in the local scope. It's inspired bypunq, so the API is very similar.Independency supports generics and other specific typings.InstallationpipinstallindependencyQuick startIndependency avoids global state, so you must explicitly create a container in the entrypoint of your application:import independency

builder = independency.ContainerBuilder()
# register application dependencies
container = builder.build()ExamplesimportrequestsfromindependencyimportContainer,ContainerBuilderclassConfig:def__init__(self,url:str):self.url=urlclassGetter:def__init__(self,config:Config):self.config=configdefget(self):returnrequests.get(self.config.url)defcreate_container()->Container:builder=ContainerBuilder()builder.singleton(Config,Config,url='http://example.com')builder.singleton(Getter,Getter)returnbuilder.build()defmain():container=create_container()getter:Getter=container.resolve(Getter)print(getter.get().status_code)if__name__=='__main__':main()Suppose we need to declare multiple objects of the same type and use them correspondingly.fromindependencyimportContainer,ContainerBuilder,DependencyasDepclassQueue:def__init__(self,url:str):self.url=urldefpop(self):...classConsumer:def__init__(self,q:Queue):self.queue=qdefconsume(self):whileTrue:message=self.queue.pop()# process messagedefcreate_container()->Container:builder=ContainerBuilder()builder.singleton('first_q',Queue,url='http://example.com')builder.singleton('second_q',Queue,url='http://example2.com')builder.singleton('c1',Consumer,q=Dep('first_q'))builder.singleton('c2',Consumer,q=Dep('second_q'))returnbuilder.build()defmain():container=create_container()consumer:Consumer=container.resolve('c1')consumer.consume()if__name__=='__main__':main()
Package: index
INSTALLATIONsudo easy_install indexHOW TO USEfrom index import main
main.main()or clifrom index import export
export.main(files)

from index import export
export.main(files, "Example list (proceed_default)")Usetksettings.pyfor import setting from plugins
‘proceed_default’, ‘proceed_default2’
(Click ‘Import from module’ and choose files:
‘proceed_default/presets_default.py’ and
‘proceed_default2/presets_default.py’).
Package: index-503
Index 503PEP 503 index builderUsageIf you have a directory full of wheels likemusllinux:index-503 musllinuxThis will produce amusllinux-indexdirectory with a PEP 503 index symlinked to the original directory without disturbing the original directory.Running this again will replace the original index and delete the old index in an atomic manner.A lock will be held in the parent directory to prevent concurrent executions.ExampleFor image buildspip3 install --no-cache-dir --dry-run --only-binary=:all: --index-url "https://wheels.koston.org/musllinux-index/" -r requirements.txtFor run time installspip3 install --no-cache-dir --dry-run --only-binary=:all: --extra-index-url "https://wheels.koston.org/musllinux-index/" -r requirements.txtKnown issuesThis only works with pip 23.2 or later due tohttps://github.com/pypa/pip/issues/12038InstallationInstall this via pip (or your favourite package manager):pip install index-503CreditsThis package was created withCopierand thebrowniebroke/pypackage-templateproject template.This project borrows heavily from Dominic Davis-Foster's simple503https://github.com/repo-helper/simple503
Package: index-analysis
A sample Python projectA sample project that exists as an aid to the Python Packaging User Guide’s Tutorial on Packaging and Distributing Projects.This projects does not aim to cover best practices for Python project development as a whole. For example, it does not provide guidance or tool recommendations for version control, documentation, or testing.This is the README file for the project.The file should use UTF-8 encoding and be written using reStructuredText. It will be used to generate the project webpage on PyPI and will be displayed as the project homepage on common code-hosting services, and should be written for that purpose.Typical contents for this file would include an overview of the project, basic usage examples, etc. Generally, including the project changelog in here is not a good idea, although a simple “What’s New” section for the most recent version may be appropriate.
Package: index-calculator
VersionsDocumentation and SupportOpen SourceCoding StandardsDevelopment StatusPython index_calculator is an xclim wrapper to calculate climate indicators from CMORized netCDF files.DocumentationThe official documentation is athttps://index-calculator.readthedocs.io/FeaturesCalculate climate indices viaxclim.Write standardized netCDF attributes.Write on disk with a project-specific output file name.Available projectsYou can calculate climate indicators using index_calculator with the projects listed in the table below.CMIPCMIP5, CMIP6CORDEXCORDEXObservational dataE-OBS, HYRASReanalysis dataERA5InstallationYou can install the package directly with pip:pip install index_calculatorIf you want to contribute, I recommend cloning the repository and installing the package in development mode, e.g.git clone https://github.com/ludwiglierhammer/index_calculator
cd index_calculator
pip install -e .This will install the package but you can still edit it and you don’t need the package in yourPYTHONPATHRequirementspython3.6 or higherxclimnumpypandasxarraycf_xarraycftimeCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: index-eab
This is the simplified version of the testbed proposed in theIndex Advisor (EA&B)paper, which conducts a comprehensive assessment of the heuristic-based and the learning-based index advisors.This package implements workflow of the index advisor:(1) Index Candidate Generation:synthesizes promising index candidates using predefined strategies;(2) Index Selection:iterates over the generated index candidates and selects indexes based on the underlying selection mechanisms;(3) Index Benefit Estimation:estimates the benefits of utilizing the selected indexes without actually building the indexes.The following is the demostration code about how to use this package. Please refer to the original repository for more details :)# 1. Configuration Setuphost="-- your host --"port="-- your port --"db_name="-- your database --"user="-- your user --"password="-- your password --"connector=PostgresDatabaseConnector(autocommit=True,host=host,port=port,db_name=db_name,user=user,password=password)# 2. Data Preparationschema_load="/path/your database schema.json"withopen(schema_load,"r")asrf:schema_list=json.load(rf)_,columns=get_columns_from_schema(schema_list)work_load="/path/testing workload.json"withopen(work_load,"r")asrf:work_list=json.load(rf)forworkinwork_list:workload=Workload(read_row_query(work,columns,varying_frequencies=True,seed=666))# 3. Index Advisor Evaluationconfig={"budget_MB":500,"max_index_width":2,"max_indexes":5,"constraint":"storage"}index_advisor=ExtendAlgorithm(connector,config)indexes=index_advisor.calculate_best_indexes(workload,columns=columns)breakNote that the data of the/path/your database schema.jsonfile should be organized in the following format:[{"table":"region","rows":5,"columns":[{"name":"r_regionkey","type":"integer"},...]},...]Besides, the data of the/path/testing workload.jsonfile should be organized in the following format:[[#workload[#query1,#queryID"select  l_returnflag,  l_linestatus,  sum(l_quantity) as sum_qty, ...",#querytext926#queryfrequency],...],...]
Package: indexed
Introductionindexed.IndexedOrderedDict(aliasindexed.Dict) is feature compatible
withcollections.OrderedDictas of Python 3.11 and can be used as
a drop in replacement.
The main difference is that key, value and item views support accessing
elements by their index.d=indexed.IndexedOrderedDict()d["first-key"]="first-value"d["second-key"]="second-value"d["third-key"]="third-value"values=d.values()assertvalues[2]=="third-value"assertd.keys().index("second-key")==1FeaturesAccess keys, values and items by index, e.g.,d.keys()[5].Find the index of a key, e.g.,d.keys().index("key").Sort keys in place, e.g.,d.sort().Excluding those additions the API is the same as the API ofcollections.OrderedDict().Installingpip install indexedPerformancePerformance is practically on the same order of magnitude as the built incollections.OrderedDict, with exceptions in bold:dcollections.OrderedDictindexed.IndexedOrderedDictOperationAvergageWorst caseAverageWorst cased.copy()O(n)O(n)O(n)O(n)d[key]O(1)O(n)O(1)O(n)d[key] = valueO(1)O(n)[1]O(1)O(n)[1]del d[key]O(1)O(n)O(n)O(n)d.keys()[i]O(n)[2]O(n)[2]O(1)O(1)d.values()[i]O(n)[3]O(n)[3]O(1)O(n)d.items()[i]O(n)[3]O(n)[3]O(1)O(n)d.keys().index(x)O(n)[3]O(n)[3]O(n)O(n)[1](1,2)These areamortizedworst case runtimes.[2](1,2)This does not work in Python 3 becausecolections.KeysViewis not
indexable. One of the theoretically best work arounds isnext(itertools.islice(d.keys(),i, i + 1)).[3](1,2,3,4,5,6)Assuming the theoretically best possible workaround.LicenseThis library is derived from CPython’scollections.OrderedDictand licensed under the PSFL.
See the LICENSE file for the full license text.
Package: indexedlines
Copyright (c) 2016 Luís Gomesindexedlinesimplements a list-like immutable view over lines of text files.
In other words, it allows access to any line given it’s zero-based index.
Thus, if you have a big text file and you want to get line number 100001, you
don’t have to read the first 100000 sentences before getting that one.Of course there are no free lunches, and this module needs to compute a list
of sentence offsets beforehand (which is saved to disk when a indexedlines
object is created for the first time).
Package: indexed-meta
indexed_metaPython metaclass with support for per-class specialization via an index method.Adds a__param__field to classes programmatically so that you can store a
static field on them without having to define a new class and without having to
use a new name.fromindexed_metaimportIndexedMetaclass# Base type but either will work finefromindexed_metaimportIndexedClass# Convenience type. Fixes repr(), str()classVec(IndexedClass):defshow(self):# This is the value-add for this library. Use __param__ as you see fit.# It is different per specialized class but the exact same when param is# the same: Vec[1] == Vec[1]; Vec[1] != Vec[2]print(self.__param__)v1=Vec[3]()v1.show()# Prints `3`Vec[1],Vec[2],Vec[3],Vec[1,2,3],Vec[frozenset([1,2,3])]# It's possible to override the default __param__ of None by inheriting from a# specialized class:classVec(metaclass=IndexedMetaclass):...classVec4(Vec[4]):...assertVec4.__param__==4# Normally it would be `None`
Package: indexed-png-stats
Python library that inspects indexed PNG files and outputs the pixel counts
per palette entry.
Can inspect multiple directories and work recursively as well.
Output can be as summary or per file, in plain-text or JSON.
It is also possible to remap palette indices, e.g., replacing 5 with 1.
Changelog
=========0.0.6 (2023-11-15)added threshold parameters–above/–belowto check for large/small amount
of pixel annotations in images, search can be limited to specific palette
entries via the–indexparameter0.0.5 (2023-10-25)–backupoption now also gets applied in recursive mode0.0.4 (2023-10-25)addedindexed-png-remaptool for remapping color palette entries
(eg replacing 5 with 1).0.0.3 (2023-06-23)fixed recursive analysis, no longer iterates through characters of path,
verbose flag is passed on now too0.0.2 (2023-06-15)added missing MANIFEST.in–image_dirsupports multiple directories now0.0.1 (2023-06-14)Initial release
Package: indexed-pq
indexed priority queue implemented with a python listThree classes are implemented, namely,
indexed min heap, indexed max heap and indexed median heap and the corresponding class names are
min_ipqa, max_ipqa, median_ipqa respectively.an element of arbitrary index can be removed with pop_using_input_index in O(log(N))my_min_ippa=min_ipqa()my_min_ippa.insert(0,1)my_min_ippa.insert(1,3)my_min_ippa.insert(2,-3)my_min_ippa.insert(3,-5)my_min_ippa.insert(4,5)print('arbitrary at index 2 popped with value',my_min_ippa.pop_using_input_index(2))whilemy_min_ippa.len>0:print(my_min_ippa.poptop())results will bearbitrary at index 2 popped with value (2, -3)
(3, -5)
(0, 1)
(1, 3)
(4, 5)Note that the tuple is (index, value)
and the heap is popping by ordering the value instead of the indexMedian heapHere is a step by step examples showing the internals of the index median priority queue.my_median_ipqa=median_ipqa()e=[1,2,3,4,2,3,6,8,4,5]d=3fori,valinenumerate(e):my_median_ipqa.insert(i,val)print(my_median_ipqa)print(my_median_ipqa.get_median())maxheap
heaparray: [1]
heapindex: [0]
index2heap: {0: 0}
len: 1
minheap
heaparray: []
heapindex: []
index2heap: {}
len: 0
1
maxheap
heaparray: [1]
heapindex: [0]
index2heap: {0: 0}
len: 1
minheap
heaparray: [2]
heapindex: [1]
index2heap: {1: 0}
len: 1
1.5
maxheap
heaparray: [2, 1]
heapindex: [1, 0]
index2heap: {0: 1, 1: 0}
len: 2
minheap
heaparray: [3]
heapindex: [2]
index2heap: {2: 0}
len: 1
2
maxheap
heaparray: [2, 1]
heapindex: [1, 0]
index2heap: {0: 1, 1: 0}
len: 2
minheap
heaparray: [3, 4]
heapindex: [2, 3]
index2heap: {2: 0, 3: 1}
len: 2
2.5
maxheap
heaparray: [2, 1, 2]
heapindex: [1, 0, 4]
index2heap: {0: 1, 1: 0, 4: 2}
len: 3
minheap
heaparray: [3, 4]
heapindex: [2, 3]
index2heap: {2: 0, 3: 1}
len: 2
2
maxheap
heaparray: [2, 1, 2]
heapindex: [1, 0, 4]
index2heap: {0: 1, 1: 0, 4: 2}
len: 3
minheap
heaparray: [3, 4, 3]
heapindex: [2, 3, 5]
index2heap: {2: 0, 3: 1, 5: 2}
len: 3
2.5
maxheap
heaparray: [3, 2, 2, 1]
heapindex: [2, 1, 4, 0]
index2heap: {0: 3, 1: 1, 4: 2, 2: 0}
len: 4
minheap
heaparray: [3, 4, 6]
heapindex: [5, 3, 6]
index2heap: {3: 1, 5: 0, 6: 2}
len: 3
3
maxheap
heaparray: [3, 2, 2, 1]
heapindex: [2, 1, 4, 0]
index2heap: {0: 3, 1: 1, 4: 2, 2: 0}
len: 4
minheap
heaparray: [3, 4, 6, 8]
heapindex: [5, 3, 6, 7]
index2heap: {3: 1, 5: 0, 6: 2, 7: 3}
len: 4
3.0
maxheap
heaparray: [3, 3, 2, 1, 2]
heapindex: [2, 5, 4, 0, 1]
index2heap: {0: 3, 1: 4, 4: 2, 2: 0, 5: 1}
len: 5
minheap
heaparray: [4, 4, 6, 8]
heapindex: [8, 3, 6, 7]
index2heap: {3: 1, 6: 2, 7: 3, 8: 0}
len: 4
3
maxheap
heaparray: [3, 3, 2, 1, 2]
heapindex: [2, 5, 4, 0, 1]
index2heap: {0: 3, 1: 4, 4: 2, 2: 0, 5: 1}
len: 5
minheap
heaparray: [4, 4, 6, 8, 5]
heapindex: [8, 3, 6, 7, 9]
index2heap: {3: 1, 6: 2, 7: 3, 8: 0, 9: 4}
len: 5
3.5
Package: indexed-priority-queue
Python Indexed Priority QueueA Python implementation of an Indexed Priority Queue (IPQ).An IPQ is like any regular priority queue. But it supports quick lookups, updates and deletions...on the fly.Time and space complexitiesIt is implemented as minimum binary heap. For indexing, it uses two additional dicts. So, in terms of memory space, it usesO(3 * n) -> O(n)space.This data structure has the following time complexities:OperationDescriptionTime Complexitypush(key, priority)Enqueue a key with a priorityO(log(n))pop() -> key, priorityPop and retrieve the index with the highest priority (lowest value)O(log(n))peek() -> key, priorityRetrieve the key and priority with the highest priority, without popping itO(1)delete(key) -> key, priorityDelete a keyO(log(n))update(key, new_priority)Update the priority of a keyO(log(n))index(key) -> intRetrieve the index of the given keyO(1)key(index: int)Retrieve the key at the given indexO(1)priority(key)Retrieve the priority of the given keyO(1)__bool__ -> boolDetermine if the queue is empty or not. Equivalent tois_empty()O(1)__len__ -> intReturns the count of elements in the queueO(1)__contains(key)__ -> boolDetermine if the given key exists in the queueO(1)Where:keyis anytyping.Hashableobjectpriorityis anumbers.Numberindexis anintExamplesfromindexed_priority_queueimportIndexedPriorityQueue# Initialize the queuequeue=IndexedPriorityQueue()# Enqueue a few valuesqueue.push("John",7)queue.push("Maria",3)queue.push("Peter",5)key,priority=queue.peek()# Maria, 3queue.push("Kim",2)key,priority=queue.peek()# Kim, 2queue.update("Peter",1)key,priority=queue.peek()# Peter, 1assertlen(queue)==4# Truekey,priority=queue.delete("John")# John, 7assertlen(queue)==3# Truekey,priority=queue.pop()# Peter, 1key,priority=queue.peek()# Kim, 2index=queue.index("Kim")# 0key=queue.key(0)# Kimpriority=queue.priority("Kim")# 2# Not empty, 2ifqueue:print(f"Not empty,{len(queue)}")else:print("Empty")# Max is not in the queueif"Max"inqueue:print("Max is in the queue")else:print("Max is not in the queue")pushraisesKeyErrorif the key is already in the queue.popandpeekraiseIndexErrorif the queue is empty.delete,update,indexandpriorityraiseKeyErrorif the key is not in the queue.keyraisesKeyErrorif the given index does not exist.Use any hashable object as keyYou can use anytyping.Hashableobject as key, not just strings. For example:queue.push(frozenset(["a","b"]),1)queue.push((1,2,3),2)
Package: indexed-zstd
indexed_zstdThis module provides an IndexedZstdFile class, which can be used to seek inside zstd files without having to decompress them first.It's shamelessy based onindexed_bzip2, which was refactored to supportzstdinstead of bzip2 usinglibzstd-seek.Kudos to the author for its work.Seeking inside a block is only emulated, so IndexedZstdFile will only speed up seeking when there are more than one block.To create multi-block archives you may uset2sz.UsageExample 1fromindexed_zstdimportIndexedZstdFilefile=IndexedZstdFile("example.zst")# You can now use it like a normal filefile.seek(123)data=file.read(100)
Package: indexgen
Hyperlinked Index Markdown / Github Repo Table of Contents GeneratorDescriptionThe Hyperlinked Index MD Generator is a command-line tool designed to create a structured and navigable markdown document that serves as a comprehensive index for your github project directories. This tool generates a clickable markdown index, organizing files and folders in a user-friendly format, which is especially beneficial for large and complex projects.Motivation for this project: I maintain a repository where I push all my data structure and algorithm problems, as well as my LeetCode practice exercises. I wanted to use a navigable index as my README because I wished to see all the problems I've solved on the main GitHub project page. A hyperlinked table of contents seemed like a good idea, but I couldn't find any robust solution for it. Hence, I created this project.If you want to use the UI directly,check this outFeaturesGenerates a markdown file with a linked index of directories and files.Allows exclusion of specified files and directories using patterns.Option to specify the output file name.Simple and easy-to-use command-line interface.InstallationTo install the Hyperlinked Index MD Generator and use it, follow these steps:Install the packagepip install indexgenUsageTo use the Hyperlinked Index MD Generator, run the following command in your terminal:indexgen generate [OPTIONS]Options:-o,--outputTEXT: Output markdown file name. If not specified, the output will be printed to the console.-i,--ignoreTEXT: Patterns of files or directories to ignore. This option can be repeated to specify multiple patterns.Example:Generate an index for the current directory and output toindex.md, ignoring all.logfiles:indexgen generate --output index.md --ignore "*.log"If you want to run this command for a repository located elsewhereindexgen generate "<location/to/any/git/repo>"And then, simply copy the markdown file contents to you project and push it.ContributingContributions to the Hyperlinked Index MD Generator are welcome!LicenseThis project is licensed under theGNU GENERAL PUBLIC LICENSE.AcknowledgmentsSpecial thanks toBootstrapandClickfor making the UI and CLI functionality straightforward and robust.
Package: index-generator
index-generatorYet another python index generatorInstallPypipipinstallindex-generatorGitHub releaseYou can just download wheel(.whl) file, and install usingpip install.DistributionsArch Linux# Coming soonOther DistributionGitHub master branchgitclonehttps://github.com/BruceZhang1993/index-generator.gitcdindex-generator
sudopythonsetup.pyinstall# ORsudopipinstall.UsageSeeWiki PageLicenseMITContributorsSorting by alphabet order.Bruce Zhang (BruceZhang1993)Edward P (edward-p)OriginCode (OriginCode)More...