Saravanan666/pypi-org huggingface dataset:
Package: magic-module-skaffolder
magic-module-skaffoldergenerates or updates a Magic Module Resource definitions with the metadata
of the Google Cloud APIs.When generating the definitions, it will first use thegainterface, and
supplement the definition with thebetainterface, so that it can
determine which fields are only available on thebetainterface.The resulting definitions are not perfect and may need some polishing. Most
properties required by the magic module are derived from the free text
description field. So, please do check the result.Existing field definitions are not overwritten, so once inspected and
correct you can rerun the merge operation as often as you want. Note that
fields of a resource which do not exist in the API are removed.example - updateTo update an existing resource definition, type:$ mm-skaffolder update --inplace --resource-file tests/mmv1/products/compute/BackendService.yaml

INFO: adding port as ga field to definition of BackendService
INFO: adding kind as ga field to definition of BackendService
INFO: adding network as ga field to definition of BackendService
INFO: adding maxStreamDuration as ga field to definition of BackendService
INFO: adding region as ga field to definition of BackendService
INFO: adding connectionTrackingPolicy as ga field to definition of BackendService
INFO: adding failoverPolicy as ga field to definition of BackendService
INFO: adding subsetting as ga field to definition of BackendService
INFO: adding selfLink as ga field to definition of BackendService
INFO: adding serviceBindings as ga field to definition of BackendService
INFO: adding failover as ga field to definition of BackendService.backends.
INFO: keeping beta field connectTimeout from definition of BackendService.circuitBreakers in ga 
INFO: adding requestCoalescing as ga field to definition of BackendService.cdnPolicy
INFO: adding signedUrlKeyNames as ga field to definition of BackendService.cdnPolicy
INFO: adding bypassCacheOnRequestHeaders as ga field to definition of BackendService.cdnPolicy
WARNING: mismatch in field name BackendService.localityLbPolicies: expected "localityLbPolicyConfig" defined ""
INFO: adding optionalFields as ga field to definition of BackendService.logConfig
INFO: adding optionalMode as ga field to definition of BackendService.logConfig
WARNING: mismatch in field name BackendService.localityLbPolicies: expected "localityLbPolicyConfig" defined ""
INFO: adding authentication as beta field to definition of BackendService.securitySettings
INFO: adding awsV4Authentication as beta field to definition of BackendService.securitySettings
INFO: adding subsetSize as beta field to definition of BackendService.subsettingexample - generateTo generate a new resource definition, type:$mm-skaffoldergenerate\--product-directorytests/mmv1/products/networksecurity\serverTlsPoliciesaddressGroups
INFO:WritingtodefinitionofServerTlsPolicytotests/mmv1/products/networksecurity/ServerTlsPolicy.yaml
Package: magicov
# MagicovDoes anybody bother you about increasing the testing coverage of your Python
project? Are you tired of writing useless tests just to increase that metric?
Then magicov is for you!This tool will automatically modify your code so you’ll get 100% testing
coverage instantly. How? Just remove all uncovered lines of your project!This approach will make you have less code to maintain, since most of it (at
least if you have low coverage) will be removed.# UsageInstall the tool with pip:` pip install magicov `Then run the Pythoncoveragetool to fetch the coverage of your project:` coverage run'--include=your_project/*'command_to_run_tests.py `Make a backup of your code, and run magicov passing it the file with the
coverage data:` magicov .coverage `You will see a lot of Python files are modified, but your test suite should
pass anyway. And if everything is ok, you will have 100% coverage! You’re ready
to push your code to your master branch and make your boss (or testing-obsesive
coworker) satisfied because of a useless metric!# DisclaimerThis is a joke project. It has no practical purpose at all. If you run
this tool, all untested features of your product will be unusable.This was just my constructive way of saying that testing coverage is not a
useful metric in software projects. At least, not as important as other, more
related to the product ones.# CreditsThanks to the [pasta][pasta] maintainers for writing the tool that allowed me
to write magicov, and for the super fast fixing of the strange bugs I reported
to it.Also, thanks to all the [Faraday Team][faraday] for letting me write the tool and
use it in our product.[pasta]:https://github.com/google/pasta/[faraday]:https://github.com/infobyte/faraday/
Package: magicpandas
##### UNDER CONSTRUCTION #####magicpandasmagicpandasmakes working with pandas dead simple.Main FeaturesMagicDataFrame subclasses DataFrame to make existing methods more intuitive as well as add new methodsMagicDataFrame adds verbose labels that are used by default when displaying dataMagicDataFrame supports Django ORMinspectdf uses DataFrame column types to produce a Django model class (cf.inspectdb)to_django saves the DataFrame to SQL using Django ORM'sbulk_updateandbulk_create.Installationpip install magicpandasExamplesfrommagicpandasimportMagicDataFramemdf=MagicDataFrame(df)mdf2=mdf.drop('*e',axis=1)# df2 drops all columns ending in "e"mdf.browse()# opens the DataFrame in MS Excel with nice formattingmdf.browse(client='webbrowser')# opens the DataFrame as html displayed in Chrome with nice formattingmdf.graph()# Opens a graph in Chrome using the excellent Altair library using sensible encodingsmdf.inspect_for_django()# prints text that corresponds to a Django model definitionPhilosophyConvention over configurationEmploys Altair rather than than matplotlib because it's web first and based on
theGrammar of GraphicsEmploys MS Excel for data browsingThere should be little gap between intention and implementation
Package: magic-patch
The magic_patch is a simple library that provides the ability to patch an object in different scopes at once.
Now you can patch objects easily like magic.Example 1 *
A project contains a few modules that imports datetime library# module 1fromdatetimeimportdatetime...# module 2fromdatetimeimportdatetime...Using magic_patch you don't need to patch each module manually# testfromunittest.mockimportMockfrommagic_patchimportmagic_patchfromdatetimeimportdatetime# import target objectfrom...importstart_module# necessary to run importsdatetime_mock=Mock()withmagic_patch(start_module,datetime,datetime_mock):# all done! - all modules patched!!!...Example 2 *
A project contains a few modules that import the datetime class from datatime library
There are different names for the target object.
The magic_patch provides the ability to examine all available variables in each module# module 1fromdatetimeimportdatetime...# module 2fromdatetimeimportdatetimeasnew_name_datetime...Just set up the option search_by_all_names=True and magic_patch finds your target with other names# testfromunittest.mockimportMockfrommagic_patchimportmagic_patchfromdatetimeimportdatetime# import target objectfrom...importstart_module# necessary to run importsdatetime_mock=Mock()withmagic_patch(start_module,datetime,datetime_mock,search_by_all_names=True):# all done! - all modules patched!!!...Happy magic patching!
Package: magic-py-ball
Magic Py BallMagic Py Ballis a simple Python implementation of a random magic 8 ball.>>>answer()'Without a doubt.'InstallationMagic Py Ball is available on PyPI:$python-mpipinstallmagic_py_ballMagic Py Ball officially supports Python 2.7 and 3.5+.API Referencemagic_py_ball.ANSWERSAlistofstrobjects representing all possible magic 8 ball answersmagic_py_ball.answer()Gets a random magic 8 ball answer usingrandom.choice().
Package: magicpyden
MagicPydenAsynchronous API wrapper for the MagicEden APIInstallationPyPipipinstallmagicpydenPoetrypoetryaddmagicpydenFrom sourcegitclonehttps://github.com/ChristianPerez34/magicpyden.gitcdmagicpydenpythonsetup.pyinstallUsage/ExamplesOfficial DocumentationfrommagicpydenimportMagicEdenApi# Assuming inside async function/methodasyncwithMagicEdenApi()asapi:collection_stats=awaitapi.get_collection_stats(collection_name="degods")
Package: magicregex
🦄 Magic RegExReadable Regular Expressions for PythonRuntime is ultra-minimalCompiles to pure RegExAutomatically typed capture groupsNatural language syntaxThis library is a port of themagic-regexpJavaScript module byDaniel Roe.QuickstartFirst, installmagicregexbypipinstallmagicregexSecond, find e-mails in text byimportmagicregexasmrereg=mre.createRegEx(mre.exactly(mre.letter.TimesAtLeast(1).And(mre.exactly('@')).And(mre.letter.TimesAtLeast(1)).And(mre.exactly('.')).And(mre.letter.TimesAtLeast(2))))reg.findall('daniel@roe.uk lore ipsum thomas@wollmann.de')# Result: ['daniel@roe.uk', 'thomas@wollmann.de']DocumentationUp to now, this module is compatible withmagic-regexp's documentation.ContributeMade with ❤️. If you want to support:Clone this repositoryInstall dependencies usingpoetry install --with devRun tests usingpytestRun code checks usingpre-commit run
Package: magicresult
Magic ResultsUsage:# -*- coding: macro -*-

