Saravanan666/pypi-org huggingface dataset:
Package: memhax
MemhaxA python library for accessing raw python objects and other regions in memory.Installation$pipinstallmemhaxUsageRead/Write raw memoryfrommemhax.constantsimportmemory# Read 4 bytes from address 0x12345678withmemory(0x12345678)asmem:data=mem.read(4)Dump an object's structfrommemhax.cpython.primitivesimportPyLongObjectprint(PyLongObject)# struct PyLongObject {#     Py_ssize_t    ob_refcnt;#     PyTypeObject* ob_type;#     Py_ssize_t    ob_size;#     uint32_t[]    ob_digit;# }Read/modify python objectsfrommemhax.cpython.collectionsimportPyTupleObjectmy_tuple=(1,"abc",3.5)tuple_obj=PyTupleObject(id(my_tuple))# Get the tuple's lengthprint(tuple_obj.ob_size())# => 3# Replace an item in the tuplenew_item=[my_tuple,b"123"]tuple_obj.ob_item[0].raw(id(new_item))print(my_tuple)# => ([(...), b'123'], 'abc', 3.5)
Package: memimport
memimport for Python 3memimportis a part ofpy2exe, which helps import Python extensions from
memory, e.g. extensions from Zip files or Web.This repo via CI to build it as Python extensions, beacause the original has
been built into the py2exe runstubs, only run with script, no REPL.Development ofmemimportis hosted here:https://github.com/SeaHOH/memimport.Development ofpy2exeis hosted here:https://github.com/py2exe/py2exe.Installationpip install memimportUsageimportzipextimporterimportsyssys.path.insert(0,'path/to/libs.zip')thenzipextimporter.install()# default, prefer `hook=False`, `hook=True` as fallbackorzipextimporter.install(hook=False)# better compatibility, monkey patch `zipimport.zipimporter`# equal to empty argument, `hook=True` as fallbackorzipextimporter.install(hook=True)# not recommend, install to `sys.path_hooks`thenimportext_mod_in_zip# now, support __init__.pyd in packagesext_mod_in_zip# <module 'ext_mod_in_zip' from 'path\\to\\libs.zip\\ext_mod_in_zip\\__init__.pyd'>ext_mod_in_zip.__file__# 'path\\to\\libs.zip\\ext_mod_in_zip\\__init__.pyd'>ext_mod_in_zip.__loader__# <ZipExtensionImporter object 'path\to\libs.zip\'>importpy_mod_in_zippy_mod_in_zip# <module 'py_mod_in_zip' from 'path\\to\\libs.zip\\py_mod_in_zip\\__init__.py'>py_mod_in_zip.__file__# 'path\\to\\libs.zip\\py_mod_in_zip\\__init__.py'>py_mod_in_zip.__loader__# <zipimporter object 'path\to\libs.zip\'>More usage see source or use help function.
Package: memly
memlyMemly is amembrane analysis tool for molecular dynamics simulations of lipid bilayers. Memly features frame-by-frame
leaflet identification designed to capture lipid flip-flop. Analysis functions are implemented in an easily extensible way,
making it simple to add or customize simulation analysis.The following analysis metrics are currently available in memly:Surface area per lipidArea compressibility modulusSecond-rank nematic order parametersBilayer thicknessDomain detectionCopyrightCopyright (c) 2020, Tamir DingjanAcknowledgementsProject based on theComputational Molecular Science Python Cookiecutterversion 1.3.
Package: memmpy
MemmpyMemmpy is a Python library for storing datasets in, and loading datasets from,memory mappedfiles. This is particularly useful for large datasets that do not fit in memory and therefore need to be processed in batches. Memmpy is based on thenumpy.memmapimplementation.Who should use Memmpy?Memmpy is primarily intended for use in medium to large scale machine learning applications in high energy particle physics, where the whole dataset would not fit into memory at once and iterating over the ROOT files is too slow. This could be because shuffling of datapoints is desired, or because only a fraction of the information or events is needed for training.Memmpy is not intended for use in small applications where the entire dataset fits into memory and can be loaded at once. It is also not intended for use in very large applications where training is massively distributed.InstallationMemmpy can be installed directly from PyPI usingpip. It requires Python 3.10 or higher.
If you want to process.rootfiles,uprootis required. This can also be installed usingpip.pipinstallmemmpyUsageA simple memory mapped file can be created as follows:withWriteVector(path="data.mmpy",name="testdata")asmemfile:# Append a single numpy array.# The shape and dtype will be inferred from the array.memfile.append(np.array([1,2,3]))# Append another numpy array of the same shape and dtypememfile.append(np.array([4,5,6]))# Extend the file by an array with an additional axis.memfile.extend(np.array([[7,8,9],[10,11,12]]))memmap_data=read_vector(path="data.mmpy",name="testdata")
Package: memobird
### memobird.pyunofficial Python SDK for [memobird](http://www.memobird.cn/)### Installation$ pip install memobird### Usagefrom memobird import Memobirdmemobird = Memobird(‘{ak}’)
memobird.setup_device(‘{device_id}’)
memobird.print_text(‘text’)
memobird.print_image(‘/path/to/image.jpg’)
Package: memobird-agent
Memobird AgentMemobird Agent 是一个开源的咕咕机打印API，它基于对官方App的逆向分析。使用寥寥数行代码就可以实现自定义文本，图片，二维码和内置贴画的打印。Installationpipinstallmemobird_agentUsageimportmemobird_agentdocument=memobird_agent.Document()document.add_text(text="测试文字",bold=0,font_size=1,underline=0)document.add_picture(path_to_image)document.add_qrcode("嵌在二维码的文本")document.add_text(sticker_id)user_id=memobird_agent.Util.get_user_id(username="username",password="password")memobird_agent.Util.bind_machine(smart_guid=smart_guid,user_id=user_id)document.print(smart_guid,user_id,to_user_id)ExamplesSimple Examples打印文本importmemobird_agentdocument=memobird_agent.Document()document.add_text("需要打印的文字")document.print(smart_guid,user_id,to_user_id)FAQQ:Document.print()里的三个参数都是什么？应该如何获取？A: smart_guid是长按设备六秒后印出文档里的16个字符的字符串。user_id是发送者的用户ID。to_user_id是一个可选项，表示了接收者的用户ID。可以通过memobird_agent.Util.get_user_id(username, password)来取得用户IDQ: 为什么输入了正确的smart_guid和user_id后无法打印？A: smart_guid所属的咕咕机必须与user_id所属的用户绑定后才可以打印，绑定可在官方App内操作，或使用memobird_agent.Util.bind_machine(smart_guid, user_id)来绑定。Comments若有问题或者建议欢迎提Issue以及Pull Request来讨论。Roadmapv2.5提供设置蜂鸣器与LED的APIv3.x提供更多的功能
Package: memobj
memobjA library for defining objects in memoryinstallingpip install memobjexampleimportosfrommemobjimportWindowsProcess,MemoryObjectfrommemobj.propertyimportSigned4classPythonIntObject(MemoryObject):# note: this offset might be different in future python versionsvalue:int=Signed4(24)process=WindowsProcess.from_id(os.getpid())# id(x) gives the address of the object in cpythonmy_int=PythonIntObject(address=id(1),process=process)# prints 1print(my_int.value)supportdiscord:https://discord.gg/7hBStdXkyR
Package: memocalc
—Name: memocalcVersion: 0.0.1Description: memocalc is a Python package made for performing essential math calculations for everyday use.Supported Actions:AdditionMultiplicationSubtractionDivisionnth root calculationMemory resetPrint out memory—
How to install this package:
1. installing via terminal -pip install memocalcinstalling via IDE -%pip install memocalc—
How it works:from calculator.calculator import Calculatornew_obj = calc.Calculator()  # New object is created.new_obj.add(55) # Returns 55.0new_obj.subtract(22.6) # Returns 32.4new_obj.multiply(5) # Returns 162.0new_obj.divide(2) # Returns 81.0new_obj.n_root(4) # Returns 3.0new_obj.return_memory # Returns 3.0new_obj.memory_reset() # Resets memory to 0.0—Keywords: calculator, addition, multiplication, subtraction, division, nth rootThis project is licensed under the terms of the MIT license.
Package: memofn
MemoFNA python library for memoizing functions for quick debugging/translations.Usagefrommemofnimportmemofn,load_cache,save_cachedeffib(n):ifn<2:returnnreturnfib(n-1)+fib(n-2)load_cache('fib.cache.pkl')mfib=memofn(expire_in_days=9)(fib)mfib(10)save_cache('fib.cache.pkl')
Package: memoframe
1. What is it ?memoframe is a Python package that enables to easily optimize memory consumption of pandas dataframe. If you encounter OOM (Out of Memory) errors or slow downs during data analysis or model training.2. Where to get the package ?Binary installers for the latest released version are available at the Python Package Index (PyPI).# PyPI 
pip install memoframe3. FeaturesOptimize integer memory usageOptimize float memory usageOptimize object memory usageGet an estimation of the memory usage saved4. How to use the libraryfrom memoframe import memoframe as mf

