Saravanan666/pypi-org huggingface dataset:
Package: cf-LRU-cache
Ormuco Code ChallengeThis project has been created only for demonstration purpose.The challengeAt Ormuco, we want to optimize every bits of software we write. Your goal is to write a new library that can be integrated to the Ormuco stack. Dealing with network issues everyday, latency is our biggest problem. Thus, your challenge is to write a new Geo Distributed LRU (Least Recently Used) cache with time expiration. This library will be used extensively by many of our services so it needs to meet the following criteria:Simplicity. Integration needs to be dead simple.Resilient to network failures or crashes.Near real time replication of data across Geolocation. Writes need to be in real time.Data consistency across regionsLocality of reference, data should almost always be available from the closest regionFlexible SchemaCache can expireThe Answersource directory:./cacheThis feature is not finished yet, but the idea to implement is:In each remote server create a local cacheEach independent cache will have other 2 optional roles at the same time; as server cache and as client cacheAs server cache it will have the responsibility to synchronize all its client cachesAs client cache it will have the responsibility to notify its server cache each time a change occursAll this communication will be through sockets in independent threads each oneIf the connection gets broken in any point the caches networks remaining will continue working as independent networksIf a server gets disconnected from the caches network, its cache will work locally without any problemThe developer in charge to deploy the system will have the responsibility to decide which server is a cache server or client or bothusage:Runpip3 install cf_LRU_cacheusage for a local cache only:from lru_cache.lru_cache import LRUCache

def load_callback(key):
    """This function has the responsibility to load the content 
       to store into the cache
    """
    return key

local_cache = LRUCache(
    load_callback=load_callback,
    maximum_capacity=5555,
    expiration_time=5555
)

# get data from the cache; it will call `load_callback` if the 
# value is not available
data_from_cache = local_cache.get('test_key')

# set data manually into the cache
data_from_cache = local_cache.set('test_key', 'test_value')

# More options are only documented into the source codeusage for a distributed cache:from lru_cache.lru_cache_distributed import LRUCacheDistributed

def load_callback(key):
    """This function has the responsibility to load the content 
       to store into the cache
    """
    return key

local_cache = LRUCacheDistributed(
    load_callback=load_callback,
    maximum_capacity=5555,
    expiration_time=5555,
    connection_timeout=5555,
    remote_address=('192.168.1.1', '5555'),  # to be a client
    local_address=('', '5555')  # to be a server
)

# get data from the cache; it will call `load_callback` if the 
# value is not available
data_from_cache = local_cache.get('test_key')

# set data manually into the cache
data_from_cache = local_cache.set('test_key', 'test_value')

