Saravanan666/pypi-org huggingface dataset:
Package: clean-workspace
Clean Workspace: Archive Web Browser TabsI love experimenting with productivity. One glitch I've found in my mind is I can easily
get distracted by open tabs on my browser, especially if I'm trying to write or read something which I want to give
my full attention to.I've found that if I close all my tabs (similar idea toshrinking context size), I can focus better on the task at hand. However, I don't
want to lose any interesting tabs so I don't easily quit my browsers. It's just the little extra of cognitive energy required to add more focus that doesn't get spent.This is utility to fix this issue. It closes all your tabs (in both Safari & Chrome), sends them totodoistwith a specified project and optionally a label, and outputs the list to the terminal (mostly for debugging). Only unique URLs are sent to Todoist, if you have a previous "archive task" with a URL archived it will not be archived again.This utility has helped my mind and made it easy for me to find interesting things I've run into in the past. I've tied this into a 'first wake'hyper focusscript to automatically run each morning when I first open my computer.Installationpipinstallclean-workspaceTODOIST_API_KEYhas to exist in your shell environment for the tool to run.
I recommend usingdirenvto do this. Add your todoist token to.envrcanddirenv allow .Customize the url and domain blacklistUsage❯clean-workspace--help
Usage:clean-workspace[OPTIONS]Options:--blacklist-domainsPATH--blacklist-urlsPATH--tab-descriptionTEXTDescriptionfortab--todoist-labelTEXTlabelintodoistforallcreatedtasks[default:web-archive]--todoist-projectTEXTprojectintodoistforallcreatedtasks[default:Learning]--helpShowthismessageandexit.Developmentpoetryinstall
poetryrunclean-workspaceRegex EntriesYou can use regex matches in both the url and domain blacklist files. For example, if you want to blacklist all Zoom domains, you can use the following:echo"/.*zoom\.us/">>~/.config/clean-workspace/blacklist-domains.txtA regex entry starts & ends with/, likesed.Collecting Tab Description Via AppleScriptHere's a quick script you can use to collect a description of what you were working on via applescript:dialogResult=$(osascript<<EOTset dialogResult to display dialog "What were you working on yesterday?" buttons {"OK"} default button "OK" giving up after 300 default answer ""return text returned of dialogResultEOT)Here's afull exampleof using this withhyper-focus.DebuggingYou can useipythonto interactively play with the todoist API:fromclean_workspaceimport_todoist_api_keyapi=TodoistAPI(_todoist_api_key())Inspirationhttps://gist.github.com/aleks-mariusz/cc27b21f2c5b91fbd285https://github.com/tominsam/shelf-python/blob/f357d9b147fa651034b71501edabf65f59d5befa/extractors/ComAppleSafari.py#L11TODOIndicate in python config that this is macOS only in poetry config?move blacklist files into example area of repolook at previous tasks and see if links are contained there before including them againsupport google chrome canarycheck to make sure regex gdrive urls work
Package: clear
clearA cross-platform Python module that provides a clear() function which clears the terminal. That's all.To install with pip, run:pip install clearYou can then clear the screen by running:from clear import clear
clear()This function runs the one-liner:os.system('cls' if os.name == 'nt' else 'clear')This module exists as a simpler alternative to defining this function on your own.Special thanks to David George for allowing me to use the Clear name on PyPI. The original Clear module ("Command-Line Extract And Rename utility. This provides a media library manager that allows extraction and renaming of media files.") can still be found in the previous releases of this project on PyPI.
Package: clearbit
# ClearbitA Python API client to [https://clearbit.com](https://clearbit.com).## InstallationTo install the Clearbit Python bindings, run:pip install clearbitOreasy_install clearbit## UsageFirst authorize requests by setting the API key found on your [account’s settings page](https://clearbit.com/keys).`python import clearbit clearbit.key = 'mykey' `You can also set the API key via the CLEARBIT_KEY environment variable.Then you can lookup people by email address. If the email’s domain is corporate we’ll also return a company response.`python response =clearbit.Enrichment.find(email='alex@clearbit.com',stream=True)`See the [documentation](https://clearbit.com/docs#person-api) for more information.## Company lookupYou can lookup company data by domain name:`python company =clearbit.Company.find(domain='uber.com',stream=True)`If the company can’t be found, thenNonewill be returned.See the [documentation](https://clearbit.com/docs#company-api) for more information.## TestingSet thePYTHONPATHenv var to the current directory to load the library locally:export PYTHONPATH=.## Deploypython setup.py sdist upload -r pypi
Package: clearbit-slack-python
Clean beautiful customer data. Now in Slack.InstallationAdd to your application’s requirements.txt file…clearbit-slack-pythonOr pip install…$ pip install clearbit-slack-pythonConfigurationTo use, instantiate aNotifierobject with your Slack token, channel, and datadictbuilt
from part of the body of the POST request sent by Clearbit.import json

