Saravanan666/pypi-org huggingface dataset:
Package: granavi
granavifromgranaviimportNodeclassRail(Node):def__init__(self,name,raillength=1,description=""):super().__init__(name,description)self.raillength=raillengthclassStation(Node):passstation_a=Station("Station A")station_b=Station("Station B")station_c=Station("Station C")rail_a_b=Rail("A -> B",5)[rail_a_b.connect(i,bidirect=True)foriin[station_a,station_b]]rail_b_c=Rail("B -> C",3)foriin[station_b,station_c]:rail_b_c.connect(i,bidirect=True)result=0foriinstation_a.pathTo(station_c):ifisinstance(i,Rail):result+=i.raillength
Package: grand
CorePython 3package for the offline software of theGRANDCollaboration.Quick startThe grand package can be installed fromPyPIusing pip, e.g. as:pipinstallgrandNote that Python 3.8 or above is required. On Linux you can get it as anAppImageincluding grand dependencies as:wgethttps://github.com/grand-mother/grand/releases/download/appimage/python3-x86_64.AppImagechmodu+xpython3-x86_64.AppImageCheck theonline documentationfor further details.How to contributeIssues can bereported on GitHub.You can also contribute back to the code with Pull RequestsPR. Note that you
first need to fork and clone this repository. On Linux a development
environment is provided. It can be enabled by sourcing thesetup.shscript.In order to be accepted your changes are expected to successfully pass the
integration tests. You can run does locally as:python-mtestsLicenseThe GRAND software is distributed under the LGPL-3.0 license. See the providedLICENSEandCOPYING.LESSERfiles.
Package: grandalf
Grandalf is a python package made for experimentations with graphs drawing
algorithms. It is written in pure python, and currently implements two layouts:
the Sugiyama hierarchical layout and the force-driven or energy minimization approach.
While not as fast or featured asgraphvizor other libraries likeOGDF(C++),
it provides a way to walk and draw graphs
no larger than thousands of nodes, while keeping the source code simple enough
to tweak and hack any part of it for experimental purpose.
With a total of about 1500 lines of python, the code involved in
drawing the Sugiyama (dot) layout fits in less than 600 lines.
The energy minimization approach is comprised of only 250 lines!Grandalf does only 2 not-so-simple things:computing the nodes (x,y) coordinates
(based on provided nodes dimensions, and a chosen layout)routing the edges with lines or nurbsIt doesn’t depend on any GTK/Qt/whatever graphics toolkit.
This means that it will help you findwhereto
draw things like nodes and edges, but it’s up to you to actually draw things with
your favorite toolkit.
Package: grandas
GrandasGrandas as a library that allows simplified, flexible analysis of the nodes and relationships stored in a graph database. It allows a user to search for and filter information and connections contained in a subgraph of a graph database.Data StructuresNodeA Node object is the basic entity object and identifies any noun in your graph dataset.RelationshipA Relationship stores the way that any two nodes in your dataset are related. Bi-directional relationships here are stored as two independent relationships.NodeFrameNodeframes allow users to see the nodes in their graph databases, and further enable them to filter and resolve redundant nodes.RelationshipFrameThe RelationshipFrame object stores a series of Relationship objects as a pandas DataFrame, using the hashed value of the full node to identify where the start and ending points for each relationship are.GraphFrameA GraphFrame is comprised of a NodeFrame (attribute:nodes) and a RelationshipFrame (attribute:rels).Getting StartedTo get started using grandas, you can install it using pip:pip install grandasFrom there, load in nodes and relationships to a GraphFrame object, similar to how you would use a pandas DataFrame.import grandas as gd

nodes = [
  Node(label='PERSON',name='Alice',age='27'),
  Node(label='PERSON',name='Bob',age='24'),
  ]
alice, bob = nodes
rels = [
  Relationship(start=alice, end=bob, label='owes_money_to',amount=10)
]
gf = GraphFrame(nodes=nodes, relationships=rels)

