Saravanan666/pypi-org huggingface dataset:
Package: bqme
Bayesian Quantile Matching Estimation using Order StatisticsBQME is a package that allows users to fit a distribution to observed quantile data. The package uses Order Statistics as the noise model, which is more robust than e.g. Gaussian noise model (mean squared error). The paper describing the theory can be found on arxiv:https://arxiv.org/abs/2008.06423. The notebooks for the experiments in the paper are moved tohttps://github.com/RSNirwan/BQME_experiments.BQME generates stan-code that implements the matching and then uses stan'ssamplingandoptimizingfunctions for posterior samples and MAP estimate, respectively.InstallInstall latest release viapippipinstallbqmeFor latest development version clone the repository and install via pipgitclonehttps://github.com/RSNirwan/bqmecdbqme
pipinstall.Install with dev dependenciesgitclonehttps://github.com/RSNirwan/bqmecdbqme
pipinstall-e.[dev]if using ZSH, do the followingpip install -e ".[dev]"UsageHere, we fit a Normal distribution to observed quantile data using order statistics of the observed quantiles.
Note that the likelihood is not a Normal distribution, but the order statistics of the observed quantiles assuming the underlying distribution is a Normal.frombqme.distributionsimportNormal,Gammafrombqme.modelsimportNormalQMN,q,X=100,[0.25,0.5,0.75],[-0.1,0.3,0.8]# define priorsmu=Normal(0,1,name='mu')sigma=Gamma(1,1,name='sigma')# define likelihoodmodel=NormalQM(mu,sigma)# sample the posteriorfit=model.sampling(N,q,X)# extract posterior samplesmu_posterior=fit.musigma_posterior=fit.sigma# get stan sample objectstan_samples=fit.stan_obj# get pdf and cdf of x_newx_new=1.0pdf_x=fit.pdf(x_new)cdf_x=fit.cdf(x_new)# get percent point function of q_new (inverse of cdf)# default return values are samples from posterior predictive p(x|q)q_new=0.2ppf_q=fit.ppf(q_new)We can also look at the generated stan code and optimize the parameters (MAP) instead of sampling the posterior.frombqme.distributionsimportNormal,Gammafrombqme.modelsimportNormalQMmu=Normal(0,1,name='mu')sigma=Gamma(1,1,name='sigma')model=NormalQM(mu,sigma)# print generated stan codeprint(model.code)# optimizeN,q,X=100,[0.25,0.5,0.75],[-0.1,0.3,0.8]fit=model.optimizing(N,q,X)# extract optimized parametersmu_opt=fit.musigma_opt=fit.sigma# get pdf, cdf, ppfpdf_x=fit.pdf(1.1)cdf_x=fit.cdf(1.1)ppf_q=fit.ppf(0.2)Available prior distributions and likelihoodsdistributions/priors (import frombqme.distributions):Normal(mu:float, sigma:float, name:str)Gamma(alpha:float, beta:float, name:str)Lognormal(mu:float, sigma:float, name:str)Weibull(alpha:float, sigma:float, name:str)InvGamma...models/likelihoods (import frombqme.models):NormalQM(mu:distribution, sigma:distribution)GammaQM(alpha:distribution, beta:distribution)LognormalQM(mu:distribution, sigma:distribution)WeibullQM(alpha:distribution, sigma:distribution)InvGammaQM...Inputs to the models need to be distributions.Todosmake package available on PyPItag/release on githubgithub actions for testing on different os and versionsuse sphinx as documentation toolimplement fit.ppf(q), fit.cdf(x), fit.pdf(x), ...add Mixture-model
Package: bq-meta
BigQuery metadata"Inspect BigQuery metadata faster"Interactive CLIQuick search through available projects, datasets, tablesView up to date table's metadata and it's schemaLocal history of searched tablesRequirementspython >= 3.10fzf -https://github.com/junegunn/fzf(required)brewinstallfzfsearch through list of values (i.e. project, dataset, tables) is done usingfzfInstallationInstall as python package usingpypi, this will create executable in/usr/local/bin/bq-metapipinstallbq-metaInitializebq-metabq-meta--initFollow on screen promptscreate configurationlogin to the google account using browser (Account is separated fromgcloudcli)RunTo open interactive CLI, simply runbq-metaTable metadataTo view table metadata, pressokey and select through project, dataset, table.Table metadata can be refreshed, pressrto fetch fresh metadataIt's also possible to runbq-metadirectly withFULL_TABLE_IDbq-metabigquery-public-data:github_repos.commitsTable schemaOnce table metadata is opened, pressskey to view it's schemaOpen in consoleYou can open table in console.cloud.google.com by pressingckeySearch historyEvery viewed table is saved to the history. To search through history, presshkeyOtherUsage:python-mbq_meta[OPTIONS][FULL_TABLE_ID]BiqQuerymetadata

