Saravanan666/pypi-org huggingface dataset:
Package: magic-combo
🌟 magic_comboA collection of Python utilities for seamless
management of my personal games project in
Godot Engine.AboutThis project is used todevelop, contributeand managemy game projects, but it's also
completelyoptional.Develop, contribute and manageThe package is split into 3 parts:tasks, that is a wrapper around the Godot
binary. It's allow to automatically download
the version of Godot used by your game...playbooks, that is a suite of tasks. It's
useful to build your game from scratch, like
in CI.scripts, that is more random stuff, like
generate credits from a dep5 file, or bump
your game version in the Godot export preset
file.And the second goal of this package is to pin
dependencies use in my.pre-commit-config.ymlfiles.OptionalI attach importance to being able  to do
things without extra tools, so my personal
game projects used this package
to simplify some tasks, but if you know
how to use Godot you can do anything
with Godot.This project was born to localize
my scripts in one place rather than having
them duplicated in each project.InstallThis project usespythonandpip.
Go check them out if you don't have them
locally installed.$ pip install magic_comboUsageTo list all sucommands, run:$ magic_combo --list
Subcommands:

  playbook.build                    Build godot game for Linux.
  playbook.clean                    Clean combo, godot and plug caches.
  playbook.export                   Release export for any platform.
  playbook.run                      Build and run godot game for Linux.
  script.add-config-to-github-env   Add 'godot_version' and 'game_version'
                                    to Github env.
  script.bump-version               Updates the game version for export.
  script.generate-credits           Generate a CREDITS.md file.
  script.new                        Create a new godot game project, based
                                    on MechanicalFlower/godot-template.
  task.clean-combo
  task.clean-godot
  task.clean-plug
  task.editor
  task.export-release-linux
  task.export-release-mac
  task.export-release-windows
  task.godot
  task.import-resources
  task.install-addons
  task.install-godot
  task.install-templates
  task.makedirs
  task.run-releaseAnd to run any subcommands, run:$ magic_combo <sucommand>
