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 initialize(self, run_tracker, start_time=None):
'Initialize with the given RunTracker.\n\n TODO: See `RunTracker.start`.\n '
run_id = run_tracker.initialize()
run_dir = os.path.join(self.get_options().reports_dir, run_id)
html_dir = os.path.join(run_dir, 'html')
safe_mkdir(html_dir)
re... | 6,642,605,218,831,490,000 | Initialize with the given RunTracker.
TODO: See `RunTracker.start`. | src/python/pants/reporting/reporting.py | initialize | GoingTharn/pants | python | def initialize(self, run_tracker, start_time=None):
'Initialize with the given RunTracker.\n\n TODO: See `RunTracker.start`.\n '
run_id = run_tracker.initialize()
run_dir = os.path.join(self.get_options().reports_dir, run_id)
html_dir = os.path.join(run_dir, 'html')
safe_mkdir(html_dir)
re... |
def update_reporting(self, global_options, is_quiet, run_tracker):
"Updates reporting config once we've parsed cmd-line flags."
removed_reporter = run_tracker.report.remove_reporter('capturing')
buffered_out = self._consume_stringio(removed_reporter.settings.outfile)
buffered_err = self._consume_stringi... | 6,257,123,446,702,456,000 | Updates reporting config once we've parsed cmd-line flags. | src/python/pants/reporting/reporting.py | update_reporting | GoingTharn/pants | python | def update_reporting(self, global_options, is_quiet, run_tracker):
removed_reporter = run_tracker.report.remove_reporter('capturing')
buffered_out = self._consume_stringio(removed_reporter.settings.outfile)
buffered_err = self._consume_stringio(removed_reporter.settings.errfile)
log_level = Report.... |
@asyncio.coroutine
def test_extract_from_service_available_device(hass):
'Test the extraction of entity from service and device is available.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
(yield from component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2', available=False), M... | 8,222,202,552,732,189,000 | Test the extraction of entity from service and device is available. | tests/helpers/test_entity_component.py | test_extract_from_service_available_device | BobbyBleacher/home-assistant | python | @asyncio.coroutine
def test_extract_from_service_available_device(hass):
component = EntityComponent(_LOGGER, DOMAIN, hass)
(yield from component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2', available=False), MockEntity(name='test_3'), MockEntity(name='test_4', available=False)]... |
@asyncio.coroutine
def test_platform_not_ready(hass):
'Test that we retry when platform not ready.'
platform1_setup = Mock(side_effect=[PlatformNotReady, PlatformNotReady, None])
loader.set_component(hass, 'mod1', MockModule('mod1'))
loader.set_component(hass, 'mod1.test_domain', MockPlatform(platform1_... | -842,300,693,004,235,100 | Test that we retry when platform not ready. | tests/helpers/test_entity_component.py | test_platform_not_ready | BobbyBleacher/home-assistant | python | @asyncio.coroutine
def test_platform_not_ready(hass):
platform1_setup = Mock(side_effect=[PlatformNotReady, PlatformNotReady, None])
loader.set_component(hass, 'mod1', MockModule('mod1'))
loader.set_component(hass, 'mod1.test_domain', MockPlatform(platform1_setup))
component = EntityComponent(_LOGG... |
@asyncio.coroutine
def test_extract_from_service_returns_all_if_no_entity_id(hass):
'Test the extraction of everything from service.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
(yield from component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call = ha.ServiceCall... | 6,420,445,789,876,699,000 | Test the extraction of everything from service. | tests/helpers/test_entity_component.py | test_extract_from_service_returns_all_if_no_entity_id | BobbyBleacher/home-assistant | python | @asyncio.coroutine
def test_extract_from_service_returns_all_if_no_entity_id(hass):
component = EntityComponent(_LOGGER, DOMAIN, hass)
(yield from component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call = ha.ServiceCall('test', 'service')
assert (['test_domain.tes... |
@asyncio.coroutine
def test_extract_from_service_filter_out_non_existing_entities(hass):
'Test the extraction of non existing entities from service.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
(yield from component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call ... | 4,302,766,359,275,721,000 | Test the extraction of non existing entities from service. | tests/helpers/test_entity_component.py | test_extract_from_service_filter_out_non_existing_entities | BobbyBleacher/home-assistant | python | @asyncio.coroutine
def test_extract_from_service_filter_out_non_existing_entities(hass):
component = EntityComponent(_LOGGER, DOMAIN, hass)
(yield from component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call = ha.ServiceCall('test', 'service', {'entity_id': ['test_dom... |
@asyncio.coroutine
def test_extract_from_service_no_group_expand(hass):
'Test not expanding a group.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
test_group = (yield from group.Group.async_create_group(hass, 'test_group', ['light.Ceiling', 'light.Kitchen']))
(yield from component.async_add_entiti... | 7,651,423,936,688,272,000 | Test not expanding a group. | tests/helpers/test_entity_component.py | test_extract_from_service_no_group_expand | BobbyBleacher/home-assistant | python | @asyncio.coroutine
def test_extract_from_service_no_group_expand(hass):
component = EntityComponent(_LOGGER, DOMAIN, hass)
test_group = (yield from group.Group.async_create_group(hass, 'test_group', ['light.Ceiling', 'light.Kitchen']))
(yield from component.async_add_entities([test_group]))
call = ... |
@asyncio.coroutine
def test_setup_dependencies_platform(hass):
"Test we setup the dependencies of a platform.\n\n We're explictely testing that we process dependencies even if a component\n with the same name has already been loaded.\n "
loader.set_component(hass, 'test_component', MockModule('test_com... | 2,688,575,218,466,561,000 | Test we setup the dependencies of a platform.
We're explictely testing that we process dependencies even if a component
with the same name has already been loaded. | tests/helpers/test_entity_component.py | test_setup_dependencies_platform | BobbyBleacher/home-assistant | python | @asyncio.coroutine
def test_setup_dependencies_platform(hass):
"Test we setup the dependencies of a platform.\n\n We're explictely testing that we process dependencies even if a component\n with the same name has already been loaded.\n "
loader.set_component(hass, 'test_component', MockModule('test_com... |
async def test_setup_entry(hass):
'Test setup entry calls async_setup_entry on platform.'
mock_setup_entry = Mock(return_value=mock_coro(True))
mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry, scan_interval=timedelta(seconds=5)))
component = EntityC... | -6,554,110,248,055,908,000 | Test setup entry calls async_setup_entry on platform. | tests/helpers/test_entity_component.py | test_setup_entry | BobbyBleacher/home-assistant | python | async def test_setup_entry(hass):
mock_setup_entry = Mock(return_value=mock_coro(True))
mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry, scan_interval=timedelta(seconds=5)))
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigE... |
async def test_setup_entry_platform_not_exist(hass):
'Test setup entry fails if platform doesnt exist.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigEntry(domain='non_existing')
assert ((await component.async_setup_entry(entry)) is False) | 6,092,304,173,295,340,000 | Test setup entry fails if platform doesnt exist. | tests/helpers/test_entity_component.py | test_setup_entry_platform_not_exist | BobbyBleacher/home-assistant | python | async def test_setup_entry_platform_not_exist(hass):
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigEntry(domain='non_existing')
assert ((await component.async_setup_entry(entry)) is False) |
async def test_setup_entry_fails_duplicate(hass):
"Test we don't allow setting up a config entry twice."
mock_setup_entry = Mock(return_value=mock_coro(True))
mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry))
component = EntityComponent(_LOGGER, DOM... | 4,654,525,383,403,044,000 | Test we don't allow setting up a config entry twice. | tests/helpers/test_entity_component.py | test_setup_entry_fails_duplicate | BobbyBleacher/home-assistant | python | async def test_setup_entry_fails_duplicate(hass):
mock_setup_entry = Mock(return_value=mock_coro(True))
mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry))
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigEntry(domain='entry_d... |
async def test_unload_entry_resets_platform(hass):
'Test unloading an entry removes all entities.'
mock_setup_entry = Mock(return_value=mock_coro(True))
mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry))
component = EntityComponent(_LOGGER, DOMAIN, h... | -7,203,035,027,081,088,000 | Test unloading an entry removes all entities. | tests/helpers/test_entity_component.py | test_unload_entry_resets_platform | BobbyBleacher/home-assistant | python | async def test_unload_entry_resets_platform(hass):
mock_setup_entry = Mock(return_value=mock_coro(True))
mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry))
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigEntry(domain='entry_... |
async def test_unload_entry_fails_if_never_loaded(hass):
'.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigEntry(domain='entry_domain')
with pytest.raises(ValueError):
(await component.async_unload_entry(entry)) | 6,201,961,440,986,574,000 | . | tests/helpers/test_entity_component.py | test_unload_entry_fails_if_never_loaded | BobbyBleacher/home-assistant | python | async def test_unload_entry_fails_if_never_loaded(hass):
component = EntityComponent(_LOGGER, DOMAIN, hass)
entry = MockConfigEntry(domain='entry_domain')
with pytestraises(ValueError):
(await componentasync_unload_entry(entry)) |
async def test_update_entity(hass):
'Test that we can update an entity with the helper.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
entity = MockEntity()
entity.async_update_ha_state = Mock(return_value=mock_coro())
(await component.async_add_entities([entity]))
assert (len(entity.async_... | -6,916,889,164,922,576,000 | Test that we can update an entity with the helper. | tests/helpers/test_entity_component.py | test_update_entity | BobbyBleacher/home-assistant | python | async def test_update_entity(hass):
component = EntityComponent(_LOGGER, DOMAIN, hass)
entity = MockEntity()
entity.async_update_ha_state = Mock(return_value=mock_coro())
(await component.async_add_entities([entity]))
assert (len(entity.async_update_ha_state.mock_calls) == 1)
(await hass.he... |
async def test_set_service_race(hass):
'Test race condition on setting service.'
exception = False
def async_loop_exception_handler(_, _2) -> None:
'Handle all exception inside the core loop.'
nonlocal exception
exception = True
hass.loop.set_exception_handler(async_loop_excepti... | -4,838,710,095,732,210,000 | Test race condition on setting service. | tests/helpers/test_entity_component.py | test_set_service_race | BobbyBleacher/home-assistant | python | async def test_set_service_race(hass):
exception = False
def async_loop_exception_handler(_, _2) -> None:
'Handle all exception inside the core loop.'
nonlocal exception
exception = True
hass.loop.set_exception_handler(async_loop_exception_handler)
(await async_setup_compon... |
async def test_extract_all_omit_entity_id(hass, caplog):
'Test extract all with None and *.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
(await component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call = ha.ServiceCall('test', 'service')
assert (['test_domain.... | 6,499,691,931,174,889,000 | Test extract all with None and *. | tests/helpers/test_entity_component.py | test_extract_all_omit_entity_id | BobbyBleacher/home-assistant | python | async def test_extract_all_omit_entity_id(hass, caplog):
component = EntityComponent(_LOGGER, DOMAIN, hass)
(await component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call = ha.ServiceCall('test', 'service')
assert (['test_domain.test_1', 'test_domain.test_2'] == s... |
async def test_extract_all_use_match_all(hass, caplog):
'Test extract all with None and *.'
component = EntityComponent(_LOGGER, DOMAIN, hass)
(await component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call = ha.ServiceCall('test', 'service', {'entity_id': 'all'})
a... | -157,309,294,548,301,440 | Test extract all with None and *. | tests/helpers/test_entity_component.py | test_extract_all_use_match_all | BobbyBleacher/home-assistant | python | async def test_extract_all_use_match_all(hass, caplog):
component = EntityComponent(_LOGGER, DOMAIN, hass)
(await component.async_add_entities([MockEntity(name='test_1'), MockEntity(name='test_2')]))
call = ha.ServiceCall('test', 'service', {'entity_id': 'all'})
assert (['test_domain.test_1', 'test... |
def setUp(self):
'Initialize a test Home Assistant instance.'
self.hass = get_test_home_assistant() | 9,083,279,011,530,655,000 | Initialize a test Home Assistant instance. | tests/helpers/test_entity_component.py | setUp | BobbyBleacher/home-assistant | python | def setUp(self):
self.hass = get_test_home_assistant() |
def tearDown(self):
'Clean up the test Home Assistant instance.'
self.hass.stop() | -5,348,143,838,058,471,000 | Clean up the test Home Assistant instance. | tests/helpers/test_entity_component.py | tearDown | BobbyBleacher/home-assistant | python | def tearDown(self):
self.hass.stop() |
def test_setting_up_group(self):
'Set up the setting of a group.'
setup_component(self.hass, 'group', {'group': {}})
component = EntityComponent(_LOGGER, DOMAIN, self.hass, group_name='everyone')
assert (len(self.hass.states.entity_ids()) == 0)
component.add_entities([MockEntity()])
self.hass.bl... | -7,333,364,860,958,330,000 | Set up the setting of a group. | tests/helpers/test_entity_component.py | test_setting_up_group | BobbyBleacher/home-assistant | python | def test_setting_up_group(self):
setup_component(self.hass, 'group', {'group': {}})
component = EntityComponent(_LOGGER, DOMAIN, self.hass, group_name='everyone')
assert (len(self.hass.states.entity_ids()) == 0)
component.add_entities([MockEntity()])
self.hass.block_till_done()
assert (len(... |
def test_setup_loads_platforms(self):
'Test the loading of the platforms.'
component_setup = Mock(return_value=True)
platform_setup = Mock(return_value=None)
mock_integration(self.hass, MockModule('test_component', setup=component_setup))
mock_integration(self.hass, MockModule('mod2', dependencies=[... | 1,190,858,218,687,881,700 | Test the loading of the platforms. | tests/helpers/test_entity_component.py | test_setup_loads_platforms | BobbyBleacher/home-assistant | python | def test_setup_loads_platforms(self):
component_setup = Mock(return_value=True)
platform_setup = Mock(return_value=None)
mock_integration(self.hass, MockModule('test_component', setup=component_setup))
mock_integration(self.hass, MockModule('mod2', dependencies=['test_component']))
mock_entity_... |
def test_setup_recovers_when_setup_raises(self):
'Test the setup if exceptions are happening.'
platform1_setup = Mock(side_effect=Exception('Broken'))
platform2_setup = Mock(return_value=None)
mock_entity_platform(self.hass, 'test_domain.mod1', MockPlatform(platform1_setup))
mock_entity_platform(sel... | 8,994,935,806,947,191,000 | Test the setup if exceptions are happening. | tests/helpers/test_entity_component.py | test_setup_recovers_when_setup_raises | BobbyBleacher/home-assistant | python | def test_setup_recovers_when_setup_raises(self):
platform1_setup = Mock(side_effect=Exception('Broken'))
platform2_setup = Mock(return_value=None)
mock_entity_platform(self.hass, 'test_domain.mod1', MockPlatform(platform1_setup))
mock_entity_platform(self.hass, 'test_domain.mod2', MockPlatform(plat... |
@patch('homeassistant.helpers.entity_component.EntityComponent._async_setup_platform', return_value=mock_coro())
@patch('homeassistant.setup.async_setup_component', return_value=mock_coro(True))
def test_setup_does_discovery(self, mock_setup_component, mock_setup):
'Test setup for discovery.'
component = Entity... | -5,922,677,092,688,795,000 | Test setup for discovery. | tests/helpers/test_entity_component.py | test_setup_does_discovery | BobbyBleacher/home-assistant | python | @patch('homeassistant.helpers.entity_component.EntityComponent._async_setup_platform', return_value=mock_coro())
@patch('homeassistant.setup.async_setup_component', return_value=mock_coro(True))
def test_setup_does_discovery(self, mock_setup_component, mock_setup):
component = EntityComponent(_LOGGER, DOMAIN, ... |
@patch('homeassistant.helpers.entity_platform.async_track_time_interval')
def test_set_scan_interval_via_config(self, mock_track):
'Test the setting of the scan interval via configuration.'
def platform_setup(hass, config, add_entities, discovery_info=None):
'Test the platform setup.'
add_entit... | 4,659,996,049,484,274,000 | Test the setting of the scan interval via configuration. | tests/helpers/test_entity_component.py | test_set_scan_interval_via_config | BobbyBleacher/home-assistant | python | @patch('homeassistant.helpers.entity_platform.async_track_time_interval')
def test_set_scan_interval_via_config(self, mock_track):
def platform_setup(hass, config, add_entities, discovery_info=None):
'Test the platform setup.'
add_entities([MockEntity(should_poll=True)])
mock_entity_platfo... |
def test_set_entity_namespace_via_config(self):
'Test setting an entity namespace.'
def platform_setup(hass, config, add_entities, discovery_info=None):
'Test the platform setup.'
add_entities([MockEntity(name='beer'), MockEntity(name=None)])
platform = MockPlatform(platform_setup)
mock... | -1,436,440,670,925,141,000 | Test setting an entity namespace. | tests/helpers/test_entity_component.py | test_set_entity_namespace_via_config | BobbyBleacher/home-assistant | python | def test_set_entity_namespace_via_config(self):
def platform_setup(hass, config, add_entities, discovery_info=None):
'Test the platform setup.'
add_entities([MockEntity(name='beer'), MockEntity(name=None)])
platform = MockPlatform(platform_setup)
mock_entity_platform(self.hass, 'test_d... |
def async_loop_exception_handler(_, _2) -> None:
'Handle all exception inside the core loop.'
nonlocal exception
exception = True | -6,541,915,942,138,100,000 | Handle all exception inside the core loop. | tests/helpers/test_entity_component.py | async_loop_exception_handler | BobbyBleacher/home-assistant | python | def async_loop_exception_handler(_, _2) -> None:
nonlocal exception
exception = True |
def platform_setup(hass, config, add_entities, discovery_info=None):
'Test the platform setup.'
add_entities([MockEntity(should_poll=True)]) | -8,607,022,983,448,196,000 | Test the platform setup. | tests/helpers/test_entity_component.py | platform_setup | BobbyBleacher/home-assistant | python | def platform_setup(hass, config, add_entities, discovery_info=None):
add_entities([MockEntity(should_poll=True)]) |
def platform_setup(hass, config, add_entities, discovery_info=None):
'Test the platform setup.'
add_entities([MockEntity(name='beer'), MockEntity(name=None)]) | 7,361,666,536,476,458,000 | Test the platform setup. | tests/helpers/test_entity_component.py | platform_setup | BobbyBleacher/home-assistant | python | def platform_setup(hass, config, add_entities, discovery_info=None):
add_entities([MockEntity(name='beer'), MockEntity(name=None)]) |
def quadprog(Q, q, G, h, A, b):
'\n Input: Numpy arrays, the format follows MATLAB quadprog function: https://www.mathworks.com/help/optim/ug/quadprog.html\n Output: Numpy array of the solution\n '
Q = cvxopt.matrix(Q.tolist())
q = cvxopt.matrix(q.tolist(), tc='d')
G = cvxopt.matrix(G.tolist())... | 7,936,910,832,750,283,000 | Input: Numpy arrays, the format follows MATLAB quadprog function: https://www.mathworks.com/help/optim/ug/quadprog.html
Output: Numpy array of the solution | fedlab_benchmarks/fedmgda+/standalone.py | quadprog | KarhouTam/FedLab-benchmarks | python | def quadprog(Q, q, G, h, A, b):
'\n Input: Numpy arrays, the format follows MATLAB quadprog function: https://www.mathworks.com/help/optim/ug/quadprog.html\n Output: Numpy array of the solution\n '
Q = cvxopt.matrix(Q.tolist())
q = cvxopt.matrix(q.tolist(), tc='d')
G = cvxopt.matrix(G.tolist())... |
def handle_mark(self, time, mark):
' Handle a single trace item (scoped entry and exit).\n Translates:\n - Automatically generated HIDL traces into NNTRACE layers and phases\n - SPEC:Switch phase during function into dummy items\n - SPEC:Subtracting time when nesting is violated in... | -6,323,244,300,068,887,000 | Handle a single trace item (scoped entry and exit).
Translates:
- Automatically generated HIDL traces into NNTRACE layers and phases
- SPEC:Switch phase during function into dummy items
- SPEC:Subtracting time when nesting is violated into "subtract"
markers
- CPU/Driver layer distinction based on whether t... | tools/systrace_parser/parser/tracker.py | handle_mark | PotatoProject-next/ackages_modules_NeuralNetworks | python | def handle_mark(self, time, mark):
' Handle a single trace item (scoped entry and exit).\n Translates:\n - Automatically generated HIDL traces into NNTRACE layers and phases\n - SPEC:Switch phase during function into dummy items\n - SPEC:Subtracting time when nesting is violated in... |
def is_complete(self):
" Checks if we've seen all end tracepoints for the begin tracepoints.\n "
return self.mytree.current.is_root() | -2,324,503,509,758,186,000 | Checks if we've seen all end tracepoints for the begin tracepoints. | tools/systrace_parser/parser/tracker.py | is_complete | PotatoProject-next/ackages_modules_NeuralNetworks | python | def is_complete(self):
" \n "
return self.mytree.current.is_root() |
def test_water_at_freezing(self):
'\n Reproduce verification results from IAPWS-IF97 for water at 0C\n http://www.iapws.org/relguide/supsat.pdf\n '
water = SaturatedWater()
steam = SaturatedSteam()
Tk = 273.16
ref_vapor_pressure = 611.657
ref_dp_dT = 44.436693
ref_satura... | 7,141,919,799,247,304,000 | Reproduce verification results from IAPWS-IF97 for water at 0C
http://www.iapws.org/relguide/supsat.pdf | armi/materials/tests/test_water.py | test_water_at_freezing | youngmit/armi | python | def test_water_at_freezing(self):
'\n Reproduce verification results from IAPWS-IF97 for water at 0C\n http://www.iapws.org/relguide/supsat.pdf\n '
water = SaturatedWater()
steam = SaturatedSteam()
Tk = 273.16
ref_vapor_pressure = 611.657
ref_dp_dT = 44.436693
ref_satura... |
def test_water_at_boiling(self):
'\n Reproduce verification results from IAPWS-IF97 for water at 100C\n http://www.iapws.org/relguide/supsat.pdf\n '
water = SaturatedWater()
steam = SaturatedSteam()
Tk = 373.1243
ref_vapor_pressure = 101325.0
ref_dp_dT = 3616.0
ref_satur... | -7,031,717,173,156,379,000 | Reproduce verification results from IAPWS-IF97 for water at 100C
http://www.iapws.org/relguide/supsat.pdf | armi/materials/tests/test_water.py | test_water_at_boiling | youngmit/armi | python | def test_water_at_boiling(self):
'\n Reproduce verification results from IAPWS-IF97 for water at 100C\n http://www.iapws.org/relguide/supsat.pdf\n '
water = SaturatedWater()
steam = SaturatedSteam()
Tk = 373.1243
ref_vapor_pressure = 101325.0
ref_dp_dT = 3616.0
ref_satur... |
def test_water_at_critcalPoint(self):
'\n Reproduce verification results from IAPWS-IF97 for water at 647.096K\n http://www.iapws.org/relguide/supsat.pdf\n '
water = SaturatedWater()
steam = SaturatedSteam()
Tk = 647.096
ref_vapor_pressure = 22064000.0
ref_dp_dT = 268000.0
... | 1,907,172,182,332,172,500 | Reproduce verification results from IAPWS-IF97 for water at 647.096K
http://www.iapws.org/relguide/supsat.pdf | armi/materials/tests/test_water.py | test_water_at_critcalPoint | youngmit/armi | python | def test_water_at_critcalPoint(self):
'\n Reproduce verification results from IAPWS-IF97 for water at 647.096K\n http://www.iapws.org/relguide/supsat.pdf\n '
water = SaturatedWater()
steam = SaturatedSteam()
Tk = 647.096
ref_vapor_pressure = 22064000.0
ref_dp_dT = 268000.0
... |
def count_evens(start, end):
'Returns the number of even numbers between start and end.'
counter = start
num_evens = 0
while (counter <= end):
if ((counter % 2) == 0):
num_evens += 1
counter += 1
return num_evens | 4,659,412,109,170,044,000 | Returns the number of even numbers between start and end. | exercise_brokencounts_solution.py | count_evens | annezola/gdi-python | python | def count_evens(start, end):
counter = start
num_evens = 0
while (counter <= end):
if ((counter % 2) == 0):
num_evens += 1
counter += 1
return num_evens |
def count_multiples(start, end, divisor):
'Returns the number of multiples of divisor between start and end.'
counter = start
num_multiples = 0
while (counter <= end):
if ((counter % divisor) == 0):
num_multiples += 1
counter += 1
return num_multiples | 3,766,785,650,277,561,300 | Returns the number of multiples of divisor between start and end. | exercise_brokencounts_solution.py | count_multiples | annezola/gdi-python | python | def count_multiples(start, end, divisor):
counter = start
num_multiples = 0
while (counter <= end):
if ((counter % divisor) == 0):
num_multiples += 1
counter += 1
return num_multiples |
def calculate(pxarray: np.ndarray):
'Calculates one or more values from plot-level RGB data\n Arguments:\n pxarray: Array of RGB data for a single plot\n Return:\n Returns one or more calculated values\n '
channel_size = pxarray[:, :, 1].size
return channel_size | -8,294,379,030,707,513,000 | Calculates one or more values from plot-level RGB data
Arguments:
pxarray: Array of RGB data for a single plot
Return:
Returns one or more calculated values | .github/workflows/algorithm_rgb.py | calculate | AgPipeline/plot-base-rgb | python | def calculate(pxarray: np.ndarray):
'Calculates one or more values from plot-level RGB data\n Arguments:\n pxarray: Array of RGB data for a single plot\n Return:\n Returns one or more calculated values\n '
channel_size = pxarray[:, :, 1].size
return channel_size |
def _eval(self, segment, **kwargs):
'Join/From clauses should not contain subqueries. Use CTEs instead.\n\n NB: No fix for this routine because it would be very complex to\n implement reliably.\n '
parent_types = self._config_mapping[self.forbid_subquery_in]
for parent_type in parent_ty... | -681,525,606,612,198,700 | Join/From clauses should not contain subqueries. Use CTEs instead.
NB: No fix for this routine because it would be very complex to
implement reliably. | src/sqlfluff/core/rules/std/L042.py | _eval | Jophish/sqlfluff | python | def _eval(self, segment, **kwargs):
'Join/From clauses should not contain subqueries. Use CTEs instead.\n\n NB: No fix for this routine because it would be very complex to\n implement reliably.\n '
parent_types = self._config_mapping[self.forbid_subquery_in]
for parent_type in parent_ty... |
def cog_unload(self):
' Cog unload handler. This removes any event hooks that were registered. '
self.bot.lavalink._event_hooks.clear() | 5,768,431,661,943,328,000 | Cog unload handler. This removes any event hooks that were registered. | cogs/music.py | cog_unload | 1Prototype1/HexBot | python | def cog_unload(self):
' '
self.bot.lavalink._event_hooks.clear() |
async def cog_before_invoke(self, ctx):
' Command before-invoke handler. '
guild_check = (ctx.guild is not None)
if guild_check:
(await self.ensure_voice(ctx))
return guild_check | -198,743,436,622,049,540 | Command before-invoke handler. | cogs/music.py | cog_before_invoke | 1Prototype1/HexBot | python | async def cog_before_invoke(self, ctx):
' '
guild_check = (ctx.guild is not None)
if guild_check:
(await self.ensure_voice(ctx))
return guild_check |
async def ensure_voice(self, ctx):
' This check ensures that the bot and command author are in the same voicechannel. '
player = self.bot.lavalink.player_manager.create(ctx.guild.id, endpoint=str(ctx.guild.region))
should_connect = (ctx.command.name in ('play',))
if ((not ctx.author.voice) or (not ctx.a... | 7,336,377,337,078,352,000 | This check ensures that the bot and command author are in the same voicechannel. | cogs/music.py | ensure_voice | 1Prototype1/HexBot | python | async def ensure_voice(self, ctx):
' '
player = self.bot.lavalink.player_manager.create(ctx.guild.id, endpoint=str(ctx.guild.region))
should_connect = (ctx.command.name in ('play',))
if ((not ctx.author.voice) or (not ctx.author.voice.channel)):
raise commands.CommandInvokeError('Join a voice c... |
async def connect_to(self, guild_id: int, channel_id: str):
' Connects to the given voicechannel ID. A channel_id of `None` means disconnect. '
ws = self.bot._connection._get_websocket(guild_id)
(await ws.voice_state(str(guild_id), channel_id)) | 8,130,363,841,742,988,000 | Connects to the given voicechannel ID. A channel_id of `None` means disconnect. | cogs/music.py | connect_to | 1Prototype1/HexBot | python | async def connect_to(self, guild_id: int, channel_id: str):
' '
ws = self.bot._connection._get_websocket(guild_id)
(await ws.voice_state(str(guild_id), channel_id)) |
@commands.command(name='lyrics', aliases=['ly'])
async def get_lyrics(self, ctx, *, query: str=''):
'Get lyrics of current song'
if (not query):
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
if (not player.is_playing):
return (await ctx.send("I'm not currently playing a... | -1,764,598,707,970,382,600 | Get lyrics of current song | cogs/music.py | get_lyrics | 1Prototype1/HexBot | python | @commands.command(name='lyrics', aliases=['ly'])
async def get_lyrics(self, ctx, *, query: str=):
if (not query):
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
if (not player.is_playing):
return (await ctx.send("I'm not currently playing anything :warning:"))
q... |
@commands.command(name='equalizer', aliases=['eq'])
async def equalizer(self, ctx, *args):
'Equalizer'
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
if (len(args) == 0):
(await ctx.send('Specify `band gain` or `preset` to change frequencies :control_knobs:'))
elif (len(args) == 1):... | 2,920,680,446,155,721,000 | Equalizer | cogs/music.py | equalizer | 1Prototype1/HexBot | python | @commands.command(name='equalizer', aliases=['eq'])
async def equalizer(self, ctx, *args):
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
if (len(args) == 0):
(await ctx.send('Specify `band gain` or `preset` to change frequencies :control_knobs:'))
elif (len(args) == 1):
pr... |
def __init__(self):
'\n initialize your data structure here.\n '
self.stack = []
self.min = math.inf | -9,064,414,778,785,991,000 | initialize your data structure here. | notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/Interview-Problems/LeetCode/MinStack.py | __init__ | bgoonz/INTERVIEW-PREP-COMPLETE | python | def __init__(self):
'\n \n '
self.stack = []
self.min = math.inf |
def get_full_mapping(src_filename, trg_filename, align_filename, mapping_filename, reverse_src2trg=False, lowercase=True):
' Get full mapping give align.\n\n Args:\n src_filename:\n trg_filename:\n align_filename:\n mapping_filename:\n reverse_src2trg:\n lowercase:\n\n ... | 691,652,501,439,763,500 | Get full mapping give align.
Args:
src_filename:
trg_filename:
align_filename:
mapping_filename:
reverse_src2trg:
lowercase:
Returns: | examples/wmt/tools/align/extract_bilingual_vocabulary.py | get_full_mapping | JiangtaoFeng/ParaGen | python | def get_full_mapping(src_filename, trg_filename, align_filename, mapping_filename, reverse_src2trg=False, lowercase=True):
' Get full mapping give align.\n\n Args:\n src_filename:\n trg_filename:\n align_filename:\n mapping_filename:\n reverse_src2trg:\n lowercase:\n\n ... |
def refine_dict(full_mapping, clean_dict_filename, threshold, ignore_gap):
" Clean dictionary based on frequency and gap of frequency.\n For example,\n {'s1': ['t1': 999, 't2': 199, 't3':1],\n 's2': ['m1': 2000, 'm2': 100]}\n =>\n {'s1': ['t1': 999, 't2': 199],\n 's2': ['m1': 2000]}\n\n Args... | -6,374,763,968,999,119,000 | Clean dictionary based on frequency and gap of frequency.
For example,
{'s1': ['t1': 999, 't2': 199, 't3':1],
's2': ['m1': 2000, 'm2': 100]}
=>
{'s1': ['t1': 999, 't2': 199],
's2': ['m1': 2000]}
Args:
full_mapping:
clean_dict_filename:
threshold:
ignore_gap:
Returns: | examples/wmt/tools/align/extract_bilingual_vocabulary.py | refine_dict | JiangtaoFeng/ParaGen | python | def refine_dict(full_mapping, clean_dict_filename, threshold, ignore_gap):
" Clean dictionary based on frequency and gap of frequency.\n For example,\n {'s1': ['t1': 999, 't2': 199, 't3':1],\n 's2': ['m1': 2000, 'm2': 100]}\n =>\n {'s1': ['t1': 999, 't2': 199],\n 's2': ['m1': 2000]}\n\n Args... |
def test_TreeTest1(self):
'Test Tree module.'
f = data_stream('nexus/test_Nexus_input.nex')
n = Nexus(f)
t3 = n.trees[2]
n.trees[2]
t3.root_with_outgroup(['t1', 't5'])
self.assertEqual(t3.is_monophyletic(['t1', 't5']), 13)
t3.split(parent_id=t3.search_taxon('t9'))
f.close() | 8,496,966,509,704,470,000 | Test Tree module. | tests/test_nexus.py | test_TreeTest1 | WebLogo/weblogo | python | def test_TreeTest1(self):
f = data_stream('nexus/test_Nexus_input.nex')
n = Nexus(f)
t3 = n.trees[2]
n.trees[2]
t3.root_with_outgroup(['t1', 't5'])
self.assertEqual(t3.is_monophyletic(['t1', 't5']), 13)
t3.split(parent_id=t3.search_taxon('t9'))
f.close() |
def _vec(x):
'Stacks column of matrix to form a single column.'
return array_ops.reshape(array_ops.matrix_transpose(x), array_ops.concat([array_ops.shape(x)[:(- 2)], [(- 1)]], axis=0)) | -5,485,323,311,372,672,000 | Stacks column of matrix to form a single column. | tensorflow/contrib/linalg/python/ops/linear_operator_kronecker.py | _vec | ADiegoCAlonso/tensorflow | python | def _vec(x):
return array_ops.reshape(array_ops.matrix_transpose(x), array_ops.concat([array_ops.shape(x)[:(- 2)], [(- 1)]], axis=0)) |
def _unvec_by(y, num_col):
'Unstack vector to form a matrix, with a specified amount of columns.'
return array_ops.matrix_transpose(array_ops.reshape(y, array_ops.concat([array_ops.shape(y)[:(- 1)], [num_col, (- 1)]], axis=0))) | 1,865,925,301,402,786,300 | Unstack vector to form a matrix, with a specified amount of columns. | tensorflow/contrib/linalg/python/ops/linear_operator_kronecker.py | _unvec_by | ADiegoCAlonso/tensorflow | python | def _unvec_by(y, num_col):
return array_ops.matrix_transpose(array_ops.reshape(y, array_ops.concat([array_ops.shape(y)[:(- 1)], [num_col, (- 1)]], axis=0))) |
def _rotate_last_dim(x, rotate_right=False):
'Rotate the last dimension either left or right.'
ndims = array_ops.rank(x)
if rotate_right:
transpose_perm = array_ops.concat([[(ndims - 1)], math_ops.range(0, (ndims - 1))], axis=0)
else:
transpose_perm = array_ops.concat([math_ops.range(1, ... | 8,692,827,826,145,462,000 | Rotate the last dimension either left or right. | tensorflow/contrib/linalg/python/ops/linear_operator_kronecker.py | _rotate_last_dim | ADiegoCAlonso/tensorflow | python | def _rotate_last_dim(x, rotate_right=False):
ndims = array_ops.rank(x)
if rotate_right:
transpose_perm = array_ops.concat([[(ndims - 1)], math_ops.range(0, (ndims - 1))], axis=0)
else:
transpose_perm = array_ops.concat([math_ops.range(1, ndims), [0]], axis=0)
return array_ops.transp... |
def __init__(self, operators, is_non_singular=None, is_self_adjoint=None, is_positive_definite=None, is_square=None, name=None):
'Initialize a `LinearOperatorKronecker`.\n\n `LinearOperatorKronecker` is initialized with a list of operators\n `[op_1,...,op_J]`.\n\n Args:\n operators: Iterable of `Line... | -419,869,077,990,686,340 | Initialize a `LinearOperatorKronecker`.
`LinearOperatorKronecker` is initialized with a list of operators
`[op_1,...,op_J]`.
Args:
operators: Iterable of `LinearOperator` objects, each with
the same `dtype` and composable shape, representing the Kronecker
factors.
is_non_singular: Expect that this opera... | tensorflow/contrib/linalg/python/ops/linear_operator_kronecker.py | __init__ | ADiegoCAlonso/tensorflow | python | def __init__(self, operators, is_non_singular=None, is_self_adjoint=None, is_positive_definite=None, is_square=None, name=None):
'Initialize a `LinearOperatorKronecker`.\n\n `LinearOperatorKronecker` is initialized with a list of operators\n `[op_1,...,op_J]`.\n\n Args:\n operators: Iterable of `Line... |
@app.route(('/api/' + version), methods=['GET'])
def test():
'\n GET method to test the API.\n '
message = {'response': [{'text': 'Hello world!'}]}
return jsonify(message) | 5,445,447,162,671,225,000 | GET method to test the API. | app.py | test | RodolfoFerro/iris-api | python | @app.route(('/api/' + version), methods=['GET'])
def test():
'\n \n '
message = {'response': [{'text': 'Hello world!'}]}
return jsonify(message) |
@app.route((('/api/' + version) + '/predict'), methods=['POST'])
def predict():
'\n POST method to predict with our classification model.\n '
req_data = request.get_json()
sl = req_data['sepal_length']
sw = req_data['sepal_width']
pl = req_data['petal_length']
pw = req_data['petal_width']
... | -4,948,526,796,356,483,000 | POST method to predict with our classification model. | app.py | predict | RodolfoFerro/iris-api | python | @app.route((('/api/' + version) + '/predict'), methods=['POST'])
def predict():
'\n \n '
req_data = request.get_json()
sl = req_data['sepal_length']
sw = req_data['sepal_width']
pl = req_data['petal_length']
pw = req_data['petal_width']
input_data = np.array([[sl, sw, pl, pw]])
pre... |
def format_yaml(yaml, **kwargs):
'Formats a yaml template.\n\n Example usage:\n format_yaml(\'{"abc": ${x.y}}\', x={\'y\': 123})\n output should be \'{"abc": 123}\'\n '
template = _YamlTemplate(yaml)
try:
return template.substitute(flatten((kwargs or {}), reducer='dot'))
except ... | -7,073,362,382,966,232,000 | Formats a yaml template.
Example usage:
format_yaml('{"abc": ${x.y}}', x={'y': 123})
output should be '{"abc": 123}' | web_console_v2/api/fedlearner_webconsole/workflow_template/slots_formatter.py | format_yaml | duanbing/fedlearner | python | def format_yaml(yaml, **kwargs):
'Formats a yaml template.\n\n Example usage:\n format_yaml(\'{"abc": ${x.y}}\', x={\'y\': 123})\n output should be \'{"abc": 123}\'\n '
template = _YamlTemplate(yaml)
try:
return template.substitute(flatten((kwargs or {}), reducer='dot'))
except ... |
def generate_yaml_template(base_yaml, slots_proto):
"\n Args:\n base_yaml: A string representation of one type job's base yaml.\n slots_proto: A proto map object representation of modification\n template's operable smallest units.\n Returns:\n string: A yaml_template\n "
slo... | 7,733,384,208,342,072,000 | Args:
base_yaml: A string representation of one type job's base yaml.
slots_proto: A proto map object representation of modification
template's operable smallest units.
Returns:
string: A yaml_template | web_console_v2/api/fedlearner_webconsole/workflow_template/slots_formatter.py | generate_yaml_template | duanbing/fedlearner | python | def generate_yaml_template(base_yaml, slots_proto):
"\n Args:\n base_yaml: A string representation of one type job's base yaml.\n slots_proto: A proto map object representation of modification\n template's operable smallest units.\n Returns:\n string: A yaml_template\n "
slo... |
def _create_tensor_from_params(*size, local_device, tensor_init_params: TensorInitParams):
' Helper to construct tensor from size, device and common params. '
create_op = tensor_init_params.create_op
dtype = tensor_init_params.tensor_properties.dtype
layout = tensor_init_params.tensor_properties.layout
... | -4,788,187,083,809,758,000 | Helper to construct tensor from size, device and common params. | torch/distributed/_sharded_tensor/api.py | _create_tensor_from_params | dannis999/tensorflow | python | def _create_tensor_from_params(*size, local_device, tensor_init_params: TensorInitParams):
' '
create_op = tensor_init_params.create_op
dtype = tensor_init_params.tensor_properties.dtype
layout = tensor_init_params.tensor_properties.layout
requires_grad = tensor_init_params.tensor_properties.requir... |
def gather(self, dst: int=0, out: Optional[torch.Tensor]=None) -> None:
'\n Creates a full :class:`Tensor` on rank ``dst`` by gathering all shards of the\n sharded tensor.\n\n The API needs to be called on all ranks in SPMD fashion. All ranks should have\n the same ``dst``. ``out`` shoul... | 6,785,489,561,761,985,000 | Creates a full :class:`Tensor` on rank ``dst`` by gathering all shards of the
sharded tensor.
The API needs to be called on all ranks in SPMD fashion. All ranks should have
the same ``dst``. ``out`` should be a tensor of the same size as the overall
size of the sharded tensor on ``dst`` and ``None`` on all other ranks... | torch/distributed/_sharded_tensor/api.py | gather | dannis999/tensorflow | python | def gather(self, dst: int=0, out: Optional[torch.Tensor]=None) -> None:
'\n Creates a full :class:`Tensor` on rank ``dst`` by gathering all shards of the\n sharded tensor.\n\n The API needs to be called on all ranks in SPMD fashion. All ranks should have\n the same ``dst``. ``out`` shoul... |
@classmethod
def _init_from_local_shards_and_global_metadata(cls, local_shards: List[Shard], sharded_tensor_metadata: ShardedTensorMetadata, process_group=None, init_rrefs=False) -> 'ShardedTensor':
'\n Initialize a ShardedTensor with local shards and a global\n ShardedTensorMetadata built on each ran... | 8,566,875,488,481,365,000 | Initialize a ShardedTensor with local shards and a global
ShardedTensorMetadata built on each rank.
Warning: This API is experimental and subject to change. It does
not do cross rank validations, and fully rely on the user
for the correctness of sharded_tensor_metadata on each rank | torch/distributed/_sharded_tensor/api.py | _init_from_local_shards_and_global_metadata | dannis999/tensorflow | python | @classmethod
def _init_from_local_shards_and_global_metadata(cls, local_shards: List[Shard], sharded_tensor_metadata: ShardedTensorMetadata, process_group=None, init_rrefs=False) -> 'ShardedTensor':
'\n Initialize a ShardedTensor with local shards and a global\n ShardedTensorMetadata built on each ran... |
def sharding_spec(self) -> ShardingSpec:
'\n Returns the ShardingSpec for the tensor.\n '
return self._sharding_spec | -8,737,724,293,681,844,000 | Returns the ShardingSpec for the tensor. | torch/distributed/_sharded_tensor/api.py | sharding_spec | dannis999/tensorflow | python | def sharding_spec(self) -> ShardingSpec:
'\n \n '
return self._sharding_spec |
def metadata(self) -> ShardedTensorMetadata:
'\n Returns a :class:`ShardedTensorMetadata` object corresponding to the\n metadata for the entire tensor.\n '
return self._metadata | 8,535,982,073,666,668,000 | Returns a :class:`ShardedTensorMetadata` object corresponding to the
metadata for the entire tensor. | torch/distributed/_sharded_tensor/api.py | metadata | dannis999/tensorflow | python | def metadata(self) -> ShardedTensorMetadata:
'\n Returns a :class:`ShardedTensorMetadata` object corresponding to the\n metadata for the entire tensor.\n '
return self._metadata |
def local_shards(self) -> List[Shard]:
"\n Returns a list of :class:`Shard' corresponding to the\n local shards for this rank. Returns an empty list if the current rank\n does not host any shards for this Tensor.\n "
return self._local_shards | -6,682,747,474,173,311,000 | Returns a list of :class:`Shard' corresponding to the
local shards for this rank. Returns an empty list if the current rank
does not host any shards for this Tensor. | torch/distributed/_sharded_tensor/api.py | local_shards | dannis999/tensorflow | python | def local_shards(self) -> List[Shard]:
"\n Returns a list of :class:`Shard' corresponding to the\n local shards for this rank. Returns an empty list if the current rank\n does not host any shards for this Tensor.\n "
return self._local_shards |
def size(self, dim: int=None) -> Union[(torch.Size, int)]:
'\n Returns a :Union:`[torch.Size, int]` which represents the size of the tensor.\n The dimension can be specified.\n\n Args:\n dim (int, optional): the dimension over which the size represents.\n If specif... | -6,670,305,957,667,188,000 | Returns a :Union:`[torch.Size, int]` which represents the size of the tensor.
The dimension can be specified.
Args:
dim (int, optional): the dimension over which the size represents.
If specified, it returns the size of the given dimension.
If not, it returns a subclass of tuple.
Defaul... | torch/distributed/_sharded_tensor/api.py | size | dannis999/tensorflow | python | def size(self, dim: int=None) -> Union[(torch.Size, int)]:
'\n Returns a :Union:`[torch.Size, int]` which represents the size of the tensor.\n The dimension can be specified.\n\n Args:\n dim (int, optional): the dimension over which the size represents.\n If specif... |
def is_pinned(self) -> bool:
'\n Returns True if the sharded tensor (each local shard) resides in pinned memory.\n '
return self._metadata.tensor_properties.pin_memory | -8,720,569,316,649,941,000 | Returns True if the sharded tensor (each local shard) resides in pinned memory. | torch/distributed/_sharded_tensor/api.py | is_pinned | dannis999/tensorflow | python | def is_pinned(self) -> bool:
'\n \n '
return self._metadata.tensor_properties.pin_memory |
def is_contiguous(self) -> bool:
'\n Returns True if the sharded tensor (each local shard) is contiguous in memory\n in the order specified by memory format.\n '
return (self._metadata.tensor_properties.memory_format == torch.contiguous_format) | -169,953,434,054,276,770 | Returns True if the sharded tensor (each local shard) is contiguous in memory
in the order specified by memory format. | torch/distributed/_sharded_tensor/api.py | is_contiguous | dannis999/tensorflow | python | def is_contiguous(self) -> bool:
'\n Returns True if the sharded tensor (each local shard) is contiguous in memory\n in the order specified by memory format.\n '
return (self._metadata.tensor_properties.memory_format == torch.contiguous_format) |
def remote_shards(self) -> Dict[(int, List[rpc.RRef[Shard]])]:
'\n Returns a Dict[int, RRef] with keys being the RPC rank and values\n being RRefs to shards on that rank. Need to initialize the\n RPC framework for this functionality.\n\n Raises an exception if ShardedTensor was created w... | -8,189,682,645,657,949,000 | Returns a Dict[int, RRef] with keys being the RPC rank and values
being RRefs to shards on that rank. Need to initialize the
RPC framework for this functionality.
Raises an exception if ShardedTensor was created with ``init_rrefs=False`` | torch/distributed/_sharded_tensor/api.py | remote_shards | dannis999/tensorflow | python | def remote_shards(self) -> Dict[(int, List[rpc.RRef[Shard]])]:
'\n Returns a Dict[int, RRef] with keys being the RPC rank and values\n being RRefs to shards on that rank. Need to initialize the\n RPC framework for this functionality.\n\n Raises an exception if ShardedTensor was created w... |
def add_stats(self, a, b):
'\n Add two stats dict that are returned by the process function.\n This is used for multiple files\n :param a: stats dict\n :param b: stats dict\n :return: stats dict\n '
stats = {}
stats['skipped_because_min_length'] = (a['skipped_because_min_... | 5,214,798,530,183,328,000 | Add two stats dict that are returned by the process function.
This is used for multiple files
:param a: stats dict
:param b: stats dict
:return: stats dict | corpus/text_cleaner.py | add_stats | senisioi/Romanian-Transformers | python | def add_stats(self, a, b):
'\n Add two stats dict that are returned by the process function.\n This is used for multiple files\n :param a: stats dict\n :param b: stats dict\n :return: stats dict\n '
stats = {}
stats['skipped_because_min_length'] = (a['skipped_because_min_... |
def run_cardiac_segmentation(img, guide_structure=None, settings=CARDIAC_SETTINGS_DEFAULTS):
'Runs the atlas-based cardiac segmentation\n\n Args:\n img (sitk.Image):\n settings (dict, optional): Dictionary containing settings for algorithm.\n Defaults to default_se... | 1,093,644,460,725,558,900 | Runs the atlas-based cardiac segmentation
Args:
img (sitk.Image):
settings (dict, optional): Dictionary containing settings for algorithm.
Defaults to default_settings.
Returns:
dict: Dictionary containing output of segmentation | platipy/imaging/projects/cardiac/run.py | run_cardiac_segmentation | RadiotherapyAI/platipy | python | def run_cardiac_segmentation(img, guide_structure=None, settings=CARDIAC_SETTINGS_DEFAULTS):
'Runs the atlas-based cardiac segmentation\n\n Args:\n img (sitk.Image):\n settings (dict, optional): Dictionary containing settings for algorithm.\n Defaults to default_se... |
def test_programs(self):
'\n Checks the evaluation of programs\n '
p1 = BasicPrimitive('MAP')
p2 = BasicPrimitive('MAP', type_=PolymorphicType(name='test'))
self.assertTrue((repr(p1) == repr(p2)))
self.assertTrue(p1.typeless_eq(p2))
self.assertFalse(p1.__eq__(p2))
self.assertFa... | -6,552,360,153,264,010,000 | Checks the evaluation of programs | unit_tests_programs.py | test_programs | agissaud/DeepSynth | python | def test_programs(self):
'\n \n '
p1 = BasicPrimitive('MAP')
p2 = BasicPrimitive('MAP', type_=PolymorphicType(name='test'))
self.assertTrue((repr(p1) == repr(p2)))
self.assertTrue(p1.typeless_eq(p2))
self.assertFalse(p1.__eq__(p2))
self.assertFalse((id(p1) == id(p2)))
t0 = ... |
def test_evaluation_from_compressed(self):
'\n Check if evaluation_from_compressed evaluates correctly the programs\n '
N = 20000
deepcoder = DSL(semantics, primitive_types)
type_request = Arrow(List(INT), List(INT))
deepcoder_CFG = deepcoder.DSL_to_CFG(type_request)
deepcoder_PCFG... | -7,977,442,394,043,425,000 | Check if evaluation_from_compressed evaluates correctly the programs | unit_tests_programs.py | test_evaluation_from_compressed | agissaud/DeepSynth | python | def test_evaluation_from_compressed(self):
'\n \n '
N = 20000
deepcoder = DSL(semantics, primitive_types)
type_request = Arrow(List(INT), List(INT))
deepcoder_CFG = deepcoder.DSL_to_CFG(type_request)
deepcoder_PCFG = deepcoder_CFG.CFG_to_Random_PCFG()
gen_a_star = a_star(deepco... |
def prerelease_local_scheme(version):
'\n Return local scheme version unless building on master in CircleCI.\n\n This function returns the local scheme version number\n (e.g. 0.0.0.dev<N>+g<HASH>) unless building on CircleCI for a\n pre-release in which case it ignores the hash and produces a\n PEP44... | -4,038,724,985,312,240,000 | Return local scheme version unless building on master in CircleCI.
This function returns the local scheme version number
(e.g. 0.0.0.dev<N>+g<HASH>) unless building on CircleCI for a
pre-release in which case it ignores the hash and produces a
PEP440 compliant pre-release version number (e.g. 0.0.0.dev<N>). | setup.py | prerelease_local_scheme | abcsFrederick/HistomicsUI | python | def prerelease_local_scheme(version):
'\n Return local scheme version unless building on master in CircleCI.\n\n This function returns the local scheme version number\n (e.g. 0.0.0.dev<N>+g<HASH>) unless building on CircleCI for a\n pre-release in which case it ignores the hash and produces a\n PEP44... |
def on_demand_feature_view(*args, features: Optional[List[Feature]]=None, sources: Optional[Dict[(str, Union[(FeatureView, RequestSource)])]]=None, inputs: Optional[Dict[(str, Union[(FeatureView, RequestSource)])]]=None, schema: Optional[List[Field]]=None, description: str='', tags: Optional[Dict[(str, str)]]=None, own... | 2,463,973,979,159,200,300 | Creates an OnDemandFeatureView object with the given user function as udf.
Args:
features (deprecated): The list of features in the output of the on demand
feature view, after the transformation has been applied.
sources (optional): A map from input source names to the actual input sources,
whi... | sdk/python/feast/on_demand_feature_view.py | on_demand_feature_view | aurobindoc/feast | python | def on_demand_feature_view(*args, features: Optional[List[Feature]]=None, sources: Optional[Dict[(str, Union[(FeatureView, RequestSource)])]]=None, inputs: Optional[Dict[(str, Union[(FeatureView, RequestSource)])]]=None, schema: Optional[List[Field]]=None, description: str=, tags: Optional[Dict[(str, str)]]=None, owner... |
@log_exceptions
def __init__(self, *args, name: Optional[str]=None, features: Optional[List[Feature]]=None, sources: Optional[Dict[(str, Union[(FeatureView, FeatureViewProjection, RequestSource)])]]=None, udf: Optional[MethodType]=None, inputs: Optional[Dict[(str, Union[(FeatureView, FeatureViewProjection, RequestSourc... | -7,160,352,753,140,764,000 | Creates an OnDemandFeatureView object.
Args:
name: The unique name of the on demand feature view.
features (deprecated): The list of features in the output of the on demand
feature view, after the transformation has been applied.
sources (optional): A map from input source names to the actual input... | sdk/python/feast/on_demand_feature_view.py | __init__ | aurobindoc/feast | python | @log_exceptions
def __init__(self, *args, name: Optional[str]=None, features: Optional[List[Feature]]=None, sources: Optional[Dict[(str, Union[(FeatureView, FeatureViewProjection, RequestSource)])]]=None, udf: Optional[MethodType]=None, inputs: Optional[Dict[(str, Union[(FeatureView, FeatureViewProjection, RequestSourc... |
def to_proto(self) -> OnDemandFeatureViewProto:
'\n Converts an on demand feature view object to its protobuf representation.\n\n Returns:\n A OnDemandFeatureViewProto protobuf.\n '
meta = OnDemandFeatureViewMeta()
if self.created_timestamp:
meta.created_timestamp.Fro... | 3,485,548,422,337,629,000 | Converts an on demand feature view object to its protobuf representation.
Returns:
A OnDemandFeatureViewProto protobuf. | sdk/python/feast/on_demand_feature_view.py | to_proto | aurobindoc/feast | python | def to_proto(self) -> OnDemandFeatureViewProto:
'\n Converts an on demand feature view object to its protobuf representation.\n\n Returns:\n A OnDemandFeatureViewProto protobuf.\n '
meta = OnDemandFeatureViewMeta()
if self.created_timestamp:
meta.created_timestamp.Fro... |
@classmethod
def from_proto(cls, on_demand_feature_view_proto: OnDemandFeatureViewProto):
'\n Creates an on demand feature view from a protobuf representation.\n\n Args:\n on_demand_feature_view_proto: A protobuf representation of an on-demand feature view.\n\n Returns:\n ... | 6,164,696,982,730,159,000 | Creates an on demand feature view from a protobuf representation.
Args:
on_demand_feature_view_proto: A protobuf representation of an on-demand feature view.
Returns:
A OnDemandFeatureView object based on the on-demand feature view protobuf. | sdk/python/feast/on_demand_feature_view.py | from_proto | aurobindoc/feast | python | @classmethod
def from_proto(cls, on_demand_feature_view_proto: OnDemandFeatureViewProto):
'\n Creates an on demand feature view from a protobuf representation.\n\n Args:\n on_demand_feature_view_proto: A protobuf representation of an on-demand feature view.\n\n Returns:\n ... |
def infer_features(self):
'\n Infers the set of features associated to this feature view from the input source.\n\n Raises:\n RegistryInferenceFailure: The set of features could not be inferred.\n '
df = pd.DataFrame()
for feature_view_projection in self.source_feature_view_p... | 251,879,823,335,674,460 | Infers the set of features associated to this feature view from the input source.
Raises:
RegistryInferenceFailure: The set of features could not be inferred. | sdk/python/feast/on_demand_feature_view.py | infer_features | aurobindoc/feast | python | def infer_features(self):
'\n Infers the set of features associated to this feature view from the input source.\n\n Raises:\n RegistryInferenceFailure: The set of features could not be inferred.\n '
df = pd.DataFrame()
for feature_view_projection in self.source_feature_view_p... |
def initUI(self):
' Инициализируем содержимое окна '
self.sub_objs = QtWidgets.QListWidget()
for obj in self.__obj.sub_objects:
a = QtWidgets.QListWidgetItem()
a.sub_obj = obj
a.setText(obj.name)
self.sub_objs.addItem(a)
self.form = QtWidgets.QFormLayout()
self.form.a... | 5,570,166,808,828,233,000 | Инициализируем содержимое окна | src/gui/SubVision.py | initUI | bochkovoi/AHP | python | def initUI(self):
' '
self.sub_objs = QtWidgets.QListWidget()
for obj in self.__obj.sub_objects:
a = QtWidgets.QListWidgetItem()
a.sub_obj = obj
a.setText(obj.name)
self.sub_objs.addItem(a)
self.form = QtWidgets.QFormLayout()
self.form.addRow(self.sub_objs)
self.... |
@staticmethod
def extract_intent_and_entities(user_input):
'Parse the user input using regexes to extract intent & entities.'
prefixes = re.escape(RegexInterpreter.allowed_prefixes())
m = re.search((('^[' + prefixes) + ']?([^{]+)([{].+)?'), user_input)
if (m is not None):
event_name = m.group(1)... | 6,407,435,312,694,949,000 | Parse the user input using regexes to extract intent & entities. | rasa_core/interpreter.py | extract_intent_and_entities | RocketChat/rasa_core | python | @staticmethod
def extract_intent_and_entities(user_input):
prefixes = re.escape(RegexInterpreter.allowed_prefixes())
m = re.search((('^[' + prefixes) + ']?([^{]+)([{].+)?'), user_input)
if (m is not None):
event_name = m.group(1).strip()
entities = RegexInterpreter._parse_parameters(m.g... |
@staticmethod
def deprecated_extraction(user_input):
'DEPRECATED parse of user input message.'
value_assign_rx = '\\s*(.+)\\s*=\\s*(.+)\\s*'
prefixes = re.escape(RegexInterpreter.allowed_prefixes())
structured_message_rx = (('^[' + prefixes) + ']?([^\\[]+)(\\[(.+)\\])?')
m = re.search(structured_mes... | 1,870,368,407,113,227,800 | DEPRECATED parse of user input message. | rasa_core/interpreter.py | deprecated_extraction | RocketChat/rasa_core | python | @staticmethod
def deprecated_extraction(user_input):
value_assign_rx = '\\s*(.+)\\s*=\\s*(.+)\\s*'
prefixes = re.escape(RegexInterpreter.allowed_prefixes())
structured_message_rx = (('^[' + prefixes) + ']?([^\\[]+)(\\[(.+)\\])?')
m = re.search(structured_message_rx, user_input)
if (m is not Non... |
@staticmethod
def is_using_deprecated_format(text):
'Indicates if the text string is using the deprecated intent format.\n\n In the deprecated format entities where annotated using `[name=Rasa]`\n which has been replaced with `{"name": "Rasa"}`.'
return ((text.find('[') != (- 1)) and ((text.find('... | -736,614,347,310,115,300 | Indicates if the text string is using the deprecated intent format.
In the deprecated format entities where annotated using `[name=Rasa]`
which has been replaced with `{"name": "Rasa"}`. | rasa_core/interpreter.py | is_using_deprecated_format | RocketChat/rasa_core | python | @staticmethod
def is_using_deprecated_format(text):
'Indicates if the text string is using the deprecated intent format.\n\n In the deprecated format entities where annotated using `[name=Rasa]`\n which has been replaced with `{"name": "Rasa"}`.'
return ((text.find('[') != (- 1)) and ((text.find('... |
def parse(self, text):
'Parse a text message.'
if self.is_using_deprecated_format(text):
(intent, entities) = self.deprecated_extraction(text)
else:
(intent, entities) = self.extract_intent_and_entities(text)
return {'text': text, 'intent': {'name': intent, 'confidence': 1.0}, 'intent_ra... | 4,211,144,143,960,487,000 | Parse a text message. | rasa_core/interpreter.py | parse | RocketChat/rasa_core | python | def parse(self, text):
if self.is_using_deprecated_format(text):
(intent, entities) = self.deprecated_extraction(text)
else:
(intent, entities) = self.extract_intent_and_entities(text)
return {'text': text, 'intent': {'name': intent, 'confidence': 1.0}, 'intent_ranking': [{'name': inten... |
def parse(self, text):
'Parse a text message.\n\n Return a default value if the parsing of the text failed.'
default_return = {'intent': {'name': '', 'confidence': 0.0}, 'entities': [], 'text': ''}
result = self._rasa_http_parse(text)
return (result if (result is not None) else default_return) | 4,051,425,145,987,794,000 | Parse a text message.
Return a default value if the parsing of the text failed. | rasa_core/interpreter.py | parse | RocketChat/rasa_core | python | def parse(self, text):
'Parse a text message.\n\n Return a default value if the parsing of the text failed.'
default_return = {'intent': {'name': , 'confidence': 0.0}, 'entities': [], 'text': }
result = self._rasa_http_parse(text)
return (result if (result is not None) else default_return) |
def _rasa_http_parse(self, text):
'Send a text message to a running rasa NLU http server.\n\n Return `None` on failure.'
if (not self.server):
logger.error("Failed to parse text '{}' using rasa NLU over http. No rasa NLU server specified!".format(text))
return None
params = {'token': ... | 3,105,361,765,552,769,500 | Send a text message to a running rasa NLU http server.
Return `None` on failure. | rasa_core/interpreter.py | _rasa_http_parse | RocketChat/rasa_core | python | def _rasa_http_parse(self, text):
'Send a text message to a running rasa NLU http server.\n\n Return `None` on failure.'
if (not self.server):
logger.error("Failed to parse text '{}' using rasa NLU over http. No rasa NLU server specified!".format(text))
return None
params = {'token': ... |
def parse(self, text):
'Parse a text message.\n\n Return a default value if the parsing of the text failed.'
if (self.lazy_init and (self.interpreter is None)):
self._load_interpreter()
return self.interpreter.parse(text) | 7,794,856,214,773,793,000 | Parse a text message.
Return a default value if the parsing of the text failed. | rasa_core/interpreter.py | parse | RocketChat/rasa_core | python | def parse(self, text):
'Parse a text message.\n\n Return a default value if the parsing of the text failed.'
if (self.lazy_init and (self.interpreter is None)):
self._load_interpreter()
return self.interpreter.parse(text) |
def register_dummy_task(task_name: str, dataset_fn: Callable[([str, str], tf.data.Dataset)], output_feature_names: Sequence[str]=('inputs', 'targets')) -> None:
'Register a dummy task for GetDatasetTest.'
dataset_providers.TaskRegistry.add(task_name, source=dataset_providers.FunctionDataSource(dataset_fn=datase... | 6,762,093,965,352,016,000 | Register a dummy task for GetDatasetTest. | seqio/dataset_providers_test.py | register_dummy_task | 00mjk/seqio | python | def register_dummy_task(task_name: str, dataset_fn: Callable[([str, str], tf.data.Dataset)], output_feature_names: Sequence[str]=('inputs', 'targets')) -> None:
dataset_providers.TaskRegistry.add(task_name, source=dataset_providers.FunctionDataSource(dataset_fn=dataset_fn, splits=['train', 'validation']), prep... |
def sequential_intereave(datasets: Sequence[tf.data.Dataset], rates: Sequence[float], sample_seed: Optional[int]) -> tf.data.Dataset:
'Sample function that simply concatenates two datasets.'
del rates, sample_seed
return datasets[0].concatenate(datasets[1]) | 5,979,708,542,510,301,000 | Sample function that simply concatenates two datasets. | seqio/dataset_providers_test.py | sequential_intereave | 00mjk/seqio | python | def sequential_intereave(datasets: Sequence[tf.data.Dataset], rates: Sequence[float], sample_seed: Optional[int]) -> tf.data.Dataset:
del rates, sample_seed
return datasets[0].concatenate(datasets[1]) |
def next_token_metrics_epoch_end(self, outputs, stage):
'\n Logic for validation & testing epoch end:\n 1) Calculate accuracy@1, accuracy@5, MRR@5\n 2) (in val stage only) Aggregate loss and log metric(s) for ModelCheckpoint\n 3) Log everything to wandb\n '
loss = torch.stack(... | 2,297,948,692,306,093,000 | Logic for validation & testing epoch end:
1) Calculate accuracy@1, accuracy@5, MRR@5
2) (in val stage only) Aggregate loss and log metric(s) for ModelCheckpoint
3) Log everything to wandb | src/model/encoder_decoder_module.py | next_token_metrics_epoch_end | saridormi/commit_message_generation | python | def next_token_metrics_epoch_end(self, outputs, stage):
'\n Logic for validation & testing epoch end:\n 1) Calculate accuracy@1, accuracy@5, MRR@5\n 2) (in val stage only) Aggregate loss and log metric(s) for ModelCheckpoint\n 3) Log everything to wandb\n '
loss = torch.stack(... |
def custom_name_func(testcase_func, param_num, param):
"\n A custom test name function that will ensure that the tests are run such that they're batched with all tests for a\n given data set are run together, avoiding re-reading the data more than necessary. Tests are run in alphabetical\n order, so put the test... | 896,388,110,667,100,500 | A custom test name function that will ensure that the tests are run such that they're batched with all tests for a
given data set are run together, avoiding re-reading the data more than necessary. Tests are run in alphabetical
order, so put the test case first. An alternate option is to right justify the test number (... | tests/testUtils.py | custom_name_func | NPCC-Joe/Radiomics-pyradiomics | python | def custom_name_func(testcase_func, param_num, param):
"\n A custom test name function that will ensure that the tests are run such that they're batched with all tests for a\n given data set are run together, avoiding re-reading the data more than necessary. Tests are run in alphabetical\n order, so put the test... |
def readBaselineFiles(self):
"\n Reads the 'baseline' folder contained in dataDir. All files starting with 'baseline_' are read as baseline files.\n These files should therefore be named as follows: 'baseline_<className>.csv'.\n "
baselineFiles = [fileName for fileName in os.listdir(self._baselineDir) ... | 3,192,976,214,395,778,000 | Reads the 'baseline' folder contained in dataDir. All files starting with 'baseline_' are read as baseline files.
These files should therefore be named as follows: 'baseline_<className>.csv'. | tests/testUtils.py | readBaselineFiles | NPCC-Joe/Radiomics-pyradiomics | python | def readBaselineFiles(self):
"\n Reads the 'baseline' folder contained in dataDir. All files starting with 'baseline_' are read as baseline files.\n These files should therefore be named as follows: 'baseline_<className>.csv'.\n "
baselineFiles = [fileName for fileName in os.listdir(self._baselineDir) ... |
def getTests(self):
'\n Return all the tests for which there are baseline information.\n '
return self._tests | 3,367,122,534,872,929,300 | Return all the tests for which there are baseline information. | tests/testUtils.py | getTests | NPCC-Joe/Radiomics-pyradiomics | python | def getTests(self):
'\n \n '
return self._tests |
def getFeatureNames(self, className, test):
'\n Gets all features for which a baseline value is available for the current class and test case. Returns a list\n containing the feature names (without image type and feature class specifiers, i.e. just the feature name).\n '
if (className not in self._base... | 944,828,873,189,261,000 | Gets all features for which a baseline value is available for the current class and test case. Returns a list
containing the feature names (without image type and feature class specifiers, i.e. just the feature name). | tests/testUtils.py | getFeatureNames | NPCC-Joe/Radiomics-pyradiomics | python | def getFeatureNames(self, className, test):
'\n Gets all features for which a baseline value is available for the current class and test case. Returns a list\n containing the feature names (without image type and feature class specifiers, i.e. just the feature name).\n '
if (className not in self._base... |
def setFeatureClassAndTestCase(self, className, test):
'\n Set testing suite to specified testCase and feature class. Throws an assertion error if either class or test case\n are not recognized. These have to be set here together, as the settings with which the test case has to be loaded\n are defined per ... | -1,088,853,398,139,280,100 | Set testing suite to specified testCase and feature class. Throws an assertion error if either class or test case
are not recognized. These have to be set here together, as the settings with which the test case has to be loaded
are defined per feature class in the baseline (extracted from provenance information).
Only... | tests/testUtils.py | setFeatureClassAndTestCase | NPCC-Joe/Radiomics-pyradiomics | python | def setFeatureClassAndTestCase(self, className, test):
'\n Set testing suite to specified testCase and feature class. Throws an assertion error if either class or test case\n are not recognized. These have to be set here together, as the settings with which the test case has to be loaded\n are defined per ... |
def checkResult(self, featureName, value):
'\n Use utility methods to get and test the results against the expected baseline value for this key.\n '
longName = '_'.join(featureName)
if (value is None):
self._diffs[self._test][longName] = None
self._results[self._test][longName] = None
... | 2,661,342,036,451,224,000 | Use utility methods to get and test the results against the expected baseline value for this key. | tests/testUtils.py | checkResult | NPCC-Joe/Radiomics-pyradiomics | python | def checkResult(self, featureName, value):
'\n \n '
longName = '_'.join(featureName)
if (value is None):
self._diffs[self._test][longName] = None
self._results[self._test][longName] = None
assert (value is not None)
if math.isnan(value):
self._diffs[self._test][longName... |
def writeCSV(self, data, fileName):
"\n Write out data in a csv file.\n Assumes a data structure with:\n\n {'id1' : {'f1':n1, 'f2':n2}, 'id2' : {'f1':n3, 'f2':n4}}\n "
if (len(self._testedSet) > 0):
with open(fileName, 'w') as csvFile:
csvFileWriter = csv.writer(csvFile, lineterm... | -6,234,742,826,333,706,000 | Write out data in a csv file.
Assumes a data structure with:
{'id1' : {'f1':n1, 'f2':n2}, 'id2' : {'f1':n3, 'f2':n4}} | tests/testUtils.py | writeCSV | NPCC-Joe/Radiomics-pyradiomics | python | def writeCSV(self, data, fileName):
"\n Write out data in a csv file.\n Assumes a data structure with:\n\n {'id1' : {'f1':n1, 'f2':n2}, 'id2' : {'f1':n3, 'f2':n4}}\n "
if (len(self._testedSet) > 0):
with open(fileName, 'w') as csvFile:
csvFileWriter = csv.writer(csvFile, lineterm... |
def getTestFeatures(self, test):
'\n Gets all features for which a baseline value is available for the current class and test case. Returns a list\n containing the feature names.\n '
if (test not in self.baseline):
return None
return list(self.baseline[test].keys()) | 6,512,197,557,371,750,000 | Gets all features for which a baseline value is available for the current class and test case. Returns a list
containing the feature names. | tests/testUtils.py | getTestFeatures | NPCC-Joe/Radiomics-pyradiomics | python | def getTestFeatures(self, test):
'\n Gets all features for which a baseline value is available for the current class and test case. Returns a list\n containing the feature names.\n '
if (test not in self.baseline):
return None
return list(self.baseline[test].keys()) |
def __init__(self, **kwargs):
'\n Initializes a new UpdateHttpRedirectDetails object with values from keyword arguments.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param display_name:\n The value to assign to the display... | 6,103,624,177,813,616,000 | Initializes a new UpdateHttpRedirectDetails object with values from keyword arguments.
The following keyword arguments are supported (corresponding to the getters/setters of this class):
:param display_name:
The value to assign to the display_name property of this UpdateHttpRedirectDetails.
:type display_name: str... | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/update_http_redirect_details.py | __init__ | revnav/sandbox | python | def __init__(self, **kwargs):
'\n Initializes a new UpdateHttpRedirectDetails object with values from keyword arguments.\n The following keyword arguments are supported (corresponding to the getters/setters of this class):\n\n :param display_name:\n The value to assign to the display... |
@property
def display_name(self):
'\n Gets the display_name of this UpdateHttpRedirectDetails.\n The user-friendly name of the HTTP Redirect. The name can be changed and does not need to be unique.\n\n\n :return: The display_name of this UpdateHttpRedirectDetails.\n :rtype: str\n ... | -4,049,829,361,402,219,000 | Gets the display_name of this UpdateHttpRedirectDetails.
The user-friendly name of the HTTP Redirect. The name can be changed and does not need to be unique.
:return: The display_name of this UpdateHttpRedirectDetails.
:rtype: str | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/update_http_redirect_details.py | display_name | revnav/sandbox | python | @property
def display_name(self):
'\n Gets the display_name of this UpdateHttpRedirectDetails.\n The user-friendly name of the HTTP Redirect. The name can be changed and does not need to be unique.\n\n\n :return: The display_name of this UpdateHttpRedirectDetails.\n :rtype: str\n ... |
@display_name.setter
def display_name(self, display_name):
'\n Sets the display_name of this UpdateHttpRedirectDetails.\n The user-friendly name of the HTTP Redirect. The name can be changed and does not need to be unique.\n\n\n :param display_name: The display_name of this UpdateHttpRedirectDe... | 937,187,494,521,535,200 | Sets the display_name of this UpdateHttpRedirectDetails.
The user-friendly name of the HTTP Redirect. The name can be changed and does not need to be unique.
:param display_name: The display_name of this UpdateHttpRedirectDetails.
:type: str | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/update_http_redirect_details.py | display_name | revnav/sandbox | python | @display_name.setter
def display_name(self, display_name):
'\n Sets the display_name of this UpdateHttpRedirectDetails.\n The user-friendly name of the HTTP Redirect. The name can be changed and does not need to be unique.\n\n\n :param display_name: The display_name of this UpdateHttpRedirectDe... |
@property
def target(self):
'\n Gets the target of this UpdateHttpRedirectDetails.\n The redirect target object including all the redirect data.\n\n\n :return: The target of this UpdateHttpRedirectDetails.\n :rtype: HttpRedirectTarget\n '
return self._target | 5,426,157,337,298,315,000 | Gets the target of this UpdateHttpRedirectDetails.
The redirect target object including all the redirect data.
:return: The target of this UpdateHttpRedirectDetails.
:rtype: HttpRedirectTarget | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/update_http_redirect_details.py | target | revnav/sandbox | python | @property
def target(self):
'\n Gets the target of this UpdateHttpRedirectDetails.\n The redirect target object including all the redirect data.\n\n\n :return: The target of this UpdateHttpRedirectDetails.\n :rtype: HttpRedirectTarget\n '
return self._target |
@target.setter
def target(self, target):
'\n Sets the target of this UpdateHttpRedirectDetails.\n The redirect target object including all the redirect data.\n\n\n :param target: The target of this UpdateHttpRedirectDetails.\n :type: HttpRedirectTarget\n '
self._target = targe... | -3,774,355,794,326,944,000 | Sets the target of this UpdateHttpRedirectDetails.
The redirect target object including all the redirect data.
:param target: The target of this UpdateHttpRedirectDetails.
:type: HttpRedirectTarget | darling_ansible/python_venv/lib/python3.7/site-packages/oci/waas/models/update_http_redirect_details.py | target | revnav/sandbox | python | @target.setter
def target(self, target):
'\n Sets the target of this UpdateHttpRedirectDetails.\n The redirect target object including all the redirect data.\n\n\n :param target: The target of this UpdateHttpRedirectDetails.\n :type: HttpRedirectTarget\n '
self._target = targe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.