# More options are only documented into the source code
Package: cfly
Build python extensions on-the-fly.Run C++ code directly from Python.LinksDocumentationcfly on Githubcfly on PyPIExamplefromcflyimportbuild_modulemymodule=build_module('mymodule','''
#define PY_SSIZE_T_CLEAN
#include <Python.h>

struct Foobar {
    PyObject_HEAD
};

PyObject * meth_hello_world(PyObject * self) {
    return PyLong_FromLong(1234);
}
''')print(mymodule.Foobar)print(mymodule.hello_world())output<class'mymodule.Foobar'>1234
Package: cfmacro
Cloud Formation Macro ToolkitA CloudFormation Toolkit to easily implement processors for Cloudformation MacroFree software: MIT licenseDocumentation:https://cfmacro.readthedocs.io.Why CFMacroWhen you do Infrastructure as Code the main goal it’s always to create modularity in your code
and be able to reuse the patterns and template as much as possible.Some template though requires additional implementations for a specific use and with the current AWS Cloudformation
capabilities, you cannot make such generic templates to be real blueprints.With CFMacro you can incorporate a macro transform to the template in order to pre-process the template
while creating the change set with all the customisation you need.FeaturesImplements a processor engine that enables you to plug multiple processor at time and render the
result template by using only one lambda function.Processors are easy to implement and associate to specific Custom Resource type so you can extend
this framework with your own additional processors.IncludesSgProcessor, a powerful and very flexible Security Group rules generator.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2019-02-23)First release on PyPI.
Package: cfme-testcases
import requirements missing in Polarionimport test cases missing in Polarionupdate existing test cases, link missing requirementscreate new test run in Polarion or update an existing test run with newly imported test casesAll this with single command, using just the Polarion Importers. The legacy webservices API is not used at all.UsageRun in the integration tests repository in your usual virtual environment.cfme_testcases_upload.py -t {testrun id} -c {polarion_tools.yaml}InstallTo install the package to your virtualenv, runpip install cfme-testcases
# or
pip install -e .Requirementspip install -r requirements.txt
Package: cfm-id
CFM-ID Python PackageThis package is a Python wrapper to use CFM-ID :https://cfmid.wishartlab.comCFM-ID provides a method for accurately and efficiently identifying metabolites
in spectra generated by electrospray tandem mass spectrometry (ESI-MS/MS).
The program uses Competitive Fragmentation Modeling to produce a probabilistic generative model
for the MS/MS fragmentation process and machine learning techniques to adapt the model parameters from data.This package is under devopment and work only forcfm-predictof the CFM-ID version 2.0.Installpipinstallcfm-idUsagefromcfm_idimportCfmIdcfm_id=CfmId("/path/to/cfm_id/folder")cfm_id.predict("O=C1OC(CO)C(O)=C1O")The default output format is a list of MatchMSSpectrum,
including a "merged" spectrum of the 3 energies.You can specify the CFM-ID raw text format export with theraw_formatparam :cfm_id.predict("O=C1OC(CO)C(O)=C1O",raw_format=True)Environment variableYou can also use environment variableCFMID_PATHrather than path argument.exportCFMID_PATH=path/to/cfm_id/folderfromcfm_idimportCfmIdcfm_id=CfmId()Param and config filesBy defaultCfmIdwill useparam_output.logandparam_config.txtfiles
located at the root of the cfm_id folder as respectively param and config files.You can specify anoter files location at instantiation with local path as ist of string :fromcfm_idimportCfmIdcfm_id=CfmId("/path/to/cfm_id/folder",param=["param","param_output0_neg.log"],conf=["conf","param_config_neg.txt"])In this example, thecfm_idinstance will use/path/to/cfm_id/folder/param/param_output0_neg.logas param file.Use Docker imageYou can use a Docker image for CFM-ID rather than local files by usingCfmIdDockerclass.fromcfm_idimportCfmIdDockercfm_id=CfmIdDocker("myrepo/image_name:tag")In the Docker image,cfm-predicthas to be in the PATH environment variable
andparam_output.logandparam_config.txtfiles must be located at the working directory.You can also use environment variableCFMID_IMAGErather than path argument.exportCFMID_IMAGE=myrepo/image_name:tagfromcfm_idimportCfmIdDockercfm_id=CfmIdDocker()
Package: cfml-kernel
Jupyter Kernel for CFMLThis a Jupyter Kernel for CFML powered by theCommandBox REPL. It should work on Window, Linux, and MacOS but I have not done extensive testing on them. You can also try it out onmybinder.org.It is based on the concept of aPython wrapper kernel. It is a work it progress so likley has some functionality missing that other Kernels may provide. I am new to Python so there are probably a lot of things that can be improved here.RequirementsPythonIf you want to run it locally you will need to havePythoninstalled. I installed it on Windows using theChocolatey package manager.chocoinstallpythonCommandBoxYou will also need to make sureCommandBoxis installed and in the systempath.JupyterYou will need to haveJupyterinstalled or you can also use theVS Code Jupyter notebook extension.DockerYou can also run it with Docker if you do not want to mess around with installing dependencies. There is a docker image associated with the repository that can be utilized for running it was well. See the other options below.Clone the repogitclonehttps://github.com/jsteinshouer/cfml-jupyter-kernel.gitInstall Kernelpipinstall./cfml-jupyter-kernel
python-mcfml_kernel.cfscript.install
python-mcfml_kernel.cfml.installIf you want to develop on the Kernel you can add the-eflag to make it editable.pipinstall-e./cfml-jupyter-kernel
python-mcfml_kernel.cfscript.install
python-mcfml_kernel.cfml.installRun itI prefer to use theVS Code Jupyter notebook extensionto run my notebooks but if you installedJupyterto can run it using this command:jupyter notebookRun on mybinder.orgYou can try it out and create CFML notebooks using this link:Github Codespaces / Dev ContainerYou can fork this repo and run it with Github Codespaces or clone the repo and run it locally with the VS Code Dev Containers extension.Running locally with DockerIf you have cloned the repo you can just usedocker composeto run it.dockercomposeupGo tohttp://127.0.0.1:8888/lab?token=123to access the Jupyter Lab application.However there is a pre-built image you can use instead. This will run the Jupyter lab application using the pre-built image.docker run -v ${PWD}:/home/jovyan/work -p 8888:8888 -e JUPYTER_TOKEN=123 ghcr.io/jsteinshouer/cfml-jupyter:latest
Package: cfmmc
# cfmmc1. 中国期货市场监控中心的浏览器模拟操作。2. 使用了`selenium`和`Chromedrive`来实现。3. 已经实现的功能：1. 下载每日结算单，默认保存为`csv`文件。根据已有的数据，可以接着下载。## 准备- 安装`selenium-python`- 安装`chromedirve`- 安装`cfmmc````pip install cfmmc # 从 pypi 安装# ORpip install -e . # 从本地项目目录安装```## 使用期货结算中心的登录参见[这里](https://investorservice.cfmmc.com)。账号密码详询自己的客户经理。账号密码不同于期货交易账户。### 下载每日结算数据```import cfmmc# 设置账号密码dic = {'userID':'查询账号','password': '查询密码','saveto': '保存下载数据的文件夹'}# 下载数据cfmmc.downloadDailySettlement(**dic)> 请手动输入验证码:```弹出来的`chrome`浏览器，就是正在被代码操纵的浏览器。输入浏览器中的验证码，即可登录。
Package: cfm-tiptapy
TiptapyLibrary that generates HTML output from JSON export of tiptap editorThis is a forked version ofstckme/tiptapyby Shekhar Tiwatne. This version includes camel case support for newer tiptap versions. Please consider using the original project in your projects.Installpipinstallcfm-tiptapyTestpython-mpytestUsageimport tiptapy