Options:--rawViewrawresponsefromtheBigQueryforspecific'FULL_TABLE_ID'--initInitialize'bq-meta'configuration--infoPrintinfoofcurrentlyusedaccount--fetch-projectsFetchavailablegoogleprojects--versionShowtheversionandexit.--helpShowthismessageandexit.
Package: bqpipe
A lightweight Python wrapper around the Google Cloud BigQuery and
Snowflake data platform APIs to simplify read and write
between Pandas DataFrames and BigQuery/Snowflake.FeaturesCreate new tables with specified schemaAppend DataFrames to existing tablesSimply read from tables or arbitrary SELECT statementsGet BigQuery metadata (datasets, tables, table schemas, etc.)DependenciesBQPipe supports Python 3.7+.Installation requiresNumPy,Pandas,Google-Cloud-BigQuery,Snowflake-Connector-Python,Snowflake-SQLAlchemy,
andCryptography.InstallationThe latest stable release (and older versions) can be
installed from PyPI:pip install bqpipeYou may instead want to use the development version from Github:pip install git+https://github.com/4mile/bqpipe.git#egg=bqpipeTestingComing SoonDevelopmentBQPipe development takes place onGitHub.Please submit any reproducible bugs you encounter to
theIssue Tracker.
Package: bqpjson
release:dev status:bqpjson is a minimalist python package for working with bqpjson data files, a json-based encoding of binary quadratic programs.  A detailed description of the bqpjson data format is availablehere.The package can be installed via:pip install bqpjsonThe bqpjson toolset includes:bqpjson- python tools for the validation and transformation of bqpjson data (documentation)bqpjson-schema.json- a JSON-Schema for bqpjson data filesspin2bool- a command line tool for converting a bqpjson data files between the spin and boolean variable spacesbqp2qh- a command line tool for converting bqpjson data files into qubist compatible hamiltoniansbqp2qubo- a command line tool for converting bqpjson data into qubo databqp2mzn- a command line tool for converting bqpjson data into a minizinc modelbqp2hfs- a command line tool for converting bqpjson data into hfs dataAn example of bqpjson data:{
  "description":"a simple model",
  "id": 0,
  "linear_terms": [
    {"coeff":  1.3, "id": 2},
    {"coeff": -0.7, "id": 6}
  ],
  "metadata": {},
  "offset": 0.0,
  "quadratic_terms": [
    {"coeff": -0.2, "id_head": 4, "id_tail": 2},
    {"coeff":  1.5, "id_head": 6, "id_tail": 2}
  ],
  "scale": 1.0,
  "variable_domain": "spin",
  "variable_ids": [2,4,6],
  "version": "1.0.0"
}Licensebqpjson is developed at Los Alamos National Laboratory and is provided under a BSD-ish license with a “modifications must be indicated” clause.  See theLICENSE.mdfile for the full text.  This package is part of the Hybrid Quantum-Classical Computing suite, known internally as LA-CC-16-032.Changelogstagednothingv0.5.3added scaling and offset return values to bqpjson_to_hfsv0.5.2improved bqp2hfs robustness to coefficient precision issuesdropped support for python 2.7 and 3.4v0.5.1added support for translation to the HFS data formatv0.5.0initial release
Package: bq-properties-creator
bq-properties-creatorPython code that creates properties files containing all BigQuery resourcesFree software: MIT licenseDocumentation:https://bq-properties-creator.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-03-19)First release on PyPI.
Package: bqqtest
BigQueryのクエリをテストするためのツールBigQueryへのクエリロジックのテストができますBasic UsageSimplefrombqqtestimportQueryTestfromgoogle.cloudimportbigquery# expectedexpected_schema=[{"name":"name","type":"STRING","mode":"NULLABLE"},{"name":"value","type":"INT64","mode":"NULLABLE"},]expected_datum=[["abc",100],["bbb",333]]expected={"schema":expected_schema,"datum":expected_datum}# actualtarget_schema=[{"name":"name","type":"STRING","mode":"NULLABLE"},{"name":"value","type":"INT64","mode":"NULLABLE"},]target_datum=[["abc",100],["bbb",333]]tables={"test.target_table":{"schema":target_schema,"datum":target_datum}}eval_query={"query":"SELECT * FROM test.target_table","params":[]}qt=QueryTest(bigquery.Client(),expected,tables,eval_query)success,diff=qt.run()success# TrueGroup ByfrombqqtestimportQueryTestfromgoogle.cloudimportbigquery# expectedexpected_schema=[{"name":"item","type":"STRING","mode":"NULLABLE"},{"name":"total","type":"INT64","mode":"NULLABLE"},]expected_datum=[["abc",300],["bbb",333]]expected={"schema":expected_schema,"datum":expected_datum}# actualtarget_schema=[{"name":"item","type":"STRING","mode":"NULLABLE"},{"name":"value","type":"INT64","mode":"NULLABLE"},]target_datum=[["abc",100],["bbb",333],["abc",200]]tables={"test.target_table":{"schema":target_schema,"datum":target_datum}}eval_query={"query":"SELECT item, SUM(value) AS total FROM test.target_table GROUP BY item","params":[],}qt=QueryTest(bigquery.Client(),expected,tables,eval_query)success,diff=qt.run()success# TrueMulti TablefrombqqtestimportQueryTestfromgoogle.cloudimportbigquery# expectedexpected_schema=[{"name":"item","type":"STRING","mode":"NULLABLE"},{"name":"value","type":"INT64","mode":"NULLABLE"},]expected_datum=[["abc",100],["bbb",333],["xxxx",888],["zzzz",999]]expected={"schema":expected_schema,"datum":expected_datum}# actualtarget_schema=[{"name":"item","type":"STRING","mode":"NULLABLE"},{"name":"value","type":"INT64","mode":"NULLABLE"},]target_datum1=[["abc",100],["bbb",333]]target_datum2=[["xxxx",888],["zzzz",999]]tables={"test.table1":{"schema":target_schema,"datum":target_datum1},"test.table2":{"schema":target_schema,"datum":target_datum2},}eval_query={"query":"SELECT * FROM `test.table1` UNION ALL SELECT * FROM `test.table2`","params":[],}qt=QueryTest(bigquery.Client(),expected,tables,eval_query)success,diff=qt.run()success# True特徴see alsohttps://qiita.com/tamanobi/items/9434ca0dbd5f0d3018d9WITH を利用して、 BigQuery に保存されないテストデータを一時的に生成します。BigQuery は保存されているデータ走査した量とAPIリクエスト数で課金されるため、費用抑えてユニットテストができます。料金の詳細は、 BigQuery の公式ドキュメントを参照してくださいテストをするために、クエリを書き直す必要はありませんライブラリ内部では、対象テーブルの Identifier を書き換えてテーブルを差し替えます注意BigQuery へ直接クエリを発行します。
Package: bqrepl
BQ REPLREPL for BigQueryCommandsCommands:
\?, \h, \help                         Print this stuff
\d, \datasets [PROJECT]               List datasets in current project (or another project)
\p, \projects [PROJECT]               List projects
                                      Will switch projects when provided as parameter