node_frame = gf.nodes
relationship_frame =  gf.relsContributingContributions are more than welcome! Please just submit a pull request to thedevelopbranch.
Package: grandcentral-py
GrandCentral is an extremely basic publisher subscriber event libraryFree software: ISC licenseDocumentation:https://grandcentral.readthedocs.org.DescriptionGrandCentral is an extremely basic publisher subscriber event library. It provides only
two methodspublish:- it publishes an event on provided channel with a payloadsubscribe:- it registers channel/event pair with a consumer that is to be called when that particular event is published on the channel.GrandCentralConsumer is an abstract class that determines how an event emitted
by grandcentral is to be handled. Currently the library provides two simple consumersSyncConsumer which receives a callable and executes that callable synchronouslyCeleryConsumer which receives a celery task and execute that asynchornously using celery.A library also provides a DjangoCentral which also allows to subscribe to built in
django signals like pre-save, post-save, pre-delete, post-delete etc.History0.1.0 (2015-05-09)First release on PyPI.
Package: grand-challenge-forge
🛠️ grand-challenge-forgeA utility that generates distributable items that help challenge organizers set up their challenge more easily onGrand-Challenge.org.InstallInstall via PyPi:pipinstallgrand-challenge-forge
grand-challenge-forge--help📦 Challenge packsA challenge pack consists of challenge-tailored examples for the following:A script toautomate uploadingdata to an archiveAsubmission algorithmthat can be submitted to a challenge phaseAnevaluation methodthat evaluates algorithm submissions and generates performance
metrics for rankingUsagegrand-challenge-forgepack-context.jsonWill use the context found inpack-context.jsonand generate a pack at the current working directory in
a directorydist/(default).Example of the content of pack-context.json{"challenge":{"slug":"challenge-slug","phases":[{"slug":"phase-slug","archive":{"url":"https://grand-challenge.org/archives/archive-slug/"},"algorithm_inputs":[{"slug":"input-ci-slug","kind":"Segmentation","super_kind":"Image","relative_path":"images/input-value"},{"slug":"another-input-ci-slug","kind":"Anything","super_kind":"File","relative_path":"another-input-value.json"}],"algorithm_outputs":[{"slug":"output-ci-slug","kind":"Image","super_kind":"Image","relative_path":"images/output-value"},{"slug":"another-output-ci-slug","kind":"Anything","super_kind":"File","relative_path":"output-value.json"}]},{"slug":"another-phase-slug","archive":{"url":"https://grand-challenge.org/archives/another-archive-slug/"},"algorithm_inputs":[{"slug":"input-ci-slug","kind":"Image","super_kind":"Image","relative_path":"images/input-value"}],"algorithm_outputs":[{"slug":"another-output-ci-slug","kind":"Anything","super_kind":"File","relative_path":"output-value.json"}]}]}}Alternatively, you generate a pack by providing a JSON string directly:grand-challenge-forge--output-dir/tmp'{ "challenge": { "slug": "a-slug"...'This will output a pack directory in the/tmpdirectory.[!NOTE]
By default, the forge does quality checks on the pack that may require docker.
You can disable these via-n🏗️ DevelopmentInstall locallyInstall grand-challenge-forge locally (requirespoetry):gitclonehttps://github.com/DIAGNijmegen/rse-grand-challenge-forge.gitcdrse-grand-challenge-forge
poetryinstall
poetryrungrand-challenge-forge--helpPre-commit hooksSeveral linters and stylers run to check the formatting during continuous integration. Ensure they are run before
committing by installingpre-commit.Running Testsusetoxto run all tests across all supported python versions:pip install tox
toxDependenciesUnder the hood grand-challenge-forge uses:Clicka composable command line interface toolkitCookiecuttera utility that creates projects from project templates
Package: grand-cypher
GrandCypherpipinstallgrand-cypher# Note: You will want a version of grandiso>=2.2.0 for best performance!pipinstall-U'grandiso>=2.2.0'GrandCypher is a partial (and growing!) implementation of the Cypher graph query language written in Python, for Python data structures.You likely already know Cypher from the Neo4j Graph Database. Use it with your favorite graph libraries in Python!UsageExample Usage with NetworkX:fromgrandcypherimportGrandCypherimportnetworkxasnxGrandCypher(nx.karate_club_graph()).run("""MATCH (A)-[]->(B)MATCH (B)-[]->(C)WHERE A.club == "Mr. Hi"RETURN A.club, B.club""")Example Usage with SQLCreate your own "Sqlite for Neo4j"! This example usesgrand-graphto run queries in SQL:importgrandfromgrandcypherimportGrandCypherG=grand.Graph(backend=grand.backends.SQLBackend(db_url="my_persisted_graph.db",directed=True))# use the networkx-style API for the Grand library:G.nx.add_node("A",foo="bar")G.nx.add_edge("A","B")G.nx.add_edge("B","C")G.nx.add_edge("C","A")GrandCypher(G.nx).run("""MATCH (A)-[]->(B)-[]->(C)MATCH (C)-[]->(A)WHEREA.foo == "bar"RETURNA, B, C""")Feature ParityFeatureSupportMultipleMATCHclauses✅WHERE-clause filtering on nodes✅Anonymous-[]-edges✅LIMIT✅SKIP✅Node/edge attributes with{}syntax✅WHERE-clause filtering on edges✅Named-[]-edges✅Chained()-[]->()-[]->()edges✅ Thanks @khoale88!Backwards()<-[]-()edges✅ Thanks @khoale88!Anonymous()nodes✅ Thanks @khoale88!Undirected()-[]-()edges✅ Thanks @khoale88!Boolean Arithmetic (AND/OR)✅ Thanks @khoale88!OPTIONAL MATCH🛣(:Type)node-labels✅ Thanks @khoale88![:Type]edge-labels✅ Thanks @khoale88!Graph mutations (e.g.DELETE,SET,...)🛣✅ = Supported🛣 = On Roadmap🔴 = Not PlannedCitingIf this tool is helpful to your research, please consider citing it with:# https://doi.org/10.1038/s41598-021-91025-5@article{Matelsky_Motifs_2021,title={{DotMotif: an open-source tool for connectome subgraph isomorphism search and graph queries}},volume={11},ISSN={2045-2322},url={http://dx.doi.org/10.1038/s41598-021-91025-5},DOI={10.1038/s41598-021-91025-5},number={1},journal={Scientific Reports},publisher={Springer Science and Business Media LLC},author={Matelsky, Jordan K. and Reilly, Elizabeth P. and Johnson, Erik C. and Stiso, Jennifer and Bassett, Danielle S. and Wester, Brock A. and Gray-Roncal, William},year={2021},month={Jun}}
Package: grand-cypher-io
grand-cypher-ioFile IO routines for reading and writing OpenCypher files.Why?To enable the use of OpenCypher files as a standard graph interchange format.To simplify reading and writing in-memory Python graphs to a Neo4j or Neptune database.To serialize and deserialize graphs for long-term (e.g., archival) immutable storage.CompatibilitiesAll routines that expect a graph can be run withGrandGraph.nxobjects.You can mock most of a Neo4j database, using this repository for IO and in conjunction withGrand-Cypherfor query execution.Designed for use withAWS NeptuneUsageExport a graph to OpenCypher-readable filesfromgrand_cypher_ioimportgraph_to_opencypher_buffers# `graph` is nx.DiGraph or compatiblevert_buffer,edge_buffer=graph_to_opencypher_buffers(graph)withopen('vertices.csv','w')asf:f.write(vert_buffer.read())withopen('edges.csv','w')asf:f.write(edge_buffer.read())Import a graph from OpenCypher-readable filesfromgrand_cypher_ioimportopencypher_buffers_to_graphwithopen('vertices.csv','r')asf:vert_buffer=io.StringIO(f.read())withopen('edges.csv','r')asf:edge_buffer=io.StringIO(f.read())graph=opencypher_buffers_to_graph(vert_buffer,edge_buffer)Usage ConsiderationsEdge addition implies verticesWhen adding an edge to a graph, the vertices of the edge are also added to the graph. This is counter to the behavior of Neo4j imports, but compatible with theGrandgraph library assumptions, and greatly reduces the inner-loop complexity of the import process.Because these implicit vertices have no properties, they are easy to detect and filter out of the graph after importing, if desired.This behavior also means that it is possible to create a full structural graph from a set of edges alone, without any vertices.The__labels__magic attributeFollowing theGrand-Cypherconvention, the__labels__attribute is used to store the labels of a node. This is an iterable of strings. The__labels__attribute is not required, but if it is present, it will be used to populate thelabelsattribute of the node for the purposes of writing to an OpenCypher file.Likewise, the__labels__attribute is used to populate thelabelsattribute of a node when reading from an OpenCypher file.Made with 💙 at
Package: grandiorite
Setuppip install -r requirements.txtRunpython main.pyBuilding and UploadingInstall tools: pyenv for .python-version, and twinepython-mpipinstall--upgradepippipinstalltwinpython3setup.pysdistbdist_wheelpython3-mtwineuploaddist/*[username:__token__,password:<APITOKENFROMPYPI.ORGACCOUNTSETTINGS>]
Package: grandiso
Grand IsomorphismsSubgraph isomorphism is a resource-heavy (but branch-parallelizable) algorithm that is hugely impactful for large graph analysis. SotA algorithms for this (Ullmann, VF2, BB-Graph) are heavily RAM-bound, but this is due to a large number of small processes each of which hold a small portion of a traversal tree in memory.Grand-Isois a subgraph isomorphism algorithm that exchanges this resource-limitation for a parallelizable partial-match queue structure.It performs favorably compared to other pure-python (and even some non-pure-python!) implementations:See thewikifor more documentation.Example Usagefromgrandisoimportfind_motifsimportnetworkxasnxhost=nx.fast_gnp_random_graph(10,0.5)motif=nx.Graph()motif.add_edge("A","B")motif.add_edge("B","C")motif.add_edge("C","D")motif.add_edge("D","A")len(find_motifs(motif,host))Directed graph support:fromgrandisoimportfind_motifsimportnetworkxasnxhost=nx.fast_gnp_random_graph(10,0.5,directed=True)motif=nx.DiGraph()motif.add_edge("A","B")motif.add_edge("B","C")motif.add_edge("C","D")motif.add_edge("D","A")len(find_motifs(motif,host))Counts-onlyFor very large graphs, you may use a good chunk of RAM not only on the queue of hypotheses, but also on the list of results. If all you care about is the NUMBER of results, you should passcount_only=Trueto thefind_motifsfunction. This will dramatically reduce your RAM overhead on higher-count queries.There are many other arguments that you can pass to the motif search algorithm. For a full list, seehere.Hacking on this repoRunning Testscoveragerun--source=grandiso-mpytestCitingIf this tool is helpful to your research, please consider citing it with:# https://doi.org/10.1038/s41598-021-91025-5@article{Matelsky_Motifs_2021,title={{DotMotif: an open-source tool for connectome subgraph isomorphism search and graph queries}},volume={11},ISSN={2045-2322},url={http://dx.doi.org/10.1038/s41598-021-91025-5},DOI={10.1038/s41598-021-91025-5},number={1},journal={Scientific Reports},publisher={Springer Science and Business Media LLC},author={Matelsky, Jordan K. and Reilly, Elizabeth P. and Johnson, Erik C. and Stiso, Jennifer and Bassett, Danielle S. and Wester, Brock A. and Gray-Roncal, William},year={2021},month={Jun}}Made with 💙 at
Package: grandlite
grandliteA SQLite-like tool for querying graphs from the command-line using graph query languages in in-memory Python.Supports out-of-core graphs withGrand.Installation$pipinstallgrandliteUsage$grandlitemy-graph.graphml
>
>match(a)-[]->(b)returna,blimit10ab0023620364605102362043884720236204623363023620962055402362031482050236207552506023620001770702362005531780236204194099023620482511>saveresults.json

>exit()Note thatsave [filename]will outputcsv,json, andjsonlfiles, depending on the extension provided; or will default toresults-XXXX.jsonwith XXX as a timestamp in ISO format, if no filename is provided.Command-line options$grandlite--help
usage:AninteractivegraphquerytoolforCypherandotherquerylanguages.[-h][-o{csv,json,jsonl}][-cCYPHER]graph

positionalarguments:graphThefilenameofthegraphtoload.

options:-h,--helpshowthishelpmessageandexit-o{csv,json,jsonl},--output{csv,json,jsonl}Theoutputformattouse.-cCYPHER,--cypherCYPHERACypherquerytorun.ExamplesNon-interactively query a GraphML file and output the results as JSON$grandlitemy-graph.graphml-c'match (a)-[]->(b) where a.type <> 1 return a,b limit 10'--jsonInteractively query a graph file downloaded from the internet, automatically inferring the file format$grandlitehttps://raw.githubusercontent.com/melaniewalsh/sample-social-network-datasets/master/sample-datasets/quakers/quakers-network.graphml

>match(a)returna,a.sizeaa.size0GeorgeKeith10.01WilliamBradford10.02GeorgeWhitehead10.03GeorgeFox10.04WilliamPenn10.0
........91JosephBesse10.092SamuelBownas10.093SilvanusBevan10.094JohnPenington10.095LewisMorris10.0Made with 💙 at
Package: grandmaster
Grandmaster AIOur mission is to make machine learning & AI accessible to as many developers as possible.Core principlesSimple to use. Get started in minutes, not hours.Zero-config. All models should work out-of-the box.Seamless integration with the Inference API.Installpip install grandmasterUsageSeehttps://grandmaster.aiContributingSeeCONTRIBUTINGLicenseTo be defined, probably MIT or similar.
Package: grangerthings
GrangerThingsDescriptionImplementation of Granger/Causality networks as described in this paper:https://arxiv.org/abs/1406.6651InstallationTODOUsageTODOSupportTODOContributingNot open for public contributions.Authors and acknowledgmentTODOLicenseTODOImplementation choicesTODO: Quickhull choices, word choices/preferences, etc. Things that were underspecified in the paper.Project statusIn development.
Package: granica-sdk
Granica SDKThis SDK provides an authentication solution for programatically interacting with Granica. It wraps the boto3 interface so project wide integration is as easy as refactoringimport boto3toimport granica as boto3.The package affects the signing and routing protocol of the boto3 S3 client, therefore any non S3 clients created through this SDK will be un-affected by the wrapper.PrerequisitesThe minimum supported version of Python is version 3.Installationpython3-mpipinstallgranica-sdkUsageIn order to use this package, you need to set the following environment variables where your application will be runningexportGRANICA_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN>exportGRANICA_REGION=<YOUR_GRANICA_CLUSTER_REGION># Optional if not running on an ec2 instance to force read from a read-replica in this azexportGRANICA_AZ_ID=<AZ_ID>For backwards compatibility, the following environment variables are supportedBOLT_CUSTOM_DOMAIN --> GRANICA_CUSTOM_DOMAIN
BOLT_REGION --> GRANICA_REGION
BOLT_AZ_ID --> GRANICA_AZ_IDIf the region and AZ environment variables aren't specified when running on an EC2 instance, the SDK will use the ec2 metadata api to fetch the instance's region and availability zone id.Example S3 GetObjectimportgranicaasboto3s3_client=boto3.client('s3')s3_client.put_object(Body="data",Bucket="BUCKET_NAME",Key="key")response=s3_client.get_object(Bucket="BUCKET_NAME",Key="key")obj=response['Body'].read()DebuggingImport the default logger and set its level to DEBUGlogging.getLogger().setLevel(logging.DEBUG)TestsBasic integration tests are provided for the modified Session/Client interfaces. They must be run in an environment with a properly configured Granica deployment accessible.python3tests/tests.py
Package: granim
granimAPython Packageto plot graphs using theManimEngine.Project page:https://pypi.python.org/pypi/granimSetupRequirements:System Libraries: Using aptsudoaptinstallsoxffmpeglibcairo2libcairo2-devpycairo: version 1.10.0 or greaterpipinstallpycairotexlive-full: Using aptsudoaptinstalltexlive-fullInstallation:pipinstallgranimQuickstartPlotting from a sample csv file (already present in the package structure):granim-plotdemocsvPlotting a set of points (already defined in the package code):granim-plotdemopointsNote:The package currently supports only these two functions. I plan to include a lot more options and solve a few issues in near future.ContributingContributions are always welcome and credit will be given!:heavy_check_mark: If you wish to add a new feature, open a PR.:bug: If you find a bug, open an issue.:books: Docs contribution are also appreciated!
Package: granita
GranitaA super-simple static site generator, with sensible opinionated defaults.InstallationpipinstallgranitaQuickstartRun the following commands in your terminal, then open the filemy_app/public/index.htmlin your browser.granitainitmy_appcdmy_app
granitabuildWhat this isAt a basic level, you write Markdown in thepagesdirectory, and Granita combines them with HTML templates from thetemplatesdirectory.For example, take the following Markdown:# Hello world!>*I'm learning how to use [Granita](https://github.com/apple-phi/granita)*This would be translated into HTML before being inserted inside the<Content/>element in the template.
By default, if a template is not specified, Granita will try to find and use file calleddefault.htmlin your templates directory.Files listed in thestaticdirectory will be copied as-is to the outputpublicdirectory.FrontmatterTo specify your own parameters, you can use a format called frontmatter. It looks like this:---
title: "My app"template: my_template.html---# Hello world!>*I'm learning how to use [Granita](https://github.com/apple-phi/granita)*titleandtemplateare treated specially by Granita. Here's what they do:titlespecifies the title of the webpage, by creating a<title>element if it doesn't already exist in the template.templatespecifies the HTML template to embed the Markdown in, with the path relative to thetemplatesdirectory.Additionally, the frontmatter keys are treated as CSS selectors for prepending content to the template. So if you had the following frontmatter:---"#my_element":"sometext"---Then the element with the idmy_elementwill have the textsome textprepended inside it.
And this will happen for all elements matched by the CSS selector. For example, if you duplicate the<Content/>tag in the default template generated bygranita initand rebuild, then you will see two copies of the page content.Further configurationIf you are unsatisfied with the default paths and settings, you can create agranita.config.jsonfile to override them. Here's what the default configuration looks like:{"pages":"pages",// path to pages dir"static":"static",// path to static dir"public":"public",// path to output dir"templates":"templates",// path to template dir"default-template":"default.html",// fallback template path"content-selector":"Content",// CSS selector to insert Markdown into"global-stylesheet":null,// a stylesheet to be applied to all templates"extra-data":{}// key : value pairs of CSS selector : HTML data}You don't have to provide customisation for all settings; the defaults will be used if left unspecified.LicenseMIT License, which can be foundhere© Copyright 2021, apple-phi.