Saravanan666/pypi-org huggingface dataset:
Package: gravity-simulation
Gravity simulationPython package  for calculation and simulation of n-bodies interaction  under  the influence of  Gravity force.Written in NumPy and Numba.Installing :pip install gravity-simulation==2.0.1Example :#random example together with one body bigger mass than others
from gravity_simulation.gravity import *

field.generate_random(15, mass=[20, 500], r=[-5, 5], velocity=[-5, 5], alpha=[0, 360])
field.add_body(Body(x0=0, y0=0,v_x=0, v_y=0, mass = 3000))

field.run(1300, C=0.01)
field.save_animation(frames=50,name='my_example',reduce_size_body=50,frames=150)more ...Docsin progressMy personal opinion is that the  Nympy is an incredible library and without it, The Python is nothing (just an easy programming language and so on), but with the Numpy, The  Python is able to solve serious processes involved a huge number of iterations. When the application was written in common Python then the results were quite bad, for example, when the number of bodies is 2000 and number of the iterations is  10000 the duration of the process takes about 2 days because of the app was useless now when the processes are vectorized with NumPy and Numba the execution time takes about 2 hours.
Package: gravityyaml
gravity.yamlStore your Pi-hole gravity configuration in a YAML file for easy
automation and replication.LicenceThis repo uses theREUSEstandard in order to
communicate the correct licence for the file. For those unfamiliar with
the standard the licence for each file can be found in one of three
places. The licence will either be in a comment block at the top of the
file, in a.licensefile with the same name as the file, or in the
dep5 file located in the.reusedirectory. If you are unsure of the
licencing terms please contactcontact@sidingsmedia.com.
All files committed to this repo must contain valid licencing
information or the pull request can not be accepted.
Package: gravlearn
importnetworkxasnximportgravlearnasgnimporttorch# Load dataG=nx.karate_club_graph()A=nx.adjacency_matrix(G)labels=[G.nodes[i]["club"]foriinG.nodes]# Generate the sequence for demosampler=gn.RandomWalkSampler(A,walk_length=40,p=1,q=1)walks=[sampler.sampling(i)for_inrange(10)foriinrange(A.shape[0])]# Trainingmodel=gravlearn.Word2Vec(A.shape[0],32)# Embedding based on setdist_metric=gravlearn.DistanceMetrics.EUCLIDEANmodel=gravlearn.train(model,walks,device=device,bags=A,window_length=5,dist_metric=dist_metric)# Embeddingemb=model.forward(torch.arange(A.shape[0]))
Package: gravnoise
gravnoise is a block-based, gravity-infused puzzle game: it is a bit of a
tetris clone.It features annoying graphics.Licensegravnoise is free software under the terms of the GNU General Public License
version 3 (or any later version). This is version 0.1.0 of the program.ContactThe author of gravnoise is Niels G. W. Serup <ns@metanohi.name>. Bug reports
and game suggestions should be sent to him.InstallationDependenciesgravnoise depends on argparse and pygame. From Python 3.2, argparse is included
in Python. If you’re using Python 3.x, x < 2, you can download argparse fromhttps://code.google.com/p/argparse/gravnoise will also use the Python packages termcolor and setproctitle
(available at PyPi) if present.Way #1Just run this:# pip-3.1 install gravnoiseWay #2Get the newest version of gravnoise athttp://metanohi.name/projects/gravnoise/or athttp://pypi.python.org/pypi/gravnoiseExtract gravnoise from the downloaded file, cd into it and run this in a
terminal:# python3 setup.py installUseRungravnoiseto use it. Rungravnoise--helpto check out how to use
it.As a moduleTo find out how to use it, run:$ pydoc3 gravnoiseDevelopmentgravnoise uses Git for code management. The newest (and sometimes unstable) code
is available at:$ git clone git://gitorious.org/gravnoise/gravnoise.gitThis documentCopyright (C) 2012  Niels G. W. SerupCopying and distribution of this file, with or without modification, are
permitted in any medium without royalty provided the copyright notice and this
notice are preserved.  This file is offered as-is, without any warranty.
Package: gravomg
Gravo MG Python Bindings[Paper][Project page]Python binding for Gravo MG. Gravo MG is a Geometric Multigrid Method for solving linear systems on curved surfaces. For more information, check out ourproject page.How to useGiven positions of points on a mesh or point clouds and a neighborhood graph (e.g., the edges on a mesh), you can use Gravo MG to solve linear systems as follows:importmgsolverV,F=# Mesh with vertices and facesM=# Mass matrixS=# Stiffness matrix (Laplacian)# Create the hierarchyneigh=gravomg.util.neighbors_from_stiffness(S)solver=gravomg.MultigridSolver(V,neigh,M)# Solve a linear systemlhs=# Some left hand side, e.g. M + 0.01 * S, make sure it is in csr format.rhs=# Some right hand side, e.g. M @ Vsolution=solver.solve(lhs,rhs)InstallationThe Gravo MG package is available on pippipinstallgravomgIf you would like to recompile yourself, you can clone this repositorygitclone--recursehttps://github.com/rubenwiersma/gravo_mg_python.gitAnd install from the foldercdgravo_mg_python
pipinstall./CitationsPlease cite our paper if this code contributes to an academic publication:@Article{WiersmaNasikun2023GravoMG,author={Ruben Wiersma, Ahmad Nasikun, Elmar Eisemann, Klaus Hildebrandt},journal={SIGGRAPH 2023},title={A Fast Geometric Multigrid Method for Curved Surfaces},year={2023},month=jul,number={4},volume={41},doi={10.1145/3588432.3591502},publisher={ACM}}
Package: gravpy
gravpyA sandbox for gravitational wave astronomy.Free software: ISC licenseDocumentation:https://code.daniel-williams.co.uk/gravpy/FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.2.1 (2019-07-16)Added the noise curve for the Einstein Telescope (configuration D only).0.1.0 (2016-03-15)First release on PyPI.
Package: gravtools
Gravitational Wave utilities in PythonThegravtoolsmodule is a complementary module to the existing, well-written librariespycbcandgwpy. This package began as a few simple utilities, such as constants
and date conversion helper functions.Useful ConstantsThegravtoolspackage includes some human-readable, enumerated constants for key components of
thePyCBCmodule structure, such as Detector names and Merger parameter names. This is made
necessary sincePyCBCoften relies on a lazy-loading pattern for attributes, using thesetattrfunction to assign attributes to primary classes likeMerger. Unfortunately, this makes these
attributes uninspectable by most IDEs. Also the names of these attributes are occasionally less-than-legible.>>>fromgravtoolsimportMergerParameters,Observatory>>>Observatory.LIGOHanford'H1'>>>MergerParameters.RadiatedEnergy,MergerParameters.FinalSpin('E_rad','a_final')Time ConversionGravitational wave data uses GPS time format, which is a float number of seconds since the
GPS era. Thetimemodule ingravtoolscontains a utility function to convert
from GPS time to the builtindatetime.>>>fromgravtoolsimporttime>>>time.gps_to_datetime(1187529241)datetime.datetime(2017,8,23,13,14,20)Merger FormattingTheMergerclass in thePyCBCmodule doesn't have a clean repr by default. Themergermodule
in thegravtoolspackage includes formatting utilities forMergerobjects, mostly for quick
inspection and display purposes (for example, in a Jupyter notebook).>>>fromgravtoolsimportmerger>>>frompycbcimportcatalog>>>m=catalog.Merger('GW150914')>>>merger.summary(m)'Merger[GW150914](Mass1=35.6, Mass2=30.6, FinalSpin=0.69)'The parameters displayed are configurable as well, using theparametersargument>>>merger.summary(m,parameters=[MergerParameters.Redshift])'Merger[GW150914](Redshift=0.09)'
Package: grawlix
grawlixCLI ebook downloaderSupported servicesgrawlix currently supports downloading from the following sources:DC Universe InfiniteeReolenfanfiction.netFlippInternet ArchiveManga PlusMarvel UnlimitedNextoryRoyal RoadSaxoWebtoonsInstallationFrom pypi (recommended)pipinstallgrawlixFrom repo (unstable)gitclonehttps://github.com/jo1gi/grawlix.gitcdgrawlix
python3setup.pyinstallAuthenticationAuthentication can either be done with login (username and password) or cookies.
Not all sources support both methods.LoginSome sources require authentication, which can be done either with cli arguments
or a config file.Cli examplegrawlix--username"user@example.com"--password"SuperSecretPassword"<url>Config file example[sources.name]username="user@example.com"password="SuperSecretPassword"Config file should be placed in~/.config/grawlix/grawlix.tomlCookiesSome sources can be authenticated with Netscape cookie files. I usethis extensionto export my
cookies from my browser.Cookies can be placed in current dir ascookies.txtor be given with the--cookieargument.Download booksTo download a book run:grawlix[options]<bookurl>
Package: gray2color
Grayscale to Color Semantic Mask ConverotrBug Fixesversion 0.4.3updated for use with pytorch and numpy.addeddeepglobdataset pallet.version 0.4.1FixedValueErrorraised while using Custom color pallet.Dependenciesnumpy
cv2
tensorflow # only if using backend='tf'
python >= 3.6Installationpip install gray2colorThislibconverts the grayscale semantic masks obtained at the output a CNN and fills it with colors for example in case ofcityscapedataset you have 30 channels at the output of CNN and after usingargmaxto create one channel semantic mask you
get the following outputwhich you can use for measuringIOU,Diceor other evaluation metrics. But it is a bit difficult for human visualization so this package
converts the above output to following ouptut easy to visualize.Usageimportcv2fromgray2colorimportgray2color'''two backends'tf' # for tesnorflow'np' # for numpy/pytorch'''mask=cv2.imread('../gray.png',0)rgb=gray2rgb(mask,use_pallet='cityscape',custom_pallet=None,backend='np')ReturnsAuint8image with values ranging from [0, 255] you can save viaimportcv2rgb=cv2.cvtColor(rgb,cv2.COLOR_BGR2RGB)#   becaues cv2 will change color channels before writingcv2.imwrite('../rgb.png',rgb)Available PalletsAvailable Pallets areade20k,cityscape,lip,pannuke,pascal,vistasfor details on all above pallets and their corresponding names visithereUsage with custom palletsYou can also define your custom color Pallets as follows# values are in order [R, G, B] ranging from [0, 255]c_pallet=np.array([[[128,64,128],[244,35,232],[70,70,70],[102,102,156],[190,153,153]]],np.uint8)/255rgb=gray2rgb(mask,use_pallet=None,custom_pallet=c_pallet,backend='np')Raises ErrorsPalletNotDefined:ifpalletisnotspecifiedNotEnoughColors:ifgrayscalemaskhasmoreclassespresentthanthecolorsinthepalletFor more details visitGitHub
Package: graycode
IntroductionGray code or reflected binary code (RBC) is an ordering of binary numbers such
that two successive numbers only differ in one bit. In essence, this is an
alternative to two's complement integers when it is useful to change only
one bit between successive numbers.This library implements functions to convert gray code to two's complement
integer and vice versa.See LICENSE.md for copyright information. This library is licensed under the
MIT license.Seehttps://en.wikipedia.org/wiki/Gray_codefor details and applications of
gray codes.Installation$ python3 setup.py installOr from PyPi:$ pip3 install graycodeExampleimport graycode

