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,400 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.PadToAspectRatio | class PadToAspectRatio(PadToFixedSize):
"""Pad images until their width/height matches an aspect ratio.
This augmenter adds either rows or columns until the image reaches
the desired aspect ratio given in ``width / height``.
Added in 0.4.0.
**Supported dtypes**:
See :class:`~imgaug.augmenter... | class PadToAspectRatio(PadToFixedSize):
'''Pad images until their width/height matches an aspect ratio.
This augmenter adds either rows or columns until the image reaches
the desired aspect ratio given in ``width / height``.
Added in 0.4.0.
**Supported dtypes**:
See :class:`~imgaug.augmenters.si... | 4 | 2 | 13 | 1 | 10 | 1 | 1 | 1.52 | 1 | 1 | 0 | 2 | 3 | 1 | 3 | 63 | 100 | 22 | 31 | 15 | 24 | 47 | 16 | 12 | 12 | 2 | 3 | 1 | 4 |
20,401 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.PadToFixedSize | import functools
from . import meta
from .. import parameters as iap
class PadToFixedSize(meta.Augmenter):
"""Pad images to a predefined minimum width and/or height.
If images are already at the minimum width/height or are larger, they will
not be padded. Note that this also means that images will not be ... |
class PadToFixedSize(meta.Augmenter):
'''Pad images to a predefined minimum width and/or height.
If images are already at the minimum width/height or are larger, they will
not be padded. Note that this also means that images will not be cropped if
they exceed the required width/height.
The augmente... | 10 | 2 | 21 | 3 | 15 | 3 | 3 | 1.09 | 1 | 6 | 0 | 4 | 7 | 8 | 8 | 60 | 311 | 54 | 123 | 59 | 108 | 134 | 82 | 53 | 73 | 6 | 2 | 2 | 21 |
20,402 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.PadToMultiplesOf | class PadToMultiplesOf(PadToFixedSize):
"""Pad images until their height/width is a multiple of a value.
Added in 0.4.0.
**Supported dtypes**:
See :class:`~imgaug.augmenters.size.PadToFixedSize`.
Parameters
----------
width_multiple : int or None
Multiple for the width. Images wi... | class PadToMultiplesOf(PadToFixedSize):
'''Pad images until their height/width is a multiple of a value.
Added in 0.4.0.
**Supported dtypes**:
See :class:`~imgaug.augmenters.size.PadToFixedSize`.
Parameters
----------
width_multiple : int or None
Multiple for the width. Images will b... | 4 | 2 | 14 | 1 | 11 | 1 | 1 | 1.43 | 1 | 1 | 0 | 1 | 3 | 2 | 3 | 63 | 106 | 21 | 35 | 17 | 27 | 50 | 17 | 13 | 13 | 2 | 3 | 1 | 4 |
20,403 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.PadToPowersOf | class PadToPowersOf(PadToFixedSize):
"""Pad images until their height/width is a power of a base.
This augmenter adds pixels to an axis with size ``S`` leading to the
new size ``S'`` until ``S' = B^E`` is fulfilled, where ``B`` is a
provided base (e.g. ``2``) and ``E`` is an exponent from the discrete
... | class PadToPowersOf(PadToFixedSize):
'''Pad images until their height/width is a power of a base.
This augmenter adds pixels to an axis with size ``S`` leading to the
new size ``S'`` until ``S' = B^E`` is fulfilled, where ``B`` is a
provided base (e.g. ``2``) and ``E`` is an exponent from the discrete
... | 4 | 2 | 14 | 1 | 11 | 1 | 1 | 1.6 | 1 | 1 | 0 | 1 | 3 | 2 | 3 | 63 | 113 | 22 | 35 | 17 | 27 | 56 | 17 | 13 | 13 | 2 | 3 | 1 | 4 |
20,404 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.PadToSquare | class PadToSquare(PadToAspectRatio):
"""Pad images until their height and width are identical.
This augmenter is identical to
:class:`~imgaug.augmenters.size.PadToAspectRatio` with ``aspect_ratio=1.0``.
Added in 0.4.0.
**Supported dtypes**:
See :class:`~imgaug.augmenters.size.PadToFixedSize`... | class PadToSquare(PadToAspectRatio):
'''Pad images until their height and width are identical.
This augmenter is identical to
:class:`~imgaug.augmenters.size.PadToAspectRatio` with ``aspect_ratio=1.0``.
Added in 0.4.0.
**Supported dtypes**:
See :class:`~imgaug.augmenters.size.PadToFixedSize`.
... | 2 | 1 | 8 | 0 | 8 | 0 | 1 | 4.11 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 64 | 61 | 15 | 9 | 4 | 5 | 37 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
20,405 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size.Resize | import imgaug as ia
import numpy as np
from .. import parameters as iap
import functools
from . import meta
class Resize(meta.Augmenter):
"""Augmenter that resizes images to specified heights and widths.
**Supported dtypes**:
See :func:`~imgaug.imgaug.imresize_many_images`.
Parameters
----------... |
class Resize(meta.Augmenter):
'''Augmenter that resizes images to specified heights and widths.
**Supported dtypes**:
See :func:`~imgaug.imgaug.imresize_many_images`.
Parameters
----------
size : 'keep' or int or float or tuple of int or tuple of float or list of int or list of float or imgaug.... | 17 | 2 | 23 | 2 | 20 | 1 | 5 | 0.53 | 1 | 16 | 5 | 0 | 7 | 3 | 10 | 62 | 409 | 66 | 224 | 71 | 205 | 119 | 155 | 66 | 142 | 13 | 2 | 2 | 54 |
20,406 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/size.py | imgaug.augmenters.size._CropAndPadSamplingResult | class _CropAndPadSamplingResult(object):
def __init__(self, crop_top, crop_right, crop_bottom, crop_left, pad_top, pad_right, pad_bottom, pad_left, pad_mode, pad_cval):
self.crop_top = crop_top
self.crop_right = crop_right
self.crop_bottom = crop_bottom
self.crop_left = crop_left
... | class _CropAndPadSamplingResult(object):
def __init__(self, crop_top, crop_right, crop_bottom, crop_left, pad_top, pad_right, pad_bottom, pad_left, pad_mode, pad_cval):
pass
def croppings(self, i):
'''Get absolute pixel amounts of croppings as a TRBL tuple.'''
pass
def paddings(se... | 4 | 2 | 9 | 0 | 9 | 1 | 1 | 0.07 | 1 | 0 | 0 | 0 | 3 | 10 | 3 | 3 | 31 | 2 | 27 | 15 | 22 | 2 | 16 | 14 | 12 | 1 | 1 | 0 | 3 |
20,407 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.CloudLayer | from . import meta, arithmetic, blur, contrast, color as colorlib
from .. import dtypes as iadt
import imgaug as ia
from .. import parameters as iap
import numpy as np
class CloudLayer(meta.Augmenter):
"""Add a single layer of clouds to an image.
**Supported dtypes**:
* ``uint8``: yes; indirectly tes... |
class CloudLayer(meta.Augmenter):
'''Add a single layer of clouds to an image.
**Supported dtypes**:
* ``uint8``: yes; indirectly tested (1)
* ``uint16``: no
* ``uint32``: no
* ``uint64``: no
* ``int8``: no
* ``int16``: no
* ``int32``: no
* ``int6... | 12 | 2 | 17 | 1 | 15 | 1 | 1 | 1.04 | 1 | 5 | 2 | 1 | 5 | 9 | 8 | 60 | 296 | 42 | 125 | 55 | 104 | 130 | 64 | 43 | 55 | 3 | 2 | 1 | 11 |
20,408 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.Clouds | from . import meta, arithmetic, blur, contrast, color as colorlib
class Clouds(meta.SomeOf):
"""
Add clouds to images.
This is a wrapper around :class:`~imgaug.augmenters.weather.CloudLayer`.
It executes 1 to 2 layers per image, leading to varying densities and
frequency patterns of clouds.
T... |
class Clouds(meta.SomeOf):
'''
Add clouds to images.
This is a wrapper around :class:`~imgaug.augmenters.weather.CloudLayer`.
It executes 1 to 2 layers per image, leading to varying densities and
frequency patterns of clouds.
This augmenter seems to be fairly robust w.r.t. the image size. Teste... | 2 | 1 | 40 | 1 | 39 | 0 | 1 | 1.15 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 97 | 100 | 14 | 40 | 5 | 36 | 46 | 4 | 3 | 2 | 1 | 3 | 0 | 1 |
20,409 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.FastSnowyLandscape | from . import meta, arithmetic, blur, contrast, color as colorlib
import numpy as np
from .. import dtypes as iadt
from .. import parameters as iap
class FastSnowyLandscape(meta.Augmenter):
"""Convert non-snowy landscapes to snowy ones.
This augmenter expects to get an image that roughly shows a landscape.
... |
class FastSnowyLandscape(meta.Augmenter):
'''Convert non-snowy landscapes to snowy ones.
This augmenter expects to get an image that roughly shows a landscape.
This augmenter is based on the method proposed in
https://medium.freecodecamp.org/image-augmentation-make-it-rain-make-it-snow-how-to-modify-a-... | 5 | 2 | 13 | 2 | 11 | 0 | 2 | 2 | 1 | 3 | 0 | 0 | 4 | 3 | 4 | 56 | 165 | 33 | 44 | 24 | 35 | 88 | 30 | 20 | 25 | 3 | 2 | 1 | 6 |
20,410 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.Fog | class Fog(CloudLayer):
"""Add fog to images.
This is a wrapper around :class:`~imgaug.augmenters.weather.CloudLayer`.
It executes a single layer per image with a configuration leading to
fairly dense clouds with low-frequency patterns.
This augmenter seems to be fairly robust w.r.t. the image size... | class Fog(CloudLayer):
'''Add fog to images.
This is a wrapper around :class:`~imgaug.augmenters.weather.CloudLayer`.
It executes a single layer per image with a configuration leading to
fairly dense clouds with low-frequency patterns.
This augmenter seems to be fairly robust w.r.t. the image size. ... | 2 | 1 | 15 | 0 | 15 | 0 | 1 | 2.81 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 61 | 74 | 13 | 16 | 4 | 12 | 45 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
20,411 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.Rain | from . import meta, arithmetic, blur, contrast, color as colorlib
class Rain(meta.SomeOf):
"""Add falling snowflakes to images.
This is a wrapper around
:class:`~imgaug.augmenters.weather.RainLayer`. It executes 1 to 3
layers per image.
.. note::
This augmenter currently seems to work be... |
class Rain(meta.SomeOf):
'''Add falling snowflakes to images.
This is a wrapper around
:class:`~imgaug.augmenters.weather.RainLayer`. It executes 1 to 3
layers per image.
.. note::
This augmenter currently seems to work best for medium-sized images
around ``192x256``. For smaller im... | 2 | 1 | 24 | 1 | 23 | 0 | 1 | 2.46 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 97 | 105 | 22 | 24 | 8 | 18 | 59 | 4 | 3 | 2 | 1 | 3 | 0 | 1 |
20,412 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.RainLayer | import numpy as np
class RainLayer(SnowflakesLayer):
"""Add a single layer of falling raindrops to images.
Added in 0.4.0.
**Supported dtypes**:
* ``uint8``: yes; indirectly tested (1)
* ``uint16``: no
* ``uint32``: no
* ``uint64``: no
* ``int8``: no
* ``i... |
class RainLayer(SnowflakesLayer):
'''Add a single layer of falling raindrops to images.
Added in 0.4.0.
**Supported dtypes**:
* ``uint8``: yes; indirectly tested (1)
* ``uint16``: no
* ``uint32``: no
* ``uint64``: no
* ``int8``: no
* ``int16``: no
* `... | 8 | 1 | 9 | 0 | 8 | 1 | 1 | 1.76 | 1 | 1 | 0 | 0 | 1 | 0 | 4 | 68 | 115 | 21 | 34 | 17 | 21 | 60 | 17 | 9 | 12 | 2 | 3 | 0 | 5 |
20,413 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.Snowflakes | from . import meta, arithmetic, blur, contrast, color as colorlib
class Snowflakes(meta.SomeOf):
"""Add falling snowflakes to images.
This is a wrapper around
:class:`~imgaug.augmenters.weather.SnowflakesLayer`. It executes 1 to 3
layers per image.
**Supported dtypes**:
* ``uint8``: yes;... |
class Snowflakes(meta.SomeOf):
'''Add falling snowflakes to images.
This is a wrapper around
:class:`~imgaug.augmenters.weather.SnowflakesLayer`. It executes 1 to 3
layers per image.
**Supported dtypes**:
* ``uint8``: yes; tested
* ``uint16``: no (1)
* ``uint32``: no (1)
... | 2 | 1 | 24 | 1 | 23 | 0 | 1 | 5.5 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 97 | 191 | 35 | 24 | 8 | 18 | 132 | 4 | 3 | 2 | 1 | 3 | 0 | 1 |
20,414 | aleju/imgaug | aleju_imgaug/imgaug/augmenters/weather.py | imgaug.augmenters.weather.SnowflakesLayer | import imgaug as ia
from .. import parameters as iap
import numpy as np
from . import meta, arithmetic, blur, contrast, color as colorlib
class SnowflakesLayer(meta.Augmenter):
"""Add a single layer of falling snowflakes to images.
**Supported dtypes**:
* ``uint8``: yes; indirectly tested (1)
... |
class SnowflakesLayer(meta.Augmenter):
'''Add a single layer of falling snowflakes to images.
**Supported dtypes**:
* ``uint8``: yes; indirectly tested (1)
* ``uint16``: no
* ``uint32``: no
* ``uint64``: no
* ``int8``: no
* ``int16``: no
* ``int32``: no
... | 21 | 2 | 13 | 1 | 10 | 2 | 1 | 1.19 | 1 | 8 | 4 | 1 | 4 | 9 | 12 | 64 | 347 | 53 | 134 | 62 | 108 | 160 | 80 | 49 | 67 | 3 | 2 | 1 | 15 |
20,415 | aleju/imgaug | aleju_imgaug/imgaug/external/opensimplex.py | imgaug.external.opensimplex.OpenSimplex | from math import floor as _floor
class OpenSimplex(object):
"""
OpenSimplex n-dimensional gradient noise functions.
"""
def __init__(self, seed=DEFAULT_SEED):
"""
Initiate the class and generate permutation arrays from a seed number.
"""
perm = self._perm = [0] * 256
... |
class OpenSimplex(object):
'''
OpenSimplex n-dimensional gradient noise functions.
'''
def __init__(self, seed=DEFAULT_SEED):
'''
Initiate the class and generate permutation arrays from a seed number.
'''
pass
def _extrapolate2d(self, xsb, ysb, dx, dy):
pas... | 8 | 5 | 262 | 28 | 214 | 25 | 33 | 0.12 | 1 | 2 | 0 | 0 | 7 | 2 | 7 | 7 | 1,847 | 207 | 1,502 | 226 | 1,494 | 177 | 1,353 | 226 | 1,345 | 154 | 1 | 5 | 229 |
20,416 | aleju/imgaug | aleju_imgaug/imgaug/external/poly_point_isect_py2py3.py | imgaug.external.poly_point_isect_py2py3.Event | class Event:
__slots__ = ('type', 'point', 'segment', 'slope', 'span') + (() if not USE_DEBUG else ('other', 'in_sweep'))
class Type:
END = 0
INTERSECTION = 1
START = 2
if USE_VERTICAL:
START_VERTICAL = 3
def __init__(self, type, point, segment, slope):
... | class Event:
class Type:
def __init__(self, type, point, segment, slope):
pass
def __hash__(self):
pass
def is_vertical(self):
pass
def y_intercept_x(self, x):
pass
@staticmethod
def Compare(sweep_line, this, that):
pass
def __repr__(self):
... | 9 | 0 | 17 | 2 | 14 | 2 | 5 | 0.14 | 0 | 1 | 0 | 0 | 5 | 7 | 6 | 6 | 132 | 17 | 101 | 33 | 92 | 14 | 74 | 32 | 66 | 17 | 0 | 3 | 30 |
20,417 | aleju/imgaug | aleju_imgaug/imgaug/external/poly_point_isect_py2py3.py | imgaug.external.poly_point_isect_py2py3.EventQueue | class EventQueue:
__slots__ = ('events_scan',)
def __init__(self, segments, line):
self.events_scan = RBTree()
for s in segments:
assert s[0][X] <= s[1][X]
slope = slope_v2v2(*s)
if s[0] == s[1]:
pass
elif USE_VERTICAL and s[0][X] ... | class EventQueue:
def __init__(self, segments, line):
pass
def offer(self, p, e):
'''
Offer a new event ``s`` at point ``p`` in this queue.
'''
pass
def poll(self):
'''
Get, and remove, the first (lowest) item from this queue.
:return: the f... | 4 | 2 | 19 | 3 | 10 | 6 | 3 | 0.62 | 0 | 3 | 3 | 0 | 3 | 1 | 3 | 3 | 67 | 13 | 34 | 12 | 30 | 21 | 28 | 12 | 24 | 6 | 0 | 3 | 9 |
20,418 | aleju/imgaug | aleju_imgaug/imgaug/external/poly_point_isect_py2py3.py | imgaug.external.poly_point_isect_py2py3.Node | class Node(object):
"""Internal object, represents a tree node."""
__slots__ = ['key', 'value', 'red', 'left', 'right']
def __init__(self, key=None, value=None):
self.key = key
self.value = value
self.red = True
self.left = None
self.right = None
def free(self):... | class Node(object):
'''Internal object, represents a tree node.'''
def __init__(self, key=None, value=None):
pass
def free(self):
pass
def __getitem__(self, key):
'''N.__getitem__(key) <==> x[key], where key is 0 (left) or 1 (right).'''
pass
def __setitem__(self, ... | 5 | 3 | 5 | 0 | 5 | 1 | 2 | 0.15 | 1 | 0 | 0 | 0 | 4 | 5 | 4 | 4 | 27 | 4 | 20 | 11 | 15 | 3 | 19 | 11 | 14 | 2 | 1 | 1 | 6 |
20,419 | aleju/imgaug | aleju_imgaug/imgaug/external/poly_point_isect_py2py3.py | imgaug.external.poly_point_isect_py2py3.RBTree | class RBTree(_ABCTree):
"""
RBTree implements a balanced binary tree with a dict-like interface.
see: http://en.wikipedia.org/wiki/Red_black_tree
"""
@staticmethod
def is_red(node):
if node is not None and node.red:
return True
else:
return False
@s... | class RBTree(_ABCTree):
'''
RBTree implements a balanced binary tree with a dict-like interface.
see: http://en.wikipedia.org/wiki/Red_black_tree
'''
@staticmethod
def is_red(node):
pass
@staticmethod
def jsw_single(root, direction):
pass
@staticmethod
def jsw_dou... | 10 | 4 | 23 | 2 | 18 | 5 | 5 | 0.27 | 1 | 4 | 1 | 0 | 3 | 1 | 6 | 34 | 152 | 19 | 113 | 31 | 103 | 31 | 104 | 28 | 97 | 16 | 2 | 6 | 32 |
20,420 | aleju/imgaug | aleju_imgaug/imgaug/external/poly_point_isect_py2py3.py | imgaug.external.poly_point_isect_py2py3.SweepLine | class SweepLine:
__slots__ = ('intersections', 'queue', '_events_current_sweep', '_current_event_point_x', '_before')
def __init__(self):
self.intersections = {}
self._current_event_point_x = None
self._events_current_sweep = RBTree(cmp=Event.Compare, cmp_data=self)
self._before... | class SweepLine:
def __init__(self):
pass
def get_intersections(self):
'''
Return a list of unordered intersection points.
'''
pass
def get_intersections_with_segments(self):
'''
Return a list of unordered intersection '(point, segment)' pairs,
... | 13 | 2 | 18 | 2 | 13 | 3 | 4 | 0.38 | 0 | 8 | 3 | 0 | 12 | 4 | 12 | 12 | 262 | 43 | 160 | 33 | 147 | 60 | 127 | 33 | 114 | 16 | 0 | 4 | 47 |
20,421 | aleju/imgaug | aleju_imgaug/imgaug/external/poly_point_isect_py2py3.py | imgaug.external.poly_point_isect_py2py3._ABCTree | from operator import attrgetter
class _ABCTree(object):
def __init__(self, items=None, cmp=None, cmp_data=None):
"""T.__init__(...) initializes T; see T.__class__.__doc__ for signature"""
self._root = None
self._count = 0
if cmp is None:
def cmp(cmp_data, a, b):
... |
class _ABCTree(object):
def __init__(self, items=None, cmp=None, cmp_data=None):
'''T.__init__(...) initializes T; see T.__class__.__doc__ for signature'''
pass
def cmp(cmp_data, a, b):
pass
def clear(self):
'''T.clear() -> None. Remove all items ... | 32 | 23 | 10 | 0 | 8 | 2 | 3 | 0.27 | 1 | 5 | 0 | 1 | 28 | 4 | 28 | 28 | 320 | 33 | 232 | 64 | 200 | 62 | 208 | 62 | 177 | 13 | 1 | 4 | 90 |
20,422 | aleju/imgaug | aleju_imgaug/imgaug/imgaug.py | imgaug.imgaug.DeprecationWarning | class DeprecationWarning(Warning):
"""Warning for deprecated calls.
Since python 2.7 DeprecatedWarning is silent by default. So we define
our own DeprecatedWarning here so that it is not silent by default.
""" | class DeprecationWarning(Warning):
'''Warning for deprecated calls.
Since python 2.7 DeprecatedWarning is silent by default. So we define
our own DeprecatedWarning here so that it is not silent by default.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 7 | 2 | 1 | 1 | 0 | 5 | 1 | 1 | 0 | 0 | 4 | 0 | 0 |
20,423 | aleju/imgaug | aleju_imgaug/imgaug/imgaug.py | imgaug.imgaug.HooksHeatmaps | class HooksHeatmaps(HooksImages):
"""Class to intervene with heatmap augmentation runs.
This is e.g. useful to dynamically deactivate some augmenters.
This class is currently the same as the one for images. This may or may
not change in the future.
""" | class HooksHeatmaps(HooksImages):
'''Class to intervene with heatmap augmentation runs.
This is e.g. useful to dynamically deactivate some augmenters.
This class is currently the same as the one for images. This may or may
not change in the future.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 9 | 3 | 1 | 1 | 0 | 5 | 1 | 1 | 0 | 0 | 2 | 0 | 0 |
20,424 | aleju/imgaug | aleju_imgaug/imgaug/imgaug.py | imgaug.imgaug.HooksImages | class HooksImages(object):
"""Class to intervene with image augmentation runs.
This is e.g. useful to dynamically deactivate some augmenters.
Parameters
----------
activator : None or callable, optional
A function that gives permission to execute an augmenter.
The expected interfac... | class HooksImages(object):
'''Class to intervene with image augmentation runs.
This is e.g. useful to dynamically deactivate some augmenters.
Parameters
----------
activator : None or callable, optional
A function that gives permission to execute an augmenter.
The expected interface ... | 6 | 5 | 13 | 2 | 4 | 6 | 2 | 3.91 | 1 | 0 | 0 | 2 | 5 | 4 | 5 | 5 | 142 | 29 | 23 | 11 | 16 | 90 | 22 | 10 | 16 | 2 | 1 | 1 | 9 |
20,425 | aleju/imgaug | aleju_imgaug/imgaug/imgaug.py | imgaug.imgaug.HooksKeypoints | class HooksKeypoints(HooksImages):
"""Class to intervene with keypoint augmentation runs.
This is e.g. useful to dynamically deactivate some augmenters.
This class is currently the same as the one for images. This may or may
not change in the future.
""" | class HooksKeypoints(HooksImages):
'''Class to intervene with keypoint augmentation runs.
This is e.g. useful to dynamically deactivate some augmenters.
This class is currently the same as the one for images. This may or may
not change in the future.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 9 | 3 | 1 | 1 | 0 | 5 | 1 | 1 | 0 | 0 | 2 | 0 | 0 |
20,426 | aleju/imgaug | aleju_imgaug/imgaug/imgaug.py | imgaug.imgaug.deprecated | import functools
class deprecated(object):
"""Decorator to mark deprecated functions with warning.
Adapted from
<https://github.com/scikit-image/scikit-image/blob/master/skimage/_shared/utils.py>.
Parameters
----------
alt_func : None or str, optional
If given, tell user what function... |
class deprecated(object):
'''Decorator to mark deprecated functions with warning.
Adapted from
<https://github.com/scikit-image/scikit-image/blob/master/skimage/_shared/utils.py>.
Parameters
----------
alt_func : None or str, optional
If given, tell user what function to use instead.
... | 5 | 1 | 30 | 5 | 21 | 4 | 4 | 0.49 | 1 | 1 | 0 | 0 | 2 | 4 | 2 | 2 | 88 | 19 | 47 | 19 | 40 | 23 | 35 | 17 | 30 | 5 | 1 | 1 | 11 |
20,427 | aleju/imgaug | aleju_imgaug/imgaug/multicore.py | imgaug.multicore.BackgroundAugmenter | import imgaug.imgaug as ia
import imgaug.random as iarandom
import random
import numpy as np
import time
import multiprocessing
class BackgroundAugmenter(object):
"""
**Deprecated**. Augment batches in the background processes.
Deprecated. Use ``imgaug.multicore.Pool`` instead.
This is a wrapper arou... |
class BackgroundAugmenter(object):
'''
**Deprecated**. Augment batches in the background processes.
Deprecated. Use ``imgaug.multicore.Pool`` instead.
This is a wrapper around the multiprocessing module.
Parameters
----------
batch_loader : BatchLoader or multiprocessing.Queue
Batch... | 9 | 4 | 21 | 3 | 14 | 4 | 3 | 0.61 | 1 | 3 | 0 | 0 | 5 | 6 | 6 | 6 | 167 | 30 | 85 | 26 | 75 | 52 | 70 | 23 | 63 | 5 | 1 | 3 | 20 |
20,428 | aleju/imgaug | aleju_imgaug/imgaug/multicore.py | imgaug.multicore.BatchLoader | from imgaug.augmentables.batches import Batch, UnnormalizedBatch
import random
import time
import imgaug.imgaug as ia
import imgaug.random as iarandom
import multiprocessing
import threading
import numpy as np
import traceback
class BatchLoader(object):
"""**Deprecated**. Load batches in the background.
Depre... |
class BatchLoader(object):
'''**Deprecated**. Load batches in the background.
Deprecated. Use ``imgaug.multicore.Pool`` instead.
Loaded batches can be accesses using :attr:`imgaug.BatchLoader.queue`.
Parameters
----------
load_batch_func : callable or generator
Generator or generator fu... | 10 | 3 | 24 | 2 | 19 | 3 | 5 | 0.28 | 1 | 8 | 1 | 0 | 6 | 6 | 7 | 7 | 201 | 28 | 135 | 27 | 123 | 38 | 105 | 23 | 97 | 14 | 1 | 4 | 38 |
20,429 | aleju/imgaug | aleju_imgaug/imgaug/multicore.py | imgaug.multicore.Pool | import numpy as np
import imgaug.random as iarandom
import imgaug.imgaug as ia
class Pool(object):
"""
Wrapper around ``multiprocessing.Pool`` for multicore augmentation.
Parameters
----------
augseq : imgaug.augmenters.meta.Augmenter
The augmentation sequence to apply to batches.
pro... |
class Pool(object):
'''
Wrapper around ``multiprocessing.Pool`` for multicore augmentation.
Parameters
----------
augseq : imgaug.augmenters.meta.Augmenter
The augmentation sequence to apply to batches.
processes : None or int, optional
The number of background workers, similar ... | 21 | 9 | 19 | 3 | 9 | 8 | 2 | 1.11 | 1 | 6 | 0 | 1 | 13 | 6 | 16 | 16 | 363 | 62 | 143 | 45 | 119 | 159 | 86 | 38 | 69 | 4 | 1 | 3 | 30 |
20,430 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Absolute | import numpy as np
class Absolute(StochasticParameter):
"""Convert the samples of another parameter to their absolute values.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be modified.
Examples
--------
>>> ... |
class Absolute(StochasticParameter):
'''Convert the samples of another parameter to their absolute values.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be modified.
Examples
--------
>>> import imgaug.paramet... | 5 | 1 | 4 | 1 | 3 | 0 | 1 | 0.85 | 1 | 2 | 0 | 0 | 4 | 1 | 4 | 26 | 33 | 9 | 13 | 8 | 8 | 11 | 13 | 8 | 8 | 1 | 2 | 0 | 4 |
20,431 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Add | import numpy as np
class Add(StochasticParameter):
"""Add to the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Samples of `val` will be added to samples of this parameter.
... |
class Add(StochasticParameter):
'''Add to the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Samples of `val` will be added to samples of this parameter.
Let ``S`` be the r... | 5 | 1 | 7 | 1 | 6 | 0 | 2 | 1.46 | 1 | 3 | 1 | 0 | 4 | 3 | 4 | 26 | 75 | 16 | 24 | 12 | 19 | 35 | 20 | 12 | 15 | 3 | 2 | 1 | 6 |
20,432 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.AutoPrefetcher | from operator import mul as mul_op
from functools import reduce, wraps
import numpy as np
class AutoPrefetcher(StochasticParameter):
"""Parameter that prefetches random samples from a child parameter.
This parameter will fetch ``N`` random samples in one big swoop and then
return ``M`` of these samples up... |
class AutoPrefetcher(StochasticParameter):
'''Parameter that prefetches random samples from a child parameter.
This parameter will fetch ``N`` random samples in one big swoop and then
return ``M`` of these samples upon each call, with ``M << N``.
This improves the sampling efficiency by performing as f... | 7 | 1 | 12 | 2 | 10 | 0 | 2 | 0.47 | 1 | 2 | 0 | 0 | 6 | 5 | 6 | 28 | 113 | 22 | 62 | 18 | 55 | 29 | 41 | 18 | 34 | 6 | 2 | 1 | 14 |
20,433 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Beta | from . import imgaug as ia
import numpy as np
class Beta(StochasticParameter):
"""Parameter that resembles a (continuous) beta distribution.
Parameters
----------
alpha : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
alpha parameter of the beta distributi... |
class Beta(StochasticParameter):
'''Parameter that resembles a (continuous) beta distribution.
Parameters
----------
alpha : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
alpha parameter of the beta distribution.
Expected value range is ``(0, inf)`... | 7 | 2 | 4 | 0 | 4 | 0 | 1 | 1.38 | 1 | 2 | 0 | 0 | 5 | 3 | 5 | 27 | 64 | 14 | 21 | 12 | 14 | 29 | 19 | 11 | 13 | 1 | 2 | 0 | 5 |
20,434 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Binomial | import numpy as np
class Binomial(StochasticParameter):
"""Binomial distribution.
Parameters
----------
p : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Probability of the binomial distribution. Expected to be in the
interval ``[0.0, 1.0]``.
... |
class Binomial(StochasticParameter):
'''Binomial distribution.
Parameters
----------
p : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Probability of the binomial distribution. Expected to be in the
interval ``[0.0, 1.0]``.
* If a singl... | 7 | 2 | 3 | 0 | 3 | 0 | 1 | 1.53 | 1 | 1 | 0 | 0 | 5 | 1 | 5 | 27 | 54 | 11 | 17 | 9 | 10 | 26 | 14 | 8 | 8 | 1 | 2 | 0 | 5 |
20,435 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.ChiSquare | import numpy as np
class ChiSquare(StochasticParameter):
"""Parameter that resembles a (continuous) chi-square distribution.
This is a wrapper around numpy's :func:`numpy.random.chisquare`.
Parameters
----------
df : int or tuple of two int or list of int or imgaug.parameters.StochasticParameter
... |
class ChiSquare(StochasticParameter):
'''Parameter that resembles a (continuous) chi-square distribution.
This is a wrapper around numpy's :func:`numpy.random.chisquare`.
Parameters
----------
df : int or tuple of two int or list of int or imgaug.parameters.StochasticParameter
Degrees of fr... | 7 | 2 | 3 | 0 | 3 | 1 | 1 | 1.73 | 1 | 1 | 0 | 0 | 5 | 1 | 5 | 27 | 53 | 12 | 15 | 9 | 8 | 26 | 14 | 8 | 8 | 1 | 2 | 0 | 5 |
20,436 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Choice | from collections import defaultdict
from . import imgaug as ia
import numpy as np
class Choice(StochasticParameter):
"""Parameter that samples value from a list of allowed values.
Parameters
----------
a : iterable
List of allowed values.
Usually expected to be ``int`` s, ``float`` s o... |
class Choice(StochasticParameter):
'''Parameter that samples value from a list of allowed values.
Parameters
----------
a : iterable
List of allowed values.
Usually expected to be ``int`` s, ``float`` s or ``str`` s.
May also contain ``StochasticParameter`` s. Each
``Sto... | 7 | 2 | 16 | 1 | 12 | 3 | 3 | 0.64 | 1 | 5 | 0 | 0 | 5 | 3 | 5 | 27 | 117 | 17 | 61 | 21 | 54 | 39 | 47 | 20 | 41 | 12 | 2 | 3 | 17 |
20,437 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Clip | from . import imgaug as ia
import numpy as np
class Clip(StochasticParameter):
"""Clip another parameter to a defined value range.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
The other parameter, which's values are to be clipped.
minval : None or number, opti... |
class Clip(StochasticParameter):
'''Clip another parameter to a defined value range.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
The other parameter, which's values are to be clipped.
minval : None or number, optional
The minimum value to use.
I... | 5 | 1 | 8 | 1 | 7 | 1 | 2 | 0.77 | 1 | 4 | 0 | 0 | 4 | 3 | 4 | 26 | 65 | 12 | 30 | 10 | 25 | 23 | 25 | 10 | 20 | 4 | 2 | 1 | 8 |
20,438 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Deterministic | from . import imgaug as ia
import numpy as np
class Deterministic(StochasticParameter):
"""Parameter that is a constant value.
If ``N`` values are sampled from this parameter, it will return ``N`` times
``V``, where ``V`` is the constant value.
Parameters
----------
value : number or str or i... |
class Deterministic(StochasticParameter):
'''Parameter that is a constant value.
If ``N`` values are sampled from this parameter, it will return ``N`` times
``V``, where ``V`` is the constant value.
Parameters
----------
value : number or str or imgaug.parameters.StochasticParameter
A c... | 5 | 1 | 6 | 0 | 6 | 0 | 3 | 0.72 | 1 | 4 | 0 | 0 | 4 | 1 | 4 | 26 | 52 | 9 | 25 | 7 | 20 | 18 | 21 | 7 | 16 | 3 | 2 | 1 | 10 |
20,439 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.DeterministicList | from . import imgaug as ia
import numpy as np
class DeterministicList(StochasticParameter):
"""Parameter that repeats elements from a list in the given order.
E.g. of samples of shape ``(A, B, C)`` are requested, this parameter will
return the first ``A*B*C`` elements, reshaped to ``(A, B, C)`` from the
... |
class DeterministicList(StochasticParameter):
'''Parameter that repeats elements from a list in the given order.
E.g. of samples of shape ``(A, B, C)`` are requested, this parameter will
return the first ``A*B*C`` elements, reshaped to ``(A, B, C)`` from the
provided list. If the list contains less tha... | 5 | 1 | 10 | 1 | 8 | 2 | 2 | 0.74 | 1 | 5 | 0 | 0 | 4 | 1 | 4 | 26 | 65 | 11 | 31 | 11 | 26 | 23 | 26 | 11 | 21 | 4 | 2 | 2 | 9 |
20,440 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.DiscreteUniform | import numpy as np
class DiscreteUniform(StochasticParameter):
"""Uniform distribution over the discrete interval ``[a..b]``.
Parameters
----------
a : int or tuple of int or list of int or imgaug.parameters.StochasticParameter
Lower bound of the interval.
If ``a>b``, `a` and `b` will ... |
class DiscreteUniform(StochasticParameter):
'''Uniform distribution over the discrete interval ``[a..b]``.
Parameters
----------
a : int or tuple of int or list of int or imgaug.parameters.StochasticParameter
Lower bound of the interval.
If ``a>b``, `a` and `b` will automatically be fli... | 7 | 2 | 4 | 0 | 4 | 1 | 1 | 1.6 | 1 | 1 | 0 | 0 | 5 | 2 | 5 | 27 | 65 | 13 | 20 | 11 | 13 | 32 | 18 | 10 | 12 | 3 | 2 | 1 | 7 |
20,441 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Discretize | import numpy as np
class Discretize(StochasticParameter):
"""Convert a continuous distribution to a discrete one.
This will round the values and then cast them to integers.
Values sampled from already discrete distributions are not changed.
Parameters
----------
other_param : imgaug.parameter... |
class Discretize(StochasticParameter):
'''Convert a continuous distribution to a discrete one.
This will round the values and then cast them to integers.
Values sampled from already discrete distributions are not changed.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter... | 5 | 1 | 8 | 1 | 6 | 2 | 2 | 0.88 | 1 | 2 | 0 | 0 | 4 | 2 | 4 | 26 | 59 | 12 | 25 | 11 | 20 | 22 | 22 | 11 | 17 | 3 | 2 | 1 | 6 |
20,442 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Divide | import numpy as np
class Divide(StochasticParameter):
"""Divide the samples of another stochastic parameter.
This parameter will automatically prevent division by zero (uses 1.0)
as the denominator in these cases.
Parameters
----------
other_param : number or tuple of number or list of number... |
class Divide(StochasticParameter):
'''Divide the samples of another stochastic parameter.
This parameter will automatically prevent division by zero (uses 1.0)
as the denominator in these cases.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters... | 5 | 1 | 10 | 2 | 7 | 1 | 2 | 1.33 | 1 | 4 | 1 | 0 | 4 | 3 | 4 | 26 | 90 | 20 | 30 | 13 | 25 | 40 | 22 | 13 | 17 | 3 | 2 | 2 | 6 |
20,443 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.ForceSign | from . import imgaug as ia
import numpy as np
class ForceSign(StochasticParameter):
"""Convert a parameter's samples to either positive or negative values.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be modified.
... |
class ForceSign(StochasticParameter):
'''Convert a parameter's samples to either positive or negative values.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be modified.
positive : bool
Whether to force all sig... | 5 | 1 | 16 | 2 | 13 | 2 | 3 | 0.63 | 1 | 3 | 0 | 0 | 4 | 4 | 4 | 26 | 103 | 20 | 51 | 16 | 45 | 32 | 37 | 15 | 32 | 7 | 2 | 3 | 10 |
20,444 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.FrequencyNoise | import cv2
from . import imgaug as ia
import numpy as np
class FrequencyNoise(StochasticParameter):
"""Parameter to generate noise of varying frequencies.
This parameter expects to sample noise for 2d planes, i.e. for
sizes ``(H, W, [C])`` and will return a value in the range ``[0.0, 1.0]``
per spatia... |
class FrequencyNoise(StochasticParameter):
'''Parameter to generate noise of varying frequencies.
This parameter expects to sample noise for 2d planes, i.e. for
sizes ``(H, W, [C])`` and will return a value in the range ``[0.0, 1.0]``
per spatial location in that plane.
The exponent controls the fr... | 12 | 1 | 19 | 2 | 14 | 3 | 2 | 0.72 | 1 | 8 | 2 | 0 | 6 | 4 | 8 | 30 | 256 | 39 | 126 | 50 | 113 | 91 | 92 | 46 | 82 | 5 | 2 | 2 | 21 |
20,445 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.FromLowerResolution | from . import dtypes as iadt
from . import imgaug as ia
import numpy as np
class FromLowerResolution(StochasticParameter):
"""Parameter to sample from other parameters at lower image resolutions.
This parameter is intended to be used with parameters that would usually
sample one value per pixel (or one va... |
class FromLowerResolution(StochasticParameter):
'''Parameter to sample from other parameters at lower image resolutions.
This parameter is intended to be used with parameters that would usually
sample one value per pixel (or one value per pixel and channel). Instead
of sampling from the other parameter... | 5 | 1 | 33 | 3 | 28 | 3 | 6 | 0.66 | 1 | 9 | 3 | 0 | 4 | 6 | 4 | 26 | 210 | 25 | 112 | 24 | 106 | 74 | 67 | 23 | 62 | 11 | 2 | 3 | 24 |
20,446 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.IterativeNoiseAggregator | import six.moves as sm
from . import imgaug as ia
import numpy as np
class IterativeNoiseAggregator(StochasticParameter):
"""Aggregate multiple iterations of samples from another parameter.
This is supposed to be used in conjunction with :class:`SimplexNoise` or
:class:`FrequencyNoise`. If a shape ``S`` i... |
class IterativeNoiseAggregator(StochasticParameter):
'''Aggregate multiple iterations of samples from another parameter.
This is supposed to be used in conjunction with :class:`SimplexNoise` or
:class:`FrequencyNoise`. If a shape ``S`` is requested, it will request
``I`` times ``S`` samples from the un... | 6 | 1 | 21 | 2 | 19 | 0 | 4 | 0.6 | 1 | 8 | 3 | 0 | 4 | 3 | 4 | 26 | 166 | 23 | 90 | 18 | 83 | 54 | 52 | 17 | 46 | 9 | 2 | 3 | 19 |
20,447 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Laplace | import numpy as np
class Laplace(StochasticParameter):
"""Parameter that resembles a (continuous) laplace distribution.
This is a wrapper around numpy's :func:`numpy.random.laplace`.
Parameters
----------
loc : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
... |
class Laplace(StochasticParameter):
'''Parameter that resembles a (continuous) laplace distribution.
This is a wrapper around numpy's :func:`numpy.random.laplace`.
Parameters
----------
loc : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
The position o... | 7 | 2 | 4 | 0 | 4 | 0 | 1 | 1.6 | 1 | 1 | 0 | 0 | 5 | 2 | 5 | 27 | 65 | 13 | 20 | 11 | 13 | 32 | 18 | 10 | 12 | 2 | 2 | 1 | 6 |
20,448 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Multiply | import numpy as np
class Multiply(StochasticParameter):
"""Multiply the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be multiplied ... |
class Multiply(StochasticParameter):
'''Multiply the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be multiplied with `val`.
... | 5 | 1 | 7 | 1 | 6 | 0 | 2 | 1.4 | 1 | 3 | 1 | 0 | 4 | 3 | 4 | 26 | 75 | 15 | 25 | 12 | 20 | 35 | 20 | 12 | 15 | 3 | 2 | 1 | 6 |
20,449 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Normal | import numpy as np
class Normal(StochasticParameter):
"""Parameter that resembles a normal/gaussian distribution.
Parameters
----------
loc : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
The mean of the normal distribution.
* If a single ``n... |
class Normal(StochasticParameter):
'''Parameter that resembles a normal/gaussian distribution.
Parameters
----------
loc : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
The mean of the normal distribution.
* If a single ``number``, this ``numbe... | 7 | 2 | 4 | 0 | 4 | 0 | 1 | 1.5 | 1 | 1 | 0 | 0 | 5 | 2 | 5 | 27 | 62 | 12 | 20 | 11 | 13 | 30 | 18 | 10 | 12 | 2 | 2 | 1 | 6 |
20,450 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Poisson | import numpy as np
class Poisson(StochasticParameter):
"""Parameter that resembles a poisson distribution.
A poisson distribution with ``lambda=0`` has its highest probability at
point ``0`` and decreases quickly from there.
Poisson distributions are discrete and never negative.
Parameters
--... |
class Poisson(StochasticParameter):
'''Parameter that resembles a poisson distribution.
A poisson distribution with ``lambda=0`` has its highest probability at
point ``0`` and decreases quickly from there.
Poisson distributions are discrete and never negative.
Parameters
----------
lam : nu... | 7 | 2 | 3 | 0 | 3 | 0 | 1 | 1.93 | 1 | 1 | 0 | 0 | 5 | 1 | 5 | 27 | 58 | 14 | 15 | 9 | 8 | 29 | 14 | 8 | 8 | 1 | 2 | 0 | 5 |
20,451 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Power | import numpy as np
class Power(StochasticParameter):
"""Exponentiate the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be exponentia... |
class Power(StochasticParameter):
'''Exponentiate the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be exponentiated by `val`.
... | 5 | 1 | 10 | 2 | 7 | 2 | 2 | 1.54 | 1 | 4 | 1 | 0 | 4 | 3 | 4 | 26 | 88 | 17 | 28 | 14 | 23 | 43 | 23 | 14 | 18 | 3 | 2 | 1 | 6 |
20,452 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.RandomSign | from . import imgaug as ia
import numpy as np
class RandomSign(StochasticParameter):
"""Convert a parameter's samples randomly to positive or negative values.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be modified.
... |
class RandomSign(StochasticParameter):
'''Convert a parameter's samples randomly to positive or negative values.
Parameters
----------
other_param : imgaug.parameters.StochasticParameter
Other parameter which's sampled values are to be modified.
p_positive : number
Fraction of value... | 5 | 1 | 9 | 1 | 7 | 2 | 1 | 0.79 | 1 | 3 | 0 | 0 | 4 | 2 | 4 | 26 | 61 | 11 | 28 | 13 | 23 | 22 | 21 | 13 | 16 | 1 | 2 | 0 | 4 |
20,453 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Sigmoid | from . import imgaug as ia
from operator import mul as mul_op
import numpy as np
class Sigmoid(StochasticParameter):
"""Apply a sigmoid function to the outputs of another parameter.
This is intended to be used in combination with :class:`SimplexNoise` or
:class:`FrequencyNoise`. It pushes the noise values... |
class Sigmoid(StochasticParameter):
'''Apply a sigmoid function to the outputs of another parameter.
This is intended to be used in combination with :class:`SimplexNoise` or
:class:`FrequencyNoise`. It pushes the noise values away from ``~0.5`` and
towards ``0.0`` or ``1.0``, making the noise maps more... | 7 | 2 | 13 | 2 | 7 | 4 | 1 | 1.79 | 1 | 3 | 0 | 0 | 4 | 5 | 5 | 27 | 131 | 25 | 38 | 18 | 30 | 68 | 29 | 16 | 23 | 3 | 2 | 1 | 7 |
20,454 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.SimplexNoise | import six.moves as sm
from .external.opensimplex import OpenSimplex
from . import imgaug as ia
import numpy as np
class SimplexNoise(StochasticParameter):
"""Parameter that generates simplex noise of varying resolutions.
This parameter expects to sample noise for 2d planes, i.e. for
sizes ``(H, W, [C])``... |
class SimplexNoise(StochasticParameter):
'''Parameter that generates simplex noise of varying resolutions.
This parameter expects to sample noise for 2d planes, i.e. for
sizes ``(H, W, [C])`` and will return a value in the range ``[0.0, 1.0]``
per spatial location in that plane.
The noise is sample... | 7 | 1 | 19 | 2 | 16 | 2 | 4 | 0.64 | 1 | 9 | 3 | 0 | 6 | 2 | 6 | 28 | 186 | 30 | 96 | 34 | 88 | 61 | 68 | 32 | 61 | 7 | 2 | 3 | 22 |
20,455 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.StochasticParameter | import six
from abc import ABCMeta, abstractmethod
import numpy as np
import imageio
import copy as copy_module
from . import random as iarandom
import six.moves as sm
import tempfile
from . import imgaug as ia
@six.add_metaclass(ABCMeta)
class StochasticParameter(object):
"""Abstract parent class for all stochast... | @six.add_metaclass(ABCMeta)
class StochasticParameter(object):
'''Abstract parent class for all stochastic parameters.
Stochastic parameters are here all parameters from which values are
supposed to be sampled. Usually the sampled values are to a degree random.
E.g. a stochastic parameter may be the uni... | 26 | 7 | 12 | 1 | 7 | 4 | 2 | 0.57 | 1 | 12 | 7 | 29 | 22 | 0 | 22 | 22 | 299 | 50 | 159 | 35 | 133 | 90 | 103 | 32 | 79 | 4 | 1 | 1 | 43 |
20,456 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Subtract | import numpy as np
class Subtract(StochasticParameter):
"""Subtract from the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Samples of `val` will be subtracted from samples of thi... |
class Subtract(StochasticParameter):
'''Subtract from the samples of another stochastic parameter.
Parameters
----------
other_param : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Samples of `val` will be subtracted from samples of this parameter.
... | 5 | 1 | 7 | 1 | 6 | 0 | 2 | 1.46 | 1 | 3 | 1 | 0 | 4 | 3 | 4 | 26 | 74 | 15 | 24 | 12 | 19 | 35 | 20 | 12 | 15 | 3 | 2 | 1 | 6 |
20,457 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.TruncatedNormal | import scipy
import numpy as np
import scipy.stats
class TruncatedNormal(StochasticParameter):
"""Parameter that resembles a truncated normal distribution.
A truncated normal distribution is similar to a normal distribution,
except the domain is smoothly bounded to a min and max value.
This is a wrap... |
class TruncatedNormal(StochasticParameter):
'''Parameter that resembles a truncated normal distribution.
A truncated normal distribution is similar to a normal distribution,
except the domain is smoothly bounded to a min and max value.
This is a wrapper around :func:`scipy.stats.truncnorm`.
Paramet... | 7 | 2 | 7 | 0 | 6 | 1 | 1 | 1.45 | 1 | 1 | 0 | 0 | 5 | 4 | 5 | 27 | 94 | 18 | 31 | 19 | 24 | 45 | 28 | 18 | 22 | 3 | 2 | 1 | 7 |
20,458 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Uniform | import numpy as np
class Uniform(StochasticParameter):
"""Parameter that resembles a uniform distribution over ``[a, b)``.
Parameters
----------
a : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Lower bound of the interval.
If ``a>b``, `a` and `b`... |
class Uniform(StochasticParameter):
'''Parameter that resembles a uniform distribution over ``[a, b)``.
Parameters
----------
a : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Lower bound of the interval.
If ``a>b``, `a` and `b` will automatically ... | 7 | 2 | 4 | 0 | 4 | 1 | 1 | 1.55 | 1 | 1 | 0 | 0 | 5 | 2 | 5 | 27 | 64 | 13 | 20 | 11 | 13 | 31 | 18 | 10 | 12 | 3 | 2 | 1 | 7 |
20,459 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.Weibull | import numpy as np
class Weibull(StochasticParameter):
"""
Parameter that resembles a (continuous) weibull distribution.
This is a wrapper around numpy's :func:`numpy.random.weibull`.
Parameters
----------
a : number or tuple of number or list of number or imgaug.parameters.StochasticParamete... |
class Weibull(StochasticParameter):
'''
Parameter that resembles a (continuous) weibull distribution.
This is a wrapper around numpy's :func:`numpy.random.weibull`.
Parameters
----------
a : number or tuple of number or list of number or imgaug.parameters.StochasticParameter
Shape param... | 7 | 2 | 3 | 0 | 3 | 1 | 1 | 1.8 | 1 | 1 | 0 | 0 | 5 | 1 | 5 | 27 | 54 | 12 | 15 | 9 | 8 | 27 | 14 | 8 | 8 | 1 | 2 | 0 | 5 |
20,460 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.no_prefetching | class no_prefetching(toggled_prefetching):
"""Context that deactviates prefetching.
Added in 0.5.0.
"""
def __init__(self):
super(no_prefetching, self).__init__(False) | class no_prefetching(toggled_prefetching):
'''Context that deactviates prefetching.
Added in 0.5.0.
'''
def __init__(self):
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 1.67 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 4 | 10 | 3 | 3 | 2 | 1 | 5 | 3 | 2 | 1 | 1 | 2 | 0 | 1 |
20,461 | aleju/imgaug | aleju_imgaug/imgaug/parameters.py | imgaug.parameters.toggled_prefetching | class toggled_prefetching(object):
"""Context that toggles prefetching on or off depending on a flag.
Added in 0.5.0.
Parameters
----------
enabled : bool
Whether enabled is activated (``True``) or off (``False``).
"""
def __init__(self, enabled):
self.enabled = enabled
... | class toggled_prefetching(object):
'''Context that toggles prefetching on or off depending on a flag.
Added in 0.5.0.
Parameters
----------
enabled : bool
Whether enabled is activated (``True``) or off (``False``).
'''
def __init__(self, enabled):
pass
def __enter__(sel... | 4 | 1 | 4 | 0 | 3 | 1 | 1 | 1.18 | 1 | 0 | 0 | 1 | 3 | 2 | 3 | 3 | 29 | 6 | 11 | 8 | 5 | 13 | 11 | 8 | 5 | 1 | 1 | 0 | 3 |
20,462 | aleju/imgaug | aleju_imgaug/imgaug/random.py | imgaug.random.RNG | import numpy as np
import six.moves as sm
class RNG(object):
"""
Random number generator for imgaug.
This class is a wrapper around ``numpy.random.Generator`` and
automatically falls back to ``numpy.random.RandomState`` in case of
numpy version 1.16 or lower. It allows to use numpy 1.17's sampling... |
class RNG(object):
'''
Random number generator for imgaug.
This class is a wrapper around ``numpy.random.Generator`` and
automatically falls back to ``numpy.random.RandomState`` in case of
numpy version 1.16 or lower. It allows to use numpy 1.17's sampling
functions in 1.16 too and supports a v... | 73 | 67 | 9 | 2 | 3 | 5 | 1 | 1.84 | 1 | 1 | 0 | 0 | 64 | 3 | 67 | 67 | 766 | 178 | 207 | 87 | 129 | 381 | 172 | 78 | 102 | 3 | 1 | 1 | 77 |
20,463 | aleju/imgaug | aleju_imgaug/imgaug/random.py | imgaug.random.temporary_numpy_seed | import numpy as np
class temporary_numpy_seed(object):
"""Context to temporarily alter the random state of ``numpy.random``.
The random state's internal state will be set back to the original one
once the context finishes.
Added in 0.4.0.
Parameters
----------
entropy : None or int
... |
class temporary_numpy_seed(object):
'''Context to temporarily alter the random state of ``numpy.random``.
The random state's internal state will be set back to the original one
once the context finishes.
Added in 0.4.0.
Parameters
----------
entropy : None or int
The seed value to u... | 4 | 1 | 3 | 0 | 3 | 0 | 2 | 1.27 | 1 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 32 | 7 | 11 | 6 | 7 | 14 | 11 | 6 | 7 | 2 | 1 | 1 | 5 |
20,464 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/adapters.py | chatterbot.adapters.Adapter | class Adapter(object):
"""
A superclass for all adapter classes.
:param chatbot: A ChatBot instance.
"""
def __init__(self, chatbot, **kwargs):
self.chatbot = chatbot
class AdapterMethodNotImplementedError(NotImplementedError):
"""
An exception to be raised when an ada... | class Adapter(object):
'''
A superclass for all adapter classes.
:param chatbot: A ChatBot instance.
'''
def __init__(self, chatbot, **kwargs):
pass
class AdapterMethodNotImplementedError(NotImplementedError):
'''
An exception to be raised when an adapter method has not... | 5 | 4 | 4 | 0 | 2 | 2 | 1 | 2 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 29 | 5 | 8 | 6 | 3 | 16 | 8 | 6 | 3 | 1 | 1 | 0 | 2 |
20,465 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/chatterbot.py | chatterbot.chatterbot.ChatBot | import spacy
from chatterbot.logic import LogicAdapter
import logging
from chatterbot.search import TextSearch, IndexedTextSearch
from chatterbot.tagging import PosLemmaTagger
from chatterbot.conversation import Statement
from typing import Union
from chatterbot import languages
from chatterbot.storage import StorageAd... |
class ChatBot(object):
'''
A conversational dialog chat bot.
:param name: A name is the only required parameter for the ChatBot class.
:type name: str
:keyword storage_adapter: The dot-notated import path to a storage adapter class.
Defaults to ``"chatterbot.storage.SQ... | 9 | 5 | 43 | 10 | 27 | 6 | 6 | 0.23 | 1 | 11 | 7 | 0 | 5 | 7 | 5 | 5 | 268 | 67 | 163 | 52 | 153 | 38 | 119 | 52 | 109 | 12 | 1 | 4 | 38 |
20,466 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/comparisons.py | chatterbot.comparisons.Comparator | class Comparator:
"""
Base class establishing the interface that all comparators should implement.
"""
def __init__(self, language):
self.language = language
def __call__(self, statement_a, statement_b):
return self.compare(statement_a, statement_b)
def compare_text(self, text... | class Comparator:
'''
Base class establishing the interface that all comparators should implement.
'''
def __init__(self, language):
pass
def __call__(self, statement_a, statement_b):
pass
def compare_text(self, text_a: str, text_b: str) -> float:
'''
Imple... | 5 | 3 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 3 | 3 | 1 | 3 | 3 | 11 | 4 | 7 | 5 | 3 | 0 | 7 | 5 | 3 | 1 | 0 | 0 | 3 |
20,467 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/comparisons.py | chatterbot.comparisons.JaccardSimilarity | from chatterbot.utils import get_model_for_language
import spacy
class JaccardSimilarity(Comparator):
"""
Calculates the similarity of two statements based on the Jaccard index.
The Jaccard index is composed of a numerator and denominator.
In the numerator, we count the number of items that are shared... |
class JaccardSimilarity(Comparator):
'''
Calculates the similarity of two statements based on the Jaccard index.
The Jaccard index is composed of a numerator and denominator.
In the numerator, we count the number of items that are shared between the sets.
In the denominator, we count the total numb... | 3 | 2 | 21 | 3 | 16 | 3 | 2 | 0.75 | 1 | 6 | 1 | 0 | 2 | 1 | 2 | 5 | 69 | 13 | 32 | 15 | 28 | 24 | 22 | 14 | 18 | 3 | 1 | 1 | 4 |
20,468 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/comparisons.py | chatterbot.comparisons.LevenshteinDistance | from difflib import SequenceMatcher
class LevenshteinDistance(Comparator):
"""
Compare two statements based on the Levenshtein distance
of each statement's text.
For example, there is a 65% similarity between the statements
"where is the post office?" and "looking for the post office"
based on... |
class LevenshteinDistance(Comparator):
'''
Compare two statements based on the Levenshtein distance
of each statement's text.
For example, there is a 65% similarity between the statements
"where is the post office?" and "looking for the post office"
based on the Levenshtein distance algorithm.
... | 2 | 2 | 26 | 6 | 12 | 8 | 2 | 1.15 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 4 | 36 | 8 | 13 | 6 | 11 | 15 | 9 | 6 | 7 | 2 | 1 | 1 | 2 |
20,469 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/comparisons.py | chatterbot.comparisons.SpacySimilarity | import spacy
from chatterbot.utils import get_model_for_language
class SpacySimilarity(Comparator):
"""
Calculate the similarity of two statements using Spacy models.
NOTE:
You will also need to download a ``spacy`` model to use for tagging. Internally these are used to determine parts of speech f... |
class SpacySimilarity(Comparator):
'''
Calculate the similarity of two statements using Spacy models.
NOTE:
You will also need to download a ``spacy`` model to use for tagging. Internally these are used to determine parts of speech for words.
The easiest way to do this is to use the ``spacy... | 3 | 2 | 16 | 2 | 11 | 3 | 2 | 0.78 | 1 | 4 | 1 | 0 | 2 | 1 | 2 | 5 | 55 | 14 | 23 | 10 | 19 | 18 | 17 | 9 | 13 | 3 | 1 | 1 | 4 |
20,470 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/conversation.py | chatterbot.conversation.Statement | from dateutil import parser as date_parser
from datetime import datetime, timezone
class Statement(StatementMixin):
"""
A statement represents a single spoken entity, sentence or
phrase that someone can say.
"""
__slots__ = ('id', 'text', 'search_text', 'conversation', 'persona', 'tags', 'in_respon... |
class Statement(StatementMixin):
'''
A statement represents a single spoken entity, sentence or
phrase that someone can say.
'''
def __init__(self, text: str, in_response_to=None, **kwargs):
pass
def __str__(self):
pass
def __repr__(self):
pass
def save(self)... | 5 | 2 | 9 | 1 | 6 | 2 | 2 | 0.31 | 1 | 3 | 0 | 0 | 4 | 11 | 4 | 8 | 57 | 10 | 36 | 17 | 31 | 11 | 24 | 17 | 19 | 3 | 2 | 1 | 6 |
20,471 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/conversation.py | chatterbot.conversation.StatementMixin | class StatementMixin(object):
"""
This class has shared methods used to
normalize different statement models.
"""
statement_field_names = ['id', 'text', 'search_text', 'conversation', 'persona', 'tags', 'in_response_to', 'search_in_response_to', 'created_at']
extra_statement_field_names = []
... | class StatementMixin(object):
'''
This class has shared methods used to
normalize different statement models.
'''
def get_statement_field_names(self) -> list[str]:
'''
Return the list of field names for the statement.
'''
pass
def get_tags(self) -> list[str]:
... | 5 | 5 | 8 | 1 | 4 | 3 | 2 | 0.57 | 1 | 0 | 0 | 3 | 4 | 0 | 4 | 4 | 56 | 9 | 30 | 10 | 25 | 17 | 17 | 10 | 12 | 3 | 1 | 2 | 6 |
20,472 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/exceptions.py | chatterbot.exceptions.OptionalDependencyImportError | class OptionalDependencyImportError(ImportError):
"""
An exception raised when a feature requires an optional dependency to be installed.
"""
pass | class OptionalDependencyImportError(ImportError):
'''
An exception raised when a feature requires an optional dependency to be installed.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 5 | 0 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
20,473 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/abstract_models.py | chatterbot.ext.django_chatterbot.abstract_models.AbstractBaseStatement | from django.db import models
from chatterbot.conversation import StatementMixin
from django.utils import timezone
from chatterbot import constants
class AbstractBaseStatement(models.Model, StatementMixin):
"""
The abstract base statement allows other models to be created
using the attributes that exist on ... |
class AbstractBaseStatement(models.Model, StatementMixin):
'''
The abstract base statement allows other models to be created
using the attributes that exist on the default models.
'''
class Meta:
def __str__(self):
pass
def get_tags(self) -> list[str]:
'''
Ret... | 5 | 3 | 6 | 0 | 4 | 3 | 2 | 0.28 | 2 | 1 | 0 | 1 | 3 | 0 | 3 | 7 | 81 | 13 | 53 | 17 | 48 | 15 | 23 | 17 | 18 | 3 | 2 | 1 | 6 |
20,474 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/abstract_models.py | chatterbot.ext.django_chatterbot.abstract_models.AbstractBaseTag | from chatterbot import constants
from django.db import models
class AbstractBaseTag(models.Model):
"""
The abstract base tag allows other models to be created
using the attributes that exist on the default models.
"""
name = models.SlugField(max_length=constants.TAG_NAME_MAX_LENGTH, unique=True, he... |
class AbstractBaseTag(models.Model):
'''
The abstract base tag allows other models to be created
using the attributes that exist on the default models.
'''
class Meta:
def __str__(self):
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.44 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 16 | 3 | 9 | 5 | 6 | 4 | 6 | 5 | 3 | 1 | 1 | 0 | 1 |
20,475 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/apps.py | chatterbot.ext.django_chatterbot.apps.DjangoChatterBotConfig | from django.apps import AppConfig
class DjangoChatterBotConfig(AppConfig):
name = 'chatterbot.ext.django_chatterbot'
label = 'django_chatterbot'
verbose_name = 'Django ChatterBot'
def ready(self):
from chatterbot.ext.django_chatterbot import settings as defaults
from django.conf import... |
class DjangoChatterBotConfig(AppConfig):
def ready(self):
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 4 | 4 | 3 | 0 | 4 | 4 | 3 | 0 | 1 | 0 | 0 |
20,476 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0001_initial.py | chatterbot.ext.django_chatterbot.migrations.0001_initial.Migration | from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [migrations.CreateModel(name='Response', fields=[('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 3 | 29 | 4 | 28 | 0 | 4 | 4 | 3 | 0 | 1 | 0 | 0 |
20,477 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0002_statement_extra_data.py | chatterbot.ext.django_chatterbot.migrations.0002_statement_extra_data.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0001_initial')]
operations = [migrations.AddField(model_name='statement', name='extra_data', field=models.CharField(default='{}', max_length=500), preserve_default=False)] |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 2 | 12 | 3 | 11 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,478 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0003_change_occurrence_default.py | chatterbot.ext.django_chatterbot.migrations.0003_change_occurrence_default.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0002_statement_extra_data')]
operations = [migrations.AlterField(model_name='response', name='occurrence', field=models.PositiveIntegerField(default=1))] |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 11 | 3 | 10 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,479 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0004_rename_in_response_to.py | chatterbot.ext.django_chatterbot.migrations.0004_rename_in_response_to.Migration | from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0003_change_occurrence_default')]
operations = [migrations.AlterField(model_name='response', name='statement', field=models.ForeignKey(on_delete=django.db.mode... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 2 | 16 | 3 | 15 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,480 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0005_statement_created_at.py | chatterbot.ext.django_chatterbot.migrations.0005_statement_created_at.Migration | import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0004_rename_in_response_to')]
operations = [migrations.AddField(model_name='statement', name='created_at', field=models.DateTimeField(default=django.utils.timezone... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 2 | 14 | 3 | 13 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,481 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py | chatterbot.ext.django_chatterbot.migrations.0006_create_conversation.Migration | from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0005_statement_created_at')]
operations = [migrations.CreateModel(name='Conversation', fields=[('id', models.AutoField(auto_create... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 2 | 22 | 3 | 21 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,482 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0007_response_created_at.py | chatterbot.ext.django_chatterbot.migrations.0007_response_created_at.Migration | from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0006_create_conversation')]
operations = [migrations.AddField(model_name='response', name='created_at', field=models.DateTimeField(default=django.utils.timezone.no... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 2 | 14 | 3 | 13 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,483 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0008_update_conversations.py | chatterbot.ext.django_chatterbot.migrations.0008_update_conversations.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0007_response_created_at')]
operations = [migrations.RemoveField(model_name='conversation', name='statements'), migrations.RemoveField(model_name='response', name='occurrence'), migrations.Rem... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 2 | 23 | 3 | 22 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,484 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0009_tags.py | chatterbot.ext.django_chatterbot.migrations.0009_tags.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0008_update_conversations')]
operations = [migrations.CreateModel(name='Tag', fields=[('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name'... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 2 | 26 | 3 | 25 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,485 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0010_statement_text.py | chatterbot.ext.django_chatterbot.migrations.0010_statement_text.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0009_tags')]
operations = [migrations.AlterField(model_name='statement', name='text', field=models.CharField(max_length=400, unique=True))] |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 11 | 3 | 10 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,486 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0011_blank_extra_data.py | chatterbot.ext.django_chatterbot.migrations.0011_blank_extra_data.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0010_statement_text')]
operations = [migrations.AlterField(model_name='statement', name='extra_data', field=models.CharField(blank=True, max_length=500))] |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 11 | 3 | 10 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,487 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0012_statement_created_at.py | chatterbot.ext.django_chatterbot.migrations.0012_statement_created_at.Migration | import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0011_blank_extra_data')]
operations = [migrations.AddField(model_name='statement', name='created_at', field=models.DateTimeField(default=django.utils.timezone.now,... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16 | 2 | 14 | 3 | 13 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,488 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0013_change_conversations.py | chatterbot.ext.django_chatterbot.migrations.0013_change_conversations.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0012_statement_created_at')]
operations = [migrations.RemoveField(model_name='conversation', name='responses'), migrations.RemoveField(model_name='response', name='response'), migrations.Remov... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 42 | 2 | 40 | 3 | 39 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,489 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0014_remove_statement_extra_data.py | chatterbot.ext.django_chatterbot.migrations.0014_remove_statement_extra_data.Migration | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0013_change_conversations')]
operations = [migrations.RemoveField(model_name='statement', name='extra_data')] |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 2 | 10 | 3 | 9 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,490 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0015_statement_persona.py | chatterbot.ext.django_chatterbot.migrations.0015_statement_persona.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0014_remove_statement_extra_data')]
operations = [migrations.AddField(model_name='statement', name='persona', field=models.CharField(default='', max_length=50), preserve_default=False)] |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 2 | 12 | 3 | 11 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,491 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0016_statement_stemmed_text.py | chatterbot.ext.django_chatterbot.migrations.0016_statement_stemmed_text.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0015_statement_persona')]
operations = [migrations.AddField(model_name='statement', name='search_text', field=models.CharField(blank=True, max_length=400)), migrations.AddField(model_name='sta... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 2 | 16 | 3 | 15 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,492 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0017_tags_unique.py | chatterbot.ext.django_chatterbot.migrations.0017_tags_unique.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0016_statement_stemmed_text')]
operations = [migrations.RemoveField(model_name='tag', name='statements'), migrations.AddField(model_name='statement', name='tags', field=models.ManyToManyField(... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 2 | 23 | 3 | 22 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,493 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0018_text_max_length.py | chatterbot.ext.django_chatterbot.migrations.0018_text_max_length.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0017_tags_unique')]
operations = [migrations.AlterField(model_name='statement', name='in_response_to', field=models.CharField(max_length=255, null=True)), migrations.AlterField(model_name='sta... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 2 | 26 | 3 | 25 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,494 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/migrations/0019_alter_statement_id_alter_tag_id_and_more.py | chatterbot.ext.django_chatterbot.migrations.0019_alter_statement_id_alter_tag_id_and_more.Migration | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [('django_chatterbot', '0018_text_max_length')]
operations = [migrations.AlterField(model_name='statement', name='id', field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'... |
class Migration(migrations.Migration):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 2 | 24 | 3 | 23 | 0 | 3 | 3 | 2 | 0 | 1 | 0 | 0 |
20,495 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/model_admin.py | chatterbot.ext.django_chatterbot.model_admin.StatementAdmin | from django.contrib import admin
class StatementAdmin(admin.ModelAdmin):
list_display = ('text', 'in_response_to', 'conversation', 'created_at')
list_filter = ('text', 'created_at')
search_fields = ('text',) |
class StatementAdmin(admin.ModelAdmin):
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,496 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/model_admin.py | chatterbot.ext.django_chatterbot.model_admin.TagAdmin | from django.contrib import admin
class TagAdmin(admin.ModelAdmin):
list_display = ('name',)
list_filter = ('name',)
search_fields = ('name',) |
class TagAdmin(admin.ModelAdmin):
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,497 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/models.py | chatterbot.ext.django_chatterbot.models.Statement | from chatterbot.ext.django_chatterbot.abstract_models import AbstractBaseStatement, AbstractBaseTag
class Statement(AbstractBaseStatement):
"""
A statement represents a single spoken entity, sentence or
phrase that someone can say.
"""
pass |
class Statement(AbstractBaseStatement):
'''
A statement represents a single spoken entity, sentence or
phrase that someone can say.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 6 | 0 | 2 | 1 | 1 | 4 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
20,498 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/django_chatterbot/models.py | chatterbot.ext.django_chatterbot.models.Tag | from chatterbot.ext.django_chatterbot.abstract_models import AbstractBaseStatement, AbstractBaseTag
class Tag(AbstractBaseTag):
"""
A label that categorizes a statement.
"""
pass |
class Tag(AbstractBaseTag):
'''
A label that categorizes a statement.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 5 | 0 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 0 | 2 | 0 | 0 |
20,499 | gunthercox/ChatterBot | gunthercox_ChatterBot/chatterbot/ext/sqlalchemy_app/models.py | chatterbot.ext.sqlalchemy_app.models.ModelBase | from sqlalchemy import Table, Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.ext.declarative import declared_attr
class ModelBase(object):
"""
An augmented base class for SqlAlchemy models.
"""
@declared_attr
def __tablename__(cls) -> str:
"""
Return the lowercase cl... |
class ModelBase(object):
'''
An augmented base class for SqlAlchemy models.
'''
@declared_attr
def __tablename__(cls) -> str:
'''
Return the lowercase class name as the name of the table.
'''
pass | 3 | 2 | 5 | 0 | 2 | 3 | 1 | 0.67 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 17 | 2 | 9 | 3 | 6 | 6 | 4 | 2 | 2 | 1 | 1 | 0 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.