repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
dmwm/DBS
Server/Python/src/dbs/business/DBSDataTier.py
DBSDataTier.listDataTiers
def listDataTiers(self, data_tier_name=""): """ List data tier(s) """ if not isinstance(data_tier_name, basestring) : dbsExceptionHandler('dbsException-invalid-input', 'data_tier_name given is not valid : %s' % data_tier_name) else: ...
python
def listDataTiers(self, data_tier_name=""): """ List data tier(s) """ if not isinstance(data_tier_name, basestring) : dbsExceptionHandler('dbsException-invalid-input', 'data_tier_name given is not valid : %s' % data_tier_name) else: ...
[ "def", "listDataTiers", "(", "self", ",", "data_tier_name", "=", "\"\"", ")", ":", "if", "not", "isinstance", "(", "data_tier_name", ",", "basestring", ")", ":", "dbsExceptionHandler", "(", "'dbsException-invalid-input'", ",", "'data_tier_name given is not valid : %s'",...
List data tier(s)
[ "List", "data", "tier", "(", "s", ")" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataTier.py#L25-L44
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/Site/List.py
List.execute
def execute(self, conn, site_name= "", transaction = False): """ Lists all sites types if site_name is not provided. """ sql = self.sql if site_name == "": result = self.dbi.processData(sql, conn=conn, transaction=transaction) else: sql += "WHERE S...
python
def execute(self, conn, site_name= "", transaction = False): """ Lists all sites types if site_name is not provided. """ sql = self.sql if site_name == "": result = self.dbi.processData(sql, conn=conn, transaction=transaction) else: sql += "WHERE S...
[ "def", "execute", "(", "self", ",", "conn", ",", "site_name", "=", "\"\"", ",", "transaction", "=", "False", ")", ":", "sql", "=", "self", ".", "sql", "if", "site_name", "==", "\"\"", ":", "result", "=", "self", ".", "dbi", ".", "processData", "(", ...
Lists all sites types if site_name is not provided.
[ "Lists", "all", "sites", "types", "if", "site_name", "is", "not", "provided", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/Site/List.py#L24-L35
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/FileBuffer/DeleteFiles.py
DeleteFiles.execute
def execute(self, conn, logical_file_name={}, transaction=False): """ simple execute """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/DeleteFiles. Expects db connection from upper layer.") self.dbi.processData(self.sql, logical_file_name, conn...
python
def execute(self, conn, logical_file_name={}, transaction=False): """ simple execute """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/DeleteFiles. Expects db connection from upper layer.") self.dbi.processData(self.sql, logical_file_name, conn...
[ "def", "execute", "(", "self", ",", "conn", ",", "logical_file_name", "=", "{", "}", ",", "transaction", "=", "False", ")", ":", "if", "not", "conn", ":", "dbsExceptionHandler", "(", "\"dbsException-db-conn-failed\"", ",", "\"Oracle/FileBuffer/DeleteFiles. Expects d...
simple execute
[ "simple", "execute" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileBuffer/DeleteFiles.py#L20-L27
dmwm/DBS
Server/Python/src/dbs/business/DBSDataType.py
DBSDataType.listDataType
def listDataType(self, dataType="", dataset=""): """ List data-type/primary-ds-type """ conn = self.dbi.connection() try: if dataset and dataType: dbsExceptionHandler('dbsException-invalid-input', "DBSDataType/listDataType. Data Ty...
python
def listDataType(self, dataType="", dataset=""): """ List data-type/primary-ds-type """ conn = self.dbi.connection() try: if dataset and dataType: dbsExceptionHandler('dbsException-invalid-input', "DBSDataType/listDataType. Data Ty...
[ "def", "listDataType", "(", "self", ",", "dataType", "=", "\"\"", ",", "dataset", "=", "\"\"", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "try", ":", "if", "dataset", "and", "dataType", ":", "dbsExceptionHandler", "(", "'db...
List data-type/primary-ds-type
[ "List", "data", "-", "type", "/", "primary", "-", "ds", "-", "type" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataType.py#L22-L36
dmwm/DBS
Server/Python/src/dbs/business/DBSFileBuffer.py
DBSFileBuffer.getBlocks
def getBlocks(self): """ Get the blocks that need to be migrated """ try: conn = self.dbi.connection() result = self.buflistblks.execute(conn) return result finally: if conn: conn.close()
python
def getBlocks(self): """ Get the blocks that need to be migrated """ try: conn = self.dbi.connection() result = self.buflistblks.execute(conn) return result finally: if conn: conn.close()
[ "def", "getBlocks", "(", "self", ")", ":", "try", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "result", "=", "self", ".", "buflistblks", ".", "execute", "(", "conn", ")", "return", "result", "finally", ":", "if", "conn", ":", ...
Get the blocks that need to be migrated
[ "Get", "the", "blocks", "that", "need", "to", "be", "migrated" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFileBuffer.py#L35-L45
dmwm/DBS
Server/Python/src/dbs/business/DBSFileBuffer.py
DBSFileBuffer.getBufferedFiles
def getBufferedFiles(self, block_id): """ Get some files from the insert buffer """ try: conn = self.dbi.connection() result = self.buflist.execute(conn, block_id) return result finally: if conn: conn.cl...
python
def getBufferedFiles(self, block_id): """ Get some files from the insert buffer """ try: conn = self.dbi.connection() result = self.buflist.execute(conn, block_id) return result finally: if conn: conn.cl...
[ "def", "getBufferedFiles", "(", "self", ",", "block_id", ")", ":", "try", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "result", "=", "self", ".", "buflist", ".", "execute", "(", "conn", ",", "block_id", ")", "return", "result", ...
Get some files from the insert buffer
[ "Get", "some", "files", "from", "the", "insert", "buffer" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFileBuffer.py#L47-L58
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/DataTier/List.py
List.execute
def execute(self, conn, data_tier_name='', transaction = False, cache=None): """ returns id for a given datatier name """ if cache: ret=cache.get("DATA_TIERS") if not ret==None: return ret sql = self.sql binds={} if data_tier_name: o...
python
def execute(self, conn, data_tier_name='', transaction = False, cache=None): """ returns id for a given datatier name """ if cache: ret=cache.get("DATA_TIERS") if not ret==None: return ret sql = self.sql binds={} if data_tier_name: o...
[ "def", "execute", "(", "self", ",", "conn", ",", "data_tier_name", "=", "''", ",", "transaction", "=", "False", ",", "cache", "=", "None", ")", ":", "if", "cache", ":", "ret", "=", "cache", ".", "get", "(", "\"DATA_TIERS\"", ")", "if", "not", "ret", ...
returns id for a given datatier name
[ "returns", "id", "for", "a", "given", "datatier", "name" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/DataTier/List.py#L27-L43
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/MigrationRequests/ListOldest.py
ListOldest.execute
def execute(self, conn, migration_url="", migration_input="", create_by="", migration_request_id="", transaction=False): """ Lists the oldest request queued """ binds = {} result = self.dbi.processData(self.sql, binds, conn, transaction) result = self.formatDict(result) if len...
python
def execute(self, conn, migration_url="", migration_input="", create_by="", migration_request_id="", transaction=False): """ Lists the oldest request queued """ binds = {} result = self.dbi.processData(self.sql, binds, conn, transaction) result = self.formatDict(result) if len...
[ "def", "execute", "(", "self", ",", "conn", ",", "migration_url", "=", "\"\"", ",", "migration_input", "=", "\"\"", ",", "create_by", "=", "\"\"", ",", "migration_request_id", "=", "\"\"", ",", "transaction", "=", "False", ")", ":", "binds", "=", "{", "}...
Lists the oldest request queued
[ "Lists", "the", "oldest", "request", "queued" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/MigrationRequests/ListOldest.py#L21-L32
dmwm/DBS
Server/Python/src/dbs/business/DBSProcessingEra.py
DBSProcessingEra.listProcessingEras
def listProcessingEras(self, processing_version=''): """ Returns all processing eras in dbs """ conn = self.dbi.connection() try: result = self.pelst.execute(conn, processing_version) return result finally: if conn: conn...
python
def listProcessingEras(self, processing_version=''): """ Returns all processing eras in dbs """ conn = self.dbi.connection() try: result = self.pelst.execute(conn, processing_version) return result finally: if conn: conn...
[ "def", "listProcessingEras", "(", "self", ",", "processing_version", "=", "''", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "try", ":", "result", "=", "self", ".", "pelst", ".", "execute", "(", "conn", ",", "processing_version...
Returns all processing eras in dbs
[ "Returns", "all", "processing", "eras", "in", "dbs" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSProcessingEra.py#L25-L35
dmwm/DBS
Server/Python/src/dbs/business/DBSProcessingEra.py
DBSProcessingEra.insertProcessingEra
def insertProcessingEra(self, businput): """ Input dictionary has to have the following keys: processing_version, creation_date, create_by, description it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = con...
python
def insertProcessingEra(self, businput): """ Input dictionary has to have the following keys: processing_version, creation_date, create_by, description it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = con...
[ "def", "insertProcessingEra", "(", "self", ",", "businput", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "tran", "=", "conn", ".", "begin", "(", ")", "try", ":", "businput", "[", "\"processing_era_id\"", "]", "=", "self", "."...
Input dictionary has to have the following keys: processing_version, creation_date, create_by, description it builds the correct dictionary for dao input and executes the dao
[ "Input", "dictionary", "has", "to", "have", "the", "following", "keys", ":", "processing_version", "creation_date", "create_by", "description", "it", "builds", "the", "correct", "dictionary", "for", "dao", "input", "and", "executes", "the", "dao" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSProcessingEra.py#L37-L70
dmwm/DBS
Server/Python/src/dbs/business/DBSPhysicsGroup.py
DBSPhysicsGroup.listPhysicsGroups
def listPhysicsGroups(self, physics_group_name=""): """ Returns all physics groups if physics group names are not passed. """ if not isinstance(physics_group_name, basestring): dbsExceptionHandler('dbsException-invalid-input', 'physics group name given is not ...
python
def listPhysicsGroups(self, physics_group_name=""): """ Returns all physics groups if physics group names are not passed. """ if not isinstance(physics_group_name, basestring): dbsExceptionHandler('dbsException-invalid-input', 'physics group name given is not ...
[ "def", "listPhysicsGroups", "(", "self", ",", "physics_group_name", "=", "\"\"", ")", ":", "if", "not", "isinstance", "(", "physics_group_name", ",", "basestring", ")", ":", "dbsExceptionHandler", "(", "'dbsException-invalid-input'", ",", "'physics group name given is n...
Returns all physics groups if physics group names are not passed.
[ "Returns", "all", "physics", "groups", "if", "physics", "group", "names", "are", "not", "passed", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPhysicsGroup.py#L23-L45
dmwm/DBS
Server/Python/src/dbs/utils/DBSDaoTools.py
create_token_generator
def create_token_generator(input_list): """SQL Generator to select from list of values in Oracle""" ###Generator trick from http://betteratoracle.com/posts/20-how-do-i-bind-a-variable-in-list ###The maximum length of the comma separated list is 4000 characters, therefore we need to split the list ###ORA...
python
def create_token_generator(input_list): """SQL Generator to select from list of values in Oracle""" ###Generator trick from http://betteratoracle.com/posts/20-how-do-i-bind-a-variable-in-list ###The maximum length of the comma separated list is 4000 characters, therefore we need to split the list ###ORA...
[ "def", "create_token_generator", "(", "input_list", ")", ":", "###Generator trick from http://betteratoracle.com/posts/20-how-do-i-bind-a-variable-in-list", "###The maximum length of the comma separated list is 4000 characters, therefore we need to split the list", "###ORA-01460: unimplemented or un...
SQL Generator to select from list of values in Oracle
[ "SQL", "Generator", "to", "select", "from", "list", "of", "values", "in", "Oracle" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/utils/DBSDaoTools.py#L4-L50
dmwm/DBS
Server/Python/src/dbs/web/DBSServicesRegistry.py
DBSServicesRegistry.getServices
def getServices(self): """ Simple method that returs list of all know DBS instances, instances known to this registry """ try: conn = self.dbi.connection() result = self.serviceslist.execute(conn) return result except Exception as ex: ...
python
def getServices(self): """ Simple method that returs list of all know DBS instances, instances known to this registry """ try: conn = self.dbi.connection() result = self.serviceslist.execute(conn) return result except Exception as ex: ...
[ "def", "getServices", "(", "self", ")", ":", "try", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "result", "=", "self", ".", "serviceslist", ".", "execute", "(", "conn", ")", "return", "result", "except", "Exception", "as", "ex", ...
Simple method that returs list of all know DBS instances, instances known to this registry
[ "Simple", "method", "that", "returs", "list", "of", "all", "know", "DBS", "instances", "instances", "known", "to", "this", "registry" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSServicesRegistry.py#L37-L53
dmwm/DBS
Server/Python/src/dbs/web/DBSServicesRegistry.py
DBSServicesRegistry.addService
def addService(self): """ Add a service to service registry """ conn = self.dbi.connection() tran = conn.begin() try: body = request.body.read() service = cjson.decode(body) addthis = {} addthis['service_id'] =...
python
def addService(self): """ Add a service to service registry """ conn = self.dbi.connection() tran = conn.begin() try: body = request.body.read() service = cjson.decode(body) addthis = {} addthis['service_id'] =...
[ "def", "addService", "(", "self", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "tran", "=", "conn", ".", "begin", "(", ")", "try", ":", "body", "=", "request", ".", "body", ".", "read", "(", ")", "service", "=", "cjson"...
Add a service to service registry
[ "Add", "a", "service", "to", "service", "registry" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSServicesRegistry.py#L55-L115
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/MigrationRequests/UpdateRequestStatus.py
UpdateRequestStatus.execute
def execute(self, conn, daoinput, transaction = False): """ required keys: migration_status, migration_request_id """ if not conn: dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationRequests/UpdateRequestStatus. Expects db connection from upper layer.", ...
python
def execute(self, conn, daoinput, transaction = False): """ required keys: migration_status, migration_request_id """ if not conn: dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationRequests/UpdateRequestStatus. Expects db connection from upper layer.", ...
[ "def", "execute", "(", "self", ",", "conn", ",", "daoinput", ",", "transaction", "=", "False", ")", ":", "if", "not", "conn", ":", "dbsExceptionHandler", "(", "\"dbsException-failed-connect2host\"", ",", "\"Oracle/MigrationRequests/UpdateRequestStatus. Expects db connecti...
required keys: migration_status, migration_request_id
[ "required", "keys", ":", "migration_status", "migration_request_id" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/MigrationRequests/UpdateRequestStatus.py#L67-L85
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/MigrationRequests/List.py
List.execute
def execute(self, conn, migration_url="", migration_input="", create_by="", migration_request_id="", oldest= False, transaction=False): """ Lists all requests if pattern is not provided. """ sql = self.sql binds = {} if migration_request_id: sql += " WHERE MR.MIGRATION_REQU...
python
def execute(self, conn, migration_url="", migration_input="", create_by="", migration_request_id="", oldest= False, transaction=False): """ Lists all requests if pattern is not provided. """ sql = self.sql binds = {} if migration_request_id: sql += " WHERE MR.MIGRATION_REQU...
[ "def", "execute", "(", "self", ",", "conn", ",", "migration_url", "=", "\"\"", ",", "migration_input", "=", "\"\"", ",", "create_by", "=", "\"\"", ",", "migration_request_id", "=", "\"\"", ",", "oldest", "=", "False", ",", "transaction", "=", "False", ")",...
Lists all requests if pattern is not provided.
[ "Lists", "all", "requests", "if", "pattern", "is", "not", "provided", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/MigrationRequests/List.py#L28-L75
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/FileBuffer/DeleteDuplicates.py
DeleteDuplicates.execute
def execute(self, conn, logical_file_name, transaction=False): """ simple execute """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/DeleteDupicates. Expects db connection from upper layer.") print(self.sql) self.dbi.processData(self.sql, logical_fil...
python
def execute(self, conn, logical_file_name, transaction=False): """ simple execute """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/DeleteDupicates. Expects db connection from upper layer.") print(self.sql) self.dbi.processData(self.sql, logical_fil...
[ "def", "execute", "(", "self", ",", "conn", ",", "logical_file_name", ",", "transaction", "=", "False", ")", ":", "if", "not", "conn", ":", "dbsExceptionHandler", "(", "\"dbsException-db-conn-failed\"", ",", "\"Oracle/FileBuffer/DeleteDupicates. Expects db connection from...
simple execute
[ "simple", "execute" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileBuffer/DeleteDuplicates.py#L21-L29
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/BlockParent/List.py
List.execute
def execute(self, conn, block_name="", transaction = False): """ block: /a/b/c#d """ if not conn: dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/BlockParent/List. Expects db connection from upper layer.", self.logger.exception) sql = self.sql if i...
python
def execute(self, conn, block_name="", transaction = False): """ block: /a/b/c#d """ if not conn: dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/BlockParent/List. Expects db connection from upper layer.", self.logger.exception) sql = self.sql if i...
[ "def", "execute", "(", "self", ",", "conn", ",", "block_name", "=", "\"\"", ",", "transaction", "=", "False", ")", ":", "if", "not", "conn", ":", "dbsExceptionHandler", "(", "\"dbsException-failed-connect2host\"", ",", "\"Oracle/BlockParent/List. Expects db connection...
block: /a/b/c#d
[ "block", ":", "/", "a", "/", "b", "/", "c#d" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/BlockParent/List.py#L27-L44
dmwm/DBS
Server/Python/src/dbs/dao/Oracle/Block/ListBlockOrigin.py
ListBlockOrigin.execute
def execute(self, conn, origin_site_name="", dataset="", block_name="", transaction = False): """ origin_site_name: T1_US_FNAL_Buffer dataset: /a/b/c block_name: /a/b/c#d """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", ...
python
def execute(self, conn, origin_site_name="", dataset="", block_name="", transaction = False): """ origin_site_name: T1_US_FNAL_Buffer dataset: /a/b/c block_name: /a/b/c#d """ if not conn: dbsExceptionHandler("dbsException-db-conn-failed", ...
[ "def", "execute", "(", "self", ",", "conn", ",", "origin_site_name", "=", "\"\"", ",", "dataset", "=", "\"\"", ",", "block_name", "=", "\"\"", ",", "transaction", "=", "False", ")", ":", "if", "not", "conn", ":", "dbsExceptionHandler", "(", "\"dbsException...
origin_site_name: T1_US_FNAL_Buffer dataset: /a/b/c block_name: /a/b/c#d
[ "origin_site_name", ":", "T1_US_FNAL_Buffer", "dataset", ":", "/", "a", "/", "b", "/", "c", "block_name", ":", "/", "a", "/", "b", "/", "c#d" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/Block/ListBlockOrigin.py#L29-L63
dmwm/DBS
Server/Python/src/dbs/business/DBSPrimaryDataset.py
DBSPrimaryDataset.listPrimaryDatasets
def listPrimaryDatasets(self, primary_ds_name="", primary_ds_type=""): """ Returns all primary dataset if primary_ds_name or primary_ds_type are not passed. """ conn = self.dbi.connection() try: result = self.primdslist.execute(conn, primary_ds_name, primary_ds_type) ...
python
def listPrimaryDatasets(self, primary_ds_name="", primary_ds_type=""): """ Returns all primary dataset if primary_ds_name or primary_ds_type are not passed. """ conn = self.dbi.connection() try: result = self.primdslist.execute(conn, primary_ds_name, primary_ds_type) ...
[ "def", "listPrimaryDatasets", "(", "self", ",", "primary_ds_name", "=", "\"\"", ",", "primary_ds_type", "=", "\"\"", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "try", ":", "result", "=", "self", ".", "primdslist", ".", "execu...
Returns all primary dataset if primary_ds_name or primary_ds_type are not passed.
[ "Returns", "all", "primary", "dataset", "if", "primary_ds_name", "or", "primary_ds_type", "are", "not", "passed", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPrimaryDataset.py#L29-L40
dmwm/DBS
Server/Python/src/dbs/business/DBSPrimaryDataset.py
DBSPrimaryDataset.listPrimaryDSTypes
def listPrimaryDSTypes(self, primary_ds_type="", dataset=""): """ Returns all primary dataset types if dataset or primary_ds_type are not passed. """ conn = self.dbi.connection() try: result = self.primdstypeList.execute(conn, primary_ds_type, dataset) if ...
python
def listPrimaryDSTypes(self, primary_ds_type="", dataset=""): """ Returns all primary dataset types if dataset or primary_ds_type are not passed. """ conn = self.dbi.connection() try: result = self.primdstypeList.execute(conn, primary_ds_type, dataset) if ...
[ "def", "listPrimaryDSTypes", "(", "self", ",", "primary_ds_type", "=", "\"\"", ",", "dataset", "=", "\"\"", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "try", ":", "result", "=", "self", ".", "primdstypeList", ".", "execute", ...
Returns all primary dataset types if dataset or primary_ds_type are not passed.
[ "Returns", "all", "primary", "dataset", "types", "if", "dataset", "or", "primary_ds_type", "are", "not", "passed", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPrimaryDataset.py#L42-L53
dmwm/DBS
Server/Python/src/dbs/business/DBSPrimaryDataset.py
DBSPrimaryDataset.insertPrimaryDataset
def insertPrimaryDataset(self, businput): """ Input dictionary has to have the following keys: primary_ds_name, primary_ds_type, creation_date, create_by. it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = c...
python
def insertPrimaryDataset(self, businput): """ Input dictionary has to have the following keys: primary_ds_name, primary_ds_type, creation_date, create_by. it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = c...
[ "def", "insertPrimaryDataset", "(", "self", ",", "businput", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "tran", "=", "conn", ".", "begin", "(", ")", "#checking for required fields", "if", "\"primary_ds_name\"", "not", "in", "busi...
Input dictionary has to have the following keys: primary_ds_name, primary_ds_type, creation_date, create_by. it builds the correct dictionary for dao input and executes the dao
[ "Input", "dictionary", "has", "to", "have", "the", "following", "keys", ":", "primary_ds_name", "primary_ds_type", "creation_date", "create_by", ".", "it", "builds", "the", "correct", "dictionary", "for", "dao", "input", "and", "executes", "the", "dao" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPrimaryDataset.py#L55-L99
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/PhysicsGroup/List.py#L23-L39
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSOutputConfig.py#L55-L107
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L195-L211
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L225-L248
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L251-L274
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...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L284-L488
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L490-L532
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L535-L563
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...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L569-L695
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L698-L720
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L744-L776
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L779-L796
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L800-L850
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", "-", ...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L857-L974
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",...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L976-L1072
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", ":" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1076-L1135
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1138-L1155
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1179-L1221
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1225-L1250
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1252-L1300
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1307-L1334
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1338-L1377
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1435-L1482
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", ")", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1485-L1504
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1507-L1524
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1527-L1544
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1568-L1586
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1589-L1612
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1615-L1634
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1637-L1656
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1659-L1697
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L22-L26
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L34-L36
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L66-L70
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L94-L100
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L105-L114
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L133-L155
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L171-L206
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L214-L221
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" ]
train
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L229-L236
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L85-L106
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", ")", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L430-L562
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L564-L884
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_" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L888-L1017
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSSite.py#L24-L37
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSSite.py#L39-L69
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", "/", ...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/utils/das_logfile_analyser.py#L31-L50
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", ...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L14-L28
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L30-L75
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",...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L77-L105
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L107-L136
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L171-L210
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L212-L228
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L231-L241
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L317-L347
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L381-L409
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L465-L482
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L544-L562
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...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L564-L615
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...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L679-L758
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L776-L802
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...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1127-L1266
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1378-L1394
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1432-L1454
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" ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1534-L1551
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileLumi/List.py#L30-L159
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...
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileParent/ListFileParentageByLumi.py#L39-L118
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", "." ]
train
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/DatasetRun/List.py#L30-L86
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L91-L141
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L143-L191
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...
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L280-L286
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...
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L303-L309
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L326-L336
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L344-L353
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L365-L374
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L386-L397
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L404-L417
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", "." ]
train
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L419-L435