partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
DBSReaderModel.dumpBlock
API the list all information related with the block_name :param block_name: Name of block to be dumped (Required) :type block_name: str
Server/Python/src/dbs/web/DBSReaderModel.py
def dumpBlock(self, block_name): """ API the list all information related with the block_name :param block_name: Name of block to be dumped (Required) :type block_name: str """ try: return self.dbsBlock.dumpBlock(block_name) except HTTPError as he: ...
def dumpBlock(self, block_name): """ API the list all information related with the block_name :param block_name: Name of block to be dumped (Required) :type block_name: str """ try: return self.dbsBlock.dumpBlock(block_name) except HTTPError as he: ...
[ "API", "the", "list", "all", "information", "related", "with", "the", "block_name" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1507-L1524
[ "def", "dumpBlock", "(", "self", ",", "block_name", ")", ":", "try", ":", "return", "self", ".", "dbsBlock", ".", "dumpBlock", "(", "block_name", ")", "except", "HTTPError", "as", "he", ":", "raise", "he", "except", "dbsException", "as", "de", ":", "dbsE...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSReaderModel.listAcquisitionEras
API to list all Acquisition Eras in DBS. :param acquisition_era_name: Acquisition era name (Optional, wild cards allowed) :type acquisition_era_name: str :returns: List of dictionaries containing following keys (description, end_date, acquisition_era_name, create_by, creation_date and start_dat...
Server/Python/src/dbs/web/DBSReaderModel.py
def listAcquisitionEras(self, acquisition_era_name=''): """ API to list all Acquisition Eras in DBS. :param acquisition_era_name: Acquisition era name (Optional, wild cards allowed) :type acquisition_era_name: str :returns: List of dictionaries containing following keys (descrip...
def listAcquisitionEras(self, acquisition_era_name=''): """ API to list all Acquisition Eras in DBS. :param acquisition_era_name: Acquisition era name (Optional, wild cards allowed) :type acquisition_era_name: str :returns: List of dictionaries containing following keys (descrip...
[ "API", "to", "list", "all", "Acquisition", "Eras", "in", "DBS", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1527-L1544
[ "def", "listAcquisitionEras", "(", "self", ",", "acquisition_era_name", "=", "''", ")", ":", "try", ":", "acquisition_era_name", "=", "acquisition_era_name", ".", "replace", "(", "'*'", ",", "'%'", ")", "return", "self", ".", "dbsAcqEra", ".", "listAcquisitionEr...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSReaderModel.listProcessingEras
API to list all Processing Eras in DBS. :param processing_version: Processing Version (Optional). If provided just this processing_version will be listed :type processing_version: str :returns: List of dictionaries containing the following keys (create_by, processing_version, description, creat...
Server/Python/src/dbs/web/DBSReaderModel.py
def listProcessingEras(self, processing_version=0): """ API to list all Processing Eras in DBS. :param processing_version: Processing Version (Optional). If provided just this processing_version will be listed :type processing_version: str :returns: List of dictionaries containi...
def listProcessingEras(self, processing_version=0): """ API to list all Processing Eras in DBS. :param processing_version: Processing Version (Optional). If provided just this processing_version will be listed :type processing_version: str :returns: List of dictionaries containi...
[ "API", "to", "list", "all", "Processing", "Eras", "in", "DBS", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1568-L1586
[ "def", "listProcessingEras", "(", "self", ",", "processing_version", "=", "0", ")", ":", "try", ":", "#processing_version = processing_version.replace(\"*\", \"%\")", "return", "self", ".", "dbsProcEra", ".", "listProcessingEras", "(", "processing_version", ")", "except",...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSReaderModel.listReleaseVersions
API to list all release versions in DBS :param release_version: List only that release version :type release_version: str :param dataset: List release version of the specified dataset :type dataset: str :param logical_file_name: List release version of the logical file name ...
Server/Python/src/dbs/web/DBSReaderModel.py
def listReleaseVersions(self, release_version='', dataset='', logical_file_name=''): """ API to list all release versions in DBS :param release_version: List only that release version :type release_version: str :param dataset: List release version of the specified dataset ...
def listReleaseVersions(self, release_version='', dataset='', logical_file_name=''): """ API to list all release versions in DBS :param release_version: List only that release version :type release_version: str :param dataset: List release version of the specified dataset ...
[ "API", "to", "list", "all", "release", "versions", "in", "DBS" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1589-L1612
[ "def", "listReleaseVersions", "(", "self", ",", "release_version", "=", "''", ",", "dataset", "=", "''", ",", "logical_file_name", "=", "''", ")", ":", "if", "release_version", ":", "release_version", "=", "release_version", ".", "replace", "(", "\"*\"", ",", ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSReaderModel.listDatasetAccessTypes
API to list dataset access types. :param dataset_access_type: List that dataset access type (Optional) :type dataset_access_type: str :returns: List of dictionary containing the following key (dataset_access_type). :rtype: List of dicts
Server/Python/src/dbs/web/DBSReaderModel.py
def listDatasetAccessTypes(self, dataset_access_type=''): """ API to list dataset access types. :param dataset_access_type: List that dataset access type (Optional) :type dataset_access_type: str :returns: List of dictionary containing the following key (dataset_access_type). ...
def listDatasetAccessTypes(self, dataset_access_type=''): """ API to list dataset access types. :param dataset_access_type: List that dataset access type (Optional) :type dataset_access_type: str :returns: List of dictionary containing the following key (dataset_access_type). ...
[ "API", "to", "list", "dataset", "access", "types", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1615-L1634
[ "def", "listDatasetAccessTypes", "(", "self", ",", "dataset_access_type", "=", "''", ")", ":", "if", "dataset_access_type", ":", "dataset_access_type", "=", "dataset_access_type", ".", "replace", "(", "\"*\"", ",", "\"%\"", ")", "try", ":", "return", "self", "."...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSReaderModel.listPhysicsGroups
API to list all physics groups. :param physics_group_name: List that specific physics group (Optional) :type physics_group_name: basestring :returns: List of dictionaries containing the following key (physics_group_name) :rtype: list of dicts
Server/Python/src/dbs/web/DBSReaderModel.py
def listPhysicsGroups(self, physics_group_name=''): """ API to list all physics groups. :param physics_group_name: List that specific physics group (Optional) :type physics_group_name: basestring :returns: List of dictionaries containing the following key (physics_group_name) ...
def listPhysicsGroups(self, physics_group_name=''): """ API to list all physics groups. :param physics_group_name: List that specific physics group (Optional) :type physics_group_name: basestring :returns: List of dictionaries containing the following key (physics_group_name) ...
[ "API", "to", "list", "all", "physics", "groups", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1637-L1656
[ "def", "listPhysicsGroups", "(", "self", ",", "physics_group_name", "=", "''", ")", ":", "if", "physics_group_name", ":", "physics_group_name", "=", "physics_group_name", ".", "replace", "(", "'*'", ",", "'%'", ")", "try", ":", "return", "self", ".", "dbsPhysi...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSReaderModel.listRunSummaries
API to list run summaries, like the maximal lumisection in a run. :param dataset: dataset name (Optional) :type dataset: str :param run_num: Run number (Required) :type run_num: str, long, int :rtype: list containing a dictionary with key max_lumi
Server/Python/src/dbs/web/DBSReaderModel.py
def listRunSummaries(self, dataset="", run_num=-1): """ API to list run summaries, like the maximal lumisection in a run. :param dataset: dataset name (Optional) :type dataset: str :param run_num: Run number (Required) :type run_num: str, long, int :rtype: list c...
def listRunSummaries(self, dataset="", run_num=-1): """ API to list run summaries, like the maximal lumisection in a run. :param dataset: dataset name (Optional) :type dataset: str :param run_num: Run number (Required) :type run_num: str, long, int :rtype: list c...
[ "API", "to", "list", "run", "summaries", "like", "the", "maximal", "lumisection", "in", "a", "run", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/web/DBSReaderModel.py#L1659-L1697
[ "def", "listRunSummaries", "(", "self", ",", "dataset", "=", "\"\"", ",", "run_num", "=", "-", "1", ")", ":", "if", "run_num", "==", "-", "1", ":", "dbsExceptionHandler", "(", "\"dbsException-invalid-input\"", ",", "\"The run_num parameter is mandatory\"", ",", ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
list
List all events
lambder/cli.py
def list(): """ List all events """ entries = lambder.list_events() for e in entries: click.echo(str(e))
def list(): """ List all events """ entries = lambder.list_events() for e in entries: click.echo(str(e))
[ "List", "all", "events" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L22-L26
[ "def", "list", "(", ")", ":", "entries", "=", "lambder", ".", "list_events", "(", ")", "for", "e", "in", "entries", ":", "click", ".", "echo", "(", "str", "(", "e", ")", ")" ]
1c50b5dd2af286286e1547ee87d815d66382b884
train
add
Create an event
lambder/cli.py
def add(name, function_name, cron): """ Create an event """ lambder.add_event(name=name, function_name=function_name, cron=cron)
def add(name, function_name, cron): """ Create an event """ lambder.add_event(name=name, function_name=function_name, cron=cron)
[ "Create", "an", "event" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L34-L36
[ "def", "add", "(", "name", ",", "function_name", ",", "cron", ")", ":", "lambder", ".", "add_event", "(", "name", "=", "name", ",", "function_name", "=", "function_name", ",", "cron", "=", "cron", ")" ]
1c50b5dd2af286286e1547ee87d815d66382b884
train
load
Load events from a json file
lambder/cli.py
def load(file): """ Load events from a json file """ with open(file, 'r') as f: contents = f.read() lambder.load_events(contents)
def load(file): """ Load events from a json file """ with open(file, 'r') as f: contents = f.read() lambder.load_events(contents)
[ "Load", "events", "from", "a", "json", "file" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L66-L70
[ "def", "load", "(", "file", ")", ":", "with", "open", "(", "file", ",", "'r'", ")", "as", "f", ":", "contents", "=", "f", ".", "read", "(", ")", "lambder", ".", "load_events", "(", "contents", ")" ]
1c50b5dd2af286286e1547ee87d815d66382b884
train
functions
Manage AWS Lambda functions
lambder/cli.py
def functions(context): """ Manage AWS Lambda functions """ # find lambder.json in CWD config_file = "./lambder.json" if os.path.isfile(config_file): context.obj = FunctionConfig(config_file) pass
def functions(context): """ Manage AWS Lambda functions """ # find lambder.json in CWD config_file = "./lambder.json" if os.path.isfile(config_file): context.obj = FunctionConfig(config_file) pass
[ "Manage", "AWS", "Lambda", "functions" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L94-L100
[ "def", "functions", "(", "context", ")", ":", "# find lambder.json in CWD", "config_file", "=", "\"./lambder.json\"", "if", "os", ".", "path", ".", "isfile", "(", "config_file", ")", ":", "context", ".", "obj", "=", "FunctionConfig", "(", "config_file", ")", "...
1c50b5dd2af286286e1547ee87d815d66382b884
train
list
List lambder functions
lambder/cli.py
def list(): """ List lambder functions """ functions = lambder.list_functions() output = json.dumps( functions, sort_keys=True, indent=4, separators=(',', ':') ) click.echo(output)
def list(): """ List lambder functions """ functions = lambder.list_functions() output = json.dumps( functions, sort_keys=True, indent=4, separators=(',', ':') ) click.echo(output)
[ "List", "lambder", "functions" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L105-L114
[ "def", "list", "(", ")", ":", "functions", "=", "lambder", ".", "list_functions", "(", ")", "output", "=", "json", ".", "dumps", "(", "functions", ",", "sort_keys", "=", "True", ",", "indent", "=", "4", ",", "separators", "=", "(", "','", ",", "':'",...
1c50b5dd2af286286e1547ee87d815d66382b884
train
new
Create a new lambda project
lambder/cli.py
def new( name, bucket, timeout, memory, description, subnet_ids, security_group_ids ): """ Create a new lambda project """ config = {} if timeout: config['timeout'] = timeout if memory: config['memory'] = memory if description: config['description'...
def new( name, bucket, timeout, memory, description, subnet_ids, security_group_ids ): """ Create a new lambda project """ config = {} if timeout: config['timeout'] = timeout if memory: config['memory'] = memory if description: config['description'...
[ "Create", "a", "new", "lambda", "project" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L133-L155
[ "def", "new", "(", "name", ",", "bucket", ",", "timeout", ",", "memory", ",", "description", ",", "subnet_ids", ",", "security_group_ids", ")", ":", "config", "=", "{", "}", "if", "timeout", ":", "config", "[", "'timeout'", "]", "=", "timeout", "if", "...
1c50b5dd2af286286e1547ee87d815d66382b884
train
deploy
Deploy/Update a function from a project directory
lambder/cli.py
def deploy( config, name, bucket, timeout, memory, description, subnet_ids, security_group_ids ): """ Deploy/Update a function from a project directory """ # options should override config if it is there myname = name or config.name mybucket = bucket or config.bucket ...
def deploy( config, name, bucket, timeout, memory, description, subnet_ids, security_group_ids ): """ Deploy/Update a function from a project directory """ # options should override config if it is there myname = name or config.name mybucket = bucket or config.bucket ...
[ "Deploy", "/", "Update", "a", "function", "from", "a", "project", "directory" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L171-L206
[ "def", "deploy", "(", "config", ",", "name", ",", "bucket", ",", "timeout", ",", "memory", ",", "description", ",", "subnet_ids", ",", "security_group_ids", ")", ":", "# options should override config if it is there", "myname", "=", "name", "or", "config", ".", ...
1c50b5dd2af286286e1547ee87d815d66382b884
train
rm
Delete lambda function, role, and zipfile
lambder/cli.py
def rm(config, name, bucket): """ Delete lambda function, role, and zipfile """ # options should override config if it is there myname = name or config.name mybucket = bucket or config.bucket click.echo('Deleting {} from {}'.format(myname, mybucket)) lambder.delete_function(myname, mybucket)
def rm(config, name, bucket): """ Delete lambda function, role, and zipfile """ # options should override config if it is there myname = name or config.name mybucket = bucket or config.bucket click.echo('Deleting {} from {}'.format(myname, mybucket)) lambder.delete_function(myname, mybucket)
[ "Delete", "lambda", "function", "role", "and", "zipfile" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L214-L221
[ "def", "rm", "(", "config", ",", "name", ",", "bucket", ")", ":", "# options should override config if it is there", "myname", "=", "name", "or", "config", ".", "name", "mybucket", "=", "bucket", "or", "config", ".", "bucket", "click", ".", "echo", "(", "'De...
1c50b5dd2af286286e1547ee87d815d66382b884
train
invoke
Invoke function in AWS
lambder/cli.py
def invoke(config, name, input): """ Invoke function in AWS """ # options should override config if it is there myname = name or config.name click.echo('Invoking ' + myname) output = lambder.invoke_function(myname, input) click.echo(output)
def invoke(config, name, input): """ Invoke function in AWS """ # options should override config if it is there myname = name or config.name click.echo('Invoking ' + myname) output = lambder.invoke_function(myname, input) click.echo(output)
[ "Invoke", "function", "in", "AWS" ]
LeafSoftware/python-lambder
python
https://github.com/LeafSoftware/python-lambder/blob/1c50b5dd2af286286e1547ee87d815d66382b884/lambder/cli.py#L229-L236
[ "def", "invoke", "(", "config", ",", "name", ",", "input", ")", ":", "# options should override config if it is there", "myname", "=", "name", "or", "config", ".", "name", "click", ".", "echo", "(", "'Invoking '", "+", "myname", ")", "output", "=", "lambder", ...
1c50b5dd2af286286e1547ee87d815d66382b884
train
DBSBlockInsert.putBlock
Insert the data in sereral steps and commit when each step finishes or rollback if there is a problem.
Server/Python/src/dbs/business/DBSBlockInsert.py
def putBlock(self, blockcontent, migration=False): """ Insert the data in sereral steps and commit when each step finishes or rollback if there is a problem. """ #YG try: #1 insert configuration self.logger.debug("insert configuration") configL...
def putBlock(self, blockcontent, migration=False): """ Insert the data in sereral steps and commit when each step finishes or rollback if there is a problem. """ #YG try: #1 insert configuration self.logger.debug("insert configuration") configL...
[ "Insert", "the", "data", "in", "sereral", "steps", "and", "commit", "when", "each", "step", "finishes", "or", "rollback", "if", "there", "is", "a", "problem", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L85-L106
[ "def", "putBlock", "(", "self", ",", "blockcontent", ",", "migration", "=", "False", ")", ":", "#YG", "try", ":", "#1 insert configuration", "self", ".", "logger", ".", "debug", "(", "\"insert configuration\"", ")", "configList", "=", "self", ".", "insertOutpu...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSBlockInsert.insertOutputModuleConfig
Insert Release version, application, parameter set hashes and the map(output module config).
Server/Python/src/dbs/business/DBSBlockInsert.py
def insertOutputModuleConfig(self, remoteConfig, migration=False): """ Insert Release version, application, parameter set hashes and the map(output module config). """ otptIdList = [] missingList = [] conn = self.dbi.connection() try: for c in remoteC...
def insertOutputModuleConfig(self, remoteConfig, migration=False): """ Insert Release version, application, parameter set hashes and the map(output module config). """ otptIdList = [] missingList = [] conn = self.dbi.connection() try: for c in remoteC...
[ "Insert", "Release", "version", "application", "parameter", "set", "hashes", "and", "the", "map", "(", "output", "module", "config", ")", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L430-L562
[ "def", "insertOutputModuleConfig", "(", "self", ",", "remoteConfig", ",", "migration", "=", "False", ")", ":", "otptIdList", "=", "[", "]", "missingList", "=", "[", "]", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "try", ":", "for", "...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSBlockInsert.insertDataset
This method insert a datsset from a block object into dbs.
Server/Python/src/dbs/business/DBSBlockInsert.py
def insertDataset(self, blockcontent, otptIdList, migration=False): """ This method insert a datsset from a block object into dbs. """ dataset = blockcontent['dataset'] conn = self.dbi.connection() # First, check and see if the dataset exists. try: da...
def insertDataset(self, blockcontent, otptIdList, migration=False): """ This method insert a datsset from a block object into dbs. """ dataset = blockcontent['dataset'] conn = self.dbi.connection() # First, check and see if the dataset exists. try: da...
[ "This", "method", "insert", "a", "datsset", "from", "a", "block", "object", "into", "dbs", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L564-L884
[ "def", "insertDataset", "(", "self", ",", "blockcontent", ",", "otptIdList", ",", "migration", "=", "False", ")", ":", "dataset", "=", "blockcontent", "[", "'dataset'", "]", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "# First, check and se...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSBlockInsert.insertDatasetWOannex
_insertDatasetOnly_ Insert the dataset and only the dataset Meant to be called after everything else is put into place. The insertDataset flag is set to false if the dataset already exists
Server/Python/src/dbs/business/DBSBlockInsert.py
def insertDatasetWOannex(self, dataset, blockcontent, otptIdList, conn, insertDataset = True, migration = False): """ _insertDatasetOnly_ Insert the dataset and only the dataset Meant to be called after everything else is put into place. The insertD...
def insertDatasetWOannex(self, dataset, blockcontent, otptIdList, conn, insertDataset = True, migration = False): """ _insertDatasetOnly_ Insert the dataset and only the dataset Meant to be called after everything else is put into place. The insertD...
[ "_insertDatasetOnly_" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSBlockInsert.py#L888-L1017
[ "def", "insertDatasetWOannex", "(", "self", ",", "dataset", ",", "blockcontent", ",", "otptIdList", ",", "conn", ",", "insertDataset", "=", "True", ",", "migration", "=", "False", ")", ":", "tran", "=", "conn", ".", "begin", "(", ")", "try", ":", "#8 Fin...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSSite.listSites
Returns sites.
Server/Python/src/dbs/business/DBSSite.py
def listSites(self, block_name="", site_name=""): """ Returns sites. """ try: conn = self.dbi.connection() if block_name: result = self.blksitelist.execute(conn, block_name) else: result = self.sitelist.execute(conn, sit...
def listSites(self, block_name="", site_name=""): """ Returns sites. """ try: conn = self.dbi.connection() if block_name: result = self.blksitelist.execute(conn, block_name) else: result = self.sitelist.execute(conn, sit...
[ "Returns", "sites", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSSite.py#L24-L37
[ "def", "listSites", "(", "self", ",", "block_name", "=", "\"\"", ",", "site_name", "=", "\"\"", ")", ":", "try", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "if", "block_name", ":", "result", "=", "self", ".", "blksitelist", "....
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DBSSite.insertSite
Input dictionary has to have the following keys: site_name it builds the correct dictionary for dao input and executes the dao
Server/Python/src/dbs/business/DBSSite.py
def insertSite(self, businput): """ Input dictionary has to have the following keys: site_name it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = conn.begin() try: siteobj = { # FIXME: un...
def insertSite(self, businput): """ Input dictionary has to have the following keys: site_name it builds the correct dictionary for dao input and executes the dao """ conn = self.dbi.connection() tran = conn.begin() try: siteobj = { # FIXME: un...
[ "Input", "dictionary", "has", "to", "have", "the", "following", "keys", ":", "site_name", "it", "builds", "the", "correct", "dictionary", "for", "dao", "input", "and", "executes", "the", "dao" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/business/DBSSite.py#L39-L69
[ "def", "insertSite", "(", "self", ",", "businput", ")", ":", "conn", "=", "self", ".", "dbi", ".", "connection", "(", ")", "tran", "=", "conn", ".", "begin", "(", ")", "try", ":", "siteobj", "=", "{", "# FIXME: unused?", "\"site_name\"", ":", "businput...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DASMapping._create_das_mapping
das_map = {'lookup' : [{params : {'param1' : 'required', 'param2' : 'optional', 'param3' : 'default_value' ...}, url : 'https://cmsweb.cern.ch:8443/dbs/prod/global/DBSReader/acquisitioneras/', das_map : {'das_param1' : dbs_param1, ...} ...
Server/Python/utils/das_logfile_analyser.py
def _create_das_mapping(self): """ das_map = {'lookup' : [{params : {'param1' : 'required', 'param2' : 'optional', 'param3' : 'default_value' ...}, url : 'https://cmsweb.cern.ch:8443/dbs/prod/global/DBSReader/acquisitioneras/', das_map : {'...
def _create_das_mapping(self): """ das_map = {'lookup' : [{params : {'param1' : 'required', 'param2' : 'optional', 'param3' : 'default_value' ...}, url : 'https://cmsweb.cern.ch:8443/dbs/prod/global/DBSReader/acquisitioneras/', das_map : {'...
[ "das_map", "=", "{", "lookup", ":", "[", "{", "params", ":", "{", "param1", ":", "required", "param2", ":", "optional", "param3", ":", "default_value", "...", "}", "url", ":", "https", ":", "//", "cmsweb", ".", "cern", ".", "ch", ":", "8443", "/", ...
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/utils/das_logfile_analyser.py#L31-L50
[ "def", "_create_das_mapping", "(", "self", ")", ":", "with", "open", "(", "self", ".", "_mapfile", ",", "'r'", ")", "as", "f", ":", "for", "entry", "in", "yaml", ".", "load_all", "(", "f", ")", ":", "das2dbs_param_map", "=", "{", "}", "if", "'lookup'...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
slicedIterator
:param: sourceList: list which need to be sliced :type: list :param: sliceSize: size of the slice :type: int :return: iterator of the sliced list
Client/src/python/dbs/apis/dbsClient.py
def slicedIterator(sourceList, sliceSize): """ :param: sourceList: list which need to be sliced :type: list :param: sliceSize: size of the slice :type: int :return: iterator of the sliced list """ start = 0 end = 0 while len(sourceList) > end: end = start + sliceSize ...
def slicedIterator(sourceList, sliceSize): """ :param: sourceList: list which need to be sliced :type: list :param: sliceSize: size of the slice :type: int :return: iterator of the sliced list """ start = 0 end = 0 while len(sourceList) > end: end = start + sliceSize ...
[ ":", "param", ":", "sourceList", ":", "list", "which", "need", "to", "be", "sliced", ":", "type", ":", "list", ":", "param", ":", "sliceSize", ":", "size", "of", "the", "slice", ":", "type", ":", "int", ":", "return", ":", "iterator", "of", "the", ...
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L14-L28
[ "def", "slicedIterator", "(", "sourceList", ",", "sliceSize", ")", ":", "start", "=", "0", "end", "=", "0", "while", "len", "(", "sourceList", ")", ">", "end", ":", "end", "=", "start", "+", "sliceSize", "yield", "sourceList", "[", "start", ":", "end",...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
checkInputParameter
Helper function to check input by using before sending to the server :param method: Name of the API :type method: str :param validParameters: Allow parameters for the API call :type validParameters: list :param requiredParameters: Required parameters for the API call (Default: None) :type requi...
Client/src/python/dbs/apis/dbsClient.py
def checkInputParameter(method, parameters, validParameters, requiredParameters=None): """ Helper function to check input by using before sending to the server :param method: Name of the API :type method: str :param validParameters: Allow parameters for the API call :type validParameters: list ...
def checkInputParameter(method, parameters, validParameters, requiredParameters=None): """ Helper function to check input by using before sending to the server :param method: Name of the API :type method: str :param validParameters: Allow parameters for the API call :type validParameters: list ...
[ "Helper", "function", "to", "check", "input", "by", "using", "before", "sending", "to", "the", "server" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L30-L75
[ "def", "checkInputParameter", "(", "method", ",", "parameters", ",", "validParameters", ",", "requiredParameters", "=", "None", ")", ":", "for", "parameter", "in", "parameters", ":", "if", "parameter", "not", "in", "validParameters", ":", "raise", "dbsClientExcept...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
list_parameter_splitting
Helper function split list used as input parameter for requests, since Apache has a limitation to 8190 Bytes for the lenght of an URI. We extended it to also split lfn and dataset list length for POST calls to avoid DB abuse even if there is no limit on hoe long the list can be. YG 2015-5-13 :param data...
Client/src/python/dbs/apis/dbsClient.py
def list_parameter_splitting(data, key, size_limit=8000, method='GET'): """ Helper function split list used as input parameter for requests, since Apache has a limitation to 8190 Bytes for the lenght of an URI. We extended it to also split lfn and dataset list length for POST calls to avoid DB abuse...
def list_parameter_splitting(data, key, size_limit=8000, method='GET'): """ Helper function split list used as input parameter for requests, since Apache has a limitation to 8190 Bytes for the lenght of an URI. We extended it to also split lfn and dataset list length for POST calls to avoid DB abuse...
[ "Helper", "function", "split", "list", "used", "as", "input", "parameter", "for", "requests", "since", "Apache", "has", "a", "limitation", "to", "8190", "Bytes", "for", "the", "lenght", "of", "an", "URI", ".", "We", "extended", "it", "to", "also", "split",...
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L77-L105
[ "def", "list_parameter_splitting", "(", "data", ",", "key", ",", "size_limit", "=", "8000", ",", "method", "=", "'GET'", ")", ":", "values", "=", "list", "(", "data", "[", "key", "]", ")", "data", "[", "key", "]", "=", "[", "]", "for", "element", "...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
split_calls
Decorator to split up server calls for methods using url parameters, due to the lenght limitation of the URI in Apache. By default 8190 bytes
Client/src/python/dbs/apis/dbsClient.py
def split_calls(func): """ Decorator to split up server calls for methods using url parameters, due to the lenght limitation of the URI in Apache. By default 8190 bytes """ def wrapper(*args, **kwargs): #The size limit is 8190 bytes minus url and api to call #For example (https://cms...
def split_calls(func): """ Decorator to split up server calls for methods using url parameters, due to the lenght limitation of the URI in Apache. By default 8190 bytes """ def wrapper(*args, **kwargs): #The size limit is 8190 bytes minus url and api to call #For example (https://cms...
[ "Decorator", "to", "split", "up", "server", "calls", "for", "methods", "using", "url", "parameters", "due", "to", "the", "lenght", "limitation", "of", "the", "URI", "in", "Apache", ".", "By", "default", "8190", "bytes" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L107-L136
[ "def", "split_calls", "(", "func", ")", ":", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "#The size limit is 8190 bytes minus url and api to call", "#For example (https://cmsweb-testbed.cern.ch:8443/dbs/prod/global/filechildren), so 192 bytes should be ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.__callServer
A private method to make HTTP call to the DBS Server :param method: REST API to call, e.g. 'datasets, blocks, files, ...'. :type method: str :param params: Parameters to the API call, e.g. {'dataset':'/PrimaryDS/ProcessedDS/TIER'}. :type params: dict :param callmethod: The HTTP ...
Client/src/python/dbs/apis/dbsClient.py
def __callServer(self, method="", params={}, data={}, callmethod='GET', content='application/json'): """ A private method to make HTTP call to the DBS Server :param method: REST API to call, e.g. 'datasets, blocks, files, ...'. :type method: str :param params: Parameters to the ...
def __callServer(self, method="", params={}, data={}, callmethod='GET', content='application/json'): """ A private method to make HTTP call to the DBS Server :param method: REST API to call, e.g. 'datasets, blocks, files, ...'. :type method: str :param params: Parameters to the ...
[ "A", "private", "method", "to", "make", "HTTP", "call", "to", "the", "DBS", "Server" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L171-L210
[ "def", "__callServer", "(", "self", ",", "method", "=", "\"\"", ",", "params", "=", "{", "}", ",", "data", "=", "{", "}", ",", "callmethod", "=", "'GET'", ",", "content", "=", "'application/json'", ")", ":", "UserID", "=", "os", ".", "environ", "[", ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.__parseForException
An internal method, should not be used by clients :param httperror: Thrown httperror by the server
Client/src/python/dbs/apis/dbsClient.py
def __parseForException(self, http_error): """ An internal method, should not be used by clients :param httperror: Thrown httperror by the server """ data = http_error.body try: if isinstance(data, str): data = cjson.decode(data) excep...
def __parseForException(self, http_error): """ An internal method, should not be used by clients :param httperror: Thrown httperror by the server """ data = http_error.body try: if isinstance(data, str): data = cjson.decode(data) excep...
[ "An", "internal", "method", "should", "not", "be", "used", "by", "clients" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L212-L228
[ "def", "__parseForException", "(", "self", ",", "http_error", ")", ":", "data", "=", "http_error", ".", "body", "try", ":", "if", "isinstance", "(", "data", ",", "str", ")", ":", "data", "=", "cjson", ".", "decode", "(", "data", ")", "except", ":", "...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.requestTimingInfo
Returns the time needed to process the request by the frontend server in microseconds and the EPOC timestamp of the request in microseconds. :rtype: tuple containing processing time and timestamp
Client/src/python/dbs/apis/dbsClient.py
def requestTimingInfo(self): """ Returns the time needed to process the request by the frontend server in microseconds and the EPOC timestamp of the request in microseconds. :rtype: tuple containing processing time and timestamp """ try: return tuple(item.spl...
def requestTimingInfo(self): """ Returns the time needed to process the request by the frontend server in microseconds and the EPOC timestamp of the request in microseconds. :rtype: tuple containing processing time and timestamp """ try: return tuple(item.spl...
[ "Returns", "the", "time", "needed", "to", "process", "the", "request", "by", "the", "frontend", "server", "in", "microseconds", "and", "the", "EPOC", "timestamp", "of", "the", "request", "in", "microseconds", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L231-L241
[ "def", "requestTimingInfo", "(", "self", ")", ":", "try", ":", "return", "tuple", "(", "item", ".", "split", "(", "'='", ")", "[", "1", "]", "for", "item", "in", "self", ".", "http_response", ".", "header", ".", "get", "(", "'CMS-Server-Time'", ")", ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.insertBulkBlock
API to insert a bulk block :param blockDump: Output of the block dump command, example can be found in https://svnweb.cern.ch/trac/CMSDMWM/browser/DBS/trunk/Client/tests/dbsclient_t/unittests/blockdump.dict :type blockDump: dict
Client/src/python/dbs/apis/dbsClient.py
def insertBulkBlock(self, blockDump): """ API to insert a bulk block :param blockDump: Output of the block dump command, example can be found in https://svnweb.cern.ch/trac/CMSDMWM/browser/DBS/trunk/Client/tests/dbsclient_t/unittests/blockdump.dict :type blockDump: dict """ ...
def insertBulkBlock(self, blockDump): """ API to insert a bulk block :param blockDump: Output of the block dump command, example can be found in https://svnweb.cern.ch/trac/CMSDMWM/browser/DBS/trunk/Client/tests/dbsclient_t/unittests/blockdump.dict :type blockDump: dict """ ...
[ "API", "to", "insert", "a", "bulk", "block" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L317-L347
[ "def", "insertBulkBlock", "(", "self", ",", "blockDump", ")", ":", "#We first check if the first lumi section has event_count or not", "frst", "=", "True", "if", "(", "blockDump", "[", "'files'", "]", "[", "0", "]", "[", "'file_lumi_list'", "]", "[", "0", "]", "...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.insertFiles
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...
Client/src/python/dbs/apis/dbsClient.py
def insertFiles(self, filesList, qInserts=False): """ API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request. :param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minut...
def insertFiles(self, filesList, qInserts=False): """ API to insert a list of file into DBS in DBS. Up to 10 files can be inserted in one request. :param qInserts: True means that inserts will be queued instead of done immediately. INSERT QUEUE Manager will perform the inserts, within few minut...
[ "API", "to", "insert", "a", "list", "of", "file", "into", "DBS", "in", "DBS", ".", "Up", "to", "10", "files", "can", "be", "inserted", "in", "one", "request", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L381-L409
[ "def", "insertFiles", "(", "self", ",", "filesList", ",", "qInserts", "=", "False", ")", ":", "if", "not", "qInserts", ":", "#turn off qInserts", "return", "self", ".", "__callServer", "(", "\"files\"", ",", "params", "=", "{", "'qInserts'", ":", "qInserts",...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listFileParentsByLumi
API to list file parents using lumi section info. :param block_name: name of block that has files who's parents needs to be found (Required) :type block_name: str :param logical_file_name: if not all the file parentages under the block needed, this lfn list gives the files that needs to find it...
Client/src/python/dbs/apis/dbsClient.py
def listFileParentsByLumi(self, **kwargs): """ API to list file parents using lumi section info. :param block_name: name of block that has files who's parents needs to be found (Required) :type block_name: str :param logical_file_name: if not all the file parentages under the bl...
def listFileParentsByLumi(self, **kwargs): """ API to list file parents using lumi section info. :param block_name: name of block that has files who's parents needs to be found (Required) :type block_name: str :param logical_file_name: if not all the file parentages under the bl...
[ "API", "to", "list", "file", "parents", "using", "lumi", "section", "info", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L465-L482
[ "def", "listFileParentsByLumi", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'block_name'", ",", "'logical_file_name'", "]", "requiredParameters", "=", "{", "'forced'", ":", "[", "'block_name'", "]", "}", "checkInputParameter", "...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listBlockParents
API to list block parents. :param block_name: name of block who's parents needs to be found (Required) :type block_name: str :returns: List of dictionaries containing following keys (block_name) :rtype: list of dicts
Client/src/python/dbs/apis/dbsClient.py
def listBlockParents(self, **kwargs): """ API to list block parents. :param block_name: name of block who's parents needs to be found (Required) :type block_name: str :returns: List of dictionaries containing following keys (block_name) :rtype: list of dicts ...
def listBlockParents(self, **kwargs): """ API to list block parents. :param block_name: name of block who's parents needs to be found (Required) :type block_name: str :returns: List of dictionaries containing following keys (block_name) :rtype: list of dicts ...
[ "API", "to", "list", "block", "parents", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L544-L562
[ "def", "listBlockParents", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'block_name'", "]", "requiredParameters", "=", "{", "'forced'", ":", "validParameters", "}", "checkInputParameter", "(", "method", "=", "\"listBlockParents\"",...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listBlocks
API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and the difference in time have to be less than 31 days. :param block_name: name of the b...
Client/src/python/dbs/apis/dbsClient.py
def listBlocks(self, **kwargs): """ API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and the difference in time have to be less tha...
def listBlocks(self, **kwargs): """ API to list a block in DBS. At least one of the parameters block_name, dataset, data_tier_name or logical_file_name are required. If data_tier_name is provided, min_cdate and max_cdate have to be specified and the difference in time have to be less tha...
[ "API", "to", "list", "a", "block", "in", "DBS", ".", "At", "least", "one", "of", "the", "parameters", "block_name", "dataset", "data_tier_name", "or", "logical_file_name", "are", "required", ".", "If", "data_tier_name", "is", "provided", "min_cdate", "and", "m...
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L564-L615
[ "def", "listBlocks", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'dataset'", ",", "'block_name'", ",", "'data_tier_name'", ",", "'origin_site_name'", ",", "'logical_file_name'", ",", "'run_num'", ",", "'open_for_writing'", ",", ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listDatasets
API to list dataset(s) in DBS * You can use ANY combination of these parameters in this API * In absence of parameters, all valid datasets known to the DBS instance will be returned :param dataset: Full dataset (path) of the dataset :type dataset: str :param parent_dataset: Ful...
Client/src/python/dbs/apis/dbsClient.py
def listDatasets(self, **kwargs): """ API to list dataset(s) in DBS * You can use ANY combination of these parameters in this API * In absence of parameters, all valid datasets known to the DBS instance will be returned :param dataset: Full dataset (path) of the dataset ...
def listDatasets(self, **kwargs): """ API to list dataset(s) in DBS * You can use ANY combination of these parameters in this API * In absence of parameters, all valid datasets known to the DBS instance will be returned :param dataset: Full dataset (path) of the dataset ...
[ "API", "to", "list", "dataset", "(", "s", ")", "in", "DBS", "*", "You", "can", "use", "ANY", "combination", "of", "these", "parameters", "in", "this", "API", "*", "In", "absence", "of", "parameters", "all", "valid", "datasets", "known", "to", "the", "D...
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L679-L758
[ "def", "listDatasets", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'dataset'", ",", "'parent_dataset'", ",", "'is_dataset_valid'", ",", "'release_version'", ",", "'pset_hash'", ",", "'app_name'", ",", "'output_module_label'", ",",...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listDatasetArray
API to list datasets in DBS. :param dataset: list of datasets [dataset1,dataset2,..,dataset n] (Required if dataset_id is not presented), Max length 1000. :type dataset: list :param dataset_id: list of dataset_ids that are the primary keys of datasets table: [dataset_id1,dataset_id2,..,dataset_...
Client/src/python/dbs/apis/dbsClient.py
def listDatasetArray(self, **kwargs): """ API to list datasets in DBS. :param dataset: list of datasets [dataset1,dataset2,..,dataset n] (Required if dataset_id is not presented), Max length 1000. :type dataset: list :param dataset_id: list of dataset_ids that are the primary ke...
def listDatasetArray(self, **kwargs): """ API to list datasets in DBS. :param dataset: list of datasets [dataset1,dataset2,..,dataset n] (Required if dataset_id is not presented), Max length 1000. :type dataset: list :param dataset_id: list of dataset_ids that are the primary ke...
[ "API", "to", "list", "datasets", "in", "DBS", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L776-L802
[ "def", "listDatasetArray", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'dataset'", ",", "'dataset_access_type'", ",", "'detail'", ",", "'dataset_id'", "]", "requiredParameters", "=", "{", "'multiple'", ":", "[", "'dataset'", "...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listFileArray
API to list files in DBS. Non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required. The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported. * For lumi_list the following two json for...
Client/src/python/dbs/apis/dbsClient.py
def listFileArray(self, **kwargs): """ API to list files in DBS. Non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required. The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported...
def listFileArray(self, **kwargs): """ API to list files in DBS. Non-wildcarded logical_file_name, non-wildcarded dataset, non-wildcarded block_name or non-wildcarded lfn list is required. The combination of a non-wildcarded dataset or block_name with an wildcarded logical_file_name is supported...
[ "API", "to", "list", "files", "in", "DBS", ".", "Non", "-", "wildcarded", "logical_file_name", "non", "-", "wildcarded", "dataset", "non", "-", "wildcarded", "block_name", "or", "non", "-", "wildcarded", "lfn", "list", "is", "required", ".", "The", "combinat...
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1127-L1266
[ "def", "listFileArray", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'dataset'", ",", "'block_name'", ",", "'logical_file_name'", ",", "'release_version'", ",", "'pset_hash'", ",", "'app_name'", ",", "'output_module_label'", ",", ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listPrimaryDSTypes
API to list primary dataset types :param primary_ds_type: List that primary dataset type (Optional) :type primary_ds_type: str :param dataset: List the primary dataset type for that dataset (Optional) :type dataset: str :returns: List of dictionaries containing the following key...
Client/src/python/dbs/apis/dbsClient.py
def listPrimaryDSTypes(self, **kwargs): """ API to list primary dataset types :param primary_ds_type: List that primary dataset type (Optional) :type primary_ds_type: str :param dataset: List the primary dataset type for that dataset (Optional) :type dataset: str ...
def listPrimaryDSTypes(self, **kwargs): """ API to list primary dataset types :param primary_ds_type: List that primary dataset type (Optional) :type primary_ds_type: str :param dataset: List the primary dataset type for that dataset (Optional) :type dataset: str ...
[ "API", "to", "list", "primary", "dataset", "types" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1378-L1394
[ "def", "listPrimaryDSTypes", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'primary_ds_type'", ",", "'dataset'", "]", "checkInputParameter", "(", "method", "=", "\"listPrimaryDSTypes\"", ",", "parameters", "=", "kwargs", ".", "key...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.listRuns
API to list all run dictionary, for example: [{'run_num': [160578, 160498, 160447, 160379]}]. At least one parameter is mandatory. :param logical_file_name: List all runs in the file :type logical_file_name: str :param block_name: List all runs in the block :type block_name: st...
Client/src/python/dbs/apis/dbsClient.py
def listRuns(self, **kwargs): """ API to list all run dictionary, for example: [{'run_num': [160578, 160498, 160447, 160379]}]. At least one parameter is mandatory. :param logical_file_name: List all runs in the file :type logical_file_name: str :param block_name: List ...
def listRuns(self, **kwargs): """ API to list all run dictionary, for example: [{'run_num': [160578, 160498, 160447, 160379]}]. At least one parameter is mandatory. :param logical_file_name: List all runs in the file :type logical_file_name: str :param block_name: List ...
[ "API", "to", "list", "all", "run", "dictionary", "for", "example", ":", "[", "{", "run_num", ":", "[", "160578", "160498", "160447", "160379", "]", "}", "]", ".", "At", "least", "one", "parameter", "is", "mandatory", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1432-L1454
[ "def", "listRuns", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'run_num'", ",", "'logical_file_name'", ",", "'block_name'", ",", "'dataset'", "]", "requiredParameters", "=", "{", "'multiple'", ":", "validParameters", "}", "che...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
DbsApi.updateAcqEraEndDate
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
Client/src/python/dbs/apis/dbsClient.py
def updateAcqEraEndDate(self, **kwargs): """ API to update the end_date of an acquisition era :param acquisition_era_name: acquisition_era_name to update (Required) :type acquisition_era_name: str :param end_date: end_date not zero (Required) :type end_date: int ...
def updateAcqEraEndDate(self, **kwargs): """ 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" ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Client/src/python/dbs/apis/dbsClient.py#L1534-L1551
[ "def", "updateAcqEraEndDate", "(", "self", ",", "*", "*", "kwargs", ")", ":", "validParameters", "=", "[", "'end_date'", ",", "'acquisition_era_name'", "]", "requiredParameters", "=", "{", "'forced'", ":", "validParameters", "}", "checkInputParameter", "(", "metho...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
List.execute
Lists lumi section numbers with in a file, a list of files or a block.
Server/Python/src/dbs/dao/Oracle/FileLumi/List.py
def execute(self, conn, logical_file_name='', block_name='', run_num=-1, validFileOnly=0, migration=False): """ Lists lumi section numbers with in a file, a list of files or a block. """ sql = "" wheresql = "" lfn_generator = "" run_generator = "" if logical_file_name and not isinsta...
def execute(self, conn, logical_file_name='', block_name='', run_num=-1, validFileOnly=0, migration=False): """ Lists lumi section numbers with in a file, a list of files or a block. """ sql = "" wheresql = "" lfn_generator = "" run_generator = "" if logical_file_name and not isinsta...
[ "Lists", "lumi", "section", "numbers", "with", "in", "a", "file", "a", "list", "of", "files", "or", "a", "block", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileLumi/List.py#L30-L159
[ "def", "execute", "(", "self", ",", "conn", ",", "logical_file_name", "=", "''", ",", "block_name", "=", "''", ",", "run_num", "=", "-", "1", ",", "validFileOnly", "=", "0", ",", "migration", "=", "False", ")", ":", "sql", "=", "\"\"", "wheresql", "=...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
ListFileParentageByLumi.execute
cursors = self.dbi.processData(sql, binds, conn, transaction=transaction, returnCursor=True) for i in cursors: d = self.formatCursor(i, size=100) if isinstance(d, list) or isinstance(d, GeneratorType): for elem in d: yield elem elif d: ...
Server/Python/src/dbs/dao/Oracle/FileParent/ListFileParentageByLumi.py
def execute(self, conn, child_block_name='', child_lfn_list=[], transaction=False): sql = '' binds = {} child_ds_name = '' child_where = '' if child_block_name: child_ds_name = child_block_name.split('#')[0] parent_where = " where d.dataset = :child_ds_nam...
def execute(self, conn, child_block_name='', child_lfn_list=[], transaction=False): sql = '' binds = {} child_ds_name = '' child_where = '' if child_block_name: child_ds_name = child_block_name.split('#')[0] parent_where = " where d.dataset = :child_ds_nam...
[ "cursors", "=", "self", ".", "dbi", ".", "processData", "(", "sql", "binds", "conn", "transaction", "=", "transaction", "returnCursor", "=", "True", ")", "for", "i", "in", "cursors", ":", "d", "=", "self", ".", "formatCursor", "(", "i", "size", "=", "1...
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/FileParent/ListFileParentageByLumi.py#L39-L118
[ "def", "execute", "(", "self", ",", "conn", ",", "child_block_name", "=", "''", ",", "child_lfn_list", "=", "[", "]", ",", "transaction", "=", "False", ")", ":", "sql", "=", "''", "binds", "=", "{", "}", "child_ds_name", "=", "''", "child_where", "=", ...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
List.execute
Lists all primary datasets if pattern is not provided.
Server/Python/src/dbs/dao/Oracle/DatasetRun/List.py
def execute(self, conn, run_num=-1, logical_file_name="", block_name="", dataset="", trans=False): """ Lists all primary datasets if pattern is not provided. """ sql = self.sql binds = {} if logical_file_name and "%" not in logical_file_name: sql += """ inner join %sFILES F...
def execute(self, conn, run_num=-1, logical_file_name="", block_name="", dataset="", trans=False): """ Lists all primary datasets if pattern is not provided. """ sql = self.sql binds = {} if logical_file_name and "%" not in logical_file_name: sql += """ inner join %sFILES F...
[ "Lists", "all", "primary", "datasets", "if", "pattern", "is", "not", "provided", "." ]
dmwm/DBS
python
https://github.com/dmwm/DBS/blob/9619bafce3783b3e77f0415f8f9a258e33dd1e6f/Server/Python/src/dbs/dao/Oracle/DatasetRun/List.py#L30-L86
[ "def", "execute", "(", "self", ",", "conn", ",", "run_num", "=", "-", "1", ",", "logical_file_name", "=", "\"\"", ",", "block_name", "=", "\"\"", ",", "dataset", "=", "\"\"", ",", "trans", "=", "False", ")", ":", "sql", "=", "self", ".", "sql", "bi...
9619bafce3783b3e77f0415f8f9a258e33dd1e6f
train
find_devices
Return a list of dictionaries. Each dictionary represents one device. The dictionary contains the following keys: port, unique_id and in_use. `port` can be used with :func:`open`. `serial_number` is the serial number of the device (and can also be used with :func:`open`) and `in_use` indicates whether ...
pyaardvark/aardvark.py
def find_devices(): """Return a list of dictionaries. Each dictionary represents one device. The dictionary contains the following keys: port, unique_id and in_use. `port` can be used with :func:`open`. `serial_number` is the serial number of the device (and can also be used with :func:`open`) and `in_...
def find_devices(): """Return a list of dictionaries. Each dictionary represents one device. The dictionary contains the following keys: port, unique_id and in_use. `port` can be used with :func:`open`. `serial_number` is the serial number of the device (and can also be used with :func:`open`) and `in_...
[ "Return", "a", "list", "of", "dictionaries", ".", "Each", "dictionary", "represents", "one", "device", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L91-L141
[ "def", "find_devices", "(", ")", ":", "# first fetch the number of attached devices, so we can create a buffer", "# with the exact amount of entries. api expects array of u16", "num_devices", "=", "api", ".", "py_aa_find_devices", "(", "0", ",", "array", ".", "array", "(", "'H'...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
open
Open an aardvark device and return an :class:`Aardvark` object. If the device cannot be opened an :class:`IOError` is raised. The `port` can be retrieved by :func:`find_devices`. Usually, the first device is 0, the second 1, etc. If you are using only one device, you can therefore omit the parameter ...
pyaardvark/aardvark.py
def open(port=None, serial_number=None): """Open an aardvark device and return an :class:`Aardvark` object. If the device cannot be opened an :class:`IOError` is raised. The `port` can be retrieved by :func:`find_devices`. Usually, the first device is 0, the second 1, etc. If you are using only on...
def open(port=None, serial_number=None): """Open an aardvark device and return an :class:`Aardvark` object. If the device cannot be opened an :class:`IOError` is raised. The `port` can be retrieved by :func:`find_devices`. Usually, the first device is 0, the second 1, etc. If you are using only on...
[ "Open", "an", "aardvark", "device", "and", "return", "an", ":", "class", ":", "Aardvark", "object", ".", "If", "the", "device", "cannot", "be", "opened", "an", ":", "class", ":", "IOError", "is", "raised", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L143-L191
[ "def", "open", "(", "port", "=", "None", ",", "serial_number", "=", "None", ")", ":", "if", "port", "is", "None", "and", "serial_number", "is", "None", ":", "dev", "=", "Aardvark", "(", ")", "elif", "serial_number", "is", "not", "None", ":", "for", "...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.enable_i2c
Set this to `True` to enable the hardware I2C interface. If set to `False` the hardware interface will be disabled and its pins (SDA and SCL) can be used as GPIOs.
pyaardvark/aardvark.py
def enable_i2c(self): """Set this to `True` to enable the hardware I2C interface. If set to `False` the hardware interface will be disabled and its pins (SDA and SCL) can be used as GPIOs. """ config = self._interface_configuration(CONFIG_QUERY) return config == CONFIG_GP...
def enable_i2c(self): """Set this to `True` to enable the hardware I2C interface. If set to `False` the hardware interface will be disabled and its pins (SDA and SCL) can be used as GPIOs. """ config = self._interface_configuration(CONFIG_QUERY) return config == CONFIG_GP...
[ "Set", "this", "to", "True", "to", "enable", "the", "hardware", "I2C", "interface", ".", "If", "set", "to", "False", "the", "hardware", "interface", "will", "be", "disabled", "and", "its", "pins", "(", "SDA", "and", "SCL", ")", "can", "be", "used", "as...
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L280-L286
[ "def", "enable_i2c", "(", "self", ")", ":", "config", "=", "self", ".", "_interface_configuration", "(", "CONFIG_QUERY", ")", "return", "config", "==", "CONFIG_GPIO_I2C", "or", "config", "==", "CONFIG_SPI_I2C" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.enable_spi
Set this to `True` to enable the hardware SPI interface. If set to `False` the hardware interface will be disabled and its pins (MISO, MOSI, SCK and SS) can be used as GPIOs.
pyaardvark/aardvark.py
def enable_spi(self): """Set this to `True` to enable the hardware SPI interface. If set to `False` the hardware interface will be disabled and its pins (MISO, MOSI, SCK and SS) can be used as GPIOs. """ config = self._interface_configuration(CONFIG_QUERY) return config =...
def enable_spi(self): """Set this to `True` to enable the hardware SPI interface. If set to `False` the hardware interface will be disabled and its pins (MISO, MOSI, SCK and SS) can be used as GPIOs. """ config = self._interface_configuration(CONFIG_QUERY) return config =...
[ "Set", "this", "to", "True", "to", "enable", "the", "hardware", "SPI", "interface", ".", "If", "set", "to", "False", "the", "hardware", "interface", "will", "be", "disabled", "and", "its", "pins", "(", "MISO", "MOSI", "SCK", "and", "SS", ")", "can", "b...
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L303-L309
[ "def", "enable_spi", "(", "self", ")", ":", "config", "=", "self", ".", "_interface_configuration", "(", "CONFIG_QUERY", ")", "return", "config", "==", "CONFIG_SPI_GPIO", "or", "config", "==", "CONFIG_SPI_I2C" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_bitrate
I2C bitrate in kHz. Not every bitrate is supported by the host adapter. Therefore, the actual bitrate may be less than the value which is set. The power-on default value is 100 kHz.
pyaardvark/aardvark.py
def i2c_bitrate(self): """I2C bitrate in kHz. Not every bitrate is supported by the host adapter. Therefore, the actual bitrate may be less than the value which is set. The power-on default value is 100 kHz. """ ret = api.py_aa_i2c_bitrate(self.handle, 0) _raise...
def i2c_bitrate(self): """I2C bitrate in kHz. Not every bitrate is supported by the host adapter. Therefore, the actual bitrate may be less than the value which is set. The power-on default value is 100 kHz. """ ret = api.py_aa_i2c_bitrate(self.handle, 0) _raise...
[ "I2C", "bitrate", "in", "kHz", ".", "Not", "every", "bitrate", "is", "supported", "by", "the", "host", "adapter", ".", "Therefore", "the", "actual", "bitrate", "may", "be", "less", "than", "the", "value", "which", "is", "set", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L326-L336
[ "def", "i2c_bitrate", "(", "self", ")", ":", "ret", "=", "api", ".", "py_aa_i2c_bitrate", "(", "self", ".", "handle", ",", "0", ")", "_raise_error_if_negative", "(", "ret", ")", "return", "ret" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_pullups
Setting this to `True` will enable the I2C pullup resistors. If set to `False` the pullup resistors will be disabled. Raises an :exc:`IOError` if the hardware adapter does not support pullup resistors.
pyaardvark/aardvark.py
def i2c_pullups(self): """Setting this to `True` will enable the I2C pullup resistors. If set to `False` the pullup resistors will be disabled. Raises an :exc:`IOError` if the hardware adapter does not support pullup resistors. """ ret = api.py_aa_i2c_pullup(self.handle,...
def i2c_pullups(self): """Setting this to `True` will enable the I2C pullup resistors. If set to `False` the pullup resistors will be disabled. Raises an :exc:`IOError` if the hardware adapter does not support pullup resistors. """ ret = api.py_aa_i2c_pullup(self.handle,...
[ "Setting", "this", "to", "True", "will", "enable", "the", "I2C", "pullup", "resistors", ".", "If", "set", "to", "False", "the", "pullup", "resistors", "will", "be", "disabled", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L344-L353
[ "def", "i2c_pullups", "(", "self", ")", ":", "ret", "=", "api", ".", "py_aa_i2c_pullup", "(", "self", ".", "handle", ",", "I2C_PULLUP_QUERY", ")", "_raise_error_if_negative", "(", "ret", ")", "return", "ret" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.target_power
Setting this to `True` will activate the power pins (4 and 6). If set to `False` the power will be deactivated. Raises an :exc:`IOError` if the hardware adapter does not support the switchable power pins.
pyaardvark/aardvark.py
def target_power(self): """Setting this to `True` will activate the power pins (4 and 6). If set to `False` the power will be deactivated. Raises an :exc:`IOError` if the hardware adapter does not support the switchable power pins. """ ret = api.py_aa_target_power(self.h...
def target_power(self): """Setting this to `True` will activate the power pins (4 and 6). If set to `False` the power will be deactivated. Raises an :exc:`IOError` if the hardware adapter does not support the switchable power pins. """ ret = api.py_aa_target_power(self.h...
[ "Setting", "this", "to", "True", "will", "activate", "the", "power", "pins", "(", "4", "and", "6", ")", ".", "If", "set", "to", "False", "the", "power", "will", "be", "deactivated", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L365-L374
[ "def", "target_power", "(", "self", ")", ":", "ret", "=", "api", ".", "py_aa_target_power", "(", "self", ".", "handle", ",", "TARGET_POWER_QUERY", ")", "_raise_error_if_negative", "(", "ret", ")", "return", "ret" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_bus_timeout
I2C bus lock timeout in ms. Minimum value is 10 ms and the maximum value is 450 ms. Not every value can be set and will be rounded to the next possible number. You can read back the property to get the actual value. The power-on default value is 200 ms.
pyaardvark/aardvark.py
def i2c_bus_timeout(self): """I2C bus lock timeout in ms. Minimum value is 10 ms and the maximum value is 450 ms. Not every value can be set and will be rounded to the next possible number. You can read back the property to get the actual value. The power-on default value is 20...
def i2c_bus_timeout(self): """I2C bus lock timeout in ms. Minimum value is 10 ms and the maximum value is 450 ms. Not every value can be set and will be rounded to the next possible number. You can read back the property to get the actual value. The power-on default value is 20...
[ "I2C", "bus", "lock", "timeout", "in", "ms", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L386-L397
[ "def", "i2c_bus_timeout", "(", "self", ")", ":", "ret", "=", "api", ".", "py_aa_i2c_bus_timeout", "(", "self", ".", "handle", ",", "0", ")", "_raise_error_if_negative", "(", "ret", ")", "return", "ret" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_master_write
Make an I2C write access. The given I2C device is addressed and data given as a string is written. The transaction is finished with an I2C stop condition unless I2C_NO_STOP is set in the flags. 10 bit addresses are supported if the I2C_10_BIT_ADDR flag is set.
pyaardvark/aardvark.py
def i2c_master_write(self, i2c_address, data, flags=I2C_NO_FLAGS): """Make an I2C write access. The given I2C device is addressed and data given as a string is written. The transaction is finished with an I2C stop condition unless I2C_NO_STOP is set in the flags. 10 bit address...
def i2c_master_write(self, i2c_address, data, flags=I2C_NO_FLAGS): """Make an I2C write access. The given I2C device is addressed and data given as a string is written. The transaction is finished with an I2C stop condition unless I2C_NO_STOP is set in the flags. 10 bit address...
[ "Make", "an", "I2C", "write", "access", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L404-L417
[ "def", "i2c_master_write", "(", "self", ",", "i2c_address", ",", "data", ",", "flags", "=", "I2C_NO_FLAGS", ")", ":", "data", "=", "array", ".", "array", "(", "'B'", ",", "data", ")", "status", ",", "_", "=", "api", ".", "py_aa_i2c_write_ext", "(", "se...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_master_read
Make an I2C read access. The given I2C device is addressed and clock cycles for `length` bytes are generated. A short read will occur if the device generates an early NAK. The transaction is finished with an I2C stop condition unless the I2C_NO_STOP flag is set.
pyaardvark/aardvark.py
def i2c_master_read(self, addr, length, flags=I2C_NO_FLAGS): """Make an I2C read access. The given I2C device is addressed and clock cycles for `length` bytes are generated. A short read will occur if the device generates an early NAK. The transaction is finished with an I2C st...
def i2c_master_read(self, addr, length, flags=I2C_NO_FLAGS): """Make an I2C read access. The given I2C device is addressed and clock cycles for `length` bytes are generated. A short read will occur if the device generates an early NAK. The transaction is finished with an I2C st...
[ "Make", "an", "I2C", "read", "access", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L419-L435
[ "def", "i2c_master_read", "(", "self", ",", "addr", ",", "length", ",", "flags", "=", "I2C_NO_FLAGS", ")", ":", "data", "=", "array", ".", "array", "(", "'B'", ",", "(", "0", ",", ")", "*", "length", ")", "status", ",", "rx_len", "=", "api", ".", ...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_master_write_read
Make an I2C write/read access. First an I2C write access is issued. No stop condition will be generated. Instead the read access begins with a repeated start. This method is useful for accessing most addressable I2C devices like EEPROMs, port expander, etc. Basically, this is ...
pyaardvark/aardvark.py
def i2c_master_write_read(self, i2c_address, data, length): """Make an I2C write/read access. First an I2C write access is issued. No stop condition will be generated. Instead the read access begins with a repeated start. This method is useful for accessing most addressable I2C devices...
def i2c_master_write_read(self, i2c_address, data, length): """Make an I2C write/read access. First an I2C write access is issued. No stop condition will be generated. Instead the read access begins with a repeated start. This method is useful for accessing most addressable I2C devices...
[ "Make", "an", "I2C", "write", "/", "read", "access", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L437-L451
[ "def", "i2c_master_write_read", "(", "self", ",", "i2c_address", ",", "data", ",", "length", ")", ":", "self", ".", "i2c_master_write", "(", "i2c_address", ",", "data", ",", "I2C_NO_STOP", ")", "return", "self", ".", "i2c_master_read", "(", "i2c_address", ",",...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.poll
Wait for an event to occur. If `timeout` is given, if specifies the length of time in milliseconds which the function will wait for events before returing. If `timeout` is omitted, negative or None, the call will block until there is an event. Returns a list of events. In case ...
pyaardvark/aardvark.py
def poll(self, timeout=None): """Wait for an event to occur. If `timeout` is given, if specifies the length of time in milliseconds which the function will wait for events before returing. If `timeout` is omitted, negative or None, the call will block until there is an event. ...
def poll(self, timeout=None): """Wait for an event to occur. If `timeout` is given, if specifies the length of time in milliseconds which the function will wait for events before returing. If `timeout` is omitted, negative or None, the call will block until there is an event. ...
[ "Wait", "for", "an", "event", "to", "occur", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L453-L475
[ "def", "poll", "(", "self", ",", "timeout", "=", "None", ")", ":", "if", "timeout", "is", "None", ":", "timeout", "=", "-", "1", "ret", "=", "api", ".", "py_aa_async_poll", "(", "self", ".", "handle", ",", "timeout", ")", "_raise_error_if_negative", "(...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.enable_i2c_slave
Enable I2C slave mode. The device will respond to the specified slave_address if it is addressed. You can wait for the data with :func:`poll` and get it with `i2c_slave_read`.
pyaardvark/aardvark.py
def enable_i2c_slave(self, slave_address): """Enable I2C slave mode. The device will respond to the specified slave_address if it is addressed. You can wait for the data with :func:`poll` and get it with `i2c_slave_read`. """ ret = api.py_aa_i2c_slave_enable(sel...
def enable_i2c_slave(self, slave_address): """Enable I2C slave mode. The device will respond to the specified slave_address if it is addressed. You can wait for the data with :func:`poll` and get it with `i2c_slave_read`. """ ret = api.py_aa_i2c_slave_enable(sel...
[ "Enable", "I2C", "slave", "mode", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L477-L488
[ "def", "enable_i2c_slave", "(", "self", ",", "slave_address", ")", ":", "ret", "=", "api", ".", "py_aa_i2c_slave_enable", "(", "self", ".", "handle", ",", "slave_address", ",", "self", ".", "BUFFER_SIZE", ",", "self", ".", "BUFFER_SIZE", ")", "_raise_error_if_...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_slave_read
Read the bytes from an I2C slave reception. The bytes are returned as a string object.
pyaardvark/aardvark.py
def i2c_slave_read(self): """Read the bytes from an I2C slave reception. The bytes are returned as a string object. """ data = array.array('B', (0,) * self.BUFFER_SIZE) status, addr, rx_len = api.py_aa_i2c_slave_read_ext(self.handle, self.BUFFER_SIZE, data) ...
def i2c_slave_read(self): """Read the bytes from an I2C slave reception. The bytes are returned as a string object. """ data = array.array('B', (0,) * self.BUFFER_SIZE) status, addr, rx_len = api.py_aa_i2c_slave_read_ext(self.handle, self.BUFFER_SIZE, data) ...
[ "Read", "the", "bytes", "from", "an", "I2C", "slave", "reception", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L495-L509
[ "def", "i2c_slave_read", "(", "self", ")", ":", "data", "=", "array", ".", "array", "(", "'B'", ",", "(", "0", ",", ")", "*", "self", ".", "BUFFER_SIZE", ")", "status", ",", "addr", ",", "rx_len", "=", "api", ".", "py_aa_i2c_slave_read_ext", "(", "se...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_slave_last_transmit_size
Returns the number of bytes transmitted by the slave.
pyaardvark/aardvark.py
def i2c_slave_last_transmit_size(self): """Returns the number of bytes transmitted by the slave.""" ret = api.py_aa_i2c_slave_write_stats(self.handle) _raise_error_if_negative(ret) return ret
def i2c_slave_last_transmit_size(self): """Returns the number of bytes transmitted by the slave.""" ret = api.py_aa_i2c_slave_write_stats(self.handle) _raise_error_if_negative(ret) return ret
[ "Returns", "the", "number", "of", "bytes", "transmitted", "by", "the", "slave", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L533-L537
[ "def", "i2c_slave_last_transmit_size", "(", "self", ")", ":", "ret", "=", "api", ".", "py_aa_i2c_slave_write_stats", "(", "self", ".", "handle", ")", "_raise_error_if_negative", "(", "ret", ")", "return", "ret" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.i2c_monitor_read
Retrieved any data fetched by the monitor. This function has an integrated timeout mechanism. You should use :func:`poll` to determine if there is any data available. Returns a list of data bytes and special symbols. There are three special symbols: `I2C_MONITOR_NACK`, I2C_MONITOR_STAR...
pyaardvark/aardvark.py
def i2c_monitor_read(self): """Retrieved any data fetched by the monitor. This function has an integrated timeout mechanism. You should use :func:`poll` to determine if there is any data available. Returns a list of data bytes and special symbols. There are three special symbol...
def i2c_monitor_read(self): """Retrieved any data fetched by the monitor. This function has an integrated timeout mechanism. You should use :func:`poll` to determine if there is any data available. Returns a list of data bytes and special symbols. There are three special symbol...
[ "Retrieved", "any", "data", "fetched", "by", "the", "monitor", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L559-L575
[ "def", "i2c_monitor_read", "(", "self", ")", ":", "data", "=", "array", ".", "array", "(", "'H'", ",", "(", "0", ",", ")", "*", "self", ".", "BUFFER_SIZE", ")", "ret", "=", "api", ".", "py_aa_i2c_monitor_read", "(", "self", ".", "handle", ",", "self"...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.spi_bitrate
SPI bitrate in kHz. Not every bitrate is supported by the host adapter. Therefore, the actual bitrate may be less than the value which is set. The slowest bitrate supported is 125kHz. Any smaller value will be rounded up to 125kHz. The power-on default value is 1000 kHz.
pyaardvark/aardvark.py
def spi_bitrate(self): """SPI bitrate in kHz. Not every bitrate is supported by the host adapter. Therefore, the actual bitrate may be less than the value which is set. The slowest bitrate supported is 125kHz. Any smaller value will be rounded up to 125kHz. The power-on default ...
def spi_bitrate(self): """SPI bitrate in kHz. Not every bitrate is supported by the host adapter. Therefore, the actual bitrate may be less than the value which is set. The slowest bitrate supported is 125kHz. Any smaller value will be rounded up to 125kHz. The power-on default ...
[ "SPI", "bitrate", "in", "kHz", ".", "Not", "every", "bitrate", "is", "supported", "by", "the", "host", "adapter", ".", "Therefore", "the", "actual", "bitrate", "may", "be", "less", "than", "the", "value", "which", "is", "set", ".", "The", "slowest", "bit...
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L578-L588
[ "def", "spi_bitrate", "(", "self", ")", ":", "ret", "=", "api", ".", "py_aa_spi_bitrate", "(", "self", ".", "handle", ",", "0", ")", "_raise_error_if_negative", "(", "ret", ")", "return", "ret" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.spi_configure
Configure the SPI interface.
pyaardvark/aardvark.py
def spi_configure(self, polarity, phase, bitorder): """Configure the SPI interface.""" ret = api.py_aa_spi_configure(self.handle, polarity, phase, bitorder) _raise_error_if_negative(ret)
def spi_configure(self, polarity, phase, bitorder): """Configure the SPI interface.""" ret = api.py_aa_spi_configure(self.handle, polarity, phase, bitorder) _raise_error_if_negative(ret)
[ "Configure", "the", "SPI", "interface", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L595-L598
[ "def", "spi_configure", "(", "self", ",", "polarity", ",", "phase", ",", "bitorder", ")", ":", "ret", "=", "api", ".", "py_aa_spi_configure", "(", "self", ".", "handle", ",", "polarity", ",", "phase", ",", "bitorder", ")", "_raise_error_if_negative", "(", ...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.spi_configure_mode
Configure the SPI interface by the well known SPI modes.
pyaardvark/aardvark.py
def spi_configure_mode(self, spi_mode): """Configure the SPI interface by the well known SPI modes.""" if spi_mode == SPI_MODE_0: self.spi_configure(SPI_POL_RISING_FALLING, SPI_PHASE_SAMPLE_SETUP, SPI_BITORDER_MSB) elif spi_mode == SPI_MODE_3: self.spi...
def spi_configure_mode(self, spi_mode): """Configure the SPI interface by the well known SPI modes.""" if spi_mode == SPI_MODE_0: self.spi_configure(SPI_POL_RISING_FALLING, SPI_PHASE_SAMPLE_SETUP, SPI_BITORDER_MSB) elif spi_mode == SPI_MODE_3: self.spi...
[ "Configure", "the", "SPI", "interface", "by", "the", "well", "known", "SPI", "modes", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L600-L609
[ "def", "spi_configure_mode", "(", "self", ",", "spi_mode", ")", ":", "if", "spi_mode", "==", "SPI_MODE_0", ":", "self", ".", "spi_configure", "(", "SPI_POL_RISING_FALLING", ",", "SPI_PHASE_SAMPLE_SETUP", ",", "SPI_BITORDER_MSB", ")", "elif", "spi_mode", "==", "SPI...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.spi_write
Write a stream of bytes to a SPI device.
pyaardvark/aardvark.py
def spi_write(self, data): """Write a stream of bytes to a SPI device.""" data_out = array.array('B', data) data_in = array.array('B', (0,) * len(data_out)) ret = api.py_aa_spi_write(self.handle, len(data_out), data_out, len(data_in), data_in) _raise_error_if_nega...
def spi_write(self, data): """Write a stream of bytes to a SPI device.""" data_out = array.array('B', data) data_in = array.array('B', (0,) * len(data_out)) ret = api.py_aa_spi_write(self.handle, len(data_out), data_out, len(data_in), data_in) _raise_error_if_nega...
[ "Write", "a", "stream", "of", "bytes", "to", "a", "SPI", "device", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L611-L618
[ "def", "spi_write", "(", "self", ",", "data", ")", ":", "data_out", "=", "array", ".", "array", "(", "'B'", ",", "data", ")", "data_in", "=", "array", ".", "array", "(", "'B'", ",", "(", "0", ",", ")", "*", "len", "(", "data_out", ")", ")", "re...
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
Aardvark.spi_ss_polarity
Change the ouput polarity on the SS line. Please note, that this only affects the master functions.
pyaardvark/aardvark.py
def spi_ss_polarity(self, polarity): """Change the ouput polarity on the SS line. Please note, that this only affects the master functions. """ ret = api.py_aa_spi_master_ss_polarity(self.handle, polarity) _raise_error_if_negative(ret)
def spi_ss_polarity(self, polarity): """Change the ouput polarity on the SS line. Please note, that this only affects the master functions. """ ret = api.py_aa_spi_master_ss_polarity(self.handle, polarity) _raise_error_if_negative(ret)
[ "Change", "the", "ouput", "polarity", "on", "the", "SS", "line", "." ]
kontron/python-aardvark
python
https://github.com/kontron/python-aardvark/blob/9827f669fbdc5bceb98e7d08a294b4e4e455d0d5/pyaardvark/aardvark.py#L620-L626
[ "def", "spi_ss_polarity", "(", "self", ",", "polarity", ")", ":", "ret", "=", "api", ".", "py_aa_spi_master_ss_polarity", "(", "self", ".", "handle", ",", "polarity", ")", "_raise_error_if_negative", "(", "ret", ")" ]
9827f669fbdc5bceb98e7d08a294b4e4e455d0d5
train
OAISetModelView.edit_form
Customize edit form.
invenio_oaiserver/admin.py
def edit_form(self, obj): """Customize edit form.""" form = super(OAISetModelView, self).edit_form(obj) del form.spec return form
def edit_form(self, obj): """Customize edit form.""" form = super(OAISetModelView, self).edit_form(obj) del form.spec return form
[ "Customize", "edit", "form", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/admin.py#L36-L40
[ "def", "edit_form", "(", "self", ",", "obj", ")", ":", "form", "=", "super", "(", "OAISetModelView", ",", "self", ")", ".", "edit_form", "(", "obj", ")", "del", "form", ".", "spec", "return", "form" ]
eae765e32bd816ddc5612d4b281caf205518b512
train
flatten_nested_hash
Flatten nested dictionary for GET / POST / DELETE API request
sailthru/sailthru_http.py
def flatten_nested_hash(hash_table): """ Flatten nested dictionary for GET / POST / DELETE API request """ def flatten(hash_table, brackets=True): f = {} for key, value in hash_table.items(): _key = '[' + str(key) + ']' if brackets else str(key) if isinstance(valu...
def flatten_nested_hash(hash_table): """ Flatten nested dictionary for GET / POST / DELETE API request """ def flatten(hash_table, brackets=True): f = {} for key, value in hash_table.items(): _key = '[' + str(key) + ']' if brackets else str(key) if isinstance(valu...
[ "Flatten", "nested", "dictionary", "for", "GET", "/", "POST", "/", "DELETE", "API", "request" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_http.py#L8-L28
[ "def", "flatten_nested_hash", "(", "hash_table", ")", ":", "def", "flatten", "(", "hash_table", ",", "brackets", "=", "True", ")", ":", "f", "=", "{", "}", "for", "key", ",", "value", "in", "hash_table", ".", "items", "(", ")", ":", "_key", "=", "'['...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
sailthru_http_request
Perform an HTTP GET / POST / DELETE request
sailthru/sailthru_http.py
def sailthru_http_request(url, data, method, file_data=None, headers=None, request_timeout=10): """ Perform an HTTP GET / POST / DELETE request """ data = flatten_nested_hash(data) method = method.upper() params, data = (None, data) if method == 'POST' else (data, None) sailthru_headers = {'...
def sailthru_http_request(url, data, method, file_data=None, headers=None, request_timeout=10): """ Perform an HTTP GET / POST / DELETE request """ data = flatten_nested_hash(data) method = method.upper() params, data = (None, data) if method == 'POST' else (data, None) sailthru_headers = {'...
[ "Perform", "an", "HTTP", "GET", "/", "POST", "/", "DELETE", "request" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_http.py#L30-L49
[ "def", "sailthru_http_request", "(", "url", ",", "data", ",", "method", ",", "file_data", "=", "None", ",", "headers", "=", "None", ",", "request_timeout", "=", "10", ")", ":", "data", "=", "flatten_nested_hash", "(", "data", ")", "method", "=", "method", ...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
_schema_from_verb
Return an instance of schema for given verb.
invenio_oaiserver/resumption_token.py
def _schema_from_verb(verb, partial=False): """Return an instance of schema for given verb.""" from .verbs import Verbs return getattr(Verbs, verb)(partial=partial)
def _schema_from_verb(verb, partial=False): """Return an instance of schema for given verb.""" from .verbs import Verbs return getattr(Verbs, verb)(partial=partial)
[ "Return", "an", "instance", "of", "schema", "for", "given", "verb", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L18-L21
[ "def", "_schema_from_verb", "(", "verb", ",", "partial", "=", "False", ")", ":", "from", ".", "verbs", "import", "Verbs", "return", "getattr", "(", "Verbs", ",", "verb", ")", "(", "partial", "=", "partial", ")" ]
eae765e32bd816ddc5612d4b281caf205518b512
train
serialize
Return resumption token serializer.
invenio_oaiserver/resumption_token.py
def serialize(pagination, **kwargs): """Return resumption token serializer.""" if not pagination.has_next: return token_builder = URLSafeTimedSerializer( current_app.config['SECRET_KEY'], salt=kwargs['verb'], ) schema = _schema_from_verb(kwargs['verb'], partial=False) da...
def serialize(pagination, **kwargs): """Return resumption token serializer.""" if not pagination.has_next: return token_builder = URLSafeTimedSerializer( current_app.config['SECRET_KEY'], salt=kwargs['verb'], ) schema = _schema_from_verb(kwargs['verb'], partial=False) da...
[ "Return", "resumption", "token", "serializer", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L24-L40
[ "def", "serialize", "(", "pagination", ",", "*", "*", "kwargs", ")", ":", "if", "not", "pagination", ".", "has_next", ":", "return", "token_builder", "=", "URLSafeTimedSerializer", "(", "current_app", ".", "config", "[", "'SECRET_KEY'", "]", ",", "salt", "="...
eae765e32bd816ddc5612d4b281caf205518b512
train
ResumptionToken._deserialize
Serialize resumption token.
invenio_oaiserver/resumption_token.py
def _deserialize(self, value, attr, data): """Serialize resumption token.""" token_builder = URLSafeTimedSerializer( current_app.config['SECRET_KEY'], salt=data['verb'], ) result = token_builder.loads(value, max_age=current_app.config[ 'OAISERVER_RESUM...
def _deserialize(self, value, attr, data): """Serialize resumption token.""" token_builder = URLSafeTimedSerializer( current_app.config['SECRET_KEY'], salt=data['verb'], ) result = token_builder.loads(value, max_age=current_app.config[ 'OAISERVER_RESUM...
[ "Serialize", "resumption", "token", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L46-L56
[ "def", "_deserialize", "(", "self", ",", "value", ",", "attr", ",", "data", ")", ":", "token_builder", "=", "URLSafeTimedSerializer", "(", "current_app", ".", "config", "[", "'SECRET_KEY'", "]", ",", "salt", "=", "data", "[", "'verb'", "]", ",", ")", "re...
eae765e32bd816ddc5612d4b281caf205518b512
train
ResumptionTokenSchema.load
Deserialize a data structure to an object.
invenio_oaiserver/resumption_token.py
def load(self, data, many=None, partial=None): """Deserialize a data structure to an object.""" result = super(ResumptionTokenSchema, self).load( data, many=many, partial=partial ) result.data.update( result.data.get('resumptionToken', {}).get('kwargs', {}) ...
def load(self, data, many=None, partial=None): """Deserialize a data structure to an object.""" result = super(ResumptionTokenSchema, self).load( data, many=many, partial=partial ) result.data.update( result.data.get('resumptionToken', {}).get('kwargs', {}) ...
[ "Deserialize", "a", "data", "structure", "to", "an", "object", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/resumption_token.py#L64-L72
[ "def", "load", "(", "self", ",", "data", ",", "many", "=", "None", ",", "partial", "=", "None", ")", ":", "result", "=", "super", "(", "ResumptionTokenSchema", ",", "self", ")", ".", "load", "(", "data", ",", "many", "=", "many", ",", "partial", "=...
eae765e32bd816ddc5612d4b281caf205518b512
train
make_request_validator
Validate arguments in incomming request.
invenio_oaiserver/verbs.py
def make_request_validator(request): """Validate arguments in incomming request.""" verb = request.values.get('verb', '', type=str) resumption_token = request.values.get('resumptionToken', None) schema = Verbs if resumption_token is None else ResumptionVerbs return getattr(schema, verb, OAISchema)(...
def make_request_validator(request): """Validate arguments in incomming request.""" verb = request.values.get('verb', '', type=str) resumption_token = request.values.get('resumptionToken', None) schema = Verbs if resumption_token is None else ResumptionVerbs return getattr(schema, verb, OAISchema)(...
[ "Validate", "arguments", "in", "incomming", "request", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/verbs.py#L152-L158
[ "def", "make_request_validator", "(", "request", ")", ":", "verb", "=", "request", ".", "values", ".", "get", "(", "'verb'", ",", "''", ",", "type", "=", "str", ")", "resumption_token", "=", "request", ".", "values", ".", "get", "(", "'resumptionToken'", ...
eae765e32bd816ddc5612d4b281caf205518b512
train
DateTime.from_iso_permissive
Parse an ISO8601-formatted datetime and return a datetime object. Inspired by the marshmallow.utils.from_iso function, but also accepts datestrings that don't contain the time.
invenio_oaiserver/verbs.py
def from_iso_permissive(datestring, use_dateutil=True): """Parse an ISO8601-formatted datetime and return a datetime object. Inspired by the marshmallow.utils.from_iso function, but also accepts datestrings that don't contain the time. """ dateutil_available = False try:...
def from_iso_permissive(datestring, use_dateutil=True): """Parse an ISO8601-formatted datetime and return a datetime object. Inspired by the marshmallow.utils.from_iso function, but also accepts datestrings that don't contain the time. """ dateutil_available = False try:...
[ "Parse", "an", "ISO8601", "-", "formatted", "datetime", "and", "return", "a", "datetime", "object", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/verbs.py#L36-L56
[ "def", "from_iso_permissive", "(", "datestring", ",", "use_dateutil", "=", "True", ")", ":", "dateutil_available", "=", "False", "try", ":", "from", "dateutil", "import", "parser", "dateutil_available", "=", "True", "except", "ImportError", ":", "dateutil_available"...
eae765e32bd816ddc5612d4b281caf205518b512
train
OAISchema.validate
Check range between dates under keys ``from_`` and ``until``.
invenio_oaiserver/verbs.py
def validate(self, data): """Check range between dates under keys ``from_`` and ``until``.""" if 'verb' in data and data['verb'] != self.__class__.__name__: raise ValidationError( # FIXME encode data 'This is not a valid OAI-PMH verb:{0}'.format(data['verb']),...
def validate(self, data): """Check range between dates under keys ``from_`` and ``until``.""" if 'verb' in data and data['verb'] != self.__class__.__name__: raise ValidationError( # FIXME encode data 'This is not a valid OAI-PMH verb:{0}'.format(data['verb']),...
[ "Check", "range", "between", "dates", "under", "keys", "from_", "and", "until", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/verbs.py#L75-L92
[ "def", "validate", "(", "self", ",", "data", ")", ":", "if", "'verb'", "in", "data", "and", "data", "[", "'verb'", "]", "!=", "self", ".", "__class__", ".", "__name__", ":", "raise", "ValidationError", "(", "# FIXME encode data", "'This is not a valid OAI-PMH ...
eae765e32bd816ddc5612d4b281caf205518b512
train
upgrade
Upgrade database.
invenio_oaiserver/alembic/e655021de0de_create_oiaserver_tables.py
def upgrade(): """Upgrade database.""" op.create_table( 'oaiserver_set', sa.Column('created', sa.DateTime(), nullable=False), sa.Column('updated', sa.DateTime(), nullable=False), sa.Column('id', sa.Integer(), nullable=False), sa.Column('spec', sa.String(length=255), nulla...
def upgrade(): """Upgrade database.""" op.create_table( 'oaiserver_set', sa.Column('created', sa.DateTime(), nullable=False), sa.Column('updated', sa.DateTime(), nullable=False), sa.Column('id', sa.Integer(), nullable=False), sa.Column('spec', sa.String(length=255), nulla...
[ "Upgrade", "database", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/alembic/e655021de0de_create_oiaserver_tables.py#L21-L40
[ "def", "upgrade", "(", ")", ":", "op", ".", "create_table", "(", "'oaiserver_set'", ",", "sa", ".", "Column", "(", "'created'", ",", "sa", ".", "DateTime", "(", ")", ",", "nullable", "=", "False", ")", ",", "sa", ".", "Column", "(", "'updated'", ",",...
eae765e32bd816ddc5612d4b281caf205518b512
train
_AppState.sets
Get list of sets.
invenio_oaiserver/ext.py
def sets(self): """Get list of sets.""" if self.cache: return self.cache.get( self.app.config['OAISERVER_CACHE_KEY'])
def sets(self): """Get list of sets.""" if self.cache: return self.cache.get( self.app.config['OAISERVER_CACHE_KEY'])
[ "Get", "list", "of", "sets", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/ext.py#L33-L37
[ "def", "sets", "(", "self", ")", ":", "if", "self", ".", "cache", ":", "return", "self", ".", "cache", ".", "get", "(", "self", ".", "app", ".", "config", "[", "'OAISERVER_CACHE_KEY'", "]", ")" ]
eae765e32bd816ddc5612d4b281caf205518b512
train
_AppState.sets
Set list of sets.
invenio_oaiserver/ext.py
def sets(self, values): """Set list of sets.""" # if cache server is configured, save sets list if self.cache: self.cache.set(self.app.config['OAISERVER_CACHE_KEY'], values)
def sets(self, values): """Set list of sets.""" # if cache server is configured, save sets list if self.cache: self.cache.set(self.app.config['OAISERVER_CACHE_KEY'], values)
[ "Set", "list", "of", "sets", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/ext.py#L40-L44
[ "def", "sets", "(", "self", ",", "values", ")", ":", "# if cache server is configured, save sets list", "if", "self", ".", "cache", ":", "self", ".", "cache", ".", "set", "(", "self", ".", "app", ".", "config", "[", "'OAISERVER_CACHE_KEY'", "]", ",", "values...
eae765e32bd816ddc5612d4b281caf205518b512
train
_AppState.register_signals
Register signals.
invenio_oaiserver/ext.py
def register_signals(self): """Register signals.""" from .receivers import OAIServerUpdater # Register Record signals to update OAI informations self.update_function = OAIServerUpdater() records_signals.before_record_insert.connect(self.update_function, ...
def register_signals(self): """Register signals.""" from .receivers import OAIServerUpdater # Register Record signals to update OAI informations self.update_function = OAIServerUpdater() records_signals.before_record_insert.connect(self.update_function, ...
[ "Register", "signals", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/ext.py#L46-L56
[ "def", "register_signals", "(", "self", ")", ":", "from", ".", "receivers", "import", "OAIServerUpdater", "# Register Record signals to update OAI informations", "self", ".", "update_function", "=", "OAIServerUpdater", "(", ")", "records_signals", ".", "before_record_insert...
eae765e32bd816ddc5612d4b281caf205518b512
train
_AppState.register_signals_oaiset
Register OAISet signals to update records.
invenio_oaiserver/ext.py
def register_signals_oaiset(self): """Register OAISet signals to update records.""" from .models import OAISet from .receivers import after_insert_oai_set, \ after_update_oai_set, after_delete_oai_set listen(OAISet, 'after_insert', after_insert_oai_set) listen(OAISet,...
def register_signals_oaiset(self): """Register OAISet signals to update records.""" from .models import OAISet from .receivers import after_insert_oai_set, \ after_update_oai_set, after_delete_oai_set listen(OAISet, 'after_insert', after_insert_oai_set) listen(OAISet,...
[ "Register", "OAISet", "signals", "to", "update", "records", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/ext.py#L58-L65
[ "def", "register_signals_oaiset", "(", "self", ")", ":", "from", ".", "models", "import", "OAISet", "from", ".", "receivers", "import", "after_insert_oai_set", ",", "after_update_oai_set", ",", "after_delete_oai_set", "listen", "(", "OAISet", ",", "'after_insert'", ...
eae765e32bd816ddc5612d4b281caf205518b512
train
_AppState.unregister_signals
Unregister signals.
invenio_oaiserver/ext.py
def unregister_signals(self): """Unregister signals.""" # Unregister Record signals if hasattr(self, 'update_function'): records_signals.before_record_insert.disconnect( self.update_function) records_signals.before_record_update.disconnect( ...
def unregister_signals(self): """Unregister signals.""" # Unregister Record signals if hasattr(self, 'update_function'): records_signals.before_record_insert.disconnect( self.update_function) records_signals.before_record_update.disconnect( ...
[ "Unregister", "signals", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/ext.py#L67-L75
[ "def", "unregister_signals", "(", "self", ")", ":", "# Unregister Record signals", "if", "hasattr", "(", "self", ",", "'update_function'", ")", ":", "records_signals", ".", "before_record_insert", ".", "disconnect", "(", "self", ".", "update_function", ")", "records...
eae765e32bd816ddc5612d4b281caf205518b512
train
_AppState.unregister_signals_oaiset
Unregister signals oaiset.
invenio_oaiserver/ext.py
def unregister_signals_oaiset(self): """Unregister signals oaiset.""" from .models import OAISet from .receivers import after_insert_oai_set, \ after_update_oai_set, after_delete_oai_set if contains(OAISet, 'after_insert', after_insert_oai_set): remove(OAISet, 'af...
def unregister_signals_oaiset(self): """Unregister signals oaiset.""" from .models import OAISet from .receivers import after_insert_oai_set, \ after_update_oai_set, after_delete_oai_set if contains(OAISet, 'after_insert', after_insert_oai_set): remove(OAISet, 'af...
[ "Unregister", "signals", "oaiset", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/ext.py#L77-L85
[ "def", "unregister_signals_oaiset", "(", "self", ")", ":", "from", ".", "models", "import", "OAISet", "from", ".", "receivers", "import", "after_insert_oai_set", ",", "after_update_oai_set", ",", "after_delete_oai_set", "if", "contains", "(", "OAISet", ",", "'after_...
eae765e32bd816ddc5612d4b281caf205518b512
train
InvenioOAIServer.init_config
Initialize configuration. :param app: An instance of :class:`flask.Flask`.
invenio_oaiserver/ext.py
def init_config(self, app): """Initialize configuration. :param app: An instance of :class:`flask.Flask`. """ app.config.setdefault( 'OAISERVER_BASE_TEMPLATE', app.config.get('BASE_TEMPLATE', 'invenio_oaiserver/base.html')) app...
def init_config(self, app): """Initialize configuration. :param app: An instance of :class:`flask.Flask`. """ app.config.setdefault( 'OAISERVER_BASE_TEMPLATE', app.config.get('BASE_TEMPLATE', 'invenio_oaiserver/base.html')) app...
[ "Initialize", "configuration", "." ]
inveniosoftware/invenio-oaiserver
python
https://github.com/inveniosoftware/invenio-oaiserver/blob/eae765e32bd816ddc5612d4b281caf205518b512/invenio_oaiserver/ext.py#L108-L138
[ "def", "init_config", "(", "self", ",", "app", ")", ":", "app", ".", "config", ".", "setdefault", "(", "'OAISERVER_BASE_TEMPLATE'", ",", "app", ".", "config", ".", "get", "(", "'BASE_TEMPLATE'", ",", "'invenio_oaiserver/base.html'", ")", ")", "app", ".", "co...
eae765e32bd816ddc5612d4b281caf205518b512
train
extract_params
Extracts the values of a set of parameters, recursing into nested dictionaries.
sailthru/sailthru_client.py
def extract_params(params): """ Extracts the values of a set of parameters, recursing into nested dictionaries. """ values = [] if isinstance(params, dict): for key, value in params.items(): values.extend(extract_params(value)) elif isinstance(params, list): for value...
def extract_params(params): """ Extracts the values of a set of parameters, recursing into nested dictionaries. """ values = [] if isinstance(params, dict): for key, value in params.items(): values.extend(extract_params(value)) elif isinstance(params, list): for value...
[ "Extracts", "the", "values", "of", "a", "set", "of", "parameters", "recursing", "into", "nested", "dictionaries", "." ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L11-L24
[ "def", "extract_params", "(", "params", ")", ":", "values", "=", "[", "]", "if", "isinstance", "(", "params", ",", "dict", ")", ":", "for", "key", ",", "value", "in", "params", ".", "items", "(", ")", ":", "values", ".", "extend", "(", "extract_param...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
get_signature_string
Returns the unhashed signature string (secret + sorted list of param values) for an API call. @param params: dictionary values to generate signature string @param secret: secret string
sailthru/sailthru_client.py
def get_signature_string(params, secret): """ Returns the unhashed signature string (secret + sorted list of param values) for an API call. @param params: dictionary values to generate signature string @param secret: secret string """ str_list = [str(item) for item in extract_params(params)] ...
def get_signature_string(params, secret): """ Returns the unhashed signature string (secret + sorted list of param values) for an API call. @param params: dictionary values to generate signature string @param secret: secret string """ str_list = [str(item) for item in extract_params(params)] ...
[ "Returns", "the", "unhashed", "signature", "string", "(", "secret", "+", "sorted", "list", "of", "param", "values", ")", "for", "an", "API", "call", "." ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L26-L34
[ "def", "get_signature_string", "(", "params", ",", "secret", ")", ":", "str_list", "=", "[", "str", "(", "item", ")", "for", "item", "in", "extract_params", "(", "params", ")", "]", "str_list", ".", "sort", "(", ")", "return", "(", "secret", "+", "''",...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.send
Remotely send an email template to a single email address. http://docs.sailthru.com/api/send @param template: template string @param email: Email value @param _vars: a key/value hash of the replacement vars to use in the send. Each var may be referenced as {varname} within the template i...
sailthru/sailthru_client.py
def send(self, template, email, _vars=None, options=None, schedule_time=None, limit=None): """ Remotely send an email template to a single email address. http://docs.sailthru.com/api/send @param template: template string @param email: Email value @param _vars: a key/value...
def send(self, template, email, _vars=None, options=None, schedule_time=None, limit=None): """ Remotely send an email template to a single email address. http://docs.sailthru.com/api/send @param template: template string @param email: Email value @param _vars: a key/value...
[ "Remotely", "send", "an", "email", "template", "to", "a", "single", "email", "address", ".", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "send" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L65-L86
[ "def", "send", "(", "self", ",", "template", ",", "email", ",", "_vars", "=", "None", ",", "options", "=", "None", ",", "schedule_time", "=", "None", ",", "limit", "=", "None", ")", ":", "_vars", "=", "_vars", "or", "{", "}", "options", "=", "optio...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.multi_send
Remotely send an email template to multiple email addresses. http://docs.sailthru.com/api/send @param template: template string @param emails: List with email values or comma separated email string @param _vars: a key/value hash of the replacement vars to use in the send. Each var may be...
sailthru/sailthru_client.py
def multi_send(self, template, emails, _vars=None, evars=None, schedule_time=None, options=None): """ Remotely send an email template to multiple email addresses. http://docs.sailthru.com/api/send @param template: template string @param emails: List with email values or comma sep...
def multi_send(self, template, emails, _vars=None, evars=None, schedule_time=None, options=None): """ Remotely send an email template to multiple email addresses. http://docs.sailthru.com/api/send @param template: template string @param emails: List with email values or comma sep...
[ "Remotely", "send", "an", "email", "template", "to", "multiple", "email", "addresses", ".", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "send" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L88-L108
[ "def", "multi_send", "(", "self", ",", "template", ",", "emails", ",", "_vars", "=", "None", ",", "evars", "=", "None", ",", "schedule_time", "=", "None", ",", "options", "=", "None", ")", ":", "_vars", "=", "_vars", "or", "{", "}", "evars", "=", "...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.set_email
DEPRECATED! Update information about one of your users, including adding and removing the user from lists. http://docs.sailthru.com/api/email
sailthru/sailthru_client.py
def set_email(self, email, _vars=None, lists=None, templates=None, verified=0, optout=None, send=None, send_vars=None): """ DEPRECATED! Update information about one of your users, including adding and removing the user from lists. http://docs.sailthru.com/api/email """ _v...
def set_email(self, email, _vars=None, lists=None, templates=None, verified=0, optout=None, send=None, send_vars=None): """ DEPRECATED! Update information about one of your users, including adding and removing the user from lists. http://docs.sailthru.com/api/email """ _v...
[ "DEPRECATED!", "Update", "information", "about", "one", "of", "your", "users", "including", "adding", "and", "removing", "the", "user", "from", "lists", ".", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "email" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L131-L152
[ "def", "set_email", "(", "self", ",", "email", ",", "_vars", "=", "None", ",", "lists", "=", "None", ",", "templates", "=", "None", ",", "verified", "=", "0", ",", "optout", "=", "None", ",", "send", "=", "None", ",", "send_vars", "=", "None", ")",...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.get_user
get user by a given id http://getstarted.sailthru.com/api/user
sailthru/sailthru_client.py
def get_user(self, idvalue, options=None): """ get user by a given id http://getstarted.sailthru.com/api/user """ options = options or {} data = options.copy() data['id'] = idvalue return self.api_get('user', data)
def get_user(self, idvalue, options=None): """ get user by a given id http://getstarted.sailthru.com/api/user """ options = options or {} data = options.copy() data['id'] = idvalue return self.api_get('user', data)
[ "get", "user", "by", "a", "given", "id", "http", ":", "//", "getstarted", ".", "sailthru", ".", "com", "/", "api", "/", "user" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L154-L162
[ "def", "get_user", "(", "self", ",", "idvalue", ",", "options", "=", "None", ")", ":", "options", "=", "options", "or", "{", "}", "data", "=", "options", ".", "copy", "(", ")", "data", "[", "'id'", "]", "=", "idvalue", "return", "self", ".", "api_g...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.save_user
save user by a given id http://getstarted.sailthru.com/api/user
sailthru/sailthru_client.py
def save_user(self, idvalue, options=None): """ save user by a given id http://getstarted.sailthru.com/api/user """ options = options or {} data = options.copy() data['id'] = idvalue return self.api_post('user', data)
def save_user(self, idvalue, options=None): """ save user by a given id http://getstarted.sailthru.com/api/user """ options = options or {} data = options.copy() data['id'] = idvalue return self.api_post('user', data)
[ "save", "user", "by", "a", "given", "id", "http", ":", "//", "getstarted", ".", "sailthru", ".", "com", "/", "api", "/", "user" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L164-L172
[ "def", "save_user", "(", "self", ",", "idvalue", ",", "options", "=", "None", ")", ":", "options", "=", "options", "or", "{", "}", "data", "=", "options", ".", "copy", "(", ")", "data", "[", "'id'", "]", "=", "idvalue", "return", "self", ".", "api_...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.schedule_blast
Schedule a mass mail blast http://docs.sailthru.com/api/blast @param name: name to give to this new blast @param list: mailing list name to send to @param schedule_time: when the blast should send. Dates in the past will be scheduled for immediate delivery. Any English textual datetime ...
sailthru/sailthru_client.py
def schedule_blast(self, name, list, schedule_time, from_name, from_email, subject, content_html, content_text, options=None): """ Schedule a mass mail blast http://docs.sailthru.com/api/blast @param name: name to give to this new blast @param list: mailing list name to send to ...
def schedule_blast(self, name, list, schedule_time, from_name, from_email, subject, content_html, content_text, options=None): """ Schedule a mass mail blast http://docs.sailthru.com/api/blast @param name: name to give to this new blast @param list: mailing list name to send to ...
[ "Schedule", "a", "mass", "mail", "blast", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "blast" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L174-L212
[ "def", "schedule_blast", "(", "self", ",", "name", ",", "list", ",", "schedule_time", ",", "from_name", ",", "from_email", ",", "subject", ",", "content_html", ",", "content_text", ",", "options", "=", "None", ")", ":", "options", "=", "options", "or", "{"...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.schedule_blast_from_template
Schedule a mass mail blast from template http://docs.sailthru.com/api/blast @param template: template to copy from @param list_name: list to send to @param schedule_time @param options: additional optional params
sailthru/sailthru_client.py
def schedule_blast_from_template(self, template, list_name, schedule_time, options=None): """ Schedule a mass mail blast from template http://docs.sailthru.com/api/blast @param template: template to copy from @param list_name: list to send to @param schedule_time ...
def schedule_blast_from_template(self, template, list_name, schedule_time, options=None): """ Schedule a mass mail blast from template http://docs.sailthru.com/api/blast @param template: template to copy from @param list_name: list to send to @param schedule_time ...
[ "Schedule", "a", "mass", "mail", "blast", "from", "template", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "blast" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L214-L228
[ "def", "schedule_blast_from_template", "(", "self", ",", "template", ",", "list_name", ",", "schedule_time", ",", "options", "=", "None", ")", ":", "options", "=", "options", "or", "{", "}", "data", "=", "options", ".", "copy", "(", ")", "data", "[", "'c...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.schedule_blast_from_blast
Schedule a mass mail blast from previous blast http://docs.sailthru.com/api/blast @param blast_id: blast_id to copy from @param schedule_time @param options: additional optional params
sailthru/sailthru_client.py
def schedule_blast_from_blast(self, blast_id, schedule_time, options=None): """ Schedule a mass mail blast from previous blast http://docs.sailthru.com/api/blast @param blast_id: blast_id to copy from @param schedule_time @param options: additional optional params ...
def schedule_blast_from_blast(self, blast_id, schedule_time, options=None): """ Schedule a mass mail blast from previous blast http://docs.sailthru.com/api/blast @param blast_id: blast_id to copy from @param schedule_time @param options: additional optional params ...
[ "Schedule", "a", "mass", "mail", "blast", "from", "previous", "blast", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "blast" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L230-L242
[ "def", "schedule_blast_from_blast", "(", "self", ",", "blast_id", ",", "schedule_time", ",", "options", "=", "None", ")", ":", "options", "=", "options", "or", "{", "}", "data", "=", "options", ".", "copy", "(", ")", "data", "[", "'copy_blast'", "]", "="...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.get_list
Get detailed metadata information about a list.
sailthru/sailthru_client.py
def get_list(self, list_name, options=None): """ Get detailed metadata information about a list. """ options = options or {} data = {'list': list_name} data.update(options) return self.api_get('list', data)
def get_list(self, list_name, options=None): """ Get detailed metadata information about a list. """ options = options or {} data = {'list': list_name} data.update(options) return self.api_get('list', data)
[ "Get", "detailed", "metadata", "information", "about", "a", "list", "." ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L341-L348
[ "def", "get_list", "(", "self", ",", "list_name", ",", "options", "=", "None", ")", ":", "options", "=", "options", "or", "{", "}", "data", "=", "{", "'list'", ":", "list_name", "}", "data", ".", "update", "(", "options", ")", "return", "self", ".", ...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.save_list
Upload a list. The list import job is queued and will happen shortly after the API request. http://docs.sailthru.com/api/list @param list: list name @param emails: List of email values or comma separated string
sailthru/sailthru_client.py
def save_list(self, list_name, emails): """ Upload a list. The list import job is queued and will happen shortly after the API request. http://docs.sailthru.com/api/list @param list: list name @param emails: List of email values or comma separated string """ data ...
def save_list(self, list_name, emails): """ Upload a list. The list import job is queued and will happen shortly after the API request. http://docs.sailthru.com/api/list @param list: list name @param emails: List of email values or comma separated string """ data ...
[ "Upload", "a", "list", ".", "The", "list", "import", "job", "is", "queued", "and", "will", "happen", "shortly", "after", "the", "API", "request", ".", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "list" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L356-L365
[ "def", "save_list", "(", "self", ",", "list_name", ",", "emails", ")", ":", "data", "=", "{", "'list'", ":", "list_name", ",", "'emails'", ":", "','", ".", "join", "(", "emails", ")", "if", "isinstance", "(", "emails", ",", "list", ")", "else", "emai...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.import_contacts
Fetch email contacts from a user's address book on one of the major email websites. Currently supports AOL, Gmail, Hotmail, and Yahoo! Mail.
sailthru/sailthru_client.py
def import_contacts(self, email, password, include_name=False): """ Fetch email contacts from a user's address book on one of the major email websites. Currently supports AOL, Gmail, Hotmail, and Yahoo! Mail. """ data = {'email': email, 'password': password} if in...
def import_contacts(self, email, password, include_name=False): """ Fetch email contacts from a user's address book on one of the major email websites. Currently supports AOL, Gmail, Hotmail, and Yahoo! Mail. """ data = {'email': email, 'password': password} if in...
[ "Fetch", "email", "contacts", "from", "a", "user", "s", "address", "book", "on", "one", "of", "the", "major", "email", "websites", ".", "Currently", "supports", "AOL", "Gmail", "Hotmail", "and", "Yahoo!", "Mail", "." ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L374-L382
[ "def", "import_contacts", "(", "self", ",", "email", ",", "password", ",", "include_name", "=", "False", ")", ":", "data", "=", "{", "'email'", ":", "email", ",", "'password'", ":", "password", "}", "if", "include_name", ":", "data", "[", "'names'", "]",...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.push_content
Push a new piece of content to Sailthru. Expected names for the `images` argument's map are "full" and "thumb" Expected format for `location` should be [longitude,latitude] @param title: title string for the content @param url: URL string for the content @param images: map of i...
sailthru/sailthru_client.py
def push_content(self, title, url, images=None, date=None, expire_date=None, description=None, location=None, price=None, tags=None, author=None, site_name=None, spider=None, vars=None): """ Push a ...
def push_content(self, title, url, images=None, date=None, expire_date=None, description=None, location=None, price=None, tags=None, author=None, site_name=None, spider=None, vars=None): """ Push a ...
[ "Push", "a", "new", "piece", "of", "content", "to", "Sailthru", "." ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L384-L437
[ "def", "push_content", "(", "self", ",", "title", ",", "url", ",", "images", "=", "None", ",", "date", "=", "None", ",", "expire_date", "=", "None", ",", "description", "=", "None", ",", "location", "=", "None", ",", "price", "=", "None", ",", "tags"...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.save_alert
Add a new alert to a user. You can add either a realtime or a summary alert (daily/weekly). http://docs.sailthru.com/api/alert Usage: email = 'praj@sailthru.com' type = 'weekly' template = 'default' when = '+5 hours' alert_options = {'match': ...
sailthru/sailthru_client.py
def save_alert(self, email, type, template, when=None, options=None): """ Add a new alert to a user. You can add either a realtime or a summary alert (daily/weekly). http://docs.sailthru.com/api/alert Usage: email = 'praj@sailthru.com' type = 'weekly' ...
def save_alert(self, email, type, template, when=None, options=None): """ Add a new alert to a user. You can add either a realtime or a summary alert (daily/weekly). http://docs.sailthru.com/api/alert Usage: email = 'praj@sailthru.com' type = 'weekly' ...
[ "Add", "a", "new", "alert", "to", "a", "user", ".", "You", "can", "add", "either", "a", "realtime", "or", "a", "summary", "alert", "(", "daily", "/", "weekly", ")", ".", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "al...
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L445-L474
[ "def", "save_alert", "(", "self", ",", "email", ",", "type", ",", "template", ",", "when", "=", "None", ",", "options", "=", "None", ")", ":", "options", "=", "options", "or", "{", "}", "data", "=", "options", ".", "copy", "(", ")", "data", "[", ...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.delete_alert
delete user alert
sailthru/sailthru_client.py
def delete_alert(self, email, alert_id): """ delete user alert """ data = {'email': email, 'alert_id': alert_id} return self.api_delete('alert', data)
def delete_alert(self, email, alert_id): """ delete user alert """ data = {'email': email, 'alert_id': alert_id} return self.api_delete('alert', data)
[ "delete", "user", "alert" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L476-L482
[ "def", "delete_alert", "(", "self", ",", "email", ",", "alert_id", ")", ":", "data", "=", "{", "'email'", ":", "email", ",", "'alert_id'", ":", "alert_id", "}", "return", "self", ".", "api_delete", "(", "'alert'", ",", "data", ")" ]
22aa39ba0c5bddd7b8743e24ada331128c0f4f54
train
SailthruClient.purchase
Record that a user has made a purchase, or has added items to their purchase total. http://docs.sailthru.com/api/purchase @param email: Email string @param items: list of item dictionary with keys: id, title, price, qty, and url @param message_id: message_id string @param extid: ...
sailthru/sailthru_client.py
def purchase(self, email, items=None, incomplete=None, message_id=None, options=None, extid=None): """ Record that a user has made a purchase, or has added items to their purchase total. http://docs.sailthru.com/api/purchase @param email: Email string @param items: list of item d...
def purchase(self, email, items=None, incomplete=None, message_id=None, options=None, extid=None): """ Record that a user has made a purchase, or has added items to their purchase total. http://docs.sailthru.com/api/purchase @param email: Email string @param items: list of item d...
[ "Record", "that", "a", "user", "has", "made", "a", "purchase", "or", "has", "added", "items", "to", "their", "purchase", "total", ".", "http", ":", "//", "docs", ".", "sailthru", ".", "com", "/", "api", "/", "purchase" ]
sailthru/sailthru-python-client
python
https://github.com/sailthru/sailthru-python-client/blob/22aa39ba0c5bddd7b8743e24ada331128c0f4f54/sailthru/sailthru_client.py#L484-L505
[ "def", "purchase", "(", "self", ",", "email", ",", "items", "=", "None", ",", "incomplete", "=", "None", ",", "message_id", "=", "None", ",", "options", "=", "None", ",", "extid", "=", "None", ")", ":", "items", "=", "items", "or", "{", "}", "optio...
22aa39ba0c5bddd7b8743e24ada331128c0f4f54