Saravanan666/pypi-org huggingface dataset:
Package: decomon
Decomon: Automatic Certified Perturbation Analysis of Neural NetworksIntroductionWhat is decomon?decomonis a library that allows the derivation of upper and lower bounds
for the predictions of a Tensorflow/Keras neural network with perturbed inputs.
In the current release, these bounds are represented as affine functions with respect to some variable under perturbation.Previous works that tackled certified robustness with backward propagation relied on forward upper and lower bounds. Indecomon,
we explored various ways to tighten forward upper and lower bounds, while remaining backpropagation-compatible
thanks to symbolic optimization.Our algorithm improves existing forward linear relaxation algorithms for general Keras-based neural networks
without manual derivation. Our implementation is also automaticallydifferentiable.
So far we support interval bound propagation, forward mode perturbation, backward mode perturbation as well as hybrid approaches.decomonis compatible with a wider range of perturbation: boxes, $L_{\inf, 1, 2}$ norms or general
convex sets described by their vertices.We believe that decomon is a complementary tool to existing libraries for the certification of neural networks.Since we rely on Tensorflow and not Pytorch, we are opening up the possibility for a new community
to formally assess the robustness of their networks, without worrying about the technicality of
the implementation. In this way, we hope to promote the formal certification of neural networks
into safety critical systems.InstallationQuick version:pipinstalldecomonFor more details, see theonline documentation.Quick startYou can see how to get certified lower and upper bounds for a basic Keras neural network in theGetting started sectionof the online documentation.DocumentationThe latest documentation is availableonline.ExamplesSome educational notebooks are available intutorials/folder.
Links to launch them online withcolaborbinderare provided in theTutorials sectionof the online documentation.ContributingWe welcome any contribution. See more about how to contribute in theonline documentation.
Package: decompose-mrobison
DecomposeThis module provides a method for decomposing strings containing latin diacretics, ligatures,
and other unusual latin letters into their appropriate ascii counterparts generally for the purpose
of data for submission into systems requiring the usage of the ascii subset.Examplefromdecomposeimportdecomposedecompose('Málaga')# returns 'Malaga'Commentsdecompose.decompose() depends upon unicodedata.normalize() for most of its heavy lifting.
However, it also contains a lookup table (decompose.charmap) for those unicode characters that are
not necessarily handled by normalize(). Any letter not handled by either normalize or charmap will
be silently dropped.
Package: decon2vcf
DeconToVCFIntroductionThis is a tool to convert multiple DeCon .txt [1] file outputs generated in pipelines into a single genomic VCF format file that can then be used for annotation software and further analysis tools.Download the directory:git clone git@github.com:AWGL/DeconToVCF.gitRequirementsThe python script needs to be run with arguments-d = path to decon output directory. The directory should be the folder containing all of the decon outputs "raw_data".-p = path to ped file.-o = path and filename of choice for the output. The programme will not create directories that do not already exist.To run the programmecreate environment from .yaml file and activatepip install decon2vcfrun programme with argumentspython DeconToVCF -d <path-to-decon-output-directory> -p <path-to-ped-file> -o <path/filename-for-output-file>eg:python DeconToVCF -d /data/runid/post-processing/results/cnv_svs/raw_data/ -p post-processing/results/ped/file.ped -o post-processing/results/DeconToVCF_output.vcfReferences[1]https://www.imm.ox.ac.uk/research/research-groups/lunter-group/lunter-group/decon-detection-of-exon-copy-number
Package: deconvoluted
DeconvolutedDeconvoluted makes performing numerical integral transforms simple and pythonic!Free software: MIT licenseDocumentation:https://deconvoluted.readthedocs.io.FeaturesFourier TransformsAs a first example, let’s perform a Fourier transform:t=np.linspace(0,10,201)f=np.sin(3*2*np.pi*t)F,nu=fourier_transform(f,t)By default, Fourier transforms use Fourier coefficientsa=0,b=-2pi. Using another convention is simple:F,omega=fourier_transform(f,t,convention=(-1,1))As a physicist myself, I therefore switch the labelling of the output fromnufor frequency, toomegafor angular frequency.Performing multidimensional transforms is just as easy. For example:F_pq,p,q=fourier_transform(f_xy,x,y)transforms bothxandyat the same time.
Transforming only one of the two variables can be done simply by setting those
that shouldn’t transform toNone:F_py,p=fourier_transform(f_xy,x,None)F_xq,q=fourier_transform(f_xy,None,y)See the documentation for more examples!History0.1.1 (2019-06-05)Implemented support for different FT conventions.0.1.0 (2019-06-03)First release on PyPI.
Package: deconzpy
deconzpyHomeautomation Library for the tech savvy (depending on zigbee/deconz-rest)This should be a library to easily build home automation scripts on top of the deconz-rest apiIt can be used to easily issue comands to devices connected to deconz, subscribe to events and mix the two.
For example: on motion -> switch light onSample CodefromdeconzpyimportRouterrouter=Router()# Router is a singelton, can be called in multiple places and will return the same Router Object### print some objects##sensors=router.getAllSensors()forsinsensors:s.println()print("---")lights=router.getAllLights()forlinlights:l.println()# subscribe to websocket (for updates)router.startAndRunThread()#get motion sensorsbewegungsmelder=router.getSensorsByIcon("🏃‍♂️")defonMotion(sensor,key_that_changed,oldval,newval):print("somebody moved - or stoped moving")bewegungsmelder[0].subscribeToAttribute("state_presence",onMotion)
Package: decopts
Installationpip install decparseUsageBefore with argeparseimportargparseparser=argparse.ArgumentParser(prog='foo',description='Print bar',add_help=True)parser.add_argument('--baz',action='store_true'help='Also print baz')args=parser.parse_arguments()print('bar')ifargs.baz:print('baz')Using decopts insteadfromdecoptsimportentrypoint,option@entrypoint(prog='foo',description='Print bar',add_help=True)@option('--baz',action='store_true'help='Also print baz')defmain():print('bar')ifmain.args.baz:print('baz')main()Adding subcommandsfromdecoptsimportentrypoint,option,action@entrypoint(prog='foo',description='Print something',add_help=True)defmain():return@action(main,'foo',description='Print foo')deffoo():print('foo')@action(main,'baz',description='Print baz')defbaz():print('baz')main()
Package: decora-bleak
decora_bleakPython module for interacting with Leviton bluetooth switches and dimmers via BLE (Bluetooth Low Energy). There is prior art in this space, namelyhttps://github.com/mjg59/python-decoraandhttps://github.com/lucapinello/pydecora_ble, both of which primarily use the bluepy module. This project aims to provide the same support using Bleak which is used for interacting with BLE devices in Home Assistant.UsingOnce the package is installed (and assuming the repo was cloned to make changes) usingpython -m pip install -e .:decora scandecora connect -a "C84441EE-5C57-2681-1BD5-82AF18C58F5D"decora connect -a "C84441EE-5C57-2681-1BD5-82AF18C58F5D" -k "8c4c89fa00"ReleasingOne ofbumpver update --commit --tag-commit --push --major
bumpver update --commit --tag-commit --push --minor
bumpver update --commit --tag-commit --push --patch
Package: decorata
Decorata데코레이타(decorata)는 데이터를 쉽게 전처리 할 수 있는 high-level API library입니다.UsageInstall$pipinstalldecorataBasic UsageBase dataset을 선택합니다. Pytorch 기반 데이터셋을 만들려면TorchBaseDataset을 사용합니다. Tensorflow 기반 데이터셋을 만들려면TFBaseDataset을 사용합니다.importdecorata.dataasDdataset=D.TorchBaseDataset(images,labels,classes)decorata.data안의 모듈을 이용하여 학습 전 데이터를 처리합니다.dataset=D.LoadImages(dataset)dataset=D.ResizeImages(dataset,(256,256))dataset=D.OneHotLabels(dataset)데이터 로더를 생성하여 학습에 사용합니다.fromtorch.utils.dataimportDataLoaderdata_loader=DataLoader(dataset,batch_size=16,shuffle=False,num_workers=4)AugmentationsAugmentation은Albumentations라이브러리를 이용하도록 설계했습니다.decorata.data.Augmentations의 인자로 base dataset에서 파생된 인스턴스와 Albumentations 인스턴스를 받습니다.decorata.augmentations에 Albumentations와 함께 사용할 수 있는 모듈을 추가하고 있습니다.importalbumentationsasAimportdecorata.dataasDimportdecorata.augmentationsasDAaugmentations=A.Compose([A.RandomRotate90(p=1),A.GridDistortion(p=0.8),A.GaussNoise(p=0.75),DA.CutMix(dataset,p=0.8),])dataset=D.Augmentations(dataset,augmentations)Transformsdecorata.data.Transforms를 이용하여 Pytorch의 Transforms를 적용할 수 있습니다.Augmentation과 동일하게 base dataset에서 파생된 인스턴스와 Albumentations 인스턴스를 인자로 받습니다.decorata.transforms에 Transforms와 함께 사용할 수 있는 모듈을 추가하고 있습니다.fromtorchvision.transformsasTimportdecorata.dataasDimportdecorata.transformsasDTtransforms=T.Compose([DT.ToTorchTensor(),DT.TorchNormalize(from_image=True)])dataset=D.Transforms(dataset,transforms)
Package: decorate
TestsDownloadsAboutStatusAbout DecorateDecoratetakes an HTML and decorates it with style.Currently it just supportBootstrap, but it is built in order to allow any other framework.MDL(Material Design Lite) current support is very poor.How does it workIt parses the HTML, uses a set of rules and creates a new HTML with new classes.You can say: “Well… I could have done the same by using JavaScript”, and you’d right. But there are some advantages in using it statically:It is faster. You have just to run it once.It can be used in third parties projects. Forget about the style from now on.Avoids the blink while javascript is being applied.What was it intended for?I was writting a static test runner, and I decided not to tie it to any style. This was a spin off. Indeed, it could be run as command line…UsageCommand linePlease, run the help command with-h.Here you are a basic example:decorate my.html -t bootstrap -o outputLibraryEasy: just import and use it:from decorate import Decorate
decorate = Decorate('bootstrap')
with open('my.html') as fd:
  decorate.apply_to(fd.read(), 'output.html')
