Saravanan666/pypi-org huggingface dataset:
Package: gizio
gizioA light-weight Python package forGIZMOsnapshot IODevelopment:https://github.com/galaxy-lab/gizioDocumentation:https://gizio.readthedocs.ioAboutThere aretwo snapshot reading scriptsreadsnap.pyandload_from_snapshot.pyaccompanying theGIZMO source code. gizio aims to replaceload_from_snapshot.pywith several improvements:A more flexible interface to access fieldA unit system powered byunytEasier format spec customization without source code modificationEasier to install and maintain as a Python packageWe acknowledgeytandpynbodyfor interface design inspirations.DemoThe sample data could be downloadedhere.Load a snapshot:>>>importgizio>>>snap=gizio.load('data/FIRE_M12i_ref11/snapshot_600.hdf5')View its header:>>>snap.header{'time':unyt_quantity(13.79874688,'Gyr'),'n_file':1,'mass_tab':unyt_array([0.,0.,0.,0.,0.,0.],'code_mass'),'f_sfr':1,'f_cool':1,'f_fb':1,'f_age':1,'f_met':11,'n_part':array([753678,1104128,2567905,0,361239,0],dtype=uint32),'n_part_pf':[array([753678,1104128,2567905,0,361239,0],dtype=int32)],'box_size':unyt_quantity(60000.,'code_length'),'Om0':0.272,'OmL':0.728,'h':0.702,'z':0.0,'cosmological':True}Load a field:>>>snap['PartType0','Masses']unyt_array([3.175186e-05,3.175186e-05,3.175186e-05,...,3.175186e-05,3.175186e-05,3.175186e-05],dtype=float32,units='code_mass')Load a field using shorthands:>>>snap.pt['gas']['m']unyt_array([3.175186e-05,3.175186e-05,3.175186e-05,...,3.175186e-05,3.175186e-05,3.175186e-05],dtype=float32,units='code_mass')Select particles by masking:>>>gas=snap.pt['gas']>>>hot_gas=gas[gas['t'].to_value('K')>1e5]>>>hot_gas['t'].min()unyt_quantity(100000.79,dtype=float32,units='K')Select particles by composing:>>>star=snap.pt['star']>>>baryon=gas|star>>>len(gas)753678>>>len(star)361239>>>len(baryon)1114917>>>baryon['m']unyt_array([3.1751861e-05,3.1751861e-05,3.1751861e-05,...,2.2581291e-05,2.3056862e-05,2.7417644e-05],dtype=float32,units='code_mass')InstallationInstall latest stable version from PyPI:pipinstallgizioInstall development version from source:gitclonehttps://github.com/galaxy-lab/gizio.gitcdgizio
pipinstall-e.
Package: gj
Grant Jenkstools.FeaturesPure-PythonMiscellaneous toolsTodoAdd “trash” command. Usesend2trashmodule.Add “watch” command. Usewatchdogmodule.QuickstartInstallinggjis simple withpip:$ pip install gjYou can access documentation in the interpreter with Python’s built-in help
function:>>> import gj
>>> help(gj)Reference and IndicesGJ DocumentationGJ at PyPIGJ at GitHubGJ Issue TrackerLicenseCopyright 2016-2019 Grant JenksLicensed 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.
Package: gja
Gauss-Jordan Assistant (gja)Enabling live demonstration of the Gauss-Jordan algorithm in a terminal/console.Installationpip install gjaDescriptionThe idea of this project is to enable live demonstration of using the
Gauss-Jordan algorithm to solve systems of linear equations,
using a simple console.
This project is developed on Windows but should work using other operating systems.Why?I teach an introductory course in Linear Algebra by videoconference
to students who are not math majors; the focus is on calculations,
not proofs.
As I teach remotely, I share the content of my screen.
Many of the examples require, at one stage or another, that
Gaussian elimination on a matrix be performed.In my experience, using slides with all the content
written up in advance (which is what I have mostly done until recently)
is not a good way to maintain student engagement.
My hand writing (either using a mouse or a tablet) on a computer screen
is absolutely atrocious, which makes it difficult to do "live" examples.I have also found that a small fraction of students do not seem to understand
the basic step of Gaussian elimination, even when I attempt to
provide additional explanations via email.This tool, which I named the Gauss-Jordan Assistant (or GJA),
allows me to do live computations on my screen in a legible way.
I have tried to design it so that each computation includes some
visual clues reinforcing some aspects of Gaussian elimination.Using the GJA, I can ask students to suggest what should be the
next step in the computation, just as easily as I could
do it in a traditional classroom with a blackboard. If they suggest
something that is incorrect, rather than telling them up front,
I can type in their suggestion, observe the result, and follow with
relevant explanations go wrong.BonusIt is possible to save the result of all the steps using LaTeX
format, for easy inclusion (without typos!) in any LaTeX document.RequirementsPython 3.8+Rich (https://pypi.org/project/rich/).  Rich is a fantastic project.To work properly on Windows (which is what I use), you need the following:Windows Terminal (https://github.com/Microsoft/Terminal), which you can
get from the Microsoft Store.
Package: gjf
gjf: A tool for fixing invalid GeoJSON objectsThe goal of this tool is to make it as easy as possible to fix invalid GeoJSON objects through Python or Command Line.InstallationpipinstallgjfVerify installation by runninggjf--versionFeaturesFix all types of GeoJSON objects, including FeatureCollection and Geometry Collection. If there is nothing to fix the object will be returned as is.Can validate GeoJSON objects, and print explanations if the object is not valid.Can be used within Python or command lineUsagePythonSay, you have a GeoJSON object defined as follows:obj={"type":"Polygon","coordinates":[[[45.892166,25.697688],[45.894522,25.696483],[45.897131,25.695144],[45.898814,25.694268],[45.900496,25.693394],[45.901284,25.692983],[45.903946,25.697312],[45.894791,25.701933],[45.894621,25.701657],[45.892593,25.698379],[45.892166,25.697688]],[[45.892086,25.697729],[45.892166,25.697688],[45.892086,25.697729]]]}You can simply callapply_fixes_if_neededfromgjf.geojson_fixerimportapply_fixes_if_neededfixed_obj=apply_fixes_if_needed(obj)You can also flip coordinates order by togglingflip_coordsfromgjf.geojson_fixerimportapply_fixes_if_neededfixed_obj_with_flipped_coordinates=apply_fixes_if_needed(obj,flip_coords=True)You can also check whether a GeoJSON object is valid or not by callingvalidityfromgjf.geojson_fixerimportvalidityvalidity(obj)Will result('invalid', ['Too few points in geometry component[45.892086 25.697729]', ''])CLIgjfinvalid.geojsongjfwill fix the file, and output toinvalid_fixed.geojsonby default. If you need the output directed in another way you can use--output-methodas directed below. It is also possible to fix multiple files, as below.gjfinvalid_1.geojsoninvalid_2.geojsonAbove will output fixed GeoJSON objects toinvalid_1_fixed.geojsonandinvalid_2_fixed.geojson.CLI Arguments--versionprint version and exit--validatevalidate GeoJSON file, and print the error message if it is not valid, without attempting to fix it.--flipFlip coordinates order-o, --output-method [overwrite|new_file|print]Default isnew_file, wheregjfwill output fixed GeoJSON object to file with the postfix_fixed. Whereasoverwritewill write the fixed GeoJSON object to the source file, overwriting the original file in process. Lastly,printwill output the fixed GeoJSON object on the terminalgjf--output-methodprintinvalid.geojsonThis would print fixedinvalid.geojsonon the terminalIssuesFeel free to open an issue if you have any problems.Special ThanksShapelygeojson-rewind
Package: gjtheme
Sphinx GJ Themeis an Apache2 licensed Sphinx theme for projects by Grant
Jenks.ReferencesSphinx GJ Theme DocumentationSphinx GJ Theme at PyPISphinx GJ Theme at GitHubSphinx GJ Theme Issue TrackerSphinx GJ Theme LicenseCopyright 2017-2022 Grant JenksLicensed 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.
Package: gkamin-calculator
The Calculator PackageTable of contentsSummaryRequirementsInstallationUsageLicenseSummaryThis package contains a class Calculator which allows to perform basic mathematical operations
while saving the obtained result in memory for further calculations.It includes methods for the following operations:Addition / SubtractionMultiplication / DivisionTake (n) root of a numberReset memoryRequirementsPython 3.6 or newerInstallationTo install the package:pipinstallgkamin-calculatorUsageThis section will detail all the methods that can be called for the created object Calculator.However, in order to use the methods, first we need to import the package:>>>>fromgkamin_calculator.gkamin_calculatorimportCalculatorCreating the calculator objectWhen the calculator object is created, the initial value it stores is equal to zero:>>>>calc=Calculator()>>>>print(calc.result)0Initial value can be changed by using optional input parameter:>>>>calc=Calculator(10.05)>>>>print(calc.result)10.05Addition method.add(addend)- this method adds input value to last stored result.
Initially to 0:>>>>calc=Calculator()>>>>calc.add(2)>>>>print(calc.result)2>>>>print(calc.result)2>>>>calc.add(3)>>>>print(calc.result)5Subtraction method.subtract(subtrahend)- this method subtracts input value from last stored result:>>>>print(calc.result)5>>>>calc.subtract(1)>>>>print(calc.result)4Multiplication method.multiply(multiplier)- this method multiplies input value by last stored result:>>>>print(calc.result)4>>>>calc.multiply(4)>>>>print(calc.result)16Division method.divide(divisor)- this method divides last stored result by input value:>>>>print(calc.result)16>>>>calc.divide(2)>>>>print(calc.result)8Root method.root(degree_of_root)- this method extracts n-th root from last stored result, where n is degree of root.>>>>print(calc.result)8>>>>calc.root(3)>>>>print(calc.result)2.root(degree_of_root, radicand)- if this is the first operation performed (initially radicand is equal to 0),
optional input value to be used to set required radicand value:>>>>calc=Calculator()>>>>calc.root(4,64)>>>>print(calc.result)4Reset method.reset(self)- this method resets the last stored result to zero:>>>>calc.reset()>>>>print(calc.result)0LicenseThis project is licensed under the MIT License. See the LICENSE.txt for details.
Package: gkd
gkdA set of tools to help programming in LaTex.pip install gkd, and append contents ofgkd.texto your Tex sources.GKDBNF: The best LaTex BNF package you've ever seen?This relies onpaperbnf.Usage\begin{GKDBNF}{some_unique_id}!Expressions! <e> ::= <e> ( <e>  )
| let <n> = <e> in <e>
| !$\lambda$! <n> . <e>
| <\mathtt{atom}>\end{GKDBNF}Remember to place a blank line in the end of GKDBNF block.How to write this BNF?Follow the syntax and lexer rules:Valid BNF Syntax:<atom>::=NONTERMINAL
       | TERMINAL
       | TERMINAL2
       | '|'<prod>::=NONTERMINAL '::='<atom>+ NEWLINE
       | TERMINAL NONTERMINAL '::='<atom>+ NEWLINE
       | TERMINAL2 NONTERMINAL '::='<atom>+ NEWLINE
       | '|'<atom>+<NEWLINE>Lexer rule by regex:NEWLINE     = [\r\n]+
NONTERMINAL = <.*?>
TERMINAL2   = !.*?!
Term        = \S+Whitespace tokens are ignored.
Package: gkdbnf
GKD-BNFpip install gkdbnf.Maybe the most simplest way to write pretty BNF in LaTex.Use this package withgkdtex:Usage\gkd@bnf{<i, j> :: Integer
<b> :: Boolean
<l> :: Labels


!Instructions! <h> :: !Instr[MinSIL]! =\mathbf{load}\;i%%% \qquad  \qquad  describe load|\mathbf{store}\;i
                                     |\mathbf{push}\;\zeta|\mathbf{pop}|\mathbf{jump\mbox{-}if}l%%%   consume TOS.|\cdots<e> ::= <e> ( <e> * ) |  atom}SyntaxValid BNF Syntax:atom::=NONTERMINAL
       | TERMINAL
       | TERMINAL2
       | '|'

rule::='%%%' TERMINAL2
description::=TERMINAL | TERMINAL2
type::=TERMINAL | TERMINAL2 | NONTERMINAL

prod::=description? NONTERMINAL '::' type  '=' atom+ rule? 
      | '|' atom+ rule?

start::=start NEWLINE
      |   start prod
      |   NEWLINE
      |   prodLexer rule by regex:NEWLINE     = [\r\n]+
NONTERMINAL = <.*?>
TERMINAL2   = !.*?!
TERMINAL    = \S+Whitespace tokens are ignored.Nice Error Report1:\gkd@usepackage{gkdbnf}2:\gkd@bnf{3:  <a> ::= a + 1
4:
5:  <c> ::= a a
6:  Expressions e ::= e
7:}You get errorSyntaxError: filename runtest/a.tex:
line 6, column 13, NonTerm not matchThen you know you should changeExpression etoExpression <e>.
Package: gkdbutils
gkdbutilsDatabase ingest methods and command line utilities for MySQL and CassandraThis code does NOT install mysqlclient or cassandra-driver.  If you want to use either you MUST install whichever driver you need.The command line utilities are:cassandraIngest (ingest into a Cassandra table from a text file - requires cassandra-driver)mysqlIngest (ingest into a MySQL table from a text file - requires mysqlclient)
Package: gkdhighlight
GkdHighlightGKD, i.e., 搞快点, means "(please) do it faster", which is an old saying in China.Backgroud, Installation and CLIclick and see100 trillion words omitted here,let us presentgkdhighlight.It's a syntax highlighting library viaGkdTeX,which is a programmable TeX compiles to LaTeX.No LaTeX dependencies other thanxcolorandasmmath,no shell-escape,no package conflicts, but—only normal paragraphs generated and coloured,you place it in tabular, in commands—Oh, composability! Reusability!The strong PTSD against its alternatives eventually fades.—but anyway, now,pip install pygments gkdtex gkdhighlightwithin 0.5 seconds,gkdtex main.tex --out_file main.out.texwithin 0.5 seconds,latexmk -pdf main.out.texwithin 10 seconds—faster typesetting and compilation,longer sleep,the joy of reasonable programming,hope your paper got accepted.Preview\gkd@usepackage{gkdhighlight}\begin{document}...\gkd@highlight{ocaml}{module FM = Functor(M)
    let res = print_endline FM.message}\gkd@loadpygments{colorful}\gkd@highlight{python}{class S:
        def f(self, x):
            return print(1 + x)}\gkd@loadpygments{perldoc}\gkd@highlight{haskell}{data NAT repr = NAT{Z :: repr, S :: repr -> repr}data Nat
        = Z
        | S Nat}Writing Your Own StylersIn the configuration directory of gkdtex(specified bygkdtex --config_dir <xxx>; default to be the directory you callgkdtex),
