Saravanan666/pypi-org huggingface dataset:
Package: shangjian-api
shangjian_api安装python-mpipinstallshangjian_api用法AirWorks Api基础用法importjsonfromshangjian_api.airworks.package_apiimportAirWorksApiawp=AirWorksApi(base_url="api.airworks.shangjian.tech:30000",access_key="xxx",access_secret="xxx",default_app_id=1,default_api_method="GET",default_page_num=1,default_page_size=100)res=awp.call(app_url="api_gateway/api/1/daily",port_code='',date='',api_method="GET")print(json.dumps(res,indent=2,ensure_ascii=False))使用本地配置文件时importjsonfromshangjian_api.airworks.package_apiimportAirWorksApiawp=AirWorksApi(default_app_id=1,default_api_method="GET",default_page_num=1,default_page_size=100)使用api别名作为函数名来调用res=awp.daily(app_id=1,port_code='',date='',api_method="GET")print(json.dumps(res,indent=2,ensure_ascii=False))KM Apifromshangjian_api.km.base_apiimportget_indicator_valuesindicator_ids=["all_indexpv_chain_rank_app_by_week_all"]result=get_indicator_values(indicator_ids)print(result)配置文件内容文件路径: 包安装路径下名为 sdk_config.toml 的文件, 例如
/usr/lib/python3.8/site-packages/shangjian_api-0.0.2-py3.8.egg/shangjian_api/sdk_config.toml
内容如下title="sdk config"[km][km.indicator]#host = "localhost:8888"host=""username=""password=""# airworks[airworks][airworks.api]#host = "localhost:8888"host=""access_key=""access_secret=""开发可将包内代码复制,并修改顶级包名,可新增功能,但需要在理解逻辑的前提下修改现有代码release log20211028km get_indicator_values 接口返回值有序20210826添加支持本地配置文件功能支持顶级包名可变
Package: shanhe-sdk
This repository allows you to accessShanHeand control your resources from your applications.This SDK is licensed underApache Licence, Version 2.0.NoteRequires Python 2.6 or higher, compatible with Python 3,
for more information please seeShanHe SDK DocumentationInstallationInstall viapip$ pip install shanhe-sdkUpgrade to the latest version$ pip install --upgrade shanhe-sdkInstall from sourcegit clone https://github.com/yunify/shanhe-sdk-python.git
cd shanhe-sdk-python
python setup.py installGetting StartedIn order to operate shanhe IaaS or OIS (Object Intelligent Storage),
you need applyaccess keyonshanhe consolefirst.QingCloud IaaS APIPass access key id and secret key into methodconnect_to_zoneto create connection>>> import shanhe.iaas
>>> conn = shanhe.iaas.connect_to_zone(
        'zone id',
        'access key id',
        'secret access key'
    )Call API by using IAM roleIf you would like to call our APIs without access key and secret key (bad things would happen if they were lost or leaked)
or if you want a finer access control over your instances, there is a easy way to do it :PGo to our IAM service, create an instance role and attach it to your instance.Create connection without access key and secret key.>>> import shanhe.iaas
>>> conn = shanhe.iaas.connect_to_zone(
      'zone id',
       None,
       None
    )The variableconnis the instance ofshanhe.iaas.connection.APIConnection,
we can use it to call resource related methods. Example:# launch instances
>>> ret = conn.run_instances(
        image_id='img-xxxxxxxx',
        cpu=1,
        memory=1024,
        vxnets=['vxnet-0'],
        login_mode='passwd',
        login_passwd='Passw0rd@()'
    )

# stop instances
>>> ret = conn.stop_instances(
        instances=['i-xxxxxxxx'],
        force=True
      )

# describe instances
>>> ret = conn.describe_instances(
        status=['running', 'stopped']
      )shanhe OIS APIPass access key id and secret key into methodconnectto create connection>>> import shanhe.ois
>>> conn = shanhe.ois.connect(
        'jn1.is.shanhe.com',
        'access key id',
        'secret access key'
    )The variableconnis the instance ofshanhe.ois.connection.QSConnection,
