Saravanan666/pypi-org huggingface dataset:
Package: permabots
CI:PyPI:Docs:Build chat bots and connect then to your app APIs.With Permabots you can build chat bots and with the same configuration use it for several instant messaging providers. Permabots
was born to be a microservice to connect messaging providers to your apps using REST APIs.DocumentationThe full documentation is athttps://permabots.readthedocs.org.FeaturesTelegram, Kik and Facebook Messenger botsMessage handling definition with regex, as django urls.HTTP methods: GET/POST/PUT/DELETE/PATCHText responses and keyboards with Jinja2 templatesChat State handlingAsynchronous processing of messagesMedia messages not supportedQuickstartInstall permabots:pip install permabotsAddpermabotsto yourINSTALLED_APPS, and run:$ python manage.py migrate permabotsInstant messaging providers uses webhooks to send messages to your bots. Add permabots processing urls to your urlpatterns:url(r'^processing/', include('permabots.urls_processing', namespace="permabots"))Webhooks are generated withdjango.contrib.sites. You need it installed andSITE_IDconfigured. If you want to generate webhook manually you can do it:MICROBOT_WEBHOOK_DOMAIN = 'https://yourdomain.herokuapp.com'It is usefull when you don’t havehttpsin your public domain but you have it in your autogenerated domain. i.e. heroku.Bots are associated to Django Users. You need at least one user, for example admin user.Then you can create all permabots data, Bots, Conversation Handlers, Notitication Hooks,… via Django admin or with REST API (recommended).Remember there is an online implementation in www.permabots.com to use it for free.DemoYou can check and deploy a Permabots demohttps://github.com/jlmadurga/permabots-demoRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements/test.txt
(myenv) $ make test
(myenv) $ make test-allHistory0.1.0 (2016-05-16)First release on PyPI.
Package: permacache
PermacacheAdd a permanant disk-backed cache for a given function.Simple usagefrom permacache import permacache

@permacache("unique/path/for/this/function")
def f(x):
    out = x ** 2 # do some fancy compute here
    return outYou can simply annotate your function with the permacache annotation as shown aboveCompressing argumentsBy default, permacache uses a full json stringification of the arguments of your function, with a few special cases given to numpy, torch, and attr classes. If you want to use other classes or only use part of an argument as a key, you can pass in a key_function as suchfrom permacache import permacache, stable_hash
@permacache(
    "path",
    key_function=dict(large_argument=stable_hash, not_json_argument=lambda x: str(x), transient_flag=None)
)
def f(large_argument, not_json_argument, transient_flag):
    ...The dictionary has keys that correspond to each of the arguments, and the values are applied to them before placing them in the key. Here,stable_hashcan be used to hash the json stringification of the value, saving disk space but making recovering the value impossible if you want to do that later. Additionally,strcan be used to stringify objects that you are convinced have stablestrrepresentations but cannot be represented in json. Finally, the flag argument is ignored in the JSON representation, this is useful for verbosity flags, etc., that don't affect the output.AliasingPermacache uses the underlying function signature to construct the key. For example, for the function@permacache("path/f")
def f(x, y=2, z=3):
    passThe callsf(2),f(2, 2, 3),f(2, z=3, y=2), andf(x=2, y=2, z=3)are all cached using the same key.If you want to add an extra argument, you can keep backwards compatibility using the following code.from permacache import drop_if_equal

@permacache("path/f", key_function=dict(t=drop_if_equal(0)))
def f(x, y=2, z=3, t=0):
    passIn the above code,tis dropped from consideration ift == 0, allowing us to reuse our old calls.
