Saravanan666/pypi-org huggingface dataset:
Package: citibox-gcloud-logger
gcloud-loggerPython log wrapper for gcloud logging formatHow to use it?Create your filter classes as needed, extending BaseContextFilter i.e.fromcitibox.gcloudloggerimportBaseContextFilterclassMyTestFilter(BaseContextFilter):def__init__(self):super().__init__()self.some_attribute="Some Value"@staticmethoddeffilter_name():return"my_test_filter"defto_dict(self)->dict:return{"some_attribute":self.some_attribute}Get logger from generated dict:Import logging requiredimportloggingfromlogging.configimportdictConfigImport GCloudLogConfig:fromcitibox.gcloudloggerimportGCloudLogConfigInstance the library with your custom filters and set the logger config:my_log_config=GCloudLogConfig(MyTestFilter)dictConfig(my_log_config.config)Use the logger as normally:logger=logging.getLogger()logger.info("something good is happening")Also, you can add more loggers if needed:importloggingfromlogging.configimportdictConfigfromcitibox.gcloudloggerimportGCloudLogConfigmy_log_config=GCloudLogConfig(AnyFilter)my_log_config.add_logger("new_logger",level=logging.INFO)dictConfig(my_log_config.config)And, add filters after the creation of the log config class:importloggingfromlogging.configimportdictConfigfromcitibox.gcloudloggerimportGCloudLogConfigmy_log_config=GCloudLogConfig(AnyFilter)my_log_config.add_filter(AnotherFilterClass)Using MiddlewaresFalconThere is a Falcon middleware ready for logging Request and Response.
UseFalcon middlewaresadding the included class:importfalconfromcitibox.gcloudlogger.contrib.falconimportFalconMiddlewareapp=falcon.API(middleware=[FalconMiddleware()])Djangoin your config file add:MIDDLEWARE=['citibox.gcloudlogger.contrib.django.DjangoMiddleware',...]
Package: citibox-profiling
Citibox profilingPython library to profiling inside Citibox backend teamHow to use it?Install via pip and initialize it as soon as possible with the following code:fromcitibox.profilingimportProfiling,GoogleConfig,ProfilerServiceGoogleprofiling_config=GoogleConfig(service_name="name_of_your_service",service_version="core-001",project_id="gcp_project_id",service_account_json_file="path/to/json_credentials-json",)profiling_service=ProfilerServiceGoogle(profiling_config)profiling=Profiling(profiler_service=profiling_service)profiling.start()##Step-by-step guide:Import library profiler, config and service implementation:fromcitibox.profilingimportProfiling,GoogleConfig,ProfilerServiceGoogleCreate config for your serviceprofiling_config=GoogleConfig(service_name="name_of_your_service",service_version="core-001",project_id="gcp_proyect_id",service_account_json_file="path/to/json_credentials-json",)Create the service with the previous configuration and pass it to profilingprofiling_service=ProfilerServiceGoogle(profiling_config)profiling=Profiling(profiler_service=profiling_service)Start collecting informationprofiling.start()Enjoy itHow to use in django project?Define config in settingsPROFILING={'ACTIVE':True,'SERVICE_NAME':'app_service','SERVICE_VERSION':'core-001','PROJECT_ID':'gcp_project_id','SERVICE_ACCOUNT_JSON_FILE':'path/to/json_credentials-json',}Add middleware in configMIDDLEWARE=['citibox.profiling.contrib.django.ProfilingMiddleware',]
Package: citibox-tracer
tracing-libraryOpencensuspython wrapper for traceabilityUsageHow to enablethe tracing require environment variable to startTRACER=TrueFalcon MiddlewareEnable the middleware in your app.importfalconfromcitibox.google_cloud_tracer.contrib.falconimportGoogleCloudFalconMiddlewarefromopencensus.traceimportsamplersgoogleCloudTracer=GoogleCloudFalconMiddleware("your-project",["/","/health","/another-not-traceable"],samplers.AlwaysOnSampler())app=falcon.API(middleware=[googleCloudTracer])Requests wrapperThere is arequestswrapper to make http requests traceablesfromcitibox.google_cloud_tracerimportrequestsr_get=requests.get('https://google.com',{"param":"something"})r_post=requests.post('https://google.com',json={"something":"value"})You can userequestswrapper as nativerequestslibrary.requests.Session() not applied, you will need to get the trace headers if you are using sessionsDjango MiddlewareEnable the middleware in your app.MIDDLEWARE=[...,'citibox.google_cloud_tracer.contrib.django.GoogleCloudDjangoMiddleware',...,]TRACING={'PROJECT_ID':'your-project-id','EXCLUDELIST_HOSTNAMES':['localhost','127.0.0.1'],'EXCLUDELIST_PATHS':['_ah/health'],'SAMPLER':'opencensus.trace.samplers.AlwaysOnSampler()',}
Package: citier
citierPython Library to Validate and List Countires, States and cities.InstallationpipinstallcitierUsageCountryfromcitier.countryimportvalidate_country,countries_listValidate any Countryvalidate_country("Pakistan")List a Range of countriescountries_list(1,2)List all Countriescountries_list()Statefromcitier.stateimportvalidate_state,list_statesValidate a Statevalidate_state("Punjab")List All States of a Countrylist_states("Pakistan")Cityfromcitier.cityimportlist_cities,list_state_citiesList All Cities of a Countrylist_cities("Pakistan")List All Cities of a Statelist_state_cities("Punjab")
Package: cities-coordinates
Cities coordinatescities_coordinates is a python package that helps to identify cities' coordinations arround theInstallationcities_coordinates python and pip to be installed.In order to install the plugin, run the following command:pipinstallcities_coordinatesUsageFor now this package has two basical methods the first oneget_city()returns the city coordinations using a city name and its country code, the secondget_country_citiesreturns all of the cities that belongs to the given country code.fromcities_coordinatesimportCityCoordinatorc=CityCoordinator()c.get_city(city_name="Jena",country_code_iso="DE")# {'country_iso_code': 'DE', 'city_name': 'Jena', 'location': {'lat': '50.92878', 'lon': '11.5899'}}c.get_country_cities(country_code_iso="DE")#[# {'country_iso_code': 'DE', 'city_name': 'Lenningen', 'location': {'lat': '48.55048', 'lon': '9.47674'}},# {'country_iso_code': 'DE', 'city_name': 'Lobbach', 'location': {'lat': '49.37519', 'lon': '8.88884'}},# {'country_iso_code': 'DE', 'city_name': 'Sachsenheim', 'location': {'lat': '48.96', 'lon': '9.06472'}}#...]I'll be happy if you like this helpful package and feel free contribute to it
Package: citi-wikibot
Python script to easily edit pages onCITi’s Wikidirectly from shell or using a Markdown (.md) file. Currently, our Wiki is made usingMediaWiki.Installation$pipinstallciti-wikibotUsageNote: Keep in mind that every command will overwrite the current page content with the one you provide.QuickstartJust initialize your WikibotUse one of the commands, it’s that simple :sparkles:Editing a page directly from the shell$python>>>fromwikibotimportWikibot>>>bot=Wikibot('username','password','page_title')>>>bot.edit_page('== My title ==\nHello world!')Editing a page from a Markdown fileImportant: It’s recommended that you run the script in the folder your file is located$lsnotes.md$python>>>fromwikibotimportWikibot>>>bot=Wikibot('username','password','page_title')>>>bot.edit_page_from_file('notes.md')Gets the Homepage from GitHub wiki of your repositoryAutomatically gets your GitHub wiki homepage (example), parses it and edits the page on CITi Wiki (result).You must declare yourpersonal access token from GitHubin a variable calledGITHUB_TOKENin order to use this command.$GITHUB_TOKEN="mypersonalaccesstoken123"$python>>>fromwikibotimportWikibot>>>bot=Wikibot('username','password','page_title')>>>bot.edit_page_from_github('my_repository')GitHub'swikihomepagefrommy_repositorysuccessfullyloadedandedited!Checkithere:http://wiki.citi.org.br/index.php?title=insert_pageReferenceedit_page(content)content(string): The content you want to put in the page. Note that it will overwrite the current one!It accepts Wikicode (Wikipedia and MediaWiki format).Example:fromwikibotimportWikibotbot=Wikibot('myusername','123','My_Page')bot.edit_page('*Hello* world!')edit_page_from_file(file)file(string): The file name you want to load. It must be in Markdown format!Example:fromwikibotimportWikibotbot=Wikibot('myusername','123','My_Page')bot.edit_page_from_file('notes.md')edit_page_from_github(repo)repo(string): The name of your repository. It needs to have a Wiki. The script will automatically search inciti-ufpe’s organization.Remember to declare yourGITHUB_TOKENenvironment variable! Instructions above inUsage.Example:fromwikibotimportWikibotbot=Wikibot('myusername','123','My_Page')bot.edit_page_from_github('my-repo')
Package: citlalicue
CitlalicueOscar Barragán (Sept 2020)Citlalicueis the name of the Aztec Goddess who created the stars.
This code allows you to mimic Citlalicue powers to create and manipulate stellar light curves.The actual version of the code allows you to create synthetic stellar light curves (transits, stellar variability and white noise)
and detrend light curves using Gaussian Processes (GPs).Dependencies:NumpyMatplotlibScipyPyTransitgeorgeTry it now!Install it by typingpip install citlalicueSimulate light curvesTransits are implemented usingPyTransit,
while the stellar variability is added from samples of a Quasi-Periodic Kernel with covariance given byCheck the example of how to use Citlalicue to create light curves in the linkexample_light_curves.ipynb.Detrend light curvesCheck the example of how to use Citlalicue to detrend light curves in the linkexample_detrending.ipynb.
Package: citools
ci-toolsprototype tool collection for continuous integration of Java projects with lots of modulesExamplescollect/accumulate test results of another jobExample:update_job_state master-unittests master-integrationtestsThis will create local databasesmaster-unittests.dbandmaster-integrationtests.dbcontaining all test results of the given job namesmaster-unittestsandmaster-integrationtests. Newer Suites overwrite older ones. Full tests runs overwrite all results.merge test results of job databaseExample:merge_job_state master-unittests master-integrationtests masterCreates a local databasemaster.dbcontaining the merged test results of the local databasesmaster-unittests.dbandmaster-integrationtests.db.create junit result from databaseExample:export_job_state masterCreates a JUnit XML file containing the current test state from themaster.dbpersistence file.
Package: citram-python-api
citram-python-apiPython wrapper of Consorcio de Transportes de Madrid (CTRM) API.This module seeks to comprise all the CTRM endpoints, using different CTRM APIs.With this API you can request static and live (not as a streaming) for the different public transport the CTRM manages:
Madrid Metro, MetroSur Metro, Cercanías Renfe, Madrid EMT buses, intercity buses, multi-transport stations (intercambiadores),
and Metro Ligero. You can request information of CTRM offices and parkings.Any kind of transport fits in the paradigm of stops and lines.Please visithttps://citram-python-api.readthedocs.io/en/latest/to read the documentation.Modules description:lines: Requests relative to transport lines.offices: Requests relative to CTRM offices.stops: Requests relative to transport stops.others: Other relevant requests that don't fit in any of the other categories.constants: Useful constants to use when making requests.utils: Useful functions to use when making requests.Some tips:When writing line names, they're usually in upper case and have no whitespaces nor other characters like dashes or
underscores. The functions in utils.utils can help you to create stop and line codes.With the constants module you can make requests about municipalities, transport modes and office types easily.In case your mother tongue is English and you're having trouble understanding the different transports,
you might find this link helpful:https://www.crtm.es/widgets/language.jsonSometimes you'll see kmz links. kmz files are used by Google Maps or Google Earth to display a set of points
or geometric figures in a map.When the field access is greater than 0, it means the stop is adapted to people with special conditions.When the field park is greater than 0, it means that stop has a parking.When the field nightService or nightLinesService is greater than 0, it means that line has night service (sometimes
this is called Búho, specially on bus lines).Example of usefrom citram_api.constants.constants import TransportModes
from citram_api.api.lines.lines import get_line_info
from citram_api.utils.utils import create_line_cod