we can use it to create Bucket which is used for generating Key and MultiPartUpload.Example:# Create a bucket
>>> bucket = conn.create_bucket('mybucket')

# Create a key
>>> key = bucket.new_key('myobject')
>>> with open('/tmp/myfile') as f:
>>>     key.send_file(f)

# Delete the key
>>> bucket.delete_key('myobject')
Package: shannonca
SCA (Shannon Components Analysis)Shannon Component Analysis (SCA) is a dimensionality reduction technique for single-cell data which leverages mathematical information theory to identify biologically informative axes of variation in single-cell transcriptomic data, enabling recovery of rare and common cell types at superior resolution. It is written in Python. The pre-print can be foundhere.For full documentation of shannonca's API, see ourReadthedocs page.InstallationSCA is available via pip:pip install shannoncaDependenciesSCA requires the following packages:sklearnscipynumpymatplotlibpandasseabornscanpyfbpcaUsageDimensionality ReductionSCA generates information score matrices, which are used to generate linear combinations of genes (metagenes) that are biologically informative. The package includes workflows both with and without Scanpy undersca.dimred.Without ScanpyThereducefunction accepts a (num genes) x (num cells) matrix X, and outputs a dimensionality-reduced version with fewer features. The input matrix may be normalized or otherwise processed, but a zero in the input matrix must indicate zero recorded transcripts.from shannonca.dimred import reduce

X = mmread('mydata.mtx').transpose() # read some dataset

reduction = reduce(X, n_comps=50, n_pcs=50, iters=1, nbhd_size=15, metric='euclidean', model='wilcoxon', chunk_size=1000, n_tests='auto')reductionis an (num cells) x (n_comps)-dimensional matrix. The function optionally returns SCA's score matrix (if keep_scores=True), metagene loadings (if keep_loadings=True), or intermediate results (if iters>1 and keep_all_iters=True). If at least one of these is returned, the return type is a dictionary with keys for 'reduction', 'scores', and 'loadings'. If keep_all_iters=True, the reductions after each iteration will be keyed by 'reduction_i' for each iteration number i.Starting neighborhoods are computed by default using Euclidean distance (controlled bymetric) inn_comps-dimensional PCA space. See the docstring for more detailed and comprehensive parameter descriptions.With ScanpyScanpy (https://github.com/theislab/scanpy) is a commonly-used single-cell workflow. To compute a reduction in place on a scanpy AnnData object, usereduce_scanpy:import scanpy as sc
from shannonca.dimred import reduce_scanpy

adata = sc.AnnData(X)
reduce_scanpy(adata, keep_scores=True, keep_loadings=True, keep_all_iters=True, layer=None, key_added='sca', iters=1, n_comps=50)This function shares all parameters withreduce, but instead of returning the reduction, it updates the input AnnData object. Dimensionality reductions are stored inadata.obsm[key_added], or, if keep_all_iters=True, inadata.obsm['key_added_i']for each iteration number i. Ifkeep_scores=Truein the reducer constructor, the information scores of each gene in each cell are stored inadata.layers[key_added_score]. Iflayer=None, the algorithm is run onadata.X; otherwise, it is run onadata.layers[layer].
Package: shannon-fano
Shannon FanoA small practice library created as a project to encode an image.Installationpip install shannon-fanoHow to use this?This library returns the shannon fano code words of the image.from shannon_fano import Shannon_fano_encoding

# enter the image name as <name of the image.extension>

image_name = Shannon_fano_encoding(input("Enter the Filename:"))
print(image_name.encode())
Package: shanten-tools
shanten-toolsFast calculation of shanten numbers in Japanese Mahjong.Usage>>> from shanten_tools import shanten
>>> import numpy as np
>>> hand = np.array([
>>>     3,1,1,1,1,1,1,1,3,
>>>     0,0,0,0,0,0,0,0,0,
>>>     0,0,0,0,0,0,0,0,0,
>>>     0,0,0,0,0,0,0], dtype=np.uint8)
>>> shanten(hand)
1
>>> hand = np.array([
>>>     3,1,1,1,1,1,1,1,3,
>>>     0,0,0,0,0,0,0,0,0,
>>>     0,0,0,0,0,0,0,0,0,
>>>     0,0,0,0,0,0,1], dtype=np.uint8)
>>> shanten_discard(hand)
array([2,1,2,2,1,2,2,1,2,
       0,0,0,0,0,0,0,0,0,
       0,0,0,0,0,0,0,0,0,
       0,0,0,0,0,0,1], dtype=uint64)Notesshanten number+1is output