Package: permadict
A trivial, persistent, dictionary-like object, backed by SQLite.Installation$ python setup.py installOr just drop thepermadict.pyfile into your package.UsageBasic usage:>>>frompermadictimportPermadict>>>d=Permadict("db.sqlite")>>>d["key"]="value">>>print(d["key"])valueAs a context manager:>>>withPermadict("db.sqlite")asd:...d["something"]=1.2345...>>>withPermadict("db.sqlite")asd:...print(d["something"])...1.2345Iterating:>>>d=Permadict("db.sqlite")>>>fork,vind.items():...print(k,v)...something1.2345>>>forkeyind.keys():...print(key)...somethingDeleting an item:>>>deld["something"]Clearing all items:>>>d.clear()LimitationsKeys must be strings. Values are stored asBLOBtype after being
pickled, so your Python objects must be picklable.Permadictdoesn’t act entirely like adict: some methods are
missing, whether that be on purpose (as withdict.copy) or simply
due to negligence.MotivationI needed a way to share small amounts of data between processes. SQLite
provides a safe way to do so. Also, why not?
Package: permalink_adder
permalink_adderPACKAGE RENAMED AND MOVED TO: https://pypi.python.org/pypi/internal_linksThis package will be preserved for backward compatibility with current users, but won’t be developed anymore under this name.SEO tool for adding permalinks to text contained in Django apps
databases.InstallationInstall with pip:pip install permalink_adderUsageYou need to specify where and what to look for in your Django app’s
settings in this manner:PERMALINK_ADDER_SETTINGS = [{'app': 'your_app_name',
                            'model_name': 'your_model_name',
                            'fields': ['list', 'of', 'fields', 'in', 'which', 'script', 'should', 'search'],
                            'words': ['list', 'of', 'words', 'to', 'search'],
                            'url': 'url_that_should_be_wrapped_around_found_text'}]Starting script with option--startwill actually apply changes to
database, instead of printing them out.You can run the script either usingadd_permalinksmanagement
command or callpermalink_adderfunction fromadder.pymodule.OutputNo output if there are no occurrences of words or when they’re already
wrapped.Without--startoption, script will only print out proposed changes.
Package: permamodel
permamodelPermamodel is a collection of numerical permafrost models.
This repository contains source code and examples for two models:Frost numberKuFor more information,
see the project home page:https://permamodel.github.io.InstallationPermamodel can be installed withpip:$ pip install permamodelor withconda:$ conda install -c conda-forge permamodelWe recommend installing permamodel into a Python virtual environment.The MIT License (MIT)Copyright (c) 2016 permamodelPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: permasigner
Permanently sign IPAs on jailbroken iDevices 14.0-14.8.1 (persists on stock)How does it work?In iOS 14.0-14.8.1, there is a bug where CoreTrust will allow any root certificate. Although the bug exists on iOS 15.0-15.4.1, it can not be abused (yet) since you need to be jailbroken at first to place the app in the /Applications folder. This bug does not exist on anything older than iOS 14.This script makes a deb file for you based on an IPA. Tested only with Taurine, but should work with many others.Based on theresign_taurine branch of CoreTrustDemo, please note that certificates are not copyrightable.PrerequsitesA computer or jailbroken iDevice with ProcursusMac OS X 10.5.0 (?) or later required.(Basically) any Linux distro is supported.A jailbroken iDevice using the Procursus bootstrap is supported.Jailbroken "target" iDevice on 14.0-14.8.1The device needs to be jailbroken at first to place the app in the /Applications folder. After installing it'll continue working on stock.TutorialsRun OnlineRun in DockerRun on iOSRun on macOSRun on LinuxRun on FreeBSDRun on WindowsIn ProgressView theGitHub Projects board!CreditsLinus Henzefor the bugzhuoweifor the original Taurine scriptRexSonicfor the fix and a lot of helpsuperrnovaefor contributing lots of fixes and featuresverygenericnamefor the ldid downloader and supporttheProcursus Teamfor the amazing bootstrap and the ldid forkPlus, big thanks to all of the contributors that made this project possible.LicensePermasigner is licensed under the BSD-3-Clause license, and can be foundhere.Other StuffReddit Post
Package: permaswap
permaswap.pypython sdk for permaswapinstallpipinstallpermaswapusageperpare everpay accountimporteverpayapi_server='https://api-dev.everpay.io'# eth accountpk=''signer=everpay.ETHSigner(pk)# or ar account#signer = everpay.ARSigner('arweave-keyfile-xxx.json')account=everpay.Account(api_server,signer)init permaswaprouter_host='wss://router0-dev.permaswap.network/'swap=permaswap.Swap(router_host,account)query orderimportpermaswap# get_order('token_in', 'token_out', 'amount_in')# sell 1 tar for tusdcorder=swap.get_order('tAR','tUSDC',10**12)print(order)place orderresult=swap.place_order(order)print(result)
Package: perm-banana
Perm-BananaA package to enable easy permission creation inside Python.How to use it?fromperm-bananaimportPermission,Check,banana@bananaclassMyPermission(Permission)can_read_messages=Check(Permission(0b1))can_write_messages=Check(Permission(0b10))basic_user=can_read_message|can_write_messagesuser=MyPermission(0b11)ifuser.basic_user:print("permission granted")else:print("permission denied")
Package: permgroups
permgroups packagePython implementation of permutation groups is presented.
Two classes are introduced:Permfor permutations,Groupfor permutation groups (everal versions).The classPermfrom thepermsmodule
is based on Python dictionaries and utilize cycle notation.
The methods of calculation for the perm order, parity, ranking and unranking
are given. A random permutation generation is also shown.The classGroupfrom thegroupsmodule
is very simple and it is also based on dictionaries.
It is mainly the presentation of the permutation groups interface with
methods for the group order, subgroups (normalizer, centralizer, center,
stabilizer), orbits, and several tests.The classGroupfrom thesetgroupsmodule
is also simple and it is based on sets.The classGroupfrom thesimsgroupsmodule
is advanced and it is bases on the Sims theory.The project is moved fromGoogle Code.DownloadTo install an official release dopython3 -m pip install permgroupsTo get the git version dogit clone https://github.com/ufkapano/permgroups.gitUsage>>>frompermgroups.permsimportPerm>>>frompermgroups.groupsimportGroup>>>p=Perm()(0,1,2,4)(3,5)>>>~pPerm()(0,4,2,1)(3,5)>>>p.is_identity(),p.parity(),p.is_even(),p.sign()(False,0,True,1)>>>p.order(),pow(p,4)(4,Perm())>>>Perm.random(10)Perm()(0,1,4,2,7)(3,9,8)(5,6)>>>G=Group()>>>G.insert(p)>>>G.order()4>>>list(G.iterperms())[Perm(),Perm()(0,1,2,4)(3,5),Perm()(0,2)(1,4),Perm()(0,4,2,1)(3,5)]>>>Perm()(1,4)(0,2)inG,Perm()(0,1,2,3)inG(True,False)>>>G.is_abelian()TrueReferences[1] A. Kapanowski,Python for education: permutations.http://arxiv.org/abs/1307.7042[draft][2] A. Kapanowski, The Python Papers 9, 3 (2014).Python for education: permutations. [final version]http://ojs.pythonpapers.org/index.php/tpp/article/view/258ContributorsAndrzej Kapanowski (project leader)Tomasz GądekEOF
Package: permhash
Permhash is an extensible framework to hash the declared permissions applied to Chromium-based browser extensions and APKs allowing for clustering, hunting, and pivoting similar to import hashing and rich header hashing.Permhash is currently capable of running on four types of files, but is extensible beyond this:An Android Package (APK) file.A Chromium-based Extension file (CRX).An AXML Android Manifest file found at the root directory within APKs.A JSON Extension Manifest from a Chromium-based extension.Download and UsageInstall the permhash librarypip install permhashLibrary UseImport permhashfrom permhash import functions as permhashUse permhash# The path variable should be the full path to the file you wish to use to calculate the permhash.

