Saravanan666/pypi-org huggingface dataset:
Package: cubex
cubexis a Python module for analysing CUBE (.cubex) profiles.Quick start guidecubexis still a work in progress, but it is currently useable and the
following instructions should help you get started.To create a newCubeobject, open a new file.>>importcubex>>prof=cubex.open('profile.cubex')Use theshow_metrics()function to list the available metrics.>>>prof.show_metrics()bytes_sentvisitstime...By default,cubexdoes not load all available metrics into memory.  To load
the desired metric, saytime, use theread_data()function.>>prof.read_data('time')TheCubestores the call tree in a list,prof.calltrees.  For most
programs, this will consist of a single entry.  For profiles containing
multiple executables (MPMD), each program’s calltree will be an element in the
list.The call tree can be printed using theprint_calltree()function inside the
profile’s calltree.>>prof.calltrees[0].print_tree()This displays each node of the call tree, indented by depth, and labeled with
its corresponding region.At this point, it helps if the user has some intuitive feel for the call tree
in the profile.  (And if anyone has feedback on how to improve this, please
submit feedback.)Having said that, if one knows the function (or “region” in CUBE parlance) of
interest, then the data is accessed with theregionproperty.>>prof.regions[reg].cnodes[<cubex.calltree.CallTreeobjectat0x7f4437892f90>,<cubex.calltree.CallTreeobjectat0x7f4437539f10>,...]This returns a list of each node (actually subtree) in the call tree where this
function was called.To distinguish betweencnodes, one can inspect its call tree (usingprint_tree()) or inspect its parent node.>>cnode=prof.regions[reg].cnodes[0]>>cnode.parent.region.name'function_name_calling_cnode_'One can also inspect the node index (cnode.idx) although this requires some
knowledge of the tree itself, which can be checked using the CUBE graphical
browser.Finally, to get the metric values at the targetcnode, access itsmetricsproperty.>>prof.regions[reg].cnodes[0].metrics['time'](496.59532077590507,291.106782542039,496.5975198073004,...)This returns a list of the time measured in each computational unit, such as an
MPI rank or OpenMP thread.NotesRegion names follow C conventions.  Fortran programs will typically convert
any function names to lower case and will append a_to the end of the
function name.  For example,  a function namedGET_LAPLACIANwill be
stored asget_laplacian_.This is the usual convention, but other compilers may deviate from thisj
so it’s recommended that you inspect the regions before accessing them.Currently only Score-P output is supported in themainbranch.  Scalasca
output is slightly different and currently does not work as well incubex.We have some internal versions that do work, but are not yet user-friendly
and would need a bit of a cleanup before releasing publicly.
Package: cubic-bezier-spline
Non-rational Bezier curves and splines (composite Bezier curves)This package exists mostly to create C2-continuous, non-rational cubic Bezier splines. In other words, this will approximate or interpolate a sequence of points into a sequence of non-rational cubic Bezier curves.Should be relatively fast, but this isn't suited for heavy math. This is for taking some points you have and making a nice-looking curve out of them. Specifically, a cubic Bezier spline, which is made from the type of curves used in SVG, fonts, and other vector-base programs. I am only interested in feature requests that directly apply to that purpose. This is not an exercise in completism.installpip install cubic_bezier_splinethis package willEvaluate, differentiate, elevate, and split non-rational Bezier curves of any degreeConstruct non-rational cubic Bezier splines (open and closed, approximating and interpolating)Evaluate and differentiate non-rational Bezier splines of any degreethis package will not**Work with rational Bezier splines, b-splines, NURBS, or any other generalization of Bezier curvesDecrease curve degreeApproximate curve intersectionsApproximate the length of a curve"Stroke" (move left or right) a curve** much of the "will not" features can be found here:https://github.com/dhermes/bezierPublic classes / functions# a c2-continuous cubic Bezier spline near the control points
new_open_approximating_spline([(x0, y0), (x1, y1), ...])

# a c2-continuous cubic Bezier spline near the control points
new_closed_approximating_spline([(x0, y0), (x1, y1), ...])

# a c2-continuous cubic Bezier spline through the control points
new_open_interpolating_spline([(x0, y0), (x1, y1), ...])

# a c2-continuous cubic Bezier spline through the control points
new_closed_interpolating_spline([(x0, y0), (x1, y1), ...])Any of these will return a BezierSpline object. This object has a some of the usual methods (e.g., elevate, derivative, split) to help find path normals or do some light modeling, but you may be most interested in.# plot the spline at a given point, where time is 0 to
# (number of input points + 1)
spline(time: float)

