Saravanan666/pypi-org huggingface dataset:
Package: cuthon
Cuthon is a simple Python script to avoid settingCUDA_VISIBLE_DEVICESwhen
running python programs on a GPU. The script will find the firstunusedGPU(s) then run the program as usual. At its simplest:cuthon my_program.pyThis tool is intended for a fairly niche use case: running python programs on
an interactive node which has more than one GPU. For those that have done this
often you may be relieved at never having to runnvidia-smifollowed by
settingCUDA_VISIBLE_DEVICESagain (when running a python program that is).InstallInstall withpip:pip install cuthonUsageIn general, usecuthonjust like you would usepython.cuthonto launch a python repl.cuthon -Vto see the python version number.cuthon train_model.pyto run your program.For help on availablecuthonoptions type:cuthon -h --The output will be:usage: cuthon.py [-h] [-n NUM_GPUS] [-l]

Select the first unused GPU(s) and run Python. To pass the script arguments
specify '--' between cuthon arguments and arguments to be passed through to
your script. If '--' is not specified, then all arguments will be passed
through.

optional arguments:
  -h, --help            show this help message and exit
  -n NUM_GPUS, --num_gpus NUM_GPUS
                        The number of GPUs to use.
  -l, --least_used      Switch from an unused to a least-used policy.For example, to run on two available GPUs execute:cuthon -n 2 -- train_model.py
