repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
mdiener/grace
grace/py27/pyjsdoc.py
split_tag
def split_tag(section): """ Split the JSDoc tag text (everything following the @) at the first whitespace. Returns a tuple of (tagname, body). """ splitval = re.split('\s+', section, 1) tag, body = len(splitval) > 1 and splitval or (splitval[0], '') return tag.strip(), body.strip()
python
def split_tag(section): """ Split the JSDoc tag text (everything following the @) at the first whitespace. Returns a tuple of (tagname, body). """ splitval = re.split('\s+', section, 1) tag, body = len(splitval) > 1 and splitval or (splitval[0], '') return tag.strip(), body.strip()
[ "def", "split_tag", "(", "section", ")", ":", "splitval", "=", "re", ".", "split", "(", "'\\s+'", ",", "section", ",", "1", ")", "tag", ",", "body", "=", "len", "(", "splitval", ")", ">", "1", "and", "splitval", "or", "(", "splitval", "[", "0", "...
Split the JSDoc tag text (everything following the @) at the first whitespace. Returns a tuple of (tagname, body).
[ "Split", "the", "JSDoc", "tag", "text", "(", "everything", "following", "the" ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L257-L264
mdiener/grace
grace/py27/pyjsdoc.py
guess_function_name
def guess_function_name(next_line, regexps=FUNCTION_REGEXPS): """ Attempt to determine the function name from the first code line following the comment. The patterns recognized are described by `regexps`, which defaults to FUNCTION_REGEXPS. If a match is successful, returns the function name. Ot...
python
def guess_function_name(next_line, regexps=FUNCTION_REGEXPS): """ Attempt to determine the function name from the first code line following the comment. The patterns recognized are described by `regexps`, which defaults to FUNCTION_REGEXPS. If a match is successful, returns the function name. Ot...
[ "def", "guess_function_name", "(", "next_line", ",", "regexps", "=", "FUNCTION_REGEXPS", ")", ":", "for", "regexp", "in", "regexps", ":", "match", "=", "re", ".", "search", "(", "regexp", ",", "next_line", ")", "if", "match", ":", "return", "match", ".", ...
Attempt to determine the function name from the first code line following the comment. The patterns recognized are described by `regexps`, which defaults to FUNCTION_REGEXPS. If a match is successful, returns the function name. Otherwise, returns None.
[ "Attempt", "to", "determine", "the", "function", "name", "from", "the", "first", "code", "line", "following", "the", "comment", ".", "The", "patterns", "recognized", "are", "described", "by", "regexps", "which", "defaults", "to", "FUNCTION_REGEXPS", ".", "If", ...
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L272-L283
mdiener/grace
grace/py27/pyjsdoc.py
guess_parameters
def guess_parameters(next_line): """ Attempt to guess parameters based on the presence of a parenthesized group of identifiers. If successful, returns a list of parameter names; otherwise, returns None. """ match = re.search('\(([\w\s,]+)\)', next_line) if match: return [arg.strip()...
python
def guess_parameters(next_line): """ Attempt to guess parameters based on the presence of a parenthesized group of identifiers. If successful, returns a list of parameter names; otherwise, returns None. """ match = re.search('\(([\w\s,]+)\)', next_line) if match: return [arg.strip()...
[ "def", "guess_parameters", "(", "next_line", ")", ":", "match", "=", "re", ".", "search", "(", "'\\(([\\w\\s,]+)\\)'", ",", "next_line", ")", "if", "match", ":", "return", "[", "arg", ".", "strip", "(", ")", "for", "arg", "in", "match", ".", "group", "...
Attempt to guess parameters based on the presence of a parenthesized group of identifiers. If successful, returns a list of parameter names; otherwise, returns None.
[ "Attempt", "to", "guess", "parameters", "based", "on", "the", "presence", "of", "a", "parenthesized", "group", "of", "identifiers", ".", "If", "successful", "returns", "a", "list", "of", "parameter", "names", ";", "otherwise", "returns", "None", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L285-L295
mdiener/grace
grace/py27/pyjsdoc.py
parse_comment
def parse_comment(doc_comment, next_line): r""" Split the raw comment text into a dictionary of tags. The main comment body is included as 'doc'. >>> comment = get_doc_comments(read_file('examples/module.js'))[4][0] >>> parse_comment(strip_stars(comment), '')['doc'] 'This is the documentation ...
python
def parse_comment(doc_comment, next_line): r""" Split the raw comment text into a dictionary of tags. The main comment body is included as 'doc'. >>> comment = get_doc_comments(read_file('examples/module.js'))[4][0] >>> parse_comment(strip_stars(comment), '')['doc'] 'This is the documentation ...
[ "def", "parse_comment", "(", "doc_comment", ",", "next_line", ")", ":", "sections", "=", "re", ".", "split", "(", "'\\n\\s*@'", ",", "doc_comment", ")", "tags", "=", "{", "'doc'", ":", "sections", "[", "0", "]", ".", "strip", "(", ")", ",", "'guessed_f...
r""" Split the raw comment text into a dictionary of tags. The main comment body is included as 'doc'. >>> comment = get_doc_comments(read_file('examples/module.js'))[4][0] >>> parse_comment(strip_stars(comment), '')['doc'] 'This is the documentation for the fourth function.\n\n Since the function...
[ "r", "Split", "the", "raw", "comment", "text", "into", "a", "dictionary", "of", "tags", ".", "The", "main", "comment", "body", "is", "included", "as", "doc", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L297-L330
mdiener/grace
grace/py27/pyjsdoc.py
parse_comments_for_file
def parse_comments_for_file(filename): """ Return a list of all parsed comments in a file. Mostly for testing & interactive use. """ return [parse_comment(strip_stars(comment), next_line) for comment, next_line in get_doc_comments(read_file(filename))]
python
def parse_comments_for_file(filename): """ Return a list of all parsed comments in a file. Mostly for testing & interactive use. """ return [parse_comment(strip_stars(comment), next_line) for comment, next_line in get_doc_comments(read_file(filename))]
[ "def", "parse_comments_for_file", "(", "filename", ")", ":", "return", "[", "parse_comment", "(", "strip_stars", "(", "comment", ")", ",", "next_line", ")", "for", "comment", ",", "next_line", "in", "get_doc_comments", "(", "read_file", "(", "filename", ")", "...
Return a list of all parsed comments in a file. Mostly for testing & interactive use.
[ "Return", "a", "list", "of", "all", "parsed", "comments", "in", "a", "file", ".", "Mostly", "for", "testing", "&", "interactive", "use", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L332-L338
mdiener/grace
grace/py27/pyjsdoc.py
build_dependency_graph
def build_dependency_graph(start_nodes, js_doc): """ Build a graph where nodes are filenames and edges are reverse dependencies (so an edge from jquery.js to jquery.dimensions.js indicates that jquery.js must be included before jquery.dimensions.js). The graph is represented as a dictionary from fi...
python
def build_dependency_graph(start_nodes, js_doc): """ Build a graph where nodes are filenames and edges are reverse dependencies (so an edge from jquery.js to jquery.dimensions.js indicates that jquery.js must be included before jquery.dimensions.js). The graph is represented as a dictionary from fi...
[ "def", "build_dependency_graph", "(", "start_nodes", ",", "js_doc", ")", ":", "queue", "=", "[", "]", "dependencies", "=", "{", "}", "start_sort", "=", "[", "]", "def", "add_vertex", "(", "file", ")", ":", "in_degree", "=", "len", "(", "js_doc", "[", "...
Build a graph where nodes are filenames and edges are reverse dependencies (so an edge from jquery.js to jquery.dimensions.js indicates that jquery.js must be included before jquery.dimensions.js). The graph is represented as a dictionary from filename to (in-degree, edges) pair, for ease of topologica...
[ "Build", "a", "graph", "where", "nodes", "are", "filenames", "and", "edges", "are", "reverse", "dependencies", "(", "so", "an", "edge", "from", "jquery", ".", "js", "to", "jquery", ".", "dimensions", ".", "js", "indicates", "that", "jquery", ".", "js", "...
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1362-L1393
mdiener/grace
grace/py27/pyjsdoc.py
topological_sort
def topological_sort(dependencies, start_nodes): """ Perform a topological sort on the dependency graph `dependencies`, starting from list `start_nodes`. """ retval = [] def edges(node): return dependencies[node][1] def in_degree(node): return dependencies[node][0] def remove_incoming(no...
python
def topological_sort(dependencies, start_nodes): """ Perform a topological sort on the dependency graph `dependencies`, starting from list `start_nodes`. """ retval = [] def edges(node): return dependencies[node][1] def in_degree(node): return dependencies[node][0] def remove_incoming(no...
[ "def", "topological_sort", "(", "dependencies", ",", "start_nodes", ")", ":", "retval", "=", "[", "]", "def", "edges", "(", "node", ")", ":", "return", "dependencies", "[", "node", "]", "[", "1", "]", "def", "in_degree", "(", "node", ")", ":", "return"...
Perform a topological sort on the dependency graph `dependencies`, starting from list `start_nodes`.
[ "Perform", "a", "topological", "sort", "on", "the", "dependency", "graph", "dependencies", "starting", "from", "list", "start_nodes", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1395-L1416
mdiener/grace
grace/py27/pyjsdoc.py
make_index
def make_index(css_class, entities): """ Generate the HTML index (a short description and a link to the full documentation) for a list of FunctionDocs or ClassDocs. """ def make_entry(entity): return ('<dt><a href = "%(url)s">%(name)s</a></dt>\n' + '<dd>%(doc)s</dd>') % { ...
python
def make_index(css_class, entities): """ Generate the HTML index (a short description and a link to the full documentation) for a list of FunctionDocs or ClassDocs. """ def make_entry(entity): return ('<dt><a href = "%(url)s">%(name)s</a></dt>\n' + '<dd>%(doc)s</dd>') % { ...
[ "def", "make_index", "(", "css_class", ",", "entities", ")", ":", "def", "make_entry", "(", "entity", ")", ":", "return", "(", "'<dt><a href = \"%(url)s\">%(name)s</a></dt>\\n'", "+", "'<dd>%(doc)s</dd>'", ")", "%", "{", "'name'", ":", "entity", ".", "name", ","...
Generate the HTML index (a short description and a link to the full documentation) for a list of FunctionDocs or ClassDocs.
[ "Generate", "the", "HTML", "index", "(", "a", "short", "description", "and", "a", "link", "to", "the", "full", "documentation", ")", "for", "a", "list", "of", "FunctionDocs", "or", "ClassDocs", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1442-L1458
mdiener/grace
grace/py27/pyjsdoc.py
htmlize_paragraphs
def htmlize_paragraphs(text): """ Convert paragraphs delimited by blank lines into HTML text enclosed in <p> tags. """ paragraphs = re.split('(\r?\n)\s*(\r?\n)', text) return '\n'.join('<p>%s</p>' % paragraph for paragraph in paragraphs)
python
def htmlize_paragraphs(text): """ Convert paragraphs delimited by blank lines into HTML text enclosed in <p> tags. """ paragraphs = re.split('(\r?\n)\s*(\r?\n)', text) return '\n'.join('<p>%s</p>' % paragraph for paragraph in paragraphs)
[ "def", "htmlize_paragraphs", "(", "text", ")", ":", "paragraphs", "=", "re", ".", "split", "(", "'(\\r?\\n)\\s*(\\r?\\n)'", ",", "text", ")", "return", "'\\n'", ".", "join", "(", "'<p>%s</p>'", "%", "paragraph", "for", "paragraph", "in", "paragraphs", ")" ]
Convert paragraphs delimited by blank lines into HTML text enclosed in <p> tags.
[ "Convert", "paragraphs", "delimited", "by", "blank", "lines", "into", "HTML", "text", "enclosed", "in", "<p", ">", "tags", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1475-L1481
mdiener/grace
grace/py27/pyjsdoc.py
get_path_list
def get_path_list(opts): """ Return a list of all root paths where JS files can be found, given the command line options (in dict form) for this script. """ paths = [] for opt, arg in list(opts.items()): if opt in ('-p', '--jspath'): paths.append(arg) return paths or [os....
python
def get_path_list(opts): """ Return a list of all root paths where JS files can be found, given the command line options (in dict form) for this script. """ paths = [] for opt, arg in list(opts.items()): if opt in ('-p', '--jspath'): paths.append(arg) return paths or [os....
[ "def", "get_path_list", "(", "opts", ")", ":", "paths", "=", "[", "]", "for", "opt", ",", "arg", "in", "list", "(", "opts", ".", "items", "(", ")", ")", ":", "if", "opt", "in", "(", "'-p'", ",", "'--jspath'", ")", ":", "paths", ".", "append", "...
Return a list of all root paths where JS files can be found, given the command line options (in dict form) for this script.
[ "Return", "a", "list", "of", "all", "root", "paths", "where", "JS", "files", "can", "be", "found", "given", "the", "command", "line", "options", "(", "in", "dict", "form", ")", "for", "this", "script", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1540-L1549
mdiener/grace
grace/py27/pyjsdoc.py
run_and_exit_if
def run_and_exit_if(opts, action, *names): """ Run the no-arg function `action` if any of `names` appears in the option dict `opts`. """ for name in names: if name in opts: action() sys.exit(0)
python
def run_and_exit_if(opts, action, *names): """ Run the no-arg function `action` if any of `names` appears in the option dict `opts`. """ for name in names: if name in opts: action() sys.exit(0)
[ "def", "run_and_exit_if", "(", "opts", ",", "action", ",", "*", "names", ")", ":", "for", "name", "in", "names", ":", "if", "name", "in", "opts", ":", "action", "(", ")", "sys", ".", "exit", "(", "0", ")" ]
Run the no-arg function `action` if any of `names` appears in the option dict `opts`.
[ "Run", "the", "no", "-", "arg", "function", "action", "if", "any", "of", "names", "appears", "in", "the", "option", "dict", "opts", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1551-L1559
mdiener/grace
grace/py27/pyjsdoc.py
main
def main(args=sys.argv): """ Main command-line invocation. """ try: opts, args = getopt.gnu_getopt(args[1:], 'p:o:jdt', [ 'jspath=', 'output=', 'private', 'json', 'dependencies', 'test', 'help']) opts = dict(opts) except getopt.GetoptError: usage() ...
python
def main(args=sys.argv): """ Main command-line invocation. """ try: opts, args = getopt.gnu_getopt(args[1:], 'p:o:jdt', [ 'jspath=', 'output=', 'private', 'json', 'dependencies', 'test', 'help']) opts = dict(opts) except getopt.GetoptError: usage() ...
[ "def", "main", "(", "args", "=", "sys", ".", "argv", ")", ":", "try", ":", "opts", ",", "args", "=", "getopt", ".", "gnu_getopt", "(", "args", "[", "1", ":", "]", ",", "'p:o:jdt'", ",", "[", "'jspath='", ",", "'output='", ",", "'private'", ",", "...
Main command-line invocation.
[ "Main", "command", "-", "line", "invocation", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1565-L1600
mdiener/grace
grace/py27/pyjsdoc.py
CodeBaseDoc._build_dependencies
def _build_dependencies(self): """ >>> CodeBaseDoc(['examples'])['subclass.js'].module.all_dependencies ['module.js', 'module_closure.js', 'class.js', 'subclass.js'] """ for module in list(self.values()): module.set_all_dependencies(find_dependencies([module.name], se...
python
def _build_dependencies(self): """ >>> CodeBaseDoc(['examples'])['subclass.js'].module.all_dependencies ['module.js', 'module_closure.js', 'class.js', 'subclass.js'] """ for module in list(self.values()): module.set_all_dependencies(find_dependencies([module.name], se...
[ "def", "_build_dependencies", "(", "self", ")", ":", "for", "module", "in", "list", "(", "self", ".", "values", "(", ")", ")", ":", "module", ".", "set_all_dependencies", "(", "find_dependencies", "(", "[", "module", ".", "name", "]", ",", "self", ")", ...
>>> CodeBaseDoc(['examples'])['subclass.js'].module.all_dependencies ['module.js', 'module_closure.js', 'class.js', 'subclass.js']
[ ">>>", "CodeBaseDoc", "(", "[", "examples", "]", ")", "[", "subclass", ".", "js", "]", ".", "module", ".", "all_dependencies", "[", "module", ".", "js", "module_closure", ".", "js", "class", ".", "js", "subclass", ".", "js", "]" ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L391-L397
mdiener/grace
grace/py27/pyjsdoc.py
CodeBaseDoc._build_superclass_lists
def _build_superclass_lists(self): """ >>> CodeBaseDoc(['examples']).all_classes['MySubClass'].all_superclasses[0].name 'MyClass' """ cls_dict = self.all_classes for cls in list(cls_dict.values()): cls.all_superclasses = [] superclass = cls.supercl...
python
def _build_superclass_lists(self): """ >>> CodeBaseDoc(['examples']).all_classes['MySubClass'].all_superclasses[0].name 'MyClass' """ cls_dict = self.all_classes for cls in list(cls_dict.values()): cls.all_superclasses = [] superclass = cls.supercl...
[ "def", "_build_superclass_lists", "(", "self", ")", ":", "cls_dict", "=", "self", ".", "all_classes", "for", "cls", "in", "list", "(", "cls_dict", ".", "values", "(", ")", ")", ":", "cls", ".", "all_superclasses", "=", "[", "]", "superclass", "=", "cls",...
>>> CodeBaseDoc(['examples']).all_classes['MySubClass'].all_superclasses[0].name 'MyClass'
[ ">>>", "CodeBaseDoc", "(", "[", "examples", "]", ")", ".", "all_classes", "[", "MySubClass", "]", ".", "all_superclasses", "[", "0", "]", ".", "name", "MyClass" ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L399-L414
mdiener/grace
grace/py27/pyjsdoc.py
CodeBaseDoc.translate_ref_to_url
def translate_ref_to_url(self, ref, in_comment=None): """ Translates an @see or @link reference to a URL. If the ref is of the form #methodName, it looks for a method of that name on the class `in_comment` or parent class of method `in_comment`. In this case, it returns a loca...
python
def translate_ref_to_url(self, ref, in_comment=None): """ Translates an @see or @link reference to a URL. If the ref is of the form #methodName, it looks for a method of that name on the class `in_comment` or parent class of method `in_comment`. In this case, it returns a loca...
[ "def", "translate_ref_to_url", "(", "self", ",", "ref", ",", "in_comment", "=", "None", ")", ":", "if", "ref", ".", "startswith", "(", "'#'", ")", ":", "method_name", "=", "ref", "[", "1", ":", "]", "if", "isinstance", "(", "in_comment", ",", "Function...
Translates an @see or @link reference to a URL. If the ref is of the form #methodName, it looks for a method of that name on the class `in_comment` or parent class of method `in_comment`. In this case, it returns a local hash URL, since the method is guaranteed to be on the same page:...
[ "Translates", "an", "@see", "or", "@link", "reference", "to", "a", "URL", ".", "If", "the", "ref", "is", "of", "the", "form", "#methodName", "it", "looks", "for", "a", "method", "of", "that", "name", "on", "the", "class", "in_comment", "or", "parent", ...
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L442-L513
mdiener/grace
grace/py27/pyjsdoc.py
CodeBaseDoc.translate_links
def translate_links(self, text, in_comment=None): """ Turn all @link tags in `text` into HTML anchor tags. `in_comment` is the `CommentDoc` that contains the text, for relative method lookups. """ def replace_link(matchobj): ref = matchobj.group(1) ...
python
def translate_links(self, text, in_comment=None): """ Turn all @link tags in `text` into HTML anchor tags. `in_comment` is the `CommentDoc` that contains the text, for relative method lookups. """ def replace_link(matchobj): ref = matchobj.group(1) ...
[ "def", "translate_links", "(", "self", ",", "text", ",", "in_comment", "=", "None", ")", ":", "def", "replace_link", "(", "matchobj", ")", ":", "ref", "=", "matchobj", ".", "group", "(", "1", ")", "return", "'<a href = \"%s\">%s</a>'", "%", "(", "self", ...
Turn all @link tags in `text` into HTML anchor tags. `in_comment` is the `CommentDoc` that contains the text, for relative method lookups.
[ "Turn", "all", "@link", "tags", "in", "text", "into", "HTML", "anchor", "tags", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L525-L536
mdiener/grace
grace/py27/pyjsdoc.py
CodeBaseDoc.to_dict
def to_dict(self, files=None): """ Converts the CodeBaseDoc into a dictionary containing the to_dict() representations of each contained file. The optional `files` list lets you restrict the dict to include only specific files. >>> CodeBaseDoc(['examples']).to_dict(['class.js']...
python
def to_dict(self, files=None): """ Converts the CodeBaseDoc into a dictionary containing the to_dict() representations of each contained file. The optional `files` list lets you restrict the dict to include only specific files. >>> CodeBaseDoc(['examples']).to_dict(['class.js']...
[ "def", "to_dict", "(", "self", ",", "files", "=", "None", ")", ":", "keys", "=", "files", "or", "list", "(", "self", ".", "keys", "(", ")", ")", "return", "dict", "(", "(", "key", ",", "self", "[", "key", "]", ".", "to_dict", "(", ")", ")", "...
Converts the CodeBaseDoc into a dictionary containing the to_dict() representations of each contained file. The optional `files` list lets you restrict the dict to include only specific files. >>> CodeBaseDoc(['examples']).to_dict(['class.js']).get('module.js') >>> CodeBaseDoc(['exampl...
[ "Converts", "the", "CodeBaseDoc", "into", "a", "dictionary", "containing", "the", "to_dict", "()", "representations", "of", "each", "contained", "file", ".", "The", "optional", "files", "list", "lets", "you", "restrict", "the", "dict", "to", "include", "only", ...
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L545-L557
mdiener/grace
grace/py27/pyjsdoc.py
CodeBaseDoc.save_docs
def save_docs(self, files=None, output_dir=None): """ Save documentation files for codebase into `output_dir`. If output dir is None, it'll refrain from building the index page and build the file(s) in the current directory. If `files` is None, it'll build all files in the code...
python
def save_docs(self, files=None, output_dir=None): """ Save documentation files for codebase into `output_dir`. If output dir is None, it'll refrain from building the index page and build the file(s) in the current directory. If `files` is None, it'll build all files in the code...
[ "def", "save_docs", "(", "self", ",", "files", "=", "None", ",", "output_dir", "=", "None", ")", ":", "if", "output_dir", ":", "try", ":", "os", ".", "mkdir", "(", "output_dir", ")", "except", "OSError", ":", "pass", "try", ":", "import", "pkg_resource...
Save documentation files for codebase into `output_dir`. If output dir is None, it'll refrain from building the index page and build the file(s) in the current directory. If `files` is None, it'll build all files in the codebase.
[ "Save", "documentation", "files", "for", "codebase", "into", "output_dir", ".", "If", "output", "dir", "is", "None", "it", "ll", "refrain", "from", "building", "the", "index", "page", "and", "build", "the", "file", "(", "s", ")", "in", "the", "current", ...
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L566-L607
mdiener/grace
grace/py27/pyjsdoc.py
FileDoc.functions
def functions(self): """ Returns a generator of all standalone functions in the file, in textual order. >>> file = FileDoc('module.js', read_file('examples/module.js')) >>> list(file.functions)[0].name 'the_first_function' >>> list(file.functions)[3].name ...
python
def functions(self): """ Returns a generator of all standalone functions in the file, in textual order. >>> file = FileDoc('module.js', read_file('examples/module.js')) >>> list(file.functions)[0].name 'the_first_function' >>> list(file.functions)[3].name ...
[ "def", "functions", "(", "self", ")", ":", "def", "is_function", "(", "comment", ")", ":", "return", "isinstance", "(", "comment", ",", "FunctionDoc", ")", "and", "not", "comment", ".", "member", "return", "self", ".", "_filtered_iter", "(", "is_function", ...
Returns a generator of all standalone functions in the file, in textual order. >>> file = FileDoc('module.js', read_file('examples/module.js')) >>> list(file.functions)[0].name 'the_first_function' >>> list(file.functions)[3].name 'not_auto_discovered'
[ "Returns", "a", "generator", "of", "all", "standalone", "functions", "in", "the", "file", "in", "textual", "order", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L742-L756
mdiener/grace
grace/py27/pyjsdoc.py
FileDoc.methods
def methods(self): """ Returns a generator of all member functions in the file, in textual order. >>> file = FileDoc('class.js', read_file('examples/class.js')) >>> file.methods.next().name 'first_method' """ def is_method(comment): return ...
python
def methods(self): """ Returns a generator of all member functions in the file, in textual order. >>> file = FileDoc('class.js', read_file('examples/class.js')) >>> file.methods.next().name 'first_method' """ def is_method(comment): return ...
[ "def", "methods", "(", "self", ")", ":", "def", "is_method", "(", "comment", ")", ":", "return", "isinstance", "(", "comment", ",", "FunctionDoc", ")", "and", "comment", ".", "member", "return", "self", ".", "_filtered_iter", "(", "is_method", ")" ]
Returns a generator of all member functions in the file, in textual order. >>> file = FileDoc('class.js', read_file('examples/class.js')) >>> file.methods.next().name 'first_method'
[ "Returns", "a", "generator", "of", "all", "member", "functions", "in", "the", "file", "in", "textual", "order", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L759-L771
mdiener/grace
grace/py27/pyjsdoc.py
CommentDoc.get_as_list
def get_as_list(self, tag_name): """ Return the value of a tag, making sure that it's a list. Absent tags are returned as an empty-list; single tags are returned as a one-element list. The returned list is a copy, and modifications do not affect the original object. ...
python
def get_as_list(self, tag_name): """ Return the value of a tag, making sure that it's a list. Absent tags are returned as an empty-list; single tags are returned as a one-element list. The returned list is a copy, and modifications do not affect the original object. ...
[ "def", "get_as_list", "(", "self", ",", "tag_name", ")", ":", "val", "=", "self", ".", "get", "(", "tag_name", ",", "[", "]", ")", "if", "isinstance", "(", "val", ",", "list", ")", ":", "return", "val", "[", ":", "]", "else", ":", "return", "[", ...
Return the value of a tag, making sure that it's a list. Absent tags are returned as an empty-list; single tags are returned as a one-element list. The returned list is a copy, and modifications do not affect the original object.
[ "Return", "the", "value", "of", "a", "tag", "making", "sure", "that", "it", "s", "a", "list", ".", "Absent", "tags", "are", "returned", "as", "an", "empty", "-", "list", ";", "single", "tags", "are", "returned", "as", "a", "one", "-", "element", "lis...
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L839-L852
mdiener/grace
grace/py27/pyjsdoc.py
ModuleDoc.to_dict
def to_dict(self): """ Return this ModuleDoc as a dict. In addition to `CommentDoc` defaults, this has: - **name**: The module name. - **dependencies**: A list of immediate dependencies. - **all_dependencies**: A list of all dependencies. """ ...
python
def to_dict(self): """ Return this ModuleDoc as a dict. In addition to `CommentDoc` defaults, this has: - **name**: The module name. - **dependencies**: A list of immediate dependencies. - **all_dependencies**: A list of all dependencies. """ ...
[ "def", "to_dict", "(", "self", ")", ":", "vars", "=", "super", "(", "ModuleDoc", ",", "self", ")", ".", "to_dict", "(", ")", "vars", "[", "'dependencies'", "]", "=", "self", ".", "dependencies", "vars", "[", "'name'", "]", "=", "self", ".", "name", ...
Return this ModuleDoc as a dict. In addition to `CommentDoc` defaults, this has: - **name**: The module name. - **dependencies**: A list of immediate dependencies. - **all_dependencies**: A list of all dependencies.
[ "Return", "this", "ModuleDoc", "as", "a", "dict", ".", "In", "addition", "to", "CommentDoc", "defaults", "this", "has", ":" ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L947-L963
mdiener/grace
grace/py27/pyjsdoc.py
ModuleDoc.to_html
def to_html(self, codebase): """ Convert this to HTML. """ html = '' def build_line(key, include_pred, format_fn): val = getattr(self, key) if include_pred(val): return '<dt>%s</dt><dd>%s</dd>\n' % (printable(key), format_fn(val)) ...
python
def to_html(self, codebase): """ Convert this to HTML. """ html = '' def build_line(key, include_pred, format_fn): val = getattr(self, key) if include_pred(val): return '<dt>%s</dt><dd>%s</dd>\n' % (printable(key), format_fn(val)) ...
[ "def", "to_html", "(", "self", ",", "codebase", ")", ":", "html", "=", "''", "def", "build_line", "(", "key", ",", "include_pred", ",", "format_fn", ")", ":", "val", "=", "getattr", "(", "self", ",", "key", ")", "if", "include_pred", "(", "val", ")",...
Convert this to HTML.
[ "Convert", "this", "to", "HTML", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L965-L989
mdiener/grace
grace/py27/pyjsdoc.py
FunctionDoc.params
def params(self): """ Returns a ParamDoc for each parameter of the function, picking up the order from the actual parameter list. >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn2 = FunctionDoc(comments[2]) >>> fn2.params[0].name 'elem'...
python
def params(self): """ Returns a ParamDoc for each parameter of the function, picking up the order from the actual parameter list. >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn2 = FunctionDoc(comments[2]) >>> fn2.params[0].name 'elem'...
[ "def", "params", "(", "self", ")", ":", "tag_texts", "=", "self", ".", "get_as_list", "(", "'param'", ")", "+", "self", ".", "get_as_list", "(", "'argument'", ")", "if", "self", ".", "get", "(", "'guessed_params'", ")", "is", "None", ":", "return", "["...
Returns a ParamDoc for each parameter of the function, picking up the order from the actual parameter list. >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn2 = FunctionDoc(comments[2]) >>> fn2.params[0].name 'elem' >>> fn2.params[1].type ...
[ "Returns", "a", "ParamDoc", "for", "each", "parameter", "of", "the", "function", "picking", "up", "the", "order", "from", "the", "actual", "parameter", "list", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1012-L1036
mdiener/grace
grace/py27/pyjsdoc.py
FunctionDoc.return_val
def return_val(self): """ Returns the return value of the function, as a ParamDoc with an empty name: >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn1 = FunctionDoc(comments[1]) >>> fn1.return_val.name '' >>> fn1.return_val.doc...
python
def return_val(self): """ Returns the return value of the function, as a ParamDoc with an empty name: >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn1 = FunctionDoc(comments[1]) >>> fn1.return_val.name '' >>> fn1.return_val.doc...
[ "def", "return_val", "(", "self", ")", ":", "ret", "=", "self", ".", "get", "(", "'return'", ")", "or", "self", ".", "get", "(", "'returns'", ")", "type", "=", "self", ".", "get", "(", "'type'", ")", "if", "'{'", "in", "ret", "and", "'}'", "in", ...
Returns the return value of the function, as a ParamDoc with an empty name: >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn1 = FunctionDoc(comments[1]) >>> fn1.return_val.name '' >>> fn1.return_val.doc 'Some value' >>> fn1.retu...
[ "Returns", "the", "return", "value", "of", "the", "function", "as", "a", "ParamDoc", "with", "an", "empty", "name", ":" ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1057-L1087
mdiener/grace
grace/py27/pyjsdoc.py
FunctionDoc.exceptions
def exceptions(self): """ Returns a list of ParamDoc objects (with empty names) of the exception tags for the function. >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn1 = FunctionDoc(comments[1]) >>> fn1.exceptions[0].doc 'Another exce...
python
def exceptions(self): """ Returns a list of ParamDoc objects (with empty names) of the exception tags for the function. >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn1 = FunctionDoc(comments[1]) >>> fn1.exceptions[0].doc 'Another exce...
[ "def", "exceptions", "(", "self", ")", ":", "def", "make_param", "(", "text", ")", ":", "if", "'{'", "in", "text", "and", "'}'", "in", "text", ":", "# Make sure param name is blank:", "word_split", "=", "list", "(", "split_delimited", "(", "'{}'", ",", "' ...
Returns a list of ParamDoc objects (with empty names) of the exception tags for the function. >>> comments = parse_comments_for_file('examples/module_closure.js') >>> fn1 = FunctionDoc(comments[1]) >>> fn1.exceptions[0].doc 'Another exception' >>> fn1.exceptions[1].doc ...
[ "Returns", "a", "list", "of", "ParamDoc", "objects", "(", "with", "empty", "names", ")", "of", "the", "exception", "tags", "for", "the", "function", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1090-L1117
mdiener/grace
grace/py27/pyjsdoc.py
FunctionDoc.to_dict
def to_dict(self): """ Convert this FunctionDoc to a dictionary. In addition to `CommentDoc` keys, this adds: - **name**: The function name - **params**: A list of parameter dictionaries - **options**: A list of option dictionaries - **exceptions...
python
def to_dict(self): """ Convert this FunctionDoc to a dictionary. In addition to `CommentDoc` keys, this adds: - **name**: The function name - **params**: A list of parameter dictionaries - **options**: A list of option dictionaries - **exceptions...
[ "def", "to_dict", "(", "self", ")", ":", "vars", "=", "super", "(", "FunctionDoc", ",", "self", ")", ".", "to_dict", "(", ")", "vars", ".", "update", "(", "{", "'name'", ":", "self", ".", "name", ",", "'params'", ":", "[", "param", ".", "to_dict", ...
Convert this FunctionDoc to a dictionary. In addition to `CommentDoc` keys, this adds: - **name**: The function name - **params**: A list of parameter dictionaries - **options**: A list of option dictionaries - **exceptions**: A list of exception dictionaries ...
[ "Convert", "this", "FunctionDoc", "to", "a", "dictionary", ".", "In", "addition", "to", "CommentDoc", "keys", "this", "adds", ":" ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1141-L1166
mdiener/grace
grace/py27/pyjsdoc.py
FunctionDoc.to_html
def to_html(self, codebase): """ Convert this `FunctionDoc` to HTML. """ body = '' for section in ('params', 'options', 'exceptions'): val = getattr(self, section) if val: body += '<h5>%s</h5>\n<dl class = "%s">%s</dl>' % ( ...
python
def to_html(self, codebase): """ Convert this `FunctionDoc` to HTML. """ body = '' for section in ('params', 'options', 'exceptions'): val = getattr(self, section) if val: body += '<h5>%s</h5>\n<dl class = "%s">%s</dl>' % ( ...
[ "def", "to_html", "(", "self", ",", "codebase", ")", ":", "body", "=", "''", "for", "section", "in", "(", "'params'", ",", "'options'", ",", "'exceptions'", ")", ":", "val", "=", "getattr", "(", "self", ",", "section", ")", "if", "val", ":", "body", ...
Convert this `FunctionDoc` to HTML.
[ "Convert", "this", "FunctionDoc", "to", "HTML", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1168-L1183
mdiener/grace
grace/py27/pyjsdoc.py
ClassDoc.get_method
def get_method(self, method_name, default=None): """ Returns the contained method of the specified name, or `default` if not found. """ for method in self.methods: if method.name == method_name: return method return default
python
def get_method(self, method_name, default=None): """ Returns the contained method of the specified name, or `default` if not found. """ for method in self.methods: if method.name == method_name: return method return default
[ "def", "get_method", "(", "self", ",", "method_name", ",", "default", "=", "None", ")", ":", "for", "method", "in", "self", ".", "methods", ":", "if", "method", ".", "name", "==", "method_name", ":", "return", "method", "return", "default" ]
Returns the contained method of the specified name, or `default` if not found.
[ "Returns", "the", "contained", "method", "of", "the", "specified", "name", "or", "default", "if", "not", "found", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1233-L1241
mdiener/grace
grace/py27/pyjsdoc.py
ClassDoc.to_dict
def to_dict(self): """ Convert this ClassDoc to a dict, such as if you want to use it in a template or string interpolation. Aside from the basic `CommentDoc` fields, this also contains: - **name**: The class name - **method**: A list of methods, in their dictio...
python
def to_dict(self): """ Convert this ClassDoc to a dict, such as if you want to use it in a template or string interpolation. Aside from the basic `CommentDoc` fields, this also contains: - **name**: The class name - **method**: A list of methods, in their dictio...
[ "def", "to_dict", "(", "self", ")", ":", "vars", "=", "super", "(", "ClassDoc", ",", "self", ")", ".", "to_dict", "(", ")", "vars", ".", "update", "(", "{", "'name'", ":", "self", ".", "name", ",", "'method'", ":", "[", "method", ".", "to_dict", ...
Convert this ClassDoc to a dict, such as if you want to use it in a template or string interpolation. Aside from the basic `CommentDoc` fields, this also contains: - **name**: The class name - **method**: A list of methods, in their dictionary form.
[ "Convert", "this", "ClassDoc", "to", "a", "dict", "such", "as", "if", "you", "want", "to", "use", "it", "in", "a", "template", "or", "string", "interpolation", ".", "Aside", "from", "the", "basic", "CommentDoc", "fields", "this", "also", "contains", ":" ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1243-L1257
mdiener/grace
grace/py27/pyjsdoc.py
ClassDoc.to_html
def to_html(self, codebase): """ Convert this ClassDoc to HTML. This returns the default long-form HTML description that's used when the full docs are built. """ return ('<a name = "%s" />\n<div class = "jsclass">\n' + '<h3>%s</h3>\n%s\n<h4>Methods</h4>\n%s</div...
python
def to_html(self, codebase): """ Convert this ClassDoc to HTML. This returns the default long-form HTML description that's used when the full docs are built. """ return ('<a name = "%s" />\n<div class = "jsclass">\n' + '<h3>%s</h3>\n%s\n<h4>Methods</h4>\n%s</div...
[ "def", "to_html", "(", "self", ",", "codebase", ")", ":", "return", "(", "'<a name = \"%s\" />\\n<div class = \"jsclass\">\\n'", "+", "'<h3>%s</h3>\\n%s\\n<h4>Methods</h4>\\n%s</div>'", ")", "%", "(", "self", ".", "name", ",", "self", ".", "name", ",", "htmlize_paragr...
Convert this ClassDoc to HTML. This returns the default long-form HTML description that's used when the full docs are built.
[ "Convert", "this", "ClassDoc", "to", "HTML", ".", "This", "returns", "the", "default", "long", "-", "form", "HTML", "description", "that", "s", "used", "when", "the", "full", "docs", "are", "built", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1259-L1270
mdiener/grace
grace/py27/pyjsdoc.py
ParamDoc.to_html
def to_html(self, css_class=''): """ Returns the parameter as a dt/dd pair. """ if self.name and self.type: header_text = '%s (%s)' % (self.name, self.type) elif self.type: header_text = self.type else: header_text = self.name r...
python
def to_html(self, css_class=''): """ Returns the parameter as a dt/dd pair. """ if self.name and self.type: header_text = '%s (%s)' % (self.name, self.type) elif self.type: header_text = self.type else: header_text = self.name r...
[ "def", "to_html", "(", "self", ",", "css_class", "=", "''", ")", ":", "if", "self", ".", "name", "and", "self", ".", "type", ":", "header_text", "=", "'%s (%s)'", "%", "(", "self", ".", "name", ",", "self", ".", "type", ")", "elif", "self", ".", ...
Returns the parameter as a dt/dd pair.
[ "Returns", "the", "parameter", "as", "a", "dt", "/", "dd", "pair", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/pyjsdoc.py#L1324-L1334
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentOfferedRecord.has_max_attempts
def has_max_attempts(self): """stub""" if 'maxAttempts' not in self.my_osid_object._my_map or \ self.my_osid_object._my_map['maxAttempts'] is None: return False return True
python
def has_max_attempts(self): """stub""" if 'maxAttempts' not in self.my_osid_object._my_map or \ self.my_osid_object._my_map['maxAttempts'] is None: return False return True
[ "def", "has_max_attempts", "(", "self", ")", ":", "if", "'maxAttempts'", "not", "in", "self", ".", "my_osid_object", ".", "_my_map", "or", "self", ".", "my_osid_object", ".", "_my_map", "[", "'maxAttempts'", "]", "is", "None", ":", "return", "False", "return...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L57-L62
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentOfferedFormRecord._init_map
def _init_map(self): """stub""" self.my_osid_object_form._my_map['reviewOptions'] = \ dict(self._review_options_metadata['default_object_values'][0]) self.my_osid_object_form._my_map['reviewOptions']['whetherCorrect'] = \ dict(self._whether_correct_metadata['default_objec...
python
def _init_map(self): """stub""" self.my_osid_object_form._my_map['reviewOptions'] = \ dict(self._review_options_metadata['default_object_values'][0]) self.my_osid_object_form._my_map['reviewOptions']['whetherCorrect'] = \ dict(self._whether_correct_metadata['default_objec...
[ "def", "_init_map", "(", "self", ")", ":", "self", ".", "my_osid_object_form", ".", "_my_map", "[", "'reviewOptions'", "]", "=", "dict", "(", "self", ".", "_review_options_metadata", "[", "'default_object_values'", "]", "[", "0", "]", ")", "self", ".", "my_o...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L116-L142
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentOfferedFormRecord._init_metadata
def _init_metadata(self): """stub""" self._review_options_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, 'review_options'), 'element_label': 'Review Options', ...
python
def _init_metadata(self): """stub""" self._review_options_metadata = { 'element_id': Id(self.my_osid_object_form._authority, self.my_osid_object_form._namespace, 'review_options'), 'element_label': 'Review Options', ...
[ "def", "_init_metadata", "(", "self", ")", ":", "self", ".", "_review_options_metadata", "=", "{", "'element_id'", ":", "Id", "(", "self", ".", "my_osid_object_form", ".", "_authority", ",", "self", ".", "my_osid_object_form", ".", "_namespace", ",", "'review_op...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L144-L257
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentOfferedFormRecord.set_review_whether_correct
def set_review_whether_correct(self, during_attempt=None, after_attempt=None, before_deadline=None, after_deadline=None): """stub""" whether_correct = self.my_osid_...
python
def set_review_whether_correct(self, during_attempt=None, after_attempt=None, before_deadline=None, after_deadline=None): """stub""" whether_correct = self.my_osid_...
[ "def", "set_review_whether_correct", "(", "self", ",", "during_attempt", "=", "None", ",", "after_attempt", "=", "None", ",", "before_deadline", "=", "None", ",", "after_deadline", "=", "None", ")", ":", "whether_correct", "=", "self", ".", "my_osid_object_form", ...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L283-L297
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentOfferedFormRecord.set_review_solution
def set_review_solution(self, during_attempt=None, after_attempt=None, before_deadline=None, after_deadline=None): """stub""" solution = self.my_osid_object_form._my_map['reviewOptions']['solu...
python
def set_review_solution(self, during_attempt=None, after_attempt=None, before_deadline=None, after_deadline=None): """stub""" solution = self.my_osid_object_form._my_map['reviewOptions']['solu...
[ "def", "set_review_solution", "(", "self", ",", "during_attempt", "=", "None", ",", "after_attempt", "=", "None", ",", "before_deadline", "=", "None", ",", "after_deadline", "=", "None", ")", ":", "solution", "=", "self", ".", "my_osid_object_form", ".", "_my_...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L299-L313
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentOfferedFormRecord.set_max_attempts
def set_max_attempts(self, value): """stub""" if value is None: raise InvalidArgument('value must be an integer') if value is not None and not isinstance(value, int): raise InvalidArgument('value is not an integer') if not self.my_osid_object_form._is_valid_intege...
python
def set_max_attempts(self, value): """stub""" if value is None: raise InvalidArgument('value must be an integer') if value is not None and not isinstance(value, int): raise InvalidArgument('value is not an integer') if not self.my_osid_object_form._is_valid_intege...
[ "def", "set_max_attempts", "(", "self", ",", "value", ")", ":", "if", "value", "is", "None", ":", "raise", "InvalidArgument", "(", "'value must be an integer'", ")", "if", "value", "is", "not", "None", "and", "not", "isinstance", "(", "value", ",", "int", ...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L319-L328
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentOfferedFormRecord.clear_max_attempts
def clear_max_attempts(self): """stub""" if (self.get_max_attempts_metadata().is_read_only() or self.get_max_attempts_metadata().is_required()): raise NoAccess() self.my_osid_object_form._my_map['maxAttempts'] = \ list(self._max_attempts_metadata['default_...
python
def clear_max_attempts(self): """stub""" if (self.get_max_attempts_metadata().is_read_only() or self.get_max_attempts_metadata().is_required()): raise NoAccess() self.my_osid_object_form._my_map['maxAttempts'] = \ list(self._max_attempts_metadata['default_...
[ "def", "clear_max_attempts", "(", "self", ")", ":", "if", "(", "self", ".", "get_max_attempts_metadata", "(", ")", ".", "is_read_only", "(", ")", "or", "self", ".", "get_max_attempts_metadata", "(", ")", ".", "is_required", "(", ")", ")", ":", "raise", "No...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L330-L336
mitsei/dlkit
dlkit/records/assessment/basic/assessment_records.py
ReviewOptionsAssessmentTakenRecord.can_review_whether_correct
def can_review_whether_correct(self): """stub""" ao = self.my_osid_object.get_assessment_offered() attempt_complete = self.my_osid_object.has_ended() if ao.can_review_whether_correct_during_attempt() and not attempt_complete: return True if ao.can_review_whether_corre...
python
def can_review_whether_correct(self): """stub""" ao = self.my_osid_object.get_assessment_offered() attempt_complete = self.my_osid_object.has_ended() if ao.can_review_whether_correct_during_attempt() and not attempt_complete: return True if ao.can_review_whether_corre...
[ "def", "can_review_whether_correct", "(", "self", ")", ":", "ao", "=", "self", ".", "my_osid_object", ".", "get_assessment_offered", "(", ")", "attempt_complete", "=", "self", ".", "my_osid_object", ".", "has_ended", "(", ")", "if", "ao", ".", "can_review_whethe...
stub
[ "stub" ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/assessment_records.py#L369-L377
mdiener/grace
grace/py27/slimit/visitors/scopevisitor.py
mangle_scope_tree
def mangle_scope_tree(root, toplevel): """Walk over a scope tree and mangle symbol names. Args: toplevel: Defines if global scope should be mangled or not. """ def mangle(scope): # don't mangle global scope if not specified otherwise if scope.get_enclosing_scope() is None and no...
python
def mangle_scope_tree(root, toplevel): """Walk over a scope tree and mangle symbol names. Args: toplevel: Defines if global scope should be mangled or not. """ def mangle(scope): # don't mangle global scope if not specified otherwise if scope.get_enclosing_scope() is None and no...
[ "def", "mangle_scope_tree", "(", "root", ",", "toplevel", ")", ":", "def", "mangle", "(", "scope", ")", ":", "# don't mangle global scope if not specified otherwise", "if", "scope", ".", "get_enclosing_scope", "(", ")", "is", "None", "and", "not", "toplevel", ":",...
Walk over a scope tree and mangle symbol names. Args: toplevel: Defines if global scope should be mangled or not.
[ "Walk", "over", "a", "scope", "tree", "and", "mangle", "symbol", "names", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/visitors/scopevisitor.py#L141-L161
mdiener/grace
grace/py27/slimit/visitors/scopevisitor.py
RefVisitor._fill_scope_refs
def _fill_scope_refs(name, scope): """Put referenced name in 'ref' dictionary of a scope. Walks up the scope tree and adds the name to 'ref' of every scope up in the tree until a scope that defines referenced name is reached. """ symbol = scope.resolve(name) if symbol is...
python
def _fill_scope_refs(name, scope): """Put referenced name in 'ref' dictionary of a scope. Walks up the scope tree and adds the name to 'ref' of every scope up in the tree until a scope that defines referenced name is reached. """ symbol = scope.resolve(name) if symbol is...
[ "def", "_fill_scope_refs", "(", "name", ",", "scope", ")", ":", "symbol", "=", "scope", ".", "resolve", "(", "name", ")", "if", "symbol", "is", "None", ":", "return", "orig_scope", "=", "symbol", ".", "scope", "scope", ".", "refs", "[", "name", "]", ...
Put referenced name in 'ref' dictionary of a scope. Walks up the scope tree and adds the name to 'ref' of every scope up in the tree until a scope that defines referenced name is reached.
[ "Put", "referenced", "name", "in", "ref", "dictionary", "of", "a", "scope", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/visitors/scopevisitor.py#L124-L138
mdiener/grace
grace/py27/slimit/visitors/scopevisitor.py
NameManglerVisitor.visit_Identifier
def visit_Identifier(self, node): """Mangle names.""" if not self._is_mangle_candidate(node): return name = node.value symbol = node.scope.resolve(node.value) if symbol is None: return mangled = symbol.scope.mangled.get(name) if mangled is ...
python
def visit_Identifier(self, node): """Mangle names.""" if not self._is_mangle_candidate(node): return name = node.value symbol = node.scope.resolve(node.value) if symbol is None: return mangled = symbol.scope.mangled.get(name) if mangled is ...
[ "def", "visit_Identifier", "(", "self", ",", "node", ")", ":", "if", "not", "self", ".", "_is_mangle_candidate", "(", "node", ")", ":", "return", "name", "=", "node", ".", "value", "symbol", "=", "node", ".", "scope", ".", "resolve", "(", "node", ".", ...
Mangle names.
[ "Mangle", "names", "." ]
train
https://github.com/mdiener/grace/blob/2dab13a2cf636da5da989904c5885166fc94d36d/grace/py27/slimit/visitors/scopevisitor.py#L190-L200
delfick/harpoon
docs/sphinx/ext/show_tasks.py
ShowTasksDirective.run
def run(self): """For each file in noseOfYeti/specs, output nodes to represent each spec file""" tokens = [] section = nodes.section() section['ids'].append("available-tasks") title = nodes.title() title += nodes.Text("Default tasks") section += title ta...
python
def run(self): """For each file in noseOfYeti/specs, output nodes to represent each spec file""" tokens = [] section = nodes.section() section['ids'].append("available-tasks") title = nodes.title() title += nodes.Text("Default tasks") section += title ta...
[ "def", "run", "(", "self", ")", ":", "tokens", "=", "[", "]", "section", "=", "nodes", ".", "section", "(", ")", "section", "[", "'ids'", "]", ".", "append", "(", "\"available-tasks\"", ")", "title", "=", "nodes", ".", "title", "(", ")", "title", "...
For each file in noseOfYeti/specs, output nodes to represent each spec file
[ "For", "each", "file", "in", "noseOfYeti", "/", "specs", "output", "nodes", "to", "represent", "each", "spec", "file" ]
train
https://github.com/delfick/harpoon/blob/a2d39311d6127b7da2e15f40468bf320d598e461/docs/sphinx/ext/show_tasks.py#L13-L32
python-odin/odinweb
odinweb/swagger.py
resource_definition
def resource_definition(resource): """ Generate a `Swagger Definitions Object <http://swagger.io/specification/#definitionsObject>`_ from a resource. """ meta = getmeta(resource) definition = { 'type': "object", 'properties': {} } for field in meta.all_fields: ...
python
def resource_definition(resource): """ Generate a `Swagger Definitions Object <http://swagger.io/specification/#definitionsObject>`_ from a resource. """ meta = getmeta(resource) definition = { 'type': "object", 'properties': {} } for field in meta.all_fields: ...
[ "def", "resource_definition", "(", "resource", ")", ":", "meta", "=", "getmeta", "(", "resource", ")", "definition", "=", "{", "'type'", ":", "\"object\"", ",", "'properties'", ":", "{", "}", "}", "for", "field", "in", "meta", ".", "all_fields", ":", "fi...
Generate a `Swagger Definitions Object <http://swagger.io/specification/#definitionsObject>`_ from a resource.
[ "Generate", "a", "Swagger", "Definitions", "Object", "<http", ":", "//", "swagger", ".", "io", "/", "specification", "/", "#definitionsObject", ">", "_", "from", "a", "resource", "." ]
train
https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/swagger.py#L71-L105
python-odin/odinweb
odinweb/swagger.py
SwaggerSpec.cenancestor
def cenancestor(self): """ Last universal ancestor (or the top level of the API structure). """ ancestor = parent = self.parent while parent: ancestor = parent parent = getattr(parent, 'parent', None) return ancestor
python
def cenancestor(self): """ Last universal ancestor (or the top level of the API structure). """ ancestor = parent = self.parent while parent: ancestor = parent parent = getattr(parent, 'parent', None) return ancestor
[ "def", "cenancestor", "(", "self", ")", ":", "ancestor", "=", "parent", "=", "self", ".", "parent", "while", "parent", ":", "ancestor", "=", "parent", "parent", "=", "getattr", "(", "parent", ",", "'parent'", ",", "None", ")", "return", "ancestor" ]
Last universal ancestor (or the top level of the API structure).
[ "Last", "universal", "ancestor", "(", "or", "the", "top", "level", "of", "the", "API", "structure", ")", "." ]
train
https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/swagger.py#L137-L145
python-odin/odinweb
odinweb/swagger.py
SwaggerSpec.base_path
def base_path(self): """ Calculate the APIs base path """ path = UrlPath() # Walk up the API to find the base object parent = self.parent while parent: path_prefix = getattr(parent, 'path_prefix', NoPath) path = path_prefix + path ...
python
def base_path(self): """ Calculate the APIs base path """ path = UrlPath() # Walk up the API to find the base object parent = self.parent while parent: path_prefix = getattr(parent, 'path_prefix', NoPath) path = path_prefix + path ...
[ "def", "base_path", "(", "self", ")", ":", "path", "=", "UrlPath", "(", ")", "# Walk up the API to find the base object", "parent", "=", "self", ".", "parent", "while", "parent", ":", "path_prefix", "=", "getattr", "(", "parent", ",", "'path_prefix'", ",", "No...
Calculate the APIs base path
[ "Calculate", "the", "APIs", "base", "path" ]
train
https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/swagger.py#L148-L161
python-odin/odinweb
odinweb/swagger.py
SwaggerSpec.parse_operations
def parse_operations(self): """ Flatten routes into a path -> method -> route structure """ resource_defs = { getmeta(resources.Error).resource_name: resource_definition(resources.Error), getmeta(resources.Listing).resource_name: resource_definition(resources.List...
python
def parse_operations(self): """ Flatten routes into a path -> method -> route structure """ resource_defs = { getmeta(resources.Error).resource_name: resource_definition(resources.Error), getmeta(resources.Listing).resource_name: resource_definition(resources.List...
[ "def", "parse_operations", "(", "self", ")", ":", "resource_defs", "=", "{", "getmeta", "(", "resources", ".", "Error", ")", ".", "resource_name", ":", "resource_definition", "(", "resources", ".", "Error", ")", ",", "getmeta", "(", "resources", ".", "Listin...
Flatten routes into a path -> method -> route structure
[ "Flatten", "routes", "into", "a", "path", "-", ">", "method", "-", ">", "route", "structure" ]
train
https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/swagger.py#L186-L231
python-odin/odinweb
odinweb/swagger.py
SwaggerSpec.get_swagger
def get_swagger(self, request): """ Generate this document. """ api_base = self.parent paths, definitions = self.parse_operations() codecs = getattr(self.cenancestor, 'registered_codecs', CODECS) # type: dict return dict_filter({ 'swagger': '2.0', ...
python
def get_swagger(self, request): """ Generate this document. """ api_base = self.parent paths, definitions = self.parse_operations() codecs = getattr(self.cenancestor, 'registered_codecs', CODECS) # type: dict return dict_filter({ 'swagger': '2.0', ...
[ "def", "get_swagger", "(", "self", ",", "request", ")", ":", "api_base", "=", "self", ".", "parent", "paths", ",", "definitions", "=", "self", ".", "parse_operations", "(", ")", "codecs", "=", "getattr", "(", "self", ".", "cenancestor", ",", "'registered_c...
Generate this document.
[ "Generate", "this", "document", "." ]
train
https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/swagger.py#L234-L255
python-odin/odinweb
odinweb/swagger.py
SwaggerSpec.get_ui
def get_ui(self, _): """ Load the Swagger UI interface """ if not self._ui_cache: content = self.load_static('ui.html') if isinstance(content, binary_type): content = content.decode('UTF-8') self._ui_cache = content.replace(u"{{SWAGGER_...
python
def get_ui(self, _): """ Load the Swagger UI interface """ if not self._ui_cache: content = self.load_static('ui.html') if isinstance(content, binary_type): content = content.decode('UTF-8') self._ui_cache = content.replace(u"{{SWAGGER_...
[ "def", "get_ui", "(", "self", ",", "_", ")", ":", "if", "not", "self", ".", "_ui_cache", ":", "content", "=", "self", ".", "load_static", "(", "'ui.html'", ")", "if", "isinstance", "(", "content", ",", "binary_type", ")", ":", "content", "=", "content"...
Load the Swagger UI interface
[ "Load", "the", "Swagger", "UI", "interface" ]
train
https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/swagger.py#L271-L282
python-odin/odinweb
odinweb/swagger.py
SwaggerSpec.get_static
def get_static(self, _, file_name=None): """ Get static content for UI. """ content_type = { 'ss': 'text/css', 'js': 'application/javascript', }.get(file_name[-2:]) if not content_type: raise HttpError(HTTPStatus.NOT_FOUND, 42) ...
python
def get_static(self, _, file_name=None): """ Get static content for UI. """ content_type = { 'ss': 'text/css', 'js': 'application/javascript', }.get(file_name[-2:]) if not content_type: raise HttpError(HTTPStatus.NOT_FOUND, 42) ...
[ "def", "get_static", "(", "self", ",", "_", ",", "file_name", "=", "None", ")", ":", "content_type", "=", "{", "'ss'", ":", "'text/css'", ",", "'js'", ":", "'application/javascript'", ",", "}", ".", "get", "(", "file_name", "[", "-", "2", ":", "]", "...
Get static content for UI.
[ "Get", "static", "content", "for", "UI", "." ]
train
https://github.com/python-odin/odinweb/blob/198424133584acc18cb41c8d18d91f803abc810f/odinweb/swagger.py#L285-L300
theosysbio/means
src/means/simulation/trajectory.py
perturbed_trajectory
def perturbed_trajectory(trajectory, sensitivity_trajectory, delta=1e-4): """ Slightly perturb trajectory wrt the parameter specified in sensitivity_trajectory. :param trajectory: the actual trajectory for an ODE term :type trajectory: :class:`Trajectory` :param sensitivity_trajectory: sensitivity ...
python
def perturbed_trajectory(trajectory, sensitivity_trajectory, delta=1e-4): """ Slightly perturb trajectory wrt the parameter specified in sensitivity_trajectory. :param trajectory: the actual trajectory for an ODE term :type trajectory: :class:`Trajectory` :param sensitivity_trajectory: sensitivity ...
[ "def", "perturbed_trajectory", "(", "trajectory", ",", "sensitivity_trajectory", ",", "delta", "=", "1e-4", ")", ":", "sensitivity_trajectory_description", "=", "sensitivity_trajectory", ".", "description", "assert", "(", "isinstance", "(", "sensitivity_trajectory_descripti...
Slightly perturb trajectory wrt the parameter specified in sensitivity_trajectory. :param trajectory: the actual trajectory for an ODE term :type trajectory: :class:`Trajectory` :param sensitivity_trajectory: sensitivity trajectory (dy/dpi for all timepoints t) :type sensitivity_trajectory: :class:`Tra...
[ "Slightly", "perturb", "trajectory", "wrt", "the", "parameter", "specified", "in", "sensitivity_trajectory", "." ]
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/simulation/trajectory.py#L357-L377
theosysbio/means
src/means/simulation/trajectory.py
Trajectory.to_csv
def to_csv(self, file): """ Write this trajectory to a csv file with the headers 'time' and 'value'. :param file: a file object to write to :type file: :class:`file` :return: """ file.write("time,value\n") for t,v in self: file.write("%f,%f\n...
python
def to_csv(self, file): """ Write this trajectory to a csv file with the headers 'time' and 'value'. :param file: a file object to write to :type file: :class:`file` :return: """ file.write("time,value\n") for t,v in self: file.write("%f,%f\n...
[ "def", "to_csv", "(", "self", ",", "file", ")", ":", "file", ".", "write", "(", "\"time,value\\n\"", ")", "for", "t", ",", "v", "in", "self", ":", "file", ".", "write", "(", "\"%f,%f\\n\"", "%", "(", "t", ",", "v", ")", ")" ]
Write this trajectory to a csv file with the headers 'time' and 'value'. :param file: a file object to write to :type file: :class:`file` :return:
[ "Write", "this", "trajectory", "to", "a", "csv", "file", "with", "the", "headers", "time", "and", "value", "." ]
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/simulation/trajectory.py#L60-L71
theosysbio/means
src/means/simulation/trajectory.py
Trajectory.resample
def resample(self, new_timepoints, extrapolate=False): """ Use linear interpolation to resample trajectory values. The new values are interpolated for the provided time points. This is generally before comparing or averaging trajectories. :param new_timepoints: the new time poi...
python
def resample(self, new_timepoints, extrapolate=False): """ Use linear interpolation to resample trajectory values. The new values are interpolated for the provided time points. This is generally before comparing or averaging trajectories. :param new_timepoints: the new time poi...
[ "def", "resample", "(", "self", ",", "new_timepoints", ",", "extrapolate", "=", "False", ")", ":", "if", "not", "extrapolate", ":", "if", "min", "(", "self", ".", "timepoints", ")", ">", "min", "(", "new_timepoints", ")", ":", "raise", "Exception", "(", ...
Use linear interpolation to resample trajectory values. The new values are interpolated for the provided time points. This is generally before comparing or averaging trajectories. :param new_timepoints: the new time points :param extrapolate: whether extrapolation should be performed wh...
[ "Use", "linear", "interpolation", "to", "resample", "trajectory", "values", ".", "The", "new", "values", "are", "interpolated", "for", "the", "provided", "time", "points", ".", "This", "is", "generally", "before", "comparing", "or", "averaging", "trajectories", ...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/simulation/trajectory.py#L150-L169
theosysbio/means
src/means/simulation/trajectory.py
Trajectory._arithmetic_operation
def _arithmetic_operation(self, other, operation): """ Applies an operation between the values of a trajectories and a scalar or between the respective values of two trajectories. In the latter case, trajectories should have equal descriptions and time points """ if isins...
python
def _arithmetic_operation(self, other, operation): """ Applies an operation between the values of a trajectories and a scalar or between the respective values of two trajectories. In the latter case, trajectories should have equal descriptions and time points """ if isins...
[ "def", "_arithmetic_operation", "(", "self", ",", "other", ",", "operation", ")", ":", "if", "isinstance", "(", "other", ",", "Trajectory", ")", ":", "if", "self", ".", "description", "!=", "other", ".", "description", ":", "raise", "Exception", "(", "\"Ca...
Applies an operation between the values of a trajectories and a scalar or between the respective values of two trajectories. In the latter case, trajectories should have equal descriptions and time points
[ "Applies", "an", "operation", "between", "the", "values", "of", "a", "trajectories", "and", "a", "scalar", "or", "between", "the", "respective", "values", "of", "two", "trajectories", ".", "In", "the", "latter", "case", "trajectories", "should", "have", "equal...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/simulation/trajectory.py#L221-L238
theosysbio/means
src/means/simulation/trajectory.py
TrajectoryWithSensitivityData._arithmetic_operation
def _arithmetic_operation(self, other, operation): """ Applies an operation between the values of a trajectories and a scalar or between the respective values of two trajectories. In the latter case, trajectories should have equal descriptions and time points """ if isins...
python
def _arithmetic_operation(self, other, operation): """ Applies an operation between the values of a trajectories and a scalar or between the respective values of two trajectories. In the latter case, trajectories should have equal descriptions and time points """ if isins...
[ "def", "_arithmetic_operation", "(", "self", ",", "other", ",", "operation", ")", ":", "if", "isinstance", "(", "other", ",", "TrajectoryWithSensitivityData", ")", ":", "if", "self", ".", "description", "!=", "other", ".", "description", ":", "raise", "Excepti...
Applies an operation between the values of a trajectories and a scalar or between the respective values of two trajectories. In the latter case, trajectories should have equal descriptions and time points
[ "Applies", "an", "operation", "between", "the", "values", "of", "a", "trajectories", "and", "a", "scalar", "or", "between", "the", "respective", "values", "of", "two", "trajectories", ".", "In", "the", "latter", "case", "trajectories", "should", "have", "equal...
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/simulation/trajectory.py#L322-L345
theosysbio/means
src/means/simulation/trajectory.py
TrajectoryCollection.to_csv
def to_csv(self, file): """ Write all the trajectories of a collection to a csv file with the headers 'description', 'time' and 'value'. :param file: a file object to write to :type file: :class:`file` :return: """ file.write("description,time,value\n") f...
python
def to_csv(self, file): """ Write all the trajectories of a collection to a csv file with the headers 'description', 'time' and 'value'. :param file: a file object to write to :type file: :class:`file` :return: """ file.write("description,time,value\n") f...
[ "def", "to_csv", "(", "self", ",", "file", ")", ":", "file", ".", "write", "(", "\"description,time,value\\n\"", ")", "for", "traj", "in", "self", ":", "for", "t", ",", "v", "in", "traj", ":", "file", ".", "write", "(", "\"%s,%f,%f\\n\"", "%", "(", "...
Write all the trajectories of a collection to a csv file with the headers 'description', 'time' and 'value'. :param file: a file object to write to :type file: :class:`file` :return:
[ "Write", "all", "the", "trajectories", "of", "a", "collection", "to", "a", "csv", "file", "with", "the", "headers", "description", "time", "and", "value", "." ]
train
https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/simulation/trajectory.py#L396-L407
mulkieran/justbases
src/justbases/_display.py
Digits.xform
def xform(self, number, base): """ Get a number as a string. :param number: a number :type number: list of int :param int base: the base in which this number is being represented :raises BasesValueError: if config is unsuitable for number """ if self.CONF...
python
def xform(self, number, base): """ Get a number as a string. :param number: a number :type number: list of int :param int base: the base in which this number is being represented :raises BasesValueError: if config is unsuitable for number """ if self.CONF...
[ "def", "xform", "(", "self", ",", "number", ",", "base", ")", ":", "if", "self", ".", "CONFIG", ".", "use_letters", ":", "digits", "=", "self", ".", "_UPPER_DIGITS", "if", "self", ".", "CONFIG", ".", "use_caps", "else", "self", ".", "_LOWER_DIGITS", "r...
Get a number as a string. :param number: a number :type number: list of int :param int base: the base in which this number is being represented :raises BasesValueError: if config is unsuitable for number
[ "Get", "a", "number", "as", "a", "string", "." ]
train
https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_display.py#L57-L72
mulkieran/justbases
src/justbases/_display.py
Strip._strip_trailing_zeros
def _strip_trailing_zeros(value): """ Strip trailing zeros from a list of ints. :param value: the value to be stripped :type value: list of str :returns: list with trailing zeros stripped :rtype: list of int """ return list( reversed( ...
python
def _strip_trailing_zeros(value): """ Strip trailing zeros from a list of ints. :param value: the value to be stripped :type value: list of str :returns: list with trailing zeros stripped :rtype: list of int """ return list( reversed( ...
[ "def", "_strip_trailing_zeros", "(", "value", ")", ":", "return", "list", "(", "reversed", "(", "list", "(", "itertools", ".", "dropwhile", "(", "lambda", "x", ":", "x", "==", "0", ",", "reversed", "(", "value", ")", ")", ")", ")", ")" ]
Strip trailing zeros from a list of ints. :param value: the value to be stripped :type value: list of str :returns: list with trailing zeros stripped :rtype: list of int
[ "Strip", "trailing", "zeros", "from", "a", "list", "of", "ints", "." ]
train
https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_display.py#L83-L97
mulkieran/justbases
src/justbases/_display.py
Strip.xform
def xform(self, number, relation): """ Strip trailing zeros from a number according to config and relation. :param number: a number :type number: list of int :param int relation: the relation of the display value to the actual """ # pylint: disable=too-many-bool...
python
def xform(self, number, relation): """ Strip trailing zeros from a number according to config and relation. :param number: a number :type number: list of int :param int relation: the relation of the display value to the actual """ # pylint: disable=too-many-bool...
[ "def", "xform", "(", "self", ",", "number", ",", "relation", ")", ":", "# pylint: disable=too-many-boolean-expressions", "if", "(", "self", ".", "CONFIG", ".", "strip", ")", "or", "(", "self", ".", "CONFIG", ".", "strip_exact", "and", "relation", "==", "0", ...
Strip trailing zeros from a number according to config and relation. :param number: a number :type number: list of int :param int relation: the relation of the display value to the actual
[ "Strip", "trailing", "zeros", "from", "a", "number", "according", "to", "config", "and", "relation", "." ]
train
https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_display.py#L109-L124
mulkieran/justbases
src/justbases/_display.py
Number.xform
def xform(self, left, right, repeating, base, sign): """ Return prefixes for tuple. :param str left: left of the radix :param str right: right of the radix :param str repeating: repeating part :param int base: the base in which value is displayed :param int sign:...
python
def xform(self, left, right, repeating, base, sign): """ Return prefixes for tuple. :param str left: left of the radix :param str right: right of the radix :param str repeating: repeating part :param int base: the base in which value is displayed :param int sign:...
[ "def", "xform", "(", "self", ",", "left", ",", "right", ",", "repeating", ",", "base", ",", "sign", ")", ":", "# pylint: disable=too-many-arguments", "base_prefix", "=", "''", "if", "self", ".", "CONFIG", ".", "use_prefix", ":", "if", "base", "==", "8", ...
Return prefixes for tuple. :param str left: left of the radix :param str right: right of the radix :param str repeating: repeating part :param int base: the base in which value is displayed :param int sign: -1, 0, 1 as appropriate :returns: the number string :rty...
[ "Return", "prefixes", "for", "tuple", "." ]
train
https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_display.py#L156-L192
mulkieran/justbases
src/justbases/_display.py
Decorators.decorators
def decorators(self, relation): """ Return prefixes for tuple. :param int relation: relation of string value to actual value """ if self.CONFIG.show_approx_str: approx_str = Decorators.relation_to_symbol(relation) else: approx_str = '' re...
python
def decorators(self, relation): """ Return prefixes for tuple. :param int relation: relation of string value to actual value """ if self.CONFIG.show_approx_str: approx_str = Decorators.relation_to_symbol(relation) else: approx_str = '' re...
[ "def", "decorators", "(", "self", ",", "relation", ")", ":", "if", "self", ".", "CONFIG", ".", "show_approx_str", ":", "approx_str", "=", "Decorators", ".", "relation_to_symbol", "(", "relation", ")", "else", ":", "approx_str", "=", "''", "return", "_Decorat...
Return prefixes for tuple. :param int relation: relation of string value to actual value
[ "Return", "prefixes", "for", "tuple", "." ]
train
https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_display.py#L236-L247
mulkieran/justbases
src/justbases/_display.py
String.xform
def xform(self, radix, relation): """ Transform a radix and some information to a str according to configurations. :param Radix radix: the radix :param int relation: relation of display value to actual value :param units: element of UNITS() :returns: a string rep...
python
def xform(self, radix, relation): """ Transform a radix and some information to a str according to configurations. :param Radix radix: the radix :param int relation: relation of display value to actual value :param units: element of UNITS() :returns: a string rep...
[ "def", "xform", "(", "self", ",", "radix", ",", "relation", ")", ":", "right", "=", "radix", ".", "non_repeating_part", "left", "=", "radix", ".", "integer_part", "repeating", "=", "radix", ".", "repeating_part", "if", "repeating", "==", "[", "]", ":", "...
Transform a radix and some information to a str according to configurations. :param Radix radix: the radix :param int relation: relation of display value to actual value :param units: element of UNITS() :returns: a string representing the value :rtype: str :rais...
[ "Transform", "a", "radix", "and", "some", "information", "to", "a", "str", "according", "to", "configurations", "." ]
train
https://github.com/mulkieran/justbases/blob/dd52ff4b3d11609f54b2673599ee4eeb20f9734f/src/justbases/_display.py#L278-L318
mitsei/dlkit
dlkit/handcar/repository/objects.py
Asset.get_provider_link_ids
def get_provider_link_ids(self): """Gets the resource Ids representing the source of this asset in order from the most recent provider to the originating source. return: (osid.id.IdList) - the provider Ids compliance: mandatory - This method must be implemented. """ id_...
python
def get_provider_link_ids(self): """Gets the resource Ids representing the source of this asset in order from the most recent provider to the originating source. return: (osid.id.IdList) - the provider Ids compliance: mandatory - This method must be implemented. """ id_...
[ "def", "get_provider_link_ids", "(", "self", ")", ":", "id_list", "=", "[", "]", "for", "id_", "in", "self", ".", "_my_map", "[", "'providerLinkIds'", "]", ":", "id_list", ".", "append", "(", "Id", "(", "id_", ")", ")", "return", "IdList", "(", "id_lis...
Gets the resource Ids representing the source of this asset in order from the most recent provider to the originating source. return: (osid.id.IdList) - the provider Ids compliance: mandatory - This method must be implemented.
[ "Gets", "the", "resource", "Ids", "representing", "the", "source", "of", "this", "asset", "in", "order", "from", "the", "most", "recent", "provider", "to", "the", "originating", "source", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L285-L296
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_title
def set_title(self, title=None): """Sets the title. :param title: the new title :type title: ``string`` :raise: ``InvalidArgument`` -- ``title`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``title`` is ``null`` ...
python
def set_title(self, title=None): """Sets the title. :param title: the new title :type title: ``string`` :raise: ``InvalidArgument`` -- ``title`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``title`` is ``null`` ...
[ "def", "set_title", "(", "self", ",", "title", "=", "None", ")", ":", "if", "title", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'title'", "]", ")", "if", "metad...
Sets the title. :param title: the new title :type title: ``string`` :raise: ``InvalidArgument`` -- ``title`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``title`` is ``null`` *compliance: mandatory -- This method ...
[ "Sets", "the", "title", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L528-L548
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.clear_title
def clear_title(self): """Removes the title. :raise: ``NoAccess`` -- ``Metadata.isRequired()`` is ``true`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ metadata = Metadata(**settings.METADATA['title']) ...
python
def clear_title(self): """Removes the title. :raise: ``NoAccess`` -- ``Metadata.isRequired()`` is ``true`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ metadata = Metadata(**settings.METADATA['title']) ...
[ "def", "clear_title", "(", "self", ")", ":", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'title'", "]", ")", "if", "metadata", ".", "is_read_only", "(", ")", "or", "metadata", ".", "is_required", "(", ")", ":", "raise...
Removes the title. :raise: ``NoAccess`` -- ``Metadata.isRequired()`` is ``true`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.*
[ "Removes", "the", "title", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L550-L562
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_public_domain
def set_public_domain(self, public_domain=None): """Sets the public domain flag. :param public_domain: the public domain status :type public_domain: ``boolean`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implement...
python
def set_public_domain(self, public_domain=None): """Sets the public domain flag. :param public_domain: the public domain status :type public_domain: ``boolean`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implement...
[ "def", "set_public_domain", "(", "self", ",", "public_domain", "=", "None", ")", ":", "if", "public_domain", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'public_domain'"...
Sets the public domain flag. :param public_domain: the public domain status :type public_domain: ``boolean`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.*
[ "Sets", "the", "public", "domain", "flag", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L580-L598
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_copyright
def set_copyright(self, copyright=None): """Sets the copyright. :param copyright: the new copyright :type copyright: ``string`` :raise: ``InvalidArgument`` -- ``copyright`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` ...
python
def set_copyright(self, copyright=None): """Sets the copyright. :param copyright: the new copyright :type copyright: ``string`` :raise: ``InvalidArgument`` -- ``copyright`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` ...
[ "def", "set_copyright", "(", "self", ",", "copyright", "=", "None", ")", ":", "if", "copyright", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'copyright'", "]", ")", ...
Sets the copyright. :param copyright: the new copyright :type copyright: ``string`` :raise: ``InvalidArgument`` -- ``copyright`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``copyright`` is ``null`` *compliance: m...
[ "Sets", "the", "copyright", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L630-L650
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_copyright_registration
def set_copyright_registration(self, registration): """Sets the copyright registration. arg: registration (string): the new copyright registration raise: InvalidArgument - ``copyright`` is invalid raise: NoAccess - ``Metadata.isReadOnly()`` is ``true`` raise: NullArgument ...
python
def set_copyright_registration(self, registration): """Sets the copyright registration. arg: registration (string): the new copyright registration raise: InvalidArgument - ``copyright`` is invalid raise: NoAccess - ``Metadata.isReadOnly()`` is ``true`` raise: NullArgument ...
[ "def", "set_copyright_registration", "(", "self", ",", "registration", ")", ":", "# Implemented from template for osid.repository.AssetContentForm.set_url_template", "if", "self", ".", "get_copyright_registration_metadata", "(", ")", ".", "is_read_only", "(", ")", ":", "raise...
Sets the copyright registration. arg: registration (string): the new copyright registration raise: InvalidArgument - ``copyright`` is invalid raise: NoAccess - ``Metadata.isReadOnly()`` is ``true`` raise: NullArgument - ``copyright`` is ``null`` *compliance: mandatory -- T...
[ "Sets", "the", "copyright", "registration", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L683-L700
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_distribute_verbatim
def set_distribute_verbatim(self, distribute_verbatim=None): """Sets the distribution rights. :param distribute_verbatim: right to distribute verbatim copies :type distribute_verbatim: ``boolean`` :raise: ``InvalidArgument`` -- ``distribute_verbatim`` is invalid :raise: ``NoAcce...
python
def set_distribute_verbatim(self, distribute_verbatim=None): """Sets the distribution rights. :param distribute_verbatim: right to distribute verbatim copies :type distribute_verbatim: ``boolean`` :raise: ``InvalidArgument`` -- ``distribute_verbatim`` is invalid :raise: ``NoAcce...
[ "def", "set_distribute_verbatim", "(", "self", ",", "distribute_verbatim", "=", "None", ")", ":", "if", "distribute_verbatim", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", ...
Sets the distribution rights. :param distribute_verbatim: right to distribute verbatim copies :type distribute_verbatim: ``boolean`` :raise: ``InvalidArgument`` -- ``distribute_verbatim`` is invalid :raise: ``NoAccess`` -- authorization failure *compliance: mandatory -- This me...
[ "Sets", "the", "distribution", "rights", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L731-L750
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_distribute_alterations
def set_distribute_alterations(self, distribute_mods=None): """Sets the distribute alterations flag. This also sets distribute verbatim to ``true``. :param distribute_mods: right to distribute modifications :type distribute_mods: ``boolean`` :raise: ``InvalidArgument`` -- ``dis...
python
def set_distribute_alterations(self, distribute_mods=None): """Sets the distribute alterations flag. This also sets distribute verbatim to ``true``. :param distribute_mods: right to distribute modifications :type distribute_mods: ``boolean`` :raise: ``InvalidArgument`` -- ``dis...
[ "def", "set_distribute_alterations", "(", "self", ",", "distribute_mods", "=", "None", ")", ":", "if", "distribute_mods", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'di...
Sets the distribute alterations flag. This also sets distribute verbatim to ``true``. :param distribute_mods: right to distribute modifications :type distribute_mods: ``boolean`` :raise: ``InvalidArgument`` -- ``distribute_mods`` is invalid :raise: ``NoAccess`` -- authorization...
[ "Sets", "the", "distribute", "alterations", "flag", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L783-L804
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_distribute_compositions
def set_distribute_compositions(self, distribute_comps=None): """Sets the distribution rights. This sets distribute verbatim to ``true``. :param distribute_comps: right to distribute modifications :type distribute_comps: ``boolean`` :raise: ``InvalidArgument`` -- ``distribute_c...
python
def set_distribute_compositions(self, distribute_comps=None): """Sets the distribution rights. This sets distribute verbatim to ``true``. :param distribute_comps: right to distribute modifications :type distribute_comps: ``boolean`` :raise: ``InvalidArgument`` -- ``distribute_c...
[ "def", "set_distribute_compositions", "(", "self", ",", "distribute_comps", "=", "None", ")", ":", "if", "distribute_comps", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "...
Sets the distribution rights. This sets distribute verbatim to ``true``. :param distribute_comps: right to distribute modifications :type distribute_comps: ``boolean`` :raise: ``InvalidArgument`` -- ``distribute_comps`` is invalid :raise: ``NoAccess`` -- authorization failure ...
[ "Sets", "the", "distribution", "rights", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L837-L858
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_source
def set_source(self, source_id=None): """Sets the source. :param source_id: the new publisher :type source_id: ``osid.id.Id`` :raise: ``InvalidArgument`` -- ``source_id`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` --...
python
def set_source(self, source_id=None): """Sets the source. :param source_id: the new publisher :type source_id: ``osid.id.Id`` :raise: ``InvalidArgument`` -- ``source_id`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` --...
[ "def", "set_source", "(", "self", ",", "source_id", "=", "None", ")", ":", "if", "source_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'source_id'", "]", ")", "...
Sets the source. :param source_id: the new publisher :type source_id: ``osid.id.Id`` :raise: ``InvalidArgument`` -- ``source_id`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``source_id`` is ``null`` *compliance: ...
[ "Sets", "the", "source", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L891-L911
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_provider_links
def set_provider_links(self, resource_ids=None): """Sets a provider chain in order from the most recent source to the originating source. :param resource_ids: the new source :type resource_ids: ``osid.id.Id[]`` :raise: ``InvalidArgument`` -- ``resource_ids`` is invalid :...
python
def set_provider_links(self, resource_ids=None): """Sets a provider chain in order from the most recent source to the originating source. :param resource_ids: the new source :type resource_ids: ``osid.id.Id[]`` :raise: ``InvalidArgument`` -- ``resource_ids`` is invalid :...
[ "def", "set_provider_links", "(", "self", ",", "resource_ids", "=", "None", ")", ":", "if", "resource_ids", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'provider_link_id...
Sets a provider chain in order from the most recent source to the originating source. :param resource_ids: the new source :type resource_ids: ``osid.id.Id[]`` :raise: ``InvalidArgument`` -- ``resource_ids`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true``...
[ "Sets", "a", "provider", "chain", "in", "order", "from", "the", "most", "recent", "source", "to", "the", "originating", "source", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L943-L966
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_created_date
def set_created_date(self, created_date=None): """Sets the created date. :param created_date: the new created date :type created_date: ``osid.calendaring.DateTime`` :raise: ``InvalidArgument`` -- ``created_date`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``...
python
def set_created_date(self, created_date=None): """Sets the created date. :param created_date: the new created date :type created_date: ``osid.calendaring.DateTime`` :raise: ``InvalidArgument`` -- ``created_date`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``...
[ "def", "set_created_date", "(", "self", ",", "created_date", "=", "None", ")", ":", "if", "created_date", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'created_date'", ...
Sets the created date. :param created_date: the new created date :type created_date: ``osid.calendaring.DateTime`` :raise: ``InvalidArgument`` -- ``created_date`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``created_date`...
[ "Sets", "the", "created", "date", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L998-L1018
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_published
def set_published(self, published=None): """Sets the published status. :param published: the published status :type published: ``boolean`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ ...
python
def set_published(self, published=None): """Sets the published status. :param published: the published status :type published: ``boolean`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ ...
[ "def", "set_published", "(", "self", ",", "published", "=", "None", ")", ":", "if", "published", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'published'", "]", ")", ...
Sets the published status. :param published: the published status :type published: ``boolean`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.*
[ "Sets", "the", "published", "status", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1049-L1067
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.clear_published
def clear_published(self): """Removes the published status. :raise: ``NoAccess`` -- ``Metadata.isRequired()`` is ``true`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ metadata = Metadata(**settings.METADATA['published...
python
def clear_published(self): """Removes the published status. :raise: ``NoAccess`` -- ``Metadata.isRequired()`` is ``true`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.* """ metadata = Metadata(**settings.METADATA['published...
[ "def", "clear_published", "(", "self", ")", ":", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'published'", "]", ")", "if", "metadata", ".", "is_read_only", "(", ")", "or", "metadata", ".", "is_required", "(", ")", ":", ...
Removes the published status. :raise: ``NoAccess`` -- ``Metadata.isRequired()`` is ``true`` or ``Metadata.isReadOnly()`` is ``true`` *compliance: mandatory -- This method must be implemented.*
[ "Removes", "the", "published", "status", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1069-L1080
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_published_date
def set_published_date(self, published_date=None): """Sets the published date. :param published_date: the new published date :type published_date: ``osid.calendaring.DateTime`` :raise: ``InvalidArgument`` -- ``published_date`` is invalid :raise: ``NoAccess`` -- ``Metadata.isRead...
python
def set_published_date(self, published_date=None): """Sets the published date. :param published_date: the new published date :type published_date: ``osid.calendaring.DateTime`` :raise: ``InvalidArgument`` -- ``published_date`` is invalid :raise: ``NoAccess`` -- ``Metadata.isRead...
[ "def", "set_published_date", "(", "self", ",", "published_date", "=", "None", ")", ":", "if", "published_date", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'published_da...
Sets the published date. :param published_date: the new published date :type published_date: ``osid.calendaring.DateTime`` :raise: ``InvalidArgument`` -- ``published_date`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``pub...
[ "Sets", "the", "published", "date", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1098-L1118
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_principal_credit_string
def set_principal_credit_string(self, credit_string=None): """Sets the principal credit string. :param credit_string: the new credit string :type credit_string: ``string`` :raise: ``InvalidArgument`` -- ``credit_string`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()...
python
def set_principal_credit_string(self, credit_string=None): """Sets the principal credit string. :param credit_string: the new credit string :type credit_string: ``string`` :raise: ``InvalidArgument`` -- ``credit_string`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()...
[ "def", "set_principal_credit_string", "(", "self", ",", "credit_string", "=", "None", ")", ":", "if", "credit_string", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'princ...
Sets the principal credit string. :param credit_string: the new credit string :type credit_string: ``string`` :raise: ``InvalidArgument`` -- ``credit_string`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``credit_string`` i...
[ "Sets", "the", "principal", "credit", "string", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1149-L1169
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetForm.set_composition
def set_composition(self, composition_id=None): """Sets the composition. :param composition_id: a composition :type composition_id: ``osid.id.Id`` :raise: ``InvalidArgument`` -- ``composition_id`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :...
python
def set_composition(self, composition_id=None): """Sets the composition. :param composition_id: a composition :type composition_id: ``osid.id.Id`` :raise: ``InvalidArgument`` -- ``composition_id`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :...
[ "def", "set_composition", "(", "self", ",", "composition_id", "=", "None", ")", ":", "if", "composition_id", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'composition_id'...
Sets the composition. :param composition_id: a composition :type composition_id: ``osid.id.Id`` :raise: ``InvalidArgument`` -- ``composition_id`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``composition_id`` is ``null`` ...
[ "Sets", "the", "composition", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1200-L1220
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetList.get_next_asset
def get_next_asset(self): """Gets the next Asset in this list. return: (osid.repository.Asset) - the next Asset in this list. The has_next() method should be used to test that a next Asset is available before calling this method. raise: IllegalState - no more el...
python
def get_next_asset(self): """Gets the next Asset in this list. return: (osid.repository.Asset) - the next Asset in this list. The has_next() method should be used to test that a next Asset is available before calling this method. raise: IllegalState - no more el...
[ "def", "get_next_asset", "(", "self", ")", ":", "try", ":", "next_object", "=", "next", "(", "self", ")", "except", "StopIteration", ":", "raise", "IllegalState", "(", "'no more elements available in this list'", ")", "except", "Exception", ":", "# Need to specify e...
Gets the next Asset in this list. return: (osid.repository.Asset) - the next Asset in this list. The has_next() method should be used to test that a next Asset is available before calling this method. raise: IllegalState - no more elements available in this list ...
[ "Gets", "the", "next", "Asset", "in", "this", "list", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1269-L1287
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetContentForm.add_accessibility_type
def add_accessibility_type(self, accessibility_type=None): """Adds an accessibility type. Multiple types can be added. :param accessibility_type: a new accessibility type :type accessibility_type: ``osid.type.Type`` :raise: ``InvalidArgument`` -- ``accessibility_type`` is inval...
python
def add_accessibility_type(self, accessibility_type=None): """Adds an accessibility type. Multiple types can be added. :param accessibility_type: a new accessibility type :type accessibility_type: ``osid.type.Type`` :raise: ``InvalidArgument`` -- ``accessibility_type`` is inval...
[ "def", "add_accessibility_type", "(", "self", ",", "accessibility_type", "=", "None", ")", ":", "if", "accessibility_type", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'...
Adds an accessibility type. Multiple types can be added. :param accessibility_type: a new accessibility type :type accessibility_type: ``osid.type.Type`` :raise: ``InvalidArgument`` -- ``accessibility_type`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true...
[ "Adds", "an", "accessibility", "type", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1528-L1552
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetContentForm.remove_accessibility_type
def remove_accessibility_type(self, accessibility_type=None): """Removes an accessibility type. :param accessibility_type: accessibility type to remove :type accessibility_type: ``osid.type.Type`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NotFound``...
python
def remove_accessibility_type(self, accessibility_type=None): """Removes an accessibility type. :param accessibility_type: accessibility type to remove :type accessibility_type: ``osid.type.Type`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NotFound``...
[ "def", "remove_accessibility_type", "(", "self", ",", "accessibility_type", "=", "None", ")", ":", "if", "accessibility_type", "is", "None", ":", "raise", "NullArgument", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'accessibili...
Removes an accessibility type. :param accessibility_type: accessibility type to remove :type accessibility_type: ``osid.type.Type`` :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NotFound`` -- acessibility type not found :raise: ``NullArgument`` -- ``acc...
[ "Removes", "an", "accessibility", "type", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1554-L1573
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetContentForm.set_url
def set_url(self, url=None): """Sets the url. :param url: the new copyright :type url: ``string`` :raise: ``InvalidArgument`` -- ``url`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``url`` is ``null`` *com...
python
def set_url(self, url=None): """Sets the url. :param url: the new copyright :type url: ``string`` :raise: ``InvalidArgument`` -- ``url`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``url`` is ``null`` *com...
[ "def", "set_url", "(", "self", ",", "url", "=", "None", ")", ":", "if", "url", "is", "None", ":", "raise", "NullArgument", "(", ")", "metadata", "=", "Metadata", "(", "*", "*", "settings", ".", "METADATA", "[", "'url'", "]", ")", "if", "metadata", ...
Sets the url. :param url: the new copyright :type url: ``string`` :raise: ``InvalidArgument`` -- ``url`` is invalid :raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true`` :raise: ``NullArgument`` -- ``url`` is ``null`` *compliance: mandatory -- This method must b...
[ "Sets", "the", "url", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1644-L1664
mitsei/dlkit
dlkit/handcar/repository/objects.py
AssetContentList.get_next_asset_content
def get_next_asset_content(self): """Gets the next AssetContent in this list. return: (osid.repository.AssetContent) - the next AssetContent in this list. The has_next() method should be used to test that a next AssetContent is available before calling th...
python
def get_next_asset_content(self): """Gets the next AssetContent in this list. return: (osid.repository.AssetContent) - the next AssetContent in this list. The has_next() method should be used to test that a next AssetContent is available before calling th...
[ "def", "get_next_asset_content", "(", "self", ")", ":", "try", ":", "next_object", "=", "next", "(", "self", ")", "except", "StopIteration", ":", "raise", "IllegalState", "(", "'no more elements available in this list'", ")", "except", "Exception", ":", "# Need to s...
Gets the next AssetContent in this list. return: (osid.repository.AssetContent) - the next AssetContent in this list. The has_next() method should be used to test that a next AssetContent is available before calling this method. raise: IllegalState - no ...
[ "Gets", "the", "next", "AssetContent", "in", "this", "list", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1713-L1732
mitsei/dlkit
dlkit/handcar/repository/objects.py
RepositoryList.get_next_repository
def get_next_repository(self): """Gets the next ``Repository`` in this list. :return: the next ``Repository`` in this list. The ``has_next()`` method should be used to test that a next ``Repository`` is available before calling this method. :rtype: ``osid.repository.Repository`` :raise:...
python
def get_next_repository(self): """Gets the next ``Repository`` in this list. :return: the next ``Repository`` in this list. The ``has_next()`` method should be used to test that a next ``Repository`` is available before calling this method. :rtype: ``osid.repository.Repository`` :raise:...
[ "def", "get_next_repository", "(", "self", ")", ":", "try", ":", "next_object", "=", "next", "(", "self", ")", "except", "StopIteration", ":", "raise", "IllegalState", "(", "'no more elements available in this list'", ")", "except", "Exception", ":", "# Need to spec...
Gets the next ``Repository`` in this list. :return: the next ``Repository`` in this list. The ``has_next()`` method should be used to test that a next ``Repository`` is available before calling this method. :rtype: ``osid.repository.Repository`` :raise: ``IllegalState`` -- no more elements avai...
[ "Gets", "the", "next", "Repository", "in", "this", "list", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/handcar/repository/objects.py#L1860-L1878
bodylabs/harrison
harrison/profile.py
profile
def profile(message=None, verbose=False): """Decorator for profiling a function. TODO: Support `@profile` syntax (without parens). This would involve inspecting the args. In this case `profile` would receive a single argument, which is the function to be decorated. """ import functools fro...
python
def profile(message=None, verbose=False): """Decorator for profiling a function. TODO: Support `@profile` syntax (without parens). This would involve inspecting the args. In this case `profile` would receive a single argument, which is the function to be decorated. """ import functools fro...
[ "def", "profile", "(", "message", "=", "None", ",", "verbose", "=", "False", ")", ":", "import", "functools", "from", "harrison", ".", "registered_timer", "import", "RegisteredTimer", "# Adjust the call stack index for RegisteredTimer so the call is Timer use", "# is proper...
Decorator for profiling a function. TODO: Support `@profile` syntax (without parens). This would involve inspecting the args. In this case `profile` would receive a single argument, which is the function to be decorated.
[ "Decorator", "for", "profiling", "a", "function", "." ]
train
https://github.com/bodylabs/harrison/blob/8a05b5c997909a75480b3fccacb2bfff888abfc7/harrison/profile.py#L1-L26
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_lookup_session
def get_item_lookup_session(self): """Gets the ``OsidSession`` associated with the item lookup service. return: (osid.assessment.ItemLookupSession) - an ``ItemLookupSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_loo...
python
def get_item_lookup_session(self): """Gets the ``OsidSession`` associated with the item lookup service. return: (osid.assessment.ItemLookupSession) - an ``ItemLookupSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_loo...
[ "def", "get_item_lookup_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_item_lookup", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", "ItemLookupSession", "(", "runtim...
Gets the ``OsidSession`` associated with the item lookup service. return: (osid.assessment.ItemLookupSession) - an ``ItemLookupSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_lookup()`` is ``false`` *compliance: opti...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "item", "lookup", "service", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L777-L791
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_lookup_session_for_bank
def get_item_lookup_session_for_bank(self, bank_id): """Gets the ``OsidSession`` associated with the item lookup service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.ItemLookupSession) - ``an _item_lookup_session`` rai...
python
def get_item_lookup_session_for_bank(self, bank_id): """Gets the ``OsidSession`` associated with the item lookup service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.ItemLookupSession) - ``an _item_lookup_session`` rai...
[ "def", "get_item_lookup_session_for_bank", "(", "self", ",", "bank_id", ")", ":", "if", "not", "self", ".", "supports_item_lookup", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "##", "# Also include check to see if the catalog Id is found otherwise ...
Gets the ``OsidSession`` associated with the item lookup service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.ItemLookupSession) - ``an _item_lookup_session`` raise: NotFound - ``bank_id`` not found raise: NullArgume...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "item", "lookup", "service", "for", "the", "given", "bank", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L797-L819
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_query_session
def get_item_query_session(self): """Gets the ``OsidSession`` associated with the item query service. return: (osid.assessment.ItemQuerySession) - an ``ItemQuerySession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_query()...
python
def get_item_query_session(self): """Gets the ``OsidSession`` associated with the item query service. return: (osid.assessment.ItemQuerySession) - an ``ItemQuerySession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_query()...
[ "def", "get_item_query_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_item_query", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", "ItemQuerySession", "(", "runtime",...
Gets the ``OsidSession`` associated with the item query service. return: (osid.assessment.ItemQuerySession) - an ``ItemQuerySession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_query()`` is ``false`` *compliance: optional...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "item", "query", "service", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L822-L836
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_query_session_for_bank
def get_item_query_session_for_bank(self, bank_id): """Gets the ``OsidSession`` associated with the item query service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.ItemQuerySession) - ``an _item_query_session`` raise: ...
python
def get_item_query_session_for_bank(self, bank_id): """Gets the ``OsidSession`` associated with the item query service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.ItemQuerySession) - ``an _item_query_session`` raise: ...
[ "def", "get_item_query_session_for_bank", "(", "self", ",", "bank_id", ")", ":", "if", "not", "self", ".", "supports_item_query", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "##", "# Also include check to see if the catalog Id is found otherwise ra...
Gets the ``OsidSession`` associated with the item query service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.ItemQuerySession) - ``an _item_query_session`` raise: NotFound - ``bank_id`` not found raise: NullArgument ...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "item", "query", "service", "for", "the", "given", "bank", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L842-L864
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_notification_session
def get_item_notification_session(self, item_receiver): """Gets the notification session for notifications pertaining to item changes. arg: item_receiver (osid.assessment.ItemReceiver): the item receiver interface return: (osid.assessment.ItemNotificationSession) - an ...
python
def get_item_notification_session(self, item_receiver): """Gets the notification session for notifications pertaining to item changes. arg: item_receiver (osid.assessment.ItemReceiver): the item receiver interface return: (osid.assessment.ItemNotificationSession) - an ...
[ "def", "get_item_notification_session", "(", "self", ",", "item_receiver", ")", ":", "if", "not", "self", ".", "supports_item_notification", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", ...
Gets the notification session for notifications pertaining to item changes. arg: item_receiver (osid.assessment.ItemReceiver): the item receiver interface return: (osid.assessment.ItemNotificationSession) - an ``ItemNotificationSession`` raise: NullArgument -...
[ "Gets", "the", "notification", "session", "for", "notifications", "pertaining", "to", "item", "changes", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L958-L976
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_notification_session_for_bank
def get_item_notification_session_for_bank(self, item_receiver, bank_id): """Gets the ``OsidSession`` associated with the item notification service for the given bank. arg: item_receiver (osid.assessment.ItemReceiver): the item receiver interface arg: bank_id (osid.id.Id):...
python
def get_item_notification_session_for_bank(self, item_receiver, bank_id): """Gets the ``OsidSession`` associated with the item notification service for the given bank. arg: item_receiver (osid.assessment.ItemReceiver): the item receiver interface arg: bank_id (osid.id.Id):...
[ "def", "get_item_notification_session_for_bank", "(", "self", ",", "item_receiver", ",", "bank_id", ")", ":", "if", "not", "self", ".", "supports_item_notification", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "##", "# Also include check to see...
Gets the ``OsidSession`` associated with the item notification service for the given bank. arg: item_receiver (osid.assessment.ItemReceiver): the item receiver interface arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.AssessmentNotificationSessio...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "item", "notification", "service", "for", "the", "given", "bank", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L980-L1005
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_bank_session
def get_item_bank_session(self): """Gets the ``OsidSession`` associated with the item banking service. return: (osid.assessment.ItemBankSession) - an ``ItemBankSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_bank()``...
python
def get_item_bank_session(self): """Gets the ``OsidSession`` associated with the item banking service. return: (osid.assessment.ItemBankSession) - an ``ItemBankSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_bank()``...
[ "def", "get_item_bank_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_item_bank", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", "ItemBankSession", "(", "runtime", ...
Gets the ``OsidSession`` associated with the item banking service. return: (osid.assessment.ItemBankSession) - an ``ItemBankSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_bank()`` is ``false`` *compliance: optional ...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "item", "banking", "service", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L1008-L1022
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_item_bank_assignment_session
def get_item_bank_assignment_session(self): """Gets the ``OsidSession`` associated with the item bank assignment service. return: (osid.assessment.ItemBankAssignmentSession) - an ``ItemBankAssignmentSession`` raise: OperationFailed - unable to complete request raise: U...
python
def get_item_bank_assignment_session(self): """Gets the ``OsidSession`` associated with the item bank assignment service. return: (osid.assessment.ItemBankAssignmentSession) - an ``ItemBankAssignmentSession`` raise: OperationFailed - unable to complete request raise: U...
[ "def", "get_item_bank_assignment_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_item_bank_assignment", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", "ItemBankAssignment...
Gets the ``OsidSession`` associated with the item bank assignment service. return: (osid.assessment.ItemBankAssignmentSession) - an ``ItemBankAssignmentSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_item_bank_assignment()`` is ...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "item", "bank", "assignment", "service", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L1027-L1042
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_assessment_admin_session
def get_assessment_admin_session(self): """Gets the ``OsidSession`` associated with the assessment administration service. return: (osid.assessment.AssessmentAdminSession) - an ``AssessmentAdminSession`` raise: OperationFailed - unable to complete request raise: Unimpl...
python
def get_assessment_admin_session(self): """Gets the ``OsidSession`` associated with the assessment administration service. return: (osid.assessment.AssessmentAdminSession) - an ``AssessmentAdminSession`` raise: OperationFailed - unable to complete request raise: Unimpl...
[ "def", "get_assessment_admin_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_assessment_admin", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", "AssessmentAdminSession", ...
Gets the ``OsidSession`` associated with the assessment administration service. return: (osid.assessment.AssessmentAdminSession) - an ``AssessmentAdminSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_assessment_admin()`` is ...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "assessment", "administration", "service", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L1139-L1154
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_assessment_admin_session_for_bank
def get_assessment_admin_session_for_bank(self, bank_id): """Gets the ``OsidSession`` associated with the assessment admin service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.AssessmentAdminSession) - ``an _assessment_admin_s...
python
def get_assessment_admin_session_for_bank(self, bank_id): """Gets the ``OsidSession`` associated with the assessment admin service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.AssessmentAdminSession) - ``an _assessment_admin_s...
[ "def", "get_assessment_admin_session_for_bank", "(", "self", ",", "bank_id", ")", ":", "if", "not", "self", ".", "supports_assessment_admin", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "##", "# Also include check to see if the catalog Id is found ...
Gets the ``OsidSession`` associated with the assessment admin service for the given bank. arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid.assessment.AssessmentAdminSession) - ``an _assessment_admin_session`` raise: NotFound - ``bank_id`` not found rai...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "assessment", "admin", "service", "for", "the", "given", "bank", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L1160-L1182
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_assessment_notification_session
def get_assessment_notification_session(self, assessment_receiver): """Gets the notification session for notifications pertaining to assessment changes. arg: assessment_receiver (osid.assessment.AssessmentReceiver): the assessment receiver interface return: (o...
python
def get_assessment_notification_session(self, assessment_receiver): """Gets the notification session for notifications pertaining to assessment changes. arg: assessment_receiver (osid.assessment.AssessmentReceiver): the assessment receiver interface return: (o...
[ "def", "get_assessment_notification_session", "(", "self", ",", "assessment_receiver", ")", ":", "if", "not", "self", ".", "supports_assessment_notification", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "s...
Gets the notification session for notifications pertaining to assessment changes. arg: assessment_receiver (osid.assessment.AssessmentReceiver): the assessment receiver interface return: (osid.assessment.AssessmentNotificationSession) - an ``Assessment...
[ "Gets", "the", "notification", "session", "for", "notifications", "pertaining", "to", "assessment", "changes", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L1186-L1205
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_assessment_notification_session_for_bank
def get_assessment_notification_session_for_bank(self, assessment_receiver, bank_id): """Gets the ``OsidSession`` associated with the assessment notification service for the given bank. arg: assessment_receiver (osid.assessment.AssessmentReceiver): the assessment rece...
python
def get_assessment_notification_session_for_bank(self, assessment_receiver, bank_id): """Gets the ``OsidSession`` associated with the assessment notification service for the given bank. arg: assessment_receiver (osid.assessment.AssessmentReceiver): the assessment rece...
[ "def", "get_assessment_notification_session_for_bank", "(", "self", ",", "assessment_receiver", ",", "bank_id", ")", ":", "if", "not", "self", ".", "supports_assessment_notification", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "##", "# Also in...
Gets the ``OsidSession`` associated with the assessment notification service for the given bank. arg: assessment_receiver (osid.assessment.AssessmentReceiver): the assessment receiver interface arg: bank_id (osid.id.Id): the ``Id`` of the bank return: (osid...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "assessment", "notification", "service", "for", "the", "given", "bank", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L1209-L1235
mitsei/dlkit
dlkit/json_/assessment/managers.py
AssessmentManager.get_assessment_offered_lookup_session
def get_assessment_offered_lookup_session(self): """Gets the ``OsidSession`` associated with the assessment offered lookup service. return: (osid.assessment.AssessmentOfferedLookupSession) - an ``AssessmentOfferedLookupSession`` raise: OperationFailed - unable to complete reque...
python
def get_assessment_offered_lookup_session(self): """Gets the ``OsidSession`` associated with the assessment offered lookup service. return: (osid.assessment.AssessmentOfferedLookupSession) - an ``AssessmentOfferedLookupSession`` raise: OperationFailed - unable to complete reque...
[ "def", "get_assessment_offered_lookup_session", "(", "self", ")", ":", "if", "not", "self", ".", "supports_assessment_offered_lookup", "(", ")", ":", "raise", "errors", ".", "Unimplemented", "(", ")", "# pylint: disable=no-member", "return", "sessions", ".", "Assessme...
Gets the ``OsidSession`` associated with the assessment offered lookup service. return: (osid.assessment.AssessmentOfferedLookupSession) - an ``AssessmentOfferedLookupSession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_assessment_off...
[ "Gets", "the", "OsidSession", "associated", "with", "the", "assessment", "offered", "lookup", "service", "." ]
train
https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/assessment/managers.py#L1325-L1340