Saravanan666/pypi-org huggingface dataset:
Package: machine-learning-with-graph
Machine Learning with Graphs LibraryThis Python library offers a comprehensive suite of graph-based machine learning algorithms, designed for ease of use and versatility.FeaturesGraph Neural Networks (GNNs): Includes GCNs, GATs, and more.Graph Clustering Algorithms: Features Spectral Clustering, Louvain method, and others.Graph Embedding Methods: Implements Node2Vec, DeepWalk, etc.Diverse Range of Algorithms: For various graph-based learning tasks.Installationpipinstallmachine_learning_with_graphUsageScripts in the examples folder demonstrate various algorithms' usage.Example to integrate spectral clustering methodimportnetworkxasnxfromnetworkx.generators.communityimportstochastic_block_modelfromml_wg.clustering.spectralimportSpectralClusteringimportnumpyasnp# Create a Stochastic Block Model graphsizes=[15,15,15]# Sizes of each blockp_matrix=[[0.5,0.1,0.05],[0.1,0.5,0.1],[0.05,0.1,0.5]]# Probability matrixG=stochastic_block_model(sizes,p_matrix)# Get the adjacency matrixadj_matrix=nx.to_numpy_array(G)# Apply our spectral clustering librarysc=SpectralClustering(n_clusters=3)clusters=sc.fit_predict(adj_matrix)# Create a color map based on cluster labelscolor_map=['red'ifclusters[node]==0else'blue'ifclusters[node]==1else'green'fornodeinG.nodes()]# Draw the networknx.draw(G,node_color=color_map,with_labels=True,node_size=500,font_size=10)plt.title("Stochastic Block model Graph Visualization")plt.show()Output:TestingRun tests using pytest:pytestContributingContributions are welcome! See CONTRIBUTING.md for guidelines.Developer GuideTo contribute to the project, follow these steps to set up a local development environment:Clone the Repository:gitclonehttps://github.com/susheelg1197/machine-learning-with-graphs-lib.gitcdmachine-learning-with-graphs-libCreate and Activate a Virtual Environment(optional but recommended):python-mvenvvenvsourcevenv/bin/activate# On Windows use venv\Scripts\activateInstall Dependencies:pipinstall-rrequirements.txtMake Changes:Implement new features or fix bugs.Write tests to ensure functionality.Testing:
Add test cases within testing folderpytestCommit Your Changes:gitadd.
gitcommit-m"Your detailed description of changes"Push to Your Fork and Create a Pull Request.Please ensure your code adheres to the project's coding standards and include tests for new features.
Package: machine-number-sense
Machine Number SensePyTorch implementation of neural networks for solving problems from the Machine Number Sense (MNS) dataset[1].
Dataset and official implementation of baseline models can be found inthis repo, created by paper authors.Setup$pipinstallmachine_number_senseUsageBaseline modelsMLP[1]:importtorchfrommns.modelimportConvMLPx=torch.rand(4,3,80,80)mlp=ConvMLP(image_size=80)logits=mlp(x)logits# torch.Tensor with shape (4, 99)LSTM[1]:importtorchfrommns.modelimportConvLSTMx=torch.rand(4,3,80,80)lstm=ConvLSTM(image_size=80)logits=lstm(x)logits# torch.Tensor with shape (4, 99)Experimental modelsScattering Compositional Learner (SCL)[2]adapted to problems from the MNS dataset:importtorchfrommns.modelimportSCLx=torch.rand(4,3,80,80)scl=SCL(image_size=80)logits=scl(x)logits# torch.Tensor with shape (4, 99)Implementation of SCL for solving Raven's Progressive Matrices can be found inthis repo.Neural Arithmetic Logic Unit (NALU)[3]adapted to MNS:importtorchfrommns.modelimportConvNALUx=torch.rand(4,3,80,80)nalu=ConvNALU(image_size=80)logits=nalu(x)logits# torch.Tensor with shape (4, 99)DatasetThe MNS dataset can be obtained as describedin this repo.
After downloading, it can be loaded with:frommns.datasetimportMNSDatasetdataset=MNSDataset(data_dir='/path/to/dataset',image_size=80)iterator=iter(dataset)image,target=next(iterator)image# torch.Tensor with shape (3, 80, 80)target# torch.Tensor with shape ()TrainingFilemns.modulecontains aPyTorch Lightningmodule for training models on MNS.
Training can be run with Docker using scripts from thescripts/directory.Unit tests$python-mpytesttestsBibliography[1]Zhang, Wenhe, et al. "Machine number sense: A dataset of visual arithmetic problems for abstract and relational reasoning." Proceedings of the AAAI Conference on Artificial Intelligence. 2020.[2]Wu, Yuhuai, et al. "The Scattering Compositional Learner: Discovering Objects, Attributes, Relationships in Analogical Reasoning." arXiv preprint arXiv:2007.04212 (2020).[3]Trask, Andrew, et al. "Neural arithmetic logic units." Advances in Neural Information Processing Systems. 2018.Citations@inproceedings{zhang2020machine,title={Machine number sense: A dataset of visual arithmetic problems for abstract and relational reasoning},author={Zhang, Wenhe and Zhang, Chi and Zhu, Yixin and Zhu, Song-Chun},booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},volume={34},number={02},pages={1332--1340},year={2020}}@article{wu2020scattering,title={The Scattering Compositional Learner: Discovering Objects, Attributes, Relationships in Analogical Reasoning},author={Wu, Yuhuai and Dong, Honghua and Grosse, Roger and Ba, Jimmy},journal={arXiv preprint arXiv:2007.04212},year={2020}}@inproceedings{trask2018neural,title={Neural arithmetic logic units},author={Trask, Andrew and Hill, Felix and Reed, Scott E and Rae, Jack and Dyer, Chris and Blunsom, Phil},booktitle={Advances in Neural Information Processing Systems},pages={8035--8044},year={2018}}
Package: machineop
The machine operator package runs state machines based on the below meta-model:StateMachine:
    'events'
        events+=Event
    'end'

    'commands'
        commands+=Command
    'end'

    ('commandgroups'
        commandGroupBlocks+=CommandGroupBlock        
    'end')? 

    states+=State
