Saravanan666/pypi-org huggingface dataset:
Package: defity
Speedy Python library to determine MIME type of file.Defity (Detectfiletype) is a library for Python application to guess file type in a reliable way, not based on filename extension (*.png,*.pdf), but on actual file content. It is like whatfilecommand andlibmagiclibrary do, but with different strategy.📕 Documentation:defity.readthedocs.ioInstall$pipinstalldefityUsage>>>importdefity>>>defity.from_file('path/to/landscape.png')'image/png'>>>withopen('path/to/landscape.png','rb')asf:...defity.from_file(f)...'image/png'>>>defity.from_bytes(b'some-binary-content')'image/png'How different with libmagic-based ones?There are many Python libraries also do the same thing, most of them are based on wellknownlibmagic. Defity is based on Rusttree_magic_minilibrary, which in turn is a fork oftree_magic, another Rust library. Quote fromtree_magicto see how it differs fromlibmagic:Unlike the typical approach that libmagic and file(1) uses, this loads all the file types in a tree based on subclasses. (EX: application/vnd.openxmlformats-officedocument.wordprocessingml.document (MS Office 2007) subclasses application/zip which subclasses application/octet-stream) Then, instead of checking the file against every file type, it can traverse down the tree and only check the file types that make sense to check. (After all, the fastest check is the check that never gets run.)This library also provides the ability to check if a file is a certain type without going through the process of checking it against every file type.And whattree_magic_minihas improved overtree_magic:Reduced copying and memory allocation, for a slight increase in speed and decrease in memory use.So,Defityshould have better performance than other libraries for the same purpose.Another advantage is that,Defityis static linked to the underlying Rust library, not depend on discretelibmagic.so. It will be easier to deploy to cloud function platforms, where you don’t have control over what system libraries is present there.LicenseIn general, Defity is licensed under Apache-2.0 if it is built withouttree_magic_miniembedded MIME database, and is licensed under GPL-3.0 otherwise. Concretely:On Linux, it is licensed under Apache-2.0.On Windows and MacOS, it is licensed under GPL-3.0.It is because, Linux boxes already come with FreeDesktop’sMIME database, Defity just uses it.
Windows and MacOS don’t have this database and Defity has to embed with it.CreditAuthor:Nguyễn Hồng Quân.Free icon is made byVitaly Gorbachevfromflaticon.com.
Package: defKey
defKeyNon-blocking keybinds using threads.SetupDownload withpip3 install defKeyImport withimport defKeyUsagedefKey allows the binding of keys to Python functions. When activated, defKey spawns a new thread which catches all keypresses (thus breakinginput()) and, if they have been bound, spawns a new thread which executes the bound function. This is best for games and TUI programs.Examplefrom defKey import defKey

def hello():
    print("hello")

def goodbye():
    print("goodbye")

def actualGoodbye():
    defKey.stop()

defKey.bind("h", hello)
defKey.bind("g", goodbye)
defKey.bind("q", actualGoodbye)