s = """

{
  "type": "doc",
  "content": [
    {
      "type": "blockquote",
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "Readability counts."
            }
          ]
        },
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "marks": [
                {
                  "type": "link",
                  "attrs": { "href": "https://en.wikipedia.org/wiki/Zen_of_Python" }
                }
              ],
              "text": "Zen of Python"
            },
            {
              "type": "text", "text": " By "
            },
            {
              "type": "text",
              "marks": [
                {
                  "type": "bold"
                }
              ],
              "text": "Tom Peters"
            }
          ]
        }
      ]
    }
  ]
}
"""

class config:
    """
    Config class to store constants used by the other nodes.
    """
    DOMAIN = "python.org"


renderer = tiptapy.BaseDoc(config)
out = renderer.render(s)
print(out)Output<blockquote>
  <p>Readability counts.</p>
  <p>
      <a href="https://en.wikipedia.org/wiki/Zen_of_Python">Zen of Python</a> By
      <strong>Tom Peters</strong>
  </p>
</blockquote>
Package: cfn-cli-typescriptv2-plugin
CloudFormation Typescript (v2) PluginThis is a plugin for theCloudFormation CLIthat enables the use of Typescript for resource providers, as well providing a number of other QoL improvments over the default TypeScript plugin. It can also be used for the development of JavaScript providers, though that has not be as tested.WarningThis plugin is still in beta, and is not yet ready for production use. It is not recommended to use this plugin for any production workloads.InstallationTo install the plugin, run the following command:pipinstallcfn-cli-typescriptv2-pluginThecfncli will automatically detect the plugin and make it available as a language provider option.UsageCreate and navigate to a new directory for your resource provider, and run the following command:cfninitThis will walk you through the process of creating a new resource provider. When asked for the language, selectTypescript (v2).This plugin automatically generates bindings from your schema file via thenpm run generatecommand, and makes then available via the.cfnfolder as$cfn. You should not need to interact with this folder directly, and should only update the schema file.See the generatedREADME.mdfile for more information on how to use the generated bindings, and the generalCloudFormation CLI Documentationfor more information on how to use the CloudFormation CLI, test your resource provider, and publish it.
Package: cfncluster
cfncluster is an example framework for launching clusters.usage: cfncluster [-h]{create,update,delete,start,stop,status,list,instances,ssh,configure,version}...cfncluster is a tool to launch and manage a cluster.positional arguments:{create,update,delete,start,stop,status,list,instances,ssh,configure,version}create              creates a clusterupdate              update a running clusterdelete              delete a clusterstart               start the compute fleet that has been stoppedstop                stop the compute fleet, but leave the master serverrunning for debugging/developmentstatus              pull the current status of the clusterlist                display a list of stacks associated with cfnclusterinstances           display a list of all instances in a clusterssh                 connect to the master server using SSHconfigure           creating initial cfncluster configurationversion             display version of cfnclusteroptional arguments:-h, --help            show this help message and exitFor command specific flags run cfncluster [command] --help
Package: cfnctl
CFNCTLControl Cloudformation stack lifecycle.FeaturesSeemlessly supports templates files over 51,000 bytesCreate/Update with single command(optional) Processes your template with jinja2 for advanced templatingAlways creates a changesetInstallrequires boto3Pippip install cfnctlUsageusage: cfnctl [-h] [-p AWS_PROFILE] [-r REGION] {deploy,lambda} ...

