Saravanan666/pypi-org huggingface dataset:
Package: lazyarray
lazyarray is a Python package that provides a lazily-evaluated numerical array
class,larray, based on and compatible with NumPy arrays.Lazy evaluation means that any operations on the array (potentially including
array construction) are not performed immediately, but are delayed until
evaluation is specifically requested. Evaluation of only parts of the array is
also possible.Use of anlarraycan potentially save considerable computation time
and memory in cases where:arrays are used conditionally (i.e. there are cases in which the array is
never used)only parts of an array are used (for example in distributed computation,
in which each MPI node operates on a subset of the elements of the array)
Package: lazy-async
Lazy EvaluationLazy evaluate function/class method/class property. The target will be evaluated once and only once on first call
, and concurrent calls will get the result immediately once the target is ready and gets the same exception when the target
raises some exception.FeaturesImplemented both sync and async version.Lock free!!!! (thanks to asyncio.Future and concurrent.futures.Future, all the operations are atomic)Assign will update cache immediately.Async property must use sync setter and deleter for now, due to the limitation that python does not support await
before assignment ordel.await setattr(foo, value)is one possible workaround, but it introduces more obfuscation.Installationpipinstalllazy-asyncExampleimportasynciofromlazy_asyncimportlazy,lazy_property,lazy_async,lazy_property_asyncfromthreadingimportThreadimporttimeclassExampleClass:def__init__(self):self.sync_called=0self.async_called=0self.prop='nothing'@lazydeffunc1(self):time.sleep(5)self.sync_called+=1return'something'@lazy_asyncasyncdeffunc2(self):awaitasyncio.sleep(5)self.async_called+=1return'something'@lazydeffunc3(self):time.sleep(5)raiseValueError('SomeException')@lazy_asyncasyncdeffunc4(self):awaitasyncio.sleep(5)raiseValueError('SomeException')@lazy_propertydeffunc5(self):time.sleep(5)self.sync_called+=1returnself.prop@func5.setterdeffunc5(self,value):self.prop=value@lazy_property_asyncasyncdeffunc6(self):awaitasyncio.sleep(5)self.async_called+=1returnself.prop@func6.setterdeffunc6(self,value):self.prop=valuedeftest_something_sync():test_class=ExampleClass()test1=dict()defstart1():test1[1]=test_class.func1()defstart2():time.sleep(3)test1[2]=test_class.func1()defstart3():time.sleep(10)test1[3]=test_class.func1()Thread(target=start1).start()Thread(target=start2).start()Thread(target=start3).start()time.sleep(1)asserttest1=={}time.sleep(3)asserttest1=={}time.sleep(2)asserttest1=={1:'something',2:'something'}time.sleep(5)asserttest1=={1:'something',2:'something',3:'something'}deftest_something_async():test2=dict()loop=asyncio.new_event_loop()asyncio.set_event_loop(loop)test_class=ExampleClass()asyncdefstart1():test2[1]=awaittest_class.func2()asyncdefstart2():awaitasyncio.sleep(3)test2[2]=awaittest_class.func2()asyncdefstart3():awaitasyncio.sleep(10)test2[3]=awaittest_class.func2()asyncdefassert1():awaitasyncio.sleep(1)asserttest2=={}awaitasyncio.sleep(3)asserttest2=={}awaitasyncio.sleep(2)asserttest2=={1:'something',2:'something'}awaitasyncio.sleep(5)asserttest2=={1:'something',2:'something',3:'something'}loop.run_until_complete(asyncio.gather(start1(),start2(),start3(),assert1()))See unittest for more examples.
Package: lazybot
lazybotA simple class that can call arbitrary methods and make a request to Telegrams bot api.But why ?While writing my userbot I wanted a easy way to make calls to the bot api without needing a full blown lib with handlers etc..Where are the docs ?Use theTelegram Docsand the following example as base.import lazybot
bot = lazybot.Bot('TOKEN')
# you can use snake case
bot.send_message(chat_id=123456, text='Text')