defKey.start()You must calldefKey.stop()before usinginput(). Binds will be retained and defKey can be restarted after.All contributions are welcome by pull request or issue.defKey is licensed under GNU General Public License v3.0. SeeLICENSEfor full text.
Package: deflacue
http://github.com/idlesign/deflacueWhat’s thatdeflacue is a SoX based audio splitter appropriate to split audio CD images incorporated with .cue files.It is able to function both as a Python module and in command line mode.FeaturesLarge variety of supported lossless input audio formats FLAC, WAV, etc. (due to SoX).Batch audio files processing (including recursive path traversing).Automatic audio collection hierarchy building (Artist/Year-Album/Tracknum-Title).Automatic track metadata copying from .cue.RequirementsPython 3.6+SoX command line utility -http://sox.sourceforge.net.Ubuntu users may install the following SoX packages:sox,libsox-fmt-all.UsageFrom Pythonfrom deflacue import deflacue- if you want to use it as module.UseDeflacueclass for SoX interaction.UseCueParserclass for .cue parsing.From Command Linedeflacue--helpin command line - to get help on utility usage.In the following example we create audio collection in/home/idle/audio_collection/from audio CD images
stored under/home/idle/audio_raw/processing Cue Sheet files created usingwindows-1251encoding:$ deflacue -e windows-1251 /home/idle/audio_raw/ -d /home/idle/audio_collection/
Package: deflatable-dict
deflatable-dictA dictionary that can be flattened and re-inflated. Particularly useful if you're interacting with yaml, for example.Installationwith pip:pip install deflatable-dictdeflatable-dictdoes not have any dependencies beyond standard python libraries.InstantiationfromdeflatabledictimportDeflatableDictdd=DeflatableDict({"a":{"1":True,"2":False,},"b":20,})dd["a.1"]# Truedd["a.2"]# Falsedd["b"]# 20dd["a"]# { "1": True, "2": False }DeflationA DeflatableDict can be deflated with.deflate(). This returns a standard dictionary object with flattened keys constructed by concatenating the nested keys with the DeflatableDict's delimiter. A DeflatableDict uses it's deflated form for its string representation.DelimiterA DeflatableDict can have it's delimiter specified by passing the desired delimiter as thesepparameter to the DeflatableDict constructor. By default the delimiter if..InflationA DeflatableDict will automatically inflate any values that are inserted into it. For example:fromdeflatabledictimportDeflatableDictdd=DeflatableDict()dd["a.1"]=Truedd["a.2"]=Falsedd["a"]# { "1": True, "2": False }DevelopmentThis project uses.devcontainerto describe the environment to use for development. You may use the environment described in this directory (it integrates automatically with vscode's 'remote containers' extension), or you may create your own environment with the same dependencies.DependenciesInstall development dependencies with:pip install .[tests]TestsRun tests with:pytest
Package: deflate
deflate APIThis is a very thin Python wrapper Eric Biggers' excellentlibdeflate.Currently, it only handles:compression and decompression of gzip data, with a very basic APIimportdeflatelevel=6# The default; may be 1-12 for libdeflate.compressed=deflate.gzip_compress(b"hello world!"*1000,level)original=deflate.gzip_decompress(compressed)compression and decompression of raw DEFLATE dataThe size of the decompressed file needs to be kept through additional logic. Ditto for checksums.importdeflatelevel=6# The default; may be 1-12 for libdeflate.data=b"hello world!"*1000compressed=deflate.deflate_compress(data,level)original=deflate.deflate_decompress(compressed,len(data))crc32 computationimportdeflatecrc32=deflate.crc32(b"hello world! ")# initialcrc32=deflate.crc32(b"hello universe!",crc32)# continuedadler32 computationimportdeflateadler32=deflate.adler32(b"hello world! ")# initialadler32=deflate.adler32(b"hello universe!",adler32)# continuedInstallationInstallingdeflatewill either link to or compilelibdeflate, depending on the
following:If aLIBDEFLATE_PREFIXenvironment variable is set, it will always be used to look
for a system-installedlibdeflate.If thepkgconfigpackage is installed, it will be used to automatically find (and
link to) a system-installedlibdeflateif available.Falls back to compiling the bundled libdeflate code. This behavior can be triggered
manually by settingUSE_BUNDLED_DEFLATE=1.export USE_BUNDLED_DEFLATE=no  # default is no
export LIBDEFLATE_PREFIX=/path/to/lib/deflate  # default: no path given
pip install pkgconfig  # optional, you also need pkg-config cli tool
pip install deflateTestingpip install pytest
pip install pytest-benchmark
pytest
Package: deflateBR
deflateBRdeflateBRis aPythonpackage used to deflate nominal Brazilian Reais
using several popular price indexes. It is a reimplementation of the greatdeflateBR R packagebyFernando Meireles.InstallationpipinstalldeflateBRExamplesThedeflateBR’s main function,deflate, requires three arguments to
work: anintoffloatvector of nominal Reais (nominal_values); astrordatetimevector of corresponding dates (nominal_dates); and a reference month in theYYYY-MMformat (real_date), used to deflate the values. An
example:To deflate BRL R$100,00 (one hundred brazilian reais) in January 2015,
simply doimportdeflatebrasdbrdbr.deflate(nominal_values=100,nominal_dates='2015-01-01',real_date='2020-01')array([131.32029183])To deflate a bigger series, doimportpandasaspddf=pd.DataFrame({'nom_values':[100,200,300,400],'dates':['2015-01-01','2015-02-01','2015-10-01','2015-12-01']})dfnom_values       dates
0         100  2015-01-01
1         200  2015-02-01
2         300  2015-10-01
3         400  2015-12-01dbr.deflate(nominal_values=df.nom_values,nominal_dates=df.dates,real_date='2020-01')array([131.32029183, 259.42387232, 365.99132289, 479.18030761])To display aprogress bar, setprogress_bar=True. If you are running on a jupyter notebook or a jupyter lab, set alsoon_jupyter=Trueto have a nice HTML progress bar:dbr.deflate(nominal_values=df.nom_values,nominal_dates=df.dates,real_date='2020-01',progress_bar=True,on_jupyter=False)100%|██████████████████████████████| 6/6 [00:00<00:00, 3006.67it/s] 
array([1084.40219182, 1192.842411  , 1247.06252059, 1053.40923236,
   1264.09107883, 1316.76154045])Behind the scenes,deflateBRrequests data fromIPEADATA’s API on one these five
