Saravanan666/pypi-org huggingface dataset:
Package: dendrite
Barebones social connection library. Tries to not do everything so you
can do anything. Only OAuth1 and OAuth2 currently. Python 3 compatible.UsageDendrite doesn’t give you any models, URLS or finished views. It’s up to
you to define the behaviour, URLs and models. An example using Instagram
follows.``models.py``We copy the full Instagram profile. If you don’t want the full profile,
you can change the behaviour ofOAuth2CallbackView.create_profilein
your views.classInstagramProfile(models.Model):id=models.CharField(max_length=255,primary_key=True)username=models.CharField(max_length=255,blank=True)full_name=models.CharField(max_length=255,blank=True)profile_picture=models.URLField(blank=True)bio=models.TextField(blank=True)website=models.URLField(blank=True)user=models.ForeignKey(settings.AUTH_USER_MODEL,related_name='instagram_profiles')access_token=models.CharField(max_length=255,blank=True)def__unicode__(self):returnself.full_name``views.py``Create views to handle connection. You can customize the views to behave
differently.fromdendrite.viewsimportOAuth2Mixin,OAuth2ConnectView,OAuth2CallbackViewfrom.modelsimportInstagramProfileclassInstagramMixin(OAuth2Mixin):client_id=settings.INSTAGRAM_CLIENT_IDclient_secret=settings.INSTAGRAM_CLIENT_SECRETsite='https://api.instagram.com'authorization_url='https://api.instagram.com/oauth/authorize/'token_url='https://api.instagram.com/oauth/access_token'redirect_uri='callback'# Name or full URLprofile_class=InstagramProfilescope="basic"classInstagramConnectView(InstagramMixin,OAuth2ConnectView):passclassInstagramCallbackView(InstagramMixin,OAuth2CallbackView):defget_remote_profile(self,request,token):returntoken["user"]``urls.py``Includeyoursocial views into your urls.urlpatterns=patterns('',url('^social/instagram/connect/$',InstagramConnectView.as_view(),name='connect'),url('^social/instagram/callback/$',InstagramCallbackView.as_view(),name='callback'),)``backends.py``Create an additionalauthentication
backendthat usesInstagramProfile.DendriteBackendobjects receive the profile class and the full
profile information returned byInstagramCallbackView.get_remote_profile.fromdendrite.backendsimportDendriteBackendfrom.modelsimportInstagramProfileclassInstagramBackend(DendriteBackend):profile_class=InstagramProfile``settings.py``Adding API keys and authentication backend.AUTHENTICATION_BACKENDS=('django.contrib.auth.backends.ModelBackend','app.InstagramBackend',)INSTAGRAM_CLIENT_ID=os.environ.get('INSTAGRAM_CLIENT_ID','')INSTAGRAM_CLIENT_SECRET=os.environ.get('INSTAGRAM_CLIENT_SECRET, '')
Package: dendritecli
DendritecliA friendly command line interface for managing Dendrite admin APIs.InstallingYou will need python 3.10 or later. You will also needpipx(pip install pipx && python3 -m pipx ensurepath)You can then install dendritecli with the following command:pipxinstallgit+https://github.com/nexy7574/dendritecli.gitor, as a library:pipinstallgit+https://github.com/nexy7574/dendritecli.gitUsageAs a command line toolpipxcreates two commands (in$HOME/.local/binon Linux):dendriteclianddendrite-cli.
They are identical, so you can use either one.You can get help withdendritecli --helpordendritecli <command> --help.TheConfiguration Filesection describes how to configure dendritecli.As a libraryYou can use dendritecli as a library. The main entry point isdendritecli.api.HTTPAPIManager.fromdendritecli.apiimportHTTPAPIManagermanager=HTTPAPIManager(access_token="<access token>")Configuration FileYou can configure dendritecli with a configuration file. The default location is$HOME/.config/dendritecli.toml,
or if$HOME/.configdoes not exist,$HOME/.dendritecli.toml.The configuration file supports the following options:access_token="<the access token from your homeserver>"server="<the URL of your homeserver>"# e.g: matrix-client.matrix.org, not matrix.orgoverride-password-length-check=false# Due to a bug in Dendrite (https://github.com/matrix-org/dendrite/issues/3012), passwords cannot be over 72 bytes# in length (usually). If you want to override this check, set this to true.# You shouldn't do this unless you know your homeservertimeout=60.0# the timeout for requests, in seconds. Includes connect, read, and write timeouts.# By default, the library has a 10 second connect timeout, 3 minute read timeout (for long responses),# and a 1 minute write timeout. This has been specially tuned for Dendrite servers.# If you're having issues with timeouts (due to a slow homeserver), feel free to bump this to a higher value,# like 600 (10 minutes).[proxies]# By default, if these arent specified, the library will use the system proxy settings.http="http://my.http.prox:13"https="https://my.https.prox:13"socks5="socks5://my.socks5.prox:13"[headers]# headers to send with every request# You should not overwrite Accept, or Content-Type, as they are required for the API to work.# You also cannot overwrite User-Agent.X-My-Header="my header value"
Package: dendrite-python-sdk
dendrite-python-sdkInstallation:Authentication:Get your API key by going to dendrite.se and creating an account.You must enter your own OpenAI API key into your Dendrite account's environment variables before you can start.Complete web tasks with Dendrite's agent:client = DendriteAPI('your-api-key')

dto = {
    "message": "Please go to https://www.scrapethissite.com/pages/forms/ and scrape all the Team's names.",
    "store_chat":  True

}
res = client.complete_task(dto)

print(res.message) # Description of how the results were acheived
print(res.data) # JSON containing the data from the task if there is anyComplete web tasks with your own agent:Entire example can be found in /examples....Custom actions...


messages = [
    {"role": "system", "content": "The assistant is a AI agent [...] "},
    {"role": "user", "content": "Please go to the website https://scrapethis [...] "},
]
max_iterations = 10
iterations = 0
openai_api_key = os.environ.get("OPENAI_API_KEY")
dendrite_api_key = os.environ.get("DENDRITE_API_KEY")

openai_client = openai.OpenAI(api_key=openai_api_key)
dendrite_client = DendriteAPI(api_key=dendrite_api_key)

actions = [go_to_website, scroll, custom_action_tool]

while iterations < max_iterations:
    iterations += 1

    response = openai_client.chat.completions.create({
        "model": "gpt-3.5-turbo-1106",
        "messages": messages,
        "tools": actions,
    })
    tool_calls = response.tool_calls
    if not tool_calls:
        break
    else:
        for tool_call in tool_calls:
            function_name = tool_call.function.name
            function_args = json.loads(tool_call.function.arguments)
            valid_args = {k: v for k, v in function_args.items()
                          if v is not None}

            function_response = "No response"

            if function_name == "go_to_website":
                function_response = dendrite_client.go_to_website(**valid_args)
            elif function_name == "scroll":
                function_response = dendrite_client.scroll(**valid_args)
            elif function_name == "custom_action":
                function_response = custom_action(**valid_args)

            tool_call = {
                "tool_call_id": tool_call.id,
                "role": "tool",
                "name": function_name,
                "content": function_response,
            }
            messages.append(tool_call)
Package: dendritic-arborization-tracer
Dendritic Arborization TracerDendritic Arborization Tracer is a tool to segment neurons along with their dendrites. Ideally, it takes a single channel image as input.The neuron mask is detected in the 'Mask neuron' tabThe cell body mask is detected in the 'Mask cell body' tabFinally, the neuron is skeletonized in the 'Segment dendrites' tab using skeletonization or using the watershed algotrithm. Once skeletonized, the neuron can be further segmented to identify dendrites.InstallInstallpython 3.7orAnaconda 3.7(if not already present on your system)In a command prompt type:pip install --user --upgrade dendritic-arborization-tracerorpip3 install --user --upgrade dendritic-arborization-tracerNB:To open acommand promptonWindowspress'Windows'+Rthen type'cmd'To open acommand promptonMacOSpress'Command'+Spacethen type in'Terminal'To open the graphical user interface, type the following in a command:python -m dendritic_arborization_tracerorpython3 -m dendritic_arborization_tracer
Package: dendrogram-ts
Scipy’s dendrogram for agglomerative clustering requires extensive customizations
to make it more informative. This package wraps scipy’s dendrogram with two customizations:Timeseries graph at the sideDistance labels and cluster split pointsInstallationpipinstalldendrogram-tsExamplesPlot by Maximum Clustersfromdendrogram_tsimportmaxclust_drawplt.style.use('seaborn-whitegrid')plt.figure(figsize=(8,5));maxclust_draw(df,'ward','euclidean',max_cluster=10,ts_hspace=2)Plot by Color Thresholdfromdendrogram_tsimportcolorclust_drawimportmatplotlibasmplmpl.rcParams['lines.linewidth']=1plt.style.use('seaborn-white')plt.figure(figsize=(12,10))colorclust_draw(df,method='ward',metric='euclidean',color_threshold=5200,ts_hspace=1)Plot All Clustersfromdendrogram_tsimportallclust_drawplt.style.use('seaborn-whitegrid')plt.figure(figsize=(12,10))allclust_draw(df,'ward','euclidean',ts_hspace=5)
Package: dendron
🌳 DendronInstallationTo install Dendron, runpip install dendronThis will automatically install torch, transformers, bitsandbytes, accelerate, and sentencepiece, and protobuf. You should consider installing and usingFlash Attention, which is just a pip install, but has prerequisites that you should manually check. It's worth it though - maybe doubling your inference speeds.Behavior Trees for Structured Programming of LLMsHere is an example behavior tree that implements a chat agent:You can build this agent by followingthe tutorial here.ExamplesFor examples of basic language model node usage, see the example notebooks in this repository. For larger and more interesting examples, see theexamples repo.DocumentationYou can find the main documentation for Dendronhere. This includes a full tutorial building a chat agent that has text-to-speech and automatic speech recognition capabilities, and an API reference.AcknowledgementsThis work was supported in part by the Federal Transit Administration and the Regional Transportation Commission of Washoe County.
Package: dendroplot
dendroplotPython analysis scripts for applying dendrograms to LMC ALMA data, and visualizing the results.  Still under active development, but currently available are the following:from dendroplot import run_dendrofrom dendroplot.analysis import calc_phys_props, find_clusters, get_response_widthfrom dendroplot.lte import lte, add_ltemassfrom dendroplot.plotting import pltprops, colorcode, comp_propsTo get started, please see the sample notebook inexampleand the various scripts inpublished.Required packagesnumpymatplotlibastropyastrodendro(fork by Tony Wong)scimes(fork by Tony Wong)kapteynInstallationInstall the package directly from PyPI (https://pypi.org/project/dendroplot/) usingpip install dendroplotor, if you prefer to keep the latest source code handy, by cloning this Github repository and runningpip install .in the directory containingsetup.py.
Package: dendro-text
dendro_textDraw a dendrogram of similarity between text files.The similarity is measured in terms ofDamerau-Levenshtein edit distance.
The distance between given two texts is a count of inserted, deleted, and substituted characters required to modify one text to the other.
A smaller value means that the two texts are more similar.Features:Parallel execution: Supports execution on multiple CPU cores. Plus, jit compilation by Numba (v1.6+).Options in tokenization: By default, the text is compared with a sequence of words extracted by splitting input text into different character types. Optionally, you can compare texts line by line, character by character, or token by token as extracted with lexical analyzers of programming languages.File-centric search: A function to list files in order of similarity to a given file.Diff (Experimental): Diff functionality to show textual differences between files. (This function is provided to check for differences in similarity calculations depending on tokenization.)Installationpipinstalldendro-textIf you run the dendro_text and get the following error message, please install dendro-text with docopt-ng.$dendro_text
Error:theDocoptmodulehasnotbeeninstalled.Installitwith`pipinstalldocopt-ng`.pipinstalldendro-text[docopt-ng](To makedendro-textcompatible with bothdocoptanddocopt-ng, dependencies on them are now explicitly extra dependencies.)To uninstall,pipuninstalldendro-text
Package: denest
deNEST: A declarative frontend for NESTdeNEST is a Python library for specifying networks and running simulations
usingthe NEST simulator.deNEST allows the user to concisely specify large-scale networks and
simulations in hierarchically-organized declarative parameter files.From these parameter files, a network is instantiated in NEST (layers of neurons
and stimulation devices, their connections, and recorder devices), and a
simulation is run in sequential steps ("sessions"), during which the network
parameters can be modified and the network can be stimulated, recorded, etc.Some advantages of the declarative approach:Parameters and code are separatedSimulations are easier to reason about, reuse, and modifyParameters are more readable and succinctParameter files can be easily version controlled and diffs are smaller and more interpretableClean separation between the specification of the "network" (the simulated neuronal system) and the "simulation" (structured stimulation and recording of the network), which facilitates running different experiments using the same networkParameter exploration is more easily automatedThe complexity of interacting with NEST is hidden, which makes some tricky operations (such as connecting aweight_recorder) easyDocumentationDocumentation and tutorials can be found athttp://denest.readthedocs.io.InstallationSee instructionshere.CreditWe are in the process of submitting a JOSS paper describing this package.If you use it for your research, please be so kind as to check again later and
cite our article :)
Package: denetcdf
Denetcdf PackageIni merupakan paket python untuk simpan variabel 3 dimensi ke dalam format netcdf yang bisa dibaca Grads, R, python, matlab dll.Contoh 1 variabel:
#####################
import denetcdf
import netCDF4 as nc
import numpy as np
from wrf import getvar, vinterp, to_np, get_basemap, latlon_coords, extract_times, ALL_TIMESfl = 'wrfout'fh=nc.Dataset(fl[0])
lats=to_np(getvar(fh, "lat"))[:,0]
lons=to_np(getvar(fh, "lon"))[0,:]
fh.close()
fh=[nc.Dataset(i) for i in fl];print(len(fl))
pm_10=[to_np(fh[i]['PM10']) for i in range(len(fl))];pm_10=np.squeeze(np.array(pm_10))denetcdf.create('test.nc', lats, lons, 'Inaaqm Output', '20230905000000', 73, 'Particulate Matter 10 (g/kg)','pm10','g/kg', pm_10[:,0,:,:])######################Contoh multi-variabel:
######################
import denetcdf
import netCDF4 as nc
import numpy as np
from wrf import getvar, vinterp, to_np, get_basemap, latlon_coords, extract_times, ALL_TIMESfl = 'wrfout'fh=nc.Dataset(fl[0])
lats=to_np(getvar(fh, "lat"))[:,0]
lons=to_np(getvar(fh, "lon"))[0,:]
fh.close()
fh=[nc.Dataset(i) for i in fl]
titles=[];vars=[];units=[];data=[]
titles.append('Particulate Matter 10 (g/kg)')
vars.append('pm10')
units.append('g/kg')
pm_10=[to_np(fh[i]['PM10']) for i in range(len(fl))];data.append(np.squeeze(np.array(pm_10))[:,0,:,:])
titles.append('Particulate Matter 2.5 (g/kg)')
vars.append('pm25')
units.append('g/kg')
pm_25=[to_np(fh[i]['PM2_5_DRY']) for i in range(len(fl))];data.append(np.squeeze(np.array(pm_10))[:,0,:,:])
titles.append('Sulfur dioxide (SO2) (ppm)')
vars.append('so2')
units.append('ppm')
pm_so=[to_np(fh[i]['so2']) for i in range(len(fl))];data.append(np.squeeze(np.array(pm_10))[:,0,:,:])
titles.append('Carbon monoxide (CO) (ppm)')
vars.append('co')
units.append('ppm')
pm_co=[to_np(fh[i]['co']) for i in range(len(fl))];data.append(np.squeeze(np.array(pm_10))[:,0,:,:])
data=np.array(data)denetcdf.create('testm.nc', lats, lons, 'Inaaqm Output', '20230905000000', len(fl), titles,vars,units, data)######################
Package: deng
个人常用工具类封装更新历史2022-5-9git.pull_repo方法增加consistency_check参数，默认启用分支一致性检查2022-4-24windows.py模块更新，集成一些常用方法2022-4-8增加get_uuid方法get_current_time方法支持直接传递格式，支持纳秒级输出修复自定义文件缓存类中setex方法声明与redis中相映方法声明不一致的问题优化文件缓存类位置优化日志2022-4-7添加timestamp_to_str方法，快速将时间戳转换成指定格式的字符串优化日志优化缓存类，防止没有配置redis时报错2022-3-26优化压缩函数compress_tgz与compress_zip支持直接压缩文件（原来只支持压缩目录）2022-3-25优化格式化输出函数format_output中的溯源日志信息增加控制参数，可控制接口请求失败时是否显示整个http报文2022-3-1优化parse_url_to_dict方法优化部分日志级别及为部分方法添加注释说明添加AES CBC加解密算法2021-11-17重构2019-11-07新增生成银联卡卡号方法，可通过支付宝校验2018-04-20新增to_dict方法，将x-www-form-urlencoded格式字符串转换成dict2018-02-27新增mysql连接池类MysqlPool；pip安装# 此方式安装方法最简便，但可能不是最新的
pip install deng
# 安装最新的版本
pip install git+https://github.com/Deng2016/deng@201801requirements.txt引用-e git+git@github.com:Deng2016/deng.git@master#egg=deng安装应用python setup.py install开发模式安装python setup.py develop创建egg包# 生成egg包
python setup.py bdist_egg

# 安装egg包
easy_install deng-0.1-py2.7.egg创建tar.gz包# 创建tar.gz包
python setup.py sdist --formats=gztar

# 将tar.gz包安装到别处
pip install deng-0.1.tar.gz将包发布到pypi# 先升级打包工具
pip install --upgrade setuptools wheel twine

# 打包
python setup.py sdist bdist_wheel

# 检查
twine check dist/*

# 上传pypi
twine upload dist/*打包参考资料
Package: dengo-chemistry
This is the Dengo package, designed to be a meta-solver for chemical reaction
networks and cooling processes.  The purpose of this is to provide a simple and
maintainable way of defining microphysical solvers for updating the chemical
and thermodynamic state of fluids in astrophysical simulations.  It has been
designed to output a C solver which can call external solver libraries, as well
as affiliated reaction rate tables.A online version of the cookbook and documentation can be found herehttps://hisunnytang.github.io/dengo-cookbook/landing.htmlFor more information, please contact the authors:Sunny Tang   (hisunnytang@gmail.com)
Matthew Turk (matthew.turk@gmail.com)
Devin Silvia (devin.silvia@gmail.com)
Package: denmarf
denmarfDensity EstimatioN using Masked AutoRegressive FlowThis package provides ascikit-learn-like interface to perform density estimation usingmasked autoregressive flow. The currenttorch-based implementation usespytorch-flowas the backbone. A more performant re-implementation injaxis in progress.Requirementsscipy-stack (numpy, scipy, matplotlib, pandas)pytorchCUDA (for GPU capability)Installationpip install denmarfUsageThe interface is very similar to theKernelDensitymodule in scikit-learn. To perform a density estimation, one first initialize aDensityEstimateobject fromdenmarf.density. Then one fit the data, which is a numpy ndarray of size (n_samples, n_features)),Xwith the methodDensityEstimate.fit(X). Once a model is trained, it can be used to generate new samples usingDensityEstimate.sample(), or to evaluate the density at arbitrary point withDensityEstimate.score_samples()Initializing aDensityEstimateobjectTo initialize aDensityEstimatemodel, one can simply usefromdenmarfimportDensityEstimatede=DensityEstimate()Note that by default the model will try to use GPU whenever CUDA is available, and revert back to CPU if not available. To by-pass this behavior and use CPU even when GPU is available, usefromdenmarfimportDensityEstimatede=DensityEstimate(device="cpu",use_cuda=False)If multiple GPUs are available, one can specify which device to use byfromdenmarfimportDensityEstimatede=DensityEstimate(device="cuda:2")Fitting a bounded distributionTo faciliate the fitting performance for bounded distributions,logit transformationscan be used to convert bounded distributions to unbound ones.denmarfwill automatically perform both the linear shifting and rescaling, as well as the actual logit transformation if the argumentboundedis set when initializing the model, and if the lower and upper bounds are given when calling.fit(). When computing the probability density, the appropriate Jacobian is also computed.For example,fromdenmarfimportDensityEstimate# X is some np ndarrayde=DensityEstimate().fit(X,bounded=True,lower_bounds=...,upper_bounds=...)Saving a trained modelAfter training a model, it can be saved (pickled) to disk for later usage. This can be done by usingde.save("filename_for_the_model.pkl")Loading a saved model from diskdenmarfhas built-in support for loading a trained model saved to disk and reconstructing the model either to CPU or GPU (does not have to be the same architecture where the training was performed!). For example, let us say we have a model trained on a GPU and we want to evaluate the model on a CPU instead. This can be done by usingfromdenmarfimportDensityEstimatede=DensityEstimate.from_file(filename="filename_for_the_model.pkl")The default behavior is always loading the model to CPU.Contributing to denmarfContribution is always welcome!You can use theissue tracker on githubto submit a bug report, to request a new feature, or simply to ask a question about the code!If you would like to make changes to the code, just submit apull request on github.
Package: dennis
Dennis is a set of utilities for working with PO files to ease development and
improve quality. Translate POT files to find problems with localization in your
code. Lint PO files for common problems like variable formatting, mismatched
HTML, missing variables, etc.dennis-cmdhas the following subcommands:lint: Lints PO and POT files for problems including errors that can cause
your production system to crash and problems in strings that can lead to poor
translations.The system allows for defining other variable formats.status: Get a high-level status of a PO file including a list of
unstranslated strings.translate: Translates strings in PO files into something else! Comes with
an HTML extractor (tokenizes strings so that only the text is translated) and
a bunch of translations like Pirate!.This is helpful for l10n testing, development, finding unicode/layout
problems, amazing your friends, hilarious April 1st shenanigans, etc.Specify the tokenizer/transform pipeline you want to use that combines
things. Zombie? Sure! Shouty Zombie? Ok! Manic shouty Dubstep? Bring it on!This also works on strings passed in as command line arguments and as
stdin—it doesn’t have to be a PO file or in a PO format format. For
example, Dennis uses Dennis to translate all Dennis commit messages into
Pirate!. That’s how cool Dennis is!Quick startInstall:$ pip install dennisLint a PO file for problems:$ dennis-cmd lint locale/fr/LC_MESSAGES/messages.poLint all your PO files for errors:$ dennis-cmd lint --errorsonly locale/Lint a POT file for problems:$ dennis-cmd lint locale/templates/LC_MESSAGES/messages.potTranslate a PO file in place into Pirate!:$ dennis-cmd translate --pipeline=html,pirate \
    locale/xx/LC_MESSAGES/messages.poGet help:$ dennis-cmdProject detailsCode:https://github.com/mozilla/dennisDocumentation:https://dennis.readthedocs.io/Issue tracker:https://github.com/mozilla/dennis/issuesLicense:BSD 3-clause; see LICENSE fileWhy is it called Dennis?This is how @willkg names his software projects.