# dataframe is a pandas DataFram
optimized_dataframe = mf.downsize_memory(dataframe)

# Estimates memory usage gains
mf.get_opti_info(dataframe)
Package: memoi
MemoiDescriptionA generic caching mechanism for memoizing function or method calls.PrerequisitesPython >= 3.10Installationpython-mpipinstallmemoiExamplefromdatetimeimportdatetimeasdtfrommemoiimportcached,TextFileRepo@cached(TextFileRepo('.'))deff(*args,**kwargs):returnf"this is the result of the first f() call at{dt.now().isoformat()}"print(f())print(f())This will create a a sqlite databasememo.sqlite, keeping track of function calls,
and a text file50/506f353d3ef92d51f3e57bae99367cafdirectory, containing the result of the firstf()call.
Obviously the timestamp from the first function call is preserved.AuthorEmanuel Schmid,schmide@ethz.chChangelogRelease 0.0.1DescriptionMinimum Viable Product of a result caching function decorator.Addeddecoratorcached: providing a caching mechanism for return values, so the function is not executed the next time when it is called with the same arguments.classTextFileRepo: for caching return values of functions returning strings as text files in a configurable directory.Release 0.1.0DescriptionMulti-String support.Changedcached: returns a pair of datetime and original result, the former indicating the date of first submission; can handle functions/methods that return iterables.
Package: memoir
memoirIn what followspythonis an alias forpython3.5or any later
version (python3.6and so on),pypyis an alias forpypy3.5or any later
version (pypy3.6and so on).InstallationInstall the latestpip&setuptoolspackages versions:withCPythonpython-mpipinstall--upgradepipsetuptoolswithPyPypypy-mpipinstall--upgradepipsetuptoolsUserDownload and install the latest stable version fromPyPIrepository:withCPythonpython-mpipinstall--upgradememoirwithPyPypypy-mpipinstall--upgradememoirDeveloperDownload the latest version fromGitHubrepositorygitclonehttps://github.com/lycantropos/memoir.gitcdmemoirInstall:withCPythonpythonsetup.pyinstallwithPyPypypysetup.pyinstallUsageLet's suppose we are defining a class
with expensive read-onlypropertywhich can be calculated once and reused afterwards.Common way of solving this is by introducing private'ish attribute like>>>classExample:...@property...defexpensive_property(self):...try:...result=self._expensive_property...exceptAttributeError:...result=do_expensive_calculations(...)...self._expensive_property=result...returnresultthis works fine, but each such propertyintroduces an extra attribute,requires a lot of boilerplate code.If we haveweakly-referencable(which is by default if not suppressed explicitly,
e.g. by using__slots__class variable),hashableclass we can implement it like>>>frommemoirimportcached>>>classExample:...@cached.property_...defexpensive_property(self):...returndo_expensive_calculations(...)DevelopmentBumping versionPreparationInstallbump2version.Pre-releaseChoose which version number category to bump followingsemver
specification.Test bumping versionbump2version--dry-run--verbose$CATEGORYwhere$CATEGORYis the target version number category name, possible
values arepatch/minor/major.Bump versionbump2version--verbose$CATEGORYThis will set version tomajor.minor.patch-alpha.ReleaseTest bumping versionbump2version--dry-run--verbose--tagreleaseBump versionbump2version--verbose--tagreleaseThis will set version tomajor.minor.patchand addGittag.NotesTo avoid inconsistency between branches and pull requests,
bumping version should be merged intomasterbranch as separate pull
request.Running testsPlain:withCPythonpythonsetup.pytestwithPyPypypysetup.pytestInsideDockercontainer:withCPythondocker-compose--filedocker-compose.cpython.ymlupwithPyPydocker-compose--filedocker-compose.pypy.ymlupBashscript (e.g. can be used inGithooks):withCPython./run-tests.shor./run-tests.shcpythonwithPyPy./run-tests.shpypyPowerShellscript (e.g. can be used inGithooks):withCPython.\run-tests.ps1or.\run-tests.ps1cpythonwithPyPy.\run-tests.ps1pypy
Package: memoiz
MemoizMemoiz is a memoization decorator that makes resonable assumptions about how and if to cache the return value of a function or method based on the arguments passed to it.  The decorator can be used on both free and bound functions.Usagefrommemoiz.cacheimportCachecache=Cache()classExample:def__init__(self):self.n=1@cachedeftest(self,a,b):return(self.n,a,b)example=Example()example.test(1,2)cache.invalidate(example.test,example,1,2)@cachedeftest(a):returnatest(1)cache.invalidate(test,1)Installpipinstallmemoiz
Package: memoize
Only compute the value of properties the first time they are called. The easiest way to explain it is by example.Bad:class Foo(object):
    def __init__(self):
        self._bar_cache = None

    @property
    def bar(self):
        if self._bar_cache is None:
            self._bar_cache = 2 * 2 * 2
        return self._bar_cacheGood:from memoize import mproperty