Brazilian price indexes:IPCAandINPC,
maintained byIBGE; andIGP-M,IGP-DI,
andIPCmaintained byFGV/IBRE.
To select one of the available price indexes, just provide one of the
following options to theindex =argument:ipca,igpm,igpdi,ipc, andinpc. In the following, the INPC index is used.dbr.deflate(nominal_values=100,nominal_dates='2015-01-01',real_date='2020-01',index='inpc')array([131.06584509])MethodologyFollowing standard practice, seconded by theBrazilian Central
Bank,
thedeflateBRadjusts for inflation by multiplying nominal Reais by
the ratio between the original and the reference price indexes. For
example, to adjust 100 reais of January 2018, with IPCA index of
4916.46, to August 2018, with IPCA of 5056.56 in the previous month, we
first calculate the ratio between the two indexes (e.g., 5056.56 /
4916.46 = 1.028496) and then multiply this value by 100 (e.g., 102.84
adjusted Reais). Thedeflatefunction gives exactly the same result:dbr.deflate(100,"2018-01-01","2018-08","ipca")array([102.84961131])AuthorsNeylson Crepalde&Fernando Meireles
Package: deflate-dict
Python package to deflate and re-inflate dictionaries.How do I install this package?As usual, just download it using pip:pipinstalldeflate_dictDeflating a dictionaryA dictionary will be deflated down to its smallest non-further iterable elements, defined as those not containing lists or dictionaries.fromdeflate_dictimportdeflateD={"a":[{"b":(0,1,2)},{"c":[1,2,3]}]}result=deflate(D,sep="_")# {'a_0_b': (0, 1, 2), 'a_1_c': [1, 2, 3], 'd': 4}Inflate a dictionaryTo reinflate a dictionary to its forgotten glory, just go with:fromdeflate_dictimportinflateD={"a_0_b":(0,1,2),"a_1_c":[1,2,3],"d":4}result=inflate(D,sep="_")# {'a': [{'b': (0, 1, 2)}, {'c': [1, 2, 3]}], 'd': 4}Handling and restoring mixed typesTo deflate and re-inflate mixed types and restore them to the original type
you can use thetype_encode_keykeyword:fromdeflate_dictimportdeflateD={"a":[{"b":(0,1,2)},{"c":[1,2,3]}]}print(deflate(D,sep="_",type_encode_key=True))# {#    'str(a)_listIndex(0)_str(b)': (0, 1, 2),#    'str(a)_listIndex(1)_str(c)': [1, 2, 3]# }
Package: deflatepybr
Python brazilian currency deflatorA simple python package to deflate historical yearly or monthly values using IPCA (Consumers Broad Price Index).Throught IPEA Data's API the function gather historical IPCA yearly (PRECOS_IPCAG series) and monthly (PRECOS12_IPCAG12 series) indexes to deflate currency values.Installation:pandasandrequestspackages are required in your environment (python -m pip install pandas requests).Install the package (pip install deflatepybr)Usage:The function takes 5 arguments:data_frame: APandas.DataFramewith the data;value_column(str): A column containing the values to deflate;date_column(str): Column name fromdata_framewith the date range;deflate_year(int): Year that you wanna deflate the series to;deflate_month(int), optional: Month to deflate if you need monthly index values.If onlydeflate_yearis passed, the functions assumes that Yearly values are desired.Examples can be found in theexample.ipynbjupyter notebook file available on the project's Github page.
Package: deflemask-preset-viewer
DefleMask Preset ViewerReads Deflemask preset files (DMP) and displays the stored parameters. Also supports dumping of bank and instrument data ofWOPN filesas used bylibOPNMIDISupported FormatsDefleMask preset versions 8 and 11WOPN versions 1 and 2Installation$ pip3 install deflemask-preset-viewerUsageOutput Parameters to ConsoleDMP files$deflemask-preset-viewerdeflemask_preset_viewer/tests/data/sample.dmp
Version8FMUnknown
Algorithm3LFOFMS0Feedback0LFOAMS0------------------------------------------------------------
ParameterOp1Op2Op3Op4------------------------------------------------------------
MUL14100TL39242419AR31313131D1R151499D1L14141414RR15151515AM0000RS2000DT13333D2R0000SSG0000WOPN files$deflemask-preset-viewerdeflemask_preset_viewer/tests/data/sample.wopn
WOPN
M_Banks2P_Banks5LFOOn
LFOFreq1============================================================M.Bank0Standard:3========================================================================================================================Instrument0*GrandPiano============================================================Algorithm2LFOFMS0Feedback0LFOAMS0------------------------------------------------------------
ParameterOp1Op2Op3Op4------------------------------------------------------------
MUL1421TL393642AR26243127D1R79234D1L76910RR1716AM0000RS1132DT10673D2R49154SSG0000============================================================Instrument1*BrightPiano============================================================Algorithm5LFOFMS0Feedback7LFOAMS0------------------------------------------------------------
...Output as C CodeIt can also generate C code for inclusion in theMega Drive MIDI Interfaceproject. Specify-cto output parameters in this way:DMP files$deflemask-preset-viewerdeflemask_preset_viewer/tests/data/sample.dmp-c
staticconstChannelSAMPLE={3,0,3,0,0,0,0,{14,3,31,2,15,0,14,0,15,39,0},{1,3,31,0,14,0,14,0,15,24,0},{0,3,31,0,9,0,14,0,15,24,0},{0,3,31,0,9,0,14,0,15,19,0}};WOPN files$deflemask-preset-viewerdeflemask_preset_viewer/tests/data/sample.wopn-c
staticconstChannelM_BANK_0_INST_0_GRANDPIANO={2,0,3,0,0,0,0,{{1,0,26,1,7,0,7,4,1,39,0},{4,6,24,1,9,0,6,9,7,36,0},{2,7,31,3,23,0,9,15,1,4,0},{1,3,27,2,4,0,10,4,6,2,0}}};staticconstChannelM_BANK_0_INST_1_BRIGHTPIANO={5,7,3,0,0,0,0,{{4,2,27,1,9,0,11,5,6,33,0},{4,5,27,1,9,0,7,9,7,18,0},{1,2,27,1,5,1,10,5,6,8,0},{6,5,27,1,9,0,3,8,7,9,0}}};...
staticconstChannelM_BANK_0_INST_127_GUNSHOT={5,7,3,0,1,0,0,{{3,3,31,0,3,0,15,17,5,4,0},{1,0,31,0,20,0,15,20,8,0,0},{1,0,31,0,15,0,15,31,8,0,0},{1,0,31,0,15,0,15,16,11,0,0}}};staticconstChannelM_BANK_0[]={M_BANK_0_INST_0_GRANDPIANO,M_BANK_0_INST_1_BRIGHTPIANO,
...M_BANK_0_INST_127_GUNSHOT};Build & Test$maketestCreditsThis project includes FM samples in its automated tests byWohlstand.
Package: deflicker
After I made my first few timelapse videos I got really bothered by the
erratic small changes of exposure, which are caused by various effects:
* Changes of the exposure settings (if not in full manual mode) *
Uncertainties of the aperture * Shutter jitterI was looking for an existing solution and only found expensive
(O(100€)) software.So I wrote this little (150 SLOCS) programm. The brightness of the
images are adjusted to fit a rolling mean over several consecutive
images.InstallationI recommend anaconda, it comes with the heavy dependencies of this
package:numpyandscikit-imageInstallation ofdeflicker:$ pip install deflickerUsagedeflickerexpects all your pictures in one directory. The
alphabetical order has to be equivalent to the chronological order.deflicker <inputfolder> [options]Options-o<dir>,--outdir=<dir>Output directory [default: deflickered]-w<N>,--window=<N>Window size for rolling mean [default: 10]-q,--quietOnly output errors and warnings-f<fmt>,--format=<fmt>Output format for the scaled images
[default: png]-s
,--sigma=
Sigma for the sigma clipping
Package: def-main
Define the main function in one step.For any non-trivial projects, use typer and dtyper instead!Usage exampleWithout an return codeimportdef_main@def_maindefmain(*argv):print('hello,',*argv)means precisely the same as:defmain(*argv):print('hello,',*argv)if__name__=='__main__':importsysmain(sys.argv[1:])With a return codeimportdef_main@def_maindefmain(*argv):print('hello,',*argv)returnargvmeans precisely the same as:defmain(*argv):print('hello,',*argv)returnargvif__name__=='__main__':importsysreturncode=main(sys.argv[1:])sys.exit(returncode)
Package: defogging
Implement a robust and efficient defogging method with PythonFeaturesDefogging a single foggy imageinstallUsepipto install:$ pip install defoggingOr you can install from source:$ git clone git@github.com:scloudyy/Defogging.git
$ cd Defogging
$ python setup.py build
$ pip install .UsageUsedefoggingthrough command line:$ defogging your_img.bmpthe result will be saved asyour_img_defogging.bmpAnd you can also usedefoggingin your own code:fromdefoggingimportDefogin_name="foggy.bmp"out_name="defogged.bmp"df=Defog()df.read_img(in_name)df.defog()df.save_img(out_name)you can directly input a foggy object in the form ofnumpy.array:df.read_array(your_array,range)whererangeindicates the value range of your array.The range has two options:
the first is1, which means the value range of your array is [0,1],
and the second is255, which means the value range is [0,255]If you want to process the defogged object further, you can also get defogged array:dst=df.get_array(range)also,rangeindicates the value range of returned array, either1or255.
If you choose1, the range will lie in [0,1], and the type of it isfloat.
Or if you choose255, the range will be [0,255], and the type will beuint8.
Package: defopt
defopt is a lightweight, no-effort argument parser.defopt will:Allow functions to be run from code and the command line without modification.Reward you for documenting your functions.Save you from writing, testing and maintaining argument parsing code.defopt will not:Modify your functions in any way.Allow you to build highly complex or customized command line tools.If you want total control over how your command line looks or behaves, trydocopt,clickorargh. If you just want to write Python code and leave the
command line interface up to someone else, defopt is for you.UsageOnce you have written anddocumentedyour function, simply pass it todefopt.run()and you’re done.importdefopt# Use type hints:defmain(greeting:str,*,count:int=1):"""
    Display a friendly greeting.

    :param greeting: Greeting to display
    :param count: Number of times to display the greeting
    """for_inrange(count):print(greeting)# ... or document parameter types in the docstring:defmain(greeting,*,count=1):"""
    Display a friendly greeting.

    :param str greeting: Greeting to display
    :param int count: Number of times to display the greeting
    """for_inrange(count):print(greeting)if__name__=='__main__':defopt.run(main)Descriptions of the parameters and the function itself are used to build an
informative help message.$ python test.py -h
usage: test.py [-h] [-c COUNT] greeting

Display a friendly greeting.

positional arguments:
  greeting              Greeting to display

optional arguments:
  -h, --help            show this help message and exit
  -c COUNT, --count COUNT
                        Number of times to display the greeting
                        (default: 1)Your function can now be called identically from Python and the command line.>>> from test import main
>>> main('hello!', count=2)
hello!
hello!$ python test.py hello! --count 2
hello!
hello!Philosopydefopt was developed with the following guiding principles in mind:The interface can be fully understood in seconds.If it took any longer,
your time would be better spent learning a more flexible tool.Anything you learn applies to the existing ecosystem.The exact same
docstrings used by defopt are also used by Sphinx’sautodocextension to
generate documentation, and by your IDE to do type checking. Chances are you
already know everything you need to know to use defopt.Everything is handled for you.If you’re using defopt, it’s because you
don’t want to write any argument parsing codeat all. You can trust it to
build a logically consistent command line interface to your functions
with no configuration required.Your Python functions are never modified.Type conversions are only ever
applied to data originating from the command line. When used in code,
duck-typing still works exactly as you expect with no surprises.DevelopmentFor source code, examples, questions, feature requests and bug reports, visit
theGitHub repository.DocumentationDocumentation is hosted onRead the Docs.
Package: deformation-inversion-layer
Deformation inversion layerDeformation inversion layeris a neural network layer for inverting deformation fields develped as part of SITReg, a deep learning intra-modality image registration arhitecture fulfilling strict symmetry properties.InstallationInstall using pip by running the commandpip install deformation-inversion-layerRequirementsPython 3.8+PyTorch 1.10+Source codeCode repository can be found at GitHubhttps://github.com/honkamj/deformation-inversion-layerDocumentationFor documentation, see the GitHub repository.PublicationIf you use deformation inversion layer, please cite the SITReg paper. Details for citing can be found at the GitHub repository.AcknowledgmentsTutorialby Zico Kolter, David Duvenaud, and Matt Johnson was very helpful in implementing the layer.LicenseDeformation inversion layer is released under the MIT license.
Package: deform-ext-autocomplete
Extended Autocomplete provides a few features that are not available
in the default autocomplete widget shipped withDeform. Essentially,
Extended Autocomplete allows the developer to show a value to the user
that is different from the one that is returned by the widget (and
eventually stored).For further details, see the documentation athttps://deform-ext-autocomplete.readthedocs.io/en/latest/.
Package: deform-extensions
Note : since version 0.4 deform_extensions is now compatible with python 3This package provides custom widgets and form layout widgets.It aims to extend deform 2 and replaces the former deform_bootstrap_extensions
(that was dedicated to deform_bootstrap and deform 0.* serie)Installpip install deform_extensionsCustom widgetsLocalizationWidget : Map locationCustomDateTimeInputWidget : Datetime widgetRadioToggleWidgetDate related widgets were added to allow a better support for
internationalization and different format support.The RadioToggleWidget is a common radio widget that allow to hide show form
nodes on selection. It’s very similar to deform base Radio widget, the
difference is that values parameters is a list of 3-uples (instead of 2-uples),
allowing to specify the name of a form node to hide/show.Layout ToolsLayout tools:DisabledInput (that really doesn’t allow edition)InlineMappingWidgetVoidWidget that is used by GridWidgets to fill void cellsTableMappingWidgetGridMappingWidgetAccordionMappingWidgetTableFormWidgetGridFormWidgetAccordionFormWidgetSee __init__.py source code for some docs or ping me on Freenode @tonthonRun testspip3 install pytest
py.test -xv