Package: magic-commands
IPython's magic commands, now implemented in pure Python (Python using only built-in libraries).How to install usingpipin Windows 10:Open command prompt (Win+R, type in 'cmd')Type commandpip install magic-commands2.1. To install in Python versionX.Y, dopipX.Y install magic-commandsorpy -X.Y -m pip install magic-commands(requires global py launcher)2.2. Ifpipis not already installed, dopy -m ensurepip, or in Python versionX.Ydopy -X.Y -m ensurepip2.3. If neitherpynorpythonis a command, make sure to have installed Python with theAdd PythonX.Y to PATHandglobal py launcheroptions checked.How to install usingpipin Ubuntu 20.04 LTS (Needs confirmation):Open TerminalRunpip install magic-commands2.1. To install in Python version 'X.Y', dopipX.Y install magic-commandsorpythonX.Y -m pip install magic-commands2.2. Ifpipis not already installed, dopython -m ensurepip, or in Python versionX.YdopythonX.Y -m ensurepipORsudo apt install python-pip2.3. If neitherpythonnorpython3is a command, Python can be installed usingsudo apt install python, or specifically Python versionX.Ydosudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install pythonX.YTo check ifmagic-commandsis installed:On Windows 101.1 Open command prompt (Win+R, type in 'cmd')1.2 Open python by entering commandpyorpython. To open Python versionX.Yspecifically, dopy -X.Y1.3 Type inimport magiccmds. If noImportErroroccurs, the package is installed.On Ubuntu 20.04 LTS2.1 Open Terminal2.2 Open python by entering commandpythonorpython3. To open Python versionX.Yspecifically, dopythonX.Y2.3 Type inimport magiccmds. If noImportErroroccurs, the package is installed.
Package: magic-config
Magic ConfigA simple library for easy handling of .env files and environment variables configurations.This library is a class for working with configurations. The class is implemented as a singleton, which allows you to always have exactly one instance of the same data registry everywhere.The configuration data itself is taken from the .env file or from environment variables.Installationpip install magic-configUpgradepip install --upgrade magic-configPypi url:https://pypi.org/project/magic-config/Example:DEBUG=1myapp.pyMy app script:frommagic_configimportConfig# You can access to variables as property of class objectifConfig.DEBUG:...# You can access to variables in lower case (and camel case, and other case)ifConfig.debug:...# You can access to variables as key of dict objectifConfig["debug"]:...Configure custom variables# You can add variables to the object# as dictMagicConfig({"Number":456,"Boolean":True})# as named argumentsMagicConfig(Number=456,Boolean=True)Prepared autogenerators for DB URIsFor example in .env  file you can write only this data:MONGO_HOST="127.0.0.1"
MONGO_USER="user"
MONGO_PWD="*****"
MONGO_DB="test"
MONGO_PORT=27017and in code you can call the MONGO_URLfrommagic_configimportConfigConfig.MONGO_URL# output:# mongodb://user:passwd@127.0.0.1:27017/test?authSource=admin&tls=falseSet type casting for environment variablesFor example if you create in source root magic.config file and write:DEBUG="bool"DEBUG_STEP="bool"DEBUG_USER_ID="int"then you runDEBUG=1DEBUG_STEP=1DEBUG_USER_ID=1DEBUG_USER_ID=10011888pythonserver.pyConfig.DEBUG# TrueConfig.DEBUG_STEP# TrueConfig.DEBUG_USER_ID# int(10011888)Custom file pathInstead default .env file in source root you can configure path to .env file:# for exampleenv_file=os.path.realpath(os.path.dirname(os.path.realpath(__file__))+"/../my.env")MagicConfig(env_file=env_file)
Package: magic-container
Magic ContainerThread-safe, lightweight and persistent dict for Python with a magical touch.ContentsInstallationExamplesInstallation:pip install magic-containerExamples:Use it like a dict:fromcontainerimportcontainercontainer["key"]=3print(container["key"])delcontainer["key"]Or get the values while setting them if there aren't in the container:fromcontainerimportcontainerprint(container["second_key"],lambda:23)Limitations:Currently only works if installed and used in a virtual environment with write access to the venv folder.Currently keys can only be strings.Currently only theget,setanddeletemethods are defined.
Package: magic-cta-pipe
Repository for the analysis of MAGIC and MAGIC+LST1 data, based onctapipe.Code:https://github.com/cta-observatory/magic-cta-pipeDocs (preliminary):https://magic-cta-pipe.readthedocs.io/v0.4.1 ofmagic-cta-pipeprovides all the functionalities to perform a MAGIC+LST-1 or a MAGIC-only analysis. Both types of analyses can be performed using the scripts within thelst1_magicfolder.
Seeherefor more details on how to run the analysis.v0.4.1 is based onctapipev0.19.x andcta-lstchainv0.10.x.NOTE ON OLD RELEASESv0.3.1 ofmagic-cta-pipewas the last release before the cleanup of old files. Also, it was the last one supporting ctapipe v0.12.
In order to exploit fully the new functionalities provided byctapipe, use always the latest stable release ofmagic-cta-pipe(currently v0.4.1).
v0.4.1 contains backward incompatible changes with respect to v0.3.1. Therefore, you cannot mix analyses performed with the two releases.Installation for usersmagic-cta-pipeand its dependencies may be installed using theAnacondaorMinicondapackage system. We recommend creating a conda virtual environment
first, to isolate the installed version and dependencies from your master environment (this is optional).The following command will set up a conda virtual environment, add the necessary package channels, and installmagic-cta-pipeand its dependencies:git clone https://github.com/cta-observatory/magic-cta-pipe.git
cd magic-cta-pipe
conda env create -n magic-lst1 -f environment.yml
conda activate magic-lst1
pip install .In general,magic-cta-pipeis still in heavy development phase, so expect large changes between different releases.Instructions for developersDevelopers should follow the development install instructions found in thedocumentation.
Package: magiccube
MagicCube: A NxNxN Rubik Cube implementationA fast implementation of the Rubik Cube based in Python 3.x.Makes it easy to create cubes of various sizes (2x2x2, 3x3x3, 4x4x4, 6x6x6, ...., 100x100x100).Fast rotation speed when compared with other Python implementations, which makes it suitable for Rubik Cube simulations.Includes:Simple solver for the 3x3x3 cube.Move optimizer which reduces the number of moves.InstallationpipinstallmagiccubeUsageimportmagiccube# 3x3x3 Cubecube=magiccube.Cube(3,"YYYYYYYYYRRRRRRRRRGGGGGGGGGOOOOOOOOOBBBBBBBBBWWWWWWWWW")print(cube)# Rotate the cubecube.rotate("R' L2 U D' F B'2 R' L")# Solve the 3x3x3 cubesolver=BasicSolver(cube)solver.solve()# Complex moves 6x6x6 Cubecube=magiccube.Cube(6)cube.rotate("Lw")# L wide rotationcube.rotate("Lw'")# L wide counter-rotationcube.rotate("Lw2")# 2x L wide rotationcube.rotate("3L")# 3rd line L rotationcube.rotate("3Lw")# 3rd line L wide rotationcube.rotate("3Lw'2")# 2x 3rd line L wide counter-rotationExamplesSee examples folder.Supported Moves and NotationBasic movesMoveL L'Clockwise/Counterclockwise cube rotation of the LEFT face.R R'Clockwise/Counterclockwise cube rotation of the RIGHT face.D D'Clockwise/Counterclockwise cube rotation of the DOWN face.U U'Clockwise/Counterclockwise cube rotation of the UP face.F F'Clockwise/Counterclockwise cube rotation of the FRONT face.B B'Clockwise/Counterclockwise cube rotation of the BACK face.Advanced MovesMoveX X'Cube rotation on X axis. X is the axis that points from LEFT to the RIGHT face.Y Y'Cube rotation on Y axis. Y is the axis that points from DOWN to the UP face.Z Z'Cube rotation on Z axis. Z is the axis that points from BACK to the FRONT face.M M'Rotation of the center layer on the X axis.E E'Rotation of the center layer on the Y axis.S S'Rotation of the center layer on the Z axis.Fw Fw'Wide rotation of 2 layers.3Fw 3Fw'Wide rotation of 3 layers.3F 3F'Rotation of the 3rd layer.F2 F2'2x rotation.Cube CoordinatesCube coordinates are expressed as a tuple of x,y,z.(0,0,0) is the piece on the LEFT,DOWN,BACK corner.In a 3x3x3, (2,2,2) is the piece on the RIGH,UP,FRONT corner.SolverThe solver uses thebeginner methodto solve the cubeMove OptimizerThe move optimizer does the following optimizations:Eliminates redundant moves (ex: L L L L)Converts 3x moves to the inverse (ex: F F F -> F')Eliminates cube rotations (ex: Y F -> R)DevelopmentInstallpyenvcurlhttps://pyenv.run|bashSetup the environment usingpyenvpyenvvirtualenv3.11cube-3.11
pyenvlocalcube-3.11
pipinstall-rrequirements.txt
direnvallowInstall commit hookspre-commitinstall
Package: magic-cypher
cypher magicBased on the code fromhttps://github.com/innovationOUtside/cypher_magic.gitbut now more complete .pip install --upgrade git+https://github.com/petehughes/cypher_magic.gitLoad the magic with:%load_ext cypher_magicThe magic allows you to run Cypher commands against the connected database using default credentialsYou can set the host name of the neo4j using the-s/--servervariable. default islocalhostYou can set the username with the-u/--userNamevariable. default isneo4jYou can change the password with the-p/--passwordvariable.the-qflag suppresses the cell output.the-o/--outputset the output type:default:pandasdataframeraw: response from thepy2neotable,matrix- requiressympygraph%cypher -r
%cypher -q -p password -u neo4j -s localhostCall as line magic%cypheror block magic:%%cypherp = %cypher -o table MATCH (p:Person) RETURN p.name AS nameor%%cypher -o table
MATCH (p:Person)
RETURN p.name AS namethe magic will return apandasdataframe by default. Other return formats, set using the-o/--outputparameter, includetableandmatrix(the latter requiressympyto be installed).graph output options:the graph output can be tailored by using a number of options:{
    "label of node or type of edge": "attribute name to use to describe it"
}eg{"Person":"FullName" }complex:
the graph output can be tailored by using a number of options:{
    "label of node or type of edge": {
        "label":"attribute name to use to describe it",
        "opacity":"the opacity",
        "width":"the width of the relationship line", // relationship only
        "color": "the colour",
        "colorValue": "the value in the relationship that defines the color",
        "image": "url to the image" // node only
        "shape": "the type of shape" // node only
        "noArrows": "remove all the arrows from showing" // relationship only
    }
}
Package: magicdaq
MagicDAQis a data acquisition and test automation device (USB DAQ) powered by an easy to usePython API.MagicDAQ Key Features:8 Analog inputs, 14 bit resolution, 48 KS/s maximum measurement frequency, -/+ 10V input voltage range8 Digital inputs / outputs, 0 to 5V range2 Analog outputs / PWM outputs / sine wave outputs, 0 to 5V range1 Pulse counter / PWM output, 0 to 3.3V rangeUSB PoweredWell documentedPython APIcontains code examples for all functions.MagicDAQ Hardware Docs:All hardware documentation can be found atMagicDAQ.comData Sheet3D Model (.stp)Mechanical DrawingGetting Started with MagicDAQYou caninstall MagicDAQusing pip:python -m pip install magicdaqFull API documentation and code examples:MagicDAQ API DocsMeasurement & Automation Board OverviewAn extensive set of hardware testing capabilities can be accessed by connecting the MagicDAQ to theM&A Board. The M&A Board can be used in conjunction with the MagicDAQ, an alternative USB DAQ, or can be used stand alone.M&A Board Key Features:3 Current measurement circuits, 5A maximum1 Low current measurement circuit, measures uAs4 Temperature measurement probes, -55C to 125C range4 Switching relays, 10A maximum switching capacity1 Variable voltage power output, 1V to 10V range, 2A maximum current output2 Fixed voltage power outputs: 3.3V and 12VM&A Board Hardware Docs:All hardware documentation can be found atMagicDAQ.comData Sheet3D Model (.stp)Mechanical Drawing
Package: magicdate
Convert from fuzzy dates like “yesterday”, “2 weeks and 1 day ago”, “next wed”,
“Jan 4”, etc., to a datetime object.This is useful for processing command line arguments:>>> from optparse import OptionParser
>>> import magicdate
>>> parser = OptionParser(option_class=magicdate.MagicDateOption)
>>> parser.add_option(
...     '-s', '--start', dest='start', type='magicdate', default=None)
>>> parser.add_option(
...     '-e', '--end', dest='end', type='magicdate', default='today')Now you can pass options like “today”, “1996-01-01”, etc., to your program.Inspired by Simon Willison’sdateparse.js.
Package: magicdb
MagicDBA fully typed Firestore ORM for python -- the easiest way to store data.MagicDB inherets from Pydantic, so you get all the power of Pydantic models with the functionality of Firestore:https://pydantic-docs.helpmanual.io/.Instalationpip install magicdbInitialize the DBMagicDB is initialized via a Firestore service account json which you download from your Firebase console.
Once you have the json, you must tell MagicDB where it is, either by 1) setting theGOOGLE_APPLICATION_CREDENTIALSenvironment variable to the json path, or by 2) calling magicdb.connect with the path:# 1)# You can set the env variable from the terminal too: export GOOGLE_APPLICATION_CREDENTIALS="path/to/my-service-account.json"importosos.environ["GOOGLE_APPLICATION_CREDENTIALS"]="path/to/my-service-account.json"# OR# 2)importmagicdbmagicdb.connect(from_file="path/to/my-service-account.json")Examplefrommagicdb.ModelsimportMagicModelclassSalesman(MagicModel):name:str=Nonecompany:str=Nones=Salesman()s.name='Jim's.save()# Get Salesmans=Salesman.collection.get(s.id)print(s.name)# JimFieldsUse any typemypywill accept!Fields ExamplefromdatetimeimportdatetimeclassManager(MagicModel):name:strage:intcompany:str='Dunder Mifflin'startedWorkingAt:datetime=None# m = Manager(name='Michael Scott', age=44)  # you must pass in the required fields on initializing the object.m.age=45m.save()# Success! New doc in collection "manager" as: { name: Michael Scott, age: 45, company: Dunder Mifflin }m=Manager(name='Dwight Schrute')# Exception since age is required but not givenYou can also add other Objects as a field.NestedModel ExampleclassDog(MagicModel):age:intowner:Managerdog=Dog()dog.age=3dog.owner=Manager(name='Robert California',age=59)dog.save()print(dog)CollectionsThe collection name for a class defaults to the class' name in lowercase. To set the collection name, use theMetaclass.Meta ExampleclassStudent(MagicModel):name:str=Noneschool:str='UPenn'classMeta:collection_name='students's=Student(name='Amy Gutman')s.save()# creates a new document in the "students" collectionprint(s)# name='Amy Gutman' school='UPenn'You can also inheret classes.Inheritance ExampleclassExchangeStudent(Student):originalCountry:strclassMeta:collection_name='exchangeStudents'e=ExchangeStudent(originalCountry='UK')print(e.school)# UPenne.save()print(e)# name=None school='UPenn' originalCountry='UK'QueriesYou can make queries with the same syntax you would using the Python firebase-admin SDK. But FireORM returns the objects.Queries Examplee=ExchangeStudent(originalCountry='UK')print(e.school)# UPenne.save()print(e)# name=None school='UPenn' originalCountry='UK'managers=Manager.collection.where('name','==','Michael Scott').limit(1).stream()print(managers)# [Manager(name='Michael Scott', age=45, company='Dunder Mifflin', startedWorkingAt=None)]print(managers[0].id)manager=Manager.collection.get('0mIWZ8FfgQzBanCllqsV')print(manager)# name='Michael Scott' age=45 company='Dunder Mifflin' startedWorkingAt=None
Package: magicdb-cli
Installpipinstallmagicdb_cliTutorialsDatabase OperationsList All Databasesshowdatabases;Create A Database-- db_name: the name of this databasecreatedatabase[ifnotexists]db_namewithproperties("k1"="v1","k2"="v2");propertiesMUST CONTAINthese keys:bucket: bucket name of OSS/S3 example: (s3://bucket-name | oss://test-bucket)endpoint: endpoint for OSS/S3access_key: token for accountsecret_key: token for accountDelete A Databasedropdatabase[ifexists]db_name;Table OperationsList All Tables Of A Database-- db_name: the name of this databaseshowtablesdb_name;Drop A Table-- db_name: the name of this databasedroptable[ifexists]db_name.table_name;Create A Table Of A Database-- db_name: the name of this database-- table_name: the name of this tablecreatetable[ifnotexists]db_name.table_namewithproperties("k1"="v1","k2"="v2");propertiesMUST CONTAINthese keys:data: the path to put sqlite filesmeta: the path to put meta filesShow Table Info-- db_name: the name of this database-- table_name: the name of this tabledescdb_name.table_name;describedb_name.table_name;Versions OperationsList All Versions Of A Table-- db_name: the name of this database-- table_name: the name of this tableshowversionsdb_name.table_name;Show Current Version Of A Table-- db_name: the name of this database-- table_name: the name of this tableshowcurrentversiondb_name.table_name;Update Current Version Of A Table-- db_name: the name of this database-- table_name: the name of this table-- version1: the name of current versionupdatetabledb_name.table_namesetcurrentversion="version1";Drop A Version Of A Table-- db_name: the name of this database-- table_name: the name of this table-- version1: the name of current version-- if `version1` is current version, then the new current version is set `nil`.altertabledb_name.table_namedropversion("version1");Machine OperationsList ALL Machines of A Database-- db_name: the name of this databaseshowmachinesdb_name;Delete A Machine Of A Database-- db_name: the name of this database-- machine_ip: ip of this machinealterdatabasedb_namedropmachine("machine_ip");Add A Machine Of A Database-- db_name: the name of this database-- machine_ip: ip of this machinealterdatabasedb_nameaddmachine("machine_ip");Load And Select OperationsLoad Data To A Table-- db_name: the name of this database-- table_name: the name of this table-- properties are optional-- path: hive table pathloaddata"path"intodb_name.table_name[withwithproperties("k1"="v1","k2":"v2")];propertiesMUST CONTAINthese keys:key: primary key of tablepropertiesMAY CONTAINthese keys:partitions: partitions to split, default: 100workdir: where to save the load data, defalue: /tmp/$db_name/$table_name/$timestamp/workers: process num, default: max(cup()-1, 1)Select Data From Table-- db_name: the name of this database-- table_name: the name of this table-- key: the primary key value-- field: the primary key fieldselect*fromdb_name.table_namewherefield='key';
Package: magic-decorator
Simple demo function using LangChainThe only function implemented in this module is magic.magicworks as a decorator. It simply sends the function's signature and docstring to the LLM and expects to get a result.It can be installed withpip install magic-decoratorand used withfrom magic_decorator import magic.fromlangchainimportSomeLLMModelsllm=SomeLLMModels()frommagic_decoratorimportmagic@magic(llm=llm)deftranspose(matrix:list[list[int]])->list[list[int]]:"""This function finds the transpose of the given matrix."""transpose([[1,2,3],[4,5,6]])[[1, 4], [2, 5], [3, 6]]frommagic_decoratorimportmagic@magic(llm=llm)defadd(a:float,b:float)->float:"""This function adds a and b."""add(1.,10.)11.0frommagic_decoratorimportmagic@magic(llm=llm)deffriend(message:str)->str:"""This function responds like a friend."""friend("Hi, how are you today?")'Hey! I am doing great, thank you. How about you?'Added a decorator for langchain. In this case, it becomes LLMChain.llm=SomeLLMModels()@magic_langchain(llm=llm)defmychain(arg1:int,arg2:str):...mychain.predict(arg1=2,arg2="hi")There is no preprocessing, no postprocessing, and no error handling in this module. It's just code to do a simple thing, so there are no prompts to encourage better answers.
Package: magicdict
An ordered, one-to-many mapping.Install$pipinstall-UmagicdictThread SafetyFrozenMagicDictand its subclasses should be thread safe without additional
locking. If any data races occurred, then that’s a bug. Please file an issue
with reproducing procedure.UsageMagicDictshould function likecollections.OrderedDictexceptmove_to_endis not defined andd[key]always returns the first
item.FrozenMagicDictis an immutable version ofMagicDict.FrozenTolerantMagicDictandTolerantMagicDictare
case-insensitive versions ofFrozenMagicDictandMagicDictrespectively.get_first,get_last,get_iter, andget_list:
These methods are available inFrozenMagicDictand its subclasses.
For more details, please read the comments of each method.add:
Methodaddis available inMagicDictandTolerantMagicDict. This method is used as an substitution ofdic[key] = valueas it can append a value to the
dictionary without removing the existing one. Setting values like normalOrderedDictwill clear the stored value(s) if any.ContributingThe repository is hosted onGitHub.LicenseCopyright 2020 Kaede HoshikawaLicensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.