\t, \tables [PROJECT.]DATASET         List tables in a dataset
\c, \columns [PROJECT.]DATASET.TABLE  List columns in a table
\x, \expanded                         Toggle expanded view on/off.
                                      Shorthand for \set expanded BOOL
\clear, clear                         Clear screen


Options:
\set VARIABLE VALUE                   
Available options:
    - project PROJECT_ID              Set current project to PROJECT_ID
    - maxrows INT                     Maximum rows displayed (default=100)
    - maxwidth INT                    Maximum column width in non-expanded view (default=50)
    - max_expanded_width INT          Maximum column width in expanded view (default=100)
    - expanded BOOL                   Expanded view (default=False)
    - format_integer STR              Integer display format (default=",d")
    - format_float STR                Float display format (default=",.4f")Command line arguments$ bqrepl --help
Usage: bqrepl [OPTIONS]

  REPL for BigQuery

Options:
  -c, --credentials-file TEXT  path to credentials .json
  -p, --project TEXT           Use specific project instead of inferring from
                               credentials

  --help                       Show this message and exit.Installation$pipinstallbqreplDependenciesPython dependencies:google-cloud-bigquerypytzclickprompt-toolkitlogzeropydata-google-authrequestsTasksStuff to implement, in no particular order:Essentialsnice looking resultsquery executiontoggle numbers formatting on/offstring truncation (aka max column width)expanded outputswitch GCP projects during sessionnicer looking errors/warningsmultiline queriesmultiline results in cellssome kind of authentication flow if there's no service account providedpersist query history in local databasequery result pagination or whatever is required to keep # results saneCommand line arguments:service-accountprojectexecute SQL from command linecode completion:BQ-specific SQL syntaxprojects/datasets/tables/columns available in the query contextBQ commandsBQ commandslist projectslist datasetslist tableslist datasets in a specific projectlist columnsshow info about dataset/table/view/modelfilter listcopy tablesextract (table to bucket)insert rows to table (from local file)create datasetcreate tableExtrascolour-coding nullscolour-coding floats/integers/strings/dates (do I even need this?)recall cached query results instead of running them againview results in a horizontally scrollable table (like pgcli)project/dataset treeuse tabs for query results?async queriesclear screen? help command