line_info = get_line_info(create_line_cod(TransportModes.METRO.value, 10))
Package: citree
Citreeresearch citations tree visualizationCitree is a class that creates a citations tree.
the input is the DOI of the paper you want to start with (for example, 10.1002/ejp.1639).
the data is retrieved using semanticscholar package
(api that works with https://www.semanticscholar.org/).
the network is built by using Networkx package.
the plotting is done by using Bokeh package.

attributes: 
--------------
    first_doi - the doi provided by the user
    paper - a semanticscholar class (api that works with https://www.semanticscholar.org/)
    plot_name - plot title based on the name and author of the paper provided
    G - networkx object of the papers network
    A - networkx object of the authors plot
    generation - stores the number of generations
        (iterations of create_next_generation method)

methods:
--------------
first - creates the first node
create_next_generation - creates nodes based on papaers that cited
    the last generation nodes.
    saves a backup gpickle file.
    prints the generaton nuber and how many papers were found.
color_by_self_citation - needs an input of authorId.
    colors in red nodes of papers which the input author is a co-author.
    the other nodes and edges are green.
    the authors names are stored at paper['authors']
plot_html - creats an html file with tow plots:
    1. papers cictations tree
    2. authors who wrote toghather
export_csv(filename='filename') - creates a dataframe and exports it as 'filename.csv'example of use:
from citree import citree
temp = citree('10.1111/j.1526-4610.2006.00288.x')

#other optional methods
temp.first()
temp.create_next_generation()
temp.create_next_generation()
temp.color_by_self_citation()
temp.plot_html('temp')
temp.export_csv(filename='mycsv)
Package: citric
CitricProject HealthPackagingMiscA client to theLimeSurvey Remote Control API 2, written in modern Python.FeaturesSupports the full RPC API via theSessionclass.Best effort to implement all the RPC methods in theClientclass. See theAPI coverage pagefor details.Easily export survey data to CSV files,Pandas DataFramesandDuckDB databases.Easilydownload survey files(e.g. images, audio, etc.) to a local directory.Tested against LimeSurvey 6.0.0+ and 5.0.0+ versions.Experimental support for the newREST API.Installation# PyPIpipinstallcitric# or condacondainstall-cconda-forgecitricUsagefromcitricimportClient# Connect to your LimeSurvey instanceclient=Client("https://mylimesite.limequery.com/admin/remotecontrol","myusername","mypassword",)# Print the LimeSurvey versionprint(client.get_server_version())# Print every survey's titleforsurveyinclient.list_surveys():print(survey["surveyls_title"])DocumentationCode samples and API documentation are available atcitric.readthedocs.io.ContributingIf you'd like to contribute to this project, please see thecontributing guide.CreditsMarkus Opolkafor maintaining a very robust set ofLimeSurvey Docker images.Claudio Jolowiczandhis amazing blog post.
Package: citros
cliCITROS cliCommandscitrosinitcitrosdoctorcitrosruncitrosbatchcitrosdatacitrosreportcitrosobservabilityinitializationanalyze the ROS2 project and initialize the .citros folder with all the files needed to operate citroscitrosinit[-d|--destination]<repositoryfolder>doctorchecks for problems in .citros folder and suggests fixescitrosdoctor[-d|--destination]<repositoryfolder>Runstarts a simulation locally or on remotecitrosrun[-gh|--github]#iniate an action that will runs the simulation on github as a workflow.[-c]#completions[-o]#destination folder defaults to .citros/runs[-D]#dockerized - we will run dockerzed version of the simulation (can run parallel simulations on the same machine)[-p]#parallelism ? do we need it or can we know how many cpu available and devide it by the requested number of cpus per cpu 8 (available cpu) / 2 (requested cpu) = 4 (number of parallel runs)[-r]#remote run[-s]#simulation name[-t]#time limit[-v]#verbose[-w]#workflowBatchall batch operations#get the data for a batch runcitrosbatchget<id>#lists all batches + statuscitrosbatchlist# delete a batch runcitrosbatchdelete<id>|<simulation>/<name>Data accessThis DB will be used wo store the indexed bags for the# starts server to listen for data access requests.citrosdataaccess[-p]#port[-v]#verbose[-D]#dockerized# prints the available data (db status) size, mem, how many batches loaded, etc...citrosdatastatus# create a new DB instance# creates all permissions and tables needed for CITROScitrosdatacreate[-n]#name of the DB[-p]#port of the DB[-u]#user of the DB[-P]#password of the DB[-v]#verbose[-D]#dockerized# clean the DB from data that wasend used for more then -d days -h hours -m minutescitrosdataclean[-d]#days[-h]#hours[-m]#minutes[-v]#verbose[-D]#dockerizedREST API detailsThe user can check the availability of the data in a rest api that will be created by the service.check the availability of the dataGET http://{domain}:{port}/{batch run name}{"status":"unloaded","last access":"2020-01-01 00:00:00",...}request access for batch runPOST http://{domain}:{port}/{batch run name}{"status":"loading","last access":"2020-01-01 00:00:00",...}ReportsA report is a signed set of generated notebooks with batch run data.
this report can be shared trough CITROR or sent as a file.# generate a signed report from a list of notebooks and use the data from the batch run specified.citrosreportgeneratenotebook.ipynbsimulation/batch_run_name# generate a report from report_name as specified unser .citros/reports/report_name.jsoncitrosreportgeneratorreport_nameObservabilitystart a node that will measue system / ros metrics and publish all to a topiccitrosobservability[-c]#channel[-t]#topic[-v]#verbose
Package: citros-data-analysis
Package for perfoming data analysis in CITROS.citros_data_analysisPackage to query and analyze data from Citros database.Package containes three modules:data_accesserror_analysisvalidationDocumentationdata_accessThedata_accessmodule provides functionality to retrieve information about batches and repositories, query simulated data and generate plots.Documentation: data_accessExamples: data_accesserror_analysisTheerror_analysismodule is for calculating and visualizing statistics across different simulations.Documentation: erros_analysisExamples: error_analysisvalidationThevalidationmodule is designed for setting validation tests on simulation results.Documentation: validationExamples: validation
Package: citros-test
CITROS CLI OverviewWelcome to Citros CLI.Citrosserves as an innovative platform for executing ROS project simulations, automating integration, and conducting in-depth performance analysis.The Citros CLI offers ROS 2 developers a seamless interface to launch multiple ROS simulations for a specific project with just a single command. Beyond setting static parameter values, it empowers users with the flexibility to utilize function objects. This means you can craft dynamic simulation environments where each execution produces unique parameter values, whether they're sourced from standard numpy functions or tailored via user-defined computations. Moreover, these operations can be executed offline without relying on any external dependencies.Citros takes its capabilities a notch higher when the user logs in. Once logged in, users can tap into the full potential of Citros, ranging from running parallel simulations in the cloud to utilizing advanced data analysis tools for performance examination. Additionally, automatic report generation is a standout feature, aiding in effortless documentation of your work. Beyond these technical perks, logging in also paves the way for collaborative work, allowing you to engage and exchange ideas with team members.For additional information, please refer to the Citros documentation. This will provide you with comprehensive insights and detailed instructions for effective usage of Citros in general and Citros CLI in particular, and their full suite of features.We are dedicated to enriching your ROS project simulation experience, and this package is our contribution to that cause.Table of ContentsQuick StartInstallationCLI CommandsCitros Repository directory and file StructureCitros Repository ConfigurationUser Templates
Package: citrus
CitrusIntended to work likePuLP, but with a few convenience functions thrown in.pipinstallcitrusComparisonsANDing two variables# without citrusimportpulpp=pulp.LpProblem('and example',pulp.LpMinimize)x=pulp.LpVariable('x',cat=pulp.LpBinary)y=pulp.LpVariable('y',cat=pulp.LpBinary)x_and_y=pulp.LpVariable('x_and_y',cat=pulp.LpBinary)model.addConstraint(x_and_y>=x+y-1)model.addConstraint(x_and_y<=x)model.addConstraint(x_and_y<=y)# with citrusimportcitrusp=citrus.Problem('and example',pulp.LpMinimize)x=p.make_var('x',cat=pulp.LpBinary)y=p.make_var('y',cat=pulp.LpBinary)x_and_y=x&y# alternatively, x_and_y = citrus.logical_and(x, y)ORing two variables# without citrusimportpulpp=pulp.LpProblem('or example',pulp.LpMinimize)x=pulp.LpVariable('x',cat=pulp.LpBinary)y=pulp.LpVariable('y',cat=pulp.LpBinary)x_or_y=pulp.LpVariable('x_or_y',cat=pulp.LpBinary)model.addConstraint(x_or_y<=x+y)model.addConstraint(x_or_y>=x)model.addConstraint(x_or_y>=y)# with citrusimportcitrusp=citrus.Problem('or example',pulp.LpMinimize)x=p.make_var('x',cat=pulp.LpBinary)y=p.make_var('y',cat=pulp.LpBinary)x_or_y=x|y# alternatively, x_or_y = citrus.logical_or(x, y)Negating a variable# without citrusp=pulp.LpProblem('negation test',pulp.LpMinimize)x=pulp.LpVariable('x',cat=pulp.LpBinary)not_x=pulp.LpVariable('not_x',cat=pulp.LpBinary)p.addConstraint(not_x==1-x)# With citrusimportcitrusp=citrus.Problem('negation test',pulp.LpMinimize)x=p.make_var('x',cat=pulp.LpBinary)not_x=citrus.negate(x)Tips & TricksSometimes, you'll have many variables that you want to AND or OR together:p=citrus.Problem('vacation at some point',pulp.Maximize)vacation_in_x_month=[p.make_var('vacation in '+month,cat=pulp.LpBinary)formonthinMONTHS]take_a_vacation=reduce(citrus.logical_or,vacation_in_x_month)p.addConstraint(take_a_vacation)APIClassesVariableis a subclass ofpulp.LpVariable. It adds the following methods:(classmethod)from_lp_var. Upgrade apulp.LpVariableto a Variable.__or__(self, other)Compute thelogical_orof two binaryVariables__and__(self, other)Compute thelogical_andof two binaryVariables__and__(self, other)Compute thelogical_andof two binaryVariables__abs__(self)Create a new Variable restricted to the absolute value of this one.ProblemA subclass ofpulp.LpProblem. It adds the following methodmake_var()accepts the same arguments aspulp.LpVariable, but produces aVariableFunctionsnegate(x: Variable)Produce a newVariablewith the opposite value ofx.logical_and(x: Variable, y: Variable)Produce a newVariableconstrained to take on the AND ofxandy.logical_or(x: Variable, y: Variable)Produce a newVariableconstrained to take on the OR ofxandy.logical_xor(x: Variable, y: Variable)Produce a newVariableconstrained to take on the XOR ofxandy.implies(x: Variable, y: Variable)Produce a new variable constrained to take on the value ofx => yminimum(*xs)Produce a newVariablethat can be no larger than the smallest inxsmaximum(*xy)Produce a newVariablethat can be no smaller than the largest inxs