id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20,100 | saltstack/salt | saltstack_salt/salt/wheel/__init__.py | salt.wheel.WheelClient | from collections.abc import Mapping
import salt.config
import salt.utils.network
import salt.utils.error
import salt.channel.client
import salt.client.mixins
import salt.loader
class WheelClient(salt.client.mixins.SyncClientMixin, salt.client.mixins.AsyncClientMixin):
"""
An interface to Salt's wheel modules
... |
class WheelClient(salt.client.mixins.SyncClientMixin, salt.client.mixins.AsyncClientMixin):
'''
An interface to Salt's wheel modules
:ref:`Wheel modules <all-salt.wheel>` interact with various parts of the
Salt Master.
Importing and using ``WheelClient`` must be done on the same machine as the
... | 7 | 6 | 16 | 2 | 8 | 7 | 2 | 1.22 | 2 | 4 | 1 | 0 | 6 | 2 | 6 | 23 | 132 | 22 | 50 | 27 | 33 | 61 | 30 | 15 | 23 | 5 | 2 | 2 | 10 |
20,101 | saltstack/salt | saltstack_salt/doc/_ext/saltautodoc.py | saltautodoc.SaltFunctionDocumenter | from sphinx.ext.autodoc import FunctionDocumenter
class SaltFunctionDocumenter(FunctionDocumenter):
"""
Simple override of sphinx.ext.autodoc.FunctionDocumenter to properly render
salt's aliased function names.
"""
def format_name(self):
"""
Format the function name
"""
... |
class SaltFunctionDocumenter(FunctionDocumenter):
'''
Simple override of sphinx.ext.autodoc.FunctionDocumenter to properly render
salt's aliased function names.
'''
def format_name(self):
'''
Format the function name
'''
pass | 2 | 2 | 18 | 3 | 8 | 7 | 4 | 1.22 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 24 | 4 | 9 | 2 | 7 | 11 | 9 | 2 | 7 | 4 | 1 | 1 | 4 |
20,102 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.CurrentFormula | from docutils.parsers.rst import Directive
class CurrentFormula(Directive):
domain = 'salt'
has_content = False
required_arguments = 1
optional_arguments = 0
final_argument_whitespace = False
option_spec = {}
def run(self):
env = self.state.document.settings.env
modname = s... |
class CurrentFormula(Directive):
def run(self):
pass | 2 | 0 | 8 | 0 | 8 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 16 | 1 | 15 | 10 | 13 | 0 | 14 | 10 | 12 | 2 | 1 | 1 | 2 |
20,103 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.Event | from sphinx.domains.python import PyObject
class Event(PyObject):
"""
Document Salt events
"""
domain = 'salt' |
class Event(PyObject):
'''
Document Salt events
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 2 | 2 | 1 | 3 | 2 | 2 | 1 | 0 | 1 | 0 | 0 |
20,104 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.Formula | from sphinx import addnodes
from docutils import nodes
from docutils.parsers.rst import Directive
class Formula(Directive):
domain = 'salt'
has_content = True
required_arguments = 1
def run(self):
env = self.state.document.settings.env
formname = self.arguments[0].strip()
env.t... |
class Formula(Directive):
def run(self):
pass | 2 | 0 | 25 | 6 | 19 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 30 | 7 | 23 | 10 | 21 | 0 | 16 | 10 | 14 | 2 | 1 | 1 | 2 |
20,105 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.LiterateCoding | from docutils.parsers.rst import Directive
import re
from docutils.statemachine import ViewList
from docutils import nodes
from sphinx.util.nodes import make_refnode, nested_parse_with_titles, set_source_info
import os
import salt
import itertools
class LiterateCoding(Directive):
"""
Auto-doc SLS files using l... |
class LiterateCoding(Directive):
'''
Auto-doc SLS files using literate-style comment/code separation
'''
def parse_file(self, fpath):
'''
Read a file on the file system (relative to salt's base project dir)
:returns: A file-like object.
:raises IOError: If the file cann... | 5 | 3 | 28 | 6 | 18 | 5 | 3 | 0.31 | 1 | 4 | 0 | 1 | 3 | 0 | 3 | 3 | 96 | 21 | 58 | 27 | 54 | 18 | 56 | 25 | 52 | 6 | 1 | 2 | 10 |
20,106 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.LiterateFormula | import os
class LiterateFormula(LiterateCoding):
"""
Customizations to handle finding and parsing SLS files
"""
def parse_file(self, sls_path):
"""
Given a typical Salt SLS path (e.g.: apache.vhosts.standard), find the
file on the file system and parse it
"""
co... |
class LiterateFormula(LiterateCoding):
'''
Customizations to handle finding and parsing SLS files
'''
def parse_file(self, sls_path):
'''
Given a typical Salt SLS path (e.g.: apache.vhosts.standard), find the
file on the file system and parse it
'''
pass | 2 | 2 | 25 | 4 | 17 | 4 | 3 | 0.39 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 4 | 30 | 5 | 18 | 9 | 16 | 7 | 14 | 8 | 12 | 3 | 2 | 3 | 3 |
20,107 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.SLSXRefRole | from sphinx.roles import XRefRole
class SLSXRefRole(XRefRole):
pass |
class SLSXRefRole(XRefRole):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
20,108 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.SaltDomain | from sphinx.locale import _
from sphinx.util.nodes import make_refnode, nested_parse_with_titles, set_source_info
from sphinx.domains import python as python_domain
from sphinx.domains import ObjType
class SaltDomain(python_domain.PythonDomain):
name = 'salt'
label = 'Salt'
data_version = 2
object_type... |
class SaltDomain(python_domain.PythonDomain):
def resolve_xref(self, env, fromdocname, builder, type, target, node, contnode):
pass | 2 | 0 | 9 | 0 | 9 | 0 | 3 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 38 | 6 | 32 | 11 | 30 | 0 | 19 | 11 | 17 | 3 | 1 | 2 | 3 |
20,109 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.SaltModuleIndex | from sphinx.locale import _
from sphinx.domains import python as python_domain
class SaltModuleIndex(python_domain.PythonModuleIndex):
name = 'modindex'
localname = _('Salt Module Index')
shortname = _('all salt modules') |
class SaltModuleIndex(python_domain.PythonModuleIndex):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 1 | 0 | 0 |
20,110 | saltstack/salt | saltstack_salt/doc/_ext/saltdomain.py | saltdomain.State | from sphinx import addnodes
from docutils.parsers.rst import Directive
from docutils import nodes
class State(Directive):
domain = 'salt'
has_content = True
required_arguments = 1
def run(self):
env = self.state.document.settings.env
statename = self.arguments[0].strip()
if 'no... |
class State(Directive):
def run(self):
pass | 2 | 0 | 18 | 5 | 13 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 23 | 6 | 17 | 11 | 15 | 0 | 15 | 11 | 13 | 2 | 1 | 1 | 2 |
20,111 | saltstack/salt | saltstack_salt/setup.py | setup.BDistEgg | from setuptools.command.bdist_egg import bdist_egg
class BDistEgg(bdist_egg):
def finalize_options(self):
bdist_egg.finalize_options(self)
self.distribution.build_egg = True
if not self.skip_build:
self.run_command('build') |
class BDistEgg(bdist_egg):
def finalize_options(self):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 12 | 6 | 0 | 6 | 2 | 4 | 0 | 6 | 2 | 4 | 2 | 2 | 1 | 2 |
20,112 | saltstack/salt | saltstack_salt/setup.py | setup.Build | from distutils.command.build import build
import os
class Build(build):
def run(self):
build.run(self)
salt_build_ver_file = os.path.join(self.build_lib, 'salt', '_version.txt')
if getattr(self.distribution, 'with_salt_version', False):
self.distribution.salt_version_hardcoded_... |
class Build(build):
def run(self):
pass | 2 | 0 | 32 | 6 | 18 | 8 | 5 | 0.42 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 38 | 33 | 6 | 19 | 3 | 17 | 8 | 17 | 3 | 15 | 5 | 2 | 1 | 5 |
20,113 | saltstack/salt | saltstack_salt/setup.py | setup.Clean | import os
import glob
from distutils.command.clean import clean
class Clean(clean):
def run(self):
clean.run(self)
for subdir in ('salt', 'tests', 'doc'):
root = os.path.join(os.path.dirname(__file__), subdir)
for dirname, _, _ in os.walk(root):
for to_remov... |
class Clean(clean):
def run(self):
pass | 2 | 0 | 8 | 0 | 7 | 1 | 4 | 0.13 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 34 | 9 | 0 | 8 | 6 | 6 | 1 | 8 | 6 | 6 | 4 | 2 | 3 | 4 |
20,114 | saltstack/salt | saltstack_salt/setup.py | setup.CloudSdist | import os
from distutils import log
class CloudSdist(Sdist):
user_options = Sdist.user_options + [('download-bootstrap-script', None, 'Download the latest stable bootstrap-salt.sh script. This can also be triggered by having `DOWNLOAD_BOOTSTRAP_SCRIPT=1` as an environment variable.')]
boolean_options = Sdist.b... |
class CloudSdist(Sdist):
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass
def write_manifest(self):
pass | 5 | 0 | 18 | 1 | 16 | 2 | 4 | 0.1 | 1 | 2 | 0 | 0 | 4 | 2 | 4 | 75 | 88 | 9 | 73 | 20 | 67 | 7 | 45 | 18 | 39 | 6 | 4 | 3 | 14 |
20,115 | saltstack/salt | saltstack_salt/setup.py | setup.Develop | from setuptools.command.develop import develop
import os
class Develop(develop):
user_options = develop.user_options + [('write-salt-version', None, "Generate Salt's _version.txt file which allows proper version reporting. This defaults to False on develop/editable setups. If WRITE_SALT_VERSION is found in the env... |
class Develop(develop):
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass | 4 | 0 | 10 | 1 | 8 | 0 | 3 | 0.02 | 1 | 0 | 0 | 0 | 3 | 3 | 3 | 70 | 66 | 6 | 59 | 9 | 55 | 1 | 28 | 9 | 24 | 5 | 3 | 1 | 9 |
20,116 | saltstack/salt | saltstack_salt/setup.py | setup.GenerateSaltSyspaths | from distutils.cmd import Command
class GenerateSaltSyspaths(Command):
description = "Generate salt's hardcoded syspaths file"
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if getattr(self.distribution, 'salt_syspaths_hardcoded_path', None... |
class GenerateSaltSyspaths(Command):
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass | 4 | 0 | 12 | 0 | 11 | 1 | 1 | 0.06 | 1 | 0 | 0 | 0 | 3 | 0 | 3 | 33 | 42 | 5 | 35 | 5 | 31 | 2 | 11 | 5 | 7 | 2 | 1 | 1 | 4 |
20,117 | saltstack/salt | saltstack_salt/setup.py | setup.Install | import os
import sys
from distutils.version import LooseVersion
from setuptools.command.install import install
import setuptools
class Install(install):
def initialize_options(self):
install.initialize_options(self)
def finalize_options(self):
install.finalize_options(self)
def run(self)... |
class Install(install):
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass
@staticmethod
def _called_from_setup(run_frame):
'''
Attempt to detect whether run() was called from setup() or by another
command. If ... | 7 | 1 | 14 | 1 | 8 | 5 | 3 | 0.62 | 1 | 1 | 0 | 0 | 3 | 0 | 4 | 61 | 62 | 7 | 34 | 8 | 28 | 21 | 27 | 7 | 22 | 4 | 3 | 2 | 10 |
20,118 | saltstack/salt | saltstack_salt/setup.py | setup.InstallLib | from distutils.command.install_lib import install_lib
import os
class InstallLib(install_lib):
def run(self):
executables = ['salt/templates/git/ssh-id-wrapper', 'salt/templates/lxc/salt_tarball']
install_lib.run(self)
inp = self.get_inputs()
out = self.get_outputs()
chmod ... |
class InstallLib(install_lib):
def run(self):
pass | 2 | 0 | 19 | 2 | 16 | 1 | 5 | 0.06 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 41 | 20 | 2 | 17 | 9 | 15 | 1 | 14 | 9 | 12 | 5 | 2 | 3 | 5 |
20,119 | saltstack/salt | saltstack_salt/setup.py | setup.SaltDistribution | import distutils.dist
import os
import sys
from distutils.errors import DistutilsArgError
import glob
class SaltDistribution(distutils.dist.Distribution):
"""
Just so it's completely clear
Under windows, the following scripts should be installed:
* salt-call
* salt-cp
* salt-minio... |
class SaltDistribution(distutils.dist.Distribution):
'''
Just so it's completely clear
Under windows, the following scripts should be installed:
* salt-call
* salt-cp
* salt-minion
When packaged for salt-ssh, the following scripts should be installed:
* salt-call
... | 17 | 1 | 35 | 2 | 30 | 2 | 6 | 0.13 | 1 | 18 | 13 | 0 | 11 | 34 | 11 | 41 | 497 | 43 | 403 | 73 | 384 | 52 | 178 | 67 | 164 | 18 | 1 | 4 | 66 |
20,120 | saltstack/salt | saltstack_salt/setup.py | setup.Sdist | import os
from setuptools.command.sdist import sdist
class Sdist(sdist):
def make_release_tree(self, base_dir, files):
if self.distribution.ssh_packaging:
self.distribution.salt_ssh_packaging_file = PACKAGED_FOR_SALT_SSH_FILE
self.run_command('write_salt_ssh_packaging_file')
... |
class Sdist(sdist):
def make_release_tree(self, base_dir, files):
pass
def make_distribution(self):
pass | 3 | 0 | 9 | 1 | 8 | 1 | 2 | 0.06 | 1 | 0 | 0 | 1 | 2 | 0 | 2 | 71 | 20 | 3 | 16 | 3 | 13 | 1 | 14 | 3 | 11 | 2 | 3 | 1 | 4 |
20,121 | saltstack/salt | saltstack_salt/setup.py | setup.TestCommand | import subprocess
import sys
from distutils.cmd import Command
import os
class TestCommand(Command):
description = 'Run tests'
user_options = [('runtests-opts=', 'R', 'Command line options to pass to runtests.py')]
def initialize_options(self):
self.runtests_opts = None
def finalize_options(s... |
class TestCommand(Command):
def initialize_options(self):
pass
def finalize_options(self):
'''
Abstract method that is required to be overwritten
'''
pass
def run(self):
pass | 4 | 1 | 9 | 1 | 7 | 1 | 1 | 0.16 | 1 | 0 | 0 | 0 | 3 | 1 | 3 | 33 | 34 | 5 | 25 | 12 | 20 | 4 | 17 | 12 | 12 | 2 | 1 | 1 | 4 |
20,122 | saltstack/salt | saltstack_salt/setup.py | setup.WriteSaltSshPackagingFile | import os
from distutils.cmd import Command
class WriteSaltSshPackagingFile(Command):
description = "Write salt's ssh packaging file"
user_options = []
def initialize_options(self):
"""
Abstract method that is required to be overwritten
"""
def finalize_options(self):
... |
class WriteSaltSshPackagingFile(Command):
def initialize_options(self):
'''
Abstract method that is required to be overwritten
'''
pass
def finalize_options(self):
'''
Abstract method that is required to be overwritten
'''
pass
def run(self... | 4 | 2 | 6 | 0 | 3 | 3 | 2 | 0.62 | 1 | 0 | 0 | 0 | 3 | 0 | 3 | 33 | 26 | 5 | 13 | 6 | 9 | 8 | 11 | 6 | 7 | 3 | 1 | 2 | 5 |
20,123 | saltstack/salt | saltstack_salt/setup.py | setup.WriteSaltVersion | import os
from distutils import log
from distutils.cmd import Command
import sys
class WriteSaltVersion(Command):
description = "Write salt's hardcoded version file"
user_options = []
def initialize_options(self):
"""
Abstract method that is required to be overwritten
"""
def ... |
class WriteSaltVersion(Command):
def initialize_options(self):
'''
Abstract method that is required to be overwritten
'''
pass
def finalize_options(self):
'''
Abstract method that is required to be overwritten
'''
pass
def run(self):
... | 4 | 2 | 12 | 1 | 9 | 2 | 2 | 0.23 | 1 | 2 | 1 | 0 | 3 | 0 | 3 | 33 | 44 | 7 | 30 | 9 | 25 | 7 | 20 | 8 | 15 | 5 | 1 | 2 | 7 |
20,124 | saltstack/salt | saltstack_salt/tools/ci.py | tools.ci.TestRun | class TestRun(TypedDict):
type: str
skip_code_coverage: bool
from_filenames: NotRequired[str]
selected_tests: NotRequired[dict[str, bool]] | class TestRun(TypedDict):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 5 | 1 | 4 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 0 |
20,125 | saltstack/salt | saltstack_salt/tools/pkg/__init__.py | tools.pkg.Recompress | import tarfile
import tempfile
import shutil
import pathlib
import gzip
class Recompress:
"""
Helper class to re-compress a ``.tag.gz`` file to make it reproducible.
"""
def __init__(self, mtime):
self.mtime = int(mtime)
def tar_reset(self, tarinfo):
"""
Reset user, group,... |
class Recompress:
'''
Helper class to re-compress a ``.tag.gz`` file to make it reproducible.
'''
def __init__(self, mtime):
pass
def tar_reset(self, tarinfo):
'''
Reset user, group, mtime, and mode to create reproducible tar.
'''
pass
def recompre... | 4 | 3 | 16 | 0 | 14 | 3 | 3 | 0.26 | 0 | 5 | 0 | 0 | 3 | 1 | 3 | 3 | 55 | 4 | 42 | 16 | 38 | 11 | 34 | 12 | 30 | 4 | 0 | 4 | 8 |
20,126 | saltstack/salt | saltstack_salt/tools/precommit/workflows.py | tools.precommit.workflows.NeedsTracker | class NeedsTracker:
def __init__(self):
self._needs = []
def append(self, need):
if need not in self._needs:
self._needs.append(need)
def iter(self, consume=False):
if consume is False:
for need in self._needs:
yield need
return
... | class NeedsTracker:
def __init__(self):
pass
def append(self, need):
pass
def iter(self, consume=False):
pass
def __bool__(self):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 4 | 1 | 4 | 4 | 19 | 3 | 16 | 7 | 11 | 0 | 16 | 7 | 11 | 4 | 0 | 2 | 8 |
20,127 | saltstack/salt | saltstack_salt/tools/utils/__init__.py | tools.utils.ExitCode | from enum import IntEnum
class ExitCode(IntEnum):
OK = 0
FAIL = 1
SOFT_FAIL = 2 |
class ExitCode(IntEnum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 4 | 0 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 3 | 0 | 0 |
20,128 | saltstack/salt | saltstack_salt/tools/utils/__init__.py | tools.utils.Linux | import attr
@attr.s(frozen=True, slots=True)
class Linux(OS):
platform: str = attr.ib(default='linux')
fips: bool = attr.ib(default=False)
container: str = attr.ib(default=None)
@property
def job_name(self):
return f"test-{self.slug.replace('.', '')}{('-fips' if self.fips else '')}"
d... | @attr.s(frozen=True, slots=True)
class Linux(OS):
@property
def job_name(self):
pass
def as_dict(self):
pass | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,129 | saltstack/salt | saltstack_salt/tools/utils/__init__.py | tools.utils.MacOS | import attr
@attr.s(frozen=True, slots=True)
class MacOS(OS):
runner: str = attr.ib()
platform: str = attr.ib(default='macos')
@runner.default
def _default_runner(self):
return self.slug
@property
def job_name(self):
return f"test-{self.slug.replace('.', '')}"
def as_dict... | @attr.s(frozen=True, slots=True)
class MacOS(OS):
@runner.default
def _default_runner(self):
pass
@property
def job_name(self):
pass
def as_dict(self):
pass | 7 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 3 | 7 | 1 | 6 | 5 | 3 | 0 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
20,130 | saltstack/salt | saltstack_salt/tools/utils/__init__.py | tools.utils.OS | import attr
@attr.s(frozen=True, slots=True)
class OS:
platform: str = attr.ib()
slug: str = attr.ib()
arch: str = attr.ib()
display_name: str = attr.ib(default=None)
pkg_type: str = attr.ib(default=None)
@arch.default
def _default_arch(self):
return self._get_default_arch()
d... | @attr.s(frozen=True, slots=True)
class OS:
@arch.default
def _default_arch(self):
pass
def _get_default_arch(self):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 0 | 0 | 3 | 2 | 0 | 2 | 2 | 17 | 2 | 15 | 9 | 11 | 0 | 14 | 8 | 11 | 3 | 0 | 1 | 4 |
20,131 | saltstack/salt | saltstack_salt/tools/utils/__init__.py | tools.utils.PlatformDefinitions | class PlatformDefinitions(TypedDict):
linux: list[Linux]
macos: list[MacOS]
windows: list[Windows] | class PlatformDefinitions(TypedDict):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 1 | 3 | 0 | 4 | 1 | 3 | 0 | 1 | 0 | 0 |
20,132 | saltstack/salt | saltstack_salt/tools/utils/__init__.py | tools.utils.Version | import packaging.version
class Version(packaging.version.Version):
def __lt__(self, other):
if not isinstance(other, self.__class__):
other = self.__class__(other)
return super().__lt__(other)
def __le__(self, other):
if not isinstance(other, self.__class__):
o... |
class Version(packaging.version.Version):
def __lt__(self, other):
pass
def __le__(self, other):
pass
def __eq__(self, other):
pass
def __ge__(self, other):
pass
def __gt__(self, other):
pass
def __ne__(self, other):
pass
def __str__(se... | 9 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 8 | 0 | 8 | 32 | 36 | 7 | 29 | 9 | 20 | 0 | 29 | 9 | 20 | 2 | 2 | 1 | 14 |
20,133 | saltstack/salt | saltstack_salt/tools/utils/__init__.py | tools.utils.Windows | import attr
@attr.s(frozen=True, slots=True)
class Windows(OS):
platform: str = attr.ib(default='windows')
def _get_default_arch(self):
return 'amd64'
@property
def job_name(self):
return f"test-{self.slug.replace('.', '')}"
def as_dict(self):
return {'platform': self.pla... | @attr.s(frozen=True, slots=True)
class Windows(OS):
def _get_default_arch(self):
pass
@property
def job_name(self):
pass
def as_dict(self):
pass | 6 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 3 | 5 | 1 | 4 | 3 | 2 | 0 | 4 | 3 | 2 | 1 | 1 | 0 | 1 |
20,134 | saltstack/salt | saltstack_salt/tools/utils/repo.py | tools.utils.repo.UpdateProgress | class UpdateProgress:
def __init__(self, progress, task):
self.progress = progress
self.task = task
def __call__(self, chunk_size):
self.progress.update(self.task, advance=chunk_size) | class UpdateProgress:
def __init__(self, progress, task):
pass
def __call__(self, chunk_size):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 7 | 1 | 6 | 5 | 3 | 0 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
20,135 | saltstack/salt | saltstack_salt/doc/_ext/vaultpolicylexer.py | vaultpolicylexer.VaultPolicyLexer | from pygments.lexer import bygroups, inherit
from pygments.lexers.configs import TerraformLexer
from pygments.token import Keyword, Name, Punctuation, Whitespace
class VaultPolicyLexer(TerraformLexer):
aliases = ['vaultpolicy']
filenames = ['*.hcl']
mimetypes = ['application/x-hcl-policy']
tokens = {'b... |
class VaultPolicyLexer(TerraformLexer):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 16 | 1 | 15 | 5 | 14 | 0 | 5 | 5 | 4 | 0 | 7 | 0 | 0 |
20,136 | aleju/imgaug | aleju_imgaug/checks/check_deprecation_warning.py | check_deprecation_warning.Dummy1 | import imgaug as ia
class Dummy1(object):
@ia.deprecated(alt_func='Foo')
def __init__(self):
pass |
class Dummy1(object):
@ia.deprecated(alt_func='Foo')
def __init__(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 4 | 0 | 4 | 3 | 1 | 0 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
20,137 | aleju/imgaug | aleju_imgaug/checks/check_deprecation_warning.py | check_deprecation_warning.Dummy2 | import imgaug as ia
class Dummy2(object):
@ia.deprecated(alt_func='Foo', comment='Some example comment.')
def __init__(self):
pass |
class Dummy2(object):
@ia.deprecated(alt_func='Foo', comment='Some example comment.')
def __init__(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 4 | 0 | 4 | 3 | 1 | 0 | 3 | 2 | 1 | 1 | 1 | 0 | 1 |
20,138 | aleju/imgaug | aleju_imgaug/checks/check_deprecation_warning.py | check_deprecation_warning.Dummy3 | import imgaug as ia
class Dummy3(object):
def __init__(self):
pass
@ia.deprecated(alt_func='bar()', comment='Some example comment.')
def foo(self):
pass |
class Dummy3(object):
def __init__(self):
pass
@ia.deprecated(alt_func='bar()', comment='Some example comment.')
def foo(self):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 1 | 7 | 5 | 2 | 0 | 5 | 3 | 2 | 1 | 1 | 0 | 2 |
20,139 | aleju/imgaug | aleju_imgaug/checks/check_elastic_transformation.py | check_elastic_transformation.ElasticTransformationCv2 | import imgaug as ia
import six.moves as sm
import cv2
import numpy as np
from imgaug.augmenters import meta
from imgaug import augmenters as iaa
from scipy import ndimage
class ElasticTransformationCv2(iaa.ElasticTransformation):
@classmethod
def map_coordinates(cls, image, dx, dy, order=1, cval=0, mode='cons... |
class ElasticTransformationCv2(iaa.ElasticTransformation):
@classmethod
def map_coordinates(cls, image, dx, dy, order=1, cval=0, mode='constant'):
pass | 3 | 0 | 91 | 11 | 77 | 3 | 17 | 0.04 | 1 | 3 | 0 | 0 | 0 | 0 | 1 | 1 | 93 | 11 | 79 | 26 | 76 | 3 | 61 | 25 | 59 | 17 | 1 | 4 | 17 |
20,140 | aleju/imgaug | aleju_imgaug/checks/check_elastic_transformation.py | check_elastic_transformation.ElasticTransformationScipy | import imgaug as ia
import numpy as np
from imgaug import augmenters as iaa
import cv2
from scipy import ndimage
from imgaug.augmenters import meta
import six.moves as sm
class ElasticTransformationScipy(iaa.ElasticTransformation):
@classmethod
def map_coordinates(cls, image, dx, dy, order=1, cval=0, mode='co... |
class ElasticTransformationScipy(iaa.ElasticTransformation):
@classmethod
def map_coordinates(cls, image, dx, dy, order=1, cval=0, mode='constant'):
pass | 3 | 0 | 91 | 11 | 77 | 3 | 17 | 0.04 | 1 | 3 | 0 | 0 | 0 | 0 | 1 | 1 | 93 | 11 | 79 | 26 | 76 | 3 | 61 | 25 | 59 | 17 | 1 | 4 | 17 |
20,141 | aleju/imgaug | aleju_imgaug/checks/check_multicore_pool.py | check_multicore_pool.PoolWithMarkedWorker | import imgaug.multicore as multicore
import multiprocessing
class PoolWithMarkedWorker(multicore.Pool):
def __init__(self, *args, **kwargs):
super(PoolWithMarkedWorker, self).__init__(*args, **kwargs)
@classmethod
def _worker(cls, batch_idx, batch):
process_name = multiprocessing.current_... |
class PoolWithMarkedWorker(multicore.Pool):
def __init__(self, *args, **kwargs):
pass
@classmethod
def _worker(cls, batch_idx, batch):
pass | 4 | 0 | 5 | 0 | 4 | 1 | 2 | 0.1 | 1 | 1 | 0 | 0 | 1 | 0 | 2 | 18 | 12 | 1 | 10 | 6 | 6 | 1 | 9 | 5 | 6 | 3 | 2 | 2 | 4 |
20,142 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/base.py | imgaug.augmentables.base.IAugmentable | class IAugmentable(object):
"""Interface of augmentable objects.
This interface is right now only used to "mark" augmentable objects.
It does not enforce any methods yet (but will probably in the future).
Currently, only ``*OnImage`` clases are marked as augmentable.
Non-OnImage objects are normal... | class IAugmentable(object):
'''Interface of augmentable objects.
This interface is right now only used to "mark" augmentable objects.
It does not enforce any methods yet (but will probably in the future).
Currently, only ``*OnImage`` clases are marked as augmentable.
Non-OnImage objects are normaliz... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 8 | 1 | 0 | 0 | 6 | 0 | 0 | 0 | 0 | 13 | 4 | 1 | 1 | 0 | 8 | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
20,143 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/batches.py | imgaug.augmentables.batches.Batch | from .. import imgaug as ia
from . import utils
class Batch(object):
"""
Class encapsulating a batch before and after augmentation.
Parameters
----------
images : None or (N,H,W,C) ndarray or list of (H,W,C) ndarray
The images to augment.
heatmaps : None or list of imgaug.augmentables... |
class Batch(object):
'''
Class encapsulating a batch before and after augmentation.
Parameters
----------
images : None or (N,H,W,C) ndarray or list of (H,W,C) ndarray
The images to augment.
heatmaps : None or list of imgaug.augmentables.heatmaps.HeatmapsOnImage
The heatmaps to ... | 24 | 12 | 19 | 3 | 8 | 9 | 1 | 1.26 | 1 | 1 | 1 | 0 | 11 | 15 | 11 | 11 | 297 | 55 | 107 | 51 | 67 | 135 | 58 | 30 | 44 | 2 | 1 | 1 | 15 |
20,144 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/batches.py | imgaug.augmentables.batches.UnnormalizedBatch | from . import normalization as nlib
class UnnormalizedBatch(object):
"""
Class for batches of unnormalized data before and after augmentation.
Parameters
----------
images : None or (N,H,W,C) ndarray or (N,H,W) ndarray or iterable of (H,W,C) ndarray or iterable of (H,W) ndarray
The images ... |
class UnnormalizedBatch(object):
'''
Class for batches of unnormalized data before and after augmentation.
Parameters
----------
images : None or (N,H,W,C) ndarray or (N,H,W) ndarray or iterable of (H,W,C) ndarray or iterable of (H,W) ndarray
The images to augment.
heatmaps : None or (N... | 6 | 6 | 35 | 4 | 18 | 12 | 1 | 1.44 | 1 | 1 | 1 | 0 | 5 | 15 | 5 | 5 | 267 | 40 | 93 | 28 | 85 | 134 | 46 | 25 | 40 | 2 | 1 | 1 | 6 |
20,145 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/batches.py | imgaug.augmentables.batches._BatchInAugmentation | from . import utils
from .. import imgaug as ia
import numpy as np
class _BatchInAugmentation(object):
"""
Class encapsulating a batch during the augmentation process.
Data within the batch is already verified and normalized, similar to
:class:`Batch`. Data within the batch may be changed in-place. No... |
class _BatchInAugmentation(object):
'''
Class encapsulating a batch during the augmentation process.
Data within the batch is already verified and normalized, similar to
:class:`Batch`. Data within the batch may be changed in-place. No initial
copy is needed.
Added in 0.4.0.
Parameters
... | 19 | 16 | 27 | 5 | 9 | 13 | 3 | 1.51 | 1 | 6 | 2 | 0 | 15 | 8 | 15 | 15 | 455 | 101 | 142 | 54 | 121 | 215 | 115 | 49 | 99 | 9 | 1 | 5 | 41 |
20,146 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/batches.py | imgaug.augmentables.batches._BatchInAugmentationPropagationContext | class _BatchInAugmentationPropagationContext(object):
def __init__(self, batch, augmenter, hooks, parents):
self.batch = batch
self.augmenter = augmenter
self.hooks = hooks
self.parents = parents
self.noned_info = None
def __enter__(self):
if self.hooks is not N... | class _BatchInAugmentationPropagationContext(object):
def __init__(self, batch, augmenter, hooks, parents):
pass
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 3 | 5 | 3 | 3 | 18 | 2 | 16 | 9 | 12 | 0 | 14 | 9 | 10 | 2 | 1 | 1 | 5 |
20,147 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/bbs.py | imgaug.augmentables.bbs.BoundingBox | import copy
from .. import imgaug as ia
import skimage.measure
import numpy as np
from .utils import normalize_imglike_shape, project_coords, _remove_out_of_image_fraction_, _normalize_shift_args, _handle_on_image_shape
import skimage.draw
class BoundingBox(object):
"""Class representing bounding boxes.
Each ... |
class BoundingBox(object):
'''Class representing bounding boxes.
Each bounding box is parameterized by its top left and bottom right
corners. Both are given as x and y-coordinates. The corners are intended
to lie inside the bounding box area. As a result, a bounding box that lies
completely inside ... | 57 | 43 | 28 | 5 | 8 | 15 | 2 | 1.96 | 1 | 10 | 3 | 0 | 43 | 5 | 44 | 44 | 1,335 | 269 | 360 | 128 | 291 | 706 | 256 | 107 | 208 | 15 | 1 | 3 | 90 |
20,148 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/bbs.py | imgaug.augmentables.bbs.BoundingBoxesOnImage | from .. import imgaug as ia
import copy
from .base import IAugmentable
from .utils import normalize_imglike_shape, project_coords, _remove_out_of_image_fraction_, _normalize_shift_args, _handle_on_image_shape
import numpy as np
class BoundingBoxesOnImage(IAugmentable):
"""Container for the list of all bounding box... |
class BoundingBoxesOnImage(IAugmentable):
'''Container for the list of all bounding boxes on a single image.
Parameters
----------
bounding_boxes : list of imgaug.augmentables.bbs.BoundingBox
List of bounding boxes on the image.
shape : tuple of int
The shape of the image on which t... | 43 | 32 | 21 | 4 | 5 | 12 | 1 | 2.44 | 1 | 7 | 3 | 0 | 32 | 2 | 34 | 34 | 795 | 184 | 178 | 66 | 130 | 435 | 130 | 55 | 93 | 3 | 2 | 1 | 49 |
20,149 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/bbs.py | imgaug.augmentables.bbs._LabelOnImageDrawer | from .. import imgaug as ia
import numpy as np
class _LabelOnImageDrawer(object):
def __init__(self, color=(0, 255, 0), color_text=None, color_bg=None, size=1, alpha=1.0, raise_if_out_of_image=False, height=30, size_text=20):
self.color = color
self.color_text = color_text
self.color_bg = ... |
class _LabelOnImageDrawer(object):
def __init__(self, color=(0, 255, 0), color_text=None, color_bg=None, size=1, alpha=1.0, raise_if_out_of_image=False, height=30, size_text=20):
pass
def draw_on_image_(self, image, bounding_box):
pass
def draw_on_image_(self, image, bounding_box):
... | 11 | 0 | 14 | 1 | 11 | 1 | 2 | 0.09 | 1 | 2 | 0 | 0 | 6 | 8 | 8 | 8 | 120 | 18 | 94 | 40 | 80 | 8 | 66 | 35 | 57 | 5 | 1 | 1 | 16 |
20,150 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/heatmaps.py | imgaug.augmentables.heatmaps.HeatmapsOnImage | from .base import IAugmentable
import numpy as np
from .. import imgaug as ia
import six.moves as sm
class HeatmapsOnImage(IAugmentable):
"""Object representing heatmaps on a single image.
Parameters
----------
arr : (H,W) ndarray or (H,W,C) ndarray
Array representing the heatmap(s) on a singl... |
class HeatmapsOnImage(IAugmentable):
'''Object representing heatmaps on a single image.
Parameters
----------
arr : (H,W) ndarray or (H,W,C) ndarray
Array representing the heatmap(s) on a single image.
Multiple heatmaps may be provided, in which case ``C`` is expected to
denote ... | 23 | 18 | 35 | 5 | 14 | 16 | 2 | 1.32 | 1 | 2 | 0 | 0 | 14 | 5 | 17 | 17 | 674 | 121 | 238 | 73 | 210 | 315 | 134 | 67 | 112 | 4 | 2 | 2 | 32 |
20,151 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/kps.py | imgaug.augmentables.kps.Keypoint | import numpy as np
from .. import imgaug as ia
from .utils import normalize_imglike_shape, project_coords, _remove_out_of_image_fraction_, _handle_on_image_shape
class Keypoint(object):
"""A single keypoint (aka landmark) on an image.
Parameters
----------
x : number
Coordinate of the keypoint... |
class Keypoint(object):
'''A single keypoint (aka landmark) on an image.
Parameters
----------
x : number
Coordinate of the keypoint on the x axis.
y : number
Coordinate of the keypoint on the y axis.
'''
def __init__(self, x, y):
pass
@property
def coords(s... | 26 | 18 | 25 | 5 | 7 | 13 | 2 | 1.82 | 1 | 7 | 0 | 0 | 20 | 2 | 20 | 20 | 535 | 118 | 148 | 64 | 120 | 270 | 116 | 57 | 95 | 11 | 1 | 2 | 39 |
20,152 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/kps.py | imgaug.augmentables.kps.KeypointsOnImage | import numpy as np
import six.moves as sm
from .utils import normalize_imglike_shape, project_coords, _remove_out_of_image_fraction_, _handle_on_image_shape
from .base import IAugmentable
from .. import imgaug as ia
class KeypointsOnImage(IAugmentable):
"""Container for all keypoints on a single image.
Parame... |
class KeypointsOnImage(IAugmentable):
'''Container for all keypoints on a single image.
Parameters
----------
keypoints : list of imgaug.augmentables.kps.Keypoint
List of keypoints on the image.
shape : tuple of int
The shape of the image on which the objects are placed, i.e. the
... | 45 | 31 | 25 | 5 | 7 | 13 | 2 | 1.77 | 1 | 9 | 1 | 0 | 29 | 2 | 33 | 33 | 881 | 186 | 252 | 99 | 203 | 447 | 194 | 85 | 160 | 11 | 2 | 3 | 68 |
20,153 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/lines.py | imgaug.augmentables.lines.LineString | from .utils import normalize_imglike_shape, project_coords_, interpolate_points, _remove_out_of_image_fraction_, _normalize_shift_args, _handle_on_image_shape
from .. import imgaug as ia
import copy as copylib
import numpy as np
import skimage.draw
import skimage.measure
import cv2
class LineString(object):
"""Cla... |
class LineString(object):
'''Class representing line strings.
A line string is a collection of connected line segments, each
having a start and end point. Each point is given as its ``(x, y)``
absolute (sub-)pixel coordinates. The end point of each segment is
also the start point of the next segmen... | 55 | 45 | 33 | 6 | 11 | 17 | 3 | 1.6 | 1 | 15 | 6 | 0 | 46 | 2 | 46 | 46 | 1,622 | 321 | 501 | 170 | 415 | 800 | 349 | 144 | 289 | 18 | 1 | 4 | 127 |
20,154 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/lines.py | imgaug.augmentables.lines.LineStringsOnImage | import numpy as np
from .base import IAugmentable
from .. import imgaug as ia
from .utils import normalize_imglike_shape, project_coords_, interpolate_points, _remove_out_of_image_fraction_, _normalize_shift_args, _handle_on_image_shape
class LineStringsOnImage(IAugmentable):
"""Object that represents all line str... |
class LineStringsOnImage(IAugmentable):
'''Object that represents all line strings on a single image.
Parameters
----------
line_strings : list of imgaug.augmentables.lines.LineString
List of line strings on the image.
shape : tuple of int or ndarray
The shape of the image on which ... | 33 | 26 | 24 | 5 | 5 | 14 | 1 | 2.65 | 1 | 6 | 2 | 0 | 27 | 2 | 28 | 28 | 727 | 160 | 156 | 58 | 116 | 413 | 112 | 48 | 81 | 3 | 2 | 1 | 41 |
20,155 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/polys.py | imgaug.augmentables.polys.MultiPolygon | class MultiPolygon(object):
"""
Class that represents several polygons.
Parameters
----------
geoms : list of imgaug.augmentables.polys.Polygon
List of the polygons.
"""
def __init__(self, geoms):
"""Create a new MultiPolygon instance."""
assert len(geoms) == 0 or ... | class MultiPolygon(object):
'''
Class that represents several polygons.
Parameters
----------
geoms : list of imgaug.augmentables.polys.Polygon
List of the polygons.
'''
def __init__(self, geoms):
'''Create a new MultiPolygon instance.'''
pass
@staticmethod
d... | 4 | 3 | 29 | 4 | 17 | 8 | 3 | 0.64 | 1 | 4 | 1 | 0 | 1 | 1 | 2 | 2 | 69 | 10 | 36 | 6 | 31 | 23 | 14 | 5 | 10 | 4 | 1 | 1 | 5 |
20,156 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/polys.py | imgaug.augmentables.polys.Polygon | import numpy as np
from .. import imgaug as ia
import skimage.measure
import skimage.draw
from .utils import normalize_imglike_shape, interpolate_points, _remove_out_of_image_fraction_, project_coords_, _normalize_shift_args, _handle_on_image_shape
class Polygon(object):
"""Class representing polygons.
Each p... |
class Polygon(object):
'''Class representing polygons.
Each polygon is parameterized by its corner points, given as absolute
x- and y-coordinates with sub-pixel accuracy.
Parameters
----------
exterior : list of imgaug.augmentables.kps.Keypoint or list of tuple of float or (N,2) ndarray
... | 57 | 42 | 28 | 5 | 8 | 15 | 2 | 1.8 | 1 | 8 | 3 | 0 | 42 | 2 | 43 | 43 | 1,347 | 263 | 387 | 132 | 311 | 697 | 270 | 109 | 217 | 14 | 1 | 3 | 97 |
20,157 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/polys.py | imgaug.augmentables.polys.PolygonsOnImage | from .utils import normalize_imglike_shape, interpolate_points, _remove_out_of_image_fraction_, project_coords_, _normalize_shift_args, _handle_on_image_shape
from .base import IAugmentable
import numpy as np
class PolygonsOnImage(IAugmentable):
"""Container for all polygons on a single image.
Parameters
... |
class PolygonsOnImage(IAugmentable):
'''Container for all polygons on a single image.
Parameters
----------
polygons : list of imgaug.augmentables.polys.Polygon
List of polygons on the image.
shape : tuple of int
The shape of the image on which the objects are placed, i.e. the
... | 32 | 26 | 24 | 5 | 5 | 14 | 1 | 2.73 | 1 | 4 | 1 | 0 | 28 | 2 | 28 | 28 | 731 | 163 | 153 | 57 | 113 | 417 | 108 | 46 | 78 | 3 | 2 | 1 | 41 |
20,158 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/polys.py | imgaug.augmentables.polys._ConcavePolygonRecoverer | from .. import imgaug as ia
import collections
import traceback
import six.moves as sm
import scipy.spatial.distance
from .. import random as iarandom
import numpy as np
class _ConcavePolygonRecoverer(object):
def __init__(self, threshold_duplicate_points=0.0001, noise_strength=0.0001, oversampling=0.01, max_segm... |
class _ConcavePolygonRecoverer(object):
def __init__(self, threshold_duplicate_points=0.0001, noise_strength=0.0001, oversampling=0.01, max_segment_difference=0.0001):
pass
def recover_from(self, new_exterior, old_polygon, random_state=0):
pass
def _remove_consecutive_duplicate_points(se... | 17 | 0 | 47 | 5 | 34 | 8 | 5 | 0.25 | 1 | 12 | 2 | 1 | 8 | 12 | 11 | 11 | 576 | 65 | 409 | 146 | 387 | 102 | 277 | 135 | 262 | 15 | 1 | 5 | 70 |
20,159 | aleju/imgaug | aleju_imgaug/imgaug/augmentables/segmaps.py | imgaug.augmentables.segmaps.SegmentationMapsOnImage | from .base import IAugmentable
import six.moves as sm
from ..augmenters import blend as blendlib
import numpy as np
from .. import imgaug as ia
class SegmentationMapsOnImage(IAugmentable):
"""
Object representing a segmentation map associated with an image.
Attributes
----------
DEFAULT_SEGMENT_CO... |
class SegmentationMapsOnImage(IAugmentable):
'''
Object representing a segmentation map associated with an image.
Attributes
----------
DEFAULT_SEGMENT_COLORS : list of tuple of int
Standard RGB colors to use during drawing, ordered by class index.
Parameters
----------
arr : (H... | 15 | 11 | 39 | 6 | 17 | 17 | 3 | 1.12 | 1 | 6 | 0 | 0 | 11 | 3 | 11 | 11 | 546 | 83 | 239 | 47 | 218 | 267 | 110 | 41 | 95 | 11 | 2 | 3 | 40 |
20,160 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Add | from . import meta
from .. import parameters as iap
class Add(meta.Augmenter):
"""
Add a value to all pixels in an image.
**Supported dtypes**:
See :func:`~imgaug.augmenters.arithmetic.add_scalar`.
Parameters
----------
value : number or tuple of number or list of number or imgaug.parame... |
class Add(meta.Augmenter):
'''
Add a value to all pixels in an image.
**Supported dtypes**:
See :func:`~imgaug.augmenters.arithmetic.add_scalar`.
Parameters
----------
value : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
Value to add... | 4 | 2 | 20 | 3 | 11 | 6 | 2 | 2.24 | 1 | 3 | 0 | 0 | 3 | 2 | 3 | 55 | 139 | 29 | 34 | 18 | 28 | 76 | 24 | 16 | 20 | 5 | 2 | 2 | 7 |
20,161 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.AddElementwise | from .. import parameters as iap
from . import meta
class AddElementwise(meta.Augmenter):
"""
Add to the pixels of images values that are pixelwise randomly sampled.
While the ``Add`` Augmenter samples one value to add *per image* (and
optionally per channel), this augmenter samples different values p... |
class AddElementwise(meta.Augmenter):
'''
Add to the pixels of images values that are pixelwise randomly sampled.
While the ``Add`` Augmenter samples one value to add *per image* (and
optionally per channel), this augmenter samples different values per image
and *per pixel* (and optionally per chan... | 4 | 2 | 12 | 2 | 10 | 0 | 2 | 1.97 | 1 | 3 | 0 | 3 | 3 | 2 | 3 | 55 | 119 | 27 | 31 | 17 | 25 | 61 | 21 | 15 | 17 | 4 | 2 | 1 | 6 |
20,162 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.AdditiveGaussianNoise | from .. import parameters as iap
class AdditiveGaussianNoise(AddElementwise):
"""
Add noise sampled from gaussian distributions elementwise to images.
This augmenter samples and adds noise elementwise, i.e. it can add
different noise values to neighbouring pixels and is comparable
to ``AddElementw... |
class AdditiveGaussianNoise(AddElementwise):
'''
Add noise sampled from gaussian distributions elementwise to images.
This augmenter samples and adds noise elementwise, i.e. it can add
different noise values to neighbouring pixels and is comparable
to ``AddElementwise``.
**Supported dtypes**:
... | 2 | 1 | 16 | 2 | 14 | 0 | 1 | 4.67 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 56 | 108 | 23 | 15 | 7 | 11 | 70 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
20,163 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.AdditiveLaplaceNoise | from .. import parameters as iap
class AdditiveLaplaceNoise(AddElementwise):
"""
Add noise sampled from laplace distributions elementwise to images.
The laplace distribution is similar to the gaussian distribution, but
puts more weight on the long tail. Hence, this noise will add more
outliers (ve... |
class AdditiveLaplaceNoise(AddElementwise):
'''
Add noise sampled from laplace distributions elementwise to images.
The laplace distribution is similar to the gaussian distribution, but
puts more weight on the long tail. Hence, this noise will add more
outliers (very high/low values). It is somewhe... | 2 | 1 | 17 | 2 | 15 | 0 | 1 | 4.94 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 56 | 120 | 25 | 16 | 7 | 12 | 79 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
20,164 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.AdditivePoissonNoise | from .. import parameters as iap
class AdditivePoissonNoise(AddElementwise):
"""
Add noise sampled from poisson distributions elementwise to images.
Poisson noise is comparable to gaussian noise, as e.g. generated via
``AdditiveGaussianNoise``. As poisson distributions produce only positive
number... |
class AdditivePoissonNoise(AddElementwise):
'''
Add noise sampled from poisson distributions elementwise to images.
Poisson noise is comparable to gaussian noise, as e.g. generated via
``AdditiveGaussianNoise``. As poisson distributions produce only positive
numbers, the sign of the sampled values ... | 2 | 1 | 14 | 2 | 12 | 0 | 1 | 5.46 | 1 | 3 | 2 | 0 | 1 | 0 | 1 | 56 | 109 | 25 | 13 | 6 | 9 | 71 | 5 | 4 | 3 | 1 | 3 | 0 | 1 |
20,165 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.CoarseDropout | from .. import parameters as iap
class CoarseDropout(MultiplyElementwise):
"""
Set rectangular areas within images to zero.
In contrast to ``Dropout``, these areas can have larger sizes.
(E.g. you might end up with three large black rectangles in an image.)
Note that the current implementation lea... |
class CoarseDropout(MultiplyElementwise):
'''
Set rectangular areas within images to zero.
In contrast to ``Dropout``, these areas can have larger sizes.
(E.g. you might end up with three large black rectangles in an image.)
Note that the current implementation leads to correlated sizes,
so if ... | 2 | 1 | 26 | 2 | 22 | 2 | 3 | 5.35 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 56 | 176 | 30 | 23 | 6 | 18 | 123 | 8 | 3 | 6 | 3 | 3 | 1 | 3 |
20,166 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.CoarsePepper | from .. import parameters as iap
class CoarsePepper(ReplaceElementwise):
"""
Replace rectangular areas in images with black-ish pixel noise.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceElementwise`.
Parameters
----------
p : float or tuple of float or list of f... |
class CoarsePepper(ReplaceElementwise):
'''
Replace rectangular areas in images with black-ish pixel noise.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceElementwise`.
Parameters
----------
p : float or tuple of float or list of float or imgaug.parameters.Stochastic... | 2 | 1 | 30 | 3 | 27 | 0 | 3 | 3.18 | 1 | 4 | 3 | 0 | 1 | 0 | 1 | 56 | 138 | 21 | 28 | 9 | 23 | 89 | 10 | 6 | 8 | 3 | 3 | 1 | 3 |
20,167 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.CoarseSalt | from .. import parameters as iap
class CoarseSalt(ReplaceElementwise):
"""
Replace rectangular areas in images with white-ish pixel noise.
See also the similar ``CoarseSaltAndPepper``.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceElementwise`.
Parameters
------... |
class CoarseSalt(ReplaceElementwise):
'''
Replace rectangular areas in images with white-ish pixel noise.
See also the similar ``CoarseSaltAndPepper``.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceElementwise`.
Parameters
----------
p : float or tuple of float ... | 2 | 1 | 30 | 3 | 27 | 0 | 3 | 3.21 | 1 | 4 | 3 | 0 | 1 | 0 | 1 | 56 | 140 | 22 | 28 | 9 | 23 | 90 | 10 | 6 | 8 | 3 | 3 | 1 | 3 |
20,168 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.CoarseSaltAndPepper | from .. import parameters as iap
class CoarseSaltAndPepper(ReplaceElementwise):
"""
Replace rectangular areas in images with white/black-ish pixel noise.
This adds salt and pepper noise (noisy white-ish and black-ish pixels) to
rectangular areas within the image. Note that this means that within these... |
class CoarseSaltAndPepper(ReplaceElementwise):
'''
Replace rectangular areas in images with white/black-ish pixel noise.
This adds salt and pepper noise (noisy white-ish and black-ish pixels) to
rectangular areas within the image. Note that this means that within these
rectangular areas the color v... | 2 | 1 | 25 | 3 | 22 | 0 | 3 | 4.52 | 1 | 3 | 2 | 0 | 1 | 0 | 1 | 56 | 155 | 28 | 23 | 8 | 18 | 104 | 9 | 5 | 7 | 3 | 3 | 1 | 3 |
20,169 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Cutout | from .. import parameters as iap
import imgaug as ia
from . import meta
import numpy as np
class Cutout(meta.Augmenter):
"""Fill one or more rectangular areas in an image using a fill mode.
See paper "Improved Regularization of Convolutional Neural Networks with
Cutout" by DeVries and Taylor.
In cont... |
class Cutout(meta.Augmenter):
'''Fill one or more rectangular areas in an image using a fill mode.
See paper "Improved Regularization of Convolutional Neural Networks with
Cutout" by DeVries and Taylor.
In contrast to the paper, this implementation also supports replacing
image sub-areas with gauss... | 9 | 2 | 25 | 3 | 22 | 1 | 2 | 1.02 | 1 | 12 | 4 | 0 | 4 | 7 | 6 | 58 | 329 | 60 | 134 | 59 | 112 | 137 | 69 | 46 | 60 | 3 | 2 | 2 | 13 |
20,170 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Dropout | class Dropout(MultiplyElementwise):
"""
Set a fraction of pixels in images to zero.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.MultiplyElementwise`.
Parameters
----------
p : float or tuple of float or imgaug.parameters.StochasticParameter, optional
The probab... | class Dropout(MultiplyElementwise):
'''
Set a fraction of pixels in images to zero.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.MultiplyElementwise`.
Parameters
----------
p : float or tuple of float or imgaug.parameters.StochasticParameter, optional
The probabili... | 2 | 1 | 10 | 1 | 9 | 0 | 1 | 6.1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 56 | 90 | 19 | 10 | 5 | 6 | 61 | 4 | 3 | 2 | 1 | 3 | 0 | 1 |
20,171 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Dropout2d | from . import meta
import numpy as np
class Dropout2d(meta.Augmenter):
"""Drop random channels from images.
For image data, dropped channels will be filled with zeros.
.. note::
This augmenter may also set the arrays of heatmaps and segmentation
maps to zero and remove all coordinate-bas... |
class Dropout2d(meta.Augmenter):
'''Drop random channels from images.
For image data, dropped channels will be filled with zeros.
.. note::
This augmenter may also set the arrays of heatmaps and segmentation
maps to zero and remove all coordinate-based data (e.g. it removes
all boun... | 5 | 2 | 25 | 4 | 18 | 4 | 5 | 1.25 | 1 | 6 | 0 | 0 | 4 | 11 | 4 | 56 | 198 | 36 | 72 | 36 | 65 | 90 | 59 | 34 | 54 | 11 | 2 | 3 | 18 |
20,172 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.ImpulseNoise | class ImpulseNoise(SaltAndPepper):
"""
Add impulse noise to images.
This is identical to ``SaltAndPepper``, except that `per_channel` is
always set to ``True``.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.SaltAndPepper`.
Parameters
----------
p : float or tupl... | class ImpulseNoise(SaltAndPepper):
'''
Add impulse noise to images.
This is identical to ``SaltAndPepper``, except that `per_channel` is
always set to ``True``.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.SaltAndPepper`.
Parameters
----------
p : float or tuple of... | 2 | 1 | 8 | 0 | 8 | 0 | 1 | 4.22 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 60 | 13 | 9 | 4 | 5 | 38 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,173 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Invert | import numpy as np
from .. import parameters as iap
from . import meta
class Invert(meta.Augmenter):
"""
Invert all values in images, e.g. turn ``5`` into ``255-5=250``.
For the standard value range of 0-255 it converts ``0`` to ``255``,
``255`` to ``0`` and ``10`` to ``(255-10)=245``.
Let ``M`` b... |
class Invert(meta.Augmenter):
'''
Invert all values in images, e.g. turn ``5`` into ``255-5=250``.
For the standard value range of 0-255 it converts ``0`` to ``255``,
``255`` to ``0`` and ``10`` to ``(255-10)=245``.
Let ``M`` be the maximum value possible, ``m`` the minimum value possible,
``v`... | 5 | 2 | 21 | 3 | 18 | 1 | 3 | 1.22 | 1 | 3 | 1 | 2 | 4 | 6 | 4 | 56 | 211 | 36 | 79 | 28 | 71 | 96 | 44 | 25 | 39 | 6 | 2 | 3 | 11 |
20,174 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.JpegCompression | from . import meta
from .. import parameters as iap
class JpegCompression(meta.Augmenter):
"""
Degrade the quality of images by JPEG-compressing them.
During JPEG compression, high frequency components (e.g. edges) are removed.
With low compression (strength) only the highest frequency components are
... |
class JpegCompression(meta.Augmenter):
'''
Degrade the quality of images by JPEG-compressing them.
During JPEG compression, high frequency components (e.g. edges) are removed.
With low compression (strength) only the highest frequency components are
removed, while very high compression (strength) w... | 4 | 2 | 9 | 1 | 7 | 1 | 2 | 2.59 | 1 | 4 | 0 | 0 | 3 | 1 | 3 | 55 | 99 | 20 | 22 | 11 | 16 | 57 | 15 | 9 | 11 | 3 | 2 | 1 | 5 |
20,175 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Multiply | from .. import parameters as iap
from . import meta
class Multiply(meta.Augmenter):
"""
Multiply all pixels in an image with a random value sampled once per image.
This augmenter can be used to make images lighter or darker.
**Supported dtypes**:
See :func:`~imgaug.augmenters.arithmetic.multiply... |
class Multiply(meta.Augmenter):
'''
Multiply all pixels in an image with a random value sampled once per image.
This augmenter can be used to make images lighter or darker.
**Supported dtypes**:
See :func:`~imgaug.augmenters.arithmetic.multiply_scalar`.
Parameters
----------
mul : numbe... | 4 | 2 | 20 | 2 | 11 | 7 | 2 | 2.24 | 1 | 3 | 0 | 0 | 3 | 2 | 3 | 55 | 138 | 28 | 34 | 18 | 28 | 76 | 24 | 16 | 20 | 5 | 2 | 2 | 7 |
20,176 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.MultiplyElementwise | from . import meta
from .. import parameters as iap
class MultiplyElementwise(meta.Augmenter):
"""
Multiply image pixels with values that are pixelwise randomly sampled.
While the ``Multiply`` Augmenter uses a constant multiplier *per
image* (and optionally channel), this augmenter samples the multipl... |
class MultiplyElementwise(meta.Augmenter):
'''
Multiply image pixels with values that are pixelwise randomly sampled.
While the ``Multiply`` Augmenter uses a constant multiplier *per
image* (and optionally channel), this augmenter samples the multipliers
to use per image and *per pixel* (and option... | 4 | 2 | 16 | 2 | 12 | 2 | 2 | 1.73 | 1 | 6 | 2 | 2 | 3 | 2 | 3 | 55 | 129 | 28 | 37 | 18 | 31 | 64 | 24 | 16 | 20 | 5 | 2 | 2 | 7 |
20,177 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Pepper | from .. import parameters as iap
class Pepper(ReplaceElementwise):
"""
Replace pixels in images with pepper noise, i.e. black-ish pixels.
This augmenter is similar to ``SaltAndPepper``, but adds no salt noise to
images.
This augmenter is similar to ``Dropout``, but slower and the black pixels
... |
class Pepper(ReplaceElementwise):
'''
Replace pixels in images with pepper noise, i.e. black-ish pixels.
This augmenter is similar to ``SaltAndPepper``, but adds no salt noise to
images.
This augmenter is similar to ``Dropout``, but slower and the black pixels
are not uniformly black.
**Sup... | 2 | 1 | 16 | 1 | 15 | 0 | 1 | 3.13 | 1 | 3 | 2 | 0 | 1 | 0 | 1 | 56 | 82 | 16 | 16 | 6 | 12 | 50 | 5 | 4 | 3 | 1 | 3 | 0 | 1 |
20,178 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.ReplaceElementwise | from .. import parameters as iap
from . import meta
import numpy as np
class ReplaceElementwise(meta.Augmenter):
"""
Replace pixels in an image with new values.
**Supported dtypes**:
See :func:`~imgaug.augmenters.arithmetic.replace_elementwise_`.
Parameters
----------
mask : float or tup... |
class ReplaceElementwise(meta.Augmenter):
'''
Replace pixels in an image with new values.
**Supported dtypes**:
See :func:`~imgaug.augmenters.arithmetic.replace_elementwise_`.
Parameters
----------
mask : float or tuple of float or list of float or imgaug.parameters.StochasticParameter
... | 4 | 2 | 20 | 2 | 14 | 3 | 2 | 2.16 | 1 | 4 | 0 | 6 | 3 | 3 | 3 | 55 | 168 | 29 | 44 | 19 | 38 | 95 | 27 | 17 | 23 | 5 | 2 | 2 | 7 |
20,179 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Salt | from .. import parameters as iap
class Salt(ReplaceElementwise):
"""
Replace pixels in images with salt noise, i.e. white-ish pixels.
This augmenter is similar to ``SaltAndPepper``, but adds no pepper noise to
images.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceEle... |
class Salt(ReplaceElementwise):
'''
Replace pixels in images with salt noise, i.e. white-ish pixels.
This augmenter is similar to ``SaltAndPepper``, but adds no pepper noise to
images.
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceElementwise`.
Parameters
------... | 2 | 1 | 17 | 1 | 15 | 1 | 1 | 3.06 | 1 | 3 | 2 | 0 | 1 | 0 | 1 | 56 | 80 | 15 | 16 | 6 | 12 | 49 | 5 | 4 | 3 | 1 | 3 | 0 | 1 |
20,180 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.SaltAndPepper | from .. import parameters as iap
class SaltAndPepper(ReplaceElementwise):
"""
Replace pixels in images with salt/pepper noise (white/black-ish colors).
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceElementwise`.
Parameters
----------
p : float or tuple of float o... |
class SaltAndPepper(ReplaceElementwise):
'''
Replace pixels in images with salt/pepper noise (white/black-ish colors).
**Supported dtypes**:
See :class:`~imgaug.augmenters.arithmetic.ReplaceElementwise`.
Parameters
----------
p : float or tuple of float or list of float or imgaug.parameters... | 2 | 1 | 9 | 0 | 9 | 0 | 1 | 5 | 1 | 2 | 1 | 1 | 1 | 0 | 1 | 56 | 74 | 14 | 10 | 4 | 6 | 50 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,181 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.Solarize | class Solarize(Invert):
"""Invert all pixel values above a threshold.
This is the same as :class:`Invert`, but sets a default threshold around
``128`` (+/- 64, decided per image) and default `invert_above_threshold`
to ``True`` (i.e. only values above the threshold will be inverted).
See :class:`I... | class Solarize(Invert):
'''Invert all pixel values above a threshold.
This is the same as :class:`Invert`, but sets a default threshold around
``128`` (+/- 64, decided per image) and default `invert_above_threshold`
to ``True`` (i.e. only values above the threshold will be inverted).
See :class:`Inv... | 2 | 1 | 10 | 0 | 10 | 0 | 1 | 3.91 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 57 | 72 | 18 | 11 | 5 | 6 | 43 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,182 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic.TotalDropout | import imgaug as ia
from . import meta
import numpy as np
class TotalDropout(meta.Augmenter):
"""Drop all channels of a defined fraction of all images.
For image data, all components of dropped images will be filled with zeros.
.. note::
This augmenter also sets the arrays of heatmaps and segmen... |
class TotalDropout(meta.Augmenter):
'''Drop all channels of a defined fraction of all images.
For image data, all components of dropped images will be filled with zeros.
.. note::
This augmenter also sets the arrays of heatmaps and segmentation
maps to zero and removes all coordinate-based ... | 7 | 2 | 13 | 1 | 11 | 1 | 3 | 1.21 | 1 | 1 | 0 | 0 | 4 | 10 | 5 | 57 | 155 | 29 | 57 | 28 | 48 | 69 | 50 | 25 | 44 | 11 | 2 | 3 | 16 |
20,183 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic._CutoutSamples | class _CutoutSamples(object):
def __init__(self, nb_iterations, pos_x, pos_y, size_h, size_w, squared, fill_mode, cval, fill_per_channel):
self.nb_iterations = nb_iterations
self.pos_x = pos_x
self.pos_y = pos_y
self.size_h = size_h
self.size_w = size_w
self.squared ... | class _CutoutSamples(object):
def __init__(self, nb_iterations, pos_x, pos_y, size_h, size_w, squared, fill_mode, cval, fill_per_channel):
pass | 2 | 0 | 11 | 0 | 11 | 0 | 1 | 0.08 | 1 | 0 | 0 | 0 | 1 | 9 | 1 | 1 | 13 | 0 | 12 | 12 | 9 | 1 | 11 | 11 | 9 | 1 | 1 | 0 | 1 |
20,184 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic._InvertSamples | class _InvertSamples(object):
def __init__(self, p, per_channel, min_value, max_value, threshold, invert_above_threshold):
self.p = p
self.per_channel = per_channel
self.min_value = min_value
self.max_value = max_value
self.threshold = threshold
self.invert_above_thr... | class _InvertSamples(object):
def __init__(self, p, per_channel, min_value, max_value, threshold, invert_above_threshold):
pass | 2 | 0 | 8 | 0 | 8 | 0 | 1 | 0.11 | 1 | 0 | 0 | 0 | 1 | 6 | 1 | 1 | 10 | 0 | 9 | 9 | 6 | 1 | 8 | 8 | 6 | 1 | 1 | 0 | 1 |
20,185 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic._InvertTables | class _InvertTables(object):
def __init__(self):
self.tables = {}
def get_table(self, min_value, max_value, threshold, invert_above_threshold):
if min_value == 0 and max_value == 255:
key = (threshold, invert_above_threshold)
table = self.tables.get(key, None)
... | class _InvertTables(object):
def __init__(self):
pass
def get_table(self, min_value, max_value, threshold, invert_above_threshold):
pass | 3 | 0 | 8 | 0 | 8 | 0 | 2 | 0.12 | 1 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 20 | 1 | 17 | 7 | 13 | 2 | 12 | 6 | 9 | 3 | 1 | 2 | 4 |
20,186 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/arithmetic.py | imgaug.augmenters.arithmetic._InvertTablesSingleton | class _InvertTablesSingleton(object):
_INSTANCE = None
@classmethod
def get_instance(cls):
if cls._INSTANCE is None:
cls._INSTANCE = _InvertTables()
return cls._INSTANCE | class _InvertTablesSingleton(object):
@classmethod
def get_instance(cls):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0.14 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 9 | 1 | 7 | 4 | 4 | 1 | 6 | 3 | 4 | 2 | 1 | 1 | 2 |
20,187 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/artistic.py | imgaug.augmenters.artistic.Cartoon | from . import meta
from . import color as colorlib
from .. import parameters as iap
class Cartoon(meta.Augmenter):
"""Convert the style of images to a more cartoonish one.
This augmenter was primarily designed for images with a size of ``200``
to ``800`` pixels. Smaller or larger images may cause issues.
... |
class Cartoon(meta.Augmenter):
'''Convert the style of images to a more cartoonish one.
This augmenter was primarily designed for images with a size of ``200``
to ``800`` pixels. Smaller or larger images may cause issues.
Note that the quality of the results can currently not compete with
learned s... | 5 | 2 | 12 | 0 | 12 | 0 | 2 | 1.81 | 1 | 2 | 0 | 0 | 4 | 5 | 4 | 56 | 163 | 28 | 48 | 17 | 39 | 87 | 19 | 13 | 14 | 3 | 2 | 2 | 6 |
20,188 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/base.py | imgaug.augmenters.base.SuspiciousMultiImageShapeWarning | class SuspiciousMultiImageShapeWarning(UserWarning):
"""Warning multi-image inputs that look like a single image.""" | class SuspiciousMultiImageShapeWarning(UserWarning):
'''Warning multi-image inputs that look like a single image.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
20,189 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/base.py | imgaug.augmenters.base.SuspiciousSingleImageShapeWarning | class SuspiciousSingleImageShapeWarning(UserWarning):
"""Warning for single-image inputs that look like multiple images.""" | class SuspiciousSingleImageShapeWarning(UserWarning):
'''Warning for single-image inputs that look like multiple images.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 2 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 5 | 0 | 0 |
20,190 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlpha | import numpy as np
from . import meta
from .. import parameters as iap
class BlendAlpha(meta.Augmenter):
"""
Alpha-blend two image sources using an alpha/opacity value.
The two image sources can be imagined as branches.
If a source is not given, it is automatically the same as the input.
Let ``FG`... |
class BlendAlpha(meta.Augmenter):
'''
Alpha-blend two image sources using an alpha/opacity value.
The two image sources can be imagined as branches.
If a source is not given, it is automatically the same as the input.
Let ``FG`` be the foreground branch and ``BG`` be the background branch.
Then... | 7 | 3 | 15 | 2 | 12 | 2 | 3 | 1.79 | 1 | 2 | 0 | 0 | 6 | 6 | 6 | 58 | 240 | 45 | 70 | 32 | 60 | 125 | 41 | 28 | 34 | 10 | 2 | 3 | 15 |
20,191 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaBoundingBoxes | class BlendAlphaBoundingBoxes(BlendAlphaMask):
"""Blend images from two branches based on areas enclosed in bounding boxes.
This class generates masks that are ``1.0`` within bounding boxes of given
labels. A mask pixel will be set to ``1.0`` if *at least* one bounding box
covers the area and has one o... | class BlendAlphaBoundingBoxes(BlendAlphaMask):
'''Blend images from two branches based on areas enclosed in bounding boxes.
This class generates masks that are ``1.0`` within bounding boxes of given
labels. A mask pixel will be set to ``1.0`` if *at least* one bounding box
covers the area and has one of... | 2 | 1 | 15 | 0 | 15 | 0 | 1 | 5.13 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 61 | 127 | 29 | 16 | 7 | 9 | 82 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,192 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaCheckerboard | class BlendAlphaCheckerboard(BlendAlphaMask):
"""Blend images from two branches according to a checkerboard pattern.
This class generates for each image a mask following a checkboard layout of
``H`` rows and ``W`` columns. Each cell is then filled with either
``1.0`` or ``0.0``. The cell at the top-lef... | class BlendAlphaCheckerboard(BlendAlphaMask):
'''Blend images from two branches according to a checkerboard pattern.
This class generates for each image a mask following a checkboard layout of
``H`` rows and ``W`` columns. Each cell is then filled with either
``1.0`` or ``0.0``. The cell at the top-left... | 2 | 1 | 13 | 0 | 13 | 0 | 1 | 4.57 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 61 | 99 | 21 | 14 | 5 | 9 | 64 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,193 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaElementwise | from .. import parameters as iap
class BlendAlphaElementwise(BlendAlphaMask):
"""
Alpha-blend two image sources using alpha/opacity values sampled per pixel.
This is the same as :class:`BlendAlpha`, except that the opacity factor is
sampled once per *pixel* instead of once per *image* (or a few times ... |
class BlendAlphaElementwise(BlendAlphaMask):
'''
Alpha-blend two image sources using alpha/opacity values sampled per pixel.
This is the same as :class:`BlendAlpha`, except that the opacity factor is
sampled once per *pixel* instead of once per *image* (or a few times per
image, if ``BlendAlpha.per... | 4 | 1 | 7 | 0 | 7 | 0 | 1 | 6.63 | 1 | 2 | 1 | 2 | 2 | 0 | 2 | 62 | 154 | 32 | 16 | 8 | 9 | 106 | 7 | 4 | 4 | 1 | 3 | 0 | 2 |
20,194 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaFrequencyNoise | import imgaug as ia
from .. import parameters as iap
class BlendAlphaFrequencyNoise(BlendAlphaElementwise):
"""Alpha-blend two image sources using frequency noise masks.
The alpha masks are sampled using frequency noise of varying scales,
which can sometimes create large connected blobs of ``1`` s surroun... |
class BlendAlphaFrequencyNoise(BlendAlphaElementwise):
'''Alpha-blend two image sources using frequency noise masks.
The alpha masks are sampled using frequency noise of varying scales,
which can sometimes create large connected blobs of ``1`` s surrounded
by ``0`` s and other times results in smaller ... | 2 | 1 | 43 | 4 | 38 | 1 | 5 | 4.31 | 1 | 6 | 5 | 0 | 1 | 0 | 1 | 63 | 250 | 43 | 39 | 11 | 32 | 168 | 11 | 6 | 9 | 5 | 4 | 1 | 5 |
20,195 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaHorizontalLinearGradient | class BlendAlphaHorizontalLinearGradient(BlendAlphaMask):
"""Blend images from two branches along a horizontal linear gradient.
This class generates a horizontal linear gradient mask (i.e. usually a
mask with low values on the left and high values on the right) and
alphas-blends between foreground and ... | class BlendAlphaHorizontalLinearGradient(BlendAlphaMask):
'''Blend images from two branches along a horizontal linear gradient.
This class generates a horizontal linear gradient mask (i.e. usually a
mask with low values on the left and high values on the right) and
alphas-blends between foreground and b... | 2 | 1 | 16 | 0 | 16 | 0 | 1 | 4.47 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 61 | 120 | 27 | 17 | 6 | 11 | 76 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,196 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaMask | from .. import dtypes as iadt
import numpy as np
from . import meta
from ..augmentables import utils as augm_utils
import imgaug as ia
class BlendAlphaMask(meta.Augmenter):
"""
Alpha-blend two image sources using non-binary masks generated per image.
This augmenter queries for each image a mask generator ... |
class BlendAlphaMask(meta.Augmenter):
'''
Alpha-blend two image sources using non-binary masks generated per image.
This augmenter queries for each image a mask generator to generate
a ``(H,W)`` or ``(H,W,C)`` channelwise mask ``[0.0, 1.0]``, where
``H`` is the image height and ``W`` the width.
... | 11 | 3 | 23 | 2 | 18 | 4 | 3 | 0.79 | 1 | 4 | 0 | 8 | 6 | 6 | 8 | 60 | 309 | 48 | 146 | 51 | 131 | 115 | 80 | 44 | 71 | 8 | 2 | 4 | 23 |
20,197 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaRegularGrid | class BlendAlphaRegularGrid(BlendAlphaMask):
"""Blend images from two branches according to a regular grid.
This class generates for each image a mask that splits the image into a
grid-like pattern of ``H`` rows and ``W`` columns. Each cell is then
filled with an alpha value, sampled randomly per cell.... | class BlendAlphaRegularGrid(BlendAlphaMask):
'''Blend images from two branches according to a regular grid.
This class generates for each image a mask that splits the image into a
grid-like pattern of ``H`` rows and ``W`` columns. Each cell is then
filled with an alpha value, sampled randomly per cell.
... | 2 | 1 | 16 | 0 | 15 | 1 | 1 | 5.25 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 61 | 126 | 26 | 16 | 6 | 10 | 84 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,198 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaSegMapClassIds | class BlendAlphaSegMapClassIds(BlendAlphaMask):
"""Blend images from two branches based on segmentation map ids.
This class generates masks that are ``1.0`` at pixel locations covered
by specific classes in segmentation maps.
This class is a thin wrapper around
:class:`~imgaug.augmenters.blend.Ble... | class BlendAlphaSegMapClassIds(BlendAlphaMask):
'''Blend images from two branches based on segmentation map ids.
This class generates masks that are ``1.0`` at pixel locations covered
by specific classes in segmentation maps.
This class is a thin wrapper around
:class:`~imgaug.augmenters.blend.Blend... | 2 | 1 | 15 | 0 | 15 | 0 | 1 | 5.31 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 61 | 130 | 29 | 16 | 7 | 9 | 85 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,199 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/blend.py | imgaug.augmenters.blend.BlendAlphaSimplexNoise | import imgaug as ia
from .. import parameters as iap
class BlendAlphaSimplexNoise(BlendAlphaElementwise):
"""Alpha-blend two image sources using simplex noise alpha masks.
The alpha masks are sampled using a simplex noise method, roughly creating
connected blobs of 1s surrounded by 0s. If nearest neighbou... |
class BlendAlphaSimplexNoise(BlendAlphaElementwise):
'''Alpha-blend two image sources using simplex noise alpha masks.
The alpha masks are sampled using a simplex noise method, roughly creating
connected blobs of 1s surrounded by 0s. If nearest neighbour
upsampling is used, these blobs can be rectangul... | 2 | 1 | 41 | 4 | 37 | 0 | 5 | 3.82 | 1 | 6 | 5 | 0 | 1 | 0 | 1 | 63 | 222 | 39 | 38 | 11 | 31 | 145 | 11 | 6 | 9 | 5 | 4 | 1 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.