Saravanan666/pypi-org huggingface dataset:
Package: nsj-gcf-utils
nsj_gcf_utilsUtilitários para construção de Google Cloud Functions.Features disponíveisSegue breve descrição das features disponiveis, identificando os respectivos módulos:nsj_gcf_utils.app_logger: Configuração padrão de logger para aplicações GCF.nsj_gcf_utils.authentication_service: Validação de chaves recebidas no cabeçalho X-API-Key.nsj_gcf_utils.db_adapter: Adapter de comunicação com o banco.nsj_gcf_utils.http_util: Realiza requisições HTTP, com suporte a tentativas seguidas em caso de falha.nsj_gcf_utils.iban: Utilitário para manipulação de International Bank Account Number (IBAN)nsj_gcf_utils.json_util: Serialização e desserialização em JSON, com manipulação nativa de datas no formato "yyyy-mm-ddThh:mm:ss". Decimal é traduzido para string ao serializar para JSON.nsj_gcf_utils.keycloak_service: Autenticação para aplicação enquanto cliente Oauth.nsj_gcf_utils.nsj_authentication_service: Validação de access_token recebido no cabeçalho Authorization (Bearer token), por meio do padrão Token Instrospection (RFC 7662).nsj_gcf_utils.router: Utilitário para controler de rotas por meio decorators, fazendo com que uma fucntion-framework se comporte de modo similar a outros frameworks web como Spring ou Symfony.Testes AutomatizadosSempre rode o comando abaixo, antes de dar push neste repositório:make tests
Package: nsj-rest-test-util
nsj-rest-test-utilUtilitário para geração e execução de testes em APIs RestEsta biblioteca não se propõe a testar método e sim requisições.
A criação dos testes é automatizada, só é necessário preencher qual a requisição e qual a resposta esperada.A biblioteca possui dois passos: a Criação e a ExecuçãoA Criação de caso de teste é o processo que realiza um dump das informações no banco ele gera um csv com as informações do banco no momento da criação do teste e também realiza a requisção para a api que será testada para gerar assim o retorno que será comparado na hora de executar o teste.A Execução do teste é realizada pelo pytest na pasta api/casos_de_teste
neste ponto ele carregará no banco os dados do csv criado na criação do teste e fará uma requisição para a api no tenant que foi configurado nas variaveis de ambiente.Variaveis de ambienteDATABASE_HOST - Host do banco
DATABASE_PASS - Senha do banco
DATABASE_PORT - Porta do banco
DATABASE_NAME - Nome da base de dados
DATABASE_USER - Usuario do bancoSERVER_PORT - porta da aplicação que será testada
TESTS_TENANT - tenant que será usado para inserção de dados de teste
TESTS_URL_BASE - url base da aplicação que seráCriação de caso de testeem src/util/tcase_tools altere o chamamento da função TCaseTools.criar_caso_teste_padrao no método main
TCaseTools.criar_caso_teste_padrao(
1,                          # Tenant que será feita a requisição ara montar o teste
"/recursos",                # Rota que será feira a requisição
"1234",                     # Codigo mope para a rota
HTTPMethod.GET,             # Metodo HTTP que será feita a requisição
204,                        # Código esperado para o retorno
"exemplo1",                 # Nome que será usado para se referir ao teste
JsonUtil().decode(""""""),  # Corpo da requisição em caso de POST, em caso de GET e DELETE são os parametros na url
True,                       # Esse parametro é para saber se deseja executar o teste e gerar a saída, por
padrão passamos true
True                        # esse paramentro é para se o teste já existir ao executar novamente será sobrescrito
seus arquivos
)
Package: nsjwt
No Shit JWT implementationAdvantages:Damn simple: only HMAC SHA-256 (“HS256”) algorithm implemented so no header parameter neededFast: usesultrajsonandpybase64No Object-Oriented shitInstallationpipinstallnsjwtUsage>>>importnsjwt>>>secret='secret'>>>payload={"sub":"1234567890","name":"Robbie Basho","admin":True}>>>nsjwt.encode(secret,payload)b'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IlJvYmJpZSBCYXNobyIsImFkbWluIjp0cnVlfQ.MvN07jU4TCXH-lrYE2qsiY5cmxHO7ZCH8eLn6WpbWFM'>>>nsjwt.decode(secret,b'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRmFoZXkiLCJhZG1pbiI6dHJ1ZX0.XDADzzjyGLeoLBl2BHJaytkLtGdhBb5KWsKOtZlVEo8'){'admin':True,'name':'John Fahey','sub':'1234567890'}LicenseApache 2.0 - Seethe LICENSEfor more information.
Package: ns-jwt
ns_jwt: JSON Web Tokens for Notary ServiceWe will use RS256 (public/private key) variant of JWT signing. (Source:https://pyjwt.readthedocs.io/en/latest/usage.html#encoding-decoding-tokens-with-rs256-rsa). For signing, , NS is assumed to be in possession of a public-private keypair. Presidio can access the public key through static configuration or, possibly, by querying an endpoint on NS, that is specified in the token.NS tokens carry the following claims:namedescriptiontypedata-setSAFE Token that points to the dataset. Presidio is able to synthesize a token with linked assertions based on data-set, project-id and user idString, Privateproject-idCoManage/NS name of the project, universally unique and distinct.String, Privatens-tokenSAFE Token of the NS generated from its public keyString, Privatens-nameHuman-readable NS nameString, PrivateissNS FQDNString, RegisteredsubOSF DCE rendering of DN attributes from user’s X.509 certString, PublicexpExpiration dateDate, RegisterediatIssued at dateDate, RegisterednameFull name of subjectString, PublicFor dates, a JSON numeric value representing the number of seconds from1970-01-01T00:00:00Z UTCuntil the specified UTC date/time, ignoring leap seconds.  This is equivalent to the IEEE Std 1003.1, 2013 Edition definition "Seconds Since the Epoch", in which each day is accounted for by exactly 86400 seconds, other than that non-integer values can be represented.  See RFC 3339 for details regarding date/times in general and UTC in particular.Setup and configurationNo external configuration except for dependencies (PyJWT, cryptography, python-dateutil).As above, use a virtual environmentvirtualenv -p $(which python3) venv
source venv/bin/activate
pip install --editable ns_jwt
pip install pytestTestingSimply execute the command below. The test relies on havingpublic.pemandprivate.pem(public and private portions of an RSA key) to be present in thetests/directory. You can generate new pairs usingtests/gen-keypair.sh(relies on openssl installation).pytest -v ns_jwtTeardown and CleanupNone needed.TroubleshootingCI Logon or other JWTs may not decode outright using PyJWT due tobinascii.Error: Incorrect paddingandjwt.exceptions.DecodeError: Invalid crypto padding. This is due to lack of base64 padding at the end of the token. Read it in as a string, then add the padding prior to decoding:import jwt

with open('token_file.jwt') as f:
  token_string = f.read()

jwt.decode(token_string + "==", verify=False)Any number of=can be added (at least 2) to fix the padding. If token is read in as a byte string, convert toutf-8first:jwt_str = str(jwt_bin, 'utf-8'), then add padding (Source:https://gist.github.com/perrygeo/ee7c65bb1541ff6ac770)
Package: nska-deserialize
NSKeyedArchive plist deserializerDeserializes NSKeyedArchiver created plists, which are frequent in macOS/iOS. These are serialized versions of plists (or data classes) and are meant for machine reading. The deserialized version is human readable for analysts and investigators who need to review the data.The library recursively deserializes the entire plist and returns a dictionary/list object representing the entire plist. Certain NSKeyedArchiver plists contain circular references, which results in infinite looping. The code detects and breaks these loops wherever found to return useable data.Requirements: Python 3.6+ (3.8 recommended)Due to improvements in the built-inplistliblibrary in Python 3.8, it is recommended to use 3.8 or above. For 3.7 or lower, it should work fine for most plists, some might fail to save correctly. If you don't care about saving the deserialized plist (using the built-in library functions), then this should make no difference.Installation (via pip/pip3)pip3 install nska_deserializeUsageFrom a fileimportnska_deserializeasndinput_path='/Users/yogesh/Desktop/sample.sfl2'withopen(input_path,'rb')asf:try:deserialized_plist=nd.deserialize_plist(f)print(deserialized_plist)except(nd.DeserializeError,nd.biplist.NotBinaryPlistException,nd.biplist.InvalidPlistException,plistlib.InvalidFileException,nd.ccl_bplist.BplistError,ValueError,TypeError,OSError,OverflowError)asex:# These are all possible errors from libraries importedprint('Had exception: '+str(ex))deserialized_plist=Noneifdeserialized_plist:output_path_plist=input_path+'_deserialized.plist'output_path_json=input_path+'_deserialized.json'nd.write_plist_to_json_file(deserialized_plist,output_path_json)nd.write_plist_to_file(deserialized_plist,output_path_plist)From a Stringimportnska_deserializeasndplist_in_string=b"{notional string that might have come from a database}"try:deserialized_plist=nd.deserialize_plist_from_string(plist_in_string)print(deserialized_plist)except(nd.DeserializeError,nd.biplist.NotBinaryPlistException,nd.biplist.InvalidPlistException,plistlib.InvalidFileException,nd.ccl_bplist.BplistError,ValueError,TypeError,OSError,OverflowError)asex:# These are all possible errors from libraries importedprint('Had exception: '+str(ex))deserialized_plist=Noneifdeserialized_plist:output_path_plist=input_path+'_deserialized.plist'output_path_json=input_path+'_deserialized.json'nd.write_plist_to_json_file(deserialized_plist,output_path_json)nd.write_plist_to_file(deserialized_plist,output_path_plist)Change logv1.3.2Version 1.3.2 adds NSUUID type to ccl_bplist, which should remove at least some exceptions related tounhashable type: 'NsKeyedArchiverDictionary'v1.3.1Version 1.3.1 is python 3.9 compatible (earlier versions of library may have problems with XML plists on python 3.9)v1.2Support for macOS Big Sur plists, some have hexadecimal integers in XML, which caused problems with underlying plist parsers
Package: ns-lab-aws
Console for AWSInstallpipinstallns-lab-awsInitializepython-mns_lab_aws.initWill be created "logging.conf" and ".env" with default valuesSet AWS credentialsAWS_KEY=eEXAMPLEoIAN88J7LAH45XAWS_SECRET=eEXAMPLEo2D4zGlMlwNrn7vC/rmKzxXz6X0cgj/AWS_REGION=eu-central-1RunHelp Infopython-mns_lab_aws.manager--help(venv)salavat@LinuxAWS%python-mns_console.client--help
usage:client.py[-h][--list][--create][--delete][--upload][--download][--content][--force][-bBUCKET][-fFILE][-dDIR]AWSS3Buckets

options:-h,--helpshowthishelpmessageandexit--listListallbuckets--createCreatebucket--deleteDeletebucket--uploadUploadfiletobucket--downloadDownloadfilefrombucket--contentShowbucketcontent--forceForcedeletebucket-bBUCKET,--bucketBUCKETBucketname-fFILE,--fileFILEFilename-dDIR,--dirDIRDirectorynameShow all bucketspython-mns_lab_aws.manager--list(venv)salavat@LinuxAWS%python-mns_console.client--listAWSS3BucketsIDFilesBucketLocationCreated──────────────────────────────────────────────────────────────────────────────────────────────────────────12ns-lab.open-storageEU-CENTRAL-12023-02-1408:45:5520aws-sam-cli-managed-default-samclisourcebucket-1agj41…EU-CENTRAL-12023-04-0314:34:2534backnameEU-CENTRAL-12023-06-0713:32:36402023-06-08-my-bucketEU-CENTRAL-12023-06-0806:02:0052new-storage4EU-CENTRAL-12023-02-1520:15:51610new-storage3EU-CENTRAL-12023-02-1514:00:3771zappa-s3-test1EU-CENTRAL-12023-04-1709:27:418189ns-lab-webEU-WEST-32022-12-0309:15:52Create new S3 Bucketpython-mns_lab_aws.manager--create-b'project-8.console'Delete S3 Bucketpython-mns_lab_aws.manager--delete-b'project-8.console'Show S3 Bucket contentpython-mns_lab_aws.manager--content-b'backname'FilesinAWSS3BucketIDPathFileExtensionSizeCreated─────────────────────────────────────────────────────────────────────────────────14100020573.pdfPDF350.64KB2023-06-0719:34:092Docker.dmgDMG590.5MB2023-06-0719:35:263flower.jpegJPEG202.35KB2023-06-0719:39:004my_pdf_document.pdfPDF350.64KB2023-06-0719:31:02
Package: nsloader
nsloaderThis script collects articles fromWall Street Journaland returns it in dict format.Installing nsloader and Supported Versionsnsloader is not registered on the pypi. You have to download from github directly.$ python -m pip install nsloadernsloader is tested by Python3.10.DependenciesplaywrightAdditionaly, you have to executeinstall playwrightin your execution environment.UsageTo load theWall Street Journalarticles and parse to dictionay format.Wall Street JournalNOTE: You have to set 2 enviroment valiables name asWSJ_USERNAMEandWSJ_PASSWORDbefore execution.>>>fromnsloaderimportwsj>>>article=wsj.Article()>>>article.load('https://www.wsj.com/articles/...')>>>print(article.to_dict()){"url":"https://www.wsj.com/articles/...","title":"The Fed ...","sub_title":"As expected ...",...}
Package: nslocalized
What is this?It’s a package of Python code for manipulating Mac OS X/iOS .strings files,
which has been written carefully to support all of the character escapes and
Unicode characters you might wish to use.How do I use it?To read a .strings file:>>> from nslocalized import StringTable
>>> st = StringTable.read('/path/to/my/Localized.strings')or to read the strings into an existingStringTable:>>> st.read('/path/to/my/other/Localized.strings')To write a new .strings file:>>> st.write('/path/to/my/new/Localized.strings')By default, that uses host-endian UTF-16, but you can specify the encoding:>>> st.write('/path/to/my/new/Localized.strings', encoding='utf_8')Each string is represented by aLocalizedStringobject; given the strings
file:/* My important string */
"Very important" = "Très important";in aStringTablest:>>> ls = st.lookup('Very important')
>>> print ls.source
Very important
>>> print ls.target
Très important
>>> print ls.comment
My important stringYou can also add entries to aStringTablewith:>>> st.store(LocalizedString('One', 'Uno'))or with a comment:>>> st.store(LocalizedString('MB', 'Mo', 'Megabytes'))Finally, for simple access you can use the[]operator:>>> st['GB'] = 'Go'
>>> print st['MB']
MoIn some cases you might want to load the string table without processing
escapes.  In that case, you can do:>>> st = StringTable.read('/path/to/my/Localized.strings',
process_escapes=False)which will read the table without any escape processing taking place.
Obviously if you read a table in this form, you will also want to write it
without escaping:>>> st.write('/path/to/my/new/Localized.strings', escape_strings=False)
Package: nslookup
PyNslookupSimple, sensible high-level DNS lookups in Python (on top of dnspython dns.resolver).Purpose and scopeThis library is a simple wrapper arounddnspython,
to provide high level functions with good error/exception handling, for the most common basic DNS lookup cases.A,AAAArecord lookups (typical DNS queries)SOA lookupsThis is not intended to be a complete wrapper around dnspython library or to handle uncommon edge cases.
Features like DoH are out of scope, and should be done using other libraries or dnspython directly.UsageReturns an object containing two arrays:response_full: the full DNS response string(s)answer: the parsed DNS answer (list of IPs or SOA string)fromnslookupimportNslookupdomain="example.com"# Initialize Nslookupdns_query=Nslookup()# Alternatively, the Nslookup constructor supports optional# arguments for setting custom dns servers (defaults to system DNS),# verbosity (default: True) and using TCP instead of UDP (default: False)dns_query=Nslookup(dns_servers=["1.1.1.1"],verbose=False,tcp=False)ips_record=dns_query.dns_lookup(domain)print(ips_record.response_full,ips_record.answer)soa_record=dns_query.soa_lookup(domain)print(soa_record.response_full,soa_record.answer)NoteThis library is oriented around regular UDP DNS.Using TCP modes in this simple library will create a separate TCP session for
each query, which can be resource intensive for a large number of queries.
For this it is recommended to use the more granulardnspythonAPI directly.
Package: nsma
NSMA: A Memetic Procedure for Global Multi-Objective OptimizationImplementation of the NSMA Algorithm proposed inLapucci, M., Mansueto, P. & Schoen, F. A memetic procedure for global multi-objective optimization. Math. Prog. Comp. (2022).If you have used our code for research purposes, please cite the publication mentioned above.
For the sake of simplicity, we provide the Bibtex format:@Article{Lapucci2022,
    author={Lapucci, Matteo and Mansueto, Pierluigi and Schoen, Fabio},
    title={A memetic procedure for global multi-objective optimization},
    journal={Mathematical Programming Computation},
    year={2022},
    month={Nov},
    day={22},
    issn={1867-2957},
    doi={10.1007/s12532-022-00231-3},
    url={https://doi.org/10.1007/s12532-022-00231-3}
}Main Dependenciespython v3.9pip v22.2.2numpy v1.22.3scipy v1.7.3matplotlibWindows:v3.5.3, Linux:v3.5.2, MacOSX:v3.6.1tensorflowWindows:v2.9.1, Linux:v2.8.2, MacOSX:v2.10.0gurobipy v9.5.2progressbar2 v4.2.0Gurobi OptimizerIn order to run some parts of the code, theGurobiOptimizer needs to be installed and, in addition, a valid Gurobi licence is required.
However, the employment of the Gurobi Optimizer is not mandatory to execute the code.
Indeed, we provide alternative scripts where the HiGHS dual simplex solver implementation bySciPyis used.UsageWe refer to the code documentation and the related GitHub repository for all the information.An usage example could be the following:importtensorflowastffromnsma.algorithms.memetic.nsmaimportNSMAfromnsma.problems.man.man_instanceimportMAN1fromnsma.general_utils.pareto_utilsimportpoints_initializationtf.compat.v1.disable_eager_execution()session=tf.compat.v1.Session()withsession.as_default():algorithm=NSMA(max_iter=None,max_time=2,max_f_evals=None,verbose=True,verbose_interspace=10,plot_pareto_front=True,plot_pareto_solutions=False,plot_dpi=100,pop_size=100,crossover_probability=0.9,crossover_eta=20,mutation_eta=20,shift=10,crowding_quantile=0.9,n_opt=5,FMOPG_max_iter=5,theta_for_stationarity=-1e-10,theta_tol=-1e-1,theta_dec_factor=10**(-0.5),gurobi=True,gurobi_method=1,gurobi_verbose=False,ALS_alpha_0=1,ALS_delta=0.5,ALS_beta=10**-4,ALS_min_alpha=1e-7)problem=MAN1(n=5)initial_p_list,initial_f_list,n_initial_points=points_initialization(problem,'hyper',5)p_list,f_list,elapsed_time=algorithm.search(initial_p_list,initial_f_list,problem)ContactIf you have any question, feel free to contact me:Pierluigi MansuetoGlobal Optimization Laboratory (GOL)University of FlorenceEmail: pierluigi dot mansueto at unifi dot it
Package: nsmpy
NsmPy Version 1.0.3: What's new and how do I use it?NsmPy is a big little python library designed to make scientific, mathematical, and numerical equations
easier to grasp. This module, as of this version (release 1.0.3) only contains one datatype - matricies.
(more will be comming soon hopefully.)InstallationNsmPy is availiable via the pip command. However, there is one other library needed - NumPy.
I highly recommend using NumPy version 1.16.1 because it is the most stable. Installing this
version will be covered in the installation steps.Install with:(mac/linux)#$ sudo pip uninstall numpy#$ sudo pip install numpy==1.16.1#$ sudo pip install nsmpy==1.0.2(PC)#C:> pip uninstall numpy#C:> pip install numpy==1.16.1#C:> pip install nsmpy==1.0.2What's new?This update does not add much to the library other than bug fixes.
datatype.Using the libraryThe NsmPy library offers lots of different features for the matrix datatype - you can run callbacks on the elements,
you can reshape matricies, and you can even treat the class like a list!First off, how do you create a matrix?
It's as simple as typingfromnsmpyimportmatrixx=matrix([1,2,3,4],shape=(2,2))Just like that we just created a 2x2 matrix! It's that simple!
We can also do matrix multiplication - a common mathematical practice when working with matricies. We can do this
with the following code:fromnsmpyimportmatrixx=matrix([2,3,4,5],shape=(2,2))y=matrix([3,4,5,6],shape=(2,2))z=x.matrix_mult(y)# matrix_mult(n) -> matrix()That's it!
When you actually compare this library to the NumPy library, you will see that it is a much better option for matricies.
Here is an example of defining matricies in both modules.
NumPy:mat=np.array([[2,2],[2,2]])NsmPy:mat = matrix([2,2,2,2],(2,2))As you can see, the NumPy version, while being excellent, just doesn't look as good as the NsmPy version. It also is less
efficient due to more typing being needed.Method documentationmatrix(array, shape)                  -> matrix
matrix.reshape(new_shape)             -> matrix{new shape}
matrix.flatten()                      -> matrix{new shape}
matrix.add_element(element,new_shape) -> matrix{el+1, new shape}
matrix.get_type()                     -> dtype
matrix.matrix_mult(b_mat,a_mat=None)  -> matrix{new shape, new values}
matrix.as_numpy_array()               -> np.array(matrix)
matrix.multiply(mat_b,mat_a=None)     -> matrix{new values, a_matrix shape}
matrix.convert_to_list()              -> list{matrix elements}
matrix.inverse()                      -> matrix{inverse elements}
matrix.generate_identity(r,c,start)   -> matrix{identity matrix}
matrix.run_function_on_elements(func) -> matrix{other elements}
matrix.convert_type(new_type)         -> matrix{new type}
matrix.shape                          -> shape
matrix.as_array                       -> array-type matrix
matrix.temp                           -> nothing to see here
matrix.type                           -> the current matrix type.Have fun!
Package: nsmr
# Navigation Simulator for Mobile Robot[![Python](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7-blue)](https://www.python.org)
[![Build Status](https://travis-ci.com/Jumpei-Arima/Navigation_Simulator_for_Mobile_Robot.svg?branch=master)](https://travis-ci.com/Jumpei-Arima/Navigation_Simulator_for_Mobile_Robot)
[![Coverage Status](https://coveralls.io/repos/github/Jumpei-Arima/Navigation_Simulator_for_Mobile_Robot/badge.svg?branch=master)](https://coveralls.io/github/Jumpei-Arima/Navigation_Simulator_for_Mobile_Robot?branch=master)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Jumpei-Arima/Navigation_Simulator_for_Mobile_Robot)![nsmr](assets/nsmr.gif)## Installation
NSMR can be installed by usingpip.` $ pip install nsmr `If installing from source code, execute the following commands.` $ git clonehttps://github.com/Jumpei-Arima/Navigation_Simulator_for_Mobile_Robot$ cd Navigation_Simulator_for_Mobile_Robot $ pip install-e. `For examples see example` python examples/run_env.py `