repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
dmwm/DBS | Server/Python/src/dbs/business/DBSAcquisitionEra.py | DBSAcquisitionEra.listAcquisitionEras_CI | def listAcquisitionEras_CI(self, acq=''):
"""
Returns all acquistion eras in dbs
"""
try:
acq = str(acq)
except:
dbsExceptionHandler('dbsException-invalid-input', 'aquistion_era_name given is not valid : %s'%acq)
conn = self.dbi.connection()
... | python | def listAcquisitionEras_CI(self, acq=''):
"""
Returns all acquistion eras in dbs
"""
try:
acq = str(acq)
except:
dbsExceptionHandler('dbsException-invalid-input', 'aquistion_era_name given is not valid : %s'%acq)
conn = self.dbi.connection()
... | [
"def",
"listAcquisitionEras_CI",
"(",
"self",
",",
"acq",
"=",
"''",
")",
":",
"try",
":",
"acq",
"=",
"str",
"(",
"acq",
")",
"except",
":",
"dbsExceptionHandler",
"(",
"'dbsException-invalid-input'",
",",
"'aquistion_era_name given is not valid : %s'",
"%",
"acq... | Returns all acquistion eras in dbs | [
"Returns",
"all",
"acquistion",
"eras",
"in",
"dbs"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSAcquisitionEra.py#L42-L55 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSAcquisitionEra.py | DBSAcquisitionEra.insertAcquisitionEra | def insertAcquisitionEra(self, businput):
"""
Input dictionary has to have the following keys:
acquisition_era_name, creation_date, create_by, start_date, end_date.
it builds the correct dictionary for dao input and executes the dao
"""
conn = self.dbi.connection()
... | python | def insertAcquisitionEra(self, businput):
"""
Input dictionary has to have the following keys:
acquisition_era_name, creation_date, create_by, start_date, end_date.
it builds the correct dictionary for dao input and executes the dao
"""
conn = self.dbi.connection()
... | [
"def",
"insertAcquisitionEra",
"(",
"self",
",",
"businput",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"tran",
"=",
"conn",
".",
"begin",
"(",
")",
"try",
":",
"businput",
"[",
"\"acquisition_era_id\"",
"]",
"=",
"self",
"... | Input dictionary has to have the following keys:
acquisition_era_name, creation_date, create_by, start_date, end_date.
it builds the correct dictionary for dao input and executes the dao | [
"Input",
"dictionary",
"has",
"to",
"have",
"the",
"following",
"keys",
":",
"acquisition_era_name",
"creation_date",
"create_by",
"start_date",
"end_date",
".",
"it",
"builds",
"the",
"correct",
"dictionary",
"for",
"dao",
"input",
"and",
"executes",
"the",
"dao"... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSAcquisitionEra.py#L57-L83 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSAcquisitionEra.py | DBSAcquisitionEra.UpdateAcqEraEndDate | def UpdateAcqEraEndDate(self, acquisition_era_name ="", end_date=0):
"""
Input dictionary has to have the following keys:
acquisition_era_name, end_date.
"""
if acquisition_era_name =="" or end_date==0:
dbsExceptionHandler('dbsException-invalid-input', "acquisition_er... | python | def UpdateAcqEraEndDate(self, acquisition_era_name ="", end_date=0):
"""
Input dictionary has to have the following keys:
acquisition_era_name, end_date.
"""
if acquisition_era_name =="" or end_date==0:
dbsExceptionHandler('dbsException-invalid-input', "acquisition_er... | [
"def",
"UpdateAcqEraEndDate",
"(",
"self",
",",
"acquisition_era_name",
"=",
"\"\"",
",",
"end_date",
"=",
"0",
")",
":",
"if",
"acquisition_era_name",
"==",
"\"\"",
"or",
"end_date",
"==",
"0",
":",
"dbsExceptionHandler",
"(",
"'dbsException-invalid-input'",
",",... | Input dictionary has to have the following keys:
acquisition_era_name, end_date. | [
"Input",
"dictionary",
"has",
"to",
"have",
"the",
"following",
"keys",
":",
"acquisition_era_name",
"end_date",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSAcquisitionEra.py#L85-L100 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/OutputModuleConfig/GetID.py | GetID.execute | def execute(self, conn, app="", release_version="", pset_hash="", output_label="",
global_tag='', transaction = False):
"""
returns id for a given application
"""
sql = self.sql
binds = {}
setAnd=False
if not app == "":
sql += " A.APP_NAME=:app_name"
binds[... | python | def execute(self, conn, app="", release_version="", pset_hash="", output_label="",
global_tag='', transaction = False):
"""
returns id for a given application
"""
sql = self.sql
binds = {}
setAnd=False
if not app == "":
sql += " A.APP_NAME=:app_name"
binds[... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"app",
"=",
"\"\"",
",",
"release_version",
"=",
"\"\"",
",",
"pset_hash",
"=",
"\"\"",
",",
"output_label",
"=",
"\"\"",
",",
"global_tag",
"=",
"''",
",",
"transaction",
"=",
"False",
")",
":",
"sql",
... | returns id for a given application | [
"returns",
"id",
"for",
"a",
"given",
"application"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/OutputModuleConfig/GetID.py#L31-L68 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.prepareDatasetMigrationList | def prepareDatasetMigrationList(self, conn, request):
"""
Prepare the ordered lists of blocks based on input DATASET (note Block is different)
1. Get list of blocks from source
2. Check and see if these blocks are already at DST
3. Check if dataset has parents
... | python | def prepareDatasetMigrationList(self, conn, request):
"""
Prepare the ordered lists of blocks based on input DATASET (note Block is different)
1. Get list of blocks from source
2. Check and see if these blocks are already at DST
3. Check if dataset has parents
... | [
"def",
"prepareDatasetMigrationList",
"(",
"self",
",",
"conn",
",",
"request",
")",
":",
"ordered_dict",
"=",
"{",
"}",
"order_counter",
"=",
"0",
"srcdataset",
"=",
"request",
"[",
"\"migration_input\"",
"]",
"url",
"=",
"request",
"[",
"\"migration_url\"",
... | Prepare the ordered lists of blocks based on input DATASET (note Block is different)
1. Get list of blocks from source
2. Check and see if these blocks are already at DST
3. Check if dataset has parents
4. Check if parent blocks are already at DST | [
"Prepare",
"the",
"ordered",
"lists",
"of",
"blocks",
"based",
"on",
"input",
"DATASET",
"(",
"note",
"Block",
"is",
"different",
")",
"1",
".",
"Get",
"list",
"of",
"blocks",
"from",
"source",
"2",
".",
"Check",
"and",
"see",
"if",
"these",
"blocks",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L77-L120 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.processDatasetBlocks | def processDatasetBlocks(self, url, conn, inputdataset, order_counter):
"""
Utility function, that comapares blocks of a dataset at source and dst
and returns an ordered list of blocks not already at dst for migration
"""
ordered_dict = {}
srcblks = self.getSrcBlocks(url,... | python | def processDatasetBlocks(self, url, conn, inputdataset, order_counter):
"""
Utility function, that comapares blocks of a dataset at source and dst
and returns an ordered list of blocks not already at dst for migration
"""
ordered_dict = {}
srcblks = self.getSrcBlocks(url,... | [
"def",
"processDatasetBlocks",
"(",
"self",
",",
"url",
",",
"conn",
",",
"inputdataset",
",",
"order_counter",
")",
":",
"ordered_dict",
"=",
"{",
"}",
"srcblks",
"=",
"self",
".",
"getSrcBlocks",
"(",
"url",
",",
"dataset",
"=",
"inputdataset",
")",
"if"... | Utility function, that comapares blocks of a dataset at source and dst
and returns an ordered list of blocks not already at dst for migration | [
"Utility",
"function",
"that",
"comapares",
"blocks",
"of",
"a",
"dataset",
"at",
"source",
"and",
"dst",
"and",
"returns",
"an",
"ordered",
"list",
"of",
"blocks",
"not",
"already",
"at",
"dst",
"for",
"migration"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L122-L148 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.getParentDatasetsOrderedList | def getParentDatasetsOrderedList(self, url, conn, dataset, order_counter):
"""
check if input dataset has parents,
check if any of the blocks are already at dst,
prepare the ordered list and return it.
url : source DBS url
dataset : to be migrated dataset
order_co... | python | def getParentDatasetsOrderedList(self, url, conn, dataset, order_counter):
"""
check if input dataset has parents,
check if any of the blocks are already at dst,
prepare the ordered list and return it.
url : source DBS url
dataset : to be migrated dataset
order_co... | [
"def",
"getParentDatasetsOrderedList",
"(",
"self",
",",
"url",
",",
"conn",
",",
"dataset",
",",
"order_counter",
")",
":",
"ordered_dict",
"=",
"{",
"}",
"parentSrcDatasets",
"=",
"self",
".",
"getSrcDatasetParents",
"(",
"url",
",",
"dataset",
")",
"if",
... | check if input dataset has parents,
check if any of the blocks are already at dst,
prepare the ordered list and return it.
url : source DBS url
dataset : to be migrated dataset
order_counter: the order in which migration happends. | [
"check",
"if",
"input",
"dataset",
"has",
"parents",
"check",
"if",
"any",
"of",
"the",
"blocks",
"are",
"already",
"at",
"dst",
"prepare",
"the",
"ordered",
"list",
"and",
"return",
"it",
".",
"url",
":",
"source",
"DBS",
"url",
"dataset",
":",
"to",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L150-L182 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.prepareBlockMigrationList | def prepareBlockMigrationList(self, conn, request):
"""
Prepare the ordered lists of blocks based on input BLOCK
1. see if block already exists at dst (no need to migrate),
raise "ALREADY EXISTS"
2. see if block exists at src & make sure the block's open_for_writin... | python | def prepareBlockMigrationList(self, conn, request):
"""
Prepare the ordered lists of blocks based on input BLOCK
1. see if block already exists at dst (no need to migrate),
raise "ALREADY EXISTS"
2. see if block exists at src & make sure the block's open_for_writin... | [
"def",
"prepareBlockMigrationList",
"(",
"self",
",",
"conn",
",",
"request",
")",
":",
"ordered_dict",
"=",
"{",
"}",
"block_name",
"=",
"request",
"[",
"\"migration_input\"",
"]",
"url",
"=",
"request",
"[",
"\"migration_url\"",
"]",
"order_counter",
"=",
"0... | Prepare the ordered lists of blocks based on input BLOCK
1. see if block already exists at dst (no need to migrate),
raise "ALREADY EXISTS"
2. see if block exists at src & make sure the block's open_for_writing=0
3. see if block has parents
4. see if parent... | [
"Prepare",
"the",
"ordered",
"lists",
"of",
"blocks",
"based",
"on",
"input",
"BLOCK",
"1",
".",
"see",
"if",
"block",
"already",
"exists",
"at",
"dst",
"(",
"no",
"need",
"to",
"migrate",
")",
"raise",
"ALREADY",
"EXISTS",
"2",
".",
"see",
"if",
"bloc... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L184-L238 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.removeMigrationRequest | def removeMigrationRequest(self, migration_rqst):
"""
Method to remove pending or failed migration request from the queue.
"""
conn = self.dbi.connection()
try:
tran = conn.begin()
self.mgrremove.execute(conn, migration_rqst)
tran.commit()
... | python | def removeMigrationRequest(self, migration_rqst):
"""
Method to remove pending or failed migration request from the queue.
"""
conn = self.dbi.connection()
try:
tran = conn.begin()
self.mgrremove.execute(conn, migration_rqst)
tran.commit()
... | [
"def",
"removeMigrationRequest",
"(",
"self",
",",
"migration_rqst",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"try",
":",
"tran",
"=",
"conn",
".",
"begin",
"(",
")",
"self",
".",
"mgrremove",
".",
"execute",
"(",
"conn",... | Method to remove pending or failed migration request from the queue. | [
"Method",
"to",
"remove",
"pending",
"or",
"failed",
"migration",
"request",
"from",
"the",
"queue",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L285-L301 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.insertMigrationRequest | def insertMigrationRequest(self, request):
"""
Method to insert use requests to MIGRATION_REQUESTS table.
request keys: migration_url, migration_input
"""
conn = self.dbi.connection()
# check if already queued.
#If the migration_input is the same, but the src url ... | python | def insertMigrationRequest(self, request):
"""
Method to insert use requests to MIGRATION_REQUESTS table.
request keys: migration_url, migration_input
"""
conn = self.dbi.connection()
# check if already queued.
#If the migration_input is the same, but the src url ... | [
"def",
"insertMigrationRequest",
"(",
"self",
",",
"request",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"# check if already queued.",
"#If the migration_input is the same, but the src url is different,",
"#We will consider it as a submitted request... | Method to insert use requests to MIGRATION_REQUESTS table.
request keys: migration_url, migration_input | [
"Method",
"to",
"insert",
"use",
"requests",
"to",
"MIGRATION_REQUESTS",
"table",
".",
"request",
"keys",
":",
"migration_url",
"migration_input"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L305-L418 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.listMigrationRequests | def listMigrationRequests(self, migration_request_id="", block_name="",
dataset="", user="", oldest=False):
"""
get the status of the migration
migratee : can be dataset or block_name
"""
conn = self.dbi.connection()
migratee = ""
tr... | python | def listMigrationRequests(self, migration_request_id="", block_name="",
dataset="", user="", oldest=False):
"""
get the status of the migration
migratee : can be dataset or block_name
"""
conn = self.dbi.connection()
migratee = ""
tr... | [
"def",
"listMigrationRequests",
"(",
"self",
",",
"migration_request_id",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"user",
"=",
"\"\"",
",",
"oldest",
"=",
"False",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"... | get the status of the migration
migratee : can be dataset or block_name | [
"get",
"the",
"status",
"of",
"the",
"migration",
"migratee",
":",
"can",
"be",
"dataset",
"or",
"block_name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L420-L440 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.listMigrationBlocks | def listMigrationBlocks(self, migration_request_id=""):
"""
get eveything of block that is has status = 0 and migration_request_id as specified.
"""
conn = self.dbi.connection()
try:
return self.mgrblklist.execute(conn, migration_request_id=migration_request_id)
... | python | def listMigrationBlocks(self, migration_request_id=""):
"""
get eveything of block that is has status = 0 and migration_request_id as specified.
"""
conn = self.dbi.connection()
try:
return self.mgrblklist.execute(conn, migration_request_id=migration_request_id)
... | [
"def",
"listMigrationBlocks",
"(",
"self",
",",
"migration_request_id",
"=",
"\"\"",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"try",
":",
"return",
"self",
".",
"mgrblklist",
".",
"execute",
"(",
"conn",
",",
"migration_reque... | get eveything of block that is has status = 0 and migration_request_id as specified. | [
"get",
"eveything",
"of",
"block",
"that",
"is",
"has",
"status",
"=",
"0",
"and",
"migration_request_id",
"as",
"specified",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L442-L451 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.updateMigrationRequestStatus | def updateMigrationRequestStatus(self, migration_status, migration_request_id):
"""
migration_status:
0=PENDING
1=IN PROGRESS
2=COMPLETED
3=FAILED (will be retried)
9=Terminally FAILED
status change:
0 -> 1
1 -> 2
1 -> 3
1 ... | python | def updateMigrationRequestStatus(self, migration_status, migration_request_id):
"""
migration_status:
0=PENDING
1=IN PROGRESS
2=COMPLETED
3=FAILED (will be retried)
9=Terminally FAILED
status change:
0 -> 1
1 -> 2
1 -> 3
1 ... | [
"def",
"updateMigrationRequestStatus",
"(",
"self",
",",
"migration_status",
",",
"migration_request_id",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"tran",
"=",
"conn",
".",
"begin",
"(",
")",
"try",
":",
"upst",
"=",
"dict",
... | migration_status:
0=PENDING
1=IN PROGRESS
2=COMPLETED
3=FAILED (will be retried)
9=Terminally FAILED
status change:
0 -> 1
1 -> 2
1 -> 3
1 -> 9
are only allowed changes for working through migration.
3 -> 1 is allowed for r... | [
"migration_status",
":",
"0",
"=",
"PENDING",
"1",
"=",
"IN",
"PROGRESS",
"2",
"=",
"COMPLETED",
"3",
"=",
"FAILED",
"(",
"will",
"be",
"retried",
")",
"9",
"=",
"Terminally",
"FAILED",
"status",
"change",
":",
"0",
"-",
">",
"1",
"1",
"-",
">",
"2... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L454-L486 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.updateMigrationBlockStatus | def updateMigrationBlockStatus(self, migration_status=0, migration_block=None, migration_request=None):
"""
migration_status:
0=PENDING
1=IN PROGRESS
2=COMPLETED
3=FAILED (will be retried)
9=Terminally FAILED
status change:
0 -> 1
1 -> 2
... | python | def updateMigrationBlockStatus(self, migration_status=0, migration_block=None, migration_request=None):
"""
migration_status:
0=PENDING
1=IN PROGRESS
2=COMPLETED
3=FAILED (will be retried)
9=Terminally FAILED
status change:
0 -> 1
1 -> 2
... | [
"def",
"updateMigrationBlockStatus",
"(",
"self",
",",
"migration_status",
"=",
"0",
",",
"migration_block",
"=",
"None",
",",
"migration_request",
"=",
"None",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"tran",
"=",
"conn",
".... | migration_status:
0=PENDING
1=IN PROGRESS
2=COMPLETED
3=FAILED (will be retried)
9=Terminally FAILED
status change:
0 -> 1
1 -> 2
1 -> 3
1 -> 9
are only allowed changes for working through migration.
3 -> 1 allowed for retry... | [
"migration_status",
":",
"0",
"=",
"PENDING",
"1",
"=",
"IN",
"PROGRESS",
"2",
"=",
"COMPLETED",
"3",
"=",
"FAILED",
"(",
"will",
"be",
"retried",
")",
"9",
"=",
"Terminally",
"FAILED",
"status",
"change",
":",
"0",
"-",
">",
"1",
"1",
"-",
">",
"2... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L492-L526 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.getSrcDatasetParents | def getSrcDatasetParents(self, url, dataset):
"""
List block at src DBS
"""
#resturl = "%s/datasetparents?dataset=%s" % (url, dataset)
params={'dataset':dataset}
return cjson.decode(self.callDBSService(url, 'datasetparents', params, {})) | python | def getSrcDatasetParents(self, url, dataset):
"""
List block at src DBS
"""
#resturl = "%s/datasetparents?dataset=%s" % (url, dataset)
params={'dataset':dataset}
return cjson.decode(self.callDBSService(url, 'datasetparents', params, {})) | [
"def",
"getSrcDatasetParents",
"(",
"self",
",",
"url",
",",
"dataset",
")",
":",
"#resturl = \"%s/datasetparents?dataset=%s\" % (url, dataset)",
"params",
"=",
"{",
"'dataset'",
":",
"dataset",
"}",
"return",
"cjson",
".",
"decode",
"(",
"self",
".",
"callDBSServic... | List block at src DBS | [
"List",
"block",
"at",
"src",
"DBS"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L554-L560 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.getSrcBlockParents | def getSrcBlockParents(self, url, block):
"""
List block at src DBS
"""
#blockname = block.replace("#", urllib.quote_plus('#'))
#resturl = "%s/blockparents?block_name=%s" % (url, blockname)
params={'block_name':block}
return cjson.decode(self.callDBSService(url, '... | python | def getSrcBlockParents(self, url, block):
"""
List block at src DBS
"""
#blockname = block.replace("#", urllib.quote_plus('#'))
#resturl = "%s/blockparents?block_name=%s" % (url, blockname)
params={'block_name':block}
return cjson.decode(self.callDBSService(url, '... | [
"def",
"getSrcBlockParents",
"(",
"self",
",",
"url",
",",
"block",
")",
":",
"#blockname = block.replace(\"#\", urllib.quote_plus('#'))",
"#resturl = \"%s/blockparents?block_name=%s\" % (url, blockname)",
"params",
"=",
"{",
"'block_name'",
":",
"block",
"}",
"return",
"cjso... | List block at src DBS | [
"List",
"block",
"at",
"src",
"DBS"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L562-L569 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSMigrate.py | DBSMigrate.getSrcBlocks | def getSrcBlocks(self, url, dataset="", block=""):
"""
Need to list all blocks of the dataset and its parents starting from the top
For now just list the blocks from this dataset.
Client type call...
"""
if block:
params={'block_name':block, 'open_for_writing'... | python | def getSrcBlocks(self, url, dataset="", block=""):
"""
Need to list all blocks of the dataset and its parents starting from the top
For now just list the blocks from this dataset.
Client type call...
"""
if block:
params={'block_name':block, 'open_for_writing'... | [
"def",
"getSrcBlocks",
"(",
"self",
",",
"url",
",",
"dataset",
"=",
"\"\"",
",",
"block",
"=",
"\"\"",
")",
":",
"if",
"block",
":",
"params",
"=",
"{",
"'block_name'",
":",
"block",
",",
"'open_for_writing'",
":",
"0",
"}",
"elif",
"dataset",
":",
... | Need to list all blocks of the dataset and its parents starting from the top
For now just list the blocks from this dataset.
Client type call... | [
"Need",
"to",
"list",
"all",
"blocks",
"of",
"the",
"dataset",
"and",
"its",
"parents",
"starting",
"from",
"the",
"top",
"For",
"now",
"just",
"list",
"the",
"blocks",
"from",
"this",
"dataset",
".",
"Client",
"type",
"call",
"..."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSMigrate.py#L571-L586 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/InsertTable/Insert.py | InsertSingle.executeSingle | def executeSingle( self, conn, daoinput, tablename, transaction = False):
"""build dynamic sql based on daoinput"""
sql1 = " insert into %s%s( " %(self.owner, tablename)
sql2 =" values("
"Now loop over all the input keys. We need to check if all the keys are valid !!!"
for key in daoinput:
sq... | python | def executeSingle( self, conn, daoinput, tablename, transaction = False):
"""build dynamic sql based on daoinput"""
sql1 = " insert into %s%s( " %(self.owner, tablename)
sql2 =" values("
"Now loop over all the input keys. We need to check if all the keys are valid !!!"
for key in daoinput:
sq... | [
"def",
"executeSingle",
"(",
"self",
",",
"conn",
",",
"daoinput",
",",
"tablename",
",",
"transaction",
"=",
"False",
")",
":",
"sql1",
"=",
"\" insert into %s%s( \"",
"%",
"(",
"self",
".",
"owner",
",",
"tablename",
")",
"sql2",
"=",
"\" values(\"",
"\"... | build dynamic sql based on daoinput | [
"build",
"dynamic",
"sql",
"based",
"on",
"daoinput"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/InsertTable/Insert.py#L16-L27 | train |
henriquebastos/django-decouple | decouple.py | Config._cast_boolean | def _cast_boolean(self, value):
"""
Helper to convert config values to boolean as ConfigParser do.
"""
if value.lower() not in self._BOOLEANS:
raise ValueError('Not a boolean: %s' % value)
return self._BOOLEANS[value.lower()] | python | def _cast_boolean(self, value):
"""
Helper to convert config values to boolean as ConfigParser do.
"""
if value.lower() not in self._BOOLEANS:
raise ValueError('Not a boolean: %s' % value)
return self._BOOLEANS[value.lower()] | [
"def",
"_cast_boolean",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
".",
"lower",
"(",
")",
"not",
"in",
"self",
".",
"_BOOLEANS",
":",
"raise",
"ValueError",
"(",
"'Not a boolean: %s'",
"%",
"value",
")",
"return",
"self",
".",
"_BOOLEANS",
"[",... | Helper to convert config values to boolean as ConfigParser do. | [
"Helper",
"to",
"convert",
"config",
"values",
"to",
"boolean",
"as",
"ConfigParser",
"do",
"."
] | fbc4a1b139565e1468b97de7e8c4276bcfc5b3e9 | https://github.com/henriquebastos/django-decouple/blob/fbc4a1b139565e1468b97de7e8c4276bcfc5b3e9/decouple.py#L40-L47 | train |
henriquebastos/django-decouple | decouple.py | Config.get | def get(self, option, default=undefined, cast=undefined):
"""
Return the value for option or default if defined.
"""
if option in self.repository:
value = self.repository.get(option)
else:
value = default
if isinstance(value, Undefined):
... | python | def get(self, option, default=undefined, cast=undefined):
"""
Return the value for option or default if defined.
"""
if option in self.repository:
value = self.repository.get(option)
else:
value = default
if isinstance(value, Undefined):
... | [
"def",
"get",
"(",
"self",
",",
"option",
",",
"default",
"=",
"undefined",
",",
"cast",
"=",
"undefined",
")",
":",
"if",
"option",
"in",
"self",
".",
"repository",
":",
"value",
"=",
"self",
".",
"repository",
".",
"get",
"(",
"option",
")",
"else"... | Return the value for option or default if defined. | [
"Return",
"the",
"value",
"for",
"option",
"or",
"default",
"if",
"defined",
"."
] | fbc4a1b139565e1468b97de7e8c4276bcfc5b3e9 | https://github.com/henriquebastos/django-decouple/blob/fbc4a1b139565e1468b97de7e8c4276bcfc5b3e9/decouple.py#L49-L66 | train |
dmwm/DBS | Client/setup.py | parse_requirements | def parse_requirements(requirements_file):
"""
Create a list for the 'install_requires' component of the setup function
by parsing a requirements file
"""
if os.path.exists(requirements_file):
# return a list that contains each line of the requirements file
return open(requireme... | python | def parse_requirements(requirements_file):
"""
Create a list for the 'install_requires' component of the setup function
by parsing a requirements file
"""
if os.path.exists(requirements_file):
# return a list that contains each line of the requirements file
return open(requireme... | [
"def",
"parse_requirements",
"(",
"requirements_file",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"requirements_file",
")",
":",
"# return a list that contains each line of the requirements file",
"return",
"open",
"(",
"requirements_file",
",",
"'r'",
")",
... | Create a list for the 'install_requires' component of the setup function
by parsing a requirements file | [
"Create",
"a",
"list",
"for",
"the",
"install_requires",
"component",
"of",
"the",
"setup",
"function",
"by",
"parsing",
"a",
"requirements",
"file"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/setup.py#L16-L27 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/Block/BriefList.py | BriefList.execute | def execute(self, conn, 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, transaction = False):
"""
dataset: /a/b/c
block:... | python | def execute(self, conn, 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, transaction = False):
"""
dataset: /a/b/c
block:... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"dataset",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"data_tier_name",
"=",
"\"\"",
",",
"origin_site_name",
"=",
"\"\"",
",",
"logical_file_name",
"=",
"\"\"",
",",
"run_num",
"=",
"-",
"1",
",",
... | dataset: /a/b/c
block: /a/b/c#d | [
"dataset",
":",
"/",
"a",
"/",
"b",
"/",
"c",
"block",
":",
"/",
"a",
"/",
"b",
"/",
"c#d"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/Block/BriefList.py#L26-L144 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/PrimaryDSType/List.py | List.execute | def execute(self, conn, dsType = "", dataset="", transaction = False):
"""
Lists all primary dataset types if no user input is provided.
"""
sql = self.sql
binds={}
if not dsType and not dataset:
pass
elif dsType and dataset in ("", None, '%'):
... | python | def execute(self, conn, dsType = "", dataset="", transaction = False):
"""
Lists all primary dataset types if no user input is provided.
"""
sql = self.sql
binds={}
if not dsType and not dataset:
pass
elif dsType and dataset in ("", None, '%'):
... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"dsType",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"transaction",
"=",
"False",
")",
":",
"sql",
"=",
"self",
".",
"sql",
"binds",
"=",
"{",
"}",
"if",
"not",
"dsType",
"and",
"not",
"dataset",... | Lists all primary dataset types if no user input is provided. | [
"Lists",
"all",
"primary",
"dataset",
"types",
"if",
"no",
"user",
"input",
"is",
"provided",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/PrimaryDSType/List.py#L29-L62 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/OutputModuleConfig/List.py | List.execute | def execute(self, conn, dataset="", logical_file_name="", app="", release_version="", pset_hash="",
output_label ="", block_id=0, global_tag='', transaction = False):
"""
returns id for a given application
"""
#sql=self.sql
binds = {}
setAnd=False
#add search only b... | python | def execute(self, conn, dataset="", logical_file_name="", app="", release_version="", pset_hash="",
output_label ="", block_id=0, global_tag='', transaction = False):
"""
returns id for a given application
"""
#sql=self.sql
binds = {}
setAnd=False
#add search only b... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"dataset",
"=",
"\"\"",
",",
"logical_file_name",
"=",
"\"\"",
",",
"app",
"=",
"\"\"",
",",
"release_version",
"=",
"\"\"",
",",
"pset_hash",
"=",
"\"\"",
",",
"output_label",
"=",
"\"\"",
",",
"block_id"... | returns id for a given application | [
"returns",
"id",
"for",
"a",
"given",
"application"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/OutputModuleConfig/List.py#L42-L116 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/BlockParent/ListChild.py | ListChild.execute | def execute(self, conn, block_name="", transaction = False):
"""
block: /a/b/c#d
"""
if not conn:
msg='Oracle/BlockParent/List. No DB connection found'
dbsExceptionHandler('dbsException-failed-connect2host', msg, self.logger.exception)
sql = self.sql
... | python | def execute(self, conn, block_name="", transaction = False):
"""
block: /a/b/c#d
"""
if not conn:
msg='Oracle/BlockParent/List. No DB connection found'
dbsExceptionHandler('dbsException-failed-connect2host', msg, self.logger.exception)
sql = self.sql
... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"block_name",
"=",
"\"\"",
",",
"transaction",
"=",
"False",
")",
":",
"if",
"not",
"conn",
":",
"msg",
"=",
"'Oracle/BlockParent/List. No DB connection found'",
"dbsExceptionHandler",
"(",
"'dbsException-failed-conne... | block: /a/b/c#d | [
"block",
":",
"/",
"a",
"/",
"b",
"/",
"c#d"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/BlockParent/ListChild.py#L27-L46 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.listFileLumis | def listFileLumis(self, logical_file_name="", block_name="", run_num=-1, validFileOnly=0, input_body=-1):
"""
optional parameter: logical_file_name, block_name, validFileOnly
returns: logical_file_name, file_lumi_id, run_num, lumi_section_num
"""
if((logical_file_name=='' or '*'i... | python | def listFileLumis(self, logical_file_name="", block_name="", run_num=-1, validFileOnly=0, input_body=-1):
"""
optional parameter: logical_file_name, block_name, validFileOnly
returns: logical_file_name, file_lumi_id, run_num, lumi_section_num
"""
if((logical_file_name=='' or '*'i... | [
"def",
"listFileLumis",
"(",
"self",
",",
"logical_file_name",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"run_num",
"=",
"-",
"1",
",",
"validFileOnly",
"=",
"0",
",",
"input_body",
"=",
"-",
"1",
")",
":",
"if",
"(",
"(",
"logical_file_name",
... | optional parameter: logical_file_name, block_name, validFileOnly
returns: logical_file_name, file_lumi_id, run_num, lumi_section_num | [
"optional",
"parameter",
":",
"logical_file_name",
"block_name",
"validFileOnly",
"returns",
":",
"logical_file_name",
"file_lumi_id",
"run_num",
"lumi_section_num"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L52-L76 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.listFileSummary | def listFileSummary(self, block_name="", dataset="", run_num=-1, validFileOnly=0, sumOverLumi=0):
"""
required parameter: full block_name or dataset name. No wildcards allowed. run_num is optional.
"""
if not block_name and not dataset:
msg = "Block_name or dataset is requir... | python | def listFileSummary(self, block_name="", dataset="", run_num=-1, validFileOnly=0, sumOverLumi=0):
"""
required parameter: full block_name or dataset name. No wildcards allowed. run_num is optional.
"""
if not block_name and not dataset:
msg = "Block_name or dataset is requir... | [
"def",
"listFileSummary",
"(",
"self",
",",
"block_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"run_num",
"=",
"-",
"1",
",",
"validFileOnly",
"=",
"0",
",",
"sumOverLumi",
"=",
"0",
")",
":",
"if",
"not",
"block_name",
"and",
"not",
"dataset... | required parameter: full block_name or dataset name. No wildcards allowed. run_num is optional. | [
"required",
"parameter",
":",
"full",
"block_name",
"or",
"dataset",
"name",
".",
"No",
"wildcards",
"allowed",
".",
"run_num",
"is",
"optional",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L78-L96 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.listFileParents | def listFileParents(self, logical_file_name="", block_id=0, block_name=""):
"""
required parameter: logical_file_name or block_name
returns: this_logical_file_name, parent_logical_file_name, parent_file_id
"""
#self.logger.debug("lfn %s, block_name %s, block_id :%s" % (logical_fi... | python | def listFileParents(self, logical_file_name="", block_id=0, block_name=""):
"""
required parameter: logical_file_name or block_name
returns: this_logical_file_name, parent_logical_file_name, parent_file_id
"""
#self.logger.debug("lfn %s, block_name %s, block_id :%s" % (logical_fi... | [
"def",
"listFileParents",
"(",
"self",
",",
"logical_file_name",
"=",
"\"\"",
",",
"block_id",
"=",
"0",
",",
"block_name",
"=",
"\"\"",
")",
":",
"#self.logger.debug(\"lfn %s, block_name %s, block_id :%s\" % (logical_file_name, block_name, block_id))",
"if",
"not",
"logica... | required parameter: logical_file_name or block_name
returns: this_logical_file_name, parent_logical_file_name, parent_file_id | [
"required",
"parameter",
":",
"logical_file_name",
"or",
"block_name",
"returns",
":",
"this_logical_file_name",
"parent_logical_file_name",
"parent_file_id"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L97-L116 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.listFileParentsByLumi | def listFileParentsByLumi(self, block_name='', logical_file_name=[]):
"""
required parameter: block_name
returns: [{child_parent_id_list: [(cid1, pid1), (cid2, pid2), ... (cidn, pidn)]}]
"""
#self.logger.debug("lfn %s, block_name %s" % (logical_file_name, block_name))
if... | python | def listFileParentsByLumi(self, block_name='', logical_file_name=[]):
"""
required parameter: block_name
returns: [{child_parent_id_list: [(cid1, pid1), (cid2, pid2), ... (cidn, pidn)]}]
"""
#self.logger.debug("lfn %s, block_name %s" % (logical_file_name, block_name))
if... | [
"def",
"listFileParentsByLumi",
"(",
"self",
",",
"block_name",
"=",
"''",
",",
"logical_file_name",
"=",
"[",
"]",
")",
":",
"#self.logger.debug(\"lfn %s, block_name %s\" % (logical_file_name, block_name))",
"if",
"not",
"block_name",
":",
"dbsExceptionHandler",
"(",
"'d... | required parameter: block_name
returns: [{child_parent_id_list: [(cid1, pid1), (cid2, pid2), ... (cidn, pidn)]}] | [
"required",
"parameter",
":",
"block_name",
"returns",
":",
"[",
"{",
"child_parent_id_list",
":",
"[",
"(",
"cid1",
"pid1",
")",
"(",
"cid2",
"pid2",
")",
"...",
"(",
"cidn",
"pidn",
")",
"]",
"}",
"]"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L118-L129 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.listFileChildren | def listFileChildren(self, logical_file_name='', block_name='', block_id=0):
"""
required parameter: logical_file_name or block_name or block_id
returns: logical_file_name, child_logical_file_name, parent_file_id
"""
conn = self.dbi.connection()
try:
if not lo... | python | def listFileChildren(self, logical_file_name='', block_name='', block_id=0):
"""
required parameter: logical_file_name or block_name or block_id
returns: logical_file_name, child_logical_file_name, parent_file_id
"""
conn = self.dbi.connection()
try:
if not lo... | [
"def",
"listFileChildren",
"(",
"self",
",",
"logical_file_name",
"=",
"''",
",",
"block_name",
"=",
"''",
",",
"block_id",
"=",
"0",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"try",
":",
"if",
"not",
"logical_file_name",
... | required parameter: logical_file_name or block_name or block_id
returns: logical_file_name, child_logical_file_name, parent_file_id | [
"required",
"parameter",
":",
"logical_file_name",
"or",
"block_name",
"or",
"block_id",
"returns",
":",
"logical_file_name",
"child_logical_file_name",
"parent_file_id"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L131-L157 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.updateStatus | def updateStatus(self, logical_file_name, is_file_valid, lost, dataset):
"""
Used to toggle the status of a file from is_file_valid=1 (valid) to is_file_valid=0 (invalid)
"""
conn = self.dbi.connection()
trans = conn.begin()
try :
self.updatestatus.execute(co... | python | def updateStatus(self, logical_file_name, is_file_valid, lost, dataset):
"""
Used to toggle the status of a file from is_file_valid=1 (valid) to is_file_valid=0 (invalid)
"""
conn = self.dbi.connection()
trans = conn.begin()
try :
self.updatestatus.execute(co... | [
"def",
"updateStatus",
"(",
"self",
",",
"logical_file_name",
",",
"is_file_valid",
",",
"lost",
",",
"dataset",
")",
":",
"conn",
"=",
"self",
".",
"dbi",
".",
"connection",
"(",
")",
"trans",
"=",
"conn",
".",
"begin",
"(",
")",
"try",
":",
"self",
... | Used to toggle the status of a file from is_file_valid=1 (valid) to is_file_valid=0 (invalid) | [
"Used",
"to",
"toggle",
"the",
"status",
"of",
"a",
"file",
"from",
"is_file_valid",
"=",
"1",
"(",
"valid",
")",
"to",
"is_file_valid",
"=",
"0",
"(",
"invalid",
")"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L159-L180 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.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, input_body=-1):
"""
... | 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, input_body=-1):
"""
... | [
"def",
"listFiles",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"logical_file_name",
"=",
"\"\"",
",",
"release_version",
"=",
"\"\"",
",",
"pset_hash",
"=",
"\"\"",
",",
"app_name",
"=",
"\"\"",
",",
"output_module_label",... | One of below parameter groups must be present:
non-patterned dataset, non-patterned block, non-patterned dataset with lfn, non-patterned block with lfn,
non-patterned lfn
non-patterned lfn list | [
"One",
"of",
"below",
"parameter",
"groups",
"must",
"be",
"present",
":",
"non",
"-",
"patterned",
"dataset",
"non",
"-",
"patterned",
"block",
"non",
"-",
"patterned",
"dataset",
"with",
"lfn",
"non",
"-",
"patterned",
"block",
"with",
"lfn",
"non",
"-",... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L182-L249 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.insertFile | def insertFile(self, businput, qInserts=False):
"""
This method supports bulk insert of files
performing other operations such as setting Block and Dataset parentages,
setting mapping between OutputConfigModules and File(s) etc.
:param qInserts: True means that inserts will be q... | python | def insertFile(self, businput, qInserts=False):
"""
This method supports bulk insert of files
performing other operations such as setting Block and Dataset parentages,
setting mapping between OutputConfigModules and File(s) etc.
:param qInserts: True means that inserts will be q... | [
"def",
"insertFile",
"(",
"self",
",",
"businput",
",",
"qInserts",
"=",
"False",
")",
":",
"# We do not want to go be beyond 10 files at a time",
"# If user wants to insert over 10 files in one shot, we run into risks of locking the database",
"# tables for longer time, and in case of e... | This method supports bulk insert of files
performing other operations such as setting Block and Dataset parentages,
setting mapping between OutputConfigModules and File(s) etc.
:param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform... | [
"This",
"method",
"supports",
"bulk",
"insert",
"of",
"files",
"performing",
"other",
"operations",
"such",
"as",
"setting",
"Block",
"and",
"Dataset",
"parentages",
"setting",
"mapping",
"between",
"OutputConfigModules",
"and",
"File",
"(",
"s",
")",
"etc",
"."... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L250-L513 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSFile.py | DBSFile.insertFileParents | def insertFileParents(self, businput):
"""
This is a special function for WMAgent only.
input block_name: is a child block name.
input chils_parent_id_list: is a list of file id of child, parent pair: [[cid1, pid1],[cid2,pid2],[cid3,pid3],...]
The requirment for this API... | python | def insertFileParents(self, businput):
"""
This is a special function for WMAgent only.
input block_name: is a child block name.
input chils_parent_id_list: is a list of file id of child, parent pair: [[cid1, pid1],[cid2,pid2],[cid3,pid3],...]
The requirment for this API... | [
"def",
"insertFileParents",
"(",
"self",
",",
"businput",
")",
":",
"if",
"\"block_name\"",
"not",
"in",
"businput",
".",
"keys",
"(",
")",
"or",
"\"child_parent_id_list\"",
"not",
"in",
"businput",
".",
"keys",
"(",
")",
"or",
"not",
"businput",
"[",
"\"c... | This is a special function for WMAgent only.
input block_name: is a child block name.
input chils_parent_id_list: is a list of file id of child, parent pair: [[cid1, pid1],[cid2,pid2],[cid3,pid3],...]
The requirment for this API is
1. All the child files belong to the block.
... | [
"This",
"is",
"a",
"special",
"function",
"for",
"WMAgent",
"only",
".",
"input",
"block_name",
":",
"is",
"a",
"child",
"block",
"name",
".",
"input",
"chils_parent_id_list",
":",
"is",
"a",
"list",
"of",
"file",
"id",
"of",
"child",
"parent",
"pair",
"... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFile.py#L515-L557 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/SequenceManager.py | SequenceManager.increment | def increment(self, conn, seqName, transaction = False, incCount=1):
"""
increments the sequence `seqName` by default `Incremented by`
and returns its value
incCount: is UNUSED variable in Oracle implementation
"""
#FIXME: Do we need to lock the tables here?
sql... | python | def increment(self, conn, seqName, transaction = False, incCount=1):
"""
increments the sequence `seqName` by default `Incremented by`
and returns its value
incCount: is UNUSED variable in Oracle implementation
"""
#FIXME: Do we need to lock the tables here?
sql... | [
"def",
"increment",
"(",
"self",
",",
"conn",
",",
"seqName",
",",
"transaction",
"=",
"False",
",",
"incCount",
"=",
"1",
")",
":",
"#FIXME: Do we need to lock the tables here?",
"sql",
"=",
"\"select %s%s.nextval as val from dual\"",
"%",
"(",
"self",
".",
"owne... | increments the sequence `seqName` by default `Incremented by`
and returns its value
incCount: is UNUSED variable in Oracle implementation | [
"increments",
"the",
"sequence",
"seqName",
"by",
"default",
"Incremented",
"by",
"and",
"returns",
"its",
"value",
"incCount",
":",
"is",
"UNUSED",
"variable",
"in",
"Oracle",
"implementation"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/SequenceManager.py#L17-L29 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSReleaseVersion.py | DBSReleaseVersion.listReleaseVersions | def listReleaseVersions(self, release_version="", dataset='', logical_file_name=''):
"""
List release versions
"""
if dataset and ('%' in dataset or '*' in dataset):
dbsExceptionHandler('dbsException-invalid-input',
" DBSReleaseVersion/listReleaseVersions. No ... | python | def listReleaseVersions(self, release_version="", dataset='', logical_file_name=''):
"""
List release versions
"""
if dataset and ('%' in dataset or '*' in dataset):
dbsExceptionHandler('dbsException-invalid-input',
" DBSReleaseVersion/listReleaseVersions. No ... | [
"def",
"listReleaseVersions",
"(",
"self",
",",
"release_version",
"=",
"\"\"",
",",
"dataset",
"=",
"''",
",",
"logical_file_name",
"=",
"''",
")",
":",
"if",
"dataset",
"and",
"(",
"'%'",
"in",
"dataset",
"or",
"'*'",
"in",
"dataset",
")",
":",
"dbsExc... | List release versions | [
"List",
"release",
"versions"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSReleaseVersion.py#L23-L50 | train |
dmwm/DBS | PycurlClient/src/python/RestClient/AuthHandling/X509Auth.py | X509Auth.__search_ca_path | def __search_ca_path(self):
"""
Get CA Path to check the validity of the server host certificate on the client side
"""
if "X509_CERT_DIR" in os.environ:
self._ca_path = os.environ['X509_CERT_DIR']
elif os.path.exists('/etc/grid-security/certificates'):
s... | python | def __search_ca_path(self):
"""
Get CA Path to check the validity of the server host certificate on the client side
"""
if "X509_CERT_DIR" in os.environ:
self._ca_path = os.environ['X509_CERT_DIR']
elif os.path.exists('/etc/grid-security/certificates'):
s... | [
"def",
"__search_ca_path",
"(",
"self",
")",
":",
"if",
"\"X509_CERT_DIR\"",
"in",
"os",
".",
"environ",
":",
"self",
".",
"_ca_path",
"=",
"os",
".",
"environ",
"[",
"'X509_CERT_DIR'",
"]",
"elif",
"os",
".",
"path",
".",
"exists",
"(",
"'/etc/grid-securi... | Get CA Path to check the validity of the server host certificate on the client side | [
"Get",
"CA",
"Path",
"to",
"check",
"the",
"validity",
"of",
"the",
"server",
"host",
"certificate",
"on",
"the",
"client",
"side"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/PycurlClient/src/python/RestClient/AuthHandling/X509Auth.py#L26-L37 | train |
dmwm/DBS | PycurlClient/src/python/RestClient/AuthHandling/X509Auth.py | X509Auth.__search_cert_key | def __search_cert_key(self):
"""
Get the user credentials if they exist, otherwise throw an exception.
This code was modified from DBSAPI/dbsHttpService.py and WMCore/Services/Requests.py
"""
# Now we're trying to guess what the right cert/key combo is...
# First preferen... | python | def __search_cert_key(self):
"""
Get the user credentials if they exist, otherwise throw an exception.
This code was modified from DBSAPI/dbsHttpService.py and WMCore/Services/Requests.py
"""
# Now we're trying to guess what the right cert/key combo is...
# First preferen... | [
"def",
"__search_cert_key",
"(",
"self",
")",
":",
"# Now we're trying to guess what the right cert/key combo is...",
"# First preference to HOST Certificate, This is how it set in Tier0",
"if",
"'X509_HOST_CERT'",
"in",
"os",
".",
"environ",
":",
"self",
".",
"_ssl_cert",
"=",
... | Get the user credentials if they exist, otherwise throw an exception.
This code was modified from DBSAPI/dbsHttpService.py and WMCore/Services/Requests.py | [
"Get",
"the",
"user",
"credentials",
"if",
"they",
"exist",
"otherwise",
"throw",
"an",
"exception",
".",
"This",
"code",
"was",
"modified",
"from",
"DBSAPI",
"/",
"dbsHttpService",
".",
"py",
"and",
"WMCore",
"/",
"Services",
"/",
"Requests",
".",
"py"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/PycurlClient/src/python/RestClient/AuthHandling/X509Auth.py#L39-L83 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSMigrateModel.py | authInsert | def authInsert(user, role, group, site):
"""
Authorization function for general insert
"""
if not role: return True
for k, v in user['roles'].iteritems():
for g in v['group']:
if k in role.get(g, '').split(':'):
return True
return False | python | def authInsert(user, role, group, site):
"""
Authorization function for general insert
"""
if not role: return True
for k, v in user['roles'].iteritems():
for g in v['group']:
if k in role.get(g, '').split(':'):
return True
return False | [
"def",
"authInsert",
"(",
"user",
",",
"role",
",",
"group",
",",
"site",
")",
":",
"if",
"not",
"role",
":",
"return",
"True",
"for",
"k",
",",
"v",
"in",
"user",
"[",
"'roles'",
"]",
".",
"iteritems",
"(",
")",
":",
"for",
"g",
"in",
"v",
"["... | Authorization function for general insert | [
"Authorization",
"function",
"for",
"general",
"insert"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSMigrateModel.py#L32-L41 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSMigrateModel.py | DBSMigrateModel.submit | def submit(self):
"""
Interface for submitting a migration request.
Required input keys:
MIGRATION_URL: The source DBS url for migration.
MIGRATION_INPUT: The block or dataset names to be migrated.
"""
body = request.body.read()
indata = cjson.decode(body)... | python | def submit(self):
"""
Interface for submitting a migration request.
Required input keys:
MIGRATION_URL: The source DBS url for migration.
MIGRATION_INPUT: The block or dataset names to be migrated.
"""
body = request.body.read()
indata = cjson.decode(body)... | [
"def",
"submit",
"(",
"self",
")",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"indata",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"try",
":",
"indata",
"=",
"validateJSONInputNoCopy",
"(",
"\"migration_rqst\"",
",",
"indata",
... | Interface for submitting a migration request.
Required input keys:
MIGRATION_URL: The source DBS url for migration.
MIGRATION_INPUT: The block or dataset names to be migrated. | [
"Interface",
"for",
"submitting",
"a",
"migration",
"request",
".",
"Required",
"input",
"keys",
":",
"MIGRATION_URL",
":",
"The",
"source",
"DBS",
"url",
"for",
"migration",
".",
"MIGRATION_INPUT",
":",
"The",
"block",
"or",
"dataset",
"names",
"to",
"be",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSMigrateModel.py#L68-L93 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSMigrateModel.py | DBSMigrateModel.status | def status(self, migration_rqst_id="", block_name="", dataset="", user=""):
"""
Interface to query status of a migration request
In this preference order of input parameters :
migration_rqst_id, block, dataset, user
(if multi parameters are provided, only the precedence o... | python | def status(self, migration_rqst_id="", block_name="", dataset="", user=""):
"""
Interface to query status of a migration request
In this preference order of input parameters :
migration_rqst_id, block, dataset, user
(if multi parameters are provided, only the precedence o... | [
"def",
"status",
"(",
"self",
",",
"migration_rqst_id",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"user",
"=",
"\"\"",
")",
":",
"try",
":",
"return",
"self",
".",
"dbsMigrate",
".",
"listMigrationRequests",
"(",
"mig... | Interface to query status of a migration request
In this preference order of input parameters :
migration_rqst_id, block, dataset, user
(if multi parameters are provided, only the precedence order is followed) | [
"Interface",
"to",
"query",
"status",
"of",
"a",
"migration",
"request",
"In",
"this",
"preference",
"order",
"of",
"input",
"parameters",
":",
"migration_rqst_id",
"block",
"dataset",
"user",
"(",
"if",
"multi",
"parameters",
"are",
"provided",
"only",
"the",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSMigrateModel.py#L96-L114 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSMigrateModel.py | DBSMigrateModel.remove | def remove(self):
"""
Interface to remove a migration request from the queue.
Only Permanent FAILED/9 and PENDING/0 requests can be removed
(running and sucessed requests cannot be removed)
"""
body = request.body.read()
indata = cjson.decode(body)
try:
... | python | def remove(self):
"""
Interface to remove a migration request from the queue.
Only Permanent FAILED/9 and PENDING/0 requests can be removed
(running and sucessed requests cannot be removed)
"""
body = request.body.read()
indata = cjson.decode(body)
try:
... | [
"def",
"remove",
"(",
"self",
")",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"indata",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"try",
":",
"indata",
"=",
"validateJSONInputNoCopy",
"(",
"\"migration_rqst\"",
",",
"indata",
... | Interface to remove a migration request from the queue.
Only Permanent FAILED/9 and PENDING/0 requests can be removed
(running and sucessed requests cannot be removed) | [
"Interface",
"to",
"remove",
"a",
"migration",
"request",
"from",
"the",
"queue",
".",
"Only",
"Permanent",
"FAILED",
"/",
"9",
"and",
"PENDING",
"/",
"0",
"requests",
"can",
"be",
"removed",
"(",
"running",
"and",
"sucessed",
"requests",
"cannot",
"be",
"... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSMigrateModel.py#L116-L134 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/FileParent/List.py | List.execute | def execute(self, conn, logical_file_name='', block_id=0, block_name='', transaction=False):
"""
return {} if condition is not provided.
"""
sql = ''
binds = {}
if logical_file_name:
if isinstance(logical_file_name, basestring):
wheresql = "WH... | python | def execute(self, conn, logical_file_name='', block_id=0, block_name='', transaction=False):
"""
return {} if condition is not provided.
"""
sql = ''
binds = {}
if logical_file_name:
if isinstance(logical_file_name, basestring):
wheresql = "WH... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"logical_file_name",
"=",
"''",
",",
"block_id",
"=",
"0",
",",
"block_name",
"=",
"''",
",",
"transaction",
"=",
"False",
")",
":",
"sql",
"=",
"''",
"binds",
"=",
"{",
"}",
"if",
"logical_file_name",
... | return {} if condition is not provided. | [
"return",
"{}",
"if",
"condition",
"is",
"not",
"provided",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileParent/List.py#L31-L67 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSDataset.py | DBSDataset.listDatasetParents | def listDatasetParents(self, dataset=""):
"""
takes required dataset parameter
returns only parent dataset name
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/listDatasetParents. Child Dataset name is required.")
conn = ... | python | def listDatasetParents(self, dataset=""):
"""
takes required dataset parameter
returns only parent dataset name
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/listDatasetParents. Child Dataset name is required.")
conn = ... | [
"def",
"listDatasetParents",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
")",
":",
"if",
"(",
"dataset",
"==",
"\"\"",
")",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-invalid-input\"",
",",
"\"DBSDataset/listDatasetParents. Child Dataset name is required.\"",
")",
"... | takes required dataset parameter
returns only parent dataset name | [
"takes",
"required",
"dataset",
"parameter",
"returns",
"only",
"parent",
"dataset",
"name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataset.py#L42-L55 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSDataset.py | DBSDataset.listDatasetChildren | def listDatasetChildren(self, dataset):
"""
takes required dataset parameter
returns only children dataset name
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/listDatasetChildren. Parent Dataset name is required.")
conn ... | python | def listDatasetChildren(self, dataset):
"""
takes required dataset parameter
returns only children dataset name
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/listDatasetChildren. Parent Dataset name is required.")
conn ... | [
"def",
"listDatasetChildren",
"(",
"self",
",",
"dataset",
")",
":",
"if",
"(",
"dataset",
"==",
"\"\"",
")",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-invalid-input\"",
",",
"\"DBSDataset/listDatasetChildren. Parent Dataset name is required.\"",
")",
"conn",
"=",
... | takes required dataset parameter
returns only children dataset name | [
"takes",
"required",
"dataset",
"parameter",
"returns",
"only",
"children",
"dataset",
"name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataset.py#L57-L70 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSDataset.py | DBSDataset.updateStatus | def updateStatus(self, dataset, is_dataset_valid):
"""
Used to toggle the status of a dataset is_dataset_valid=0/1 (invalid/valid)
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/updateStatus. dataset is required.")
conn = self... | python | def updateStatus(self, dataset, is_dataset_valid):
"""
Used to toggle the status of a dataset is_dataset_valid=0/1 (invalid/valid)
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/updateStatus. dataset is required.")
conn = self... | [
"def",
"updateStatus",
"(",
"self",
",",
"dataset",
",",
"is_dataset_valid",
")",
":",
"if",
"(",
"dataset",
"==",
"\"\"",
")",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-invalid-input\"",
",",
"\"DBSDataset/updateStatus. dataset is required.\"",
")",
"conn",
"=... | Used to toggle the status of a dataset is_dataset_valid=0/1 (invalid/valid) | [
"Used",
"to",
"toggle",
"the",
"status",
"of",
"a",
"dataset",
"is_dataset_valid",
"=",
"0",
"/",
"1",
"(",
"invalid",
"/",
"valid",
")"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataset.py#L72-L94 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSDataset.py | DBSDataset.updateType | def updateType(self, dataset, dataset_access_type):
"""
Used to change the status of a dataset type (production/etc.)
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/updateType. dataset is required.")
conn = self.dbi.connection(... | python | def updateType(self, dataset, dataset_access_type):
"""
Used to change the status of a dataset type (production/etc.)
"""
if( dataset == "" ):
dbsExceptionHandler("dbsException-invalid-input", "DBSDataset/updateType. dataset is required.")
conn = self.dbi.connection(... | [
"def",
"updateType",
"(",
"self",
",",
"dataset",
",",
"dataset_access_type",
")",
":",
"if",
"(",
"dataset",
"==",
"\"\"",
")",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-invalid-input\"",
",",
"\"DBSDataset/updateType. dataset is required.\"",
")",
"conn",
"="... | Used to change the status of a dataset type (production/etc.) | [
"Used",
"to",
"change",
"the",
"status",
"of",
"a",
"dataset",
"type",
"(",
"production",
"/",
"etc",
".",
")"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataset.py#L96-L117 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSDataset.py | DBSDataset.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="", run_num=-1, physics_group_name="",
... | 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="", run_num=-1, physics_group_name="",
... | [
"def",
"listDatasets",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"parent_dataset",
"=",
"\"\"",
",",
"is_dataset_valid",
"=",
"1",
",",
"release_version",
"=",
"\"\"",
",",
"pset_hash",
"=",
"\"\"",
",",
"app_name",
"=",
"\"\"",
",",
"output_module_labe... | lists all datasets if dataset parameter is not given.
The parameter can include % character.
all other parameters are not wild card ones. | [
"lists",
"all",
"datasets",
"if",
"dataset",
"parameter",
"is",
"not",
"given",
".",
"The",
"parameter",
"can",
"include",
"%",
"character",
".",
"all",
"other",
"parameters",
"are",
"not",
"wild",
"card",
"ones",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataset.py#L119-L160 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSDataset.py | DBSDataset.insertDataset | def insertDataset(self, businput):
"""
input dictionary must have the following keys:
dataset, primary_ds_name(name), processed_ds(name), data_tier(name),
acquisition_era(name), processing_version
It may have following keys:
physics_group(name), xtcrosssection, creation_d... | python | def insertDataset(self, businput):
"""
input dictionary must have the following keys:
dataset, primary_ds_name(name), processed_ds(name), data_tier(name),
acquisition_era(name), processing_version
It may have following keys:
physics_group(name), xtcrosssection, creation_d... | [
"def",
"insertDataset",
"(",
"self",
",",
"businput",
")",
":",
"if",
"not",
"(",
"\"primary_ds_name\"",
"in",
"businput",
"and",
"\"dataset\"",
"in",
"businput",
"and",
"\"dataset_access_type\"",
"in",
"businput",
"and",
"\"processed_ds_name\"",
"in",
"businput",
... | input dictionary must have the following keys:
dataset, primary_ds_name(name), processed_ds(name), data_tier(name),
acquisition_era(name), processing_version
It may have following keys:
physics_group(name), xtcrosssection, creation_date, create_by,
last_modification_date, last_m... | [
"input",
"dictionary",
"must",
"have",
"the",
"following",
"keys",
":",
"dataset",
"primary_ds_name",
"(",
"name",
")",
"processed_ds",
"(",
"name",
")",
"data_tier",
"(",
"name",
")",
"acquisition_era",
"(",
"name",
")",
"processing_version",
"It",
"may",
"ha... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataset.py#L188-L337 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/Block/UpdateSiteName.py | UpdateSiteName.execute | def execute(self, conn, block_name, origin_site_name, transaction=False):
"""
Update origin_site_name for a given block_name
"""
if not conn:
dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/Block/UpdateStatus. \
Expects db connection from upper layer.", self.l... | python | def execute(self, conn, block_name, origin_site_name, transaction=False):
"""
Update origin_site_name for a given block_name
"""
if not conn:
dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/Block/UpdateStatus. \
Expects db connection from upper layer.", self.l... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"block_name",
",",
"origin_site_name",
",",
"transaction",
"=",
"False",
")",
":",
"if",
"not",
"conn",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-failed-connect2host\"",
",",
"\"Oracle/Block/UpdateStatus. \\\nExp... | Update origin_site_name for a given block_name | [
"Update",
"origin_site_name",
"for",
"a",
"given",
"block_name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/Block/UpdateSiteName.py#L25-L34 | train |
dmwm/DBS | Server/Python/src/dbs/dao/MySQL/SequenceManager.py | SequenceManager.increment | def increment(self, conn, seqName, transaction = False, incCount=1):
"""
increments the sequence `seqName` by default `Incremented by one`
and returns its value
"""
try:
seqTable = "%sS" %seqName
tlock = "lock tables %s write" %seqTable
self.dbi.processData(tlock, [], con... | python | def increment(self, conn, seqName, transaction = False, incCount=1):
"""
increments the sequence `seqName` by default `Incremented by one`
and returns its value
"""
try:
seqTable = "%sS" %seqName
tlock = "lock tables %s write" %seqTable
self.dbi.processData(tlock, [], con... | [
"def",
"increment",
"(",
"self",
",",
"conn",
",",
"seqName",
",",
"transaction",
"=",
"False",
",",
"incCount",
"=",
"1",
")",
":",
"try",
":",
"seqTable",
"=",
"\"%sS\"",
"%",
"seqName",
"tlock",
"=",
"\"lock tables %s write\"",
"%",
"seqTable",
"self",
... | increments the sequence `seqName` by default `Incremented by one`
and returns its value | [
"increments",
"the",
"sequence",
"seqName",
"by",
"default",
"Incremented",
"by",
"one",
"and",
"returns",
"its",
"value"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/MySQL/SequenceManager.py#L15-L38 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSRun.py | DBSRun.listRuns | def listRuns(self, run_num=-1, logical_file_name="",
block_name="", dataset=""):
"""
List run known to DBS.
"""
if( '%' in logical_file_name or '%' in block_name or '%' in dataset ):
dbsExceptionHandler('dbsException-invalid-input',
... | python | def listRuns(self, run_num=-1, logical_file_name="",
block_name="", dataset=""):
"""
List run known to DBS.
"""
if( '%' in logical_file_name or '%' in block_name or '%' in dataset ):
dbsExceptionHandler('dbsException-invalid-input',
... | [
"def",
"listRuns",
"(",
"self",
",",
"run_num",
"=",
"-",
"1",
",",
"logical_file_name",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
")",
":",
"if",
"(",
"'%'",
"in",
"logical_file_name",
"or",
"'%'",
"in",
"block_name",
"... | List run known to DBS. | [
"List",
"run",
"known",
"to",
"DBS",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSRun.py#L27-L48 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSWriterModel.py | insertPrimaryDataset | def insertPrimaryDataset(self):
"""
API to insert A primary dataset in DBS
:param primaryDSObj: primary dataset object
:type primaryDSObj: dict
:key primary_ds_type: TYPE (out of valid types in DBS, MC, DATA) (Required)
:key primary_ds_name: Name of the primary dataset (... | python | def insertPrimaryDataset(self):
"""
API to insert A primary dataset in DBS
:param primaryDSObj: primary dataset object
:type primaryDSObj: dict
:key primary_ds_type: TYPE (out of valid types in DBS, MC, DATA) (Required)
:key primary_ds_name: Name of the primary dataset (... | [
"def",
"insertPrimaryDataset",
"(",
"self",
")",
":",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"indata",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"indata",
"=",
"validateJSONInputNoCopy",
"(",
"\"primds\"",
",",
"inda... | API to insert A primary dataset in DBS
:param primaryDSObj: primary dataset object
:type primaryDSObj: dict
:key primary_ds_type: TYPE (out of valid types in DBS, MC, DATA) (Required)
:key primary_ds_name: Name of the primary dataset (Required) | [
"API",
"to",
"insert",
"A",
"primary",
"dataset",
"in",
"DBS"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSWriterModel.py#L73-L98 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSWriterModel.py | updateAcqEraEndDate | def updateAcqEraEndDate(self, acquisition_era_name ="", end_date=0):
"""
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)
... | python | def updateAcqEraEndDate(self, acquisition_era_name ="", end_date=0):
"""
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)
... | [
"def",
"updateAcqEraEndDate",
"(",
"self",
",",
"acquisition_era_name",
"=",
"\"\"",
",",
"end_date",
"=",
"0",
")",
":",
"try",
":",
"self",
".",
"dbsAcqEra",
".",
"UpdateAcqEraEndDate",
"(",
"acquisition_era_name",
",",
"end_date",
")",
"except",
"dbsException... | API to update the end_date of an acquisition era
:param acquisition_era_name: acquisition_era_name to update (Required)
:type acquisition_era_name: str
:param end_date: end_date not zero (Required)
:type end_date: int | [
"API",
"to",
"update",
"the",
"end_date",
"of",
"an",
"acquisition",
"era"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSWriterModel.py#L134-L153 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSWriterModel.py | insertBulkBlock | def insertBulkBlock(self):
"""
API to insert a bulk block
:param blockDump: Output of the block dump command
:type blockDump: dict
"""
try:
body = request.body.read()
indata = cjson.decode(body)
if (indata.get("file_parent_list", []) ... | python | def insertBulkBlock(self):
"""
API to insert a bulk block
:param blockDump: Output of the block dump command
:type blockDump: dict
"""
try:
body = request.body.read()
indata = cjson.decode(body)
if (indata.get("file_parent_list", []) ... | [
"def",
"insertBulkBlock",
"(",
"self",
")",
":",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"indata",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"if",
"(",
"indata",
".",
"get",
"(",
"\"file_parent_list\"",
",",
"[",
... | API to insert a bulk block
:param blockDump: Output of the block dump command
:type blockDump: dict | [
"API",
"to",
"insert",
"a",
"bulk",
"block"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSWriterModel.py#L254-L283 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSWriterModel.py | insertBlock | def insertBlock(self):
"""
API to insert a block into DBS
:param blockObj: Block object
:type blockObj: dict
:key open_for_writing: Open For Writing (1/0) (Optional, default 1)
:key block_size: Block Size (Optional, default 0)
:key file_count: File Count (Optiona... | python | def insertBlock(self):
"""
API to insert a block into DBS
:param blockObj: Block object
:type blockObj: dict
:key open_for_writing: Open For Writing (1/0) (Optional, default 1)
:key block_size: Block Size (Optional, default 0)
:key file_count: File Count (Optiona... | [
"def",
"insertBlock",
"(",
"self",
")",
":",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"indata",
"=",
"cjson",
".",
"decode",
"(",
"body",
")",
"indata",
"=",
"validateJSONInputNoCopy",
"(",
"\"block\"",
",",
"indata",
")"... | API to insert a block into DBS
:param blockObj: Block object
:type blockObj: dict
:key open_for_writing: Open For Writing (1/0) (Optional, default 1)
:key block_size: Block Size (Optional, default 0)
:key file_count: File Count (Optional, default 0)
:key block_name: Bloc... | [
"API",
"to",
"insert",
"a",
"block",
"into",
"DBS"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSWriterModel.py#L315-L340 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSWriterModel.py | insertFile | def insertFile(self, 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 minutes.
... | python | def insertFile(self, 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 minutes.
... | [
"def",
"insertFile",
"(",
"self",
",",
"qInserts",
"=",
"False",
")",
":",
"if",
"qInserts",
"in",
"(",
"False",
",",
"'False'",
")",
":",
"qInserts",
"=",
"False",
"try",
":",
"body",
"=",
"request",
".",
"body",
".",
"read",
"(",
")",
"indata",
"... | API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request.
:param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minutes.
:type qInserts: bool
:param filesList: List of dic... | [
"API",
"to",
"insert",
"a",
"list",
"of",
"file",
"into",
"DBS",
"in",
"DBS",
".",
"Up",
"to",
"10",
"files",
"can",
"be",
"inserted",
"in",
"one",
"request",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSWriterModel.py#L342-L400 | train |
dmwm/DBS | Server/Python/src/dbs/web/DBSWriterModel.py | updateFile | def updateFile(self, logical_file_name=[], is_file_valid=1, lost=0, dataset=''):
"""
API to update file status
:param logical_file_name: logical_file_name to update (optional), but must have either a fln or
a dataset
:type logical_file_name: str
:param is_file_valid: va... | python | def updateFile(self, logical_file_name=[], is_file_valid=1, lost=0, dataset=''):
"""
API to update file status
:param logical_file_name: logical_file_name to update (optional), but must have either a fln or
a dataset
:type logical_file_name: str
:param is_file_valid: va... | [
"def",
"updateFile",
"(",
"self",
",",
"logical_file_name",
"=",
"[",
"]",
",",
"is_file_valid",
"=",
"1",
",",
"lost",
"=",
"0",
",",
"dataset",
"=",
"''",
")",
":",
"if",
"lost",
"in",
"[",
"1",
",",
"True",
",",
"'True'",
",",
"'true'",
",",
"... | API to update file status
:param logical_file_name: logical_file_name to update (optional), but must have either a fln or
a dataset
:type logical_file_name: str
:param is_file_valid: valid=1, invalid=0 (Required)
:type is_file_valid: bool
:param lost: default lost=0 (op... | [
"API",
"to",
"update",
"file",
"status"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSWriterModel.py#L404-L437 | train |
closeio/flask-ipblock | flask_ipblock/documents.py | IPNetwork.create_from_string | def create_from_string(cls, cidr, label=None, whitelist=False):
"""
Converts a CIDR like 192.168.0.0/24 into 2 parts:
start: 3232235520
stop: 3232235775
"""
network = netaddr.IPNetwork(cidr)
start = network.first
stop = start + network.size - 1
... | python | def create_from_string(cls, cidr, label=None, whitelist=False):
"""
Converts a CIDR like 192.168.0.0/24 into 2 parts:
start: 3232235520
stop: 3232235775
"""
network = netaddr.IPNetwork(cidr)
start = network.first
stop = start + network.size - 1
... | [
"def",
"create_from_string",
"(",
"cls",
",",
"cidr",
",",
"label",
"=",
"None",
",",
"whitelist",
"=",
"False",
")",
":",
"network",
"=",
"netaddr",
".",
"IPNetwork",
"(",
"cidr",
")",
"start",
"=",
"network",
".",
"first",
"stop",
"=",
"start",
"+",
... | Converts a CIDR like 192.168.0.0/24 into 2 parts:
start: 3232235520
stop: 3232235775 | [
"Converts",
"a",
"CIDR",
"like",
"192",
".",
"168",
".",
"0",
".",
"0",
"/",
"24",
"into",
"2",
"parts",
":",
"start",
":",
"3232235520",
"stop",
":",
"3232235775"
] | d4d6d50e4a7d1ba7aa0f8d7298ee8d63d25b644f | https://github.com/closeio/flask-ipblock/blob/d4d6d50e4a7d1ba7aa0f8d7298ee8d63d25b644f/flask_ipblock/documents.py#L20-L31 | train |
closeio/flask-ipblock | flask_ipblock/documents.py | IPNetwork.qs_for_ip | def qs_for_ip(cls, ip_str):
"""
Returns a queryset with matching IPNetwork objects for the given IP.
"""
ip = int(netaddr.IPAddress(ip_str))
# ignore IPv6 addresses for now (4294967295 is 0xffffffff, aka the
# biggest 32-bit number)
if ip > 4294967295:
... | python | def qs_for_ip(cls, ip_str):
"""
Returns a queryset with matching IPNetwork objects for the given IP.
"""
ip = int(netaddr.IPAddress(ip_str))
# ignore IPv6 addresses for now (4294967295 is 0xffffffff, aka the
# biggest 32-bit number)
if ip > 4294967295:
... | [
"def",
"qs_for_ip",
"(",
"cls",
",",
"ip_str",
")",
":",
"ip",
"=",
"int",
"(",
"netaddr",
".",
"IPAddress",
"(",
"ip_str",
")",
")",
"# ignore IPv6 addresses for now (4294967295 is 0xffffffff, aka the",
"# biggest 32-bit number)",
"if",
"ip",
">",
"4294967295",
":"... | Returns a queryset with matching IPNetwork objects for the given IP. | [
"Returns",
"a",
"queryset",
"with",
"matching",
"IPNetwork",
"objects",
"for",
"the",
"given",
"IP",
"."
] | d4d6d50e4a7d1ba7aa0f8d7298ee8d63d25b644f | https://github.com/closeio/flask-ipblock/blob/d4d6d50e4a7d1ba7aa0f8d7298ee8d63d25b644f/flask_ipblock/documents.py#L40-L56 | train |
closeio/flask-ipblock | flask_ipblock/documents.py | IPNetwork.matches_ip | def matches_ip(cls, ip_str, read_preference=None):
"""
Return True if provided IP exists in the blacklist and doesn't exist
in the whitelist. Otherwise, return False.
"""
qs = cls.qs_for_ip(ip_str).only('whitelist')
if read_preference:
qs = qs.read_preference(... | python | def matches_ip(cls, ip_str, read_preference=None):
"""
Return True if provided IP exists in the blacklist and doesn't exist
in the whitelist. Otherwise, return False.
"""
qs = cls.qs_for_ip(ip_str).only('whitelist')
if read_preference:
qs = qs.read_preference(... | [
"def",
"matches_ip",
"(",
"cls",
",",
"ip_str",
",",
"read_preference",
"=",
"None",
")",
":",
"qs",
"=",
"cls",
".",
"qs_for_ip",
"(",
"ip_str",
")",
".",
"only",
"(",
"'whitelist'",
")",
"if",
"read_preference",
":",
"qs",
"=",
"qs",
".",
"read_prefe... | Return True if provided IP exists in the blacklist and doesn't exist
in the whitelist. Otherwise, return False. | [
"Return",
"True",
"if",
"provided",
"IP",
"exists",
"in",
"the",
"blacklist",
"and",
"doesn",
"t",
"exist",
"in",
"the",
"whitelist",
".",
"Otherwise",
"return",
"False",
"."
] | d4d6d50e4a7d1ba7aa0f8d7298ee8d63d25b644f | https://github.com/closeio/flask-ipblock/blob/d4d6d50e4a7d1ba7aa0f8d7298ee8d63d25b644f/flask_ipblock/documents.py#L59-L70 | train |
dmwm/DBS | Server/Python/src/dbs/utils/dbsExceptionHandler.py | dbsExceptionHandler | def dbsExceptionHandler(eCode='', message='', logger=None , serverError=''):
"""
This utility function handles all dbs exceptions. It will log , raise exception
based on input condition. It loggs the traceback on the server log. Send HTTPError 400
for invalid client input and HTTPError 404 for NOT FOUN... | python | def dbsExceptionHandler(eCode='', message='', logger=None , serverError=''):
"""
This utility function handles all dbs exceptions. It will log , raise exception
based on input condition. It loggs the traceback on the server log. Send HTTPError 400
for invalid client input and HTTPError 404 for NOT FOUN... | [
"def",
"dbsExceptionHandler",
"(",
"eCode",
"=",
"''",
",",
"message",
"=",
"''",
",",
"logger",
"=",
"None",
",",
"serverError",
"=",
"''",
")",
":",
"if",
"logger",
":",
"#HTTP Error",
"if",
"eCode",
"==",
"\"dbsException-invalid-input\"",
":",
"#logger(eC... | This utility function handles all dbs exceptions. It will log , raise exception
based on input condition. It loggs the traceback on the server log. Send HTTPError 400
for invalid client input and HTTPError 404 for NOT FOUND required pre-existing condition. | [
"This",
"utility",
"function",
"handles",
"all",
"dbs",
"exceptions",
".",
"It",
"will",
"log",
"raise",
"exception",
"based",
"on",
"input",
"condition",
".",
"It",
"loggs",
"the",
"traceback",
"on",
"the",
"server",
"log",
".",
"Send",
"HTTPError",
"400",
... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/utils/dbsExceptionHandler.py#L6-L40 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/FileBuffer/List.py | List.execute | def execute(self, conn, block_id="", transaction=False):
"""
simple execute
"""
if not conn:
dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/List. Expects db connection from upper layer.")
sql = self.sql
binds = { "block_id" : block_id}
cursor... | python | def execute(self, conn, block_id="", transaction=False):
"""
simple execute
"""
if not conn:
dbsExceptionHandler("dbsException-db-conn-failed", "Oracle/FileBuffer/List. Expects db connection from upper layer.")
sql = self.sql
binds = { "block_id" : block_id}
cursor... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"block_id",
"=",
"\"\"",
",",
"transaction",
"=",
"False",
")",
":",
"if",
"not",
"conn",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-db-conn-failed\"",
",",
"\"Oracle/FileBuffer/List. Expects db connection from up... | simple execute | [
"simple",
"execute"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileBuffer/List.py#L20-L31 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/PrimaryDataset/List.py | List.execute | def execute(self, conn, primary_ds_name="", primary_ds_type="", transaction=False):
"""
Lists all primary datasets if pattern is not provided.
"""
sql = self.sql
binds = {}
#import pdb
#pdb.set_trace()
if primary_ds_name and primary_ds_type in ('', None, ... | python | def execute(self, conn, primary_ds_name="", primary_ds_type="", transaction=False):
"""
Lists all primary datasets if pattern is not provided.
"""
sql = self.sql
binds = {}
#import pdb
#pdb.set_trace()
if primary_ds_name and primary_ds_type in ('', None, ... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"primary_ds_name",
"=",
"\"\"",
",",
"primary_ds_type",
"=",
"\"\"",
",",
"transaction",
"=",
"False",
")",
":",
"sql",
"=",
"self",
".",
"sql",
"binds",
"=",
"{",
"}",
"#import pdb",
"#pdb.set_trace()",
"... | Lists all primary datasets if pattern is not provided. | [
"Lists",
"all",
"primary",
"datasets",
"if",
"pattern",
"is",
"not",
"provided",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/PrimaryDataset/List.py#L31-L60 | train |
dmwm/DBS | PycurlClient/src/python/RestClient/ProxyPlugins/Socks5Proxy.py | Socks5Proxy.configure_proxy | def configure_proxy(self, curl_object):
"""configure pycurl proxy settings"""
curl_object.setopt(curl_object.PROXY, self._proxy_hostname)
curl_object.setopt(curl_object.PROXYPORT, self._proxy_port)
curl_object.setopt(curl_object.PROXYTYPE, curl_object.PROXYTYPE_SOCKS5)
if self._p... | python | def configure_proxy(self, curl_object):
"""configure pycurl proxy settings"""
curl_object.setopt(curl_object.PROXY, self._proxy_hostname)
curl_object.setopt(curl_object.PROXYPORT, self._proxy_port)
curl_object.setopt(curl_object.PROXYTYPE, curl_object.PROXYTYPE_SOCKS5)
if self._p... | [
"def",
"configure_proxy",
"(",
"self",
",",
"curl_object",
")",
":",
"curl_object",
".",
"setopt",
"(",
"curl_object",
".",
"PROXY",
",",
"self",
".",
"_proxy_hostname",
")",
"curl_object",
".",
"setopt",
"(",
"curl_object",
".",
"PROXYPORT",
",",
"self",
".... | configure pycurl proxy settings | [
"configure",
"pycurl",
"proxy",
"settings"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/PycurlClient/src/python/RestClient/ProxyPlugins/Socks5Proxy.py#L13-L19 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/FileParent/Insert2.py | Insert2.execute | def execute( self, conn, daoinput, transaction = False ):
"""
daoinput must be validated to have the following keys:
child_parent_id__list[[cid, pid],...], block_name
"""
binds = {}
bindlist=[]
if isinstance(daoinput, dict) and "block_name" in daoinput.k... | python | def execute( self, conn, daoinput, transaction = False ):
"""
daoinput must be validated to have the following keys:
child_parent_id__list[[cid, pid],...], block_name
"""
binds = {}
bindlist=[]
if isinstance(daoinput, dict) and "block_name" in daoinput.k... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"daoinput",
",",
"transaction",
"=",
"False",
")",
":",
"binds",
"=",
"{",
"}",
"bindlist",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"daoinput",
",",
"dict",
")",
"and",
"\"block_name\"",
"in",
"daoinput"... | daoinput must be validated to have the following keys:
child_parent_id__list[[cid, pid],...], block_name | [
"daoinput",
"must",
"be",
"validated",
"to",
"have",
"the",
"following",
"keys",
":",
"child_parent_id__list",
"[[",
"cid",
"pid",
"]",
"...",
"]",
"block_name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileParent/Insert2.py#L26-L55 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/AcquisitionEra/UpdateEndDate.py | UpdateEndDate.execute | def execute(self, conn, acquisition_era_name,end_date, transaction = False):
"""
for a given block_id
"""
if not conn:
dbsExceptionHandler("dbsException-failed-connect2host", "dbs/dao/Oracle/AcquisitionEra/updateEndDate expects db connection from upper layer.", self.logger.exception)
... | python | def execute(self, conn, acquisition_era_name,end_date, transaction = False):
"""
for a given block_id
"""
if not conn:
dbsExceptionHandler("dbsException-failed-connect2host", "dbs/dao/Oracle/AcquisitionEra/updateEndDate expects db connection from upper layer.", self.logger.exception)
... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"acquisition_era_name",
",",
"end_date",
",",
"transaction",
"=",
"False",
")",
":",
"if",
"not",
"conn",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-failed-connect2host\"",
",",
"\"dbs/dao/Oracle/AcquisitionEra/up... | for a given block_id | [
"for",
"a",
"given",
"block_id"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/AcquisitionEra/UpdateEndDate.py#L22-L29 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/MigrationBlock/Update.py | Update.execute | def execute(self, conn, daoinput, transaction = False):
"""
daoinput keys:
migration_status, migration_block_id, migration_request_id
"""
#print daoinput['migration_block_id']
if not conn:
dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationBlock/Updat... | python | def execute(self, conn, daoinput, transaction = False):
"""
daoinput keys:
migration_status, migration_block_id, migration_request_id
"""
#print daoinput['migration_block_id']
if not conn:
dbsExceptionHandler("dbsException-failed-connect2host", "Oracle/MigrationBlock/Updat... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"daoinput",
",",
"transaction",
"=",
"False",
")",
":",
"#print daoinput['migration_block_id']",
"if",
"not",
"conn",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-failed-connect2host\"",
",",
"\"Oracle/MigrationBlock/... | daoinput keys:
migration_status, migration_block_id, migration_request_id | [
"daoinput",
"keys",
":",
"migration_status",
"migration_block_id",
"migration_request_id"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/MigrationBlock/Update.py#L40-L72 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/FileParentBlock/List.py | List.execute | def execute(self, conn, file_id_list, transaction=False):
"""
file_id_list : file_id_list
"""
sql=self.sql
binds={}
if file_id_list:
count=0
for an_id in file_id_list:
if count > 0: sql += ", "
sql += ":file_id_%s" %count
binds.update({"file_id_%s" %count : an_id})
count+=1
sql += ")"
els... | python | def execute(self, conn, file_id_list, transaction=False):
"""
file_id_list : file_id_list
"""
sql=self.sql
binds={}
if file_id_list:
count=0
for an_id in file_id_list:
if count > 0: sql += ", "
sql += ":file_id_%s" %count
binds.update({"file_id_%s" %count : an_id})
count+=1
sql += ")"
els... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"file_id_list",
",",
"transaction",
"=",
"False",
")",
":",
"sql",
"=",
"self",
".",
"sql",
"binds",
"=",
"{",
"}",
"if",
"file_id_list",
":",
"count",
"=",
"0",
"for",
"an_id",
"in",
"file_id_list",
"... | file_id_list : file_id_list | [
"file_id_list",
":",
"file_id_list"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileParentBlock/List.py#L25-L44 | train |
dmwm/DBS | Server/Python/src/dbs/dao/Oracle/OutputModuleConfig/GetIDForBlockInsert.py | GetIDForBlockInsert.execute | def execute(self, conn, app, release_version, pset_hash, output_label, global_tag, transaction = False):
"""
returns id for a given application
This always requires all four variables to be set, because
you better have them in blockInsert
"""
binds = {}
binds["ap... | python | def execute(self, conn, app, release_version, pset_hash, output_label, global_tag, transaction = False):
"""
returns id for a given application
This always requires all four variables to be set, because
you better have them in blockInsert
"""
binds = {}
binds["ap... | [
"def",
"execute",
"(",
"self",
",",
"conn",
",",
"app",
",",
"release_version",
",",
"pset_hash",
",",
"output_label",
",",
"global_tag",
",",
"transaction",
"=",
"False",
")",
":",
"binds",
"=",
"{",
"}",
"binds",
"[",
"\"app_name\"",
"]",
"=",
"app",
... | returns id for a given application
This always requires all four variables to be set, because
you better have them in blockInsert | [
"returns",
"id",
"for",
"a",
"given",
"application"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/OutputModuleConfig/GetIDForBlockInsert.py#L32-L51 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.dumpBlock | def dumpBlock(self, block_name):
""" This method is used at source server and gets the
information on a single block that is being migrated.
Try to return in a format to be ready for insert calls"""
if '%' in block_name or '*' in block_name:
msg = "No wildcard is all... | python | def dumpBlock(self, block_name):
""" This method is used at source server and gets the
information on a single block that is being migrated.
Try to return in a format to be ready for insert calls"""
if '%' in block_name or '*' in block_name:
msg = "No wildcard is all... | [
"def",
"dumpBlock",
"(",
"self",
",",
"block_name",
")",
":",
"if",
"'%'",
"in",
"block_name",
"or",
"'*'",
"in",
"block_name",
":",
"msg",
"=",
"\"No wildcard is allowed in block_name for dumpBlock API\"",
"dbsExceptionHandler",
"(",
"'dbsException-invalid-input'",
","... | This method is used at source server and gets the
information on a single block that is being migrated.
Try to return in a format to be ready for insert calls | [
"This",
"method",
"is",
"used",
"at",
"source",
"server",
"and",
"gets",
"the",
"information",
"on",
"a",
"single",
"block",
"that",
"is",
"being",
"migrated",
".",
"Try",
"to",
"return",
"in",
"a",
"format",
"to",
"be",
"ready",
"for",
"insert",
"calls"... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L46-L138 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.updateStatus | def updateStatus(self, block_name="", open_for_writing=0):
"""
Used to toggle the status of a block open_for_writing=1, open for writing, open_for_writing=0, closed
"""
if open_for_writing not in [1, 0, '1', '0']:
msg = "DBSBlock/updateStatus. open_for_writing can only be 0 o... | python | def updateStatus(self, block_name="", open_for_writing=0):
"""
Used to toggle the status of a block open_for_writing=1, open for writing, open_for_writing=0, closed
"""
if open_for_writing not in [1, 0, '1', '0']:
msg = "DBSBlock/updateStatus. open_for_writing can only be 0 o... | [
"def",
"updateStatus",
"(",
"self",
",",
"block_name",
"=",
"\"\"",
",",
"open_for_writing",
"=",
"0",
")",
":",
"if",
"open_for_writing",
"not",
"in",
"[",
"1",
",",
"0",
",",
"'1'",
",",
"'0'",
"]",
":",
"msg",
"=",
"\"DBSBlock/updateStatus. open_for_wri... | Used to toggle the status of a block open_for_writing=1, open for writing, open_for_writing=0, closed | [
"Used",
"to",
"toggle",
"the",
"status",
"of",
"a",
"block",
"open_for_writing",
"=",
"1",
"open",
"for",
"writing",
"open_for_writing",
"=",
"0",
"closed"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L140-L161 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.updateSiteName | def updateSiteName(self, block_name, origin_site_name):
"""
Update the origin_site_name for a given block name
"""
if not origin_site_name:
dbsExceptionHandler('dbsException-invalid-input',
"DBSBlock/updateSiteName. origin_site_name is mandator... | python | def updateSiteName(self, block_name, origin_site_name):
"""
Update the origin_site_name for a given block name
"""
if not origin_site_name:
dbsExceptionHandler('dbsException-invalid-input',
"DBSBlock/updateSiteName. origin_site_name is mandator... | [
"def",
"updateSiteName",
"(",
"self",
",",
"block_name",
",",
"origin_site_name",
")",
":",
"if",
"not",
"origin_site_name",
":",
"dbsExceptionHandler",
"(",
"'dbsException-invalid-input'",
",",
"\"DBSBlock/updateSiteName. origin_site_name is mandatory.\"",
")",
"conn",
"="... | Update the origin_site_name for a given block name | [
"Update",
"the",
"origin_site_name",
"for",
"a",
"given",
"block",
"name"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L163-L183 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.listBlockParents | def listBlockParents(self, block_name=""):
"""
list parents of a block
"""
if not block_name:
msg = " DBSBlock/listBlockParents. Block_name must be provided as a string or a list. \
No wildcards allowed in block_name/s."
dbsExceptionHandler('dbsExc... | python | def listBlockParents(self, block_name=""):
"""
list parents of a block
"""
if not block_name:
msg = " DBSBlock/listBlockParents. Block_name must be provided as a string or a list. \
No wildcards allowed in block_name/s."
dbsExceptionHandler('dbsExc... | [
"def",
"listBlockParents",
"(",
"self",
",",
"block_name",
"=",
"\"\"",
")",
":",
"if",
"not",
"block_name",
":",
"msg",
"=",
"\" DBSBlock/listBlockParents. Block_name must be provided as a string or a list. \\\n No wildcards allowed in block_name/s.\"",
"dbsExceptio... | list parents of a block | [
"list",
"parents",
"of",
"a",
"block"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L185-L217 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.listBlockChildren | def listBlockChildren(self, block_name=""):
"""
list parents of a block
"""
if (not block_name) or re.search("['%','*']", block_name):
dbsExceptionHandler("dbsException-invalid-input", "DBSBlock/listBlockChildren. Block_name must be provided." )
conn = self.dbi.connec... | python | def listBlockChildren(self, block_name=""):
"""
list parents of a block
"""
if (not block_name) or re.search("['%','*']", block_name):
dbsExceptionHandler("dbsException-invalid-input", "DBSBlock/listBlockChildren. Block_name must be provided." )
conn = self.dbi.connec... | [
"def",
"listBlockChildren",
"(",
"self",
",",
"block_name",
"=",
"\"\"",
")",
":",
"if",
"(",
"not",
"block_name",
")",
"or",
"re",
".",
"search",
"(",
"\"['%','*']\"",
",",
"block_name",
")",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-invalid-input\"",
... | list parents of a block | [
"list",
"parents",
"of",
"a",
"block"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L219-L231 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.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):
"""
dataset, block_name, data_tier_na... | 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):
"""
dataset, block_name, data_tier_na... | [
"def",
"listBlocks",
"(",
"self",
",",
"dataset",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
",",
"data_tier_name",
"=",
"\"\"",
",",
"origin_site_name",
"=",
"\"\"",
",",
"logical_file_name",
"=",
"\"\"",
",",
"run_num",
"=",
"-",
"1",
",",
"min_cdate",... | dataset, block_name, data_tier_name or logical_file_name must be passed. | [
"dataset",
"block_name",
"data_tier_name",
"or",
"logical_file_name",
"must",
"be",
"passed",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L233-L260 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.listBlocksOrigin | def listBlocksOrigin(self, origin_site_name="", dataset="", block_name=""):
"""
This is the API to list all the blocks/datasets first generated in the site called origin_site_name,
if origin_site_name is provided w/ no wildcards allow. If a fully spelled dataset is provided, then it will
... | python | def listBlocksOrigin(self, origin_site_name="", dataset="", block_name=""):
"""
This is the API to list all the blocks/datasets first generated in the site called origin_site_name,
if origin_site_name is provided w/ no wildcards allow. If a fully spelled dataset is provided, then it will
... | [
"def",
"listBlocksOrigin",
"(",
"self",
",",
"origin_site_name",
"=",
"\"\"",
",",
"dataset",
"=",
"\"\"",
",",
"block_name",
"=",
"\"\"",
")",
":",
"if",
"not",
"(",
"dataset",
"or",
"block_name",
")",
":",
"dbsExceptionHandler",
"(",
"\"dbsException-invalid-... | This is the API to list all the blocks/datasets first generated in the site called origin_site_name,
if origin_site_name is provided w/ no wildcards allow. If a fully spelled dataset is provided, then it will
only list the blocks first generated from origin_site_name under the given dataset. | [
"This",
"is",
"the",
"API",
"to",
"list",
"all",
"the",
"blocks",
"/",
"datasets",
"first",
"generated",
"in",
"the",
"site",
"called",
"origin_site_name",
"if",
"origin_site_name",
"is",
"provided",
"w",
"/",
"no",
"wildcards",
"allow",
".",
"If",
"a",
"f... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L262-L280 | train |
dmwm/DBS | Server/Python/src/dbs/business/DBSBlock.py | DBSBlock.insertBlock | def insertBlock(self, businput):
"""
Input dictionary has to have the following keys:
blockname
It may have:
open_for_writing, origin_site(name), block_size,
file_count, creation_date, create_by, last_modification_date, last_modified_by
it builds... | python | def insertBlock(self, businput):
"""
Input dictionary has to have the following keys:
blockname
It may have:
open_for_writing, origin_site(name), block_size,
file_count, creation_date, create_by, last_modification_date, last_modified_by
it builds... | [
"def",
"insertBlock",
"(",
"self",
",",
"businput",
")",
":",
"if",
"not",
"(",
"\"block_name\"",
"in",
"businput",
"and",
"\"origin_site_name\"",
"in",
"businput",
")",
":",
"dbsExceptionHandler",
"(",
"'dbsException-invalid-input'",
",",
"\"business/DBSBlock/insertB... | Input dictionary has to have the following keys:
blockname
It may have:
open_for_writing, origin_site(name), block_size,
file_count, creation_date, create_by, last_modification_date, last_modified_by
it builds the correct dictionary for dao input and executes th... | [
"Input",
"dictionary",
"has",
"to",
"have",
"the",
"following",
"keys",
":",
"blockname",
"It",
"may",
"have",
":",
"open_for_writing",
"origin_site",
"(",
"name",
")",
"block_size",
"file_count",
"creation_date",
"create_by",
"last_modification_date",
"last_modified_... | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlock.py#L283-L337 | train |
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",
")"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataTier.py#L25-L44 | train |
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",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/Site/List.py#L24-L35 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileBuffer/DeleteFiles.py#L20-L27 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSDataType.py#L22-L36 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFileBuffer.py#L35-L45 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSFileBuffer.py#L47-L58 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/DataTier/List.py#L27-L43 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/MigrationRequests/ListOldest.py#L21-L32 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSProcessingEra.py#L25-L35 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSProcessingEra.py#L37-L70 | train |
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",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPhysicsGroup.py#L23-L45 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/utils/DBSDaoTools.py#L4-L50 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSServicesRegistry.py#L37-L53 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSServicesRegistry.py#L55-L115 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/MigrationRequests/UpdateRequestStatus.py#L67-L85 | train |
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",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/MigrationRequests/List.py#L28-L75 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileBuffer/DeleteDuplicates.py#L21-L29 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/BlockParent/List.py#L27-L44 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/Block/ListBlockOrigin.py#L29-L63 | train |
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",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPrimaryDataset.py#L29-L40 | train |
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",
"."
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPrimaryDataset.py#L42-L53 | train |
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"
] | 9619bafce3783b3e77f0415f8f9a258e33dd1e6f | https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSPrimaryDataset.py#L55-L99 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.