Saravanan666/pypi-org huggingface dataset:
Package: simghg
simghgco2.pyThe CO2 emissions of each country in Annex I Countries is drawn in comparison with Japan. In addition, a comparison with the base year of the United Nations Framework Convention on Climate Change (Kyoto Protocol base year) is drawn. The number of years is from 1990 to 2019.$ python co2.py
1:  Comparison CO2 with Japan
2:  Comparison CO2 with Base year
99:  Stop
>>> 1
Country Name >>> SlovakiaDraw The CO2 emissions of each country in Annex I Countries and the base year of the United Nations Framework Convention on Climate Change in that country.$ python co2.py
1:  Comparison CO2 with Japan
2:  Comparison CO2 with Base year
99:  Stop
>>> 2
Country Name >>> Austriasimghg.pyDraw other countries that have similar trends in comparison with the previous year for each country the Annex I Countries.$ python simghg.py Greece
Package: simgrid
SimGrid is a scientific instrument to study the behavior of large-scale distributed systems such as Grids, Clouds, HPC or P2P systems. It can be used to evaluate heuristics, prototype applications or even assess legacy MPI applications.This package contains a native library. Please install cmake, boost, pybind11 and a C++ compiler before using pip3. On Debian/Ubuntu, this is as easy as
sudo apt install cmake libboost-dev pybind11-dev g++ gcc
Package: simgui
simguiA simple GUI API (wrapper around PySide6) for Python learners to build simple yet interesting event driven apps.It provides the following features:Create labels, buttons, input fields and comboboxes.Respond to events such as button clicks and input text changes.Place such widgets on a grid layout easily.All is done using simple function calls (no need to understand classes and objects).With these a Python learner can make GUI apps like: pacman, spade invaders, etc.How to useHere is a sample GUI program.from simgui import *

def on_ready():
    add_label("l1", "Name")
    add_input("i1", right=True)
    add_label("l2", "Job Title")
    add_input("i2", right=True)
    add_combo("cb1", cols=2)
    add_combo_item("cb1", "chicken")
    add_combo_item("cb1", "beef")
    add_combo_item("cb1", "beans")
    add_button("b1", "OK")
    add_button("b2", "Cancel", right=True)

def on_click_b1():
    set_label_text("l2", 333)

def on_edited_i1():
    set_input_text("i2", get_input_value("i1")+1)

def on_index_changed_cb1():
    print(get_combo_text("cb1")+" is selected")

start()  # must do this to kick start the app with the UI
Package: simhandler
intelligent-simulation-handlerWhat is this repository for?Software development of an intelligent simulation handler for power system load flow simulationsProject completed as partial requirement of attaining MSc at the University of AlbertaHow do I get set up?pip install simhandlerTo run the basic 3 node example:Download3node.jsonfile and put it somewhere convenient (ie: Downloads folder) as3node.json*For example, C:\Users\mikey\Downloads\3node.jsonIn a Python editor write the following basic test:'''
import numpy as np
from simhandler.smartsim import SmartPSLFconfiguration_file =insert path to your 3node.json file(ex: C:/Users/mikey/Downloads/3node.json')
sim = SmartPSLF(configuration_file)fake_load_profile = np.ones((10,3)) # Ten timesteps, three input nodes
print(sim.map.predictWithModel(fake_load_profile)) # Prints out ten voltage timesteps. Three nodes per timestep
'''Contribution guidelinesFollow PEP8 guidelines with the following exception: use lowercaseUppercase function naming instead of snake_caseQuestions?If you find a bug or want a feature. Create an issueOtherwise, send emails with title 'Intelligent Simulation Handler -Question/Comment' tobardwell@ualberta.ca
Package: simhunter
Installation$ pip install simhunter && simhunterFeaturessimhunter, ** Get Simcard Information **How to install ?$ pkg install python -y
$ pip install simhunter
$ simhunterRun ?$ simhunterDisclaimerWe are not responsible for your loss by this tool.
this tool is made for Education/Learning Purpose.
Dont harm anyone using this tool.Changelog- added Email Features !Usage$ simhunter
$ enter number without country code.
$ enter country code letter (ex, in,pk,bd..)

