Saravanan666/pypi-org huggingface dataset:
Package: graphql-ws-aiohttp
graphql-ws-aiohttpPort ofgraphql-ws-nextforgraphql-core v3.A GraphQL WebSocket server and client to facilitate GraphQL queries, mutations and subscriptions over WebSocket (for Python 3.6+).
This code is based on the current implementation ofsubscriptions-transport-ws.PyPIpip installgraphql-ws-aiohttpSource codehttps://github.com/dls-controls/graphql-ws-aiohttpChangeloghttps://github.com/dls-controls/graphql-ws-aiohttp/blob/master/CHANGELOG.rstGetting StartedStart by installing the package using pip:Or, by using your favorite package manager, likePoetry:WithaiohttpUsage withaiohttpis simple:For other frameworksAdding support for other web frameworks is simple.
A framework must provide a concrete implementation ofgraphql_ws.abc.AbstractConnectionContext, and then it’s ready to use with theSubscriptionServer.UsageUsingapollo-link-wsyou can opt to use websockets for queries and mutations in addition to subscriptions.Use it with GraphiQLLook in thedemo<./demo>_directory to see usage examples for GraphiQL.
Due to the implementation of the javascript client for GraphiQL (GraphiQL-Subscriptions-Fetcher), queries and mutations will not be handled over websocket.ContributingThis project usesPoetry, so to contribute, simply fork and clone this repository, and then set up your virtual environment using:If you don’t yet have Poetry installed, please follow thedocumentation for installation.Code formatting is done viablack, and code should be well-typed usingmypy.LicenseThis package is licensed under the MIT License.
Package: graphql-ws-next
A GraphQL WebSocket server and client to facilitate GraphQL queries, mutations and subscriptions over WebSocket (for Python 3.6+).
This code is based on the current implementation ofsubscriptions-transport-ws.Getting StartedStart by installing the package using pip:Or, by using your favorite package manager, likePoetry:WithaiohttpUsage withaiohttpis simple:For other frameworksAdding support for other web frameworks is simple.
A framework must provide a concrete implementation ofgraphql_ws.abc.AbstractConnectionContext, and then it’s ready to use with theSubscriptionServer.UsageUsingapollo-link-wsyou can opt to use websockets for queries and mutations in addition to subscriptions.Use it with GraphiQLLook in thedemo<./demo>_directory to see usage examples for GraphiQL.
Due to the implementation of the javascript client for GraphiQL (GraphiQL-Subscriptions-Fetcher), queries and mutations will not be handled over websocket.ContributingThis project usesPoetry, so to contribute, simply fork and clone this repository, and then set up your virtual environment using:If you don’t yet have Poetry installed, please follow thedocumentation for installation.Code formatting is done viablack, and code should be well-typed usingmypy.LicenseThis package is licensed under the MIT License.
Package: graphqt
Author : Amit Singh Sansoya (@amit3200)
Github :https://github.com/Amit3200library : graphqt# Import`import graphqt`# Introduction
This is test library for the python which lets you create graph using some functions. This library will allow you to create undirected graphs and also provides some of the other functionalities. This library is for the beginner programmer who wants to get started at the programming with the graphs and want to visualize it easily. It is highly recommended to learn the actual code so that one can implement them without using this library at the interviews, and competition. This library was designed for the programmers who are studying graph currently. This will allow them to have the idea and brute force solution to them which they can further optimize. This libary also allow’s you to do following thingsCreate Graph [Undirected]Detect Cycle [Undirected]Check Path [Undirected]Disconnected Components [Undirected]#   Create Graph### Description:This function allow you to add the edge between two nodes. The use of this function is very simple. One only needs to pass the dictionary so called graph,node u and node v where edge will exist between u and v. Moreover the edge v and u will be automatically created as this is undirected graph.Function Use : insertuv(dictionary_name,node1,node2)
Example : graphqt.insert_uv(d,1,2)
Return Type : None
In above example d is the dictionary (so called graph)#   Detect Cycle### Description:As the name suggests, this function will allow you to detect if there is a cycle in graph Return type is Boolean [True or False] where True tells that graph has cycle and False depicts there is no cycle. This will detect as per the undirected graph.Function use : detect_cycle(dictionary_name)
Example : graphqt.detect_cycle(d)
Return Type : Boolean
In above example d is the dictionary (so called graph)#   Check Path### Description:As the name says this function will tell you if there exists the path between two nodes. One only needs to pass dictionary_name (so called graph), the node u and node v. This function returns boolean value. True if there is path between u and v else FalseFunction use : check_path(dictionary_name,node1,node2)
Example : graphqt.check_path(d,2,8)
Return Type : Boolean
In above example d is the dictionary (so called graph)#   Disconnected Components### Description:As the name says this function will detect the disconnected components and this will return a dictionary having keys as: ‘dis_count’: This will give you the values of count of disconnected components in a graph. If the value returned is 1 then there is no disconnected component. [ Makes Sense ;) ] ‘components’: Gives the list of containing nodes which are connected togetherFunction use : graphqt.get_disconnected_components(d)
graphqt.get_disconnected_components(d)[‘dis_count’]
graphqt.get_disconnected_components(d)[‘components’]
Return Type : Dict# Note##### RememberThis library resembles undirected graph
Also Get the logic behind function that is very important# Do Support Author :
### Amit Singh Sansoya (@amit3200)
### Github :https://github.com/Amit3200## Keep Coding and Smiling
Package: graphq-trans
GraphQ TransGraphQ Trans is a source-to-source compiler that supports the transpilation among multiple graph query languages via a unified intermediate representation. For detailed documentation, please refer to our project websitehttps://github.com/Flitternie/graphq_transDependenciesThis package relies onANTLR4for front-end analysis and has the following dependencies:Python >= 3.6.2ANTLR >= 4.9.2antlr4-python3-runtime >= 4.9.2CitationIf you find our work helpful, please cite it as follows:@article{nie2022graphq,
  title={GraphQ IR: Unifying Semantic Parsing of Graph Query Language with Intermediate Representation},
  author={Nie, Lunyiu and Cao, Shulin and Shi, Jiaxin and Tian, Qi and Hou, Lei and Li, Juanzi and Zhai, Jidong},
  journal={arXiv preprint arXiv:2205.12078},
  year={2022}
}
Package: graph-retrieval-toolkit
Graph MatchingModels UsedSimGNN:Encoder:Inputs: Initial one-hot encoded node embedding matrix $U \in R^{NXD}$Outputs: Aggregated node Embedding Matrix $U \in R^{NXD}$Uses: Neighbour Aggregation with Conv Nets (SAGE, GCN, GAT)Attention Mechanism:Inputs: Node Embedding Matrix $U \in R^{NXD}$Outputs: Attention Weighted Graph Embedding Vector $h \in R^{D}$Uses: Non linear weighted transform ($\tanh$) for context, sigmoid layers for att. weights, $\sum$ aggregate for hGraph Interaction Extraction:Inputs: Graph Embedding Vectors $h_{q}, h_{c} \in R^{D}$Outputs: Interaction Score Vector $g \in R^{K}$, K being the depth of the NTNUses: Neural Tensor NetworkScore Predictor:Inputs: Graph Similarity Score Vector $g \in R^{K}$Outputs: Graph Similarity Score sUses: Fully Connected NetworkGMN Embed:Encoder:Inputs:Initial Node Representation Matrix $U \in R^{NXD}$Initial Edge Representation Matrix $X \in R^{NXN}$Outputs: Encoded Node and Edge Embedding Vectors $H^{0} \in R^{NXD}$ and $E \in R^{NXN}$Uses: Multi Layer Perceptron NetworksPropagation:Inputs: Encoded embeddings $H^{0} \in R^{NXD}$ and $E \in R^{NXN}$
Package: graph-sc
Graph-scThis repository contains the pytorch implementation of the paper "Clustering scRNA-seq data with graph neural networks", by Madalina Ciortan under the supervision of Matthieu Defrance.We propose graph-sc, a method modeling scRNA-seq data as a graph, processed with a graph autoencoder network to create representations (embeddings) for each cell. The resulting embeddings are clustered with a general clustering algorithm (i.e. KMeans, Leiden) to produce cell class assignments.
An extensive experimental study was performed on 24 simulated and 15 real-world scRNA-seq datasets. graph-sc was compared with 11 competing state-of-the-art techniques on 4 clustering scores, reflecting both the external and the internal clustering performance. The results indicate that although there is no consistently best method across all analyzed datasets, graph-sc compared favorably with the competing techniques across all types of datasets. A large ablation study evaluates numerous strategies to create the input graph, the graph autoencoder network and also the clustering phase. The proposed method is stable across consecutive runs, robust to input down-sampling, generally insensitive to changes in the network architecture or training parameters and more computationally efficient than other competing methods based on neural networks. Moreover, modeling the data as a graph provides an increased flexibility to define custom features characterizing the genes, the cells and their interactions as well as the possibility to enrich the graph with external data (i.e. gene correlations).InstallationThe package requires python >= 3.6 and can be installed by running:pip install graph-scTutorialFirst import required libraries:import h5py
import matplotlib.pyplot as plt
import numpy as np
import pkg_resources
import graph_sc.models as models
import graph_sc.train as train