;

Keyword:
    'end' | 'events' | 'state' | 'actions' | 'commandgroups' | 'group' | 'groupend'
;

Event:
    name=SMID code=ID
;

Command:
    name=SMID code=ID
;

CommandGroupBlock:
    'group' name=SMID
        groupCommands+=[Command|SMID]       
    'groupend'
;

GroupOrCommand: Command | CommandGroupBlock;

State:
    'state' name=ID
        ('actions' '{' actions+=[GroupOrCommand | SMID] '}')?
        (transitions+=Transition)?
    'end'
;

Transition:
    event=[Event|SMID] '=>' to_state=[State]
;

SMID:
    !Keyword ID
;

Comment:
    /\/\*(.|\n)*?\*\//
;The package will run a basic microwave oven as the default state machine. The default microwave oven has only 2 functionalities: baking and cleaning. This is a very legacy oven, because of which the cleaning is not timer controlled. You have to manually turn off the cleaning.To run the oven as a state machine, execute the commandmachineop. If you want to execute a different state machine other than the default one, you can pass the path to the state machine file (with .pymo extension) to the package via the-mflag.machineop -m <PATH-TO_CUSTOM_STATE_MACHINE>To define a custom interpreter to the state machine model, you can pass the python interpreter using the-iflag.machineop -i <PATH-TO_CUSTOM_INTERPRETER>If you want to get even more creative, you can specify your custom meta-model as well using the-tflag.machineop -t <PATH-TO_CUSTOM_META_MODEL>Connecting all together, you can have your own completely customized textx setup using your own custom meta-model, model and interpreter.machineop -m <PATH-TO_CUSTOM_STATE_MACHINE> -i <PATH-TO_CUSTOM_INTERPRETER> -t <PATH-TO_CUSTOM_META_MODEL>
Package: machinepy
machinePy 2.0Welcome to machinePy, the worlds most user-friendly machine learning neural network library!To learn how to use it, visitmachinePy, where you'll find everything you need to start including detailed examples.Quick rundownfoo = initnet(network_structure)Use this function to declare your neural network structure and assign random weights and biases. It takes an array of integers. The first element determines the amount of inputs and the last element determines the amount of outputs. Every element in between represents a hidden layer with the integer value as the amount of neurons in that particular hidden layer.foo = forward(inputs, weights)This is the forward propagation function. It takes two arguments, an array of inputs, and an array of weights, which is the output ofinitnet.foo = train(inputs, weights, targets, learning_rate)This is the implementation of the infamous backpropagation. It takes four arguments, an array of inputs, an array of weights, again in the form ofinitnet, an array of target outputs, and an optional learning rate value, otherwise assigned 0.1.Exampleimport machinepy as mp

inputs = [[0,0],[0,1],[1,0],[1,1]]
outputs = [[1],[0],[0],[1]]
weights = mp.initnet([2,3,1])

epochs = 10000

