repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/PhysicsGroup/List.py | List.execute | def execute(self, conn, name='', transaction = False):
"""
returns id for a given physics group name
"""
binds={}
if name:
op = ('=', 'like')['%' in name]
sql = self.sql + " WHERE pg.physics_group_name %s :physicsgroup" % (op)
binds = {"physic... | python | def execute(self, conn, name='', transaction = False):
"""
returns id for a given physics group name
"""
binds={}
if name:
op = ('=', 'like')['%' in name]
sql = self.sql + " WHERE pg.physics_group_name %s :physicsgroup" % (op)
binds = {"physic... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"name",
"=",
"''",
",",
"transaction",
"=",
"False",
")",
":",
"binds",
"=",
"{",
"}",
"if",
"name",
":",
"op",
"=",
"(",
"'='",
",",
"'like'",
")",
"[",
"'%'",
"in",
"name",
"]",
"sql",
"=",
"... | returns id for a given physics group name | [
"returns",
"id",
"for",
"a",
"given",
"physics",
"group",
"name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/PhysicsGroup/List.py#L23-L39 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSOutputConfig.py | DBSOutputConfig.insertOutputConfig | def insertOutputConfig(self, businput):
"""
Method to insert the Output Config.
app_name, release_version, pset_hash, global_tag and output_module_label are
required.
args:
businput(dic): input dictionary.
Updated Oct 12, 2011
"""
if not ... | python | def insertOutputConfig(self, businput):
"""
Method to insert the Output Config.
app_name, release_version, pset_hash, global_tag and output_module_label are
required.
args:
businput(dic): input dictionary.
Updated Oct 12, 2011
"""
if not ... | [
"def",
"insertOutputConfig",
"(",
"self",
",",
"businput",
")",
":",
"if",
"not",
"(",
"\"app_name\"",
"in",
"businput",
"and",
"\"release_version\"",
"in",
"businput",
"and",
"\"pset_hash\"",
"in",
"businput",
"and",
"\"output_module_label\"",
"in",
"businput",
"... | Method to insert the Output Config.
app_name, release_version, pset_hash, global_tag and output_module_label are
required.
args:
businput(dic): input dictionary.
Updated Oct 12, 2011 | [
"Method",
"to",
"insert",
"the",
"Output",
"Config",
".",
"app_name",
"release_version",
"pset_hash",
"global_tag",
"and",
"output_module_label",
"are",
"required",
".",
"args",
":",
"businput",
"(",
"dic",
")",
":",
"input",
"dictionary",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSOutputConfig.py#L55-L107 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.getHelp | def getHelp(self, call=""):
"""
API to get a list of supported REST APIs. In the case a particular API is specified,
the docstring of that API is displayed.
:param call: call to get detailed information about (Optional)
:type call: str
:return: List of APIs or detailed i... | python | def getHelp(self, call=""):
"""
API to get a list of supported REST APIs. In the case a particular API is specified,
the docstring of that API is displayed.
:param call: call to get detailed information about (Optional)
:type call: str
:return: List of APIs or detailed i... | [
"def",
"getHelp",
"(",
"self",
",",
"call",
"=",
"\"\"",
")",
":",
"if",
"call",
":",
"params",
"=",
"self",
".",
"methods",
"[",
"'GET'",
"]",
"[",
"call",
"]",
"[",
"'args'",
"]",
"doc",
"=",
"self",
".",
"methods",
"[",
"'GET'",
"]",
"[",
"c... | API to get a list of supported REST APIs. In the case a particular API is specified,
the docstring of that API is displayed.
:param call: call to get detailed information about (Optional)
:type call: str
:return: List of APIs or detailed information about a specific call (parameters and... | [
"API",
"to",
"get",
"a",
"list",
"of",
"supported",
"REST",
"APIs",
".",
"In",
"the",
"case",
"a",
"particular",
"API",
"is",
"specified",
"the",
"docstring",
"of",
"that",
"API",
"is",
"displayed",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L195-L211 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listPrimaryDatasets | def listPrimaryDatasets(self, primary_ds_name="", primary_ds_type=""):
"""
API to list primary datasets
:param primary_ds_type: List primary datasets with primary dataset type (Optional)
:type primary_ds_type: str
:param primary_ds_name: List that primary dataset (Optional)
... | python | def listPrimaryDatasets(self, primary_ds_name="", primary_ds_type=""):
"""
API to list primary datasets
:param primary_ds_type: List primary datasets with primary dataset type (Optional)
:type primary_ds_type: str
:param primary_ds_name: List that primary dataset (Optional)
... | [
"def",
"listPrimaryDatasets",
"(",
"self",
",",
"primary_ds_name",
"=",
"\"\"",
",",
"primary_ds_type",
"=",
"\"\"",
")",
":",
"primary_ds_name",
"=",
"primary_ds_name",
".",
"replace",
"(",
"\"*\"",
",",
"\"%\"",
")",
"primary_ds_type",
"=",
"primary_ds_type",
... | API to list primary datasets
:param primary_ds_type: List primary datasets with primary dataset type (Optional)
:type primary_ds_type: str
:param primary_ds_name: List that primary dataset (Optional)
:type primary_ds_name: str
:returns: List of dictionaries containing the follow... | [
"API",
"to",
"list",
"primary",
"datasets"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L225-L248 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listPrimaryDsTypes | def listPrimaryDsTypes(self, primary_ds_type="", dataset=""):
"""
API to list primary dataset types
:param primary_ds_type: List that primary dataset type (Optional)
:type primary_ds_type: str
:param dataset: List the primary dataset type for that dataset (Optional)
:typ... | python | def listPrimaryDsTypes(self, primary_ds_type="", dataset=""):
"""
API to list primary dataset types
:param primary_ds_type: List that primary dataset type (Optional)
:type primary_ds_type: str
:param dataset: List the primary dataset type for that dataset (Optional)
:typ... | [
"def",
"listPrimaryDsTypes",
"(",
"self",
",",
"primary_ds_type",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
")",
":",
"if",
"primary_ds_type",
":",
"primary_ds_type",
"=",
"primary_ds_type",
".",
"replace",
"(",
"\"*\"",
",",
"\"%\"",
")",
"if",
"dataset",
"... | API to list primary dataset types
:param primary_ds_type: List that primary dataset type (Optional)
:type primary_ds_type: str
:param dataset: List the primary dataset type for that dataset (Optional)
:type dataset: str
:returns: List of dictionaries containing the following key... | [
"API",
"to",
"list",
"primary",
"dataset",
"types"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L251-L274 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listDatasets | def listDatasets(self, dataset="", parent_dataset="", is_dataset_valid=1,
release_version="", pset_hash="", app_name="", output_module_label="", global_tag="",
processing_version=0, acquisition_era_name="", run_num=-1,
physics_group_name="", logical_file_name="", primary_ds_name="", primary_ds_t... | python | def listDatasets(self, dataset="", parent_dataset="", is_dataset_valid=1,
release_version="", pset_hash="", app_name="", output_module_label="", global_tag="",
processing_version=0, acquisition_era_name="", run_num=-1,
physics_group_name="", logical_file_name="", primary_ds_name="", primary_ds_t... | [
"def",
"listDatasets",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"parent_dataset",
"=",
"\"\"",
",",
"is_dataset_valid",
"=",
"1",
",",
"release_version",
"=",
"\"\"",
",",
"pset_hash",
"=",
"\"\"",
",",
"app_name",
"=",
"\"\"",
",",
"output_module_labe... | API to list dataset(s) in DBS
* You can use ANY combination of these parameters in this API
* In absence of parameters, all valid datasets known to the DBS instance will be returned
:param dataset: Full dataset (path) of the dataset.
:type dataset: str
:param parent_dataset: Fu... | [
"API",
"to",
"list",
"dataset",
"(",
"s",
")",
"in",
"DBS",
"*",
"You",
"can",
"use",
"ANY",
"combination",
"of",
"these",
"parameters",
"in",
"this",
"API",
"*",
"In",
"absence",
"of",
"parameters",
"all",
"valid",
"datasets",
"known",
"to",
"the",
"D... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L284-L488 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listDatasetArray | def listDatasetArray(self):
"""
API to list datasets in DBS. To be called by datasetlist url with post call.
:param dataset: list of datasets [dataset1,dataset2,..,dataset n] (must have either a list of dataset or dataset_id), Max length 1000.
:type dataset: list
:param dataset_id: lis... | python | def listDatasetArray(self):
"""
API to list datasets in DBS. To be called by datasetlist url with post call.
:param dataset: list of datasets [dataset1,dataset2,..,dataset n] (must have either a list of dataset or dataset_id), Max length 1000.
:type dataset: list
:param dataset_id: lis... | [
"def",
"listDatasetArray",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"if",
"body",
":",
"data",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"data",
"=",
"validateJSONInpu... | API to list datasets in DBS. To be called by datasetlist url with post call.
:param dataset: list of datasets [dataset1,dataset2,..,dataset n] (must have either a list of dataset or dataset_id), Max length 1000.
:type dataset: list
:param dataset_id: list of dataset ids [dataset_id1,dataset_id2,..,dat... | [
"API",
"to",
"list",
"datasets",
"in",
"DBS",
".",
"To",
"be",
"called",
"by",
"datasetlist",
"url",
"with",
"post",
"call",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L490-L532 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listDataTiers | def listDataTiers(self, data_tier_name=""):
"""
API to list data tiers known to DBS.
:param data_tier_name: List details on that data tier (Optional)
:type data_tier_name: str
:returns: List of dictionaries containing the following keys (data_tier_id, data_tier_name, create_by, ... | python | def listDataTiers(self, data_tier_name=""):
"""
API to list data tiers known to DBS.
:param data_tier_name: List details on that data tier (Optional)
:type data_tier_name: str
:returns: List of dictionaries containing the following keys (data_tier_id, data_tier_name, create_by, ... | [
"def",
"listDataTiers",
"(",
"self",
",",
"data_tier_name",
"=",
"\"\"",
")",
":",
"data_tier_name",
"=",
"data_tier_name",
".",
"replace",
"(",
"\"*\"",
",",
"\"%\"",
")",
"try",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"return... | API to list data tiers known to DBS.
:param data_tier_name: List details on that data tier (Optional)
:type data_tier_name: str
:returns: List of dictionaries containing the following keys (data_tier_id, data_tier_name, create_by, creation_date) | [
"API",
"to",
"list",
"data",
"tiers",
"known",
"to",
"DBS",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L535-L563 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listBlocks | def listBlocks(self, dataset="", block_name="", data_tier_name="", origin_site_name="",
logical_file_name="",run_num=-1, min_cdate='0', max_cdate='0',
min_ldate='0', max_ldate='0', cdate='0', ldate='0', open_for_writing=-1, detail=False):
"""
API to list a block i... | python | def listBlocks(self, dataset="", block_name="", data_tier_name="", origin_site_name="",
logical_file_name="",run_num=-1, min_cdate='0', max_cdate='0',
min_ldate='0', max_ldate='0', cdate='0', ldate='0', open_for_writing=-1, detail=False):
"""
API to list a block i... | [
"def",
"listBlocks",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"data_tier_name",
"=",
"\"\"",
",",
"origin_site_name",
"=",
"\"\"",
",",
"logical_file_name",
"=",
"\"\"",
",",
"run_num",
"=",
"-",
"1",
",",
"min_cdate",... | API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or
logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and
the difference in time have to be less than 31 days.
:param block_name: name of the b... | [
"API",
"to",
"list",
"a",
"block",
"in",
"DBS",
".",
"At",
"least",
"one",
"of",
"the",
"parameters",
"block_name",
"dataset",
"data_tier_name",
"or",
"logical_file_name",
"are",
"required",
".",
"If",
"data_tier_name",
"is",
"provided",
"min_cdate",
"and",
"m... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L569-L695 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listBlockOrigin | def listBlockOrigin(self, origin_site_name="", dataset="", block_name=""):
"""
API to list blocks first generated in origin_site_name.
:param origin_site_name: Origin Site Name (Optional, No wildcards)
:type origin_site_name: str
:param dataset: dataset ( No wildcards, either d... | python | def listBlockOrigin(self, origin_site_name="", dataset="", block_name=""):
"""
API to list blocks first generated in origin_site_name.
:param origin_site_name: Origin Site Name (Optional, No wildcards)
:type origin_site_name: str
:param dataset: dataset ( No wildcards, either d... | [
"def",
"listBlockOrigin",
"(",
"self",
",",
"origin_site_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
")",
":",
"try",
":",
"return",
"self",
".",
"dbsBlock",
".",
"listBlocksOrigin",
"(",
"origin_site_name",
",",
"dataset... | API to list blocks first generated in origin_site_name.
:param origin_site_name: Origin Site Name (Optional, No wildcards)
:type origin_site_name: str
:param dataset: dataset ( No wildcards, either dataset or block name needed)
:type dataset: str
:param block_name:
:type... | [
"API",
"to",
"list",
"blocks",
"first",
"generated",
"in",
"origin_site_name",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L698-L720 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listBlocksParents | def listBlocksParents(self):
"""
API to list block parents of multiple blocks. To be called by blockparents url with post call.
:param block_names: list of block names [block_name1, block_name2, ...] (Required). Mwx length 1000.
:type block_names: list
"""
try :
... | python | def listBlocksParents(self):
"""
API to list block parents of multiple blocks. To be called by blockparents url with post call.
:param block_names: list of block names [block_name1, block_name2, ...] (Required). Mwx length 1000.
:type block_names: list
"""
try :
... | [
"def",
"listBlocksParents",
"(",
"self",
")",
":",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"data",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"data",
"=",
"validateJSONInputNoCopy",
"(",
"\"block\"",
",",
"data",
","... | API to list block parents of multiple blocks. To be called by blockparents url with post call.
:param block_names: list of block names [block_name1, block_name2, ...] (Required). Mwx length 1000.
:type block_names: list | [
"API",
"to",
"list",
"block",
"parents",
"of",
"multiple",
"blocks",
".",
"To",
"be",
"called",
"by",
"blockparents",
"url",
"with",
"post",
"call",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L744-L776 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listBlockChildren | def listBlockChildren(self, block_name=""):
"""
API to list block children.
:param block_name: name of block who's children needs to be found (Required)
:type block_name: str
:returns: List of dictionaries containing following keys (block_name)
:rtype: list of dicts
... | python | def listBlockChildren(self, block_name=""):
"""
API to list block children.
:param block_name: name of block who's children needs to be found (Required)
:type block_name: str
:returns: List of dictionaries containing following keys (block_name)
:rtype: list of dicts
... | [
"def",
"listBlockChildren",
"(",
"self",
",",
"block_name",
"=",
"\"\"",
")",
":",
"block_name",
"=",
"block_name",
".",
"replace",
"(",
"\"*\"",
",",
"\"%\"",
")",
"try",
":",
"return",
"self",
".",
"dbsBlock",
".",
"listBlockChildren",
"(",
"block_name",
... | API to list block children.
:param block_name: name of block who's children needs to be found (Required)
:type block_name: str
:returns: List of dictionaries containing following keys (block_name)
:rtype: list of dicts | [
"API",
"to",
"list",
"block",
"children",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L779-L796 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listBlockSummaries | def listBlockSummaries(self, block_name="", dataset="", detail=False):
"""
API that returns summary information like total size and total number of events in a dataset or a list of blocks
:param block_name: list block summaries for block_name(s)
:type block_name: str, list
:para... | python | def listBlockSummaries(self, block_name="", dataset="", detail=False):
"""
API that returns summary information like total size and total number of events in a dataset or a list of blocks
:param block_name: list block summaries for block_name(s)
:type block_name: str, list
:para... | [
"def",
"listBlockSummaries",
"(",
"self",
",",
"block_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"detail",
"=",
"False",
")",
":",
"if",
"bool",
"(",
"dataset",
")",
"+",
"bool",
"(",
"block_name",
")",
"!=",
"1",
":",
"dbsExceptionHandler",
... | API that returns summary information like total size and total number of events in a dataset or a list of blocks
:param block_name: list block summaries for block_name(s)
:type block_name: str, list
:param dataset: list block summaries for all blocks in dataset
:type dataset: str
... | [
"API",
"that",
"returns",
"summary",
"information",
"like",
"total",
"size",
"and",
"total",
"number",
"of",
"events",
"in",
"a",
"dataset",
"or",
"a",
"list",
"of",
"blocks"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L800-L850 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listFiles | def listFiles(self, dataset = "", block_name = "", logical_file_name = "",
release_version="", pset_hash="", app_name="", output_module_label="",
run_num=-1, origin_site_name="", lumi_list="", detail=False, validFileOnly=0, sumOverLumi=0):
"""
API to list files in DBS. Either non-wildcar... | python | def listFiles(self, dataset = "", block_name = "", logical_file_name = "",
release_version="", pset_hash="", app_name="", output_module_label="",
run_num=-1, origin_site_name="", lumi_list="", detail=False, validFileOnly=0, sumOverLumi=0):
"""
API to list files in DBS. Either non-wildcar... | [
"def",
"listFiles",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"logical_file_name",
"=",
"\"\"",
",",
"release_version",
"=",
"\"\"",
",",
"pset_hash",
"=",
"\"\"",
",",
"app_name",
"=",
"\"\"",
",",
"output_module_label",... | API to list files in DBS. Either non-wildcarded logical_file_name, non-wildcarded dataset or non-wildcarded block_name is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported.
* For lumi_list the following two json formats are supported:
... | [
"API",
"to",
"list",
"files",
"in",
"DBS",
".",
"Either",
"non",
"-",
"wildcarded",
"logical_file_name",
"non",
"-",
"wildcarded",
"dataset",
"or",
"non",
"-",
"wildcarded",
"block_name",
"is",
"required",
".",
"The",
"combination",
"of",
"a",
"non",
"-",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L857-L974 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listFileArray | def listFileArray(self):
"""
API to list files in DBS. Either non-wildcarded logical_file_name, non-wildcarded dataset,
non-wildcarded block_name or non-wildcarded lfn list is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported.... | python | def listFileArray(self):
"""
API to list files in DBS. Either non-wildcarded logical_file_name, non-wildcarded dataset,
non-wildcarded block_name or non-wildcarded lfn list is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported.... | [
"def",
"listFileArray",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"if",
"body",
":",
"data",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"data",
"=",
"validateJSONInputNo... | API to list files in DBS. Either non-wildcarded logical_file_name, non-wildcarded dataset,
non-wildcarded block_name or non-wildcarded lfn list is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported.
* For lumi_list the followi... | [
"API",
"to",
"list",
"files",
"in",
"DBS",
".",
"Either",
"non",
"-",
"wildcarded",
"logical_file_name",
"non",
"-",
"wildcarded",
"dataset",
"non",
"-",
"wildcarded",
"block_name",
"or",
"non",
"-",
"wildcarded",
"lfn",
"list",
"is",
"required",
".",
"The",... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L976-L1072 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listFileSummaries | def listFileSummaries(self, block_name='', dataset='', run_num=-1, validFileOnly=0, sumOverLumi=0):
"""
API to list number of files, event counts and number of lumis in a given block or dataset.
If the optional run_num, output are:
* The number of files which have data (lumis) ... | python | def listFileSummaries(self, block_name='', dataset='', run_num=-1, validFileOnly=0, sumOverLumi=0):
"""
API to list number of files, event counts and number of lumis in a given block or dataset.
If the optional run_num, output are:
* The number of files which have data (lumis) ... | [
"def",
"listFileSummaries",
"(",
"self",
",",
"block_name",
"=",
"''",
",",
"dataset",
"=",
"''",
",",
"run_num",
"=",
"-",
"1",
",",
"validFileOnly",
"=",
"0",
",",
"sumOverLumi",
"=",
"0",
")",
":",
"# run_num=1 caused full table scan and CERN DBS reported som... | API to list number of files, event counts and number of lumis in a given block or dataset.
If the optional run_num, output are:
* The number of files which have data (lumis) for that run number;
* The total number of events in those files;
* The total number of ... | [
"API",
"to",
"list",
"number",
"of",
"files",
"event",
"counts",
"and",
"number",
"of",
"lumis",
"in",
"a",
"given",
"block",
"or",
"dataset",
".",
"If",
"the",
"optional",
"run_num",
"output",
"are",
":"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1076-L1135 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listDatasetParents | def listDatasetParents(self, dataset=''):
"""
API to list A datasets parents in DBS.
:param dataset: dataset (Required)
:type dataset: str
:returns: List of dictionaries containing the following keys (this_dataset, parent_dataset_id, parent_dataset)
:rtype: list of dicts... | python | def listDatasetParents(self, dataset=''):
"""
API to list A datasets parents in DBS.
:param dataset: dataset (Required)
:type dataset: str
:returns: List of dictionaries containing the following keys (this_dataset, parent_dataset_id, parent_dataset)
:rtype: list of dicts... | [
"def",
"listDatasetParents",
"(",
"self",
",",
"dataset",
"=",
"''",
")",
":",
"try",
":",
"return",
"self",
".",
"dbsDataset",
".",
"listDatasetParents",
"(",
"dataset",
")",
"except",
"dbsException",
"as",
"de",
":",
"dbsExceptionHandler",
"(",
"de",
".",
... | API to list A datasets parents in DBS.
:param dataset: dataset (Required)
:type dataset: str
:returns: List of dictionaries containing the following keys (this_dataset, parent_dataset_id, parent_dataset)
:rtype: list of dicts | [
"API",
"to",
"list",
"A",
"datasets",
"parents",
"in",
"DBS",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1138-L1155 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listOutputConfigs | def listOutputConfigs(self, dataset="", logical_file_name="",
release_version="", pset_hash="", app_name="",
output_module_label="", block_id=0, global_tag=''):
"""
API to list OutputConfigs in DBS.
* You can use any combination of these param... | python | def listOutputConfigs(self, dataset="", logical_file_name="",
release_version="", pset_hash="", app_name="",
output_module_label="", block_id=0, global_tag=''):
"""
API to list OutputConfigs in DBS.
* You can use any combination of these param... | [
"def",
"listOutputConfigs",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"logical_file_name",
"=",
"\"\"",
",",
"release_version",
"=",
"\"\"",
",",
"pset_hash",
"=",
"\"\"",
",",
"app_name",
"=",
"\"\"",
",",
"output_module_label",
"=",
"\"\"",
",",
"bloc... | API to list OutputConfigs in DBS.
* You can use any combination of these parameters in this API
* All parameters are optional, if you do not provide any parameter, all configs will be listed from DBS
:param dataset: Full dataset (path) of the dataset
:type dataset: str
:param l... | [
"API",
"to",
"list",
"OutputConfigs",
"in",
"DBS",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1179-L1221 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listFileParents | def listFileParents(self, logical_file_name='', block_id=0, block_name=''):
"""
API to list file parents
:param logical_file_name: logical_file_name of file (Required)
:type logical_file_name: str, list
:param block_id: ID of the a block, whose files should be listed
:ty... | python | def listFileParents(self, logical_file_name='', block_id=0, block_name=''):
"""
API to list file parents
:param logical_file_name: logical_file_name of file (Required)
:type logical_file_name: str, list
:param block_id: ID of the a block, whose files should be listed
:ty... | [
"def",
"listFileParents",
"(",
"self",
",",
"logical_file_name",
"=",
"''",
",",
"block_id",
"=",
"0",
",",
"block_name",
"=",
"''",
")",
":",
"try",
":",
"r",
"=",
"self",
".",
"dbsFile",
".",
"listFileParents",
"(",
"logical_file_name",
",",
"block_id",
... | API to list file parents
:param logical_file_name: logical_file_name of file (Required)
:type logical_file_name: str, list
:param block_id: ID of the a block, whose files should be listed
:type block_id: int, str
:param block_name: Name of the block, whose files should be listed... | [
"API",
"to",
"list",
"file",
"parents"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1225-L1250 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listFileParentsByLumi | def listFileParentsByLumi(self):
"""
IMPORTANT: This is ***WMAgent*** sepcial case API. It is not for others.
API to list File Parentage for a given block with or w/o a list of LFN. It is used with the POST method of fileparents call.
Using the child_lfn_list will significantly affect ... | python | def listFileParentsByLumi(self):
"""
IMPORTANT: This is ***WMAgent*** sepcial case API. It is not for others.
API to list File Parentage for a given block with or w/o a list of LFN. It is used with the POST method of fileparents call.
Using the child_lfn_list will significantly affect ... | [
"def",
"listFileParentsByLumi",
"(",
"self",
")",
":",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"if",
"body",
":",
"data",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"data",
"=",
"validateJSONInputNoCopy",
"(",
"'file... | IMPORTANT: This is ***WMAgent*** sepcial case API. It is not for others.
API to list File Parentage for a given block with or w/o a list of LFN. It is used with the POST method of fileparents call.
Using the child_lfn_list will significantly affect the API running speed.
:param block... | [
"IMPORTANT",
":",
"This",
"is",
"***",
"WMAgent",
"***",
"sepcial",
"case",
"API",
".",
"It",
"is",
"not",
"for",
"others",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1252-L1300 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listFileChildren | def listFileChildren(self, logical_file_name='', block_name='', block_id=0):
"""
API to list file children. One of the parameters in mandatory.
:param logical_file_name: logical_file_name of file (Required)
:type logical_file_name: str, list
:param block_name: block_name
... | python | def listFileChildren(self, logical_file_name='', block_name='', block_id=0):
"""
API to list file children. One of the parameters in mandatory.
:param logical_file_name: logical_file_name of file (Required)
:type logical_file_name: str, list
:param block_name: block_name
... | [
"def",
"listFileChildren",
"(",
"self",
",",
"logical_file_name",
"=",
"''",
",",
"block_name",
"=",
"''",
",",
"block_id",
"=",
"0",
")",
":",
"if",
"isinstance",
"(",
"logical_file_name",
",",
"list",
")",
":",
"for",
"f",
"in",
"logical_file_name",
":",... | API to list file children. One of the parameters in mandatory.
:param logical_file_name: logical_file_name of file (Required)
:type logical_file_name: str, list
:param block_name: block_name
:type block_name: str
:param block_id: block_id
:type block_id: str, int
... | [
"API",
"to",
"list",
"file",
"children",
".",
"One",
"of",
"the",
"parameters",
"in",
"mandatory",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1307-L1334 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listFileLumis | def listFileLumis(self, logical_file_name="", block_name="", run_num=-1, validFileOnly=0):
"""
API to list Lumi for files. Either logical_file_name or block_name is required. No wild card support in this API
:param block_name: Name of the block
:type block_name: str
:param logic... | python | def listFileLumis(self, logical_file_name="", block_name="", run_num=-1, validFileOnly=0):
"""
API to list Lumi for files. Either logical_file_name or block_name is required. No wild card support in this API
:param block_name: Name of the block
:type block_name: str
:param logic... | [
"def",
"listFileLumis",
"(",
"self",
",",
"logical_file_name",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"run_num",
"=",
"-",
"1",
",",
"validFileOnly",
"=",
"0",
")",
":",
"# run_num=1 caused full table scan and CERN DBS reported some of the queries ran more th... | API to list Lumi for files. Either logical_file_name or block_name is required. No wild card support in this API
:param block_name: Name of the block
:type block_name: str
:param logical_file_name: logical_file_name of file
:type logical_file_name: str, list
:param run_num: List... | [
"API",
"to",
"list",
"Lumi",
"for",
"files",
".",
"Either",
"logical_file_name",
"or",
"block_name",
"is",
"required",
".",
"No",
"wild",
"card",
"support",
"in",
"this",
"API"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1338-L1377 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listRuns | def listRuns(self, run_num=-1, logical_file_name="", block_name="", dataset=""):
"""
API to list all runs in DBS. At least one parameter is mandatory.
:param logical_file_name: List all runs in the file
:type logical_file_name: str
:param block_name: List all runs in the block
... | python | def listRuns(self, run_num=-1, logical_file_name="", block_name="", dataset=""):
"""
API to list all runs in DBS. At least one parameter is mandatory.
:param logical_file_name: List all runs in the file
:type logical_file_name: str
:param block_name: List all runs in the block
... | [
"def",
"listRuns",
"(",
"self",
",",
"run_num",
"=",
"-",
"1",
",",
"logical_file_name",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
")",
":",
"# run_num=1 caused full table scan and CERN DBS reported some of the queries ran more than 50 ho... | API to list all runs in DBS. At least one parameter is mandatory.
:param logical_file_name: List all runs in the file
:type logical_file_name: str
:param block_name: List all runs in the block
:type block_name: str
:param dataset: List all runs in that dataset
:type data... | [
"API",
"to",
"list",
"all",
"runs",
"in",
"DBS",
".",
"At",
"least",
"one",
"parameter",
"is",
"mandatory",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1435-L1482 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listDataTypes | def listDataTypes(self, datatype="", dataset=""):
"""
API to list data types known to dbs (when no parameter supplied).
:param dataset: Returns data type (of primary dataset) of the dataset (Optional)
:type dataset: str
:param datatype: List specific data type
:type data... | python | def listDataTypes(self, datatype="", dataset=""):
"""
API to list data types known to dbs (when no parameter supplied).
:param dataset: Returns data type (of primary dataset) of the dataset (Optional)
:type dataset: str
:param datatype: List specific data type
:type data... | [
"def",
"listDataTypes",
"(",
"self",
",",
"datatype",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
")",
":",
"try",
":",
"return",
"self",
".",
"dbsDataType",
".",
"listDataType",
"(",
"dataType",
"=",
"datatype",
",",
"dataset",
"=",
"dataset",
")",
"excep... | API to list data types known to dbs (when no parameter supplied).
:param dataset: Returns data type (of primary dataset) of the dataset (Optional)
:type dataset: str
:param datatype: List specific data type
:type datatype: str
:returns: List of dictionaries containing the follow... | [
"API",
"to",
"list",
"data",
"types",
"known",
"to",
"dbs",
"(",
"when",
"no",
"parameter",
"supplied",
")",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1485-L1504 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.dumpBlock | def dumpBlock(self, block_name):
"""
API the list all information related with the block_name
:param block_name: Name of block to be dumped (Required)
:type block_name: str
"""
try:
return self.dbsBlock.dumpBlock(block_name)
except HTTPError as he:
... | python | def dumpBlock(self, block_name):
"""
API the list all information related with the block_name
:param block_name: Name of block to be dumped (Required)
:type block_name: str
"""
try:
return self.dbsBlock.dumpBlock(block_name)
except HTTPError as he:
... | [
"def",
"dumpBlock",
"(",
"self",
",",
"block_name",
")",
":",
"try",
":",
"return",
"self",
".",
"dbsBlock",
".",
"dumpBlock",
"(",
"block_name",
")",
"except",
"HTTPError",
"as",
"he",
":",
"raise",
"he",
"except",
"dbsException",
"as",
"de",
":",
"dbsE... | API the list all information related with the block_name
:param block_name: Name of block to be dumped (Required)
:type block_name: str | [
"API",
"the",
"list",
"all",
"information",
"related",
"with",
"the",
"block_name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1507-L1524 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listAcquisitionEras | def listAcquisitionEras(self, acquisition_era_name=''):
"""
API to list all Acquisition Eras in DBS.
:param acquisition_era_name: Acquisition era name (Optional, wild cards allowed)
:type acquisition_era_name: str
:returns: List of dictionaries containing following keys (descrip... | python | def listAcquisitionEras(self, acquisition_era_name=''):
"""
API to list all Acquisition Eras in DBS.
:param acquisition_era_name: Acquisition era name (Optional, wild cards allowed)
:type acquisition_era_name: str
:returns: List of dictionaries containing following keys (descrip... | [
"def",
"listAcquisitionEras",
"(",
"self",
",",
"acquisition_era_name",
"=",
"''",
")",
":",
"try",
":",
"acquisition_era_name",
"=",
"acquisition_era_name",
".",
"replace",
"(",
"'*'",
",",
"'%'",
")",
"return",
"self",
".",
"dbsAcqEra",
".",
"listAcquisitionEr... | API to list all Acquisition Eras in DBS.
:param acquisition_era_name: Acquisition era name (Optional, wild cards allowed)
:type acquisition_era_name: str
:returns: List of dictionaries containing following keys (description, end_date, acquisition_era_name, create_by, creation_date and start_dat... | [
"API",
"to",
"list",
"all",
"Acquisition",
"Eras",
"in",
"DBS",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1527-L1544 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listProcessingEras | def listProcessingEras(self, processing_version=0):
"""
API to list all Processing Eras in DBS.
:param processing_version: Processing Version (Optional). If provided just this processing_version will be listed
:type processing_version: str
:returns: List of dictionaries containi... | python | def listProcessingEras(self, processing_version=0):
"""
API to list all Processing Eras in DBS.
:param processing_version: Processing Version (Optional). If provided just this processing_version will be listed
:type processing_version: str
:returns: List of dictionaries containi... | [
"def",
"listProcessingEras",
"(",
"self",
",",
"processing_version",
"=",
"0",
")",
":",
"try",
":",
"#processing_version = processing_version.replace(\"*\", \"%\")",
"return",
"self",
".",
"dbsProcEra",
".",
"listProcessingEras",
"(",
"processing_version",
")",
"except",... | API to list all Processing Eras in DBS.
:param processing_version: Processing Version (Optional). If provided just this processing_version will be listed
:type processing_version: str
:returns: List of dictionaries containing the following keys (create_by, processing_version, description, creat... | [
"API",
"to",
"list",
"all",
"Processing",
"Eras",
"in",
"DBS",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1568-L1586 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listReleaseVersions | def listReleaseVersions(self, release_version='', dataset='', logical_file_name=''):
"""
API to list all release versions in DBS
:param release_version: List only that release version
:type release_version: str
:param dataset: List release version of the specified dataset
... | python | def listReleaseVersions(self, release_version='', dataset='', logical_file_name=''):
"""
API to list all release versions in DBS
:param release_version: List only that release version
:type release_version: str
:param dataset: List release version of the specified dataset
... | [
"def",
"listReleaseVersions",
"(",
"self",
",",
"release_version",
"=",
"''",
",",
"dataset",
"=",
"''",
",",
"logical_file_name",
"=",
"''",
")",
":",
"if",
"release_version",
":",
"release_version",
"=",
"release_version",
".",
"replace",
"(",
"\"*\"",
",",
... | API to list all release versions in DBS
:param release_version: List only that release version
:type release_version: str
:param dataset: List release version of the specified dataset
:type dataset: str
:param logical_file_name: List release version of the logical file name
... | [
"API",
"to",
"list",
"all",
"release",
"versions",
"in",
"DBS"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1589-L1612 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listDatasetAccessTypes | def listDatasetAccessTypes(self, dataset_access_type=''):
"""
API to list dataset access types.
:param dataset_access_type: List that dataset access type (Optional)
:type dataset_access_type: str
:returns: List of dictionary containing the following key (dataset_access_type).
... | python | def listDatasetAccessTypes(self, dataset_access_type=''):
"""
API to list dataset access types.
:param dataset_access_type: List that dataset access type (Optional)
:type dataset_access_type: str
:returns: List of dictionary containing the following key (dataset_access_type).
... | [
"def",
"listDatasetAccessTypes",
"(",
"self",
",",
"dataset_access_type",
"=",
"''",
")",
":",
"if",
"dataset_access_type",
":",
"dataset_access_type",
"=",
"dataset_access_type",
".",
"replace",
"(",
"\"*\"",
",",
"\"%\"",
")",
"try",
":",
"return",
"self",
"."... | API to list dataset access types.
:param dataset_access_type: List that dataset access type (Optional)
:type dataset_access_type: str
:returns: List of dictionary containing the following key (dataset_access_type).
:rtype: List of dicts | [
"API",
"to",
"list",
"dataset",
"access",
"types",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1615-L1634 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listPhysicsGroups | def listPhysicsGroups(self, physics_group_name=''):
"""
API to list all physics groups.
:param physics_group_name: List that specific physics group (Optional)
:type physics_group_name: basestring
:returns: List of dictionaries containing the following key (physics_group_name)
... | python | def listPhysicsGroups(self, physics_group_name=''):
"""
API to list all physics groups.
:param physics_group_name: List that specific physics group (Optional)
:type physics_group_name: basestring
:returns: List of dictionaries containing the following key (physics_group_name)
... | [
"def",
"listPhysicsGroups",
"(",
"self",
",",
"physics_group_name",
"=",
"''",
")",
":",
"if",
"physics_group_name",
":",
"physics_group_name",
"=",
"physics_group_name",
".",
"replace",
"(",
"'*'",
",",
"'%'",
")",
"try",
":",
"return",
"self",
".",
"dbsPhysi... | API to list all physics groups.
:param physics_group_name: List that specific physics group (Optional)
:type physics_group_name: basestring
:returns: List of dictionaries containing the following key (physics_group_name)
:rtype: list of dicts | [
"API",
"to",
"list",
"all",
"physics",
"groups",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1637-L1656 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSReaderModel.py | DBSReaderModel.listRunSummaries | def listRunSummaries(self, dataset="", run_num=-1):
"""
API to list run summaries, like the maximal lumisection in a run.
:param dataset: dataset name (Optional)
:type dataset: str
:param run_num: Run number (Required)
:type run_num: str, long, int
:rtype: list c... | python | def listRunSummaries(self, dataset="", run_num=-1):
"""
API to list run summaries, like the maximal lumisection in a run.
:param dataset: dataset name (Optional)
:type dataset: str
:param run_num: Run number (Required)
:type run_num: str, long, int
:rtype: list c... | [
"def",
"listRunSummaries",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"run_num",
"=",
"-",
"1",
")",
":",
"if",
"run_num",
"==",
"-",
"1",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-invalid-input\"",
",",
"\"The run_num parameter is mandatory\"",
",",
... | API to list run summaries, like the maximal lumisection in a run.
:param dataset: dataset name (Optional)
:type dataset: str
:param run_num: Run number (Required)
:type run_num: str, long, int
:rtype: list containing a dictionary with key max_lumi | [
"API",
"to",
"list",
"run",
"summaries",
"like",
"the",
"maximal",
"lumisection",
"in",
"a",
"run",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1659-L1697 | train |
LeafSoftware/python-lambder | lambder/cli.py | list | def list():
""" List all events """
entries = lambder.list_events()
for e in entries:
click.echo(str(e)) | python | def list():
""" List all events """
entries = lambder.list_events()
for e in entries:
click.echo(str(e)) | [
"def",
"list",
"(",
")",
":",
"entries",
"=",
"lambder",
".",
"list_events",
"(",
")",
"for",
"e",
"in",
"entries",
":",
"click",
".",
"echo",
"(",
"str",
"(",
"e",
")",
")"
] | List all events | [
"List",
"all",
"events"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L22-L26 | train |
LeafSoftware/python-lambder | lambder/cli.py | add | def add(name, function_name, cron):
""" Create an event """
lambder.add_event(name=name, function_name=function_name, cron=cron) | python | def add(name, function_name, cron):
""" Create an event """
lambder.add_event(name=name, function_name=function_name, cron=cron) | [
"def",
"add",
"(",
"name",
",",
"function_name",
",",
"cron",
")",
":",
"lambder",
".",
"add_event",
"(",
"name",
"=",
"name",
",",
"function_name",
"=",
"function_name",
",",
"cron",
"=",
"cron",
")"
] | Create an event | [
"Create",
"an",
"event"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L34-L36 | train |
LeafSoftware/python-lambder | lambder/cli.py | load | def load(file):
""" Load events from a json file """
with open(file, 'r') as f:
contents = f.read()
lambder.load_events(contents) | python | def load(file):
""" Load events from a json file """
with open(file, 'r') as f:
contents = f.read()
lambder.load_events(contents) | [
"def",
"load",
"(",
"file",
")",
":",
"with",
"open",
"(",
"file",
",",
"'r'",
")",
"as",
"f",
":",
"contents",
"=",
"f",
".",
"read",
"(",
")",
"lambder",
".",
"load_events",
"(",
"contents",
")"
] | Load events from a json file | [
"Load",
"events",
"from",
"a",
"json",
"file"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L66-L70 | train |
LeafSoftware/python-lambder | lambder/cli.py | functions | def functions(context):
""" Manage AWS Lambda functions """
# find lambder.json in CWD
config_file = "./lambder.json"
if os.path.isfile(config_file):
context.obj = FunctionConfig(config_file)
pass | python | def functions(context):
""" Manage AWS Lambda functions """
# find lambder.json in CWD
config_file = "./lambder.json"
if os.path.isfile(config_file):
context.obj = FunctionConfig(config_file)
pass | [
"def",
"functions",
"(",
"context",
")",
":",
"# find lambder.json in CWD",
"config_file",
"=",
"\"./lambder.json\"",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"config_file",
")",
":",
"context",
".",
"obj",
"=",
"FunctionConfig",
"(",
"config_file",
")",
"... | Manage AWS Lambda functions | [
"Manage",
"AWS",
"Lambda",
"functions"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L94-L100 | train |
LeafSoftware/python-lambder | lambder/cli.py | list | def list():
""" List lambder functions """
functions = lambder.list_functions()
output = json.dumps(
functions,
sort_keys=True,
indent=4,
separators=(',', ':')
)
click.echo(output) | python | def list():
""" List lambder functions """
functions = lambder.list_functions()
output = json.dumps(
functions,
sort_keys=True,
indent=4,
separators=(',', ':')
)
click.echo(output) | [
"def",
"list",
"(",
")",
":",
"functions",
"=",
"lambder",
".",
"list_functions",
"(",
")",
"output",
"=",
"json",
".",
"dumps",
"(",
"functions",
",",
"sort_keys",
"=",
"True",
",",
"indent",
"=",
"4",
",",
"separators",
"=",
"(",
"','",
",",
"':'",... | List lambder functions | [
"List",
"lambder",
"functions"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L105-L114 | train |
LeafSoftware/python-lambder | lambder/cli.py | new | def new(
name,
bucket,
timeout,
memory,
description,
subnet_ids,
security_group_ids
):
""" Create a new lambda project """
config = {}
if timeout:
config['timeout'] = timeout
if memory:
config['memory'] = memory
if description:
config['description'... | python | def new(
name,
bucket,
timeout,
memory,
description,
subnet_ids,
security_group_ids
):
""" Create a new lambda project """
config = {}
if timeout:
config['timeout'] = timeout
if memory:
config['memory'] = memory
if description:
config['description'... | [
"def",
"new",
"(",
"name",
",",
"bucket",
",",
"timeout",
",",
"memory",
",",
"description",
",",
"subnet_ids",
",",
"security_group_ids",
")",
":",
"config",
"=",
"{",
"}",
"if",
"timeout",
":",
"config",
"[",
"'timeout'",
"]",
"=",
"timeout",
"if",
"... | Create a new lambda project | [
"Create",
"a",
"new",
"lambda",
"project"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L133-L155 | train |
LeafSoftware/python-lambder | lambder/cli.py | deploy | def deploy(
config,
name,
bucket,
timeout,
memory,
description,
subnet_ids,
security_group_ids
):
""" Deploy/Update a function from a project directory """
# options should override config if it is there
myname = name or config.name
mybucket = bucket or config.bucket
... | python | def deploy(
config,
name,
bucket,
timeout,
memory,
description,
subnet_ids,
security_group_ids
):
""" Deploy/Update a function from a project directory """
# options should override config if it is there
myname = name or config.name
mybucket = bucket or config.bucket
... | [
"def",
"deploy",
"(",
"config",
",",
"name",
",",
"bucket",
",",
"timeout",
",",
"memory",
",",
"description",
",",
"subnet_ids",
",",
"security_group_ids",
")",
":",
"# options should override config if it is there",
"myname",
"=",
"name",
"or",
"config",
".",
... | Deploy/Update a function from a project directory | [
"Deploy",
"/",
"Update",
"a",
"function",
"from",
"a",
"project",
"directory"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L171-L206 | train |
LeafSoftware/python-lambder | lambder/cli.py | rm | def rm(config, name, bucket):
""" Delete lambda function, role, and zipfile """
# options should override config if it is there
myname = name or config.name
mybucket = bucket or config.bucket
click.echo('Deleting {} from {}'.format(myname, mybucket))
lambder.delete_function(myname, mybucket) | python | def rm(config, name, bucket):
""" Delete lambda function, role, and zipfile """
# options should override config if it is there
myname = name or config.name
mybucket = bucket or config.bucket
click.echo('Deleting {} from {}'.format(myname, mybucket))
lambder.delete_function(myname, mybucket) | [
"def",
"rm",
"(",
"config",
",",
"name",
",",
"bucket",
")",
":",
"# options should override config if it is there",
"myname",
"=",
"name",
"or",
"config",
".",
"name",
"mybucket",
"=",
"bucket",
"or",
"config",
".",
"bucket",
"click",
".",
"echo",
"(",
"'De... | Delete lambda function, role, and zipfile | [
"Delete",
"lambda",
"function",
"role",
"and",
"zipfile"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L214-L221 | train |
LeafSoftware/python-lambder | lambder/cli.py | invoke | def invoke(config, name, input):
""" Invoke function in AWS """
# options should override config if it is there
myname = name or config.name
click.echo('Invoking ' + myname)
output = lambder.invoke_function(myname, input)
click.echo(output) | python | def invoke(config, name, input):
""" Invoke function in AWS """
# options should override config if it is there
myname = name or config.name
click.echo('Invoking ' + myname)
output = lambder.invoke_function(myname, input)
click.echo(output) | [
"def",
"invoke",
"(",
"config",
",",
"name",
",",
"input",
")",
":",
"# options should override config if it is there",
"myname",
"=",
"name",
"or",
"config",
".",
"name",
"click",
".",
"echo",
"(",
"'Invoking '",
"+",
"myname",
")",
"output",
"=",
"lambder",
... | Invoke function in AWS | [
"Invoke",
"function",
"in",
"AWS"
] | 1c50b5dd2af286286e1547ee87d815d66382b884 | https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L229-L236 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlockInsert.py | DBSBlockInsert.putBlock | def putBlock(self, blockcontent, migration=False):
"""
Insert the data in sereral steps and commit when each step finishes or rollback if there is a problem.
"""
#YG
try:
#1 insert configuration
self.logger.debug("insert configuration")
configL... | python | def putBlock(self, blockcontent, migration=False):
"""
Insert the data in sereral steps and commit when each step finishes or rollback if there is a problem.
"""
#YG
try:
#1 insert configuration
self.logger.debug("insert configuration")
configL... | [
"def",
"putBlock",
"(",
"self",
",",
"blockcontent",
",",
"migration",
"=",
"False",
")",
":",
"#YG",
"try",
":",
"#1 insert configuration",
"self",
".",
"logger",
".",
"debug",
"(",
"\"insert configuration\"",
")",
"configList",
"=",
"self",
".",
"insertOutpu... | Insert the data in sereral steps and commit when each step finishes or rollback if there is a problem. | [
"Insert",
"the",
"data",
"in",
"sereral",
"steps",
"and",
"commit",
"when",
"each",
"step",
"finishes",
"or",
"rollback",
"if",
"there",
"is",
"a",
"problem",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L85-L106 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlockInsert.py | DBSBlockInsert.insertOutputModuleConfig | def insertOutputModuleConfig(self, remoteConfig, migration=False):
"""
Insert Release version, application, parameter set hashes and the map(output module config).
"""
otptIdList = []
missingList = []
conn = self.dbi.connection()
try:
for c in remoteC... | python | def insertOutputModuleConfig(self, remoteConfig, migration=False):
"""
Insert Release version, application, parameter set hashes and the map(output module config).
"""
otptIdList = []
missingList = []
conn = self.dbi.connection()
try:
for c in remoteC... | [
"def",
"insertOutputModuleConfig",
"(",
"self",
",",
"remoteConfig",
",",
"migration",
"=",
"False",
")",
":",
"otptIdList",
"=",
"[",
"]",
"missingList",
"=",
"[",
"]",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"try",
":",
"for",
"... | Insert Release version, application, parameter set hashes and the map(output module config). | [
"Insert",
"Release",
"version",
"application",
"parameter",
"set",
"hashes",
"and",
"the",
"map",
"(",
"output",
"module",
"config",
")",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L430-L562 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlockInsert.py | DBSBlockInsert.insertDataset | def insertDataset(self, blockcontent, otptIdList, migration=False):
"""
This method insert a datsset from a block object into dbs.
"""
dataset = blockcontent['dataset']
conn = self.dbi.connection()
# First, check and see if the dataset exists.
try:
da... | python | def insertDataset(self, blockcontent, otptIdList, migration=False):
"""
This method insert a datsset from a block object into dbs.
"""
dataset = blockcontent['dataset']
conn = self.dbi.connection()
# First, check and see if the dataset exists.
try:
da... | [
"def",
"insertDataset",
"(",
"self",
",",
"blockcontent",
",",
"otptIdList",
",",
"migration",
"=",
"False",
")",
":",
"dataset",
"=",
"blockcontent",
"[",
"'dataset'",
"]",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"# First, check and se... | This method insert a datsset from a block object into dbs. | [
"This",
"method",
"insert",
"a",
"datsset",
"from",
"a",
"block",
"object",
"into",
"dbs",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L564-L884 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlockInsert.py | DBSBlockInsert.insertDatasetWOannex | def insertDatasetWOannex(self, dataset, blockcontent, otptIdList, conn,
insertDataset = True, migration = False):
"""
_insertDatasetOnly_
Insert the dataset and only the dataset
Meant to be called after everything else is put into place.
The insertD... | python | def insertDatasetWOannex(self, dataset, blockcontent, otptIdList, conn,
insertDataset = True, migration = False):
"""
_insertDatasetOnly_
Insert the dataset and only the dataset
Meant to be called after everything else is put into place.
The insertD... | [
"def",
"insertDatasetWOannex",
"(",
"self",
",",
"dataset",
",",
"blockcontent",
",",
"otptIdList",
",",
"conn",
",",
"insertDataset",
"=",
"True",
",",
"migration",
"=",
"False",
")",
":",
"tran",
"=",
"conn",
".",
"begin",
"(",
")",
"try",
":",
"#8 Fin... | _insertDatasetOnly_
Insert the dataset and only the dataset
Meant to be called after everything else is put into place.
The insertDataset flag is set to false if the dataset already exists | [
"_insertDatasetOnly_"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L888-L1017 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSSite.py | DBSSite.listSites | def listSites(self, block_name="", site_name=""):
"""
Returns sites.
"""
try:
conn = self.dbi.connection()
if block_name:
result = self.blksitelist.execute(conn, block_name)
else:
result = self.sitelist.execute(conn, sit... | python | def listSites(self, block_name="", site_name=""):
"""
Returns sites.
"""
try:
conn = self.dbi.connection()
if block_name:
result = self.blksitelist.execute(conn, block_name)
else:
result = self.sitelist.execute(conn, sit... | [
"def",
"listSites",
"(",
"self",
",",
"block_name",
"=",
"\"\"",
",",
"site_name",
"=",
"\"\"",
")",
":",
"try",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"if",
"block_name",
":",
"result",
"=",
"self",
".",
"blksitelist",
".... | Returns sites. | [
"Returns",
"sites",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSSite.py#L24-L37 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSSite.py | DBSSite.insertSite | def insertSite(self, businput):
"""
Input dictionary has to have the following keys:
site_name
it builds the correct dictionary for dao input and executes the dao
"""
conn = self.dbi.connection()
tran = conn.begin()
try:
siteobj = { # FIXME: un... | python | def insertSite(self, businput):
"""
Input dictionary has to have the following keys:
site_name
it builds the correct dictionary for dao input and executes the dao
"""
conn = self.dbi.connection()
tran = conn.begin()
try:
siteobj = { # FIXME: un... | [
"def",
"insertSite",
"(",
"self",
",",
"businput",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"tran",
"=",
"conn",
".",
"begin",
"(",
")",
"try",
":",
"siteobj",
"=",
"{",
"# FIXME: unused?",
"\"site_name\"",
":",
"businput... | Input dictionary has to have the following keys:
site_name
it builds the correct dictionary for dao input and executes the dao | [
"Input",
"dictionary",
"has",
"to",
"have",
"the",
"following",
"keys",
":",
"site_name",
"it",
"builds",
"the",
"correct",
"dictionary",
"for",
"dao",
"input",
"and",
"executes",
"the",
"dao"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSSite.py#L39-L69 | train |
dmwm/DBS | Server/Python/utils/das_logfile_analyser.py | DASMapping._create_das_mapping | def _create_das_mapping(self):
"""
das_map = {'lookup' : [{params : {'param1' : 'required', 'param2' : 'optional', 'param3' : 'default_value' ...},
url : 'https://cmsweb.cern.ch:8443/dbs/prod/global/DBSReader/acquisitioneras/',
das_map : {'... | python | def _create_das_mapping(self):
"""
das_map = {'lookup' : [{params : {'param1' : 'required', 'param2' : 'optional', 'param3' : 'default_value' ...},
url : 'https://cmsweb.cern.ch:8443/dbs/prod/global/DBSReader/acquisitioneras/',
das_map : {'... | [
"def",
"_create_das_mapping",
"(",
"self",
")",
":",
"with",
"open",
"(",
"self",
".",
"_mapfile",
",",
"'r'",
")",
"as",
"f",
":",
"for",
"entry",
"in",
"yaml",
".",
"load_all",
"(",
"f",
")",
":",
"das2dbs_param_map",
"=",
"{",
"}",
"if",
"'lookup'... | das_map = {'lookup' : [{params : {'param1' : 'required', 'param2' : 'optional', 'param3' : 'default_value' ...},
url : 'https://cmsweb.cern.ch:8443/dbs/prod/global/DBSReader/acquisitioneras/',
das_map : {'das_param1' : dbs_param1, ...}
... | [
"das_map",
"=",
"{",
"lookup",
":",
"[",
"{",
"params",
":",
"{",
"param1",
":",
"required",
"param2",
":",
"optional",
"param3",
":",
"default_value",
"...",
"}",
"url",
":",
"https",
":",
"//",
"cmsweb",
".",
"cern",
".",
"ch",
":",
"8443",
"/",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/utils/das_logfile_analyser.py#L31-L50 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | slicedIterator | def slicedIterator(sourceList, sliceSize):
"""
:param: sourceList: list which need to be sliced
:type: list
:param: sliceSize: size of the slice
:type: int
:return: iterator of the sliced list
"""
start = 0
end = 0
while len(sourceList) > end:
end = start + sliceSize
... | python | def slicedIterator(sourceList, sliceSize):
"""
:param: sourceList: list which need to be sliced
:type: list
:param: sliceSize: size of the slice
:type: int
:return: iterator of the sliced list
"""
start = 0
end = 0
while len(sourceList) > end:
end = start + sliceSize
... | [
"def",
"slicedIterator",
"(",
"sourceList",
",",
"sliceSize",
")",
":",
"start",
"=",
"0",
"end",
"=",
"0",
"while",
"len",
"(",
"sourceList",
")",
">",
"end",
":",
"end",
"=",
"start",
"+",
"sliceSize",
"yield",
"sourceList",
"[",
"start",
":",
"end",... | :param: sourceList: list which need to be sliced
:type: list
:param: sliceSize: size of the slice
:type: int
:return: iterator of the sliced list | [
":",
"param",
":",
"sourceList",
":",
"list",
"which",
"need",
"to",
"be",
"sliced",
":",
"type",
":",
"list",
":",
"param",
":",
"sliceSize",
":",
"size",
"of",
"the",
"slice",
":",
"type",
":",
"int",
":",
"return",
":",
"iterator",
"of",
"the",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L14-L28 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | checkInputParameter | def checkInputParameter(method, parameters, validParameters, requiredParameters=None):
"""
Helper function to check input by using before sending to the server
:param method: Name of the API
:type method: str
:param validParameters: Allow parameters for the API call
:type validParameters: list
... | python | def checkInputParameter(method, parameters, validParameters, requiredParameters=None):
"""
Helper function to check input by using before sending to the server
:param method: Name of the API
:type method: str
:param validParameters: Allow parameters for the API call
:type validParameters: list
... | [
"def",
"checkInputParameter",
"(",
"method",
",",
"parameters",
",",
"validParameters",
",",
"requiredParameters",
"=",
"None",
")",
":",
"for",
"parameter",
"in",
"parameters",
":",
"if",
"parameter",
"not",
"in",
"validParameters",
":",
"raise",
"dbsClientExcept... | Helper function to check input by using before sending to the server
:param method: Name of the API
:type method: str
:param validParameters: Allow parameters for the API call
:type validParameters: list
:param requiredParameters: Required parameters for the API call (Default: None)
:type requi... | [
"Helper",
"function",
"to",
"check",
"input",
"by",
"using",
"before",
"sending",
"to",
"the",
"server"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L30-L75 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | list_parameter_splitting | def list_parameter_splitting(data, key, size_limit=8000, method='GET'):
"""
Helper function split list used as input parameter for requests,
since Apache has a limitation to 8190 Bytes for the lenght of an URI.
We extended it to also split lfn and dataset list length for POST calls to avoid
DB abuse... | python | def list_parameter_splitting(data, key, size_limit=8000, method='GET'):
"""
Helper function split list used as input parameter for requests,
since Apache has a limitation to 8190 Bytes for the lenght of an URI.
We extended it to also split lfn and dataset list length for POST calls to avoid
DB abuse... | [
"def",
"list_parameter_splitting",
"(",
"data",
",",
"key",
",",
"size_limit",
"=",
"8000",
",",
"method",
"=",
"'GET'",
")",
":",
"values",
"=",
"list",
"(",
"data",
"[",
"key",
"]",
")",
"data",
"[",
"key",
"]",
"=",
"[",
"]",
"for",
"element",
"... | Helper function split list used as input parameter for requests,
since Apache has a limitation to 8190 Bytes for the lenght of an URI.
We extended it to also split lfn and dataset list length for POST calls to avoid
DB abuse even if there is no limit on hoe long the list can be. YG 2015-5-13
:param data... | [
"Helper",
"function",
"split",
"list",
"used",
"as",
"input",
"parameter",
"for",
"requests",
"since",
"Apache",
"has",
"a",
"limitation",
"to",
"8190",
"Bytes",
"for",
"the",
"lenght",
"of",
"an",
"URI",
".",
"We",
"extended",
"it",
"to",
"also",
"split",... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L77-L105 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | split_calls | def split_calls(func):
"""
Decorator to split up server calls for methods using url parameters, due to the lenght
limitation of the URI in Apache. By default 8190 bytes
"""
def wrapper(*args, **kwargs):
#The size limit is 8190 bytes minus url and api to call
#For example (https://cms... | python | def split_calls(func):
"""
Decorator to split up server calls for methods using url parameters, due to the lenght
limitation of the URI in Apache. By default 8190 bytes
"""
def wrapper(*args, **kwargs):
#The size limit is 8190 bytes minus url and api to call
#For example (https://cms... | [
"def",
"split_calls",
"(",
"func",
")",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"#The size limit is 8190 bytes minus url and api to call",
"#For example (https://cmsweb-testbed.cern.ch:8443/dbs/prod/global/filechildren), so 192 bytes should be ... | Decorator to split up server calls for methods using url parameters, due to the lenght
limitation of the URI in Apache. By default 8190 bytes | [
"Decorator",
"to",
"split",
"up",
"server",
"calls",
"for",
"methods",
"using",
"url",
"parameters",
"due",
"to",
"the",
"lenght",
"limitation",
"of",
"the",
"URI",
"in",
"Apache",
".",
"By",
"default",
"8190",
"bytes"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L107-L136 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.__callServer | def __callServer(self, method="", params={}, data={}, callmethod='GET', content='application/json'):
"""
A private method to make HTTP call to the DBS Server
:param method: REST API to call, e.g. 'datasets, blocks, files, ...'.
:type method: str
:param params: Parameters to the ... | python | def __callServer(self, method="", params={}, data={}, callmethod='GET', content='application/json'):
"""
A private method to make HTTP call to the DBS Server
:param method: REST API to call, e.g. 'datasets, blocks, files, ...'.
:type method: str
:param params: Parameters to the ... | [
"def",
"__callServer",
"(",
"self",
",",
"method",
"=",
"\"\"",
",",
"params",
"=",
"{",
"}",
",",
"data",
"=",
"{",
"}",
",",
"callmethod",
"=",
"'GET'",
",",
"content",
"=",
"'application/json'",
")",
":",
"UserID",
"=",
"os",
".",
"environ",
"[",
... | A private method to make HTTP call to the DBS Server
:param method: REST API to call, e.g. 'datasets, blocks, files, ...'.
:type method: str
:param params: Parameters to the API call, e.g. {'dataset':'/PrimaryDS/ProcessedDS/TIER'}.
:type params: dict
:param callmethod: The HTTP ... | [
"A",
"private",
"method",
"to",
"make",
"HTTP",
"call",
"to",
"the",
"DBS",
"Server"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L171-L210 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.__parseForException | def __parseForException(self, http_error):
"""
An internal method, should not be used by clients
:param httperror: Thrown httperror by the server
"""
data = http_error.body
try:
if isinstance(data, str):
data = cjson.decode(data)
excep... | python | def __parseForException(self, http_error):
"""
An internal method, should not be used by clients
:param httperror: Thrown httperror by the server
"""
data = http_error.body
try:
if isinstance(data, str):
data = cjson.decode(data)
excep... | [
"def",
"__parseForException",
"(",
"self",
",",
"http_error",
")",
":",
"data",
"=",
"http_error",
".",
"body",
"try",
":",
"if",
"isinstance",
"(",
"data",
",",
"str",
")",
":",
"data",
"=",
"cjson",
".",
"decode",
"(",
"data",
")",
"except",
":",
"... | An internal method, should not be used by clients
:param httperror: Thrown httperror by the server | [
"An",
"internal",
"method",
"should",
"not",
"be",
"used",
"by",
"clients"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L212-L228 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.requestTimingInfo | def requestTimingInfo(self):
"""
Returns the time needed to process the request by the frontend server in microseconds
and the EPOC timestamp of the request in microseconds.
:rtype: tuple containing processing time and timestamp
"""
try:
return tuple(item.spl... | python | def requestTimingInfo(self):
"""
Returns the time needed to process the request by the frontend server in microseconds
and the EPOC timestamp of the request in microseconds.
:rtype: tuple containing processing time and timestamp
"""
try:
return tuple(item.spl... | [
"def",
"requestTimingInfo",
"(",
"self",
")",
":",
"try",
":",
"return",
"tuple",
"(",
"item",
".",
"split",
"(",
"'='",
")",
"[",
"1",
"]",
"for",
"item",
"in",
"self",
".",
"http_response",
".",
"header",
".",
"get",
"(",
"'CMS-Server-Time'",
")",
... | Returns the time needed to process the request by the frontend server in microseconds
and the EPOC timestamp of the request in microseconds.
:rtype: tuple containing processing time and timestamp | [
"Returns",
"the",
"time",
"needed",
"to",
"process",
"the",
"request",
"by",
"the",
"frontend",
"server",
"in",
"microseconds",
"and",
"the",
"EPOC",
"timestamp",
"of",
"the",
"request",
"in",
"microseconds",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L231-L241 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.insertBulkBlock | def insertBulkBlock(self, blockDump):
"""
API to insert a bulk block
:param blockDump: Output of the block dump command, example can be found in https://svnweb.cern.ch/trac/CMSDMWM/browser/DBS/trunk/Client/tests/dbsclient_t/unittests/blockdump.dict
:type blockDump: dict
"""
... | python | def insertBulkBlock(self, blockDump):
"""
API to insert a bulk block
:param blockDump: Output of the block dump command, example can be found in https://svnweb.cern.ch/trac/CMSDMWM/browser/DBS/trunk/Client/tests/dbsclient_t/unittests/blockdump.dict
:type blockDump: dict
"""
... | [
"def",
"insertBulkBlock",
"(",
"self",
",",
"blockDump",
")",
":",
"#We first check if the first lumi section has event_count or not",
"frst",
"=",
"True",
"if",
"(",
"blockDump",
"[",
"'files'",
"]",
"[",
"0",
"]",
"[",
"'file_lumi_list'",
"]",
"[",
"0",
"]",
"... | API to insert a bulk block
:param blockDump: Output of the block dump command, example can be found in https://svnweb.cern.ch/trac/CMSDMWM/browser/DBS/trunk/Client/tests/dbsclient_t/unittests/blockdump.dict
:type blockDump: dict | [
"API",
"to",
"insert",
"a",
"bulk",
"block"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L317-L347 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.insertFiles | def insertFiles(self, filesList, qInserts=False):
"""
API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request.
:param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minut... | python | def insertFiles(self, filesList, qInserts=False):
"""
API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request.
:param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minut... | [
"def",
"insertFiles",
"(",
"self",
",",
"filesList",
",",
"qInserts",
"=",
"False",
")",
":",
"if",
"not",
"qInserts",
":",
"#turn off qInserts",
"return",
"self",
".",
"__callServer",
"(",
"\"files\"",
",",
"params",
"=",
"{",
"'qInserts'",
":",
"qInserts",... | API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request.
:param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minutes.
:type qInserts: bool
:param filesList: List of dic... | [
"API",
"to",
"insert",
"a",
"list",
"of",
"file",
"into",
"DBS",
"in",
"DBS",
".",
"Up",
"to",
"10",
"files",
"can",
"be",
"inserted",
"in",
"one",
"request",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L381-L409 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listFileParentsByLumi | def listFileParentsByLumi(self, **kwargs):
"""
API to list file parents using lumi section info.
:param block_name: name of block that has files who's parents needs to be found (Required)
:type block_name: str
:param logical_file_name: if not all the file parentages under the bl... | python | def listFileParentsByLumi(self, **kwargs):
"""
API to list file parents using lumi section info.
:param block_name: name of block that has files who's parents needs to be found (Required)
:type block_name: str
:param logical_file_name: if not all the file parentages under the bl... | [
"def",
"listFileParentsByLumi",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'block_name'",
",",
"'logical_file_name'",
"]",
"requiredParameters",
"=",
"{",
"'forced'",
":",
"[",
"'block_name'",
"]",
"}",
"checkInputParameter",
"... | API to list file parents using lumi section info.
:param block_name: name of block that has files who's parents needs to be found (Required)
:type block_name: str
:param logical_file_name: if not all the file parentages under the block needed, this lfn list gives the files that needs to find it... | [
"API",
"to",
"list",
"file",
"parents",
"using",
"lumi",
"section",
"info",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L465-L482 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listBlockParents | def listBlockParents(self, **kwargs):
"""
API to list block parents.
:param block_name: name of block who's parents needs to be found (Required)
:type block_name: str
:returns: List of dictionaries containing following keys (block_name)
:rtype: list of dicts
... | python | def listBlockParents(self, **kwargs):
"""
API to list block parents.
:param block_name: name of block who's parents needs to be found (Required)
:type block_name: str
:returns: List of dictionaries containing following keys (block_name)
:rtype: list of dicts
... | [
"def",
"listBlockParents",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'block_name'",
"]",
"requiredParameters",
"=",
"{",
"'forced'",
":",
"validParameters",
"}",
"checkInputParameter",
"(",
"method",
"=",
"\"listBlockParents\"",... | API to list block parents.
:param block_name: name of block who's parents needs to be found (Required)
:type block_name: str
:returns: List of dictionaries containing following keys (block_name)
:rtype: list of dicts | [
"API",
"to",
"list",
"block",
"parents",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L544-L562 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listBlocks | def listBlocks(self, **kwargs):
"""
API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or
logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and
the difference in time have to be less tha... | python | def listBlocks(self, **kwargs):
"""
API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or
logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and
the difference in time have to be less tha... | [
"def",
"listBlocks",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'dataset'",
",",
"'block_name'",
",",
"'data_tier_name'",
",",
"'origin_site_name'",
",",
"'logical_file_name'",
",",
"'run_num'",
",",
"'open_for_writing'",
",",
... | API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or
logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and
the difference in time have to be less than 31 days.
:param block_name: name of the b... | [
"API",
"to",
"list",
"a",
"block",
"in",
"DBS",
".",
"At",
"least",
"one",
"of",
"the",
"parameters",
"block_name",
"dataset",
"data_tier_name",
"or",
"logical_file_name",
"are",
"required",
".",
"If",
"data_tier_name",
"is",
"provided",
"min_cdate",
"and",
"m... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L564-L615 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listDatasets | def listDatasets(self, **kwargs):
"""
API to list dataset(s) in DBS
* You can use ANY combination of these parameters in this API
* In absence of parameters, all valid datasets known to the DBS instance will be returned
:param dataset: Full dataset (path) of the dataset
... | python | def listDatasets(self, **kwargs):
"""
API to list dataset(s) in DBS
* You can use ANY combination of these parameters in this API
* In absence of parameters, all valid datasets known to the DBS instance will be returned
:param dataset: Full dataset (path) of the dataset
... | [
"def",
"listDatasets",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'dataset'",
",",
"'parent_dataset'",
",",
"'is_dataset_valid'",
",",
"'release_version'",
",",
"'pset_hash'",
",",
"'app_name'",
",",
"'output_module_label'",
",",... | API to list dataset(s) in DBS
* You can use ANY combination of these parameters in this API
* In absence of parameters, all valid datasets known to the DBS instance will be returned
:param dataset: Full dataset (path) of the dataset
:type dataset: str
:param parent_dataset: Ful... | [
"API",
"to",
"list",
"dataset",
"(",
"s",
")",
"in",
"DBS",
"*",
"You",
"can",
"use",
"ANY",
"combination",
"of",
"these",
"parameters",
"in",
"this",
"API",
"*",
"In",
"absence",
"of",
"parameters",
"all",
"valid",
"datasets",
"known",
"to",
"the",
"D... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L679-L758 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listDatasetArray | def listDatasetArray(self, **kwargs):
"""
API to list datasets in DBS.
:param dataset: list of datasets [dataset1,dataset2,..,dataset n] (Required if dataset_id is not presented), Max length 1000.
:type dataset: list
:param dataset_id: list of dataset_ids that are the primary ke... | python | def listDatasetArray(self, **kwargs):
"""
API to list datasets in DBS.
:param dataset: list of datasets [dataset1,dataset2,..,dataset n] (Required if dataset_id is not presented), Max length 1000.
:type dataset: list
:param dataset_id: list of dataset_ids that are the primary ke... | [
"def",
"listDatasetArray",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'dataset'",
",",
"'dataset_access_type'",
",",
"'detail'",
",",
"'dataset_id'",
"]",
"requiredParameters",
"=",
"{",
"'multiple'",
":",
"[",
"'dataset'",
"... | API to list datasets in DBS.
:param dataset: list of datasets [dataset1,dataset2,..,dataset n] (Required if dataset_id is not presented), Max length 1000.
:type dataset: list
:param dataset_id: list of dataset_ids that are the primary keys of datasets table: [dataset_id1,dataset_id2,..,dataset_... | [
"API",
"to",
"list",
"datasets",
"in",
"DBS",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L776-L802 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listFileArray | def listFileArray(self, **kwargs):
"""
API to list files in DBS. Non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported... | python | def listFileArray(self, **kwargs):
"""
API to list files in DBS. Non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported... | [
"def",
"listFileArray",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'dataset'",
",",
"'block_name'",
",",
"'logical_file_name'",
",",
"'release_version'",
",",
"'pset_hash'",
",",
"'app_name'",
",",
"'output_module_label'",
",",
... | API to list files in DBS. Non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required.
The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported.
* For lumi_list the following two json for... | [
"API",
"to",
"list",
"files",
"in",
"DBS",
".",
"Non",
"-",
"wildcarded",
"logical_file_name",
"non",
"-",
"wildcarded",
"dataset",
"non",
"-",
"wildcarded",
"block_name",
"or",
"non",
"-",
"wildcarded",
"lfn",
"list",
"is",
"required",
".",
"The",
"combinat... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1127-L1266 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listPrimaryDSTypes | def listPrimaryDSTypes(self, **kwargs):
"""
API to list primary dataset types
:param primary_ds_type: List that primary dataset type (Optional)
:type primary_ds_type: str
:param dataset: List the primary dataset type for that dataset (Optional)
:type dataset: str
... | python | def listPrimaryDSTypes(self, **kwargs):
"""
API to list primary dataset types
:param primary_ds_type: List that primary dataset type (Optional)
:type primary_ds_type: str
:param dataset: List the primary dataset type for that dataset (Optional)
:type dataset: str
... | [
"def",
"listPrimaryDSTypes",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'primary_ds_type'",
",",
"'dataset'",
"]",
"checkInputParameter",
"(",
"method",
"=",
"\"listPrimaryDSTypes\"",
",",
"parameters",
"=",
"kwargs",
".",
"key... | API to list primary dataset types
:param primary_ds_type: List that primary dataset type (Optional)
:type primary_ds_type: str
:param dataset: List the primary dataset type for that dataset (Optional)
:type dataset: str
:returns: List of dictionaries containing the following key... | [
"API",
"to",
"list",
"primary",
"dataset",
"types"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1378-L1394 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.listRuns | def listRuns(self, **kwargs):
"""
API to list all run dictionary, for example: [{'run_num': [160578, 160498, 160447, 160379]}].
At least one parameter is mandatory.
:param logical_file_name: List all runs in the file
:type logical_file_name: str
:param block_name: List ... | python | def listRuns(self, **kwargs):
"""
API to list all run dictionary, for example: [{'run_num': [160578, 160498, 160447, 160379]}].
At least one parameter is mandatory.
:param logical_file_name: List all runs in the file
:type logical_file_name: str
:param block_name: List ... | [
"def",
"listRuns",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'run_num'",
",",
"'logical_file_name'",
",",
"'block_name'",
",",
"'dataset'",
"]",
"requiredParameters",
"=",
"{",
"'multiple'",
":",
"validParameters",
"}",
"che... | API to list all run dictionary, for example: [{'run_num': [160578, 160498, 160447, 160379]}].
At least one parameter is mandatory.
:param logical_file_name: List all runs in the file
:type logical_file_name: str
:param block_name: List all runs in the block
:type block_name: st... | [
"API",
"to",
"list",
"all",
"run",
"dictionary",
"for",
"example",
":",
"[",
"{",
"run_num",
":",
"[",
"160578",
"160498",
"160447",
"160379",
"]",
"}",
"]",
".",
"At",
"least",
"one",
"parameter",
"is",
"mandatory",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1432-L1454 | train |
dmwm/DBS | Client/src/python/dbs/apis/dbsClient.py | DbsApi.updateAcqEraEndDate | def updateAcqEraEndDate(self, **kwargs):
"""
API to update the end_date of an acquisition era
:param acquisition_era_name: acquisition_era_name to update (Required)
:type acquisition_era_name: str
:param end_date: end_date not zero (Required)
:type end_date: int
... | python | def updateAcqEraEndDate(self, **kwargs):
"""
API to update the end_date of an acquisition era
:param acquisition_era_name: acquisition_era_name to update (Required)
:type acquisition_era_name: str
:param end_date: end_date not zero (Required)
:type end_date: int
... | [
"def",
"updateAcqEraEndDate",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"validParameters",
"=",
"[",
"'end_date'",
",",
"'acquisition_era_name'",
"]",
"requiredParameters",
"=",
"{",
"'forced'",
":",
"validParameters",
"}",
"checkInputParameter",
"(",
"metho... | API to update the end_date of an acquisition era
:param acquisition_era_name: acquisition_era_name to update (Required)
:type acquisition_era_name: str
:param end_date: end_date not zero (Required)
:type end_date: int | [
"API",
"to",
"update",
"the",
"end_date",
"of",
"an",
"acquisition",
"era"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1534-L1551 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/FileLumi/List.py | List.execute | def execute(self, conn, logical_file_name='', block_name='', run_num=-1, validFileOnly=0, migration=False):
"""
Lists lumi section numbers with in a file, a list of files or a block.
"""
sql = ""
wheresql = ""
lfn_generator = ""
run_generator = ""
if logical_file_name and not isinsta... | python | def execute(self, conn, logical_file_name='', block_name='', run_num=-1, validFileOnly=0, migration=False):
"""
Lists lumi section numbers with in a file, a list of files or a block.
"""
sql = ""
wheresql = ""
lfn_generator = ""
run_generator = ""
if logical_file_name and not isinsta... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"logical_file_name",
"=",
"''",
",",
"block_name",
"=",
"''",
",",
"run_num",
"=",
"-",
"1",
",",
"validFileOnly",
"=",
"0",
",",
"migration",
"=",
"False",
")",
":",
"sql",
"=",
"\"\"",
"wheresql",
"=... | Lists lumi section numbers with in a file, a list of files or a block. | [
"Lists",
"lumi",
"section",
"numbers",
"with",
"in",
"a",
"file",
"a",
"list",
"of",
"files",
"or",
"a",
"block",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileLumi/List.py#L30-L159 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/FileParent/ListFileParentageByLumi.py | ListFileParentageByLumi.execute | def execute(self, conn, child_block_name='', child_lfn_list=[], transaction=False):
sql = ''
binds = {}
child_ds_name = ''
child_where = ''
if child_block_name:
child_ds_name = child_block_name.split('#')[0]
parent_where = " where d.dataset = :child_ds_nam... | python | def execute(self, conn, child_block_name='', child_lfn_list=[], transaction=False):
sql = ''
binds = {}
child_ds_name = ''
child_where = ''
if child_block_name:
child_ds_name = child_block_name.split('#')[0]
parent_where = " where d.dataset = :child_ds_nam... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"child_block_name",
"=",
"''",
",",
"child_lfn_list",
"=",
"[",
"]",
",",
"transaction",
"=",
"False",
")",
":",
"sql",
"=",
"''",
"binds",
"=",
"{",
"}",
"child_ds_name",
"=",
"''",
"child_where",
"=",
... | cursors = self.dbi.processData(sql, binds, conn, transaction=transaction, returnCursor=True)
for i in cursors:
d = self.formatCursor(i, size=100)
if isinstance(d, list) or isinstance(d, GeneratorType):
for elem in d:
yield elem
elif d:
... | [
"cursors",
"=",
"self",
".",
"dbi",
".",
"processData",
"(",
"sql",
"binds",
"conn",
"transaction",
"=",
"transaction",
"returnCursor",
"=",
"True",
")",
"for",
"i",
"in",
"cursors",
":",
"d",
"=",
"self",
".",
"formatCursor",
"(",
"i",
"size",
"=",
"1... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileParent/ListFileParentageByLumi.py#L39-L118 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/DatasetRun/List.py | List.execute | def execute(self, conn, run_num=-1, logical_file_name="", block_name="", dataset="", trans=False):
"""
Lists all primary datasets if pattern is not provided.
"""
sql = self.sql
binds = {}
if logical_file_name and "%" not in logical_file_name:
sql += """ inner join %sFILES F... | python | def execute(self, conn, run_num=-1, logical_file_name="", block_name="", dataset="", trans=False):
"""
Lists all primary datasets if pattern is not provided.
"""
sql = self.sql
binds = {}
if logical_file_name and "%" not in logical_file_name:
sql += """ inner join %sFILES F... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"run_num",
"=",
"-",
"1",
",",
"logical_file_name",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"trans",
"=",
"False",
")",
":",
"sql",
"=",
"self",
".",
"sql",
"bi... | Lists all primary datasets if pattern is not provided. | [
"Lists",
"all",
"primary",
"datasets",
"if",
"pattern",
"is",
"not",
"provided",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/DatasetRun/List.py#L30-L86 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | find_devices | def find_devices():
"""Return a list of dictionaries. Each dictionary represents one device.
The dictionary contains the following keys: port, unique_id and in_use.
`port` can be used with :func:`open`. `serial_number` is the serial number
of the device (and can also be used with :func:`open`) and `in_... | python | def find_devices():
"""Return a list of dictionaries. Each dictionary represents one device.
The dictionary contains the following keys: port, unique_id and in_use.
`port` can be used with :func:`open`. `serial_number` is the serial number
of the device (and can also be used with :func:`open`) and `in_... | [
"def",
"find_devices",
"(",
")",
":",
"# first fetch the number of attached devices, so we can create a buffer",
"# with the exact amount of entries. api expects array of u16",
"num_devices",
"=",
"api",
".",
"py_aa_find_devices",
"(",
"0",
",",
"array",
".",
"array",
"(",
"'H'... | Return a list of dictionaries. Each dictionary represents one device.
The dictionary contains the following keys: port, unique_id and in_use.
`port` can be used with :func:`open`. `serial_number` is the serial number
of the device (and can also be used with :func:`open`) and `in_use`
indicates whether ... | [
"Return",
"a",
"list",
"of",
"dictionaries",
".",
"Each",
"dictionary",
"represents",
"one",
"device",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L91-L141 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | open | def open(port=None, serial_number=None):
"""Open an aardvark device and return an :class:`Aardvark` object. If the
device cannot be opened an :class:`IOError` is raised.
The `port` can be retrieved by :func:`find_devices`. Usually, the first
device is 0, the second 1, etc.
If you are using only on... | python | def open(port=None, serial_number=None):
"""Open an aardvark device and return an :class:`Aardvark` object. If the
device cannot be opened an :class:`IOError` is raised.
The `port` can be retrieved by :func:`find_devices`. Usually, the first
device is 0, the second 1, etc.
If you are using only on... | [
"def",
"open",
"(",
"port",
"=",
"None",
",",
"serial_number",
"=",
"None",
")",
":",
"if",
"port",
"is",
"None",
"and",
"serial_number",
"is",
"None",
":",
"dev",
"=",
"Aardvark",
"(",
")",
"elif",
"serial_number",
"is",
"not",
"None",
":",
"for",
"... | Open an aardvark device and return an :class:`Aardvark` object. If the
device cannot be opened an :class:`IOError` is raised.
The `port` can be retrieved by :func:`find_devices`. Usually, the first
device is 0, the second 1, etc.
If you are using only one device, you can therefore omit the parameter
... | [
"Open",
"an",
"aardvark",
"device",
"and",
"return",
"an",
":",
"class",
":",
"Aardvark",
"object",
".",
"If",
"the",
"device",
"cannot",
"be",
"opened",
"an",
":",
"class",
":",
"IOError",
"is",
"raised",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L143-L191 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.enable_i2c | def enable_i2c(self):
"""Set this to `True` to enable the hardware I2C interface. If set to
`False` the hardware interface will be disabled and its pins (SDA and
SCL) can be used as GPIOs.
"""
config = self._interface_configuration(CONFIG_QUERY)
return config == CONFIG_GP... | python | def enable_i2c(self):
"""Set this to `True` to enable the hardware I2C interface. If set to
`False` the hardware interface will be disabled and its pins (SDA and
SCL) can be used as GPIOs.
"""
config = self._interface_configuration(CONFIG_QUERY)
return config == CONFIG_GP... | [
"def",
"enable_i2c",
"(",
"self",
")",
":",
"config",
"=",
"self",
".",
"_interface_configuration",
"(",
"CONFIG_QUERY",
")",
"return",
"config",
"==",
"CONFIG_GPIO_I2C",
"or",
"config",
"==",
"CONFIG_SPI_I2C"
] | Set this to `True` to enable the hardware I2C interface. If set to
`False` the hardware interface will be disabled and its pins (SDA and
SCL) can be used as GPIOs. | [
"Set",
"this",
"to",
"True",
"to",
"enable",
"the",
"hardware",
"I2C",
"interface",
".",
"If",
"set",
"to",
"False",
"the",
"hardware",
"interface",
"will",
"be",
"disabled",
"and",
"its",
"pins",
"(",
"SDA",
"and",
"SCL",
")",
"can",
"be",
"used",
"as... | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L280-L286 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.enable_spi | def enable_spi(self):
"""Set this to `True` to enable the hardware SPI interface. If set to
`False` the hardware interface will be disabled and its pins (MISO,
MOSI, SCK and SS) can be used as GPIOs.
"""
config = self._interface_configuration(CONFIG_QUERY)
return config =... | python | def enable_spi(self):
"""Set this to `True` to enable the hardware SPI interface. If set to
`False` the hardware interface will be disabled and its pins (MISO,
MOSI, SCK and SS) can be used as GPIOs.
"""
config = self._interface_configuration(CONFIG_QUERY)
return config =... | [
"def",
"enable_spi",
"(",
"self",
")",
":",
"config",
"=",
"self",
".",
"_interface_configuration",
"(",
"CONFIG_QUERY",
")",
"return",
"config",
"==",
"CONFIG_SPI_GPIO",
"or",
"config",
"==",
"CONFIG_SPI_I2C"
] | Set this to `True` to enable the hardware SPI interface. If set to
`False` the hardware interface will be disabled and its pins (MISO,
MOSI, SCK and SS) can be used as GPIOs. | [
"Set",
"this",
"to",
"True",
"to",
"enable",
"the",
"hardware",
"SPI",
"interface",
".",
"If",
"set",
"to",
"False",
"the",
"hardware",
"interface",
"will",
"be",
"disabled",
"and",
"its",
"pins",
"(",
"MISO",
"MOSI",
"SCK",
"and",
"SS",
")",
"can",
"b... | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L303-L309 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_bitrate | def i2c_bitrate(self):
"""I2C bitrate in kHz. Not every bitrate is supported by the host
adapter. Therefore, the actual bitrate may be less than the value which
is set.
The power-on default value is 100 kHz.
"""
ret = api.py_aa_i2c_bitrate(self.handle, 0)
_raise... | python | def i2c_bitrate(self):
"""I2C bitrate in kHz. Not every bitrate is supported by the host
adapter. Therefore, the actual bitrate may be less than the value which
is set.
The power-on default value is 100 kHz.
"""
ret = api.py_aa_i2c_bitrate(self.handle, 0)
_raise... | [
"def",
"i2c_bitrate",
"(",
"self",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_i2c_bitrate",
"(",
"self",
".",
"handle",
",",
"0",
")",
"_raise_error_if_negative",
"(",
"ret",
")",
"return",
"ret"
] | I2C bitrate in kHz. Not every bitrate is supported by the host
adapter. Therefore, the actual bitrate may be less than the value which
is set.
The power-on default value is 100 kHz. | [
"I2C",
"bitrate",
"in",
"kHz",
".",
"Not",
"every",
"bitrate",
"is",
"supported",
"by",
"the",
"host",
"adapter",
".",
"Therefore",
"the",
"actual",
"bitrate",
"may",
"be",
"less",
"than",
"the",
"value",
"which",
"is",
"set",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L326-L336 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_pullups | def i2c_pullups(self):
"""Setting this to `True` will enable the I2C pullup resistors. If set
to `False` the pullup resistors will be disabled.
Raises an :exc:`IOError` if the hardware adapter does not support
pullup resistors.
"""
ret = api.py_aa_i2c_pullup(self.handle,... | python | def i2c_pullups(self):
"""Setting this to `True` will enable the I2C pullup resistors. If set
to `False` the pullup resistors will be disabled.
Raises an :exc:`IOError` if the hardware adapter does not support
pullup resistors.
"""
ret = api.py_aa_i2c_pullup(self.handle,... | [
"def",
"i2c_pullups",
"(",
"self",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_i2c_pullup",
"(",
"self",
".",
"handle",
",",
"I2C_PULLUP_QUERY",
")",
"_raise_error_if_negative",
"(",
"ret",
")",
"return",
"ret"
] | Setting this to `True` will enable the I2C pullup resistors. If set
to `False` the pullup resistors will be disabled.
Raises an :exc:`IOError` if the hardware adapter does not support
pullup resistors. | [
"Setting",
"this",
"to",
"True",
"will",
"enable",
"the",
"I2C",
"pullup",
"resistors",
".",
"If",
"set",
"to",
"False",
"the",
"pullup",
"resistors",
"will",
"be",
"disabled",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L344-L353 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.target_power | def target_power(self):
"""Setting this to `True` will activate the power pins (4 and 6). If
set to `False` the power will be deactivated.
Raises an :exc:`IOError` if the hardware adapter does not support
the switchable power pins.
"""
ret = api.py_aa_target_power(self.h... | python | def target_power(self):
"""Setting this to `True` will activate the power pins (4 and 6). If
set to `False` the power will be deactivated.
Raises an :exc:`IOError` if the hardware adapter does not support
the switchable power pins.
"""
ret = api.py_aa_target_power(self.h... | [
"def",
"target_power",
"(",
"self",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_target_power",
"(",
"self",
".",
"handle",
",",
"TARGET_POWER_QUERY",
")",
"_raise_error_if_negative",
"(",
"ret",
")",
"return",
"ret"
] | Setting this to `True` will activate the power pins (4 and 6). If
set to `False` the power will be deactivated.
Raises an :exc:`IOError` if the hardware adapter does not support
the switchable power pins. | [
"Setting",
"this",
"to",
"True",
"will",
"activate",
"the",
"power",
"pins",
"(",
"4",
"and",
"6",
")",
".",
"If",
"set",
"to",
"False",
"the",
"power",
"will",
"be",
"deactivated",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L365-L374 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_bus_timeout | def i2c_bus_timeout(self):
"""I2C bus lock timeout in ms.
Minimum value is 10 ms and the maximum value is 450 ms. Not every value
can be set and will be rounded to the next possible number. You can
read back the property to get the actual value.
The power-on default value is 20... | python | def i2c_bus_timeout(self):
"""I2C bus lock timeout in ms.
Minimum value is 10 ms and the maximum value is 450 ms. Not every value
can be set and will be rounded to the next possible number. You can
read back the property to get the actual value.
The power-on default value is 20... | [
"def",
"i2c_bus_timeout",
"(",
"self",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_i2c_bus_timeout",
"(",
"self",
".",
"handle",
",",
"0",
")",
"_raise_error_if_negative",
"(",
"ret",
")",
"return",
"ret"
] | I2C bus lock timeout in ms.
Minimum value is 10 ms and the maximum value is 450 ms. Not every value
can be set and will be rounded to the next possible number. You can
read back the property to get the actual value.
The power-on default value is 200 ms. | [
"I2C",
"bus",
"lock",
"timeout",
"in",
"ms",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L386-L397 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_master_write | def i2c_master_write(self, i2c_address, data, flags=I2C_NO_FLAGS):
"""Make an I2C write access.
The given I2C device is addressed and data given as a string is
written. The transaction is finished with an I2C stop condition unless
I2C_NO_STOP is set in the flags.
10 bit address... | python | def i2c_master_write(self, i2c_address, data, flags=I2C_NO_FLAGS):
"""Make an I2C write access.
The given I2C device is addressed and data given as a string is
written. The transaction is finished with an I2C stop condition unless
I2C_NO_STOP is set in the flags.
10 bit address... | [
"def",
"i2c_master_write",
"(",
"self",
",",
"i2c_address",
",",
"data",
",",
"flags",
"=",
"I2C_NO_FLAGS",
")",
":",
"data",
"=",
"array",
".",
"array",
"(",
"'B'",
",",
"data",
")",
"status",
",",
"_",
"=",
"api",
".",
"py_aa_i2c_write_ext",
"(",
"se... | Make an I2C write access.
The given I2C device is addressed and data given as a string is
written. The transaction is finished with an I2C stop condition unless
I2C_NO_STOP is set in the flags.
10 bit addresses are supported if the I2C_10_BIT_ADDR flag is set. | [
"Make",
"an",
"I2C",
"write",
"access",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L404-L417 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_master_read | def i2c_master_read(self, addr, length, flags=I2C_NO_FLAGS):
"""Make an I2C read access.
The given I2C device is addressed and clock cycles for `length` bytes
are generated. A short read will occur if the device generates an early
NAK.
The transaction is finished with an I2C st... | python | def i2c_master_read(self, addr, length, flags=I2C_NO_FLAGS):
"""Make an I2C read access.
The given I2C device is addressed and clock cycles for `length` bytes
are generated. A short read will occur if the device generates an early
NAK.
The transaction is finished with an I2C st... | [
"def",
"i2c_master_read",
"(",
"self",
",",
"addr",
",",
"length",
",",
"flags",
"=",
"I2C_NO_FLAGS",
")",
":",
"data",
"=",
"array",
".",
"array",
"(",
"'B'",
",",
"(",
"0",
",",
")",
"*",
"length",
")",
"status",
",",
"rx_len",
"=",
"api",
".",
... | Make an I2C read access.
The given I2C device is addressed and clock cycles for `length` bytes
are generated. A short read will occur if the device generates an early
NAK.
The transaction is finished with an I2C stop condition unless the
I2C_NO_STOP flag is set. | [
"Make",
"an",
"I2C",
"read",
"access",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L419-L435 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_master_write_read | def i2c_master_write_read(self, i2c_address, data, length):
"""Make an I2C write/read access.
First an I2C write access is issued. No stop condition will be
generated. Instead the read access begins with a repeated start.
This method is useful for accessing most addressable I2C devices... | python | def i2c_master_write_read(self, i2c_address, data, length):
"""Make an I2C write/read access.
First an I2C write access is issued. No stop condition will be
generated. Instead the read access begins with a repeated start.
This method is useful for accessing most addressable I2C devices... | [
"def",
"i2c_master_write_read",
"(",
"self",
",",
"i2c_address",
",",
"data",
",",
"length",
")",
":",
"self",
".",
"i2c_master_write",
"(",
"i2c_address",
",",
"data",
",",
"I2C_NO_STOP",
")",
"return",
"self",
".",
"i2c_master_read",
"(",
"i2c_address",
",",... | Make an I2C write/read access.
First an I2C write access is issued. No stop condition will be
generated. Instead the read access begins with a repeated start.
This method is useful for accessing most addressable I2C devices like
EEPROMs, port expander, etc.
Basically, this is ... | [
"Make",
"an",
"I2C",
"write",
"/",
"read",
"access",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L437-L451 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.poll | def poll(self, timeout=None):
"""Wait for an event to occur.
If `timeout` is given, if specifies the length of time in milliseconds
which the function will wait for events before returing. If `timeout`
is omitted, negative or None, the call will block until there is an
event.
... | python | def poll(self, timeout=None):
"""Wait for an event to occur.
If `timeout` is given, if specifies the length of time in milliseconds
which the function will wait for events before returing. If `timeout`
is omitted, negative or None, the call will block until there is an
event.
... | [
"def",
"poll",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"if",
"timeout",
"is",
"None",
":",
"timeout",
"=",
"-",
"1",
"ret",
"=",
"api",
".",
"py_aa_async_poll",
"(",
"self",
".",
"handle",
",",
"timeout",
")",
"_raise_error_if_negative",
"(... | Wait for an event to occur.
If `timeout` is given, if specifies the length of time in milliseconds
which the function will wait for events before returing. If `timeout`
is omitted, negative or None, the call will block until there is an
event.
Returns a list of events. In case ... | [
"Wait",
"for",
"an",
"event",
"to",
"occur",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L453-L475 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.enable_i2c_slave | def enable_i2c_slave(self, slave_address):
"""Enable I2C slave mode.
The device will respond to the specified slave_address if it is
addressed.
You can wait for the data with :func:`poll` and get it with
`i2c_slave_read`.
"""
ret = api.py_aa_i2c_slave_enable(sel... | python | def enable_i2c_slave(self, slave_address):
"""Enable I2C slave mode.
The device will respond to the specified slave_address if it is
addressed.
You can wait for the data with :func:`poll` and get it with
`i2c_slave_read`.
"""
ret = api.py_aa_i2c_slave_enable(sel... | [
"def",
"enable_i2c_slave",
"(",
"self",
",",
"slave_address",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_i2c_slave_enable",
"(",
"self",
".",
"handle",
",",
"slave_address",
",",
"self",
".",
"BUFFER_SIZE",
",",
"self",
".",
"BUFFER_SIZE",
")",
"_raise_error_if_... | Enable I2C slave mode.
The device will respond to the specified slave_address if it is
addressed.
You can wait for the data with :func:`poll` and get it with
`i2c_slave_read`. | [
"Enable",
"I2C",
"slave",
"mode",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L477-L488 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_slave_read | def i2c_slave_read(self):
"""Read the bytes from an I2C slave reception.
The bytes are returned as a string object.
"""
data = array.array('B', (0,) * self.BUFFER_SIZE)
status, addr, rx_len = api.py_aa_i2c_slave_read_ext(self.handle,
self.BUFFER_SIZE, data)
... | python | def i2c_slave_read(self):
"""Read the bytes from an I2C slave reception.
The bytes are returned as a string object.
"""
data = array.array('B', (0,) * self.BUFFER_SIZE)
status, addr, rx_len = api.py_aa_i2c_slave_read_ext(self.handle,
self.BUFFER_SIZE, data)
... | [
"def",
"i2c_slave_read",
"(",
"self",
")",
":",
"data",
"=",
"array",
".",
"array",
"(",
"'B'",
",",
"(",
"0",
",",
")",
"*",
"self",
".",
"BUFFER_SIZE",
")",
"status",
",",
"addr",
",",
"rx_len",
"=",
"api",
".",
"py_aa_i2c_slave_read_ext",
"(",
"se... | Read the bytes from an I2C slave reception.
The bytes are returned as a string object. | [
"Read",
"the",
"bytes",
"from",
"an",
"I2C",
"slave",
"reception",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L495-L509 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_slave_last_transmit_size | def i2c_slave_last_transmit_size(self):
"""Returns the number of bytes transmitted by the slave."""
ret = api.py_aa_i2c_slave_write_stats(self.handle)
_raise_error_if_negative(ret)
return ret | python | def i2c_slave_last_transmit_size(self):
"""Returns the number of bytes transmitted by the slave."""
ret = api.py_aa_i2c_slave_write_stats(self.handle)
_raise_error_if_negative(ret)
return ret | [
"def",
"i2c_slave_last_transmit_size",
"(",
"self",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_i2c_slave_write_stats",
"(",
"self",
".",
"handle",
")",
"_raise_error_if_negative",
"(",
"ret",
")",
"return",
"ret"
] | Returns the number of bytes transmitted by the slave. | [
"Returns",
"the",
"number",
"of",
"bytes",
"transmitted",
"by",
"the",
"slave",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L533-L537 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.i2c_monitor_read | def i2c_monitor_read(self):
"""Retrieved any data fetched by the monitor.
This function has an integrated timeout mechanism. You should use
:func:`poll` to determine if there is any data available.
Returns a list of data bytes and special symbols. There are three
special symbol... | python | def i2c_monitor_read(self):
"""Retrieved any data fetched by the monitor.
This function has an integrated timeout mechanism. You should use
:func:`poll` to determine if there is any data available.
Returns a list of data bytes and special symbols. There are three
special symbol... | [
"def",
"i2c_monitor_read",
"(",
"self",
")",
":",
"data",
"=",
"array",
".",
"array",
"(",
"'H'",
",",
"(",
"0",
",",
")",
"*",
"self",
".",
"BUFFER_SIZE",
")",
"ret",
"=",
"api",
".",
"py_aa_i2c_monitor_read",
"(",
"self",
".",
"handle",
",",
"self"... | Retrieved any data fetched by the monitor.
This function has an integrated timeout mechanism. You should use
:func:`poll` to determine if there is any data available.
Returns a list of data bytes and special symbols. There are three
special symbols: `I2C_MONITOR_NACK`, I2C_MONITOR_STAR... | [
"Retrieved",
"any",
"data",
"fetched",
"by",
"the",
"monitor",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L559-L575 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.spi_bitrate | def spi_bitrate(self):
"""SPI bitrate in kHz. Not every bitrate is supported by the host
adapter. Therefore, the actual bitrate may be less than the value which
is set. The slowest bitrate supported is 125kHz. Any smaller value will
be rounded up to 125kHz.
The power-on default ... | python | def spi_bitrate(self):
"""SPI bitrate in kHz. Not every bitrate is supported by the host
adapter. Therefore, the actual bitrate may be less than the value which
is set. The slowest bitrate supported is 125kHz. Any smaller value will
be rounded up to 125kHz.
The power-on default ... | [
"def",
"spi_bitrate",
"(",
"self",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_spi_bitrate",
"(",
"self",
".",
"handle",
",",
"0",
")",
"_raise_error_if_negative",
"(",
"ret",
")",
"return",
"ret"
] | SPI bitrate in kHz. Not every bitrate is supported by the host
adapter. Therefore, the actual bitrate may be less than the value which
is set. The slowest bitrate supported is 125kHz. Any smaller value will
be rounded up to 125kHz.
The power-on default value is 1000 kHz. | [
"SPI",
"bitrate",
"in",
"kHz",
".",
"Not",
"every",
"bitrate",
"is",
"supported",
"by",
"the",
"host",
"adapter",
".",
"Therefore",
"the",
"actual",
"bitrate",
"may",
"be",
"less",
"than",
"the",
"value",
"which",
"is",
"set",
".",
"The",
"slowest",
"bit... | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L578-L588 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.spi_configure | def spi_configure(self, polarity, phase, bitorder):
"""Configure the SPI interface."""
ret = api.py_aa_spi_configure(self.handle, polarity, phase, bitorder)
_raise_error_if_negative(ret) | python | def spi_configure(self, polarity, phase, bitorder):
"""Configure the SPI interface."""
ret = api.py_aa_spi_configure(self.handle, polarity, phase, bitorder)
_raise_error_if_negative(ret) | [
"def",
"spi_configure",
"(",
"self",
",",
"polarity",
",",
"phase",
",",
"bitorder",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_spi_configure",
"(",
"self",
".",
"handle",
",",
"polarity",
",",
"phase",
",",
"bitorder",
")",
"_raise_error_if_negative",
"(",
... | Configure the SPI interface. | [
"Configure",
"the",
"SPI",
"interface",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L595-L598 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.spi_configure_mode | def spi_configure_mode(self, spi_mode):
"""Configure the SPI interface by the well known SPI modes."""
if spi_mode == SPI_MODE_0:
self.spi_configure(SPI_POL_RISING_FALLING,
SPI_PHASE_SAMPLE_SETUP, SPI_BITORDER_MSB)
elif spi_mode == SPI_MODE_3:
self.spi... | python | def spi_configure_mode(self, spi_mode):
"""Configure the SPI interface by the well known SPI modes."""
if spi_mode == SPI_MODE_0:
self.spi_configure(SPI_POL_RISING_FALLING,
SPI_PHASE_SAMPLE_SETUP, SPI_BITORDER_MSB)
elif spi_mode == SPI_MODE_3:
self.spi... | [
"def",
"spi_configure_mode",
"(",
"self",
",",
"spi_mode",
")",
":",
"if",
"spi_mode",
"==",
"SPI_MODE_0",
":",
"self",
".",
"spi_configure",
"(",
"SPI_POL_RISING_FALLING",
",",
"SPI_PHASE_SAMPLE_SETUP",
",",
"SPI_BITORDER_MSB",
")",
"elif",
"spi_mode",
"==",
"SPI... | Configure the SPI interface by the well known SPI modes. | [
"Configure",
"the",
"SPI",
"interface",
"by",
"the",
"well",
"known",
"SPI",
"modes",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L600-L609 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.spi_write | def spi_write(self, data):
"""Write a stream of bytes to a SPI device."""
data_out = array.array('B', data)
data_in = array.array('B', (0,) * len(data_out))
ret = api.py_aa_spi_write(self.handle, len(data_out), data_out,
len(data_in), data_in)
_raise_error_if_nega... | python | def spi_write(self, data):
"""Write a stream of bytes to a SPI device."""
data_out = array.array('B', data)
data_in = array.array('B', (0,) * len(data_out))
ret = api.py_aa_spi_write(self.handle, len(data_out), data_out,
len(data_in), data_in)
_raise_error_if_nega... | [
"def",
"spi_write",
"(",
"self",
",",
"data",
")",
":",
"data_out",
"=",
"array",
".",
"array",
"(",
"'B'",
",",
"data",
")",
"data_in",
"=",
"array",
".",
"array",
"(",
"'B'",
",",
"(",
"0",
",",
")",
"*",
"len",
"(",
"data_out",
")",
")",
"re... | Write a stream of bytes to a SPI device. | [
"Write",
"a",
"stream",
"of",
"bytes",
"to",
"a",
"SPI",
"device",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L611-L618 | train |
kontron/python-aardvark | pyaardvark/aardvark.py | Aardvark.spi_ss_polarity | def spi_ss_polarity(self, polarity):
"""Change the ouput polarity on the SS line.
Please note, that this only affects the master functions.
"""
ret = api.py_aa_spi_master_ss_polarity(self.handle, polarity)
_raise_error_if_negative(ret) | python | def spi_ss_polarity(self, polarity):
"""Change the ouput polarity on the SS line.
Please note, that this only affects the master functions.
"""
ret = api.py_aa_spi_master_ss_polarity(self.handle, polarity)
_raise_error_if_negative(ret) | [
"def",
"spi_ss_polarity",
"(",
"self",
",",
"polarity",
")",
":",
"ret",
"=",
"api",
".",
"py_aa_spi_master_ss_polarity",
"(",
"self",
".",
"handle",
",",
"polarity",
")",
"_raise_error_if_negative",
"(",
"ret",
")"
] | Change the ouput polarity on the SS line.
Please note, that this only affects the master functions. | [
"Change",
"the",
"ouput",
"polarity",
"on",
"the",
"SS",
"line",
"."
] | 9827f669fbdc5bceb98e7d08a294b4e4e455d0d5 | https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L620-L626 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/admin.py | OAISetModelView.edit_form | def edit_form(self, obj):
"""Customize edit form."""
form = super(OAISetModelView, self).edit_form(obj)
del form.spec
return form | python | def edit_form(self, obj):
"""Customize edit form."""
form = super(OAISetModelView, self).edit_form(obj)
del form.spec
return form | [
"def",
"edit_form",
"(",
"self",
",",
"obj",
")",
":",
"form",
"=",
"super",
"(",
"OAISetModelView",
",",
"self",
")",
".",
"edit_form",
"(",
"obj",
")",
"del",
"form",
".",
"spec",
"return",
"form"
] | Customize edit form. | [
"Customize",
"edit",
"form",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/admin.py#L36-L40 | train |
sailthru/sailthru-python-client | sailthru/sailthru_http.py | flatten_nested_hash | def flatten_nested_hash(hash_table):
"""
Flatten nested dictionary for GET / POST / DELETE API request
"""
def flatten(hash_table, brackets=True):
f = {}
for key, value in hash_table.items():
_key = '[' + str(key) + ']' if brackets else str(key)
if isinstance(valu... | python | def flatten_nested_hash(hash_table):
"""
Flatten nested dictionary for GET / POST / DELETE API request
"""
def flatten(hash_table, brackets=True):
f = {}
for key, value in hash_table.items():
_key = '[' + str(key) + ']' if brackets else str(key)
if isinstance(valu... | [
"def",
"flatten_nested_hash",
"(",
"hash_table",
")",
":",
"def",
"flatten",
"(",
"hash_table",
",",
"brackets",
"=",
"True",
")",
":",
"f",
"=",
"{",
"}",
"for",
"key",
",",
"value",
"in",
"hash_table",
".",
"items",
"(",
")",
":",
"_key",
"=",
"'['... | Flatten nested dictionary for GET / POST / DELETE API request | [
"Flatten",
"nested",
"dictionary",
"for",
"GET",
"/",
"POST",
"/",
"DELETE",
"API",
"request"
] | 22aa39ba0c5bddd7b8743e24ada331128c0f4f54 | https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_http.py#L8-L28 | train |
sailthru/sailthru-python-client | sailthru/sailthru_http.py | sailthru_http_request | def sailthru_http_request(url, data, method, file_data=None, headers=None, request_timeout=10):
"""
Perform an HTTP GET / POST / DELETE request
"""
data = flatten_nested_hash(data)
method = method.upper()
params, data = (None, data) if method == 'POST' else (data, None)
sailthru_headers = {'... | python | def sailthru_http_request(url, data, method, file_data=None, headers=None, request_timeout=10):
"""
Perform an HTTP GET / POST / DELETE request
"""
data = flatten_nested_hash(data)
method = method.upper()
params, data = (None, data) if method == 'POST' else (data, None)
sailthru_headers = {'... | [
"def",
"sailthru_http_request",
"(",
"url",
",",
"data",
",",
"method",
",",
"file_data",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"request_timeout",
"=",
"10",
")",
":",
"data",
"=",
"flatten_nested_hash",
"(",
"data",
")",
"method",
"=",
"method",
... | Perform an HTTP GET / POST / DELETE request | [
"Perform",
"an",
"HTTP",
"GET",
"/",
"POST",
"/",
"DELETE",
"request"
] | 22aa39ba0c5bddd7b8743e24ada331128c0f4f54 | https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_http.py#L30-L49 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/resumption_token.py | _schema_from_verb | def _schema_from_verb(verb, partial=False):
"""Return an instance of schema for given verb."""
from .verbs import Verbs
return getattr(Verbs, verb)(partial=partial) | python | def _schema_from_verb(verb, partial=False):
"""Return an instance of schema for given verb."""
from .verbs import Verbs
return getattr(Verbs, verb)(partial=partial) | [
"def",
"_schema_from_verb",
"(",
"verb",
",",
"partial",
"=",
"False",
")",
":",
"from",
".",
"verbs",
"import",
"Verbs",
"return",
"getattr",
"(",
"Verbs",
",",
"verb",
")",
"(",
"partial",
"=",
"partial",
")"
] | Return an instance of schema for given verb. | [
"Return",
"an",
"instance",
"of",
"schema",
"for",
"given",
"verb",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L18-L21 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/resumption_token.py | serialize | def serialize(pagination, **kwargs):
"""Return resumption token serializer."""
if not pagination.has_next:
return
token_builder = URLSafeTimedSerializer(
current_app.config['SECRET_KEY'],
salt=kwargs['verb'],
)
schema = _schema_from_verb(kwargs['verb'], partial=False)
da... | python | def serialize(pagination, **kwargs):
"""Return resumption token serializer."""
if not pagination.has_next:
return
token_builder = URLSafeTimedSerializer(
current_app.config['SECRET_KEY'],
salt=kwargs['verb'],
)
schema = _schema_from_verb(kwargs['verb'], partial=False)
da... | [
"def",
"serialize",
"(",
"pagination",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"pagination",
".",
"has_next",
":",
"return",
"token_builder",
"=",
"URLSafeTimedSerializer",
"(",
"current_app",
".",
"config",
"[",
"'SECRET_KEY'",
"]",
",",
"salt",
"="... | Return resumption token serializer. | [
"Return",
"resumption",
"token",
"serializer",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L24-L40 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/resumption_token.py | ResumptionToken._deserialize | def _deserialize(self, value, attr, data):
"""Serialize resumption token."""
token_builder = URLSafeTimedSerializer(
current_app.config['SECRET_KEY'],
salt=data['verb'],
)
result = token_builder.loads(value, max_age=current_app.config[
'OAISERVER_RESUM... | python | def _deserialize(self, value, attr, data):
"""Serialize resumption token."""
token_builder = URLSafeTimedSerializer(
current_app.config['SECRET_KEY'],
salt=data['verb'],
)
result = token_builder.loads(value, max_age=current_app.config[
'OAISERVER_RESUM... | [
"def",
"_deserialize",
"(",
"self",
",",
"value",
",",
"attr",
",",
"data",
")",
":",
"token_builder",
"=",
"URLSafeTimedSerializer",
"(",
"current_app",
".",
"config",
"[",
"'SECRET_KEY'",
"]",
",",
"salt",
"=",
"data",
"[",
"'verb'",
"]",
",",
")",
"re... | Serialize resumption token. | [
"Serialize",
"resumption",
"token",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L46-L56 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/resumption_token.py | ResumptionTokenSchema.load | def load(self, data, many=None, partial=None):
"""Deserialize a data structure to an object."""
result = super(ResumptionTokenSchema, self).load(
data, many=many, partial=partial
)
result.data.update(
result.data.get('resumptionToken', {}).get('kwargs', {})
... | python | def load(self, data, many=None, partial=None):
"""Deserialize a data structure to an object."""
result = super(ResumptionTokenSchema, self).load(
data, many=many, partial=partial
)
result.data.update(
result.data.get('resumptionToken', {}).get('kwargs', {})
... | [
"def",
"load",
"(",
"self",
",",
"data",
",",
"many",
"=",
"None",
",",
"partial",
"=",
"None",
")",
":",
"result",
"=",
"super",
"(",
"ResumptionTokenSchema",
",",
"self",
")",
".",
"load",
"(",
"data",
",",
"many",
"=",
"many",
",",
"partial",
"=... | Deserialize a data structure to an object. | [
"Deserialize",
"a",
"data",
"structure",
"to",
"an",
"object",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L64-L72 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/verbs.py | make_request_validator | def make_request_validator(request):
"""Validate arguments in incomming request."""
verb = request.values.get('verb', '', type=str)
resumption_token = request.values.get('resumptionToken', None)
schema = Verbs if resumption_token is None else ResumptionVerbs
return getattr(schema, verb, OAISchema)(... | python | def make_request_validator(request):
"""Validate arguments in incomming request."""
verb = request.values.get('verb', '', type=str)
resumption_token = request.values.get('resumptionToken', None)
schema = Verbs if resumption_token is None else ResumptionVerbs
return getattr(schema, verb, OAISchema)(... | [
"def",
"make_request_validator",
"(",
"request",
")",
":",
"verb",
"=",
"request",
".",
"values",
".",
"get",
"(",
"'verb'",
",",
"''",
",",
"type",
"=",
"str",
")",
"resumption_token",
"=",
"request",
".",
"values",
".",
"get",
"(",
"'resumptionToken'",
... | Validate arguments in incomming request. | [
"Validate",
"arguments",
"in",
"incomming",
"request",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/verbs.py#L152-L158 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/verbs.py | DateTime.from_iso_permissive | def from_iso_permissive(datestring, use_dateutil=True):
"""Parse an ISO8601-formatted datetime and return a datetime object.
Inspired by the marshmallow.utils.from_iso function, but also accepts
datestrings that don't contain the time.
"""
dateutil_available = False
try:... | python | def from_iso_permissive(datestring, use_dateutil=True):
"""Parse an ISO8601-formatted datetime and return a datetime object.
Inspired by the marshmallow.utils.from_iso function, but also accepts
datestrings that don't contain the time.
"""
dateutil_available = False
try:... | [
"def",
"from_iso_permissive",
"(",
"datestring",
",",
"use_dateutil",
"=",
"True",
")",
":",
"dateutil_available",
"=",
"False",
"try",
":",
"from",
"dateutil",
"import",
"parser",
"dateutil_available",
"=",
"True",
"except",
"ImportError",
":",
"dateutil_available"... | Parse an ISO8601-formatted datetime and return a datetime object.
Inspired by the marshmallow.utils.from_iso function, but also accepts
datestrings that don't contain the time. | [
"Parse",
"an",
"ISO8601",
"-",
"formatted",
"datetime",
"and",
"return",
"a",
"datetime",
"object",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/verbs.py#L36-L56 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/verbs.py | OAISchema.validate | def validate(self, data):
"""Check range between dates under keys ``from_`` and ``until``."""
if 'verb' in data and data['verb'] != self.__class__.__name__:
raise ValidationError(
# FIXME encode data
'This is not a valid OAI-PMH verb:{0}'.format(data['verb']),... | python | def validate(self, data):
"""Check range between dates under keys ``from_`` and ``until``."""
if 'verb' in data and data['verb'] != self.__class__.__name__:
raise ValidationError(
# FIXME encode data
'This is not a valid OAI-PMH verb:{0}'.format(data['verb']),... | [
"def",
"validate",
"(",
"self",
",",
"data",
")",
":",
"if",
"'verb'",
"in",
"data",
"and",
"data",
"[",
"'verb'",
"]",
"!=",
"self",
".",
"__class__",
".",
"__name__",
":",
"raise",
"ValidationError",
"(",
"# FIXME encode data",
"'This is not a valid OAI-PMH ... | Check range between dates under keys ``from_`` and ``until``. | [
"Check",
"range",
"between",
"dates",
"under",
"keys",
"from_",
"and",
"until",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/verbs.py#L75-L92 | train |
inveniosoftware/invenio-oaiserver | invenio_oaiserver/alembic/e655021de0de_create_oiaserver_tables.py | upgrade | def upgrade():
"""Upgrade database."""
op.create_table(
'oaiserver_set',
sa.Column('created', sa.DateTime(), nullable=False),
sa.Column('updated', sa.DateTime(), nullable=False),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('spec', sa.String(length=255), nulla... | python | def upgrade():
"""Upgrade database."""
op.create_table(
'oaiserver_set',
sa.Column('created', sa.DateTime(), nullable=False),
sa.Column('updated', sa.DateTime(), nullable=False),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('spec', sa.String(length=255), nulla... | [
"def",
"upgrade",
"(",
")",
":",
"op",
".",
"create_table",
"(",
"'oaiserver_set'",
",",
"sa",
".",
"Column",
"(",
"'created'",
",",
"sa",
".",
"DateTime",
"(",
")",
",",
"nullable",
"=",
"False",
")",
",",
"sa",
".",
"Column",
"(",
"'updated'",
",",... | Upgrade database. | [
"Upgrade",
"database",
"."
] | eae765e32bd816ddc5612d4b281caf205518b512 | https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/alembic/e655021de0de_create_oiaserver_tables.py#L21-L40 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.