device = train.get_device(use_cpu=True)
print(f"Running on device: {device}")Then load the data to be analyzed. The package provides an example dataset:DATA_PATH = pkg_resources.resource_filename("graph_sc", "data/")
data_mat = h5py.File(f"{DATA_PATH}/worm_neuron_cell.h5", "r")

X = np.array(data_mat["X"])

Y = np.array(data_mat["Y"]) # this is optional
n_clusters = len(np.unique(Y)) # this is required for KMeansRun the model training:scores = train.fit(X, Y, n_clusters, cluster_methods=["KMeans"])
print(scores)Get the resulting embedding:embeddings = scores["features"]This embedding can be used as input to any other downstream task.Plot the latent space and the underlying prediction:pca = PCA(2).fit_transform(embeddings)
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.title("Ground truth")
plt.scatter(pca[:, 0], pca[:, 1], c=Y, s=4)

plt.subplot(122)
plt.title("K-Means pred")
plt.scatter(pca[:, 0], pca[:, 1], c=scores["kmeans_pred"], s=4)
Package: graph-scheduler
Graph SchedulerA graph scheduler generates the order in which the nodes of a directed
acyclic graph (DAG) are executed using the structure of the graph and
expressiveconditions.
Specifically, a scheduler uses a topological ordering of the nodes as a
base sequence of execution and further restricts execution based on
predefined or custom conditions provided by the user. Patterns of
execution are linked to abstract units of time and may optionally be
mapped to real time units usingpint.Documentation is available on github-pagesfor the current
releaseandfor the
current main
branch. For
prior releases, go tohttps://kmantel.github.io/graph-scheduler/tag/<tag_name>.InstallationInstall from pypi:pipinstallgraph-schedulerExampleThe graph is specified here in dependency dictionary format, butnetworkxDigraphs are also
supported.>>>importgraph_scheduler>>>graph={'A':set(),'B':{'A'},'C':{'A'},'D':{'B','C'},}>>>sched=graph_scheduler.Scheduler(graph=graph)>>>sched.add_condition('C',graph_scheduler.EveryNCalls('A',2))>>>sched.add_condition('D',graph_scheduler.EveryNCalls('C',2))>>>print(list(sched.run()))[{'A'},{'B'},{'A'},{'C','B'},{'A'},{'B'},{'A'},{'C','B'},{'D'}]
Package: graphscii
Print ASCII graphs in the terminal.InstallationThe easiest way to install is with pip:sudo pip install graphsciiTo manually install, use:sudo python ./setup.py installUsageTo draw a graph, create a Graph object, add nodes and edges, and invoke thedraw()method:from graphscii import Graph