i = 0
j = 0 
while(i < len(inputs)*epochs):
	weights = mp.train(inputs[j],weights,outputs[j],0.1)
		if(j==3):
			j = 0
		else:
			j+=1
		i+=1

i = 0
while i < len(inputs):
	foo = mp.forward(inputs[i],weights)
	print(foo)
	i+=1
Package: machine-py
MachinePyA python library based on NumPy, SymPy, Matplotlib.IntroductionThe package has been written in for supervised, unsupervised and semi-supervised machine learning algorithms. All the major basic and advanced machine learning algorithms are written for clustering, rergression, classificaton, dimensionalty reduction problems. Aim of the project is purely educational and it was considered to be optimal while writing.FunctionalityCurrently, the release contain several models for the above stated functions. The structure of the proect is as follows:Clustering:K-Means,(K-means++),K-Median,(K-Median++),Heirarchical,Mean-Shift,Fuzzy C-Mean,Gaussian Mixture ModelsandSpectral Clustering.Regression:Linear Regreession,Linear Regresson L2 regularised,Linear Regression L1 Regularised,Linear regression L1,L2 Regularised,MLE Linear Regression,Bayesian Ridge Regression,Gaussian Processes,RANSAC,Nadaraya Watson Regression,Local Regression,KNN Regression,Perceptron/ADALINE Regression,Chebyshev-FLNN,Legendre-FLNN,Laguerre-FLNNandRadial Basis Function Neural Net.Classification:K-Nearest Neighbors,Logistic Regression,Logistic Regression L2 Regularised,Logistic Regression L1 Regularised,Logistic Regression L1 L2 Regularised,Linear Discriminant Analysis,Quadratic Discriminant Analysis,Naive Bayes,SVM,PerceptronandRBF Neurl Network.Dimensionality Reduction:Principal Component Analysis (PCA),Probabilistic PCA,Random Projection,classical Multi-Dimension Scaling(cMDS),LDA,Kernel PCA,Kernel LDA,IsomapandDiscriminant Neighborhood Embedding (DNE).Semi-Supervised Clustering:Constrained K-means,Seed K-meansandCOP K-means.Semi-Supervised Regression:Co-Training Regression.Semi-Supervised Classification:Pseudo Labelling,Cluster & Label,Self TrainingandCo-Training.Semi-Supervised Dimensionality Reduction:SSDR-M, SSDR-CM & SSDR-CMUandSSDR-Manifold.InstallationSoon to be available thorugh PIP install.ContributorPrashant Lawhatre and Pranay LawhatreLicenseBSD 3-Clause License
Package: machines
A sample project that exists as an aid to thePython Packaging User Guide’sTutorial on Packaging and Distributing
Projects.This projects does not aim to cover best practices for Python project
development as a whole. For example, it does not provide guidance or tool
recommendations for version control, documentation, or testing.This is the README file for the project.The file should use UTF-8 encoding and be written using ReStructured Text. It
will be used to generate the project webpage on PyPI and will be displayed as
the project homepage on common code-hosting services, and should be written for
that purpose.Typical contents for this file would include an overview of the project, basic
usage examples, etc. Generally, including the project changelog in here is not
a good idea, although a simple “What’s New” section for the most recent version
may be appropriate.
Package: machine-signals
Signal CreatorThis is the signal creator Package developed by Camilo Rey, to
create periodic signals that areflavoredby stochastic noise andperturbationsfollowing a deceptively simple mathematical model.There are two main components in this package (i.e. sub-packages). Thefunctionspackage where the basic signal functions are located
(i.e. periodic functions and gaussian noise) to create signals that
can be sampled (automatically to 100 points), and theperturbationsubpackage that allows us to extend a base classPerturbationto
mess basic harmonic signals.This readme was created using theGithub-flavored Markdown.
Package: machine-stats-alpha
Machine Stats AlphaWarning: This is not a stable release!A simple and effective way to gather machine statistics (RAM, Storage, CPU)
from a server environment as a first layer of aTidal Migrations discovery
process.Machine Stats alpha only works with Ubuntu distributions. To use machine stats with other distributions, please checkout the stable version ofmachine-stats.InstallationInstall locally in a Python 3 environment:python3-mpipinstallmachine-stats-alphaSupported distributionsUbuntu with Python 3.x
Package: machinetalk-protobuf
machinetalk-protobufProtobuf declarations for machinekit messagesThis repo is integrated into github.com/machinekit/machinekit as a git subtree.To change/add to message definitions:send a PR against this repoadd a new remote in your machinekit repo referring to hereupdate the subtree in your machinekit repo like sogit remote add machinetalk-protobuf git://github.com/machinekit/machinetalk-protobuf.git
git fetch machinetalk-protobuf
git subtree merge --prefix=src/machinetalk/proto machinetalk-protobuf/master --squashNow create a PR against the machinekit repo.PythonInstallation via PyPiTo use the Machinetalk protobuf Python modules in your projects, use:pipinstallmachinetalk-protobufInstallation from sourceAlternatively you can install the Python modules directly from the source code.make
pythonsetup.pybuild
sudopythonsetup.pyinstallUsageSeeexamples.JavaScript (NPM/NodeJS)InstallationTo use machinetalk protobuf definitions in your npm-based projects, use:npminstall--savemachinetalk-protobufUsageSeeexamples. If you want to try these examples, be sure to first runnpm installin this repository.EncodingvarmachinetalkProtobuf=require('machinetalk-protobuf');varmessageContainer={type:machinetalkProtobuf.message.ContainerType.MT_PING};varencodedMessageContainer=machinetalkProtobuf.message.Container.encode(messageContainer);This results in a buffer that starts with0x08 0xd2 0x01.DecodingvarmachinetalkProtobuf=require('machinetalk-protobuf');varencodedBuffer=newBuffer([0x08,0xd2,0x01]);vardecodedMessageContainer=machinetalkProtobuf.message.Container.decode(encodedBuffer);This results in a messageContainer like the one defined inEncoding.JavaScript (Browser)CDN usage<scriptsrc="//cdn.rawgit.com/machinekit/machinetalk-protobuf/VERSION/dist/machinetalk-protobuf.js"></script>WithVERSIONreplaced bya valid tagor justmasterfor testing
the latest master build.EncodingvarmessageContainer={type:machinetalk.protobuf.message.ContainerType.MT_PING};varencodedMessageContainer=machinetalk.protobuf.message.Container.encode(messageContainer);This results in a buffer that starts with0x08 0xd2 0x01.DecodingvarencodedBuffer=newArrayBuffer([0x08,0xd2,0x01]);vardecodedMessageContainer=machinetalk.protobuf.message.Container.decode(encodedBuffer);This results in a messageContainer like the one defined inEncoding.
Package: machine-usage
Machine UsageA simple command-line interface that gives an overview of the available resources on our local cluster.Machine_usage is build usingTextualas the TUI framework.
This framework is still a work in progress and currently runs on onlyMacOS / Linux. Windows support is in the pipeline.Always happy to hear about any bugs or suggested improvements.Quick startInstall and run withpip install machine_usage
machine_usageFor all options, seemachine_usage --helpUsage: machine_usage [OPTIONS]

  Command line tool to display the current usage of machines on our local
  cluster.