Package: decorate-all-methods
decorate-all-methodsDecorator that applies a decorator to all methods of a class.Installingpipinstalldecorate-all-methodsExample Usagefromdecorate_all_methodsimportdecorate_all_methodsfromtenacityimportretry,stop_after_attempt,wait_fixed@decorate_all_methods(retry(stop=stop_after_attempt(3),wait=wait_fixed(1)),exclude=['__init__'])classMyClass(object):def__init__(self,object):"""Will not be retried."""passdefforce_error(self):"""Will be retried 3 times."""assertFalsedefforce_another_error(self):"""Will also be retried 3 times."""assertFalseNote: It is not necessary to exclude any methods.VersioningWe useSemVerfor versioning.LicenseThis project is licensed under the Apache License, Version 2.0.Acknowledgmentshttps://stackoverflow.com/a/6307868/1191286
Package: decorated_options
Function decorator to make argument passing saner.I often have to write a function which runs a simulation/learning task which I
need to run for several different parameters. This initially is manageable, but
then slowly configuration creep starts to happen: I keep adding more and more
parameters to the functions which run the simulations and keep making my old
code more and more fragile.I wrotedecorated_optionsto decouple the arguments for different set of experiments.In brief,decorated_optionsconverts this:def run(max_num_followers, num_segments, is_hawkes):
    # ...
    # ...