add the following code to your.gkdrc.py.frompygments.styleimportStylefrompygmentsimporttokendefpygments_monkeypatch_style(mod_name,cls):importsysimportpygments.stylescls_name=cls.__name__mod=type(__import__("os"))(mod_name)setattr(mod,cls_name,cls)setattr(pygments.styles,mod_name,mod)sys.modules["pygments.styles."+mod_name]=modfrompygments.stylesimportSTYLE_MAPSTYLE_MAP[mod_name]=mod_name+"::"+cls_nameclassYourStyler(Style):background_color="#FFFFAA"styles={token.Text:"#AA3939",token.String:"#479030",token.Keyword:"#A600A6",token.Operator:"#246C60",token.Number:"#779D34",token.Comment:"#AA6F39",token.Punctuation:"#DE369D",token.Literal:"#4671D5",}pygments_monkeypatch_style("you_gkd_please",YourStyler)Then load it in gkdtex.\gkd@loadpygments{you_gkd_please}Writing Your Own LexersWrite this in your.gkdrc.py.frompygments.lexerimportRegexLexerfromsphinx.highlightingimportlexerskeywords=['lAtEx']classYourLexer(RegexLexer):name="your_lang"tokens={"root":[*[(escape(k),token.Keyword)forkinkeywords],(r"[a-zA-Z_][a-zA-Z_]*",token.Name),(r"\s+",token.Whitespace)]}lexers[YourLexer.name]=YourLexer(startinline=True)Then use it in gkdtex.\gkd@highlight{your_lang}{lAtEx is so cool!}MiscellaneousMany popular Python distributions are addicted to providing brokenpygmentsin their bundles.
I've appreciated it a lot and you need to reinstallpygmentsagain in order to use alternatives togkdhighlight.Unfortunately,gkdhighlightjust works if you have Python 3.6+ installed.
Package: gkdtex
GKD TeXTeX that σ`∀´)!python setup.py installand you can have thegkdtexcommand.The syntax is compatible to TeX. Before executing a TeX engine, a part of TeX commands understandable togkdtexare preprocessed, generating TeX code.The usage is:gkdtex main.tex [--config_dir <str>] [--out_file <str>=main.out.tex].In GKD-TeX, there are 3 kinds of commands.The first is a Python function provided by a Python file(usually in your$config_dir/.gkdrc.pyor other gkd packages), you can check examples at Python modulegkdtex.builtins.*.The other 2, CBV(Call By Value) Commands and 2. CBN(Call By Name) Commands, are similar, can be defined via\gkd@defor\gkd@def@lazy.Commands without any arguments shall be a constant string.Gkd PackagesSome Gkd packages providing productive tools can be installed viapip.gkdbnf: painless BNF writing; no dependencies.gkdhighlight: syntax highlighting for vast programming languages; extensible; no dependencies other thanxcolorandamsmath.gkdtikz.tree: simple TikZ trees with Yaml syntax.P.S: For a package$a.$b.$c, usepip install $a.Python CommandsA minimal gkd package can be written in$config_dir/mininalplugin.py:fromgkdtex.interpreterimportInterpreterfromgkdtex.developer_utilitiesimport*defarginfo(*args:Group,tex_print,**kwargs):tex_print("{}positional arguments, keyword arguments: {{{}}}".format(len(args),','.join(kwargs.keys())))classGkdInterface:@staticmethoddefload(self:Interpreter,text_print):if'narg'inself.globals:raiseNameError("'narg' has already been defined.")self.globals['arginfo']=arginfo\gkd@usepackage{mininalplugin}\arginfo{1}{2}{3}{^a 1}% '3 positional arguments, keyword arguments: { a,self }'\gkd@verb(requiresfancyvrb)\gkd@verb{{1, 2, 3}a}% \verb& {1, 2, 3}  a&\gkd@usepackageA GKD package is made from a Python module.\gkd@usepackage{module_name}will doimport("module_name").The module search path is Pythonsys.path, with$config_dirappended.In that module you should provide a namespaceGkdInterface,GkdInterfaceshould have 1 or 2 elements,GkdInterface.loadandGkdInterface.dispose(optional).Checkruntest/plugin_A.pyfor how to implementloadordispose.\gkd@input\gkd@input{some_file}literally inputs source code insome_file.Note thatsome_fileis the relative path. The base is the directory of the proceeding document.CBV Commands\gkd@defdefines your own Call By Value command. You can define a Call By Name command by using\gkd@def@lazy.Positional arguments\gkd@def{\a{}}{#\1+ #\1}\a{1}% '1 + 1'Keyword arguments\gkd@def{\a{^a}{^b}}{#\a^#\b}\a{^b x}{^a y}% 'y + x'Optional arguments\gkd@def{\a{1}{^b k_a}}{#\1+ #\b}\a% '1 + k_a'\gkd@pyexecand\gkd@pyeval\gkd@pyeval{1 + 1}% 2\gkd@def{\add{}{}}{#\1+ #\2}\gkd@pyexec{x = r"\add{1}"}\gkd@pyeval{^expand after=True}{x + "{1}"}% 1 + 1P.S: You can use Python variabletex_print(string)to putstringin the generated tex file,
and you can useselfto access the interpreter in case you need to inspect information such as frames(self.frames), current filename(self.filename), current source code(self.src), etc.
Package: gkdtikz
gkdtikzInstallationpip install gkdtikz gkdtex
gkdtex src.tex
latexmk -pdf src.out.texgkdtizWriting simple trees via basic Yaml syntax.\usepackage{tikz}% use LaTex package\gkd@usepackage{gkdtikz.tree}% use GkdTeX package\gkd@simpletree{root:
  - node 1:
    -$\mathbb{L}\mathrm{eaf}\;1$- leaf 2$\lambda$- node 2$\gamma$:
    -$math$- normal:
      -\textbf{bold}-\textit{italic}-\textrm{roman}}
Package: gkeep
DEVELOPMENT BRANCH: The current branch is a development version. Go to the stable release by clicking
onthe master branch.Google Keep CliWork with Google Keep on your terminal. To install this module
(more options in the documentation):$ pip install -U gkeepTo get the available options use the--helpparameter orsee the documentation:$ gkeep --helpFor exampleto search for notes:$ gkeep notes search "Shopping list"Gkeep allows you to use Google Keepin your scripts. For example to remember to buy milk:$ gkeep items edit --uncheck 150ad84b557.97eb8e3bffcb03e1 "Milk"ThanksThis module is a command-line interface of the modulegkeepapi.
Thanks to Kiwiz for maintaining the module.This module does not use an official Google API to work with Google Keep. As this module does not use an official
API, its operation is not guaranteed for a production environment.
Package: gkeepapi
gkeepapiNOTICE: Google offers an officialAPIwhich might be an option if you have an Enterprise account. 🎉An unofficial client for theGoogle KeepAPI.importgkeepapikeep=gkeepapi.Keep()success=keep.login('user@gmail.com','password')note=keep.createNote('Todo','Eat breakfast')note.pinned=Truenote.color=gkeepapi.node.ColorValue.Redkeep.sync()gkeepapi is not supported nor endorsed by Google.The code is pretty stable at this point, but you should always make backups. The project is under development, so feel free to open an issue if you have questions, see any bugs or have a feature request. PRs are welcome too!Installationpip install gkeepapiDocumentationThe docs are available onRead the Docs.Todo (Open an issue if you'd like to help!)RemindersremindersFigure out all possible values forTaskAssist._suggest(Same as CategoryValue?)Figure out all possible values forNodeImage._extraction_status(integer)Blobs (Drawings/Images/Recordings)
Package: gkeep-sync
gkeep-files-syncHelps you backup your local file notesHelps you access yourGoogle Keepnotes through the local file system and therefore your favorite text editorSetupCreate a label namedautosyncthrough the Google Keep UIClone the repogitclonegit@github.com:kanevk/gkeep-files-sync.gitcdgkeep-files-syncOpen virtual environmentpipenvshellInstall dependenciespipenvinstallCreate a local config:python3gkeep_sync/generate_config.py"[Google email]""[Google app password]""[Notes root directory]"_For more information about the config options check.config.example.jsonStart the serverpython3gkeep_sync/sync_server.pyNote:Sometimes Google don't let you use your user password and in this case you have to fill.config.jsonfield password with newly generatedApp password
Package: gke-taskflow
gke-taskflowAdds support for Taskflow to the GKEStartPodOperator in Airflow.This allows us to write cleaner, more pythonic DAGs.InstallationThis backage will need to be installed into the same environment as
Airflow in order to function correctly.  For Cloud Composer, we'll have
tofollow the docs.PIPExecute the following:pipinstallgke-taskflowUseAfter the package is installed, you can define your task using the@task.gke_poddecorator:fromdatetimeimportdatetimefromairflow.decoratorsimportdag,task@dag(schedule=None,start_date=datetime(2023,7,15),tags=["testing"])defexample_dag_taskflow():@task.gke_pod(image="python:3.10-slim",task_id="test_flow",name="test_flow",cluster_name="test-cluster",namespace="composer-internal",location="us-central1",project_id="test-cluster-123abc",)defhello_world_from_container():print("hello world from container")hello_world_from_container()example_dag_taskflow()The keyword arguments supplied to@task.gke_podare identical to those
supplied to Google's GKEStartPodOperator, on which this work is based.
Thedocs for that classare scant, but thesource code is available
onlinefor review.