Saravanan666/pypi-org huggingface dataset:
Package: weibull
PurposeThis package is intended to ease reliability analysis using the Weibull distribution, which is the most common method of reliability analysis.  Check out thedocumentationfor more information!Project MaturityI am making every effort to ensure that every release is technically sound; however, it is possible that something is technically incorrect!  It is up to the user to verify functionality for themselves.In addition, the interface is still maturing as I run it through different use cases and there will likely be breaking changes until the 1.0 release.  There will not be any breaking changes until major release numbers after that.Most of the functionality is backed up by tests with the exception of plotting functionality.GalleryProbability PlotHazard FunctionSurvival FunctionContributionsContribution guidelines:Fork the repository to your account.Clone your account repository to your local development environment.Create/checkout a new branch appropriately named by feature, bug, issue number, whatever.Make your changes on your branch.  The ideal changes would:have testing implemented usingpytesthave working examples in theexamplesdirectoryhave documentation in thedocsdirectoryPush your changes to your github account.Create a pull request from within github.If you have created a feature branch and made your changes there, your pull request is much more likely to be accepted even if it doesn't havepytest, examples, and documentation.  If you have made the changes on themasterbranch, then it is expected to be a comprehensive pull request with testing, examples, and working documentation.Initial work on this repository was done by usertgray.  You can still peruse theoriginal repository.Beautiful probably plots contributed by userAlanLesmerises.
Package: weidmd
Simulating dynamics of open quantum systems is sometimes a significant challenge, despite the availability of various exact or approximate methods.
Particularly when dealing with complex systems, the huge computational cost will largely limit the applicability of these methods.
WeiDMD is a Python package that uses Dynamic Mode Decomposition for a data-driven model simplification based on spatiotemporal coherent structures.
whether the external field is involved or not, the DMD can give accurate prediction of the result compared with the traditional propagations, and simultaneously reduce the required computational cost.
Package: weigangtang-mypkg
Package DescriptionThis is a simple example package. You can useGithub-flavored Markdownto write your content.This pacakge is just for my self. I still decide what functions should I add in this packagesChange LogVersion 0.0.1 (2021-07-07)Include two function scriptsVersion 0.0.2 (2021-07-08)bug fixednew functions addedVersion 0.0.3 (2021-07-09)solve the README.md issueVersion 0.0.9 (2021-07-10)require pymannkendall package
Package: weighbridge-simulator
weighbridge-simulatorA command line tool continuously send data to a serial port to simulate
weighbridge communicating.InstallYou can install this tool by the following methods:Installweighbridge-simulatorbypip:pip install git+ssh://git@github.com/garrett-he/weighbridge-simulator.gitDownload compiled binary files fromRepository Releases.QuickstartPrepare a file contains weight list in format:000.000
000.020
000.160
000.420
000.780
005.660
005.800
006.040
006.120
006.100
006.080
...Runwb-simulatorto start simulation:wb-simulator --data-file FILEThen you can receive the weight values from the created port/dev/pts/Nin *raw* data format.weighbridge-simulatorwill convert the input data intorawweighbridge format before sending it to a serial port, like:012.345will be converted to543.210=UsageUsage: wb-simulator [OPTIONS]

  A command line tool continuously send data to a serial port to simulate
  weighbridge communicating.

Options:
  -p, --port NAME       Name of serial port.
  -d, --data-file PATH  Path of data file.  [required]
  -l, --loops N         Loops of sending data set, zero means endless.
  -i, --interval SECS   Interval of each data.
  --version             Show the version and exit.
  --help                Show this message and exit.LicenseCopyright (C) 2023 Garrett HEgarrett.he@hotmail.comThe BSD 3-Clause License, seeLICENSE.
Package: weightbot
This module is an unofficial API intoWeightBot.  Right now it’s very simple
becauseWeightBotis simple.Here’s an example of how you can use it:from weightbot import WeightBot
from pprint import pprint

wb = WeightBot('me@example.com', 'my_password')
data = wb.get_data()

