Saravanan666/pypi-org huggingface dataset:
Package: localrag
localraglocalragis a Python package enabling users to "chat" with their documents using a local Retrieval Augmented Generation (RAG) approach, without needing an external Large Language Model (LLM) provider.It allows for quick, local, and easy interactions with text data, extracting and generating responses based on the content.FeaturesLocal Processing: Runs entirely on your local machine - no need to send data externally.Customizable: Easy to set up with default models or specify your own.Versatile: Use it for a variety of applications, from automated Q&A systems to data mining. You add files, folders or websites to the index!PrerequisitesBefore you install and start usinglocalrag, make sure you meet the following requirements:Ollama for Local Inferencelocalraguses Ollama for local inference, particularly beneficial for macOS users. Ollama allows for easy model serving and inference. To set up Ollama:Download and run the appFrom command line, fetch a model from thislist of options: e.g.,ollama pull llama2When the app is running, all models are automatically served on localhost:11434InstallationTo installlocalrag, simply use pip:pipinstalllocalragQuick StartHere's a quick example of how you can use localrag to chat with your documents:Here is an example in test.txt in the docs folder:I have a dogimportlocalragmy_local_rag=localrag.init()# Add docsmy_local_rag.add_to_index("./docs")# Chat with docsresponse=my_local_rag.chat("What type of pet do I have?")print(response.answer)print(response.context)# Based on the context you provided, I can determine that you have a dog. Therefore, the type of pet you have is "dog."# [Document(page_content='I have a dog', metadata={'source': 'docs/test.txt'})]Website Exampleimportlocalragmy_local_rag=localrag.init()my_local_rag.add_to_index("https://github.com/banjtheman/localrag")response=my_local_rag.chat("What is localrag?")print(response.answer)# Based on the context provided in the GitHub repository page for "banjtheman/localrag", localrag is a chat application that allows users to communicate with their documents locally...More examples in thetestsfolder.localrag config optionsHere is how you can configure localrag:importlocalragmy_local_rag=localrag.init(llm_model="llama2",# Can choose from ollama models: https://ollama.ai/libraryembedding_model="BAAI/bge-small-en-v1.5",# Can choose variations of https://huggingface.co/BAAI/bge-large-en-v1.5, top 5 embedding model https://huggingface.co/spaces/mteb/leaderboarddevice="mps",# can set device to mps, cpu or cuda:Xindex_location="localrag_index",# Location of the vectorstoresystem_prompt="You are Duck. Start each response with Quack.",# Custom system prompt)my_local_rag.add_to_index("./docs")# can change the URL of the ollama server with my_local_rag.llm.base_url = "http://ollama:11434"# Can use openai models with# my_local_rag.setup_openai_llm(model="gpt-3.5-turbo",temp=0)LicenseThis library is licensed under the Apache 2.0 License. See the LICENSE file.
Package: local-reload
local_reloadProvides a means of identifying and automatically reloading "stale" pages.Keeps a "last update time" in localStorage, and updates it whenever the user "updates data". Any time the user "returns" to a page (via browser history, or switches tabs/windows), that page will automatically reload if it is stale (if it was rendered before the last update time).Intended for use on CRUD heavy sites, especially when you use history.back() or use multiple tabs/windows as part of the normal workflow.LimitationsUpdate Time is Per-BrowserIf data is updated in one browser, it will not reload pages in another browser. This is designed for a single user updating and viewing data in a single browser. We usewindow.localStorageto store the update time, so our scope is the same as that of localStorage (hence the name "local_reload").Update Time is Site-WideA single, site-wide "update time" is maintained. A change in one piece of data will invalidate all previously rendered pages, even if they do not display that data.Update DetectionWe automatically reset the update time when any form is POSTed. To be more precise - we reset the update time on every form submit event, as long as the form's method is not GET.This works well if you use actual form submissions (even if handled via javascript) as the event which triggers data updates. If you update data without the user submitting a form, then you must manually callwindow.local_reload_invalidate().No Background ReloadPages will not be reloaded in background tabs/windows. They will only be reloaded when the user returns focus to them. This is actually by design. Previous attempts to reload background windows/tabs resulted in undesirable behaviour in many situations.Installationpip install local_reloadadd 'local_reload' toINSTALLED_APPS{% include "local_reload/local_reload_support.html" %}in thehead*of any page that displays or updates data*This should be added near the top of yourhead, so it can run as early as possible.window.disable_local_reloadSet this to true if you want to temporarily/conditionally disable local reload on the given window.NavTricksWe include a copy of NavTricks.js in our static files. This script pairs perfectly with local_reload.
Package: localres
localresPlot the histogram of local resolution values of a cryo-EM reconstruction.From a cryo-EM reconstruction, one can calculate local resolution and generate a
color-coded 3D map showing local resolution across the 3D reconstruction (or
within slices of it). This command-line tool complements this by allowing one to
quantitatively answer the question "how many map voxels inside the mask have a
given local resolution?". This tool generates a histogram of local resolution
values from a local resolution map and a mask (relion_locres.mrcandmask.mrcfiles from RELION, respectively;cryosparc_*_map_locres.mrcandcryosparc_*_volume_mask_refine.mrcfrom cryoSPARC, respectively).FAQQ:Doesn't RELION already do this?A:Yes, RELION-3.1 already prints out this histogram. This tool, however,
doesn't require an installation of RELION, allowing one to inspect files quickly
from a different computer. This tool also lets you adjust the number of bins in
the histogram, and save the histogram as an SVG file (which is useful for
adjusting styling to make a pretty figure).Q:Doesn't cryoSPARC already do this?A:Yes, cryoSPARC already prints out this histogram. This tool, however,
doesn't require an installation of cryoSPARC, allowing one to inspect files
quickly from a different computer. This tool also lets you adjust the number of
bins in the histogram, and save the histogram as an SVG file (which is useful
for adjusting styling to make a pretty figure).Q:Will it work with MRC files produced by my favorite software (not RELION
or cryoSPARC)?A:If these MRC files have the same structure, then yes. But I don't know
for sure, because this tool has only been tested with files produced by RELION
and cryoSPARC.AcknowledgmentsI would not have been able to put this tool together without themrcfilelibrary.I reused code suggested by@biochem_fan. My
contribution was simply to package it into a command-line tool that's documented
and easy to install.InstallationI recommend to install this tool in a dedicated conda environment. You can
create one like so (replaceENV_NAMEwith the name you want to give to this
environment):$ conda deactivate
$ conda create --name ENV_NAME python=3.9
$ conda activate ENV_NAMEOnce the conda environment is active, you can install the tool with the
following command:$ pip install localresUsage$ localres --help
Usage: localres [OPTIONS] <relion_locres.mrc> <mask.mrc>

  Plot a histogram of local resolution values from a local resolution map
  and a mask both produced by RELION.

  For meaningful results, the mask.mrc file must be the one used for the 3D
  refinement and post-processing jobs that produced the relion_locres.mrc
  file.