Launch and manage CloudFormation stacks

positional arguments:
  {deploy,lambda}
    deploy         creates a changeset and executes to create or update stack
    lambda         creates an archive and loads it to S3 to create a lambda
                   from

optional arguments:
  -h, --help       show this help message and exit
  -p AWS_PROFILE   AWS Profile
  -r REGION        Region nameDeployusage: cfnctl deploy [-h] -s STACK_NAME -t TEMPLATE [-b BUCKET] [-nr]
                     [-p PARAMETERS]

optional arguments:
  -h, --help     show this help message and exit

required arguments:
  -s STACK_NAME  Stack name
  -t TEMPLATE    CFN Template from local file or URL

optional arguments:
  -b BUCKET      Bucket to upload template to
  -nr            Do not rollback
  -p PARAMETERS  Local parameters JSON fileLambdaPackage a folder into a zip archive and upload to S3. Creates the bucket
if it does not exist. Outputs the S3 url for use in a stack.usage: cfnctl lambda [-h] -s SOURCE [-o OUTPUT] [-b BUCKET]

optional arguments:
  -h, --help  show this help message and exit

required arguments:
  -s SOURCE   Source folder to zip and upload

optional arguments:
  -o OUTPUT   Destination of the archive file
  -b BUCKET   Bucket to upload archive to
Package: cfn-custom-resource
cfn-custom-resourcePython helper library for creation of Lambda basedCustom Resourcefor AWS CloudFormation. The library allows the author to focus on the logic of creation/update/removal of the Custom
Resource instead of the details of the request/response format that CloudFormation expects.InstallationTo install simply use pip:pip install cfn-custom-resourceBasic usageHere's how a basic Custom Resource can be created:from cfn_custom_resource import lambda_handler, create, update, delete

@create()
def create(event, context):
  # .. provision resource ..

  # resource_id = ...
  # output_attribures = {} 

  return resource_id, output_attributes

@update()
def update(event, context):
  # .. update resource ..
  # if resource_id changed cloudformation would trigger delete 

  return resource_id, output_attributes

@delete()
def delete(event, context):
  # .. cleanup ..

  returnCheckthe wikifor more details.ContributingSeeCONTRIBUTING.mdLicenseCopyright (c) 2018 Atlassian and others.