# Calculate the permhash for a CRX
ph = permhash.permhash_crx(path)

# Calculate the permhash for a CRX manifest
ph = permhash.permhash_crx_manifest(path)

# Calculate the permhash for an APK
ph = permhash.permhash_apk(path)

# Calculate the permhash for an APK manifest
ph = permhash.permhash_apk_manifest(path)ExampleAn example of calculating permhash in bulk.import csv
import os
from permhash import functions as permhash


def bulk_permhash_crx_manifest(path, output):
    """
    Computes the permhash from a directory of CRX manifests
    Outputs the results in a csv passed as input

    :param path: The targeted directory
    :type path: string
    :param output:
    :type path: string

    """
    with open(output, mode="w", encoding="utf-8") as results:
        out_writer = csv.writer(
            results, delimiter=",", quotechar='"', quoting=csv.QUOTE_MINIMAL
        )
        out_writer.writerow(["filename", "permhash"])
        for filename in os.listdir(path):
            if path.endswith("/"):
                full_path = path + filename
            else:
                full_path = path + "/" + filename
            calculated_permhash = permhash.permhash_crx_manifest(full_path)
            if calculated_permhash:
                out_writer.writerow([filename, calculated_permhash])Commandline UsePermhash can also be used as a commandline tool. Provide the full path to the file to calculate the permhash in the --path/-p switch and the type of file being analyzed in the --type/-t switch. The command will output the permhash or False if it is an invalid file.permhash --type crx --path '[PATH TO CRX File]'