for i in range(8):
    print(i, '{:03b}'.format(graycode.tc_to_gray_code(i)))=>0 000
1 001
2 011
3 010
4 110
5 111
6 101
7 100Reverse is also provided:graycode.gray_code_to_tc(0b011)=>2gen_gray_codes(n) produces all n bit gray codes:graycode.gen_gray_codes(3)=>[0, 1, 3, 2, 6, 7, 5, 4]
Package: graylogger
Graylog HandlersОднажды в рабочем процессе мне понадобилось отправлять логи из моего python приложения в graylog.
Перебрав все более-менее нормальные библиотеки для работы с gelp http graylog, не нашел ни одной,
которая бы работала так, как от нее ожидается. Некоторые вообще не шлют логи, другие теряют сообщения.Тогда, на выходных, я решил написать свой мини-хендлер graylog для библиотеки logger для использования в своих проектах.
Так родилась эта библиотека. Возможно, она сэкономит кому-то несколько часов времени.Версии:0.1.*: Базовый HTTP хендлер для GELF Graylog.0.2.0: Функционал добавления кастомных полей в HTTP хендлер.0.2.1: Пакет в pip пакетном менеджере.0.2.2: Исправление проблем с путями импортов.0.2.3: Пайплайн автоматической сборки пакета, выкатки релиза после пуша в мастер и прохождения всех тестов.Примеры использования:Установка пакета из пакетного менеджера производится командой:pip install graylogИмпортирование пакета:import graylogggingИспользование хендлера в библиотекеlogging:logger = logging.getLogger(logger_name)
logger.setLevel(logging.INFO)
handler = grayloggging.HTTPHandler(host='yourgraylog.ru', path='/gelf', port=80)
handler.add_field(name='castom_field_name', content='castom_field_content')
logger.addHandler(handler)Возможные ошибки и их решение:Ошибка:socket.gaierror: [Errno 11001] getaddrinfo failedРешение: Скорее всего у вас указан протокол (http:// или https://) в параметре host хендлера. Надо убрать.Наиболее актуальное readmeсмотрите на github
Package: graylogging
grayloggingGraylogging is an extension to the built-in logging module that allows logs to be written directly to Graylog via the GELF input rather than feeding from a flat file.InstallationThe package can be installed by one of the following methods:PIPpip install grayloggingPipenvpipenv install grayloggingGeneral UseInitializationImport both theloggingand thegrayloggingmodule:import logging
import grayloggingAfter those have been imported, you can use both the GraylogHandler and GraylogFormatter classes like the other built-in Formatters and Handlers:logger = logging.getLogger(name)
gh = GraylogHandler(graylog_server, gelf_port, transport="tcp", appname="MyKickassApp")
gh.setFormatter(GraylogFormatter)
logger.addHandler(gh)
logger.setLevel(logging.DEBUG)The transport options are "tcp", "udp", and "http"; the correct choice will depend on the Graylog input configuration.This handler could also be used in conjunction with another handler. For example if it's desired to output the logs to console as well, we can accomplish this with the following example:graylog_server = "graylog.contoso.com"
gelf_port = 12201
appname = "MyKickassApp"
log_level = logging.INFO
logger = logging.getLogger(name)
logger.propogate = False
logger.disable_existing_loggers = True
console_formatter = logging.Formatter(
    "%(asctime)s :: %(name)s :: %(levelname)s :: %(message)s"
)
sh = logging.StreamHandler()
sh.setFormatter(console_formatter)
logger.handlers = [ch]
gh = GraylogHandler(graylog_server, gelf_port, transport="http", appname=appname)
gh.setFormatter(GraylogFormatter)
logger.addHandler(gh)
logger.setLevel(log_level)You should be ready to roll now.Shipping actual log messages:One logging has been initialized, graylogging can be used just like the built-in logging module:logger.debug(message)
logger.info(message)
logger.warning(message)
logger.error(message)
logger.critical(message)
logger.exception(message)EnhancementsJSON payloadsGraylogging can be fed either a string as normal, or a dict that will be json-encoded before shipping. This will allow a configured pipeline rule to parse the json and extract the key-value pairs into searchable fields. Example pipeline rule:rule "parse gelf json input"
when
  contains(to_string($message.application), "MyKickassApp")
then
  let json_fields = parse_json(to_string($message.message));
  let json_map = to_map(json_fields);
  set_fields(json_map);
endThis will allow you to search by appname and e.g. severity level, function name, as well as any exception info (if called from logger.exception()).LimitationsGraylogging requires python3.6+GraylogHandler and GraylogFormatter are co-dependent. Don't try to use either without the other.
Package: graylog-json-formatter
GrayLogJSONFormatter formatted LogRecord as JSON object for graylog JSON extractor.
JSON object include LogRecord attributes as default_keys and include extra attributes:source,message,asctimeanddata.Exampleconfigure:from logging import config

config.dictConfig({
        'version': 1,
        'disable_existing_loggers': True,
        'formatters': {
            'graylog': {
                '()': 'graylog_json_formatter.GrayLogJSONFormatter',
                'format': '({levelname}) | {name} | [{asctime}]: '
                          'File {pathname}:{lineno}" - {funcName}() | {message}',
                'style': '{',
                'source': 'test',
                'environment': 'testing',
                'keys': {
                    'name', 'levelno', 'levelname',
                    'pathname', 'filename', 'module', 'lineno', 'funcName',
                    'created', 'asctime', 'msecs', 'relativeCreated',
                    'thread', 'threadName', 'process',
                    'message', 'data',
                    'exc_text', 'stack_info',
                },
                'extra': {'service': 'my-service'},
            }
        },
        'handlers': {
            'console': {
                'level': 'DEBUG',
                'class': 'logging.StreamHandler',
                'formatter': 'graylog',
            },
            'graylog': {
                'level': 'DEBUG',
                'class': 'logging.handlers.SysLogHandler',
                'formatter': 'graylog',
                'address': ('localhost', 10000),
            }
        },
        'loggers': {
            'test': {
                'level': 'DEBUG',
                'handlers': ['console', 'graylog'],
                'propagate': False,
            },
        }
    })

    logger = logging.getLogger('test')logging:# extra usage
logger.debug('test message: % | %s', 1, 2, extra={'data': {'key': 'value', 'int_key': 12})Graylog extract extra asdata-keyanddata-int_keyfields.extraargument may be callable or string with dotted path to callable attribute:'extra': lambda record: {'service': 'service-func'}
Package: grayness-index-python
Grayness IndexUnofficial Python implementation of the paper named"On Finding Gray Pixels".Disclaimer:You may copy, distribute and modify the software provided that modifications are described and licensed for free under LGPL. Derivatives works (including modifications or anything statically linked to the library) can only be redistributed under LGPL, but applications that use the library don't have to be.Installationpip install grayness-index-pythonBasic Usageimport numpy as np
import math
from scipy.io import loadmat

from grayness_index import GraynessIndex

gi = GraynessIndex()
mat = loadmat("imgs/exampleimg.mat")
gt = mat["gt"]
input_im = mat["input_im"]  # np.ndarray with shape H x W x 3.
pred_illum = gi.apply(input_im)
error = np.arccos(pred_illum @ gt.transpose()) * 180 / math.pi
log.info(f"Error: {error}")ReferencesOfficial MatLab CodeTo cite the original paper:@inproceedings{qian2019cvpr,
  title={On Finding Gray Pixels},
  author={Qian, Yanlin and K{\"a}m{\"a}r{\"a}inen, Joni-Kristian and Nikkanen, Jarno and Matas, Jiri},
  booktitle={IEEE International Conference of Computer Vision and Pattern Recognition},
  year={2019}
}
Package: graynet
graynetNewsVolumetric version of graynet is available now -check hereOverviewIndividualized single-subject networks from T1-weighted magnetic resonance imaging (MRI) features such as:vertex-wise features such as cortical thickness, gyrification and curavaturevolumetric features such as gray matter density (T1w images) or metabolic uptake (PET) or another voxel-wise featureSubcortical morphometric featuresor any other similar feature distributed over a domain (cortex, or whole brain) to enable compuatation of inter-regional edge weightsApplicable for whenever network-level features are useful, among which common use cases are:Biomarker development.Brain-behaviour relationships (e.g. for the diagnosis and prognosis of many brain disorders such as Alzheimer's, Parkinson's, Schizophrenia and the like).Aging (changes in network properties over age and their relations to other variables).Docs:https://raamana.github.io/graynet/Quick illustration:Installationpip install -U graynetCitationIf you found any parts of graynet to be useful in your research, I'd appreciate if you could cite the software paper in JOSS below, as well as the methods paper that motivated the tool development in that order:Raamana et al., (2018). graynet: single-subject morphometric networks for neuroscience connectivity applications. Journal of Open Source Software, 3(30), 924,https://doi.org/10.21105/joss.00924Raamana, P. R., & Strother, S. C. (2020), “Does size matter? Relationship between predictive power of single subject morphometric networks to spatial scale and edge weight”, Brain Structure and Function, 225(8), 2475-2493. DOI: 10.1007/s00429-020-02136-0Raamana, P. R., Weiner, M. W., Wang, L., Beg, M. F., & Alzheimer's Disease Neuroimaging Initiative. (2015). Thickness network features for prognostic applications in dementia. Neurobiology of aging, 36, S91-S102.https://www.sciencedirect.com/science/article/pii/S0197458014005521
Package: grayscale-converter
Grayscale ConverterType:PackageTitle:Greyscale converter with custom extensionVersion:0.1Date and Time:04-02-2023 1:00AMAuthor:Pranav Singh, Aashutosh Dubey, Aditya Singh RathoreMaintainer:Pranav Singhpsingh2_be20@thapar.edu, Aditya Singh Rathorearathore_be20@thapar.edu, Aashutosh Dubeyasaashutoshdubey0@gmail.comDescription:conversion of digital colored images to grayscale images with custom passed extensionHow to install this package:>> pip install grayscale-converterIn Command Prompt>> grayscale input.png jpegGrayscaleGrayscale images are digital images that represent a single channel of information, where each pixel is represented by a single value that represents its intensity. In grayscale images, the intensity of each pixel is proportional to the brightness of the corresponding point in the scene being captured or generated. Grayscale images have only one channel, compared to color images, which have three channels (red, green, and blue) that together form the final color representation of each pixel. Grayscale images are often used in fields such as image processing, computer vision, and photography, where the focus is on the intensity information, rather than the color information, of the image.File ExtensionWhat's the difference between JPEG, JPG and PNG?JPEG, JPG, and PNG are the three most commonly used image file formats on the web. Understanding the differences between them is important for choosing the right format for your images.JPEG, or Joint Photographic Experts Group, is a lossy image compression format. This means that during the compression process, some image data is lost, leading to a smaller file size but lower image quality. JPEG is best for photographs and images with a lot of color variations and smooth gradients, as these types of images can be compressed with little visible loss in quality. The ".jpg" extension is commonly used for JPEG images, while the ".jpeg" extension is also used, but less commonly.JPG is just a common file extension used for JPEG images, with "JPEG" being the correct name for the image format.PNG, or Portable Network Graphics, is a lossless image compression format. This means that no image data is lost during the compression process, resulting in high-quality images but larger file sizes. PNG is ideal for images that require high-quality images, such as illustrations and graphics, which often have sharp lines and distinct areas of color. PNG images are also capable of handling transparency, which allows the background color or image behind the PNG to show through any transparent pixels in the image.In conclusion, when choosing between JPEG, JPG, and PNG, consider the quality and transparency of your images. If you want to preserve image quality and transparency, choose PNG. If you want to save space and don't mind sacrificing a bit of image quality, choose JPEG.