query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Describes the interval in milliseconds between checkpoint operations. | def checkpoint_interval(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "checkpoint_interval") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def duration(self):\n return int(\n (self.finish_checkpoint - self.start_checkpoint) * 1000000\n )",
"def checkpoint_period_get(self):\n raise Exception(\"TODO\")",
"def get_interval(self):\n return self.interval * 1000",
"def get_interval_of_checking(self):\n re... | [
"0.7090562",
"0.69199383",
"0.6792741",
"0.6790077",
"0.6511564",
"0.6445197",
"0.6318114",
"0.6309584",
"0.6293418",
"0.62719446",
"0.62694013",
"0.623769",
"0.62273866",
"0.6174583",
"0.6090513",
"0.60774183",
"0.60166854",
"0.59780884",
"0.591519",
"0.59076864",
"0.5907686... | 0.7116312 | 0 |
Describes whether checkpointing is enabled for a Flinkbased Kinesis Data Analytics application. | def checkpointing_enabled(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "checkpointing_enabled") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def checkpoint_configuration(self) -> Optional[pulumi.Input['ApplicationApplicationConfigurationFlinkApplicationConfigurationCheckpointConfigurationArgs']]:\n return pulumi.get(self, \"checkpoint_configuration\")",
"def is_on(self) -> bool:\n return self.coordinator.data.get_metric(METRIC_KEY_MODE)... | [
"0.64683825",
"0.56311584",
"0.5604138",
"0.5564769",
"0.5300111",
"0.52998567",
"0.5290939",
"0.52690357",
"0.52690357",
"0.5241474",
"0.5230387",
"0.52285844",
"0.5222677",
"0.5196311",
"0.5167732",
"0.5133584",
"0.51228505",
"0.51166874",
"0.50924313",
"0.5084937",
"0.5082... | 0.7300332 | 0 |
Describes the number of parallel tasks that a Flinkbased Kinesis Data Analytics application can perform per Kinesis Processing Unit (KPU) used by the application. | def parallelism_per_kpu(self) -> Optional[pulumi.Input[int]]:
return pulumi.get(self, "parallelism_per_kpu") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def num_tasks(self):\n return self.num_labels",
"def num_partitions(self) -> str:\n return pulumi.get(self, \"num_partitions\")",
"def num_partitions(self): # -> int:\n ...",
"def n_tasks(self) -> int:\n pass",
"def num_partitions(self): # -> None:\n ...",
"def num_part... | [
"0.6757724",
"0.67434907",
"0.6643423",
"0.6570741",
"0.65159297",
"0.6492713",
"0.6449353",
"0.64321536",
"0.6343204",
"0.62586075",
"0.6241361",
"0.61708623",
"0.6162687",
"0.6149073",
"0.6125479",
"0.61032414",
"0.6096231",
"0.6077758",
"0.60536927",
"0.6053319",
"0.604742... | 0.7148753 | 0 |
When restoring from a snapshot, specifies whether the runtime is allowed to skip a state that cannot be mapped to the new program. Default is `false`. | def allow_non_restored_state(self) -> Optional[pulumi.Input[bool]]:
return pulumi.get(self, "allow_non_restored_state") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_skip_store(self):\n machine_uuid = \"955429e1-2125-478a-869c-3b3ce5549c38\"\n\n # Try to create machine's snapshot. The operation fails because\n # there is no reference to the machine in the state store.\n status = self.proxy.snapshot.create(PROVIDER_ID, machine_uuid)\n ... | [
"0.5744409",
"0.5708534",
"0.5589964",
"0.5539716",
"0.5498233",
"0.5486469",
"0.5461766",
"0.54595065",
"0.54511833",
"0.54478574",
"0.5351094",
"0.53494096",
"0.53361106",
"0.53031653",
"0.5284819",
"0.5284819",
"0.5279202",
"0.51409894",
"0.50932884",
"0.5092522",
"0.50817... | 0.7150096 | 0 |
The reference data source used by the application. | def reference_data_source(self) -> Optional[pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationReferenceDataSourceArgs']]:
return pulumi.get(self, "reference_data_source") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_datasource(self):\n return None",
"def get_datasource_of():\n global datasource_of\n\n if not datasource_of:\n datasource_of = stixhelpers.datasource_of()\n \n return datasource_of",
"def source(self) -> DatasetSource:\n return self._source",
"def data_source(self):\n... | [
"0.72443944",
"0.6912803",
"0.6375961",
"0.6326055",
"0.6263807",
"0.61858654",
"0.6173886",
"0.61317223",
"0.6124154",
"0.61231923",
"0.611299",
"0.60985607",
"0.60985607",
"0.60985607",
"0.60985607",
"0.60985607",
"0.6076321",
"0.5999728",
"0.5976692",
"0.5976692",
"0.59605... | 0.74361086 | 0 |
The name prefix to use when creating an inapplication stream. | def name_prefix(self) -> pulumi.Input[str]:
return pulumi.get(self, "name_prefix") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name_prefix(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"name_prefix\")",
"def name_prefix(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"name_prefix\")",
"def name_prefix(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"name_prefix\")",
"def name_prefix... | [
"0.71362305",
"0.71362305",
"0.71362305",
"0.71362305",
"0.6918192",
"0.68073887",
"0.6771651",
"0.6771651",
"0.6771651",
"0.6771651",
"0.6771651",
"0.6771651",
"0.6771651",
"0.6771651",
"0.66528785",
"0.65789336",
"0.6560445",
"0.6560445",
"0.6467437",
"0.6467437",
"0.646743... | 0.7220133 | 0 |
The input processing configuration for the input. An input processor transforms records as they are received from the stream, before the application's SQL code executes. | def input_processing_configuration(self) -> Optional[pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationInputInputProcessingConfigurationArgs']]:
return pulumi.get(self, "input_processing_configuration") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def preprocess(self, cfg_pipeline):\n return",
"def input_lambda_processor(self) -> pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationInputInputProcessingConfigurationInputLambdaProcessorArgs']:\n return pulumi.get(self, \"input_lambda_processor\")",
"def yaml_parser_pre... | [
"0.6423906",
"0.6413206",
"0.5722969",
"0.5721583",
"0.570311",
"0.56442153",
"0.55848205",
"0.55335677",
"0.5526697",
"0.5514887",
"0.5474236",
"0.540598",
"0.540598",
"0.540598",
"0.53983486",
"0.5380912",
"0.5368006",
"0.53399986",
"0.5308886",
"0.5306165",
"0.5293826",
... | 0.7067719 | 0 |
Describes the Lambda function that is used to preprocess the records in the stream before being processed by your application code. | def input_lambda_processor(self) -> pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationInputInputProcessingConfigurationInputLambdaProcessorArgs']:
return pulumi.get(self, "input_lambda_processor") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_transform_fn():",
"def preprocess_func(cls, func):\n return func",
"def preprocess_func(cls, func):\n pass",
"def lambda_fn(ds, fn):\n logger.info(\"Applying function '%s' on dataset.\", str(fn))\n return fn(ds)",
"def _generateLambda(self, string):\n derivation = self.fieldN... | [
"0.60500723",
"0.5853654",
"0.58531594",
"0.5635226",
"0.55408764",
"0.55171096",
"0.54786307",
"0.5369227",
"0.5369227",
"0.5313675",
"0.52289945",
"0.521508",
"0.51577866",
"0.51454824",
"0.51357025",
"0.51317424",
"0.51239043",
"0.51186234",
"0.5078332",
"0.5064614",
"0.50... | 0.58873874 | 1 |
Specifies the format of the records on the streaming source. | def record_format(self) -> pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationInputInputSchemaRecordFormatArgs']:
return pulumi.get(self, "record_format") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def record_format(self) -> pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationReferenceDataSourceReferenceSchemaRecordFormatArgs']:\n return pulumi.get(self, \"record_format\")",
"def data_format(self, data_format):\n self._data_format = data_format",
"def setDataFormat(s... | [
"0.6560593",
"0.63796043",
"0.61925083",
"0.58701175",
"0.58701175",
"0.5819595",
"0.5803842",
"0.5776424",
"0.5678299",
"0.5672246",
"0.5638766",
"0.56083024",
"0.5529705",
"0.55146104",
"0.5464747",
"0.54631674",
"0.5429269",
"0.53865623",
"0.5385777",
"0.53256935",
"0.5325... | 0.64553505 | 1 |
The column delimiter. For example, in a CSV format, a comma (`,`) is the typical column delimiter. | def record_column_delimiter(self) -> pulumi.Input[str]:
return pulumi.get(self, "record_column_delimiter") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_delimiter(ds_path: str) -> str:\n with open(ds_path) as f:\n first_line = f.readline()\n s = csv.Sniffer()\n return s.sniff(first_line).delimiter",
"def detect_csv_separator(filename):\n with open(filename) as csvfile:\n first_line = csvfile.readline()\n return cs... | [
"0.7160481",
"0.69935775",
"0.6887538",
"0.6887538",
"0.66514015",
"0.65056276",
"0.6475536",
"0.6418397",
"0.64122546",
"0.6394634",
"0.61797684",
"0.61778563",
"0.6057239",
"0.5975895",
"0.5971224",
"0.5918189",
"0.5899364",
"0.5842732",
"0.5809351",
"0.57896143",
"0.571567... | 0.82689506 | 1 |
The row delimiter. For example, in a CSV format, `\\n` is the typical row delimiter. | def record_row_delimiter(self) -> pulumi.Input[str]:
return pulumi.get(self, "record_row_delimiter") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def linesep(self):\n return self._linesep",
"def record_column_delimiter(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"record_column_delimiter\")",
"def record_column_delimiter(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"record_column_delimiter\")",
"def detect_csv_... | [
"0.6906747",
"0.65744084",
"0.65744084",
"0.6168595",
"0.61223483",
"0.60816497",
"0.60645837",
"0.59837085",
"0.5700958",
"0.56844014",
"0.5678744",
"0.56472635",
"0.563881",
"0.5636245",
"0.55983347",
"0.5551391",
"0.55208045",
"0.54770505",
"0.547492",
"0.5441575",
"0.5427... | 0.8129885 | 1 |
Specifies the format of the records on the streaming source. | def record_format(self) -> pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationReferenceDataSourceReferenceSchemaRecordFormatArgs']:
return pulumi.get(self, "record_format") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def record_format(self) -> pulumi.Input['ApplicationApplicationConfigurationSqlApplicationConfigurationInputInputSchemaRecordFormatArgs']:\n return pulumi.get(self, \"record_format\")",
"def data_format(self, data_format):\n self._data_format = data_format",
"def setDataFormat(self, format='yaml'... | [
"0.64553505",
"0.63796043",
"0.61925083",
"0.58701175",
"0.58701175",
"0.5819595",
"0.5803842",
"0.5776424",
"0.5678299",
"0.5672246",
"0.5638766",
"0.56083024",
"0.5529705",
"0.55146104",
"0.5464747",
"0.54631674",
"0.5429269",
"0.53865623",
"0.5385777",
"0.53256935",
"0.532... | 0.6560593 | 0 |
The column delimiter. For example, in a CSV format, a comma (`,`) is the typical column delimiter. | def record_column_delimiter(self) -> pulumi.Input[str]:
return pulumi.get(self, "record_column_delimiter") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_delimiter(ds_path: str) -> str:\n with open(ds_path) as f:\n first_line = f.readline()\n s = csv.Sniffer()\n return s.sniff(first_line).delimiter",
"def detect_csv_separator(filename):\n with open(filename) as csvfile:\n first_line = csvfile.readline()\n return cs... | [
"0.7158849",
"0.69919837",
"0.68864447",
"0.68864447",
"0.66498417",
"0.6502271",
"0.6472595",
"0.6415401",
"0.6408405",
"0.6391545",
"0.617637",
"0.61740214",
"0.6055878",
"0.59736997",
"0.5968155",
"0.59172034",
"0.58977574",
"0.5841925",
"0.5807263",
"0.57889515",
"0.57141... | 0.8267689 | 0 |
The row delimiter. For example, in a CSV format, `\\n` is the typical row delimiter. | def record_row_delimiter(self) -> pulumi.Input[str]:
return pulumi.get(self, "record_row_delimiter") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def linesep(self):\n return self._linesep",
"def record_column_delimiter(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"record_column_delimiter\")",
"def record_column_delimiter(self) -> pulumi.Input[str]:\n return pulumi.get(self, \"record_column_delimiter\")",
"def detect_csv_... | [
"0.69073635",
"0.6572592",
"0.6572592",
"0.61668015",
"0.6119303",
"0.6079805",
"0.6061957",
"0.5981943",
"0.5697512",
"0.568188",
"0.5678118",
"0.5645893",
"0.56365895",
"0.5633454",
"0.55964607",
"0.5549832",
"0.55176854",
"0.54758847",
"0.54739815",
"0.544086",
"0.54276514... | 0.8130535 | 0 |
The file key for the object containing the application code. | def file_key(self) -> pulumi.Input[str]:
return pulumi.get(self, "file_key") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def file_key(filename):\n return FILE_PREFIX + filename",
"def key_file(self):\n return self._get('key_file')",
"def key(self):\n key = self.name\n if self.task:\n key += getsource(self.task.__class__)\n return hashlib.md5(key.encode()).hexdigest()",
"def key(self):\... | [
"0.7508476",
"0.73354226",
"0.7072803",
"0.69536316",
"0.69291615",
"0.69158894",
"0.6855917",
"0.679805",
"0.6769428",
"0.67669773",
"0.6765789",
"0.67546976",
"0.6742771",
"0.6728351",
"0.6709861",
"0.6701392",
"0.6701392",
"0.6701392",
"0.6701392",
"0.6701392",
"0.6701392"... | 0.75691706 | 0 |
The ARN of the CloudWatch log stream to receive application messages. | def log_stream_arn(self) -> pulumi.Input[str]:
return pulumi.get(self, "log_stream_arn") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def application_arn(self) -> Optional[str]:\n return pulumi.get(self, \"application_arn\")",
"def log_stream_name(self) -> str:\n ...",
"def log_stream_name(self) -> str:\n return jsii.get(self, \"logStreamName\")",
"def log_stream_name(self) -> str:\n return jsii.get(self, \"logS... | [
"0.6001394",
"0.59847903",
"0.5802143",
"0.5802143",
"0.5731812",
"0.5621402",
"0.5612447",
"0.56038076",
"0.5595356",
"0.54737455",
"0.54737455",
"0.5471732",
"0.5471732",
"0.5444732",
"0.54274035",
"0.54274035",
"0.5395084",
"0.5389815",
"0.5353434",
"0.5353434",
"0.5326181... | 0.73665595 | 0 |
Attaches access token cache to given credentials if no store set. Note that credentials themselves will not be persisted only access token. Use this whenever access token caching is desired, yet credentials themselves should not be persisted. | def MaybeAttachAccessTokenCacheStore(credentials,
access_token_file=None):
if credentials.store is not None:
return credentials
account_id = getattr(credentials, 'service_account_email', None)
if not account_id:
account_id = six.text_type(hash(credentials.refresh_token... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, access_token_cache, account_id, credentials):\n super(AccessTokenStore, self).__init__(lock=None)\n self._access_token_cache = access_token_cache\n self._account_id = account_id\n self._credentials = credentials",
"def auth_token_provider_reuse_access_token(self, auth_token_provide... | [
"0.651423",
"0.5646629",
"0.55664665",
"0.55158335",
"0.5494154",
"0.54888105",
"0.5463974",
"0.5452858",
"0.5426651",
"0.5384568",
"0.5347672",
"0.53383857",
"0.53216386",
"0.53113616",
"0.52904916",
"0.5233214",
"0.51778674",
"0.5173551",
"0.5167001",
"0.51514953",
"0.51195... | 0.74616456 | 0 |
Given Oauth2client credentials return library independent json for it. | def ToJson(credentials):
creds_type = CredentialType.FromCredentials(credentials)
if creds_type == CredentialType.USER_ACCOUNT:
creds_dict = {
'type': creds_type.key,
'client_id': credentials.client_id,
'client_secret': credentials.client_secret,
'refresh_token': credentials.refr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _v2_auth(self, url):\n return {\"auth\": {\n \"passwordCredentials\": {\"username\": self.user,\n \"password\": self.secret}}}",
"def get_api_credentials(scope, service_account=True):\n\tSTORAGE = file.Storage('oAuth2.json') #local storage of oAuth tokens\... | [
"0.64327383",
"0.6215458",
"0.6149437",
"0.6104791",
"0.60650396",
"0.59063005",
"0.57356715",
"0.57085896",
"0.57019377",
"0.5687563",
"0.5602176",
"0.5558295",
"0.55137014",
"0.5491059",
"0.5483749",
"0.5466274",
"0.5413144",
"0.5401998",
"0.5400506",
"0.5377871",
"0.536562... | 0.69036746 | 0 |
Get a sqlitebased Credential Store. | def _GetSqliteStore(sqlite_credential_file=None, sqlite_access_token_file=None):
sqlite_credential_file = (sqlite_credential_file or
config.Paths().credentials_db_path)
files.PrivatizeFile(sqlite_credential_file)
credential_store = SqliteCredentialStore(sqlite_credential_file)
sqlit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load_credential_store(self): \n try:\n return shelve.open(self._store_pathname)\n\n except Exception:\n raise CredentialError('Unable to open credential store: ' + self._store_pathname)",
"def get(self):\n self._lock.acquire()\n try:\n f = open(self._filenam... | [
"0.7100657",
"0.6401368",
"0.63991886",
"0.6351033",
"0.6237552",
"0.6196055",
"0.6127853",
"0.61212665",
"0.6104686",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
"0.6098569",
... | 0.827619 | 0 |
Dumps the credentials and the quota project to the ADC json file. | def DumpExtendedADCToFile(self, file_path=None, quota_project=None):
if (CredentialType.FromCredentials(self._credentials) !=
CredentialType.USER_ACCOUNT):
raise CredentialFileSaveError(
'The credential is not a user credential, so we cannot insert a '
'quota project to application... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _DumpADCJsonToFile(adc, file_path):\n try:\n contents = json.dumps(adc, sort_keys=True, indent=2, separators=(',', ': '))\n files.WriteFileContents(file_path, contents, private=True)\n except files.Error as e:\n log.debug(e, exc_info=True)\n raise CredentialFileSaveError(\n 'Error saving A... | [
"0.63619524",
"0.6058559",
"0.6049376",
"0.59278494",
"0.5824682",
"0.5713599",
"0.54278344",
"0.53845274",
"0.5381745",
"0.5363411",
"0.53609824",
"0.5358683",
"0.5354004",
"0.53457445",
"0.5327523",
"0.52664196",
"0.52118564",
"0.51858824",
"0.5175649",
"0.51462495",
"0.513... | 0.6461764 | 0 |
Add quota_project_id field to ADC json. | def _ExtendADCWithQuotaProject(self, quota_project):
extended_adc = copy.deepcopy(self.adc)
if quota_project:
extended_adc[ADC_QUOTA_PROJECT_FIELD_NAME] = quota_project
else:
log.warning(
'Cannot find a project to insert into application default '
'credentials (ADC) as a quot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, quota_json):\n super(Quota, self).__init__(quota_json)",
"def _project(request, key):\n context = request.context\n if not context.project_id:\n raise exceptions.QuotaMissingTenant()\n return {key: {key + '_id': context.project_id}}",
"def set_project_q... | [
"0.60322165",
"0.5817829",
"0.566296",
"0.55185705",
"0.5480808",
"0.53639513",
"0.5296517",
"0.5217045",
"0.521169",
"0.521169",
"0.51124364",
"0.51077044",
"0.51072097",
"0.50957143",
"0.50301355",
"0.5028076",
"0.49977353",
"0.4991696",
"0.49663103",
"0.49636415",
"0.49545... | 0.71154326 | 0 |
Dumps ADC json object to file. | def _DumpADCJsonToFile(adc, file_path):
try:
contents = json.dumps(adc, sort_keys=True, indent=2, separators=(',', ': '))
files.WriteFileContents(file_path, contents, private=True)
except files.Error as e:
log.debug(e, exc_info=True)
raise CredentialFileSaveError(
'Error saving Application D... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def DumpADCToFile(self, file_path=None):\n file_path = file_path or self.default_adc_file_path\n return _DumpADCJsonToFile(self.adc, file_path)",
"def dump(self):\n if self.jfile != None: \n with open(\"%s.json\" % self.jfile, 'w') as fd:\n json.dump([self.buf_i, self.... | [
"0.66645867",
"0.658237",
"0.65601677",
"0.6416019",
"0.6347637",
"0.63372505",
"0.6213744",
"0.621152",
"0.6193932",
"0.619238",
"0.6186865",
"0.61700195",
"0.6167682",
"0.6164547",
"0.61431515",
"0.614036",
"0.61272544",
"0.6101407",
"0.6098971",
"0.6098118",
"0.6091912",
... | 0.73404664 | 0 |
adds new bar matrix to plot_matrix_list | def add_barplot(self, x_axe, y_axe, name="Plot"):
if x_axe and y_axe:
# calculating canvas params of current plot
max_x = max(x_axe)
max_y = max(y_axe)
step_y = max_y // self.divider
step_x = max_x // self.divider
value_of_bar = step_y / se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bar(self, row_id, col_id, label=None, offset=(350, 30), **kwargs):\n bar = BarGraph(label=label, **kwargs)\n self.pl[row_id, col_id].addItem(bar)\n\n bar.barClicked.connect(self.clickedBar)",
"def _q_bar_matrix(self):\n return np.array([\n [self.q[0], -self.q[1], -self.... | [
"0.57784945",
"0.55985945",
"0.5518147",
"0.5505747",
"0.54637384",
"0.54401857",
"0.534793",
"0.53365016",
"0.52733284",
"0.5266981",
"0.52591056",
"0.5226266",
"0.5118469",
"0.5108735",
"0.5096863",
"0.5073557",
"0.507038",
"0.50665236",
"0.5063104",
"0.50592613",
"0.505818... | 0.5668367 | 1 |
Returns the module google.protobuf.json_format | def getJsonFormat():
return json_format | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format(cls):\n return \"json\"",
"def format(self):\n return self[\"format\"]",
"def format(self):\n return self[\"format\"]",
"def get_format(cls):\n return cls._format",
"def get_format(self):\n pass",
"def json_format_version(self) -> List[int]:\n return s... | [
"0.65211064",
"0.62669176",
"0.62669176",
"0.62618667",
"0.6225714",
"0.6128684",
"0.6062467",
"0.5907508",
"0.5865211",
"0.5660671",
"0.5660671",
"0.565723",
"0.56493616",
"0.56386447",
"0.55734247",
"0.5573061",
"0.55502754",
"0.55164206",
"0.5507462",
"0.54791635",
"0.5476... | 0.7530172 | 0 |
Returns the module google.protobuf.struct_pb2 | def getStructPb2():
return struct_pb2 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_protobuf_schema() -> GeneratedProtocolMessageType:\n\n return GetGroupMessage_PB",
"def get_protobuf_schema() -> GeneratedProtocolMessageType:\n\n return UpdateGroupMessage_PB",
"def get_protobuf_schema() -> GeneratedProtocolMessageType:\n\n return GetGroupResponse_PB",
"def get_... | [
"0.6989943",
"0.68833786",
"0.67564493",
"0.67261416",
"0.67225623",
"0.6691569",
"0.66570055",
"0.6597888",
"0.6494545",
"0.6414882",
"0.64075613",
"0.62625",
"0.61084735",
"0.60853565",
"0.60373724",
"0.5939573",
"0.58508843",
"0.58262056",
"0.58053815",
"0.576158",
"0.5749... | 0.82754725 | 0 |
Transform the string in a set and check it's length. If it's different from the lenght of the string, return False | def is_unique_n_set(string: str) -> bool:
return len(set(string)) == len(string) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_unique_set(string):\n return len(string) == len(set(string))",
"def is_unique2(test_str):\n\n chars = set(test_str)\n\n if len(test_str) == len(chars):\n return True\n\n return False",
"def is_unique_string(s):\n return len(s) == len(set(s))",
"def _check_max_length(self, p: lis... | [
"0.7004517",
"0.67947793",
"0.6566188",
"0.6392785",
"0.6279278",
"0.6263172",
"0.61861837",
"0.6113249",
"0.61025304",
"0.6063138",
"0.6062532",
"0.6062532",
"0.60592145",
"0.60538894",
"0.6049363",
"0.6034283",
"0.6023342",
"0.59905356",
"0.59903276",
"0.59786355",
"0.59713... | 0.7378646 | 0 |
Quantify the passed FASTQ files using a subprocess call to Kallisto kallisto Path to kallisto executable fq_dir Directory of the FASTQ input files transcriptome Path to reference transcriptome | def quantify(kallisto, fq_dir, transcriptome):
try:
out = subprocess.check_output(
[
kallisto,
"OTHER STUFF"
]
)
except subprocess.CalledProcessError as e:
print(e)
return(1)
return(out) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def quant(input_folder,fastq_dict,species_kmers,output_folder,transcriptome_folder,bsub_out=\"bsub_out\"):\n print(\"Starting new quantification run for batch of %d samples from %s\"%(len(fastq_dict),input_folder))\n mkdir_p(bsub_out)\n #no subfolders needed for SRA data\n print(\"bsub logs stored in %... | [
"0.7481823",
"0.65502053",
"0.617919",
"0.61411935",
"0.5991473",
"0.5925397",
"0.5808109",
"0.57995737",
"0.57940453",
"0.5784107",
"0.5745061",
"0.573668",
"0.57352805",
"0.5705401",
"0.56974626",
"0.5648538",
"0.56192017",
"0.5613782",
"0.559223",
"0.55875987",
"0.55737156... | 0.7143875 | 1 |
Orthogonalize each column in matrix A w.r.t. matrix B in M basis. M is a LinearOperator. | def ortho(A, B, dim=-2, M=None, mright=True):
if M is None:
return A - (A * B).sum(dim=dim, keepdim=True) * B
elif mright:
return A - (M.mm(A) * B).sum(dim=dim, keepdim=True) * B
else:
return A - M.mm((A * B).sum(dim=dim, keepdim=True) * B) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def orthogonalize_matrix(m):\n U, __, VT = np.linalg.svd(np.matrix(m))\n return np.dot(U, VT)",
"def orthogonality(matrix):\n norm = jnp.sqrt(jnp.sum(matrix**2, axis=1))\n matrix_normalized = matrix / (norm[:, None] + EPSILON)\n return matrix_normalized @ matrix_normalized.transpose()",
"def _matrixOr... | [
"0.7009345",
"0.61869025",
"0.60442066",
"0.58897644",
"0.5867025",
"0.5854292",
"0.5712935",
"0.56533104",
"0.56307596",
"0.55762094",
"0.553436",
"0.54413205",
"0.5420926",
"0.5419841",
"0.53674424",
"0.53617686",
"0.53605556",
"0.5349843",
"0.5327146",
"0.53218573",
"0.530... | 0.72226095 | 0 |
Cat the /tmp/log file Store in the class variable _build_log_text This content won't change, so we'll use self._build_log_text as a cache | def build_log(self):
if not self._build_log_text:
self._build_log_text = self._cat('/tmp/log')
return self._build_log_text | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_data(self):\n\n self.check_dir()\n with open(self.log_file, \"a\") as logger_file:\n logger_file.write(\"{}, {}\\n\".format(self.time, self.msg))",
"def _init_log(self):\n if not os_path_exists(self.log_file):\n self._write('', 'w')",
"def logsave(self):\n ... | [
"0.6914454",
"0.6854679",
"0.676383",
"0.6619031",
"0.65706134",
"0.6560708",
"0.638432",
"0.6362478",
"0.6362212",
"0.6361741",
"0.63182664",
"0.63145626",
"0.62974083",
"0.62739825",
"0.62590253",
"0.6242276",
"0.61643624",
"0.6158187",
"0.61472064",
"0.614538",
"0.61363995... | 0.81534284 | 0 |
Cat the /tmp/error file Store in the class variable _error_log_text This content won't change, so we'll use self._error_log_text as a cache | def error_log(self):
if not self._error_log_text:
self._error_log_text = self._cat('/tmp/errors')
return self._error_log_text | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def logError(self, text):\n time = datetime.now().strftime(\"%H:%M:%S \")\n self.log(time + \"(ERR):\\t\", text)",
"def log_error(self, message):\n # log the datetime+message to error_log.txt\n curr_time = datetime.datetime.now().strftime(\"%H:%M:%S \"\n ... | [
"0.659818",
"0.65906084",
"0.6447774",
"0.6318997",
"0.62516534",
"0.6184731",
"0.6142806",
"0.61355877",
"0.612007",
"0.6097077",
"0.6083677",
"0.6080938",
"0.60623085",
"0.60591733",
"0.6055762",
"0.6041494",
"0.6037642",
"0.60330135",
"0.5987795",
"0.5987157",
"0.5986379",... | 0.81520677 | 0 |
Instantiate a new user session, given the user's ID, the time of the event, and the event itself. | def __init__(self, user_id, start_time, events, last_time=None):
# Store the user's ID and the timestamp of the start of this session
self.user_id = user_id
self.first_timestamp = start_time
# If the user had a known previous session end time, let's store that
if last_time is n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_session(self, user_id, **kwargs):\n defaults = {\n 'created_at': time.time()\n }\n defaults.update(kwargs)\n self.save_session(user_id, defaults)\n if self.max_session_length:\n self.schedule_session_expiry(user_id, self.max_session_length)\n ... | [
"0.70722103",
"0.6421884",
"0.63374776",
"0.62315655",
"0.6223192",
"0.61353743",
"0.59885424",
"0.59807557",
"0.5916376",
"0.5879288",
"0.5867936",
"0.5867288",
"0.5865137",
"0.5843203",
"0.58274156",
"0.5784982",
"0.57710856",
"0.5763767",
"0.5759849",
"0.5759225",
"0.57484... | 0.7434149 | 0 |
The current session has come to a close when we received an event outside of the max interevent duration. As such, construct a payload that contains information about this session, for later storage. | def close_session(self):
return {
"duration": (self.last_timestamp - self.first_timestamp).seconds / 60,
"total_events": len(self.events_in_session[:-1].split(",")),
"user_id": self.user_id,
"timestamp": self.first_timestamp,
"last_timestamp": self.las... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def payload(self) -> dict:\n return {\n 'event_name': '',\n\n }",
"def process_events(self):\n next_timeout = ffi.new('int *')\n\n spotify.Error.maybe_raise(lib.sp_session_process_events(\n self._sp_session, next_timeout))\n\n return next_timeout[0]",
"d... | [
"0.6061007",
"0.5872116",
"0.5685048",
"0.5534685",
"0.5433771",
"0.542238",
"0.5407633",
"0.539605",
"0.5343599",
"0.5332656",
"0.53315985",
"0.53115153",
"0.5297154",
"0.52789974",
"0.5272441",
"0.5258945",
"0.52588993",
"0.52486044",
"0.52238214",
"0.5219478",
"0.52168334"... | 0.68322027 | 0 |
Log an event. If the user has an existing session open, it will be added to that session; otherwise, a new one will be created for them. | def log_event(self, user_id, timestamp, events, duration=30):
# If the user doesn't have an open session
if self.current_sessions.get(user_id) is None:
# Then create a new one, and store that current session
session = UserCurrentSession(user_id, timestamp, events)
se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log_event(self, event_timestamp, events, duration=30):\n\n # If the event is within the session\n if (event_timestamp - self.last_timestamp).total_seconds() < duration * 60:\n\n # Update the current session's last event time\n # and add the event to the list of events\n ... | [
"0.72297865",
"0.68521917",
"0.64133537",
"0.6412893",
"0.628519",
"0.627616",
"0.6197996",
"0.61559016",
"0.6091189",
"0.6076861",
"0.6009313",
"0.59900814",
"0.5989177",
"0.598117",
"0.5954494",
"0.595015",
"0.58841825",
"0.58841825",
"0.5874921",
"0.5874921",
"0.5874921",
... | 0.75089663 | 0 |
Converts the inputs to a numpy array. | def _convert_to_np_array(inputs: Union[float, Tuple[float], np.ndarray], dim):
outputs = None
if isinstance(inputs, (tuple, np.ndarray)):
outputs = np.array(inputs)
else:
outputs = np.full(dim, inputs)
if len(outputs) != dim:
raise ValueError("The inputs array has a different dimension {}"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_numpy(self, **kwargs):\n pass",
"def _to_numpy_ndarray(cls, data):\n if isinstance(data, np.ndarray):\n return data\n arr = np.array(data, dtype=np.float)\n if len(arr.shape) == 1:\n arr = np.reshape(arr, newshape=(1, arr.shape[0]))\n return arr",
... | [
"0.746069",
"0.69843745",
"0.69512624",
"0.6800036",
"0.679763",
"0.67890203",
"0.67890203",
"0.6775519",
"0.6775212",
"0.674951",
"0.67156804",
"0.67091966",
"0.6706892",
"0.66821086",
"0.66363823",
"0.66122323",
"0.6609599",
"0.6583373",
"0.65531075",
"0.65194315",
"0.65061... | 0.7654006 | 1 |
Initializes the first order filter. Requires that filter is called at regular intervals specified by sampling_time Computes the complementary factor as, alpha = sampling_time / (time_constant + sampling_time), which is valid for time_constant >> sampling_time. | def __init__(self, time_constant: float, sampling_time: float):
self.alpha = sampling_time / (time_constant + sampling_time)
self.state = None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_filter(self, first_call_time, measurement):\n # Initial state\n m = measurement.flatten()\n self.x = np.c_[m, np.zeros_like(m)].flatten()\n assert len(self.x) == self.state_dim, 'State dim does not match'\n # State transition matrix\n self.F = np.zeros([12, ... | [
"0.63928115",
"0.638262",
"0.60742694",
"0.56298333",
"0.562949",
"0.5618275",
"0.5612252",
"0.554044",
"0.5511209",
"0.54992723",
"0.54481417",
"0.5411458",
"0.5410106",
"0.5388484",
"0.5307554",
"0.52980787",
"0.5248909",
"0.5224966",
"0.5224966",
"0.5224966",
"0.52232933",... | 0.6741435 | 0 |
Sets the gains of all motors. These gains are PD gains for motor positional control. kp is the proportional gain and kd is the derivative gain. | def set_motor_gains(
self,
kp: Union[float, Tuple[float], np.ndarray],
kd: Union[float, Tuple[float], np.ndarray],
):
self._kp = _convert_to_np_array(kp, self._num_motors)
self._kd = _convert_to_np_array(kd, self._num_motors) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_motor_gains(self):\n return self._kp, self._kd",
"def setKd(self, derivative_gain):\r\n self.Kd = derivative_gain",
"def set_tunings(self, kp, ki, kd, p_on_e):\n if kp < 0 or ki < 0 or kd < 0:\n print(\"PID parameters cannot be less than zero.\")\n if self.forward:\n ... | [
"0.62753445",
"0.58722025",
"0.5867399",
"0.58380836",
"0.5834265",
"0.5743118",
"0.5709882",
"0.5672215",
"0.54417557",
"0.5416091",
"0.5351114",
"0.5262038",
"0.52445704",
"0.52003187",
"0.51246554",
"0.5015624",
"0.50074136",
"0.50070643",
"0.50028193",
"0.4995706",
"0.495... | 0.8093956 | 0 |
Get the PD gains of all motors. | def get_motor_gains(self):
return self._kp, self._kd | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_motors():\n return mc.get('motor_values')",
"def get_gains(self):\n self._pid_lock.acquire() # Acquire Lock\n\n rtn = {\n PIDController.KP_KEY: self._kP,\n PIDController.KI_KEY: self._kI,\n PIDController.KD_KEY: self._kD\n }\n\n ... | [
"0.5975514",
"0.57920396",
"0.5651322",
"0.5581263",
"0.55549437",
"0.5524639",
"0.54204303",
"0.53717446",
"0.53626394",
"0.53346324",
"0.5261317",
"0.52570295",
"0.52332306",
"0.52309495",
"0.519466",
"0.51856613",
"0.5156386",
"0.5147275",
"0.5129355",
"0.5119178",
"0.5090... | 0.7455719 | 0 |
Computes the motor torques. | def get_motor_torques(
self,
motor_commands: np.ndarray,
motor_control_mode=None) -> Tuple[np.ndarray, np.ndarray]:
if not motor_control_mode:
motor_control_mode = self._motor_control_mode
motor_torques = None
if motor_control_mode is robot_config.MotorControlMode.TORQUE:
mot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def motor_torques(self):\n raise NotImplementedError('Not yet implemented!')",
"def compute_torques(self, caller):\n if caller == 'pose':\n self.pose_call = True\n if caller == 'vel':\n self.vel_call = True\n #If both vels and poses has called compute torques\n ... | [
"0.7586769",
"0.6873253",
"0.66058385",
"0.6421434",
"0.6321269",
"0.6254091",
"0.6178357",
"0.6170231",
"0.5890763",
"0.58480805",
"0.5822806",
"0.5819131",
"0.56880105",
"0.56318456",
"0.5631183",
"0.5628372",
"0.56055325",
"0.5602737",
"0.5576653",
"0.5565028",
"0.5532901"... | 0.70870054 | 1 |
Computes observation of motor angle and velocity under latency. | def get_motor_states(self, latency=None):
if latency is None:
latency = self._pd_latency
buffer = self._observation_buffer.get_delayed_value(latency)
angle_vel_t0 = buffer.value_0
angle_vel_t1 = buffer.value_1
coeff = buffer.coeff
pos_idx = 0
motor_angles = angle_vel_t0[pos_idx] * (
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_vel(self, state, goal):\n\n \"\"\"\n Unicycle model control law:\n [v;w] = [kp 0 0; 0 ka kb]*[p;a;b]\n v = commanded linear velocity of robot\n w = commanded rotational velcoity of robot\n kp = gain parameter where kp > 0\n ka = gain parameter where ka -... | [
"0.6689666",
"0.6635304",
"0.650453",
"0.64466584",
"0.63028914",
"0.6162215",
"0.6098542",
"0.60848826",
"0.60819685",
"0.60772544",
"0.60603005",
"0.60552835",
"0.6050636",
"0.6027384",
"0.59821045",
"0.59553456",
"0.5938499",
"0.5933562",
"0.5925076",
"0.59192026",
"0.5902... | 0.73435795 | 0 |
Computes the pd torques. | def _compute_pd_torques(
self,
desired_motor_angles: np.ndarray,
kp: np.ndarray,
desired_motor_velocities,
kd: np.ndarray,
) -> Tuple[np.ndarray, np.ndarray]:
motor_angles, motor_velocities = self.get_motor_states()
motor_torques = -kp * (motor_angles - desired_motor_angles) - kd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def compute_torques(self, caller):\n if caller == 'pose':\n self.pose_call = True\n if caller == 'vel':\n self.vel_call = True\n #If both vels and poses has called compute torques\n if self.pose_call and self.vel_call:\n #Reset checkers\n self... | [
"0.58948183",
"0.5625053",
"0.5543698",
"0.5510901",
"0.54293513",
"0.5360425",
"0.5315842",
"0.52422225",
"0.5238921",
"0.5214612",
"0.519302",
"0.51507187",
"0.50875676",
"0.50651896",
"0.5029844",
"0.5023859",
"0.49947906",
"0.49939898",
"0.49775532",
"0.49667665",
"0.4963... | 0.7324066 | 0 |
Retrieve the HTML for the given episode playlist URL. | def retrieve_episode_html(url):
response = requests.get(url)
return response.content | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_episode(url):\n domain = parse_domain(url)\n html = retrieve_episode_html(url)\n return domain, html",
"def getDownload(self, html, episode_number):\n soup = BeautifulSoup(html, \"html.parser\")\n download = soup.find_all('source')\n if download:\n self.downl... | [
"0.72098535",
"0.6683082",
"0.6336104",
"0.6289755",
"0.6265504",
"0.62509876",
"0.6218938",
"0.605726",
"0.6040801",
"0.59332925",
"0.58976763",
"0.58947045",
"0.58816195",
"0.5827879",
"0.5806822",
"0.5793759",
"0.57340175",
"0.5733955",
"0.5672913",
"0.5666561",
"0.5657982... | 0.77256435 | 0 |
Create a linked list from input array | def create_linked_list(Arr):
# check if array is empty or not
if len(Arr) == 0:
return None
# put first array value as head of linked list
head = Node(Arr[0])
# vars for linked list
prev = head
curr = None
# read remaining array and set sibling ptrs
for i ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def constructListNode(input_list):\n root = ListNode(0)\n curr = root\n for i in range(len(input_list)):\n curr.next = ListNode(input_list[i])\n curr = curr.next\n return root.next",
"def create_linked_list(input_list):\n if len(input_list) == 0:\n return None\n head = crea... | [
"0.64746267",
"0.62838835",
"0.62798005",
"0.61630315",
"0.6149418",
"0.6052515",
"0.6016434",
"0.59775466",
"0.5949384",
"0.5918414",
"0.5884773",
"0.5884545",
"0.5874807",
"0.5874807",
"0.58640456",
"0.5757416",
"0.5716086",
"0.5712112",
"0.57034636",
"0.5693684",
"0.569015... | 0.7253454 | 0 |
print linked list pointed to by head | def print_linked_list(head):
while head != None:
print head.val,
head = head.sibling
print | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_list(head=None):\n print head\n if(head.next):\n print_list(head.next)",
"def printList(head) :\n \n # Iterate through the list, printing all values\n ptr = head\n while ptr :\n print(ptr.data, end=\" \")\n ptr = ptr.next\n print()",
"def print(self):\n ... | [
"0.8448935",
"0.82492477",
"0.8243216",
"0.8227272",
"0.81590027",
"0.81332666",
"0.81206983",
"0.80077916",
"0.7980729",
"0.79632694",
"0.7887659",
"0.7880878",
"0.7772034",
"0.7762872",
"0.7679602",
"0.76236916",
"0.7562152",
"0.7512745",
"0.74997616",
"0.74892604",
"0.7376... | 0.86068755 | 0 |
print child list ponted to by head | def print_child_list(head):
while head != None:
print head.val,
head = head.child
print | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def printList(self): \r\n aux = self.head \r\n while(aux): \r\n print(aux.data , end = ' ') \r\n aux = aux.next",
"def print_list(self):\n\n current = self.head\n\n while current is not None:\n print current.data\n current = current.next"... | [
"0.72938114",
"0.72850025",
"0.7251832",
"0.72301435",
"0.7212098",
"0.71728474",
"0.7083767",
"0.704221",
"0.69309556",
"0.69058675",
"0.68508905",
"0.6748205",
"0.6723264",
"0.6641698",
"0.66155374",
"0.65852165",
"0.6580225",
"0.65455526",
"0.6518585",
"0.6505857",
"0.6463... | 0.83477503 | 0 |
Initializes a new MotionHandler. | def __init__(self, motion_queue):
threading.Thread.__init__(self)
self.motion_queue = motion_queue
self.motions = []
self.kill = False
self.timeout = 1
logging.debug("Created MotionHandler %s . Reader %s",
self, self.motion_queue) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n self.inches_moved = 0\n self.left_motor = ev3.LargeMotor(ev3.OUTPUT_B)\n self.right_motor = ev3.LargeMotor(ev3.OUTPUT_C)\n self.arm_motor = ev3.MediumMotor(ev3.OUTPUT_A)\n self.touch_sensor = ev3.TouchSensor()\n self.running = True\n self.ir_se... | [
"0.62182754",
"0.61050564",
"0.60680073",
"0.58909935",
"0.5887746",
"0.58321303",
"0.5790146",
"0.57515806",
"0.573849",
"0.569168",
"0.5687837",
"0.56513983",
"0.56474024",
"0.56254536",
"0.5605766",
"0.5591285",
"0.55898756",
"0.55809253",
"0.55457664",
"0.55391216",
"0.55... | 0.6736274 | 0 |
Adds a motion to detect. Once added the handler will try to detect this motion. Duplicate motions are allowed, but it will cause the action to get executed multiple times for each detection. | def add_motion(self, mot):
self.motions.append(mot)
logging.debug("Added Motion %s to MotionHandler %s",
mot, self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_motion_detection(self):\n ret = self._nvr.set_camera_recording(self._uuid, \"motion\")\n if not ret:\n return\n\n self._motion_status = \"motion\"\n self._isrecording = True\n _LOGGER.debug(\"Motion Detection Enabled for Camera: %s\", self._name)",
"def _m... | [
"0.5844171",
"0.56728196",
"0.5666996",
"0.5635643",
"0.552874",
"0.5392539",
"0.53719383",
"0.5301622",
"0.519511",
"0.51770824",
"0.5141038",
"0.51387775",
"0.5125174",
"0.5086803",
"0.5073165",
"0.5050087",
"0.5038127",
"0.5012593",
"0.4997618",
"0.49935424",
"0.49668458",... | 0.8004302 | 0 |
Link value to handler | def _set_link(self, value, handler):
self._mapping[value] = handler | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_handler(self, name):\n return self.params[name].value_handler",
"def get_cb(self, value):\n log.debug(f\"Value received from DHT get lookup of {self.key}: {value}\")\n self.append(value)",
"def register_handler(self, handler):\r\n self.handler = handler",
"def process(self... | [
"0.6803656",
"0.6768367",
"0.64776534",
"0.643902",
"0.6264778",
"0.6241445",
"0.62249726",
"0.61271816",
"0.6103107",
"0.6036977",
"0.6036977",
"0.5997133",
"0.5973603",
"0.5950872",
"0.59468174",
"0.59182614",
"0.5861313",
"0.5832669",
"0.58324957",
"0.58324957",
"0.5821123... | 0.69994706 | 0 |
Creates an InputSpec from a ComponentInputsSpec message in dict format (pipeline_spec.components..inputDefinitions.parameters.). | def from_ir_component_inputs_dict(
cls, ir_component_inputs_dict: Dict[str, Any]) -> 'InputSpec':
if 'parameterType' in ir_component_inputs_dict:
type_string = ir_component_inputs_dict['parameterType']
type_ = type_utils.IR_TYPE_TO_IN_MEMORY_SPEC_TYPE.get(type_string)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_v1_component_spec(\n cls,\n v1_component_spec: v1_structures.ComponentSpec) -> 'ComponentSpec':\n component_dict = v1_component_spec.to_dict()\n if component_dict.get('implementation') is None:\n raise ValueError('Implementation field not found')\n\n i... | [
"0.63507426",
"0.626017",
"0.59023",
"0.5680535",
"0.55224806",
"0.5454127",
"0.5428586",
"0.5398932",
"0.53977805",
"0.5394131",
"0.5379558",
"0.5328352",
"0.5264637",
"0.52405065",
"0.5112282",
"0.5099798",
"0.509574",
"0.50762194",
"0.50648177",
"0.50582767",
"0.50547415",... | 0.7276286 | 0 |
Equality comparison for InputSpec. Robust to different type representations, such that it respects the maximum amount of information possible to encode in IR. That is, because `typing.List[str]` can only be represented a `List` in IR, 'typing.List' == 'List' in this comparison. | def __eq__(self, other: Any) -> bool:
if isinstance(other, InputSpec):
return type_utils.get_canonical_name_for_outer_generic(
self.type) == type_utils.get_canonical_name_for_outer_generic(
other.type) and self.default == other.default
else:
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def assert_spec_compatibility(input_spec: TensorSpec, other_spec: TensorSpec):\n if not input_spec:\n return False\n if isinstance(input_spec, (tuple, list)) and all([isinstance(item, numbers.Integral) for item in input_spec]):\n input_spec = TensorSpec(shape=to_tensor(input_spec))\n\n if is... | [
"0.6361688",
"0.5710673",
"0.56830126",
"0.5659754",
"0.56373155",
"0.56326175",
"0.55026084",
"0.5413745",
"0.53967404",
"0.5345117",
"0.53326076",
"0.5311643",
"0.5305124",
"0.52690315",
"0.5262476",
"0.52565765",
"0.52542055",
"0.52172667",
"0.51932675",
"0.518693",
"0.516... | 0.6071262 | 1 |
Type should either be a parameter or a valid bundled artifact type by the time it gets to InputSpec. This allows us to perform fewer checks downstream. | def _validate_type(self) -> None:
# TODO: add transformation logic so that we don't have to transform inputs at every place they are used, including v1 back compat support
if not spec_type_is_parameter(self.type):
type_utils.validate_bundled_artifact_type(self.type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_type(self):\n # TODO: add transformation logic so that we don't have to transform outputs at every place they are used, including v1 back compat support\n if not spec_type_is_parameter(self.type):\n type_utils.validate_bundled_artifact_type(self.type)",
"def test_type_check... | [
"0.8123066",
"0.61260456",
"0.59167814",
"0.590088",
"0.58568084",
"0.5829538",
"0.5785337",
"0.5738281",
"0.5710498",
"0.5675379",
"0.56743306",
"0.5647267",
"0.5591175",
"0.55651367",
"0.5549972",
"0.55474687",
"0.5531946",
"0.55315727",
"0.5489079",
"0.5461646",
"0.5443961... | 0.8103978 | 1 |
Creates an OutputSpec from a ComponentOutputsSpec message in dict format (pipeline_spec.components..outputDefinitions.parameters|artifacts.). | def from_ir_component_outputs_dict(
cls, ir_component_outputs_dict: Dict[str, Any]) -> 'OutputSpec':
if 'parameterType' in ir_component_outputs_dict:
type_string = ir_component_outputs_dict['parameterType']
type_ = type_utils.IR_TYPE_TO_IN_MEMORY_SPEC_TYPE.get(type_string)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_pipeline_spec_dict(cls, pipeline_spec_dict: Dict[str, Any],\n component_name: str) -> 'Implementation':\n executor_key = utils.sanitize_executor_label(component_name)\n executor = pipeline_spec_dict['deploymentSpec']['executors'].get(\n executor_key)... | [
"0.5480028",
"0.5465604",
"0.5459345",
"0.54008895",
"0.54000956",
"0.5381803",
"0.5306984",
"0.51787907",
"0.51635534",
"0.5140961",
"0.51241505",
"0.48760843",
"0.47889614",
"0.4787075",
"0.4715851",
"0.46876132",
"0.4637216",
"0.46329325",
"0.4622072",
"0.4539027",
"0.4531... | 0.65594184 | 0 |
Equality comparison for OutputSpec. Robust to different type representations, such that it respects the maximum amount of information possible to encode in IR. That is, because `typing.List[str]` can only be represented a `List` in IR, 'typing.List' == 'List' in this comparison. | def __eq__(self, other: Any) -> bool:
if isinstance(other, OutputSpec):
return type_utils.get_canonical_name_for_outer_generic(
self.type) == type_utils.get_canonical_name_for_outer_generic(
other.type)
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_type_equality(self):\r\n #list of matrices\r\n myType1 = TypedListType(T.TensorType(theano.config.floatX,\r\n (False, False)))\r\n #list of matrices\r\n myType2 = TypedListType(T.TensorType(theano.config.floatX,\r\n ... | [
"0.59405035",
"0.5857514",
"0.58393806",
"0.5748355",
"0.56077236",
"0.55620664",
"0.555708",
"0.5542282",
"0.5511462",
"0.550106",
"0.5492813",
"0.54836243",
"0.5474691",
"0.54711217",
"0.5459651",
"0.5416596",
"0.53954756",
"0.5392184",
"0.53889036",
"0.53886",
"0.5387499",... | 0.6710461 | 0 |
Type should either be a parameter or a valid bundled artifact type by the time it gets to OutputSpec. This allows us to perform fewer checks downstream. | def _validate_type(self):
# TODO: add transformation logic so that we don't have to transform outputs at every place they are used, including v1 back compat support
if not spec_type_is_parameter(self.type):
type_utils.validate_bundled_artifact_type(self.type) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_type(self) -> None:\n # TODO: add transformation logic so that we don't have to transform inputs at every place they are used, including v1 back compat support\n if not spec_type_is_parameter(self.type):\n type_utils.validate_bundled_artifact_type(self.type)",
"def _valid_o... | [
"0.76130724",
"0.61566174",
"0.592572",
"0.58730024",
"0.582966",
"0.5687703",
"0.5637603",
"0.56128025",
"0.56128025",
"0.56128025",
"0.56128025",
"0.56128025",
"0.56128025",
"0.55650043",
"0.5541752",
"0.55292505",
"0.55139524",
"0.5488805",
"0.54879904",
"0.5457972",
"0.54... | 0.7965839 | 0 |
Use None instead of empty list for command. | def _transform_command(self) -> None:
self.command = None if self.command == [] else self.command | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cmd_noop(args):",
"def list_command(ctx: Any) -> None:\n pass",
"def commands(self) -> List[Command]:\n return []",
"def get_commands(self):\r\n return list(filter(None, self._commands.keys()))",
"def __noop_list(self, *args, **kwargs):\n return []",
"def _commands(self) -> Dict[str, ... | [
"0.6839648",
"0.6656209",
"0.6595953",
"0.63819516",
"0.63766414",
"0.6343263",
"0.6270497",
"0.626302",
"0.62211937",
"0.6213392",
"0.61848706",
"0.6172324",
"0.6172324",
"0.6172324",
"0.6172324",
"0.6103507",
"0.60850513",
"0.59949684",
"0.59941477",
"0.59903055",
"0.598486... | 0.7310038 | 0 |
Use None instead of empty list for args. | def _transform_args(self) -> None:
self.args = None if self.args == [] else self.args | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_args(self) -> Optional[list[str]]:\n _args: list[Arg] = []\n _ctx = self._select(\"defaultArgs\", _args)\n return _ctx.execute_sync(Optional[list[str]])",
"def _clean_args(*args):\n newargs = []\n for chk in args:\n if chk is None:\n break\n newargs... | [
"0.7101734",
"0.70301557",
"0.6824177",
"0.6733473",
"0.6705487",
"0.66453147",
"0.654591",
"0.6499843",
"0.64852524",
"0.6420016",
"0.6365215",
"0.6361735",
"0.6350958",
"0.6311817",
"0.6309764",
"0.6284991",
"0.6246077",
"0.6215142",
"0.62049145",
"0.6168287",
"0.6152805",
... | 0.73730135 | 0 |
Use None instead of empty dict for env. | def _transform_env(self) -> None:
self.env = None if self.env == {} else self.env | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def empty_env(self):\n return ()",
"def get_empty_env():\n return EvalEnvironment(namespaces={})",
"def get_empty_env():\n return EvalEnvironment(namespaces={})",
"def _finalize_env(self, env: Dict[str, str]) -> None:\n\n # add the applicable kernel_id and language to the env dict\n ... | [
"0.7506495",
"0.6892591",
"0.6892591",
"0.6722652",
"0.66688734",
"0.6521722",
"0.65181935",
"0.6515571",
"0.6515571",
"0.6515571",
"0.64632887",
"0.6430169",
"0.63657653",
"0.6362443",
"0.6330296",
"0.6307691",
"0.62757427",
"0.6272593",
"0.62555563",
"0.6251175",
"0.6251175... | 0.78597975 | 0 |
Creates a ContainerSpecImplementation from a PipelineContainerSpec message in dict format (pipeline_spec.deploymentSpec.executors..container). | def from_container_dict(
cls, container_dict: Dict[str,
Any]) -> 'ContainerSpecImplementation':
return ContainerSpecImplementation(
image=container_dict['image'],
command=container_dict.get('command'),
args=container_dict.get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_pipeline_spec_dict(cls, pipeline_spec_dict: Dict[str, Any],\n component_name: str) -> 'Implementation':\n executor_key = utils.sanitize_executor_label(component_name)\n executor = pipeline_spec_dict['deploymentSpec']['executors'].get(\n executor_key)... | [
"0.6941872",
"0.6062166",
"0.5577439",
"0.5425937",
"0.54045695",
"0.5389137",
"0.53062654",
"0.50465834",
"0.50102645",
"0.49788636",
"0.49162155",
"0.4873828",
"0.47720784",
"0.47714484",
"0.47485322",
"0.47436357",
"0.47367996",
"0.46576533",
"0.45869637",
"0.45823467",
"0... | 0.69637334 | 0 |
Creates an Implementation object from a PipelineSpec message in dict format. | def from_pipeline_spec_dict(cls, pipeline_spec_dict: Dict[str, Any],
component_name: str) -> 'Implementation':
executor_key = utils.sanitize_executor_label(component_name)
executor = pipeline_spec_dict['deploymentSpec']['executors'].get(
executor_key)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_msg(cls, msg):\n if cls._debug:\n log.debug('msg=%s', msg)\n key, seq_s, uuid, prop_s, body = msg\n key = key if key else None\n seq = struct.unpack('!q', seq_s)[0]\n body = body if body else None\n if body:\n body = pipeline.load(body)\n ... | [
"0.6436397",
"0.6267915",
"0.61444587",
"0.61162764",
"0.57210857",
"0.56808233",
"0.5630783",
"0.5594873",
"0.5483311",
"0.5461722",
"0.5453731",
"0.5427917",
"0.53711474",
"0.53690076",
"0.53684783",
"0.5307283",
"0.5288682",
"0.5273172",
"0.52257395",
"0.5142328",
"0.51401... | 0.73927045 | 0 |
Validates input/output placeholders refer to an existing input/output. | def check_placeholder_references_valid_io_name(
inputs_dict: Dict[str, InputSpec],
outputs_dict: Dict[str, OutputSpec],
arg: placeholders.CommandLineElement,
) -> None:
if isinstance(arg, ContainerComponentArtifactChannel):
raise ValueError(
'Cannot access artifact by itself in the c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _validate_placeholders(self):\n if self.implementation.container is None:\n return\n\n valid_inputs = {} if self.inputs is None else self.inputs\n valid_outputs = {} if self.outputs is None else self.outputs\n for arg in itertools.chain(\n (self.implementation.... | [
"0.7509751",
"0.61773205",
"0.5925817",
"0.591883",
"0.58988214",
"0.58416843",
"0.57860863",
"0.5770824",
"0.5678071",
"0.56428355",
"0.5640215",
"0.5640215",
"0.5606555",
"0.55463696",
"0.55062664",
"0.549956",
"0.54940325",
"0.5470439",
"0.5459503",
"0.54416907",
"0.543371... | 0.62412816 | 1 |
Use None instead of empty list for inputs. | def _transform_inputs(self) -> None:
self.inputs = None if self.inputs == {} else self.inputs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nonull(inputlist):\n return clean(inputlist, isnull, True)",
"def input():\n return list_of_inputs.pop(0)",
"def _clean_inputs(self, inputs):\n return inputs",
"def __set_inputs__(self):\n self.__set_in_out_var__(None, 0) # TODO: inspect None",
"def optional_inputs(self):\n\n ... | [
"0.6515103",
"0.63922536",
"0.6377314",
"0.63331497",
"0.6327437",
"0.6210212",
"0.6184592",
"0.6169635",
"0.6159794",
"0.60910654",
"0.60898995",
"0.60791475",
"0.6075677",
"0.6005073",
"0.60029364",
"0.59418225",
"0.5937453",
"0.5887603",
"0.5878415",
"0.58634007",
"0.58542... | 0.714406 | 0 |
Use None instead of empty list for outputs. | def _transform_outputs(self) -> None:
self.outputs = None if self.outputs == {} else self.outputs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clear_outputs(self):\n self.outputs = []",
"def get_unnamed_outputs(self):\n return []",
"def __init__(self):\n self.output = []",
"def auxiliary_outputs(self):\n\n return [None]",
"def get_output(self):\n return None, None",
"def get_output(self):\n return N... | [
"0.7152462",
"0.69712555",
"0.67291284",
"0.66714287",
"0.6665553",
"0.6665553",
"0.6552956",
"0.6485143",
"0.64152485",
"0.6281874",
"0.62517375",
"0.62001336",
"0.61731166",
"0.61485434",
"0.6148037",
"0.61328185",
"0.6120143",
"0.60450596",
"0.6030019",
"0.6015118",
"0.601... | 0.7085828 | 1 |
Validates that input/output placeholders refer to an existing input/output. | def _validate_placeholders(self):
if self.implementation.container is None:
return
valid_inputs = {} if self.inputs is None else self.inputs
valid_outputs = {} if self.outputs is None else self.outputs
for arg in itertools.chain(
(self.implementation.container.co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_placeholder_references_valid_io_name(\n inputs_dict: Dict[str, InputSpec],\n outputs_dict: Dict[str, OutputSpec],\n arg: placeholders.CommandLineElement,\n) -> None:\n if isinstance(arg, ContainerComponentArtifactChannel):\n raise ValueError(\n 'Cannot access artifact by its... | [
"0.63493675",
"0.6111994",
"0.5930746",
"0.5851066",
"0.58508646",
"0.5847614",
"0.5781615",
"0.5777986",
"0.57435966",
"0.5668561",
"0.5599109",
"0.5599109",
"0.5569877",
"0.5565575",
"0.55518854",
"0.5506776",
"0.5501792",
"0.55004144",
"0.5497757",
"0.549454",
"0.548961",
... | 0.75350773 | 0 |
Converts V1 ComponentSpec to V2 ComponentSpec. | def from_v1_component_spec(
cls,
v1_component_spec: v1_structures.ComponentSpec) -> 'ComponentSpec':
component_dict = v1_component_spec.to_dict()
if component_dict.get('implementation') is None:
raise ValueError('Implementation field not found')
if 'implement... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def convert_spec(spec):\n config = configobj.ConfigObj(configspec=spec)\n\n return config.configspec",
"def FbcV1ToV2Converter_init():\n return _libsbml.FbcV1ToV2Converter_init()",
"def convert(self):\n return _libsbml.FbcV1ToV2Converter_convert(self)",
"def FbcV2ToV1Converter_init():\n return... | [
"0.55564994",
"0.5420875",
"0.54170686",
"0.5256799",
"0.5225626",
"0.5207605",
"0.5084011",
"0.50473577",
"0.5025268",
"0.49739403",
"0.49643576",
"0.48605055",
"0.48101908",
"0.478078",
"0.4779629",
"0.47795108",
"0.47635478",
"0.47248465",
"0.4708872",
"0.4700041",
"0.4652... | 0.68672734 | 0 |
Creates a ComponentSpec from the PipelineSpec and PlatformSpec messages as dicts. | def from_ir_dicts(
cls,
pipeline_spec_dict: dict,
platform_spec_dict: dict,
) -> 'ComponentSpec':
raw_name = pipeline_spec_dict['pipelineInfo']['name']
def inputs_dict_from_component_spec_dict(
component_spec_dict: Dict[str, Any]) -> Dict[str, InputSpec]:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_pipeline_spec(self) -> pipeline_spec_pb2.PipelineSpec:\n # import here to aviod circular module dependency\n from kfp.compiler import compiler_utils\n from kfp.compiler import pipeline_spec_builder as builder\n from kfp.dsl import pipeline_channel\n from kfp.dsl import pip... | [
"0.60301256",
"0.5952016",
"0.59299326",
"0.587879",
"0.5813433",
"0.56020594",
"0.55732507",
"0.54503536",
"0.53852123",
"0.53650683",
"0.53505313",
"0.5217479",
"0.5108321",
"0.50176895",
"0.49924394",
"0.4952811",
"0.49400592",
"0.49382567",
"0.4909664",
"0.490863",
"0.488... | 0.66587025 | 0 |
Loads V1 or V2 component YAML into a ComponentSpec. | def from_yaml_documents(cls, component_yaml: str) -> 'ComponentSpec':
def extract_description(component_yaml: str) -> Union[str, None]:
heading = '# Description: '
multi_line_description_prefix = '# '
index_of_heading = 2
if heading in component_yaml:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_v1_component_spec(\n cls,\n v1_component_spec: v1_structures.ComponentSpec) -> 'ComponentSpec':\n component_dict = v1_component_spec.to_dict()\n if component_dict.get('implementation') is None:\n raise ValueError('Implementation field not found')\n\n i... | [
"0.6498726",
"0.61364365",
"0.58479095",
"0.5753236",
"0.5701305",
"0.554159",
"0.5440505",
"0.5433452",
"0.54245573",
"0.5363948",
"0.5357924",
"0.53141606",
"0.5302807",
"0.52972454",
"0.52142835",
"0.52065897",
"0.514958",
"0.5134919",
"0.5123118",
"0.51186144",
"0.5101206... | 0.68338966 | 0 |
Saves ComponentSpec into IR YAML file. | def save_to_component_yaml(self, output_file: str) -> None:
from kfp.compiler import pipeline_spec_builder as builder
pipeline_spec = self.to_pipeline_spec()
builder.write_pipeline_spec_to_file(
pipeline_spec,
None,
pipeline_spec_pb2.PlatformSpec(),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save(self):\n # Always write out components in alphabetical order for determinism,\n # especially in tests.\n for function_name in sorted(self._components.keys()):\n self._config_parser[_COMPONENTS_SECTION][\n function_name] = self._components[function_name]\n\n ... | [
"0.6325632",
"0.6164157",
"0.6164157",
"0.60113925",
"0.5841129",
"0.5754559",
"0.5732931",
"0.5732495",
"0.5662218",
"0.56195146",
"0.5589751",
"0.5582945",
"0.55785394",
"0.5568464",
"0.55668694",
"0.55613947",
"0.5555207",
"0.5469642",
"0.5438465",
"0.543694",
"0.5412114",... | 0.6884692 | 0 |
Creates a pipeline instance and constructs the pipeline spec for a single component. | def to_pipeline_spec(self) -> pipeline_spec_pb2.PipelineSpec:
# import here to aviod circular module dependency
from kfp.compiler import compiler_utils
from kfp.compiler import pipeline_spec_builder as builder
from kfp.dsl import pipeline_channel
from kfp.dsl import pipeline_task... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_pipeline(self) -> codepipeline.Pipeline:\n source_output = codepipeline.Artifact()\n build_output = codepipeline.Artifact()\n return codepipeline.Pipeline(\n self,\n 'Pipeline',\n stages=[\n self._create_source_stage('Source', source_... | [
"0.67166334",
"0.6362365",
"0.6308995",
"0.6284752",
"0.6179383",
"0.6142861",
"0.6063674",
"0.6055747",
"0.60467815",
"0.60435206",
"0.60233295",
"0.59884477",
"0.59787315",
"0.5896945",
"0.5881008",
"0.5855254",
"0.58505946",
"0.5845825",
"0.58453816",
"0.5831409",
"0.58157... | 0.71348125 | 0 |
Converts a duration string to seconds. | def convert_duration_to_seconds(duration: str) -> int:
duration = normalize_time_string(duration)
seconds_per_unit = {'s': 1, 'm': 60, 'h': 3_600, 'd': 86_400, 'w': 604_800}
if duration[-1] not in seconds_per_unit.keys():
raise ValueError(
f"Unsupported duration unit: '{duration[-1]}' fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _duration_to_secs(duration):\n secs = int(duration[:-1])\n if duration[-1] == 's':\n pass\n elif duration[-1] == 'm':\n secs *= 60\n elif duration[-1] == 'h':\n secs *= 60 * 60\n elif duration[-1] == 'd':\n secs *= 60 * 60 * 24\n ... | [
"0.8086014",
"0.77428716",
"0.763269",
"0.7523472",
"0.74770683",
"0.733889",
"0.7248498",
"0.71414965",
"0.70478374",
"0.7006096",
"0.6958672",
"0.68102986",
"0.671041",
"0.6706914",
"0.66889966",
"0.6648879",
"0.65866536",
"0.65786785",
"0.65781003",
"0.65767723",
"0.655214... | 0.7933268 | 1 |
Loads up to two YAML documents from a YAML string. First document must always be present. If second document is present, it is returned as a dict, else an empty dict. | def load_documents_from_yaml(component_yaml: str) -> Tuple[dict, dict]:
documents = list(yaml.safe_load_all(component_yaml))
num_docs = len(documents)
if num_docs == 1:
pipeline_spec_dict = documents[0]
platform_spec_dict = {}
elif num_docs == 2:
pipeline_spec_dict = documents[0]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def yaml_parse(yamlstr):\n try:\n # PyYAML doesn't support json as well as it should, so if the input\n # is actually just json it is better to parse it with the standard\n # json parser.\n return json.loads(yamlstr, object_pairs_hook=OrderedDict)\n except ValueError:\n loa... | [
"0.6587058",
"0.658387",
"0.6566409",
"0.6374544",
"0.62657386",
"0.62417525",
"0.6167273",
"0.6147996",
"0.60870063",
"0.60779995",
"0.60406476",
"0.5983952",
"0.59795594",
"0.59493494",
"0.59470266",
"0.59402436",
"0.59374875",
"0.5931332",
"0.5927774",
"0.5918283",
"0.5893... | 0.6956233 | 0 |
Load a game log from a given log file. | def load(logFile):
pass #TODO | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_log(self, log_name, file_path, parameters=None):\n lh.load_log_static(log_name, file_path, parameters=parameters)",
"def _load_log(self, log: str) -> None:\n # load the log fluence image\n mlog = load_log(log)\n fl = mlog.fluence.expected.calc_map(equal_aspect=True)\n ... | [
"0.6974636",
"0.69622296",
"0.6581829",
"0.6426646",
"0.6302641",
"0.6259109",
"0.61477435",
"0.61087215",
"0.59914",
"0.5987402",
"0.5843572",
"0.58266324",
"0.57913625",
"0.5776125",
"0.57605946",
"0.57571983",
"0.56887054",
"0.5661987",
"0.56578946",
"0.5657874",
"0.556565... | 0.7583647 | 0 |
Notify the user of a debug message. | def hook_notifydebug(self,msg,subsystem=None):
ui.notifydebug(msg,subsystem) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def debug(self, message):\r\n if self._debug:\r\n print('[Debug] %s' % message)",
"def debug(self, message):\r\n pass",
"def debug(msg):",
"def debug(self, msg, *args, **kwargs):\n pass",
"def debug(self, msg):\n debug(msg)",
"def debug(self, msg):\n if self._debug:\n ... | [
"0.7136082",
"0.7038687",
"0.6901497",
"0.68524575",
"0.684266",
"0.678017",
"0.6759219",
"0.6726343",
"0.67233175",
"0.67058825",
"0.6692184",
"0.6685208",
"0.66757154",
"0.6665802",
"0.6645503",
"0.6636035",
"0.6620625",
"0.66152805",
"0.6613033",
"0.65976894",
"0.6592125",... | 0.7828026 | 0 |
Notify the user of the extent of progress of an operation. | def hook_notifyprogress(self,operation,progress,progressLim=1.,
subsystem=None):
ui.notifydebug(operation+"... ("+str(progress)+"/"+str(progressLim)+")",
subsystem) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def notify_progress(self, progress_data):\n pass # pragma: no cover",
"def reportProgress(self):\n \n pass",
"def progress(self, arg, num_done, info=''):\n pass",
"def doProgress(self,progress,message):\n pass",
"def _on_progress(self, num):\n self._num_progresses += ... | [
"0.7222878",
"0.6964044",
"0.67728686",
"0.6730313",
"0.6519032",
"0.64386344",
"0.6395417",
"0.6395417",
"0.63666755",
"0.63629544",
"0.63124436",
"0.62976354",
"0.62933385",
"0.62933385",
"0.62766933",
"0.62734425",
"0.6235213",
"0.6231048",
"0.6210148",
"0.6189416",
"0.616... | 0.7345943 | 0 |
Collect the game setup information. | def hook_collectgamesetup(self):
result = ui.collectgamesetup()
# The following unpacking/repacking is just to force the interface:
return {'nPlayers':result['nPlayers'],'ixDealer':result['ixDealer'],
'playerCharCards':result['playerCharCards'],
'playerCardHeldCounts':res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup(self):\n header_print(self.data['intro'])\n header_print(self.data['help'])\n random.shuffle(self.data['draw'])\n random.shuffle(self.data['locations'])\n random.shuffle(self.data['events'])\n random.shuffle(self.data['aces'])\n random.shuffle(self.data['p... | [
"0.6868261",
"0.63533056",
"0.6349762",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.6332498",
"0.63181335",
"0.6261499",
"0.62357545",
"0.62357545",
"0.62357545",
"0.62357545... | 0.80031425 | 0 |
Notify the user that Velma moves her character. | def hook_notifymove(self,nodeStop):
return ui.notifymove(self.ixTurn,self.ixHotSeat,
self.charLocations[self.playerCharIxs[0]],nodeStop) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def player_movement(self):",
"def _onmove(self, event):",
"def movement(self):",
"def move():\n Robot.move()",
"def AeroMove(self, pos):\r\n\r\n pass",
"def move(self, usercmd):\n newPosX = self.robot.posX\n newPosY = self.robot.posY\n logging.info(\"Avant action :: newPosX... | [
"0.64077675",
"0.63866967",
"0.6374977",
"0.6268891",
"0.60781735",
"0.60429335",
"0.6042229",
"0.6035641",
"0.60253125",
"0.6024462",
"0.6017505",
"0.6016363",
"0.5999294",
"0.59637654",
"0.59453773",
"0.59453773",
"0.5944364",
"0.5935445",
"0.5925216",
"0.5909818",
"0.59068... | 0.6856395 | 0 |
Generate a random hypothesis satisfying all current constraints. | def genfeasiblehypothesis(self):
hypValid = False
genAttempts = 0
hypothesis = []
while hypValid == False:
genAttempts += 1.
# Generate a hypothesis:
#
# 1. Deal myself the hand I know I have
hypothesis = [set() for ix in range(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_table(self):\n rule_set = []\n for i in range(self.k ** (2 * self.r + 1) - 1):\n g = np.random.rand()\n if g > self.lambda_param:\n g = 0\n else:\n g = np.random.randint(1, self.k)\n rule_set.append(g)\n rule_set.append(0)\n return rule_set",... | [
"0.64118475",
"0.60135716",
"0.60040313",
"0.5975513",
"0.59719205",
"0.5883127",
"0.5842343",
"0.5830259",
"0.57722783",
"0.5764174",
"0.574327",
"0.5741325",
"0.57405233",
"0.5728624",
"0.56916004",
"0.5691422",
"0.5684358",
"0.5648347",
"0.56463736",
"0.56435454",
"0.56169... | 0.6872866 | 0 |
Regenerate the hypothesis list after logical reduction. | def rebuildhypotheses(self):
if not (len(self.hypotheses) or self.areHypothesesEnumerable):
# We are building hypothesis database for the first time (a
# potentially slow process)
self.hook_notifywait("Building initial hypothesis database")
# This function only has a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unbatchfy(self, batch_hyps: BatchHypothesis) -> List[Hypothesis]:\n return [\n Hypothesis(\n yseq=batch_hyps.yseq[i][: batch_hyps.length[i]],\n score=batch_hyps.score[i],\n scores={k: batch_hyps.scores[k][i] for k in self.scorers},\n ... | [
"0.5524632",
"0.5352227",
"0.5309566",
"0.5181257",
"0.51341134",
"0.5063378",
"0.50572723",
"0.505214",
"0.5030455",
"0.50298125",
"0.5011891",
"0.49453822",
"0.4929902",
"0.49108154",
"0.4868331",
"0.48550463",
"0.48539516",
"0.48428267",
"0.48193216",
"0.4817345",
"0.48165... | 0.5854182 | 0 |
Return the matrix of "span" distances between all rooms. The "span" [i,j] is the expected number of dice throws necessary to move | def calculateinterroomspans(self):
# Calculate the matrix of distances between rooms without entering other
# rooms en route; and convert to "span" - expected throws:
interRoomHopSpans = game.dicerollstomove(np.array(
[self.calculateroomhops(room) for room in game.ROOMNODES]))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wallsAndGates(self, rooms: List[List[int]]) -> None:\n def get_gates(rooms):\n res = []\n M, N = len(rooms), len(rooms[0])\n for i in range(M):\n for j in range(N):\n if rooms[i][j] == 0:\n res.append((i, j))\n ... | [
"0.6092645",
"0.60925835",
"0.6083903",
"0.6063592",
"0.6056241",
"0.58330566",
"0.5826",
"0.5771334",
"0.5718568",
"0.57047266",
"0.5686043",
"0.5657456",
"0.5497435",
"0.54515254",
"0.5436689",
"0.53802377",
"0.53614146",
"0.53524494",
"0.52980226",
"0.5204121",
"0.5175831"... | 0.73202235 | 0 |
Update the record of statistics for the currently held hypotheses. | def updatestats(self):
result = self.statsfromcounts(self.hypCountByScenario)
self.pScenario = result["p"]
self.scenarioEntropy = result["entropy"] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update(self):\n\n self.stats = statistics.get()\n self.ticker = exchangerates.get_ticker()",
"def update_stats(self):\n\n self.raw_data_index = 0\n start_time = time.time()\n data_frame = load_data(self.selections)\n user_stats = get_user_stats(data_frame)\n\n ... | [
"0.65621215",
"0.61820555",
"0.60233736",
"0.5938149",
"0.5933853",
"0.5932433",
"0.5858069",
"0.5814102",
"0.5794021",
"0.5690563",
"0.56790185",
"0.5675637",
"0.5625173",
"0.5624675",
"0.56101954",
"0.5597737",
"0.5587007",
"0.5583633",
"0.5573746",
"0.5560822",
"0.5557816"... | 0.67503935 | 0 |
sca_agg merges results from independent benchmarking measurements into a single CSV file for use in sca_fit. It assumes (and checks) that a single CSV file contains multiple trial measurements of throughput for a fixed load or concurrency and adds a row of load, measured throughput mean, and measured throughput standar... | def main(load_column, throughput_column, throughput_errors_column,
output_directory, clean, filenames):
frames = []
for filename in filenames:
logging.debug('Reading in %s', filename)
df_spec = dat.read_frame(filename)
df_spec.load_col = load_column
df_spec.throughput_co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aggregate_results(output_files, agg_filename):\n\n print(file_marker + \"STARTING AGGREGATION\")\n feather_files = output_files\n\n results = []\n for i in range(len(feather_files)):\n print(file_marker + str(i))\n x = pd.read_feather(feather_files[i])\n results.append(x)\n ... | [
"0.55479485",
"0.53911793",
"0.5357468",
"0.5325028",
"0.5274568",
"0.5214172",
"0.5122062",
"0.51134187",
"0.51000726",
"0.50902575",
"0.5077065",
"0.5071079",
"0.5062674",
"0.5014165",
"0.4992807",
"0.4988288",
"0.49600694",
"0.4933182",
"0.4923239",
"0.48981822",
"0.481906... | 0.60568774 | 0 |
Delete parameter from the db. | def deleteParameter(self, session: Session, name: str) -> None:
try:
p = self._globalParametersDbHandler.getParameter(session, name)
self._logger.debug('Deleting parameter [%s]' % (name))
session.delete(p)
session.commit()
self._logger.info('Delet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_parameter(request, parameter, **_kwargs):\n pass",
"def delete_param(command):\n namespace = app.main(command)\n assert namespace.command == 'dp' or namespace.command == \"deleteparam\"\n assert namespace.name == \"test\"",
"def delete_model_parameter(database, model, aid):\n with get... | [
"0.7945468",
"0.7122908",
"0.7031092",
"0.6929098",
"0.67621464",
"0.6647523",
"0.6623364",
"0.66104203",
"0.66104203",
"0.66015387",
"0.65953004",
"0.6542899",
"0.6515929",
"0.6501947",
"0.64682937",
"0.6449149",
"0.64409167",
"0.64334375",
"0.64213175",
"0.6378843",
"0.6376... | 0.78819406 | 1 |
Return the path to the eval graph, if it exists. | def get_saved_model_path(training_ckpt_base):
ckpt_dir = os.path.dirname(training_ckpt_base)
# If using a checkpoint from the best_exporter, return its saved_model.
if os.path.basename(ckpt_dir) == 'variables':
return os.path.join(
os.path.dirname(ckpt_dir),
tf.saved_model.constants.SAVED_MODE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def graph_path(scope=\"session\"):\n return join(dirname(__file__), pardir, \"new_data\", \"graph\")",
"def trace_path_get() -> str:\n if not (path := trace_path_stack_cv.get()):\n return \"\"\n return \"/\".join(path)",
"def execution_path(self, filename):\n return os.path.join(os.path.... | [
"0.6681766",
"0.55885756",
"0.5463786",
"0.5460819",
"0.5443106",
"0.5431904",
"0.5431904",
"0.5331948",
"0.52668387",
"0.52617824",
"0.52358526",
"0.5216969",
"0.52163595",
"0.5202785",
"0.51302534",
"0.5103788",
"0.5091816",
"0.50835663",
"0.5069184",
"0.50688463",
"0.50638... | 0.562939 | 1 |
From a list of string goals, compute and return their embeddings. | def _batch_goal_embedding(self, goals: List[Text]) -> List[GOAL_EMB_TYPE]:
# Get the first goal_net collection (second entry may be duplicated to align
# with negative theorems)
goals = self._goal_string_for_predictions(goals)
embeddings = self._sess.run(
fetches=self._graph.get_collection('goal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def embed_text(tensors, embeddings):\n wids = tensors[\"wids\"]\n cids = tensors[\"cids\"]\n\n embedding_weights = embeddings.get_initialized_params(trainable=False)\n word_vecs = tf.nn.embedding_lookup(embedding_weights, wids)\n char_emb = common_layers.character_cnn(cids)\n return tf.concat([word_vecs, cha... | [
"0.5774122",
"0.565672",
"0.56180805",
"0.5581258",
"0.5550853",
"0.5407493",
"0.53860426",
"0.5384527",
"0.536428",
"0.5359596",
"0.5322199",
"0.5319614",
"0.5304062",
"0.5283206",
"0.52772415",
"0.5252679",
"0.524753",
"0.52366084",
"0.52323616",
"0.5208159",
"0.5199289",
... | 0.7277614 | 0 |
Convert from proof_search_tree.ProofSearchNode to ProofState. | def proof_state_from_search(self, node) -> predictions.ProofState:
return predictions.ProofState(goal=str(node.goal.conclusion)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fromState(state):",
"def node_to_state(self, node):\n xd = node[0]\n yd = node[1]\n state = self.origin + np.array([self.resolution[0]*(cos(self.rotation)*xd - sin(self.rotation)*yd),\n self.resolution[1]*(sin(self.rotation)*xd + cos(self.rotation)*yd)])\n retur... | [
"0.5454135",
"0.544056",
"0.5420381",
"0.5366239",
"0.52001816",
"0.51841986",
"0.51421964",
"0.51142275",
"0.5097694",
"0.50339824",
"0.5028557",
"0.502077",
"0.48921883",
"0.48825833",
"0.4870698",
"0.48592797",
"0.48569214",
"0.48389068",
"0.48278117",
"0.47683334",
"0.474... | 0.7153803 | 0 |
Find c when ac=b (modulo mod) | def resol_modulo(a,b, mod):
for i in range(mod): # Pour tous les nombres du modulo
if (a*i) % mod == b: # Si a*i modulo mod = b
return i # Alors on a trouvé ! On renvoit i
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mcd(a, b):\n while(b != 0):\n a,b = b,a%b\n return a",
"def pgcd(a, b):\n while a % b != 0:\n a, b = b, a % b\n return b",
"def f(a, b, d):\n i = 1\n mod = -1\n\n if d and int(b/d) != b/d:\n # kdyz neni ``b`` delitelne celociselne ``d``, zadny nasobek ``a`` ho nedo... | [
"0.712863",
"0.7022156",
"0.6818918",
"0.67900646",
"0.6724137",
"0.6492075",
"0.643266",
"0.6425598",
"0.64244455",
"0.6384505",
"0.6383087",
"0.6383052",
"0.63599056",
"0.63599056",
"0.63599056",
"0.63599056",
"0.6357302",
"0.6357302",
"0.6357302",
"0.6357302",
"0.6353367",... | 0.7428239 | 0 |
Affiche la place dans l'alphabet de chaque lettre A=1 | def place_in_alphabet(letters):
for l in letters:
print(l, ':', str(ALPHABET.index(l)+1)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prefer_alphabet(i):\n if 0 <= i <= 25:\n return chr(i + 65)\n if 26 <= i <= 51:\n return chr(i + 97 - 26)\n return str(i)",
"def get_alphabet(number):\n return chr(number + 96)",
"def get_alphabet(number):\n return chr(number + 96)",
"def alphabet_position(letter):\n alpha... | [
"0.68029505",
"0.6699078",
"0.6699078",
"0.6636246",
"0.65615344",
"0.65169877",
"0.6515175",
"0.6515175",
"0.65074885",
"0.64964825",
"0.64913696",
"0.64698124",
"0.64339054",
"0.6420738",
"0.6420738",
"0.6420738",
"0.6373156",
"0.6371968",
"0.6368685",
"0.63613343",
"0.6350... | 0.7584964 | 0 |
Generate a rectangle of transposition with the key consistinh of integrers | def columnarTansposition_makeRectangleWithPlaintext_withkey(plaintext, key):
plaintext = deponctuateMessage(plaintext) # On purge le texte
rectangleWidth = len(key) # On trouve la largeur du rectangle
rectangleHeight = len(plaintext)//rectangleWidth # Nombre de lignes pleines
rectangleLastRowWidth = len(plainte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def draw_rectangle(t, w, h):\r\n for i in range(2):\r\n t.forward(w)\r\n t.left(90)\r\n t.forward(h)\r\n t.left(90)",
"def T(self):\n # TODO - your code here\n transpose = []\n for col in range(self.w):\n new_row = []\n for row in range(self.h):\n ... | [
"0.61562014",
"0.5975304",
"0.5937113",
"0.59044737",
"0.5853343",
"0.58268666",
"0.5768108",
"0.57296634",
"0.5711842",
"0.5674098",
"0.56680906",
"0.5656372",
"0.5637406",
"0.5611075",
"0.5581495",
"0.5581495",
"0.55727607",
"0.55710196",
"0.5567714",
"0.55642897",
"0.55594... | 0.6094031 | 1 |
Find person by name (can supply either first name, last name, or both). | def test_05_get_person_by_name(self):
p1 = Person.query.first()
p1_data = p1.wrap()
p1_f_name = p1_data["first_name"]
# find by first name only
# get part of name and search
q_string = "?first_name={}".format(p1_f_name[:3]) # TODO - verify the length
rv = self.ap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_person(name):\n if ' ' in name:\n name = name.replace(',', '')\n else:\n return None\n\n try:\n (first, last) = name.split(' ', 1)\n return Person.get(Person.first_name ** first, Person.last_name ** last)\n except Person.DoesNotExist:\n pass\n\n try:\n ... | [
"0.8371874",
"0.70397246",
"0.69642144",
"0.6921002",
"0.67691207",
"0.6734593",
"0.6730486",
"0.6717378",
"0.66699153",
"0.6665478",
"0.66387594",
"0.66387594",
"0.6629511",
"0.6435801",
"0.6379602",
"0.63201123",
"0.63159394",
"0.6293829",
"0.62536263",
"0.62296087",
"0.620... | 0.7409197 | 1 |
convert the various height formats into just inches | def height_conversion(height):
num_list = re.findall(r"\d+", height)
inches = int(num_list[0]) * 12 + int(num_list[1])
return inches | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inches(n):\n return n * 25.4",
"def test_height_feet_only(self):\n result = height_to_cm(\"6'\")\n self.assertEqual(result, 183)",
"def to_inch(self):\r\n if self.units != 'inch':\r\n self.units = 'inch'\r\n for statement in self.statements:\r\n ... | [
"0.70246375",
"0.6840806",
"0.6835056",
"0.68307513",
"0.68307513",
"0.68307513",
"0.67973846",
"0.67812455",
"0.66437596",
"0.6321157",
"0.62826717",
"0.6266997",
"0.6137945",
"0.61308336",
"0.6083493",
"0.6081137",
"0.6044398",
"0.60375714",
"0.5901573",
"0.58523256",
"0.58... | 0.805771 | 0 |
calculate the BMI given the height in inches and the weight in pounds | def calculate_bmi(height, weight):
m_weight = 703 * weight
m_height = height**2
bmi = m_weight / m_height
return bmi | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bmi(weight, height):\n return weight / height ** 2",
"def calculate_bmi(mass = 56, height = 1.5):\n BMI = mass / (height**2)\n return BMI",
"def bmi(self):\n if self.height == 0:\n raise ValueError(\"Height can't be zero\")\n return self.weight / (self.height * self.height... | [
"0.85620296",
"0.8138416",
"0.81370753",
"0.79148823",
"0.7881696",
"0.76957494",
"0.6760111",
"0.636256",
"0.6281729",
"0.6245808",
"0.62367904",
"0.61295456",
"0.60729676",
"0.60303086",
"0.59126484",
"0.58896154",
"0.58424115",
"0.58397776",
"0.58038974",
"0.57513416",
"0.... | 0.871847 | 0 |
function to correct the values in the height and weight columns | def bmi_magic(data):
data['BMI'] = np.nan
for i, row in data.iterrows():
data.at[i, "Height"] = height_conversion(data.at[i, "Height"])
data.at[i, "Weight"] = weight_conversion(data.at[i, "Weight"])
data.at[i, "BMI"] = calculate_bmi(data.at[i, "Height"], data.at[i, "Weight"])
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_height(self,c, h):\r\n self.h = h\r\n self.T1 = [[-self.R * np.sqrt(3) / (2*self.h), self.R / (2*self.h), 1],[0,-self.R/(self.h),1],[self.R * np.sqrt(3) / (2*self.h), self.R / (2*self.h), 1]]\r\n return self.h",
"def _modify_columns(self, cols, X, y=None):",
"def adjust_for_refract... | [
"0.5462785",
"0.54045093",
"0.5392657",
"0.5376504",
"0.5376504",
"0.5376504",
"0.53683347",
"0.5348255",
"0.5325438",
"0.5260073",
"0.5213985",
"0.5213777",
"0.51937145",
"0.5172443",
"0.5169716",
"0.5167707",
"0.5137573",
"0.51114666",
"0.5077737",
"0.5068587",
"0.506823",
... | 0.5605188 | 0 |
Registers all store modules and all schemes from the given config. | def create_multi_stores(conf=CONF):
store_count = 0
scheme_map = {}
for (store_entry, store_instance,
store_identifier) in _load_multi_stores(conf):
try:
schemes = store_instance.get_schemes()
store_instance.configure(re_raise_bsc=False)
except NotImplemented... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def RegisterBlobStores():\n blob_store.REGISTRY[db_blob_store.DbBlobStore.__name__] = (\n db_blob_store.DbBlobStore)",
"def studio_store_config(data_dir):\r\n store_config = {\r\n 'host': 'localhost',\r\n 'db': 'test_xmodule',\r\n 'collection': 'modulestore{0}'.format(uuid4().hex[:5... | [
"0.57236403",
"0.55196077",
"0.54965806",
"0.54768825",
"0.54267895",
"0.5375846",
"0.52754474",
"0.5234384",
"0.5202676",
"0.5161658",
"0.51176035",
"0.5066149",
"0.50432587",
"0.5040296",
"0.5036966",
"0.5001509",
"0.49920738",
"0.4939062",
"0.49360096",
"0.49178573",
"0.49... | 0.635483 | 0 |
Determine backing store from identifier. Given a store identifier, return the appropriate store object for handling that scheme. | def get_store_from_store_identifier(store_identifier):
scheme_map = {}
enabled_backends = CONF.enabled_backends
try:
scheme = enabled_backends[store_identifier]
except KeyError:
msg = _("Store for identifier %s not found") % store_identifier
raise exceptions.UnknownScheme(msg)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_store(self, store_id):\n for store in self.get_stores():\n if store[\"code\"] == store_id:\n return store",
"def get_store(store_name: str):\n return store_handler.get_store(store_name)",
"def prepare_store(store):\n\n if store is None:\n return None\n i... | [
"0.6666242",
"0.66437966",
"0.62758684",
"0.6080246",
"0.5950664",
"0.57255113",
"0.5569696",
"0.55365413",
"0.55058306",
"0.5415285",
"0.5390895",
"0.53754616",
"0.53732944",
"0.53703725",
"0.5349595",
"0.5340545",
"0.532611",
"0.532313",
"0.5307915",
"0.5293337",
"0.5255906... | 0.80452174 | 0 |
A wrapper around a call to each store's add() method that requires a hashing_algo identifier and returns a 5tuple including the "multihash" computed using the specified hashing_algo. (This is an enhanced version of store_add_to_backend(), which is left asis for backward compatibility.) | def store_add_to_backend_with_multihash(
image_id, data, size, hashing_algo, store,
context=None, verifier=None):
if hashing_algo not in hashlib.algorithms_available:
raise exceptions.UnknownHashingAlgo(algo=hashing_algo)
(location, size, checksum, multihash, metadata) = store.add(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def HashAlgorithm(self) -> _n_7_t_0:",
"def internal_hash(self): \n return hash(tuple(sorted(self.hashtriples())))",
"def hash_algo(self) -> str:\n return self._hash_algo",
"def _get_hasher(self):\n import hashlib\n\n # Try making the hash set from the columns marked 'hash'\n ... | [
"0.58959293",
"0.5776345",
"0.56577283",
"0.5495893",
"0.5416366",
"0.5375993",
"0.5362112",
"0.5331195",
"0.53122485",
"0.5299642",
"0.5288777",
"0.52864325",
"0.52664274",
"0.52610874",
"0.52541065",
"0.5193266",
"0.517743",
"0.5165791",
"0.5162747",
"0.5145935",
"0.5144286... | 0.7698951 | 0 |
Retrieves image size from backend specified by uri. | def get_size_from_uri_and_backend(uri, backend, context=None):
loc = location.get_location_from_uri_and_backend(
uri, backend, conf=CONF)
store = get_store_from_store_identifier(backend)
return store.get_size(loc, context=context) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_image_size(self):",
"def getFileSize(self, _uri): \n totalBytes = 0\n fileName = os.path.basename(_uri)\n\n if fileName in self.fileDict:\n # Get size from fileDict log if it exists\n totalBytes = int(self.fileDict[fileName]['Size'... | [
"0.67088974",
"0.66758454",
"0.6481023",
"0.6344729",
"0.6295729",
"0.6226935",
"0.62146527",
"0.61846435",
"0.61736596",
"0.61511904",
"0.6126573",
"0.60992",
"0.60912675",
"0.60638624",
"0.60537446",
"0.604191",
"0.60300463",
"0.6018125",
"0.5936015",
"0.59281814",
"0.59059... | 0.8247769 | 0 |
Get the coroutine callstack of this Task. | def _get_coro_stack(self) -> typing.Any:
coro_stack = extract_coro_stack(self._coro)
# Remove Trigger.__await__() from the stack, as it's not really useful
if self._natively_awaitable and len(coro_stack):
if coro_stack[-1].name == "__await__":
coro_stack.pop()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_stack(self):\n return self.__stack",
"def capture_stack(self):\n if not hasattr(self._thread_data, 'capture_stack'):\n self._thread_data.capture_stack = []\n return self._thread_data.capture_stack",
"def poolstack ( self ):\n return self._poolstack",
"def tasktrace(self):\n ... | [
"0.6653085",
"0.63512075",
"0.6079321",
"0.60719323",
"0.5973241",
"0.58940756",
"0.58487236",
"0.575254",
"0.57416373",
"0.57104164",
"0.56874853",
"0.56741816",
"0.5666401",
"0.5645741",
"0.5572927",
"0.5515526",
"0.54350317",
"0.5397445",
"0.5378243",
"0.5305025",
"0.52482... | 0.70415705 | 0 |
Return the result of the Task. If the Task ran to completion, the result is returned. If the Task failed with an exception, the exception is reraised. If the Task was cancelled, the CancelledError is reraised. | def result(self) -> T:
if not self.done():
raise InvalidStateError("result is not yet available")
elif self.cancelled():
raise self._cancelled
else:
return self._outcome.get() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(self, retry_on_failure=True):\n done = threading.Event()\n\n api.cancel_callbacks.add(done.set)\n self.on_result(lambda _result: done.set())\n done.wait()\n api.cancel_callbacks.discard(done.set)\n\n if api.has_cancel_request():\n if self._result is self... | [
"0.7071429",
"0.68099606",
"0.67153126",
"0.6613411",
"0.6596809",
"0.64619136",
"0.64058393",
"0.6363659",
"0.6352421",
"0.63189954",
"0.6315788",
"0.62119",
"0.6211757",
"0.61624295",
"0.61556363",
"0.6132622",
"0.6084497",
"0.60665035",
"0.5999137",
"0.59811294",
"0.596796... | 0.690215 | 1 |
Return the exception of the Task. If the Task ran to completion, ``None`` is returned. If the Task failed with an exception, the exception is returned. If the Task was cancelled, the CancelledError is reraised. | def exception(self) -> typing.Optional[BaseException]:
if not self.done():
raise InvalidStateError("result is not yet available")
elif self.cancelled():
raise self._cancelled
elif isinstance(self._outcome, outcomes.Error):
return self._outcome.error
el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exception(self):\n if self._exc_info is not None:\n return self._exc_info[1]\n else:\n self._check_done()\n return None",
"def exception(self):\n self.wait() # TODO: If raise_errors=True this will raise the exception when trying to access it?\n re... | [
"0.66710305",
"0.6512264",
"0.62858695",
"0.62676334",
"0.6236225",
"0.60901254",
"0.6080963",
"0.59943223",
"0.5989398",
"0.59639776",
"0.58346915",
"0.57793796",
"0.5541347",
"0.55388844",
"0.5527365",
"0.540461",
"0.53921455",
"0.5366568",
"0.5289969",
"0.52796453",
"0.527... | 0.7267879 | 0 |
``True`` if Task is not done. | def __bool__(self) -> bool:
warnings.warn(
"Deprecated in favor of the done() method. "
"Replace with `not task.done()`.",
DeprecationWarning,
stacklevel=2,
)
return not self.done() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_done():\n return False",
"def _is_done(self):\n pass",
"def done(self):\n return self._status != Future.STATUS_STARTED",
"def is_task_complete(self):\n if self._task is None:\n raise UserWarning(\"No task registered\")\n\n return self._task.is_complete()",... | [
"0.77963793",
"0.7461903",
"0.7457648",
"0.7392224",
"0.7368637",
"0.7311726",
"0.72967285",
"0.7236678",
"0.7179301",
"0.71779644",
"0.7132601",
"0.7036795",
"0.6997869",
"0.69950783",
"0.69947785",
"0.6989862",
"0.6968217",
"0.6968041",
"0.6967124",
"0.69597775",
"0.6954593... | 0.74987096 | 1 |
Installs the mysql package on the VM. | def AptInstall(vm):
vm.RemoteCommand('wget -c '
'https://repo.mysql.com//mysql-apt-config_0.8.17-1_all.deb')
vm.RemoteCommand('echo mysql-apt-config mysql-apt-config/select-server'
' select mysql-8.0 | sudo debconf-set-selections')
vm.RemoteCommand('echo mysql-apt-config mysq... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_mysql():\n with lcd(env.projectroot):\n put(\"manage/sysconf/%(target)s/mysql/setup-mysql.sql\" % env, \"/tmp\")\n #sudo(\"mysql -u root -p < /tmp/setup-mysql.sql\")\n sudo(\"mysql -u root < /tmp/setup-mysql.sql\")",
"def install():\n deploy()\n configure()",
"def instal... | [
"0.72507405",
"0.68906283",
"0.68453765",
"0.677388",
"0.6709598",
"0.6709598",
"0.6570716",
"0.6556629",
"0.6518625",
"0.6466804",
"0.6466804",
"0.6444317",
"0.6372481",
"0.6335787",
"0.6321735",
"0.63203526",
"0.631799",
"0.63127863",
"0.62949795",
"0.62640643",
"0.625931",... | 0.71592635 | 1 |
Returns the name of the mysql service. | def AptGetServiceName(vm):
del vm
return 'mysql' | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"service_name\")",
"def service_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"service_name\")",
"def service_name(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"service_name\")",
"def servi... | [
"0.6829732",
"0.6829732",
"0.6829732",
"0.68110716",
"0.68110716",
"0.671715",
"0.66382146",
"0.66382146",
"0.66382146",
"0.64938444",
"0.64697003",
"0.64697003",
"0.64697003",
"0.6415178",
"0.63908523",
"0.6350583",
"0.6346128",
"0.6290802",
"0.6276551",
"0.6259246",
"0.6211... | 0.7474581 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.