Options:
  -t, --title TEXT    Title of the histogram (default: no title).
  -b, --bins INTEGER  Number of bins in the histogram (default: 100).
  -o, --output TEXT   File name to save the histogram (optional: with no file
                      name, simply display the histogram on screen without
                      saving it; recommended file formats: .png, .pdf, .svg or
                      any format supported by matplotlib).

  -h, --help          Show this message and exit.
Package: local-resources
Local ResourcesThis project is easy attempt to emulate Java's Class.getResource() method.It provides simple access to files that are 'reachable' from directories and/or zip files referenced
in PYTHONPATH.UsageExample:fromlocal_resourcesimportResourcewithResource("VERSION")asf:version=f.read()It returns read-only file object in binary mode.Aside of reading knowing files it provides 'list' method which is similar toos.listdir(path)with one
caveat - directories are always returned with '/' appended:fromlocal_resourcesimportResourcefiles_and_dirs=Resource("").list()forfinfiles_and_dirs:iff.endswith("myfiles/to_print_on_screen"):print(f"Do something with path{f}")else:withResource(f)asfile:print(f"File{f}:")print(file.read().decode('utf-8'))Note: whenlist()' method is called there are no resources held after it finished, so there is no need forwith` statement, nor cleaning up/closing resources at the end.Note: for root of PYTHONPATH directories use"""or"/":Resource("").list().
Package: local-responder
Local ResponderLocal Responder is a helper context manager that creates a web server with just
one view that has only one purpose, to return simple predefined data.This is created just for the purpose of using in tests, to mock out an API in a
very simple manner. It's mostly useful for a blackbox like test where you are
mocking out an external API while making requests to the "blackbox" api.UsageYou can import therespondfunction and use it as an asynchronous context managerimportasyncioimportaiohttpfromlocal_responderimportrespondasyncdeffunc()->None:asyncwithaiohttp.ClientSession()assession:asyncwithrespond(json={"status":"OK"},path="/health",method="get",status_code=200,)asapi:response=awaitsession.get("http://localhost:5000/health",params={"foo":"bar"})data=awaitresponse.json()assertdata=={"status":"OK"}assertresponse.status==200assertlen(api.calls)==1assertapi.calls[0].query=={"foo":"bar"}asyncwithrespond(json={"status":"Error"},path="/health",method="get",status_code=500,):response=awaitsession.get("http://localhost:5000/health")data=awaitresponse.json()assertdata=={"status":"Error"}assertresponse.status==500if__name__=="__main__":asyncio.run(func())The context manager will raise an error if a request is made to an undefined
path or using an unsupported method.You need to provide one ofjson,textorbodyfor the view to return, the
other arguments are all optional, defaulting to creating aGETview with a
status code 200 and listen on port 5000.Request trackingEach request made to the view while it is alive is tracked. The tracker simply
tracks the request method, path, headers, query and json payload if there is
one. Each tracked request is stored in aRequestTrackerinstance that is
yielded from the context manager. Example of call verification is in the
example above.
Package: localsearchsolverpy
Local Search Solver (Python)A solver based on local search.This is the Python3 version of the C++ packagefontanf/localsearchsolver.DescriptionThe goal of this repository is to provide a simple framework to quickly implement algorithms based on local search.Solving a problem only requires a couple hundred lines of code (see examples).Algorithms:Restarting Local Searchrestarting_local_searchIterated Local Searchiterated_local_searchExamplesTravelling Salesman ProblemKnapsack ProblemUsage, running examples from command lineInstallpip3installlocalsearchsolverpyRunning an example:mkdir-pdata/travellingsalesman/instance
python3-mexamples.travellingsalesman-agenerator-idata/travellingsalesman/instance
python3-mexamples.travellingsalesman-arestarting_local_search-idata/travellingsalesman/instance_50.json
python3-mexamples.travellingsalesman-aiterated_local_search-idata/travellingsalesman/instance_50.jsonUpdate:pip3install--upgradelocalsearchsolverpyUsage, Python librarySee examples.
Package: local-selenium-pool
A local selenium pool for increased testing performance without requiring multiple hosts. multiprocessing-on-dill is used to provide a configurable number of Chrome webdriver instances on which to simultaneously run selenium tests. Each instance reuses its applicationCacheEnabled = False webdriver for multiple tests, erasing all cookies between tests.  After the pool of webdrivers has no remaining tests to execute, it creates a JSON report in an XUnit style.
Package: local-sfmx
LocalSoftmaxLocal Softmax parallelize the softmax computation by splitting the tensor into smaller sub-tensors and applying the softmax function on each of these smaller tensors independently. In other words, we want to compute a "local" softmax on each chunk of the tensor, instead of on the entire tensor.AppreciationLucidrainsAgoriansInstallpip install local-sftmxUsageimporttorchfromlocal_sfmximportlocal_softmaxtensor=torch.rand(10,5)result=local_softmax(tensor,2)print(result)Algorithmfunction LocalSoftmax(tensor, num_chunks):
split tensors intonum_chunkssmaller tensors
for each smaller tensor:
apply standard softmax
concatenate the results
return concatenated tensorLicenseMIT
Package: localshop
localshop=========.. image:: https://img.shields.io/pypi/v/localshop.svg:target: https://pypi.python.org/pypi/localshop/:alt: Latest Version.. image:: https://travis-ci.org/mvantellingen/localshop.svg?branch=develop:target: https://travis-ci.org/mvantellingen/localshop.. image:: http://codecov.io/github/mvantellingen/localshop/coverage.svg?branch=develop:target: http://codecov.io/github/mvantellingen/localshop?branch=develop.. image:: https://requires.io/github/mvantellingen/localshop/requirements.svg?branch=develop:target: https://requires.io/github/mvantellingen/localshop/requirements/?branch=develop:alt: Requirements StatusA PyPI server which automatically proxies and mirrors PyPI packages basedupon packages requested. It also supports the uploading of local (private)packages.The full documentation is available on `Read The Docs`_.. _`Read The Docs`: http://localshop.readthedocs.org/
Package: localsockets
This python package is designed to transfer binary data between Python scripts easily. 
This package uses a filesystem server to store data even when your program is closed 
and is not limited to RAM storage, but instead, your Hard Drive storage.Basic Usage:Script 1:import localsockets
    s = localsockets.socket()
    id = s.id
    # send s.id to the other script
    # wait until other script connects
    while not s.connected():
        pass
    # Now something has connected to our server. 
    s.send(b'hello') # send some data
    # servers can also receive data
    s.opend() # False
    s.connected() # False
    s.open() # reopen the server. Now you can reconnect.Script 2import localsockets
    id = # your received id
    s = localsockets.socket(id)
    s.connected() # True
    s.recv(1024) # receive up to 1024 bytes of data; returns b'hello'
    # connections can also send data
    s.close() # disconnect
    s.opened() # False
    s.connected() # FalseSaving servers to a custom directory:import localsockets
    localsockets.SERVER_DIR = "< Your new directory > "