Apache 2.0 licensed, seeLICENSEfile.
Package: cfn-datadog
# README #### What is this repository for? ###* To setup datadog monitoring via cloudformation### What does it do? ###It setups a lambda function that communicate with the monitors resourceon the datadog apihttps://docs.datadoghq.com/api/#monitorsThe lambda is invoked via cloudformation custom resource. This reposupplies custom resource classes for all the 4 Monitor types.Custom resources have the same exact data structure as the DD apiIt uses https://bitbucket.org/nordcloud/cfn_encrypt to securely storedatadog api credentials### How do I get set up? ###* clone this repo~~~~git clone git@github.com.org:nordcloud/cfn-datadog.git~~~~* Build the lambda package~~~~chmod +x create_zip.sh && ./create_zip.sh~~~~* upload `datadog_lambda.zip` to an s3 bucket* get your api and application keys from Datadog* generate the lambda template~~~~python lambda-template.py > /tmp/lambda.template~~~~* If you have not already set up your encrypt stack do that now ( https://bitbucket.org/nordcloud/cfn_encrypt )* create a stack from your `lambda.template` file* The lambda is now set up and ready to use.### How do i use it to monitor resources created in other stacks? ###Install the cfn_datadog library~~~~pip install cfn-encrypt~~~~Import the custom resource classes you want to use~~~~from cfn_datadog import (MetricAlert, MetricAlertOptions, Composite, CompositeOptions,EventAlert, EvenAlertOptions, ServiceCheck, ServiceCheckOptions)~~~~Add a parameter so that you can reference your lambda stack~~~~datadog_lambda_stackname = t.add_parameter(Parameter("DatadogLambdaStackname",Type="String",Description="Datadog lambda stackname",))~~~~Add the custom resource to the template: For documentation see datadog api~~~~t.add_resource(MetricAlert('Alert2',query=Join("",["avg(last_1h):avg:system.net.bytes_rcvd{host:",Ref(my_instance),"} < 40"]),ServiceToken=ImportValue(Sub("${DatadogLambdaStackname}-LambdaArn")),name="Bytes received on mytesthost",message="Some Message @MyDDHandle",tags=["tag1", "tag2"],options=MetricAlertOptions(notify_no_data= True,no_data_timeframe=50)))~~~~
Package: cfnet
Welcome to cfnetKey Featuresfast: code runs significantly faster than existing CF explanation
libraries.scalable: code can be accelerated overCPU,GPU, andTPUflexible: we provide flexible API for researchers to allow full
customization.TODO: - implement various methods of CF explanationsInstallcfnetis built on top ofJax. It also usesPytorchto load data.Running on CPUIf you only need to runcfneton CPU, you can simply install viapipor clone theGitHubproject.Installation via PyPI:pipinstallcfnetEditable Install:gitclonehttps://github.com/BirkhoffG/cfnet.git
pipinstall-ecfnetRunning on GPU or TPUIf you wish to runcfneton GPU or TPU, please first install this
library viapip install cfnet.Then, you should install the right GPU or TPU version of Jax by
following steps in theinstall
guidelines.An Example of usingcfnetSeeHow to use cfnet.
Package: cfn-inspect
![https://badge.fury.io/py/cfn-inspect](https://badge.fury.io/py/cfn-inspect.svg)![https://pypi.python.org/pypi/cfn-inspect](https://img.shields.io/pypi/pyversions/cfn-inspect.svg)# cfn-inspect: pretty print and inspect CloudFormation templatesSimple pretty printer for CloudFormation templates, in future it will also provide some validation and deep inspection in the future.Supports both json and yaml templates. You can validate templates with `--validate` switch.[![asciicast](https://asciinema.org/a/142549.png)](https://asciinema.org/a/142549)# Installation```$ pip install cfn-inspect```# Usage```$ Usage: cfn-inspect [OPTIONS] TEMPLATEOptions:--verbose / -v  Be more verbose about the output--validate      Validate template with AWS--help          Show this message and exit.```# AuthorDariusz Dwornikowski, Nordcloud
Package: cfnlint
Thecfnlintpackage is an AWS CloudFormation linter that uses the [AWS CloudFormation Resource Specification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) and is customizable and extendible with a custom ruleset.A custom ruleset is optional and adds the following features:Specify supported Resources: Block the specification of specific ResourcesOverride required Properties: Make non-required properties required to enforce the specification of PropertiesEnumerators: Specify a list of allowed values to enforce Property values to a set of 1 or more values.Pre-AlphaCurrent version is work in progress and only supported a minimal set of features:Current version only supportyamlCloudFormation filesCommandline support available (cfn-lint –help)
Package: cfn-lint-ax
cfn-lint-axAdditional rules forcfn-lint.Installationpython-mpipinstallcfn-lintcfn-lint-axUsagepython-mcfnlinttemplate.yaml-acfn_lint_ax.rulesRun Testsdockercomposebuild--pull
dockercomposerun--rmrulesUser Rules (E9XXX)Basic Template Errors (E90XX)Functions (E91XX)E9101 UnresolvedObjectParameters (E92XX)Resources (E93XX)I9301 EcsServiceFargatePlatformVersionNotOutdatedI9302 EcrRepositoryAutocleanupTagW9301 S3BucketPublicAccessW9302 S3BucketEncryptionW9303 CloudfrontDistributionLoggingW9304 CloudfrontDistributionCommentW9305 CertificateManagerCertificateNameTagW9306 CodeBuildProjectCloudWatchLogsW9307 CloudfrontDistributionResponseHeadersPolicyW9308 CloudfrontResponseHeaderConfigLongHstsMaxAgeW9309 EcsServiceDeploymentConfigurationW9310 CodeBuildProjectImageW9311 SqsQueueEncryptionMetadata (E94XX)E9401 MetadataAxChangesetAutoApproveOutputs (E96XX)Mappings (E97XX)Conditions (E98XX)