Options:
  --version       Show the version and exit.
  --machine TEXT  (WORK IN PROGRESS) Display load on specific machine.
  --cluster       Overview of the cluster usage.
  --help          Show this message and exit.TODOAdd GPU usage informationMake independent of user profileMake functional outside of local network
Package: machine-web
MachineA very simple web framework implemented in Python.The core idea of this framework areplugins.
Plugins could be found everywhere throughout the framework.
Plugin itself is simple - it's just an asynchronous generator that yields a tuple ofConnectionandParameters.The simplest possible plugin just yields its arguments:asyncdefsimple_plugin(conn,params):yieldconn,paramsInstallationTo install Machine, just typepip install machine-webin your console.
Package: macho_analysis
MachoAnalysisis a collection of utils written in python2 to help
developers analysis Mach-O Binaries.At this time,it can help us to
figure out which module call some target functions,and the dependencies
between the modules in a binary.UseAgeTo figure out which module call some target functions,you can do
this in your python script:importmacho_analysis;module_array=macho_analysis.utils.findCallingSymbolModule("_NSLog","linkmap_path","disassemblyfile_path")];ThefindCallingSymbolModulefunction take three arguments,which are
the name of the symbol(in this case,is the _NSLog),the path to the
linkmap file which is generated by xcode, and the path to disassembly
code file generated by otool(otool -t -V -arch [arch] [macho_path])
util in xcode app.It returns an array contains the name of all the
modules that call the symbol.To find the dependencies between the modules,you can do this in your
python script:importmacho_analysis;lib_dep_hash=macho_analysis.utils.findDependency(lib_path_array,'armv7');ThefindDependencyfunction takes two arguments,the first is an array
contains the paths to the libs,and the second is the arch name which
will be passed to the nm utils in the xcode.It returns a dictionary,the
key is the lib name,and its value is also a dictionary,which map the
lib’s undefined symbol to the module that defines it.PrerequisitesWe need xcode to run this tool.
Package: machobot
A Python toolbox for Mach-O files analysis. Heavily relies onmacholib.InstallationFor usage$ [sudo] pip install machobotFor development$ pip install nose macholib
$ git clone https://github.com/rodionovd/machobot.git machobot
$ cd ./machobot
$ nosetests # run the test suiteUsageAs a command-line util:$inject_dylib./target"@rpath/mylib.dylib"As a Python module:importmachobotExample usage:importmachobot.dylibasdylibdylib.insert_load_command("output.a","@executable_path/../../libk.dylib")Modulesdylibinsert_load_command(target_path,library_install_name)Inserts a newLC_LOAD_DYLIBload command into the target Mach-O
header.ArgumentDescriptiontarget_pathA path to the target Mach-O executable file.This file will be overwritten.library_install_nameAn install name for the library to inject. This string is used as a part of the load command.Return valueReturnsTrueif everything is OK. Otherwise rises an exception.macho_dependencies_list(target_path,header_magic=None)Generates a list of libraries the given Mach-O file depends on.In that list a single library is represented by its “install path”: for some
libraries it would be a full file path, and for others it would be a relative
path (sometimes with dyld templates like @executable_path or @rpath in it).Note: I don’t know any reason why would some architectures of a fat Mach-O depend
on certain libraries while others don’t, butit’s technically possible.
So that’s why you may want to specify theheader_magicvalue for a particular header.ArgumentDescriptiontarget_pathA path to the target Mach-O executable file.header_magicMach-O MAGIC value for a header you want to inspect. If this argument is not provided, the
function returns a list of the first header’s dependencies.Return valueAn object with two properties:weakandstrongthat hold lists
of weak and strong dependencies respectively.Seemachobot/tests/test_dylib.pyfor usage examples.Found an issue? Submit an issue! :shipit:
Package: mach.py
Magical Argparse Command HelperFeaturesGet your CLI interfaces quicklyTurn a simple class to a CLI application or an interactive interpreter.Given:classCalculator:defadd(self,a,b):"""adds two numbers and prints the result"""returna+bdefdiv(self,a,b):"""divide one number by the other"""returna/bYou can make command line application using the decoratormach1:frommachimportmach1@mach1()classCalculator:defadd(self,int:a,int:b):"""adds two numbers and prints the result"""print(a+b)defdiv(self,int:a,int:b):"""divide one number by the other"""print(a/b)calc=Calculator()calc.run()Now if you run the module, you will get a program that you can invoke with
the flag-hor--help:$pythoncalc.py-husage:calc.py[-h]{add,div}...positionalarguments:{add,div}commandsaddaddstwonumbersandprintstheresultdivdivideonenumberbytheotheroptionalarguments:-h,--helpshowthishelpmessageandexiteach method is a subcommand, with type checking and it’s own very help.
Hench, this won’t work:$pythoncalc.pyaddfoobarusage:calc.pyadd[-h]bacalc.pyadd:error:argumentb:invalidintvalue:'foo'And this will:$pythoncalc.pyadd4913To see the help of the subcommand use-h:$pythoncalc.pyadd-husage:calc.pyadd[-h]bapositionalarguments:baoptionalarguments:-h,--helpshowthishelpmessageandexitWith the help of the decoratormach2you can turn your class to CLI
application and have also an iteractive shell which invoke when no
parameters are given:$./examples/calc2.pyWelcometothecalcshell.Typehelpor?tolistcommands.calc2>?Documentedcommands(typehelp<topic>):========================================adddivexithelpcalc2>helpaddaddstwonumbersandprintstheresultcalc2>add246calc2>div623.0calc2>exitComebacksoon...$InstallationYou can get mach from PyPI using pip:$ pip install mach.py
Package: macht
A2048clone in python with Terminal UIInstallUsing thepippackage manager:pip install machtOr:python ./setup.py installPlaymachtOr without installing (in the project directory):python -m machtUse either the arrow keys, thewasdkeys, or thehjklkeys to move the tiles.OptionsSpecify the board size:macht 5x5Play on multiple grids simultaneously:macht 3x3 3x3 3x3Play with a different base number:macht --base 3Continue where the last game stopped (takes an optional file to resume from/save to):macht -rmacht 5x5 --resume '~/.local/share/macht/5x5.json'To display a help message use the-h/--helpoption.Dependenciesblessed– Used as a general abstraction on terminal input and output.enum package– Enumerations for python. Included with python3.4, older python versions need to use theenum34package.