Created by Parixit Sutariya
Github : github.com/Bhai4You
Blogspot : https://bhai4you.blogspot.comGithub
Package: simian
A decorator for easily mocking out multiple dependencies by
monkey-patching.@simian.patch(module=...,external=[...],internal=[...])Installation:$pipinstallsimiansimian.patchis a convenience wrapper aroundmock.patchwith the
following benefits:All patched objects are collected under a singlemaster_mock, which is
provided to the function being decorated. Any patched target can be
accessed by its basename (e.g., a patchedtime.sleepwould be
accessed in the decorated function asmaster_mock.sleep).The patching works even if the target is imported directly (e.g., a call tosleepis patched the same as a call totime.sleep). Simian handles
this by reloading the module under test after applying theexternalpatches.Objectsinternalto the module under test can be patched as well. They
are collected under the samemaster_mockand can be referenced in the
same way.After leaving the decorated function, simian reloads the module under testagain, bringing it back to its pre-patched state (although all of the
module’s addresses in memory have changed).External Patching## my_package.my_module#fromtimeimportsleepdefmy_sleep(duration_secs):print('Sleeping for{n}seconds'.format(n=duration_secs))sleep(duration_secs)## my_package.test.test_my_module#importsimianfrommy_packageimportmy_module@simian.patch(my_module,external=['time.sleep'])deftest_my_sleep(master_mock):my_module.my_sleep(99)master_mock.sleep.assert_called_once_with(99)Internal PatchingThe above example demonstratesexternalpatching, butinternal(same-module) patching works as well. Let’s extend the above example.## my_package.my_module#fromtimeimportsleepdefmy_sleep(duration_secs):my_logger('Starting{n}-second sleep'.format(n=duration_secs))sleep(duration_secs)my_logger('Finished{n}-second sleep'.format(n=duration_secs))defmy_logger(msg):print(msg)## my_package.test.test_my_module#importsimianfrommockimportcallfrommy_packageimportmy_module@simian.patch(my_module,external=['time.sleep'],internal=['my_logger'])deftest_my_sleep(master_mock):my_module.my_sleep(99)master_mock.assert_has_calls(calls=[call.my_logger('Starting 99-second sleep'),call.sleep(99),call.my_logger('Finished 99-second sleep')],any_order=False)
Package: simian-engine
SimianSimian is a framework thats provides a game engine using pygame.EspecificationPython: v3.6.5
pygame: v1.9.3Quick StartFollow these steps on a terminal:$ sudo apt-get install python-virtualenv

$ mkdir venv

$ virtualenv venv/games

