Saravanan666/pypi-org huggingface dataset:
Package: ctft
ctftctft is a python cli tool to save and view stylisedctftime.orgwriteups locally in your terminal.Search for writeupsby name or keywordView Stylised writeupsfrom saved filesWriteups are saved are asmarkdown fileswhich can also be read as plaintext(even though it doesn't make sense to read plaintext over formatted :unamused: )VSCode users can also use markdown viewing extensions likeMarkdown Preview Enhancedto view writeupsThe project took inspiration frommzfr's lswriteupsbut I wanted to further the ease of access and reduce browser dependence.The tool currently scrapes only writeups on CTFTime.org and github READMEs.
If you would like to add support for your site or your favourite author(with their permission ofcourse), feel free to contact me or make a pull requestUsage➜python3ctft.py-h
usage:ctft[-h](-eEVENT|-vTASKNAME)Getandviewstylisedctftimewriteupsinyourterminal

optionalarguments:-h,--helpshowthishelpmessageandexit-eEVENT,--eventEVENTNameofthectfevent-vTASKNAME,--viewTASKNAMEViewwriteupinterminalThe files are saved in your (home directory)/ctft_writeupsDEMOpython3 ctft.py -e asisctfYou can also make an alias of ctft or add ctft to $PATH for easier usagectft -v Web\ Warm-upInstallationpip3 install ctftManual InstallationCone the repo:git clone https://github.com/bajatin/ctftInstall dependencies:pip install -r requirements.txtContributingI started this project solely for educational purposes to familiarize myself with python and asynchronous programming.
Pull requests or suggestions for imporvement are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT
Package: ctg-data-helpers
CTG-Data-HelpersThis directory contains modules we developed to help with data processing, downloading and ingesting.Required dependencies:loggingospathlibhashlibpkgutiliozipfiletempfilepandasrequestssqlalchemypsycopg2-binaryDownload FunctionsThe first set of functions in the module assist with downloading dataget_path()- A string representing the path to the file or directory. If a path is provided, will return that path. If a path is not provided, will provide a new path based on a temp directory and the hash of the URL.make_path()- If a path doesn't exist,get_path()internally calls this function to build a new path. (Essentially a wrapper function aroundos.mkdirto catch errors)hash_url()- Hashes the given download URL to help build the temp path if none has been given.pure_download()- Downloads the data from the URL with the capacity to handle zip files if specified.download_data_cache()- Checks before callingpure_download()to see if the data has previously been downloaded. If the data is already in the cache, the function just returns the path to that data, without downloading it a second time.Pandas FunctionsThe second set of functions in the module assist with setting up the data in Pandas DataFrames for easier processingsetup_df()- Given a set of specified parameters, this function ingests the CSV to a DataFrame. Note:**cli_optionsis integrated with our click-based command-line-interfaces.PostgreSQL FunctionsThese functions help with setting up the database, confirming a successful upload, and uploading the data itselfget_engine()- Given the set environmental variables, returns an engine to connect to the database.confirm_table()- After data has been ingested, confirms that the data was successfully uploaded to the database.upload_data()- Uploads the data of a specific DataFrame to the database given some predetermined variableshas_primary_key()- Checks to see if an existing table has a primary keyset_primary_keys()- Given a table name and a list of columns for a primary key, this function creates the primary key.Extension Functionsbuild_plugins_map()- This function helps dynamically build a plugin map when using this code in a command-line environment
Package: cthenp
CTPCollect Then Process: A python data collection libraryWhat do you need to do if you are running some programs on the remote server and you want to collect some runtime data during program running, and process it on your local PC, e.g. plot a figure? See how many steps you need without ctp:collect the dataserialize the datadownload the data to your local computer through various ways: scp, ftp ...deserialize the data on your local computerprocess the data, e.g plot a figureTired of all this? ctp now provides a easy to use solution of just Collect then Process:Collect on the remote cloud server:importctpwithctp.append_run("my_experiment")asrun:run.collect("my_data",data)Then Process on your local computer:importctpwithctp.get_run("my_experiment")asrun:data=run.process("my_data")Usage:pipinstall--index-urlhttps://test.pypi.org/simple/--extra-index-urlhttps://pypi.org/simplecthenpServer:To start a server locally:importctpctp.start_listen(ip="localhost",port=50057)Collect:Example usage of collecting data and transfer it to server:importctprun=ctp.append_run("sample_exp")This appends a new run of the experiment, to collect data to new run:foriinrange(10):run.collect("sample_data")Or you can also pass a list created by yourself by:sample_data=[]# sample data list created by your selfrun.monitor("sample_data",sample_data)foriinrange(10):sample_data.append(i)After collecting data, finish collect and upload all data to server:run.stop_collect()If you don't want to deal with start and stop by your self, you can:withctp.append_run("sample_exp")asrun:...## your code herewill automatically upload all data once this block is finishedProcessTo process data from other machines:importctprun=ctp.get_run("sample_exp")get sample data:sample_data=run.process("sample_data")APIctpdefstart_listen(ip:str="localhost",port:int=50057)->None:defappend_run(exp_name:str,ip:str="localhost",port:int=50057)->ctp.Run:defget_run(exp_name:str,ip:str="localhost",port:int=50057)->ctp.Run:ctp.Run:defcollect(self,user_label:str,data:any=None,prefix:str='_')->List[any]:defmonitor(self,user_label:str,datas:List[any],prefix:str='_')->None:defstop_collect()->None:defprocess(self,user_label:str=None)->Optional[dict[str,List[any]],List[any]]:
Package: cthmm
cthmmThis is a python library for training and applyingcontinuous-time markov hidden markov models(CT-HMMs).
They are a simple, but exceptionally powerful tool for extracting
signal from a stream of noisy data.It was developed byField Cady.Basic UsageA Jupyter Notebook with usage usage ishere.
The main functionalities are to:Create a CT-HMM with pre-defined parametersFit a CT-HMM to data (i.e. one or more sequences of observations, along with their timestamps)Given a sequence of observations and timestamps, use a fitted CT-HMM to decode the underlying states
at each timestampTODO ItemsSupport for GaussianCTHMM and ExponentialCTHMM by inheriting from BaseCTHMM classAllowing human-readable names for statesPerformance improvements, possibly by converting to C or CythonUnit testingAdd in some fitting tolerances to reduce overfittingWhat is a continuous-time hidden markov model?Say you take somebody's temperate and it's in the normal range.
In isolation that suggests they are healthy rather than sick.
But if they had elevated temperatures one hour before and after,
chances are that measurement was a fluke and they were actually sick the whole time.Hidden markov models address this problem more generally.
There is some underlying state S of the world that varies over time
(or something like time - things just have to be sequential),
and you have some idea of how often S changes.
You don't know S for certain, but you have a sequence of
imperfect observations O at certain points in time.
You can use O(t) to guess at S(t), but you want to use the
other observations before/after t to improve on that guess.In a traditional HMM time occurs in discrete steps:
t is an integer, S(t) is either the same or different from S(t-1),
and you have the accompanying observation O(t).
But in many real-world situations time flows continuously,
and S can change at any moment.
Observations come at irregular intervals,
and they may or may not be close to the times that S changes.
If you are trying to guess S(t), the surrounding observations
are more/less informative depending on how far they are from t.In math terms a traditional HMM assumes that S is a
discrete-timeMarkov Chain,
while a CT-HMM assumes that S is acontinuous-time markov modeland makes no assumption about what observations get taken.
The nuts-and-bolts math of a CT-HMM ends up being a lot trickier
than for a normal HMM, and partly for that reason they are not
used as commonly.
But in many situations they are essential.
Package: cthreading
cthreading implements Python 2 Lock, RLock, and Condition in C, speeding
up threads synchronization and decreasing cpu usage.Status:Performancecthreading eliminates the overhead ofthreading.RLockandthreading.Conditionwhich are implemented in pure Python in Python 2.
In particular,threading.Conditionis implemented using polling. In
Python 3threading.Conditionis implemented without polling;
cthreading implements a similar design in C.$ time python whispers.py -m cthreading
real    0m2.664s
user    0m2.965s
sys     0m0.808s

$ time python3 whispers.py
real    0m9.664s
user    0m8.949s
sys     0m1.812s

$ time python whispers.py
real    0m14.914s
user    0m16.986s
sys     0m12.690s

$ time python whispers.py -m pthreading
real    0m20.169s
user    0m23.062s
sys     0m17.022sYour application is unlikely to have similar workload; do not expect
this improvement.For more info seehttps://github.com/nirs/cthreading/wiki/performance.UsageImport cthreading before any other module and monkeypatch the thread and
threading modules. From this point, threading.Lock, threading.RLock, and
threading.Condition are using cthreading.importcthreadingcthreading.monkeypatch()Note: cthreading will raise RuntimeError if the threading module was
imported beforecthreading.monkeypatch()is called.Tested platformsx86_64Fedora 22 / Python 2.7.10RHEL 7.2 / Python 2.7.5RHEL 7.2 / Python 2.7.10+ (upstream)RHEL 7.1 / Python 2.7.5RHEL 6.7 / Python-2.6.6Ubuntu 14.04 Server / Python 2.7.6Ubuntu 12.04 Server / Python 2.7.3 (python regression tests not available)Ubuntu 12.04 / Python 2.6.9 (Travis container)Ubuntu 12.04 / Python 2.7.9 (Travis container)POWER8ERHEL 7.2 / Python 2.7.5RHEL 7.2 / Python 2.7.10+ (upstream)HackingFor rpm based distributions:yum install python-devel python-testFor deb based distributions:apt-get install python-dev libpython2.7-testsuiteInstalling Python packages:pip install pytest pytest-timeout yappi==0.93Building and running the quick tests:makeBefore submitting patches, run the Python regression tests suite:make regrtestCheck theMakefilefor more info.Similar projectspthreading- uses
pthread_mutex and pthread_cond apis directly via ctypes. This
introduces undefined behavior and actually slower and increases cpu
usage in most cases compared to the original Python implementation.
Package: cthreepo
cthreepoA python script to interconvert seq-ids in gff3, gtf, bed and other files.Quick start for the impatientInstall using condaconda install -c bioconda cthreepoExecute as follows:## convert seq-ids in <input.gff3> from refseq format (NC_000001.11)
## to UCSC format (chr1) using the Human GRCh38 mapping dictionary
cthreepo -i <input.gff3> -if rs -it uc -f gff3 -m h38 -o <output.gff3>IntroductionNCBI RefSeq, UCSC and Ensembl use different identifiers for chromosomes in annotation and other files such as GFF3, GTF, etc. Users interested in using a mix of files downloaded from different sources and use them in a single pipeline may end up with seq-id mismatch related errors. This script converts seq-ids from one style to the other in order to make the files compatible with each other.Installation and UsagePython3 is required for this script to work. With that requirement satisfied, you can install as shown below:Install using condaconda install -c bioconda cthreepoInstall using pippip install cthreepoInstall from this repositoryFirst, download/clone the repository. Then run:python3 setup.py installUsage## help
cthreepo --help 

## usage
## convert seq-ids in <input.gff3> from refseq format (NC_000001.11)
## to UCSC format (chr1) using the Human GRCh38 mapping dictionary
cthreepo \
    --infile <input.gff3> \
    --id_from rs \
    --id_to uc \
    --format gff3 \
    --mapfile h38 \
    --outfile <output.gff3>File formats supportedGFF3 (default)GTFBedGraphBEDSAMVCFWIGTSVMapping filescthreeponeeds amapfilethat it uses to figure out how seq-ids map from one style to the other.Use the built-in shortcuts --h38,h37,m38andm37for GRCh38/hg38, GRCh37/hg19, MGSCv37/mm9 and GRCm38/mm10 respectively. I try to keep these files up-to-date but if they don't work as expected, I suggest using the latest file by following one of the two options described below.Provide NCBI assembly accession using the-aparameter. A complete, legal accession.version such as GCF_000001405.39 should be provided.Provide an NCBI assembly report file. For a given assembly it can be downloaded from theNCBI Assemblywebsite. If the 'Download' button is used, this file is called 'Assembly structure report'. On theNCBI Genomes FTPsite, these files have the suffixassembly_report.txt.
Package: cthulhu
cthulhuIonospheric diagnostics and tools. Mostly designed to work with the information provided by RTS calibration logs for EoR analysis, but will work with any other positional data.Usagecthulhuis designed to interface with the Murchison Widefield Array (MWA) Real-Time System (RTS) calibration software. But,cthulhuis also modular enough to accept generic ionospheric data; it needs only the expected and apparent positions of sources (provided as “offsets” or “shifts”).cthulhu_wrapper.pyacts as the primary interface for RTS data, and this application is directly responsible for populating the MWA quality-assurance database (QA DB).cthulhu_wrapper.pyalso acts as a demonstration of using thecthulhulibrary, but it may be easier to follow library usage with examples in thenotebooksdirectory.A simple usage of cthulhu is given in “cthulhu_wrapper.py”. Alternatively, for integration with another script or somesuch:from cthulhu.reconstruct import Obsid
from cthulhu.plot_tools import generate_diagnostic_figure, raw_and_tec
obj = Obsid([ra, dec, ra_shifts, dec_shifts])
generate_diagnostic_figure(obj)
raw_and_tec(obj)wherera,dec,ra_shiftsanddec_shiftsare lists or numpy arrays containing expected and apparent positions of sources due to ionospheric activity. This will generate plots in the present working directory underplotsandraw_and_tec.If interfacing with RTS logs, cthulhu includes scripts to convert RTS logs to pickles, JSONs and YAMLs. These intermediate files are useful because interfacing directly with an RTS log is much slower, and occupy much smaller volumes. Pickles will be approximately one-third the size of a JSON or YAML, but need to be unpacked before being inspected, and are not compatible across all versions of python and computer architectures. In addition, pickles can execute arbitrary code upon opening, so avoid using them whenever possible. YAML is also a lot more readable than JSON, as well as contained in a smaller file size, so use YAML if you can!LimitationsCurrently, cthulhu expects coordinates to be in a celestial reference frame ($alpha$, $delta$). However, no coordinate transformations (or etc.) are performed with common operations, so your resulting plots will simply use the values of your input data’s coordinate system with default RA/Dec. labels. Other coordinates could be incorporated in the future, but is beyond the scope of this work.Modelling and correcting the “ionosphere” from the data is not implemented correctly yet, although this will not involve much work.Bugs? Inconsistencies?Absolutely! If you find something odd, let me know and I’ll attempt to fix it ASAP.Contactchristopherjordan87 -at- gmail.comDependenciespython 2.7.x or 3.xnumpyscipyastropymatplotlibfuturepyGrad2Surf (available on myGitHub)Optional dependenciesPyYAML (human-readable intermediate format, really nice!)
Package: ctidb
DescriptionThis is a Python module for reading CTI DB files.CTI DB is a binary file format that stores data indexed by IP address
subnets (IPv4 only).InstallationTo install ctidb, simply:$pipinstallctidbUsageTo use this module, you must first download or create a CTI DB file.After you have obtained a database and imported the module, callCCtiReaderwith a path,
to the database as the first argument. Optionally, you may pass a mode as the
second argument. The modes are exported fromctidb. Valid modes are:MODE_MEMORY- load database into memory. Pure Python.MODE_AUTO- Default.NOTE:
To look up an IP address, use thegetmethod on this object. The method will return the
corresponding values for the IP address from the database (e.g., a dictionary
for GeoIP2/GeoLite2 databases). If the database does not contain a record for
that IP address, the method will returnNone.Example>>>importctidb>>>>>>withctidb.CCtiReader('criminalip.ctidb')asreader:>>>>>>reader.get('223.26.31.75'){'country': ... }ExceptionsThe module will return anInvalidDatabaseErrorif the database is corrupt
or otherwise invalid. AValueErrorwill be thrown if you look up an
invalid IP address or an IPv6 address in an IPv4 database.RequirementsThis code requires Python 3.7+. Older versions are not supported.VersioningSupport
Package: ctimed-rotating-file-handler
CTimedRotatingFileHandlerTimedRotatingFileHandler usingctimeinstead ofmtimeto determine rollover times.This module provides a subclassCTimedRotatingFileHandleroflogging.handlers.TimedRotatingFileHandlerthat uses
file creation time instead of file modification time to calculate the next rollover time.It also contains a workaround for "file system tunneling" on Windows, which prevents new files from having new
creation times if they have already existed a short time ago.To be able to do this, a new dependency towin32-setctimeis introduced (only needed if running on Windows).Usage Exampleimportloggingfromctimed_rotating_file_handlerimportCTimedRotatingFileHandlerlogfile='path/to/logdir/MyName.log'loglevel=logging.DEBUGbackupcount=7logformat='%(asctime)s\t%(levelname)s\t%(name)s\t%(message)s'log=logging.getLogger()formatter=logging.Formatter(fmt=logformat)loghandler=CTimedRotatingFileHandler(logfile,when='midnight',interval=1,backupCount=backupcount)loghandler.setFormatter(formatter)logging.root.addHandler(loghandler)logging.root.setLevel(loglevel)log.info('This is an information.')Development and buildingPrerequesitesPython 3.9 has to be installed withpipand packages:virtualenvbuildSetup development environmentAfter cloning the repo, you should create a virtual environment for all further development work.This may be done by calling one of the includedsetup_venvscripts for your platform:setup_venv.cmd: Windows batchsetup_venv.ps1: Windows Powershellsetup_venv.sh: BashThis willcreate a new virtual environment in the directoryvenvor update an existing one,install all requirements fromrequirements.txt.You still have to activate the venv manually (or automatically by configuring it in your IDE).Building the packageAll buils settings are insidepyproject.toml.You might want to changeproject.versionbefore building (eg. add.dev1to it), so you always know which one
you are dealing with.To build the project, simply run this command from inside the project directory (the same directory that containspyproject.toml):python -m buildThis will create.whland.tar.gzin the directorydist.
Package: cTimer
# cTimer - High Precision Timer Extension`cTimer` provides a nanosecond-precision timer to Python.##Usageimport cTimer as timerstart = timer.start()# Do a bunch of things here that take some time.checkpoint = timer.checkpoint()# Do some more time-vampire things here.stop = timer.stop()print timer.diff(start, stop) # Total execution timeprint timer.diff(start, checkpoint) # Execution time of first halfprint timer.diff(checkpoint, stop) # Execution time of second halfprint timer.get() # Time since cTimer was imported## Methods**`start()`** - returns an `int` referencing the current time stamp.**`checkpoint()`** - returns an `int` referencing the current time stamp.**`stop()`** - returns an `int` referencing the current time stamp.**`diff(int A, int B)`** - returns the difference between two timestamp references provided by `start()`, `checkpoint()` or `stop()`. Order does not matter, result is always a positive `float` representing seconds.**`get()`** - returns the number of seconds as a `float` since the `cTimer` library was `import`ed.## InstallationClone the repository into a new folder. Run the following commands (you *may* need to `sudo` the second one):python setup.py buildpython setup.py install## NotesThis is a lightweight extension and has not been thouroughly tested on all combinations of platforms and Python versions.It has been tested on CentOS 5, Ubuntu 10.4, and OSX 10.5 to 10.8 using Python 2.7 and Python 3.2. All platforms were 64-bit.This *should* work with 32-bit hosts, but that has not been tested yet.This *does not* work on Windows hosts yet.
Package: ctitools
Work with cti index files for the Heise papers c’t and iXDescriptionThis project provides different tool for processing index files from
Heise papers c’t and iX.Saving the current base dataset, downloaded from Heise and extractng to
data, the command> cti2bibtex data/inhalt.frm result.bibtexcreates a.bibfile with 82100 entries. Importing this result in
Zotero took more than 28h and use more than 7GB of RAM.cti2bibtexworks with the zip files directly now, so the commands> cti2bibtex ctin2328.zip
> cti2bibtex register-kurz.zipcreate the filesctin2328.bibandregister-kurz.bib.Installationctitoolsare on pypi now, so> pip install ctitoolsinstalls the last version.It can also be installed from the source repository on gitlab> pip install git+https://gitlab.com/berhoel/python/ctitools.gitDocumentationDocumentation can be foundhereAuthorsBerthold Höllmann <berthold@xn–hllmanns-n4a.de>Project statusThe projects works for converting thectiandfrmfile, provided
by Heise, tobibfiles.
Package: ctktablerowselector
CTkTableRowSelectorWrapper class around CTkTable to let users select rows.FeaturesPlug&Play: No shady attributes, create an instance and get the values you need.Easy to use interface.Select multiple rows using CTRL-Key.Headers are selectable or not, based on your need.100% test coverage. All interactions with the CTkTable are tested using pytest.Stable.Vertical table support.Installpip install CTkTableRowSelectorExampleNote:You can run a more advanced example usingpython3 -m CTkTableRowSelector.importcustomtkinterfromCTkTableimport*fromCTkTableRowSelectorimport*root=customtkinter.CTk()value=[["Header"+letterforletterin"ABCDE"],*[[i,i+1,i+2,i+3,i+4]foriinrange(0,25,5)]]table=CTkTable(master=root,row=5,column=5,values=value)table.pack(expand=True,fill="both",padx=20,pady=20)# Add the selectorrow_selector=CTkTableRowSelector(table)# Get the valuebutton=customtkinter.CTkButton(root,text="Print selected rows",command=lambda:print(row_selector.get()))button.pack(pady=(0,20))root.mainloop()## Licence
This project is delivered under the MIT Licence.
Package: ctl
CtlFull control of your environmentDocumentationlatest:https://ctl.readthedocs.io/en/latestLicenseCopyright 2016-2024 20C, LLCLicensed under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.