Saravanan666/pypi-org huggingface dataset:
Package: classprop
Small python package that provides a@classpropertydecorator for python classes
that works just like@propertyexcept for class variables!$pipinstallclasspropUse it just like builtin@property’s:fromclasspropimportclasspropclassTestClass:_internal="Hello, World"@classpropdefmy_class_prop(self)->str:returnself._internal@my_class_prop.setterdefmy_class_prop(self,value:str)->None:self._internal=valuefoo=TestClass()assertfoo.my_class_prop=="Hello, World"baz=TestClass()assertbaz.my_class_prop=="Hello, World"baz.my_class_prop="Changed"assertfoo.my_class_prop=="Changed"DevelopmentFor detailed instructions seeCONTRIBUTING.TestsYou can run tests with$invoketest$invoketest--min-coverage=90# Fail when code coverage is below 90%$invoketype-check# Run mypy type checksLinting and formattingLint and format the code with$invokeformat$invokelintAll of this happens when you runinvokepre-commit.NoteThis project is still in the alpha stage and should not be considered production ready.
Package: classproperty
Author:Philipp von WeitershausenEmail:philikon@philikon.deLicense:Zope Public License, v2.1MotivationUsing method decorators and descriptors likeproperty, we can
easily create computed attributes:>>> class JamesBrown(object):
...     @property
...     def feel(self):
...         return self._feelAn attribute like this cannot be written, though.  You would have to
do something like this:>>> class JamesBrown(object):
...     def _getFeel(self):
...         return self._feel
...     def _setFeel(self, feel):
...         self._feel = feel
...     feel = property(_getFeel, _setFeel)The problem with this approach is that it leaves the getter and setter
sitting around in the class namespace.  It also lacks the compact
spelling of a decorator solution.  To cope with that, some people like
to write:>>> class JamesBrown(object):
...     @apply
...     def feel():
...         def get(self):
...             return self._feel
...         def set(self, feel):
...             self._feel = feel
...         return property(get, set)This spelling feels rather cumbersome, apart from the fact thatapplyisgoing to go awayin Python 3000.GoalThere should be a way to declare a read & write property and still use
the compact and easy decorator spelling.  The read & write properties
should be as easy to use as the read-only property.  We explicitly
don’t want that immediately called function that really just helps us
name the attribute and create a local scope for the getter and setter.Class propertiesClass properties let you define properties via theclassstatement.  You define a dynamic property as if you were implementing
a class.  This works like this:>>> from classproperty import classproperty
>>> class JamesBrown(object):
...     class feel(classproperty):
...         def __get__(self):
...             return self._feel
...         def __set__(self, feel):
...             self._feel = feel>>> i = JamesBrown()
>>> i.feel
Traceback (most recent call last):
...
AttributeError: 'JamesBrown' object has no attribute '_feel'>>> i.feel = "good"
>>> i.feel
'good'Of course, deleters are also possible:>>> class JamesBrown(object):
...     class feel(classproperty):
...         def __get__(self):
...             return self._feel
...         def __set__(self, feel):
...             self._feel = feel
...         def __delete__(self):
...             del self._feel>>> i = JamesBrown()
>>> i.feel = "good"
>>> del i.feel
>>> i.feel
Traceback (most recent call last):
...
AttributeError: 'JamesBrown' object has no attribute '_feel'
Package: classr
Classr SDK for PythonUse microclassifiers in the cloud for spam detection, sentiment analysis and more.RequirementsPython 3.6 or newerInstallationThe Classr SDK for Python can be installed usingpip:pipinstallclassrUsageInitiaize your microclassifier by passing its UUID to theClassrconstructor like so:fromclassrimportClassr# Initialize cloud microclassifier.classifier=Classr('acd78708-850b-4cea-aeaa-23cec50d13b6')Now, call theclassifyorget_infofunctions ofclassifierto make use of it:# Classify unseen input.document=input('Enter your input: ')print(f'Predicted class:{classifier.classify(document)}')# Print macro F1 score of classifier.info=classifier.get_info()print(f'Classifier macro F1 score is:{info.f1_score}')If you'd like to use a self-hosted deployment of the Classr application (i.e. not the default official API), you can
pass a different base URL when constructing yourClassrobject:fromclassrimportClassr# Initialize cloud microclassifier.classifier=Classr('acd78708-850b-4cea-aeaa-23cec50d13b6','https://self-hosted-classr.example.com/')Related ProjectsThis SDK is for the officialClassr application(but will work with a
self-hosted deployment too, of course).LicenseMIT©lambdacasserole.
Package: classrad
Simple pipeline for experimenting with radiomics featuresStreamlit ShareDockerPythonDemodocker run -p 8501:8501 -v <your_data_dir>:/data -it piotrekwoznicki/classy-radiomics:0.1pip install --upgrade classradInstallation from sourcegitclonehttps://github.com/pwoznicki/ClassyRadiomics.gitcdClassyRadiomics
pipinstall-e.Example - Hydronephrosis detection from CT images:Extract radiomics features and save them to CSV tabledf=pd.read_csv(table_dir/"paths.csv")extractor=FeatureExtractor(df=df,out_path=(table_dir/"features.csv"),image_col="img_path",mask_col="seg_path",)extractor.extract_features()Create a dataset from the features tablefeature_df=pd.read_csv(table_dir/"features.csv")data=Dataset(dataframe=feature_df,features=feature_cols,target="Hydronephrosis",task_name="Hydronephrosis detection")data.cross_validation_split_test_from_column(column_name="cohort",test_value="control")Select classifiers to compareclassifier_names=["Gaussian Process Classifier","Logistic Regression","SVM","Random Forest","XGBoost",]classifiers=[MLClassifier(name)fornameinclassifier_names]Create an evaluator to train and evaluate selected classifiersevaluator=Evaluator(dataset=data,models=classifiers)evaluator.evaluate_cross_validation()evaluator.boxplot_by_class()evaluator.plot_all_cross_validation()evaluator.plot_test()
Package: class-registry
ClassRegistryAt the intersection of the Registry and Factory patterns lies theClassRegistry:Define global factories that generate new class instances based on
configurable keys.Seamlessly create powerful service registries.Integrate with setuptools’sentry_pointssystem to make your registries
infinitely extensible by 3rd-party libraries!And more!Getting StartedCreate a registry using theclass_registry.ClassRegistryclass, then
decorate any classes that you wish to register with itsregistermethod:fromclass_registryimportClassRegistrypokedex=ClassRegistry()@pokedex.register('fire')classCharizard(Pokemon):...@pokedex.register('grass')classBulbasaur(Pokemon):...@pokedex.register('water')classSquirtle(Pokemon):...To create a class instance from a registry, use the subscript operator:# Charizard, I choose you!fighter1=pokedex['fire']# CHARIZARD fainted!# How come my rival always picks the type that my pokémon is weak against??fighter2=pokedex['grass']Advanced UsageThere’s a whole lot more you can do with ClassRegistry, including:Provide args and kwargs to new class instances.Automatically register non-abstract classes.Integrate with setuptools’sentry_pointssystem so that 3rd-party
libraries can add their own classes to your registries.Wrap your registry in an instance cache to create a service registry.And more!For more advanced usage,check out the documentation on RTD!RequirementsClassRegistry is compatible with Python versions 3.6, 3.5 and 2.7.InstallationInstall the latest stable version via pip:pip install class-registry
Package: classroom-extensions
IPython Extensions for TeachingThis project provides a set of IPython extensions used for teaching at the
Ecole de Technologie Superieure (ETS) of Montreal. The extensions work on
Google Colab, and Jupyter notebooks with some effort, and provide a set of
magics (e.g.,%%sql) while customizing existing ones (e.g.,%%javascript)
to enable lecturers and students to deploy software frameworks quickly and
provide notes with working examples.Thenotebooksdirectory contains a set of Google Colab examples of how to
use the IPython extensions.Installing the ExtensionsYou can usepipto install the extensions:pip3 install classroom-extensionsor:pip3 install git+https://github.com/assuncaomarcos/classroom_extensions.gitOr clone this git repository and load the required extensions from theclassroom_extensionspackage.MariaDB MagicsTwo extensions are available for MariaDB. One extension (mariadb) uses some
components of the MariaDB Jupyter Kernel and creates a%%sqlcell magic that enables
code cells to accept SQL commands that an instance of MariaDB interprets. However,
unlike the MariaDB Jupyter Kernel, this extension does not change the IPython kernel
and its magics, hence enabling one to continue coding in Python, JavaScript, etc.
To ease the creation of notebooks on Google Colab, a second extension (mariadb_install)
installs MariaDB and the required libraries to run the first extension without
worrying about setting things up.Server-Side JavaScriptThis extension, calledweb, customizes the%%javascriptcell magic to enable
executing JavaScript code on the server or container hosting the Jupyter Notebook or
on Google Colab. Node.js executes the code provided in a cell whose–targetargument
receives the valueweb. It also enables starting long-running Node.js server
processes that will listen on given ports without blocking the code cell of
the notebook. In addition to executing JavaScript code on the server side, when run
on the browser, the magic enables printing the output of the browser’s console in
the result section of the code cell.Custom HTML MagicThewebextension also customizes the%%htmlmagic. After rendering the HTML code
inserted in the cell, the extension displays a high-level copy of the browser’s
console. This behavior helps in teaching HTML or JavaScript that writes on the console.PlantUML MagicsPlantUML is a textual Domain-Specific Language (DSL) used for creating diagrams,
primarily focused on software engineering and system design. It allows you to
express diagrams using a simple and intuitive syntax, which PlantUML transforms into
various types of visual diagrams, such as Unified Modeling Language (UML), sequence,
class, activity, and more.MongoDB Shell MagicsThe IPython extension%%mongoenables seamless interaction with MongoDB using
themongoshCLI. By simply prefixing a cell with%%mongo, users can execute queries
and commands against a MongoDB database directly within their IPython environment
or Colab. The extension leverages the power of themongoshCLI to provide a simple
and familiar MongoDB Shell experience, allowing for data exploration, manipulation,
and administration tasks.
Package: classroom-voter
Classroom VoterClassroom Voter is a secure LAN based polling system, similar to iClicker, which allows teachers to administer live polls. To start a poll, the teacher simply has to run the host program on their local machine. To join, students run the client program and enter the teachers IP address. Students can respond to questions via clients on their machines.Traffic is sent over HTTP on the local network. The system provides instructors with the ability to take polls while providing controllable levels of anonymity for students. For example, a teacher might make one question anonymized so that their view of the poll results just shows the number of students who voted for each option. Another poll might be transparent, and the instructor can see which participant voted for which option.InstallationAutomaticThis package is distributed via TestPyPI (Test, since the project is still in beta). Thelatest versioncan be installed via pip:pip3 install --index-url https://test.pypi.org/simple classroom-voter-harrismccManualLinux/OSXFrom thelatest release, download the file that looks likeclassroom_voter_harrismcc-VERSION.tar.gz. Next, use pip to install with the following command (making sure that the directory with the .tar.gz file is the active directoy):pip install classroom_voter_harrismcc-VERSION.tar.gz`WindowsFrom thelatest release, download the file that looks likeclassroom_voter_harrismcc-VERSION.whl. Next, use pip to install with the following command (making sure that the directory with the .tar.gz file is the active directoy):pip install classroom_voter_harrismcc-VERSION.whl`orpython -m pip install classroom_voter_harrismcc-VERSION.whlUsageAfter classroom voter is install, it can be run via the command line. To login as a student or professor, runpython -m classroom_voter.loginThis will prompt you first for the ip address and port of the server (given to you by the professor/ system admin), and then for your username and password (check your email)
Package: classroom-voter-harrismcc
Classroom VoterClassroom Voter is a secure LAN based polling system, similar to iClicker, which allows teachers to administer live polls. To start a poll, the teacher simply has to run the host program on their local machine. To join, students run the client program and enter the teachers IP address. Students can respond to questions via clients on their machines.Traffic is sent over HTTP on the local network. The system provides instructors with the ability to take polls while providing controllable levels of anonymity for students. For example, a teacher might make one question anonymized so that their view of the poll results just shows the number of students who voted for each option. Another poll might be transparent, and the instructor can see which participant voted for which option.InstallationAutomaticThis package is distributed via TestPyPI (Test, since the project is still in beta). Thelatest versioncan be installed via pip:pip3 install --index-url https://test.pypi.org/simple classroom-voter-harrismccManualLinux/OSXFrom thelatest release, download the file that looks likeclassroom_voter_harrismcc-VERSION.tar.gz. Next, use pip to install with the following command (making sure that the directory with the .tar.gz file is the active directoy):pip install classroom_voter_harrismcc-VERSION.tar.gz`WindowsFrom thelatest release, download the file that looks likeclassroom_voter_harrismcc-VERSION.whl. Next, use pip to install with the following command (making sure that the directory with the .tar.gz file is the active directoy):pip install classroom_voter_harrismcc-VERSION.whl`orpython -m pip install classroom_voter_harrismcc-VERSION.whlUsageAfter classroom voter is install, it can be run via the command line. To login as a student or professor, runpython -m classroom_voter.loginThis will prompt you first for the ip address and port of the server (given to you by the professor/ system admin), and then for your username and password (check your email)
Package: class-singledispatch
class_singledispatchAsingledispatch()for arguments that are classes annotated as specific types.Inspired byhttps://github.com/python/cpython/issues/100623.A simple exampleUsefunctools.singledispatchto singledispatch classes as parameters.Whilefunctools.singledispatchexamines the class of the first user argument,class_singledispatchuses the first argument as the class itself and performs
the same task with it asfunctools.singledispatch.fromclass_singledispatchimportclass_singledispatchclassT:passclassOtherT:pass@class_singledispatchdefon_class(cls:type[T],/)->None:print("T!")@on_class.registerdefon_other_class(cls:type[OtherT],/)->None:print("OtherT!")# Useful for <=3.10, as soon as `@class_singledispatch` allows specifying# the class similarly to `.register` -- pass the class to the decorator# not to use the annotation from the function for the targeted class resolution@on_class.register(SomeOtherT)defon_some_other_class(cls:type[SomeOtherT],/)->None:print("SomeOtherT!")on_class(T)# T!on_class(OtherT)#  OtherT!on_class(SomeOtherT)#  SomeOtherT!InstallationAsingledispatch()for arguments that are classes annotated as specific types.InstallationYou might simply install it with pip:pipinstallclass-singledispatchIf you usePoetry, then you might want to run:poetryaddclass-singledispatchFor contributors[!Note]
If you use Windows, it is highly recommended to complete the installation in the way presented below throughWSL2.Fork theclass_singledispatch repositoryon GitHub.Install Poetry.Poetry is an amazing tool for managing dependencies & virtual environments, building packages and publishing them.
You might usepipxto install it globally (recommended):pipxinstallpoetryIf you encounter any problems, refer tothe official documentationfor the most up-to-date installation instructions.Be sure to have Python 3.8 installed—if you usepyenv, simply run:pyenvinstall3.8Clone your fork locally and install dependencies.gitclonehttps://github.com/your-username/class_singledispatchpath/to/class_singledispatchcdpath/to/class_singledispatch
poetryenvuse$(cat.python-version)poetryinstallNext up, simply activate the virtual environment and install pre-commit hooks:poetryshell
pre-commitinstallFor more information on how to contribute, check outCONTRIBUTING.md.Always happy to accept contributions! ❤️Legal info© Copyright by Bartosz Sławecki (@bswck).This software is licensed under the terms ofMIT License.
Package: class-tools
Python Class Utilitiesclass-toolsis a collection of utilities for Python classes that the author
frequently needs.What can I do withclass-tools?Quickly Add Properties to Classesfromclass_tools.decoratorsimportwrapper_property@wrapper_property("name",default=lambda:"Bob",doc="The dog's name")@wrapper_property("toy",default=lambda:"ball")@wrapper_property("sharp_teeth",default=lambda:4,type=int)classDog:passdog=Dog()dog.__doc__# "The dog's name"dog.name# 'Bob'dog.toy# 'ball'dog.sharp_teeth="4"# (set as a string value)dog.sharp_teeth# 4 (returned as int)Add a Pretty__repr__Methodfromclass_tools.decoratorsimport*@with_init_from_properties()@with_repr_like_init_from_properties()@wrapper_property("name")@wrapper_property("furcolor")classCat:passcat=Cat(name="Lucy",furcolor="white")cat# Cat(#     furcolor = 'white',#     name = 'Lucy'# )Make Classes Comparable by Propertiesfromclass_tools.decoratorsimport*@with_eq_comparing_properties()@wrapper_property("name")@wrapper_property("furcolor")classCat:passlucy=Cat()lucy.name="Lucy"lucy.furcolor="white"lucy_clone=Cat()lucy_clone.name="Lucy"lucy_clone.furcolor="white"gary=Cat()gary.name="Gary"lucy==gary# Falselucy==lucy_clone# TrueAll of the Abovefromclass_tools.propertyobjectimportPropertyObjectfromclass_tools.decoratorsimportwrapper_property@wrapper_property("name")@wrapper_property("height",type=float)@wrapper_property("friends",type=list,default=list)classGiraffe(PropertyObject):passmatt=Giraffe(name="Matt")matt.height=3gunther=Giraffe(name="Gunther")gunther.friends.append(matt)gunther# Giraffe(#     friends=[Giraffe(#         friends=[],#         height=3.0,#         name='Matt'#     )],#     height=None,#     name='Gunther'# )InstallationTheclass-toolspackage is best installed viapip. Run from anywhere:python3-mpipinstall--userclass-toolsThis downloads and installs the package from thePython Package
Index.You may also installclass-toolsfrom the repository root:python3-mpipinstall--user.DocumentationDocumentation of theclass-toolspackage can be foundhere on
GitLab.Also, the command-line help pagepython3 -m class-tools -his your friend.
Package: classtools-autocode
Project page :official,backupWhat’s newDoc now generated from markdown usingmkdocsWant to contribute ?Contributions are welcome ! Simply Fork this project on github, commit
your contributions, and create pull requests.Here is a non-exhaustive list of interesting open topics:https://github.com/smarie/python-classtools-autocode/issuesto reference
new features or bugfixes.PackagingThis project usessetuptools_scmto synchronise the version number.
Therefore the following command should be used for development snapshots
as well as official releases:pythonsetup.pyegg_infobdist_wheelrotate-m.whl-k3
Package: classtree
ClasstreeClasstree is a hierarchical classifier for images or text.pipinstallclasstreeThe fastest way to use Classtree is to call the CLI on a folder of images or text files.train_data/|-animals/|-mammals/|-marsupials/|-koala/|-image001.jpg|-image002.jpg|-...|-...|-reptiles/|-...|-...|-...classtreetrainimages--modelanimals--dirtrain_data/animalsorclasstreetraintext--modelanimals--dirtrain_data/animalsAnd then use your model with the predict command.classtreepredict--modelanimalsnew_data/image304.jpg
>birds/raptors/eaglePre-trained ModelsYou can download a pre-trained model using the download command.classtreedownloadmodeldbpediaOr download a pre-prepared dataset.classtreedownloadimagesinaturalist21-mini
classtreedownloadtextdbpediaIf you want to fine-tune an existing model, you can use the--fromflag during training with any downloaded model.classtreetraintext--modelanimals--fromdbpedia--dirtrain_data/animalsAvailable ModelsTaskNameSizeDatasetNotesImage Classificationinaturalist21-miniMinaturalist21-miniNon-commercial research/educational use onlyText ClassificationdbpediaMdbpediaAvailable DatasetsTypeNameDatasetNotesImageinaturalist21-miniiNaturalist 2021 (Mini)Non-commercial research/educational use onlyTextdbpediaDBPediaCC0: Public DomainEvaluationYou can test your model on a hold-out dataset using thetestcommand.classtreetest--modelanimals--dir=test_data/animalsLicensingClasstree is available for non-commercial internal research use by academic institutions or not-for-profit organisations only, free of charge. Please, see thelicensefor further details. To the extent permitted by applicable law, your use is at your own risk and our liability is limited. Interested in a commercial license? For commercial queries, please emailaimlshop@adelaide.edu.auwith subject line “Classtree Commercial License”.This is anAIML Shopproject.
Package: classutil
classutil scraperMy attempt at aclassutil. It downloads the current UNSW class
allocations into a JSON file.Installation# optional: use virtualenvvirtualenv-ppython3venv
.venv/bin/activate

pip3install-rrequirements.txtRunpython-mclassutiloutput.jsonThe options are configurable, run with--helpfor more options.Library Usagefromclassutilimportscrape# Scrape data# Arguments don't need to be specified as these are the defaults.data=scrape(root="https://classutil.unsw.edu.au",concurrency=1,logging=False)