from clearbit_slack import Notifier


slack_token = 'xoxp-1234567890-6789012345-5432109876-12ab34'
slack_channel = '#signups'
body_data = json.loads(request_body)
attrs = body_data.get('body', {})

notifier = Notifier(slack_token, slack_channel, attrs=attrs)
notifier.notify()ContributingFork it (https://github.com/15five/clearbit-slack-python/fork)Create your feature branch (git checkout -b my-new-feature)Commit your changes (git commit -am ‘Add some feature’)Push to the branch (git push origin my-new-feature)Create a new Pull Request
Package: clearbot
clearbotClearbit Logo API client.clearbotfetches the logo of company (png file) based on their domain name.InstallThe script in available through a python package.pipinstallclearbotGet startedYou can run directly the script on a domain.clearbotgithub.comYou can pass several domains as well.clearbotgithub.comgitlab.comA file can also be used as input (one domain by line).clearbot-f./domains.txtBy default it will output/tmp/<DOMAIN>.png. You can change the destination directory with the-doption.clearbot-d.github.comBy default it outputs 512px png file (i.e. the greatest side has 512px). You can change it with the-soption.clearbot-s64github.comSometimes we may want to remove the white background (by using transparency: alpha = 0). For this purpose, you can use the-toptions that thresholds the whites (it must be between 0 and 255 as it is applied on a grayscale version of the image).clearbot-t240github.comSincev0.3.0, clearbot can colorize image (but it is stillexperimental). You can color the whites (resp. the blacks) by providing the-wflag (resp. the-bflag).clearbot-t235-b"#FC6D26"github.comWhat's next?Add testsPrint result to the terminal
Package: clear-bow
Clear BOWOverviewA cheap model that takes a formatted dictionary as input, and pushes word frequencies through either a softmax (multi-class) or sigmoid (multi-label) function, to produce label "probabilities". Useful for bootstrapping classifications with raw terminology lists.InstallVia pip:pipinstallclear_bowOr clone directly:gitclonehttps://github.com/samhardyhey/clear-bowcdclear_bow
pipinstall.Usagefromclear_bow.classifierimportDictionaryClassifier# define, instantiate, callsuper_dict={"regulation":["asic","government","federal","tax"],"contribution":["contribution","concession","personal","after tax","10%","10.5%"],"covid":["covid","lockdown","downturn","effect"],"retirement":["retire","house","annuity","age"],"fund":["unisuper","aus super","australian super","sun super","qsuper","rest","cbus"],}# multi-class/label options availabledc=DictionaryClassifier(label_dictionary=super_dict)dc.predict_single("A 10% contribution is not enough for a well balanced super fund!")# {'regulation': 0.0878,#  'contribution': 0.6488,#  'covid': 0.0878,#  'retirement': 0.0878,#  'fund': 0.0878}See tests for additional usage.TestsSimple pytesting via:pytestMulti-venv tox testing via:toxDistUpdate version withinsetup.pyCreate dist.whland.tararchives via:pythonsetup.pysdistbdist_wheelPush to main pypi repo via:twineuploaddist/*
Package: clearconf
clearconfClearConf is a library created to support easy and manageble python configuration.
It consists in aCLI toolto manage configuration and in a python class (BaseConfig) which adds additional functionalities to
a configuration class.InstallationTo install ClearConf just runpip install clearconfUsageThe first step to use clearconf would be to use the CLI tool in the root of your project to initialize it:cconf initThis will generate aconfigdirectory where you will store your configurations and a.clearconffile used by ClearConf to keep track of configurations.
After this you can start populating your config directory. You can find examples of configuration files in theExamplesection.❗ClearConf recursively recognize as configuration all python files ending with_confFinally you can import a generic configuration in your script asfromconfigsimportConfigand use it as you please.When the script is run, if a default configuration has been set via the CLIcconf defaults add main.py test_conf.pysuch configuration will be dynamically imported.Otherwise, clearconf will list all the available configuration and ask you to pick one.0: example3_conf
1: example1_conf
2: example2_conf
3: example4_conf
Choose a configuration file:CLIFor more informations on the command line interface check the related README hereExamplesExample 1A configuration file for machine learning could be structure as follow.frommodelsimportMLPfromdatasetsimportImageNetclassConfig(BaseConfig):seed=1234classModel:architecture=MLPclassParams:num_layers=16layers_dim=[96]*num_layersclassData:dataset=ImageNetclassParams:root='./data/PCN'split='PCN.json'subset='train'The training/test script could read the configuration as follows:fromconfigsimportConfigModel=Config.ModelData=Config.Datamodel=Model.architecture(**Model.Params.to_dict())dataset=Data.dataset(**Data.Params.to_dict())Example 2It is also possible to simplify the configuration further using inheritance. For example the Model configuration seen before would look like this:frommodelsimportMLPclassConfig(BaseConfig):seed=1234classModel(MLP):classParams:num_layers=16layers_dim=[96]*num_layersThe corresponding scirp is:fromconfigsimportConfigModel=Config.Modelmodel=Model(**Model.Params.to_dict())
Package: clearcut
Clearcut: A straightforward and lightweight logging wrapper libraryThis provides some helpful wrapper and util functions for logging, and formats log messages in a more human-readable way by default.UseAt the top of the file:fromclearcutimportget_logger...logger=get_logger(__name__)Logging can be performed ad-hoc:logger.info("info log")logger.warning("warn log",exc_info=e)"log blocks" can also be created which automatically log entrance/exits as well as performance informationfromclearcutimportlog_block,get_logger...logger=get_logger(__name__)...withlog_block("block name",logger):...TODOWould like to use contextvars to create a contextmanager where additional "metadata" can be specified (and unspecified) which would be
included with logging automatically. (may not be import with OTLP tracing.)json logging
Package: clear-cut
Clear CutThis package is intended to serve as a tool to sketch out the edges of any provided image. This is a personal project which I am - to use an appropriate term -channelingmy number crunching desire into.Refer tothis repoif you would like to play around with the source code.To run locallyPick a new folder location, e.g.~/Desktop/mockIn a terminal, go into this foldercd [absolute_path]/mock/Create a new Python3 virtual environmentpython3 -m venv venvActivate this virtual environment:source venv/bin/activateInstall the latest (or specific) verion of the ClearCut python module:pip install clear-cut(==1.3.1)Run Python in shell:pythonExcecute the following Python script (tailoring the paths to your local set up):from clear_cut.clear_cutter import ClearCut

image_filepath = '/Users/christopherharman/Desktop/mock/clear-cut-mock-logo.jpg'
results_path = '/Users/myusername/Desktop/mock/'

# All kwargs are optional
#   param debug: toggles on/off output to terminal
#   param results_path: sets results directory. Omitting this parameter will write results to current working directory
#   param image_filepath: location to image. Omitting this parameter will use a default Bob Ross image instead
clear_cut = ClearCut(debug=True, image_filepath=image_filepath, results_path=results_path)
clear_cut.run()On completion, you should have a set of ClearCut processed images in a/results/directory
Package: cleaREST
cleaRESTLight-weight Python framework for building REST APIsWSGIminimalisticeasy to useadvanced variables processingautomatic html documentation generationURL Routingis done by decorating your handling function with one of these decorators:@GET@POSTonly one argument is required (url to handle) ie:@GET("/my/awesome/url")
def my_function():
    ...optionally you can specify successful http result status (default is HTTP_OK) ie:@GET("/my/awesome/url", status=HTTP_CREATED)
def my_function():
    ...list of status tuples:HTTP_OKHTTP_CREATEDVariablesGET variables from query stringPOST variables can be send as:application/x-www-form-urlencodedmultipart/form-dataapplication/jsonurl path variables (identifier inside curly brackets) ie:@GET("/my/awesome/url/{variable}")
def my_function(variable):
    ...Parsingper parameter parsing function assigned as default value ie:@GET("/my/awesome/url")
def my_function(myid=int):
    ...optional parameter:@GET("/my/awesome/url")
def my_function(myid=(int, 0)):
    ...reduction multiple into one:@GET("/my/awesome/url")
def my_function(user_id=lambda user, password: login):
    ...Returning databuild-in support:ClassContent-typestrtext/plaindictapplication/jsonminidomapplication/xmletreeapplication/xmlyou can also register any custom data-type or override table above with:register_content_type(type_, content_type, handler)Errorsto return a http error raise one of these exceptions:HttpBadRequestHttpNotFoundHttpUnsupportedMediaTypeHttpNotImplementedie:@GET("/my/awesome/url")
def my_function(myid=int):
    if myid == -1:
         raise HttpNotFound()
    ...HTML Documentationwhen is url opened by web-browser html documentation is shown instead of actual function call.“application/xhtml+xml” in accept http headersimilar tags to sphinx/docutilsextra example tags: “:example:” and for response “:rexample”:ie:@GET("/my/api")
def my_function(a, b=int):
    """
    Describe your function here.

    :param str a: Describe a here.
    :param int b: Describe b here.
    :return: W/E you function returns.

    :example::

        GET /my/api?a=someting&b=42

    :rexample::

        {
            "something": "something"
            ...
        }
    """
    ...“real app” example:Examples:GET Hello world:from wsgiref.simple_server import make_server
from clearest import application, GET


@GET("/")
def hello():
    return "hello world!"

 httpd = make_server("", 8000, application)
 httpd.serve_forever()Output:curl localhost:8000hello world!POST var:from wsgiref.simple_server import make_server
from clearest import application, POST


@POST("/")
def hello(what):
    return "hello {what}!".format(what=what)


httpd = make_server("", 8000, application)
httpd.serve_forever()Output:curl –data “what=world” localhost:8000hello world!
Package: clear-html
Clean and normalize HTML. Preserve embeddings (e.g. Twitter, Instagram, etc)ContentsQuick startInstallationUsageQuick startInstallationInstall the library with pip:pip install clear-htmlUsageExample usage with lxml:fromlxml.htmlimportfromstringfromclear_htmlimportclean_node,cleaned_node_to_htmlhtml="""
        <div style="color:blue" id="main_content">
            Some text to be
            <div>cleaned up!</div>
        </div>
     """node=fromstring(html)cleaned_node=clean_node(node)cleaned_html=cleaned_node_to_html(cleaned_node)print(cleaned_html)Example usage with Parsel:fromparselimportSelectorfromclear_htmlimportclean_node,cleaned_node_to_htmlselector=Selector(text="""<html>
                            <body>
                                <h1>Hello!</h1>
                                <div style="color:blue" id="main_content">
                                    Some text to be
                                    <div>cleaned up!</div>
                                </div>
                            </body>
                            </html>""")selector=selector.css("#main_content")cleaned_node=clean_node(selector[0].root)cleaned_html=cleaned_node_to_html(cleaned_node)print(cleaned_html)Both of the different approaches above would print the following:<article><p>Some text to be</p><p>cleaned up!</p></article>Other interesting functions:cleaned_node_to_text: convert the cleaned node to plain textformatted_text.clean_doc: low level method to control more aspects
of the cleaning up
Package: clear-lambda-storage
MotivationAWS limits the total code storage for Lambda functions to75GB.The main reason of reaching such size is because for every deployment of existing function, AWS stores the previous version (“qualifier”).Usually, when you reach that point, you want to remove old version.
This tool will help you to!Setupgitclonehttps://github.com/epsagon/clear-lambda-storagecdclear-lambda-storage/pipinstall-rrequirements.txtpythonclear_lambda_storage.pyAdvanced usageProvide credentials:pythonclear_lambda_storage.py--token-key-id<access_key_id>--token-secret<secret_access_key>Alternate usage:
.. code-block:: bashpython clear_lambda_storage.py –profile-id <profile_id> –num-to-keep 2⚡️Serverless Frameworkusagenpmi-gserverlessgitclonehttps://github.com/epsagon/clear-lambda-storagecdclear-lambda-storage/serverlessdeployYou can schedule this Lambda code storage clean to run every period you want:functions:clear_lambda_storage:handler:handler.clear_lambda_storagememorySize:128timeout:120events:-schedule:cron(0 12 ? * SUN *)# Run every sunday at 12:00pm UTC
Package: clearList
clearListCustomized function pack for listsDocumentation;-> clearAndCombineList(mainList) --> Concatenates the elements in the list and converts them to string values-> getListType(mainList) --> Shows the type value of the elements in the list-> convertStrLİst(mainList) --> Converts the elements in the list to str-> getOnlyInt(mainList) --> It only returns int values ​​in the list-> getOnlyStr(mainList) --> It only returns str values ​​in the list-> getOnlyFloat(mainList) --> It only returns float values ​​in the listHOW TO USE ?from ClearList import clearListlistOne =[1,2,3,4,5,6,7]
newList = clearList.clearAndCombineList(listOne)print(newList) ----> "1234567"from ClearList import clearListlistOne =[1,2,3,4,5,6,7]
clearList.getListType(listOne)----> int | 0. Element 1
----> int | 1. Element 2
----> int | 2. Element 3
----> int | 3. Element 4
----> int | 4. Element 5from ClearList import clearListlistOne =[1,2,3,4,5,6,7]
newList = clearList.convertStrLİst(lisOne)print(newList) ----> ["1","2","3","4","5","6","7"]from ClearList import clearListlistOne =[1,2,"InterFaze","Turkey",3.14]newList = clearList.getOnlyInt(listOne)print(newList) ----> [1,2]from ClearList import clearListlistOne =[1,2,"InterFaze","Turkey",3.14]newList = clearList.getOnlyStr(listOne)print(newList) ----> ["InterFaze","Turkey",3.14]from ClearList import clearListlistOne =[1,2,"InterFaze","Turkey",3.14]newList = clearList.getOnlyFloat(listOne)print(newList) ----> [3.14]
Package: clearml-darknet-py
The library allows you to train neural networks on theDarknetframework inClearML.FeaturesGraphs in ClearML- Display graphs for any Darknet compatible networks.For classifiers:Accuracy (acc);Average loss (avg_loss);learning rate (lr).For detectors:Mean average precision 50% (mAP@0.50);Precision;Recall;F1-score;Average loss (avg_loss);learning rate (lr).Logs in ClearML- Displays logs from Darknet in ClearML.Saving weights in ClearML- Ability to save weights in ClearML with flexible adjustment of parameters.Available options:Darknet.is_save_weights-Ability to disable saving weights (for experiments).Darknet.save_weights_from_n_iterations-Ability to save weights from the start of N iterations. For example, N=10000.Darknet.save_weights_every_n_iterations-Ability to save weights every N iterations. For example, N=5000.Additional function of data splitting-Allows you to divide the data set into selections.📚 Click to see examplefromclearmlimportDatasetfromclearml_darknet.utilsimportsplit_datasetdataset_path=Dataset.get(dataset_name='dataset-example',dataset_project='Tests/darknet').get_local_copy()train,valid=split_dataset(dataset_path=dataset_path,ratio=0.7,shuffle=True)RequirementsPython (3.6)+ClearML(1.4.1)DarknetInstallationBefore running, be sure to clone the Darknet repository andcompilefor the appropriate operating system.$pipinstallclearml-darknet-pyExamplesAn example of a detector training script -train_detector.pyAn example of a classificator training script -train_classifier.pyDetector optimization script example -optimize_detector.pyFor examples and use cases, check theexamplesfolder.LicenseClearml Darknet is MIT licensed as listed in the LICENSE file.
Package: clearpasspy
Python class for Aruba's Clearpass Policy Managerhttps://www.emerickcc.comAruba NetworksExamplesfromclearpasspyimportClearpass# Client_ID: clearpassapi# Grant Type: client_credentials OR password# client Secret: <CLIENT SECRET FROM UI># Tackle first: client credentialsserver='<SERVER NAME>'grant_type='client_credentials'client_secret='SUPER SECRET'client_id='clearpassapi'data={'server':server,'grant_type':grant_type,'secret':client_secret,'client':client_id}# When you create the object, it automatically authenticates you, and stores the access token for subsequent calls.CPPM=ClearPass(data)print(CPPM.access_token)3ea61fd137df506515ae45f0887df1163c4080f9# Takes MAC address with or without colonsprint(CPPM.online_status('0000af23e980'))True# Takes 1 arg for limiting output. . max is 1000print(CPPM.get_endpoints(10))[{'id':4814,'mac_address':'0000e349473f','status':'Unknown','attributes':{},'_links':{'self':{'href':'https://clearpass.server.com/api/endpoint/4814'}}}# Print Endpoint by IDprint('Endpoint:{}'.format(CPPM.get_endpoint(4814)))Endpoint{'id':4814,'mac_address':'0000e349473f','status':'Unknown','attributes':{},'_links':{'self':{'href':'https://clearpass.server.com/api/endpoint/4814'}}}# Calls API endpoint. Only supports GET methodprint('API Call:{}'.format(CPPM.api('/auth-method')))
Package: clearscreen
ClearScreen (cls)This is a replacement for CLS that is cross platform.Instead of clearing the screen, it shows a blob of random ascii art. Because the blob is always likely to be different, this makes it easy to scroll up and see where you were before your last command.The ascii art comes from me, except for some old stuff used for the OpenStack Trove project.This isn't to be confused with theInspect Classpackage, which uses the package name cls (this uses the package name clearscreen).Install with pipx or pipsi or whatever, then run:?pipxinstallclearscreen?clsChange Log0.2.1Adds more art.0.2.0Makes showing different colors the default, cause hey why not. Also make the color selectable.0.1.1Sorts order of files in the internal list to make it easier to find them with--ls.0.1.0First release.