body
stringlengths
26
98.2k
body_hash
int64
-9,222,864,604,528,158,000
9,221,803,474B
docstring
stringlengths
1
16.8k
path
stringlengths
5
230
name
stringlengths
1
96
repository_name
stringlengths
7
89
lang
stringclasses
1 value
body_without_docstring
stringlengths
20
98.2k
def test_unicode_doctest(self, testdir): '\n Test case for issue 2434: DecodeError on Python 2 when doctest contains non-ascii\n characters.\n ' p = testdir.maketxtfile(test_unicode_doctest='\n .. doctest::\n\n >>> print(\n ... "Hi\\n\\nByé")\n ...
-2,616,174,084,683,177,500
Test case for issue 2434: DecodeError on Python 2 when doctest contains non-ascii characters.
testing/test_doctest.py
test_unicode_doctest
NNRepos/pytest
python
def test_unicode_doctest(self, testdir): '\n Test case for issue 2434: DecodeError on Python 2 when doctest contains non-ascii\n characters.\n ' p = testdir.maketxtfile(test_unicode_doctest='\n .. doctest::\n\n >>> print(\n ... "Hi\\n\\nByé")\n ...
def test_unicode_doctest_module(self, testdir): '\n Test case for issue 2434: DecodeError on Python 2 when doctest docstring\n contains non-ascii characters.\n ' p = testdir.makepyfile(test_unicode_doctest_module='\n def fix_bad_unicode(text):\n \'\'\'\n ...
1,344,466,552,277,072,100
Test case for issue 2434: DecodeError on Python 2 when doctest docstring contains non-ascii characters.
testing/test_doctest.py
test_unicode_doctest_module
NNRepos/pytest
python
def test_unicode_doctest_module(self, testdir): '\n Test case for issue 2434: DecodeError on Python 2 when doctest docstring\n contains non-ascii characters.\n ' p = testdir.makepyfile(test_unicode_doctest_module='\n def fix_bad_unicode(text):\n \'\'\'\n ...
def test_print_unicode_value(self, testdir): "\n Test case for issue 3583: Printing Unicode in doctest under Python 2.7\n doesn't work\n " p = testdir.maketxtfile(test_print_unicode_value="\n Here is a doctest::\n\n >>> print('\\xE5\\xE9\\xEE\\xF8\\xFC')\n ...
958,529,165,784,957,400
Test case for issue 3583: Printing Unicode in doctest under Python 2.7 doesn't work
testing/test_doctest.py
test_print_unicode_value
NNRepos/pytest
python
def test_print_unicode_value(self, testdir): "\n Test case for issue 3583: Printing Unicode in doctest under Python 2.7\n doesn't work\n " p = testdir.maketxtfile(test_print_unicode_value="\n Here is a doctest::\n\n >>> print('\\xE5\\xE9\\xEE\\xF8\\xFC')\n ...
def test_reportinfo(self, testdir): '\n Test case to make sure that DoctestItem.reportinfo() returns lineno.\n ' p = testdir.makepyfile(test_reportinfo="\n def foo(x):\n '''\n >>> foo('a')\n 'b'\n '''\n r...
4,596,726,916,877,206,500
Test case to make sure that DoctestItem.reportinfo() returns lineno.
testing/test_doctest.py
test_reportinfo
NNRepos/pytest
python
def test_reportinfo(self, testdir): '\n \n ' p = testdir.makepyfile(test_reportinfo="\n def foo(x):\n '\n >>> foo('a')\n 'b'\n '\n return 'c'\n ") (items, reprec) = testdir.inline_genitems(p, '...
def test_valid_setup_py(self, testdir): '\n Test to make sure that pytest ignores valid setup.py files when ran\n with --doctest-modules\n ' p = testdir.makepyfile(setup="\n from setuptools import setup, find_packages\n setup(name='sample',\n version='...
2,163,101,895,664,856,000
Test to make sure that pytest ignores valid setup.py files when ran with --doctest-modules
testing/test_doctest.py
test_valid_setup_py
NNRepos/pytest
python
def test_valid_setup_py(self, testdir): '\n Test to make sure that pytest ignores valid setup.py files when ran\n with --doctest-modules\n ' p = testdir.makepyfile(setup="\n from setuptools import setup, find_packages\n setup(name='sample',\n version='...
def test_invalid_setup_py(self, testdir): '\n Test to make sure that pytest reads setup.py files that are not used\n for python packages when ran with --doctest-modules\n ' p = testdir.makepyfile(setup="\n def test_foo():\n return 'bar'\n ") result = tes...
410,459,342,461,927,800
Test to make sure that pytest reads setup.py files that are not used for python packages when ran with --doctest-modules
testing/test_doctest.py
test_invalid_setup_py
NNRepos/pytest
python
def test_invalid_setup_py(self, testdir): '\n Test to make sure that pytest reads setup.py files that are not used\n for python packages when ran with --doctest-modules\n ' p = testdir.makepyfile(setup="\n def test_foo():\n return 'bar'\n ") result = tes...
@pytest.mark.parametrize('config_mode', ['ini', 'comment']) def test_allow_unicode(self, testdir, config_mode): 'Test that doctests which output unicode work in all python versions\n tested by pytest when the ALLOW_UNICODE option is used (either in\n the ini file or by an inline comment).\n ' ...
7,622,682,363,274,835,000
Test that doctests which output unicode work in all python versions tested by pytest when the ALLOW_UNICODE option is used (either in the ini file or by an inline comment).
testing/test_doctest.py
test_allow_unicode
NNRepos/pytest
python
@pytest.mark.parametrize('config_mode', ['ini', 'comment']) def test_allow_unicode(self, testdir, config_mode): 'Test that doctests which output unicode work in all python versions\n tested by pytest when the ALLOW_UNICODE option is used (either in\n the ini file or by an inline comment).\n ' ...
@pytest.mark.parametrize('config_mode', ['ini', 'comment']) def test_allow_bytes(self, testdir, config_mode): 'Test that doctests which output bytes work in all python versions\n tested by pytest when the ALLOW_BYTES option is used (either in\n the ini file or by an inline comment)(#1287).\n ' ...
8,425,206,529,641,055,000
Test that doctests which output bytes work in all python versions tested by pytest when the ALLOW_BYTES option is used (either in the ini file or by an inline comment)(#1287).
testing/test_doctest.py
test_allow_bytes
NNRepos/pytest
python
@pytest.mark.parametrize('config_mode', ['ini', 'comment']) def test_allow_bytes(self, testdir, config_mode): 'Test that doctests which output bytes work in all python versions\n tested by pytest when the ALLOW_BYTES option is used (either in\n the ini file or by an inline comment)(#1287).\n ' ...
def test_unicode_string(self, testdir): 'Test that doctests which output unicode fail in Python 2 when\n the ALLOW_UNICODE option is not used. The same test should pass\n in Python 3.\n ' testdir.maketxtfile(test_doc="\n >>> b'12'.decode('ascii')\n '12'\n ") ...
-3,410,570,945,633,879,000
Test that doctests which output unicode fail in Python 2 when the ALLOW_UNICODE option is not used. The same test should pass in Python 3.
testing/test_doctest.py
test_unicode_string
NNRepos/pytest
python
def test_unicode_string(self, testdir): 'Test that doctests which output unicode fail in Python 2 when\n the ALLOW_UNICODE option is not used. The same test should pass\n in Python 3.\n ' testdir.maketxtfile(test_doc="\n >>> b'12'.decode('ascii')\n '12'\n ") ...
def test_bytes_literal(self, testdir): 'Test that doctests which output bytes fail in Python 3 when\n the ALLOW_BYTES option is not used. (#1287).\n ' testdir.maketxtfile(test_doc="\n >>> b'foo'\n 'foo'\n ") reprec = testdir.inline_run() reprec.assertoutcome(fa...
4,550,843,990,118,094,000
Test that doctests which output bytes fail in Python 3 when the ALLOW_BYTES option is not used. (#1287).
testing/test_doctest.py
test_bytes_literal
NNRepos/pytest
python
def test_bytes_literal(self, testdir): 'Test that doctests which output bytes fail in Python 3 when\n the ALLOW_BYTES option is not used. (#1287).\n ' testdir.maketxtfile(test_doc="\n >>> b'foo'\n 'foo'\n ") reprec = testdir.inline_run() reprec.assertoutcome(fa...
@pytest.mark.parametrize('config_mode', ['ini', 'comment']) def test_number_precision(self, testdir, config_mode): 'Test the NUMBER option.' if (config_mode == 'ini'): testdir.makeini('\n [pytest]\n doctest_optionflags = NUMBER\n ') comment = '' e...
-1,293,729,877,081,996,500
Test the NUMBER option.
testing/test_doctest.py
test_number_precision
NNRepos/pytest
python
@pytest.mark.parametrize('config_mode', ['ini', 'comment']) def test_number_precision(self, testdir, config_mode): if (config_mode == 'ini'): testdir.makeini('\n [pytest]\n doctest_optionflags = NUMBER\n ') comment = else: comment = '#do...
def test_doctest_module_session_fixture(self, testdir): 'Test that session fixtures are initialized for doctest modules (#768)\n ' testdir.makeconftest("\n import pytest\n import sys\n\n @pytest.yield_fixture(autouse=True, scope='session')\n def myfixture():\n ...
-7,865,538,692,801,229,000
Test that session fixtures are initialized for doctest modules (#768)
testing/test_doctest.py
test_doctest_module_session_fixture
NNRepos/pytest
python
def test_doctest_module_session_fixture(self, testdir): '\n ' testdir.makeconftest("\n import pytest\n import sys\n\n @pytest.yield_fixture(autouse=True, scope='session')\n def myfixture():\n assert not hasattr(sys, 'pytest_session_data')\n ...
@pytest.mark.parametrize('scope', SCOPES) @pytest.mark.parametrize('enable_doctest', [True, False]) def test_fixture_scopes(self, testdir, scope, enable_doctest): 'Test that auto-use fixtures work properly with doctest modules.\n See #1057 and #1100.\n ' testdir.makeconftest('\n import ...
-4,703,684,174,382,545,000
Test that auto-use fixtures work properly with doctest modules. See #1057 and #1100.
testing/test_doctest.py
test_fixture_scopes
NNRepos/pytest
python
@pytest.mark.parametrize('scope', SCOPES) @pytest.mark.parametrize('enable_doctest', [True, False]) def test_fixture_scopes(self, testdir, scope, enable_doctest): 'Test that auto-use fixtures work properly with doctest modules.\n See #1057 and #1100.\n ' testdir.makeconftest('\n import ...
@pytest.mark.parametrize('scope', SCOPES) @pytest.mark.parametrize('autouse', [True, False]) @pytest.mark.parametrize('use_fixture_in_doctest', [True, False]) def test_fixture_module_doctest_scopes(self, testdir, scope, autouse, use_fixture_in_doctest): 'Test that auto-use fixtures work properly with doctest files....
-3,690,328,013,666,819,600
Test that auto-use fixtures work properly with doctest files. See #1057 and #1100.
testing/test_doctest.py
test_fixture_module_doctest_scopes
NNRepos/pytest
python
@pytest.mark.parametrize('scope', SCOPES) @pytest.mark.parametrize('autouse', [True, False]) @pytest.mark.parametrize('use_fixture_in_doctest', [True, False]) def test_fixture_module_doctest_scopes(self, testdir, scope, autouse, use_fixture_in_doctest): 'Test that auto-use fixtures work properly with doctest files....
@pytest.mark.parametrize('scope', SCOPES) def test_auto_use_request_attributes(self, testdir, scope): 'Check that all attributes of a request in an autouse fixture\n behave as expected when requested for a doctest item.\n ' testdir.makeconftest('\n import pytest\n\n @pytest.f...
4,731,622,570,318,291,000
Check that all attributes of a request in an autouse fixture behave as expected when requested for a doctest item.
testing/test_doctest.py
test_auto_use_request_attributes
NNRepos/pytest
python
@pytest.mark.parametrize('scope', SCOPES) def test_auto_use_request_attributes(self, testdir, scope): 'Check that all attributes of a request in an autouse fixture\n behave as expected when requested for a doctest item.\n ' testdir.makeconftest('\n import pytest\n\n @pytest.f...
@pytest.mark.parametrize('scope', SCOPES) def test_namespace_doctestfile(self, testdir, scope): '\n Check that inserting something into the namespace works in a\n simple text file doctest\n ' testdir.makeconftest('\n import pytest\n import contextlib\n\n @py...
925,541,292,342,811,300
Check that inserting something into the namespace works in a simple text file doctest
testing/test_doctest.py
test_namespace_doctestfile
NNRepos/pytest
python
@pytest.mark.parametrize('scope', SCOPES) def test_namespace_doctestfile(self, testdir, scope): '\n Check that inserting something into the namespace works in a\n simple text file doctest\n ' testdir.makeconftest('\n import pytest\n import contextlib\n\n @py...
@pytest.mark.parametrize('scope', SCOPES) def test_namespace_pyfile(self, testdir, scope): '\n Check that inserting something into the namespace works in a\n simple Python file docstring doctest\n ' testdir.makeconftest('\n import pytest\n import contextlib\n\n ...
-5,751,900,679,091,508,000
Check that inserting something into the namespace works in a simple Python file docstring doctest
testing/test_doctest.py
test_namespace_pyfile
NNRepos/pytest
python
@pytest.mark.parametrize('scope', SCOPES) def test_namespace_pyfile(self, testdir, scope): '\n Check that inserting something into the namespace works in a\n simple Python file docstring doctest\n ' testdir.makeconftest('\n import pytest\n import contextlib\n\n ...
def callback(update: Update, _: CallbackContext): 'Print the help text for a /start or /help command' update.message.reply_text(helper.create_help_text())
5,267,084,407,609,486,000
Print the help text for a /start or /help command
ongabot/handler/helpcommand.py
callback
walkerjens/telegram.ongabot
python
def callback(update: Update, _: CallbackContext): update.message.reply_text(helper.create_help_text())
def pattern_sixteen(steps): ' Pattern sixteen\n\n 9\n 9 8\n 9 8 7\n 9 8 7 6\n 9 8 7 6 5\n 9 8 7 6 5 4\n 9 8 7 6 5 4 3\n 9 8 7 6 5 4 3 2\n 9 8 7 6 5 4 3 2 1\n ' get_range = [str(i) for i in range(1, (steps + 1))][::(- 1)] for gr in range(1, (l...
7,583,793,884,200,287,000
Pattern sixteen 9 9 8 9 8 7 9 8 7 6 9 8 7 6 5 9 8 7 6 5 4 9 8 7 6 5 4 3 9 8 7 6 5 4 3 2 9 8 7 6 5 4 3 2 1
Project Pattern/pattern_16.py
pattern_sixteen
chandthash/nppy
python
def pattern_sixteen(steps): ' Pattern sixteen\n\n 9\n 9 8\n 9 8 7\n 9 8 7 6\n 9 8 7 6 5\n 9 8 7 6 5 4\n 9 8 7 6 5 4 3\n 9 8 7 6 5 4 3 2\n 9 8 7 6 5 4 3 2 1\n ' get_range = [str(i) for i in range(1, (steps + 1))][::(- 1)] for gr in range(1, (l...
def setup(hass, config): 'Set up the StatsD component.' conf = config[DOMAIN] host = conf.get(CONF_HOST) port = conf.get(CONF_PORT) sample_rate = conf.get(CONF_RATE) prefix = conf.get(CONF_PREFIX) value_mapping = conf.get(CONF_VALUE_MAP) show_attribute_flag = conf.get(CONF_ATTR) stat...
-1,613,744,986,944,263,200
Set up the StatsD component.
homeassistant/components/statsd/__init__.py
setup
0x00-0xFF/home-assistant
python
def setup(hass, config): conf = config[DOMAIN] host = conf.get(CONF_HOST) port = conf.get(CONF_PORT) sample_rate = conf.get(CONF_RATE) prefix = conf.get(CONF_PREFIX) value_mapping = conf.get(CONF_VALUE_MAP) show_attribute_flag = conf.get(CONF_ATTR) statsd_client = statsd.StatsClient...
def statsd_event_listener(event): 'Listen for new messages on the bus and sends them to StatsD.' state = event.data.get('new_state') if (state is None): return try: if (value_mapping and (state.state in value_mapping)): _state = float(value_mapping[state.state]) else:...
-1,950,298,841,944,332,300
Listen for new messages on the bus and sends them to StatsD.
homeassistant/components/statsd/__init__.py
statsd_event_listener
0x00-0xFF/home-assistant
python
def statsd_event_listener(event): state = event.data.get('new_state') if (state is None): return try: if (value_mapping and (state.state in value_mapping)): _state = float(value_mapping[state.state]) else: _state = state_helper.state_as_number(state) ...
def _timestamp(self): 'Returns the local time in milliseconds since the unix epoch' return int((time.time() * 1000))
6,703,314,015,782,014,000
Returns the local time in milliseconds since the unix epoch
ably/rest/auth.py
_timestamp
ably/ably-python
python
def _timestamp(self): return int((time.time() * 1000))
def get_gate_url(self): '\n Override this method to override the gate_url attribute.\n ' gate_url = (self.gate_url or settings.GATE_URL) if (not gate_url): raise ImproperlyConfigured('{0} is missing the gate_url attribute. Define {0}.gate_url, settings.GATE_URL, or override {0}.get_gat...
-6,638,031,244,147,534,000
Override this method to override the gate_url attribute.
gate/mixin.py
get_gate_url
n-serrette/wedding-website
python
def get_gate_url(self): '\n \n ' gate_url = (self.gate_url or settings.GATE_URL) if (not gate_url): raise ImproperlyConfigured('{0} is missing the gate_url attribute. Define {0}.gate_url, settings.GATE_URL, or override {0}.get_gate_url().'.format(self.__class__.__name__)) return st...
def get_permission_denied_message(self): '\n Override this method to override the permission_denied_message attribute.\n ' return self.permission_denied_message
5,832,800,233,362,823,000
Override this method to override the permission_denied_message attribute.
gate/mixin.py
get_permission_denied_message
n-serrette/wedding-website
python
def get_permission_denied_message(self): '\n \n ' return self.permission_denied_message
def get_redirect_field_name(self): '\n Override this method to override the redirect_field_name attribute.\n ' return self.redirect_field_name
3,652,313,246,061,635,600
Override this method to override the redirect_field_name attribute.
gate/mixin.py
get_redirect_field_name
n-serrette/wedding-website
python
def get_redirect_field_name(self): '\n \n ' return self.redirect_field_name
def get_lock_test_func(self): '\n Override this method to use a different test_func method.\n ' return self.lock_test_func
6,096,030,275,831,517,000
Override this method to use a different test_func method.
gate/mixin.py
get_lock_test_func
n-serrette/wedding-website
python
def get_lock_test_func(self): '\n \n ' return self.lock_test_func
def __init__(self, opt): 'Initialize this dataset class.\n\n Parameters:\n opt (Option class) -- stores all the experiment flags; needs to be a subclass of BaseOptions\n ' BaseDataset.__init__(self, opt) self.dir_A = os.path.join(opt.dataroot, (opt.phase + 'A')) self.dir_B = os....
7,680,058,650,721,001,000
Initialize this dataset class. Parameters: opt (Option class) -- stores all the experiment flags; needs to be a subclass of BaseOptions
data/unaligned_dataset.py
__init__
sinhaharsh/pytorch-CycleGAN-and-pix2pix
python
def __init__(self, opt): 'Initialize this dataset class.\n\n Parameters:\n opt (Option class) -- stores all the experiment flags; needs to be a subclass of BaseOptions\n ' BaseDataset.__init__(self, opt) self.dir_A = os.path.join(opt.dataroot, (opt.phase + 'A')) self.dir_B = os....
def __getitem__(self, index): 'Return a data point and its metadata information.\n\n Parameters:\n index (int) -- a random integer for data indexing\n\n Returns a dictionary that contains A, B, A_paths and B_paths\n A (tensor) -- an image in the input domain\n ...
-7,054,115,083,042,761,000
Return a data point and its metadata information. Parameters: index (int) -- a random integer for data indexing Returns a dictionary that contains A, B, A_paths and B_paths A (tensor) -- an image in the input domain B (tensor) -- its corresponding image in the target domain A_paths (s...
data/unaligned_dataset.py
__getitem__
sinhaharsh/pytorch-CycleGAN-and-pix2pix
python
def __getitem__(self, index): 'Return a data point and its metadata information.\n\n Parameters:\n index (int) -- a random integer for data indexing\n\n Returns a dictionary that contains A, B, A_paths and B_paths\n A (tensor) -- an image in the input domain\n ...
def __len__(self): 'Return the total number of images in the dataset.\n\n As we have two datasets with potentially different number of images,\n we take a maximum of\n ' return max(self.A_size, self.B_size)
91,132,351,507,256,300
Return the total number of images in the dataset. As we have two datasets with potentially different number of images, we take a maximum of
data/unaligned_dataset.py
__len__
sinhaharsh/pytorch-CycleGAN-and-pix2pix
python
def __len__(self): 'Return the total number of images in the dataset.\n\n As we have two datasets with potentially different number of images,\n we take a maximum of\n ' return max(self.A_size, self.B_size)
def insert_pt(self, new_pt): 'returns index of new point' i = bisect(self.points, (new_pt[0], None)) self.points.insert(i, new_pt) dispatcher.send('points changed', sender=self) return i
634,380,642,633,548,900
returns index of new point
light9/curvecalc/curve.py
insert_pt
drewp/light9
python
def insert_pt(self, new_pt): i = bisect(self.points, (new_pt[0], None)) self.points.insert(i, new_pt) dispatcher.send('points changed', sender=self) return i
def points_between(self, x1, x2): 'returns (x,y) points' return [self.points[i] for i in self.indices_between(x1, x2)]
169,765,610,131,725,920
returns (x,y) points
light9/curvecalc/curve.py
points_between
drewp/light9
python
def points_between(self, x1, x2): return [self.points[i] for i in self.indices_between(x1, x2)]
def point_before(self, x): '(x,y) of the point left of x, or None' leftidx = self.index_before(x) if (leftidx is None): return None return self.points[leftidx]
-8,937,247,978,327,115,000
(x,y) of the point left of x, or None
light9/curvecalc/curve.py
point_before
drewp/light9
python
def point_before(self, x): leftidx = self.index_before(x) if (leftidx is None): return None return self.points[leftidx]
def newCurve(self, ctx, label): '\n Save type/label for a new :Curve resource.\n Pass the ctx where the main curve data (not the points) will go.\n ' if hasattr(self, 'curve'): raise ValueError(('CurveResource already has a curve %r' % self.curve)) self.graph.patch(Patch(addQuad...
-7,079,151,998,791,664,000
Save type/label for a new :Curve resource. Pass the ctx where the main curve data (not the points) will go.
light9/curvecalc/curve.py
newCurve
drewp/light9
python
def newCurve(self, ctx, label): '\n Save type/label for a new :Curve resource.\n Pass the ctx where the main curve data (not the points) will go.\n ' if hasattr(self, 'curve'): raise ValueError(('CurveResource already has a curve %r' % self.curve)) self.graph.patch(Patch(addQuad...
def watchCurvePointChanges(self): 'start watching and saving changes to the graph' dispatcher.connect(self.onChange, 'points changed', sender=self.curve)
805,307,617,194,940,800
start watching and saving changes to the graph
light9/curvecalc/curve.py
watchCurvePointChanges
drewp/light9
python
def watchCurvePointChanges(self): dispatcher.connect(self.onChange, 'points changed', sender=self.curve)
def loadCurvesForSong(self): "\n current curves will track song's curves.\n \n This fires 'add_curve' dispatcher events to announce the new curves.\n " log.info('loadCurvesForSong') dispatcher.send('clear_curves') self.curveResources.clear() self.markers = Markers(uri=Non...
-2,281,801,921,494,547,500
current curves will track song's curves. This fires 'add_curve' dispatcher events to announce the new curves.
light9/curvecalc/curve.py
loadCurvesForSong
drewp/light9
python
def loadCurvesForSong(self): "\n current curves will track song's curves.\n \n This fires 'add_curve' dispatcher events to announce the new curves.\n " log.info('loadCurvesForSong') dispatcher.send('clear_curves') self.curveResources.clear() self.markers = Markers(uri=Non...
def save(self): 'writes a file for each curve with a name\n like basename-curvename, or saves them to the rdf graph' basename = os.path.join(showconfig.curvesDir(), showconfig.songFilenameFromURI(self.currentSong)) patches = [] for cr in list(self.curveResources.values()): patches.extend(...
2,741,524,990,762,291,000
writes a file for each curve with a name like basename-curvename, or saves them to the rdf graph
light9/curvecalc/curve.py
save
drewp/light9
python
def save(self): 'writes a file for each curve with a name\n like basename-curvename, or saves them to the rdf graph' basename = os.path.join(showconfig.curvesDir(), showconfig.songFilenameFromURI(self.currentSong)) patches = [] for cr in list(self.curveResources.values()): patches.extend(...
def __init__(__self__, *, key: pulumi.Input[str], resource_arn: pulumi.Input[str], value: pulumi.Input[str]): '\n The set of arguments for constructing a Tag resource.\n :param pulumi.Input[str] key: Tag name.\n :param pulumi.Input[str] resource_arn: Amazon Resource Name (ARN) of the ECS resour...
3,258,824,647,970,220,000
The set of arguments for constructing a Tag resource. :param pulumi.Input[str] key: Tag name. :param pulumi.Input[str] resource_arn: Amazon Resource Name (ARN) of the ECS resource to tag. :param pulumi.Input[str] value: Tag value.
sdk/python/pulumi_aws/ecs/tag.py
__init__
pulumi/pulumi-aws
python
def __init__(__self__, *, key: pulumi.Input[str], resource_arn: pulumi.Input[str], value: pulumi.Input[str]): '\n The set of arguments for constructing a Tag resource.\n :param pulumi.Input[str] key: Tag name.\n :param pulumi.Input[str] resource_arn: Amazon Resource Name (ARN) of the ECS resour...
@property @pulumi.getter def key(self) -> pulumi.Input[str]: '\n Tag name.\n ' return pulumi.get(self, 'key')
-8,963,650,479,449,913,000
Tag name.
sdk/python/pulumi_aws/ecs/tag.py
key
pulumi/pulumi-aws
python
@property @pulumi.getter def key(self) -> pulumi.Input[str]: '\n \n ' return pulumi.get(self, 'key')
@property @pulumi.getter(name='resourceArn') def resource_arn(self) -> pulumi.Input[str]: '\n Amazon Resource Name (ARN) of the ECS resource to tag.\n ' return pulumi.get(self, 'resource_arn')
-537,349,869,984,642,240
Amazon Resource Name (ARN) of the ECS resource to tag.
sdk/python/pulumi_aws/ecs/tag.py
resource_arn
pulumi/pulumi-aws
python
@property @pulumi.getter(name='resourceArn') def resource_arn(self) -> pulumi.Input[str]: '\n \n ' return pulumi.get(self, 'resource_arn')
@property @pulumi.getter def value(self) -> pulumi.Input[str]: '\n Tag value.\n ' return pulumi.get(self, 'value')
-8,049,809,238,565,177,000
Tag value.
sdk/python/pulumi_aws/ecs/tag.py
value
pulumi/pulumi-aws
python
@property @pulumi.getter def value(self) -> pulumi.Input[str]: '\n \n ' return pulumi.get(self, 'value')
def __init__(__self__, *, key: Optional[pulumi.Input[str]]=None, resource_arn: Optional[pulumi.Input[str]]=None, value: Optional[pulumi.Input[str]]=None): '\n Input properties used for looking up and filtering Tag resources.\n :param pulumi.Input[str] key: Tag name.\n :param pulumi.Input[str] r...
-4,799,673,854,584,692,000
Input properties used for looking up and filtering Tag resources. :param pulumi.Input[str] key: Tag name. :param pulumi.Input[str] resource_arn: Amazon Resource Name (ARN) of the ECS resource to tag. :param pulumi.Input[str] value: Tag value.
sdk/python/pulumi_aws/ecs/tag.py
__init__
pulumi/pulumi-aws
python
def __init__(__self__, *, key: Optional[pulumi.Input[str]]=None, resource_arn: Optional[pulumi.Input[str]]=None, value: Optional[pulumi.Input[str]]=None): '\n Input properties used for looking up and filtering Tag resources.\n :param pulumi.Input[str] key: Tag name.\n :param pulumi.Input[str] r...
@property @pulumi.getter def key(self) -> Optional[pulumi.Input[str]]: '\n Tag name.\n ' return pulumi.get(self, 'key')
6,652,848,325,136,089,000
Tag name.
sdk/python/pulumi_aws/ecs/tag.py
key
pulumi/pulumi-aws
python
@property @pulumi.getter def key(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'key')
@property @pulumi.getter(name='resourceArn') def resource_arn(self) -> Optional[pulumi.Input[str]]: '\n Amazon Resource Name (ARN) of the ECS resource to tag.\n ' return pulumi.get(self, 'resource_arn')
-4,876,156,079,371,697,000
Amazon Resource Name (ARN) of the ECS resource to tag.
sdk/python/pulumi_aws/ecs/tag.py
resource_arn
pulumi/pulumi-aws
python
@property @pulumi.getter(name='resourceArn') def resource_arn(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'resource_arn')
@property @pulumi.getter def value(self) -> Optional[pulumi.Input[str]]: '\n Tag value.\n ' return pulumi.get(self, 'value')
-1,863,364,334,913,555,700
Tag value.
sdk/python/pulumi_aws/ecs/tag.py
value
pulumi/pulumi-aws
python
@property @pulumi.getter def value(self) -> Optional[pulumi.Input[str]]: '\n \n ' return pulumi.get(self, 'value')
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, key: Optional[pulumi.Input[str]]=None, resource_arn: Optional[pulumi.Input[str]]=None, value: Optional[pulumi.Input[str]]=None, __props__=None): '\n ## Import\n\n `aws_ecs_tag` can be imported by using th...
-4,185,412,963,249,030,700
## Import `aws_ecs_tag` can be imported by using the ECS resource identifier and key, separated by a comma (`,`), e.g. ```sh $ pulumi import aws:ecs/tag:Tag example arn:aws:ecs:us-east-1:123456789012:cluster/example,Name ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Opt...
sdk/python/pulumi_aws/ecs/tag.py
__init__
pulumi/pulumi-aws
python
@overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, key: Optional[pulumi.Input[str]]=None, resource_arn: Optional[pulumi.Input[str]]=None, value: Optional[pulumi.Input[str]]=None, __props__=None): '\n ## Import\n\n `aws_ecs_tag` can be imported by using th...
@overload def __init__(__self__, resource_name: str, args: TagArgs, opts: Optional[pulumi.ResourceOptions]=None): "\n ## Import\n\n `aws_ecs_tag` can be imported by using the ECS resource identifier and key, separated by a comma (`,`), e.g.\n\n ```sh\n $ pulumi import aws:ecs/tag:Tag ex...
6,637,949,711,491,176,000
## Import `aws_ecs_tag` can be imported by using the ECS resource identifier and key, separated by a comma (`,`), e.g. ```sh $ pulumi import aws:ecs/tag:Tag example arn:aws:ecs:us-east-1:123456789012:cluster/example,Name ``` :param str resource_name: The name of the resource. :param TagArgs args: The arguments to u...
sdk/python/pulumi_aws/ecs/tag.py
__init__
pulumi/pulumi-aws
python
@overload def __init__(__self__, resource_name: str, args: TagArgs, opts: Optional[pulumi.ResourceOptions]=None): "\n ## Import\n\n `aws_ecs_tag` can be imported by using the ECS resource identifier and key, separated by a comma (`,`), e.g.\n\n ```sh\n $ pulumi import aws:ecs/tag:Tag ex...
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, key: Optional[pulumi.Input[str]]=None, resource_arn: Optional[pulumi.Input[str]]=None, value: Optional[pulumi.Input[str]]=None) -> 'Tag': "\n Get an existing Tag resource's state with the given name,...
-5,005,814,816,939,013,000
Get an existing Tag resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the...
sdk/python/pulumi_aws/ecs/tag.py
get
pulumi/pulumi-aws
python
@staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None, key: Optional[pulumi.Input[str]]=None, resource_arn: Optional[pulumi.Input[str]]=None, value: Optional[pulumi.Input[str]]=None) -> 'Tag': "\n Get an existing Tag resource's state with the given name,...
@property @pulumi.getter def key(self) -> pulumi.Output[str]: '\n Tag name.\n ' return pulumi.get(self, 'key')
-3,099,507,193,933,223,400
Tag name.
sdk/python/pulumi_aws/ecs/tag.py
key
pulumi/pulumi-aws
python
@property @pulumi.getter def key(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'key')
@property @pulumi.getter(name='resourceArn') def resource_arn(self) -> pulumi.Output[str]: '\n Amazon Resource Name (ARN) of the ECS resource to tag.\n ' return pulumi.get(self, 'resource_arn')
7,090,505,760,660,997,000
Amazon Resource Name (ARN) of the ECS resource to tag.
sdk/python/pulumi_aws/ecs/tag.py
resource_arn
pulumi/pulumi-aws
python
@property @pulumi.getter(name='resourceArn') def resource_arn(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'resource_arn')
@property @pulumi.getter def value(self) -> pulumi.Output[str]: '\n Tag value.\n ' return pulumi.get(self, 'value')
4,303,320,646,784,983,000
Tag value.
sdk/python/pulumi_aws/ecs/tag.py
value
pulumi/pulumi-aws
python
@property @pulumi.getter def value(self) -> pulumi.Output[str]: '\n \n ' return pulumi.get(self, 'value')
def GetExperimentArgs(): "Returns a list of arguments with all tested field trials.\n\n This function is a simple wrapper around the variation team's fieldtrail_util\n script that generates command line arguments to test Chromium field trials.\n\n Returns:\n an array of command line arguments to pass to chrom...
-8,818,158,228,978,697,000
Returns a list of arguments with all tested field trials. This function is a simple wrapper around the variation team's fieldtrail_util script that generates command line arguments to test Chromium field trials. Returns: an array of command line arguments to pass to chrome
tools/chrome_proxy/webdriver/variations_combinations.py
GetExperimentArgs
jnpatel2811/chromium
python
def GetExperimentArgs(): "Returns a list of arguments with all tested field trials.\n\n This function is a simple wrapper around the variation team's fieldtrail_util\n script that generates command line arguments to test Chromium field trials.\n\n Returns:\n an array of command line arguments to pass to chrom...
def GenerateTestSuites(): 'A generator function that yields non-blacklisted tests to run.\n\n This function yields test suites each with a single test case whose id is not\n blacklisted in the array at the top of this file.\n\n Yields:\n non-blacklisted test suites to run\n ' loader = unittest.TestLoader...
2,000,100,436,453,714,700
A generator function that yields non-blacklisted tests to run. This function yields test suites each with a single test case whose id is not blacklisted in the array at the top of this file. Yields: non-blacklisted test suites to run
tools/chrome_proxy/webdriver/variations_combinations.py
GenerateTestSuites
jnpatel2811/chromium
python
def GenerateTestSuites(): 'A generator function that yields non-blacklisted tests to run.\n\n This function yields test suites each with a single test case whose id is not\n blacklisted in the array at the top of this file.\n\n Yields:\n non-blacklisted test suites to run\n ' loader = unittest.TestLoader...
def ParseFlagsWithExtraBrowserArgs(extra_args): 'Generates a function to override common.ParseFlags.\n\n The returned function will honor everything in the original ParseFlags(), but\n adds on additional browser_args.\n\n Args:\n extra_args: The extra browser agruments to add.\n Returns:\n A function to o...
-5,581,824,193,676,476,000
Generates a function to override common.ParseFlags. The returned function will honor everything in the original ParseFlags(), but adds on additional browser_args. Args: extra_args: The extra browser agruments to add. Returns: A function to override common.ParseFlags with additional browser_args.
tools/chrome_proxy/webdriver/variations_combinations.py
ParseFlagsWithExtraBrowserArgs
jnpatel2811/chromium
python
def ParseFlagsWithExtraBrowserArgs(extra_args): 'Generates a function to override common.ParseFlags.\n\n The returned function will honor everything in the original ParseFlags(), but\n adds on additional browser_args.\n\n Args:\n extra_args: The extra browser agruments to add.\n Returns:\n A function to o...
def main(): "Runs all non-blacklisted tests against Chromium field trials.\n\n This script run all chrome proxy integration tests that haven't been\n blacklisted against the field trial testing configuration used by Chromium\n perf bots.\n " flags = common.ParseFlags() experiment_args = ' '.join(GetExpe...
-8,306,183,805,846,712,000
Runs all non-blacklisted tests against Chromium field trials. This script run all chrome proxy integration tests that haven't been blacklisted against the field trial testing configuration used by Chromium perf bots.
tools/chrome_proxy/webdriver/variations_combinations.py
main
jnpatel2811/chromium
python
def main(): "Runs all non-blacklisted tests against Chromium field trials.\n\n This script run all chrome proxy integration tests that haven't been\n blacklisted against the field trial testing configuration used by Chromium\n perf bots.\n " flags = common.ParseFlags() experiment_args = ' '.join(GetExpe...
def plot_gate_map(backend, figsize=None, plot_directed=False, label_qubits=True, qubit_size=24, line_width=4, font_size=12, qubit_color=None, qubit_labels=None, line_color=None, font_color='w', ax=None): "Plots the gate map of a device.\n\n Args:\n backend (BaseBackend): A backend instance,\n figsi...
8,764,939,721,214,748,000
Plots the gate map of a device. Args: backend (BaseBackend): A backend instance, figsize (tuple): Output figure size (wxh) in inches. plot_directed (bool): Plot directed coupling map. label_qubits (bool): Label the qubits. qubit_size (float): Size of qubit marker. line_width (float): Width of l...
qiskit/visualization/gate_map.py
plot_gate_map
AzizNgoueya/qiskit-terra
python
def plot_gate_map(backend, figsize=None, plot_directed=False, label_qubits=True, qubit_size=24, line_width=4, font_size=12, qubit_color=None, qubit_labels=None, line_color=None, font_color='w', ax=None): "Plots the gate map of a device.\n\n Args:\n backend (BaseBackend): A backend instance,\n figsi...
def plot_circuit_layout(circuit, backend, view='virtual'): "Plot the layout of a circuit transpiled for a given\n target backend.\n\n Args:\n circuit (QuantumCircuit): Input quantum circuit.\n backend (BaseBackend): Target backend.\n view (str): Layout view: either 'virtual' or 'physical'...
932,574,443,311,263,400
Plot the layout of a circuit transpiled for a given target backend. Args: circuit (QuantumCircuit): Input quantum circuit. backend (BaseBackend): Target backend. view (str): Layout view: either 'virtual' or 'physical'. Returns: Figure: A matplotlib figure showing layout. Raises: QiskitError: Inva...
qiskit/visualization/gate_map.py
plot_circuit_layout
AzizNgoueya/qiskit-terra
python
def plot_circuit_layout(circuit, backend, view='virtual'): "Plot the layout of a circuit transpiled for a given\n target backend.\n\n Args:\n circuit (QuantumCircuit): Input quantum circuit.\n backend (BaseBackend): Target backend.\n view (str): Layout view: either 'virtual' or 'physical'...
def plot_error_map(backend, figsize=(12, 9), show_title=True): "Plots the error map of a given backend.\n\n Args:\n backend (IBMQBackend): Given backend.\n figsize (tuple): Figure size in inches.\n show_title (bool): Show the title or not.\n\n Returns:\n Figure: A matplotlib figure...
-1,502,234,631,552,956,700
Plots the error map of a given backend. Args: backend (IBMQBackend): Given backend. figsize (tuple): Figure size in inches. show_title (bool): Show the title or not. Returns: Figure: A matplotlib figure showing error map. Raises: VisualizationError: Input is not IBMQ backend. ImportError: If ...
qiskit/visualization/gate_map.py
plot_error_map
AzizNgoueya/qiskit-terra
python
def plot_error_map(backend, figsize=(12, 9), show_title=True): "Plots the error map of a given backend.\n\n Args:\n backend (IBMQBackend): Given backend.\n figsize (tuple): Figure size in inches.\n show_title (bool): Show the title or not.\n\n Returns:\n Figure: A matplotlib figure...
@property def dist_real(self): 'Compute distance.\n ' (x0, y0) = self.ax.transAxes.transform((0, 0)) (x1, y1) = self.ax.transAxes.transform((1, 1)) value = ((x1 - x0) if self.x else (y1 - y0)) return value
-7,645,432,826,772,829,000
Compute distance.
qiskit/visualization/gate_map.py
dist_real
AzizNgoueya/qiskit-terra
python
@property def dist_real(self): '\n ' (x0, y0) = self.ax.transAxes.transform((0, 0)) (x1, y1) = self.ax.transAxes.transform((1, 1)) value = ((x1 - x0) if self.x else (y1 - y0)) return value
@property def dist_abs(self): 'Distance abs\n ' bounds = (self.ax.get_xlim() if self.x else self.ax.get_ylim()) return (bounds[0] - bounds[1])
5,587,799,260,997,822,000
Distance abs
qiskit/visualization/gate_map.py
dist_abs
AzizNgoueya/qiskit-terra
python
@property def dist_abs(self): '\n ' bounds = (self.ax.get_xlim() if self.x else self.ax.get_ylim()) return (bounds[0] - bounds[1])
@property def value(self): 'Return value.\n ' return ((self.size / self.dist_real) * self.dist_abs)
-2,474,716,988,918,986,000
Return value.
qiskit/visualization/gate_map.py
value
AzizNgoueya/qiskit-terra
python
@property def value(self): '\n ' return ((self.size / self.dist_real) * self.dist_abs)
def test_paginate(self): 'Places Pager object in context with size/num from request.' from moztrap.model.tags.models import Tag tpl = template.Template('{% load pagination %}{% paginate queryset as pager %}{% for obj in pager.objects %}{{ obj }} {% endfor %}') request = Mock() request.GET = {'pagesi...
2,482,848,873,757,526,000
Places Pager object in context with size/num from request.
tests/view/lists/templatetags/test_pagination.py
test_paginate
UCL/moztrap
python
def test_paginate(self): from moztrap.model.tags.models import Tag tpl = template.Template('{% load pagination %}{% paginate queryset as pager %}{% for obj in pager.objects %}{{ obj }} {% endfor %}') request = Mock() request.GET = {'pagesize': 3, 'pagenumber': 2} for i in range(1, 7): s...
def test_pagenumber_url(self): '``pagenumber_url`` filter updates pagenumber in URL.' from moztrap.view.lists.templatetags.pagination import pagenumber_url request = Mock() request.get_full_path.return_value = 'http://localhost/?pagenumber=2&pagesize=10' self.assertEqual(pagenumber_url(request, 1), ...
7,664,268,065,005,800,000
``pagenumber_url`` filter updates pagenumber in URL.
tests/view/lists/templatetags/test_pagination.py
test_pagenumber_url
UCL/moztrap
python
def test_pagenumber_url(self): from moztrap.view.lists.templatetags.pagination import pagenumber_url request = Mock() request.get_full_path.return_value = 'http://localhost/?pagenumber=2&pagesize=10' self.assertEqual(pagenumber_url(request, 1), 'http://localhost/?pagenumber=1&pagesize=10')
def test_pagesize_url(self): '``pagesize_url`` updates pagesize in URL (and jumps to page 1).' from moztrap.view.lists.templatetags.pagination import pagesize_url request = Mock() request.get_full_path.return_value = 'http://localhost/?pagenumber=2&pagesize=10' self.assertEqual(pagesize_url(request,...
-470,807,238,691,450,940
``pagesize_url`` updates pagesize in URL (and jumps to page 1).
tests/view/lists/templatetags/test_pagination.py
test_pagesize_url
UCL/moztrap
python
def test_pagesize_url(self): from moztrap.view.lists.templatetags.pagination import pagesize_url request = Mock() request.get_full_path.return_value = 'http://localhost/?pagenumber=2&pagesize=10' self.assertEqual(pagesize_url(request, 20), 'http://localhost/?pagenumber=1&pagesize=20')
def test_pagenumber(self): '``pagenumber`` gets the pagenumber from the request.' from moztrap.view.lists.templatetags.pagination import pagenumber request = Mock() request.GET = {'pagenumber': 2, 'pagesize': 10} self.assertEqual(pagenumber(request), 2)
4,844,378,220,135,801,000
``pagenumber`` gets the pagenumber from the request.
tests/view/lists/templatetags/test_pagination.py
test_pagenumber
UCL/moztrap
python
def test_pagenumber(self): from moztrap.view.lists.templatetags.pagination import pagenumber request = Mock() request.GET = {'pagenumber': 2, 'pagesize': 10} self.assertEqual(pagenumber(request), 2)
def test_pagesize(self): '``pagenumber`` gets the pagenumber from the request.' from moztrap.view.lists.templatetags.pagination import pagesize request = Mock() request.GET = {'pagenumber': 2, 'pagesize': 10} self.assertEqual(pagesize(request), 10)
201,397,973,904,035,840
``pagenumber`` gets the pagenumber from the request.
tests/view/lists/templatetags/test_pagination.py
test_pagesize
UCL/moztrap
python
def test_pagesize(self): from moztrap.view.lists.templatetags.pagination import pagesize request = Mock() request.GET = {'pagenumber': 2, 'pagesize': 10} self.assertEqual(pagesize(request), 10)
def as_mpl_artists(shape_list, properties_func=None, text_offset=5.0, origin=1): "\n Converts a region list to a list of patches and a list of artists.\n\n\n Optional Keywords:\n [ text_offset ] - If there is text associated with the regions, add\n some vertical offset (in pixels) to the text so that it...
-6,207,374,083,399,434,000
Converts a region list to a list of patches and a list of artists. Optional Keywords: [ text_offset ] - If there is text associated with the regions, add some vertical offset (in pixels) to the text so that it doesn't overlap with the regions. Often, the regions files implicitly assume the lower-left corner of the i...
pyregion/mpl_helper.py
as_mpl_artists
keflavich/pyregion
python
def as_mpl_artists(shape_list, properties_func=None, text_offset=5.0, origin=1): "\n Converts a region list to a list of patches and a list of artists.\n\n\n Optional Keywords:\n [ text_offset ] - If there is text associated with the regions, add\n some vertical offset (in pixels) to the text so that it...
def __init__(self, i_prev, i_next, feeGrowthOutside): '\n :type i_prev: int\n :type i_next: int\n ' self.i_prev = i_prev self.i_next = i_next self.Delta_L = 0 self.feeGrowthOutside = feeGrowthOutside self.n_positions = 0
318,246,960,711,850,600
:type i_prev: int :type i_next: int
python/scfmm/__init__.py
__init__
serokell/segmented-cfmm
python
def __init__(self, i_prev, i_next, feeGrowthOutside): '\n :type i_prev: int\n :type i_next: int\n ' self.i_prev = i_prev self.i_next = i_next self.Delta_L = 0 self.feeGrowthOutside = feeGrowthOutside self.n_positions = 0
@staticmethod def tick(srp): '\n Computes the closest tick index below a certain price, given its square root\n :param srp: square root of a price\n :return: the closest tick below a certain price\n ' if (srp == infinity): return infinity else: return math.floor((...
-7,826,974,968,341,321,000
Computes the closest tick index below a certain price, given its square root :param srp: square root of a price :return: the closest tick below a certain price
python/scfmm/__init__.py
tick
serokell/segmented-cfmm
python
@staticmethod def tick(srp): '\n Computes the closest tick index below a certain price, given its square root\n :param srp: square root of a price\n :return: the closest tick below a certain price\n ' if (srp == infinity): return infinity else: return math.floor((...
@staticmethod def srp(tick): '\n Computes the square root of the price corresponding to a given tick\n :param tick: the index of a tick\n :return: the corresponding square root price\n ' if (tick == infinity): return infinity return math.pow(math.sqrt(1.0001), tick)
2,717,632,398,661,134,000
Computes the square root of the price corresponding to a given tick :param tick: the index of a tick :return: the corresponding square root price
python/scfmm/__init__.py
srp
serokell/segmented-cfmm
python
@staticmethod def srp(tick): '\n Computes the square root of the price corresponding to a given tick\n :param tick: the index of a tick\n :return: the corresponding square root price\n ' if (tick == infinity): return infinity return math.pow(math.sqrt(1.0001), tick)
def initialize_tick(self, i, i_l): '\n Initialize a new tick at index i, provide the index of an initialized tick lower\n than i to find it easily in the linked list. Assumes that i is *not* already initialized.\n :param i:\n :param i_l:\n ' assert (i not in self.ticks) as...
-489,302,767,904,517,700
Initialize a new tick at index i, provide the index of an initialized tick lower than i to find it easily in the linked list. Assumes that i is *not* already initialized. :param i: :param i_l:
python/scfmm/__init__.py
initialize_tick
serokell/segmented-cfmm
python
def initialize_tick(self, i, i_l): '\n Initialize a new tick at index i, provide the index of an initialized tick lower\n than i to find it easily in the linked list. Assumes that i is *not* already initialized.\n :param i:\n :param i_l:\n ' assert (i not in self.ticks) as...
def __getattribute__(self, attr): "Prevent 'private' attribute access" if (attr in ('make_rdm1s', 'spin_square', 'contract_2e', 'absorb_h1e')): raise AttributeError else: return object.__getattribute__(self, attr)
-7,457,239,160,112,903,000
Prevent 'private' attribute access
pyscf/mcscf/test/test_addons.py
__getattribute__
JFurness1/pyscf
python
def __getattribute__(self, attr): if (attr in ('make_rdm1s', 'spin_square', 'contract_2e', 'absorb_h1e')): raise AttributeError else: return object.__getattribute__(self, attr)
def __getattribute__(self, attr): "Prevent 'private' attribute access" if (attr in ('make_rdm1s', 'spin_square', 'contract_2e', 'absorb_h1e')): raise AttributeError else: return object.__getattribute__(self, attr)
-7,457,239,160,112,903,000
Prevent 'private' attribute access
pyscf/mcscf/test/test_addons.py
__getattribute__
JFurness1/pyscf
python
def __getattribute__(self, attr): if (attr in ('make_rdm1s', 'spin_square', 'contract_2e', 'absorb_h1e')): raise AttributeError else: return object.__getattribute__(self, attr)
def get_first_UTC(): '\n Returns the first UTC recorded by Molonglo after the disk crash in October 2017\n ' return '2017-10-31-08:49:32'
-5,102,652,466,926,968,000
Returns the first UTC recorded by Molonglo after the disk crash in October 2017
helpers.py
get_first_UTC
vg2691994/mock_frb_injection_results
python
def get_first_UTC(): '\n \n ' return '2017-10-31-08:49:32'
def schema_exists(self): '\n \n Checks the estimated number of tuples in the subjects table to determine if data exists\n \n :return: \n ' with self.connection.cursor() as cursor: cursor.execute('select reltuples FROM pg_class where relname = %s', ('subjects',)) ...
-7,340,034,216,028,805,000
Checks the estimated number of tuples in the subjects table to determine if data exists :return:
database_query_handler.py
schema_exists
jdwinkler/dbpedia_service
python
def schema_exists(self): '\n \n Checks the estimated number of tuples in the subjects table to determine if data exists\n \n :return: \n ' with self.connection.cursor() as cursor: cursor.execute('select reltuples FROM pg_class where relname = %s', ('subjects',)) ...
def build_table_schema(self, schema_name, schema_file_path): '\n \n Loads the dbpedia schema used for supporting downstream analysis. If the schema already exists, it is\n dropped (deleted) and recreated.\n \n :param schema_name: \n :param schema_file_path: \n :retur...
172,376,289,086,650,050
Loads the dbpedia schema used for supporting downstream analysis. If the schema already exists, it is dropped (deleted) and recreated. :param schema_name: :param schema_file_path: :return:
database_query_handler.py
build_table_schema
jdwinkler/dbpedia_service
python
def build_table_schema(self, schema_name, schema_file_path): '\n \n Loads the dbpedia schema used for supporting downstream analysis. If the schema already exists, it is\n dropped (deleted) and recreated.\n \n :param schema_name: \n :param schema_file_path: \n :retur...
def build_indices(self): '\n \n Builds the following indices:\n \n Index on name for subjects\n Index on predicate for predicate_object\n Index on subject_id for predicate object\n \n :return: \n ' with self.connection.cursor() as cursor: cu...
138,920,001,608,513,780
Builds the following indices: Index on name for subjects Index on predicate for predicate_object Index on subject_id for predicate object :return:
database_query_handler.py
build_indices
jdwinkler/dbpedia_service
python
def build_indices(self): '\n \n Builds the following indices:\n \n Index on name for subjects\n Index on predicate for predicate_object\n Index on subject_id for predicate object\n \n :return: \n ' with self.connection.cursor() as cursor: cu...
def insert_spo_tuple(self, spo_tuple): '\n \n Handles the insertion of spo tuples into the db. Workflow:\n \n Attempt to find the subject table entry corresponding to your subject. If found, use that ID for\n inserting your po values. Otherwise, insert your subject into the subjec...
-8,441,923,402,302,579,000
Handles the insertion of spo tuples into the db. Workflow: Attempt to find the subject table entry corresponding to your subject. If found, use that ID for inserting your po values. Otherwise, insert your subject into the subject table and use that ID instead. The resulting id, predicate, object tuple is then inserted...
database_query_handler.py
insert_spo_tuple
jdwinkler/dbpedia_service
python
def insert_spo_tuple(self, spo_tuple): '\n \n Handles the insertion of spo tuples into the db. Workflow:\n \n Attempt to find the subject table entry corresponding to your subject. If found, use that ID for\n inserting your po values. Otherwise, insert your subject into the subjec...
def get_person_metadata(self, person_name, use_exact_match=False): '\n \n Returns all metadata associated with the provided person_name. However, does not actually check\n to see if the identifier corresponds to a person or not; the class of the identifier will\n be included in the retur...
-1,959,901,038,615,787,000
Returns all metadata associated with the provided person_name. However, does not actually check to see if the identifier corresponds to a person or not; the class of the identifier will be included in the returned metadata though. DBPedia People only contains people predicate types as well. Use_exact_match toggles bet...
database_query_handler.py
get_person_metadata
jdwinkler/dbpedia_service
python
def get_person_metadata(self, person_name, use_exact_match=False): '\n \n Returns all metadata associated with the provided person_name. However, does not actually check\n to see if the identifier corresponds to a person or not; the class of the identifier will\n be included in the retur...
def get_tuples_by_predicate(self, predicate_of_interest): '\n \n Extracts SPO tuples based on the predicate value passed to the function. This query will be slow since\n you are querying such a large fraction of the po table at once (unless your predicate does not exist).\n \n Pre...
-4,161,906,530,598,888,400
Extracts SPO tuples based on the predicate value passed to the function. This query will be slow since you are querying such a large fraction of the po table at once (unless your predicate does not exist). Predicates: Name Type Gender Description Birthdate GivenName Surname BirthPlace DeathDate DeathPlace :param pre...
database_query_handler.py
get_tuples_by_predicate
jdwinkler/dbpedia_service
python
def get_tuples_by_predicate(self, predicate_of_interest): '\n \n Extracts SPO tuples based on the predicate value passed to the function. This query will be slow since\n you are querying such a large fraction of the po table at once (unless your predicate does not exist).\n \n Pre...
def registry(): 'Map reserved names and scopes to their conversion functions.' reg = {'Placeholder': _placeholder, 'Const': _constant, 'Conv2D': _conv2d, 'Relu': _relu, 'Sigmoid': _sigmoid, 'MatMul': _matmul, 'Shape': _shape, 'StridedSlice': _strided_slice, 'Add': _add, 'Sub': _sub, 'Transpose': _transpose, 'Re...
9,216,679,404,523,882,000
Map reserved names and scopes to their conversion functions.
tf_encrypted/convert/register.py
registry
capeprivacy/tf-encrypted
python
def registry(): reg = {'Placeholder': _placeholder, 'Const': _constant, 'Conv2D': _conv2d, 'Relu': _relu, 'Sigmoid': _sigmoid, 'MatMul': _matmul, 'Shape': _shape, 'StridedSlice': _strided_slice, 'Add': _add, 'Sub': _sub, 'Transpose': _transpose, 'Reshape': _reshape, 'Pack': _pack, 'Rsqrt': _rsqrt, 'Mul': _mul,...
def _nodef_to_public_pond(converter, x): 'Map a NodeDef x to a PublicPondTensor.' dtype = x.attr['dtype'].type x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim] if (not x_shape): if (dtype == tf.float32): nums = x.attr['value'].tensor.float_val elif (dtype =...
-8,910,634,418,428,920,000
Map a NodeDef x to a PublicPondTensor.
tf_encrypted/convert/register.py
_nodef_to_public_pond
capeprivacy/tf-encrypted
python
def _nodef_to_public_pond(converter, x): dtype = x.attr['dtype'].type x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim] if (not x_shape): if (dtype == tf.float32): nums = x.attr['value'].tensor.float_val elif (dtype == tf.float64): nums = x.attr...
def _nodef_to_private_pond(converter, x): 'Map a NodeDef x to a PrivatePondTensor.' dtype = x.attr['dtype'].type warn_msg = 'Unexpected dtype {} found at node {}' err_msg = 'Unsupported dtype {} found at node {}' x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim] if (not x_shape...
447,014,265,472,516,900
Map a NodeDef x to a PrivatePondTensor.
tf_encrypted/convert/register.py
_nodef_to_private_pond
capeprivacy/tf-encrypted
python
def _nodef_to_private_pond(converter, x): dtype = x.attr['dtype'].type warn_msg = 'Unexpected dtype {} found at node {}' err_msg = 'Unsupported dtype {} found at node {}' x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim] if (not x_shape): if (dtype == tf.float32): ...
def _nodef_to_numpy_array(x): 'Map a NodeDef x to a np.array.' dtype = x.attr['dtype'].type x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim] if (dtype == tf.float32): nums = array.array('f', x.attr['value'].tensor.tensor_content) elif (dtype == tf.float64): nums = ...
8,830,999,278,678,323,000
Map a NodeDef x to a np.array.
tf_encrypted/convert/register.py
_nodef_to_numpy_array
capeprivacy/tf-encrypted
python
def _nodef_to_numpy_array(x): dtype = x.attr['dtype'].type x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim] if (dtype == tf.float32): nums = array.array('f', x.attr['value'].tensor.tensor_content) elif (dtype == tf.float64): nums = array.array('d', x.attr['value']...
def create_debug_adaptor(self): 'Create the Visual Studio Code debug adaptor' self.assertTrue(os.path.exists(self.lldbVSCodeExec), 'lldb-vscode must exist') log_file_path = self.getBuildArtifact('vscode.txt') self.vscode = vscode.DebugAdaptor(executable=self.lldbVSCodeExec, init_commands=self.setUpComma...
-3,664,724,858,036,987,400
Create the Visual Studio Code debug adaptor
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
create_debug_adaptor
Diatrus/llvm-project
python
def create_debug_adaptor(self): self.assertTrue(os.path.exists(self.lldbVSCodeExec), 'lldb-vscode must exist') log_file_path = self.getBuildArtifact('vscode.txt') self.vscode = vscode.DebugAdaptor(executable=self.lldbVSCodeExec, init_commands=self.setUpCommands(), log_file=log_file_path)
def set_source_breakpoints(self, source_path, lines, condition=None, hitCondition=None): 'Sets source breakpoints and returns an array of strings containing\n the breakpoint IDs ("1", "2") for each breakpoint that was set.\n ' response = self.vscode.request_setBreakpoints(source_path, lines, co...
-5,090,111,554,572,923,000
Sets source breakpoints and returns an array of strings containing the breakpoint IDs ("1", "2") for each breakpoint that was set.
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
set_source_breakpoints
Diatrus/llvm-project
python
def set_source_breakpoints(self, source_path, lines, condition=None, hitCondition=None): 'Sets source breakpoints and returns an array of strings containing\n the breakpoint IDs ("1", "2") for each breakpoint that was set.\n ' response = self.vscode.request_setBreakpoints(source_path, lines, co...
def set_function_breakpoints(self, functions, condition=None, hitCondition=None): 'Sets breakpoints by function name given an array of function names\n and returns an array of strings containing the breakpoint IDs\n ("1", "2") for each breakpoint that was set.\n ' response = self.vsco...
-6,898,889,011,605,928,000
Sets breakpoints by function name given an array of function names and returns an array of strings containing the breakpoint IDs ("1", "2") for each breakpoint that was set.
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
set_function_breakpoints
Diatrus/llvm-project
python
def set_function_breakpoints(self, functions, condition=None, hitCondition=None): 'Sets breakpoints by function name given an array of function names\n and returns an array of strings containing the breakpoint IDs\n ("1", "2") for each breakpoint that was set.\n ' response = self.vsco...
def verify_breakpoint_hit(self, breakpoint_ids): 'Wait for the process we are debugging to stop, and verify we hit\n any breakpoint location in the "breakpoint_ids" array.\n "breakpoint_ids" should be a list of breakpoint ID strings\n (["1", "2"]). The return value from self.set_source...
-6,815,606,521,215,621,000
Wait for the process we are debugging to stop, and verify we hit any breakpoint location in the "breakpoint_ids" array. "breakpoint_ids" should be a list of breakpoint ID strings (["1", "2"]). The return value from self.set_source_breakpoints() or self.set_function_breakpoints() can be passed to this function
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
verify_breakpoint_hit
Diatrus/llvm-project
python
def verify_breakpoint_hit(self, breakpoint_ids): 'Wait for the process we are debugging to stop, and verify we hit\n any breakpoint location in the "breakpoint_ids" array.\n "breakpoint_ids" should be a list of breakpoint ID strings\n (["1", "2"]). The return value from self.set_source...
def verify_exception_breakpoint_hit(self, filter_label): "Wait for the process we are debugging to stop, and verify the stop\n reason is 'exception' and that the description matches\n 'filter_label'\n " stopped_events = self.vscode.wait_for_stopped() for stopped_event in stopped_e...
77,465,806,993,255,650
Wait for the process we are debugging to stop, and verify the stop reason is 'exception' and that the description matches 'filter_label'
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
verify_exception_breakpoint_hit
Diatrus/llvm-project
python
def verify_exception_breakpoint_hit(self, filter_label): "Wait for the process we are debugging to stop, and verify the stop\n reason is 'exception' and that the description matches\n 'filter_label'\n " stopped_events = self.vscode.wait_for_stopped() for stopped_event in stopped_e...
def get_dict_value(self, d, key_path): 'Verify each key in the key_path array is in contained in each\n dictionary within "d". Assert if any key isn\'t in the\n corresponding dictionary. This is handy for grabbing values from VS\n Code response dictionary like getting\n respo...
-4,796,444,409,052,997,000
Verify each key in the key_path array is in contained in each dictionary within "d". Assert if any key isn't in the corresponding dictionary. This is handy for grabbing values from VS Code response dictionary like getting response['body']['stackFrames']
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
get_dict_value
Diatrus/llvm-project
python
def get_dict_value(self, d, key_path): 'Verify each key in the key_path array is in contained in each\n dictionary within "d". Assert if any key isn\'t in the\n corresponding dictionary. This is handy for grabbing values from VS\n Code response dictionary like getting\n respo...
def set_local(self, name, value, id=None): 'Set a top level local variable only.' return self.vscode.request_setVariable(1, name, str(value), id=id)
-5,406,429,082,478,088,000
Set a top level local variable only.
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
set_local
Diatrus/llvm-project
python
def set_local(self, name, value, id=None): return self.vscode.request_setVariable(1, name, str(value), id=id)
def set_global(self, name, value, id=None): 'Set a top level global variable only.' return self.vscode.request_setVariable(2, name, str(value), id=id)
1,311,405,924,274,155,000
Set a top level global variable only.
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
set_global
Diatrus/llvm-project
python
def set_global(self, name, value, id=None): return self.vscode.request_setVariable(2, name, str(value), id=id)
def attach(self, program=None, pid=None, waitFor=None, trace=None, initCommands=None, preRunCommands=None, stopCommands=None, exitCommands=None, attachCommands=None, coreFile=None): 'Build the default Makefile target, create the VSCode debug adaptor,\n and attach to the process.\n ' def cleanu...
-5,515,005,714,230,878,000
Build the default Makefile target, create the VSCode debug adaptor, and attach to the process.
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
attach
Diatrus/llvm-project
python
def attach(self, program=None, pid=None, waitFor=None, trace=None, initCommands=None, preRunCommands=None, stopCommands=None, exitCommands=None, attachCommands=None, coreFile=None): 'Build the default Makefile target, create the VSCode debug adaptor,\n and attach to the process.\n ' def cleanu...
def launch(self, program=None, args=None, cwd=None, env=None, stopOnEntry=False, disableASLR=True, disableSTDIO=False, shellExpandArguments=False, trace=False, initCommands=None, preRunCommands=None, stopCommands=None, exitCommands=None, sourcePath=None, debuggerRoot=None, launchCommands=None, sourceMap=None): 'Sen...
7,559,166,695,298,282,000
Sending launch request to vscode
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
launch
Diatrus/llvm-project
python
def launch(self, program=None, args=None, cwd=None, env=None, stopOnEntry=False, disableASLR=True, disableSTDIO=False, shellExpandArguments=False, trace=False, initCommands=None, preRunCommands=None, stopCommands=None, exitCommands=None, sourcePath=None, debuggerRoot=None, launchCommands=None, sourceMap=None): '\n ...
def build_and_launch(self, program, args=None, cwd=None, env=None, stopOnEntry=False, disableASLR=True, disableSTDIO=False, shellExpandArguments=False, trace=False, initCommands=None, preRunCommands=None, stopCommands=None, exitCommands=None, sourcePath=None, debuggerRoot=None): 'Build the default Makefile target, ...
-9,165,731,098,034,198,000
Build the default Makefile target, create the VSCode debug adaptor, and launch the process.
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
build_and_launch
Diatrus/llvm-project
python
def build_and_launch(self, program, args=None, cwd=None, env=None, stopOnEntry=False, disableASLR=True, disableSTDIO=False, shellExpandArguments=False, trace=False, initCommands=None, preRunCommands=None, stopCommands=None, exitCommands=None, sourcePath=None, debuggerRoot=None): 'Build the default Makefile target, ...
def random_rotation(x, rg, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random rotation of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n rg: Rotation range, in degrees.\n row_axis: Index of axis for rows in the input tensor.\n ...
-6,406,237,366,066,074,000
Performs a random rotation of a Numpy image tensor. # Arguments x: Input tensor. Must be 3D. rg: Rotation range, in degrees. row_axis: Index of axis for rows in the input tensor. col_axis: Index of axis for columns in the input tensor. channel_axis: Index of axis for channels in the input tensor. ...
keras/preprocessing/image.py
random_rotation
HangJie720/keras
python
def random_rotation(x, rg, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random rotation of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n rg: Rotation range, in degrees.\n row_axis: Index of axis for rows in the input tensor.\n ...
def random_shift(x, wrg, hrg, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random spatial shift of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n wrg: Width shift range, as a float fraction of the width.\n hrg: Height shift range...
1,415,840,483,480,128,800
Performs a random spatial shift of a Numpy image tensor. # Arguments x: Input tensor. Must be 3D. wrg: Width shift range, as a float fraction of the width. hrg: Height shift range, as a float fraction of the height. row_axis: Index of axis for rows in the input tensor. col_axis: Index of axis for c...
keras/preprocessing/image.py
random_shift
HangJie720/keras
python
def random_shift(x, wrg, hrg, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random spatial shift of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n wrg: Width shift range, as a float fraction of the width.\n hrg: Height shift range...
def random_shear(x, intensity, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random spatial shear of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n intensity: Transformation intensity in degrees.\n row_axis: Index of axis for rows...
-5,416,318,567,962,142,000
Performs a random spatial shear of a Numpy image tensor. # Arguments x: Input tensor. Must be 3D. intensity: Transformation intensity in degrees. row_axis: Index of axis for rows in the input tensor. col_axis: Index of axis for columns in the input tensor. channel_axis: Index of axis for channels i...
keras/preprocessing/image.py
random_shear
HangJie720/keras
python
def random_shear(x, intensity, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random spatial shear of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n intensity: Transformation intensity in degrees.\n row_axis: Index of axis for rows...
def random_zoom(x, zoom_range, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random spatial zoom of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n zoom_range: Tuple of floats; zoom range for width and height.\n row_axis: Index of ...
-1,170,494,675,024,863,500
Performs a random spatial zoom of a Numpy image tensor. # Arguments x: Input tensor. Must be 3D. zoom_range: Tuple of floats; zoom range for width and height. row_axis: Index of axis for rows in the input tensor. col_axis: Index of axis for columns in the input tensor. channel_axis: Index of axis f...
keras/preprocessing/image.py
random_zoom
HangJie720/keras
python
def random_zoom(x, zoom_range, row_axis=1, col_axis=2, channel_axis=0, fill_mode='nearest', cval=0.0): "Performs a random spatial zoom of a Numpy image tensor.\n\n # Arguments\n x: Input tensor. Must be 3D.\n zoom_range: Tuple of floats; zoom range for width and height.\n row_axis: Index of ...
def random_channel_shift(x, intensity, channel_axis=0): 'Performs a random channel shift.\n\n # Arguments\n x: Input tensor. Must be 3D.\n intensity: Transformation intensity.\n channel_axis: Index of axis for channels in the input tensor.\n\n # Returns\n Numpy image tensor.\n\n ...
6,769,834,749,985,244,000
Performs a random channel shift. # Arguments x: Input tensor. Must be 3D. intensity: Transformation intensity. channel_axis: Index of axis for channels in the input tensor. # Returns Numpy image tensor.
keras/preprocessing/image.py
random_channel_shift
HangJie720/keras
python
def random_channel_shift(x, intensity, channel_axis=0): 'Performs a random channel shift.\n\n # Arguments\n x: Input tensor. Must be 3D.\n intensity: Transformation intensity.\n channel_axis: Index of axis for channels in the input tensor.\n\n # Returns\n Numpy image tensor.\n\n ...
def random_brightness(x, brightness_range): "Performs a random brightness shift.\n\n # Arguments\n x: Input tensor. Must be 3D.\n brightness_range: Tuple of floats; brightness range.\n channel_axis: Index of axis for channels in the input tensor.\n\n # Returns\n Numpy image tensor....
1,916,011,930,223,731,200
Performs a random brightness shift. # Arguments x: Input tensor. Must be 3D. brightness_range: Tuple of floats; brightness range. channel_axis: Index of axis for channels in the input tensor. # Returns Numpy image tensor. # Raises ValueError if `brightness_range` isn't a tuple.
keras/preprocessing/image.py
random_brightness
HangJie720/keras
python
def random_brightness(x, brightness_range): "Performs a random brightness shift.\n\n # Arguments\n x: Input tensor. Must be 3D.\n brightness_range: Tuple of floats; brightness range.\n channel_axis: Index of axis for channels in the input tensor.\n\n # Returns\n Numpy image tensor....