Package: cutkum
# Cutkum ['คัดคำ']Cutkum ('คัดคำ') is a python code for Thai Word-Segmentation using Recurrent Neural Network (RNN) based on Tensorflow library.Cutkum is trained on BEST2010, a 5 Millions Thai words corpus by NECTEC (https://www.nectec.or.th/). It also comes with an already trained model, and can be used right out of the box. Cutkum is still a work-in-progress project. Evaluated on the 10% hold-out data from BEST2010 corpus (~600,000 words), the included trained model currently performs at98.0% recall, 96.3% precision, 97.1% F-measure (character-level)93.5% recall, 94.1% precision and 94.0% F-measure (word-level -- same evaluation method as BEST2010)# UpdateFeb 17, 2018 - add the training script# Requirements* python = 2.7, 3.0+* tensorflow = 1.4+# Installation`cutkum` can be installed using `pip` and the trained model can be downloaded from github. The current included model (model/lstm.l6.d2.pb) is a stacked bi-directional LSTM neural network with 6 layers.```pip install cutkum# then download the trained model (either from github) or with wgetwget https://raw.githubusercontent.com/pucktada/cutkum/master/model/lstm.l6.d2.pb```# UsagesOnce installed, you can use `cutkum` within your python code to tokenize thai sentences.```>>> from cutkum.tokenizer import Cutkum>>> ck = Cutkum('lstm.l6.d2.pb')>>> words = ck.tokenize("สารานุกรมไทยสำหรับเยาวชนฯ")# python 3.0>>> words['สารานุกรม', 'ไทย', 'สำหรับ', 'เยาวชน', 'ฯ']# python 2.7>>> print("|".join(words))# สารานุกรม|ไทย|สำหรับ|เยาวชน|ฯ```You can also use `cutkum` straight from the command line.```usage: cutkum [-h] [-v] -m MODEL_FILE(-s SENTENCE | -i INPUT_FILE | -id INPUT_DIR)[-o OUTPUT_FILE | -od OUTPUT_DIR] [--max | --viterbi]``````cutkum -m model/lstm.l6.d2.pb -s "สารานุกรมไทยสำหรับเยาวชนฯ"# output asสารานุกรม|ไทย|สำหรับ|เยาวชน|ฯ````cutkum` can also be used to segment text within a file (with -i), or to segment all the files within a given directory (with -id).```cutkum -m model/lstm.l6.d2.pb -i input.txt -o output.txtcutkum -m model/lstm.l6.d2.pb -id input_dir -od output_dir```## LicenseThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details## To Do* Improve performance, with better better model, and better included trained-model* Improve the speed when processing big file
Package: cutlery
🍴 cutleryThis Python library provides word-/sentencepiece tokenizers. The following
types of tokenizers are currenty supported:TokenizerBindingExample modelBPEsentencepieceByte BPENativeRoBERTa/GPT-2UnigramsentencepieceXLM-RoBERTaWordpieceNativeBERT⚠️ Warning: experimental packageThis package is experimental and it is likely that the APIs will change in
incompatible ways.⏳ InstallCutlery is availble through PyPI:pipinstallcutlery🚀 QuickstartThe best way to get started with cutlery is through thecurated-transformerslibrary.curated-transformersalso provides functionality to load tokenization
models from Huggingface Hub.
Package: cutlet
cutletCutlet is a tool to convert Japanese to romaji. Check out theinteractive demo! Also see thedocsand theoriginal blog post.issueを英語で書く必要はありません。Features:support forModified Hepburn,Kunreisiki,Nihonsikisystemscustom overrides for individual mappingscustom overrides for specific wordsbuilt in exceptions list (Tokyo, Osaka, etc.)uses foreign spelling when available in UniDicproper nouns are capitalizedslug mode for url generationThings not supported:traditional Hepburn n-to-m: Shimbashimacrons or circumflexes: Tōkyō, Tôkyôpassport Hepburn: Satoh (but you can use an exception)hyphenating wordsTraditional Hepburn in general is not supportedInternally, cutlet usesfugashi, so you can
use the same dictionary you use for normal tokenization.InstallationCutlet can be installed through pip as usual.pip install cutletNote that if you don't have a MeCab dictionary installed you'll also have to
install one. If you're just getting startedunidic-liteis a good choice.pip install unidic-liteUsageA command-line script is included for quick testing. Just usecutletand each
line of stdin will be treated as a sentence. You can specify the system to use
(hepburn,kunrei,nippon, ornihon) as the first argument.$ cutlet
ローマ字変換プログラム作ってみた。
Roma ji henkan program tsukutte mita.In code:importcutletkatsu=cutlet.Cutlet()katsu.romaji("カツカレーは美味しい")# => 'Cutlet curry wa oishii'# you can print a slug suitable for urlskatsu.slug("カツカレーは美味しい")# => 'cutlet-curry-wa-oishii'# You can disable using foreign spelling tookatsu.use_foreign_spelling=Falsekatsu.romaji("カツカレーは美味しい")# => 'Katsu karee wa oishii'# kunreisiki, nihonsiki work tookatu=cutlet.Cutlet('kunrei')katu.romaji("富士山")# => 'Huzi yama'# comparisonnkatu=cutlet.Cutlet('nihon')sent="彼女は王への手紙を読み上げた。"katsu.romaji(sent)# => 'Kanojo wa ou e no tegami wo yomiageta.'katu.romaji(sent)# => 'Kanozyo wa ou e no tegami o yomiageta.'nkatu.romaji(sent)# => 'Kanozyo ha ou he no tegami wo yomiageta.'Alternativeskakasi: Historically important, but not updated since 2014.pykakasi: self contained, it does segmentation on its own and uses its own dictionary.kuroshiro: Javascript based.kana: Go based.
Package: cutmix-keras
CutMixImageDataGenerator (Keras)Paper:CutMix: Regularization Strategy to Train Strong Classifiers with Localizable FeaturesInstall$pipinstallcutmix-kerasHow To UseclassCutMixImageDataGenerator():def__init__(self,generator1,generator2,img_size,batch_size):self.batch_index=0self.samples=generator1.samplesself.class_indices=generator1.class_indicesself.generator1=generator1self.generator2=generator2...generator1,generator2need same generator appliedflowmethodgenerator1,generator2needshuffle=TrueIfshuffle=False, This generator cutmix with same images.So there would no augmentationWhy are there two same generators? (generator1,generator2)--> To Solve Reference ProblemUsing Example# (some codes) ...fromcutmix_kerasimportCutMixImageDataGenerator# Import CutMixtrain_datagen=ImageDataGenerator(rescale=1./255,)train_generator1=train_datagen.flow_from_dataframe(dataframe=X_train,directory=IMG_DIR,target_size=(IMG_SIZE,IMG_SIZE),x_col='X_Column',y_col='Y_Column',color_mode='rgb',class_mode='categorical',batch_size=BATCH_SIZE,shuffle=True,# Required)train_generator2=train_datagen.flow_from_dataframe(dataframe=X_train,directory=IMG_DIR,target_size=(IMG_SIZE,IMG_SIZE),x_col='X_Column',y_col='Y_Column',color_mode='rgb',class_mode='categorical',batch_size=BATCH_SIZE,shuffle=True,# Required)# CutMixImageDataGeneratortrain_generator=CutMixImageDataGenerator(generator1=train_generator1,generator2=train_generator2,img_size=IMG_SIZE,batch_size=BATCH_SIZE,)
Package: cutmv
cutmv项目介绍调用ffmpeg库实现视频剪辑该库需要依赖ffmpeg软件。所以在调用该库写代码时，请首先确保您的计算机中已安装ffmpeg并将ffmpeg软件路径加入环境变量。计划目标全格式音频文件分段切割全格式视频文件分段切割全格式音频格式转换全格式视频格式转换项目文件参数说明s_time ：音视频文件分割起始时间e_time ：音视频文件分割截至时间files ：需要切割的文件名i_format ：输出格式版本修正2020-12-10 [v0.0.3]：修正了代码中的小错误2020-12-10 [v0.0.4]：追加批量压制视频功能代码演示：调用 cutmv 批量剪辑视频importosimportcutmvif__name__=="__main__":rootdir='./'list=os.listdir(rootdir)# 列出文件夹下所有的目录与文件foriinrange(0,len(list)):cutmv.video_cut(0,480,list[i],'.mp4')调用 cutmv 批量压制视频importcutmvif__name__=="__main__":cutmv.video_compress('./','./压制/','600k')合作及交流联系邮箱：gomehome@qq.comQQ ：287000822
Package: cutnorm
Approximation via Gaussian Rounding and Optimization with Orthogonality ConstraintsThis package computes the approximations to the cutnorm of matrices using some of the techniques detailed by Alon and Noar[ALON2004]and a fast optimization algorithm by Wen and Yin[WEN2013].Read thedocumentation.InstallationUsepipto install the package.
Install from terminal as follows:$ pip install cutnormExample UsageGiven the adjacency matrices of two simple graphs A and B, we wish to compute a norm for the difference matrix (A - B) between the two graphs. An obvious display of the advantages of using a cutnorm over l1 norm is to consider the value of the norms onErdos-Renyi random graphs.Given two Erdos-Renyi random graphs with constant n and p=0.5, the edit distance (l1 norm) of the difference (after normalization) is 0.5 with large probability. An l1 norm of 1 implies the two matrices are completely different, 0 implies identity, and 0.5 is somewhere in between. However, these two graphs have the same global structure. As n approaches infinity, A and B converges to the same graphon object that is 0.5 everywhere. The edit distance fails as a notion of ‘distance’ between the two graphs in the perspective of global structural similarity as discussed by Lovasz[LOVASZ2009]. The cutnorm is a measure of distance that reflects global structural similarity. In fact, the cutnorm of the difference for this example approaches 0 as n grows.Below is an example of using the cutnorm package and tools.importnumpyasnpfromcutnormimportcompute_cutnorm,tools# Generate Erdos Renyi Random Graph (Simple/Undirected)n=100p=0.5erdos_renyi_a=tools.sbm.erdos_renyi(n,p,symmetric=True)erdos_renyi_b=tools.sbm.erdos_renyi(n,p,symmetric=True)# Compute l1 normnormalized_diff=(erdos_renyi_a-erdos_renyi_b)/n**2l1=np.linalg.norm(normalized_diff.flatten(),ord=1)# Compute cutnormcutn_round,cutn_sdp,info=compute_cutnorm(erdos_renyi_a,erdos_renyi_b)print("l1 norm: ",l1)# prints l1 norm value near ~0.5print("cutnorm rounded: ",cutn_round)# prints cutnorm rounded solution near ~0print("cutnorm sdp: ",cutn_sdp)# prints cutnorm sdp solution near ~0[ALON2004]Noga Alon and Assaf Naor. 2004. Approximating the cut-norm via Grothendieck’s inequality. In Proceedings of the thirty-sixth annual ACM symposium on Theory of computing (STOC ‘04). ACM, New York, NY, USA, 72-80. DOI:http://dx.doi.org/10.1145/1007352.1007371[WEN2013]Zaiwen Wen and Wotao Yin. 2013. A feasible method for optimization with orthogonality constraints. Math. Program. 142, 1-2 (December 2013), 397-434. DOI:https://doi.org/10.1007/s10107-012-0584-1[LOVASZ2009]Lovasz, L. 2009. Very large graphs. ArXiv:0902.0132 [Math]. Retrieved from http://arxiv.org/abs/0902.0132
Package: cutoml
CutoML is a lightweight automl library, highly optimized to give you the best possible model depending on your datasets very quickly.Installationpip install -U cutomlUsage ExampleFor classification,fromcutoml.cutomlimportCutoClassifierfromsklearn.model_selectionimporttrain_test_splitfromsklearnimportdatasetsdataset=datasets.load_digits()X_train,X_test,y_train,y_test=train_test_split(dataset.data,dataset.target,test_size=0.25)ctc=CutoClassifier(k_folds=5,n_jobs=2)ctc.fit(X=X_train,y=y_train)For regression,fromcutoml.cutomlimportCutoRegressorfromsklearn.model_selectionimporttrain_test_splitfromsklearnimportdatasetsdataset=datasets.load_boston()X_train,X_test,y_train,y_test=train_test_split(dataset.data,dataset.target,test_size=0.25)ctr=CutoRegressor(k_folds=5,n_jobs=2)ctr.fit(X=X_train,y=y_train)
Package: cutools
v0.5.0 - 2012-09-10Managing binary files (#2)v0.4.0 - 2012-09-05Add files param to check and diff commandsv0.3.3 - 2012-09-03Fix getting files for git1.5v0.3.2 - 2012-09-02Managing right untracked filesv0.3.1 - 2012-09-02Checking local untracked files if they are in remote branch.v0.3.0 - 2012-09-02Let get_diff without arguments. Gets all current diff.Adding fetch, checkout, merge, apply_diff, apply_patch to git object.Adding header_diff, write_tmp_patches and write_tmp_patch to diff module.Fix newline for chunks in get_chunks()v0.2.0 - 2012-08-28Added –diff option to check command. By default check command only willprint the files ok or failed. If –diff flag is enabled it will show the
diff.Added diff command to get the diff of files that doesn’t apply for use when
merge is done.
Package: cutplace
Cutplace is a tool and API to validate that tabular data stored in CSV,
Excel, ODS and PRN files conform to a cutplace interface definition (CID).As an example, consider the followingcustomers.csvfile that stores data
about customers:customer_id,surname,first_name,born,gender
1,Beck,Tyler,1995-11-15,male
2,Gibson,Martin,1969-08-18,male
3,Hopkins,Chester,1982-12-19,male
4,Lopez,Tyler,1930-10-13,male
5,James,Ana,1943-08-10,female
6,Martin,Jon,1932-09-27,male
7,Knight,Carolyn,1977-05-25,female
8,Rose,Tammy,2004-01-12,female
9,Gutierrez,Reginald,2010-05-18,male
10,Phillips,Pauline,1960-11-09,femaleA CID can describe such a file in an easy to read way. It consists of
three sections. First, there is the general data format:PropertyValueDFormatDelimitedDEncodingUTF-8DHeader1DLine delimiterLFDItem delimiter,Next there are the fields stored in the data file:NameExampleEmptyLengthTypeRuleFcustomer_id3798Integer0…99999FsurnameMiller…60Ffirst_nameJohnX…60Fdate_of_birth1978-11-27DateTimeYYYY-MM-DDFgendermaleXChoicefemale, maleOptionally you can describe conditions that must be met across the whole file:DescriptionTypeRuleCcustomer must be uniqueIsUniquecustomer_idThe CID can be stored in common spreadsheet formats, in particular
Excel and ODS, for examplecid_customers.ods.Cutplace can validate that the data file conforms to the CID:$ cutplace cid_customers.ods customers.csvNow add a new line with a brokendate_of_birth:73921,Harris,Diana,04.08.1953,femaleCutplace rejects this file with the error message:customers.csv (R12C4): cannot accept field ‘date_of_birth’: date must
match format YYYY-MM-DD (%Y-%m-%d) but is: ‘04.08.1953’Additionally, cutplace provides an easy to use API to read and write
tabular data files using a common interface without having to deal with
the intrinsic of data format specific modules. To read and validate the
above example:import cutplace
import cutplace.errors

cid_path = 'cid_customers.ods'
data_path = 'customers.csv'
try:
    for row in cutplace.rows(cid_path, data_path):
        pass  # We could also do something useful with the data in ``row`` here.
except cutplace.errors.DataError as error:
    print(error)For more information, read the documentation athttp://cutplace.readthedocs.org/or visit the project athttps://github.com/roskakori/cutplace.
Package: cuTradeNet
cuTradeNetlibrary provides classes to easily create & runkinetic wealth exchange modelson complex networks.Leads the user to set one (or ensemble) ofcomplex networksas a contact structure agents use to trade about. The following wealth exchange models were implemented:Yard-sale modelMerger-Spinoff modelDragulescu and YakovenkoConstant modelChatterjee, Chakrabarti and Manna"All in" modelIt is written in Python and uses Cuda module fromNumbapackage to accelerate the simulation runnin in GPU,paralelizing some transaccionsin the same graph andparalelizing runsin multiple graphs, leading toeasier&fasteraveraging of system properties.
It's completely abstracted from the CUDA knowledge for the user, so you can use it as a regular Python library.How to useThere is aDemo notebookin the repository that can be tryed in it'sGoogle Colabversion too (you can use the package there if you don't have a NVIDIA gpu).There is also aGeneral explanationof Kinetic Wealth Exchange Models used.How to installYou can install it fromPyPiwith the following command:pipinstallcuTradeNetRepository&QuestionsThe repository is inGitHub, and you can ask questions or contact us in theDiscussionssection.CUDA dependenciesIn order to use this library in your personal computer you should have aCUDA capable gpuand download theCUDA Toolkitfor your OS. If you don't fulfill this requirementes you can always use it inthe cloud. Don't hesitate tocontact usto get help!
Package: cuts
cuts====About-----Utility for cutting out portions of each line of a file, and rearrangingthe remaining contents as desired.Based on the Unix utility ‘cut.’ The goal is to enhance the capabilitiesof cut to allow rearranging, negative indexing, flexible delimitingoutput, and proper handling of multiple instances of input delimiters.Installation------------::pip install cutsUsage-----usage: cuts [-h] [-b BYTES] [-c CHARS] [-f FIELDS] [-d DELIMITER] [-e][-s][-S SEPARATOR] [file [file …]]Remove and/or rearrange sections from each line of a file(s).positional arguments:file File(s) to cutoptional arguments:-h, –help show this help message and exit-b BYTES, –bytes BYTES Bytes to select-c CHARS, –chars CHARS Character to select-f FIELDS, –fields FIELDS Fields to select-d DELIMITER, –delimiter DELIMITER Sets field delimiter(default is TAB)-e, –regex Enable regular expressions to be used as input delimiter-s, –skip Skip lines that do not contain input delimiter.-S SEPARATOR, –separator SEPARATOR Sets field separator for output.List Specification------------------Each of the arguments -b,-c, and -f expect a list of positions as anargument. This list should be comma delimited, and allows for negativeindexing.Additionally, the list may include ascii characters. If included, thesecharacters will override the output delimiter with that character.Ranges are permitted in the list, using a colon as belowN:M All input positions from N to MN: All input positions from N to end of line:M All input positions from beginning of line to MPosition counting starts from one.Files-----Each line of an arbitrary number of files may be optionally cut bynaming them each after all other parameters are set. The file namesshould be separated by a space.If no files are specified, or a ‘-’ is used, STDIN is used.Bytes-----(-b,–bytes)=LISTCuts input by byte, as specified by LIST.Characters----------Cuts input by character, as specified by LIST.Fields------(-f,–fields)=LISTCuts input into fields separated by the input delimiter.Example:::Input:echo "this is just a test" | cuts -f 1,X,3:5 -d " " -S "."Output:thisXjust.a.testDelimiter---------(-d,–delimiter)=DELIMSpecifies input delimiter for fields option. Default is tab character(‘:raw-latex:`\t`’).If the option -e is set, the delimiter will accept regular expressions,allowing for multiple delimiters.Separator---------(-S,–separator)=SEPARATORSpecifies output delimiter. Will be overridden by ascii character inposition list.See also--------cut(1)Development notes-----------------Project is still under development. Any questions or comments, pleaseemail jon@jpweiser.com
Package: cut-sent-thai
from cut_sent_thai import cut_senttokens = cut_sent("put your string here")If you want the raw answer (which space is end of sentence (EOS) and which space is not)tokens, raw = cut_sent("put your string here", return_raw=True)raw is numpy array. value is 1 if that space position is EOS and 0 if it's not. Length of raw is the same as number of spaces in your textchange log version 0.0.8: now needs pytorch as dependency
Package: cutsets
FT-MCSFT-MCS is small library which computes the minimal cutsets of a given fault tree using the famous MOCUS algorithm [1, 2].InstallationInstall fromPyPipip install cutsetsUsage1) aircraft.csvTOP,And,B1 B2
B1,Or,C1 C2 C3 C4
B2,Or,C5 C6 C7
C1,And,D1 D2
C2,And,D1 E2
E2,Or,D3 D4
C3,And,D5 E3
E3,Or,D2 D6
C4,And,D1 D7
C5,And,D5 E5
E5,Or,D2 D6
C6,And,D8 E6
E6,Or,D2 D4 D6
C7,And,D8 E7
E7,Or,D4 D9importcutsetsft=cutsets.get_ft(aircraft.csv)cs=cutsets.mocus(ft)print(cs)output:

[['C2', 'B2'], ['B2', 'C3'], ['C4', 'B2'], ['D1', 'B2', 'D2']]2) example.py#!/usr/bin/env python3importcutsetssimple_ft=[("TOP","Or",["E1","E2"]),("E1","Or",["a","b"]),("E2","And",["c","d"])]cs=cutsets.mocus(simple_ft)./example.pyOutput:

