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 |
|---|---|---|---|---|---|---|---|---|---|---|
matham/pyflycap2 | pyflycap2/utils.py | parse_header | def parse_header(filename):
'''Returns a list of :attr:`VariableSpec`, :attr:`FunctionSpec`,
:attr:`StructSpec`, :attr:`EnumSpec`, :attr:`EnumMemberSpec`, and
:attr:`TypeDef` instances representing the c header file.
'''
with open(filename, 'rb') as fh:
content = '\n'.join(fh.read().sp... | python | def parse_header(filename):
'''Returns a list of :attr:`VariableSpec`, :attr:`FunctionSpec`,
:attr:`StructSpec`, :attr:`EnumSpec`, :attr:`EnumMemberSpec`, and
:attr:`TypeDef` instances representing the c header file.
'''
with open(filename, 'rb') as fh:
content = '\n'.join(fh.read().sp... | [
"def",
"parse_header",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"fh",
":",
"content",
"=",
"'\\n'",
".",
"join",
"(",
"fh",
".",
"read",
"(",
")",
".",
"splitlines",
"(",
")",
")",
"content",
"=",
"sub",
... | Returns a list of :attr:`VariableSpec`, :attr:`FunctionSpec`,
:attr:`StructSpec`, :attr:`EnumSpec`, :attr:`EnumMemberSpec`, and
:attr:`TypeDef` instances representing the c header file. | [
"Returns",
"a",
"list",
"of",
":",
"attr",
":",
"VariableSpec",
":",
"attr",
":",
"FunctionSpec",
":",
"attr",
":",
"StructSpec",
":",
"attr",
":",
"EnumSpec",
":",
"attr",
":",
"EnumMemberSpec",
"and",
":",
"attr",
":",
"TypeDef",
"instances",
"representi... | train | https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L133-L187 |
matham/pyflycap2 | pyflycap2/utils.py | format_enum | def format_enum(enum_def):
'''Returns a cython enum from a :attr:`EnumSpec` instance.
'''
text = []
text.append('cdef enum {}:'.format(enum_def.tp_name))
for member in enum_def.values:
if member.value:
text.append('{}{} = {}'.format(tab, *member))
else:
... | python | def format_enum(enum_def):
'''Returns a cython enum from a :attr:`EnumSpec` instance.
'''
text = []
text.append('cdef enum {}:'.format(enum_def.tp_name))
for member in enum_def.values:
if member.value:
text.append('{}{} = {}'.format(tab, *member))
else:
... | [
"def",
"format_enum",
"(",
"enum_def",
")",
":",
"text",
"=",
"[",
"]",
"text",
".",
"append",
"(",
"'cdef enum {}:'",
".",
"format",
"(",
"enum_def",
".",
"tp_name",
")",
")",
"for",
"member",
"in",
"enum_def",
".",
"values",
":",
"if",
"member",
".",... | Returns a cython enum from a :attr:`EnumSpec` instance. | [
"Returns",
"a",
"cython",
"enum",
"from",
"a",
":",
"attr",
":",
"EnumSpec",
"instance",
"."
] | train | https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L196-L210 |
matham/pyflycap2 | pyflycap2/utils.py | format_function | def format_function(function):
'''Returns a cython function from a :attr:`FunctionSpec` instance.
'''
args = [format_variable(arg) for arg in function.args]
return ['{}{} {}({})'.format(
function.type, function.pointer, function.name, ', '.join(args))] | python | def format_function(function):
'''Returns a cython function from a :attr:`FunctionSpec` instance.
'''
args = [format_variable(arg) for arg in function.args]
return ['{}{} {}({})'.format(
function.type, function.pointer, function.name, ', '.join(args))] | [
"def",
"format_function",
"(",
"function",
")",
":",
"args",
"=",
"[",
"format_variable",
"(",
"arg",
")",
"for",
"arg",
"in",
"function",
".",
"args",
"]",
"return",
"[",
"'{}{} {}({})'",
".",
"format",
"(",
"function",
".",
"type",
",",
"function",
"."... | Returns a cython function from a :attr:`FunctionSpec` instance. | [
"Returns",
"a",
"cython",
"function",
"from",
"a",
":",
"attr",
":",
"FunctionSpec",
"instance",
"."
] | train | https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L221-L226 |
matham/pyflycap2 | pyflycap2/utils.py | format_struct | def format_struct(struct_def):
'''Returns a cython struct from a :attr:`StructSpec` instance.
'''
text = []
text.append('cdef struct {}:'.format(struct_def.tp_name))
text.extend(
['{}{}'.format(tab, format_variable(var))
for var in struct_def.members]
)
for name i... | python | def format_struct(struct_def):
'''Returns a cython struct from a :attr:`StructSpec` instance.
'''
text = []
text.append('cdef struct {}:'.format(struct_def.tp_name))
text.extend(
['{}{}'.format(tab, format_variable(var))
for var in struct_def.members]
)
for name i... | [
"def",
"format_struct",
"(",
"struct_def",
")",
":",
"text",
"=",
"[",
"]",
"text",
".",
"append",
"(",
"'cdef struct {}:'",
".",
"format",
"(",
"struct_def",
".",
"tp_name",
")",
")",
"text",
".",
"extend",
"(",
"[",
"'{}{}'",
".",
"format",
"(",
"tab... | Returns a cython struct from a :attr:`StructSpec` instance. | [
"Returns",
"a",
"cython",
"struct",
"from",
"a",
":",
"attr",
":",
"StructSpec",
"instance",
"."
] | train | https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L229-L242 |
matham/pyflycap2 | pyflycap2/utils.py | dump_cython | def dump_cython(content, name, ofile):
'''Generates a cython pxi file from the output of :func:`parse_header`.
'''
with open(ofile, 'wb') as fh:
fh.write('cdef extern from "{}":\n'.format(name))
for item in content:
if isinstance(item, FunctionSpec):
code =... | python | def dump_cython(content, name, ofile):
'''Generates a cython pxi file from the output of :func:`parse_header`.
'''
with open(ofile, 'wb') as fh:
fh.write('cdef extern from "{}":\n'.format(name))
for item in content:
if isinstance(item, FunctionSpec):
code =... | [
"def",
"dump_cython",
"(",
"content",
",",
"name",
",",
"ofile",
")",
":",
"with",
"open",
"(",
"ofile",
",",
"'wb'",
")",
"as",
"fh",
":",
"fh",
".",
"write",
"(",
"'cdef extern from \"{}\":\\n'",
".",
"format",
"(",
"name",
")",
")",
"for",
"item",
... | Generates a cython pxi file from the output of :func:`parse_header`. | [
"Generates",
"a",
"cython",
"pxi",
"file",
"from",
"the",
"output",
"of",
":",
"func",
":",
"parse_header",
"."
] | train | https://github.com/matham/pyflycap2/blob/ce84f8f7553ccee7a7a3bbbc152574a68683862f/pyflycap2/utils.py#L245-L264 |
morngrar/betterdialogs | betterdialogs/betterdialog.py | parse_geometry | def parse_geometry(geometry):
"""Takes a geometry string, returns map of parameters."""
m = re.match("(\d+)x(\d+)([-+]\d+)([-+]\d+)", geometry)
if not m:
raise ValueError("failed to parse geometry string")
return map(int, m.groups()) | python | def parse_geometry(geometry):
"""Takes a geometry string, returns map of parameters."""
m = re.match("(\d+)x(\d+)([-+]\d+)([-+]\d+)", geometry)
if not m:
raise ValueError("failed to parse geometry string")
return map(int, m.groups()) | [
"def",
"parse_geometry",
"(",
"geometry",
")",
":",
"m",
"=",
"re",
".",
"match",
"(",
"\"(\\d+)x(\\d+)([-+]\\d+)([-+]\\d+)\"",
",",
"geometry",
")",
"if",
"not",
"m",
":",
"raise",
"ValueError",
"(",
"\"failed to parse geometry string\"",
")",
"return",
"map",
... | Takes a geometry string, returns map of parameters. | [
"Takes",
"a",
"geometry",
"string",
"returns",
"map",
"of",
"parameters",
"."
] | train | https://github.com/morngrar/betterdialogs/blob/185570c8dd6ea3718fef5e09ac1647e716d8bff5/betterdialogs/betterdialog.py#L8-L14 |
morngrar/betterdialogs | betterdialogs/betterdialog.py | BetterDialog.buttons | def buttons(self, master):
"""Adds 'OK' and 'Cancel' buttons to standard button frame.
Override if need for different configuration.
"""
subframe = tk.Frame(master)
subframe.pack(side=tk.RIGHT)
ttk.Button(
subframe,
text="OK",
width=... | python | def buttons(self, master):
"""Adds 'OK' and 'Cancel' buttons to standard button frame.
Override if need for different configuration.
"""
subframe = tk.Frame(master)
subframe.pack(side=tk.RIGHT)
ttk.Button(
subframe,
text="OK",
width=... | [
"def",
"buttons",
"(",
"self",
",",
"master",
")",
":",
"subframe",
"=",
"tk",
".",
"Frame",
"(",
"master",
")",
"subframe",
".",
"pack",
"(",
"side",
"=",
"tk",
".",
"RIGHT",
")",
"ttk",
".",
"Button",
"(",
"subframe",
",",
"text",
"=",
"\"OK\"",
... | Adds 'OK' and 'Cancel' buttons to standard button frame.
Override if need for different configuration. | [
"Adds",
"OK",
"and",
"Cancel",
"buttons",
"to",
"standard",
"button",
"frame",
"."
] | train | https://github.com/morngrar/betterdialogs/blob/185570c8dd6ea3718fef5e09ac1647e716d8bff5/betterdialogs/betterdialog.py#L56-L82 |
morngrar/betterdialogs | betterdialogs/betterdialog.py | BetterDialog.ok | def ok(self, event=None):
"""Function called when OK-button is clicked.
This method calls check_input(), and if that returns ok it calls
execute(), and then destroys the dialog.
"""
if not self.check_input():
self.initial_focus.focus_set()
return
... | python | def ok(self, event=None):
"""Function called when OK-button is clicked.
This method calls check_input(), and if that returns ok it calls
execute(), and then destroys the dialog.
"""
if not self.check_input():
self.initial_focus.focus_set()
return
... | [
"def",
"ok",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"check_input",
"(",
")",
":",
"self",
".",
"initial_focus",
".",
"focus_set",
"(",
")",
"return",
"self",
".",
"withdraw",
"(",
")",
"self",
".",
"update_idletas... | Function called when OK-button is clicked.
This method calls check_input(), and if that returns ok it calls
execute(), and then destroys the dialog. | [
"Function",
"called",
"when",
"OK",
"-",
"button",
"is",
"clicked",
"."
] | train | https://github.com/morngrar/betterdialogs/blob/185570c8dd6ea3718fef5e09ac1647e716d8bff5/betterdialogs/betterdialog.py#L115-L132 |
morngrar/betterdialogs | betterdialogs/betterdialog.py | BetterDialog.cancel | def cancel(self, event=None):
"""Function called when Cancel-button clicked.
This method returns focus to parent, and destroys the dialog.
"""
if self.parent != None:
self.parent.focus_set()
self.destroy() | python | def cancel(self, event=None):
"""Function called when Cancel-button clicked.
This method returns focus to parent, and destroys the dialog.
"""
if self.parent != None:
self.parent.focus_set()
self.destroy() | [
"def",
"cancel",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"if",
"self",
".",
"parent",
"!=",
"None",
":",
"self",
".",
"parent",
".",
"focus_set",
"(",
")",
"self",
".",
"destroy",
"(",
")"
] | Function called when Cancel-button clicked.
This method returns focus to parent, and destroys the dialog. | [
"Function",
"called",
"when",
"Cancel",
"-",
"button",
"clicked",
"."
] | train | https://github.com/morngrar/betterdialogs/blob/185570c8dd6ea3718fef5e09ac1647e716d8bff5/betterdialogs/betterdialog.py#L134-L143 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.set_payload | def set_payload(self,val):
"""Set a payload for this object
:param val: payload to be stored
:type val: Anything that can be put in a list
"""
self._options = self._options._replace(payload = val) | python | def set_payload(self,val):
"""Set a payload for this object
:param val: payload to be stored
:type val: Anything that can be put in a list
"""
self._options = self._options._replace(payload = val) | [
"def",
"set_payload",
"(",
"self",
",",
"val",
")",
":",
"self",
".",
"_options",
"=",
"self",
".",
"_options",
".",
"_replace",
"(",
"payload",
"=",
"val",
")"
] | Set a payload for this object
:param val: payload to be stored
:type val: Anything that can be put in a list | [
"Set",
"a",
"payload",
"for",
"this",
"object"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L89-L95 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.avg_mutual_coverage | def avg_mutual_coverage(self,gpd):
"""get the coverage fraction of each transcript then return the geometric mean
:param gpd: Another transcript
:type gpd: Transcript
:return: avg_coverage
:rtype: float
"""
ov = self.overlap_size(gpd)
if ov == 0: return 0
xfrac = float(ov) / float(s... | python | def avg_mutual_coverage(self,gpd):
"""get the coverage fraction of each transcript then return the geometric mean
:param gpd: Another transcript
:type gpd: Transcript
:return: avg_coverage
:rtype: float
"""
ov = self.overlap_size(gpd)
if ov == 0: return 0
xfrac = float(ov) / float(s... | [
"def",
"avg_mutual_coverage",
"(",
"self",
",",
"gpd",
")",
":",
"ov",
"=",
"self",
".",
"overlap_size",
"(",
"gpd",
")",
"if",
"ov",
"==",
"0",
":",
"return",
"0",
"xfrac",
"=",
"float",
"(",
"ov",
")",
"/",
"float",
"(",
"self",
".",
"get_length"... | get the coverage fraction of each transcript then return the geometric mean
:param gpd: Another transcript
:type gpd: Transcript
:return: avg_coverage
:rtype: float | [
"get",
"the",
"coverage",
"fraction",
"of",
"each",
"transcript",
"then",
"return",
"the",
"geometric",
"mean"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L132-L144 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.overlap_size | def overlap_size(self,tx2):
"""Return the number of overlapping base pairs between two transcripts
:param tx2: Another transcript
:type tx2: Transcript
:return: overlap size in base pairs
:rtype: int
"""
total = 0
for e1 in self.exons:
for e2 in tx2.exons:
total += e1.over... | python | def overlap_size(self,tx2):
"""Return the number of overlapping base pairs between two transcripts
:param tx2: Another transcript
:type tx2: Transcript
:return: overlap size in base pairs
:rtype: int
"""
total = 0
for e1 in self.exons:
for e2 in tx2.exons:
total += e1.over... | [
"def",
"overlap_size",
"(",
"self",
",",
"tx2",
")",
":",
"total",
"=",
"0",
"for",
"e1",
"in",
"self",
".",
"exons",
":",
"for",
"e2",
"in",
"tx2",
".",
"exons",
":",
"total",
"+=",
"e1",
".",
"overlap_size",
"(",
"e2",
")",
"return",
"total"
] | Return the number of overlapping base pairs between two transcripts
:param tx2: Another transcript
:type tx2: Transcript
:return: overlap size in base pairs
:rtype: int | [
"Return",
"the",
"number",
"of",
"overlapping",
"base",
"pairs",
"between",
"two",
"transcripts"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L146-L158 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.overlaps | def overlaps(self,tx2):
"""Return True if overlapping
"""
total = 0
for e1 in self.exons:
for e2 in tx2.exons:
if e1.overlap_size(e2) > 0: return True
return False | python | def overlaps(self,tx2):
"""Return True if overlapping
"""
total = 0
for e1 in self.exons:
for e2 in tx2.exons:
if e1.overlap_size(e2) > 0: return True
return False | [
"def",
"overlaps",
"(",
"self",
",",
"tx2",
")",
":",
"total",
"=",
"0",
"for",
"e1",
"in",
"self",
".",
"exons",
":",
"for",
"e2",
"in",
"tx2",
".",
"exons",
":",
"if",
"e1",
".",
"overlap_size",
"(",
"e2",
")",
">",
"0",
":",
"return",
"True"... | Return True if overlapping | [
"Return",
"True",
"if",
"overlapping"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L160-L167 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.slice_target | def slice_target(self,chr,start,end):
"""Slice the mapping by the target coordinate
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish
"""
# create a range that we are going to intersect with
trng = Bed(chr,start,end)
nrngs = []
for r in sel... | python | def slice_target(self,chr,start,end):
"""Slice the mapping by the target coordinate
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish
"""
# create a range that we are going to intersect with
trng = Bed(chr,start,end)
nrngs = []
for r in sel... | [
"def",
"slice_target",
"(",
"self",
",",
"chr",
",",
"start",
",",
"end",
")",
":",
"# create a range that we are going to intersect with",
"trng",
"=",
"Bed",
"(",
"chr",
",",
"start",
",",
"end",
")",
"nrngs",
"=",
"[",
"]",
"for",
"r",
"in",
"self",
"... | Slice the mapping by the target coordinate
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish | [
"Slice",
"the",
"mapping",
"by",
"the",
"target",
"coordinate",
"First",
"coordinate",
"is",
"0",
"-",
"indexed",
"start",
"Second",
"coordinate",
"is",
"1",
"-",
"indexed",
"finish"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L177-L192 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.slice_sequence | def slice_sequence(self,start,end):
"""Slice the mapping by the position in the sequence
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish
"""
#find the sequence length
l = self.length
indexstart = start
indexend = end
ns = []
tot... | python | def slice_sequence(self,start,end):
"""Slice the mapping by the position in the sequence
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish
"""
#find the sequence length
l = self.length
indexstart = start
indexend = end
ns = []
tot... | [
"def",
"slice_sequence",
"(",
"self",
",",
"start",
",",
"end",
")",
":",
"#find the sequence length",
"l",
"=",
"self",
".",
"length",
"indexstart",
"=",
"start",
"indexend",
"=",
"end",
"ns",
"=",
"[",
"]",
"tot",
"=",
"0",
"for",
"r",
"in",
"self",
... | Slice the mapping by the position in the sequence
First coordinate is 0-indexed start
Second coordinate is 1-indexed finish | [
"Slice",
"the",
"mapping",
"by",
"the",
"position",
"in",
"the",
"sequence",
"First",
"coordinate",
"is",
"0",
"-",
"indexed",
"start",
"Second",
"coordinate",
"is",
"1",
"-",
"indexed",
"finish"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L194-L222 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.sequence | def sequence(self):
"""A strcutre is defined so get,
if the sequence is not already there, get the sequence from the reference
Always is returned on the positive strand for the MappingGeneric
:param ref_dict: reference dictionary (only necessary if sequence has not been set already)
:type ref_dict... | python | def sequence(self):
"""A strcutre is defined so get,
if the sequence is not already there, get the sequence from the reference
Always is returned on the positive strand for the MappingGeneric
:param ref_dict: reference dictionary (only necessary if sequence has not been set already)
:type ref_dict... | [
"def",
"sequence",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_options",
".",
"ref",
":",
"raise",
"ValueError",
"(",
"\"ERROR: sequence is not defined and reference is undefined\"",
")",
"#chr = self.range.chr",
"return",
"self",
".",
"get_sequence",
"(",
"s... | A strcutre is defined so get,
if the sequence is not already there, get the sequence from the reference
Always is returned on the positive strand for the MappingGeneric
:param ref_dict: reference dictionary (only necessary if sequence has not been set already)
:type ref_dict: dict() | [
"A",
"strcutre",
"is",
"defined",
"so",
"get",
"if",
"the",
"sequence",
"is",
"not",
"already",
"there",
"get",
"the",
"sequence",
"from",
"the",
"reference"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L225-L237 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.get_sequence | def get_sequence(self,ref):
"""get a sequence given a reference"""
strand = '+'
if not self._options.direction:
sys.stderr.write("WARNING: no strand information for the transcript\n")
if self._options.direction: strand = self._options.direction
seq = ''
for e in [x.range for x in self.exon... | python | def get_sequence(self,ref):
"""get a sequence given a reference"""
strand = '+'
if not self._options.direction:
sys.stderr.write("WARNING: no strand information for the transcript\n")
if self._options.direction: strand = self._options.direction
seq = ''
for e in [x.range for x in self.exon... | [
"def",
"get_sequence",
"(",
"self",
",",
"ref",
")",
":",
"strand",
"=",
"'+'",
"if",
"not",
"self",
".",
"_options",
".",
"direction",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"\"WARNING: no strand information for the transcript\\n\"",
")",
"if",
"self",... | get a sequence given a reference | [
"get",
"a",
"sequence",
"given",
"a",
"reference"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L239-L249 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.get_junctions_string | def get_junctions_string(self):
"""Get a string representation of the junctions. This is almost identical to a previous function.
:return: string representation of junction
:rtype: string
"""
self._initialize()
return ';'.join([x.get_range_string() for x in self.junctions]) | python | def get_junctions_string(self):
"""Get a string representation of the junctions. This is almost identical to a previous function.
:return: string representation of junction
:rtype: string
"""
self._initialize()
return ';'.join([x.get_range_string() for x in self.junctions]) | [
"def",
"get_junctions_string",
"(",
"self",
")",
":",
"self",
".",
"_initialize",
"(",
")",
"return",
"';'",
".",
"join",
"(",
"[",
"x",
".",
"get_range_string",
"(",
")",
"for",
"x",
"in",
"self",
".",
"junctions",
"]",
")"
] | Get a string representation of the junctions. This is almost identical to a previous function.
:return: string representation of junction
:rtype: string | [
"Get",
"a",
"string",
"representation",
"of",
"the",
"junctions",
".",
"This",
"is",
"almost",
"identical",
"to",
"a",
"previous",
"function",
"."
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L252-L259 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.junction_overlap | def junction_overlap(self,tx,tolerance=0):
"""Calculate the junction overlap between two transcripts
:param tx: Other transcript
:type tx: Transcript
:param tolerance: how close to consider two junctions as overlapped (default=0)
:type tolerance: int
:return: Junction Overlap Report
:rtype:... | python | def junction_overlap(self,tx,tolerance=0):
"""Calculate the junction overlap between two transcripts
:param tx: Other transcript
:type tx: Transcript
:param tolerance: how close to consider two junctions as overlapped (default=0)
:type tolerance: int
:return: Junction Overlap Report
:rtype:... | [
"def",
"junction_overlap",
"(",
"self",
",",
"tx",
",",
"tolerance",
"=",
"0",
")",
":",
"self",
".",
"_initialize",
"(",
")",
"return",
"JunctionOverlap",
"(",
"self",
",",
"tx",
",",
"tolerance",
")"
] | Calculate the junction overlap between two transcripts
:param tx: Other transcript
:type tx: Transcript
:param tolerance: how close to consider two junctions as overlapped (default=0)
:type tolerance: int
:return: Junction Overlap Report
:rtype: Transcript.JunctionOverlap | [
"Calculate",
"the",
"junction",
"overlap",
"between",
"two",
"transcripts"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L261-L272 |
jason-weirather/py-seq-tools | seqtools/structure/__init__.py | MappingGeneric.smooth_gaps | def smooth_gaps(self,min_intron):
"""any gaps smaller than min_intron are joined, andreturns a new mapping with gaps smoothed
:param min_intron: the smallest an intron can be, smaller gaps will be sealed
:type min_intron: int
:return: a mapping with small gaps closed
:rtype: MappingGeneric
"""
... | python | def smooth_gaps(self,min_intron):
"""any gaps smaller than min_intron are joined, andreturns a new mapping with gaps smoothed
:param min_intron: the smallest an intron can be, smaller gaps will be sealed
:type min_intron: int
:return: a mapping with small gaps closed
:rtype: MappingGeneric
"""
... | [
"def",
"smooth_gaps",
"(",
"self",
",",
"min_intron",
")",
":",
"rngs",
"=",
"[",
"self",
".",
"_rngs",
"[",
"0",
"]",
".",
"copy",
"(",
")",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_rngs",
")",
"-",
"1",
")",
":",
"dis... | any gaps smaller than min_intron are joined, andreturns a new mapping with gaps smoothed
:param min_intron: the smallest an intron can be, smaller gaps will be sealed
:type min_intron: int
:return: a mapping with small gaps closed
:rtype: MappingGeneric | [
"any",
"gaps",
"smaller",
"than",
"min_intron",
"are",
"joined",
"andreturns",
"a",
"new",
"mapping",
"with",
"gaps",
"smoothed"
] | train | https://github.com/jason-weirather/py-seq-tools/blob/f642c2c73ffef2acc83656a78059a476fc734ca1/seqtools/structure/__init__.py#L274-L291 |
mitsei/dlkit | dlkit/primordium/locale/types/time.py | get_type_data | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
if name in CELESTIAL_TIME_TYPES:
namespace = 'time'
domain = 'Celestial Time Systems'
time_name = CELESTIAL_TIME_TYPES[nam... | python | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
name = name.upper()
if name in CELESTIAL_TIME_TYPES:
namespace = 'time'
domain = 'Celestial Time Systems'
time_name = CELESTIAL_TIME_TYPES[nam... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"name",
"=",
"name",
".",
"upper",
"(",
")",
"if",
"name",
"in",
"CELESTIAL_TIME_TYPES",
":",
"namespace",
"=",
"'time'",
"domain",
"=",
"'Celestial Time Systems'",
"time_name",
"=",
"CELESTIAL_TIME_TYPES",
"[",
"... | Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type | [
"Return",
"dictionary",
"representation",
"of",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/primordium/locale/types/time.py#L70-L100 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_coordinate_type | def supports_coordinate_type(self, coordinate_type=None):
"""Tests if the given coordinate type is supported.
arg: coordinate_type (osid.type.Type): a coordinate Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syn... | python | def supports_coordinate_type(self, coordinate_type=None):
"""Tests if the given coordinate type is supported.
arg: coordinate_type (osid.type.Type): a coordinate Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syn... | [
"def",
"supports_coordinate_type",
"(",
"self",
",",
"coordinate_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"coordinate_type",
... | Tests if the given coordinate type is supported.
arg: coordinate_type (osid.type.Type): a coordinate Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``COORDINATE``
raise: NullArgument - ``coordina... | [
"Tests",
"if",
"the",
"given",
"coordinate",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L303-L320 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_currency_type | def supports_currency_type(self, currency_type=None):
"""Tests if the given currency type is supported.
arg: currency_type (osid.type.Type): a currency Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not... | python | def supports_currency_type(self, currency_type=None):
"""Tests if the given currency type is supported.
arg: currency_type (osid.type.Type): a currency Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not... | [
"def",
"supports_currency_type",
"(",
"self",
",",
"currency_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"currency_type",
":",... | Tests if the given currency type is supported.
arg: currency_type (osid.type.Type): a currency Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``CURRENCY``
raise: NullArgument - ``currency_type`` ... | [
"Tests",
"if",
"the",
"given",
"currency",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L448-L465 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_calendar_type | def supports_calendar_type(self, calendar_type=None):
"""Tests if the given calendar type is supported.
arg: calendar_type (osid.type.Type): a calendar Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not... | python | def supports_calendar_type(self, calendar_type=None):
"""Tests if the given calendar type is supported.
arg: calendar_type (osid.type.Type): a calendar Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not... | [
"def",
"supports_calendar_type",
"(",
"self",
",",
"calendar_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"calendar_type",
":",... | Tests if the given calendar type is supported.
arg: calendar_type (osid.type.Type): a calendar Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``DATETIME`` or
``DURATION``
raise: N... | [
"Tests",
"if",
"the",
"given",
"calendar",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L600-L618 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_time_type | def supports_time_type(self, time_type=None):
"""Tests if the given time type is supported.
arg: time_type (osid.type.Type): a time Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``DATETIME, DURAT... | python | def supports_time_type(self, time_type=None):
"""Tests if the given time type is supported.
arg: time_type (osid.type.Type): a time Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``DATETIME, DURAT... | [
"def",
"supports_time_type",
"(",
"self",
",",
"time_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"time_type",
":",
"raise",
... | Tests if the given time type is supported.
arg: time_type (osid.type.Type): a time Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``DATETIME, DURATION,``
or ``TIME``
raise: NullAr... | [
"Tests",
"if",
"the",
"given",
"time",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L639-L657 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_heading_type | def supports_heading_type(self, heading_type=None):
"""Tests if the given heading type is supported.
arg: heading_type (osid.type.Type): a heading Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``... | python | def supports_heading_type(self, heading_type=None):
"""Tests if the given heading type is supported.
arg: heading_type (osid.type.Type): a heading Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``... | [
"def",
"supports_heading_type",
"(",
"self",
",",
"heading_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"heading_type",
":",
... | Tests if the given heading type is supported.
arg: heading_type (osid.type.Type): a heading Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``HEADING``
raise: NullArgument - ``heading_type`` is ``... | [
"Tests",
"if",
"the",
"given",
"heading",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L1099-L1116 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_object_type | def supports_object_type(self, object_type=None):
"""Tests if the given object type is supported.
arg: object_type (osid.type.Type): an object Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not an ``OBJ... | python | def supports_object_type(self, object_type=None):
"""Tests if the given object type is supported.
arg: object_type (osid.type.Type): an object Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not an ``OBJ... | [
"def",
"supports_object_type",
"(",
"self",
",",
"object_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"object_type",
":",
"ra... | Tests if the given object type is supported.
arg: object_type (osid.type.Type): an object Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not an ``OBJECT``
raise: NullArgument - ``object_type`` is ``nul... | [
"Tests",
"if",
"the",
"given",
"object",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L1396-L1413 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_spatial_unit_record_type | def supports_spatial_unit_record_type(self, spatial_unit_record_type=None):
"""Tests if the given spatial unit record type is supported.
arg: spatial_unit_record_type (osid.type.Type): a spatial
unit record Type
return: (boolean) - ``true`` if the type is supported, ``false``... | python | def supports_spatial_unit_record_type(self, spatial_unit_record_type=None):
"""Tests if the given spatial unit record type is supported.
arg: spatial_unit_record_type (osid.type.Type): a spatial
unit record Type
return: (boolean) - ``true`` if the type is supported, ``false``... | [
"def",
"supports_spatial_unit_record_type",
"(",
"self",
",",
"spatial_unit_record_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"... | Tests if the given spatial unit record type is supported.
arg: spatial_unit_record_type (osid.type.Type): a spatial
unit record Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not an ``SPATIALUNI... | [
"Tests",
"if",
"the",
"given",
"spatial",
"unit",
"record",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L1494-L1512 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_string_match_type | def supports_string_match_type(self, string_match_type=None):
"""Tests if the given string match type is supported.
arg: string_match_type (osid.type.Type): a string match type
return: (boolean) - ``true`` if the given string match type Is
supported, ``false`` otherwise
... | python | def supports_string_match_type(self, string_match_type=None):
"""Tests if the given string match type is supported.
arg: string_match_type (osid.type.Type): a string match type
return: (boolean) - ``true`` if the given string match type Is
supported, ``false`` otherwise
... | [
"def",
"supports_string_match_type",
"(",
"self",
",",
"string_match_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"string_match_t... | Tests if the given string match type is supported.
arg: string_match_type (osid.type.Type): a string match type
return: (boolean) - ``true`` if the given string match type Is
supported, ``false`` otherwise
raise: IllegalState - syntax is not a ``STRING``
raise: Null... | [
"Tests",
"if",
"the",
"given",
"string",
"match",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L1728-L1745 |
mitsei/dlkit | dlkit/runtime/impls/osid/metadata.py | Metadata.supports_version_type | def supports_version_type(self, version_type=None):
"""Tests if the given version type is supported.
arg: version_type (osid.type.Type): a version Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``... | python | def supports_version_type(self, version_type=None):
"""Tests if the given version type is supported.
arg: version_type (osid.type.Type): a version Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``... | [
"def",
"supports_version_type",
"(",
"self",
",",
"version_type",
"=",
"None",
")",
":",
"# Implemented from template for osid.Metadata.supports_coordinate_type",
"from",
".",
"osid_errors",
"import",
"IllegalState",
",",
"NullArgument",
"if",
"not",
"version_type",
":",
... | Tests if the given version type is supported.
arg: version_type (osid.type.Type): a version Type
return: (boolean) - ``true`` if the type is supported, ``false``
otherwise
raise: IllegalState - syntax is not a ``VERSION``
raise: NullArgument - ``version_type`` is ``... | [
"Tests",
"if",
"the",
"given",
"version",
"type",
"is",
"supported",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/runtime/impls/osid/metadata.py#L2016-L2033 |
bodylabs/harrison | harrison/registered_timer.py | aggregate_registry_timers | def aggregate_registry_timers():
"""Returns a list of aggregate timing information for registered timers.
Each element is a 3-tuple of
- timer description
- aggregate elapsed time
- number of calls
The list is sorted by the first start time of each aggregate timer.
"""
im... | python | def aggregate_registry_timers():
"""Returns a list of aggregate timing information for registered timers.
Each element is a 3-tuple of
- timer description
- aggregate elapsed time
- number of calls
The list is sorted by the first start time of each aggregate timer.
"""
im... | [
"def",
"aggregate_registry_timers",
"(",
")",
":",
"import",
"itertools",
"timers",
"=",
"sorted",
"(",
"shared_registry",
".",
"values",
"(",
")",
",",
"key",
"=",
"lambda",
"t",
":",
"t",
".",
"desc",
")",
"aggregate_timers",
"=",
"[",
"]",
"for",
"k",... | Returns a list of aggregate timing information for registered timers.
Each element is a 3-tuple of
- timer description
- aggregate elapsed time
- number of calls
The list is sorted by the first start time of each aggregate timer. | [
"Returns",
"a",
"list",
"of",
"aggregate",
"timing",
"information",
"for",
"registered",
"timers",
"."
] | train | https://github.com/bodylabs/harrison/blob/8a05b5c997909a75480b3fccacb2bfff888abfc7/harrison/registered_timer.py#L7-L33 |
theosysbio/means | src/means/io/sbml.py | read_sbml | def read_sbml(filename):
"""
Read the model from a SBML file.
:param filename: SBML filename to read the model from
:return: A tuple, consisting of :class:`~means.core.model.Model` instance,
set of parameter values, and set of initial conditions variables.
"""
import libsbml
i... | python | def read_sbml(filename):
"""
Read the model from a SBML file.
:param filename: SBML filename to read the model from
:return: A tuple, consisting of :class:`~means.core.model.Model` instance,
set of parameter values, and set of initial conditions variables.
"""
import libsbml
i... | [
"def",
"read_sbml",
"(",
"filename",
")",
":",
"import",
"libsbml",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"raise",
"IOError",
"(",
"'File {0!r} does not exist'",
".",
"format",
"(",
"filename",
")",
")",
"reader",
"=",
... | Read the model from a SBML file.
:param filename: SBML filename to read the model from
:return: A tuple, consisting of :class:`~means.core.model.Model` instance,
set of parameter values, and set of initial conditions variables. | [
"Read",
"the",
"model",
"from",
"a",
"SBML",
"file",
"."
] | train | https://github.com/theosysbio/means/blob/fe164916a1d84ab2a4fa039871d38ccdf638b1db/src/means/io/sbml.py#L55-L125 |
Vagrants/blackbird | blackbird/plugins/netstat.py | ConcreteJob.build_items | def build_items(self):
u"""This method called by Executer.
/proc/net/tcp -> {host:host, key:key, value:value, clock:clock}
"""
protocols = ['tcp', 'tcp6']
for protocol in protocols:
procfile = open('/proc/net/{0}'.format(protocol), 'r')
stats = self.count(... | python | def build_items(self):
u"""This method called by Executer.
/proc/net/tcp -> {host:host, key:key, value:value, clock:clock}
"""
protocols = ['tcp', 'tcp6']
for protocol in protocols:
procfile = open('/proc/net/{0}'.format(protocol), 'r')
stats = self.count(... | [
"def",
"build_items",
"(",
"self",
")",
":",
"protocols",
"=",
"[",
"'tcp'",
",",
"'tcp6'",
"]",
"for",
"protocol",
"in",
"protocols",
":",
"procfile",
"=",
"open",
"(",
"'/proc/net/{0}'",
".",
"format",
"(",
"protocol",
")",
",",
"'r'",
")",
"stats",
... | u"""This method called by Executer.
/proc/net/tcp -> {host:host, key:key, value:value, clock:clock} | [
"u",
"This",
"method",
"called",
"by",
"Executer",
".",
"/",
"proc",
"/",
"net",
"/",
"tcp",
"-",
">",
"{",
"host",
":",
"host",
"key",
":",
"key",
"value",
":",
"value",
"clock",
":",
"clock",
"}"
] | train | https://github.com/Vagrants/blackbird/blob/3b38cd5650caae362e0668dbd38bf8f88233e079/blackbird/plugins/netstat.py#L22-L37 |
Vagrants/blackbird | blackbird/plugins/netstat.py | ConcreteJob.count | def count(procfile):
u"""Take arguments as intermediate data.
{protocol:[...]} -> {key1:value1, key2:value2}
e.g: {linux.net.tcp.LISTEN: 20}
"""
state_tcp = {
'01': 'ESTABLISHED',
'02': 'SYN_SENT',
'03': 'SYN_RECV',
'04': 'FIN_WAIT... | python | def count(procfile):
u"""Take arguments as intermediate data.
{protocol:[...]} -> {key1:value1, key2:value2}
e.g: {linux.net.tcp.LISTEN: 20}
"""
state_tcp = {
'01': 'ESTABLISHED',
'02': 'SYN_SENT',
'03': 'SYN_RECV',
'04': 'FIN_WAIT... | [
"def",
"count",
"(",
"procfile",
")",
":",
"state_tcp",
"=",
"{",
"'01'",
":",
"'ESTABLISHED'",
",",
"'02'",
":",
"'SYN_SENT'",
",",
"'03'",
":",
"'SYN_RECV'",
",",
"'04'",
":",
"'FIN_WAIT1'",
",",
"'05'",
":",
"'FIN_WAIT2'",
",",
"'06'",
":",
"'TIME_WAI... | u"""Take arguments as intermediate data.
{protocol:[...]} -> {key1:value1, key2:value2}
e.g: {linux.net.tcp.LISTEN: 20} | [
"u",
"Take",
"arguments",
"as",
"intermediate",
"data",
".",
"{",
"protocol",
":",
"[",
"...",
"]",
"}",
"-",
">",
"{",
"key1",
":",
"value1",
"key2",
":",
"value2",
"}",
"e",
".",
"g",
":",
"{",
"linux",
".",
"net",
".",
"tcp",
".",
"LISTEN",
... | train | https://github.com/Vagrants/blackbird/blob/3b38cd5650caae362e0668dbd38bf8f88233e079/blackbird/plugins/netstat.py#L40-L77 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | ItemTextsAndFilesMixin._init_map | def _init_map(self):
"""stub"""
ItemTextsFormRecord._init_map(self)
ItemFilesFormRecord._init_map(self)
super(ItemTextsAndFilesMixin, self)._init_map() | python | def _init_map(self):
"""stub"""
ItemTextsFormRecord._init_map(self)
ItemFilesFormRecord._init_map(self)
super(ItemTextsAndFilesMixin, self)._init_map() | [
"def",
"_init_map",
"(",
"self",
")",
":",
"ItemTextsFormRecord",
".",
"_init_map",
"(",
"self",
")",
"ItemFilesFormRecord",
".",
"_init_map",
"(",
"self",
")",
"super",
"(",
"ItemTextsAndFilesMixin",
",",
"self",
")",
".",
"_init_map",
"(",
")"
] | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L88-L92 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | ItemTextsAndFilesMixin._init_metadata | def _init_metadata(self):
"""stub"""
ItemTextsFormRecord._init_metadata(self)
ItemFilesFormRecord._init_metadata(self)
super(ItemTextsAndFilesMixin, self)._init_metadata() | python | def _init_metadata(self):
"""stub"""
ItemTextsFormRecord._init_metadata(self)
ItemFilesFormRecord._init_metadata(self)
super(ItemTextsAndFilesMixin, self)._init_metadata() | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"ItemTextsFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"ItemFilesFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"super",
"(",
"ItemTextsAndFilesMixin",
",",
"self",
")",
".",
"_init_metadata",
"(",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L94-L98 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | QuestionTextAndFilesMixin._init_map | def _init_map(self):
"""stub"""
QuestionTextFormRecord._init_map(self)
QuestionFilesFormRecord._init_map(self)
super(QuestionTextAndFilesMixin, self)._init_map() | python | def _init_map(self):
"""stub"""
QuestionTextFormRecord._init_map(self)
QuestionFilesFormRecord._init_map(self)
super(QuestionTextAndFilesMixin, self)._init_map() | [
"def",
"_init_map",
"(",
"self",
")",
":",
"QuestionTextFormRecord",
".",
"_init_map",
"(",
"self",
")",
"QuestionFilesFormRecord",
".",
"_init_map",
"(",
"self",
")",
"super",
"(",
"QuestionTextAndFilesMixin",
",",
"self",
")",
".",
"_init_map",
"(",
")"
] | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L179-L183 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | QuestionTextAndFilesMixin._init_metadata | def _init_metadata(self):
"""stub"""
QuestionTextFormRecord._init_metadata(self)
QuestionFilesFormRecord._init_metadata(self)
super(QuestionTextAndFilesMixin, self)._init_metadata() | python | def _init_metadata(self):
"""stub"""
QuestionTextFormRecord._init_metadata(self)
QuestionFilesFormRecord._init_metadata(self)
super(QuestionTextAndFilesMixin, self)._init_metadata() | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"QuestionTextFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"QuestionFilesFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"super",
"(",
"QuestionTextAndFilesMixin",
",",
"self",
")",
".",
"_init_metadata",... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L185-L189 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | QuestionTextsAndFilesMixin._init_map | def _init_map(self):
"""stub"""
QuestionTextsFormRecord._init_map(self)
QuestionFilesFormRecord._init_map(self)
super(QuestionTextsAndFilesMixin, self)._init_map() | python | def _init_map(self):
"""stub"""
QuestionTextsFormRecord._init_map(self)
QuestionFilesFormRecord._init_map(self)
super(QuestionTextsAndFilesMixin, self)._init_map() | [
"def",
"_init_map",
"(",
"self",
")",
":",
"QuestionTextsFormRecord",
".",
"_init_map",
"(",
"self",
")",
"QuestionFilesFormRecord",
".",
"_init_map",
"(",
"self",
")",
"super",
"(",
"QuestionTextsAndFilesMixin",
",",
"self",
")",
".",
"_init_map",
"(",
")"
] | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L198-L202 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | QuestionTextsAndFilesMixin._init_metadata | def _init_metadata(self):
"""stub"""
QuestionTextsFormRecord._init_metadata(self)
QuestionFilesFormRecord._init_metadata(self)
super(QuestionTextsAndFilesMixin, self)._init_metadata() | python | def _init_metadata(self):
"""stub"""
QuestionTextsFormRecord._init_metadata(self)
QuestionFilesFormRecord._init_metadata(self)
super(QuestionTextsAndFilesMixin, self)._init_metadata() | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"QuestionTextsFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"QuestionFilesFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"super",
"(",
"QuestionTextsAndFilesMixin",
",",
"self",
")",
".",
"_init_metadata... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L204-L208 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | TextAnswerFormRecord._init_map | def _init_map(self):
"""stub"""
super(TextAnswerFormRecord, self)._init_map()
self.my_osid_object_form._my_map['minStringLength'] = \
self._min_string_length_metadata['default_cardinal_values'][0]
self.my_osid_object_form._my_map['maxStringLength'] = \
self._max_s... | python | def _init_map(self):
"""stub"""
super(TextAnswerFormRecord, self)._init_map()
self.my_osid_object_form._my_map['minStringLength'] = \
self._min_string_length_metadata['default_cardinal_values'][0]
self.my_osid_object_form._my_map['maxStringLength'] = \
self._max_s... | [
"def",
"_init_map",
"(",
"self",
")",
":",
"super",
"(",
"TextAnswerFormRecord",
",",
"self",
")",
".",
"_init_map",
"(",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'minStringLength'",
"]",
"=",
"self",
".",
"_min_string_length_metadata",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L256-L262 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | TextAnswerFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(TextAnswerFormRecord, self)._init_metadata()
self._min_string_length_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'min-strin... | python | def _init_metadata(self):
"""stub"""
super(TextAnswerFormRecord, self)._init_metadata()
self._min_string_length_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'min-strin... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"TextAnswerFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"self",
".",
"_min_string_length_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L264-L298 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | TextAnswerFormRecord.clear_min_string_length | def clear_min_string_length(self):
"""stub"""
if (self.get_min_string_length_metadata().is_read_only() or
self.get_min_string_length_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['minStringLength'] = \
self.get_min_string_len... | python | def clear_min_string_length(self):
"""stub"""
if (self.get_min_string_length_metadata().is_read_only() or
self.get_min_string_length_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['minStringLength'] = \
self.get_min_string_len... | [
"def",
"clear_min_string_length",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_min_string_length_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_min_string_length_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L317-L323 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | TextAnswerFormRecord.clear_max_string_length | def clear_max_string_length(self):
"""stub"""
if (self.get_max_string_length_metadata().is_read_only() or
self.get_max_string_length_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['maxStringLength'] = \
self.get_max_string_len... | python | def clear_max_string_length(self):
"""stub"""
if (self.get_max_string_length_metadata().is_read_only() or
self.get_max_string_length_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['maxStringLength'] = \
self.get_max_string_len... | [
"def",
"clear_max_string_length",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_max_string_length_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_max_string_length_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L344-L350 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | TextsAnswerFormRecord._init_map | def _init_map(self):
"""stub"""
super(TextsAnswerFormRecord, self)._init_map()
self.my_osid_object_form._my_map['minStringLength'] = \
self._min_string_length_metadata['default_cardinal_values'][0]
self.my_osid_object_form._my_map['maxStringLength'] = \
self._max_... | python | def _init_map(self):
"""stub"""
super(TextsAnswerFormRecord, self)._init_map()
self.my_osid_object_form._my_map['minStringLength'] = \
self._min_string_length_metadata['default_cardinal_values'][0]
self.my_osid_object_form._my_map['maxStringLength'] = \
self._max_... | [
"def",
"_init_map",
"(",
"self",
")",
":",
"super",
"(",
"TextsAnswerFormRecord",
",",
"self",
")",
".",
"_init_map",
"(",
")",
"self",
".",
"my_osid_object_form",
".",
"_my_map",
"[",
"'minStringLength'",
"]",
"=",
"self",
".",
"_min_string_length_metadata",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L405-L411 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | TextsAnswerFormRecord.set_min_string_length | def set_min_string_length(self, length=None):
"""stub"""
if self.get_min_string_length_metadata().is_read_only():
raise NoAccess()
if not self.my_osid_object_form._is_valid_cardinal(
length,
self.get_min_string_length_metadata()):
raise Inv... | python | def set_min_string_length(self, length=None):
"""stub"""
if self.get_min_string_length_metadata().is_read_only():
raise NoAccess()
if not self.my_osid_object_form._is_valid_cardinal(
length,
self.get_min_string_length_metadata()):
raise Inv... | [
"def",
"set_min_string_length",
"(",
"self",
",",
"length",
"=",
"None",
")",
":",
"if",
"self",
".",
"get_min_string_length_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"my_osid_object_for... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L453-L465 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | TextsAnswerFormRecord.set_max_string_length | def set_max_string_length(self, length=None):
"""stub"""
if self.get_max_string_length_metadata().is_read_only():
raise NoAccess()
if not self.my_osid_object_form._is_valid_cardinal(
length,
self.get_max_string_length_metadata()):
raise Inv... | python | def set_max_string_length(self, length=None):
"""stub"""
if self.get_max_string_length_metadata().is_read_only():
raise NoAccess()
if not self.my_osid_object_form._is_valid_cardinal(
length,
self.get_max_string_length_metadata()):
raise Inv... | [
"def",
"set_max_string_length",
"(",
"self",
",",
"length",
"=",
"None",
")",
":",
"if",
"self",
".",
"get_max_string_length_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":",
"raise",
"NoAccess",
"(",
")",
"if",
"not",
"self",
".",
"my_osid_object_for... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L482-L494 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | AnswerTextAndFilesMixin._init_map | def _init_map(self):
"""stub"""
TextAnswerFormRecord._init_map(self)
FilesAnswerFormRecord._init_map(self)
super(AnswerTextAndFilesMixin, self)._init_map() | python | def _init_map(self):
"""stub"""
TextAnswerFormRecord._init_map(self)
FilesAnswerFormRecord._init_map(self)
super(AnswerTextAndFilesMixin, self)._init_map() | [
"def",
"_init_map",
"(",
"self",
")",
":",
"TextAnswerFormRecord",
".",
"_init_map",
"(",
"self",
")",
"FilesAnswerFormRecord",
".",
"_init_map",
"(",
"self",
")",
"super",
"(",
"AnswerTextAndFilesMixin",
",",
"self",
")",
".",
"_init_map",
"(",
")"
] | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L630-L634 |
mitsei/dlkit | dlkit/records/assessment/basic/simple_records.py | AnswerTextAndFilesMixin._init_metadata | def _init_metadata(self):
"""stub"""
TextAnswerFormRecord._init_metadata(self)
FilesAnswerFormRecord._init_metadata(self)
super(AnswerTextAndFilesMixin, self)._init_metadata() | python | def _init_metadata(self):
"""stub"""
TextAnswerFormRecord._init_metadata(self)
FilesAnswerFormRecord._init_metadata(self)
super(AnswerTextAndFilesMixin, self)._init_metadata() | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"TextAnswerFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"FilesAnswerFormRecord",
".",
"_init_metadata",
"(",
"self",
")",
"super",
"(",
"AnswerTextAndFilesMixin",
",",
"self",
")",
".",
"_init_metadata",
"("... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/basic/simple_records.py#L636-L640 |
mitsei/dlkit | dlkit/records/assessment/qti/ordered_choice_records.py | OrderedChoiceItemRecord.is_response_correct | def is_response_correct(self, response):
"""returns True if response evaluates to an Item Answer that is 100 percent correct"""
for answer in self.my_osid_object.get_answers():
if self._is_match(response, answer):
return True
return False | python | def is_response_correct(self, response):
"""returns True if response evaluates to an Item Answer that is 100 percent correct"""
for answer in self.my_osid_object.get_answers():
if self._is_match(response, answer):
return True
return False | [
"def",
"is_response_correct",
"(",
"self",
",",
"response",
")",
":",
"for",
"answer",
"in",
"self",
".",
"my_osid_object",
".",
"get_answers",
"(",
")",
":",
"if",
"self",
".",
"_is_match",
"(",
"response",
",",
"answer",
")",
":",
"return",
"True",
"re... | returns True if response evaluates to an Item Answer that is 100 percent correct | [
"returns",
"True",
"if",
"response",
"evaluates",
"to",
"an",
"Item",
"Answer",
"that",
"is",
"100",
"percent",
"correct"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/qti/ordered_choice_records.py#L40-L45 |
tommyod/streprogen | streprogen/day.py | Day.add_exercises | def add_exercises(self, *exercises):
"""Add the exercises to the day. The method will automatically infer
whether a static or dynamic exercise is passed to it.
Parameters
----------
*exercises
An unpacked tuple of exercises.
Examples
-------
... | python | def add_exercises(self, *exercises):
"""Add the exercises to the day. The method will automatically infer
whether a static or dynamic exercise is passed to it.
Parameters
----------
*exercises
An unpacked tuple of exercises.
Examples
-------
... | [
"def",
"add_exercises",
"(",
"self",
",",
"*",
"exercises",
")",
":",
"for",
"exercise",
"in",
"list",
"(",
"exercises",
")",
":",
"if",
"isinstance",
"(",
"exercise",
",",
"DynamicExercise",
")",
":",
"self",
".",
"dynamic_exercises",
".",
"append",
"(",
... | Add the exercises to the day. The method will automatically infer
whether a static or dynamic exercise is passed to it.
Parameters
----------
*exercises
An unpacked tuple of exercises.
Examples
-------
>>> monday = Day(name = 'Monday')
>>> c... | [
"Add",
"the",
"exercises",
"to",
"the",
"day",
".",
"The",
"method",
"will",
"automatically",
"infer",
"whether",
"a",
"static",
"or",
"dynamic",
"exercise",
"is",
"passed",
"to",
"it",
"."
] | train | https://github.com/tommyod/streprogen/blob/21b903618e8b2d398bceb394d18d7c74ca984def/streprogen/day.py#L47-L73 |
ilgarm/pyzimbra | pyzimbra/soap_soappy.py | parseSOAP | def parseSOAP(xml_str, rules = None):
"""
Replacement for SOAPpy._parseSOAP method to spoof SOAPParser.
"""
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
parser = xml.sax.make_parser()
t = ZimbraSOAPParser(rules = rules)
parser.set... | python | def parseSOAP(xml_str, rules = None):
"""
Replacement for SOAPpy._parseSOAP method to spoof SOAPParser.
"""
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
parser = xml.sax.make_parser()
t = ZimbraSOAPParser(rules = rules)
parser.set... | [
"def",
"parseSOAP",
"(",
"xml_str",
",",
"rules",
"=",
"None",
")",
":",
"try",
":",
"from",
"cStringIO",
"import",
"StringIO",
"except",
"ImportError",
":",
"from",
"StringIO",
"import",
"StringIO",
"parser",
"=",
"xml",
".",
"sax",
".",
"make_parser",
"(... | Replacement for SOAPpy._parseSOAP method to spoof SOAPParser. | [
"Replacement",
"for",
"SOAPpy",
".",
"_parseSOAP",
"method",
"to",
"spoof",
"SOAPParser",
"."
] | train | https://github.com/ilgarm/pyzimbra/blob/c397bc7497554d260ec6fd1a80405aed872a70cc/pyzimbra/soap_soappy.py#L54-L81 |
ilgarm/pyzimbra | pyzimbra/soap_soappy.py | SoapHttpTransport.build_opener | def build_opener(self):
"""
Builds url opener, initializing proxy.
@return: OpenerDirector
"""
http_handler = urllib2.HTTPHandler() # debuglevel=self.transport.debug
if util.empty(self.transport.proxy_url):
return urllib2.build_opener(http_handler)
p... | python | def build_opener(self):
"""
Builds url opener, initializing proxy.
@return: OpenerDirector
"""
http_handler = urllib2.HTTPHandler() # debuglevel=self.transport.debug
if util.empty(self.transport.proxy_url):
return urllib2.build_opener(http_handler)
p... | [
"def",
"build_opener",
"(",
"self",
")",
":",
"http_handler",
"=",
"urllib2",
".",
"HTTPHandler",
"(",
")",
"# debuglevel=self.transport.debug",
"if",
"util",
".",
"empty",
"(",
"self",
".",
"transport",
".",
"proxy_url",
")",
":",
"return",
"urllib2",
".",
... | Builds url opener, initializing proxy.
@return: OpenerDirector | [
"Builds",
"url",
"opener",
"initializing",
"proxy",
"."
] | train | https://github.com/ilgarm/pyzimbra/blob/c397bc7497554d260ec6fd1a80405aed872a70cc/pyzimbra/soap_soappy.py#L138-L151 |
ilgarm/pyzimbra | pyzimbra/soap_soappy.py | SoapHttpTransport.init_soap_exception | def init_soap_exception(self, exc):
"""
Initializes exception based on soap error response.
@param exc: URLError
@return: SoapException
"""
if not isinstance(exc, urllib2.HTTPError):
return SoapException(unicode(exc), exc)
if isinstance(exc, urllib2.H... | python | def init_soap_exception(self, exc):
"""
Initializes exception based on soap error response.
@param exc: URLError
@return: SoapException
"""
if not isinstance(exc, urllib2.HTTPError):
return SoapException(unicode(exc), exc)
if isinstance(exc, urllib2.H... | [
"def",
"init_soap_exception",
"(",
"self",
",",
"exc",
")",
":",
"if",
"not",
"isinstance",
"(",
"exc",
",",
"urllib2",
".",
"HTTPError",
")",
":",
"return",
"SoapException",
"(",
"unicode",
"(",
"exc",
")",
",",
"exc",
")",
"if",
"isinstance",
"(",
"e... | Initializes exception based on soap error response.
@param exc: URLError
@return: SoapException | [
"Initializes",
"exception",
"based",
"on",
"soap",
"error",
"response",
"."
] | train | https://github.com/ilgarm/pyzimbra/blob/c397bc7497554d260ec6fd1a80405aed872a70cc/pyzimbra/soap_soappy.py#L154-L177 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | FirstAngleProjectionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
self._first_angle_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'first_angle'),
'element_label': 'First Angle',
'in... | python | def _init_metadata(self):
"""stub"""
self._first_angle_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'first_angle'),
'element_label': 'First Angle',
'in... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"self",
".",
"_first_angle_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",
".",
"_authority",
",",
"self",
".",
"my_osid_object_form",
".",
"_namespace",
",",
"'first_angle'... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L60-L74 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | FirstAngleProjectionFormRecord.set_first_angle_projection | def set_first_angle_projection(self, value=None):
"""stub"""
if value is None:
raise NullArgument()
if self.get_first_angle_projection_metadata().is_read_only():
raise NoAccess()
if not self.my_osid_object_form._is_valid_boolean(value):
raise InvalidAr... | python | def set_first_angle_projection(self, value=None):
"""stub"""
if value is None:
raise NullArgument()
if self.get_first_angle_projection_metadata().is_read_only():
raise NoAccess()
if not self.my_osid_object_form._is_valid_boolean(value):
raise InvalidAr... | [
"def",
"set_first_angle_projection",
"(",
"self",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"if",
"self",
".",
"get_first_angle_projection_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
":"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L80-L88 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | FirstAngleProjectionFormRecord.clear_first_angle_projection | def clear_first_angle_projection(self):
"""stub"""
if (self.get_first_angle_projection_metadata().is_read_only() or
self.get_first_angle_projection_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['firstAngle'] = \
self._first_a... | python | def clear_first_angle_projection(self):
"""stub"""
if (self.get_first_angle_projection_metadata().is_read_only() or
self.get_first_angle_projection_metadata().is_required()):
raise NoAccess()
self.my_osid_object_form._my_map['firstAngle'] = \
self._first_a... | [
"def",
"clear_first_angle_projection",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_first_angle_projection_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_first_angle_projection_metadata",
"(",
")",
".",
"is_required",
"(",
")",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L90-L96 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | BaseOrthoQuestionFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(BaseOrthoQuestionFormRecord, self)._init_metadata()
self._ortho_view_set_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'ortho... | python | def _init_metadata(self):
"""stub"""
super(BaseOrthoQuestionFormRecord, self)._init_metadata()
self._ortho_view_set_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'ortho... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"BaseOrthoQuestionFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"self",
".",
"_ortho_view_set_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form",... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L210-L226 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | BaseOrthoQuestionFormRecord.set_manip | def set_manip(self, manipulatable):
"""stub"""
if not isinstance(manipulatable, DataInputStream):
raise InvalidArgument('Manipulatable object be an ' +
'osid.transport.DataInputStream object')
self.add_file(manipulatable,
label=... | python | def set_manip(self, manipulatable):
"""stub"""
if not isinstance(manipulatable, DataInputStream):
raise InvalidArgument('Manipulatable object be an ' +
'osid.transport.DataInputStream object')
self.add_file(manipulatable,
label=... | [
"def",
"set_manip",
"(",
"self",
",",
"manipulatable",
")",
":",
"if",
"not",
"isinstance",
"(",
"manipulatable",
",",
"DataInputStream",
")",
":",
"raise",
"InvalidArgument",
"(",
"'Manipulatable object be an '",
"+",
"'osid.transport.DataInputStream object'",
")",
"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L232-L240 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | BaseOrthoQuestionFormRecord.set_ortho_view_set | def set_ortho_view_set(self, front_view, side_view, top_view):
"""stub"""
if (not isinstance(front_view, DataInputStream) or
not isinstance(top_view, DataInputStream) or
not isinstance(side_view, DataInputStream)):
raise InvalidArgument('views must be osid.tra... | python | def set_ortho_view_set(self, front_view, side_view, top_view):
"""stub"""
if (not isinstance(front_view, DataInputStream) or
not isinstance(top_view, DataInputStream) or
not isinstance(side_view, DataInputStream)):
raise InvalidArgument('views must be osid.tra... | [
"def",
"set_ortho_view_set",
"(",
"self",
",",
"front_view",
",",
"side_view",
",",
"top_view",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"front_view",
",",
"DataInputStream",
")",
"or",
"not",
"isinstance",
"(",
"top_view",
",",
"DataInputStream",
")",
... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L258-L275 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | BaseOrthoQuestionFormRecord.clear_ortho_view_set | def clear_ortho_view_set(self):
"""stub"""
if (self.get_ortho_view_set_metadata().is_read_only() or
self.get_ortho_view_set_metadata().is_required()):
raise NoAccess()
self.clear_file('frontView')
self.clear_file('sideView')
self.clear_file('topView') | python | def clear_ortho_view_set(self):
"""stub"""
if (self.get_ortho_view_set_metadata().is_read_only() or
self.get_ortho_view_set_metadata().is_required()):
raise NoAccess()
self.clear_file('frontView')
self.clear_file('sideView')
self.clear_file('topView') | [
"def",
"clear_ortho_view_set",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_ortho_view_set_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_ortho_view_set_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L277-L284 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | BaseOrthoQuestionFormRecord.set_ovs_view | def set_ovs_view(self, asset_data, view_name):
"""
view_name should be frontView, sideView, or topView
"""
if not isinstance(asset_data, DataInputStream):
raise InvalidArgument('view file must be an ' +
'osid.transport.DataInputStream object'... | python | def set_ovs_view(self, asset_data, view_name):
"""
view_name should be frontView, sideView, or topView
"""
if not isinstance(asset_data, DataInputStream):
raise InvalidArgument('view file must be an ' +
'osid.transport.DataInputStream object'... | [
"def",
"set_ovs_view",
"(",
"self",
",",
"asset_data",
",",
"view_name",
")",
":",
"if",
"not",
"isinstance",
"(",
"asset_data",
",",
"DataInputStream",
")",
":",
"raise",
"InvalidArgument",
"(",
"'view file must be an '",
"+",
"'osid.transport.DataInputStream object'... | view_name should be frontView, sideView, or topView | [
"view_name",
"should",
"be",
"frontView",
"sideView",
"or",
"topView"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L286-L299 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | LabelOrthoFacesAnswerFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(LabelOrthoFacesAnswerFormRecord, self)._init_metadata()
self._face_values_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'face... | python | def _init_metadata(self):
"""stub"""
super(LabelOrthoFacesAnswerFormRecord, self)._init_metadata()
self._face_values_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'face... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"LabelOrthoFacesAnswerFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"self",
".",
"_face_values_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L462-L478 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | LabelOrthoFacesAnswerFormRecord.set_face_values | def set_face_values(self, front_face_value, side_face_value, top_face_value):
"""stub"""
if front_face_value is None or side_face_value is None or top_face_value is None:
raise NullArgument()
self.add_integer_value(value=int(front_face_value), label='frontFaceValue')
self.add... | python | def set_face_values(self, front_face_value, side_face_value, top_face_value):
"""stub"""
if front_face_value is None or side_face_value is None or top_face_value is None:
raise NullArgument()
self.add_integer_value(value=int(front_face_value), label='frontFaceValue')
self.add... | [
"def",
"set_face_values",
"(",
"self",
",",
"front_face_value",
",",
"side_face_value",
",",
"top_face_value",
")",
":",
"if",
"front_face_value",
"is",
"None",
"or",
"side_face_value",
"is",
"None",
"or",
"top_face_value",
"is",
"None",
":",
"raise",
"NullArgumen... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L484-L490 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | LabelOrthoFacesAnswerFormRecord.clear_face_values | def clear_face_values(self):
"""stub"""
if (self.get_face_values_metadata().is_read_only() or
self.get_face_values_metadata().is_required()):
raise NoAccess()
self.clear_integer_value('frontFaceValue')
self.clear_integer_value('sideFaceValue')
self.cle... | python | def clear_face_values(self):
"""stub"""
if (self.get_face_values_metadata().is_read_only() or
self.get_face_values_metadata().is_required()):
raise NoAccess()
self.clear_integer_value('frontFaceValue')
self.clear_integer_value('sideFaceValue')
self.cle... | [
"def",
"clear_face_values",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_face_values_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_face_values_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":",
"raise",
"NoAcc... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L492-L499 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | EulerRotationAnswerFormRecord._init_metadata | def _init_metadata(self):
"""stub"""
super(EulerRotationAnswerFormRecord, self)._init_metadata()
self._euler_rotation_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'ang... | python | def _init_metadata(self):
"""stub"""
super(EulerRotationAnswerFormRecord, self)._init_metadata()
self._euler_rotation_metadata = {
'element_id': Id(self.my_osid_object_form._authority,
self.my_osid_object_form._namespace,
'ang... | [
"def",
"_init_metadata",
"(",
"self",
")",
":",
"super",
"(",
"EulerRotationAnswerFormRecord",
",",
"self",
")",
".",
"_init_metadata",
"(",
")",
"self",
".",
"_euler_rotation_metadata",
"=",
"{",
"'element_id'",
":",
"Id",
"(",
"self",
".",
"my_osid_object_form... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L566-L582 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | EulerRotationAnswerFormRecord.set_euler_angle_values | def set_euler_angle_values(self, x_angle, y_angle, z_angle):
"""stub"""
if x_angle is None or y_angle is None or z_angle is None:
raise NullArgument()
self.add_integer_value(value=x_angle, label='xAngle')
self.add_integer_value(value=y_angle, label='yAngle')
self.add_... | python | def set_euler_angle_values(self, x_angle, y_angle, z_angle):
"""stub"""
if x_angle is None or y_angle is None or z_angle is None:
raise NullArgument()
self.add_integer_value(value=x_angle, label='xAngle')
self.add_integer_value(value=y_angle, label='yAngle')
self.add_... | [
"def",
"set_euler_angle_values",
"(",
"self",
",",
"x_angle",
",",
"y_angle",
",",
"z_angle",
")",
":",
"if",
"x_angle",
"is",
"None",
"or",
"y_angle",
"is",
"None",
"or",
"z_angle",
"is",
"None",
":",
"raise",
"NullArgument",
"(",
")",
"self",
".",
"add... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L588-L594 |
mitsei/dlkit | dlkit/records/assessment/orthographic_visualization/orthographic_records.py | EulerRotationAnswerFormRecord.clear_angle_values | def clear_angle_values(self):
"""stub"""
if (self.get_euler_rotation_values_metadata().is_read_only() or
self.get_euler_rotation_values_metadata().is_required()):
raise NoAccess()
self.clear_integer_value('xAngle')
self.clear_integer_value('yAngle')
se... | python | def clear_angle_values(self):
"""stub"""
if (self.get_euler_rotation_values_metadata().is_read_only() or
self.get_euler_rotation_values_metadata().is_required()):
raise NoAccess()
self.clear_integer_value('xAngle')
self.clear_integer_value('yAngle')
se... | [
"def",
"clear_angle_values",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"get_euler_rotation_values_metadata",
"(",
")",
".",
"is_read_only",
"(",
")",
"or",
"self",
".",
"get_euler_rotation_values_metadata",
"(",
")",
".",
"is_required",
"(",
")",
")",
":"... | stub | [
"stub"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/records/assessment/orthographic_visualization/orthographic_records.py#L596-L603 |
mitsei/dlkit | dlkit/json_/learning/objective_types.py | get_type_data | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
try:
return {
'authority': 'birdland.mit.edu',
'namespace': 'Genus Types',
'identifier': name,
'domain': 'Generic ... | python | def get_type_data(name):
"""Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type
"""
try:
return {
'authority': 'birdland.mit.edu',
'namespace': 'Genus Types',
'identifier': name,
'domain': 'Generic ... | [
"def",
"get_type_data",
"(",
"name",
")",
":",
"try",
":",
"return",
"{",
"'authority'",
":",
"'birdland.mit.edu'",
",",
"'namespace'",
":",
"'Genus Types'",
",",
"'identifier'",
":",
"name",
",",
"'domain'",
":",
"'Generic Types'",
",",
"'display_name'",
":",
... | Return dictionary representation of type.
Can be used to initialize primordium.type.primitives.Type | [
"Return",
"dictionary",
"representation",
"of",
"type",
"."
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/json_/learning/objective_types.py#L15-L33 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager._set_gradebook_view | def _set_gradebook_view(self, session):
"""Sets the underlying gradebook view to match current view"""
if self._gradebook_view == COMPARATIVE:
try:
session.use_comparative_gradebook_view()
except AttributeError:
pass
else:
try:
... | python | def _set_gradebook_view(self, session):
"""Sets the underlying gradebook view to match current view"""
if self._gradebook_view == COMPARATIVE:
try:
session.use_comparative_gradebook_view()
except AttributeError:
pass
else:
try:
... | [
"def",
"_set_gradebook_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_gradebook_view",
"==",
"COMPARATIVE",
":",
"try",
":",
"session",
".",
"use_comparative_gradebook_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
"... | Sets the underlying gradebook view to match current view | [
"Sets",
"the",
"underlying",
"gradebook",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L236-L247 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager._get_provider_session | def _get_provider_session(self, session_name, proxy=None):
"""Gets the session for the provider"""
agent_key = self._get_agent_key(proxy)
if session_name in self._provider_sessions[agent_key]:
return self._provider_sessions[agent_key][session_name]
else:
session =... | python | def _get_provider_session(self, session_name, proxy=None):
"""Gets the session for the provider"""
agent_key = self._get_agent_key(proxy)
if session_name in self._provider_sessions[agent_key]:
return self._provider_sessions[agent_key][session_name]
else:
session =... | [
"def",
"_get_provider_session",
"(",
"self",
",",
"session_name",
",",
"proxy",
"=",
"None",
")",
":",
"agent_key",
"=",
"self",
".",
"_get_agent_key",
"(",
"proxy",
")",
"if",
"session_name",
"in",
"self",
".",
"_provider_sessions",
"[",
"agent_key",
"]",
"... | Gets the session for the provider | [
"Gets",
"the",
"session",
"for",
"the",
"provider"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L249-L259 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager.use_comparative_gradebook_view | def use_comparative_gradebook_view(self):
"""Pass through to provider GradeSystemGradebookSession.use_comparative_gradebook_view"""
self._gradebook_view = COMPARATIVE
# self._get_provider_session('grade_system_gradebook_session') # To make sure the session is tracked
for session in self.... | python | def use_comparative_gradebook_view(self):
"""Pass through to provider GradeSystemGradebookSession.use_comparative_gradebook_view"""
self._gradebook_view = COMPARATIVE
# self._get_provider_session('grade_system_gradebook_session') # To make sure the session is tracked
for session in self.... | [
"def",
"use_comparative_gradebook_view",
"(",
"self",
")",
":",
"self",
".",
"_gradebook_view",
"=",
"COMPARATIVE",
"# self._get_provider_session('grade_system_gradebook_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",... | Pass through to provider GradeSystemGradebookSession.use_comparative_gradebook_view | [
"Pass",
"through",
"to",
"provider",
"GradeSystemGradebookSession",
".",
"use_comparative_gradebook_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L558-L566 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager.use_plenary_gradebook_view | def use_plenary_gradebook_view(self):
"""Pass through to provider GradeSystemGradebookSession.use_plenary_gradebook_view"""
self._gradebook_view = PLENARY
# self._get_provider_session('grade_system_gradebook_session') # To make sure the session is tracked
for session in self._get_provide... | python | def use_plenary_gradebook_view(self):
"""Pass through to provider GradeSystemGradebookSession.use_plenary_gradebook_view"""
self._gradebook_view = PLENARY
# self._get_provider_session('grade_system_gradebook_session') # To make sure the session is tracked
for session in self._get_provide... | [
"def",
"use_plenary_gradebook_view",
"(",
"self",
")",
":",
"self",
".",
"_gradebook_view",
"=",
"PLENARY",
"# self._get_provider_session('grade_system_gradebook_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
... | Pass through to provider GradeSystemGradebookSession.use_plenary_gradebook_view | [
"Pass",
"through",
"to",
"provider",
"GradeSystemGradebookSession",
".",
"use_plenary_gradebook_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L568-L576 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager.get_gradebooks_by_parent_genus_type | def get_gradebooks_by_parent_genus_type(self, *args, **kwargs):
"""Pass through to provider GradebookLookupSession.get_gradebooks_by_parent_genus_type"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_by_parent_genus_type
catalogs = self._get_provider... | python | def get_gradebooks_by_parent_genus_type(self, *args, **kwargs):
"""Pass through to provider GradebookLookupSession.get_gradebooks_by_parent_genus_type"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_by_parent_genus_type
catalogs = self._get_provider... | [
"def",
"get_gradebooks_by_parent_genus_type",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinLookupSession.get_bins_by_parent_genus_type",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
... | Pass through to provider GradebookLookupSession.get_gradebooks_by_parent_genus_type | [
"Pass",
"through",
"to",
"provider",
"GradebookLookupSession",
".",
"get_gradebooks_by_parent_genus_type"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L780-L788 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager.get_gradebooks | def get_gradebooks(self):
"""Pass through to provider GradebookLookupSession.get_gradebooks"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('gradebook_lookup_session').get_gradebooks()
cat_list ... | python | def get_gradebooks(self):
"""Pass through to provider GradebookLookupSession.get_gradebooks"""
# Implemented from kitosid template for -
# osid.resource.BinLookupSession.get_bins_template
catalogs = self._get_provider_session('gradebook_lookup_session').get_gradebooks()
cat_list ... | [
"def",
"get_gradebooks",
"(",
"self",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinLookupSession.get_bins_template",
"catalogs",
"=",
"self",
".",
"_get_provider_session",
"(",
"'gradebook_lookup_session'",
")",
".",
"get_gradebooks",
"(",
")",
"... | Pass through to provider GradebookLookupSession.get_gradebooks | [
"Pass",
"through",
"to",
"provider",
"GradebookLookupSession",
".",
"get_gradebooks"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L810-L818 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager.get_gradebook_form | def get_gradebook_form(self, *args, **kwargs):
"""Pass through to provider GradebookAdminSession.get_gradebook_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will tel... | python | def get_gradebook_form(self, *args, **kwargs):
"""Pass through to provider GradebookAdminSession.get_gradebook_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.get_bin_form_for_update_template
# This method might be a bit sketchy. Time will tel... | [
"def",
"get_gradebook_form",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.get_bin_form_for_update_template",
"# This method might be a bit sketchy. Time will tell.",
"if",
"isinstance... | Pass through to provider GradebookAdminSession.get_gradebook_form_for_update | [
"Pass",
"through",
"to",
"provider",
"GradebookAdminSession",
".",
"get_gradebook_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L864-L872 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager.update_gradebook | def update_gradebook(self, *args, **kwargs):
"""Pass through to provider GradebookAdminSession.update_gradebook"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
# OSID spec does not require returning updated catalog
return Gradebook(
... | python | def update_gradebook(self, *args, **kwargs):
"""Pass through to provider GradebookAdminSession.update_gradebook"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
# OSID spec does not require returning updated catalog
return Gradebook(
... | [
"def",
"update_gradebook",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.update_bin",
"# OSID spec does not require returning updated catalog",
"return",
"Gradebook",
"(",
"self",
... | Pass through to provider GradebookAdminSession.update_gradebook | [
"Pass",
"through",
"to",
"provider",
"GradebookAdminSession",
".",
"update_gradebook"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L874-L883 |
mitsei/dlkit | dlkit/services/grading.py | GradingManager.save_gradebook | def save_gradebook(self, gradebook_form, *args, **kwargs):
"""Pass through to provider GradebookAdminSession.update_gradebook"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if gradebook_form.is_for_update():
return self.update_gradeboo... | python | def save_gradebook(self, gradebook_form, *args, **kwargs):
"""Pass through to provider GradebookAdminSession.update_gradebook"""
# Implemented from kitosid template for -
# osid.resource.BinAdminSession.update_bin
if gradebook_form.is_for_update():
return self.update_gradeboo... | [
"def",
"save_gradebook",
"(",
"self",
",",
"gradebook_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.BinAdminSession.update_bin",
"if",
"gradebook_form",
".",
"is_for_update",
"(",
")",
":",
"r... | Pass through to provider GradebookAdminSession.update_gradebook | [
"Pass",
"through",
"to",
"provider",
"GradebookAdminSession",
".",
"update_gradebook"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L885-L892 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook._set_gradebook_view | def _set_gradebook_view(self, session):
"""Sets the underlying gradebook view to match current view"""
if self._gradebook_view == FEDERATED:
try:
session.use_federated_gradebook_view()
except AttributeError:
pass
else:
try:
... | python | def _set_gradebook_view(self, session):
"""Sets the underlying gradebook view to match current view"""
if self._gradebook_view == FEDERATED:
try:
session.use_federated_gradebook_view()
except AttributeError:
pass
else:
try:
... | [
"def",
"_set_gradebook_view",
"(",
"self",
",",
"session",
")",
":",
"if",
"self",
".",
"_gradebook_view",
"==",
"FEDERATED",
":",
"try",
":",
"session",
".",
"use_federated_gradebook_view",
"(",
")",
"except",
"AttributeError",
":",
"pass",
"else",
":",
"try"... | Sets the underlying gradebook view to match current view | [
"Sets",
"the",
"underlying",
"gradebook",
"view",
"to",
"match",
"current",
"view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1246-L1257 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_comparative_grade_system_view | def use_comparative_grade_system_view(self):
"""Pass through to provider GradeSystemLookupSession.use_comparative_grade_system_view"""
self._object_views['grade_system'] = COMPARATIVE
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for se... | python | def use_comparative_grade_system_view(self):
"""Pass through to provider GradeSystemLookupSession.use_comparative_grade_system_view"""
self._object_views['grade_system'] = COMPARATIVE
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for se... | [
"def",
"use_comparative_grade_system_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'grade_system'",
"]",
"=",
"COMPARATIVE",
"# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
... | Pass through to provider GradeSystemLookupSession.use_comparative_grade_system_view | [
"Pass",
"through",
"to",
"provider",
"GradeSystemLookupSession",
".",
"use_comparative_grade_system_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1381-L1389 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_plenary_grade_system_view | def use_plenary_grade_system_view(self):
"""Pass through to provider GradeSystemLookupSession.use_plenary_grade_system_view"""
self._object_views['grade_system'] = PLENARY
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for session in sel... | python | def use_plenary_grade_system_view(self):
"""Pass through to provider GradeSystemLookupSession.use_plenary_grade_system_view"""
self._object_views['grade_system'] = PLENARY
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for session in sel... | [
"def",
"use_plenary_grade_system_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'grade_system'",
"]",
"=",
"PLENARY",
"# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"... | Pass through to provider GradeSystemLookupSession.use_plenary_grade_system_view | [
"Pass",
"through",
"to",
"provider",
"GradeSystemLookupSession",
".",
"use_plenary_grade_system_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1391-L1399 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_federated_gradebook_view | def use_federated_gradebook_view(self):
"""Pass through to provider GradeSystemLookupSession.use_federated_gradebook_view"""
self._gradebook_view = FEDERATED
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for session in self._get_provide... | python | def use_federated_gradebook_view(self):
"""Pass through to provider GradeSystemLookupSession.use_federated_gradebook_view"""
self._gradebook_view = FEDERATED
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for session in self._get_provide... | [
"def",
"use_federated_gradebook_view",
"(",
"self",
")",
":",
"self",
".",
"_gradebook_view",
"=",
"FEDERATED",
"# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",... | Pass through to provider GradeSystemLookupSession.use_federated_gradebook_view | [
"Pass",
"through",
"to",
"provider",
"GradeSystemLookupSession",
".",
"use_federated_gradebook_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1401-L1409 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_isolated_gradebook_view | def use_isolated_gradebook_view(self):
"""Pass through to provider GradeSystemLookupSession.use_isolated_gradebook_view"""
self._gradebook_view = ISOLATED
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for session in self._get_provider_s... | python | def use_isolated_gradebook_view(self):
"""Pass through to provider GradeSystemLookupSession.use_isolated_gradebook_view"""
self._gradebook_view = ISOLATED
# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked
for session in self._get_provider_s... | [
"def",
"use_isolated_gradebook_view",
"(",
"self",
")",
":",
"self",
".",
"_gradebook_view",
"=",
"ISOLATED",
"# self._get_provider_session('grade_system_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_get_provider_sessions",
"(",
... | Pass through to provider GradeSystemLookupSession.use_isolated_gradebook_view | [
"Pass",
"through",
"to",
"provider",
"GradeSystemLookupSession",
".",
"use_isolated_gradebook_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1411-L1419 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.get_grade_system_form | def get_grade_system_form(self, *args, **kwargs):
"""Pass through to provider GradeSystemAdminSession.get_grade_system_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time... | python | def get_grade_system_form(self, *args, **kwargs):
"""Pass through to provider GradeSystemAdminSession.get_grade_system_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time... | [
"def",
"get_grade_system_form",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.get_resource_form_for_update",
"# This method might be a bit sketchy. Time will tell.",
"if",
"isinst... | Pass through to provider GradeSystemAdminSession.get_grade_system_form_for_update | [
"Pass",
"through",
"to",
"provider",
"GradeSystemAdminSession",
".",
"get_grade_system_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1523-L1531 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.save_grade_system | def save_grade_system(self, grade_system_form, *args, **kwargs):
"""Pass through to provider GradeSystemAdminSession.update_grade_system"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if grade_system_form.is_for_update():
ret... | python | def save_grade_system(self, grade_system_form, *args, **kwargs):
"""Pass through to provider GradeSystemAdminSession.update_grade_system"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if grade_system_form.is_for_update():
ret... | [
"def",
"save_grade_system",
"(",
"self",
",",
"grade_system_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.update_resource",
"if",
"grade_system_form",
".",
"is_for_update",
"(",... | Pass through to provider GradeSystemAdminSession.update_grade_system | [
"Pass",
"through",
"to",
"provider",
"GradeSystemAdminSession",
".",
"update_grade_system"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1545-L1552 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_comparative_grade_entry_view | def use_comparative_grade_entry_view(self):
"""Pass through to provider GradeEntryLookupSession.use_comparative_grade_entry_view"""
self._object_views['grade_entry'] = COMPARATIVE
# self._get_provider_session('grade_entry_lookup_session') # To make sure the session is tracked
for session... | python | def use_comparative_grade_entry_view(self):
"""Pass through to provider GradeEntryLookupSession.use_comparative_grade_entry_view"""
self._object_views['grade_entry'] = COMPARATIVE
# self._get_provider_session('grade_entry_lookup_session') # To make sure the session is tracked
for session... | [
"def",
"use_comparative_grade_entry_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'grade_entry'",
"]",
"=",
"COMPARATIVE",
"# self._get_provider_session('grade_entry_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
"."... | Pass through to provider GradeEntryLookupSession.use_comparative_grade_entry_view | [
"Pass",
"through",
"to",
"provider",
"GradeEntryLookupSession",
".",
"use_comparative_grade_entry_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1650-L1658 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_plenary_grade_entry_view | def use_plenary_grade_entry_view(self):
"""Pass through to provider GradeEntryLookupSession.use_plenary_grade_entry_view"""
self._object_views['grade_entry'] = PLENARY
# self._get_provider_session('grade_entry_lookup_session') # To make sure the session is tracked
for session in self._ge... | python | def use_plenary_grade_entry_view(self):
"""Pass through to provider GradeEntryLookupSession.use_plenary_grade_entry_view"""
self._object_views['grade_entry'] = PLENARY
# self._get_provider_session('grade_entry_lookup_session') # To make sure the session is tracked
for session in self._ge... | [
"def",
"use_plenary_grade_entry_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'grade_entry'",
"]",
"=",
"PLENARY",
"# self._get_provider_session('grade_entry_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self",
".",
"_ge... | Pass through to provider GradeEntryLookupSession.use_plenary_grade_entry_view | [
"Pass",
"through",
"to",
"provider",
"GradeEntryLookupSession",
".",
"use_plenary_grade_entry_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1660-L1668 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.get_grade_entry_form | def get_grade_entry_form(self, *args, **kwargs):
"""Pass through to provider GradeEntryAdminSession.get_grade_entry_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time wi... | python | def get_grade_entry_form(self, *args, **kwargs):
"""Pass through to provider GradeEntryAdminSession.get_grade_entry_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit sketchy. Time wi... | [
"def",
"get_grade_entry_form",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.get_resource_form_for_update",
"# This method might be a bit sketchy. Time will tell.",
"if",
"isinsta... | Pass through to provider GradeEntryAdminSession.get_grade_entry_form_for_update | [
"Pass",
"through",
"to",
"provider",
"GradeEntryAdminSession",
".",
"get_grade_entry_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1824-L1832 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.save_grade_entry | def save_grade_entry(self, grade_entry_form, *args, **kwargs):
"""Pass through to provider GradeEntryAdminSession.update_grade_entry"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if grade_entry_form.is_for_update():
return s... | python | def save_grade_entry(self, grade_entry_form, *args, **kwargs):
"""Pass through to provider GradeEntryAdminSession.update_grade_entry"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if grade_entry_form.is_for_update():
return s... | [
"def",
"save_grade_entry",
"(",
"self",
",",
"grade_entry_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.update_resource",
"if",
"grade_entry_form",
".",
"is_for_update",
"(",
... | Pass through to provider GradeEntryAdminSession.update_grade_entry | [
"Pass",
"through",
"to",
"provider",
"GradeEntryAdminSession",
".",
"update_grade_entry"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1846-L1853 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_comparative_gradebook_column_view | def use_comparative_gradebook_column_view(self):
"""Pass through to provider GradebookColumnLookupSession.use_comparative_gradebook_column_view"""
self._object_views['gradebook_column'] = COMPARATIVE
# self._get_provider_session('gradebook_column_lookup_session') # To make sure the session is tr... | python | def use_comparative_gradebook_column_view(self):
"""Pass through to provider GradebookColumnLookupSession.use_comparative_gradebook_column_view"""
self._object_views['gradebook_column'] = COMPARATIVE
# self._get_provider_session('gradebook_column_lookup_session') # To make sure the session is tr... | [
"def",
"use_comparative_gradebook_column_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'gradebook_column'",
"]",
"=",
"COMPARATIVE",
"# self._get_provider_session('gradebook_column_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
... | Pass through to provider GradebookColumnLookupSession.use_comparative_gradebook_column_view | [
"Pass",
"through",
"to",
"provider",
"GradebookColumnLookupSession",
".",
"use_comparative_gradebook_column_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1887-L1895 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.use_plenary_gradebook_column_view | def use_plenary_gradebook_column_view(self):
"""Pass through to provider GradebookColumnLookupSession.use_plenary_gradebook_column_view"""
self._object_views['gradebook_column'] = PLENARY
# self._get_provider_session('gradebook_column_lookup_session') # To make sure the session is tracked
... | python | def use_plenary_gradebook_column_view(self):
"""Pass through to provider GradebookColumnLookupSession.use_plenary_gradebook_column_view"""
self._object_views['gradebook_column'] = PLENARY
# self._get_provider_session('gradebook_column_lookup_session') # To make sure the session is tracked
... | [
"def",
"use_plenary_gradebook_column_view",
"(",
"self",
")",
":",
"self",
".",
"_object_views",
"[",
"'gradebook_column'",
"]",
"=",
"PLENARY",
"# self._get_provider_session('gradebook_column_lookup_session') # To make sure the session is tracked",
"for",
"session",
"in",
"self"... | Pass through to provider GradebookColumnLookupSession.use_plenary_gradebook_column_view | [
"Pass",
"through",
"to",
"provider",
"GradebookColumnLookupSession",
".",
"use_plenary_gradebook_column_view"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L1897-L1905 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.get_gradebook_column_form | def get_gradebook_column_form(self, *args, **kwargs):
"""Pass through to provider GradebookColumnAdminSession.get_gradebook_column_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit s... | python | def get_gradebook_column_form(self, *args, **kwargs):
"""Pass through to provider GradebookColumnAdminSession.get_gradebook_column_form_for_update"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.get_resource_form_for_update
# This method might be a bit s... | [
"def",
"get_gradebook_column_form",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.get_resource_form_for_update",
"# This method might be a bit sketchy. Time will tell.",
"if",
"is... | Pass through to provider GradebookColumnAdminSession.get_gradebook_column_form_for_update | [
"Pass",
"through",
"to",
"provider",
"GradebookColumnAdminSession",
".",
"get_gradebook_column_form_for_update"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L2015-L2023 |
mitsei/dlkit | dlkit/services/grading.py | Gradebook.save_gradebook_column | def save_gradebook_column(self, gradebook_column_form, *args, **kwargs):
"""Pass through to provider GradebookColumnAdminSession.update_gradebook_column"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if gradebook_column_form.is_for_updat... | python | def save_gradebook_column(self, gradebook_column_form, *args, **kwargs):
"""Pass through to provider GradebookColumnAdminSession.update_gradebook_column"""
# Implemented from kitosid template for -
# osid.resource.ResourceAdminSession.update_resource
if gradebook_column_form.is_for_updat... | [
"def",
"save_gradebook_column",
"(",
"self",
",",
"gradebook_column_form",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Implemented from kitosid template for -",
"# osid.resource.ResourceAdminSession.update_resource",
"if",
"gradebook_column_form",
".",
"is_for_upd... | Pass through to provider GradebookColumnAdminSession.update_gradebook_column | [
"Pass",
"through",
"to",
"provider",
"GradebookColumnAdminSession",
".",
"update_gradebook_column"
] | train | https://github.com/mitsei/dlkit/blob/445f968a175d61c8d92c0f617a3c17dc1dc7c584/dlkit/services/grading.py#L2037-L2044 |
Arkq/flake8-requirements | src/flake8_requirements/checker.py | memoize | def memoize(f):
"""Cache value returned by the function."""
@wraps(f)
def w(*args, **kw):
memoize.mem[f] = v = f(*args, **kw)
return v
return w | python | def memoize(f):
"""Cache value returned by the function."""
@wraps(f)
def w(*args, **kw):
memoize.mem[f] = v = f(*args, **kw)
return v
return w | [
"def",
"memoize",
"(",
"f",
")",
":",
"@",
"wraps",
"(",
"f",
")",
"def",
"w",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"memoize",
".",
"mem",
"[",
"f",
"]",
"=",
"v",
"=",
"f",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")",
"retur... | Cache value returned by the function. | [
"Cache",
"value",
"returned",
"by",
"the",
"function",
"."
] | train | https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L34-L40 |
Arkq/flake8-requirements | src/flake8_requirements/checker.py | project2module | def project2module(project):
"""Convert project name into a module name."""
# Name unification in accordance with PEP 426.
project = project.lower().replace("-", "_")
if project.startswith("python_"):
# Remove conventional "python-" prefix.
project = project[7:]
return project | python | def project2module(project):
"""Convert project name into a module name."""
# Name unification in accordance with PEP 426.
project = project.lower().replace("-", "_")
if project.startswith("python_"):
# Remove conventional "python-" prefix.
project = project[7:]
return project | [
"def",
"project2module",
"(",
"project",
")",
":",
"# Name unification in accordance with PEP 426.",
"project",
"=",
"project",
".",
"lower",
"(",
")",
".",
"replace",
"(",
"\"-\"",
",",
"\"_\"",
")",
"if",
"project",
".",
"startswith",
"(",
"\"python_\"",
")",
... | Convert project name into a module name. | [
"Convert",
"project",
"name",
"into",
"a",
"module",
"name",
"."
] | train | https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L47-L54 |
Arkq/flake8-requirements | src/flake8_requirements/checker.py | SetupVisitor.get_requirements | def get_requirements(
self, install=True, extras=True, setup=False, tests=False):
"""Get package requirements."""
requires = []
if install:
requires.extend(parse_requirements(
self.keywords.get('install_requires', ()),
))
if extras:
... | python | def get_requirements(
self, install=True, extras=True, setup=False, tests=False):
"""Get package requirements."""
requires = []
if install:
requires.extend(parse_requirements(
self.keywords.get('install_requires', ()),
))
if extras:
... | [
"def",
"get_requirements",
"(",
"self",
",",
"install",
"=",
"True",
",",
"extras",
"=",
"True",
",",
"setup",
"=",
"False",
",",
"tests",
"=",
"False",
")",
":",
"requires",
"=",
"[",
"]",
"if",
"install",
":",
"requires",
".",
"extend",
"(",
"parse... | Get package requirements. | [
"Get",
"package",
"requirements",
"."
] | train | https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L184-L203 |
Arkq/flake8-requirements | src/flake8_requirements/checker.py | SetupVisitor.visit_Call | def visit_Call(self, node):
"""Call visitor - used for finding setup() call."""
self.generic_visit(node)
# Setup() is a keywords-only function.
if node.args:
return
keywords = set()
for k in node.keywords:
if k.arg is not None:
ke... | python | def visit_Call(self, node):
"""Call visitor - used for finding setup() call."""
self.generic_visit(node)
# Setup() is a keywords-only function.
if node.args:
return
keywords = set()
for k in node.keywords:
if k.arg is not None:
ke... | [
"def",
"visit_Call",
"(",
"self",
",",
"node",
")",
":",
"self",
".",
"generic_visit",
"(",
"node",
")",
"# Setup() is a keywords-only function.",
"if",
"node",
".",
"args",
":",
"return",
"keywords",
"=",
"set",
"(",
")",
"for",
"k",
"in",
"node",
".",
... | Call visitor - used for finding setup() call. | [
"Call",
"visitor",
"-",
"used",
"for",
"finding",
"setup",
"()",
"call",
"."
] | train | https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L205-L243 |
Arkq/flake8-requirements | src/flake8_requirements/checker.py | Flake8Checker.add_options | def add_options(cls, manager):
"""Register plug-in specific options."""
kw = {}
if flake8.__version__ >= '3.0.0':
kw['parse_from_config'] = True
manager.add_option(
"--known-modules",
action='store',
default="",
help=(
... | python | def add_options(cls, manager):
"""Register plug-in specific options."""
kw = {}
if flake8.__version__ >= '3.0.0':
kw['parse_from_config'] = True
manager.add_option(
"--known-modules",
action='store',
default="",
help=(
... | [
"def",
"add_options",
"(",
"cls",
",",
"manager",
")",
":",
"kw",
"=",
"{",
"}",
"if",
"flake8",
".",
"__version__",
">=",
"'3.0.0'",
":",
"kw",
"[",
"'parse_from_config'",
"]",
"=",
"True",
"manager",
".",
"add_option",
"(",
"\"--known-modules\"",
",",
... | Register plug-in specific options. | [
"Register",
"plug",
"-",
"in",
"specific",
"options",
"."
] | train | https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L264-L279 |
Arkq/flake8-requirements | src/flake8_requirements/checker.py | Flake8Checker.parse_options | def parse_options(cls, options):
"""Parse plug-in specific options."""
cls.known_modules = {
project2module(k): v.split(",")
for k, v in [
x.split(":[")
for x in re.split(r"],?", options.known_modules)[:-1]
]
} | python | def parse_options(cls, options):
"""Parse plug-in specific options."""
cls.known_modules = {
project2module(k): v.split(",")
for k, v in [
x.split(":[")
for x in re.split(r"],?", options.known_modules)[:-1]
]
} | [
"def",
"parse_options",
"(",
"cls",
",",
"options",
")",
":",
"cls",
".",
"known_modules",
"=",
"{",
"project2module",
"(",
"k",
")",
":",
"v",
".",
"split",
"(",
"\",\"",
")",
"for",
"k",
",",
"v",
"in",
"[",
"x",
".",
"split",
"(",
"\":[\"",
")... | Parse plug-in specific options. | [
"Parse",
"plug",
"-",
"in",
"specific",
"options",
"."
] | train | https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L282-L290 |
Arkq/flake8-requirements | src/flake8_requirements/checker.py | Flake8Checker.get_requirements | def get_requirements(cls):
"""Get package requirements."""
try:
with open("requirements.txt") as f:
return tuple(parse_requirements(f.readlines()))
except IOError as e:
LOG.debug("Couldn't open requirements file: %s", e)
return () | python | def get_requirements(cls):
"""Get package requirements."""
try:
with open("requirements.txt") as f:
return tuple(parse_requirements(f.readlines()))
except IOError as e:
LOG.debug("Couldn't open requirements file: %s", e)
return () | [
"def",
"get_requirements",
"(",
"cls",
")",
":",
"try",
":",
"with",
"open",
"(",
"\"requirements.txt\"",
")",
"as",
"f",
":",
"return",
"tuple",
"(",
"parse_requirements",
"(",
"f",
".",
"readlines",
"(",
")",
")",
")",
"except",
"IOError",
"as",
"e",
... | Get package requirements. | [
"Get",
"package",
"requirements",
"."
] | train | https://github.com/Arkq/flake8-requirements/blob/d7cb84af2429a63635528b531111a5da527bf2d1/src/flake8_requirements/checker.py#L294-L301 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.