Saravanan666/pypi-org huggingface dataset:
Package: bettermoments
bettermomentsMeasuring precise line-of-sight velocities from Doppler shifted lines is essentialwhen looking for small scale deviations indicative of, for example, embedded planets.Do that withbettermoments.InstallationTo install, we recommend using pip:pipinstallbettermomentsUsageThe easiest way to interface withbettermomentsis through the command line. To use the default quadratic method simply use,bettermomentspath/to/cube.fitswhile various other methods, discussed further in the documentation, can be accessed via the-methodflag:bettermomentspath/to/cube.fits-methodzerothA quickbettermoments--helpwill give a quick overview of what options there are.DocumentationMore information can be found in thedocumentation.
Package: betternot
betterNOTToolset for preparing observations with the Nordic Optical Telescope (NOT). Currently only set up to work with ZTF transients. You needFritzcredentials.The observability code is largely based on theNOT Observing Toolsby Steve Schulze.Note theobservation guidelinesInstallationSimply runpip install betternot.If you want to make local changes, clone the repository,cdinto it and issuepoetry install.UsagePrepare observationsThe observation planning can be run with a command line interface. Simply issuenot ZTF23changeit ZTF23thistoo ...This will generate a standard star observability plot, create an observability plot for all ZTF objects, download the finding charts for them from Fritz and print the coordinates as well as the last observed magnitude. They will all end up in thebetternot/DATEdirectory.Optionally, you can specify a desired date with-date YYYY-MM-DD(the default is today). You can also specify a telescope site with-site SITE(available sites are listedhere). Default is the NOT site (Roque de los Muchachos).Uploading spectra to WISeREPYou will need aTNSandWISeREPbot token for this. Uploading spectra can be done as follows:importloggingfrombetternot.wiserepimportWisereplogging.basicConfig()logger=logging.getLogger()logger.setLevel(logging.DEBUG)Wiserep(ztf_id="ZTF23aaawbsc",spec_path="ZTF23aaawbsc_combined_3850.ascii",sandbox=True,quality="high",# "low", "medium" or "high". Default: "medium")This will check TNS if an IAU object exists at the ZTF transient location, open the spectrum, extract the metadata, and upload the file to WISeREP as well as a report containing the extracted metadata.After checking with theWISeREP sandboxthat everything works fine, usesandbox=False
Package: betterpath
betterpath, or “bp”, is an adaptation of the classic TwistedFilePathtype
and interface. bp provides a simple, robust, well-tested object abstraction
over file paths, generalizing the concept of file paths beyond filesystems.File Pathsbp exposes an interface,bp.abstract.IFilePath, for file paths, and
provides the following concrete implementations:bp.filepath.FilePath, for the root filesystembp.zippath.ZipPath, for ZIP archivesbp.memory.MemoryPath, for in-memory temporary filesystemsIn addition, there are combining abstract file paths which can be wrapped
around other file paths:bp.readonly.ReadOnlyPath, for read-only filesystemsAPI documentation is available athttp://betterpath.rtfd.org/.Vs. the Competitionos.pathThe venerable champ,os.pathhas been the cause of (and solution to) most
of Python’s path problems over the years.ProsIn the standard libraryConsUnsafeVerboseOperates on strsNo interfaces or ABCs for functionalityOnly covers the root filesystempathlibpathlib hopes to carve a path towards greatness through PEP 428.ProsConvenient__div__()overloadingConsNo interfaces or ABCs for functionalityOnly covers the root filesystemExamplesSaving Data to DiskThe Old Waydef save(base, fragments, data):
    # `fragments` could contain unsafe paths!
    if ".." in fragments or "." in fragments:
        raise ValueError("Unsafe paths!")
    path = os.path.join(os.path.abspath(base), os.sep.join(fragments))
    # Alternatively: path = os.path.join(os.path.abspath(base), *fragments)
    # I hope that this doesn't fail mid-write! Also, did the directories
    # exist? I think so, yes.
    with open(path, "wb") as handle:
        handle.write(data)The New Waydef save(base, fragments, data):
    path = base.descendant(fragments)
    path.parent().makeDirs()
    path.setContent(data)Changelog0.2Initial release
Package: better-progress
Better-ProgressA progress bar that actually doesn't make assumptions.This package is heavily inspired by theprogresspackage. However, unlike progress, this package handles progress bars in a sane and user-friendly way.Basic usageProgress barsfrombetter_progressimportBarprogress_bar=Bar.Bar(max_value)print(progress_bar)Fillersfrombetter_progressimportFillerfiller=Filler.Filler(max_value)print(filler)Spinnersfrombetter_progressimportSpinner#...spinner=Spinner.Spinner()whileworking:#...spinner.next()print(spinner)Comparisons between progress and better-progressViewing the progress barProgress: the default behavior is to print out the progress bar to stdout upon iteration. There is no other way to get a string representation of the progress bar.Better-progress: nothing is printed out to stdout. Instead, the user can get a string of the progress bar by simply getting the string representation of any of the classes provided in the library.DocumentationProgress: No docstrings, documentation in the repository is severely lacking. Many properties are expected to be in kwargs, making it incredibly difficult to read through the source by hand.Better-progress: Docstrings for every module, class, and function. Nothing should come as a surprise to the user. No reliance on kwargs, except where it makes sense. Type hints are also provided for every parameter and function return.Usage in your codeProgress: Because it automatically prints to stdout, the user needs to work around the library, potentially changing the structure they already have in place.Better-progress: Because this library only tracks state and gives a string upon request, the library can work around the user. The user doesn't need to make any big changes to get the library to work for them.Other featuresProgress has many other features aside from producing a progress bar. It tracks the average time between increments, the elapsed time since starting, and the ETA until completion.Better-progress does not have these features. The philosophy is that this is a package that lets the user create a pretty progress bar, nothing more. If the user wants any of these features, they would be simple enough to include alongside where they use the progress bar.
Package: better-project-forecast
# better-project-forecast[![Build Status](https://travis-ci.org/cmheisel/better-project-forecast.svg?branch=master)](https://travis-ci.org/cmheisel/better-project-forecast) [![Coverage Status](https://coveralls.io/repos/github/cmheisel/better-project-forecast/badge.svg?branch=master)](https://coveralls.io/github/cmheisel/better-project-forecast?branch=master)Averages suck, improve your project forecasting
Package: betterproto-twirp
twirp python sdk generatorpython-betterproto生成的代码只能配合 grpc 使用，但生成的 message 确实很香。所以我重写了 service 代码生成逻辑，使其支持 twirp 协议。我发现可以上传到 pypi，包名是betterproto-twirp安装本地源码安装：pipinstall.从 pypi 安装：pipinstallbetterproto-twirp安装失败的话先安装pipinstall'betterproto-twirp[compiler]'使用protoc -I . --python_betterproto_out=. service.proto改动历史
Package: betterproto-twirp-new
twirp python sdk generatorpython-betterproto生成的代码只能配合 grpc 使用，但生成的 message 确实很香。所以我重写了 service 代码生成逻辑，使其支持 twirp 协议。我发现可以上传到 pypi，包名是betterproto-twirp安装本地源码安装：pipinstall.从 pypi 安装：pipinstallbetterproto-twirp安装失败的话先安装pipinstall'betterproto-twirp[compiler]'使用protoc -I . --python_betterproto_out=. service.proto改动历史
Package: better-proxy
Better ProxyПредставление такой сущности, как proxy в виде класса.МетодProxy.from_str()поддерживает большинство форматом прокси (с протоколом и без):host:port:login:password
host:port@login:password
host:port|login:password
login:password@host:port
login:password:host:port
host:portРеализованы методы__hash__и__eq__, что позволяет засовывть прокси в set()МетодProxy.from_file()возвращает список прокси из файла по указанному путиpipinstallbetter-proxyMore libraries of the family:tweepy-selfbetter-web3importaiohttpfrombetter_proxyimportProxyfromaiohttp_socksimportProxyConnectorasyncdeffetch(url):proxy=Proxy.from_str('socks5://user:password@127.0.0.1:1080')connector=ProxyConnector.from_url(proxy.as_url)asyncwithaiohttp.ClientSession(connector=connector)assession:asyncwithsession.get(url)asresponse:returnawaitresponse.text()
Package: betterpy
BetterThis package extends other packages with functionality that users typically have to implement themselves. Better doesn't redefine or alter the initial implementations, simply adding additional utilites along side.To ensure that there is no misunderstanding, I am not suggesting that any initial implementation is substandard, nor that they were incomplete, far from it, I've used and enjoyed each package. This is a package of code snippets that I've written into various projects while using the respective package and thought that others might find them useful.
Package: betterpyhap
BetterPyHAPBetterPyHAP is a Python package that provides
an updated and improved version of thepyhappackage,
which is used for HomeKit Accessory Protocol (HAP) implementations in Python.FeaturesEasy-to-use Pythonic API for implementing HomeKit accessories and pairing them with iOS devices.Compatible with Python 3.6 and above.Supports advanced features such as bridging multiple accessories and dynamic service creation.Includes improvements and bug fixes over the originalpyhappackage.InstallationYou can install BetterPyHAP via pip:
pip install betterpyhapLicense
BetterPyHAP is licensed under the apache License. See the LICENSE file
in the source distribution for more information.
Package: betterpy-i-make-modules
betterpyThebetterpypackage minimizes your python coding experience. and if you expected a function that finds the sum of a list, usesum(), it's built-in. by the way, there are a lot of functions that change your print color. if you wanna see them all and you have an autofill IDE/Text Editor. typeprint_into see them all. also if you want the source code, seesrc/betterpy_i_make_modules/betterpy.pyEnd of long description
Package: better-pynamite
better_pynamiteAddedbetter_because the namepynamitewas already taken.Setup and installationSimply install withpip install better_pynamiteImport in victim scriptimport better_pynamiteLet the chaos unfoldTodo[for when I/someone else opens this repo again after ages][ ] Add a way to configure the probability fo crashing during import. Right now it has been set to0.5which is VERY high, especially if you're trying to be sneakyA word of cautionThis package is a product of boredom + my chaotic mind and is not intended to cause harm to anyone in any way. Please use it at your own risk or for any pranks you might like. I DO NOT take any responsibility for any consequences arising out of your actions using this package.On the other hand, if you have any witty ideas, please feel free to open an issue and we can have a chat to see if it's a good idea to add it here!
Package: better-python-lists
Better Python ListsMakes lists in Python better, by adding some useful methods.List.compact()- removes allNonevalues from the List.List.flatten()- flattens an arbitrarily nested List.Installationpip install better-python-listsBasic UsageList([1,None,2,3,4,None,None,5]).compact()# => List[(1, 2, 3, 4, 5)]List([["a"],"b",5,[6,7,[8,9,[10]]]]).flatten()# => List(["a", "b", 5, 6, 7, 8, 9, 10])DetailsCompactThecompactmethod is inspired byRuby'sArray.compact.
It removes allNoneelements from the List, returning a copy of the List.frombetter_python_listsimportListmy_list=List([1,None,2,3,4,None,None,5])compact_list=my_list.compact()print(compact_list)# => [1, 2, 3, 4, 5]You can also perform in-place compacting using thecompactedmethod:print(my_list)# => [1, None, 2, 3, 4, None, None, 5]my_list.compacted()print(my_list)# => [1, 2, 3, 4, 5]If you want to filter out more than justNone, you can pass in an optional filter list:another_list=List([1,"None",2,None,3,"N/A"])another_list.compacted(filter_list=[None,"None","N/A"])print(another_list)# => [1, 2, 3]FlattenThe methodsflattenandflattenedflatten an arbitrarily nested List into a
single-level one.nested_list:List=List([["a"],"b",5,[6,7,[8,9,[10]]]])flat_list=nested_list.flatten()print(flat_list)# => ["a", "b", 5, 6, 7, 8, 9, 10]As withcompact/compacted,flattencreates a copy of the List, andflattenedperforms in-place replacement.
Package: betterreplitdb
Better Replit DB (Python)Adds a memcache to the standard replit databaseTo perform database operations such as reading, writing and deleting data, the officialreplitpackage simply sends the corresponding request to your REPL's database URL. However, this can be made more efficient by caching the database in RAM using a python dictionary, initialized when the database is created/when the REPL starts. ForAsyncDatabase, read operations read from the cache and update/delete operations will update the cache, then perform the action asynchronously as before. The same occurs for the synchronousDatabasebut with regular/synchronous update operations.UsageAsync:Replacefromreplit.databaseimportAsyncDatabaseasync_db=AsyncDatabase(replit_db_url)withfrombetterreplitdbimportAsyncDatabaseasync_db=AsyncDatabase(replit_db_url)async_db.init_cache()Note: Replit'sdocssay that you need to use AsyncDatabase() to construct a DB. This is false, please useAsyncDatabase(environ["REPLIT_DB_URL"])instead, where environ isos.environ.Sync:ReplacefromreplitimportdbwithfrombetterreplitdbimportdbVersion TrackingThis repo is up to date with themain repowith commits:replit@b36030adatabase.pyreplit@a48d6a2src/replit/database/default_db.pyreplit@59225fbunit testsIf these are not the latest commits on these files, please open an issue/PR.CopyrightThis repo is forked from Replit's, which is licensed under the ISC license, as is this project.Copyright disclaimer for replit/replit-pyCopyright 2021 Replit

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Package: better-requests
better-requests:HTTP for Humans that do rightA good design makes it intuitive and convenient to do right,better-requestsis a wrapper forrequeststhat makes default behaviors right.Default value of timeout is 30s (configurable) instead of forever, no need to specify timeout explicitly everywhere.Non-successful responses raise by default, no need to call raise_for_status explicitly everywhere.UsageWrite this:>>>importbetter_requestsasrequests>>>r=requests.get('https://www.python.org')>>>'Python is a programming language'inr.contentTrueInstead of:>>>importrequests>>>>>># You need to explicity specify timeout everywhere, or, BOOM!...r=requests.get('https://www.python.org',timeout=30)>>>>>># And explicity check status_code before reading content, everywhere, or, BOOM!...r.raise_for_status()>>>>>># And do things finally after all the ceremonies...'Python is a programming language'inr.contentTrueWhen you need to configure default timeout, either set it globally:>>>importbetter_requestsasrequests>>>requests.Session.default_timeout=5>>>>>>r=requests.get('https://www.python.org')>>>'Python is a programming language'inr.contentTrueOr per session:>>>importbetter_requestsasrequests>>>withrequests.Session()ass:>>>s.default_timeout=5>>>s.get('https://httpbin.org/get')It works just as expected.
Package: better-rich-prompts
English readmebetter-rich-prompts is a Python extension library forRich.ThisLibrarymakes it easy to use lists and dictionaries as choices forprompt.ask.CompatibilityThis library should workInstallingpython-mpipinstallbetter-rich-promptsUsing List PromptExample 1 - Using list of dictionariesfrombetter_rich_prompts.promptimportListPromptchoices=[{"name":"english","language_code":"en"},{"name":"spanish","language_code":"es"},{"name":"french","language_code":"fr"},]ListPrompt.ask("Select a language",choices,choice_key="name")Example 2 - Using list of stringsfrombetter_rich_prompts.promptimportListPromptchoices=["en","es","fr"]ListPrompt.ask("Select a language",choices,default="en")Example 3 - Using list of custom objectsfrombetter_rich_prompts.promptimportListPromptclassLanguage:def__init__(self,name,code):self.name=nameself.code=codechoices=[Language("english","en"),Language("spanish","es"),Language("french","fr"),]ListPrompt.ask("Select a language",choices,default="en",choice_key=lambdac:c.code)Using Dict Promptfrombetter_rich_prompts.promptimportDictPromptchoices={"en":"english","es":"spanish","fr":"french"}DictPrompt.ask("Select a language",choices)
Package: better-safe-than-sorry
Better Safe Than SorryThis repository is part of the paperBetter Safe Than Sorry! Automated Identification of Breaking Security-Configuration Rulesaccepted at the4th ACM/IEEE International Conference on Automation of Software Test (AST).Institutions like theCenter for Internet Securitypublish security-configuration guides(also called benchmarks) that help us configure systems more securely.
This configuration hardening can mitigate the risk of successful attacks, which may cause damage to our systems and data.
A remaining problem with applying these guides are so-called "breaking rules."
Applying breaking rules on a production system will break at least one functionality with the corresponding ramifications.
We could safely apply the remaining rules if we identified all breaking rules and removed them from the guide.Our new approach combines techniques from software testing, machine learning, and graph theory to automatically identify these breaking rules.
This repository includes our Python scripts togenerate the covering arrays from a given security-configuration guideTest the different covering arraysAnalyze the results to find the breaking rulesOne can redo all our experiments presented in the article using the code in this repository.SetupWith PyPiThe easiest way to use the scrips in this repository is to install the package from PyPipipinstallbetter-safe-than-sorry
better-safe-than-sorry--versionWith PoetryOne can also use poetry to install the dependencies.cd/path/to/better-safe-than-sorry/
poetryinstall
poetryrunbetter-safe-than-sorry--versionStepsGenerate Profiles based on Covering ArraysSeehere.Test ExecutionSimulationSeehere.Test Execution with VagrantSeehereTest Result AnalysisSeehere.ResourcesSfera Automation filesThe folderrsc/sfera_automation_jsonscontains variants ofsfera_automation.jsonfiles based on the Windows 10 version 1909 guide by the Center for Internet Security.sfera_automation.jsonis a JSON-based file format used at Siemens to automatically implement Windows-based security-configuration guides.
We generated the variants were generated using the IPOG and IPOG-D algorithms and include custom profiles for combinatorial testing of strength 2 to 5.ContactIf you have any questions, please create an issue or contactPatrick Stöckle.
Package: better-setuptools-git-version
better-setuptools-git-versionAutomatically set package version from Git. This is a re-release ofvery-good-setuptools-git-versionwith fixes and improvements, which is itself a re-release ofsetuptools-git-versionIntroductionInstead of hard-coding the package version insetup.pylike:setup(name='foobar',version='1.0',...)this package allows to extract it from tags in the underlying Git repository:setup(name='foobar',version_config={"version_format":"{tag}.dev{sha}","starting_version":"0.1.0"},setup_requires=['better-setuptools-git-version'],...)The tool uses the semantically-latest tag as the base version. If there are no annotated tags, the version specified bystarting_versionwill be used. IfHEADis at the tag, the version will be the tag itself. If there are commits ahead of the tag, the first 8 characters of the sha of theHEADcommit will be included.In all of the above cases, if the working tree is also dirty or contains untracked files, a+dirtysuffix will be appended to the version.
Package: bettershot
bettershot 💡🚀⚡️ A Python package for adding error monitoring to LLM Apps in a few minutes ⚡BetterShot by BerriAI let’s you add error (hallucinations/refusal to answer) monitoring to your LLM App in a few minutes. Like Bugsnag/Sentry for LLM apps!Getting StartedInstall bettershot by running this command.:pip install bettershotUsing bettershotIt's just 1 line of code:log(messages=messages, completion=result, user_email="YOUR_EMAIL", query=query)DashboardAll your logs are available @ 'https://better-test.vercel.app/' + YOUR_EMAILe.g.log(messages=messages, completion=result, user_email="krrish@berri.ai", query=query)will have it's results logged @https://better-test.vercel.app/krrish@berri.aiImplementationHere are all the items you can log:ParameterTypeRequired/OptionalDescriptionmessagesListRequiredThe list of messages sent to the OpenAI chat completions endpointcompletionDictionaryRequiredThe response received from the OpenAI chat completions endpointuser_emailStringRequiredYour user emailqueryStringRequiredThe query being asked by your usercustomer_idStringOptionalA way to identify your customerHere's 2 examples of using it:Calling the 'raw' OpenAI APIfrom bettershot import log
import openai 

def simple_openai_call(query):
    messages = [{'role': 'user', 'content': query}]
    completion = openai.ChatCompletion.create(
                model="gpt-3.5-turbo",
                messages=messages
    
            )
    log(messages=messages, completion=completion, user_email="YOUR_EMAIL", query=query, customer_id="fake_user@fake_accounts.xyz") #JUST 1 LINE OF CODE 🤯

simple_openai_call("hey! how's it going?")Calling the Langchain OpenAI APIimport openai
import langchain 
from bettershot import log

def simple_langchain_call(query):
    chat = ChatOpenAI(model="gpt-3.5-turbo", temperature=0.7)
    prompt = "You are an extremely intelligent AI assistant for BerriAI, answer all questions resepectfully and in a warm tone"
    messages = [
      SystemMessage(content=prompt),
      HumanMessage(content=query)
    ]
    result = chat(messages)
    log(messages=messages, completion=completion, user_email="YOUR_EMAIL", query=query, customer_id="fake_user@fake_accounts.xyz") #JUST 1 LINE OF CODE 🎉 

simple_langchain_call("hey! how's it going?")bettershot automatically evaluates your OpenAI responses to determine if the model either invented new information (hallucination) or refused to answer ("Sorry, as an AI language model...") a user's question.How does eval work?Reliable + Fast testing is hard, and that's what we want to tackle.Each question is evaluated 3 times.Each evaluation returns either True or False, along with the model's rationale for why it chose what it did.We pick the evaluation (True/False) that occurs most, along with the model rationale to explain reasoning.Each question is run in parallel and results are added to your dashboard in real-time.We will be sharing the prompts soon!ContributingWe welcome contributions to bettershot! Feel free to create issues/PR's/or DM us (👋 Hi I'm Krrish - +17708783106)Licensebettershot is released under theMIT License.