[['a'], ['b'], ['d', 'c']]ReferencesN. Limnios and R. Ziani, "An Algorithm for Reducing Cut Sets in Fault-Tree Analysis," in IEEE Transactions on Reliability, vol. 35, no. 5, pp. 559-562, Dec. 1986, doi: 10.1109/TR.1986.4335545.J. B. Fussell, W. E. Vesely,"A New Methodology for Obtaining Cut Sets for Fault Trees", Trans. Am. Nucl. Soc., vol 15, 1972 Jun, pp 262-263.
Package: cutters
cuttersA rule based sentence segmentation library.Python bindings for thecutterslibrary written in Rust.🚧This library is experimental.🚧FeaturesFull UTF-8 support.Robust parsing.Language specific rules (each defined by its ownPEG).Fast and memory efficient parsing via thepestlibrary.Sentences can contain quotes which can contain subsentences.Supported languagesCroatian (standard)English (standard)There is also an additionalBaseline"language" that simply splits the text onsentence terminalsas defined by UTF-8. Its intended use is for benchmarking.ExampleAfter installing thecutterspackage withpip, usage is simple (note that the language is defined viaISO 639-1two letter language codes).importcutterstext="""Petar Krešimir IV. je vladao od 1058. do 1074. St. Louis 9LX je događaj u svijetu šaha. To je prof.dr.sc. Ivan Horvat. Volim rock, punk, funk, pop itd. Tolstoj je napisao: "Sve sretne obitelji nalik su jedna na drugu. Svaka nesretna obitelj nesretna je na svoj način."""";sentences=cutters.cut(text,"hr");print(sentences);This results in the following output (note that thestrstruct fields are&str).[Sentence {
    str: "Petar Krešimir IV. je vladao od 1058. do 1074. ",
    quotes: [],
}, Sentence {
    str: "St. Louis 9LX je događaj u svijetu šaha.",
    quotes: [],
}, Sentence {
    str: "To je prof.dr.sc. Ivan Horvat.",
    quotes: [],
}, Sentence {
    str: "Volim rock, punk, funk, pop itd.",
    quotes: [],
}, Sentence {
    str: "Tolstoj je napisao: \"Sve sretne obitelji nalik su jedna na drugu. Svaka nesretna obitelj nesretna je na svoj način.\"",
    quotes: [
        Quote {
            str: "Sve sretne obitelji nalik su jedna na drugu. Svaka nesretna obitelj nesretna je na svoj način.",
            sentences: [
                "Sve sretne obitelji nalik su jedna na drugu.",
                "Svaka nesretna obitelj nesretna je na svoj način.",
            ],
        },
    ],
}]