Package: localspelling
Local spellingDeveloped by Fast Data Science,https://fastdatascience.comSource code athttps://github.com/fastdatascience/localspellingPython library for localising spelling between British and American conventions, conserving case.Please note this library converts only spelling variants such as US “honour” vs UK “honor”.It does not localise vocabulary such as “pavement” vs “sidewalk” or “aubergine” vs “eggplant”.It also does not localise spellings where there is more than one correct conversion, such as US “program”, which corresponds to both “programme” and “program” in British spelling.RequirementsPython 3.6 and aboveInstallationpip install localspellingUsage examplesExample 1fromlocalspellingimportconvert_spellingconvert_spelling("it has been an honor","gb")outputs ‘it has been an honour’Example 2: you can retrieve the dictionary used for the single words (this won’t match wildcards like ‘-isation’)fromlocalspellingimportget_dictionaryget_dictionary("us")["honour"]outputs ‘honor’Who to contactThomas Wood athttps://fastdatascience.com
Package: localsql
LocalSQLis for querying local csv, xlsx, json files using SQL.If you like the idea of pipeliner click ⭐ on the repo and stay tuned.Installpipinstallgit+https://github.com/localsql/localsqlUsage$ lsql --help
usage: lsql [-h] [-d DIRECTORY] [-r] [-q QUERY] [-v] [-s] [-jn] [--version] [files [files ...]]

