Saravanan666/pypi-org huggingface dataset:
Package: cs.predicate
Trite support for code predicates, presently just the context managerpost_condition.Latest release 20210306:
Package install_requires fix.Interested people should also see theicontractmodule.Functionpost_condition(*predicates)Context manager to test post conditions.Predicates may either be a tuple of(description,callable)or a plain callable.
For the latter the description is taken fromcallable.__doc__orstr(callable).
RaisesAssertionErrorif any predicates are false.Release LogRelease 20210306:
Package install_requires fix.Release 20190221:
One bugfix, other tiny changes.Release 20160828:
Use "install_requires" instead of "requires" in DISTINFO.Release 20160827:
Initial release with post_condition context manager.
Package: csp-scan
Descriptioncsp-scanis a Python script for constructing strictcontent-security-policyheaders based on content of HTML files in a source directory. It looks for used sources and hrefs in HTML elements for most CSP directives and outputs the header content.Includes a warning system for unencrypted HTTP connections.Installationpip3 install csp-scanUsagecd my-frontend-srccsp-scanOptions-d,--default-srcValue for default src directive. Default: self-r,--report-uriReport URI to post violations to.-l,--literal-srcInclude whole src paths in the CSP.Contribution / forkingContributions welcome!ContextDirectiveclass is initiated with a name of the directive (e.g.script-src,style-src...). Uses regex to locate specific attribute in a HTML element, given an optional pre-condition or file format.Filedefinitions.pycreates directive objects and defines their conditions throughadd_search_instructionmethod. If you want to add a directive or modify a search condition, do it there.style_src.add_search_instruction(tag="link",attribute="href",format=".css")This instruction will find and classify this source as style-src:<linkhref="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css"/>But not this:<linkhref="https://somecdn/js/somejsfile.js"/>style_src.add_search_instruction(tag="link",attribute="href",condition=("rel","stylesheet"))This instruction will find and classify this source as style-src:<linkhref="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;400;500;600;700&display=swap"rel="stylesheet"/>But not this:<linkhref="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css"/>style_src.add_search_instruction(tag="link",attribute="href")This instruction would find and classify all of the above examples.
Package: cs.py3
Aids for code sharing between python2 and python3.Latest release 20220523:
Minor tweak to ustr().This package presents various names in python 3 flavour for common use in
python 2 and python 3.Functionustr(s, e='utf-8', errors='strict')Upgrade string to unicode: no-op for python 3.Release LogRelease 20220523:
Minor tweak to ustr().Release 20200517:
Add date_fromisoformat and datetime_fromisoformat being the datetime.date and datetime.datetime isoformat factories.Release 20200229:
Minor fixes.Release 20190729:
Add DEVNULL, which only arrived with 3.3.Release 20190331:
cs.py3._for3.raise3: bugfix raise-with-traceback.Release 20190108:
New raise_from function to provide raise...from in py3 and plain raise in py2.Release 20181108:
Small import fix for pread.Release 20180805:
Implement pread for systems lacking os.pread.Release 20170903:Make into a package subsuming cs.py3_for2 and cs.py3_for3.Implementation of struct.iter_unpack.Make bytes.eqwork with str for Python 2.New name joinbytes for Python 2 and 3.Backports for Python 2.5.Release 20160828:
Use "install_requires" instead of "requires" in DISTINFO.Release 20160827:Move python 2 and 3 specific code into cs.py3_for2 and cs.py3_for3.Do not bother with StringIO and BytesIO, modules can get them directly from the io module.Redo python 2 bytes class.Python3 compatible versions of struct.pack and struct.unpack.Release 20150126:
bugfix py2 ustr()Release 20150120:
cs.py3: addcontainsto python 2 bytes typeRelease 20150112:
Rerelease with separate README.rst file.Release 20150111:
ustr: accept errors= parameter, default "strict"; update PyPI distinfo and arrangementsRelease 20150103:
initial release tag for cs.py3
Package: cs.py.doc
Create documentation from python modules and other objects.Latest release 20220311:
module_doc: class members no longer rendered as headings, too verbose.Functionis_dunder(name)Test whether a name is a dunder name (__foo__).Functionmodule_doc(module, *, sort_key=<function <lambda> at 0x10bca9040>, filter_key=<function <lambda> at 0x10bca90d0>, method_names=None)Fetch the docstrings from a module and assemble a MarkDown document.Parameters:module: the module or module name to inspectsort_key: optional key for sorting names in the documentation;
default:namefilter_key`: optional test for a key used to select or reject keys
to appear in the documentationFunctionobj_docstring(obj)Return a docstring forobjwhich has been passed throughstripped_dedent.This function usesobj.__doc__if it is notNone,
otherwisegetcomments(obj)if that is notNone,
otherwise''.
The chosen string is passed throughstripped_dedentbefore return.Release LogRelease 20220311:
module_doc: class members no longer rendered as headings, too verbose.Release 20210306:
Drop noise leaked into output.Release 20210123:module_doc: include properties/descriptors.DISTINFO: this is not Python 2 compatible, drop tag.Release 20200718:New is_dunder(name) function to test whether name is a dunder name.module_doc: new method_names parameter to report only specific attributes from a class - default is all public names and most dunder methods - things without docs are not reported.Assorted small changes.Release 20200521:
Initial PyPI release.
Package: cs.py.stack
I find the supplied python traceback facilities quite awkward.
These functions provide convenient facilities.Latest release 20220918:
caller(): return None if the frame offset is out of range.Functioncaller(frame_index=-3)Return theFrameof the caller's caller.
ReturnsNoneifframe_indexis out of range.Usefulframe_indexvalues:-1: caller, this function-2: invoker, who wants to know the caller-3: the calling function of the invokerThe defaultfrom_indexvalue is-3.ClassFrame(Frame, builtins.tuple)Anamedtuplefor stack frame contents.Functionframes()Return the current stack as a list ofFrameobjects.Functionstack_dump(fp=None, indent=0, Fs=None, skip=None)Recite current or supplied stack tofp, defaultsys.stderr.Parameters:fp: the output file object, defaultsys.stderrindent: how many spaces to indent the stack lines, default0Fs: the stackFrames to write,
default obtained from the current stackskip: the number ofFrames to trim from the end ofFs;
ifFsisNonethis defaults to2to trim theFrames
for thestack_dumpfunction and its call toframes(),
otherwise the default is0to use the suppliedFrames as isRelease LogRelease 20220918:
caller(): return None if the frame offset is out of range.Release 20220429:
caller: return None if the stack index is out of range.Release 20190812:
stack_dump(): trim the last 2 frames from the listing by default (they are part of stack_dump's implementation).Release 20190101:_Frame: rename .functionname to .funcname; caller: turn raw frames into Frames.caller(): accept optional frame_index, default -3.Release 20160827:
Add stack_dump().Release 20150115:
PyPI metadata fixups.Release 20150111:
Tag for initial PyPI release of cs.py.stack.
Package: c-sqlite3
cbw c_sqlite3这是一个方便本人使用sqlite时更加方便的api，本人是个小佬，欢迎各位大佬帮我修改修改代码。
因为开发时只考虑本人的使用，所以代码写的有点乱 QAQ谢谢各位大佬的指点!
Package: csr
CSR Matrices for PythonThis package provides an implementation of sparse matrices in compressed sparse
row format for Python. Routines are implemented with Numba, and both the CSR
data structure and most related matrix and vector operations can be used from
Numba's nopython mode.Right now the feature set is very limited --- don't expect this to be a drop-in
replacement for SciPy's sparse matrices.  Some features we expect to develop as
people take an interest in the package and contribute updates, but we also hope
to keep a relatively tight scope.  This package aims to provide efficient support
for compressed sparse row matrices, with some routines that can also treat them
as CSC matrices.
Package: cs.range
A Range is an object resembling a set but optimised for contiguous
ranges of int members.Latest release 20230701:
Assorted bugfixes.Functionoverlap(span1, span2)Return a list[start,end]denoting the overlap of two spans.Example:>>> overlap([1,9], [5,13])
[5, 9]ClassRangeA collection ofints that collates adjacent ints.The interface is as for asetwith additional methods:spans(): return an iterable ofSpans, with.startincluded in eachSpanand.endjust beyondAdditionally, the update/remove/etc methods have a secondary
calling signature:(start,end), which is the same as passing
inRange(start,end)but much more efficient.MethodRange.__init__(self, start=None, end=None, debug=None):
Initialise the Range.Called withstartandend, these specify the initialSpanof theRange.
If called with just one argument that argument instead be an iterable
of integer values comprising the values in theRange.ClassSpan(Span, builtins.tuple)A namedtuple with.startand.endattributes.Functionspans(items)Return an iterable ofSpansfor all contiguous sequences initems.Example:>>> list(spans([1,2,3,7,8,11,5]))
[1:4, 7:9, 11:12, 5:6]Release LogRelease 20230701:
Assorted bugfixes.Release 20230619:Span: sanity check .start and .end.Range.issubset: efficient comparison with another Range, also .issuperset.Release 20230518:
Span,Range: new as_list() methods.Release 20190102:
Span: providelen.Release 20171231:Add Range.span0, returning the first Span.Implementbooland__nonzero__.Accept a Span incontains.Some small bugfixes.Release 20160828:Add Range.start like existing Range.end.Use "install_requires" instead of "requires" in DISTINFO.Small bugfix.Release 20150116:
First PyPI release.
Package: cs.ratelimit
cs.ratelimitThis provides a threadsafe configurable rate limiter to a Python callable.It's easy to create a rate limited function>>>fromdatetimeimportdatetime,timedelta>>>fromcsimportratelimit>>>@ratelimit.ratelimited(max_count=1,interval=timedelta(seconds=1),block=False)...defmy_func():...pass>>>my_func()>>>try:...my_func()...exceptratelimit.RateLimitExceeded:...print(u"Too fast!")Toofast!We can just as easily make it a blocking rate limiter>>>@ratelimit.ratelimited(max_count=1,interval=timedelta(seconds=1),block=True)...defmy_func():...pass>>>my_func()>>>my_func()# blocks, doesn't raiseIt's also easy to create a class-level rate limited method>>>classMyClass1:...@ratelimit.ratelimitedmethod(max_count=1,interval=timedelta(seconds=1),block=False)...defmy_method(self):...pass>>>instance1=MyClass1()>>>instance2=MyClass1()>>>instance1.my_method()>>>try:...instance2.my_method()...exceptratelimit.RateLimitExceeded:...print(u"Too fast!")Toofast!A more advanced use case is per-instance limiters>>>fromoperatorimportattrgetter>>>classMyClass2:...def__init__(self):...self.rl=ratelimit.RateLimitProperties(max_count=1,...interval=timedelta(seconds=1),...block=False)...@ratelimit.ratelimitedmethod(attrgetter('rl'))...defmy_method(self):...pass>>>instance1=MyClass2()>>>instance2=MyClass2()Theratelimitersintheseinstancesareindependent>>>instance1.my_method()>>>instance2.my_method()>>>try:...instance1.my_method()...exceptratelimit.RateLimitExceeded:...print(u"Too fast!")Toofast!They can also be updated at any time>>>withinstance2.rl.rlock:#needed in threaded environments...instance2.rl.max_count=2>>>instance2.my_method()WE STOP BREACHES
Package: cs.recipe.checkinterval
IntroductionThis products uses jarn.checkinterval product to calculate the
value of the python-check-interval option in Zope’s configuration.It’s integrated into zc.buildout process, so it’s just a 3 line add
to your buildout, and each time you run it, you’ll get the correct
value for your setup, so no more need to execute manually the script.ConfigurationAdd a part in your buildout file pointing to this recipe before
the part that creates the Zope instance, as follows:[buildout]
parts =
    ...
    checkinterval
    instance
    ...

[checkinterval]
recipe = cs.recipe.checkintervalAnd then, just use the value provided by the recipe in your instance part:[instance]
...
python-check-interval = ${checkinterval:value}
...And that’s it.More about check-intervalPlease, readjarn.checkinterval’s README to get more information about it.Changelog1.0 (2012/10/05)Initial release
[erral]
Package: cs.rfc2047
unrfc2047: a decoder for RFC2047 (MIME Part 3) encoded text.Latest release 20200524:
Handle unknown charsets (parochially and abitrarily) and other decode failures.Functionunrfc2047(s)Accept a stringscontaining RFC2047 text encodings (or the whitespace
littered varieties that come from some low quality mail clients) and
decode them into flat Unicode.Seehttp://tools.ietf.org/html/rfc2047for the specification.Release LogRelease 20200524:
Handle unknown charsets (parochially and abitrarily) and other decode failures.Release 20171231:
Change final .decode to use "replace". Fix a bunch of warning format strings.Release 20170904:
Initial PyPI release.
Package: cs-rfm
Customer Segmentation: RFMCustomer segmentation and RFM analysisRecency, frequency, and monetary value (RFM) analysis is a technique used in marketing to determine which customers are the most valuable. RFM is useful for estimating a company's revenue from both existing and potential customers by determining which customers are most likely to make repeat purchases of the company's items.This package does the data processing for the inputted data, conducts RFM Analysis and provides ability to visualize the results and identify the most valueable customer segments.Example UsageI used Online Retail Store data to illustrate functionality of the package.Here is the data I used for further analysisThe package helps to investigate the data, find anomalies and understand its' overall structure and feauture distributions.rfm = CustomerSegmentation(df, customer_id='CustomerID', transaction_date='InvoiceDate', amount='Amount')
rfm.exploratory_analysis(df)With the help of this function we can get descriptive statistics, and important information about the data, with which we are going to work.The package enables to find the RFM scores, segment the customers based on their scores.df_scores = rfm.produce_rfm_dateset(df)
df_scores.head()df_scores = rfm.calculate_rfm_score(df_values)
rfm_table = rfm.find_segments(df_scores)
segment_table = rfm.find_segment_df(rfm.rfm_table)
segment_table.head()We can also plot the distribution of segments, and visually identify the ones with highest number of customersrfm.plot_segment_distribution()rfm.find_customers('Champions')
Package: csrnet
csrnet_pipCrowdCounting LibraryUsage>> csrnet filename.jpg
>> 42Packaging of the source code of paper:@inproceedings{li2018csrnet,
  title={CSRNet: Dilated convolutional neural networks for understanding the highly congested scenes},
  author={Li, Yuhong and Zhang, Xiaofan and Chen, Deming},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={1091--1100},
  year={2018}
}Githubof original authors
Package: cs.rtmpstreaming
A portlet to do streaming using a RTMP server
Changelog
=========1.0.4 (2016-01-28)add manifests [Mikel Larreategi <mlarreategi@codesyntax.com>]bump version [Mikel Larreategi <mlarreategi@codesyntax.com>]Brown bag releaseFix template
[erral]1.0.2 (2012/05/23)Include an option to add a text and a link to the portlet
[erral]1.0.1 (2012/05/22)Fix setup.py
[erral]1.0 (2012/05/22)Initial release
[erral]
Package: csr-utils
csr_utilsScalable Operations for CSR matrices.InstallationFor general users and if using conda etc.:pip install csr_utilsWithout root access:pip install --user csr_utilsUsage>>> import numpy as np
>>> from scipy.sparse import csr_matrix
>>> xcsr = csr_matrix(np.array([[1, 0], [3, 4], [2, 2]], dtype=float))

>>> import csr_utils
>>> xnorm, xmean, xstd, xixnormed = normalize_csr_matrix(xcsr)OverviewThis package currently only has a fast and memory efficient implementation for normalizing nonzero values of a CSR array without un-sparsifying the function. This is useful step for machine learning on large matrices. Most algorithms work better with normalized input, in particular the commonly usedlinear classification models in sklearn.There will be more functions added as the need arises, including turning a csr array into cuda sparse array directly. Stay tuned.normalize_csr_matrix:Normalizes a CSR matrix only based on non-zero values, without turning it into dense array.In the CSR matrix, rows correspond to samples, and columns correspond to features.Normalization will be such that each column (feature)'s non-zero values will have mean of 0.0 and standard deviation of 1.0.Will return the scalable equivalent of x = x.toarray(); x[(x==0)] = np.nan; (x - np.nanmean(x, axis=0)) / np.nanstd(x, axis=0)We compute a faster and equivalent definition of standard deviation:sigma = SquareRoot(ExpectedValue(|X - mean|^2)) # slowsigma = SquareRoot(ExpectedValue(X^2) - ExpectedValue(X)^2) # fastFor more info see the mathThis function makes the following assumptions:If we don't have any observations in a column i, mean_array[i] be set to 0.0, and std_array[i] will be set to 1.0.If we have a single observation, or if standard deviation is 0.0 for a column, we only subtract the mean for that column.(Useful for normalizing test sets:) The function allows the normalization to be based on pre-specified mean and standard deviation arrays.The function also allows only a given subset of features to be normalized.Example>>> import numpy as np
>>> from scipy.sparse import csr_matrix

>>> x = csr_matrix(np.array([[1, 0, 0], [3, 0, 4], [2, 5, 2]], dtype=float))

>>> print(x.toarray())
[[ 1.  0.  0.]
[ 3.  0.  4.]
[ 2.  5.  2.]]

>>> xnorm, xmean, xstd, xixnormed = csr_utils.normalize_csr_matrix(x)

>>> print(xnorm.todense())
[[-1.22474487  0.          0.        ]
[ 1.22474487  0.          1.        ]
[ 0.          0.         -1.        ]]

>>> xmean
array([2., 5., 3.])

>>> xstd
array([0.81649658, 1.        , 1.        ])        

>>> xixnormed
array([0, 2])
Package: cssaw-central
CSSAW_CentralInstallationpipinstallcssaw-centralUsagecsvsql scriptThe package comes with a script to automatically upload a csv file to the given table in a sql database. It takes user, pass, host IP, database, table, and cSV file path as argumentscsvsql -husage: csvsql [-h] user password host database table filenamepositional arguments:user         user for database loginpassword     password for login if necessaryhost         host IP for databasedatabase     database to run queries ontable        table to insert into (will create new if doesn't exist)filename     filepath of CSV file to insertoptional arguments:-h, --help   show this help message and exit--overwrite  Overwrite already-present table in databaseexamplecsvsqltesttestHOSTTesttest_table./TestDocs/test.csvThe above example connects to the Test database using the test user and inserts the test.csv file into test_table.Session moduleSession object acts as a wrapper for sqlalchemy connection. The connection is created and stored in the Session object at initialization, and any results can be taken from the self.conn object or, if using execute_sql(), can be taken from the returned results python list.Example:fromcssaw_central.SessionimportSessionsess=Session('username','password','localhost',db='Test')sess.create_table('test_table',['column1','column2','column3'],\[int,int,int])sess.insert('test_table',['column1','column2','column3'],[0,1,2])print(sess.execute_SQL('./queries/test.sql'))The above script will create a connection to the Test database at localhost:3306 (assuming that it exists), insert the given values into their appropriate columns in test_table, and then execute test.sql from the queries file.LicenseMPL-2.0
Package: csscheck
CSS checkCSS check is a Python library/command line meant to help CSS
developers.The main use is to see which CSS rule are applied to more than one
element in all your CSS files.InstallThe tool can be installed using easy_install:easy_install csscheckYou can then define an alias to run the tool (in your .bashrc or
.profile file):alias css_check="python -m csscheck.main"If you have a buildout with thebinflder contained in your path,
you can add this part:[css_check]
recipe = zc.recipe.egg
eggs = csscheckThat will automatically create a new executablecs_checkin thebinfolder of your buildout.UsageWhen you simply run thecss_checkcommand created earlier, it will
seek for all CSS files in the current directory (and sub-directories)
and provide the list of CSS rules applied to more than one element.
For example:Rule "display: block" -  used 4 times:
______________________________________
 - header
 - nav
 - article
 - footer


Rule "background: #008BCD;" -  used 3 times:
____________________________________________
 - #main > header
 - #main > nav > ul > li
 - #main > footerYou can also specify the directory in which the CSS files must be
checked, using the-doption:css_check -d media/green_themeYou can also check for which elements a CSS rule is applied. To do so,
you can use the-ror--rule=option.
For example:css_check  --rule="display: block"Those options will check all rules that contain the one you asked
for. So if you runcss_check-rbackground, the output will
be:Selectors for which "background: #F60;" is applied:
___________________________________________________
 - #main > header > nav


Selectors for which "background: #89BEFC;" is applied:
______________________________________________________
 - body


Selectors for which "background: #008BCD;" is applied:
______________________________________________________
 - #main > header
 - #main > nav > ul > li
 - #main > footerYou can use a strict rule checking using the-Ror--exact_ruleoption. In that case, you’ll get an exact
match. Runningcss_check-Rbackgroundwill not give any
result.The tool also allows to know which rules are applied to a selector,
using the-sor--selectoroption.
For example, runningcss_check-sfooterwill output all
rules applied for selectors containing the workfooter:Rules applied for "#main > footer a:hover":
___________________________________________
 - text-decoration: underline


Rules applied for "#main > footer a":
_____________________________________
 - color: #FFF


Rules applied for "#main > footer li":
______________________________________
 - display: inlineOnce again, you can specify the exact selector, using options-Sor--exact_selector.
Running the commandcss_check-Sfooterwill only output
this:Rules applied for "footer":
___________________________
 - display: blockThe option used to specify the CSS directory is compatible with all
other options. The other options can’t be mixed (you can’t specify a
selector and a rule for example).Change log for CSSCheck1.0 (2012-01-11)created product. [vincent]