body_hash
stringlengths
64
64
body
stringlengths
23
109k
docstring
stringlengths
1
57k
path
stringlengths
4
198
name
stringlengths
1
115
repository_name
stringlengths
7
111
repository_stars
float64
0
191k
lang
stringclasses
1 value
body_without_docstring
stringlengths
14
108k
unified
stringlengths
45
133k
cc3b903a59f7100d89b1f7083c543b3f7b9c96bfad32dd9a0bbdbbe1953cdb48
def extract_cumulative_freq_by_rank(self, hits): '\n Process search results that contain buckets with frequency rank. Each\n bucket contains the total frequency of a word of a given frequency rank.\n Buckets should be ordered by frequency rank.\n Return a dictionary of the kind {frequenc...
Process search results that contain buckets with frequency rank. Each bucket contains the total frequency of a word of a given frequency rank. Buckets should be ordered by frequency rank. Return a dictionary of the kind {frequency rank: total frequency of the words whose rank is less or equal to this rank}.
search/web_app/response_processors.py
extract_cumulative_freq_by_rank
gisly/evenki-corpus
0
python
def extract_cumulative_freq_by_rank(self, hits): '\n Process search results that contain buckets with frequency rank. Each\n bucket contains the total frequency of a word of a given frequency rank.\n Buckets should be ordered by frequency rank.\n Return a dictionary of the kind {frequenc...
def extract_cumulative_freq_by_rank(self, hits): '\n Process search results that contain buckets with frequency rank. Each\n bucket contains the total frequency of a word of a given frequency rank.\n Buckets should be ordered by frequency rank.\n Return a dictionary of the kind {frequenc...
4f88b4f7042f3c4c43d54d56ae130dea91f61704fe6577b3aaaca66c4f1b968a
async def message_update_middleware(self, payload: GatewayDispatch): '\n Middleware for ``on_message_update`` event,\n generate a class for the message that has been updated.\n\n :param self:\n The current client.\n\n :param payload:\n The data received from the message update event.\n...
Middleware for ``on_message_update`` event, generate a class for the message that has been updated. :param self: The current client. :param payload: The data received from the message update event.
pincer/middleware/message_update.py
message_update_middleware
gillesigot/Pincer
0
python
async def message_update_middleware(self, payload: GatewayDispatch): '\n Middleware for ``on_message_update`` event,\n generate a class for the message that has been updated.\n\n :param self:\n The current client.\n\n :param payload:\n The data received from the message update event.\n...
async def message_update_middleware(self, payload: GatewayDispatch): '\n Middleware for ``on_message_update`` event,\n generate a class for the message that has been updated.\n\n :param self:\n The current client.\n\n :param payload:\n The data received from the message update event.\n...
8bd1a71cbc3d79b3d13fd719dfcc63820a3e7b4e846a888096d1a7277aa6f171
def _smooth_l1_loss_base(bbox_pred, bbox_targets, sigma=1.0): '\n\n :param bbox_pred: [-1, 4] in RPN. [-1, cls_num+1, 4] in Fast-rcnn\n :param bbox_targets: shape is same as bbox_pred\n :param sigma:\n :return:\n ' sigma_2 = (sigma ** 2) box_diff = (bbox_pred - bbox_targets) abs_box_diff ...
:param bbox_pred: [-1, 4] in RPN. [-1, cls_num+1, 4] in Fast-rcnn :param bbox_targets: shape is same as bbox_pred :param sigma: :return:
libs/losses/losses.py
_smooth_l1_loss_base
gbyy422990/FPN_with_GIOU_loss
0
python
def _smooth_l1_loss_base(bbox_pred, bbox_targets, sigma=1.0): '\n\n :param bbox_pred: [-1, 4] in RPN. [-1, cls_num+1, 4] in Fast-rcnn\n :param bbox_targets: shape is same as bbox_pred\n :param sigma:\n :return:\n ' sigma_2 = (sigma ** 2) box_diff = (bbox_pred - bbox_targets) abs_box_diff ...
def _smooth_l1_loss_base(bbox_pred, bbox_targets, sigma=1.0): '\n\n :param bbox_pred: [-1, 4] in RPN. [-1, cls_num+1, 4] in Fast-rcnn\n :param bbox_targets: shape is same as bbox_pred\n :param sigma:\n :return:\n ' sigma_2 = (sigma ** 2) box_diff = (bbox_pred - bbox_targets) abs_box_diff ...
0c7625d8886566d401aef049b59cbb594ea2ebc328d40d6768a9535faae071ed
def smooth_l1_loss_rpn(bbox_pred, bbox_targets, label, sigma=1.0): '\n\n :param bbox_pred: [-1, 4]\n :param bbox_targets: [-1, 4]\n :param label: [-1]\n :param sigma:\n :return:\n ' value = giou_loss(bbox_pred, bbox_targets) print('*************************************') print('value: ...
:param bbox_pred: [-1, 4] :param bbox_targets: [-1, 4] :param label: [-1] :param sigma: :return:
libs/losses/losses.py
smooth_l1_loss_rpn
gbyy422990/FPN_with_GIOU_loss
0
python
def smooth_l1_loss_rpn(bbox_pred, bbox_targets, label, sigma=1.0): '\n\n :param bbox_pred: [-1, 4]\n :param bbox_targets: [-1, 4]\n :param label: [-1]\n :param sigma:\n :return:\n ' value = giou_loss(bbox_pred, bbox_targets) print('*************************************') print('value: ...
def smooth_l1_loss_rpn(bbox_pred, bbox_targets, label, sigma=1.0): '\n\n :param bbox_pred: [-1, 4]\n :param bbox_targets: [-1, 4]\n :param label: [-1]\n :param sigma:\n :return:\n ' value = giou_loss(bbox_pred, bbox_targets) print('*************************************') print('value: ...
ecf94bf40ed11da699d6fee0d668763b73b544d0d33d6c2da626b34ecf6f84a7
def smooth_l1_loss_rcnn(bbox_pred, bbox_targets, label, num_classes, sigma=1.0): '\n\n :param bbox_pred: [-1, (cfgs.CLS_NUM +1) * 4]\n :param bbox_targets:[-1, (cfgs.CLS_NUM +1) * 4]\n :param label:[-1]\n :param num_classes:\n :param sigma:\n :return:\n ' outside_mask = tf.stop_gradient(tf....
:param bbox_pred: [-1, (cfgs.CLS_NUM +1) * 4] :param bbox_targets:[-1, (cfgs.CLS_NUM +1) * 4] :param label:[-1] :param num_classes: :param sigma: :return:
libs/losses/losses.py
smooth_l1_loss_rcnn
gbyy422990/FPN_with_GIOU_loss
0
python
def smooth_l1_loss_rcnn(bbox_pred, bbox_targets, label, num_classes, sigma=1.0): '\n\n :param bbox_pred: [-1, (cfgs.CLS_NUM +1) * 4]\n :param bbox_targets:[-1, (cfgs.CLS_NUM +1) * 4]\n :param label:[-1]\n :param num_classes:\n :param sigma:\n :return:\n ' outside_mask = tf.stop_gradient(tf....
def smooth_l1_loss_rcnn(bbox_pred, bbox_targets, label, num_classes, sigma=1.0): '\n\n :param bbox_pred: [-1, (cfgs.CLS_NUM +1) * 4]\n :param bbox_targets:[-1, (cfgs.CLS_NUM +1) * 4]\n :param label:[-1]\n :param num_classes:\n :param sigma:\n :return:\n ' outside_mask = tf.stop_gradient(tf....
560405bb24d8d8af5456ff2021d1022eca1880b686a6ae07b49b6eafb035f846
def assym_dist(a, b): 'Calculates assymetric editor distance between a and b' (n, m) = (len(a), len(b)) current_row = range((n + 1)) zeros = ([0] * (n + 1)) res = np.inf for i in range(1, (m + 1)): (previous_row, current_row) = (current_row, zeros) for j in range(1, (n + 1)): ...
Calculates assymetric editor distance between a and b
wiki_pubmed_fuzzy/utils.py
assym_dist
elvirakinzina/Disease-ontology
3
python
def assym_dist(a, b): (n, m) = (len(a), len(b)) current_row = range((n + 1)) zeros = ([0] * (n + 1)) res = np.inf for i in range(1, (m + 1)): (previous_row, current_row) = (current_row, zeros) for j in range(1, (n + 1)): (add, delete, change) = ((previous_row[j] + 1)...
def assym_dist(a, b): (n, m) = (len(a), len(b)) current_row = range((n + 1)) zeros = ([0] * (n + 1)) res = np.inf for i in range(1, (m + 1)): (previous_row, current_row) = (current_row, zeros) for j in range(1, (n + 1)): (add, delete, change) = ((previous_row[j] + 1)...
0cc28011a22fb6d5c12bac76a5a8babdc88071335a05095c424ff6285417876a
def test_help(): ' Simple sanity check for -h option of run_benchmark.py. ' sys.argv = ['dummy.py', '-h'] with pytest.raises(SystemExit) as e: result = rb.main() assert (e.type == SystemExit) assert (e.value.code == 0)
Simple sanity check for -h option of run_benchmark.py.
tests/test.py
test_help
JanDorniak99/pmemkv-bench
0
python
def test_help(): ' ' sys.argv = ['dummy.py', '-h'] with pytest.raises(SystemExit) as e: result = rb.main() assert (e.type == SystemExit) assert (e.value.code == 0)
def test_help(): ' ' sys.argv = ['dummy.py', '-h'] with pytest.raises(SystemExit) as e: result = rb.main() assert (e.type == SystemExit) assert (e.value.code == 0)<|docstring|>Simple sanity check for -h option of run_benchmark.py.<|endoftext|>
ba2a01d4892b33e555f6c31cb9cbcc35baa92ff791823c3495b52b801a1304a8
def test_json(): 'Basic integration test for run_benchmark.py. It runs full\n benchmarking process for arbitrarily chosen parameters.\n ' build_configuration = {'db_bench': {'repo_url': project_path, 'commit': 'HEAD', 'env': {}}, 'pmemkv': {'repo_url': 'https://github.com/pmem/pmemkv.git', 'commit': 'HEAD...
Basic integration test for run_benchmark.py. It runs full benchmarking process for arbitrarily chosen parameters.
tests/test.py
test_json
JanDorniak99/pmemkv-bench
0
python
def test_json(): 'Basic integration test for run_benchmark.py. It runs full\n benchmarking process for arbitrarily chosen parameters.\n ' build_configuration = {'db_bench': {'repo_url': project_path, 'commit': 'HEAD', 'env': {}}, 'pmemkv': {'repo_url': 'https://github.com/pmem/pmemkv.git', 'commit': 'HEAD...
def test_json(): 'Basic integration test for run_benchmark.py. It runs full\n benchmarking process for arbitrarily chosen parameters.\n ' build_configuration = {'db_bench': {'repo_url': project_path, 'commit': 'HEAD', 'env': {}}, 'pmemkv': {'repo_url': 'https://github.com/pmem/pmemkv.git', 'commit': 'HEAD...
3941211195ffa32a64238e36305bcae9bc457750206fe4d8518e8f84925ee4ea
def _convert_dataset(dataset_split): 'Converts the specified dataset split to TFRecord format.\n\n Args:\n dataset_split: The dataset split (e.g., train, test).\n\n Raises:\n RuntimeError: If loaded image and label have different shape.\n ' dataset = os.path.basename(dataset_split)[:(- 4)] filename...
Converts the specified dataset split to TFRecord format. Args: dataset_split: The dataset split (e.g., train, test). Raises: RuntimeError: If loaded image and label have different shape.
datasets/build_people_segmentation.py
_convert_dataset
macqueen09/mobile-deeplab-v3-plusplus
166
python
def _convert_dataset(dataset_split): 'Converts the specified dataset split to TFRecord format.\n\n Args:\n dataset_split: The dataset split (e.g., train, test).\n\n Raises:\n RuntimeError: If loaded image and label have different shape.\n ' dataset = os.path.basename(dataset_split)[:(- 4)] filename...
def _convert_dataset(dataset_split): 'Converts the specified dataset split to TFRecord format.\n\n Args:\n dataset_split: The dataset split (e.g., train, test).\n\n Raises:\n RuntimeError: If loaded image and label have different shape.\n ' dataset = os.path.basename(dataset_split)[:(- 4)] filename...
0848d762b56cf0f7faae85414dc09cbb6da847d95e34af0c20df5fc5aadb072d
def main(): '\n Initiates pytest in repo-health mode\n ' checks_dir = Path(__file__).parent.parent.absolute() flags = ['--noconftest', '--repo-health', '--repo-health-path', str(checks_dir)] flags.extend(sys.argv[1:]) pytest.main(flags)
Initiates pytest in repo-health mode
scripts/run_checks.py
main
ifinanceCanada/edx-repo-health
2
python
def main(): '\n \n ' checks_dir = Path(__file__).parent.parent.absolute() flags = ['--noconftest', '--repo-health', '--repo-health-path', str(checks_dir)] flags.extend(sys.argv[1:]) pytest.main(flags)
def main(): '\n \n ' checks_dir = Path(__file__).parent.parent.absolute() flags = ['--noconftest', '--repo-health', '--repo-health-path', str(checks_dir)] flags.extend(sys.argv[1:]) pytest.main(flags)<|docstring|>Initiates pytest in repo-health mode<|endoftext|>
bd52b242b9f78809e54beb17501b807191deeea5841c5ba67a98b56edd6c43c9
def load_thunders2db(thunderstorms: Iterable[Thunder]): 'Add thunderstorms to database\n\n Parameters\n ----------\n thunderstorms : iterable\n collection of thunderstorms\n ' logging.info('Start load thunderstorm data to db...') new_thunders_count = 0 with Session() as session: ...
Add thunderstorms to database Parameters ---------- thunderstorms : iterable collection of thunderstorms
lightnings/meteodata/database.py
load_thunders2db
DavydovDmitry/lightnings
2
python
def load_thunders2db(thunderstorms: Iterable[Thunder]): 'Add thunderstorms to database\n\n Parameters\n ----------\n thunderstorms : iterable\n collection of thunderstorms\n ' logging.info('Start load thunderstorm data to db...') new_thunders_count = 0 with Session() as session: ...
def load_thunders2db(thunderstorms: Iterable[Thunder]): 'Add thunderstorms to database\n\n Parameters\n ----------\n thunderstorms : iterable\n collection of thunderstorms\n ' logging.info('Start load thunderstorm data to db...') new_thunders_count = 0 with Session() as session: ...
35e8265340d9d628993f4783037da87f13873f9f37816d41d9bda9627edcdb98
def test_user_fields(self): 'Test User fields when created' user = User.objects.get(username='testuser') self.assertEqual(user.username, 'testuser') self.assertEqual(user.email, 'example@example.com') self.assertEqual(user.password, 'testpass000')
Test User fields when created
registration/tests/test_models.py
test_user_fields
ht-90/wisdom
1
python
def test_user_fields(self): user = User.objects.get(username='testuser') self.assertEqual(user.username, 'testuser') self.assertEqual(user.email, 'example@example.com') self.assertEqual(user.password, 'testpass000')
def test_user_fields(self): user = User.objects.get(username='testuser') self.assertEqual(user.username, 'testuser') self.assertEqual(user.email, 'example@example.com') self.assertEqual(user.password, 'testpass000')<|docstring|>Test User fields when created<|endoftext|>
d8f103441454448e3666e8bd4958230679061b8ee103f3f9cdd190cda5a6b0e9
def test_user_status(self): 'Test User is active when User object is added' user = User.objects.get(username='testuser') self.assertTrue(user.is_active)
Test User is active when User object is added
registration/tests/test_models.py
test_user_status
ht-90/wisdom
1
python
def test_user_status(self): user = User.objects.get(username='testuser') self.assertTrue(user.is_active)
def test_user_status(self): user = User.objects.get(username='testuser') self.assertTrue(user.is_active)<|docstring|>Test User is active when User object is added<|endoftext|>
0f71ec0f9a09be53bc19c8f7685802935e702b2f3178967f0d31e34aba6e7b16
def get_table_name(prefix): 'get unique table name' return ((prefix + '_') + str(int(time.time())))
get unique table name
tests/operators/utils.py
get_table_name
kaxil/astro
0
python
def get_table_name(prefix): return ((prefix + '_') + str(int(time.time())))
def get_table_name(prefix): return ((prefix + '_') + str(int(time.time())))<|docstring|>get unique table name<|endoftext|>
5a9dc49b1cfce0bed6fab7ccfca942e6d5cb9829e497e02dce9d89dd0ef58c99
def get_file_from_url(input_str, temp_folder): 'Get a file from a URL -- return the downloaded filepath.' logging.info('Getting file from {}'.format(input_str)) filename = input_str.split('/')[(- 1)] local_path = os.path.join(temp_folder, filename) logging.info(('Filename: ' + filename)) logging...
Get a file from a URL -- return the downloaded filepath.
diamond-tax.py
get_file_from_url
FredHutch/FAMLI
14
python
def get_file_from_url(input_str, temp_folder): logging.info('Getting file from {}'.format(input_str)) filename = input_str.split('/')[(- 1)] local_path = os.path.join(temp_folder, filename) logging.info(('Filename: ' + filename)) logging.info(('Local path: ' + local_path)) if (not input_str...
def get_file_from_url(input_str, temp_folder): logging.info('Getting file from {}'.format(input_str)) filename = input_str.split('/')[(- 1)] local_path = os.path.join(temp_folder, filename) logging.info(('Filename: ' + filename)) logging.info(('Local path: ' + local_path)) if (not input_str...
c8be629ab14152c752f4c20b5b09201798d67ec98e30819c21fe6b21d9292a56
def run_cmds(commands, retry=0, catchExcept=False, stdout=None): 'Run commands and write out the log, combining STDOUT & STDERR.' logging.info('Commands:') logging.info(' '.join(commands)) if (stdout is None): p = subprocess.Popen(commands, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ...
Run commands and write out the log, combining STDOUT & STDERR.
diamond-tax.py
run_cmds
FredHutch/FAMLI
14
python
def run_cmds(commands, retry=0, catchExcept=False, stdout=None): logging.info('Commands:') logging.info(' '.join(commands)) if (stdout is None): p = subprocess.Popen(commands, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) (stdout, stderr) = p.communicate() else: with ope...
def run_cmds(commands, retry=0, catchExcept=False, stdout=None): logging.info('Commands:') logging.info(' '.join(commands)) if (stdout is None): p = subprocess.Popen(commands, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) (stdout, stderr) = p.communicate() else: with ope...
990708a415ea886a73d92e69c2715d63f17006e55e2343be4747c3fa8e6fea1f
def cull_files(self, data_files): '\n Peek at the first/last entries in the file(s) and return only the files\n that contain data between the start/stop timestamps.\n ' if (not isinstance(data_files, list)): data_files = [data_files] logging.info('Culling file list') culled_...
Peek at the first/last entries in the file(s) and return only the files that contain data between the start/stop timestamps.
misc/filecrop_utility.py
cull_files
WHOIGit/ndsf-sealog-server
4
python
def cull_files(self, data_files): '\n Peek at the first/last entries in the file(s) and return only the files\n that contain data between the start/stop timestamps.\n ' if (not isinstance(data_files, list)): data_files = [data_files] logging.info('Culling file list') culled_...
def cull_files(self, data_files): '\n Peek at the first/last entries in the file(s) and return only the files\n that contain data between the start/stop timestamps.\n ' if (not isinstance(data_files, list)): data_files = [data_files] logging.info('Culling file list') culled_...
fc0f2bfcf34fecc5b7bb66369a654ad8ba86e936176cc38a88a88a9324b6683d
def crop_file_data(self, data_files): '\n Read the file(s) and return on the data from between the start/stop\n timestamps.\n ' logging.info('Cropping file data') if (not isinstance(data_files, list)): data_files = [data_files] for data_file in data_files: logging.de...
Read the file(s) and return on the data from between the start/stop timestamps.
misc/filecrop_utility.py
crop_file_data
WHOIGit/ndsf-sealog-server
4
python
def crop_file_data(self, data_files): '\n Read the file(s) and return on the data from between the start/stop\n timestamps.\n ' logging.info('Cropping file data') if (not isinstance(data_files, list)): data_files = [data_files] for data_file in data_files: logging.de...
def crop_file_data(self, data_files): '\n Read the file(s) and return on the data from between the start/stop\n timestamps.\n ' logging.info('Cropping file data') if (not isinstance(data_files, list)): data_files = [data_files] for data_file in data_files: logging.de...
b5855263baf4e2209fd1aabc636e511484fea18c090e4eed9d8f61c81ffc98c2
@pytest.fixture(scope='session') def salt_factories_config(): '\n Return a dictionary with the keyworkd arguments for FactoriesManager\n ' return {'code_dir': str(PACKAGE_ROOT), 'inject_coverage': ('COVERAGE_PROCESS_START' in os.environ), 'inject_sitecustomize': ('COVERAGE_PROCESS_START' in os.environ), '...
Return a dictionary with the keyworkd arguments for FactoriesManager
tests/conftest.py
salt_factories_config
cheburakshu/salt-ext-modules-vmware
1
python
@pytest.fixture(scope='session') def salt_factories_config(): '\n \n ' return {'code_dir': str(PACKAGE_ROOT), 'inject_coverage': ('COVERAGE_PROCESS_START' in os.environ), 'inject_sitecustomize': ('COVERAGE_PROCESS_START' in os.environ), 'start_timeout': (120 if os.environ.get('CI') else 60)}
@pytest.fixture(scope='session') def salt_factories_config(): '\n \n ' return {'code_dir': str(PACKAGE_ROOT), 'inject_coverage': ('COVERAGE_PROCESS_START' in os.environ), 'inject_sitecustomize': ('COVERAGE_PROCESS_START' in os.environ), 'start_timeout': (120 if os.environ.get('CI') else 60)}<|docstring|>R...
ee884022e9924f88d93a09c529d385527d8cde61c5a661a9890249d7f0e7a734
def __init__(self, vibrational_integrals: list[VibrationalIntegrals], truncation_order: Optional[int]=None, basis: Optional[VibrationalBasis]=None) -> None: '\n Args:\n vibrational_integrals: a list of\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.Vib...
Args: vibrational_integrals: a list of :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals`. truncation_order: an optional truncation order for the highest number of body terms to include in the constructed Hamiltonian. basis: the :class:`...
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
__init__
jvscursulim/qiskit-nature
1
python
def __init__(self, vibrational_integrals: list[VibrationalIntegrals], truncation_order: Optional[int]=None, basis: Optional[VibrationalBasis]=None) -> None: '\n Args:\n vibrational_integrals: a list of\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.Vib...
def __init__(self, vibrational_integrals: list[VibrationalIntegrals], truncation_order: Optional[int]=None, basis: Optional[VibrationalBasis]=None) -> None: '\n Args:\n vibrational_integrals: a list of\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.Vib...
e97236c82d8399e5d2b6a7bee83b97a8969ee4d0ea0261570ff3b4c055c1e283
@property def truncation_order(self) -> int: 'Returns the truncation order.' return self._truncation_order
Returns the truncation order.
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
truncation_order
jvscursulim/qiskit-nature
1
python
@property def truncation_order(self) -> int: return self._truncation_order
@property def truncation_order(self) -> int: return self._truncation_order<|docstring|>Returns the truncation order.<|endoftext|>
b2b1f4704e631992545e01c6a9dff41f05a8c788e49440c03610a7acfea7016a
@truncation_order.setter def truncation_order(self, truncation_order: int) -> None: 'Sets the truncation order.' self._truncation_order = truncation_order
Sets the truncation order.
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
truncation_order
jvscursulim/qiskit-nature
1
python
@truncation_order.setter def truncation_order(self, truncation_order: int) -> None: self._truncation_order = truncation_order
@truncation_order.setter def truncation_order(self, truncation_order: int) -> None: self._truncation_order = truncation_order<|docstring|>Sets the truncation order.<|endoftext|>
9829f51bdfd11d28660367cd69926df884df4c2a71a5e038c7b02522616cda78
def to_hdf5(self, parent: h5py.Group) -> None: 'Stores this instance in an HDF5 group inside of the provided parent group.\n\n See also :func:`~qiskit_nature.hdf5.HDF5Storable.to_hdf5` for more details.\n\n Args:\n parent: the parent HDF5 group.\n ' super().to_hdf5(parent) gr...
Stores this instance in an HDF5 group inside of the provided parent group. See also :func:`~qiskit_nature.hdf5.HDF5Storable.to_hdf5` for more details. Args: parent: the parent HDF5 group.
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
to_hdf5
jvscursulim/qiskit-nature
1
python
def to_hdf5(self, parent: h5py.Group) -> None: 'Stores this instance in an HDF5 group inside of the provided parent group.\n\n See also :func:`~qiskit_nature.hdf5.HDF5Storable.to_hdf5` for more details.\n\n Args:\n parent: the parent HDF5 group.\n ' super().to_hdf5(parent) gr...
def to_hdf5(self, parent: h5py.Group) -> None: 'Stores this instance in an HDF5 group inside of the provided parent group.\n\n See also :func:`~qiskit_nature.hdf5.HDF5Storable.to_hdf5` for more details.\n\n Args:\n parent: the parent HDF5 group.\n ' super().to_hdf5(parent) gr...
18e253279c24b70d2d82d3615f6359bc5def4abea9d9187862373b9ae3e356a6
@staticmethod def from_hdf5(h5py_group: h5py.Group) -> VibrationalEnergy: 'Constructs a new instance from the data stored in the provided HDF5 group.\n\n See also :func:`~qiskit_nature.hdf5.HDF5Storable.from_hdf5` for more details.\n\n Args:\n h5py_group: the HDF5 group from which to load t...
Constructs a new instance from the data stored in the provided HDF5 group. See also :func:`~qiskit_nature.hdf5.HDF5Storable.from_hdf5` for more details. Args: h5py_group: the HDF5 group from which to load the data. Returns: A new instance of this class.
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
from_hdf5
jvscursulim/qiskit-nature
1
python
@staticmethod def from_hdf5(h5py_group: h5py.Group) -> VibrationalEnergy: 'Constructs a new instance from the data stored in the provided HDF5 group.\n\n See also :func:`~qiskit_nature.hdf5.HDF5Storable.from_hdf5` for more details.\n\n Args:\n h5py_group: the HDF5 group from which to load t...
@staticmethod def from_hdf5(h5py_group: h5py.Group) -> VibrationalEnergy: 'Constructs a new instance from the data stored in the provided HDF5 group.\n\n See also :func:`~qiskit_nature.hdf5.HDF5Storable.from_hdf5` for more details.\n\n Args:\n h5py_group: the HDF5 group from which to load t...
88a0c185074fdb6409e2c755ce2531170a565198cd2c94ff950106815c5a267a
@classmethod def from_legacy_driver_result(cls, result: LegacyDriverResult) -> VibrationalEnergy: 'Construct a VibrationalEnergy instance from a\n :class:`~qiskit_nature.drivers.WatsonHamiltonian`.\n\n Args:\n result: the driver result from which to extract the raw data. For this property, ...
Construct a VibrationalEnergy instance from a :class:`~qiskit_nature.drivers.WatsonHamiltonian`. Args: result: the driver result from which to extract the raw data. For this property, a :class:`~qiskit_nature.drivers.WatsonHamiltonian` is required! Returns: An instance of this property. Raises: Q...
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
from_legacy_driver_result
jvscursulim/qiskit-nature
1
python
@classmethod def from_legacy_driver_result(cls, result: LegacyDriverResult) -> VibrationalEnergy: 'Construct a VibrationalEnergy instance from a\n :class:`~qiskit_nature.drivers.WatsonHamiltonian`.\n\n Args:\n result: the driver result from which to extract the raw data. For this property, ...
@classmethod def from_legacy_driver_result(cls, result: LegacyDriverResult) -> VibrationalEnergy: 'Construct a VibrationalEnergy instance from a\n :class:`~qiskit_nature.drivers.WatsonHamiltonian`.\n\n Args:\n result: the driver result from which to extract the raw data. For this property, ...
943efa8da49b875631049ecffd45e5129d13a10ca888f1a225a3448d8e4bffbd
def __iter__(self) -> Generator[(VibrationalIntegrals, None, None)]: 'Returns the generator-iterator method.' return self._generator()
Returns the generator-iterator method.
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
__iter__
jvscursulim/qiskit-nature
1
python
def __iter__(self) -> Generator[(VibrationalIntegrals, None, None)]: return self._generator()
def __iter__(self) -> Generator[(VibrationalIntegrals, None, None)]: return self._generator()<|docstring|>Returns the generator-iterator method.<|endoftext|>
8cac19574fae711ecc48a879df3bb22bf317c9dc4210fcb3c6eb39f5cbb8daa3
def _generator(self) -> Generator[(VibrationalIntegrals, None, None)]: 'A generator-iterator method [1] iterating over all internal ``VibrationalIntegrals``.\n\n [1]: https://docs.python.org/3/reference/expressions.html#generator-iterator-methods\n ' for ints in self._vibrational_integrals.values(...
A generator-iterator method [1] iterating over all internal ``VibrationalIntegrals``. [1]: https://docs.python.org/3/reference/expressions.html#generator-iterator-methods
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
_generator
jvscursulim/qiskit-nature
1
python
def _generator(self) -> Generator[(VibrationalIntegrals, None, None)]: 'A generator-iterator method [1] iterating over all internal ``VibrationalIntegrals``.\n\n [1]: https://docs.python.org/3/reference/expressions.html#generator-iterator-methods\n ' for ints in self._vibrational_integrals.values(...
def _generator(self) -> Generator[(VibrationalIntegrals, None, None)]: 'A generator-iterator method [1] iterating over all internal ``VibrationalIntegrals``.\n\n [1]: https://docs.python.org/3/reference/expressions.html#generator-iterator-methods\n ' for ints in self._vibrational_integrals.values(...
bfd3cef65837affe404eb0a57bfb64045460b4348808b05b758dfeac9af20ceb
def add_vibrational_integral(self, integral: VibrationalIntegrals) -> None: 'Adds a\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals`\n instance to the internal storage.\n\n Internally, the\n :class:`~qiskit_nature.properties.second_quant...
Adds a :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals` instance to the internal storage. Internally, the :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals` are stored in a dictionary sorted by their number of body terms. T...
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
add_vibrational_integral
jvscursulim/qiskit-nature
1
python
def add_vibrational_integral(self, integral: VibrationalIntegrals) -> None: 'Adds a\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals`\n instance to the internal storage.\n\n Internally, the\n :class:`~qiskit_nature.properties.second_quant...
def add_vibrational_integral(self, integral: VibrationalIntegrals) -> None: 'Adds a\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals`\n instance to the internal storage.\n\n Internally, the\n :class:`~qiskit_nature.properties.second_quant...
acb5793781d03f7c79464cf6494ea8d6110c4081ee06506d719bbdfed42e8bdd
def get_vibrational_integral(self, num_body_terms: int) -> Optional[VibrationalIntegrals]: 'Gets an\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals`\n given the number of body terms.\n\n Args:\n num_body_terms: the number of body ter...
Gets an :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals` given the number of body terms. Args: num_body_terms: the number of body terms of the queried integrals. Returns: The queried integrals object (or None if unavailable).
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
get_vibrational_integral
jvscursulim/qiskit-nature
1
python
def get_vibrational_integral(self, num_body_terms: int) -> Optional[VibrationalIntegrals]: 'Gets an\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals`\n given the number of body terms.\n\n Args:\n num_body_terms: the number of body ter...
def get_vibrational_integral(self, num_body_terms: int) -> Optional[VibrationalIntegrals]: 'Gets an\n :class:`~qiskit_nature.properties.second_quantization.vibrational.integrals.VibrationalIntegrals`\n given the number of body terms.\n\n Args:\n num_body_terms: the number of body ter...
bc3bae82b0135290cb0aaa2e5c4be837a6a1ffc54afb168f5d377f9965a28c33
def second_q_ops(self) -> ListOrDictType[VibrationalOp]: 'Returns the second quantized vibrational energy operator.\n\n The actual return-type is determined by `qiskit_nature.settings.dict_aux_operators`.\n\n Returns:\n A `list` or `dict` of `VibrationalOp` objects.\n ' ops = [] ...
Returns the second quantized vibrational energy operator. The actual return-type is determined by `qiskit_nature.settings.dict_aux_operators`. Returns: A `list` or `dict` of `VibrationalOp` objects.
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
second_q_ops
jvscursulim/qiskit-nature
1
python
def second_q_ops(self) -> ListOrDictType[VibrationalOp]: 'Returns the second quantized vibrational energy operator.\n\n The actual return-type is determined by `qiskit_nature.settings.dict_aux_operators`.\n\n Returns:\n A `list` or `dict` of `VibrationalOp` objects.\n ' ops = [] ...
def second_q_ops(self) -> ListOrDictType[VibrationalOp]: 'Returns the second quantized vibrational energy operator.\n\n The actual return-type is determined by `qiskit_nature.settings.dict_aux_operators`.\n\n Returns:\n A `list` or `dict` of `VibrationalOp` objects.\n ' ops = [] ...
944c64011a4aae9c982e189752420c7b54c93c196037939e05a1e4c8665604e2
def interpret(self, result: EigenstateResult) -> None: "Interprets an :class:`~qiskit_nature.results.EigenstateResult` in this property's context.\n\n Args:\n result: the result to add meaning to.\n "
Interprets an :class:`~qiskit_nature.results.EigenstateResult` in this property's context. Args: result: the result to add meaning to.
qiskit_nature/properties/second_quantization/vibrational/vibrational_energy.py
interpret
jvscursulim/qiskit-nature
1
python
def interpret(self, result: EigenstateResult) -> None: "Interprets an :class:`~qiskit_nature.results.EigenstateResult` in this property's context.\n\n Args:\n result: the result to add meaning to.\n "
def interpret(self, result: EigenstateResult) -> None: "Interprets an :class:`~qiskit_nature.results.EigenstateResult` in this property's context.\n\n Args:\n result: the result to add meaning to.\n "<|docstring|>Interprets an :class:`~qiskit_nature.results.EigenstateResult` in this propert...
264b4832c66a0e2c12eb5b306d9f377d98b811ca98e39418f99b16bb3cf71e4b
def initialize_on_connect(self, datapath: Datapath): '\n Install the default flows on datapath connect event.\n\n Args:\n datapath: ryu datapath struct\n ' self._datapath = datapath self._delete_all_flows(datapath) self._install_default_flows(datapath) action_str = 'o...
Install the default flows on datapath connect event. Args: datapath: ryu datapath struct
lte/gateway/python/magma/pipelined/app/ipfix.py
initialize_on_connect
vladiskuz/magma
0
python
def initialize_on_connect(self, datapath: Datapath): '\n Install the default flows on datapath connect event.\n\n Args:\n datapath: ryu datapath struct\n ' self._datapath = datapath self._delete_all_flows(datapath) self._install_default_flows(datapath) action_str = 'o...
def initialize_on_connect(self, datapath: Datapath): '\n Install the default flows on datapath connect event.\n\n Args:\n datapath: ryu datapath struct\n ' self._datapath = datapath self._delete_all_flows(datapath) self._install_default_flows(datapath) action_str = 'o...
56fd4449b46f245d967fab550ea50645e13c745f17a90c385b091b85d7784792
def cleanup_on_disconnect(self, datapath: Datapath): '\n Cleanup flows on datapath disconnect event.\n\n Args:\n datapath: ryu datapath struct\n ' self._delete_all_flows(datapath)
Cleanup flows on datapath disconnect event. Args: datapath: ryu datapath struct
lte/gateway/python/magma/pipelined/app/ipfix.py
cleanup_on_disconnect
vladiskuz/magma
0
python
def cleanup_on_disconnect(self, datapath: Datapath): '\n Cleanup flows on datapath disconnect event.\n\n Args:\n datapath: ryu datapath struct\n ' self._delete_all_flows(datapath)
def cleanup_on_disconnect(self, datapath: Datapath): '\n Cleanup flows on datapath disconnect event.\n\n Args:\n datapath: ryu datapath struct\n ' self._delete_all_flows(datapath)<|docstring|>Cleanup flows on datapath disconnect event. Args: datapath: ryu datapath struct<|en...
6031a93e83d21032d38adafaa552a26fe69c1c276bdfc6ff99636d3bceb9cbce
def _install_default_flows(self, datapath: Datapath) -> None: '\n For each direction set the default flows to just forward to next app.\n\n Args:\n datapath: ryu datapath struct\n ' inbound_match = MagmaMatch(eth_type=ether_types.ETH_TYPE_IP, direction=Direction.IN) outbound_...
For each direction set the default flows to just forward to next app. Args: datapath: ryu datapath struct
lte/gateway/python/magma/pipelined/app/ipfix.py
_install_default_flows
vladiskuz/magma
0
python
def _install_default_flows(self, datapath: Datapath) -> None: '\n For each direction set the default flows to just forward to next app.\n\n Args:\n datapath: ryu datapath struct\n ' inbound_match = MagmaMatch(eth_type=ether_types.ETH_TYPE_IP, direction=Direction.IN) outbound_...
def _install_default_flows(self, datapath: Datapath) -> None: '\n For each direction set the default flows to just forward to next app.\n\n Args:\n datapath: ryu datapath struct\n ' inbound_match = MagmaMatch(eth_type=ether_types.ETH_TYPE_IP, direction=Direction.IN) outbound_...
416cefa773c76c61bb218e7ad5f3a0412153b2d46f51819555118439a1eb5418
def add_ue_sample_flow(self, imsi: str, msisdn: str, apn_mac_addr: str, apn_name: str) -> None: '\n Install a flow to sample packets for IPFIX for specific imsi\n\n Args:\n imsi (string): subscriber to install rule for\n msisdn (string): msisdn string\n apn_mac_addr (s...
Install a flow to sample packets for IPFIX for specific imsi Args: imsi (string): subscriber to install rule for msisdn (string): msisdn string apn_mac_addr (string): AP mac address string apn_name (string): AP name
lte/gateway/python/magma/pipelined/app/ipfix.py
add_ue_sample_flow
vladiskuz/magma
0
python
def add_ue_sample_flow(self, imsi: str, msisdn: str, apn_mac_addr: str, apn_name: str) -> None: '\n Install a flow to sample packets for IPFIX for specific imsi\n\n Args:\n imsi (string): subscriber to install rule for\n msisdn (string): msisdn string\n apn_mac_addr (s...
def add_ue_sample_flow(self, imsi: str, msisdn: str, apn_mac_addr: str, apn_name: str) -> None: '\n Install a flow to sample packets for IPFIX for specific imsi\n\n Args:\n imsi (string): subscriber to install rule for\n msisdn (string): msisdn string\n apn_mac_addr (s...
01c0b213d637607717a87aa58388c984b2bd9c84829c2fa20f5d8c99fd6e2ae3
def deactivate_rules(self, imsi: str) -> None: '\n Deactivate flows for a subscriber.\n\n Args:\n imsi (string): subscriber id\n ' if (self._datapath is None): self.logger.error('Datapath not initialized') return if (not imsi): self.logger.error('No su...
Deactivate flows for a subscriber. Args: imsi (string): subscriber id
lte/gateway/python/magma/pipelined/app/ipfix.py
deactivate_rules
vladiskuz/magma
0
python
def deactivate_rules(self, imsi: str) -> None: '\n Deactivate flows for a subscriber.\n\n Args:\n imsi (string): subscriber id\n ' if (self._datapath is None): self.logger.error('Datapath not initialized') return if (not imsi): self.logger.error('No su...
def deactivate_rules(self, imsi: str) -> None: '\n Deactivate flows for a subscriber.\n\n Args:\n imsi (string): subscriber id\n ' if (self._datapath is None): self.logger.error('Datapath not initialized') return if (not imsi): self.logger.error('No su...
811c940f5c52b345a8b30c52d0463d2b2b9b0c10456c1f8fd0a4d0b78084f12c
def is_hw_inverted(self) -> bool: 'Returns whether a pin is hardware inverted\n \n :rtype: bool\n ' return self._hw_inverted
Returns whether a pin is hardware inverted :rtype: bool
parallel64/pins.py
is_hw_inverted
tekktrik/TekkPort
0
python
def is_hw_inverted(self) -> bool: 'Returns whether a pin is hardware inverted\n \n :rtype: bool\n ' return self._hw_inverted
def is_hw_inverted(self) -> bool: 'Returns whether a pin is hardware inverted\n \n :rtype: bool\n ' return self._hw_inverted<|docstring|>Returns whether a pin is hardware inverted :rtype: bool<|endoftext|>
e0508eb495d576a440140926f899f96bb87e91c959a9f4ff7db6745603792bf1
def is_output_allowed(self) -> bool: 'Returns whether a pin allows output\n \n :rtype: bool\n ' return self._allow_output
Returns whether a pin allows output :rtype: bool
parallel64/pins.py
is_output_allowed
tekktrik/TekkPort
0
python
def is_output_allowed(self) -> bool: 'Returns whether a pin allows output\n \n :rtype: bool\n ' return self._allow_output
def is_output_allowed(self) -> bool: 'Returns whether a pin allows output\n \n :rtype: bool\n ' return self._allow_output<|docstring|>Returns whether a pin allows output :rtype: bool<|endoftext|>
6f3a2721582848aa8886a9efb2b2bf89391e5819f91be1b9ea01bb32ac77d28a
def iw_input_allowed(self) -> bool: 'Returns whether a pin allows input\n \n :rtype: bool\n ' return self._allow_input
Returns whether a pin allows input :rtype: bool
parallel64/pins.py
iw_input_allowed
tekktrik/TekkPort
0
python
def iw_input_allowed(self) -> bool: 'Returns whether a pin allows input\n \n :rtype: bool\n ' return self._allow_input
def iw_input_allowed(self) -> bool: 'Returns whether a pin allows input\n \n :rtype: bool\n ' return self._allow_input<|docstring|>Returns whether a pin allows input :rtype: bool<|endoftext|>
7c763762e3126a4eacabe41c8cc03f0058dfe5a7c0213d58ac5f50e2aaea6aa9
def get_named_pin_list(self) -> List[Tuple[(str, Pin)]]: 'Returns a list of pins and their names\n \n :rtype: list((str, Pin))\n ' return list(self.__dict__.items())
Returns a list of pins and their names :rtype: list((str, Pin))
parallel64/pins.py
get_named_pin_list
tekktrik/TekkPort
0
python
def get_named_pin_list(self) -> List[Tuple[(str, Pin)]]: 'Returns a list of pins and their names\n \n :rtype: list((str, Pin))\n ' return list(self.__dict__.items())
def get_named_pin_list(self) -> List[Tuple[(str, Pin)]]: 'Returns a list of pins and their names\n \n :rtype: list((str, Pin))\n ' return list(self.__dict__.items())<|docstring|>Returns a list of pins and their names :rtype: list((str, Pin))<|endoftext|>
7e67dca24084970294dcbc60803c46f1d312270c5db4446ff8ccdd30316e122f
def get_pin_list(self) -> List[Pin]: 'Returns a list of pins\n\n :rtype: list(Pin)\n ' return [pin[1] for pin in self.get_named_pin_list()]
Returns a list of pins :rtype: list(Pin)
parallel64/pins.py
get_pin_list
tekktrik/TekkPort
0
python
def get_pin_list(self) -> List[Pin]: 'Returns a list of pins\n\n :rtype: list(Pin)\n ' return [pin[1] for pin in self.get_named_pin_list()]
def get_pin_list(self) -> List[Pin]: 'Returns a list of pins\n\n :rtype: list(Pin)\n ' return [pin[1] for pin in self.get_named_pin_list()]<|docstring|>Returns a list of pins :rtype: list(Pin)<|endoftext|>
a15d2ef2925d4b8422bfcfc5b2e8260b73dc05311f5ffdc97df7b4f92de28aef
def get_pin_name_list(self) -> List[str]: 'Return a list of pin names\n \n :rtype: list(str)\n ' return [pin[0] for pin in self.get_named_pin_list()]
Return a list of pin names :rtype: list(str)
parallel64/pins.py
get_pin_name_list
tekktrik/TekkPort
0
python
def get_pin_name_list(self) -> List[str]: 'Return a list of pin names\n \n :rtype: list(str)\n ' return [pin[0] for pin in self.get_named_pin_list()]
def get_pin_name_list(self) -> List[str]: 'Return a list of pin names\n \n :rtype: list(str)\n ' return [pin[0] for pin in self.get_named_pin_list()]<|docstring|>Return a list of pin names :rtype: list(str)<|endoftext|>
6de8d704aacd41cc31780febdb1d01158c9c5a4b1544caa5c84796a2437286df
def get_pin_by_number(self, pin_number: int) -> Pin: 'Returns a pin based off of the pin number\n \n :rtype: Pin\n ' pin_list = self.get_pin_list() return [pin for pin in pin_list if (pin.pin_number == pin_number)][0]
Returns a pin based off of the pin number :rtype: Pin
parallel64/pins.py
get_pin_by_number
tekktrik/TekkPort
0
python
def get_pin_by_number(self, pin_number: int) -> Pin: 'Returns a pin based off of the pin number\n \n :rtype: Pin\n ' pin_list = self.get_pin_list() return [pin for pin in pin_list if (pin.pin_number == pin_number)][0]
def get_pin_by_number(self, pin_number: int) -> Pin: 'Returns a pin based off of the pin number\n \n :rtype: Pin\n ' pin_list = self.get_pin_list() return [pin for pin in pin_list if (pin.pin_number == pin_number)][0]<|docstring|>Returns a pin based off of the pin number :rtype: Pin<|e...
8e3a67343a4dd52519cc16810b9b08530010be373de9c2a07f0e50ebc6f3eff0
def get_all_rates(url=rss_page, processor=processors.raw, only=None, **processor_kwargs): '\n Get ECB foreign currency exchange rates to EUR.\n :param url: full URL to ECB RSS news feeds website.\n :param processor: decides the output format, see processors\n :param only: sequence, limit list of currenc...
Get ECB foreign currency exchange rates to EUR. :param url: full URL to ECB RSS news feeds website. :param processor: decides the output format, see processors :param only: sequence, limit list of currencies :param processor_args: :return:
gwaith/main.py
get_all_rates
bartekbrak/gwaith
0
python
def get_all_rates(url=rss_page, processor=processors.raw, only=None, **processor_kwargs): '\n Get ECB foreign currency exchange rates to EUR.\n :param url: full URL to ECB RSS news feeds website.\n :param processor: decides the output format, see processors\n :param only: sequence, limit list of currenc...
def get_all_rates(url=rss_page, processor=processors.raw, only=None, **processor_kwargs): '\n Get ECB foreign currency exchange rates to EUR.\n :param url: full URL to ECB RSS news feeds website.\n :param processor: decides the output format, see processors\n :param only: sequence, limit list of currenc...
cf8750bcbca4e343087ccfb70d1e806423a4f5c97cee863a7fb12e66a119a14c
def metric_fn(loss): 'Evaluation metric Fn which runs on CPU.' perplexity = tf.exp(tf.reduce_mean(loss)) return {'eval/loss': tf.metrics.mean(loss), 'eval/perplexity': tf.metrics.mean(perplexity)}
Evaluation metric Fn which runs on CPU.
pretrain/t5_train.py
metric_fn
laiguokun/transformer-xl
0
python
def metric_fn(loss): perplexity = tf.exp(tf.reduce_mean(loss)) return {'eval/loss': tf.metrics.mean(loss), 'eval/perplexity': tf.metrics.mean(perplexity)}
def metric_fn(loss): perplexity = tf.exp(tf.reduce_mean(loss)) return {'eval/loss': tf.metrics.mean(loss), 'eval/perplexity': tf.metrics.mean(perplexity)}<|docstring|>Evaluation metric Fn which runs on CPU.<|endoftext|>
93580cc5dce38cb7ae65e2cc14cf8538afb8e0f8007eecadebb69b8cd9d3fcbd
def get_model_fn(n_token): 'doc.' def model_fn(features, labels, mode, params): 'doc.' is_training = (mode == tf.estimator.ModeKeys.TRAIN) mems = {} idx = 0 for (obj_len, key) in zip([FLAGS.seq_len], ['mems']): if ((obj_len > 0) and (FLAGS.mem_len > 0)): ...
doc.
pretrain/t5_train.py
get_model_fn
laiguokun/transformer-xl
0
python
def get_model_fn(n_token): def model_fn(features, labels, mode, params): is_training = (mode == tf.estimator.ModeKeys.TRAIN) mems = {} idx = 0 for (obj_len, key) in zip([FLAGS.seq_len], ['mems']): if ((obj_len > 0) and (FLAGS.mem_len > 0)): ...
def get_model_fn(n_token): def model_fn(features, labels, mode, params): is_training = (mode == tf.estimator.ModeKeys.TRAIN) mems = {} idx = 0 for (obj_len, key) in zip([FLAGS.seq_len], ['mems']): if ((obj_len > 0) and (FLAGS.mem_len > 0)): ...
46378b8bfbef7a8a66db4dc5a593d2b50c1ce5f52fbcdcc2c967b9bafed40d2c
def get_cache_fn(mem_len): 'doc.' tf_float = (tf.bfloat16 if FLAGS.use_bfloat16 else tf.float32) def cache_fn(batch_size): 'Call back function used to create initial cache in TPUEstimator.' mems = [] for obj_len in [FLAGS.seq_len]: if (obj_len > 0): for _...
doc.
pretrain/t5_train.py
get_cache_fn
laiguokun/transformer-xl
0
python
def get_cache_fn(mem_len): tf_float = (tf.bfloat16 if FLAGS.use_bfloat16 else tf.float32) def cache_fn(batch_size): 'Call back function used to create initial cache in TPUEstimator.' mems = [] for obj_len in [FLAGS.seq_len]: if (obj_len > 0): for _ in ra...
def get_cache_fn(mem_len): tf_float = (tf.bfloat16 if FLAGS.use_bfloat16 else tf.float32) def cache_fn(batch_size): 'Call back function used to create initial cache in TPUEstimator.' mems = [] for obj_len in [FLAGS.seq_len]: if (obj_len > 0): for _ in ra...
406bcd51d7ee25f53fb8dfe6f3e55e89bb2216ad96510f147f2d7a02e5c32cec
def get_input_fn(split): 'doc.' if (split == 'train'): batch_size = FLAGS.train_batch_size else: batch_size = FLAGS.eval_batch_size kwargs = dict(doc_dir=FLAGS.doc_dir, semi_dir=FLAGS.semi_dir, sent_dir=FLAGS.sent_dir, split=split, uncased=FLAGS.uncased, seq_len=FLAGS.seq_len, num_predic...
doc.
pretrain/t5_train.py
get_input_fn
laiguokun/transformer-xl
0
python
def get_input_fn(split): if (split == 'train'): batch_size = FLAGS.train_batch_size else: batch_size = FLAGS.eval_batch_size kwargs = dict(doc_dir=FLAGS.doc_dir, semi_dir=FLAGS.semi_dir, sent_dir=FLAGS.sent_dir, split=split, uncased=FLAGS.uncased, seq_len=FLAGS.seq_len, num_predict=FLAG...
def get_input_fn(split): if (split == 'train'): batch_size = FLAGS.train_batch_size else: batch_size = FLAGS.eval_batch_size kwargs = dict(doc_dir=FLAGS.doc_dir, semi_dir=FLAGS.semi_dir, sent_dir=FLAGS.sent_dir, split=split, uncased=FLAGS.uncased, seq_len=FLAGS.seq_len, num_predict=FLAG...
e0d2a3144fbece372263f881e746f0867b17cdef31be5a80344ecea7dbde1e3c
def model_fn(features, labels, mode, params): 'doc.' is_training = (mode == tf.estimator.ModeKeys.TRAIN) mems = {} idx = 0 for (obj_len, key) in zip([FLAGS.seq_len], ['mems']): if ((obj_len > 0) and (FLAGS.mem_len > 0)): n_layer = FLAGS.n_layer if FLAGS.use_extra_laye...
doc.
pretrain/t5_train.py
model_fn
laiguokun/transformer-xl
0
python
def model_fn(features, labels, mode, params): is_training = (mode == tf.estimator.ModeKeys.TRAIN) mems = {} idx = 0 for (obj_len, key) in zip([FLAGS.seq_len], ['mems']): if ((obj_len > 0) and (FLAGS.mem_len > 0)): n_layer = FLAGS.n_layer if FLAGS.use_extra_layer: ...
def model_fn(features, labels, mode, params): is_training = (mode == tf.estimator.ModeKeys.TRAIN) mems = {} idx = 0 for (obj_len, key) in zip([FLAGS.seq_len], ['mems']): if ((obj_len > 0) and (FLAGS.mem_len > 0)): n_layer = FLAGS.n_layer if FLAGS.use_extra_layer: ...
69fe33180314a01db0cec15d2ce7b0de1dcc9b855132c900e2800c66562620f4
def cache_fn(batch_size): 'Call back function used to create initial cache in TPUEstimator.' mems = [] for obj_len in [FLAGS.seq_len]: if (obj_len > 0): for _ in range((FLAGS.n_layer + int(FLAGS.use_extra_layer))): zeros = tf.zeros([batch_size, mem_len, FLAGS.d_model], dt...
Call back function used to create initial cache in TPUEstimator.
pretrain/t5_train.py
cache_fn
laiguokun/transformer-xl
0
python
def cache_fn(batch_size): mems = [] for obj_len in [FLAGS.seq_len]: if (obj_len > 0): for _ in range((FLAGS.n_layer + int(FLAGS.use_extra_layer))): zeros = tf.zeros([batch_size, mem_len, FLAGS.d_model], dtype=tf_float) mems.append(zeros) return mems
def cache_fn(batch_size): mems = [] for obj_len in [FLAGS.seq_len]: if (obj_len > 0): for _ in range((FLAGS.n_layer + int(FLAGS.use_extra_layer))): zeros = tf.zeros([batch_size, mem_len, FLAGS.d_model], dtype=tf_float) mems.append(zeros) return mems<|...
624b68337da36f92748f23eebae098481408e9ebe66a76e33b069979e2e14515
def ParseURLsFromConfig(file_name): 'Parses URLS from the config file.\n\n The file should be in python config format, where svn section is in the\n format "svn:component_path".\n Each of the section for svn should contain changelog_url, revision_url,\n diff_url and blame_url.\n\n Args:\n file_name: The nam...
Parses URLS from the config file. The file should be in python config format, where svn section is in the format "svn:component_path". Each of the section for svn should contain changelog_url, revision_url, diff_url and blame_url. Args: file_name: The name of the file that contains URL information. Returns: A di...
tools/findit/crash_utils.py
ParseURLsFromConfig
7kbird/chrome
0
python
def ParseURLsFromConfig(file_name): 'Parses URLS from the config file.\n\n The file should be in python config format, where svn section is in the\n format "svn:component_path".\n Each of the section for svn should contain changelog_url, revision_url,\n diff_url and blame_url.\n\n Args:\n file_name: The nam...
def ParseURLsFromConfig(file_name): 'Parses URLS from the config file.\n\n The file should be in python config format, where svn section is in the\n format "svn:component_path".\n Each of the section for svn should contain changelog_url, revision_url,\n diff_url and blame_url.\n\n Args:\n file_name: The nam...
9583a2e2e3ddf851dc39b6a7127739550135f7b7b77efea9fdd7fd6ec516350a
def NormalizePathLinux(path, parsed_deps): "Normalizes linux path.\n\n Args:\n path: A string representing a path.\n parsed_deps: A map from component path to its component name, repository,\n etc.\n\n Returns:\n A tuple containing a component this path is in (e.g blink, skia, etc)\n a...
Normalizes linux path. Args: path: A string representing a path. parsed_deps: A map from component path to its component name, repository, etc. Returns: A tuple containing a component this path is in (e.g blink, skia, etc) and a path in that component's repository.
tools/findit/crash_utils.py
NormalizePathLinux
7kbird/chrome
0
python
def NormalizePathLinux(path, parsed_deps): "Normalizes linux path.\n\n Args:\n path: A string representing a path.\n parsed_deps: A map from component path to its component name, repository,\n etc.\n\n Returns:\n A tuple containing a component this path is in (e.g blink, skia, etc)\n a...
def NormalizePathLinux(path, parsed_deps): "Normalizes linux path.\n\n Args:\n path: A string representing a path.\n parsed_deps: A map from component path to its component name, repository,\n etc.\n\n Returns:\n A tuple containing a component this path is in (e.g blink, skia, etc)\n a...
f171aa2cf0d77f4516185700caceabef8cf44756de20494605e467c14da7d731
def SplitRange(regression): "Splits a range as retrieved from clusterfuzz.\n\n Args:\n regression: A string in format 'r1234:r5678'.\n\n Returns:\n A list containing two numbers represented in string, for example\n ['1234','5678'].\n " if (not regression): return None revisions = regress...
Splits a range as retrieved from clusterfuzz. Args: regression: A string in format 'r1234:r5678'. Returns: A list containing two numbers represented in string, for example ['1234','5678'].
tools/findit/crash_utils.py
SplitRange
7kbird/chrome
0
python
def SplitRange(regression): "Splits a range as retrieved from clusterfuzz.\n\n Args:\n regression: A string in format 'r1234:r5678'.\n\n Returns:\n A list containing two numbers represented in string, for example\n ['1234','5678'].\n " if (not regression): return None revisions = regress...
def SplitRange(regression): "Splits a range as retrieved from clusterfuzz.\n\n Args:\n regression: A string in format 'r1234:r5678'.\n\n Returns:\n A list containing two numbers represented in string, for example\n ['1234','5678'].\n " if (not regression): return None revisions = regress...
d6b112af8cf2f40f416476798d6ed72393b6c0fed46a966ae3b09cbeae4e7cad
def LoadJSON(json_string): 'Loads json object from string, or None.\n\n Args:\n json_string: A string to get object from.\n\n Returns:\n JSON object if the string represents a JSON object, None otherwise.\n ' try: data = json.loads(json_string) except ValueError: data = None ret...
Loads json object from string, or None. Args: json_string: A string to get object from. Returns: JSON object if the string represents a JSON object, None otherwise.
tools/findit/crash_utils.py
LoadJSON
7kbird/chrome
0
python
def LoadJSON(json_string): 'Loads json object from string, or None.\n\n Args:\n json_string: A string to get object from.\n\n Returns:\n JSON object if the string represents a JSON object, None otherwise.\n ' try: data = json.loads(json_string) except ValueError: data = None ret...
def LoadJSON(json_string): 'Loads json object from string, or None.\n\n Args:\n json_string: A string to get object from.\n\n Returns:\n JSON object if the string represents a JSON object, None otherwise.\n ' try: data = json.loads(json_string) except ValueError: data = None ret...
86ef8db88de0d8777d8bdaa59860cbacbf92d49e13f96406e2744918b2032e3b
def GetDataFromURL(url, retries=10, sleep_time=0.1, timeout=5): 'Retrieves raw data from URL, tries 10 times.\n\n Args:\n url: URL to get data from.\n retries: Number of times to retry connection.\n sleep_time: Time in seconds to wait before retrying connection.\n timeout: Time in seconds to wait befor...
Retrieves raw data from URL, tries 10 times. Args: url: URL to get data from. retries: Number of times to retry connection. sleep_time: Time in seconds to wait before retrying connection. timeout: Time in seconds to wait before time out. Returns: None if the data retrieval fails, or the raw data.
tools/findit/crash_utils.py
GetDataFromURL
7kbird/chrome
0
python
def GetDataFromURL(url, retries=10, sleep_time=0.1, timeout=5): 'Retrieves raw data from URL, tries 10 times.\n\n Args:\n url: URL to get data from.\n retries: Number of times to retry connection.\n sleep_time: Time in seconds to wait before retrying connection.\n timeout: Time in seconds to wait befor...
def GetDataFromURL(url, retries=10, sleep_time=0.1, timeout=5): 'Retrieves raw data from URL, tries 10 times.\n\n Args:\n url: URL to get data from.\n retries: Number of times to retry connection.\n sleep_time: Time in seconds to wait before retrying connection.\n timeout: Time in seconds to wait befor...
8b83efd1e99bc19ed6158d693479369072977ee407ffdef549e584fc81c0d970
def FindMinLineDistance(crashed_line_list, changed_line_numbers): 'Calculates how far the changed line is from one of the crashes.\n\n Finds the minimum distance between the lines that the file crashed on\n and the lines that the file changed. For example, if the file crashed on\n line 200 and the CL changes lin...
Calculates how far the changed line is from one of the crashes. Finds the minimum distance between the lines that the file crashed on and the lines that the file changed. For example, if the file crashed on line 200 and the CL changes line 203,204 and 205, the function returns 3. Args: crashed_line_list: A list of ...
tools/findit/crash_utils.py
FindMinLineDistance
7kbird/chrome
0
python
def FindMinLineDistance(crashed_line_list, changed_line_numbers): 'Calculates how far the changed line is from one of the crashes.\n\n Finds the minimum distance between the lines that the file crashed on\n and the lines that the file changed. For example, if the file crashed on\n line 200 and the CL changes lin...
def FindMinLineDistance(crashed_line_list, changed_line_numbers): 'Calculates how far the changed line is from one of the crashes.\n\n Finds the minimum distance between the lines that the file crashed on\n and the lines that the file changed. For example, if the file crashed on\n line 200 and the CL changes lin...
7ef55a3fa39388c5e9b9e3b4791fddbc93bcf6ad7309cef960affdb01da5683b
def GuessIfSameSubPath(path1, path2): "Guesses if two paths represent same path.\n\n Compares the name of the folders in the path (by split('/')), and checks\n if they match either more than 3 or min of path lengths.\n\n Args:\n path1: First path.\n path2: Second path to compare.\n\n Returns:\n True if...
Guesses if two paths represent same path. Compares the name of the folders in the path (by split('/')), and checks if they match either more than 3 or min of path lengths. Args: path1: First path. path2: Second path to compare. Returns: True if it they are thought to be a same path, False otherwise.
tools/findit/crash_utils.py
GuessIfSameSubPath
7kbird/chrome
0
python
def GuessIfSameSubPath(path1, path2): "Guesses if two paths represent same path.\n\n Compares the name of the folders in the path (by split('/')), and checks\n if they match either more than 3 or min of path lengths.\n\n Args:\n path1: First path.\n path2: Second path to compare.\n\n Returns:\n True if...
def GuessIfSameSubPath(path1, path2): "Guesses if two paths represent same path.\n\n Compares the name of the folders in the path (by split('/')), and checks\n if they match either more than 3 or min of path lengths.\n\n Args:\n path1: First path.\n path2: Second path to compare.\n\n Returns:\n True if...
e65f8e960f4bc1948d9c558f6608b791e16beb35488713079eb9b1df9470a225
def FindMinStackFrameNumber(stack_frame_indices, priorities): 'Finds the minimum stack number, from the list of stack numbers.\n\n Args:\n stack_frame_indices: A list of lists containing stack position.\n priorities: A list of of priority for each file.\n\n Returns:\n Inf if stack_frame_indices is empty,...
Finds the minimum stack number, from the list of stack numbers. Args: stack_frame_indices: A list of lists containing stack position. priorities: A list of of priority for each file. Returns: Inf if stack_frame_indices is empty, minimum stack number otherwise.
tools/findit/crash_utils.py
FindMinStackFrameNumber
7kbird/chrome
0
python
def FindMinStackFrameNumber(stack_frame_indices, priorities): 'Finds the minimum stack number, from the list of stack numbers.\n\n Args:\n stack_frame_indices: A list of lists containing stack position.\n priorities: A list of of priority for each file.\n\n Returns:\n Inf if stack_frame_indices is empty,...
def FindMinStackFrameNumber(stack_frame_indices, priorities): 'Finds the minimum stack number, from the list of stack numbers.\n\n Args:\n stack_frame_indices: A list of lists containing stack position.\n priorities: A list of of priority for each file.\n\n Returns:\n Inf if stack_frame_indices is empty,...
10f764bd13fa9678d3c81ba4ff34edb3a20d6c6021e4f31c58425f10c0e6a6d3
def AddHyperlink(text, link): 'Returns a string with HTML link tag.\n\n Args:\n text: A string to add link.\n link: A link to add to the string.\n\n Returns:\n A string with hyperlink added.\n ' sanitized_link = cgi.escape(link, quote=True) sanitized_text = cgi.escape(str(text)) return ('<a ...
Returns a string with HTML link tag. Args: text: A string to add link. link: A link to add to the string. Returns: A string with hyperlink added.
tools/findit/crash_utils.py
AddHyperlink
7kbird/chrome
0
python
def AddHyperlink(text, link): 'Returns a string with HTML link tag.\n\n Args:\n text: A string to add link.\n link: A link to add to the string.\n\n Returns:\n A string with hyperlink added.\n ' sanitized_link = cgi.escape(link, quote=True) sanitized_text = cgi.escape(str(text)) return ('<a ...
def AddHyperlink(text, link): 'Returns a string with HTML link tag.\n\n Args:\n text: A string to add link.\n link: A link to add to the string.\n\n Returns:\n A string with hyperlink added.\n ' sanitized_link = cgi.escape(link, quote=True) sanitized_text = cgi.escape(str(text)) return ('<a ...
c530f72d282038def045213b2df726fe3cc6519bbd48b0c8ee47256d228d6108
def PrettifyList(l): 'Returns a string representation of a list.\n\n It adds comma in between the elements and removes the brackets.\n Args:\n l: A list to prettify.\n Returns:\n A string representation of the list.\n ' return str(l)[1:(- 1)]
Returns a string representation of a list. It adds comma in between the elements and removes the brackets. Args: l: A list to prettify. Returns: A string representation of the list.
tools/findit/crash_utils.py
PrettifyList
7kbird/chrome
0
python
def PrettifyList(l): 'Returns a string representation of a list.\n\n It adds comma in between the elements and removes the brackets.\n Args:\n l: A list to prettify.\n Returns:\n A string representation of the list.\n ' return str(l)[1:(- 1)]
def PrettifyList(l): 'Returns a string representation of a list.\n\n It adds comma in between the elements and removes the brackets.\n Args:\n l: A list to prettify.\n Returns:\n A string representation of the list.\n ' return str(l)[1:(- 1)]<|docstring|>Returns a string representation of a list. It ...
48f47b14e766c915e10c6b50c2e3737b69f2c2cdb28ebedc5c37bba9ade0aae6
def PrettifyFiles(file_list): 'Returns a string representation of a list of file names.\n\n Args:\n file_list: A list of tuple, (file_name, file_url).\n Returns:\n A string representation of file names with their urls.\n ' ret = ['\n'] for (file_name, file_url) in file_list: ret.append((' ...
Returns a string representation of a list of file names. Args: file_list: A list of tuple, (file_name, file_url). Returns: A string representation of file names with their urls.
tools/findit/crash_utils.py
PrettifyFiles
7kbird/chrome
0
python
def PrettifyFiles(file_list): 'Returns a string representation of a list of file names.\n\n Args:\n file_list: A list of tuple, (file_name, file_url).\n Returns:\n A string representation of file names with their urls.\n ' ret = ['\n'] for (file_name, file_url) in file_list: ret.append((' ...
def PrettifyFiles(file_list): 'Returns a string representation of a list of file names.\n\n Args:\n file_list: A list of tuple, (file_name, file_url).\n Returns:\n A string representation of file names with their urls.\n ' ret = ['\n'] for (file_name, file_url) in file_list: ret.append((' ...
bcab5de91cedc660ae72852f0e2ccddbdf143ea37169df5768d66cfcfa3a934f
def Intersection(crashed_line_list, stack_frame_index, changed_line_numbers, line_range=3): 'Finds the overlap betwee changed lines and crashed lines.\n\n Finds the intersection of the lines that caused the crash and\n lines that the file changes. The intersection looks within 3 lines\n of the line that caused t...
Finds the overlap betwee changed lines and crashed lines. Finds the intersection of the lines that caused the crash and lines that the file changes. The intersection looks within 3 lines of the line that caused the crash. Args: crashed_line_list: A list of lines that the file crashed on. stack_frame_index: A list...
tools/findit/crash_utils.py
Intersection
7kbird/chrome
0
python
def Intersection(crashed_line_list, stack_frame_index, changed_line_numbers, line_range=3): 'Finds the overlap betwee changed lines and crashed lines.\n\n Finds the intersection of the lines that caused the crash and\n lines that the file changes. The intersection looks within 3 lines\n of the line that caused t...
def Intersection(crashed_line_list, stack_frame_index, changed_line_numbers, line_range=3): 'Finds the overlap betwee changed lines and crashed lines.\n\n Finds the intersection of the lines that caused the crash and\n lines that the file changes. The intersection looks within 3 lines\n of the line that caused t...
5e1b3098f910b5ad0ae3e8c1c1bf2d7439f2efafbda5fff90d877e6153f130c1
def MatchListToResultList(matches): 'Convert list of matches to the list of result objects.\n\n Args:\n matches: A list of match objects along with its stack priority and revision\n number/git hash\n Returns:\n A list of result object.\n\n ' result_list = [] for (_, cl, match) in matche...
Convert list of matches to the list of result objects. Args: matches: A list of match objects along with its stack priority and revision number/git hash Returns: A list of result object.
tools/findit/crash_utils.py
MatchListToResultList
7kbird/chrome
0
python
def MatchListToResultList(matches): 'Convert list of matches to the list of result objects.\n\n Args:\n matches: A list of match objects along with its stack priority and revision\n number/git hash\n Returns:\n A list of result object.\n\n ' result_list = [] for (_, cl, match) in matche...
def MatchListToResultList(matches): 'Convert list of matches to the list of result objects.\n\n Args:\n matches: A list of match objects along with its stack priority and revision\n number/git hash\n Returns:\n A list of result object.\n\n ' result_list = [] for (_, cl, match) in matche...
c35895e09356bbce861f9481b1413c97b2e1935bf1f4f1ba5e169590cf52bb5c
def BlameListToResultList(blame_list): 'Convert blame list to the list of result objects.\n\n Args:\n blame_list: A list of blame objects.\n\n Returns:\n A list of result objects.\n ' result_list = [] for blame in blame_list: suspected_cl = blame.revision revision_url = blame.url ...
Convert blame list to the list of result objects. Args: blame_list: A list of blame objects. Returns: A list of result objects.
tools/findit/crash_utils.py
BlameListToResultList
7kbird/chrome
0
python
def BlameListToResultList(blame_list): 'Convert blame list to the list of result objects.\n\n Args:\n blame_list: A list of blame objects.\n\n Returns:\n A list of result objects.\n ' result_list = [] for blame in blame_list: suspected_cl = blame.revision revision_url = blame.url ...
def BlameListToResultList(blame_list): 'Convert blame list to the list of result objects.\n\n Args:\n blame_list: A list of blame objects.\n\n Returns:\n A list of result objects.\n ' result_list = [] for blame in blame_list: suspected_cl = blame.revision revision_url = blame.url ...
96f266cb9364dffde5dc0b0d77e6965a145f85d9aae322ad6185aa0b012a04cb
@staticmethod def get_valid_params(): '\n Returns the valid parameters.\n @ In, None\n @ Out, params, _ValidParameters, return the parameters.\n ' params = Tester.get_valid_params() params.add_required_param('input', 'The python file to use for this test.') params.add_param('output', '...
Returns the valid parameters. @ In, None @ Out, params, _ValidParameters, return the parameters.
scripts/TestHarness/testers/RavenPython.py
get_valid_params
dylanjm/raven
159
python
@staticmethod def get_valid_params(): '\n Returns the valid parameters.\n @ In, None\n @ Out, params, _ValidParameters, return the parameters.\n ' params = Tester.get_valid_params() params.add_required_param('input', 'The python file to use for this test.') params.add_param('output', ,...
@staticmethod def get_valid_params(): '\n Returns the valid parameters.\n @ In, None\n @ Out, params, _ValidParameters, return the parameters.\n ' params = Tester.get_valid_params() params.add_required_param('input', 'The python file to use for this test.') params.add_param('output', ,...
ef66bd85719928d64fae7f15463ae82d3da837717386ac9090fe7deb67d84f2e
def prepare(self): '\n Copied from RavenFramework since we should still clean out test files\n before running an external tester, though we will not test if they\n are created later (for now), so it may behoove us to not save\n check_files for later use.\n @ In, None\n @ Out, None\n ...
Copied from RavenFramework since we should still clean out test files before running an external tester, though we will not test if they are created later (for now), so it may behoove us to not save check_files for later use. @ In, None @ Out, None
scripts/TestHarness/testers/RavenPython.py
prepare
dylanjm/raven
159
python
def prepare(self): '\n Copied from RavenFramework since we should still clean out test files\n before running an external tester, though we will not test if they\n are created later (for now), so it may behoove us to not save\n check_files for later use.\n @ In, None\n @ Out, None\n ...
def prepare(self): '\n Copied from RavenFramework since we should still clean out test files\n before running an external tester, though we will not test if they\n are created later (for now), so it may behoove us to not save\n check_files for later use.\n @ In, None\n @ Out, None\n ...
c38f4ee550c3ce99f02187eecfbabf7eea461693fc4aa35114856ca785b14f33
def get_command(self): '\n returns the command used by this tester.\n @ In, None\n @ Out, get_command, string, command to run.\n ' if (len(self.specs['python_command']) == 0): pythonCommand = self._get_python_command() else: pythonCommand = self.specs['python_command'] ...
returns the command used by this tester. @ In, None @ Out, get_command, string, command to run.
scripts/TestHarness/testers/RavenPython.py
get_command
dylanjm/raven
159
python
def get_command(self): '\n returns the command used by this tester.\n @ In, None\n @ Out, get_command, string, command to run.\n ' if (len(self.specs['python_command']) == 0): pythonCommand = self._get_python_command() else: pythonCommand = self.specs['python_command'] ...
def get_command(self): '\n returns the command used by this tester.\n @ In, None\n @ Out, get_command, string, command to run.\n ' if (len(self.specs['python_command']) == 0): pythonCommand = self._get_python_command() else: pythonCommand = self.specs['python_command'] ...
5eddf57e9900a31dc9c5758e963c39040684ba79b77041b388bd9b0cf14c7265
def __init__(self, name, params): '\n Initializer for the class. Takes a String name and a dictionary params\n @ In, name, string, name of the test.\n @ In, params, dictionary, parameters for the class\n @ Out, None.\n ' Tester.__init__(self, name, params) self.specs['scale_refine'] =...
Initializer for the class. Takes a String name and a dictionary params @ In, name, string, name of the test. @ In, params, dictionary, parameters for the class @ Out, None.
scripts/TestHarness/testers/RavenPython.py
__init__
dylanjm/raven
159
python
def __init__(self, name, params): '\n Initializer for the class. Takes a String name and a dictionary params\n @ In, name, string, name of the test.\n @ In, params, dictionary, parameters for the class\n @ Out, None.\n ' Tester.__init__(self, name, params) self.specs['scale_refine'] =...
def __init__(self, name, params): '\n Initializer for the class. Takes a String name and a dictionary params\n @ In, name, string, name of the test.\n @ In, params, dictionary, parameters for the class\n @ Out, None.\n ' Tester.__init__(self, name, params) self.specs['scale_refine'] =...
b0937712f05fb80d085bdb07b38e9cc2d0fe715e45c7712910d176d4208c245e
def check_runnable(self): '\n Checks if this test can be run.\n @ In, None\n @ Out, check_runnable, boolean, If True can run this test.\n ' i = 0 if (len(self.minimum_libraries) % 2): self.set_skip((('skipped (libraries are not matched to versions numbers: ' + str(self.minimum_libr...
Checks if this test can be run. @ In, None @ Out, check_runnable, boolean, If True can run this test.
scripts/TestHarness/testers/RavenPython.py
check_runnable
dylanjm/raven
159
python
def check_runnable(self): '\n Checks if this test can be run.\n @ In, None\n @ Out, check_runnable, boolean, If True can run this test.\n ' i = 0 if (len(self.minimum_libraries) % 2): self.set_skip((('skipped (libraries are not matched to versions numbers: ' + str(self.minimum_libr...
def check_runnable(self): '\n Checks if this test can be run.\n @ In, None\n @ Out, check_runnable, boolean, If True can run this test.\n ' i = 0 if (len(self.minimum_libraries) % 2): self.set_skip((('skipped (libraries are not matched to versions numbers: ' + str(self.minimum_libr...
cf4c44d4966f10210997a25bd10d1de3f730259e03953841025b4e6d299be3b2
def process_results(self, _): '\n Sets the status of this test.\n @ In, ignored, string, output of running the test.\n @ Out, None\n ' self.set_success()
Sets the status of this test. @ In, ignored, string, output of running the test. @ Out, None
scripts/TestHarness/testers/RavenPython.py
process_results
dylanjm/raven
159
python
def process_results(self, _): '\n Sets the status of this test.\n @ In, ignored, string, output of running the test.\n @ Out, None\n ' self.set_success()
def process_results(self, _): '\n Sets the status of this test.\n @ In, ignored, string, output of running the test.\n @ Out, None\n ' self.set_success()<|docstring|>Sets the status of this test. @ In, ignored, string, output of running the test. @ Out, None<|endoftext|>
9ce268bc34ad93ae083ac6091dc0ecd625d013d429a2e16cba5c2a378d9c4abd
def remove(self): '\n Removes the widget from the hierarchy.\n ' parent = self.parent if (parent is not None): parent._children.remove(self) parent.layout_changed() self._parent = None
Removes the widget from the hierarchy.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
remove
OutHereVR/c4d-prototype-converter
29
python
def remove(self): '\n \n ' parent = self.parent if (parent is not None): parent._children.remove(self) parent.layout_changed() self._parent = None
def remove(self): '\n \n ' parent = self.parent if (parent is not None): parent._children.remove(self) parent.layout_changed() self._parent = None<|docstring|>Removes the widget from the hierarchy.<|endoftext|>
2028512a8c9f7db48a0f00aa76b47f1735d6b516e30d7a3110a995f5314ec0a0
def alloc_id(self, name=None): '\n Allocates a new, unused ID for a dialog element. If a *name* is specified,\n the returned ID will be saved under that name and can be retrieved using\n #get_named_id().\n ' manager = self.manager if (self._free_id_offset < len(self._allocated_ids)): res...
Allocates a new, unused ID for a dialog element. If a *name* is specified, the returned ID will be saved under that name and can be retrieved using #get_named_id().
lib/nr.c4d/src/nr/c4d/ui/native/base.py
alloc_id
OutHereVR/c4d-prototype-converter
29
python
def alloc_id(self, name=None): '\n Allocates a new, unused ID for a dialog element. If a *name* is specified,\n the returned ID will be saved under that name and can be retrieved using\n #get_named_id().\n ' manager = self.manager if (self._free_id_offset < len(self._allocated_ids)): res...
def alloc_id(self, name=None): '\n Allocates a new, unused ID for a dialog element. If a *name* is specified,\n the returned ID will be saved under that name and can be retrieved using\n #get_named_id().\n ' manager = self.manager if (self._free_id_offset < len(self._allocated_ids)): res...
4e5fc072b60841277196af1bbd2a1b697340f4ec3cfc369d6c9bb06b11f459af
def get_named_id(self, name, default=NotImplemented): '\n Returns the value of a named ID previously created with #alloc_id().\n Raises a #KeyError if the named ID does not exist. If *default* is\n specified, it will be returned instead of a #KeyError being raised.\n ' try: return self._name...
Returns the value of a named ID previously created with #alloc_id(). Raises a #KeyError if the named ID does not exist. If *default* is specified, it will be returned instead of a #KeyError being raised.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
get_named_id
OutHereVR/c4d-prototype-converter
29
python
def get_named_id(self, name, default=NotImplemented): '\n Returns the value of a named ID previously created with #alloc_id().\n Raises a #KeyError if the named ID does not exist. If *default* is\n specified, it will be returned instead of a #KeyError being raised.\n ' try: return self._name...
def get_named_id(self, name, default=NotImplemented): '\n Returns the value of a named ID previously created with #alloc_id().\n Raises a #KeyError if the named ID does not exist. If *default* is\n specified, it will be returned instead of a #KeyError being raised.\n ' try: return self._name...
d8319086ef9f4fd32c86926d42876e77c9b195b3fb512133579366c8fa31332b
def add_event_listener(self, name, func=None): '\n Adds an event listener. If *func* is omitted, returns a decorator.\n ' def decorator(func): self._listeners.setdefault(name, []).append(func) return func if (func is not None): decorator(func) return None else: ...
Adds an event listener. If *func* is omitted, returns a decorator.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
add_event_listener
OutHereVR/c4d-prototype-converter
29
python
def add_event_listener(self, name, func=None): '\n \n ' def decorator(func): self._listeners.setdefault(name, []).append(func) return func if (func is not None): decorator(func) return None else: return decorator
def add_event_listener(self, name, func=None): '\n \n ' def decorator(func): self._listeners.setdefault(name, []).append(func) return func if (func is not None): decorator(func) return None else: return decorator<|docstring|>Adds an event listener. If *func...
03ffdab3527bbf2617577b947efbde8af8937ebbf7f9e290c665223a78ceff32
def send_event(self, __name, *args, **kwargs): '\n Sends an event to all listeners listening to that event. If any listener\n returns a value evaluating to #True, the event is no longer propagated\n to any other listeners and #True will be returned. If no listener returns\n #True, #False is returned fro...
Sends an event to all listeners listening to that event. If any listener returns a value evaluating to #True, the event is no longer propagated to any other listeners and #True will be returned. If no listener returns #True, #False is returned from this function. A listener may return a generator object in which case ...
lib/nr.c4d/src/nr/c4d/ui/native/base.py
send_event
OutHereVR/c4d-prototype-converter
29
python
def send_event(self, __name, *args, **kwargs): '\n Sends an event to all listeners listening to that event. If any listener\n returns a value evaluating to #True, the event is no longer propagated\n to any other listeners and #True will be returned. If no listener returns\n #True, #False is returned fro...
def send_event(self, __name, *args, **kwargs): '\n Sends an event to all listeners listening to that event. If any listener\n returns a value evaluating to #True, the event is no longer propagated\n to any other listeners and #True will be returned. If no listener returns\n #True, #False is returned fro...
1ad8ba39cd8f47a6cf79b04f8e03692e2c08bdb0b497f31f9734d46cd609ed02
def save_state(self): '\n Save the state and value of the widget so it can be restored in the\n same way the next time the widget is rendered.\n ' pass
Save the state and value of the widget so it can be restored in the same way the next time the widget is rendered.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
save_state
OutHereVR/c4d-prototype-converter
29
python
def save_state(self): '\n Save the state and value of the widget so it can be restored in the\n same way the next time the widget is rendered.\n ' pass
def save_state(self): '\n Save the state and value of the widget so it can be restored in the\n same way the next time the widget is rendered.\n ' pass<|docstring|>Save the state and value of the widget so it can be restored in the same way the next time the widget is rendered.<|endoftext|>
a0cfd4db55ae02e83ff1d40f5c1695eb8fd2aaff2a1a1e8598d602db402fe47d
def on_render_begin(self): '\n This method is called on all widgets that are about to be rendered.\n ' self._free_id_offset = 0 self._named_ids.clear()
This method is called on all widgets that are about to be rendered.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
on_render_begin
OutHereVR/c4d-prototype-converter
29
python
def on_render_begin(self): '\n \n ' self._free_id_offset = 0 self._named_ids.clear()
def on_render_begin(self): '\n \n ' self._free_id_offset = 0 self._named_ids.clear()<|docstring|>This method is called on all widgets that are about to be rendered.<|endoftext|>
6feb61d8dfe45a3757d98653865490bf2370858f3005cb30c8f831093ba84803
@abc.abstractmethod def render(self, dialog): "\n Called to render the widget into the #c4d.gui.GeDialog. Widgets that\n encompass multiple Cinema 4D dialog elements should enclose them in\n their own group, unless explicitly documented for the widget.\n\n Not doing so can mess up layouts in groups that...
Called to render the widget into the #c4d.gui.GeDialog. Widgets that encompass multiple Cinema 4D dialog elements should enclose them in their own group, unless explicitly documented for the widget. Not doing so can mess up layouts in groups that have more than one column and/or row. # Example ```python def render(se...
lib/nr.c4d/src/nr/c4d/ui/native/base.py
render
OutHereVR/c4d-prototype-converter
29
python
@abc.abstractmethod def render(self, dialog): "\n Called to render the widget into the #c4d.gui.GeDialog. Widgets that\n encompass multiple Cinema 4D dialog elements should enclose them in\n their own group, unless explicitly documented for the widget.\n\n Not doing so can mess up layouts in groups that...
@abc.abstractmethod def render(self, dialog): "\n Called to render the widget into the #c4d.gui.GeDialog. Widgets that\n encompass multiple Cinema 4D dialog elements should enclose them in\n their own group, unless explicitly documented for the widget.\n\n Not doing so can mess up layouts in groups that...
330553f51a00ddff064e16cc3ccca8b9e3beb04d0b889a2a30cfe06bc4d3690f
def command_event(self, id, bc): '\n Called when a Command-event is received. Returns #True to mark the\n event has being handled and avoid further progression.\n ' pass
Called when a Command-event is received. Returns #True to mark the event has being handled and avoid further progression.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
command_event
OutHereVR/c4d-prototype-converter
29
python
def command_event(self, id, bc): '\n Called when a Command-event is received. Returns #True to mark the\n event has being handled and avoid further progression.\n ' pass
def command_event(self, id, bc): '\n Called when a Command-event is received. Returns #True to mark the\n event has being handled and avoid further progression.\n ' pass<|docstring|>Called when a Command-event is received. Returns #True to mark the event has being handled and avoid further progression....
40c3defd7cff86f0769d4164b4d91cf805f2d7f271e8893297722e1424b793e9
def input_event(self, bc): '\n Called when an Input-event is received. Returns #True to mark the\n event has being handled and avoid further progression.\n ' pass
Called when an Input-event is received. Returns #True to mark the event has being handled and avoid further progression.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
input_event
OutHereVR/c4d-prototype-converter
29
python
def input_event(self, bc): '\n Called when an Input-event is received. Returns #True to mark the\n event has being handled and avoid further progression.\n ' pass
def input_event(self, bc): '\n Called when an Input-event is received. Returns #True to mark the\n event has being handled and avoid further progression.\n ' pass<|docstring|>Called when an Input-event is received. Returns #True to mark the event has being handled and avoid further progression.<|endoft...
42ef4df59d05b99641fd70490ff4fcfeca485ba764faf5c614bbaf7e54968a2e
def layout_changed(self): "\n Should be called after a widget changed its properties. The default\n implementation will simply call the parent's #layout_changed() method,\n if there is a parent. The #WidgetManager will also be notified. At the\n next possible chance, the widget will be re-rendered (usua...
Should be called after a widget changed its properties. The default implementation will simply call the parent's #layout_changed() method, if there is a parent. The #WidgetManager will also be notified. At the next possible chance, the widget will be re-rendered (usually requiring a re-rendering of the whole parent gro...
lib/nr.c4d/src/nr/c4d/ui/native/base.py
layout_changed
OutHereVR/c4d-prototype-converter
29
python
def layout_changed(self): "\n Should be called after a widget changed its properties. The default\n implementation will simply call the parent's #layout_changed() method,\n if there is a parent. The #WidgetManager will also be notified. At the\n next possible chance, the widget will be re-rendered (usua...
def layout_changed(self): "\n Should be called after a widget changed its properties. The default\n implementation will simply call the parent's #layout_changed() method,\n if there is a parent. The #WidgetManager will also be notified. At the\n next possible chance, the widget will be re-rendered (usua...
dd874ea7fcaa5b9176d0894fe5919c8c6484e4ff3993ebe5449599e211a8d773
def update_state(self, dialog): '\n This function is called from #update() by default. It should perform a\n non-recursive update of the dialog. The default implementation updates\n the enabled and visibility state of the allocated widget IDs.\n ' changed = False parent = self.parent parent_...
This function is called from #update() by default. It should perform a non-recursive update of the dialog. The default implementation updates the enabled and visibility state of the allocated widget IDs.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
update_state
OutHereVR/c4d-prototype-converter
29
python
def update_state(self, dialog): '\n This function is called from #update() by default. It should perform a\n non-recursive update of the dialog. The default implementation updates\n the enabled and visibility state of the allocated widget IDs.\n ' changed = False parent = self.parent parent_...
def update_state(self, dialog): '\n This function is called from #update() by default. It should perform a\n non-recursive update of the dialog. The default implementation updates\n the enabled and visibility state of the allocated widget IDs.\n ' changed = False parent = self.parent parent_...
f31666fa21de700a16001ead1a7dffe37024193475f73109aeb324b8fa1b78c4
def update(self, dialog): '\n Called to update the visual of the element. Groups will use this to\n re-render their contents when their layout has changed.\n ' self.update_state(dialog)
Called to update the visual of the element. Groups will use this to re-render their contents when their layout has changed.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
update
OutHereVR/c4d-prototype-converter
29
python
def update(self, dialog): '\n Called to update the visual of the element. Groups will use this to\n re-render their contents when their layout has changed.\n ' self.update_state(dialog)
def update(self, dialog): '\n Called to update the visual of the element. Groups will use this to\n re-render their contents when their layout has changed.\n ' self.update_state(dialog)<|docstring|>Called to update the visual of the element. Groups will use this to re-render their contents when their l...
a88ad496faf206eda663912e084bd443b2feac63d93a26d905680615ba2ac3af
def pack(self, widget): '\n Adds a child widget.\n ' if (not isinstance(widget, BaseWidget)): raise TypeError('expected BaseWidget') widget.remove() widget.parent = self widget.manager = self.manager self._children.append(widget) self.layout_changed()
Adds a child widget.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
pack
OutHereVR/c4d-prototype-converter
29
python
def pack(self, widget): '\n \n ' if (not isinstance(widget, BaseWidget)): raise TypeError('expected BaseWidget') widget.remove() widget.parent = self widget.manager = self.manager self._children.append(widget) self.layout_changed()
def pack(self, widget): '\n \n ' if (not isinstance(widget, BaseWidget)): raise TypeError('expected BaseWidget') widget.remove() widget.parent = self widget.manager = self.manager self._children.append(widget) self.layout_changed()<|docstring|>Adds a child widget.<|endoftext|>
df00e0c76584252201b884c8c553bcb6c822268f167fb7d1f03eac158dac2ac3
def flush_children(self): '\n Removes all children.\n ' for child in self._children[:]: assert (child.parent is self), (child, parent) child.remove() assert (len(self._children) == 0)
Removes all children.
lib/nr.c4d/src/nr/c4d/ui/native/base.py
flush_children
OutHereVR/c4d-prototype-converter
29
python
def flush_children(self): '\n \n ' for child in self._children[:]: assert (child.parent is self), (child, parent) child.remove() assert (len(self._children) == 0)
def flush_children(self): '\n \n ' for child in self._children[:]: assert (child.parent is self), (child, parent) child.remove() assert (len(self._children) == 0)<|docstring|>Removes all children.<|endoftext|>
044a42e3e22fb4a7f60cb648d758e9e4aced605aedb22f8bae378ac469eead72
def download_zip(request): '\n [概要]\n excelファイルとエラーログファイルをまとめたzipファイルをダウンロード\n ' logger.logic_log('LOSI00001', ('manageid: %s, ruletypeid: %s' % (request['rule_manage_id'], request['ruletypeid']))) with DOWNLOAD_LOCK: manageid = request['rule_manage_id'] ruletypeid = request['rulety...
[概要] excelファイルとエラーログファイルをまとめたzipファイルをダウンロード
oase-root/backyards/apply_driver/oase_apply.py
download_zip
Masa-Yasuno/oase
9
python
def download_zip(request): '\n [概要]\n excelファイルとエラーログファイルをまとめたzipファイルをダウンロード\n ' logger.logic_log('LOSI00001', ('manageid: %s, ruletypeid: %s' % (request['rule_manage_id'], request['ruletypeid']))) with DOWNLOAD_LOCK: manageid = request['rule_manage_id'] ruletypeid = request['rulety...
def download_zip(request): '\n [概要]\n excelファイルとエラーログファイルをまとめたzipファイルをダウンロード\n ' logger.logic_log('LOSI00001', ('manageid: %s, ruletypeid: %s' % (request['rule_manage_id'], request['ruletypeid']))) with DOWNLOAD_LOCK: manageid = request['rule_manage_id'] ruletypeid = request['rulety...
4bfc3d0e8cde192e10e5a2b2e8560e13e0b57866c97801645cc8e1e426a4f044
def _get_downloadfile_info(ruletypeid, manageid, testrequestflag, request): '\n [概要]\n dtまたはdtとエラーログをまとめたzipファイルに必要な情報を取得\n [引数]\n ruletypeid : ルール種別id\n manageid : ルール管理id\n [戻り値]\n rule_file_id : ルール管理id\n rule_filename : ルールファイル名\n msg : エラーメッセージ\n\n ' disconnect() logger.lo...
[概要] dtまたはdtとエラーログをまとめたzipファイルに必要な情報を取得 [引数] ruletypeid : ルール種別id manageid : ルール管理id [戻り値] rule_file_id : ルール管理id rule_filename : ルールファイル名 msg : エラーメッセージ
oase-root/backyards/apply_driver/oase_apply.py
_get_downloadfile_info
Masa-Yasuno/oase
9
python
def _get_downloadfile_info(ruletypeid, manageid, testrequestflag, request): '\n [概要]\n dtまたはdtとエラーログをまとめたzipファイルに必要な情報を取得\n [引数]\n ruletypeid : ルール種別id\n manageid : ルール管理id\n [戻り値]\n rule_file_id : ルール管理id\n rule_filename : ルールファイル名\n msg : エラーメッセージ\n\n ' disconnect() logger.lo...
def _get_downloadfile_info(ruletypeid, manageid, testrequestflag, request): '\n [概要]\n dtまたはdtとエラーログをまとめたzipファイルに必要な情報を取得\n [引数]\n ruletypeid : ルール種別id\n manageid : ルール管理id\n [戻り値]\n rule_file_id : ルール管理id\n rule_filename : ルールファイル名\n msg : エラーメッセージ\n\n ' disconnect() logger.lo...
474ba47447e214fd8b57eacdecfa91d09e10887375d60834354e6a27f88caf7c
def _get_zipfile(rule_filepath, errlog_filepath, dstpath, filename): '\n [概要]\n 引数の情報からzipファイルを作成してzipファイルパスを返す\n ファイルが存在しない場合は return None\n [引数]\n rule_filepath : ルールファイルのパス\n errlog_filepath : エラーログファイルのパス\n dstpath : 保存先のパス\n filename : 保存ファイル名\n ' disconnect() logger.logic_lo...
[概要] 引数の情報からzipファイルを作成してzipファイルパスを返す ファイルが存在しない場合は return None [引数] rule_filepath : ルールファイルのパス errlog_filepath : エラーログファイルのパス dstpath : 保存先のパス filename : 保存ファイル名
oase-root/backyards/apply_driver/oase_apply.py
_get_zipfile
Masa-Yasuno/oase
9
python
def _get_zipfile(rule_filepath, errlog_filepath, dstpath, filename): '\n [概要]\n 引数の情報からzipファイルを作成してzipファイルパスを返す\n ファイルが存在しない場合は return None\n [引数]\n rule_filepath : ルールファイルのパス\n errlog_filepath : エラーログファイルのパス\n dstpath : 保存先のパス\n filename : 保存ファイル名\n ' disconnect() logger.logic_lo...
def _get_zipfile(rule_filepath, errlog_filepath, dstpath, filename): '\n [概要]\n 引数の情報からzipファイルを作成してzipファイルパスを返す\n ファイルが存在しない場合は return None\n [引数]\n rule_filepath : ルールファイルのパス\n errlog_filepath : エラーログファイルのパス\n dstpath : 保存先のパス\n filename : 保存ファイル名\n ' disconnect() logger.logic_lo...
ce70a22a6361edf234433d58c2a6acb75963fe37d94ada4794b4b60c3a6e55d6
def get_dm_conf(): '\n [概要]\n DecisionManagerの設定値を取得する\n [戻り値]\n protocol : str プロトコル\n ipaddress : str ipアドレス\n dmuser : str DecisionManagerのユーザ名\n dmpass : str DecisionManagerのパスワード\n ' logger.logic_log('LOSI00001', 'None') rset = list(System.objects.filter(category='DMSETTINGS').v...
[概要] DecisionManagerの設定値を取得する [戻り値] protocol : str プロトコル ipaddress : str ipアドレス dmuser : str DecisionManagerのユーザ名 dmpass : str DecisionManagerのパスワード
oase-root/backyards/apply_driver/oase_apply.py
get_dm_conf
Masa-Yasuno/oase
9
python
def get_dm_conf(): '\n [概要]\n DecisionManagerの設定値を取得する\n [戻り値]\n protocol : str プロトコル\n ipaddress : str ipアドレス\n dmuser : str DecisionManagerのユーザ名\n dmpass : str DecisionManagerのパスワード\n ' logger.logic_log('LOSI00001', 'None') rset = list(System.objects.filter(category='DMSETTINGS').v...
def get_dm_conf(): '\n [概要]\n DecisionManagerの設定値を取得する\n [戻り値]\n protocol : str プロトコル\n ipaddress : str ipアドレス\n dmuser : str DecisionManagerのユーザ名\n dmpass : str DecisionManagerのパスワード\n ' logger.logic_log('LOSI00001', 'None') rset = list(System.objects.filter(category='DMSETTINGS').v...
b295381cb1019355eda40e2b397af59b773ef389826b2437fdcfd54e5499ab07
def load_settings(): '\n [メソッド概要]\n 適用君設定情報を読み込む\n ' disconnect() logger.logic_log('LOSI00001', 'None') apply_settings = {} apply_settings['host'] = '127.0.0.1' apply_settings['port'] = 50001 rset = list(System.objects.filter(category='APPLYSETTINGS').values('config_id', 'value'))...
[メソッド概要] 適用君設定情報を読み込む
oase-root/backyards/apply_driver/oase_apply.py
load_settings
Masa-Yasuno/oase
9
python
def load_settings(): '\n [メソッド概要]\n 適用君設定情報を読み込む\n ' disconnect() logger.logic_log('LOSI00001', 'None') apply_settings = {} apply_settings['host'] = '127.0.0.1' apply_settings['port'] = 50001 rset = list(System.objects.filter(category='APPLYSETTINGS').values('config_id', 'value'))...
def load_settings(): '\n [メソッド概要]\n 適用君設定情報を読み込む\n ' disconnect() logger.logic_log('LOSI00001', 'None') apply_settings = {} apply_settings['host'] = '127.0.0.1' apply_settings['port'] = 50001 rset = list(System.objects.filter(category='APPLYSETTINGS').values('config_id', 'value'))...
42fbebfdd1259c11ab96fefc82d1ca042ca4cc98d7e3a1d154c0b7669e91f46f
def flatten_list_abundance(node: ListAbundance) -> ListAbundance: 'Flattens the complex or composite abundance.' return node.__class__(list(chain.from_iterable(((flatten_list_abundance(member).members if isinstance(member, ListAbundance) else [member]) for member in node.members))))
Flattens the complex or composite abundance.
src/pybel/struct/node_utils.py
flatten_list_abundance
djinnome/pybel
103
python
def flatten_list_abundance(node: ListAbundance) -> ListAbundance: return node.__class__(list(chain.from_iterable(((flatten_list_abundance(member).members if isinstance(member, ListAbundance) else [member]) for member in node.members))))
def flatten_list_abundance(node: ListAbundance) -> ListAbundance: return node.__class__(list(chain.from_iterable(((flatten_list_abundance(member).members if isinstance(member, ListAbundance) else [member]) for member in node.members))))<|docstring|>Flattens the complex or composite abundance.<|endoftext|>
3f07ad3df5d10be554d4e7eeb66c02eae78a48e4e540dd1ac87d4e0e7eb6a0bf
def list_abundance_expansion(graph) -> None: 'Flatten list abundances.' mapping = {node: flatten_list_abundance(node) for node in graph if isinstance(node, ListAbundance)} relabel_nodes(graph, mapping, copy=False)
Flatten list abundances.
src/pybel/struct/node_utils.py
list_abundance_expansion
djinnome/pybel
103
python
def list_abundance_expansion(graph) -> None: mapping = {node: flatten_list_abundance(node) for node in graph if isinstance(node, ListAbundance)} relabel_nodes(graph, mapping, copy=False)
def list_abundance_expansion(graph) -> None: mapping = {node: flatten_list_abundance(node) for node in graph if isinstance(node, ListAbundance)} relabel_nodes(graph, mapping, copy=False)<|docstring|>Flatten list abundances.<|endoftext|>
1a647cf883dcc4e7732e565855ecee765c06c258ad11596117da06bd2c022a83
def list_abundance_cartesian_expansion(graph) -> None: 'Expand all list abundances to simple subject-predicate-object networks.' for (u, v, d) in list(graph.edges(data=True)): if (CITATION not in d): continue if (isinstance(u, ListAbundance) and isinstance(v, ListAbundance)): ...
Expand all list abundances to simple subject-predicate-object networks.
src/pybel/struct/node_utils.py
list_abundance_cartesian_expansion
djinnome/pybel
103
python
def list_abundance_cartesian_expansion(graph) -> None: for (u, v, d) in list(graph.edges(data=True)): if (CITATION not in d): continue if (isinstance(u, ListAbundance) and isinstance(v, ListAbundance)): for (u_member, v_member) in itt.product(u.members, v.members): ...
def list_abundance_cartesian_expansion(graph) -> None: for (u, v, d) in list(graph.edges(data=True)): if (CITATION not in d): continue if (isinstance(u, ListAbundance) and isinstance(v, ListAbundance)): for (u_member, v_member) in itt.product(u.members, v.members): ...
564f2b2fa84828b9622212683b0e3bcd5ec14c7204bdac63c8600e4e6e0efee0
def _reaction_cartesian_expansion_unqualified_helper(graph, u: BaseEntity, v: BaseEntity, d: dict) -> None: 'Help deal with cartesian expansion in unqualified edges.' if (isinstance(u, Reaction) and isinstance(v, Reaction)): enzymes = (_get_catalysts_in_reaction(u) | _get_catalysts_in_reaction(v)) ...
Help deal with cartesian expansion in unqualified edges.
src/pybel/struct/node_utils.py
_reaction_cartesian_expansion_unqualified_helper
djinnome/pybel
103
python
def _reaction_cartesian_expansion_unqualified_helper(graph, u: BaseEntity, v: BaseEntity, d: dict) -> None: if (isinstance(u, Reaction) and isinstance(v, Reaction)): enzymes = (_get_catalysts_in_reaction(u) | _get_catalysts_in_reaction(v)) for (reactant, product) in chain(itt.product(u.reactant...
def _reaction_cartesian_expansion_unqualified_helper(graph, u: BaseEntity, v: BaseEntity, d: dict) -> None: if (isinstance(u, Reaction) and isinstance(v, Reaction)): enzymes = (_get_catalysts_in_reaction(u) | _get_catalysts_in_reaction(v)) for (reactant, product) in chain(itt.product(u.reactant...
c39fc07c83ab28f22df537c6f8770a45d1ff80258ce7675438b34e54f3dd38e9
def _get_catalysts_in_reaction(reaction: Reaction) -> Set[BaseAbundance]: 'Return nodes that are both in reactants and reactions in a reaction.' return set(reaction.reactants).intersection(reaction.products)
Return nodes that are both in reactants and reactions in a reaction.
src/pybel/struct/node_utils.py
_get_catalysts_in_reaction
djinnome/pybel
103
python
def _get_catalysts_in_reaction(reaction: Reaction) -> Set[BaseAbundance]: return set(reaction.reactants).intersection(reaction.products)
def _get_catalysts_in_reaction(reaction: Reaction) -> Set[BaseAbundance]: return set(reaction.reactants).intersection(reaction.products)<|docstring|>Return nodes that are both in reactants and reactions in a reaction.<|endoftext|>
01b8ad0e1e7352eaad8b37324cf25f597a0f8c666603945f61d613724f3577a1
def reaction_cartesian_expansion(graph, accept_unqualified_edges: bool=True) -> None: 'Expand all reactions to simple subject-predicate-object networks.' for (u, v, d) in list(graph.edges(data=True)): if ((CITATION not in d) and accept_unqualified_edges): _reaction_cartesian_expansion_unqual...
Expand all reactions to simple subject-predicate-object networks.
src/pybel/struct/node_utils.py
reaction_cartesian_expansion
djinnome/pybel
103
python
def reaction_cartesian_expansion(graph, accept_unqualified_edges: bool=True) -> None: for (u, v, d) in list(graph.edges(data=True)): if ((CITATION not in d) and accept_unqualified_edges): _reaction_cartesian_expansion_unqualified_helper(graph, u, v, d) continue if (isins...
def reaction_cartesian_expansion(graph, accept_unqualified_edges: bool=True) -> None: for (u, v, d) in list(graph.edges(data=True)): if ((CITATION not in d) and accept_unqualified_edges): _reaction_cartesian_expansion_unqualified_helper(graph, u, v, d) continue if (isins...
6b556257a4baf0f02a68976484d24de8dedd93e1ebab55f739ea8dfd53306dc3
def remove_reified_nodes(graph) -> None: 'Remove complex nodes.' _remove_list_abundance_nodes(graph) _remove_reaction_nodes(graph)
Remove complex nodes.
src/pybel/struct/node_utils.py
remove_reified_nodes
djinnome/pybel
103
python
def remove_reified_nodes(graph) -> None: _remove_list_abundance_nodes(graph) _remove_reaction_nodes(graph)
def remove_reified_nodes(graph) -> None: _remove_list_abundance_nodes(graph) _remove_reaction_nodes(graph)<|docstring|>Remove complex nodes.<|endoftext|>
5a47926d7c2b37c2d20481790bf0253d99aad3d900988fb21394ab6d9ba1be4b
def __init__(self, xdata, ydata, fig, axes): '\n :param xdata, ydata: - line points\n :param fig: - matplotlib figure\n :param axes: - matplotlib axes\n ' self.hLine = mlines.Line2D(xdata, ydata, linewidth=4, color='b', picker=5, zorder=10) self.hFig = fig self.hAxes = axes ...
:param xdata, ydata: - line points :param fig: - matplotlib figure :param axes: - matplotlib axes
robot/robot_engine/border.py
__init__
Sherevv/robot
0
python
def __init__(self, xdata, ydata, fig, axes): '\n :param xdata, ydata: - line points\n :param fig: - matplotlib figure\n :param axes: - matplotlib axes\n ' self.hLine = mlines.Line2D(xdata, ydata, linewidth=4, color='b', picker=5, zorder=10) self.hFig = fig self.hAxes = axes ...
def __init__(self, xdata, ydata, fig, axes): '\n :param xdata, ydata: - line points\n :param fig: - matplotlib figure\n :param axes: - matplotlib axes\n ' self.hLine = mlines.Line2D(xdata, ydata, linewidth=4, color='b', picker=5, zorder=10) self.hFig = fig self.hAxes = axes ...
0d7aba401093a886432a0f5cbffba7b026a616f9608891a8c9d1c91f0963d602
def delete(self): '\n Removes the border\n Records the change of scene (adds * to the end of the window title)\n ' self.hAxes.lines.remove(self.hLine) add_star_to_end(self.hFig)
Removes the border Records the change of scene (adds * to the end of the window title)
robot/robot_engine/border.py
delete
Sherevv/robot
0
python
def delete(self): '\n Removes the border\n Records the change of scene (adds * to the end of the window title)\n ' self.hAxes.lines.remove(self.hLine) add_star_to_end(self.hFig)
def delete(self): '\n Removes the border\n Records the change of scene (adds * to the end of the window title)\n ' self.hAxes.lines.remove(self.hLine) add_star_to_end(self.hFig)<|docstring|>Removes the border Records the change of scene (adds * to the end of the window title)<|endoftext...
837c065a0d696251197693d84c45d4d5850c1d536a0f16befc2ca4854b9d1882
def get_base_data(expe_name=None): '\n Used to store default data to send for each view\n ' data = {} data['BASE'] = settings.WEB_PREFIX_URL return data
Used to store default data to send for each view
links/views.py
get_base_data
prise-3d/SIN3D-launcher
0
python
def get_base_data(expe_name=None): '\n \n ' data = {} data['BASE'] = settings.WEB_PREFIX_URL return data
def get_base_data(expe_name=None): '\n \n ' data = {} data['BASE'] = settings.WEB_PREFIX_URL return data<|docstring|>Used to store default data to send for each view<|endoftext|>