Package: bqrun
bqrun概要ディレクトリの中にあるsqlファイルを全て読み、依存関係を解析し（あるファイルAでselect .. fromされているテーブルが別のファイルBでcreate tableされていた場合、
BはAより前に実行される）、順番に実行するためのMakefileを作成、makeを実行する。外部依存dockergraphviz（dotコマンド）インストールpip install bqrun前提1つのディレクトリの中に全てのSQLファイルが入っていること全てのSQLファイルは拡張子.sqlを持つこと、かつ、クエリ以外に.sqlで終わるファイルがないこと大まかな動作全SQLファイルを読んで依存関係を解析、依存関係に従ったMakefileを作成するこのMakefileにより、各ファイルに対し以下のようなコマンドが実行される各SQLファイルをbq queryに投げるdone.<base name>というファイルを作成する(<base name>は、ファイル名の拡張子以外)2回目以降の実行では、各ファイルについてdone.<base name>ファイルのタイムスタンプと、依存先のファイルのタイムスタンプを比較し再実行が必要な部分だけが実行されるオプション-p=<num>または--parallel=<num>: 並列実行数を指定（デフォルトは8）
Package: bqscales
bqscalesGrammar of Graphics in Python for bqplot and other Jupyter widgets librariesInstallationYou can install usingpip:pipinstallbqscalesOr usingconda/mamba:mambainstall-cconda-forgebqscalesDevelopmentSee ourcontributing guidelinesto know how to contribute and set up a development environment.LicenseThis software is licensed under the Apache 2.0 license. See theLICENSEfile for details.
Package: bqsensorgen
bqsensorgenA sensor generator for your BigQuery queries.sensor_generator(query str, desired_pattern str, timezone str)

Args
        
1. query_text (str): A .sql file;
                          
	Example: 'SELECT * FROM x.y.z'
            
2. desired_pattern (str): RegEx string containing the desired pattern to look for. Default is BigQuery Pattern.
        
	Example: ".*\..*\..*" (looks for 'project.dataset.table' pattern)
                                           
3. timezone (str): A timezone for the datetime column of the sensor query (Big Query default is UTC)
        
	Example: 'America/Sao_Paulo'

Returns:
	str : A text with the complete sensor query.
	list: A list with all the sources (project.dataset.table) found.


--------------------------------------------------------------------	