pprint(data)And then running that program might result in:[{'date': datetime.date(2009, 8, 6), 'kilograms': 91.2, 'pounds': 201.1},
 {'date': datetime.date(2009, 8, 7), 'kilograms': 90.1, 'pounds': 198.7},
 {'date': datetime.date(2009, 8, 8), 'kilograms': 90.0, 'pounds': 198.5},
 {'date': datetime.date(2009, 8, 9), 'kilograms': 89.8, 'pounds': 198.0},]You could also get at the raw csv file by doingwb.get_csv_data.Hope you enjoy it!
Package: weight-converter
Weight ConverterA python module for converting weight units.InstallTo install Weight Converter, run the following command:pipinstallweight-converterUsageImport the module and unit classfromweight_converter.convertimportKilogramskilograms=Kilograms(value=1)lbs=kilograms.to_pounds()Documentation:https://weight-converter.readthedocs.io/en/latest/
Package: weighted-average
Weighted-Average (WeAve)The WeAve package (pronounced 'weave') smooths data across multiple dimensions
using weighted averages with methods inspired by the spatial-temporal models
developed in the following paper:Foreman, K.J., Lozano, R., Lopez, A.D., et al. "Modeling causes
of death: an integrated approach using CODEm,"
Popul Health Metrics, vol. 10, no. 1, pp. 1-23, 2012.For instructions on how to install and use WeAve, please refer to thedocumentation.LicenseThis project uses the following license:BSD 2-Clause
Package: weighted-centroid-distance
Weighted Centroid DistanceA new model assessment technique for multi-class classification tasks in machine learning.For the statistical theory, please see the white paper in/paper. It is auto
generated from.texto.pdf.How to use# Pythonfromweighted_centroid_distanceimportWeightedCentroidDistancedistribution=WeightedCentroidDistance.get_distribution([1,2,3,3,4,5,5,5],inverse=False)wcd=WeightedCentroidDistance(distribution=distribution)y____=[1,1,2,2,3,3,3,4,4,5,5,5,5,5,5]y_hat=[1,1,2,2,3,3,4,4,4,4,5,1,5,5,2]res=wcd.get_distance(y=y____,y_hat=y_hat)print("res: ",res)# 0.12086457016125143TodoCreate graphs for all parts of the algorithm defined in the paperImprove python script, and make a versions for other languages.
Package: weighted-collection
Weighted CollectionA WeightedCollection assigns probability weights per elements and returns elements randomly using those weights.For example: if "anakin" has a weight of 1, "constantine" a weight of 1, and "xenophon" a  weight of 2, then "xenophon" will be randomly selected 50% of the time, "anakin" 25% of the time, and "xenophon" 25% of the time.Usagefromweighted_collection.weighted_collectionimportWeightedCollectionw=WeightedCollection(obj_type=str)w.add("anakin",1)w.add("constantine",1)w.add("xenophon",2)# 25% of the time, this will return "anakin",# 25% of the time "constantine",# 50% of the time "xenophon".print(w.get())RequirementsPython 3.6+Installationpip3installweighted-collectionWeightedCollection APIWeightedCollection()The constructor.w=WeightedCollection()# Default constructor.w=WeightedCollection(obj_type=str)# All elements in the collection must be strings.w=WeightedCollection(random_seed=0)w=WeightedCollection(obj_type=str,random_seed=0)ParameterTypeDescriptionOptionalDefaultobj_typeType[T]The type of objects that can be added to the collection.objectrandom_seedintThe random number generator seed.0add(obj, weight)Try to add an object to the collection.The object's type must be the class or a subclass of theobj_typeparameter in the constructor.The object must not already be in the  collection.The weight must be > 0.Return: True if the object was added.w=WeightedCollection(obj_type=str)w.add("anakin",1)# Adds element "anakin" with a weight of 1. Returns True.w.add("anakin",3)# Returns False (object is already in the collecction).w.add(33,1)# Returns False (wrong type).w.add("constantine",-2)# Returns False (weight must be > 0).ParameterTypeDescriptionOptionalDefaultobjT(the value of theobj_typeparameter in the constructor)The object. Must not already be in the WeightedCollection.weightintThe probability weight. Must be > 0.add_many(objs)Try to add many objects to the collection.Return: A dictionary of each object and whether it was added to the collection.w=WeightedCollection(obj_type=str)result=w.add_many({"anakin":1,"constantine":1,33:0,"xenophon":-1})print(result)# {"anakin": True, "constantine": True, 33: False, "xenophon": False}ParameterTypeDescriptionOptionalDefaultobjsDict[T, int](Tis the value of theobj_typeparameter in the constructor)A dictionary of objects. A dictionary of objects. Key = the object. Value = the probability weight.Seeadd(obj, weight)for object and weight requirements.remove(obj)Remove an object from the collection.Return: True if the object was removed.w=WeightedCollection(obj_type=str)w.add("anakin",1)w.remove("anakin")# Returns True.w.remove("constantine")# Returns False.ParameterTypeDescriptionOptionalDefaultobjT(the value of theobj_typeparameter in the constructor)The object in the collection.get()Return: A randomly selected object using the probability weights per object.w=WeightedCollection(obj_type=str)w.add("anakin",1)w.add("constantine",1)w.add("xenophon",2)# 25% of the time, this will return "anakin",# 25% of the time "constantine",# 50% of the time "xenophon".print(w.get())
Package: weightedDelaunay
weighted-delaunayA packaged used to calculate the weighted delaunay triangulation in N-dimensionsUsageWeightedDelaunay(points, weights)Paramesterspoints: ndarray with all the pointsweights: a list of weights that matches the index of the pointsReturnsA weighted Delaunay datastructuretriangulation()ReturnsA list of the simplexes for the triangulationadd_point(point, weight)Paramesterspoint: the point to addweight: the weight of that pointReturnsN/A
Package: weighted-kdtree
kdtreePythonKDTree implementation with the support of weights. Each node created will be associated with a weight. Every node stores the weight associated to that package, the minimum weight in that subtree and the maximum weight.Example:Creating kdtreefrom weighted_kdtree import kdtree
points = [(12,34), (25,36), (9,10), (5, 15), (30, 20), (20, 27)]
weights = [10, 20, 12, 20, 30, 28]
kd_tree = kdtree.KDTree(points, weights)Preorder Traversalkdtree.KDTree.preorderTraversal(kd_tree.root)
[[(9, 10)], [(12, 34)], [(5, 15)], [(30, 20)], [(25, 36)], [(20, 27)]]Weightskd_tree.root.val, kd_tree.root.weight["weight"],  kd_tree.root.weight["minWeight"],  kd_tree.root.weight["maxWeight"]
((20, 27), 28, 30, 10)Nearest Neighborkdtree.KDTree.nnKDTree((10, 20), kd_tree.root, 15, 3)
[(10.04987562112089, (9, 10)),
 (12.206555615733702, (20, 27)),
 (14.142135623730951, (12, 34))]Future work:
Following weights related methods are to be added soon:Find points in a query rectangle with a weight thresholdPoint with minimum weight in a query rectanglePoint with maximum weight in a query rectangle
Package: weighted-levenshtein-substring
Codebase forked fromhttps://github.com/infoscout/weighted-levenshteinInstallpip3installweighted-levenshtein-substringUsageUsefromweighted_levenshteinimportmod_levdistance:float=mod_lev(string,pattern)To find the lowest edit distance betweenpatternand any substring
ofstring.
Package: weighted-metapath2vec
Weighted-Metapath2VecWeighted-Metapath2Vecis a Python package to embed heterogeneous graphs.
The algorithm uses a weighted alternative to Metapath2vec to compute the embeddings.
The embeddings can be used for downstream machine learning.Installationpipinstallweighted-metapath2vecUsagefromweighted_metapath2vecimportWeightedMetapath2VecModel...# Load a networkx graph as Gmetapaths=[['Article','Author','Article'],['Author','Article','Author']]model=WeightedMetapath2VecModel(G,metapaths,walk_length=3,n_walks_per_node=20,embedding_dim=128)node_embeddings=model.fit_transform()...# downstream taskContributingUse GitHub to fork and submit pull requests.LicenseMIT License. See theLICENSEfile.
Package: weightedstats
Python functions to calculate the mean, weighted mean, median, and weighted median.InstallationThe easiest way to install WeightedStats is to use pip:$ pip install weightedstatsUsageWeightedStats includes four functions (mean, weighted_mean, median, weighted_median) which accept lists as arguments, and two functions (numpy_weighted_mean, numpy weighted_median) which accept either lists or numpy arrays.Example:importweightedstatsaswsmy_data=[1,2,3,4,5]my_weights=[10,1,1,1,9]# Ordinary (unweighted) mean and medianws.mean(my_data)# equivalent to ws.weighted_mean(my_data)ws.median(my_data)# equivalent to ws.weighted_median(my_data)# Weighted mean and medianws.weighted_mean(my_data,weights=my_weights)ws.weighted_median(my_data,weights=my_weights)# Special weighted mean and median functions for use with numpy arraysws.numpy_weighted_mean(my_data,weights=my_weights)ws.numpy_weighted_median(my_data,weights=my_weights)TestsUnit tests are in the test/ directory.
Package: weighted-tqdm
weighted_tqdmInstall viapip install weighted-tqdmImport viafrom weighted_tqdm import *Descriptionweighted_tqdmworks equivalently to tqdm, accepting all the same arguments, but also accepts aweightsargument. This argument specifies the weights of each item in the iterable and can be given as a function of the iterable or be any iterable (list, array, tuple...). The progress bar will then take into account the weights of each item in it's prediciton of the time, and it's progress bar will be weighted accordingly. To the left of the progress bar an iteration counter is shown.how_many_qubits = [1,2,3,4,5]
qubits weights = lambda x: (2**x)**3
for i in weighted_tqdm(how_many_qubits, weights=weights):
    # do somethingNew: Now supportsp_tqdmwith an additionally passed function handle for parallel execution. This functionality extends to the generators.qudit_tqdmis a special variant of tqdm, that predicts the remaining time for calculations in quantum mechanics, with the added argumentsditspecifying whether its a calculation of qubits (defaultdit=2ordit=3for qutrits), and the argumentexpspecifying the scaling of computational time with the dimension of a hilbert space.for i in qudit_tqdm(how_many_qubits, dim=2, exp=3):
    time.sleep((2**i)**3)progressis a generator of progress bars which allows each iteration within a nested set of loops to update a single progress bar. It allows adding classictqdm, but alsoweighted_tqdmorqudit_tqdmto different nested loops.p = progress()
