Saravanan666/pypi-org huggingface dataset:
Package: okra
OkraDiagnose git health.How healthy is our software? Okra is a tool that diagnoses the health of
projects which use git version control. Okra uses analytics, not buzzwords,
create a Jupyter notebook report on the health of a specific project.The pre-alpha version of Okra is a command line tool:$ okra --help
$ okra upsert JuliaLang IJulia.jl "sqlite:///ijulia.db" "JuliaLang/IJulia.jl" "https://github.com/JuliaLang/IJulia.jl.git"This command will clone/fetch updates from a repo and persist log information within a sqlite database. In this example,
we're cloningIJulia.jl, and populating a sqlite databaseijulia.db.DocumentationOkra DocumentationOkraHealth WebsiteFile an IssueGitHub issuesokrahealth/okra/issues.
You can also request membership to our slack channel,https://okrahealth.slack.com.ContributingAssuming that your virtual environment is activated, clone the Okra
repository and install the required development dependencies:$ git clone --recurse-submodules https://github.com/okrahealth/okra.git
$ cd okraOkra uses a submodule,tbonza/tiny_dancer, for
testing purposes. Make sure you initialize the submodule after cloning Okra so that your
tests will be passing.Validate the clone and master branch by ensuring that tests are passing.$ make testPleaseopen an Okra issueif your tests aren't
passing.
Package: okrager
okragerOverviewThe "okrager" console application allows you to generate an exploitableOkage: Shadow Kinggame save which will leverage a stack buffer-overflow vulnerability within the player's name in the save file. This results in the code execution of the supplied PS2 ELF file when you select "RESTORE GAME" within theOkage: Shadow Kinggame.The application requires you to pass an existing input memory card file (.ps2/.card). Next, it injects the staging shellcode and the supplied PS2 ELF then saves the game save as a new output file (.ps2/.card).For additional information on the inner working of this application, see the assosicated blog post "mast1c0re: Part 2 - Arbitrary PS2 code execution".InstallationUse the following command to install the okrager package with pip:python -m pip install okragerMake sure the local bin path is in your path. If not, add it to~/.bashrcor~/.zshrc:exportPATH="$HOME/.local/bin:$PATH"Usageusage: okrager [-h] [-c CODE] [-s1 STAGE1] [-s2 STAGE2] [-v {none,normal,debug}] input output elf

Generate an Okage Shadow King exploitation game save.

positional arguments:
  input                 The input .ps2/.card game save file.
  output                The exported .ps2/.card game save file.
  elf                   The compiled PS2 ELF filepath to inject.

optional arguments:
  -h, --help            show this help message and exit
  -c CODE, --code CODE  The game save identifier code. (Default: BASCUS-97129)
  -s1 STAGE1, --stage1 STAGE1
                        The stage 1 shellcode to be executed.
  -s2 STAGE2, --stage2 STAGE2
                        The stage 2 shellcode to be executed.
  -v {none,normal,debug}, --verbosity {none,normal,debug}
                        The script output verbosity mode. (Default: normal)ExamplesPS4 / PS5└─$ okrager VMC0.card VMC0-exploit.card program.elf