class Foo(object):
    @mproperty
    def bar(self):
        return 2 * 2 * 2
Package: memoized
MemoizedThe common general versions of memoized decorators ([1],[2],[3]) are
often good enough but they incur some overhead that can be avoided in more
special cases ([4]). This package exposes a single callable,memoized,
that picks an efficient memoization implementation based on the decorated
function’s signature and a few user provided options. The included benchmark
file gives an idea of the performance characteristics of the different possible
implementations.Additionally,memoizedallows:Creating signature preserving decorators (through thedecoratormodule).Passing an external object as the underlying storage (e.g. an LRU cache)
instead of a dict that is used by default.More options for customization and optimization may be added in the future.News0.3Python 3 compatibility.0.2Addhashableparameter.Make it possible to use@memoizedas equivalent of@memoized().0.1Initial release
Package: memoized-lambda
Memoized LambdaMemoizedLambda is a class that provides an async invoke interface with
deduplication of requests and memoization of responses for aBoto3 Lambda
Client.UsageFirst, create a cache for the memoization:fromcachetoolsimportTTLCachecache=TTLCache(ttl=60,maxsize=1024)The cache can be any object that implementscollections.abc.MutableMapping.Then, create a lambda client and a memoized lambda for some AWS Lambda function:importboto3frommemoized_lambdaimportMemoizedLambdaclient=boto3.client("lambda")mlambda=MemoizedLambda(lambda_client=client,function_name="function",cache=cache)Finally, invoke the lambda function:importasyncioloop=asyncio.get_event_loop()coro=asyncio.gather(mlambda.invoke({}),mlambda.invoke([]),mlambda.invoke({}))loop.run_until_complete(coro)invokereturns the response payload, or raises aMemoizedLambdaErrorexception on error. The first invocation with a given input will invoke the
lambda, while subsequent invocations for the same input will read the response
payload from the cache. In the above example, the lambda is invoked once for{}and once for[].The request and response payloads are transformed using configurable transform
functions that default to JSON serialization and deserialization. If you want to
override them, use the optionalrequest_transformandresponse_transformarguments:mlambda=MemoizedLambda(lambda_client=client,function_name="function",cache=cache,request_transform=lambdax:x,response_transform=lambdax,y:y)Theresponse_transformfunction gets the request and response payload as
arguments.If you want to avoid caching some responses, use the optionalcache_filterargument:mlambda=MemoizedLambda(lambda_client=client,function_name="function",cache=cache,cache_filter=lambdax:notisinstance(x,Exception))Note thatMemoizedLambdaErrorexceptions are never cached, even if raised by
the response transform.
Package: memoized-property
A simple python decorator for defining properties that only run their fget function once.Free software: BSD licenseWhat?A Python property that only calls itsfgetfunction one time. How many times have you written
this code (or similar)?def class C(object):

    @property
    def name(self):
        if not hasattr(self, '_name'):
            self._name = some_expensive_load()
        return self._nameI’ve written it just enough times to be annoyed enough to capture this module. The result is this:from memoized_property import memoized_property