Querying local files using SQL.

positional arguments:
  files                 Files with tables: csv, xlsx, json.

optional arguments:
  -h, --help            show this help message and exit
  -d DIRECTORY, --directory DIRECTORY
                        Search files in this directory.
  -r, --recursive       Search files in the directory and subdirectories.
  -q QUERY, --query QUERY
                        Run SQL query and return result.
  -v, --verbose         Verbose mode.
  -s, --silent          Silent mode.
  -jn, --json-normalize
                        JSON normalize.
  --version, -V         show program's version number and exitSQL syntaxLocalSQL usesSQLite syntax.Use casesTo repeat the use cases get the repository:$cd~&&gitclone--depth1https://github.com/localsql/localsql&&cdlocalsql
$lsql-dexamples
examples/one.json:table=one_json,columns=4,rows=3examples/lines.json:table=lines_json,columns=3,rows=3examples/nested.json:table=nested_json,columns=5,rows=3examples/excel.xlsx:table=excel_xlsx,columns=3,rows=5examples/csv.csv:table=csv_csv,columns=3,rows=3lsql>Interactivelsql>select*fromexcel_xlsxidbc01611127122381334914451015lsql>SELECT*FROMexcel_xlsxeLEFTJOINone_jsonjONe.id=j.ididbcidbcd016111.04.0NaNNaN127122.0NaN5.0NaN238133.0NaNNaN6.034914NaNNaNNaNNaN451015NaNNaNNaNNaNNot interactive$lsql-dexamples-q"SELECT c, count(*) as cnt FROM one_json GROUP BY c ORDER BY 1 ASC NULLS LAST"-sccnt05.011NaN2Transpose outputTo transpose the output add/tto the end of query:lsql> SELECT * FROM nested_json LIMIT 1 /t
id                1
nest.a            1
nest.b    [1, 2, 3]
nest           None
c              None
Name: 0, dtype: objectPython modelsql> \lpy
lpy> print(self.tables['csv_csv'])
   id  b  c
