body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def test_align_no_blank_columns(self):
'correctly handle a file with no white space at line starts'
parser = MinimalNexusAlignParser('data/nexus_aa.nxs')
seqs = {n: s for (n, s) in parser}
self.assertEqual(len(seqs), 10)
lengths = set((len(seqs[n]) for n in seqs))
self.assertEqual(lengths, {234}... | 7,375,363,045,367,535,000 | correctly handle a file with no white space at line starts | tests/test_parse/test_nexus.py | test_align_no_blank_columns | tla256/cogent3 | python | def test_align_no_blank_columns(self):
parser = MinimalNexusAlignParser('data/nexus_aa.nxs')
seqs = {n: s for (n, s) in parser}
self.assertEqual(len(seqs), 10)
lengths = set((len(seqs[n]) for n in seqs))
self.assertEqual(lengths, {234}) |
def test_load_seqs_interface(self):
'load_aligned_seqs correctly loads nexus alignments'
aln = load_aligned_seqs('data/nexus_mixed.nex')
self.assertEqual(aln.num_seqs, 4)
self.assertEqual(len(aln), 20)
aln = load_aligned_seqs('data/nexus_aa.nxs')
self.assertEqual(aln.num_seqs, 10)
self.asser... | 5,215,797,518,133,954,000 | load_aligned_seqs correctly loads nexus alignments | tests/test_parse/test_nexus.py | test_load_seqs_interface | tla256/cogent3 | python | def test_load_seqs_interface(self):
aln = load_aligned_seqs('data/nexus_mixed.nex')
self.assertEqual(aln.num_seqs, 4)
self.assertEqual(len(aln), 20)
aln = load_aligned_seqs('data/nexus_aa.nxs')
self.assertEqual(aln.num_seqs, 10)
self.assertEqual(len(aln), 234) |
def _set_cdc_on_table(session, table_name, value, ks_name=None):
'\n Uses <session> to set CDC to <value> on <ks_name>.<table_name>.\n '
table_string = (((ks_name + '.') + table_name) if ks_name else table_name)
value_string = ('true' if value else 'false')
stmt = ((('ALTER TABLE ' + table_string)... | 3,866,652,390,675,072,000 | Uses <session> to set CDC to <value> on <ks_name>.<table_name>. | cdc_test.py | _set_cdc_on_table | Ankou76ers/cassandra-dtest | python | def _set_cdc_on_table(session, table_name, value, ks_name=None):
'\n \n '
table_string = (((ks_name + '.') + table_name) if ks_name else table_name)
value_string = ('true' if value else 'false')
stmt = ((('ALTER TABLE ' + table_string) + ' WITH CDC = ') + value_string)
logger.debug(stmt)
s... |
def _get_set_cdc_func(session, ks_name, table_name):
'\n Close over a session, keyspace name, and table name and return a function\n that takes enables CDC on that keyspace if its argument is truthy and\n otherwise disables it.\n '
def set_cdc(value):
return _set_cdc_on_table(session=sessio... | 4,794,727,932,145,934,000 | Close over a session, keyspace name, and table name and return a function
that takes enables CDC on that keyspace if its argument is truthy and
otherwise disables it. | cdc_test.py | _get_set_cdc_func | Ankou76ers/cassandra-dtest | python | def _get_set_cdc_func(session, ks_name, table_name):
'\n Close over a session, keyspace name, and table name and return a function\n that takes enables CDC on that keyspace if its argument is truthy and\n otherwise disables it.\n '
def set_cdc(value):
return _set_cdc_on_table(session=sessio... |
def _create_temp_dir(self, dir_name, verbose=True):
'\n Create a directory that will be deleted when this test class is torn\n down.\n '
if verbose:
logger.debug(('creating ' + dir_name))
try:
os.mkdir(dir_name)
except OSError as e:
if (e.errno != errno.EEXIS... | -3,564,366,202,013,176,300 | Create a directory that will be deleted when this test class is torn
down. | cdc_test.py | _create_temp_dir | Ankou76ers/cassandra-dtest | python | def _create_temp_dir(self, dir_name, verbose=True):
'\n Create a directory that will be deleted when this test class is torn\n down.\n '
if verbose:
logger.debug(('creating ' + dir_name))
try:
os.mkdir(dir_name)
except OSError as e:
if (e.errno != errno.EEXIS... |
def prepare(self, ks_name, table_name=None, cdc_enabled_table=None, gc_grace_seconds=None, column_spec=None, configuration_overrides=None, table_id=None):
"\n Create a 1-node cluster, start it, create a keyspace, and if\n <table_name>, create a table in that keyspace. If <cdc_enabled_table>,\n ... | 5,382,586,513,136,337,000 | Create a 1-node cluster, start it, create a keyspace, and if
<table_name>, create a table in that keyspace. If <cdc_enabled_table>,
that table is created with CDC enabled. If <column_spec>, use that
string to specify the schema of the table -- for example, a valid value
is 'a int PRIMARY KEY, b int'. The <configuration... | cdc_test.py | prepare | Ankou76ers/cassandra-dtest | python | def prepare(self, ks_name, table_name=None, cdc_enabled_table=None, gc_grace_seconds=None, column_spec=None, configuration_overrides=None, table_id=None):
"\n Create a 1-node cluster, start it, create a keyspace, and if\n <table_name>, create a table in that keyspace. If <cdc_enabled_table>,\n ... |
def _assert_cdc_data_readable_on_round_trip(self, start_with_cdc_enabled):
'\n Parameterized test asserting that data written to a table is still\n readable after flipping the CDC flag on that table, then flipping it\n again. Starts with CDC enabled if start_with_cdc_enabled, otherwise\n ... | -7,486,889,407,550,058,000 | Parameterized test asserting that data written to a table is still
readable after flipping the CDC flag on that table, then flipping it
again. Starts with CDC enabled if start_with_cdc_enabled, otherwise
starts with it disabled. | cdc_test.py | _assert_cdc_data_readable_on_round_trip | Ankou76ers/cassandra-dtest | python | def _assert_cdc_data_readable_on_round_trip(self, start_with_cdc_enabled):
'\n Parameterized test asserting that data written to a table is still\n readable after flipping the CDC flag on that table, then flipping it\n again. Starts with CDC enabled if start_with_cdc_enabled, otherwise\n ... |
def test_cdc_enabled_data_readable_on_round_trip(self):
'\n Test that data is readable after an enabled->disabled->enabled round\n trip.\n '
self._assert_cdc_data_readable_on_round_trip(start_with_cdc_enabled=True) | 8,841,384,700,411,847,000 | Test that data is readable after an enabled->disabled->enabled round
trip. | cdc_test.py | test_cdc_enabled_data_readable_on_round_trip | Ankou76ers/cassandra-dtest | python | def test_cdc_enabled_data_readable_on_round_trip(self):
'\n Test that data is readable after an enabled->disabled->enabled round\n trip.\n '
self._assert_cdc_data_readable_on_round_trip(start_with_cdc_enabled=True) |
def test_cdc_disabled_data_readable_on_round_trip(self):
'\n Test that data is readable after an disabled->enabled->disabled round\n trip.\n '
self._assert_cdc_data_readable_on_round_trip(start_with_cdc_enabled=False) | 6,506,598,792,747,785,000 | Test that data is readable after an disabled->enabled->disabled round
trip. | cdc_test.py | test_cdc_disabled_data_readable_on_round_trip | Ankou76ers/cassandra-dtest | python | def test_cdc_disabled_data_readable_on_round_trip(self):
'\n Test that data is readable after an disabled->enabled->disabled round\n trip.\n '
self._assert_cdc_data_readable_on_round_trip(start_with_cdc_enabled=False) |
def test_non_cdc_segments_deleted_after_replay(self):
'\n Test that non-cdc segment files generated in previous runs are deleted\n after replay.\n '
(ks_name, table_name) = ('ks', 'tab')
(node, session) = self.prepare(ks_name=ks_name, table_name=table_name, cdc_enabled_table=True, colum... | -2,039,349,003,963,691,000 | Test that non-cdc segment files generated in previous runs are deleted
after replay. | cdc_test.py | test_non_cdc_segments_deleted_after_replay | Ankou76ers/cassandra-dtest | python | def test_non_cdc_segments_deleted_after_replay(self):
'\n Test that non-cdc segment files generated in previous runs are deleted\n after replay.\n '
(ks_name, table_name) = ('ks', 'tab')
(node, session) = self.prepare(ks_name=ks_name, table_name=table_name, cdc_enabled_table=True, colum... |
def test_insertion_and_commitlog_behavior_after_reaching_cdc_total_space(self):
'\n Test that C* behaves correctly when CDC tables have consumed all the\n space available to them. In particular: after writing\n cdc_total_space_in_mb MB into CDC commitlogs:\n - CDC writes are rejected\n ... | 6,291,607,521,855,861,000 | Test that C* behaves correctly when CDC tables have consumed all the
space available to them. In particular: after writing
cdc_total_space_in_mb MB into CDC commitlogs:
- CDC writes are rejected
- non-CDC writes are accepted
- on flush, CDC commitlogs are copied to cdc_raw
- on flush, non-CDC commitlogs are not copied ... | cdc_test.py | test_insertion_and_commitlog_behavior_after_reaching_cdc_total_space | Ankou76ers/cassandra-dtest | python | def test_insertion_and_commitlog_behavior_after_reaching_cdc_total_space(self):
'\n Test that C* behaves correctly when CDC tables have consumed all the\n space available to them. In particular: after writing\n cdc_total_space_in_mb MB into CDC commitlogs:\n - CDC writes are rejected\n ... |
def logger(self):
'Setup logging and return the logger'
logging.config.dictConfig(self.logging)
mylogger = getLogger('hazelsync')
mylogger.debug('Logger initialized')
return mylogger | 3,415,069,736,334,545,000 | Setup logging and return the logger | hazelsync/settings.py | logger | Japannext/hazelsync | python | def logger(self):
logging.config.dictConfig(self.logging)
mylogger = getLogger('hazelsync')
mylogger.debug('Logger initialized')
return mylogger |
def job(self, job_type: str) -> dict:
'Return defaults for a job type'
return self.job_options.get(job_type, {}) | -2,602,378,712,164,210,000 | Return defaults for a job type | hazelsync/settings.py | job | Japannext/hazelsync | python | def job(self, job_type: str) -> dict:
return self.job_options.get(job_type, {}) |
def backend(self, backend_type: str) -> dict:
'Return defaults for a backend type'
return self.backend_options.get(backend_type, {}) | 4,074,459,888,001,224,700 | Return defaults for a backend type | hazelsync/settings.py | backend | Japannext/hazelsync | python | def backend(self, backend_type: str) -> dict:
return self.backend_options.get(backend_type, {}) |
@staticmethod
def list() -> dict:
'List the backup cluster found in the settings'
settings = {}
for path in ClusterSettings.directory.glob('*.yaml'):
cluster = path.stem
settings[cluster] = {'path': path}
try:
settings[cluster]['config_status'] = 'success'
except ... | 863,354,750,726,884,600 | List the backup cluster found in the settings | hazelsync/settings.py | list | Japannext/hazelsync | python | @staticmethod
def list() -> dict:
settings = {}
for path in ClusterSettings.directory.glob('*.yaml'):
cluster = path.stem
settings[cluster] = {'path': path}
try:
settings[cluster]['config_status'] = 'success'
except KeyError as err:
log.error(err)
... |
def job(self):
'Return the job options (merged with defaults)'
defaults = self.globals.job(self.job_type)
options = self.job_options
return (self.job_type, {**defaults, **options}) | -1,912,766,609,994,605,800 | Return the job options (merged with defaults) | hazelsync/settings.py | job | Japannext/hazelsync | python | def job(self):
defaults = self.globals.job(self.job_type)
options = self.job_options
return (self.job_type, {**defaults, **options}) |
def backend(self):
'Return the backend option (merged with defaults)'
defaults = self.globals.backend(self.backend_type)
options = self.backend_options
return (self.backend_type, {**defaults, **options}) | 6,782,587,185,357,458,000 | Return the backend option (merged with defaults) | hazelsync/settings.py | backend | Japannext/hazelsync | python | def backend(self):
defaults = self.globals.backend(self.backend_type)
options = self.backend_options
return (self.backend_type, {**defaults, **options}) |
def get_value(self):
'\n @summary: 返回 SetDetailData 对象\n @note: 引用集群资源变量某一列某一行的属性,如 ${value.bk_set_name[0]} -> "集群1"\n @note: 引用集群资源变量某一列的全部属性,多行用换行符 `\n` 分隔,如 ${value.flat__bk_set_name} -> "集群1\n集群2"\n @note: 引用集群资源变量的模块分配的 IP ${value._module[0]["gamesvr"]} -> "127.0.0.1,127.0.0.2"\n ... | -347,988,065,715,103,740 | @summary: 返回 SetDetailData 对象
@note: 引用集群资源变量某一列某一行的属性,如 ${value.bk_set_name[0]} -> "集群1"
@note: 引用集群资源变量某一列的全部属性,多行用换行符 `
` 分隔,如 ${value.flat__bk_set_name} -> "集群1
集群2"
@note: 引用集群资源变量的模块分配的 IP ${value._module[0]["gamesvr"]} -> "127.0.0.1,127.0.0.2"
@return: | pipeline_plugins/variables/collections/sites/open/cc.py | get_value | springborland/bk-sops | python | def get_value(self):
'\n @summary: 返回 SetDetailData 对象\n @note: 引用集群资源变量某一列某一行的属性,如 ${value.bk_set_name[0]} -> "集群1"\n @note: 引用集群资源变量某一列的全部属性,多行用换行符 `\n` 分隔,如 ${value.flat__bk_set_name} -> "集群1\n集群2"\n @note: 引用集群资源变量的模块分配的 IP ${value._module[0]["gamesvr"]} -> "127.0.0.1,127.0.0.2"\n ... |
def get_value(self):
'\n @summary: 返回 dict 对象,将每个可从CMDB查询到的输入IP作为键,将从CMDB查询到的主机属性封装成字典作为值\n @note: 引用127.0.0.1的所有属性,如 ${value["127.0.0.1"]} -> {"bk_host_id": 999, "import_from": 3, ...}\n @note: 引用127.0.0.1的bk_host_id属性,如 ${value["127.0.0.1"]["bk_host_id"]} -> 999\n @return:\n '
... | 7,958,199,696,952,713,000 | @summary: 返回 dict 对象,将每个可从CMDB查询到的输入IP作为键,将从CMDB查询到的主机属性封装成字典作为值
@note: 引用127.0.0.1的所有属性,如 ${value["127.0.0.1"]} -> {"bk_host_id": 999, "import_from": 3, ...}
@note: 引用127.0.0.1的bk_host_id属性,如 ${value["127.0.0.1"]["bk_host_id"]} -> 999
@return: | pipeline_plugins/variables/collections/sites/open/cc.py | get_value | springborland/bk-sops | python | def get_value(self):
'\n @summary: 返回 dict 对象,将每个可从CMDB查询到的输入IP作为键,将从CMDB查询到的主机属性封装成字典作为值\n @note: 引用127.0.0.1的所有属性,如 ${value["127.0.0.1"]} -> {"bk_host_id": 999, "import_from": 3, ...}\n @note: 引用127.0.0.1的bk_host_id属性,如 ${value["127.0.0.1"]["bk_host_id"]} -> 999\n @return:\n '
... |
@pytest.fixture(scope='module')
def storage_cluster(api, request):
'Specific storage cluster.\n\n :param api: api\n :param request: pytest request\n\n :raises RuntimeError: Unknown cluster name\n :return: cluster box\n '
cluster_name = request.param
cluster = None
if (cluster_name != 'DEF... | 5,424,851,730,693,390,000 | Specific storage cluster.
:param api: api
:param request: pytest request
:raises RuntimeError: Unknown cluster name
:return: cluster box | tests/fixtures/account.py | storage_cluster | agolovkina/sdk-python | python | @pytest.fixture(scope='module')
def storage_cluster(api, request):
'Specific storage cluster.\n\n :param api: api\n :param request: pytest request\n\n :raises RuntimeError: Unknown cluster name\n :return: cluster box\n '
cluster_name = request.param
cluster = None
if (cluster_name != 'DEF... |
def create_account(api, account_name: str) -> Tuple[(Box, Box)]:
'Create new account.\n\n :param api: api\n :param account_name: account name\n :raises RuntimeError: Cant find account\n :return: user params\n '
QueryO(api=api, url='/account/add', request_data={'name': account_name}, errors_mappin... | 1,231,547,780,667,811,600 | Create new account.
:param api: api
:param account_name: account name
:raises RuntimeError: Cant find account
:return: user params | tests/fixtures/account.py | create_account | agolovkina/sdk-python | python | def create_account(api, account_name: str) -> Tuple[(Box, Box)]:
'Create new account.\n\n :param api: api\n :param account_name: account name\n :raises RuntimeError: Cant find account\n :return: user params\n '
QueryO(api=api, url='/account/add', request_data={'name': account_name}, errors_mappin... |
def account_studies(api, account) -> List[Box]:
'List of account studies.\n\n :param api: api\n :param account: account\n :return: list of studies\n '
account_namespaces = [account.namespace_id]
group_namespaces = [group.namespace_id for group in api.Group.list(account_id=account.uuid).only(Gro... | 3,311,823,025,680,647,700 | List of account studies.
:param api: api
:param account: account
:return: list of studies | tests/fixtures/account.py | account_studies | agolovkina/sdk-python | python | def account_studies(api, account) -> List[Box]:
'List of account studies.\n\n :param api: api\n :param account: account\n :return: list of studies\n '
account_namespaces = [account.namespace_id]
group_namespaces = [group.namespace_id for group in api.Group.list(account_id=account.uuid).only(Gro... |
def delete_account(api, account) -> Box:
'Delete account.\n\n :param api: api\n :param account: account\n :raises RuntimeError: if account have undeleted studies\n '
try:
QueryO(api=api, url='/account/delete/', request_data={'uuid': account.uuid}, errors_mapping={'NOT_EMPTY': NotEmpty()}, re... | -5,036,035,843,466,138,000 | Delete account.
:param api: api
:param account: account
:raises RuntimeError: if account have undeleted studies | tests/fixtures/account.py | delete_account | agolovkina/sdk-python | python | def delete_account(api, account) -> Box:
'Delete account.\n\n :param api: api\n :param account: account\n :raises RuntimeError: if account have undeleted studies\n '
try:
QueryO(api=api, url='/account/delete/', request_data={'uuid': account.uuid}, errors_mapping={'NOT_EMPTY': NotEmpty()}, re... |
def clear_studies(api, account):
'Delete account studies.\n\n :param api: api\n :param account: account\n '
account_namespaces = [account.namespace_id]
group_namespaces = [group.namespace_id for group in api.Group.list(account_id=account.uuid).only(Group.namespace_id).all()]
account_namespaces.... | -3,648,538,665,187,540,500 | Delete account studies.
:param api: api
:param account: account | tests/fixtures/account.py | clear_studies | agolovkina/sdk-python | python | def clear_studies(api, account):
'Delete account studies.\n\n :param api: api\n :param account: account\n '
account_namespaces = [account.namespace_id]
group_namespaces = [group.namespace_id for group in api.Group.list(account_id=account.uuid).only(Group.namespace_id).all()]
account_namespaces.... |
@pytest.fixture(scope='module')
def account(api, storage_cluster):
'Get account.\n\n :param api: ambra api\n :param storage_cluster: storage cluster\n\n :yields: test account\n\n :raises RuntimeError: On deleted account with existing studies\n :raises TimeoutError: Time for waiting account deletion i... | -804,873,413,144,816,600 | Get account.
:param api: ambra api
:param storage_cluster: storage cluster
:yields: test account
:raises RuntimeError: On deleted account with existing studies
:raises TimeoutError: Time for waiting account deletion is out | tests/fixtures/account.py | account | agolovkina/sdk-python | python | @pytest.fixture(scope='module')
def account(api, storage_cluster):
'Get account.\n\n :param api: ambra api\n :param storage_cluster: storage cluster\n\n :yields: test account\n\n :raises RuntimeError: On deleted account with existing studies\n :raises TimeoutError: Time for waiting account deletion i... |
@pytest.fixture
def create_group(api, account):
'Create new group in account.\n\n :param api: api fixture\n :param account: account fixture\n :yields: create_group function\n '
groups = []
group_counter = 0
def _create_group(name: Optional[str]=None):
nonlocal group_counter
... | -1,279,402,041,010,284,300 | Create new group in account.
:param api: api fixture
:param account: account fixture
:yields: create_group function | tests/fixtures/account.py | create_group | agolovkina/sdk-python | python | @pytest.fixture
def create_group(api, account):
'Create new group in account.\n\n :param api: api fixture\n :param account: account fixture\n :yields: create_group function\n '
groups = []
group_counter = 0
def _create_group(name: Optional[str]=None):
nonlocal group_counter
... |
def __init__(self, api_version=None, kind=None, name=None):
'\n V2beta1CrossVersionObjectReference - a model defined in Swagger\n '
self._api_version = None
self._kind = None
self._name = None
self.discriminator = None
if (api_version is not None):
self.api_version = api_ve... | 8,192,905,385,589,957,000 | V2beta1CrossVersionObjectReference - a model defined in Swagger | kubernetes/client/models/v2beta1_cross_version_object_reference.py | __init__ | StephenPCG/python | python | def __init__(self, api_version=None, kind=None, name=None):
'\n \n '
self._api_version = None
self._kind = None
self._name = None
self.discriminator = None
if (api_version is not None):
self.api_version = api_version
self.kind = kind
self.name = name |
@property
def api_version(self):
'\n Gets the api_version of this V2beta1CrossVersionObjectReference.\n API version of the referent\n\n :return: The api_version of this V2beta1CrossVersionObjectReference.\n :rtype: str\n '
return self._api_version | -3,087,162,814,788,035,600 | Gets the api_version of this V2beta1CrossVersionObjectReference.
API version of the referent
:return: The api_version of this V2beta1CrossVersionObjectReference.
:rtype: str | kubernetes/client/models/v2beta1_cross_version_object_reference.py | api_version | StephenPCG/python | python | @property
def api_version(self):
'\n Gets the api_version of this V2beta1CrossVersionObjectReference.\n API version of the referent\n\n :return: The api_version of this V2beta1CrossVersionObjectReference.\n :rtype: str\n '
return self._api_version |
@api_version.setter
def api_version(self, api_version):
'\n Sets the api_version of this V2beta1CrossVersionObjectReference.\n API version of the referent\n\n :param api_version: The api_version of this V2beta1CrossVersionObjectReference.\n :type: str\n '
self._api_version = a... | -793,649,945,325,276,200 | Sets the api_version of this V2beta1CrossVersionObjectReference.
API version of the referent
:param api_version: The api_version of this V2beta1CrossVersionObjectReference.
:type: str | kubernetes/client/models/v2beta1_cross_version_object_reference.py | api_version | StephenPCG/python | python | @api_version.setter
def api_version(self, api_version):
'\n Sets the api_version of this V2beta1CrossVersionObjectReference.\n API version of the referent\n\n :param api_version: The api_version of this V2beta1CrossVersionObjectReference.\n :type: str\n '
self._api_version = a... |
@property
def kind(self):
'\n Gets the kind of this V2beta1CrossVersionObjectReference.\n Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"\n\n :return: The kind of this V2beta1CrossVersionObjectReference.\n :rtype: str\n ... | 2,425,916,078,310,303,000 | Gets the kind of this V2beta1CrossVersionObjectReference.
Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
:return: The kind of this V2beta1CrossVersionObjectReference.
:rtype: str | kubernetes/client/models/v2beta1_cross_version_object_reference.py | kind | StephenPCG/python | python | @property
def kind(self):
'\n Gets the kind of this V2beta1CrossVersionObjectReference.\n Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"\n\n :return: The kind of this V2beta1CrossVersionObjectReference.\n :rtype: str\n ... |
@kind.setter
def kind(self, kind):
'\n Sets the kind of this V2beta1CrossVersionObjectReference.\n Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"\n\n :param kind: The kind of this V2beta1CrossVersionObjectReference.\n :typ... | 2,954,922,473,310,548,500 | Sets the kind of this V2beta1CrossVersionObjectReference.
Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
:param kind: The kind of this V2beta1CrossVersionObjectReference.
:type: str | kubernetes/client/models/v2beta1_cross_version_object_reference.py | kind | StephenPCG/python | python | @kind.setter
def kind(self, kind):
'\n Sets the kind of this V2beta1CrossVersionObjectReference.\n Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"\n\n :param kind: The kind of this V2beta1CrossVersionObjectReference.\n :typ... |
@property
def name(self):
'\n Gets the name of this V2beta1CrossVersionObjectReference.\n Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names\n\n :return: The name of this V2beta1CrossVersionObjectReference.\n :rtype: str\n '
return self._na... | -6,171,665,245,504,551,000 | Gets the name of this V2beta1CrossVersionObjectReference.
Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
:return: The name of this V2beta1CrossVersionObjectReference.
:rtype: str | kubernetes/client/models/v2beta1_cross_version_object_reference.py | name | StephenPCG/python | python | @property
def name(self):
'\n Gets the name of this V2beta1CrossVersionObjectReference.\n Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names\n\n :return: The name of this V2beta1CrossVersionObjectReference.\n :rtype: str\n '
return self._na... |
@name.setter
def name(self, name):
'\n Sets the name of this V2beta1CrossVersionObjectReference.\n Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names\n\n :param name: The name of this V2beta1CrossVersionObjectReference.\n :type: str\n '
if ... | 1,106,479,108,438,382,700 | Sets the name of this V2beta1CrossVersionObjectReference.
Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
:param name: The name of this V2beta1CrossVersionObjectReference.
:type: str | kubernetes/client/models/v2beta1_cross_version_object_reference.py | name | StephenPCG/python | python | @name.setter
def name(self, name):
'\n Sets the name of this V2beta1CrossVersionObjectReference.\n Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names\n\n :param name: The name of this V2beta1CrossVersionObjectReference.\n :type: str\n '
if ... |
def to_dict(self):
'\n Returns the model properties as a dict\n '
result = {}
for (attr, _) in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), v... | 2,191,974,537,531,847,000 | Returns the model properties as a dict | kubernetes/client/models/v2beta1_cross_version_object_reference.py | to_dict | StephenPCG/python | python | def to_dict(self):
'\n \n '
result = {}
for (attr, _) in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to... |
def to_str(self):
'\n Returns the string representation of the model\n '
return pformat(self.to_dict()) | -3,531,024,894,346,511,000 | Returns the string representation of the model | kubernetes/client/models/v2beta1_cross_version_object_reference.py | to_str | StephenPCG/python | python | def to_str(self):
'\n \n '
return pformat(self.to_dict()) |
def __repr__(self):
'\n For `print` and `pprint`\n '
return self.to_str() | 5,853,962,500,611,353,000 | For `print` and `pprint` | kubernetes/client/models/v2beta1_cross_version_object_reference.py | __repr__ | StephenPCG/python | python | def __repr__(self):
'\n \n '
return self.to_str() |
def __eq__(self, other):
'\n Returns true if both objects are equal\n '
if (not isinstance(other, V2beta1CrossVersionObjectReference)):
return False
return (self.__dict__ == other.__dict__) | -3,340,942,517,178,243,000 | Returns true if both objects are equal | kubernetes/client/models/v2beta1_cross_version_object_reference.py | __eq__ | StephenPCG/python | python | def __eq__(self, other):
'\n \n '
if (not isinstance(other, V2beta1CrossVersionObjectReference)):
return False
return (self.__dict__ == other.__dict__) |
def __ne__(self, other):
'\n Returns true if both objects are not equal\n '
return (not (self == other)) | 3,600,423,175,817,510,400 | Returns true if both objects are not equal | kubernetes/client/models/v2beta1_cross_version_object_reference.py | __ne__ | StephenPCG/python | python | def __ne__(self, other):
'\n \n '
return (not (self == other)) |
@app.route('/hello')
@track_requests
def HelloWorld():
'A hello message\n Example endpoint returning a hello message\n ---\n responses:\n 200:\n description: A successful reply\n examples:\n text/plain: Hello from Appsody!\n '
return 'Hello from Appsody!' | 6,637,010,655,578,749,000 | A hello message
Example endpoint returning a hello message
---
responses:
200:
description: A successful reply
examples:
text/plain: Hello from Appsody! | sources/image_preprocessor/__init__.py | HelloWorld | Bhaskers-Blu-Org1/process-images-derive-insights | python | @app.route('/hello')
@track_requests
def HelloWorld():
'A hello message\n Example endpoint returning a hello message\n ---\n responses:\n 200:\n description: A successful reply\n examples:\n text/plain: Hello from Appsody!\n '
return 'Hello from Appsody!' |
def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None):
'ExtensionsV1beta1Scale - a model defined in OpenAPI'
self._api_version = None
self._kind = None
self._metadata = None
self._spec = None
self._status = None
self.discriminator = None
if (api_version i... | -3,213,912,742,942,138,000 | ExtensionsV1beta1Scale - a model defined in OpenAPI | kubernetes/client/models/extensions_v1beta1_scale.py | __init__ | ACXLM/python | python | def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None):
self._api_version = None
self._kind = None
self._metadata = None
self._spec = None
self._status = None
self.discriminator = None
if (api_version is not None):
self.api_version = api_version
... |
@property
def api_version(self):
'Gets the api_version of this ExtensionsV1beta1Scale. # noqa: E501\n\n APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://... | 6,668,571,443,484,836,000 | Gets the api_version of this ExtensionsV1beta1Scale. # noqa: E501
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-arch... | kubernetes/client/models/extensions_v1beta1_scale.py | api_version | ACXLM/python | python | @property
def api_version(self):
'Gets the api_version of this ExtensionsV1beta1Scale. # noqa: E501\n\n APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://... |
@api_version.setter
def api_version(self, api_version):
'Sets the api_version of this ExtensionsV1beta1Scale.\n\n APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... | 1,476,418,542,245,848,000 | Sets the api_version of this ExtensionsV1beta1Scale.
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-c... | kubernetes/client/models/extensions_v1beta1_scale.py | api_version | ACXLM/python | python | @api_version.setter
def api_version(self, api_version):
'Sets the api_version of this ExtensionsV1beta1Scale.\n\n APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
@property
def kind(self):
'Gets the kind of this ExtensionsV1beta1Scale. # noqa: E501\n\n Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/comm... | -2,684,591,780,846,492,000 | Gets the kind of this ExtensionsV1beta1Scale. # noqa: E501
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture... | kubernetes/client/models/extensions_v1beta1_scale.py | kind | ACXLM/python | python | @property
def kind(self):
'Gets the kind of this ExtensionsV1beta1Scale. # noqa: E501\n\n Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/comm... |
@kind.setter
def kind(self, kind):
'Sets the kind of this ExtensionsV1beta1Scale.\n\n Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community... | -8,335,573,646,077,467,000 | Sets the kind of this ExtensionsV1beta1Scale.
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventio... | kubernetes/client/models/extensions_v1beta1_scale.py | kind | ACXLM/python | python | @kind.setter
def kind(self, kind):
'Sets the kind of this ExtensionsV1beta1Scale.\n\n Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community... |
@property
def metadata(self):
'Gets the metadata of this ExtensionsV1beta1Scale. # noqa: E501\n\n\n :return: The metadata of this ExtensionsV1beta1Scale. # noqa: E501\n :rtype: V1ObjectMeta\n '
return self._metadata | -13,547,596,297,764,276 | Gets the metadata of this ExtensionsV1beta1Scale. # noqa: E501
:return: The metadata of this ExtensionsV1beta1Scale. # noqa: E501
:rtype: V1ObjectMeta | kubernetes/client/models/extensions_v1beta1_scale.py | metadata | ACXLM/python | python | @property
def metadata(self):
'Gets the metadata of this ExtensionsV1beta1Scale. # noqa: E501\n\n\n :return: The metadata of this ExtensionsV1beta1Scale. # noqa: E501\n :rtype: V1ObjectMeta\n '
return self._metadata |
@metadata.setter
def metadata(self, metadata):
'Sets the metadata of this ExtensionsV1beta1Scale.\n\n\n :param metadata: The metadata of this ExtensionsV1beta1Scale. # noqa: E501\n :type: V1ObjectMeta\n '
self._metadata = metadata | 7,311,167,920,556,201,000 | Sets the metadata of this ExtensionsV1beta1Scale.
:param metadata: The metadata of this ExtensionsV1beta1Scale. # noqa: E501
:type: V1ObjectMeta | kubernetes/client/models/extensions_v1beta1_scale.py | metadata | ACXLM/python | python | @metadata.setter
def metadata(self, metadata):
'Sets the metadata of this ExtensionsV1beta1Scale.\n\n\n :param metadata: The metadata of this ExtensionsV1beta1Scale. # noqa: E501\n :type: V1ObjectMeta\n '
self._metadata = metadata |
@property
def spec(self):
'Gets the spec of this ExtensionsV1beta1Scale. # noqa: E501\n\n\n :return: The spec of this ExtensionsV1beta1Scale. # noqa: E501\n :rtype: ExtensionsV1beta1ScaleSpec\n '
return self._spec | 6,507,947,979,207,770,000 | Gets the spec of this ExtensionsV1beta1Scale. # noqa: E501
:return: The spec of this ExtensionsV1beta1Scale. # noqa: E501
:rtype: ExtensionsV1beta1ScaleSpec | kubernetes/client/models/extensions_v1beta1_scale.py | spec | ACXLM/python | python | @property
def spec(self):
'Gets the spec of this ExtensionsV1beta1Scale. # noqa: E501\n\n\n :return: The spec of this ExtensionsV1beta1Scale. # noqa: E501\n :rtype: ExtensionsV1beta1ScaleSpec\n '
return self._spec |
@spec.setter
def spec(self, spec):
'Sets the spec of this ExtensionsV1beta1Scale.\n\n\n :param spec: The spec of this ExtensionsV1beta1Scale. # noqa: E501\n :type: ExtensionsV1beta1ScaleSpec\n '
self._spec = spec | -4,437,859,536,225,099,000 | Sets the spec of this ExtensionsV1beta1Scale.
:param spec: The spec of this ExtensionsV1beta1Scale. # noqa: E501
:type: ExtensionsV1beta1ScaleSpec | kubernetes/client/models/extensions_v1beta1_scale.py | spec | ACXLM/python | python | @spec.setter
def spec(self, spec):
'Sets the spec of this ExtensionsV1beta1Scale.\n\n\n :param spec: The spec of this ExtensionsV1beta1Scale. # noqa: E501\n :type: ExtensionsV1beta1ScaleSpec\n '
self._spec = spec |
@property
def status(self):
'Gets the status of this ExtensionsV1beta1Scale. # noqa: E501\n\n\n :return: The status of this ExtensionsV1beta1Scale. # noqa: E501\n :rtype: ExtensionsV1beta1ScaleStatus\n '
return self._status | 5,318,401,970,238,419,000 | Gets the status of this ExtensionsV1beta1Scale. # noqa: E501
:return: The status of this ExtensionsV1beta1Scale. # noqa: E501
:rtype: ExtensionsV1beta1ScaleStatus | kubernetes/client/models/extensions_v1beta1_scale.py | status | ACXLM/python | python | @property
def status(self):
'Gets the status of this ExtensionsV1beta1Scale. # noqa: E501\n\n\n :return: The status of this ExtensionsV1beta1Scale. # noqa: E501\n :rtype: ExtensionsV1beta1ScaleStatus\n '
return self._status |
@status.setter
def status(self, status):
'Sets the status of this ExtensionsV1beta1Scale.\n\n\n :param status: The status of this ExtensionsV1beta1Scale. # noqa: E501\n :type: ExtensionsV1beta1ScaleStatus\n '
self._status = status | -3,870,650,832,372,444,700 | Sets the status of this ExtensionsV1beta1Scale.
:param status: The status of this ExtensionsV1beta1Scale. # noqa: E501
:type: ExtensionsV1beta1ScaleStatus | kubernetes/client/models/extensions_v1beta1_scale.py | status | ACXLM/python | python | @status.setter
def status(self, status):
'Sets the status of this ExtensionsV1beta1Scale.\n\n\n :param status: The status of this ExtensionsV1beta1Scale. # noqa: E501\n :type: ExtensionsV1beta1ScaleStatus\n '
self._status = status |
def to_dict(self):
'Returns the model properties as a dict'
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
e... | 8,442,519,487,048,767,000 | Returns the model properties as a dict | kubernetes/client/models/extensions_v1beta1_scale.py | to_dict | ACXLM/python | python | def to_dict(self):
result = {}
for (attr, _) in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to_dict'):
... |
def to_str(self):
'Returns the string representation of the model'
return pprint.pformat(self.to_dict()) | 5,849,158,643,760,736,000 | Returns the string representation of the model | kubernetes/client/models/extensions_v1beta1_scale.py | to_str | ACXLM/python | python | def to_str(self):
return pprint.pformat(self.to_dict()) |
def __repr__(self):
'For `print` and `pprint`'
return self.to_str() | -8,960,031,694,814,905,000 | For `print` and `pprint` | kubernetes/client/models/extensions_v1beta1_scale.py | __repr__ | ACXLM/python | python | def __repr__(self):
return self.to_str() |
def __eq__(self, other):
'Returns true if both objects are equal'
if (not isinstance(other, ExtensionsV1beta1Scale)):
return False
return (self.__dict__ == other.__dict__) | 6,668,779,138,109,585,000 | Returns true if both objects are equal | kubernetes/client/models/extensions_v1beta1_scale.py | __eq__ | ACXLM/python | python | def __eq__(self, other):
if (not isinstance(other, ExtensionsV1beta1Scale)):
return False
return (self.__dict__ == other.__dict__) |
def __ne__(self, other):
'Returns true if both objects are not equal'
return (not (self == other)) | 7,764,124,047,908,058,000 | Returns true if both objects are not equal | kubernetes/client/models/extensions_v1beta1_scale.py | __ne__ | ACXLM/python | python | def __ne__(self, other):
return (not (self == other)) |
def handler(self, param: Optional[any]=None, http_request: Type[HttpRequest]=None) -> HttpResponse:
'Metodo para chamar o caso de uso'
response = None
if (not param):
raise HttpBadRequestError(message='Essa requisiçao exige o seguinte parametro: <int:user_id>, error!')
if (not str(param).isnumer... | 2,084,713,247,792,810,200 | Metodo para chamar o caso de uso | mitmirror/presenters/controllers/users/update_user_controller.py | handler | Claayton/mitmirror-api | python | def handler(self, param: Optional[any]=None, http_request: Type[HttpRequest]=None) -> HttpResponse:
response = None
if (not param):
raise HttpBadRequestError(message='Essa requisiçao exige o seguinte parametro: <int:user_id>, error!')
if (not str(param).isnumeric()):
raise HttpUnprocess... |
@classmethod
def __format_response(cls, response_method: Type[User]) -> HttpResponse:
'Formatando a resposta'
response = {'message': 'Informacoes do usuario atualizadas com sucesso!', 'data': {'id': response_method.id, 'name': response_method.name, 'email': response_method.email, 'username': response_method.use... | -528,875,641,314,126,200 | Formatando a resposta | mitmirror/presenters/controllers/users/update_user_controller.py | __format_response | Claayton/mitmirror-api | python | @classmethod
def __format_response(cls, response_method: Type[User]) -> HttpResponse:
response = {'message': 'Informacoes do usuario atualizadas com sucesso!', 'data': {'id': response_method.id, 'name': response_method.name, 'email': response_method.email, 'username': response_method.username, 'password_hash':... |
def initialization():
'Инициализация нужных файлов игры'
pygame.init()
pygame.display.set_icon(pygame.image.load('data/icon.bmp'))
pygame.display.set_caption('SPACE') | 1,552,549,711,354,153,700 | Инициализация нужных файлов игры | main.py | initialization | shycoldii/asteroids | python | def initialization():
pygame.init()
pygame.display.set_icon(pygame.image.load('data/icon.bmp'))
pygame.display.set_caption('SPACE') |
def _validate_tags(namespace):
' Extracts multiple space-separated tags in key[=value] format '
if isinstance(namespace.tags, list):
tags_dict = {}
for item in namespace.tags:
tags_dict.update(_validate_tag(item))
namespace.tags = tags_dict | 499,165,198,836,220 | Extracts multiple space-separated tags in key[=value] format | src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/validators.py | _validate_tags | aag09/azurecli | python | def _validate_tags(namespace):
' '
if isinstance(namespace.tags, list):
tags_dict = {}
for item in namespace.tags:
tags_dict.update(_validate_tag(item))
namespace.tags = tags_dict |
def _validate_tag(string):
' Extracts a single tag in key[=value] format '
result = {}
if string:
comps = string.split('=', 1)
result = ({comps[0]: comps[1]} if (len(comps) > 1) else {string: ''})
return result | -8,924,955,365,198,874,000 | Extracts a single tag in key[=value] format | src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/validators.py | _validate_tag | aag09/azurecli | python | def _validate_tag(string):
' '
result = {}
if string:
comps = string.split('=', 1)
result = ({comps[0]: comps[1]} if (len(comps) > 1) else {string: })
return result |
@property
def version(self) -> CIDVersion:
'\n CID version.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.version\n 1\n\n '
return self._version | 2,141,663,901,753,808,000 | CID version.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid.version
1 | multiformats/cid/__init__.py | version | hashberg-io/multiformats | python | @property
def version(self) -> CIDVersion:
'\n CID version.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.version\n 1\n\n '
return self._version |
@property
def base(self) -> Multibase:
'\n Multibase used to encode the CID:\n\n - if a CIDv1 was decoded from a multibase-encoded string, the encoding multibase is used\n - if a CIDv1 was decoded from a bytestring, the \'base58btc\' multibase is used\n - for a CIDv0, \'b... | 8,751,055,337,958,033,000 | Multibase used to encode the CID:
- if a CIDv1 was decoded from a multibase-encoded string, the encoding multibase is used
- if a CIDv1 was decoded from a bytestring, the 'base58btc' multibase is used
- for a CIDv0, 'base58btc' is always used
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"... | multiformats/cid/__init__.py | base | hashberg-io/multiformats | python | @property
def base(self) -> Multibase:
'\n Multibase used to encode the CID:\n\n - if a CIDv1 was decoded from a multibase-encoded string, the encoding multibase is used\n - if a CIDv1 was decoded from a bytestring, the \'base58btc\' multibase is used\n - for a CIDv0, \'b... |
@property
def codec(self) -> Multicodec:
'\n Codec that the multihash digest refers to.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.codec\n Multicodec(name=\'raw\', tag=\'ipld... | 2,974,990,426,359,168,000 | Codec that the multihash digest refers to.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid.codec
Multicodec(name='raw', tag='ipld', code='0x55',
status='permanent', description='raw binary') | multiformats/cid/__init__.py | codec | hashberg-io/multiformats | python | @property
def codec(self) -> Multicodec:
'\n Codec that the multihash digest refers to.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.codec\n Multicodec(name=\'raw\', tag=\'ipld... |
@property
def hashfun(self) -> Multihash:
'\n Multihash used to produce the multihash digest.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.hashfun\n Multicodec(name=\'sha2-256\... | 1,040,017,296,922,144,400 | Multihash used to produce the multihash digest.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid.hashfun
Multicodec(name='sha2-256', tag='multihash', code='0x12',
status='permanent', description='') | multiformats/cid/__init__.py | hashfun | hashberg-io/multiformats | python | @property
def hashfun(self) -> Multihash:
'\n Multihash used to produce the multihash digest.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.hashfun\n Multicodec(name=\'sha2-256\... |
@property
def digest(self) -> bytes:
'\n Multihash digest.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.digest.hex()\n \'12206e6ff7950a36187a801613426e858dce686cd7d7e3c0fc42ee0... | 340,595,137,949,885,060 | Multihash digest.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid.digest.hex()
'12206e6ff7950a36187a801613426e858dce686cd7d7e3c0fc42ee0330072d245c95' | multiformats/cid/__init__.py | digest | hashberg-io/multiformats | python | @property
def digest(self) -> bytes:
'\n Multihash digest.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.digest.hex()\n \'12206e6ff7950a36187a801613426e858dce686cd7d7e3c0fc42ee0... |
@property
def raw_digest(self) -> bytes:
'\n Raw hash digest, decoded from the multihash digest.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.raw_digest.hex()\n \'6e6ff7950a361... | -3,530,206,930,099,280,000 | Raw hash digest, decoded from the multihash digest.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid.raw_digest.hex()
'6e6ff7950a36187a801613426e858dce686cd7d7e3c0fc42ee0330072d245c95' | multiformats/cid/__init__.py | raw_digest | hashberg-io/multiformats | python | @property
def raw_digest(self) -> bytes:
'\n Raw hash digest, decoded from the multihash digest.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.raw_digest.hex()\n \'6e6ff7950a361... |
@property
def human_readable(self) -> str:
'\n Human-readable representation of the CID.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.human_readable\n \'base58btc - cidv1 - raw... | 776,096,244,485,080,600 | Human-readable representation of the CID.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid.human_readable
'base58btc - cidv1 - raw - (sha2-256 : 256 : 6E6FF7950A36187A801613426E858DCE686CD7D7E3C0FC42EE0330072D245C95)' | multiformats/cid/__init__.py | human_readable | hashberg-io/multiformats | python | @property
def human_readable(self) -> str:
'\n Human-readable representation of the CID.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n >>> cid = CID.decode(s)\n >>> cid.human_readable\n \'base58btc - cidv1 - raw... |
def encode(self, base: Union[(None, str, Multibase)]=None) -> str:
'\n Encodes the CID using a given multibase. If :obj:`None` is given,\n the CID\'s own multibase is used by default.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n ... | -56,374,101,431,808,100 | Encodes the CID using a given multibase. If :obj:`None` is given,
the CID's own multibase is used by default.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid.encode() # default: cid.base
'zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA'
>>> cid.encode("base... | multiformats/cid/__init__.py | encode | hashberg-io/multiformats | python | def encode(self, base: Union[(None, str, Multibase)]=None) -> str:
'\n Encodes the CID using a given multibase. If :obj:`None` is given,\n the CID\'s own multibase is used by default.\n\n Example usage:\n\n >>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"\n ... |
def set(self, *, base: Union[(None, str, Multibase)]=None, version: Union[(None, int)]=None, codec: Union[(None, str, int, Multicodec)]=None) -> 'CID':
'\n Returns a new CID obtained by setting new values for one or more of:\n ``base``, ``version``, or ``codec``.\n\n Example usage:\... | -8,268,395,013,245,805,000 | Returns a new CID obtained by setting new values for one or more of:
``base``, ``version``, or ``codec``.
Example usage:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> cid = CID.decode(s)
>>> cid
CID('base58btc', 1, 'raw',
'12206e6ff7950a36187a801613426e858dce686cd7d7e3c0fc42ee0330072d245c95')
>>> ci... | multiformats/cid/__init__.py | set | hashberg-io/multiformats | python | def set(self, *, base: Union[(None, str, Multibase)]=None, version: Union[(None, int)]=None, codec: Union[(None, str, int, Multicodec)]=None) -> 'CID':
'\n Returns a new CID obtained by setting new values for one or more of:\n ``base``, ``version``, or ``codec``.\n\n Example usage:\... |
@staticmethod
def decode(cid: Union[(str, BytesLike)]) -> 'CID':
'\n Decodes a CID from a bytestring or a hex string (which will be converted to :obj:`bytes`\n using :obj:`bytes.fromhex`). Note: the hex string is not multibase encoded.\n\n Example usage for CIDv1 multibase-encoded s... | 6,971,011,179,152,187,000 | Decodes a CID from a bytestring or a hex string (which will be converted to :obj:`bytes`
using :obj:`bytes.fromhex`). Note: the hex string is not multibase encoded.
Example usage for CIDv1 multibase-encoded string:
>>> s = "zb2rhe5P4gXftAwvA4eXQ5HJwsER2owDyS9sKaQRRVQPn93bA"
>>> CID.decode(s)
CID('base58btc', 1, 'raw'... | multiformats/cid/__init__.py | decode | hashberg-io/multiformats | python | @staticmethod
def decode(cid: Union[(str, BytesLike)]) -> 'CID':
'\n Decodes a CID from a bytestring or a hex string (which will be converted to :obj:`bytes`\n using :obj:`bytes.fromhex`). Note: the hex string is not multibase encoded.\n\n Example usage for CIDv1 multibase-encoded s... |
@staticmethod
def peer_id(pk_bytes: Union[(str, BytesLike)]) -> 'CID':
'\n Wraps the raw hash of a public key into a `PeerID <https://docs.libp2p.io/concepts/peer-id/>`_, as a CIDv1.\n\n The ``pk_bytes`` argument should be the binary public key, encoded according to the\n `PeerID sp... | 5,168,933,804,621,999,000 | Wraps the raw hash of a public key into a `PeerID <https://docs.libp2p.io/concepts/peer-id/>`_, as a CIDv1.
The ``pk_bytes`` argument should be the binary public key, encoded according to the
`PeerID spec <https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md>`_.
This can be passed as a bytestring or as a h... | multiformats/cid/__init__.py | peer_id | hashberg-io/multiformats | python | @staticmethod
def peer_id(pk_bytes: Union[(str, BytesLike)]) -> 'CID':
'\n Wraps the raw hash of a public key into a `PeerID <https://docs.libp2p.io/concepts/peer-id/>`_, as a CIDv1.\n\n The ``pk_bytes`` argument should be the binary public key, encoded according to the\n `PeerID sp... |
def train_negative_sampling(self, u_nid, train_pos_unid_inid_map, test_pos_unid_inid_map, neg_unid_inid_map, data):
'\n Unliked popular movie negative sampling:\n :param u_nid:\n :param train_pos_unid_inid_map:\n :param test_pos_unid_inid_map:\n :param neg_unid_inid_map:\n ... | 1,163,391,387,365,685,800 | Unliked popular movie negative sampling:
:param u_nid:
:param train_pos_unid_inid_map:
:param test_pos_unid_inid_map:
:param neg_unid_inid_map:
:param data:
:return: | benchmark/recsys/gcn_solver.py | train_negative_sampling | 356255531/pytorch_geometric | python | def train_negative_sampling(self, u_nid, train_pos_unid_inid_map, test_pos_unid_inid_map, neg_unid_inid_map, data):
'\n Unliked popular movie negative sampling:\n :param u_nid:\n :param train_pos_unid_inid_map:\n :param test_pos_unid_inid_map:\n :param neg_unid_inid_map:\n ... |
def fun(x):
'\n Function returning the parameters of the normal sampler.\n mean = product of elements of x\n variance = exp(|x|)/(1+exp(|x|)).\n '
return (np.prod(x), (np.exp(np.sum(x)) / (np.exp(np.sum(x)) + 1))) | 3,916,633,977,899,014,700 | Function returning the parameters of the normal sampler.
mean = product of elements of x
variance = exp(|x|)/(1+exp(|x|)). | seqgibbs/tests/test_samplers.py | fun | I-Bouros/seqgibbs | python | def fun(x):
'\n Function returning the parameters of the normal sampler.\n mean = product of elements of x\n variance = exp(|x|)/(1+exp(|x|)).\n '
return (np.prod(x), (np.exp(np.sum(x)) / (np.exp(np.sum(x)) + 1))) |
def another_fun(x):
'\n Function returning the parameters of the normal sampler.\n mean = sum of elements of x\n variance = exp(|x|)/(1+exp(|x|)).\n '
return (np.sum(x), (np.exp(np.sum(x)) / (np.exp(np.sum(x)) + 1))) | -1,303,013,952,990,475,500 | Function returning the parameters of the normal sampler.
mean = sum of elements of x
variance = exp(|x|)/(1+exp(|x|)). | seqgibbs/tests/test_samplers.py | another_fun | I-Bouros/seqgibbs | python | def another_fun(x):
'\n Function returning the parameters of the normal sampler.\n mean = sum of elements of x\n variance = exp(|x|)/(1+exp(|x|)).\n '
return (np.sum(x), (np.exp(np.sum(x)) / (np.exp(np.sum(x)) + 1))) |
def _group(template, resource, action, proid):
'Render group template.'
return template.format(resource=resource, action=action, proid=proid) | -1,832,616,014,194,641,400 | Render group template. | lib/python/treadmill/api/authz/group.py | _group | bothejjms/treadmill | python | def _group(template, resource, action, proid):
return template.format(resource=resource, action=action, proid=proid) |
def authorize(user, action, resource, resource_id, payload):
'Authorize user/action/resource'
del payload
_LOGGER.info('Authorize: %s %s %s %s', user, action, resource, resource_id)
proid = None
if resource_id:
proid = resource_id.partition('.')[0]
why = []
for group_template in grou... | 4,777,468,944,904,468,000 | Authorize user/action/resource | lib/python/treadmill/api/authz/group.py | authorize | bothejjms/treadmill | python | def authorize(user, action, resource, resource_id, payload):
del payload
_LOGGER.info('Authorize: %s %s %s %s', user, action, resource, resource_id)
proid = None
if resource_id:
proid = resource_id.partition('.')[0]
why = []
for group_template in groups:
group_name = _group(... |
def get_conf_dir(self):
'\n Returns the path to the directory where Cassandra config are located\n '
return os.path.join(self.get_path(), 'resources', 'cassandra', 'conf') | 5,371,359,768,358,725,000 | Returns the path to the directory where Cassandra config are located | ccmlib/dse_node.py | get_conf_dir | thobbs/ccm | python | def get_conf_dir(self):
'\n \n '
return os.path.join(self.get_path(), 'resources', 'cassandra', 'conf') |
def watch_log_for_alive(self, nodes, from_mark=None, timeout=720, filename='system.log'):
'\n Watch the log of this node until it detects that the provided other\n nodes are marked UP. This method works similarly to watch_log_for_death.\n\n We want to provide a higher default timeout when this ... | -150,998,833,348,054,400 | Watch the log of this node until it detects that the provided other
nodes are marked UP. This method works similarly to watch_log_for_death.
We want to provide a higher default timeout when this is called on DSE. | ccmlib/dse_node.py | watch_log_for_alive | thobbs/ccm | python | def watch_log_for_alive(self, nodes, from_mark=None, timeout=720, filename='system.log'):
'\n Watch the log of this node until it detects that the provided other\n nodes are marked UP. This method works similarly to watch_log_for_death.\n\n We want to provide a higher default timeout when this ... |
def export_dse_home_in_dse_env_sh(self):
"\n Due to the way CCM lays out files, separating the repository\n from the node(s) confs, the `dse-env.sh` script of each node\n needs to have its DSE_HOME var set and exported. Since DSE\n 4.5.x, the stock `dse-env.sh` file includes a commented-... | -31,969,036,990,758,484 | Due to the way CCM lays out files, separating the repository
from the node(s) confs, the `dse-env.sh` script of each node
needs to have its DSE_HOME var set and exported. Since DSE
4.5.x, the stock `dse-env.sh` file includes a commented-out
place to do exactly this, intended for installers.
Basically: read in the file,... | ccmlib/dse_node.py | export_dse_home_in_dse_env_sh | thobbs/ccm | python | def export_dse_home_in_dse_env_sh(self):
"\n Due to the way CCM lays out files, separating the repository\n from the node(s) confs, the `dse-env.sh` script of each node\n needs to have its DSE_HOME var set and exported. Since DSE\n 4.5.x, the stock `dse-env.sh` file includes a commented-... |
def load_labels(cache_dir: Union[(Path, str)]) -> Tuple[(Tuple[(str, ...)], np.ndarray, List[str], np.ndarray)]:
'\n prepare all the labels\n '
filename_io = download_url('https://raw.githubusercontent.com/csailvision/places365/master/IO_places365.txt', cache_dir)
with open(filename_io) as f:
... | -3,650,344,468,072,724,500 | prepare all the labels | scripts/detect_room.py | load_labels | airbert-vln/bnb-dataset | python | def load_labels(cache_dir: Union[(Path, str)]) -> Tuple[(Tuple[(str, ...)], np.ndarray, List[str], np.ndarray)]:
'\n \n '
filename_io = download_url('https://raw.githubusercontent.com/csailvision/places365/master/IO_places365.txt', cache_dir)
with open(filename_io) as f:
lines = f.readlines()
... |
def softmax(x):
'Compute softmax values for each sets of scores in x.'
e_x = np.exp((x - np.max(x)))
return (e_x / e_x.sum(axis=0)) | -8,078,771,299,122,488,000 | Compute softmax values for each sets of scores in x. | scripts/detect_room.py | softmax | airbert-vln/bnb-dataset | python | def softmax(x):
e_x = np.exp((x - np.max(x)))
return (e_x / e_x.sum(axis=0)) |
def onerror(func, path, exc_info):
'\n Error handler for ``shutil.rmtree``.\n\n If the error is due to an access error (read only file)\n it attempts to add write permission and then retries.\n\n If the error is for another reason it re-raises the error.\n\n Us... | 2,055,500,432,482,497,300 | Error handler for ``shutil.rmtree``.
If the error is due to an access error (read only file)
it attempts to add write permission and then retries.
If the error is for another reason it re-raises the error.
Usage : ``shutil.rmtree(path, onerror=onerror)`` | thlib/ui_classes/ui_watch_folder_classes.py | onerror | listyque/TACTIC-Handler | python | def onerror(func, path, exc_info):
'\n Error handler for ``shutil.rmtree``.\n\n If the error is due to an access error (read only file)\n it attempts to add write permission and then retries.\n\n If the error is for another reason it re-raises the error.\n\n Us... |
def triangleNumber(self, nums):
'\n :type nums: List[int]\n :rtype: int\n '
result = 0
nums.sort()
for i in reversed(xrange(2, len(nums))):
(left, right) = (0, (i - 1))
while (left < right):
if ((nums[left] + nums[right]) > nums[i]):
resul... | 3,631,428,936,445,728,000 | :type nums: List[int]
:rtype: int | Python/valid-triangle-number.py | triangleNumber | 20kzhan/LeetCode-Solutions | python | def triangleNumber(self, nums):
'\n :type nums: List[int]\n :rtype: int\n '
result = 0
nums.sort()
for i in reversed(xrange(2, len(nums))):
(left, right) = (0, (i - 1))
while (left < right):
if ((nums[left] + nums[right]) > nums[i]):
resul... |
def triangleNumber(self, nums):
'\n :type nums: List[int]\n :rtype: int\n '
result = 0
nums.sort()
for i in xrange((len(nums) - 2)):
if (nums[i] == 0):
continue
k = (i + 2)
for j in xrange((i + 1), (len(nums) - 1)):
while ((k < len(num... | 2,975,241,749,865,687,600 | :type nums: List[int]
:rtype: int | Python/valid-triangle-number.py | triangleNumber | 20kzhan/LeetCode-Solutions | python | def triangleNumber(self, nums):
'\n :type nums: List[int]\n :rtype: int\n '
result = 0
nums.sort()
for i in xrange((len(nums) - 2)):
if (nums[i] == 0):
continue
k = (i + 2)
for j in xrange((i + 1), (len(nums) - 1)):
while ((k < len(num... |
def test_ftu_with_tour(self):
'\n https://moztrap.mozilla.org/manage/case/6119/\n '
self.ftu.run_ftu_setup_with_default_values()
self.ftu.tap_take_tour()
self.assertEqual(self.ftu.step1_header_text, 'Swipe up and down to browse your apps and bookmarks. Tap and hold an icon to delete, move,... | 11,680,524,589,999,332 | https://moztrap.mozilla.org/manage/case/6119/ | tests/python/gaia-ui-tests/gaiatest/tests/functional/ftu/test_ftu_with_tour.py | test_ftu_with_tour | ADLR-es/gaia | python | def test_ftu_with_tour(self):
'\n \n '
self.ftu.run_ftu_setup_with_default_values()
self.ftu.tap_take_tour()
self.assertEqual(self.ftu.step1_header_text, 'Swipe up and down to browse your apps and bookmarks. Tap and hold an icon to delete, move, or edit it.')
self.ftu.tap_tour_next()
... |
def __init__(self):
'Instantiation function.'
self.params = {'n_m': numpy.nan, 'K': numpy.nan, 'tht': numpy.nan} | -3,131,612,132,851,073,000 | Instantiation function. | src/pygaps/modelling/temkinapprox.py | __init__ | ReginaPeralta/ReginaPeralta | python | def __init__(self):
self.params = {'n_m': numpy.nan, 'K': numpy.nan, 'tht': numpy.nan} |
def loading(self, pressure):
'\n Calculate loading at specified pressure.\n\n Parameters\n ----------\n pressure : float\n The pressure at which to calculate the loading.\n\n Returns\n -------\n float\n Loading at specified pressure.\n '
... | -3,862,127,436,033,543,000 | Calculate loading at specified pressure.
Parameters
----------
pressure : float
The pressure at which to calculate the loading.
Returns
-------
float
Loading at specified pressure. | src/pygaps/modelling/temkinapprox.py | loading | ReginaPeralta/ReginaPeralta | python | def loading(self, pressure):
'\n Calculate loading at specified pressure.\n\n Parameters\n ----------\n pressure : float\n The pressure at which to calculate the loading.\n\n Returns\n -------\n float\n Loading at specified pressure.\n '
... |
def pressure(self, loading):
'\n Calculate pressure at specified loading.\n\n For the TemkinApprox model, the pressure will\n be computed numerically as no analytical inversion is possible.\n\n Parameters\n ----------\n loading : float\n The loading at which to c... | -7,795,259,018,044,517,000 | Calculate pressure at specified loading.
For the TemkinApprox model, the pressure will
be computed numerically as no analytical inversion is possible.
Parameters
----------
loading : float
The loading at which to calculate the pressure.
Returns
-------
float
Pressure at specified loading. | src/pygaps/modelling/temkinapprox.py | pressure | ReginaPeralta/ReginaPeralta | python | def pressure(self, loading):
'\n Calculate pressure at specified loading.\n\n For the TemkinApprox model, the pressure will\n be computed numerically as no analytical inversion is possible.\n\n Parameters\n ----------\n loading : float\n The loading at which to c... |
def spreading_pressure(self, pressure):
'\n Calculate spreading pressure at specified gas pressure.\n\n Function that calculates spreading pressure by solving the\n following integral at each point i.\n\n .. math::\n\n \\pi = \\int_{0}^{p_i} \\frac{n_i(p_i)}{p_i} dp_i\n\n ... | -8,227,195,899,010,587,000 | Calculate spreading pressure at specified gas pressure.
Function that calculates spreading pressure by solving the
following integral at each point i.
.. math::
\pi = \int_{0}^{p_i} \frac{n_i(p_i)}{p_i} dp_i
The integral for the TemkinApprox model is solved analytically.
.. math::
\pi = n_m \Big( \ln{(1 +... | src/pygaps/modelling/temkinapprox.py | spreading_pressure | ReginaPeralta/ReginaPeralta | python | def spreading_pressure(self, pressure):
'\n Calculate spreading pressure at specified gas pressure.\n\n Function that calculates spreading pressure by solving the\n following integral at each point i.\n\n .. math::\n\n \\pi = \\int_{0}^{p_i} \\frac{n_i(p_i)}{p_i} dp_i\n\n ... |
def initial_guess(self, pressure, loading):
'\n Return initial guess for fitting.\n\n Parameters\n ----------\n pressure : ndarray\n Pressure data.\n loading : ndarray\n Loading data.\n\n Returns\n -------\n dict\n Dictionary o... | 4,176,960,451,183,268,400 | Return initial guess for fitting.
Parameters
----------
pressure : ndarray
Pressure data.
loading : ndarray
Loading data.
Returns
-------
dict
Dictionary of initial guesses for the parameters. | src/pygaps/modelling/temkinapprox.py | initial_guess | ReginaPeralta/ReginaPeralta | python | def initial_guess(self, pressure, loading):
'\n Return initial guess for fitting.\n\n Parameters\n ----------\n pressure : ndarray\n Pressure data.\n loading : ndarray\n Loading data.\n\n Returns\n -------\n dict\n Dictionary o... |
def get_batch(self, items: list):
'Return the defined batch of the given items.\n Items are usually input files.'
if (len(items) < self.batches):
raise WorkflowError('Batching rule {} has less input files than batches. Please choose a smaller number of batches.'.format(self.rulename))
items =... | -192,219,685,288,529,400 | Return the defined batch of the given items.
Items are usually input files. | snakemake/dag.py | get_batch | baileythegreen/snakemake | python | def get_batch(self, items: list):
'Return the defined batch of the given items.\n Items are usually input files.'
if (len(items) < self.batches):
raise WorkflowError('Batching rule {} has less input files than batches. Please choose a smaller number of batches.'.format(self.rulename))
items =... |
def init(self, progress=False):
' Initialise the DAG. '
for job in map(self.rule2job, self.targetrules):
job = self.update([job], progress=progress)
self.targetjobs.add(job)
for file in self.targetfiles:
job = self.update(self.file2jobs(file), file=file, progress=progress)
se... | 5,137,139,006,577,920,000 | Initialise the DAG. | snakemake/dag.py | init | baileythegreen/snakemake | python | def init(self, progress=False):
' '
for job in map(self.rule2job, self.targetrules):
job = self.update([job], progress=progress)
self.targetjobs.add(job)
for file in self.targetfiles:
job = self.update(self.file2jobs(file), file=file, progress=progress)
self.targetjobs.add(j... |
def check_directory_outputs(self):
'Check that no output file is contained in a directory output of the same or another rule.'
outputs = sorted({(path(f), job) for job in self.jobs for f in job.output for path in (os.path.abspath, os.path.realpath)})
for i in range((len(outputs) - 1)):
((a, job_a), ... | 7,875,700,181,244,890,000 | Check that no output file is contained in a directory output of the same or another rule. | snakemake/dag.py | check_directory_outputs | baileythegreen/snakemake | python | def check_directory_outputs(self):
outputs = sorted({(path(f), job) for job in self.jobs for f in job.output for path in (os.path.abspath, os.path.realpath)})
for i in range((len(outputs) - 1)):
((a, job_a), (b, job_b)) = outputs[i:(i + 2)]
try:
common = os.path.commonpath([a, b... |
def update_output_index(self):
'Update the OutputIndex.'
self.output_index = OutputIndex(self.rules) | 4,577,355,156,363,228,000 | Update the OutputIndex. | snakemake/dag.py | update_output_index | baileythegreen/snakemake | python | def update_output_index(self):
self.output_index = OutputIndex(self.rules) |
def check_incomplete(self):
'Check if any output files are incomplete. This is done by looking up\n markers in the persistence module.'
if (not self.ignore_incomplete):
incomplete = self.incomplete_files
if incomplete:
if self.force_incomplete:
logger.debug('Fo... | 3,707,933,761,524,800,000 | Check if any output files are incomplete. This is done by looking up
markers in the persistence module. | snakemake/dag.py | check_incomplete | baileythegreen/snakemake | python | def check_incomplete(self):
'Check if any output files are incomplete. This is done by looking up\n markers in the persistence module.'
if (not self.ignore_incomplete):
incomplete = self.incomplete_files
if incomplete:
if self.force_incomplete:
logger.debug('Fo... |
def incomplete_external_jobid(self, job):
'Return the external jobid of the job if it is marked as incomplete.\n\n Returns None, if job is not incomplete, or if no external jobid has been\n registered or if force_incomplete is True.\n '
if self.force_incomplete:
return None
jobi... | -2,468,886,771,994,416,000 | Return the external jobid of the job if it is marked as incomplete.
Returns None, if job is not incomplete, or if no external jobid has been
registered or if force_incomplete is True. | snakemake/dag.py | incomplete_external_jobid | baileythegreen/snakemake | python | def incomplete_external_jobid(self, job):
'Return the external jobid of the job if it is marked as incomplete.\n\n Returns None, if job is not incomplete, or if no external jobid has been\n registered or if force_incomplete is True.\n '
if self.force_incomplete:
return None
jobi... |
def check_dynamic(self):
'Check dynamic output and update downstream rules if necessary.'
if self.has_dynamic_rules:
for job in filter((lambda job: (job.dynamic_output and (not self.needrun(job)))), self.jobs):
self.update_dynamic(job)
self.postprocess() | -7,339,925,665,385,330,000 | Check dynamic output and update downstream rules if necessary. | snakemake/dag.py | check_dynamic | baileythegreen/snakemake | python | def check_dynamic(self):
if self.has_dynamic_rules:
for job in filter((lambda job: (job.dynamic_output and (not self.needrun(job)))), self.jobs):
self.update_dynamic(job)
self.postprocess() |
@property
def dynamic_output_jobs(self):
'Iterate over all jobs with dynamic output files.'
return (job for job in self.jobs if job.dynamic_output) | -3,501,796,108,319,540,000 | Iterate over all jobs with dynamic output files. | snakemake/dag.py | dynamic_output_jobs | baileythegreen/snakemake | python | @property
def dynamic_output_jobs(self):
return (job for job in self.jobs if job.dynamic_output) |
@property
def jobs(self):
' All jobs in the DAG. '
for job in self.bfs(self.dependencies, *self.targetjobs):
(yield job) | 4,769,151,645,865,818,000 | All jobs in the DAG. | snakemake/dag.py | jobs | baileythegreen/snakemake | python | @property
def jobs(self):
' '
for job in self.bfs(self.dependencies, *self.targetjobs):
(yield job) |
@property
def needrun_jobs(self):
' Jobs that need to be executed. '
for job in filter(self.needrun, self.bfs(self.dependencies, *self.targetjobs, stop=self.noneedrun_finished)):
(yield job) | 7,452,190,725,727,733,000 | Jobs that need to be executed. | snakemake/dag.py | needrun_jobs | baileythegreen/snakemake | python | @property
def needrun_jobs(self):
' '
for job in filter(self.needrun, self.bfs(self.dependencies, *self.targetjobs, stop=self.noneedrun_finished)):
(yield job) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.