from magicresult import Result, ok, error, attempt

def get_str_ok() -> Result[str]:
    return ok("hello world")

def get_str_err() -> Result[str]:
    return error("something went wrong")

def magic_example() -> Result[None]:
    a = attempt(get_str_ok())
    print("First string is: " + a)
    b = attempt(get_str_err())
    print("Second string is: " + b)
    return ok(None)

print(f"magic_example returned {magic_example()}")
Package: magicrf
MagicRF is a library for M100 and QM100 modules.InstallationCompile and install the library:pip3 install magicrfAfter installation you can run unit tests to make sure that the library works fine.  Execute:python -m magicrf.case1UsageIn Python 3::from magicrf import m100reader = m100(‘COM14’)def receive_callback(data):for item in data[:-1].split(‘;’):epc, rssi = item.split(‘,’)
print(‘{0} RSSI: -{1} dBm’.format(epc, int(rssi, 16)))reader.rxcallback( receive_callback )
reader.start()# reader.power(22)
# reader.param(q=4)
reader.query(100)Examplefrom magicrf import m100# Get PA Power
m100.power()
# Set PA Power
m100.power(22.0)V1.0.1 (2018-11-26)Release ver1.0.1V1.0 (2018-08-15)InitializationV1.1 (2018-10-24)New querypower etc. functions.
Package: magic-rs
magic-rsPython wrapper for RustinfercrateInstallationpipinstallmagic-rsQuickstartfrommagic_rsimportfrom_path,from_byteswithopen("testdata/sample.png",'rb')asf:data=f.read()py_magic=from_bytes(data)print(py_magic.extension())print(py_magic.mime_type())print(py_magic.is_image())print(py_magic.is_app())print(py_magic.is_archive())print(py_magic.is_audio())print(py_magic.is_book())print(py_magic.is_document())print(py_magic.is_font())print(py_magic.is_video())print(py_magic.is_text())py_magic=from_path("testdata/sample.png")print(py_magic.extension())print(py_magic.mime_type())print(py_magic.is_image())BenchmarksFor details, seebenchmark.
Package: magic-run-cmd
Magic Run CommandThis provide a clean way to express scripts inside your python code.
The run engine will be shell by default.
This will allow you to run shell scripts from your python code.frommagic_cmd.scriptimportScriptcmd=Script('''lstouch test.pylsrm test.py''')restults:list[str]=cmd()Installation:pipYou can install it via pip:pip install magic-run-cmdpoetryTo install this code, you will need to first install Poetry (https://python-poetry.org/docs/#installation). Poetry is a dependency manager for Python that will allow you to easily install this code and its dependencies.Once you have Poetry installed, you can install this code by running the following command from the root directory of this code:poetry add magic-run-cmdThis will install this code and all of its dependencies.Usage:To run a simple shell command you can use run_cmd.
This is what the shell engine uses under the hood:frommagic_cmd.run_cmdimportrun_cmdprint(run_cmd('ls'))output:LICENSEREADME.mdlog/poetry.lockpyproject.tomlrun_cmd/Then, you can call the run_cmd function with a shell command as a string:If an error thrown it caught, and logged before, erroring out.You can also specify whether you want the output to be returned as a list or a string:run_cmd('ls', split=True)This will output the result as a list, with each element being one line of output.ScriptScripts allow you express you script inside your python code inside triple quote.
The extra white spaces are removed so format as needed.
Scripts can be append using append(str).
Or you can add str or other Scripts.
Since the scripts are callable,
to run a script just call its name followed by ().script=Scripts('''echo "This is a line"echo "The white space are ignored"''')script()script+='echo "you can add string"'script+=Script('echo "or another Script"')script.append("And you can append too")script()#[# This is a line,#The white space are ignored,#you can add string,#or another Script#And you can append too,#]#Write to a file and return the pathshell_script:Path=script.writefile(name="shell.sh")
Package: magic-scissors
Magic Scissors ✂️Generate synthetic data for computer vision using copy-paste context augmentation.Magic Scissors is available as a Python package and aweb application.InstallationTo install Magic Scissors, run the following command:pipinstallmagicscissorsQuickstart 🚀To use Magic Scissors, you need two datasets:A dataset with object of interest;A dataset with backgrounds on which objects of interest can be pasted.Both datasets should be formatted as COCO JSON. You canconvert data between formatsusing Roboflow.frommagic_scissorsimportMagicScissorsdata=MagicScissors(dataset_size=100,min_objects_per_image=1,max_objects_per_image=3,min_size_variance=2,max_size_variance=5,annotate_occlusion=0,working_dir="./",upload_to_roboflow=False,roboflow_api_key="",roboflow_workspace="",roboflow_project="",)# load data from COCO JSON filesdata.load_backgrounds_from_coco()data.load_objects_of_interest_from_coco()# load data from Roboflowdata.download_objects_of_interest_from_roboflow(dataset_url="")data.download_backgrounds_from_roboflow(dataset_url="")# generate dataset and save to directorydata.generate_dataset()Contributing 🏆We would love your help improving Magic Scissors! Please see ourcontributing guideto get started. Thank you 🙏 to all our contributors!LicenseThis project is licensed under an MIT license.
Package: magicset
magicboxmagicset常用组件集合。update:2020-11-12,  By:8034.commagicbox 功能列表：1) 按规则生成身份证号 
2) 图片简易处理 -> Require: pip install Pillow
3）使用说明：扩展## 打包 检查
python setup.py check 
## 打包 生成
python setup.py sdist
## 上传
twine upload dist/*
## 使用
pip install magicset 
## 更新
pip install --upgrade magicset
## 卸载
pip uninstall -y magicsetMANIFEST.ininclude pat1 pat2 ...   #include all files matching any of the listed patterns
exclude pat1 pat2 ...   #exclude all files matching any of the listed patterns
recursive-include dir pat1 pat2 ...  #include all files under dir matching any of the listed patterns
recursive-exclude dir pat1 pat2 ... #exclude all files under dir matching any of the listed patterns
global-include pat1 pat2 ...    #include all files anywhere in the source tree 
matching — & any of the listed patterns
global-exclude pat1 pat2 ...    #exclude all files anywhere in the source tree matching — & any of the listed patterns
prune dir   #exclude all files under dir
graft dir   #include all files under dir
Package: magicsound
magicsoundCross platform, single function module with no dependencies for playing sounds.InstallationInstall via pip:$ pip install magicsoundDone.If you want to just work from the source,
just copy the magicsound.py file into the same folder as your project,
or into a library path.The latest version of the source code can be found at:https://github.com/jhanish/magicsoundQuick StartOnce you've installed, you can really quickly verify that it works with just this:>>> from magicsound import magicsound
>>> magicsound('/path/to/a/sound/file/you/want/to/play.wav')DocumentationThe magicsound module contains only one thing - the function (also named) magicsound.It requires one argument - the path to the file with the sound you'd like to play. This may be a local file, or a URL.There's an optional second argument, block, which is set to True by default. Setting it to False makes the function run asynchronously when possible, which is not always at this point.On Windows, uses windll.winmm. WAVE and MP3 have been tested and are known to work. Other file formats may work as well.On MacOS, we use the command line utility afplay so nothing else needs to be installed.On Raspberry Pi, we use ffplay command line utility for the same reason.On Linux, uses GStreamer. Known to work on Ubuntu 14.04 and ElementaryOS
Loki. Support for theblockargument is currently not implemented.RequirementsTested on Windows 10, MacOS 10.15.6 (Catalina), and Raspian on a 4 gig PI 4.
I've only tested with Python 3.8 on all 3 platforms.
The code is all simple enough that it's application should be able with a broad set
of software versions, but let me know, I'd like to fix any found problems
on modern systems, and add others as possible.If you need older systems to work, please check out
the playsound project that this project was forked from.https://github.com/TaylorSMarks/playsoundCopyrightThis software is Copyright (c) 2020 Joe Hanishjoe.hanish@gmail.com.This is a derivitive work from Taylor Marks playsound library that you can find
here:https://github.com/TaylorSMarks/playsound.If you are using Python older than 3.6, I recommend you use his library.  Magicsound was made just to fix some problems on newer systems, eradicate the install requirement for OSX, and detect and work with Raspberry Pi directly.  This project is MIT licensed as is his.Taylor's original source copyright:
This software is Copyright (c) 2016 Taylor Markstaylor@marksfam.com.See the bundled LICENSE file for more information.
Package: magic-storage
Magic Storage cooler than you think!Magic storage is a Python library that provides tools to easily write, read and
delete resources for testing. This applies, of course, to resources that are
difficult to obtain but not very expensive to store locally and, in addition,
do not change. A good example are responses from REST APIs or at least those of
them that are not live data.The library consists of a set of classes that implement storage using the file
system and temporary storage in RAM. All tools can be accessed through the
MagicStorage class.InstallingInstall and update using pip:$ pip install -U magic_storageExamplefromtypingimportAnyfrommagic_storageimportMagicStoragedefvery_expensive_get()->Any:...response=(MagicStorage().filesystem(__file__).cache_if_missing("Nice thing",lambda:very_expensive_get()))DocumentationOnline documentation is available onGithub pages.
Package: magicsuper
magicsuper:  backport the magical zero-argument super() to python2=================================================================This is an (awful, hacky, wtf-were-you-thinking) attempt to port the magicalzero-argument super() call from python3 to python2.In standard python2 usage of the super() builtin, you have to repeat both theclass and instance objects when you call super, like this:class Hello(Base):def hello(self):super(Hello,self).hello()Using magicsuper, you can get the friendlier behaviour from python3 where itjust figures out the correct call at runtime:class Hello(Base):def hello(self):super().hello()Of course, you can still explicitly pass in the arguments if you want to dosomething strange.  Sometimes you really do want that, e.g. to skip oversome classes in the method resolution order.How does it work?  By inspecting the calling frame to determine the functionobject being executed and the object on which it's being called, and thenwalking the object's __mro__ chain to find out where that function wasdefined.  Yuck, but it seems to work...
Package: magic-terminal
:art: magic-terminalA fun way to customize your terminal with colors, styles etc...Installpy -m pip install -U magic-terminal

:: for latest/unstable
py -m pip install -U git+https://github.com/Marseel-E/magic-terminalImportfromMagicTerminalimportMagic,Style,Color,HighlightMagic.styalize()print(Magic.styalize("Some fancy text",Style.default,Color.green,Highlight.red))# >>> Some fancy textMagic.print()Magic.print("Some fancy text",Style.default,Color.green,Highlight.red,True,True)# >>># >>> Some fancy text# >>>Magic.typed_print()Magic.typed_print(420)# >>> 420📜License
Package: magic-timer
magic-timerpip install magic-timerConveniently get a rough idea of how long things take.This is a light wrapper around the standard library'stime.monotonic. It aims to provide a clean API, and nice output strings.How to use:frommagic_timerimportMagicTimertimer=MagicTimer(history=True)foriinrange(3):expensive_computation()# Print nicely formatted string:print(f"{i}- elapsed time{timer}")# Get the elapsed times that were printed:print("timer.str_history =",timer.str_history)0 - elapsed time 510 milliseconds
1 - elapsed time 1.1 seconds
2 - elapsed time 1.6 seconds
timer.str_history = [0.5046274580000158, 1.005028416000016, 1.510260250000016]Use via context manager:frommagic_timerimportMagicTimerwithMagicTimer()astimer:# do stuffx=sum(i*iforiinrange(100_000))# Print a nicely formatted string:print('Stuff took',timer)# Or get the elapsed time in seconds:time_elapsed=timer.time_elapsed()print(time_elapsed)Stuff took 8.0 milliseconds
0.007906290999997623Use viaMagicTimerobject:frommagic_timerimportMagicTimerdefdo_stuff():[i*iforiinrange(5_000_000)]timer=MagicTimer()do_stuff()print('Stuff took',timer)do_stuff()print("Note the timer's still ticking, unless `.stop()` is called...",timer)Stuff took 210 milliseconds
Note the timer's still ticking, unless `.stop()` is called... 400 millisecondsTo pause the timer, use thestopmethod (restart with the.start()method). (Note that the context manager automatically calls.stop()).frommagic_timerimportMagicTimerdefdo_stuff():[i*iforiinrange(5_000_000)]timer=MagicTimer()do_stuff()timer.stop()print('Stuff took',timer)time_elapsed=timer.time_elapsed()other_stuff()timer.start()# continue timingUse viaftimerdecorator:frommagic_timerimportftimer@ftimerdefdo_stuff():[i*iforiinrange(20_000_000)]do_stuff()`do_stuff` ran in 1.9 seconds.The use case for this package:You have something you want to time, but you don't want to time it multiple times withtimeit.You also don't want to useJupyter's%%timeitbecause it puts the cell into a different scope.You can importmagic-timer, throw it in, and get a rough idea of the time taken. (It's slightly neater than using time.monotonic directly.)
Package: magic-toolbox
Magic ToolboxMagic toolbox is a framework built off of plac.
When you create a new cli project toolbox creates a new floder,
adds a tool.py file and main project.py file.
You put new commands into the tool.py and
the project.py will automatically add them toInstallpip install magic-toolbox 
poety add magic-toolboxUsageHow to create a new projecttoolboxcreate_projectfoo
lsfoo
foo.pytools.pyThis creates a new project, by creating a project folder, and two python files;
the project file foo.py, and the tools file tools.py.
The project file is used likepython foo.py args.Add new functions.cdfoo
toolboxadd_functionbar
cattools.py
deffoo(self,):'''This is just a dummy sub command to use as an example.You can use this as help message.'''defbar(self):'''Put your doc string here''''''Inside the project folder you can run the add_function to create a sub-command.
This adds a function to tools.py which is the entry point into your python code.Turns current directory into a magic_toolbox projecttoolboxinitYou can turn the current directory into a project if you like.