Example: sensor_generator(query_text="SELECT * FROM x.y.z", desired_pattern=".*\..*\..*", timezone="America/Sao_Paulo")How does it work?You give it a text with your BigQuery query, and it'll spit out a BigQuery sensor query that hopefully can be checked as true or false.It automatically detects 'source' tables from your query and builds a sensor based on the last updated metadata from that table (BigQuery
gives out metadata base on the dataset the table is from, hence the usage of this simple library). It is
easily editable as well, so you can quickly change what you want from its returned text.Examplesfrom bqsensorgen.sensorgen import sensor_generator

query = """
	SELECT * 
	FROM my_project.my_dataset.my_table T1
	INNER JOIN my_project.my_dataset.my_other_table T2
	ON T1.A = T2.B
"""

sensor_query, sources = sensor_generator(query)

print(sensor_query)
print(sources)Why BigQuery?Because BigQuery uses the following pattern for its tables:<project>.<dataset>.<table>and you can only see a table's metadata through that table's dataset's metadata.If you somehow want a different pattern, you can pass a RegEx expression through the arguments.Who should use it?Composer/Airflow users will find it most useful, specially when using sensor Operators.
Package: bqskit
Berkeley Quantum Synthesis Toolkit (BQSKit)The Berkeley Quantum Synthesis Toolkit (BQSKit) [bis • kit] is a powerful
and portable quantum compiler framework. It can be used with ease to compile
quantum programs to efficient physical circuits for any QPU.InstallationBQSKit is available for Python 3.8+ on Linux, macOS, and Windows. BQSKit
and its dependencies are listed on thePython Package Index,
and as such, pip can easily install it:pipinstallbqskitBasic UsageA standard BQSKit workflow loads a program into the framework, models the
target QPU, compiles the program, and exports the resulting circuit. The
below example uses BQSKit to optimize an input circuit provided by a qasm
file:frombqskitimportcompile,Circuit# Load a circuit from QASMcircuit=Circuit.from_file("input.qasm")# Compile the circuitcompiled_circuit=compile(circuit)# Save output as QASMcompiled_circuit.save("output.qasm")To learn more about BQSKit, follow thetutorial seriesor refer to
thedocumentation.How to CiteYou can use thesoftware disclosureto cite the BQSKit package.Additionally, if you used or extended a specific algorithm, you should cite
that individually. BQSKit passes will include a relevant reference in
their documentation.LicenseThe software in this repository is licensed under aBSD free software
licenseand can be used in source or binary form for any purpose as long
as the simple licensing requirements are followed. See theLICENSEfile
for more information.CopyrightBerkeley Quantum Synthesis Toolkit (BQSKit) Copyright (c) 2021,
The Regents of the University of California, through Lawrence
Berkeley National Laboratory (subject to receipt of any required
approvals from the U.S. Dept. of Energy) and Massachusetts
Institute of Technology (MIT).  All rights reserved.If you have questions about your rights to use or distribute this software,
please contact Berkeley Lab's Intellectual Property Office atIPO@lbl.gov.NOTICE.  This Software was developed under funding from the U.S. Department
of Energy and the U.S. Government consequently retains certain rights.  As
such, the U.S. Government has been granted for itself and others acting on
its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the
Software to reproduce, distribute copies to the public, prepare derivative
works, and perform publicly and display publicly, and to permit others to
do so.
Package: bqskit-qfactor-jax
QFactor implementation on GPUs using JAXbqskit-qfactor-jaxis a Python package that implements circuit instantiation withQFactoron GPUs to accelerateBQSKit. It usesJAXas an abstraction layer of the GPUs, seamlessly utilizing JIT compilation and GPU parallelism.Installationbqskit-qfactor-jaxis available for Python 3.8+ on Linux.First, install JAX with GPU support, you may refer to JAX'sinstallation instructions.Next, install this package with pip:pipinstallbqskit-qfactor-jaxRunning bqskit-qfactor-jaxPlease set the environment variable XLA_PYTHON_CLIENT_PREALLOCATE=False when using this package.Please take a look at theexamplesto see some basic usage.When using several workers on the same GPU, we recommend usingNvidia's MPS. You may initiate it using the command linenvidia-cuda-mps-control-dYou can disable it by running this command line:echoquit|nvidia-cuda-mps-controlReferencesKukliansky, Alon, et al. "QFactor:A Domain-Specific Optimizer for Quantum Circuit Instantiation." arXiv preprintarXiv:2306.08152(2023).LicenseThe software in this repository is licensed under aBSD free software
licenseand can be used in source or binary form for any purpose as long
as the simple licensing requirements are followed. See theLICENSEfile
for more information.CopyrightQuantum Fast Circuit Optimizer (QFactor) JAX implementation Copyright (c) 2023,
U.S. Federal Government and the Government of Israel. All rights reserved.
Package: bqskitrs
Native code for BQSKitbqskitrsis a Python package that implements circuit instantiation and simulation to accelerateBQSKit.Installing bqskitrsYou can often installbqskitrsvia PyPi withpip:pip install bqskitrsthis will use pre-built wheels. Sometimes wheels are not available, so you must build from source.Building bqskitrsLinuxIt's best to build and install the manylinux version with the provided
docker container:gitclonehttps://github.com/BQSKit/bqskitrs.git--recursivecdbqskitrs
dockerrun-eOPENBLAS_ARGS="DYNAMIC_ARCH=1"--rm-v$(pwd):/ioedyounis/bqskitrs-manylinux:1.1build--release--features=openblas--compatibility=manylinux2014
pipinstall--no-index--find-links=target/wheelsbqskitrsMacOSMake sure the version of pip you have is at least 20.0.2.
You can check viapip -Vand upgrade viapython3 -m pip install -U pip.First, install the dependencies. We use homebrew here, which is what we build the official package against.brew install gcc ceres-solver eigen lapackOnce that is complete you should then install Rust like as follows:curlhttps://sh.rustup.rs-sSf|sh-s---yThen clone and enter enter thebqskitrsdirectory:gitclonehttps://github.com/BQSKit/bqskitrs.git--recursivecdbqskitrsThen build the wheel (package file) withmaturin:pipinstall-Usetuptoolswheelmaturin
maturinbuild--features="accelerate"--releaseIf you encounter issues on an intel x86 Mac computer with a message like "rust failed to run custom build command for cxx', you may need to run the following build command instead:MACOSX_DEPLOYMENT_TARGET=11.0maturinbuild--features="accelerate"Finally install the wheel that you built:pipinstall--no-index--find-links=target/wheelsbqskitrsOnce it is done installing the wheel, verify that the installation succeeded by runningpython3 -c 'import bqskitrs'It should not print anything out nor give any error.WindowsMake sure the version of pip you have is at least 20.0.2.
You can check viapip -Vand upgrade viapython3 -m pip install -U pip.Download and install rust via the installer found athttps://rustup.rs/. Accept all of the defaults.Close your shell and open a new one (this updates the enviroment).Then installcargo-vcpkg, which will help install dependencies for us. You can install it viacargoinstallcargo-vcpkgcargois installed with Rust so this should "just work".Then clone and enter enter thebqskitrsdirectory:gitclonehttps://github.com/BQSKit/bqskitrs.git--recursivecdbqskitrsThen build the dependencies with vcpkg.cargovcpkgbuildThis will take quite a while.Then build the wheel (package file) withmaturin:python-mpipinstallmaturin
python-mmaturinbuild--interpreter$(whichpython)--features="openblas,openblas-src/system"--releaseFinally install the wheel that you built:pipinstall--no-index--find-links=target/wheelsbqskitrsOnce it is done installing the wheel, verify that the installation succeeded by runningpython3 -c 'import bqskitrs'It should not print anything out nor give any error.
Package: bqspec
SQL testing tool for Google BigQuery.this library is pre-alpha. not recommended to production use.Getting Startedpipinstallbqspecgcloudauthapplication-defaultloginHow to Usespec.yaml# test target SQL filepathquery_path:./sample.sql# any BigQuery query parameters (optional). more details: https://cloud.google.com/bigquery/docs/parameterized-queriesparams:-type:DATEname:datevalue:2017-11-30# known columns (optional).columns:-id-a-b-c-total# conditions which all rows must met (optional).invariants:-total >= 0# write python expression-a + b == c# any test casescases:-where:-id == 1expected:-total == 15-a == 2-b == 3-c == 5bqspec-fspec.yamlorbqspec-d.Author@orisano (Nao YONASHIRO)LicenseMIT