$ source venv/games/bin/activateThen go to the project’s root:(games) $ python3 setup.py buildAfter that your can use either docker/makefile abstraction to run your simian environmentTo quit this virtual environment just type:$ deactivateSetup sample gameInside simian folder, run:$ simian startprojectSimian will ask you some parameters then a sample game will be created. After that go to the pong folder and run the sample:$ cd pong/$ simian runPyPiA more stable version of the package is in:https://pypi.org/project/simian-engine/
Package: simiki
Simiki is a simple wiki framework, written inPython.Easy to use. Creating a wiki only needs a few stepsUseMarkdown. Just
open your editor and writeStore source files by categoryStatic HTML outputA CLI tool to manage the wikiSimiki is short forSimple Wiki:)New in version 1.6.2.3 (2019-05-11)Fix Issue #124New in version 1.6.2.2 (2019-04-21)Fix PyYAML CVE-2017-18342Fix Jinja2 CVE-2019-10906New in version 1.6.2.1 (2017-06-04)Fix preview not work in py3InstallationIt is available forPython 2.7, 3.3, 3.4, 3.5, 3.6, with Linux, Mac
OS X and Windows.Install fromPyPI:pip install simikiUpdate:pip install -U simikiQuick StartInit Sitemkdir mywiki && cd mywiki
simiki initGeneratesimiki gPreviewsimiki pFor more information,simiki-hor have a look atSimiki.orgOtherssimiki.orghttps://github.com/tankywoo/simikiEmail:me@tankywoo.comSimiki
UsersContributionYour contributions are always welcome!Sending pull requests onPull Requests
Pageis the preferred
method for receiving contributions.Bug fixes can be based on``master``branch and I will also merge
intodevbranch.Feature can be based on``dev``branch.Following links are the contribution guidelines you may need:Fork A RepoContributing to Processing with Pull
RequestsThanks to everycontributor.LicenseThe MIT License (MIT)Copyright (c) 2013 Tanky WooPermission 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: simil
Semantic String Similarity CLIsimilis a CLI interface tospacy's string similarity engine. It uses theen_vectors_web_lgdataset to compare strings for their English semantic similarity. Given two words, phrases, or sentences,similwill tell you how similar their meanings are.InstallationFirst installsimilitself:$pip3install--user-UsimilNow install one of spacy's web_vector models:$ python3 -m spacy download en_vectors_web_lgYou can choose betweenen_vectors_web_lg,en_core_web_lg, anden_core_web_md, (en_core_web_smdon't include word vectors at all, and can't be used withsimil.)similwill use the largest model that you have installed, with preference for thevectorsmodel over acoremodel.I suggest using the large vectors model (en_vectors_web_lg), but you might want to use a smaller model in order to save on disk space or memory usage.Usage:$simfirst_file.txtsecond_file.txt# compare two files$sim-s"first string""second string"# compare two stringsThe output is a number between 0 and 1, representing how similar the two strings are.Details:similuses Spacy's word vector models trained withGLoVe, such asen_vectors_web_lg.This can be a large dataset, which makes for long startup times. Sosimilspins off a process in the background to hold the model, and works under a client-server model with it. This means that if you runsimila number of times in a row, only the first run is slow.This background process does take up a fair bit of memory, typically around 2GB (for theen_vectors_web_lgmodel). After 10 minutes of inactivity it will automatically be killed, in order not to take up memory indefinitely. You can change the length of this timeout with the--timeoutflag.
Package: similar
similaris a Python library used to find the correct spelling from a misspelled text.Usage>>>fromsimilarimportbest_match>>>best_match('rasbery',['apple','raspberry','pear'])raspberryInstallationThe tool works with Python 2 and Python 3. It can be installed withPip:pip install similarNotesYou can also use a file object for the wordlist :fromsimilarimportSimilars=Similar('rasbery',open('wordlist.txt'))print(s.best())Or a generator :fromsimilarimportSimilardefgenwords():forlinein['apple','raspberry','pear']:yieldlines=Similar('rasbery',genwords())print(s.best())
Package: similar-dict
This is a small test helper that allows you to compare dicts (and sequences of
them) to an expected template. This template can be real values or types.If they are real values, normal comparison is used.
If it’s a type, thenisinstance()is used to make sure it’s of the correct
type, but no value comparison is made.This allows your test to focus on the things that are important and ignore
things that do not affect the application, but merely its presentation.ExampleConsider the followingpydanticobjects:class Author(BaseModel):
given_name: str
surname: str


class Book(BaseModel):
    title: str
    published_at: datetime
    author: AuthorA json schema for these is built from a dict that pydantic generates via themodel_json_schemamethod and will look like this:expected_book_schema = {
    "$defs": {
        "Author": {
            "properties": {
                "given_name": {"title": "Given Name", "type": "string"},
                "surname": {"title": "Surname", "type": "string"},
            },
            "required": ["given_name", "surname"],
            "title": "Author",
            "type": "object",
        }
    },
    "properties": {
        "title": {"title": "Title", "type": "string"},
        "published_at": {
            "format": "date-time",
            "title": "Published At",
            "type": "string",
        },
        "author": {"$ref": "#/$defs/Author"},
    },
    "required": ["title", "published_at", "author"],
    "title": "Book",
    "type": "object",
}Now suppose the you don’t really care about the formatting/cases/wording of the
title as it doesn’t affect the program. You care about the other stuff in your
test: that the keys are correct and that they serialise to the correct type.So we change our expected dictionary for a similarity match:expected_book_schema = {
    "$defs": {
        "Author": {
            "properties": {
                "given_name": {"title": str, "type": "string"},
                "surname": {"title": str, "type": "string"},
            },
            "required": ["given_name", "surname"],
            "title": str,
            "type": "object",
        }
    },
    "properties": {
        "title": {"title": str, "type": "string"},
        "published_at": {
            "format": "date-time",
            "title": str,
            "type": "string",
        },
        "author": {"$ref": "#/$defs/Author"},
    },
    "required": ["title", "published_at", "author"],
    "title": str,
    "type": "object",
}HINT: all titles have been replaced with astrtype.And so let’s look at our test:def test_book_schema():
    assert similar_dict(Book.model_json_schema(), expected_book_schema)This test will succeed, despite that it’s not an exact match for the Schema
definition.
Package: similar-documents
similar-documentsGenerates similarity document scores from cli. Useful when combined with static site generators.$ similar-documents -h
usage: $ similar_documents -o result.json -k 5 -t japanese *.md
       $ similar_documents -h