# an svg data string
# (the d="" attribute of an SVG path object)
spline.svg_dataExamplesSome of these use double and triple repeated points to create "knots". This isn't a special function, just a feature of Bezier math. The idea is clearer with a picture.Most of the math can be found in:A Primer on Bezier Curveshttps://pomax.github.io/bezierinfo/UCLS-Math-149-Mathematics-of-Computer-Graphics-lecture-noteshttps://www.stkent.com/assets/pdfs/UCLA-Math-149-Mathematics-of-Computer-Graphics-lecture-notes.pdf
Package: cubic-interpolate
Cubic InterpolationThis package helps you find the cubic interpolation for a given points(x,y) using the matrix form.It has the method "c_interp" which return a plot of the cubic interpolation.
it takes two parameters (x,y)x: an array that holds the x-coordinates of the given data.y: an array that holds the y-coordinates of the given data.Instructions:First you must install the following packages:Numpy:pip install numpyMatplotlib:pip install matplotlibInstall the package:pip install cubic_interpolate
Package: cubic-spline
Cubic Spline InterpolationThis package carries out cubic spline interpolation. The intended use of this package is to solve dynamic decision problems of heterogeneous agents in conjunction with theSequence-Space Jacobian (SSJ) package.The approach differs from theCubicSplinemethod of SciPy in that our package is compatible with Numba commands which increase performance in large problems. However, for now, the package is limited to the natural boundary condition.In this package, we use basic spline interpolation of exactly degree 3, the cubic spline. We follow the methods found here:https://en.wikipedia.org/wiki/Spline_interpolation. We use the natural boundary condition, which is extends a straight line from the end points at the same slope as that end point. In formal terms, the second derivative at the end points is equal to 0. We make this choice to efficiently solve the interpolation problem. The natural boundary gives a tridiagonal matrix when the constraints are put in matrix form, and this allows for the Thomas algorithm to quickly solve the matrix problem. In SciPy, we can carry out the same interpolation and get very nearly the same results by runninginterpolate.CubicSpline(x, y, bc_type='natural')Installationcubic_splineruns on NumPy and Numba. The pacakge was developed with Python 3.9 with NumPy version 1.21 and Numba version 0.55. To install run the following commandpip install cubic-splineUsing the Pacakgecubic_spline.pyandtools.pyare the necessary files for carrying out cubic interpolation. Users will normally only need to interact withcubic_splineas it contains the high level wrapper functions. The other files,vfi_demoandfirm_engine, provide an application of this cubic interpolation package to a heterogeneous firm optimization problem.firm_enginerequires the SSJ pacakge to be installed.vfi_demois a notebook that walks through the canonical lumpy investment problem with value function iteration making use of thecubic_splinemethods.
Package: cubictemp
A small, elegant templating system for Python.FeaturesSimple, well-tested and well-documented.Integrates tightly with Python - pass arbitrary Python objects into a
template, walk sequences and iterators, evaluate expressions.Default escaping helps to prevent common classes of Cross-Site Scripting
vulnerabilities.Encourages separation of interface and program logic by disallowing
statements in templates.Tiny - only ~ 170 SLOC. There are many large, over-designed
Python templating systems out there.  Cubictemp proves that a templating
sytem can be complete, elegant, powerful, fast and remain compact.Cubictemp requires Python 2.4 or newer.
Package: cubicweb
CubicWeb is a entities / relations based knowledge management system
developped at Logilab.This package contains:a repository servera RQL command line client to the repositoryan adaptative modpython interface to the servera bunch of other management toolsIntranet links to internal Sonarqube :https://sonarqube.k.intra.logilab.fr/dashboard?id=cubicweb-cubicwebInstallMore details athttps://cubicweb.readthedocs.io/en/latest/book/admin/setupGetting startedExecute:python3 -m venv venv
source venv/bin/activate
pip install cubicweb cubicweb-blog
cubicweb-ctl create blog myblog
# read how to create your ~/etc/cubicweb.d/myblog/pyramid.ini file here:
# https://cubicweb.readthedocs.io/en/latest/book/pyramid/settings/#pyramid-settings-file
# then start your instance:
cubicweb-ctl start -D myblog
sensible-browser http://localhost:8080/Details athttps://cubicweb.readthedocs.io/en/latest/tutorials/base/blog-in-five-minutesYou can also look at the latest builds on Logilab’s forge:https://forge.extranet.logilab.fr/cubicweb/cubicwebTestSimply run thetoxcommand in the root folder of this repository:toxHow to install tox:https://tox.readthedocs.io/en/latest/install.htmlDocumentationLook in the doc/ subdirectory or readhttps://cubicweb.readthedocs.io/en/latest/CubicWeb includes the Entypo pictograms by Daniel Bruce —http://www.entypo.comContributingPatches can be submitted on Logilab’s forge (https://forge.extranet.logilab.fr).
If you do not have a write-access, please contact us atcontact@logilab.frIf you have any questions you can also come on Logilab’s public matrix room using
a matrix client:#cubicweb:matrix.logilab.org
Package: cubicweb-accidents
Summary-------Cube for data.gouv.fr accidents (http://www.data.gouv.fr/fr/dataset/base-de-donnees-accidents-corporels-de-la-circulation-sur-6-annees)Installation------------Create an instance:cubicweb create accidents my_instance_accidentsCreate the database:cubicweb db-create my_instance_accidents! Do not launch the db-init !Insert postgis:psql my_instance_accidents -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sqlpsql my_instance_accidents -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sqlFinish the db:cubicweb db-init my_instance_accidentsPush the data:Get the communes and departements on http://fr.dbpedia.org/sparqlin JSON, using the following request:prefix db-owl: <http://dbpedia.org/ontology/>select ?ville ?code ?name ?lat ?long ?dep ?depcode ?depname where {?ville db-owl:country <http://fr.dbpedia.org/resource/France> .?ville dbpedia-owl:inseeCode ?code.?ville foaf:name ?name.?ville dbpedia-owl:department ?dep.?dep dbpedia-owl:inseeCode ?depcode.?dep foaf:name ?depname.?ville geo:lat ?lat.?ville geo:long ?long.}Push the communes/departements using:cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_communes.py /path/to/json/filesDownload both vehicules and accidents files on data.gouv.fr.Push the data:cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_vehicules.py /path/to/vehicules.csvcubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_accidents.py /path/to/accidents.csv
Package: cubicweb-apycot
project home page:http://www.logilab.org/project/apycotmercurial repository:http://www.logilab.org/src/apycotbotmercurial repository:http://www.logilab.org/src/cubes/apycotInstallation and configurationOn the web/data server hostInstall cubicweb and the cubicweb-apycot packages (more info in thecubicweb book). Notice that the apycot cube may be integrated withtrackerbased instances.Create TestConfig / TestConfigGroup entities through the web ui of
your instance(s) to describe what to test. (SeeMore documentation)Modify password for the apycotbot user for better securityOn the bot hostInstall apycotbot package.edit /etc/apycotbot.ini (or useapycotbot –generate-rcfile >
/etc/apycotbot.inito generate one) to adjust the bot
configuration.If using different user/password for the apycot bot in cubicweb
instances than default ones (higly recommanded), indicates connection
information for each instance in a /etc/apycotbot-cw-sources.ini file.
for instance[cwo]
user=apycotbot
password=apycot

[elo]
user=apycotbot
password=apycotwhere each section is the pyro name of an instance. You should
restrict read perms to this file agressivly.for those running from source, apycotbot/bin/apycotclient should be
in PATHMore documentationBeside low-level installation (described here), all the documentation to setup your
continuous integration environment is available online through your instance athttp://<your instance url>/doc/apycotFeedbacks, bug reportsComments and bug reports are welcome on thepython-projects@list.logilab.orgmailing-list.
Package: cubicweb-awstats
SummaryThe awstats cube integrates statistics processed by awstats into
cubicweb for visualisation and integration.It uses awstats processed files (/var/lib/awstats/*) to import stats
and visualize them. It has a simple html export of the processed data
and a visualisation of the imported stats (by document and for a time
period).To establish a link with the entity you want to build stats for
you need to create a relationship Hits “stats_about” X.classmissing_stats_about(RelationDefinition):name='stats_about'subject='Hits'object=('BlogEntry','MicroBlogEntry')When the link is established, importing the statistics is done using
theupdate-webstatscubicweb-ctl command. For help on that command
typecubicweb-ctl update-webstats -hThe process running cubicweb and cubicweb-ctl needs to have read
access to the configured location of the processed varnish files.Configurationawstats-dir:The directory where the processed awstats files are contained.awstats-domain:If awstats processes multiple domains, which domain to use for
importing into cubicweb.awstats-periodicity:Awstats by default processes per month, but you can configure it to
deal with day periods. (split by hours is not yet implemented)Dependencieshttp://awstats.sourceforge.net/or apt-get install awstats (for debian derived distributions)
Package: cubicweb-blog
SummaryTheblogcube provides blogging functionnalities. It creates two entity types,BlogandBlogEntry. There are related to each other by the relationBlogEntry entry_of Blog.It is a CubicWeb component. CubicWeb is a semantic web application
framework, seehttp://www.cubicweb.orgInstallAuto-install from sources prefered withpip/Distribute:pip install cubicweb-blogIf you have troubles, useeasy_install/setuptoolsand eggs:easy_install cubicweb-blogYou can install the package manually from the uncompressedtarball:python setup.py install # auto-install dependenciesIf you don’t want the dependancies to be installed automaticly, you
can force the setup to use the standard librarydistutils:NO_SETUPTOOLS=1 python setup.py installMore details athttp://www.cubicweb.org/doc/en/admin/setupUsageWhen a user submits a blog entry, it goes in adraftstate until the blog
entry is published by an application managers. The blog entry will not be
visible until it reaches thepublishedstate.When a blog entry is submitted, an email notification is automatically sent
to all the users belonging to themanagersgroup of the application.Specific boxes provided by this cube:BlogEntryArchiveBox, displays a box with the total number of blog entries
submitted by month for the last twelve months.BlogEntryListBox, displays a box with the latest five blog entries
published in your application as well as link to subscribe to a RSS feed.BlogEntrySummary, displays a box with the list of users who submitted
blog entries and the total number of blog entries they submitted.This cube also provides some web services such as:http://xx:xxxx/blogentries/YYYYto retrieve the blog entries submitted
during the year YYYY through a RSS feedhttp://xx:xxxx/blogentries/YYYY/MMto retrieve the blog entries submitted
during the month MM of the year YYYY through a RSS feedhttp://xx:xxxx/blog/[eid]/blogentries/YYYYto retrieve the blog entries
submitted in the blog of identifier [eid], during the year YYYY through
a RSS feedhttp://xx:xxxx/blog/[eid]/blogentries/YYYY/MMto retrieve the blog entries
submitted in the blog of identifier [eid], during the month MM of the
year YYYY through a RSS feedDocumentationLook in thedoc/subdirectory or readhttp://www.cubicweb.org/doc/en/
Package: cubicweb-brainomics
Cube for the Brainomics Project, seehttp://www.brainomics.net/Uicfg documentationIn Brainomics, we have experimented a new function for uicfg that
allows to display specific rset/information within the ‘attributes’
or ‘relations’ sections of the primary view.The display_rset method of uicfg take 3 arguments:the name of the etype concerned by the rule;the section where the information is displayed (attributes or relations);a dictionnary of properties.The dictionnary of properties must have:a ‘callback’ item OR a ‘rql’ and a ‘vid’ items.The ‘callback’ is a function that takes the entity and render an HTML snipet.The ‘rql’ is a rql query where the variable ‘X’ is the current entity. The ‘vid’
is the __regid__ of the view that will be applied to the result of the rql query.It could also have:a ‘label’ (’’ if not given);an ‘order’ (9999 if not given);It should be used as follows, e.g. using an etype property:>>> _pvdc = uicfg.primaryview_display_ctrl
>>> _pvdc.display_rset('MyEtype', 'attributes',
                       {'callback': lambda x: x.formatted_description,
                        'label': _('description')})or with a ‘rql’ and ‘vid’ attributes:>>> _pvdc = uicfg.primaryview_display_ctrl
>>> _pvdc.display_rset('MyEtype', 'relations',
                       {'rql': 'Any Z WHERE X relation1 Y, Y relation2 Z',
                        'vid': 'my-view',
                        'label': _('My label')})or with a ‘callback’ using a view:>>> _pvdc = uicfg.primaryview_display_ctrl
>>> _pvdc.display_rset('MyEtype', 'relations',
                       {'callback': lambda x: x.view('my-secondary-view'),
                       'order': 2,
                       'label': _('My label')})
Package: cubicweb-card
This cube models cards that are like wiki pages.Cardentities have a title, an abstract and some textual content as text, rest
or html.To create a new card, just create a link like ‘/card/YOUR_WIKI_ID’ and follow it
in your browser. Such a link can be written using the native HTML editor
(fckeditor) or the dedicated restructured text “card” directive, as follows:card:`free_software/logilab:free software at Logilab`
Package: cubicweb-celery
Celery integration with CubicWebGetting StartedEnable the ‘celery’ cube in yourmyappcubicweb instance:$ cubicweb-ctl shell myapp
entering the migration python shell
just type migration commands or arbitrary python code and type ENTER to execute it
type "exit" or Ctrl-D to quit the shell and resume operation
>>> add_cube('celery')
>>> ^DIf needed, configure the broker_url inall-in-one.conf. By
default, and only when using a postgresql database, thetrunktransport will be used for the broker; make sure it is installed.Write a task:from cubicweb_celery import app

@app.cwtask
def ping(self):
    return 'pong'

@app.cwtask
def users(self):
    return [str(x[0]) for x in self.cw_cnx.execute('String L WHERE U login L')]or as a class:from cubicweb_celery import app

class MyTask(app.Task):
    need_cnx = True  # if false (the default), self.cw_cnx will not be set
                     # before running the task

    def run(self):
        self.cw_cnx.execute('Any X WHERE ...')NoteIn order to have the task automatically available by the
celery worker, you must ensure that it is in a
Python file that is automatically loaded by CubicWeb, best
candidate being thesobjectsmodule of a cube (see theCubicWeb’s regitry documentation).Then start a celery worker:celery -A cubicweb_celery -i INSTANCE_NAME worker [ --beat ]Then you can make the worker execute a task by calling it, eg. from
anOperation. You may also run a task from acubicweb-ctlshell:$ cubicweb-ctl shell myapp
>>> from cubes.myapp.sobjects import ping, users
>>> print ping.delay().wait()
'pong'
>>> print users.delay().wait()
['anon', 'admin']
Package: cubicweb-celerytask
SummaryRun, monitor and log celery tasks.Installation and setupDeclare tasks using celery task or cubicweb-celery cwtasks.On worker side, installcw-celerytask-helpers.celeryconfig.py example:CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = BROKER_URL
CUBICWEB_CELERYTASK_REDIS_URL = CELERY_BROKER_URL
CELERY_IMPORTS = ('cw_celerytask_helpers.helpers', 'module.containing.tasks')In this configuration example, thecw_celerytask_helpersinCELERY_IMPORTSis required to have logging data (in the task) sent
back to the Cubicweb instance via Redis. TheCUBICWEB_CELERYTASK_REDIS_URLis the Redis endpoint used for this
logging handling mechanism.Start a worker:# running cubicweb tasks (celeryconfig.py will be imported from your instance config directory)
celery -A cubicweb_celery -i <CW_INSTANCE_NAME> worker -l info

# running pure celery tasks
celery worker -l infoTask state synchronization requires to run thecelery-monitorcommand:cubicweb-ctl celery-monitor <instance-name>Ensure to have the celeryconfig.py loaded for both cubicweb instance and
celery worker, enforce by settings with CELERY_CONFIG_MODULE environment
variable (it must be an importable python module).Running tasksCreate a task:fromceleryimportcurrent_appasappfromcelery.utils.logimportget_task_loggerlogger=get_task_logger(__name__)@app.task(name='hi_there')defmy_task(arg,kw=0):logger.info('HI%s%s!',arg,kw)return42Run a task:fromcubicweb_celerytask.entitiesimportstart_async_taskcwtask=start_async_task(cnx,'hi_there','THERE',kw=42)cnx.commit()start_async_task() accept task names, task objects or task signatures:http://docs.celeryproject.org/en/latest/userguide/canvas.html#signaturesFor instance, to start the above task in a dedicated queue namedmyqueue:importcelerystart_async_task(cnx,celery.signature('hi_there',args=('THERE',),kwargs={'kw':42},queue='myqueue'))Testing task based applicationIn CubicWeb test mode, tasks don’t run automatically, usecubicweb_celerytask.entities.get_tasks()to introspect them andcubicweb_celerytask.entities.run_all_tasks()to run them.Also, CELERY_ALWAYS_EAGER and CELERY_EAGER_PROPAGATES_EXCEPTIONS are set to
True by default.