for i in p.weighted_tqdm(range(5), weights=lambda i: (i+1), name='outer'):
    for j in p.tqdm((1,2,3,4,5), name='inner'):
        time.sleep(0.1*(i+1))weighted_kronbinations_tqdmis the final progress bar, which allows the use of weighted progress bars forkronbinationloops. Unlike the other functions, tehe update has to manually be added to every iteration.list_of_iterators = [range(3), [1,2,3]]    # list of the iterators
list_of_weights = [ones(3), lambda x: (2**x)**3]    # weights for each iterator
indexes = np.array([[0,0], [0,1], [0,2], [1,0], [1,1], [1,2]]])    # specify the indexes which are being executed 
p = weighted_kronbinations_tqdm(list_of_iterators, list_of_weights)    # initialize the generator
p.init(indexes)    # prepare a progress bar 
for i in indexes:
    p.increment()  # update the progress bar
    time.sleep((2**list_of_iterators[1][i[1]])**3)    # do somethingAuthors:By Michael Schilling
Package: weightfactors
Weight FactorsCalculate weight factors for survey data to approximate a representative sampleInstallationpipinstallweightfactorsor clone and install from sourcegitclonehttps://github.com/markteffect/weightfactorscdweightfactorspoetryinstallUsageCurrently, the package implements a generalized raking algorithm.If you'd like to see support for other algorithms, please open an issue or submit a pull request.Let's use the following dataset as an example:sample=pd.DataFrame({"Gender":["Male","Male","Female","Female","Female","Male","Female","Female","Male","Female",],"Score":[7.0,6.0,8.5,7.5,8.0,5.0,9.5,8.0,4.5,8.5],})Suppose our sample comprises 40% males and 60% females.If we were to calculate the average score, we would get:np.average(sample["Score"])# 7.25Now, assuming a 50/50 gender distribution in the population,let's calculate weight factors to approximate the population distribution:fromweightfactorsimportGeneralizedRakerraker=GeneralizedRaker({"Gender":{"Male":0.5,"Female":0.5}})weights=raker.rake(sample)# [1.25000008 1.25000008 0.83333334 0.83333334 0.83333334 1.25000008# 0.83333334 0.83333334 1.25000008 0.83333334]Let's calculate the average score again, this time applying the weight factors:np.average(sample["Score"],weights=weights)# 6.9791666284520835For more detailed information and customization options, please refer to the docstrings.
Package: weightGIS
weightGISAt its core weightGIS is designed to help standardise shapefile data to a base year, but weightGIS also contains some other supporting pipelines/methods relating to GIS to help you undertake research in this context.Getting startedweightGIS is available via Pypi so you can just pip install it, if you are a Windows user the following command can be used from the terminal.python-mpipinstallweightGISWeight Geographical Regions to a base yearweightGIS is designed first and foremost to allow you to simply create a cross relationship weight in both area and sub unit population (where available). There may be instances where you have a panel of shapefiles, but need to standardise them over time. Border changes that are not reflective of underling changes can cause empirical problems but data will exist for these places based on those changes. By standardising to a base year, this can be resolved, and data that is held can then be weighted accordingly.A fully worked example via a jupyter notebook called weightGIS Example, which is also available as an example script, and some example data is available within the Example folder of this repository that you can download to have a play around with.Determine Relations Within and Between ShapefilesIt can also be used for other relationships, so as getting adjacent polygons or construction a relational file of how differing levels of geographic sedation relate to each other. Examples of these can be found within RelationExamples jupyter NotebooksGeographical RelationsWe are often have shapefiles at multiple levels of separation, but want to know the links between them. By using
GeoLookup, you can relate a list of shapefiles to a base shapefile, where the base is the lowest level of separation.
Package: weightie
WeightieWeightie is a little utility library for downloading, serialising (and
deserialising) weights for my little deep learning projects.You probably shouldn't use this if you're not me!SerialisationQuick-start usage:>>> # Say your model weights are stored in some custom structure like so:

>>> from typing import NamedTuple
>>> from numpy.typing import NDArray

>>> class MyWeights(NamedTuple):
...     foo: NDArray
...     bar: list[NDArray]
...     baz: bool  # Data need not be entirely NDArrays


>>> # They can be dumped and loaded from disk like so:

>>> from weightie import dump, load

>>> weights = MyWeights(foo=np.zeros(1000), bar=np.zeros(10000), baz=True)
>>> with open("example.weights", "wb") as f:
...     dump(weights, f)

>>> with open("example.weights", "rb") as f:
...     loaded_weights = load(weights)Weightie's serialisation format stores Python objects containing Numpy arrays
such that, when loaded from disk, the Numpy arrays will be memory mapped
directly from the files on disk. This means that data isn't actually read from
disk until it is used and is easily swapped out of memory by the operating
system when not in use.Seeweightie/serialiser.pyfor details of the
on-disk format (it's pretty simple!).Weight DownloadingWeightie provides adownloadfunction which can be used to download weights
filed published as assets on GitHub. (GitHub hasvery
generoususage allowances for release assets!)Quick-start usage:>>> from weightie import download

>>> download(
...     repository="mossblaser/example",
...     asset_filenames=["foo.weights", "bar.weights"],
...     target_version="v1.2.3",
... )
{
    "foo": Path("/path/to/downloaded/v1.1.0-foo.weights"),
    "bar": Path("/path/to/downloaded/v1.1.0-bar.weights"),
}Thedownloadfunction handles various fiddly aspects of downloading weights
including:Downloading to platform-native data directories by default (usingplatformdirs)Re-using already downloaded weights when appropriate.Ensuring downloaded weight file versions are compatible with the running
software version.Keeping multiple weight files versions in sync.Seeweightie/downloader.pyfor the full list of
options.
Package: weightreservoir
This module brings the effective reservoir sampling method, with or without
weight. The reservoir sampling is used when you have a very large and unknown
dataset of size N, and you want to sampling a subset of k of these N samples,
with one stream or one file reading.If the weight is not present, each sample will have equal chance to be selected
in the final subset; if weight is used, each sample will be selected according
to their weights.# to installpip install weightreservoir# to use as a module in pythonfrom weightreservoir import reservoir# to use uniform samplinguniform = reservoir.UniformSampling(size = 10)# to add one item into the stream and decide to sample it or not
uniform.addOne(itemValue)# to add a list of items into the stream and decide to sample each of them or not
uniform.addAll(itemValueList)# to get all the current items of the sampled dataset, returned as a list
uniform.get()# to use weighted samplingweight_sample = reservoir.WeightSampling(size = 10)# to add one item into the stream and decide to sample it or not by its weight
weight_sample.addOne(itemValue, itemWeight)# to add a list of items into the stream and decide to sample each of them or not by their weight
weight_sample.addAll(itemValueList, itemWeightList)# to get all the current items of the sampled dataset, returned as a list
weight_sample.get()
Package: weightsplitter
WS(weight Splitter) - это сервер по рассылке и парсингу показаний с электронных весовых терминалов,
реализованный в на основе PortDataSplitter. Поддерживает интерфейсы USB и COM-port.
Имеется библиотека с парсерами для уже известных весовых терминалов а так-же функциями, специфичными для них.Пример использования (Рассыльщик данных с весов с USB на порту 2290 на Linux):
pds = PortDataSplitter(‘0.0.0.0’, 2290, port_name=’/dev/ttyUSB0’, debug=False, device_name=’USB listener’)
Package: weightunit
介绍解析字符串中的重量单位，并进行简单的计算，主要在淘宝的商品标题中做了测试一些使用例子fromweightunitimportparse_str,UnitLevel# 乘法情况, 将升转化为毫升mu=parse_str("德国进口德亚全脂纯牛奶1L*12盒整箱营养早餐奶学生儿童老人")print(mu)print((mu.start_index,mu.end_index))print(mu.calc_weight())# 计算单位，并转换为mlprint("---------------------")# 有加法的情况mu=parse_str("简醇0蔗糖250g*1瓶+开啡尔草莓味200g*5瓶")print(mu)print((mu.start_index,mu.end_index))print(mu.calc_weight())print("---------------------")# 或的情况mu=parse_str("德国进口德亚全脂纯牛奶1L*12盒|24盒整箱营养早餐奶学生儿童老人")print(mu)print((mu.start_index,mu.end_index))print(mu.calc_weight())# 计算单位，并转换为mlprint("---------------------")# 添加自定义的重量单位mu=parse_str("手拉葫芦吊机手动2吨倒链1吨10t小型5吨家用起重机3吨工业吊葫芦")print("未添加【吨】",mu)ul=UnitLevel.gen_default()ul.add_unit_word("吨",level=1)ul.add_unit_word("t",level=1)mu=parse_str("手拉葫芦吊机手动2吨倒链1吨10t小型5吨家用起重机3吨工业吊葫芦",unit_level=ul)print("添加【吨】",mu)print("---------------------")# 设置str_modifier函数，可以在真正解析前字符串前，删除一些字符，让长串的计算公式连一起defstr_modifier(input_str):# 替代默认的str修改，不对input_str进行修改returninput_strmu=parse_str("爱尔培 奶酪500g*6盒11月29到期",)print(mu)mu=parse_str("爱尔培 奶酪500g*6盒11月29到期",str_modifier=str_modifier)print(mu)print("---------------------")# 获得所有的段落，不强制合并到一个公式里mu_list=parse_str("3箱爱尔培 奶酪500g*6盒11月29到期",only_one=False)print(type(mu_list))print(mu_list)mu_list=parse_str("3箱爱尔培 奶酪500g*6盒11月29到期",only_one=True)print(type(mu_list))print(mu_list)print("---------------------")