permhash --type crx_manifest --path '[PATH TO CRX Manifest File]'
permhash --type apk --path '[PATH TO APK File]'
permhash --type apk_manifest --path '[PATH TO APK Manifest Files]'Further InformationPermhashReview theMandiant Permhash Blogfor more details.DiscussionThePermhash Google Groupcan be used to facilitate discussion.DisclaimerThis is not an officially supported Google product.
Package: permission-backend-nonrel
Django-permission-backend-nonrelA Django authentication backend that supports Django’s user and group permissions onDjango-Nonrel.InstallationGet the code from Github:git clonehttps://github.com/django-nonrel/django-permission-backend-nonrel.gitaddpermission_backend_nonrel.backends.NonrelPermissionBackendto yourAUTHENTICATION_BACKENDSandpermission_backend_nonrelto yourINSTALLED_APPSsettings.py:AUTHENTICATION_BACKENDS = (
    ...
    'permission_backend_nonrel.backends.NonrelPermissionBackend',
)

INSTALLED_APPS = (
    ...
    'permission_backend_nonrel',
)It’s important to put‘permission_backend_nonrelafterdjangotoolbox,
becausepermission_backend_nonrel.adminreplacesdjangotoolbox’s User admin site.Permission and groups can be assigned and modified via Django’s admin interface:Django-gaeauth admin interface with user_permissions and groupsNow you should be able to use all the standard Django permission methods and decorators,
likeuser.has_perm(‘foo’)and so on.
Package: permission-check
Permission CheckA simple, cross-platform, lightweight utility to check permission of files and folders in Python.Usagepip install permission-checkfrom permission_check.permission_check import PermissionCheckfile = PermissionCheck(path="path_to_your_file")(AFileNotFoundErrorwill occur if the path is not an existing file or folder on the file system)For checking Owner PermissionsReadif file.owner.has_read():print("Owner has read permissions"")Writeif file.owner.has_write():print("Owner has write permissions"")Executeif file.owner.has_execute():print("Owner has execute permissions"")For checking Group and Others user's PermissionsFor checking Group and Other user's permissions just tofile.groupandfile.othersrespectively. followed by the.has_all()or.has_read()or.has_write()or.has_execute()methods
Package: permission-graph
permission-graphA graph based authorization libraryOverviewThe permissions graph consists of Vertices and Edges.VerticesResource: a resource with predefined actions requiring authorizationActor: an identity that will take actions on resourcesGroup: a named collection ofActorsAction: an action on a resourceEdgesMemberOf: indicates membership in a collectionActor -> MemberOf -> GroupAction -> MemberOf -> ResourceAllow: indicates positive permission to act on a resourceActor -> Allow -> ActionGroup -> Allow -> ActionAction -> Allow -> ActionDeny: indicates negative permission to act on a resourceActor -> Deny -> ActionGroup -> Deny -> ActionAction -> Deny -> Actionflowchart
    Actor -->|MemberOf|Group -->|Deny| Action -->|MemberOf| Resource
    Actor -->|Allow| Action -->|Allow| Action2 -->|MemberOf| Resource2Authorizing AccessAuthorization to act on a resource is decided by finding the shortest path between
a actor and the action to be performed. If that shortest path is an ALLOW rule,
the actor is authorized. If that shortest path is a DENY rule, or if there is no
path between the actor and the action, the actor is not authorized.In the event there is a tie for shortest path, the access will be denied only
if all shortest paths are DENY rules. This behavior can be controlled when
initializing the permission graph via thetie_breaker_policyparameter.
Package: permission-manager
Permission ManagerA simple way to manage object permissions.Installpipinstallpermission-managerExampleUseBasePermissionManagerimportdataclassesfrompermission_managerimportBasePermissionManager,PermissionResult@dataclasses.dataclassclassUser:name:str@dataclasses.dataclassclassPerson:first_name:strlast_name:strstatus:strclassPersonPermissionManager(BasePermissionManager):instance:Persondefhas_create_permission(self):returnTruedefhas_delete_permission(self):returnself.user.name=='admin'defhas_access_permission(self):ifself.instance.status=='excommunicado':returnPermissionResult('Due status')returnTruemanager=PersonPermissionManager()manager.has_permission('create')# same as# manager.has_create_permission()# > Truemanager=PersonPermissionManager(instance=Person(first_name='John',last_name='Wick',status='excommunicado',),user=User(name='Ms. Perkins'),)manager.has_permission('delete')# > Falsemanager.has_permission('access')# > PermissionResult(value=False, message=['Due status'])manager.resolve()# > {'access': False, 'create': True, 'delete': False}manager.resolve(with_messages=True)# > {'access': {'allow': False, 'message': ['Due status']},#    'create': {'allow': True, 'message': None},#    'delete': {'allow': False, 'message': None}}Also, it's includePermissionManager, which add additional functionality to check parent permissionsimportdataclassesfrompermission_managerimportPermissionManagerclassPostPermissionManager(PermissionManager):instance:'Post'defhas_update_permission(self):returnself.instance.status=='draft'@dataclasses.dataclassclassPost:title:strstatus:str='draft'permission_manager=PostPermissionManagerclassImagePermissionManager(PermissionManager):parent_attr='post'instance:'Image'defhas_update_permission(self):returnself.parent_permission_manager.has_permission('update')@dataclasses.dataclassclassImage:post:Postfile:strpost=Post(title='Test')manager=ImagePermissionManager(instance=Image(post=post,file='/path/to/file',),)manager.has_permission('update')# > Truepost.status='published'manager.has_permission('update')# > False
Package: permissions-system
Permissions SystemsIt's plugin forfastapi (but can be used with similar frameworks)any frameworks, that provides a minimalsetup for maintaining resources and related permissions for user-groups.How to use it?application.pyfromfastapiimportFastAPIimportdatabasesimportsqlalchemyimportosfrompermissions_system.PermissionsSystemDatabasesimportPermissionsSapp=FastAPI()DB_URI=os.environ["DB_URI"]database=databases.Database(DB_URI)metadata=sqlalchemy.MetaData()ps=PermissionsS(metadata,database,DB_URI)app.add_event_handler("startup",startup)app.add_event_handler("shutdown",shutdown)asyncdefstartup():awaitdatabase.connect()ps.setup()for Flask app you will call ps.setup() after db.init(app), assuming you are using flask_sqlalchemyStep1 -instantiate PermissionsS class.Step2 -during startup event after database is connected make a call to setup()************_************_PermissionsS will then detect your tables add them to resources, add super-admin user-group, if there isn't already one. Everytime there is a new resource that gets added automatically to resources table. User-group super-admin by default has all CRUD permissions for all resources. To add a new user-group and related permissions use built-in functions add_user_group and add_permissions. To get whether a particular user has CRUD permissions for a particular resource you will call> ps.user_has_permissions(user_id:UUID,resource:str,permission_type:PermissionTypesEnum) -> bool*PermissionsSystem is not like django-admin or flask-admin. It doesn't provide a front-end admin dashboard, but a minimal setup to manage resources and permissions. It aims to provide autonomy and more control over to the developer. For front-end you will end up using something more custom orReact-adminorvue-element-adminFind an examplehere, to learn how it can be used.PermissionsSystem now only uses sqlalchemy and is completely sync.
Package: permissive-dict
PermissiveDictDictionary class with loose rules for returning an attribute or a requested key value.Note: may resort to iterating the dict values to find the matching requested key, so is potentially slow.Key is first directly found using the exact key, and then loose rules are used.Installingpip install permissive-dictKey Search Rules:Keys compared without regard to case.Spaces, underscores, full-stops and dashes are equivalent in a requested key.Requested key is converted to str and stripped for wild card searching.Items in the list can be retrieved by, get, attribute_access, call or array requested_key.First matching element is returned.Default of '' is used instead of dict standard None or raising KeyErrorMultiple keys can be supplied separated with , (comma)Example:from permissive_dict import PermissiveDict

    a = PermissiveDict({'A B': 2, 4: 4})
    a.get('A_b') == a['a_b'] == a['A b'] == a['A_B'] == a['a-b '] == a['a.b '] == a.a_b == a.A_b == a('a-b')

    a.get('blue,4') == 4

    a.get('4') == a[4] == a(4) == a('4')Items with multiple wildcard keys matching in the dictionary will return the first item found.Keys can be accessed as attributes, array index, get() or by calling the instance variable.Key and value can be set as an attribute.Example:a = PermissiveDict()
a.hello = 4
a.hello == a['hello'] == a('hello') == a.get('HellO')Converting an entire list of dictsAn entire list of dictionaries can be converted to PermissiveDict using
theconvert_listmethod.  NOTE: no deep conversion is done and child
dictionaries are not converted.Example:list_of_dicts = [dict(a=n) for n in range(10)]
permissive_list = PermissiveDict.convert_list(list_of_dicts)NotesOnly Python 3 is supported.Release history1.0.4 Fix missing handling of _ and -