g = Graph()
g.add_node('n0', pos=[0.1, 0.1])
g.add_node('n1', pos=[0.9, 0.1])
g.add_node('n2', pos=[0.5, 0.9])
g.add_edge('n0', 'n1', label='e0')
g.add_edge('n1', 'n2', label='e1')
g.add_edge('n2', 'n0', label='e2')
g.draw()For more examples, see theexamplesdirectory.
Package: graphsciics
graphsciicsA Python library for ascii-based graphics, with features such as animation and custom shapes as of version 0.0.3.A basic program:from graphsciics.graphsciics import *from graphsciics.animate import *from graphsciics.custom import *canvas = Canvas(1, 1)custom = Custom()custom.build()(this will prompt the user and build a custom shape line by line)rect1 = Rectangle(1, 1, Cursor(0, 0))rect2 = Rectangle(2, 2, Cursor(0, 0))anim = Animation(1)anim.addframe(rect1)anim.addframe(rect2)anim.addframe(custom)canvas.draw(anim)
Package: graphscope-flex
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).  Some useful links: - [GraphScope Repository](https://github.com/alibaba/GraphScope) - [The Source API definition for GraphScope Interactive](https://github.com/GraphScope/portal/tree/main/httpservice)
Package: graphscope-jupyter
graphscope-jupyterThe project structure refers to(ipycytoscape)[https://github.com/QuantStack/ipycytoscape/tree/1.1.0].A widget enabling interactive graph visualization withGraphinin JupyterLab and the Jupyter notebook.InstallationNote that graphscope-jupyter requires jupyterlab 2.x (e.g.,2.3.0a0) and is known unusable with jupyterlab 3.x.Withmamba:mamba install -c conda-forge graphscope-jupyterWithconda:conda install -c conda-forge graphscope-jupyterWithpip:pipinstallgraphscope-jupyterFor jupyterlab users:If you are using JupyterLab 1.x or 2.x then you will also need to installnodejsand thejupyterlab-managerextension. You can do this like so:# installing nodejscondainstall-cconda-forgenodejs# install jupyterlab-manager extensionjupyterlabextensioninstall@jupyter-widgets/jupyterlab-manager@2# if you have previously installed the manager you still to run jupyter lab buildjupyterlabbuildFor Jupyter Notebook 5.2 and earlierYou may also need to manually enable the nbextension:jupyternbextensionenable--py[--sys-prefix|--user|--system]graphscope-jupyterFor a development installation:(requires npm)While not required, we recommend creating a conda environment to work in:condacreate-ngraphscope-cconda-forgejupyterlabnodejsnetworkx
condaactivategraphscope# clone repogitclonehttps://github.com/alibaba/GraphScope.gitcdGraphScope/python/jupyter/graphscope# Install python package for development, runs npm install and npm run buildpipinstall-e.When developing graphscope-jupyter, you need to manually enable the extension with the
notebook / lab frontend. For lab, this is done by the command:# install this extension
jupyter labextension install .For classic notebook, you can run:jupyter nbextension install --sys-prefix --symlink --overwrite --py graphscope-jupyter
jupyter nbextension enable --sys-prefix --py graphscope-jupyterNote that the--symlinkflag doesn't work on Windows, so you will here have to run
theinstallcommand every time that you rebuild your extension. For certain installations
you might also need another flag instead of--sys-prefix, but we won't cover the meaning
of those flags here.You need to install and buildnpmpackages:npm install && npm run buildEvery time you change your typescript code it's necessary to build it again:npm run buildHow to see your changesTypescript:To continuously monitor the project for changes and automatically trigger a rebuild, start Jupyter in watch mode:jupyterlab--watchAnd in a separate session, begin watching the source directory for changes:npmrunwatchPython:If you make a change to the python code then you need to restart the notebook kernel to have it take effect.How to run tests locallyInstall necessary dependencies with pip:cd GraphScope/python/jupyter/graphscope
pip install -e .LicenseWe use a shared copyright model that enables all contributors to maintain the
copyright on their contributions.This software is licensed under the Apache License 2.0. See theLICENSEfile for details.
Package: graphscope-notebook
graphscope-notebookA JupyterLab extension for GraphScopeRequirementsJupyterLab >= 3.0InstallTo install the extension, execute:pipinstallgraphscope-notebookUninstallTo remove the extension, execute:pipuninstallgraphscope-notebookContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the graphscope-notebook directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseDevelopment uninstallpipuninstallgraphscope-notebookIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedgraphscope-notebookwithin that folder.Packaging the extensionSeeRELEASE
Package: graphscraper
GraphScraperGraphScraper is a Python 3 library that contains a base graph implementation designed
to be turned into a web scraper for graph data. It has two major features:1) The graph automatically manages a database (using either SQLAlchemy or
Flask-SQLAlchemy) where it stores all the nodes and edges the graph has seen.2) The base graph implementation provides hook methods that, if implemented,
turn the graph into a web scraper.Yet another graph implementation - whyThere are many excellent graph libraries available for different purposes. I started
implementing this one because i haven’t found a graph library that is dynamic (i don’t
need the whole graph in memory - or on disk - before i start working with it), that
can be used as a web scraper (to seamlessly load nodes and edges from some remote
data source when that piece of data is needed) and that keeps all data (the graph)
automatically up-to-date on the disk. GraphScraper aims to satisfy these requirements.ExamplesBesides the base graph implementation, the following working examples are also included
in the library, that show you how you can implement and use an actual graph scraper:igraphwrapper: Instead of web-scraping, this example is using anigraphgraph
instance as the “remote” source to scrape data from.spotifyartist: This example is using theSpotifyweb API to load artists and
edges are defined by Artist similarity.DependenciesIf you wish to use one of the included graph implementations, then please read the
corresponding module’s description for additional requirements.ContributionAny form of constructive contribution (feedback, features, bug fixes, tests, additional
documentation, etc.) is welcome.
Package: graphsdk
MIT LicenseCopyright (c) [2023] [Ajay Vishwakarma]Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: graphs-for-economics
graphs_for_economicsThis file will become your README and also the index of your
documentation.Installpipinstallgraphs_for_economicsHow to usegraph=Graph_free_market()supply_function=" x**2"demand_function="1000 -  x**2"consumer_surplus=graph.get_consumer_surplus(supply_function,demand_function)print("Consumer Surplus:",consumer_surplus)producer_surplus=graph.get_producer_surplus(supply_function,demand_function)print("Producer Surplus:",producer_surplus)economic_surplus=graph.get_economic_surplus(supply_function,demand_function)print("Economic Surplus:",economic_surplus)Consumer Surplus: 7451
Producer Surplus: 18454
Economic Surplus: 25905graph.market_graph(supply_function,demand_function,0,40,10,complete=True)price=graph.get_price(supply_function,demand_function)quantity=graph.get_quantity(supply_function,demand_function)print(f"Price:{price}, Quantity:{quantity}")Price: 500, Quantity: 22