Package: shantenx
shantenx麻雀におけるシャンテン数の計算を提供します.featuresmax_fanslimit枚以下の牌の入れ替えにより, 最大何翻の聴牌が作れるかを返します.引数名概要e.g.defaultpure純手牌['1m','1m','1m','2m','3m','4m','5m']furo副露['123m','666s','1111m','3__3z']limit0,1,2, ...doraドラ['1m', '1m', '6z']bakaze場風'1z','2z','3z','4z'jikaze自風'1z','2z','3z','4z'red_manzu赤5萬の有無True,FalseFalsered_pinzu赤5筒の有無True,FalseFalsered_souzu赤5索の有無True,FalseFalse以下の役満を考慮します.ダブル役満 (26翻)大四喜純正九蓮宝燈役満 (13翻)国士無双四槓子四暗刻大三元小四喜字一色清老頭緑一色九蓮宝燈これらを含まない場合, 以下の通常役を考慮します. ただし13翻以上の場合は 13翻を返します.ドラ赤ドラ断么混老頭清一色混一色自摸立直 (TODO)三槓子小三元七対子対々和三暗刻平和役牌一盃口二盃口純チャンチャンタ一気通貫三色同順三色同刻Examplesimportshantenxassert(shantenx.max_fans(pure=['1m','1m','1m','2m','3m','4m','5m','6m','7m','8m','9m','9m','9m'],furo=[],limit=0,dora=[],jikaze='1z',bakaze='2z')==26)Verifypython3pytest/test.py-tpytest/resources/shanten-online-testcases.json
Package: shanx-framework
Cookiecuttertemplate for Python Framework.Source Code:https://github.com/sp-95/python-frameworkDocumentation:https://sp-95.github.io/python-framework/Bug Reports:https://github.com/sp-95/python-framework/issuesFeaturespoetry: Dependency ManagementEditor Config: Maintains Code Consistencyflake8: Lintingblackandisort: Code Formattingmypy: Type Hintingpre_commit_hooks: Git hooksfire: Command-line Interfaceloguru: Loggingdynaconf: Configuration Managementpytestandcoverage: Python Testing and Code CoverageTox: Automated and Standardized testingSphinx: Generates documents automaticallyGitHub Actions: Continuous IntegrationGitHub Pages: Documentation HostingPyPi: Auto-deploy when you make a release (optional)GitHub issue templatesQuickstartInstall the latest framework for Python if you haven’t installed it yet$pipinstall-Upython-frameworkInitialize your project$shanx-pyinitCreate a repo and put it there.Generate the docs by pushing your first commit to master.Deploy your package toPyPiby pushing a tag and creating a release.For more details, see thepython-framework tutorial.AcknowledgmentThis package is a modified duplicate of theaudreyr/cookiecutter-pypackageproject template
Package: shape
shapeis a Python package for 2D shapes handling.Featuresobjects:abstract shapepointpolygonbounding boxrotated bounding boxellipserelations: intersection, closenessmanipulation: move and rotatevisualization using matplotlibInstallationpip install shapeDocumentationSee tests for now.Alternativeshttps://github.com/varunagrawal/bboxbounding box onlylightweighthttps://github.com/shapely/shapelycomplexbased on C++ GEOS library
Package: shape2geosparql
shape2geosparqlA library for converting shapefiles to GeoSPARQL.InstallTheGDALlibrary should already be installed on the system. On Fedora:$sudoyuminstallgdal-develOn other systems:Ubuntu:https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html#install-gdal-ogrWindows:https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windowsYou only need to install the core library, as the Python bindings will be installed withshape2geosparql.Once GDAL is installed:$python3-mvenvvenv
$sourcevenv/bin/activate
$pipinstallshape2geosparqlShould there be any problems in installing theGDALPython library, try to run this first:$pipinstallgdal==$(gdal-config--version)or insert the GDAL version number in place of$(gdal-config --version).UsageDownload and extract a shapefile, for example from:https://dati.trentino.it/dataset/stazioni-treno-open-datahttps://hifld-geoplatform.opendata.arcgis.com/datasets/american-red-cross-chapter-facilitiesThen, frompython,IPythonorJupyter:fromshape2geosparqlimportconvertconverter=convert('FILENAME.shp')print(converter.write().decode())You can also run theshape2geosparqlcommand:$shape2geosparqlFILENAME.shp
Package: shapeandshare-dicebox-core
Dicebox Core LibrariesCore libraries for the Dicebox API platform.Notesrun_unit_tests.sh created to wrap python unit test runner.RequirementsPython Module RequirementsThe requirements can be automatically installed using the below command:pip install -r requirements.txtReferencesMatt Harveythank you, for without you Dicebox would not be.  Much of the current implementation of dicebox comes from Matt's project below.  I originally forked Matt's work and used it until it outgrew what it was.Blog Post&CodeProjects that I worked with heavily during prior implementations of diceboxTensorflow & the 'slim' samplesTensorflow modelsEasyTensorflowAdditional projects used here, or where reference material for DiceboxD20 Roll Fairness Evaluation |Blog Post&CodeKeras |Site&CodeJPG-and-PNG-to-MNISTContributingFork the repository on GithubCreate a named feature branch (likeadd_component_x)Write your changeWrite tests for your change (if applicable)Run the tests, ensuring they all passSubmit a Pull Request using GithubLicense and AuthorsMIT LicenseCopyright (c) 2017-2021 Joshua C. BurtPermission 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: shapeandshare-fingerprint-dataset
Generates File Hash ReportsA simple utility to generate hash reports.Exampleimportloggingfromshapeandshare.fingerprint.datasetimportDataSetif__name__=="__main__":logging.basicConfig(level=logging.INFO)data_set:DataSet=DataSet(name="dataset",search_path=".")data_set.hash()data_set.generate_dataframe()
Package: shape-calculator
practice-problem1The following packages exist to practice object-oriented programming, collaborative development, and generalized programming. This package will allow you to practice using Docstring, unit testing, and package design. This package basically just contains a Python class to compute arithmetic operations.  You will use this class to practice your Python skills. The tasks you need to solve will be given to you by the package manager.How to installRunpip install -U https://github.com/joonyeobjeon/practice-problem1.gitRun cd practice-problem1(Optional) If you do not have poetry installed, runmake poetry-installRunmake installHow to run in cliSimply runmake cliYou can use thepracticepackage now.
Package: shapecms
Shape CMSShape CMS is a composable content management system that plugs into your Python project giving you full freedom in building sites.
It comes with an admin panel that builds itself based on the data models you create while leaving everything else up to you.Shape CMS leverages the Flask framework under-the-hood, so you also get the full power of Flask when building apps with Shape CMS.Note:There's no stable release yet, so documentation is subject to change, and I would not recommend running it in production.InstallationpipinstallshapecmsExample appA minimal example looks like this:fromshapecmsimportShapeCMSfromshapecmsimportPageViewclassHomeView(PageView):defget(self):return"Hello, world."shape=ShapeCMS(__name__,"sqlite:///demo.db")shape.add_url("/",HomeView,"home")defcreate_app():instance=shape.start()instance.secret_key="super-secret-key"returninstanceThe admin panel is automatically available at the/adminpath. If it's your first time going to the admin panel, it will guide you through a set-up process.Note however that until you add any Content Shapes the admin panel will be empty as it will have no info on how to construct itself.Adding Content ShapesTo be written.
Package: shape-commentator
Shape CommentatorAboutYou can easily add numpy.ndarray.shape, torch.Size, other shape and type information at runtime to your script code as comments.NumPyやPyTorchなどの配列のshape属性や，変数の型の実行時の情報を，スクリプトにコメントとして貼り付けるツールです．Installpip install -U shape_commentator-U means upgrading.UsageThis tool has two types of usage.このツールには2つの使い方があります．Usage 1. Execute this as a ModuleCreate Commented ScriptRun this script as a module with argument of script name.  Command line arguments to the target script are available.Pythonのモジュールとしてshape_commentatorを実行してください．引数は，スクリプト名の後にスクリプトに渡したい引数を続けることもできます．python-mshape_commentatorsrc.pypython-mshape_commentatorsrc.pyarg1arg2arg3You get the commented script. For example, you execute shape_commentator tosrc.py, you getsrc.py.commented.py.src.pyというスクリプトに対して実行すると，src.py.commented.pyが生成されます．src.pyimportnumpyasnpa=np.array([1,2,3,4,5,6])b=np.array([0,1,2,3,4,5])ab_h=np.hstack((a,b))ab_v=np.vstack((a,b))ab=np.dot(a,b)AA,BB=np.meshgrid(a,b)i=1f=1.0c=1+1js="string1"classA():passa=A()src.py.commented.pyimportnumpyasnpa=np.array([1,2,3,4,5,6])#_ (6,)b=np.array([0,1,2,3,4,5])#_ (6,)ab_h=np.hstack((a,b))#_ (12,)ab_v=np.vstack((a,b))#_ (2, 6)ab=np.dot(a,b)#_ ()AA,BB=np.meshgrid(a,b)#_ [(6, 6),(6, 6),]i=1#_ intf=1.0#_ floatc=1+1j#_ complexs="string1"#_ strclassA():passa=A()#_ AUsage 2. IPython / Jupyter Notebook (Magic Command)To use IPython / Jupyter Notebook magic command,IPythonやJupyter Notebookでのマジックコマンドの使い方importshape_commentatorCreate Commented Scriptコメントを付ける%%shapea=np.array([1,2,3,4,5,6])outputa = np.array([1,2,3,4,5,6])  #_ (6,)Delete Commentsコメントを消す%%shape-da=np.array([1,2,3,4,5,6])#_ (6,)outputa = np.array([1,2,3,4,5,6])Tested Python VersionTest scripts are written in these version of Python.以下のバージョンがテストされています．3.11.33.10.113.9.163.8.163.7.163.6.153.5.102.7.17Blog作った経緯などを書いた解説ブログはこちらにあります．NumPyやPyTorchで使える超便利ツールを作った
Package: shaped
Shaped CLICLI for interactions with the Shaped API.Installing the Shaped CLIpip install shapedInitializeshaped init --api-key <API_KEY>Model APICreate Model (File)shaped create-model --file <PATH_TO_FILE>Create Model (STDIN)cat $(PATH_TO_FILE) | shaped create-modelList Modelsshaped list-modelsView Modelshaped view-model --model-name <MODEL_NAME>Delete Modelshaped delete-model --model-name <MODEL_NAME>Dataset APICreate Datasetshaped create-dataset --file <PATH_TO_FILE>List Datasetsshaped list-datasetsDataset Insertshaped dataset-insert --dataset-name <DATASET_NAME> --file <DATAFRAME_FILE> --type <FILE_TYPE>Delete datasetshaped delete-dataset --dataset-name <DATASET_NAME>Rank APIRankshaped rank --model-name <MODEL_NAME> --user-id <USER_ID>Similar Itemsshaped similar --model-name <MODEL_NAME> --item-id <ITEM_ID>Similar Usersshaped similar --model-name <MODEL_NAME> --user-id <USER_ID>DevelopmentInstalling the Shaped CLI from Test PyPIUpon all pushes to main branch, a new version of the CLI is published to Test PyPI. To install the latest version of the CLI from Test PyPI, run the following commands:condacreate-ncli-devpython=3.9
condaactivatecli-devexportPACKAGE_VERSION={}# Specify the version you want to installpipinstall--extra-index-urlhttps://test.pypi.org/simple/shaped-cli==$PACKAGE_VERSIONReleasing a new CLI version to PyPITo release a new version of the CLI to PyPI, open a PR changing the version of the package insetup.py, followingSemantic Versioningprinciples, e.g.0.1.1.CircleCI will generate an approval prompt when this branch is merged to main, and upon approval will publish to PyPI.
Package: shape-detection-jdla
Color ThiefA module for detecting shapes using OpenCV.Installationpipinstallshape-detection-jdlaOverviewSquare detection rules:There must be four cornersAll four lines must be the same lengthAll four corners must be 90°Lines AB and CD must be horizontal linesLines AC and BC must be vertical linesThe contour must be concaveExamplefromshape_detection.squareimportSquareimportnumpyasnptry:contour=np.array([[[368,160]],[[391,163]],[[384,200]],[[361,194]]])square=Square.is_square(contour)print(square)exceptExceptionase:print(e)Linksgithub
Package: shapedetector
Shape detector with YOLOv5 🚀This Package contains YOLOv5 model which has been trained over dataset of shapes (containing two classes of polygons and ellipse), model is capable of detecting two classes and counting the number of each class in a given imageWhat is YOLOv5?YOLOv5 🚀 is a family of compound-scaled object detection models trained on the COCO dataset, and includes simple functionality for Test Time Augmentation (TTA), model ensembling, hyperparameter evolution, and export to ONNX, CoreML and TFLite.Data Set Structure 💻:For this model I used about 700 images containing different number of ellipses and polygons which all has been labeled manually, down below you can find some of the images which used for training:YOLOv5 Advantages? 🏛️:It is about 88% smaller than YOLOv4 (27 MB vs 244 MB)It is about 180% faster than YOLOv4 (140 FPS vs 50 FPS)It is roughly as accurate as YOLOv4 on the same task (0.895 mAP vs 0.892 mAP)Prerequisites 🧰YOLOv5PytorchNumpyPandasgdownAccuracy 📈For accuracy I used about 1864 images to get the number of ellipses, out of this number only 193 of images were predicted wrong with the count of ellipses.
the overall accuracy of the model was about 90%.
here is a sample of out put from the model with the image and text file with containes the number of each object and their exact position.2 0.283482 0.604911 0.183036 0.236607
0 0.872768 0.792411 0.245536 0.352679
0 0.767857 0.647321 0.3125 0.321429
0 0.189732 0.381696 0.370536 0.40625
0 0.477679 0.700893 0.294643 0.3125First column shows the classes (0 for ellipse, 1 for triangle, 2 for general polygon), and the rest of columns show position of the itemFeaturesEasy to useFastAccurateUsagePip install the package:pip install shapedetector==0.0.1Download Weights :gdownhttps://drive.google.com/uc?id=1nXiNOfZRfovIWDz00rgSbFJp2a0mlHrXSome Importsfromshape_detector.mainimportinit_detectorfromshape_detector.mainimportdetect_ellipseinit the modell:init_detector()Run the model (you might need to run this code twice to load properly)
arguments are (path to model, image dim, path to image file)detect_ellipse("/content/best.pt",224,"/content/test0099.png")To see the result image run:fromIPython.displayimportImageImage('/content/yolov5/runs/detect/exp2/test0036.png',width=500)To get the file containing classes, number of objects and their position run:cat/content/yolov5/runs/detect/exp2/labels/test0036.txt>>>20.2834820.6049110.1830360.23660700.8727680.7924110.2455360.35267900.7678570.6473210.31250.32142900.1897320.3816960.3705360.4062500.4776790.7008930.2946430.3125First column shows the classes (0 for ellipse, 1 for triangle, 2 for general polygon), and the rest of columns show position of the itemAuthorNameGithubHome PageMehdi Hosseini Moghadamhttps://github.com/mehdihosseinimoghadamhttps://mehdihosseinimoghadam.github.io/LicenseMITFree Software, Hell Yeah!