def class C(object):

    @memoized_property
    def name(self):
        # Boilerplate guard conditional avoided, but this is still only called once
        return some_expensive_load()Why?I couldn’t find a pre-existing version of this on PyPI. I found one other on GitHub,https://github.com/ytyng/python-memoized-property, but it was not published to PyPI.History1.0.3 (2016-09-28)Build universal wheelsSupport Python 3.4, 3.51.0.2 (2014-05-02)Remove dependency on six1.0.1 (2014-01-01)Added python 3.2 compatability1.0.0 (2013-12-26)First release on PyPI.
Package: memon
Very simple memory monitor that records the percent of memory used. This can be
useful if you want to dump data to disk if memory consumptions becomes too high.InstallationThis package should be installable through pip:pip install memonDescription and UsageThe MemoryMonitor class takes an interval and a memory_limit in percent.To start recording memory usage:from memon import MemoryMonitor
import time
memmon = MemoryMonitor(interval=0.1)
memmon.start()
memmon.start_recording()
time.sleep(1)
memmon.stop_recording()
assert len(memmon.history) == 10If historical data is recorded this can be used to query if memory usage will
keep under the memory limit. This is done by calling:memmon.memory_available()This function makes some assumptions:The Python process is the main memory user on the system.Any big fluctuations in memory usage are because of memory
allocation/deallocation of the process running the memon.We want to fit the average fluctuation that occurs during processing under the
memory limit.Because of these assumptions thememory_available()function calculates:delta = max(history) - min(history)
level = mean(history) + delta
level < memory_limitContributeWe are happy if you want to contribute. Please raise an issue explaining what
is missing or if you find a bug. We will also gladly accept pull requests
against our master branch for new features or bug fixes.Development setupFor Development we recommend acondaenvironmentGuidelinesIf you want to contribute please follow these steps:Fork the memon repository to your accountmake a new feature branch from the memon master branchAdd your featurePlease include tests for your contributions in one of the test directories.
We use py.test so a simple function called test_my_feature is enoughsubmit a pull request to our master branchNoteThis project has been set up using PyScaffold 3.2.3. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: memorable
MemorableA library for generating memorable strings.Usageimportmemorablememorable.name()# lue-the-jealously-happy-go-luckymemorable.action()# eat-a-pretty-paymentmemorable.thing()# cleverly-neglected-talkmemorable.code_phrase()# amused-chilly-minestrone-distributeAdvanced usageIt is possible to generate strings focusing on a specific theme.forkindinmemorable.NounTypes:phrase=memorable.thing(kind=kind)print(f'{kind.value}:{phrase}')# alcohols: wonderfully-overdue-beer# animals: uncritically-thoughtful-octopus# elements: vividly-mindless-chromium# foods: jubilantly-snappy-stew# fruits: poorly-handmade-kiwano# geographies: quaintly-mountainous-beach# households: hurriedly-ready-zester# investments: meticulously-variable-bitcoin# literature: madly-bogus-ode# mythical: readily-general-centaur# occupations: casually-tinted-data-scientist# organs: nightly-splendid-lungs# places: casually-definitive-farm# relations: later-ready-babushka# rocks: slavishly-hot-picrite# royalty: fast-loyal-despot# tools: unnecessarily-unripe-needle-nose# transports: hollowly-cheerful-pickup# trees: never-offbeat-fir# vegtables: naively-happy-bitter-melon# water_bodies: upliftingly-flickering-wadiIfmemorableis being used to generate ids and you'd like to reduce the
frequency of collisions (you should expect some collisions) it's possible
to request some extra characters tacked on the end to make them less common.memorable.action(extra_characters=4)# demand-the-hidden-bread-machine-gths
Package: memorable_password
Memorable PasswordGenerate sentence of context, along with keywords/PIN/passwords to make sure you memorize it!!!Usage as a scriptmemorable-password is available on PyPI --pip install memorable-passwordWeb demohttps://memorable-password.herokuapp.comMemorable Password on AndroidPlease see my new project:Python Password Manager for Android.Related Projecthttps://github.com/patarapolw/randomsentencehttps://github.com/patarapolw/password_managerhttps://github.com/patarapolw/diceware_utils
Package: memorandum
# memorandumCommand line tool to display calendar in terminal, mutt, etc.# Auto-configurationRun memorandum ("./memorandum.py" if cloned from git or "python3 -m memorandum"if installed from pypi) and answer configuration questions.It will install :* a configuration file in "~/.config/memorandum/memorandum.rc"* and if you wish an "memorandum" alias in "~/.bash_aliases".# Command line usage## RunThe first run is made via:* "python3 -m memorandum" if module is installed from pypi,* "./memorandum.py" if cloned from git.Then if you have installed the pypi module and created the alias, run it with :"memorandum"## OptionsThe main options are:* "memorandum": display today events* "memorandum -w": display this week events* "memorandum -m": display this month events* "memorandum -d YYYYMMDD": display the corresponding day events* "memorandum -w -d YYYYMMDD": display the corresponding week events* "memorandum -m -d YYYYMMDD": display the corresponding month events* "memorandum -c": create e new event# TODO: Mutt usage## TODO: Add to .mailcap file:text/calendar; path/memorandum/cal.py '%s'; nametemplate=%s.ics; copiousoutput;## TODO: Add to .muttrc file:auto_view text/calendar
Package: memoreka
Python库 - 妙花笔记API请注意：本仓库并非由极核科技开发，故不保证其可用性，且随时可能停更请注意：本仓库还未开发完成，目前功能有限请注意：使用时请确保云同步处于开启状态（废话）本项目使用 MIT 许可协议它允许了什么？你可以使用、分发、修改你可以免费使用或者付费出售这份源代码修改后闭源商业使用它限制了什么？不保证本仓库一定能用原作者不为使用后的一切风险承担责任它需要我做什么？在你的项目/应用中放置 MIT 许可协议本项目版本号命名规则开发时使用的Android软件版本 + 本项目版本如0.2.24.1就是 基于0.2.24版本的Android妙花笔记 开发的 第1个版本 的API库Todo登录获取笔记内容添加/修改笔记内容获取/修改云同步状态
Package: memoria
MemoriaMemoriais a Python library for hashing and caching.InstallationpipinstallmemoriaBenefits of MemoriaConsistencyUnfortunately the built-inhashmethod is not consistent.
For example if you hash a string in two different Python sessions,e.g.,hash('hello world!'), you may get different results,e.g.,-69600567246316219or-8701498716516122875. However, Memoria is consistent,e.g.,memoria.hash('hello world!')producesPwDVM4wattDXKR1HUtszcPP5BHTUVTYQ5X0cO51yAn4=.
We should credit the built-in libraryhashlibof course.Hashing Unhashable TypesMemoria can hash virtually anything. If you use the built-inhashmethodhash(dict())orhash(list())you will get an error:TypeError: unhashable type: 'dict'butMemoriacan even hashunhashabletypes by converting them into a hashable type and
hashing the result. To make sure that the hash is still different between
the original type and the hashable representation, Memoria takes some
additional measures.Usageimportmemoria# hashing a python objectmemoria.hash(123)# >>> 'zi+wk24s9wwA/UiNRKbjeu6JfDi78yCj7yVL87sS0Ko='# base is 64 by default but 32 can also be used.# base 64 should not be used in the file-system, e.g., file names, because it has inadmissible characters.memoria.hash(123,base=32)# >>> 'PONR14RE5JRGO07T926K99N3FBN8IV1ONFPI18VF4L5V7EOIQ2L0----'# dictionaries are unhashable but Memoria can hash themmemoria.hash({'name':'John','age':24})# >>> 'ioCMz5B8pcdk2CxcbIX/3n3qnQRn/yv9/zvC5Wc0YlU='