[#] Loading stagers and ELF
[#] Loading memory card
[#] Exporting BASCUS-97129
[#] Reading BASCUS-97129.psu
[#] Modifying bkmo0.dat
[#] Writing ELF
[#] Saving BASCUS-97129.psu
[#] Deleting BASCUS-97129
[#] Importing BASCUS-97129.psu
[+] Exploit wrote to save file "VMC0-exploit.card"PCSX2└─$ okrager Mcd001.ps2 Mcd001-exploit.ps2 program.elf
[#] Loading stagers and ELF
[#] Loading memory card
[#] Exporting BASCUS-97129
[#] Reading BASCUS-97129.psu
[#] Modifying bkmo0.dat
[#] Writing ELF
[#] Saving BASCUS-97129.psu
[#] Deleting BASCUS-97129
[#] Importing BASCUS-97129.psu
[+] Exploit wrote to save file "Mcd001-exploit.ps2"Referenceshttps://s3-eu-west-1.amazonaws.com/downloads-mips/documents/MIPS_Architecture_MIPS64_InstructionSet_%20AFP_P_MD00087_06.05.pdfhttps://shell-storm.org/online/Online-Assembler-and-Disassembler/https://github.com/beardypig/ghidra-emotionenginehttps://github.com/ps2dev/ps2sdkhttps://github.com/ps2dev/ps2toolchainhttps://github.com/ps2dev/mymchttps://pypi.org/project/mymcplus/https://git.sr.ht/~thestr4ng3r/mymcplushttps://playstationdev.wiki/ps2devwiki/index.php/Main_Pagehttps://www.copetti.org/writings/consoles/playstation-2/
Package: okrand
Okrand is an internationalization/translation tool for Django.It is a pure Python program so doesn’t rely ongettext.Okrand will respect your.gitignore.Django modelsOkrand can upgrade Django models so translation is much easier. You don’t need to writeverbose_nameanymore! And if you do write them Okrand will upgrade raw strings togettext_lazy.Turn this feature on in yoursetup.cfg:[tool:okrand]
django_model_upgrade=1So concretely this model:fromdjango.utils.translationimportgettext_lazyas_classBook(Model):name=CharField(verbose_name=_('name'))isbn=CharField(verbose_name=_('ISBN'))classMeta:verbose_name=_('book')verbose_name=_('books')Can now be changed to the more natural:classBook(Model):name=CharField()isbn=CharField(verbose_name='ISBN')Note that I don’t need to wrap theverbose_namein agettext_lazycall anymore.InstallationFirstpip install okrand, then addokrandtoINSTALLED_APPS.AddOKRAND_STATIC_PATHto settings, pointing to where Okrand should write the JavaScript catalog files. Typically something like:OKRAND_STATIC_PATH=Path(BASE_DIR)/'yourproject'/'base'/'static'If you have abaseapp to put common stuff.ConfigurationInsetup.cfgyou set:additional ignore rules beyond.gitignore. These are regexes for the full path.sorting: none (default), alphabeticalif the django model upgrade is enabled[tool:okrand]
ignore=
    .*some_annoying_path.*
sort=alphabetical
django_model_upgrade=1What does “Okrand” mean?Marc Okrandis a linguist who is best known for his work on Star Trek where he created the Klingon language.
Package: okra-py
okra_pyOkraAPI wrapper in Python===============================InstallationTo install with pip$ pip install okra_pyTo install from source, clone this repo:$ git clone https://github.com/Uchencho/okra_py.gitChange directory into the okra_py folder$ cd okra_py/Install the module$ python setup.py installDocumentationPlease seehttps://docs.okra.ng/for the most up-to-date documentation for the OKRA API.ImplementationSandbox/DevelopmentBy default, the class is instantiated using sandbox(developement) endpoint. To use in production, simply pass the url as an argument to
prod_url when instantiating the class.Okra Auth ClassThe okra auth class provides seven methods which corresponds to the okra auth producthttps://docs.okra.ng/products/auth. Some of the methods are shown below:retrieve_auth: retrieve the bank account and routing numbers associated with a Record's current, savings, and domiciliary accounts,# Import the Okra Auth classfromokra_py.authimportOkra_Auth# Initialize with a token from okraok_mod=Okra_Auth(my_okra_token)resp=ok_mod.retrieve_auth()print(resp.status_code,resp.json())getbyID: fetch authentication info using the id.the_id="5rggfdfghjkl4567"resp_by_id=ok_mod.getbyID(idx=the_id)print(resp_by_id.status_code,resp_by_id.json())getbyCustomer: fetch authentication info using the customer id.customer_id="5rggfdfghjkl4567"resp_by_cus_id=ok_mod.getbyCustomer(customer_id=customer_id)print(resp_by_cus_id.status_code,resp_by_cus_id.json())getbyBank: fetch authentication info using the bank id.bank_id="5rggfdfghjkl4567"resp_by_bank_id=ok_mod.getbyBank(bank_id=bank_id)print(resp_by_bank_id.status_code,resp_by_bank_id.json())Balance Class ExampleThe okra balance class provides eight methods which corresponds to the okra balance producthttps://docs.okra.ng/products/balance. Some of the methods are shown below:retrieve_balance: this returns the real-time balance for each of a Record's account# Import the Okra Balance classfromokra_py.balanceimportOkra_Balance# Initialize with a token from okraok_bal=Okra_Balance(my_okra_token)bal_resp=ok_bal.retrieve_balance()print(bal_resp.status_code,bal_resp.json())getbyID: fetch balance info using the id of the balance.the_id="5rggfdfghjkl4567"bal_by_id=ok_bal.getbyID(idx=the_id)print(bal_by_id.status_code,bal_by_id.json())getbyAccount: fetch balance info using the account id.account_id="5rggfdfghjkl4567"resp_by_account_id=ok_bal.getbyAccount(account_id=account_id)print(resp_by_account_id.status_code,resp_by_account_id.json())ProductionRetrieve Auth Production Exampleretrieve_auth: retrieve the bank account and routing numbers associated with a Record's current, savings, and domiciliary accounts,# Import the Okra Auth classfromokra_py.authimportOkra_Auth# Initialize with a token from okraprod_okr_mod=Okra_Auth(my_okra_token,prod_url='https://api.okra.ng')prod_resp=prod_okr_mod.retrieve_auth()print(prod_resp.status_code,prod_resp.json())getbyID: fetch authentication info using the id.the_id="5rggfdfghjkl4567"prod_resp_by_id=prod_okr_mod.getbyID(idx=the_id)print(prod_resp_by_id.status_code,prod_resp_by_id.json())
Package: okra-py-official
okra_pyOkraAPI wrapper in Python===============================InstallationTo install with pip$ pip install okra_py_officialTo install from source, clone this repo:$ git clone https://github.com/okraHQ/okra_py.gitChange directory into the okra_py folder$ cd okra_py/Install the module$ python setup.py installDocumentationPlease seehttps://docs.okra.ng/for the most up-to-date documentation for the OKRA API.ImplementationSandbox/DevelopmentBy default, the class is instantiated using sandbox(developement) endpoint. To use in production, simply pass the url as an argument to
prod_url when instantiating the class.Okra Auth ClassThe okra auth class provides seven methods which corresponds to the okra auth producthttps://docs.okra.ng/products/auth. Some of the methods are shown below:retrieve_auth: retrieve the bank account and routing numbers associated with a Record's current, savings, and domiciliary accounts,# Import the Okra Auth classfromokra_py.authimportOkra_Auth# Initialize with a token from okraok_mod=Okra_Auth(my_okra_token)resp=ok_mod.retrieve_auth()print(resp.status_code,resp.json())get_by_id: fetch authentication info using the id.the_id="5rggfdfghjkl4567"resp_by_id=ok_mod.get_by_id(idx=the_id)print(resp_by_id.status_code,resp_by_id.json())get_by_customer: fetch authentication info using the customer id.customer_id="5rggfdfghjkl4567"resp_by_cus_id=ok_mod.get_by_customer(customer_id=customer_id)print(resp_by_cus_id.status_code,resp_by_cus_id.json())get_by_bank: fetch authentication info using the bank id.bank_id="5rggfdfghjkl4567"resp_by_bank_id=ok_mod.get_by_bank(bank_id=bank_id)print(resp_by_bank_id.status_code,resp_by_bank_id.json())Balance Class ExampleThe okra balance class provides eight methods which corresponds to the okra balance producthttps://docs.okra.ng/products/balance. Some of the methods are shown below:retrieve_balance: this returns the real-time balance for each of a Record's account# Import the Okra Balance classfromokra_py.balanceimportOkra_Balance# Initialize with a token from okraok_bal=Okra_Balance(my_okra_token)bal_resp=ok_bal.retrieve_balance()print(bal_resp.status_code,bal_resp.json())get_by_id: fetch balance info using the id of the balance.the_id="5rggfdfghjkl4567"bal_by_id=ok_bal.get_by_id(idx=the_id)print(bal_by_id.status_code,bal_by_id.json())get_by_account: fetch balance info using the account id.account_id="5rggfdfghjkl4567"resp_by_account_id=ok_bal.get_by_account(account_id=account_id)print(resp_by_account_id.status_code,resp_by_account_id.json())ProductionRetrieve Auth Production Exampleretrieve_auth: retrieve the bank account and routing numbers associated with a Record's current, savings, and domiciliary accounts,# Import the Okra Auth classfromokra_py.authimportOkra_Auth# Initialize with a token from okraprod_okr_mod=Okra_Auth(my_okra_token,prod_url='https://api.okra.ng')prod_resp=prod_okr_mod.retrieve_auth()print(prod_resp.status_code,prod_resp.json())get_by_id: fetch authentication info using the id.the_id="5rggfdfghjkl4567"prod_resp_by_id=prod_okr_mod.get_by_id(idx=the_id)print(prod_resp_by_id.status_code,prod_resp_by_id.json())
Package: ok-redis
Object-Key Mapper for RedisIf you’ve used redis on python, you’ve had to deal with redis keys.
Sometimes,lotsof redis keys. With so many keys, it’s easy to make
mistakes, especially since keys are just strings. I builtokso that
I didn’t have to work with strings for redis keys.Here’s how you use it:importokimportredisclassUser(ok.Key):fields=['timeline','followers','following']# Get user mixxorz' timeliner=redis.StrictRedis()r.zrevrange(User('mixxorz').timeline,0,50)# ZREVRANGE User:mixxorz:timeline 0 50Managing your keys just became a lot less fragile.InstallationInstall it from pypi$ pip install ok-redisUsageAccess fields.classUser(ok.Key):fields=['timeline','followers','following']print(User('mixxorz').timeline)# User:mixxorz:timelineChain keys.classCity(ok.Key):fields=['tweets_hll']classCountry(ok.Key):subkeys=[City]print(Country('PH').City('Manila').tweets_hll)# Country:PH:City:Manila:tweetsSubkeys can be an absolute or relative path to a key.# mod_one.pyclassRefer(Key):fields=['elements']# mod_two.pyclassParent(Key):subkeys=['..mod_one.Refer']print(Parent('foo').Refer('bar').elements)# Parent:foo:Refer:bar:elementsThe string representation of aKeyinstance is the key, so you can use it like
this:classUser(ok.Key):passr.get(User('mixxorz'))But you can also access the key explicitly.User('mixxorz').key# >>> User:mixxorzIDs are optional.classUser(ok.Key):fields=['rankings']print(User().rankings)# User:rankingsIDs don’t have to be stringsclassUser(ok.Key)passprint(User(123))# User:123You can change the string used for the key.classFacebook(ok.Key):fields=['all_posts']class_key='fb'print(Facebook().all_posts)# fb:all_postsLicenseMIT
Package: okridge
OKRidgeThis repository contains source code to our NeurIPS 2023 paper:OKRidge: Scalable Optimal k-Sparse Ridge RegressionDocumentation:https://okridge.readthedocs.ioGitHub:https://github.com/jiachangliu/OKRidgePyPI:https://pypi.org/project/okridge/Free and open source software:BSD licenseTable of ContentIntroductionInstallationUsageContributingLicenseIntroductionWe consider the following optimization problem:$$\min_{\mathbf{\beta}} \sum_{i=1}^n (y_i - \mathbf{x}_i^T \mathbf{\beta})^2 + \lambda_2 \lVert \mathbf{\beta} \rVert_2^2 \quad \text{s.t.} \quad \lVert \mathbf{\beta} \rVert_0 \leq k$$Optimal k-sparse ridge regression is a crucial ML problem that has many applications in statistics, machine learning, and data mining.
However, the problem is NP-hard, and existing algorithms are either slow (using commercial MIP solvers) or suboptimal (using convex or nonconvex regularizers to approximate $\ell_0$).
We propose a novel algorithm, OKRidge, that can solve the problem to provable optimality in a scalable manner.OKRidge is based on thebranch-and-boundframework.
The insight leading to the computational efficiency comes from a novel lower bound calculation involving, first, a saddle point formulation, and from there, either solving (i) a linear system or (ii) using anADMM-based approach, where the proximal operators can be efficiently evaluated by solving another linear system and anisotonic regressionproblem.
We also propose a method to warm-start our solver, which leverages a beam search.Experimentally, our methods attain provable optimality with run times that are orders of magnitude faster than those of the existing MIP formulations solved by the commercial solver Gurobi.Installation$pipinstallokridgeUsagePlease see theexample.ipynbjupyter notebook on GitHub for a detailed tutorial on how to use OKRidge in a python environment.k=10# cardinality constraintlambda2=0.1# l2 regularization parametergap_tol=1e-4# optimality gap toleranceverbose=True# print out the progresstime_limit=180# time limit in secondsBnB_optimizer=BNBTree(X=X,y=y,lambda2=lambda2)upper_bound,betas,optimality_gap,max_lower_bound,running_time=BnB_optimizer.solve(k=k,gap_tol=gap_tol,verbose=verbose,time_limit=time_limit)ContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.Licenseokridgewas created by Jiachang Liu. It is licensed under the terms of the BSD 3-Clause license.Creditsokridgewas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.Citing Our WorkIf you find our work useful in your research, please consider citing the following paper:@inproceedings{liu2023okridge,title={OKRidge: Scalable Optimal k-Sparse Ridge Regression},author={Liu, Jiachang and Rosen, Sam and Zhong, Chudi and Rudin, Cynthia},booktitle={Thirty-seventh Conference on Neural Information Processing Systems},year={2023}}
Package: okta
A Python library for the Okta Management APIs.Getting Started` $ pip install okta `What you needAn Okta account, called an _organization_ (sign up for a free developer organization if you need one)[An API token](https://developer.okta.com/docs/api/getting_started/getting_a_token)Look for our quickstart guide here!
-https://github.com/okta/okta-sdk-pythonOkta Developer ForumFind out more and look for help here:https://devforum.okta.com/
Package: oktaauth
The oktaauth module and command line interface allows users to
authenticate with Okta and obtain a SAML assertion either from the
command line or programmatically from another script.UsageThe oktaauth CLI requires a few arguments to operate.# obtain a SAML response from Okta$ oktaauth –username joebloggs –server
acemeinc.okta.com –apptype amazon_aws –appid exk5c0llcTheapptypeandappidare provided by okta and would be seen in the
url when going via a browser.  For example:https://acmeinc.okta.com/app/amazon_aws/exk5c0llc/sso/samlThere may be an easier way to obtain this.  If you know then please
submit a pull request to thisREADME.ThanksThanks to Okta for help.  I borrowed a lot of code fromhttps://github.com/okta/okta-openvpnto handle the Okta API
authentication flow.AuthorsPeter Gillard-Moss
Package: oktaauthpy3
This is a fork of oktaauth with Python3 supportThe oktaauthpy3 module and command line interface allows users to
authenticate with Okta and obtain a SAML assertion either from the
command line or programmatically from another script.UsageThe oktaauthpy3 CLI requires a few arguments to operate.# obtain a SAML response from Okta$ oktaauthpy3 –username joebloggs –server
acemeinc.okta.com –apptype amazon_aws –appid exk5c0llcTheapptypeandappidare provided by okta and would be seen in the
url when going via a browser.  For example:https://acmeinc.okta.com/app/amazon_aws/exk5c0llc/sso/samlThere may be an easier way to obtain this.  If you know then please
submit a pull request to thisREADME.ThanksPeter Gillard-Moss who is the original Author or oktaauthhttps://pypi.org/project/oktaauth/Thanks to Okta for help.  I borrowed a lot of code fromhttps://github.com/okta/okta-openvpnto handle the Okta API
authentication flow.AuthorMansab Uppal
Package: okta-cmd
okta-cmdIntroductionThis is my usual Okta-cli, help me easy to operate okta, because okta ui is too slow..Use$pipinstallokta-cmd# init okta$okta-cmdinit--url=https://test.okta.com--token=testtoken# add group$okta-cmdadd-group--name=group-test1# add user file to group$okta-cmdadd-user-list-to-group--file=./user_list.txt--group=aaaaaaa# copy group users to other group$okta-cmdcopy-group-to-other--group=aaaaaaa--othergroup=bbb# group list$okta-cmdgroup-list# user list$okta-cmduser-listDownload user list fileuser-list command add three options.--download: want download user list--filename: file name, the default is okta_user.json--filepath: file path, the default is ./$okta-cmduser-list--download
Downloadsuccess.path:./okta_user.json
$okta-cmduser-list--download--filename=test.json
Downloadsuccess.path:./test.json
$okta-cmduser-list--download--filename=test.json--filepath=./oktacmd
Downloadsuccess.path:./oktacmd/test.jsonFeaturesadd groupadd user file to groupcopy group to other groupgroup listuser listdownload user list fileTODOdownload group list fileDelete matching usersDelete matching groupsNotesIf you have new features or questions, you can write issues
Package: oktadboto
InstallationThe oktadboto project is public and can be installed from pypi with pip for python3 on mac and linux.pip install oktadbotoRequiresThis library makes system call tooktadto get new session credentialsoktadUsageAfter activating your credentials for an oktad profile using you username, password and mfa token you should be able
to get new AWS session credentials without authenticating for upto 24 hours. AWS Sessions last only one hour though.
Use otkadboto to create an AWS Session using RefreshableCredentials that can make a system call to get a fresh session
token every hour.1) Confirm that you can runoktad {PROFILE_NAME}--envin your shell to get environment variables for
AWS_SESSION_TOKEN, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY.Example code to create a boto3 s3 client resourcefrom oktadboto import oktadboto_session
refreshing_boto_session = oktadboto_session('{PROFILE_NAME}')
s3_client = refreshing_boto_session.client('s3')
s3_client.download_fileobj(...)The RefreshableCredentials will work until you need to reauthenticate with Oktad, usually 24 hours.DevelopmentGit clone the respository:git clone git@github.com:upserve/otkadboto.gitPip install the development dependencies in avirtual environment:pip install -e .[dev]Run unit tests:python -m unittest -vRun flake8:flake8 .Run black:black .
Package: oktagon-python
oktagon-pythonThis python package is a tiny utility for verifying & decoding OKTA tokens in python
backend services.Installationpipinstalloktagon-pythonGetting StartedLet's say you have /consignments REST API endpoint which you'd like to make accessible
only by logistics OKTA group. Then you would write something like this:import os

from oktagon_python.authorisation import AuthorisationManager
from starlette.requests import Request

auth_manager = AuthorisationManager(
    service_name="your_service_name",
    okta_issuer=os.environ.get("OKTAGON_OKTA_ISSUER"),
    okta_audience=os.environ.get("OKTAGON_OKTA_AUDIENCE"),
)

async def is_authorised(request: Request):
    return await auth_manager.is_user_authorised(
        allowed_groups=["logistics"],
        resource_name="consignments",
        cookies=request.cookies
    )This will create anAuthorisationManagerinstance that will check user's
authorisation.Getting user's emailThere isget_user_emailasync method on AuthorisationManager to retrieve user's email. Usage:fromstarlette.requestsimportRequestcookies:Request.cookies=request.cookiesemail=awaitauth_manager.get_user_email(cookies)Contributinggitclonehttps://github.com/madedotcom/oktagon-python.gitcdoktagon-python
makeinstall
maketestsThis will install all the dependencies (including dev ones) and run the tests.Run the formatters/lintersmakeprettyWill run all the formatters and linters (black,isortandpylint) in write mode.makepretty-checkWill run the formatters and linters in check mode.You can also run them separtly withmake black,make isort,make pylint.RealesesMerging a PR into themainbranch will trigger the GitHubreleaseworkflow.The following GitHub actions will be triggered:github-tag-actionwill bump a new
tag withpatchversion by default. Add#majoror#minorto the merge commit
message to bump a different tag;gh-action-pypi-publishwill push the
newly built package on PyPI;action-automatic-releaseswill create the GitHub release and tag it withlatestas well.