0   1  4  7
1   2  5  8
2   3  6  9Pretty printlsql> \pp
Pretty print ON
lsql> select * from one_json
╭─────┬─────┬─────┬─────╮
│  id │   b │   c │   d │
├─────┼─────┼─────┼─────┤
│   1 │   4 │ nan │ nan │
│   2 │ nan │   5 │ nan │
│   3 │ nan │ nan │   6 │
╰─────┴─────┴─────┴─────╯
Package: localstack-extension-authress
LocalStack Extension for Authress Authentication and AuthorizationThis is theLocalStackextension that enables running authentication, user identity, permissions, api key management, and access control in yourLocalStack environmentviaAuthress.This LocalStack extension generates a copy of theAuthress APIso that the authentication and access management the Authress API provides can be utilized by running services directly in any environment. You can use this to build authentication and authorization directly into your applications and services. Additionally, this extension can be used locally to develop faster without needing anAuthress Account.InstallationTo install the Authentication & Authorization extension into LocalStack, runlocalstackextensionsinstalllocalstack-extension-authressUsageThe auth extension runs athttp://authress.localhost.localstack.cloud:4566.You can configure API calls to the authorization server by passing this url as theauthressApiUrlor theauthress_api_urldepending on which SDK you are using.import{AuthressClient}from'authress-sdk';constauthressClient=newAuthressClient({authressApiUrl:`http://authress.localhost.localstack.cloud:4566`});awaitauthressClient.userPermissions.authorizeUser(userId,resourceUri,permission);Knowledge BaseReview the in depth guides in theAuthress Local KB.Contribution GuideDeveloping for the LocalStack Authress Extension
Package: localstack-extension-diagnosis-viewer
Diagnosis ViewerView the diagnostics endpoint directly in localstackAccess Diagnosis DataThe extension is a web UI for the diagnosis endpoint of LocalStack, which is enabled when LocalStack is started withDEBUG=1and available atcurl -s localhost:4566/_localstack/diagnose.
The web UI can then be reached athttp://localhost:4566/diapretty.InstallationInstall the extension by running:localstackextensionsinstalllocalstack-extension-diagnosis-viewerDevelopmentInstall local development versionTo install the extension into localstack in developer mode, you will need Python 3.10, and create a virtual environment in the extensions project.In the newly generated project, simply runmakeinstallThen, to enable the extension for LocalStack, runlocalstackextensionsdevenable.You can then start LocalStack withEXTENSION_DEV_MODE=1to load all enabled extensions.
Make sure to also setDEBUG=1so the diagnose endpoint necessary to populate the report is loaded.EXTENSION_DEV_MODE=1DEBUG=1localstackstart
Package: localstack-extension-httpbin
LocalStack httpbin extensionA simple HTTP Request & Response Service directly in LocalStack
usinghttpbin.
Get the full httpbin experience directly in LocalStack without connecting to httpbin.org!The httpbin API is served through the hostnamehttp://httpbin.localhost.localstack.cloud:4566.InstallInstall the extension by running:localstackextensionsinstalllocalstack-extension-httpbinUsageOpeninghttp://httpbin.localhost.localstack.cloud:4566in the browser will show you the flasgger UI:And you can call the API endpoints just as you would httpbin.org.DevelopmentInstall local development versionTo install the extension into localstack in developer mode, you will need Python 3.10, and create a virtual
environment in the extensions project.In the newly generated project, simply runmakeinstallThen, to enable the extension for LocalStack, runlocalstackextensionsdevenable.You can then start LocalStack withEXTENSION_DEV_MODE=1to load all enabled extensions:EXTENSION_DEV_MODE=1localstackstartLicensinghttpbin is licensed under the ISC license:https://github.com/postmanlabs/httpbin/blob/master/LICENSEThe httpbin source code is vendored with this extension, slight modifications were made to make it
compatible with the latest Python and Werkzeug version.
The modifications retain the ISC licenseThe extension code is licensed under the Apache 2.0 License
Package: localstack-extension-lambda-appconfig
LocalStack Lambda AppConfig ExtensionThis is a simple extension to enable the Lambda AppConfig extension in LocalStack:https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions.htmlInstallationDetails following soon ...DevelopmentRun the following commands, with a LocalStack Pro instance running:$ make install
$ make build
$ make enable
# to restart the main process and load the extension:
$ docker exec localstack_main kill -sSIGUSR1 1Change Logv0.1.0: Initial releaseLicense(c) 2023+ LocalStack