positional arguments:
  documents             list[str]

optional arguments:
  -h, --help            show this help message and exit
  -o None, --output-file None
                        Optional: write output file (default STDOUT)
  -k 5, --top-k 5       Number of similar documents
  -d, --debug           Show debug messages
  -t None, --tokenizer None
                        tokenizer [japanese] (default None(space splitting))
  -e utf-8, --encoding utf-8
                        file encoding(default utf-8)$ similar-documents -t japanese -k 2 /data/markdowns/recently/*.md | jq . | head -20
{
  "/data/markdowns/recently/2021-04-01.md": [
    [
      "/data/markdowns/recently/2021-04-26.md",
      0.3123780045484529
    ],
    [
      "/data/markdowns/recently/2021-04-03.md",
      0.17384380113610887
    ]
  ],
  "/data/markdowns/recently/2021-04-02.md": [
    [
      "/data/markdowns/recently/2021-04-26.md",
      0.10715535963136594
    ],
    [
      "/data/markdowns/recently/2021-04-23.md",
      0.09411751563901728
    ]Installationpip install -U similar-documentsOn Docker$ docker build -t similar-doc .
# examples: run on windows
$ docker run -it -v C:\Users\yu1\Dropbox\secon-sites\data:/data/ --rm similar-doc bash -c 'similar-documents -t japanese -k 2 -o /data/result.json `ls /data/markdowns/*/*.md`'LisenceMITAuthorYuichi Tateno
Package: similarity-based-rs
similarity-based-rsPackage for obtaining content based recommendations based on similarityInstallationpip install similarity-based-rsUsageTODODev InstallationFor development purposes, additional libraries must be installed such aspytestandmkdocs.Prerequisites:Python >=3.8 (we usepython3.11)PoetryPreCommit(Optional)Steps1.ClonetherepositoryorimportitviayourIDE2.poetryinstall3.pre-commitinstall(Optional)4.gitbranchnew_dev_branch_name
Package: similarity-engine-utils
similarity-engine-utilsUtility tools for easier management of feature-vector database and similar
vector comparisonInstallationUse the package managerpipto install library.pipinstallsimilarity-engine-utilsSetup backend connection (milvus)fromse_utils.backend.milvus.coreimportsetup_connectionmilvus_credentials={"alias":"default","host":"localhost","port":"19530"}collection_name='test_collection'c=setup_connection(milvus_credentials)Create collectionfromse_utils.backend.milvus.coreimportcreate_milvus_collection,generate_schema,read_schema_jsoncollection_name='test_collection'schema_path="/path/to/schema.json"tag="some_tag"# existing tagcollection1=create_milvus_collection(collection_name,tag=tag)# parse json schemacollection_schema,index_params=generate_schema(tag=tag,schema=read_schema_json(schema_path))collection2=create_milvus_collection(collection_name,schema=collection_schema,indices=index_params)Insert data to collectionfromse_utils.backend.milvus.coreimportinsert2milvuscollection_name='test_collection'kwargs={"id":1,"name":"name","emb":[1,1,1,1]}insert2milvus(data=[kwargs],collection_name=collection_name)Find the closest cluster idimportnumpyasnpfromse_utils.backend.milvus.coreimportget_cluster_id,get_increment_cluster_idcollection_name='test_collection'emb_label='emb'emb=[np.random.uniform(low=-1,high=1,size=(1024,)).tolist()for_inrange(1)][0]cluster_label='group_id'cluster_id=get_cluster_id(collection_name=collection_name,emb=emb,emb_label=emb_label,cluster_label=cluster_label)ifcluster_idisNone:cluster_id=get_increment_cluster_id(collection_name=collection_name,cluster_label=cluster_label)
Package: similarity-index-of-label-graph
similarity_index_of_label_graphcalculate the similarity index of the label graph pairs package in python.Can be used for weighted/unweighted and directed/undirected networks.InstallationInstallation can be done through pip. You must have python version >= 3.7pip install similarity-index-of-label-graphUsageThe statement to import the package:from similarity_index_of_label_graph_package import similarity_index_of_label_graph_classExample:>>> from networkx.generators.directed import gnr_graph
>>> from networkx.generators import spectral_graph_forge
>>> G1 = gnr_graph(100, 0.3, seed = 65535)
>>> G2 = gnr_graph(100, 0.3, seed = 1)
>>> G3 = spectral_graph_forge(G1, 0.6, seed = 65535)
>>> G4 = spectral_graph_forge(G2, 0.6, seed = 65535)
>>> similarity_index_of_label_graph = similarity_index_of_label_graph_class()
>>> similarity_index_of_label_graph(G1, G2)
0.7651719671571124
>>> similarity_index_of_label_graph(G1, G3)
-0.8580896120374933
>>> similarity_index_of_label_graph(G2, G4)
-0.8440113193737153
>>> similarity_index_of_label_graph(G3, G4)
0.7314483604914666
Package: similarity-learning
similarity-learningDocsSeehttps://irad-zehavi.github.io/similarity-learning/Installpipinstallsimilarity_learningHow to useAs an nbdev library,similarity_learningsupportsimport *(without
importing unwanted symbols):fromsimilarity_learning.allimport*Now we can train a pair-matcher. First let’s construct dataloaders of
pairs:fromfastai.vision.allimport*pairs=Pairs(Imagenette(160),.1)dls=pairs.dls(after_item=Resize(128),after_batch=Normalize.from_stats(*imagenet_stats))To get quick results, we can use the body of a pretrained model as a
backbone for our Siamese neural network:classifier=resnet34(weights=ResNet34_Weights.DEFAULT)siamese=ThresholdSiamese(create_body(model=classifier,cut=-1)).to(dls.device)siamese.fit_threshold(dls.train)(1.0099999904632568, 0.8962054252624512)Let’s see how good it is:learn=Learner(dls,siamese,metrics=accuracy)learn.validate()(#2) [0.5453092455863953,0.8877550959587097]learn.show_results()Not bad, but we can do better with finetuning:learn.fit(5,1e-4)learn.validate()(#2) [0.26150667667388916,0.954081654548645]learn.show_results()We can also consider the distribution of feature-space distances
compared to the decision threshold:siamese.plot_distance_histogram(dls.valid)See the rest of the docs for more examples, including more
visualizations, comparison of loss functions, and facial recognition.
Package: similarity-ranker
積木塊 Similarity Ranker v1.0.0 by Bowen Chiu找到與給定查詢句子 v.s. 最相似的嵌入向量這東西可以用來做任意 .txt & .pt 遞迴子目錄的相似度比對找出排名最相似的 top 10 輸出 .json使用的是 Hugging Face Transformers 的paraphrase-multilingual-MiniLM-L12-v2模型。環境設置在開始之前，首先確保你已經安裝了以下的 Python 庫：python3 -m pip install similarity-ranker使用方法作為命令行工具使用你可以通過運行以下命令來使用 similarity_ranker.py：python3 -m similarity_ranker \
  --prompt "你的查詢句子" \
  --txt-folder "包含 txt 文件的文件夾" \
  --embeddings-folder "包含嵌入向量文件的文件夾" \
  --output-json "輸出 JSON 文件名（可選）"作為模塊導入使用首先，導入similarity_ranker：fromsimilarity_rankerimportquery_embeddings,save_ranking_to_json然後，使用query_embeddings函數獲取查詢句子的相似度排名：prompt="你的查詢句子"embeddings_folder="包含嵌入向量文件的文件夾"ranking=query_embeddings(prompt,embeddings_folder)接著，使用save_ranking_to_json函數將排名結果保存為 JSON 文件：txt_folder="包含 txt 文件的文件夾"output_file="輸出 JSON 文件名"save_ranking_to_json(prompt,ranking,txt_folder,output_file)範例假設你有以下文件結構：data/
  txt/
    file1.txt
    file2.txt
    ...
  embeddings/
    file1.pt
    file2.pt
    ...你可以通過運行以下命令找到與查詢句子最相似的嵌入向量：python3 -m similarity_ranker \
  --prompt "你的查詢句子" \
  --txt-folder "data/txt" \
  --embeddings-folder "data/embeddings" \
  --output-json "data/top_similarity.json"
Package: similaritytoolbox
# Similarity toolbox## IntroToolbox that can be used to find similar setencesTecnologies usedContrastive tensionhttps://github.com/FreddeFrallan/Contrastive-TensionFaisshttps://github.com/facebookresearch/faiss(Transformers/BERT)## Version history0.0.1   Draft## Installationpip install similaritytoolbox## Usagetoolbox = SimilarityToolbox()
toolbox.add_sentence(“kaka”)
toolbox.print_similar(“bulle”,limit = 5)## Releaserm -Rf dist/
Step up version in setup.py
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
Username: horndahl