Saravanan666/pypi-org huggingface dataset:
Package: memorywrap
DescriptionMemory Wrap is an extension to image classification models that improves both data-efficiency and model interpretability, adopting a sparse content-attention mechanism between the input and some memories of past training samples.InstallationThis is a PyTorch implementation of Memory Wrap. To install Memory Wrap run the following command:pip install memorywrapThe library contains two main classes:MemoryWrapLayer: it is the Memory Wrap variant described in the paper that uses both the input encoding and the memory encoding to compute the output;BaselineMemory: it is the baseline that uses only the memory encoding to compute the output.UsageInstantiate the layermemorywrap=MemoryWrapLayer(encoder_output_dim,output_dim,classifier=None,distance='cosine')or, for the baseline that uses only the memory to output the prediction:memorywrap=BaselineMemory(encoder_output_dim,output_dim,classifier=None,distance='cosine')whereencoder_output_dim(int) is the output dimension of the last layer of the encoderoutput_dim(int) is the desired output dimensione. In the case of the paperoutput_dimis equal to thenumber of classes;classifier (torch.nn.Module): Classifier on top of MemoryWrap. Inputs dimensions must be equal at encoder_output_dim*2 for MemoryWrapLayer and encoder_output_dim for BaselineMemory. By default is an MLP as described in the paper. An alternative is to use a linear layer. (e.g. torch.nn.Linear(encoder_output_dim*2, output_dim). Default: torch.nn.Sequential( torch.nn.Linear(encoder_output_dim*2, encoder_output_dim*4), torch.nn.ReLU(),            torch.nn.Linear(encoder_output_dim*4, output_dim)distance (str): Distance to use to compute the similarity between input and memory set. Allowed values are: cosine, l2 and dot for respectively cosine similarity, l2 distance and dot product distance. Default=cosineForward callAdd the forward call to your forward function.output_memorywrap=memorywrap(input_encoding,memory_encoding,return_weights=False)whereinput_encodingandmemory_encodingare the outputs of the the encoder of rispectively the current input and the memory set.The last argument of the Memory Wrap's call function is a boolean flag controlling the number of outputs returned. If the flag is True, then the layer returns both the output and the sparse attention weight associated to each memory sample; if the flag is False, then the layer return only the output.Additional informationHere you can find link to additional source of information about Memory Wrap:PaperGitHub repoJupyter notebook
Package: memorywrapper
memorywrapperMemoryWrapperprovides a slice-able front-end for a list of non-continuous memory backends, and only
joins the needed area into abytesobject as needed.It uses the new__buffer__protocol that is implementable in python starting withpython 3.12.Installingpip install memorywrapperUsing>>>frommemorywrapperimportMemoryWrapper>>>importstruct>>>memory=MemoryWrapper([b"\x01\x02\x03",bytes([4,5,6])])>>>part=memory[1:-1]>>>(value,)=struct.unpack(">I",part)>>>f"0x{value:08x}"'0x02030405'make_slicesmake_slicesprovides a way to cut something like bytes, memoryview, or memorywrapper into equal-sized chunks.>>>frommemorywrapperimportmake_slices>>>list(make_slices([1,2,3,4,5,6,7,8,9],3))[[1,2,3],[4,5,6],[7,8,9]]
Package: memosa
Memosa: Serve cold==========================Behold, the power of Memosa:from memosa import memoize1
from memosa.json import context
import requests

@memoize1
def getTodo(id):
    url = 'https://jsonplaceholder.typicode.com/todos/%s' % id
    return requests.get(url).json()

with context('todos.json'):    
    print(getTodo(1))
    print(getTodo(2))Featuresmemoization decoratorspersistent cache contextMemosa officially supports Python 3.6 & 3.7.InstallationTo install Memosa, simply use pip:$ pip install memosaDocumentationcheck out theexamples
Package: memos-cli
Memos CLITo use this cli, you must have a self-hosted✍️memosserver set up and running.AboutMemos CLI is a third-party client for✍️memosand both projects aren't affiliated with each other.InstallationInstall from pip:$ pip install memos-cliUsageSign in your account$ memos auth signinList your memos$ memos listCreate a new memo$ memos newRunmemos --helpto see all available commands.ConfigurationAll configs are stored in$HOME/.memos.json.text-editor: the text editor used to visualize and edit memos. If it is not specifiedviwill be used.LicenseThis project is made available under the GNU General Public License v3.
Package: memote
Our goal in promoting this tool is to achieve two major shifts in the metabolic
model building community:Models should be version-controlled such that changes can be tracked and if
necessary reverted. Ideally, they should be available through a public
repository such as GitHub that will allow other researchers to inspect,
share, and contribute to the model.Models should, for the benefit of the community and for research gain, live
up to certain standards and minimal functionality.TheMEMOTEtool therefore performs four subfunctions:Create a skeleton git repository for the model.Run the current model through atest suite that represents the community
standard.Generate an informative report which details the results of the test suite in
a visually appealing manner.(Re-)compute test statistics for an existing version controlled history of
a metabolic model.And in order to make this process as easy as possible the generated repository
can easily be integrated with continuous integration testing providers such as
Travis CI, which means that anytime you push a model change to GitHub, the test
suite will be run automatically and a report will be available for you to look
at via GitHub pages for your repository.Documentation:https://memote.readthedocs.io/.InstallationBefore installingMEMOTE, please make sure that you have correctly installed the
latest version ofgit.Moreover, we highly recommend creating a Python virtualenv for your model
testing purposes.To installMEMOTE, run this command in your terminal:$pipinstallmemoteThis is the preferred method to installMEMOTE, as it will always install the
most recent stable release.ContactFor comments and questions get in touch viaourgitter chatroomor open aGitHub issue.Are you excited about this project? Considercontributingby adding novel
tests, reporting or fixing bugs, and generally help us make this a better
software for everyone.CopyrightCopyright (c) 2017, Novo Nordisk Foundation Center for Biosustainability,
Technical University of Denmark.Free software:Apache Software License 2.0CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.Memoterelies onclickfor the command line interface,pytestfor unit
and model tests,gitpythonfor interacting with git repositories,pandasfor tabular datastructures and data input,jinja2for interacting
with HTML templates,cobrapyfor analysing genome-scale metabolic
models,python_libsbmlfor reading and writing Systems Biology Markup
Language (SBML),ruamelfor handling YAML generation,travispyandtravis-encryptfor interacting with Travis CI,pygithubfor access to the
Github API,sympyfor matrix calculations,sqlalchemyfor managinghistoryresults,numpydocfor beautifully formatted doc strings usingsphinx,pylrufor caching,goodtablesfor validation of tabular data,depinfofor pretty printing our dependencies,sixandfuturefor backward
and forward compatibility.The Memote Report App user interface is built withAngular 5,Angular Flex-Layout, andAngular Material. We rely onTauchartsfor plotting
results.The initial development ofMEMOTEhas received funding from:
Package: mem-package
The Version 0.3 add four Functions for computing diffs into the tools modules.It also remove support for Python 2.2.The mem package is a set of extension modules which allow to work on objectsmemory from Python code. The package contains:- an object which allow to manage mallocated chunks of memory as amutable sequence of bytes.- a set of functions which work on any objects which define the bufferAPI: memcopy, index, memlen, memcmp ...- a reimplementation of the buffer() built-in object which shouldcorrect it's most annoying problems.It contains also some pure Python modules:- an adapter which provide the file interface to any object whichdefine the buffer API.- an other adapter for the array interface.
Package: mempass
MempassSimple memorizable password generatorSeehttp://xkcd.com/936/Adapted fromhttps://github.com/jesterpm/bin/blob/master/mkpasswdpipinstallmempasson the command line$mempass4password:celeriacwaggableendossoxytociascore:Strong!(4)in python>>>frommempassimportmkpassword>>>password=mkpassword(4)>>>print(password)celeriacwaggableendossoxytociaor>>>frommempassimportPasswordGenerator>>>pwgen=PasswordGenerator(nwords=4)>>>print(pwgen.password)celeriacwaggableendossoxytocia>>>print(pwgen.score)4>>>print(pwgen.warning)"">>>print(pwgen.suggestions)""
Package: memproc
memproc✨ Fancy display of memory usage.AimThis tool lets you show all processes in your system (likeps aux) including memory usage with a fancy display and a bunch of command line options.RSSis the chosen memory metric.Installation$pipinstallmemprocUsageUsage: memproc [OPTIONS]--version                            Show installed version.--update                             Update memproc to last version.--sort              -s      TEXT     Sort results by criteria (m:mem, p:pid, d:description). [default: m]--sort-reverse      -r               Sort reverse by current criteria.--description       -d      TEXT     Process description (n:name, e:executable, c:command line). [default: n]--show-total        -t               Show total used memory.--units             -u      TEXT     Memory units (k:KB, m:MB, g:GB). [default: m]--num-processes     -n      INTEGER  Limit the number of processes shown. [default: 0]--grouped                            Group process by description.--greater-than      -g      FLOAT    Show processes with used memory greater than this value. [default: 0]--lower-than        -l      FLOAT    Show processes with used memory lower than this value. [default: 17179869184]--find-description  -f      TEXT     Find processes with text by the chosen description criteria.--no-color                           Disable output coloring.--help                               Show this message and exit.Get version$memproc--versionUpdate tool$memproc--updateUse casesShow all processes with the total amount of used memory:$memproc-tSort results by pid with processes greater than 10MB and less than 100MB:$memproc-sp-g10-l100-umShow grouped Firefox processes sorted by command line:$memproc--grouped-ffirefox-sd-dcShow the top 20 most memory consuming processes with KB units:$memproc-n20-ukShow processes (sorted reverse memory used) with executable as description and GB units:$memproc-de-ug-rColorBy default, processes are classified in 4 groups with regards to the maximum amount of memory usage. Each group is shown with colors: green, yellow, orange and red.Output coloring can be disabled as follows:$memproc--no-colorPagerYou can usememprocwith your favourite pager:$memproc|less
Package: memprof
memprofis a memory profiler for Python.It logs and plots the memory usage of all the variables during the
execution of the decorated methods.InstallationStablesudo pip install --upgrade memproforsudo easy_install --upgrade memprofor (Debian testing/unstable)sudo apt-get install python-memprofDevelopmentgit clone git://github.com/jmdana/memprof.git
cd memprof
sudo python setup.py installorsudo pip install git+https://github.com/jmdana/memprofUsageUsingmemprofis as easy as adding a decorator to the methods that
you want to profile:@memprof
def foo():And importing the module just by including the line below at the
beginning of your Python file:from memprof import memprofNow you can run as usual and logfiles with the names of your methods
will be created (e.g.foo.log).Generating plotsThe logfiles are not very interesting so you might prefer to use the-p/--plotflag:python -m memprof --plot <python_file>
python -m memprof -p <python_file>Which, in addition to the logfile, will generate a plot (foo.png):The grey bar indicates that thefoomethod wasn’t running at that
point.The flag may also be passed as an argument to the decorator:@memprof(plot = True)Please keep in mind that the former takes precedence over the latter.Adjusting the thresholdYou may also want to specify athreshold. The value will be the
minimum size for a variable to appear in the plot (but it will always
appear in the logfile!). The default value is 1048576 (1 MB) but you can
specify a differentthreshold(in bytes) with the-t/--thresholdflag:python -m memprof --threshold 1024 <python_file>
python -m memprof -t 1024 <python_file>Thethresholdmay also be passed as an argument to the decorator:@memprof(threshold = 1024)Please keep in mind that the former takes precedence over the latter.mp_plotIf, after runningmemprof, you want to change the threshold and
generate a new plot (or you forgot to use the-p/--plotflag
withmemprof), you don’t have to re-run! Just call the command:mp_plot [-h] [-t THRESHOLD] logfiles [logfiles ...]and generate the plots again doing something like:mp_plot -t 128 logfile1.log logfile2.logor:mp_plot -t 1024 *.logetc.ContactMailing listSubscribe by sending a message tomemprof+subscribe@googlegroups.comOnce subscribed, you can send emails tomemprof@googlegroups.comList archives athttp://groups.google.com/group/memprofCopyright 2013-2019, Jose M. Dana
Package: memprofiler
memprofilermemprofiler is a simple extension for monitoring memory usage of Jupyter notebook cells.InstallationIt can be installed as a typical Python source package from PyPi using pip:pip install memprofilerUsageA basic example of how to use this extension can be found inthis interactive Jupyter notebook.Referencemprof_run%mprof_run [-q] [-i INTERVAL] [-p] [profile_id]Run memory profiler during cell execution. (cell_magic)positional arguments:profile_idProfile label. You can specify up to two keywords by separating them
with :: (keyword0::keyword1).
Only profile_ids with two keywords can be used in plot-related
functions.optional arguments:-q,--quietSuppress verbosity.-i INTERVAL,--interval INTERVALSampling period (in seconds), default 0.01.-p,--plotPlot the memory profile.mprof_plot%mprof_plot [-t TITLE] [--groupby {0,1}] profile_ids [profile_ids ...]Plot detailed memory profiler results. (line_magic)positional arguments:profile_idsProfile identifiers made by mprof_run. Supports regex.optional arguments:-t TITLE,--title TITLEString shown as plot title.--groupby <{0,1}>Identifier number used to group the results, default 1.mprof_barplot%mprof_barplot [-t TITLE] [--variable {time,memory}]
[--barmode {group,stack}] [--groupby {0,1}]
profile_ids [profile_ids ...]Plot only-memory or only-time results in a bar chart. (line_magic)positional arguments:profile_idsProfile labels made by mprof_run. Supports regex.optional arguments:-t TITLE,--title TITLEString shown as plot title.--variable <{time,memory}>Variable to plot, default 'memory'.--barmode <{group,stack}>Bar char mode, default 'group'.--groupby <{0,1}>Identifier number used to group the results, default 1.ContributingContributions are what make the open source community such an amazing place to be learn,
inspire, and create. Any contributions you make aregreatly appreciated!Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull RequestLicenseDistributed under the BSD 3-Clause License.
SeeLICENSEfor more information.Acknowledgements@FrancescAlted
Package: memrise_audio_uploader
Memrise audio uploaderA command-line tool to upload text-to-speech audio to Memrise courses. Audio is generated using Google Text-to-Speech synthesizator.InstallationThe tool can be installed using Pip with the following command:pipinstallmemrise-audio-uploaderAfter installation you can start the tool using Python:python-mmemrise_audio_uploaderUsageYou can input your Memrise credentials when prompted in the command line or alternatively you can define them in a dotenv file. SaveMEMRISE_USERNAMEand/orMEMRISE_PASSWORDto a.envfile in your current folder.You will need access to a Google Cloud project with Google Cloud Text to Speech API enabled. The application uses default credentials for accessing Google Cloud. For more information, see:Getting started with Cloud SDKCloud SDK Application Default CredentialsCloud Text-to-Speech - Quickstart
Package: memspector
Inspect memory usage of python functionsFeaturesThread handlingExternal tool, doesn’t require code modificationCheckmemspector--helpfor command line optionsInstallationvia pip:pip install memspectorExampleexample.py:l=[]defa():l.extend(range(100000))defb():globalll=[]a()a()b()a()b()a()Runmemspector example.pyto get the following output:example.py:b()                                               thread: main_thread
total memory       diff
    2,940,336     -1,799,976
    2,040,440       -900,048

example.py:a()                                               thread: main_thread
total memory       diff
    1,139,848        900,400
    2,040,280        900,000
    1,140,408        900,048
    1,140,408        900,048

example.py                                                   thread: main_thread
total memory       diff
    1,133,832        906,232BugsBugs or suggestions? Visit theissue trackerLicenseMemspector
Copyright (C) 2015 Adam Tauber <asciimoo@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

See <http://www.gnu.org/licenses/>.
Package: memsql
MemSQL Python LibrariesThis library contains various plugins and wrappers designed by MemSQL
engineers for a couple of important python libraries.InstallpipinstallmemsqlCopy and paste the following steps to get started quickly on Ubuntu:sudoapt-getupdate
sudoapt-getinstall-ymysql-clientpython-devlibmysqlclient-devpython-pip
sudopipinstallmemsqlCopy and paste the following to get
started with RHEL based distributions such as Amazon Linux or Centos:sudoyumupdate
sudoyuminstall-ygccmysql-devel
sudopipinstallmemsqlTestingRun tests by executingmake test.
Package: memsql-collectd
===========MemSQL Collectd Plugin===========This libary implements a MemSQL Ops specific plugin for `collectd`.Install=======.. code:: bashpip install memsql-collectdThen add the following plugin to your collectd configuration[1]_:.. [1] The collectd config file may be found at /etc/collectd.conf or /etc/collectd/collectd.conf if collectd was installed through a package manager... code:: xml<LoadPlugin python>Globals true</LoadPlugin><Plugin python>Import "memsql_collectd.plugin"<Module "memsql_collectd.plugin">TypesDB "/usr/share/collectd/types.db"Host "MASTER AGGREGATOR HOSTNAME/IP_ADDRESS"Port "3306"MemSQLNode True</Module></Plugin>
Package: mem-top
Usage:pip install mem_top
from mem_top import mem_top

# From time to time:
logging.debug(mem_top())
# print(mem_top())

# Notice which counters keep increasing over time - they are the suspects.Counters:“mem_top” iterates all objects found in memory and calculates:refs - number of direct references from this object to other objects, like keys and values of dictE.g. a dict {(“some”, “complex”, “key”): “value”} will have “refs: 2” - 1 ref for key, 1 ref for valueIts key (“some”, “complex”, “key”) will have “refs: 3” - 1 ref per itembytes - size of this object in bytestypes - number of objects of this type still kept in memory after garbage collectionReal life example:refs:
144997  <type 'collections.defaultdict'> defaultdict(<type 'collections.deque'>, {<GearmanJobRequest task='...', unique='.
144996  <type 'dict'> {'.:..............:.......': <GearmanJobRequest task='..................', unique='.................
18948   <type 'dict'> {...
1578    <type 'dict'> {...
968     <type 'dict'> {...
968     <type 'dict'> {...
968     <type 'dict'> {...
767     <type 'list'> [...
726     <type 'dict'> {...
608     <type 'dict'> {...

types:
292499  <type 'dict'>
217912  <type 'collections.deque'>
72702   <class 'gearman.job.GearmanJob'>
72702   <class 'gearman.job.GearmanJobRequest'>
12340   <type '...
3103    <type '...
1112    <type '...
855     <type '...
767     <type '...
532     <type '...Noticed a leak of 6GB RAM and counting.Added “mem_top” and let it run for a while.When got the result above it became absolutely clear who is leaking here:
the Python client of Gearman kept increasing its counters over time.Found its known bug -https://github.com/Yelp/python-gearman/issues/10leaking defaultdict of deques, and a dict of GearmanJobRequest-s,
just as the “mem_top” showed.Replaced “python-gearman” - long story: stale 2.0.2 at PyPI, broken 2.0.X at github, etc.“mem_top” confirmed the leak is now completely closed.Updates:Pass e.g. “verbose_types=[dict, list]” to store their values, sorted by “repr” length, in “verbose_file_name”.Added “bytes” top.Config defaults:mem_top(
    limit=10,                           # limit of top lines per section
    width=100,                          # width of each line in chars
    sep='\n',                           # char to separate lines with
    refs_format='{num}\t{type} {obj}',  # format of line in "refs" section
    bytes_format='{num}\t {obj}',       # format of line in "bytes" section
    types_format='{num}\t {obj}',       # format of line in "types" section
    verbose_types=None,                 # list of types to sort values by `repr` length
    verbose_file_name='/tmp/mem_top',   # name of file to store verbose values in
)See also:https://docs.python.org/2/library/gc.html#gc.garbagehttps://pypi.python.org/pypi/objgraph
Package: memtrace2npz
memtrace2npzThis project is a utility for converting the output of DynamoRIO's memtrace-x86 client to an npz file. The output can be compressed into a zip file as well.Installationpip3 install memtrace2npzUsagememtrace2npz < -i inputfile > [ -o outfile ] [ -h ] [ -f ]You must specifiy the input file with-i. You may optionally specify an outputfile -- if you don't, the output file will be in the current directory with the basename of your input file, and with the extension changed to.npz.You may skip the check for the existence of the outfile with-f.Testingpytest
Package: memtracker
memtrackermemtrackeris a simple Python package to track and optionally log the peak CPU and GPU memory usage of a function.It would print the result at teminalPeak CPU Memory for main: 491.31 MB
Peak GPU Total Memory for main: 0.00 MB
Runtime for main: 1.81 secIt would generate a json file, if you setexport_to_json=True{
    "function_name": "main",
    "function_runtime_sec": 1.6997389793395996,
    "peak_cpu_memory_MB": 490.46875,
    "peak_gpu_total_memory_MB": 0
}InstallationpipinstallmemtrackerUsagefrommemtracker.memory_samplerimporttrack_peak_memory#Then, use the track_peak_memory decorator on your function:@track_peak_memory()defmy_function():# Your function logic herepassTo export the memory metrics to a JSON file:@track_peak_memory(export_to_json=True)defanother_function():# Your function logic herepass