# or camelCase
bot.sendMessage(chat_id=123456, text='Text')Installationpip install lazybot
Package: lazybox
LazyBoxA user friendly API to jump-start your Deep Learning project based on Fastai.The library is still in early development, but a lot of new features will be added in future[ ] Support for non-image Datasets
[ ] Import NN architecture from the timm library
[ ] Make it betterInstallpip install lazyboxHow to useLet's go through a typical workflow for a DeepLearning task. Let's download this Dataset on Kaggle:https://www.kaggle.com/tongpython/cat-and-dogwhich are images of cat and dogs.# we lazy folks only use wild imports
from lazybox.all import *

path = Path('test_dataset')

path.find('archive')'test_dataset/archive.zip'Let's decompress this archive
Package: lazychains
Package DescriptionA Python library to provide "chains", which are Lisp-like singly linked lists
that support the lazy expansion of iterators. For example, we can construct a
Chain of three characters from the iterable "abc" and it initially starts as
unexpanded, shown by the three dots:>>>fromlazychainsimportlazychain>>>c=lazychain("abc")>>>cchain([...])We can force the expansion ofcby performing (say) a lookup or by forcing the whole
chain of items by calling expand:>>>c[1]# Force the expansion of the next 2 elements.True>>>cchain(['a','b',...])>>>c.expand()# Force the expansion of the whole chain.chain(['a','b','c'])Chain are typically a lot less efficient than using ordinary arrays. So,
almost all the time you should carry on using ordinary arrays and/or tuples.
But Chains have a couple of special features that makes them the
perfect choice for some problems.Chains are immutable and hence can safely share their trailing segments.Chains can make it easy to work with extremely large (or infinite)
sequences.Expanded or UnexpandedWhen you construct a chain from an iterator, you can choose whether or not
it should be immediately expanded by calling chain rather than lazychain.
The difference between the two is pictured below. First we can see what happens
in the example given above where we create the chain using lazychain on
"abc".By contrast, we would immediately go to a fully expanded chain if we were to
simply apply chain:>>>fromlazychainsimportchain>>>c=chain("abc")>>>cchain(['a','b','c'])>>>
Package: lazycls
lazyPython Utilities for the Super LazyMotivationThis library is forked from an internal project that works with alotof dataclasses, (AWS API) and I got tired of writing data classes to work with and manipulate them. This library is a wrapper around the mainpydantic.create_modelfunction that recursively parses adictobject and transforms them into subclasses. So nested dict objects within dicts get transformed into their own dataclass.Quickstartpipinstall--upgradelazyclsfromlazyclsimportLazyCls,BaseLazydata={'x':...,'y':...}obj=LazyCls(name:str='CustomCls',data:Dict[str,Any]=data,modulename:str='lazycls',# your module namebasecls:Type[BaseModel]=BaseLazy# A custom Base Model class that is used to generate the model)->Type[BaseModel]:"""obj =   lazycls.CustomClslazycls.CustomCls.x = ...lazycls.CustomCls.y = ..."""UtilitiesSome additional enhancements/utilities include:set_modulename(name)- set the default module name - useful when included in other libsclear_lazy_models- clears all the currently created lazy models. Memory managementclassproperty- allows for usage of@classpropertywhich isn't available for Python < 3.9BaseCls- A wrapper aroundBaseModelwith:arbitrary_types_allowed = True.get(name, default)function to retaindict-like propertiesBaseLazy- Another wrapper aroundBaseModelwith:arbitrary_types_allowed = Trueextra = 'allow'alias_generator = to_camelcaseorjsonserializer by default.get(name, default)function to retaindict-like properties
Package: lazycodr
LazyCodr 🚀A CLI tool designed to help lazy coders get their work done with AI! LazyCodr automates tasks such as generating pull requests, and more, using our beloved AI models.YouTube Video IntroductionFeatures 💡Generate pull request descriptionsAutomate commit messages (incoming ...)Easy configurationWorks with GitHub APIPowered by LLMs (for now only OpenAI)Installation 💻pipinstalllazycodrRequirements 🔑Before you can use LazyCodr, you'll need to create an OpenAI API key and a GitHub token. Here's how to do both:OpenAI API KeySign up for an account on theOpenAI websiteif you don't have one already.Once logged in, go to theAPI Keys page.Click on "Create an API key" and copy the generated key.GitHub TokenLog in to your GitHub account and go to thePersonal Access Tokens page.Click on "Generate new token" in the top right corner.jGive your token a descriptive name and select the required scopes (for LazyCodr, you'll needrepoanduserscopes.Click "Generate token" at the bottom of the page and copy the generated token.After you have both your OpenAI API key and GitHub token, you can configure LazyCodr by running the following command:lazycodrconfigcredentialsThis command will prompt you to enter your API key and GitHub token, which will be securely stored for future use.Now you're all set to use LazyCodr! 🚀Usage 📚Configure LazyCodr with your OpenAI API key and GitHub token:lazycodrconfigcredentialsUse LazyCodr to generate a pull request description:lazycodrprgenerate<repo_name><pr_number>Use LazyCodr to generate README.md file for a git repo (it will pickup the ignored pattern from the .gitignore if it exists and you can also add additional ones with --ignore option):lazycodrreadmegenerate<repo_name>--ignore=pattern1--ignore=pattern2...Roadmap 🗺️"A lazy programmer is a great programmer"We're on a mission to make all of us even lazier 😅!
There is no clear roadmap, but here are some ideas for LazyCodr's future:🚀Commit Message Generation:Automatically generate meaningful commit messages based on your code changes, so you can save time and focus on coding.🚀Codebase Conversations:Chat with your codebase to get AI-powered recommendations and insights about your code, helping you make informed decisions as you work.🚀AI-driven Guidance:Receive step-by-step guidance from AI on how to write new features or implement specific functionality, making it easier to tackle challenging tasks.🚀 [DONE]README Generation:Automatically generate well-structured and informative README files for your projects, ensuring that your documentation is always up to date.🚀 ... replace yourself entirely so you can take 10 jobs in parallel 🤑🤑🤑Remember, even though I'm aiming to make you the laziest programmer possible 😜, I still appreciate your help.
If you have any ideas, suggestions, or improvements, feel free to contribute and help make LazyCodr even better for your fellow lazy programmers.Together, we can redefine the art of lazy programming!Contributing 🤝Contributions are welcome! Feel free to submit a pull request or open an issue.License 📄This project is licensed under the MIT License.Happy coding! 🎉
Package: lazy-computing
Lazy computingBased on haskell features, exemples are worth a 1000 wordsUsage.. code:: pythonfrom lazy_computing import *.. code:: pythonfor x in infinity: print(x)                         # 1 2 3 4 5 ...

for x in remove(100, infinity): print(x)            # 100 101 102 103 ...

for x in take(5, remove(100, infinity)): print(x)   # 100 101 102 103 104

for x in arithm(1, 5, ...): print(x)                # 1 5 9 13 17 ...

for x in arithm(1, 5, ..., 17): print(x)            # 1 5 9 13

for x in geom(1, 5, ...): print(x)                  # 1 5 25 125 625 ...

for x in geom(1, 5, ..., 500): print(x)             # 1 5 25 125 625 ...

for x in tail([5, 6, 7, 8]): print(x)               # 6 7 8

print(head([5, 6, 7, 8]))                           # 5
print(extract(2, [5, 6, 7, 8]))                     # 7Documentationinfinity: iterable representing the infinityremove(number, iterable): return an iterator without thenumberfirst elementextract(index, iterable): return the value atindexfrom iterabletake(limit, iterable): return an iterator takinglimitfirst value
from iterablehead(iterable): return the first value of an iterabletail(iterable): return an iterator on an iterable, without the headarithm(*args): return an iterable. It guess the step from the
argumentsgeom(*args): return an iterable: It guess the factor from the
arguments
Package: lazycon
Easy config files in pure Python!What you can do directly in your configs:define constantsdefine functionsuse import statementscall functions and apply arithmetic operationsa static read-only scopestatic checking: cycles detection, undefined variables detectionInstallpipinstalllazyconFeaturesBasicLet's define a config fileexample.configand see what it can do# define constantsnum_steps=100database_table='user_data'# or more complex structuresparameters={'C':10,'metric':'roc_auc',}values_to_try=[0,1,2,3,4]# you can use and call builtinssome_range=list(range(100))# or even comprehensions!squares=[i**2foriinrange(20)]Now let's load our config from pythonfromlazyconimportloadconfig=load('example.config')print(config.database_table)# 'user_data'Need to change an existing config? No problem!fromlazyconimportloadconfig=load('example.config')config.update(database_table='customer_data',some_range=[1,3,5],)config.dump('updated.config')AdvancedPython-based configs can do so much more! Let's create anotheradvanced.config:# combine config entriesx=1y=2z=x+y# define lambdascallback=lambdavalue:1ifvalue==0else(1/value)# or more complex functionsdefstrange_normalize(a,b):temp=a**2+b**2returna/temp,b/tempYou can import from other python libraries:importnumpyasnpfrommathimportsqrtconst=np.pi/np.eproportions=sqrt(2)Or even other configs!# import from `example.config` defined abovefrom.exampleimport*extended_values_to_try=values_to_try+[101,102]ContributeJust get the project from GitHub and modify it how you please!gitclonehttps://github.com/maxme1/lazycon.gitcdlazycon
pipinstall-e.
Package: lazyconn
A lazy connection context manager使用说明LazyConnection是一个线程安全的连接管理器，它将会创建一个连接上下文(context)，这个上下文管理一堆在它上面注册的工场函数(factory)。在context 的生命周期范围内，factory 将会根据使用到的情况按需创建(最多只会被创建一次), 通过以 context 上注册的名字作为属性来访问,
可得到该 factory 的一个实例。在context 的生命周期结束时，将会自动执行清理工作，factory 的实例会被销毁，如果有 close 方法也将被调用。使用范例:from lazyconn import LazyConnection

def create_test1_client():
    return snow(host='127.0.0.1', port=1234)

def create_test2_client1():
    return wish(host='127.0.0.1', port=1235)

# register
LazyConnection.register_factory('test', create_test1_client)
LazyConnection.register_factory('test2', create_test2_client)

# context life
with LazyConnection() as conn:
    conn.test1.hello('wayhome')lg是一个线程安全的全局对象，它只在连接上下文中有效，它的conn属性对应一个连接上下文。Note在 context 生命周期外，不能使用此对象。使用范例:from lazyconn.globals import lg

 with LazyConnection() as conn:
     conn.test1.hello('wayhome')
     lg.conn.test1.hello('wayhome2')thread_safe是一个装饰器, 被装饰的函数将会在一个连接上下文中执行。lg对象可以在被装饰的函数内部使用。使用范例:from lazyconn import thread_safe

@thread_safe
def test():
    lg.conn.test1.hello('wayhome3')History0.1.0 (2013-08-11)First release on PyPI.
Package: lazy-database
lazy_dbFree software: MIT licenseDocumentation:https://lazy-db.readthedocs.io.A lazily loaded key:value db intended for use with large datasets that are too big to be loaded into memory. The database supports integers, strings, lists of integers, bytes, and dictionaries. This database is meant to strike a good balance of retrieval/insertion speed and memory usage. This database best fits a scenario where each key has a lot of data stored under it. Scenarios where values are under 100 bytes in size this database is not very well suited for.Install withpip install lazy-databaseExample usage:fromlazy_dbimportLazyDb# Simple example usagedb=LazyDb("test.lazy")db.write("test_value","value")print(db.read("test_value"))# prints "value"db.close()# Or use a with statement to insure the database file is closed cleanly and avoid having to call db.close() on your ownwithLazyDb("test2.lazy")asdb:db.write("test_value","value")print(db.read("test_value"))How it worksFile layoutAll text in database files are encoded in utf-8 format. Each database has a json string at the start of the file that denotes the database's settings, who's end is marked with a NUL byte (00 in hex)Each database entry is appended at the end of the file and is laid out in this format:NameSize (bytes)PurposeNUL1Marks the start of the entry. When the initial headers index, the starting byte of each entry is checked for this NUL byte to be sure the database hasn't been corrupted. This is the beginning to what is considered the "header" for the entry (NUL bytes carry a hex value of 0x00)Key type1Marks if the key is an integer or a string.KeyanyThe key for the database entry.NUL1Marks the end of the key. This is necessary since string keys don't have a set size.Content lengthcontent_int_sizeAn integer (little endian) depicting the length of the content (including the content type). Defaults to 4 bytes long. This is the end to what is considered the "header" for the entryContent type1Marks if the content is a string, int, int list, dict, or bytes.ContentContent lengthStores the contentContent type labelsNameHex type valueType descriptionString0x01A utf-8 stringInt0x02An integerDict0x03A dictionary (internally stored as a utf-8 json string)Int list0x04A list of integers. Max integer size is defined by int_list_size (default: 4 bytes)Bytes0x05A bytes objectThe algorithmWhen loading a database, all entry headers are scanned for their key value and lengths. This allows for values to be retrieved very quickly without having to load the content of every entry, at the cost of having to store the key and content length in memory though. This approach makes the database best for cases where your database will be storing a lot of data in each key that you can't afford to store in memory, however you can afford to store the name values and lengths of each element in memory.
Package: lazydep
lazydepEvaluates some set of functions, according to tome dependency graph structureThere's pretty much 1 function that is worth noting:lazydep.resolve(graph,state,functions,request=None)Argumentsgraph: dictionary, mapping function names to the names of parameters required for their executionstate: dictionary, initial input to functions. the remainder of intermediary parameters will be bootstrappedfunctions: list of functions in any order, or dictionary mapping function names to functionsrequest: name of desired function evaluation. If request is specified, only the desired function call will be returned. If left empty, all functions specified will be returned, in the same form as state object.Returnsdictionary, or result of 'request' functionExample# Each key here corresponds to a function name# Once evaluated, a function's return value is stored as a key as its namedepGraph={# Once we specify seed, all else will be inferred'f1':'seed','f2':'f1','f3':['f1','f2'],# Function unused. If we only request 'f3', these will never be evaluated'f4':'f3','f5':'f6','f6':'seed'}# Functions will receive parameters according to the dependency graph# Keyword args only, positional args not supporteddeff1(seed):returnseed%10deff2(f1):return[f1]*f1deff3(f1,f2):return(f1,sum(f2))# The initial information, some set of named parameters.istate={'seed':42}res=lazydep.resolve(# How are inputs and outputs reordered?graph=depGraph,# What information are we working with?state=istate,# What functions are allowed?functions=[f1,f2,f3],# Which function output are we requesting?# If request == None, we will return the aggregate state, after running all functionsrequest='f3',)assert(res==(2,4))
Package: lazydf
lazydf - Serialization of nested objects to binary formatAn alternative to pickle, but may use pickle if safety is not needed.Principle: Start from the simplest and safest possible and try to be fast.try orjsondict,str,int, etctry bsonstandard types accepted by mongodbserialize as numpyndarray, pandas dataframe/seriesNon-deterministic and unsafe modes (pickle) are planned for the near future.Python installationfrom package# Set up a virtualenv.python3-mvenvvenvsourcevenv/bin/activate# Install from PyPIpipinstalllazydffrom sourcegitclonehttps://github.com/lazydf/lazydfcdlazydf
poetryinstallExamplesSome usage examples.GrantsThis work was partially supported by Fapesp under supervision of
Prof. André C. P. L. F. de Carvalho at CEPID-CeMEAI (Grants 2013/07375-0 – 2019/01735-0).
Package: lazydl
本仓库旨在方便快速地为深度学习项目提供便捷功能，例如钉钉通知、快捷配置、批量实验、GPU排队等等安装pipinstalllazydl-ihttps://pypi.org/simple使用importlazydlasll.hi()功能支持帮助信息hi()：打印 Bannerhelp()：打印帮助信息，待完善print_error_info(e: Exception)：打印错误信息通知notice(msg, warning=False, access_token="", secret="")：钉钉通知，默认读取 init_env() 设置的环境变量中的凭证Args:
    msg (str): 通知内容
    warning (bool, optional): 是否为警告. Defaults to False.
    access_token (str, optional): 钉钉机器人 access_token. Defaults to "".
    secret (str, optional): 钉钉机器人 secret. Defaults to "".配置init_env(config: Union[DictConfig, dict])：初始化环境包括随机种子、可见GPU、Comet.ml环境变量、进程名

Args:
    config (DictConfig): 配置文件
        seed (str, optional): 种子. Defaults to '3407'.
        use_deterministic (bool, optional): 是否使用确定性算法，使用了训练会变慢. Defaults to False.
        visibale_cuda (str, optional): 设置可见 GPU，如果不使用设置为 ''. Defaults to 'all'.
        comet_exp (dict, optional): Comet.ml相关环境变量设置. Defaults to {}.
        proctitle (str, optional): 进程名. Defaults to 'python'.
        proctitle_prefix_id (bool, optional): 是否在进程名前边添加进程 ID. Defaults to True.GPU 自动选择、排队gpu_ready())：检查 GPU 是否可用set_processing_units(config: Union[DictConfig, dict] = {})：设置处理器支持自动选择和手动选择、排队和不排队

Args:
    config (dict, optional): Defaults to {}.
        processing_unit: 处理器类型，可选值为：cpu、mps, 1, ^2 等，其中 ^2 表示自动选择两块 GPU，默认为 cpu
        processing_unit_type: 选择处理器，可选值为：cpu、mps、gpu-a-s、gpu-a-m、gpu-m-s、gpu-m-m
        processing_unit_min_free_memory: 最小空闲内存，单位为 GiB，默认为 10
        processing_unit_min_free_memory_ratio: 最小空闲内存比例，默认为 0.5
        queuing: 是否排队，依赖 Redis，默认为 False
        visible_devices: 可见的 GPU 序号，用逗号分隔，默认为 None

Returns:
    Union[DictConfig, dict]: config包装类Result：包装类，用于作为模块间通信的媒介，可使用字典进行初始化文件读取和保存load_in(path, data_name="")：读取文件根据文件后缀名自动选择读取方法
    目前支持保存类型有：‘pkl’、‘txt’、‘pt’、‘json’, 'jsonl'、'csv'

Args:
    data_name: str, 打印提示时需要，便于控制台查看保存的文件是什么文件, 默认为空

Returns:
    data：Objectsave_as(data, save_path, file_format="pt", data_name="", protocol=4)：保存文件将参数中的文件对象保存为指定格式格式文件
    目前支持保存类型有：‘pkl’、‘txt’、‘pt’、‘json’, 'jsonl'
    默认为‘pt’

Args:
    data: obj, 要保存的文件对象
    save_path: str, 文件的保存路径，应当包含文件名和后缀名
    data_name: str, 打印提示时需要，便于控制台查看保存的文件是什么文件, 默认为空
    protocol: int, 当文件特别大的时候，需要将此参数调到4以上, 默认为4
    file_format: str, 要保存的文件类型，支持‘pkl’、‘txt’、‘pt’、‘json’、‘jsonl’

Returns:
    None
Package: lazydoc
lazydoc=======Sometimes when you program in multiple languages, the last thing you're going to worry about is configurations.LazyDoc is your world to automatic documentation using Sphinx by guessing all the parameters. It works best with `d2tol`Usage=====Installing using```python setup.py install```Usage is via the commandline `lazydoc`:```usage: lazydoc [-h] [-g] [-d]Generate documentation - the lazy wayoptional arguments:-h, --help            show this help message and exit-g, --gen, --generategenerate sphinx doc directories-d, --doc, --documentbased on sphinx config, generate all documentation```
Package: lazydocker-bin
pybinThis project was inspired by howMaturin packages rust binaries.  The key observation is that in the wheel format, thedistribution-1.0.data/scripts/ directory is copied to bin, which means we can leverage this to seamlessly copy binaries into a user's PATH.Combined with Python's platform-specific wheels, this allows us to use pip as a "cross-platform package manager" for distributing single-binary CLI applications.Wheel Building ProcessThe core of the logic lies in thebuildlib.pymodule.A mapping from download URL (often github releases) to pypi platform tag is required.For each platform:Download the release & extract the binary.Set file permissions and place into scripts directory within wheel archive.Create the METADATA and WHEEL files within wheel archive.Place wheel intodist/folder.Once all wheels are constructed, the distribution is uploaded to PyPI.CICD is configured to automatically recognize newPyPIreleases by looking for a diff on the PYPI_VERSION.  When this happens, a build-and-release cycle is performed for that release version.Catalogpip install dive-bin:pybin version,upstream sourcepip install just-bin:pybin version,upstream sourcepip install lazydocker-bin:pybin version,upstream source