# tmp = run_multiple_followers(max_num_followers=10, num_segments=10, is_hawkes=True)
# tmp = run_multiple_followers(max_num_followers=100, num_segments=10, is_hawkes=False)
# tmp = run_multiple_followers(max_num_followers=10, num_segments=50, is_hawkes=True)
tmp = run_multiple_followers(max_num_followers=1000, num_segments=100, is_hawkes=False)to:from decorated_options import Options, optioned

@optioned('opts')
def run(max_num_followers, num_segments, is_hawkes):
    # ...
    # ...


opts = Options(max_num_followers=10, num_segments=10, is_hawkes=True)
# tmp = run_multiple_followers(opts=opts)
# tmp = run_multiple_followers(max_num_followers=100, is_hawkes=False, opts=opts)
# tmp = run_multiple_followers(num_segments=50, is_hawkes=False, opts=opts)
tmp = run_multiple_followers(max_num_followers=1000, num_segments=100, is_hawkes=False)Benefits over**kwargsin receiving function:Early reporting of errors at call-time.No need to unpack the values.Default values do not have to be hard-coded.Allows progressive improvement, no need to change old code which uses positional arguments.Benefits over**dictwhile calling:Easier updating/overriding of valuesPositional arguments also workGuaranteed immutability (throws Exceptions on attempted violations.)Benefits over default values in receiving function:Optionsobjects can save defaults for multiple settings.De-couples default values from the functions themselves.Installationpip install git+https://github.com/musically-ut/decorated_options.git@master#egg=decorated_optionsDevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.1.0 (2016-07-24)First release on PyPI.
Package: decorated-paho-mqtt
decorated_paho_mqttdecorated_paho_mqtt is a wrapper to the Eclipse paho mqtt library (https://pypi.org/project/paho-mqtt/)It is intended to be used with MQTTv5pack_topicpack_topictakes an mqtt topic pattern, such asa/+/c/#, and additional parameters to fill in for the placeholders.For each+placeholder, a string has to be passed; for a trailing#, a list/tuple has to be passed.pack_topic('a/+/c/#', "b", ("d","e"))will return the topica/b/c/d/ePacking a topic with obviously invalid characters as parameters will raise an exception.Known Bug: Packing a topic with an empty tuple as parameter for a#placeholder will not remove the trailing slash.
pack_topic and unpack_topic are not yet completely symmetrical.unpack_topicunpack_topictakes an mqtt topic pattern, such asa/+/c/#, and an actual topic, such asa/b/c/d/e.It will match the topic against the pattern, and for each placeholder in the pattern, yield the actual values.list(unpack_topic('a/+/c/#','a/b/c/d/e'))will return["b", ["d","e"]]GenericMqttEndpointGenericMqttEndpointallows to specify topic subscriptions in a declarative way using decorators.
It wraps an paho mqtt client.You can use the subscribe_decorator on methods of derived classes to receive messages.You can use the publish method to publish messages.Example:importjsonfromsignalimportpausefromicecreamimporticfromdecorated_paho_mqttimportGenericMqttEndpointclassMyMqtt(GenericMqttEndpoint):# Using this decorator will automatically subscribe to the topic and provide the values as positional parameters# The paho parameters will be passed as named parameters.@GenericMqttEndpoint.subscribe_decorator("a/+/c/#",qos=2)defreceive_something(self,b,d_e,*,client,userdata,message):assertb=="b"assertlen(d_e)==2assertd_e[0]=="d"assertd_e[1]=="e"defsend_something(self,b,d,e):self.publish("a/+/c/#",(b,(d,e)),qos=2,retain=False,payload=json.dumps(None))def_on_log(self,client,userdata,level,buf):super(MyMqtt,self)._on_log(client,userdata,level,buf)ic(client,userdata,level,buf)mqtt=MyMqtt(# Same parameters as paho's MqttClient()dict(transport="tcp"),# None or same parameters as paho's MqttClient.username_pw_set()dict(username="username",password="password"),# Same parameters as paho's MqttClient.connect_async()dict(host="127.0.0.1",port=1883,keepalive=10),# Whether to activate TLSFalse)# Non-Blocking, callbacks will return in another thread:mqtt.connect()pause()
Package: decorated-registry
decorated_registryImplementation of generalised registries for Python.Allows you to seamlessly create registries of tests, modules, DSLs and RPCs.Supports arguments and fully typed.ExamplefromtypingimportList,Typefromdataclassesimportdataclassfromdecorated_registryimportRegistry,ConstructorPayloadFactory# framework/abstract.py@dataclassclassModuleConfig:init_priority:int=-1classModule:pass# framework/registry.pyapplication_module:Registry[ModuleConfig,Type[Module]]=Registry(payload_factory=ConstructorPayloadFactory(dict))# authentication_mod/impl.py@application_moduleclassAuthenticationModule(Module):pass# database_mod/impl.pu@application_module(init_priority=2)classDatabaseSessionModule(Module):pass# framework/app.pydefload_modules()->List[Module]:rtn=[]# ensure modules are loaded in the order given by `ModuleConfig.priority`modules_priority=sorted(application_module.items,key=lambdax:x.payload.init_priority)forxinmodules_priority:module_cls:Type[Module]=x.valuemodule=module_cls()rtn.append(module)returnrtn# framework/main.pydefmain():modules=load_modules()if__name__=='__main__':main()
Package: decorateme
Decorate-mePython decorators to trim boilerplate.Example 1: auto-addrepr,str,hash, andeqimportdecoratemeasabcd@abcd.auto_obj()classAnimal:def__init__(self,species:str,age:int):self.species=speciesself.age=ageluna1=Animal("dog",12)luna2=Animal("dog",12)str(luna)# "Animal(species="dog", age=12)"assertluna1==luna2asserthash(luna1)==hash(luna2)Example 2: Customizeimportdecoratemeasabcd@abcd.auto_str(only=["species"])classAnimal:...Example 3: Add warnings about code qualityimportdecoratemeasabcd@abcd._status("immature")defmy_function():...my_function()# warns with an ImmatureWarningExample 4: Iterate, etc.importdecoratemeasabcd@abcd.sequence_over("members")classTeam:def__init__(self,members:list):self.members=membersteam=Team(["john","kerri"])list(team)# ["john", "kerri"]@abcd.float_type("v")classSize:def__init__(self,v:float):self.v=vfloat(Size(6.2))# 6.2Example 5: clearly document behaviorimportdecoratemeasabcd@abcd.not_thread_safedefrun_command():...Example 6: combine thingsimportdecoratemeasabcd@abcd.auto_obj()@abcd.float_type("weight")classUno:def__init__(self,weight):self.weight=weightlight1,light2,heavy=Uno(3.1),Uno(3.1),Uno(12.8)assertlight1==light2!=heavyprint(light1)# 'Duo(weight=22.3)'assertlight1*heavy==39.68Licensed under theApache License, version 2.0.New issuesand pull requests are welcome.
Please refer to thecontributing guide.
Generated withTyrannosaurus.List of decoratorsString-like methodsauto_repr_strauto_strauto_reprauto_html (for display in Jupyter)auto_info (add a .info method)Equalityauto_eqauto_hashtotal_ordering  (from functools)Make your class smartauto_obj (auto- for eq, str, and repr)dataclass (from dataclasses)Docstring-relatedcopy_docstringappend_docstringTimingtakes_secondstakes_seconds_namedauto_timeoutAllow a class to be used as a typeiterable_overcollection_oversequence_overfloat_typeint_typeOverriding / inheritancefinaloverridesoverride_recommendedABC (from abc)ABCMeta  (from abc)abstractmethod  (from abc)Mark purpose / useinternalexternalreservedMultithreadingthread_safenot_thread_safeMutabilitymutableimmutableCode maturitystatus (code deprecation & immaturity warnings)Singletonsauto_singleton
Package: decorating
Decorating: A Meta Repo To DecoratorsAbstractThis project encourages an exploration into the limits of decorators inPython. While decorators might by new to beginners, they are an
extremely useful feature of the language. They can be similar to Lisp
Macros, but without changes to the AST. Great decorators from this
packages are@animatedand@writing. This repository is made
from scratch, just using Python’s Standard Library, no dependency!ExamplesAnimatedUsing as decorator and mixed with context-managersUsing with nested context-managersWritingAnother project mine calledMALuses the decorating
package —- basically a command line interface forMyAnimeList. The decorator @writing can
be used by just adding 3 lines of code! The behavior is a retro
typing-like computer. Check out the awesome effect:More examples are covered on my personal blog post aboutdecorating.Decorators & UsageCurrently public decorators on the API of decoratorsdecorating:decorating.debugdecorating.cachedecorating.counterdecorating.count_timedecorating.animateddecorating.writingMostly decorators has a pretty consistent usage, but for now onlyanimatedandwritinghas support to use ascontextmanagersusing thewithsyntax.InstallationSupported Python versions:Python3.4+Python2.7You can install the last release onPyPIby calling:pipinstall--userdecoratingIf you want get the last development version install directly by the git
repository:pipinstall--usergit+https://www.github.com/ryukinix/decoratingWe have a published package onArch
Linux,which
you can install using your favorite AUR Helper, likepacauroryaourt:yaourt-Spython-decoratingThough since the version0.6we have support for Python2.7, an AUR
package for Python2 was not made yet. Fill a issue if you have interest
on that :). Thanks toMaxim Kuznetsovwhich implemented the necessary changes to make compatible with Python2!LicenseMITBecause good things need to be free.
Package: decoratools
Collection of useful decoratorsInstallationpipinstalldecoratoolsUsagecapiInterface withstatx(2):importctypesfromargparseimportArgumentParserfromdecoratools.capiimportARRAY,POINTER,structure,unwrapsLIBC=ctypes.CDLL("libc.so.6")AT_FDCDW=-100STATX_BASIC_STATS=0x000007FF@structureclassStatxTimestamp:tv_sec:ctypes.c_int64tv_nsec:ctypes.c_uint32__statx_timestamp_pad1:ctypes.c_int32@structureclassStatx:stx_mask:ctypes.c_uint32stx_blksize:ctypes.c_uint32stx_attributes:ctypes.c_uint64stx_nlink:ctypes.c_uint32stx_uid:ctypes.c_uint32stx_gid:ctypes.c_uint32stx_mode:ctypes.c_uint16__statx_pad1:ctypes.c_uint16stx_ino:ctypes.c_uint64stx_size:ctypes.c_uint64stx_blocks:ctypes.c_uint64stx_attributes_mask:ctypes.c_uint64stx_atime:StatxTimestampstx_btime:StatxTimestampstx_ctime:StatxTimestampstx_mtime:StatxTimestampstx_rdev_major:ctypes.c_uint32stx_rdev_minor:ctypes.c_uint32stx_dev_major:ctypes.c_uint32stx_dev_minor:ctypes.c_uint32stx_mnt_id:ctypes.c_uint64stx_dio_mem_align:ctypes.c_uint32stx_dio_offset_align:ctypes.c_uint32__statx_pad2:ARRAY[ctypes.c_uint64,12]@unwraps(LIBC.statx)defstatx(dirfd:ctypes.c_int,pathname:ctypes.c_char_p,flags:ctypes.c_int,mask:ctypes.c_int,statxbuf:POINTER[Statx])->int:...if__name__=="__main__":parser=ArgumentParser()parser.add_argument("path",help="path to statx")args=parser.parse_args()statxbuf=Statx()rc=statx(AT_FDCDW,args.path.encode(),0,STATX_BASIC_STATS,ctypes.byref(statxbuf))ifrc!=0:raiseRuntimeError("statx: failed")print(statxbuf)$pythonstatx.py/dev/nullStatx(stx_mask=6143, stx_blksize=4096, stx_attributes=0, stx_nlink=1, stx_uid=0, stx_gid=0, stx_mode=8630, _Statx__statx_pad1=0, stx_ino=4, stx_size=0, stx_blocks=0, stx_attributes_mask=2109552, stx_atime=StatxTimestamp(tv_sec=1672527600, tv_nsec=0, _StatxTimestamp__statx_timestamp_pad1=0), stx_btime=StatxTimestamp(tv_sec=0, tv_nsec=0, _StatxTimestamp__statx_timestamp_pad1=0), stx_ctime=StatxTimestamp(tv_sec=1672527600, tv_nsec=0, _StatxTimestamp__statx_timestamp_pad1=0), stx_mtime=StatxTimestamp(tv_sec=1672527600, tv_nsec=0, _StatxTimestamp__statx_timestamp_pad1=0), stx_rdev_major=1, stx_rdev_minor=3, stx_dev_major=0, stx_dev_minor=5, stx_mnt_id=22, stx_dio_mem_align=0, stx_dio_offset_align=0, _Statx__statx_pad2=<decoratools.capi.c_ulong_Array_12 object at 0x7efe94be0a70>)