hexsha stringlengths 40 40 | repo stringlengths 7 114 | path stringlengths 4 124 | license listlengths 1 9 | language stringclasses 1
value | identifier stringlengths 1 71 | return_type stringlengths 1 749 ⌀ | original_string stringlengths 76 22.7k | original_docstring stringlengths 16 7.61k | docstring stringlengths 16 2.47k | docstring_tokens listlengths 6 477 | code stringlengths 14 10.2k | code_tokens listlengths 6 996 | short_docstring stringlengths 2 644 | short_docstring_tokens listlengths 1 116 | comment listlengths 1 89 | parameters listlengths 0 64 | docstring_params dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fd1d8d125215261dfb8f81915520e57a6610e7cd | VIVelev/nujo | nujo/init/random.py | [
"MIT"
] | Python | randint | Tensor | def randint(*shape: int,
low=0,
high=100,
diff=False,
name='Tensor[randint]') -> Tensor:
''' Return random integers from low (inclusive) to high (exclusive).
'''
return Tensor(np_randint(low, high=high, size=shape), diff=diff, name=name) | Return random integers from low (inclusive) to high (exclusive).
| Return random integers from low (inclusive) to high (exclusive). | [
"Return",
"random",
"integers",
"from",
"low",
"(",
"inclusive",
")",
"to",
"high",
"(",
"exclusive",
")",
"."
] | def randint(*shape: int,
low=0,
high=100,
diff=False,
name='Tensor[randint]') -> Tensor:
return Tensor(np_randint(low, high=high, size=shape), diff=diff, name=name) | [
"def",
"randint",
"(",
"*",
"shape",
":",
"int",
",",
"low",
"=",
"0",
",",
"high",
"=",
"100",
",",
"diff",
"=",
"False",
",",
"name",
"=",
"'Tensor[randint]'",
")",
"->",
"Tensor",
":",
"return",
"Tensor",
"(",
"np_randint",
"(",
"low",
",",
"hig... | Return random integers from low (inclusive) to high (exclusive). | [
"Return",
"random",
"integers",
"from",
"low",
"(",
"inclusive",
")",
"to",
"high",
"(",
"exclusive",
")",
"."
] | [
"''' Return random integers from low (inclusive) to high (exclusive).\n '''"
] | [
{
"param": "shape",
"type": "int"
},
{
"param": "low",
"type": null
},
{
"param": "high",
"type": null
},
{
"param": "diff",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "shape",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "low",
"type": null,
"docstring": null,
"docstring_tokens": ... |
ae32a3d23da21214a1e3ebf3091ff90ab1d83dda | VIVelev/nujo | nujo/autodiff/_functions/_transform.py | [
"MIT"
] | Python | forward | ndarray | def forward(self) -> ndarray:
''' Method which turns the image shaped input to column shape
'''
images = self.children[0].value
# Reshape content into column shape
k, i, j = self._im2col_indices
return images[:, k, i, j]\
.transpose(1, 2, 0).reshape(self._n_... | Method which turns the image shaped input to column shape
| Method which turns the image shaped input to column shape | [
"Method",
"which",
"turns",
"the",
"image",
"shaped",
"input",
"to",
"column",
"shape"
] | def forward(self) -> ndarray:
images = self.children[0].value
k, i, j = self._im2col_indices
return images[:, k, i, j]\
.transpose(1, 2, 0).reshape(self._n_features, -1) | [
"def",
"forward",
"(",
"self",
")",
"->",
"ndarray",
":",
"images",
"=",
"self",
".",
"children",
"[",
"0",
"]",
".",
"value",
"k",
",",
"i",
",",
"j",
"=",
"self",
".",
"_im2col_indices",
"return",
"images",
"[",
":",
",",
"k",
",",
"i",
",",
... | Method which turns the image shaped input to column shape | [
"Method",
"which",
"turns",
"the",
"image",
"shaped",
"input",
"to",
"column",
"shape"
] | [
"''' Method which turns the image shaped input to column shape\n '''",
"# Reshape content into column shape"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ae32a3d23da21214a1e3ebf3091ff90ab1d83dda | VIVelev/nujo | nujo/autodiff/_functions/_transform.py | [
"MIT"
] | Python | backward | Function.T | def backward(self, idx: int, accum_grad: Function.T) -> Function.T:
''' Method which turns the column shaped input to image shape
'''
# Create images placeholder
images = zeros(self.children[0].shape)
# Separate the image sections and the batch_size (shape[0])
separated... | Method which turns the column shaped input to image shape
| Method which turns the column shaped input to image shape | [
"Method",
"which",
"turns",
"the",
"column",
"shaped",
"input",
"to",
"image",
"shape"
] | def backward(self, idx: int, accum_grad: Function.T) -> Function.T:
images = zeros(self.children[0].shape)
separated_grad = accum_grad\
.reshape(self._n_features, -1, images.shape[0])\
.transpose(2, 0, 1)
k, i, j = self._im2col_indices
add.at(images, (slice(None... | [
"def",
"backward",
"(",
"self",
",",
"idx",
":",
"int",
",",
"accum_grad",
":",
"Function",
".",
"T",
")",
"->",
"Function",
".",
"T",
":",
"images",
"=",
"zeros",
"(",
"self",
".",
"children",
"[",
"0",
"]",
".",
"shape",
")",
"separated_grad",
"=... | Method which turns the column shaped input to image shape | [
"Method",
"which",
"turns",
"the",
"column",
"shaped",
"input",
"to",
"image",
"shape"
] | [
"''' Method which turns the column shaped input to image shape\n '''",
"# Create images placeholder",
"# Separate the image sections and the batch_size (shape[0])",
"# Move the batch_size at the beginning",
"# Fill in the placeholder"
] | [
{
"param": "self",
"type": null
},
{
"param": "idx",
"type": "int"
},
{
"param": "accum_grad",
"type": "Function.T"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "idx",
"type": "int",
"docstring": null,
"docstring_tokens": [... |
ae32a3d23da21214a1e3ebf3091ff90ab1d83dda | VIVelev/nujo | nujo/autodiff/_functions/_transform.py | [
"MIT"
] | Python | _im2col_indices | Tuple[ndarray, ndarray, ndarray] | def _im2col_indices(self) -> Tuple[ndarray, ndarray, ndarray]:
''' Calculate the indices where the dot products are
to be applied between the weights and the image.
'''
# Obtain needed information
channels = self.children[0].shape[1]
kernel_height, kernel_width = self.k... | Calculate the indices where the dot products are
to be applied between the weights and the image.
| Calculate the indices where the dot products are
to be applied between the weights and the image. | [
"Calculate",
"the",
"indices",
"where",
"the",
"dot",
"products",
"are",
"to",
"be",
"applied",
"between",
"the",
"weights",
"and",
"the",
"image",
"."
] | def _im2col_indices(self) -> Tuple[ndarray, ndarray, ndarray]:
channels = self.children[0].shape[1]
kernel_height, kernel_width = self.kernel_size
stride_height, stride_width = self.stride
dilation_height, dilation_width = self.dilation
out_height, out_width = self._output_shape
... | [
"def",
"_im2col_indices",
"(",
"self",
")",
"->",
"Tuple",
"[",
"ndarray",
",",
"ndarray",
",",
"ndarray",
"]",
":",
"channels",
"=",
"self",
".",
"children",
"[",
"0",
"]",
".",
"shape",
"[",
"1",
"]",
"kernel_height",
",",
"kernel_width",
"=",
"self"... | Calculate the indices where the dot products are
to be applied between the weights and the image. | [
"Calculate",
"the",
"indices",
"where",
"the",
"dot",
"products",
"are",
"to",
"be",
"applied",
"between",
"the",
"weights",
"and",
"the",
"image",
"."
] | [
"''' Calculate the indices where the dot products are\n to be applied between the weights and the image.\n\n '''",
"# Obtain needed information",
"# Calculate sections' rows",
"# Slide rows by stride",
"# Calculate sections' columns",
"# Slide cols by stride",
"# Calculate sections' channe... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ae32a3d23da21214a1e3ebf3091ff90ab1d83dda | VIVelev/nujo | nujo/autodiff/_functions/_transform.py | [
"MIT"
] | Python | _n_features | <not_specific> | def _n_features(self):
''' number of features in the column form
'''
return self.kernel_size[0] * self.kernel_size[1] *\
self.children[0].shape[1] | number of features in the column form
| number of features in the column form | [
"number",
"of",
"features",
"in",
"the",
"column",
"form"
] | def _n_features(self):
return self.kernel_size[0] * self.kernel_size[1] *\
self.children[0].shape[1] | [
"def",
"_n_features",
"(",
"self",
")",
":",
"return",
"self",
".",
"kernel_size",
"[",
"0",
"]",
"*",
"self",
".",
"kernel_size",
"[",
"1",
"]",
"*",
"self",
".",
"children",
"[",
"0",
"]",
".",
"shape",
"[",
"1",
"]"
] | number of features in the column form | [
"number",
"of",
"features",
"in",
"the",
"column",
"form"
] | [
"''' number of features in the column form\n '''"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
32d2ae34153f2af541c0319727a5461a2bc81186 | jfardello/dyn53 | dyn53/dyn53.py | [
"MIT"
] | Python | check | <not_specific> | def check(subdomain, domain, addr):
""" Bypass what our dns says and ask directly to the authority.
zresolver is passed by kwarg to allow overriding in the tests.
"""
zresolver = resolver.Resolver()
try:
for each in resolver.query(domain, 'NS'):
ns_srv = resolver.query(each.to_... | Bypass what our dns says and ask directly to the authority.
zresolver is passed by kwarg to allow overriding in the tests.
| Bypass what our dns says and ask directly to the authority.
zresolver is passed by kwarg to allow overriding in the tests. | [
"Bypass",
"what",
"our",
"dns",
"says",
"and",
"ask",
"directly",
"to",
"the",
"authority",
".",
"zresolver",
"is",
"passed",
"by",
"kwarg",
"to",
"allow",
"overriding",
"in",
"the",
"tests",
"."
] | def check(subdomain, domain, addr):
zresolver = resolver.Resolver()
try:
for each in resolver.query(domain, 'NS'):
ns_srv = resolver.query(each.to_text())[0].to_text()
zresolver.nameservers.clear()
zresolver.nameservers.append(ns_srv)
res = zresolver.query("%s... | [
"def",
"check",
"(",
"subdomain",
",",
"domain",
",",
"addr",
")",
":",
"zresolver",
"=",
"resolver",
".",
"Resolver",
"(",
")",
"try",
":",
"for",
"each",
"in",
"resolver",
".",
"query",
"(",
"domain",
",",
"'NS'",
")",
":",
"ns_srv",
"=",
"resolver... | Bypass what our dns says and ask directly to the authority. | [
"Bypass",
"what",
"our",
"dns",
"says",
"and",
"ask",
"directly",
"to",
"the",
"authority",
"."
] | [
"\"\"\" Bypass what our dns says and ask directly to the authority.\n\n zresolver is passed by kwarg to allow overriding in the tests.\n \"\"\""
] | [
{
"param": "subdomain",
"type": null
},
{
"param": "domain",
"type": null
},
{
"param": "addr",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "subdomain",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "domain",
"type": null,
"docstring": null,
"docstring_tok... |
083e4489bb0e1ae219279f8978c1c799677a4e41 | BartMassey/capstone360 | view_student.py | [
"MIT"
] | Python | check_review_done | <not_specific> | def check_review_done(self, reviews_table, reviewer_id, reviewee_id, team_id, is_final):
"""
Check if a review has been submitted using the given reviewer, reviewee, team_id, and is_final
INPUT: -self,
-reviews_table (an instance of gbmodel.reports() class that we use to make our ... |
Check if a review has been submitted using the given reviewer, reviewee, team_id, and is_final
INPUT: -self,
-reviews_table (an instance of gbmodel.reports() class that we use to make our database call),
-reviewer_id (the id of the student who authored the review we are lo... | Check if a review has been submitted using the given reviewer, reviewee, team_id, and is_final
INPUT: -self,
reviews_table (an instance of gbmodel.reports() class that we use to make our database call),
reviewer_id (the id of the student who authored the review we are looking for),
reviewee_id (the id of the student be... | [
"Check",
"if",
"a",
"review",
"has",
"been",
"submitted",
"using",
"the",
"given",
"reviewer",
"reviewee",
"team_id",
"and",
"is_final",
"INPUT",
":",
"-",
"self",
"reviews_table",
"(",
"an",
"instance",
"of",
"gbmodel",
".",
"reports",
"()",
"class",
"that"... | def check_review_done(self, reviews_table, reviewer_id, reviewee_id, team_id, is_final):
return reviews_table.get_report(reviewer_id, reviewee_id, team_id, is_final) is not None | [
"def",
"check_review_done",
"(",
"self",
",",
"reviews_table",
",",
"reviewer_id",
",",
"reviewee_id",
",",
"team_id",
",",
"is_final",
")",
":",
"return",
"reviews_table",
".",
"get_report",
"(",
"reviewer_id",
",",
"reviewee_id",
",",
"team_id",
",",
"is_final... | Check if a review has been submitted using the given reviewer, reviewee, team_id, and is_final
INPUT: -self,
reviews_table (an instance of gbmodel.reports() class that we use to make our database call),
reviewer_id (the id of the student who authored the review we are looking for),
reviewee_id (the id of the student be... | [
"Check",
"if",
"a",
"review",
"has",
"been",
"submitted",
"using",
"the",
"given",
"reviewer",
"reviewee",
"team_id",
"and",
"is_final",
"INPUT",
":",
"-",
"self",
"reviews_table",
"(",
"an",
"instance",
"of",
"gbmodel",
".",
"reports",
"()",
"class",
"that"... | [
"\"\"\"\n Check if a review has been submitted using the given reviewer, reviewee, team_id, and is_final\n INPUT: -self,\n -reviews_table (an instance of gbmodel.reports() class that we use to make our database call),\n -reviewer_id (the id of the student who authored the r... | [
{
"param": "self",
"type": null
},
{
"param": "reviews_table",
"type": null
},
{
"param": "reviewer_id",
"type": null
},
{
"param": "reviewee_id",
"type": null
},
{
"param": "team_id",
"type": null
},
{
"param": "is_final",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "reviews_table",
"type": null,
"docstring": null,
"docstring_t... |
083e4489bb0e1ae219279f8978c1c799677a4e41 | BartMassey/capstone360 | view_student.py | [
"MIT"
] | Python | display_error | <not_specific> | def display_error(self, error):
"""
Prints a given error message to the console and returns a rendering (?) of the viewStudent template
with a generic error message in it
INPUT: -self,
-error (the error we wil to print to the console)
OUTPUT: an error page renderin... |
Prints a given error message to the console and returns a rendering (?) of the viewStudent template
with a generic error message in it
INPUT: -self,
-error (the error we wil to print to the console)
OUTPUT: an error page rendering of the viewStudent template (I think)
... | Prints a given error message to the console and returns a rendering (?) of the viewStudent template
with a generic error message in it
INPUT: -self,
error (the error we wil to print to the console)
OUTPUT: an error page rendering of the viewStudent template (I think) | [
"Prints",
"a",
"given",
"error",
"message",
"to",
"the",
"console",
"and",
"returns",
"a",
"rendering",
"(",
"?",
")",
"of",
"the",
"viewStudent",
"template",
"with",
"a",
"generic",
"error",
"message",
"in",
"it",
"INPUT",
":",
"-",
"self",
"error",
"("... | def display_error(self, error):
logging.error("View Student - " + str(error))
return render_template('viewStudent.html', error="Something went wrong") | [
"def",
"display_error",
"(",
"self",
",",
"error",
")",
":",
"logging",
".",
"error",
"(",
"\"View Student - \"",
"+",
"str",
"(",
"error",
")",
")",
"return",
"render_template",
"(",
"'viewStudent.html'",
",",
"error",
"=",
"\"Something went wrong\"",
")"
] | Prints a given error message to the console and returns a rendering (?) | [
"Prints",
"a",
"given",
"error",
"message",
"to",
"the",
"console",
"and",
"returns",
"a",
"rendering",
"(",
"?",
")"
] | [
"\"\"\"\n Prints a given error message to the console and returns a rendering (?) of the viewStudent template\n with a generic error message in it\n INPUT: -self,\n -error (the error we wil to print to the console)\n OUTPUT: an error page rendering of the viewStudent templa... | [
{
"param": "self",
"type": null
},
{
"param": "error",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "error",
"type": null,
"docstring": null,
"docstring_tokens": ... |
083e4489bb0e1ae219279f8978c1c799677a4e41 | BartMassey/capstone360 | view_student.py | [
"MIT"
] | Python | post | <not_specific> | def post(self):
"""
A function that determines how the viewStudent class handles POST requests
INPUT: self
OUTPUT: a rendering of the viewStudent.html file. The information included in the rendering depends on
the information we get from the POST request
"""
... |
A function that determines how the viewStudent class handles POST requests
INPUT: self
OUTPUT: a rendering of the viewStudent.html file. The information included in the rendering depends on
the information we get from the POST request
| A function that determines how the viewStudent class handles POST requests
INPUT: self
OUTPUT: a rendering of the viewStudent.html file. The information included in the rendering depends on
the information we get from the POST request | [
"A",
"function",
"that",
"determines",
"how",
"the",
"viewStudent",
"class",
"handles",
"POST",
"requests",
"INPUT",
":",
"self",
"OUTPUT",
":",
"a",
"rendering",
"of",
"the",
"viewStudent",
".",
"html",
"file",
".",
"The",
"information",
"included",
"in",
"... | def post(self):
students = gbmodel.students()
teams = gbmodel.teams()
reports = gbmodel.reports()
if not validate_professor():
return display_access_control_error()
try:
student_id = request.form.getlist('student_id')[0]
session_id = request.fo... | [
"def",
"post",
"(",
"self",
")",
":",
"students",
"=",
"gbmodel",
".",
"students",
"(",
")",
"teams",
"=",
"gbmodel",
".",
"teams",
"(",
")",
"reports",
"=",
"gbmodel",
".",
"reports",
"(",
")",
"if",
"not",
"validate_professor",
"(",
")",
":",
"retu... | A function that determines how the viewStudent class handles POST requests
INPUT: self
OUTPUT: a rendering of the viewStudent.html file. | [
"A",
"function",
"that",
"determines",
"how",
"the",
"viewStudent",
"class",
"handles",
"POST",
"requests",
"INPUT",
":",
"self",
"OUTPUT",
":",
"a",
"rendering",
"of",
"the",
"viewStudent",
".",
"html",
"file",
"."
] | [
"\"\"\"\n A function that determines how the viewStudent class handles POST requests\n INPUT: self\n OUTPUT: a rendering of the viewStudent.html file. The information included in the rendering depends on\n the information we get from the POST request\n \"\"\"",
"# Get th... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_professor | <not_specific> | def check_professor(self, prof_id):
"""
Checks if professor ID exists in the DB
Input: professor ID given
Output: True if it exists, False otherwise
"""
try:
prof_id = prof_id.strip().lower()
result = professors().query.filter_by(id=prof_id).first(... |
Checks if professor ID exists in the DB
Input: professor ID given
Output: True if it exists, False otherwise
| Checks if professor ID exists in the DB
Input: professor ID given
Output: True if it exists, False otherwise | [
"Checks",
"if",
"professor",
"ID",
"exists",
"in",
"the",
"DB",
"Input",
":",
"professor",
"ID",
"given",
"Output",
":",
"True",
"if",
"it",
"exists",
"False",
"otherwise"
] | def check_professor(self, prof_id):
try:
prof_id = prof_id.strip().lower()
result = professors().query.filter_by(id=prof_id).first()
except exc.SQLAlchemyError:
handle_exception()
result = None
if result is not None:
return True
... | [
"def",
"check_professor",
"(",
"self",
",",
"prof_id",
")",
":",
"try",
":",
"prof_id",
"=",
"prof_id",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"result",
"=",
"professors",
"(",
")",
".",
"query",
".",
"filter_by",
"(",
"id",
"=",
"prof_id",
... | Checks if professor ID exists in the DB
Input: professor ID given
Output: True if it exists, False otherwise | [
"Checks",
"if",
"professor",
"ID",
"exists",
"in",
"the",
"DB",
"Input",
":",
"professor",
"ID",
"given",
"Output",
":",
"True",
"if",
"it",
"exists",
"False",
"otherwise"
] | [
"\"\"\"\n Checks if professor ID exists in the DB\n Input: professor ID given\n Output: True if it exists, False otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "prof_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "prof_id",
"type": null,
"docstring": null,
"docstring_tokens"... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | prof_id | <not_specific> | def prof_id(self, name):
"""
Gets the id of the professor with the given name, if he is found. Returns -1 otherwise
Input: professor name
Output: return professor's id
"""
try:
prof = professors.query.filter_by(name=name).first()
except exc.SQLAlchemyE... |
Gets the id of the professor with the given name, if he is found. Returns -1 otherwise
Input: professor name
Output: return professor's id
| Gets the id of the professor with the given name, if he is found. Returns -1 otherwise
Input: professor name
Output: return professor's id | [
"Gets",
"the",
"id",
"of",
"the",
"professor",
"with",
"the",
"given",
"name",
"if",
"he",
"is",
"found",
".",
"Returns",
"-",
"1",
"otherwise",
"Input",
":",
"professor",
"name",
"Output",
":",
"return",
"professor",
"'",
"s",
"id"
] | def prof_id(self, name):
try:
prof = professors.query.filter_by(name=name).first()
except exc.SQLAlchemyError:
handle_exception()
prof = None
if prof is None:
return -1
return prof.id | [
"def",
"prof_id",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"prof",
"=",
"professors",
".",
"query",
".",
"filter_by",
"(",
"name",
"=",
"name",
")",
".",
"first",
"(",
")",
"except",
"exc",
".",
"SQLAlchemyError",
":",
"handle_exception",
"(",
... | Gets the id of the professor with the given name, if he is found. | [
"Gets",
"the",
"id",
"of",
"the",
"professor",
"with",
"the",
"given",
"name",
"if",
"he",
"is",
"found",
"."
] | [
"\"\"\"\n Gets the id of the professor with the given name, if he is found. Returns -1 otherwise\n Input: professor name\n Output: return professor's id\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_dup_team | <not_specific> | def check_dup_team(self, t_name, session_id):
"""
Check if the new team name already existed in the given session
Input: name of the new team and session id of the selected session
Output: return False if the team already exists, True otherwise
"""
try:
result... |
Check if the new team name already existed in the given session
Input: name of the new team and session id of the selected session
Output: return False if the team already exists, True otherwise
| Check if the new team name already existed in the given session
Input: name of the new team and session id of the selected session
Output: return False if the team already exists, True otherwise | [
"Check",
"if",
"the",
"new",
"team",
"name",
"already",
"existed",
"in",
"the",
"given",
"session",
"Input",
":",
"name",
"of",
"the",
"new",
"team",
"and",
"session",
"id",
"of",
"the",
"selected",
"session",
"Output",
":",
"return",
"False",
"if",
"the... | def check_dup_team(self, t_name, session_id):
try:
result = teams().query.filter_by(name=t_name,
session_id=session_id).first()
except exc.SQLAlchemyError:
handle_exception()
result = None
if result is not None:
... | [
"def",
"check_dup_team",
"(",
"self",
",",
"t_name",
",",
"session_id",
")",
":",
"try",
":",
"result",
"=",
"teams",
"(",
")",
".",
"query",
".",
"filter_by",
"(",
"name",
"=",
"t_name",
",",
"session_id",
"=",
"session_id",
")",
".",
"first",
"(",
... | Check if the new team name already existed in the given session
Input: name of the new team and session id of the selected session
Output: return False if the team already exists, True otherwise | [
"Check",
"if",
"the",
"new",
"team",
"name",
"already",
"existed",
"in",
"the",
"given",
"session",
"Input",
":",
"name",
"of",
"the",
"new",
"team",
"and",
"session",
"id",
"of",
"the",
"selected",
"session",
"Output",
":",
"return",
"False",
"if",
"the... | [
"\"\"\"\n Check if the new team name already existed in the given session\n Input: name of the new team and session id of the selected session\n Output: return False if the team already exists, True otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "t_name",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "t_name",
"type": null,
"docstring": null,
"docstring_tokens":... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | insert_team | <not_specific> | def insert_team(self, session_id, t_name):
"""
Insert a team to database
Input: self, session id and name of the new team
"""
id = self.get_max_team_id()
new_team = teams(id=id, session_id=session_id, name=t_name)
db.session.add(new_team)
db.session.commit... |
Insert a team to database
Input: self, session id and name of the new team
| Insert a team to database
Input: self, session id and name of the new team | [
"Insert",
"a",
"team",
"to",
"database",
"Input",
":",
"self",
"session",
"id",
"and",
"name",
"of",
"the",
"new",
"team"
] | def insert_team(self, session_id, t_name):
id = self.get_max_team_id()
new_team = teams(id=id, session_id=session_id, name=t_name)
db.session.add(new_team)
db.session.commit()
return id | [
"def",
"insert_team",
"(",
"self",
",",
"session_id",
",",
"t_name",
")",
":",
"id",
"=",
"self",
".",
"get_max_team_id",
"(",
")",
"new_team",
"=",
"teams",
"(",
"id",
"=",
"id",
",",
"session_id",
"=",
"session_id",
",",
"name",
"=",
"t_name",
")",
... | Insert a team to database
Input: self, session id and name of the new team | [
"Insert",
"a",
"team",
"to",
"database",
"Input",
":",
"self",
"session",
"id",
"and",
"name",
"of",
"the",
"new",
"team"
] | [
"\"\"\"\n Insert a team to database\n Input: self, session id and name of the new team\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "session_id",
"type": null
},
{
"param": "t_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "session_id",
"type": null,
"docstring": null,
"docstring_toke... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | remove_team_from_session | <not_specific> | def remove_team_from_session(self, name, session_id):
"""
Remove a team and all the students from that team
Input: name of the team and session id
Output: True if the operation completed successfully. False if something went wrong
"""
try:
student = students()... |
Remove a team and all the students from that team
Input: name of the team and session id
Output: True if the operation completed successfully. False if something went wrong
| Remove a team and all the students from that team
Input: name of the team and session id
Output: True if the operation completed successfully. False if something went wrong | [
"Remove",
"a",
"team",
"and",
"all",
"the",
"students",
"from",
"that",
"team",
"Input",
":",
"name",
"of",
"the",
"team",
"and",
"session",
"id",
"Output",
":",
"True",
"if",
"the",
"operation",
"completed",
"successfully",
".",
"False",
"if",
"something"... | def remove_team_from_session(self, name, session_id):
try:
student = students()
removed_student = removed_students()
result = teams.query.filter(teams.name == name,
teams.session_id == session_id).first()
tid = result.id
... | [
"def",
"remove_team_from_session",
"(",
"self",
",",
"name",
",",
"session_id",
")",
":",
"try",
":",
"student",
"=",
"students",
"(",
")",
"removed_student",
"=",
"removed_students",
"(",
")",
"result",
"=",
"teams",
".",
"query",
".",
"filter",
"(",
"tea... | Remove a team and all the students from that team
Input: name of the team and session id
Output: True if the operation completed successfully. | [
"Remove",
"a",
"team",
"and",
"all",
"the",
"students",
"from",
"that",
"team",
"Input",
":",
"name",
"of",
"the",
"team",
"and",
"session",
"id",
"Output",
":",
"True",
"if",
"the",
"operation",
"completed",
"successfully",
"."
] | [
"\"\"\"\n Remove a team and all the students from that team\n Input: name of the team and session id\n Output: True if the operation completed successfully. False if something went wrong\n \"\"\"",
"# get students to delete",
"# remove reports",
"# remove students"
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | remove_team | <not_specific> | def remove_team(self, name, session_id):
"""
Remove a team and all the students from that team
Input: name of the team and session id
Output: delete a team
move all student in the team to unassigned student
"""
try:
# Get the team slated for re... |
Remove a team and all the students from that team
Input: name of the team and session id
Output: delete a team
move all student in the team to unassigned student
| Remove a team and all the students from that team
Input: name of the team and session id
Output: delete a team
move all student in the team to unassigned student | [
"Remove",
"a",
"team",
"and",
"all",
"the",
"students",
"from",
"that",
"team",
"Input",
":",
"name",
"of",
"the",
"team",
"and",
"session",
"id",
"Output",
":",
"delete",
"a",
"team",
"move",
"all",
"student",
"in",
"the",
"team",
"to",
"unassigned",
... | def remove_team(self, name, session_id):
try:
teams_obj = teams()
team = teams_obj.query.filter(teams.name == name,
teams.session_id == session_id).first()
student_list = students.query.filter(students.tid == team.id,
... | [
"def",
"remove_team",
"(",
"self",
",",
"name",
",",
"session_id",
")",
":",
"try",
":",
"teams_obj",
"=",
"teams",
"(",
")",
"team",
"=",
"teams_obj",
".",
"query",
".",
"filter",
"(",
"teams",
".",
"name",
"==",
"name",
",",
"teams",
".",
"session_... | Remove a team and all the students from that team
Input: name of the team and session id
Output: delete a team
move all student in the team to unassigned student | [
"Remove",
"a",
"team",
"and",
"all",
"the",
"students",
"from",
"that",
"team",
"Input",
":",
"name",
"of",
"the",
"team",
"and",
"session",
"id",
"Output",
":",
"delete",
"a",
"team",
"move",
"all",
"student",
"in",
"the",
"team",
"to",
"unassigned",
... | [
"\"\"\"\n Remove a team and all the students from that team\n Input: name of the team and session id\n Output: delete a team\n move all student in the team to unassigned student\n \"\"\"",
"# Get the team slated for removal",
"# Get the students on the team",
"# If w... | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | dashboard | <not_specific> | def dashboard(self, session_id):
"""
Return a lists of sessions from the database
and a list of teams + students from a selected session
Input: session id of the selected session
"""
student = students()
session = capstone_session()
today = datetime.dateti... |
Return a lists of sessions from the database
and a list of teams + students from a selected session
Input: session id of the selected session
| Return a lists of sessions from the database
and a list of teams + students from a selected session
Input: session id of the selected session | [
"Return",
"a",
"lists",
"of",
"sessions",
"from",
"the",
"database",
"and",
"a",
"list",
"of",
"teams",
"+",
"students",
"from",
"a",
"selected",
"session",
"Input",
":",
"session",
"id",
"of",
"the",
"selected",
"session"
] | def dashboard(self, session_id):
student = students()
session = capstone_session()
today = datetime.datetime.now()
sessions = session.get_sessions()
if self.get_team_session_id(session_id) is None:
return None, sessions
tids = [row.id for row in self.get_team_... | [
"def",
"dashboard",
"(",
"self",
",",
"session_id",
")",
":",
"student",
"=",
"students",
"(",
")",
"session",
"=",
"capstone_session",
"(",
")",
"today",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"sessions",
"=",
"session",
".",
"get_sessi... | Return a lists of sessions from the database
and a list of teams + students from a selected session
Input: session id of the selected session | [
"Return",
"a",
"lists",
"of",
"sessions",
"from",
"the",
"database",
"and",
"a",
"list",
"of",
"teams",
"+",
"students",
"from",
"a",
"selected",
"session",
"Input",
":",
"session",
"id",
"of",
"the",
"selected",
"session"
] | [
"\"\"\"\n Return a lists of sessions from the database\n and a list of teams + students from a selected session\n Input: session id of the selected session\n \"\"\"",
"# Get min and max",
"# Query to get the min & max student points of their final",
"# Query to get the min & max st... | [
{
"param": "self",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "session_id",
"type": null,
"docstring": null,
"docstring_toke... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_dup_student | <not_specific> | def check_dup_student(self, id, session_id):
"""
Check if a student already exits in a session
Input: id of the student and selected session id
Output: return False if the student was already in
return True otherwise
"""
try:
result = students.... |
Check if a student already exits in a session
Input: id of the student and selected session id
Output: return False if the student was already in
return True otherwise
| Check if a student already exits in a session
Input: id of the student and selected session id
Output: return False if the student was already in
return True otherwise | [
"Check",
"if",
"a",
"student",
"already",
"exits",
"in",
"a",
"session",
"Input",
":",
"id",
"of",
"the",
"student",
"and",
"selected",
"session",
"id",
"Output",
":",
"return",
"False",
"if",
"the",
"student",
"was",
"already",
"in",
"return",
"True",
"... | def check_dup_student(self, id, session_id):
try:
result = students.query.filter_by(id=id, session_id=session_id).first()
except exc.SQLAlchemyError:
handle_exception()
result = None
if result is not None:
return False
return True | [
"def",
"check_dup_student",
"(",
"self",
",",
"id",
",",
"session_id",
")",
":",
"try",
":",
"result",
"=",
"students",
".",
"query",
".",
"filter_by",
"(",
"id",
"=",
"id",
",",
"session_id",
"=",
"session_id",
")",
".",
"first",
"(",
")",
"except",
... | Check if a student already exits in a session
Input: id of the student and selected session id
Output: return False if the student was already in
return True otherwise | [
"Check",
"if",
"a",
"student",
"already",
"exits",
"in",
"a",
"session",
"Input",
":",
"id",
"of",
"the",
"student",
"and",
"selected",
"session",
"id",
"Output",
":",
"return",
"False",
"if",
"the",
"student",
"was",
"already",
"in",
"return",
"True",
"... | [
"\"\"\"\n Check if a student already exits in a session\n Input: id of the student and selected session id\n Output: return False if the student was already in\n return True otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | insert_student | <not_specific> | def insert_student(self, name, email_address, id, session_id, t_name):
"""
Add new student
Input: student name, student email address, student id, team name and id of the selected session
Output: return False if student id already exists in the current session
add student... |
Add new student
Input: student name, student email address, student id, team name and id of the selected session
Output: return False if student id already exists in the current session
add student to the database and return True otherwise
| Add new student
Input: student name, student email address, student id, team name and id of the selected session
Output: return False if student id already exists in the current session
add student to the database and return True otherwise | [
"Add",
"new",
"student",
"Input",
":",
"student",
"name",
"student",
"email",
"address",
"student",
"id",
"team",
"name",
"and",
"id",
"of",
"the",
"selected",
"session",
"Output",
":",
"return",
"False",
"if",
"student",
"id",
"already",
"exists",
"in",
"... | def insert_student(self, name, email_address, id, session_id, t_name):
try:
result = teams.query.filter(teams.name == t_name, teams.session_id == session_id).first()
tid = result.id
new_student = students(id=id,
tid=tid,
... | [
"def",
"insert_student",
"(",
"self",
",",
"name",
",",
"email_address",
",",
"id",
",",
"session_id",
",",
"t_name",
")",
":",
"try",
":",
"result",
"=",
"teams",
".",
"query",
".",
"filter",
"(",
"teams",
".",
"name",
"==",
"t_name",
",",
"teams",
... | Add new student
Input: student name, student email address, student id, team name and id of the selected session
Output: return False if student id already exists in the current session
add student to the database and return True otherwise | [
"Add",
"new",
"student",
"Input",
":",
"student",
"name",
"student",
"email",
"address",
"student",
"id",
"team",
"name",
"and",
"id",
"of",
"the",
"selected",
"session",
"Output",
":",
"return",
"False",
"if",
"student",
"id",
"already",
"exists",
"in",
"... | [
"\"\"\"\n Add new student\n Input: student name, student email address, student id, team name and id of the selected session\n Output: return False if student id already exists in the current session\n add student to the database and return True otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "email_address",
"type": null
},
{
"param": "id",
"type": null
},
{
"param": "session_id",
"type": null
},
{
"param": "t_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | remove_student | <not_specific> | def remove_student(self, sts, t_name, session_id):
"""
Remove a list of selected students
Input: list of students, team name and session id
Output: return False of the list of student is empty or if something went wrong
otherwise, remove student from the team
"""
... |
Remove a list of selected students
Input: list of students, team name and session id
Output: return False of the list of student is empty or if something went wrong
otherwise, remove student from the team
| Remove a list of selected students
Input: list of students, team name and session id
Output: return False of the list of student is empty or if something went wrong
otherwise, remove student from the team | [
"Remove",
"a",
"list",
"of",
"selected",
"students",
"Input",
":",
"list",
"of",
"students",
"team",
"name",
"and",
"session",
"id",
"Output",
":",
"return",
"False",
"of",
"the",
"list",
"of",
"student",
"is",
"empty",
"or",
"if",
"something",
"went",
"... | def remove_student(self, sts, t_name, session_id):
try:
if t_name is None or sts is None:
return False
removed_student = removed_students()
team = teams.query.filter(teams.name == t_name,
teams.session_id == session_id).fi... | [
"def",
"remove_student",
"(",
"self",
",",
"sts",
",",
"t_name",
",",
"session_id",
")",
":",
"try",
":",
"if",
"t_name",
"is",
"None",
"or",
"sts",
"is",
"None",
":",
"return",
"False",
"removed_student",
"=",
"removed_students",
"(",
")",
"team",
"=",
... | Remove a list of selected students
Input: list of students, team name and session id
Output: return False of the list of student is empty or if something went wrong
otherwise, remove student from the team | [
"Remove",
"a",
"list",
"of",
"selected",
"students",
"Input",
":",
"list",
"of",
"students",
"team",
"name",
"and",
"session",
"id",
"Output",
":",
"return",
"False",
"of",
"the",
"list",
"of",
"student",
"is",
"empty",
"or",
"if",
"something",
"went",
"... | [
"\"\"\"\n Remove a list of selected students\n Input: list of students, team name and session id\n Output: return False of the list of student is empty or if something went wrong\n otherwise, remove student from the team\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "sts",
"type": null
},
{
"param": "t_name",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sts",
"type": null,
"docstring": null,
"docstring_tokens": []... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | validate | <not_specific> | def validate(self, id):
"""
validate cas username with student id in the database
Input: student id
Output: object of found student
"""
try:
result = students.query.filter_by(id=id).first()
except exc.SQLAlchemyError:
handle_exception()
... |
validate cas username with student id in the database
Input: student id
Output: object of found student
| validate cas username with student id in the database
Input: student id
Output: object of found student | [
"validate",
"cas",
"username",
"with",
"student",
"id",
"in",
"the",
"database",
"Input",
":",
"student",
"id",
"Output",
":",
"object",
"of",
"found",
"student"
] | def validate(self, id):
try:
result = students.query.filter_by(id=id).first()
except exc.SQLAlchemyError:
handle_exception()
result = None
if result is None:
return False
else:
return result | [
"def",
"validate",
"(",
"self",
",",
"id",
")",
":",
"try",
":",
"result",
"=",
"students",
".",
"query",
".",
"filter_by",
"(",
"id",
"=",
"id",
")",
".",
"first",
"(",
")",
"except",
"exc",
".",
"SQLAlchemyError",
":",
"handle_exception",
"(",
")",... | validate cas username with student id in the database
Input: student id
Output: object of found student | [
"validate",
"cas",
"username",
"with",
"student",
"id",
"in",
"the",
"database",
"Input",
":",
"student",
"id",
"Output",
":",
"object",
"of",
"found",
"student"
] | [
"\"\"\"\n validate cas username with student id in the database\n Input: student id\n Output: object of found student\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_team_lead | <not_specific> | def check_team_lead(self, s_id, sess_id):
"""
Check if the student passed in by id is the team lead
Input: student id of the student to check
Output: True if the student is a team lead, False otherwise
"""
try:
student = students.query.filter(students.id == s_... |
Check if the student passed in by id is the team lead
Input: student id of the student to check
Output: True if the student is a team lead, False otherwise
| Check if the student passed in by id is the team lead
Input: student id of the student to check
Output: True if the student is a team lead, False otherwise | [
"Check",
"if",
"the",
"student",
"passed",
"in",
"by",
"id",
"is",
"the",
"team",
"lead",
"Input",
":",
"student",
"id",
"of",
"the",
"student",
"to",
"check",
"Output",
":",
"True",
"if",
"the",
"student",
"is",
"a",
"team",
"lead",
"False",
"otherwis... | def check_team_lead(self, s_id, sess_id):
try:
student = students.query.filter(students.id == s_id, students.session_id == sess_id).first()
if student.is_lead == 1:
return True
else:
return False
except exc.SQLAlchemyError:
... | [
"def",
"check_team_lead",
"(",
"self",
",",
"s_id",
",",
"sess_id",
")",
":",
"try",
":",
"student",
"=",
"students",
".",
"query",
".",
"filter",
"(",
"students",
".",
"id",
"==",
"s_id",
",",
"students",
".",
"session_id",
"==",
"sess_id",
")",
".",
... | Check if the student passed in by id is the team lead
Input: student id of the student to check
Output: True if the student is a team lead, False otherwise | [
"Check",
"if",
"the",
"student",
"passed",
"in",
"by",
"id",
"is",
"the",
"team",
"lead",
"Input",
":",
"student",
"id",
"of",
"the",
"student",
"to",
"check",
"Output",
":",
"True",
"if",
"the",
"student",
"is",
"a",
"team",
"lead",
"False",
"otherwis... | [
"\"\"\"\n Check if the student passed in by id is the team lead\n Input: student id of the student to check\n Output: True if the student is a team lead, False otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "s_id",
"type": null
},
{
"param": "sess_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "s_id",
"type": null,
"docstring": null,
"docstring_tokens": [... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | edit_student | <not_specific> | def edit_student(self, id, new_name, new_email):
"""
Allows students to edit their name and email address
Input: student's new email and name and current user id
Output: apply new name and email to students in student table
"""
try:
# Find the student
... |
Allows students to edit their name and email address
Input: student's new email and name and current user id
Output: apply new name and email to students in student table
| Allows students to edit their name and email address
Input: student's new email and name and current user id
Output: apply new name and email to students in student table | [
"Allows",
"students",
"to",
"edit",
"their",
"name",
"and",
"email",
"address",
"Input",
":",
"student",
"'",
"s",
"new",
"email",
"and",
"name",
"and",
"current",
"user",
"id",
"Output",
":",
"apply",
"new",
"name",
"and",
"email",
"to",
"students",
"in... | def edit_student(self, id, new_name, new_email):
try:
student = students.query.filter(students.id == id).all()
if student is None:
return False
for i in student:
if new_name != '':
i.name = new_name
if new_em... | [
"def",
"edit_student",
"(",
"self",
",",
"id",
",",
"new_name",
",",
"new_email",
")",
":",
"try",
":",
"student",
"=",
"students",
".",
"query",
".",
"filter",
"(",
"students",
".",
"id",
"==",
"id",
")",
".",
"all",
"(",
")",
"if",
"student",
"is... | Allows students to edit their name and email address
Input: student's new email and name and current user id
Output: apply new name and email to students in student table | [
"Allows",
"students",
"to",
"edit",
"their",
"name",
"and",
"email",
"address",
"Input",
":",
"student",
"'",
"s",
"new",
"email",
"and",
"name",
"and",
"current",
"user",
"id",
"Output",
":",
"apply",
"new",
"name",
"and",
"email",
"to",
"students",
"in... | [
"\"\"\"\n Allows students to edit their name and email address\n Input: student's new email and name and current user id\n Output: apply new name and email to students in student table\n \"\"\"",
"# Find the student",
"# Change name and/or email, if either of them are non-blank"
] | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
},
{
"param": "new_name",
"type": null
},
{
"param": "new_email",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | insert_session | <not_specific> | def insert_session(self, term, year, professor_id):
"""
Add a current session (only if it wasn't in the database)
Input: starting term and year of the session
Output: return id of the added session
"""
term = term.strip().lower()
year = year.strip().lower()
... |
Add a current session (only if it wasn't in the database)
Input: starting term and year of the session
Output: return id of the added session
| Add a current session (only if it wasn't in the database)
Input: starting term and year of the session
Output: return id of the added session | [
"Add",
"a",
"current",
"session",
"(",
"only",
"if",
"it",
"wasn",
"'",
"t",
"in",
"the",
"database",
")",
"Input",
":",
"starting",
"term",
"and",
"year",
"of",
"the",
"session",
"Output",
":",
"return",
"id",
"of",
"the",
"added",
"session"
] | def insert_session(self, term, year, professor_id):
term = term.strip().lower()
year = year.strip().lower()
e_term = None
e_year = 0
terms = ["fall", "winter", "spring", "summer"]
for i in range(len(terms)):
if terms[i] == term:
e_term = terms[... | [
"def",
"insert_session",
"(",
"self",
",",
"term",
",",
"year",
",",
"professor_id",
")",
":",
"term",
"=",
"term",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"year",
"=",
"year",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"e_term",
"="... | Add a current session (only if it wasn't in the database)
Input: starting term and year of the session
Output: return id of the added session | [
"Add",
"a",
"current",
"session",
"(",
"only",
"if",
"it",
"wasn",
"'",
"t",
"in",
"the",
"database",
")",
"Input",
":",
"starting",
"term",
"and",
"year",
"of",
"the",
"session",
"Output",
":",
"return",
"id",
"of",
"the",
"added",
"session"
] | [
"\"\"\"\n Add a current session (only if it wasn't in the database)\n Input: starting term and year of the session\n Output: return id of the added session\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "term",
"type": null
},
{
"param": "year",
"type": null
},
{
"param": "professor_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "term",
"type": null,
"docstring": null,
"docstring_tokens": [... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | remove_session | <not_specific> | def remove_session(self, session_id):
"""
Removes an entire session with all the teams and students
Input: session id
"""
try:
team = teams()
session_teams = team.query.filter_by(session_id=session_id).all()
del_session = capstone_session.query... |
Removes an entire session with all the teams and students
Input: session id
| Removes an entire session with all the teams and students
Input: session id | [
"Removes",
"an",
"entire",
"session",
"with",
"all",
"the",
"teams",
"and",
"students",
"Input",
":",
"session",
"id"
] | def remove_session(self, session_id):
try:
team = teams()
session_teams = team.query.filter_by(session_id=session_id).all()
del_session = capstone_session.query.filter(capstone_session.id == session_id).first()
for t in session_teams:
team_name = t... | [
"def",
"remove_session",
"(",
"self",
",",
"session_id",
")",
":",
"try",
":",
"team",
"=",
"teams",
"(",
")",
"session_teams",
"=",
"team",
".",
"query",
".",
"filter_by",
"(",
"session_id",
"=",
"session_id",
")",
".",
"all",
"(",
")",
"del_session",
... | Removes an entire session with all the teams and students
Input: session id | [
"Removes",
"an",
"entire",
"session",
"with",
"all",
"the",
"teams",
"and",
"students",
"Input",
":",
"session",
"id"
] | [
"\"\"\"\n Removes an entire session with all the teams and students\n Input: session id\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "session_id",
"type": null,
"docstring": null,
"docstring_toke... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_term_name | <not_specific> | def check_term_name(self, s_term):
"""
Checks if the name of the term is valid
Input: start term of new session
Output: return True if valid, False otherwise
"""
s_term = s_term.strip().lower()
terms = ["fall", "winter", "spring", "summer"]
for i in range(... |
Checks if the name of the term is valid
Input: start term of new session
Output: return True if valid, False otherwise
| Checks if the name of the term is valid
Input: start term of new session
Output: return True if valid, False otherwise | [
"Checks",
"if",
"the",
"name",
"of",
"the",
"term",
"is",
"valid",
"Input",
":",
"start",
"term",
"of",
"new",
"session",
"Output",
":",
"return",
"True",
"if",
"valid",
"False",
"otherwise"
] | def check_term_name(self, s_term):
s_term = s_term.strip().lower()
terms = ["fall", "winter", "spring", "summer"]
for i in range(len(terms)):
if terms[i] == s_term:
return True
return False | [
"def",
"check_term_name",
"(",
"self",
",",
"s_term",
")",
":",
"s_term",
"=",
"s_term",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"terms",
"=",
"[",
"\"fall\"",
",",
"\"winter\"",
",",
"\"spring\"",
",",
"\"summer\"",
"]",
"for",
"i",
"in",
"r... | Checks if the name of the term is valid
Input: start term of new session
Output: return True if valid, False otherwise | [
"Checks",
"if",
"the",
"name",
"of",
"the",
"term",
"is",
"valid",
"Input",
":",
"start",
"term",
"of",
"new",
"session",
"Output",
":",
"return",
"True",
"if",
"valid",
"False",
"otherwise"
] | [
"\"\"\"\n Checks if the name of the term is valid\n Input: start term of new session\n Output: return True if valid, False otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "s_term",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "s_term",
"type": null,
"docstring": null,
"docstring_tokens":... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_term_year | <not_specific> | def check_term_year(self, s_year):
"""
Checks if the year of the term is valid
Input: start year of new session
Output: return False if invalid, True otherwise
"""
check_year = s_year.isdigit()
if not check_year:
return False
return True |
Checks if the year of the term is valid
Input: start year of new session
Output: return False if invalid, True otherwise
| Checks if the year of the term is valid
Input: start year of new session
Output: return False if invalid, True otherwise | [
"Checks",
"if",
"the",
"year",
"of",
"the",
"term",
"is",
"valid",
"Input",
":",
"start",
"year",
"of",
"new",
"session",
"Output",
":",
"return",
"False",
"if",
"invalid",
"True",
"otherwise"
] | def check_term_year(self, s_year):
check_year = s_year.isdigit()
if not check_year:
return False
return True | [
"def",
"check_term_year",
"(",
"self",
",",
"s_year",
")",
":",
"check_year",
"=",
"s_year",
".",
"isdigit",
"(",
")",
"if",
"not",
"check_year",
":",
"return",
"False",
"return",
"True"
] | Checks if the year of the term is valid
Input: start year of new session
Output: return False if invalid, True otherwise | [
"Checks",
"if",
"the",
"year",
"of",
"the",
"term",
"is",
"valid",
"Input",
":",
"start",
"year",
"of",
"new",
"session",
"Output",
":",
"return",
"False",
"if",
"invalid",
"True",
"otherwise"
] | [
"\"\"\"\n Checks if the year of the term is valid\n Input: start year of new session\n Output: return False if invalid, True otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "s_year",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "s_year",
"type": null,
"docstring": null,
"docstring_tokens":... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_session_id_valid | <not_specific> | def check_session_id_valid(self, v_id):
"""
Checks if the returned session ID is greater than
or equal to 0
"""
check_id = v_id.isdigit()
if check_id < 0:
return False
return True |
Checks if the returned session ID is greater than
or equal to 0
| Checks if the returned session ID is greater than
or equal to 0 | [
"Checks",
"if",
"the",
"returned",
"session",
"ID",
"is",
"greater",
"than",
"or",
"equal",
"to",
"0"
] | def check_session_id_valid(self, v_id):
check_id = v_id.isdigit()
if check_id < 0:
return False
return True | [
"def",
"check_session_id_valid",
"(",
"self",
",",
"v_id",
")",
":",
"check_id",
"=",
"v_id",
".",
"isdigit",
"(",
")",
"if",
"check_id",
"<",
"0",
":",
"return",
"False",
"return",
"True"
] | Checks if the returned session ID is greater than
or equal to 0 | [
"Checks",
"if",
"the",
"returned",
"session",
"ID",
"is",
"greater",
"than",
"or",
"equal",
"to",
"0"
] | [
"\"\"\"\n Checks if the returned session ID is greater than\n or equal to 0\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "v_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "v_id",
"type": null,
"docstring": null,
"docstring_tokens": [... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_dup_session | <not_specific> | def check_dup_session(self, s_term, s_year, p_id):
"""
Check if the new session name already exists in the database
Input: start term & year of the new session
Output: return False if the team already exists, True otherwise
"""
try:
s_term = s_term.strip().low... |
Check if the new session name already exists in the database
Input: start term & year of the new session
Output: return False if the team already exists, True otherwise
| Check if the new session name already exists in the database
Input: start term & year of the new session
Output: return False if the team already exists, True otherwise | [
"Check",
"if",
"the",
"new",
"session",
"name",
"already",
"exists",
"in",
"the",
"database",
"Input",
":",
"start",
"term",
"&",
"year",
"of",
"the",
"new",
"session",
"Output",
":",
"return",
"False",
"if",
"the",
"team",
"already",
"exists",
"True",
"... | def check_dup_session(self, s_term, s_year, p_id):
try:
s_term = s_term.strip().lower().capitalize()
s_year = s_year.strip().lower().capitalize()
p_id = p_id.strip().lower()
result = capstone_session().query.filter_by(
start_term=s_term, start_year... | [
"def",
"check_dup_session",
"(",
"self",
",",
"s_term",
",",
"s_year",
",",
"p_id",
")",
":",
"try",
":",
"s_term",
"=",
"s_term",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
".",
"capitalize",
"(",
")",
"s_year",
"=",
"s_year",
".",
"strip",
"... | Check if the new session name already exists in the database
Input: start term & year of the new session
Output: return False if the team already exists, True otherwise | [
"Check",
"if",
"the",
"new",
"session",
"name",
"already",
"exists",
"in",
"the",
"database",
"Input",
":",
"start",
"term",
"&",
"year",
"of",
"the",
"new",
"session",
"Output",
":",
"return",
"False",
"if",
"the",
"team",
"already",
"exists",
"True",
"... | [
"\"\"\"\n Check if the new session name already exists in the database\n Input: start term & year of the new session\n Output: return False if the team already exists, True otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "s_term",
"type": null
},
{
"param": "s_year",
"type": null
},
{
"param": "p_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "s_term",
"type": null,
"docstring": null,
"docstring_tokens":... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_dates | <not_specific> | def check_dates(self, start, end):
"""
Check if start and end dates are valid
Input: start and end dates
Output: Return 0 if valid (both start and end date being empty is valid)
Return 1 if start date is after the end date
Return 2 if either start date or ... |
Check if start and end dates are valid
Input: start and end dates
Output: Return 0 if valid (both start and end date being empty is valid)
Return 1 if start date is after the end date
Return 2 if either start date or end date is empty (but not both)
| Check if start and end dates are valid
Input: start and end dates
Output: Return 0 if valid (both start and end date being empty is valid)
Return 1 if start date is after the end date
Return 2 if either start date or end date is empty (but not both) | [
"Check",
"if",
"start",
"and",
"end",
"dates",
"are",
"valid",
"Input",
":",
"start",
"and",
"end",
"dates",
"Output",
":",
"Return",
"0",
"if",
"valid",
"(",
"both",
"start",
"and",
"end",
"date",
"being",
"empty",
"is",
"valid",
")",
"Return",
"1",
... | def check_dates(self, start, end):
params = {'start': start, 'end': end}
if params['start'] and params['end']:
if int(params['start']) > int(params['end']):
return 1
else:
return 0
elif params['start'] is None and params['end'] is None:
... | [
"def",
"check_dates",
"(",
"self",
",",
"start",
",",
"end",
")",
":",
"params",
"=",
"{",
"'start'",
":",
"start",
",",
"'end'",
":",
"end",
"}",
"if",
"params",
"[",
"'start'",
"]",
"and",
"params",
"[",
"'end'",
"]",
":",
"if",
"int",
"(",
"pa... | Check if start and end dates are valid
Input: start and end dates
Output: Return 0 if valid (both start and end date being empty is valid)
Return 1 if start date is after the end date
Return 2 if either start date or end date is empty (but not both) | [
"Check",
"if",
"start",
"and",
"end",
"dates",
"are",
"valid",
"Input",
":",
"start",
"and",
"end",
"dates",
"Output",
":",
"Return",
"0",
"if",
"valid",
"(",
"both",
"start",
"and",
"end",
"date",
"being",
"empty",
"is",
"valid",
")",
"Return",
"1",
... | [
"\"\"\"\n Check if start and end dates are valid\n Input: start and end dates\n Output: Return 0 if valid (both start and end date being empty is valid)\n Return 1 if start date is after the end date\n Return 2 if either start date or end date is empty (but not bot... | [
{
"param": "self",
"type": null
},
{
"param": "start",
"type": null
},
{
"param": "end",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "start",
"type": null,
"docstring": null,
"docstring_tokens": ... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | date_error | <not_specific> | def date_error(self, params):
"""
This method handles error message for inserting dates
Input: parameter of dates (start/end dates for midterm/final)
Output: error message
"""
error_msg = None
for i in params:
if params[i]:
params[i] = ... |
This method handles error message for inserting dates
Input: parameter of dates (start/end dates for midterm/final)
Output: error message
| This method handles error message for inserting dates
Input: parameter of dates (start/end dates for midterm/final)
Output: error message | [
"This",
"method",
"handles",
"error",
"message",
"for",
"inserting",
"dates",
"Input",
":",
"parameter",
"of",
"dates",
"(",
"start",
"/",
"end",
"dates",
"for",
"midterm",
"/",
"final",
")",
"Output",
":",
"error",
"message"
] | def date_error(self, params):
error_msg = None
for i in params:
if params[i]:
params[i] = params[i].replace('-', '')
else:
params[i] = None
mid = self.check_dates(params['midterm_start'], params['midterm_end'])
final = self.check_da... | [
"def",
"date_error",
"(",
"self",
",",
"params",
")",
":",
"error_msg",
"=",
"None",
"for",
"i",
"in",
"params",
":",
"if",
"params",
"[",
"i",
"]",
":",
"params",
"[",
"i",
"]",
"=",
"params",
"[",
"i",
"]",
".",
"replace",
"(",
"'-'",
",",
"'... | This method handles error message for inserting dates
Input: parameter of dates (start/end dates for midterm/final)
Output: error message | [
"This",
"method",
"handles",
"error",
"message",
"for",
"inserting",
"dates",
"Input",
":",
"parameter",
"of",
"dates",
"(",
"start",
"/",
"end",
"dates",
"for",
"midterm",
"/",
"final",
")",
"Output",
":",
"error",
"message"
] | [
"\"\"\"\n This method handles error message for inserting dates\n Input: parameter of dates (start/end dates for midterm/final)\n Output: error message\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "params",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": null,
"docstring": null,
"docstring_tokens":... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | split_dates | <not_specific> | def split_dates(self, params):
"""
Split dates into integer year, month and day
to convert the string to datetime object
Input: parameter of dates
Outout: parameter of datetime objects
"""
for i in params:
if params[i]:
params[i] = para... |
Split dates into integer year, month and day
to convert the string to datetime object
Input: parameter of dates
Outout: parameter of datetime objects
| Split dates into integer year, month and day
to convert the string to datetime object
Input: parameter of dates
Outout: parameter of datetime objects | [
"Split",
"dates",
"into",
"integer",
"year",
"month",
"and",
"day",
"to",
"convert",
"the",
"string",
"to",
"datetime",
"object",
"Input",
":",
"parameter",
"of",
"dates",
"Outout",
":",
"parameter",
"of",
"datetime",
"objects"
] | def split_dates(self, params):
for i in params:
if params[i]:
params[i] = params[i].split('-')
params[i] = datetime.datetime(int(params[i][0]), int(params[i][1]), int(params[i][2]))
else:
params[i] = None
return params | [
"def",
"split_dates",
"(",
"self",
",",
"params",
")",
":",
"for",
"i",
"in",
"params",
":",
"if",
"params",
"[",
"i",
"]",
":",
"params",
"[",
"i",
"]",
"=",
"params",
"[",
"i",
"]",
".",
"split",
"(",
"'-'",
")",
"params",
"[",
"i",
"]",
"=... | Split dates into integer year, month and day
to convert the string to datetime object
Input: parameter of dates
Outout: parameter of datetime objects | [
"Split",
"dates",
"into",
"integer",
"year",
"month",
"and",
"day",
"to",
"convert",
"the",
"string",
"to",
"datetime",
"object",
"Input",
":",
"parameter",
"of",
"dates",
"Outout",
":",
"parameter",
"of",
"datetime",
"objects"
] | [
"\"\"\"\n Split dates into integer year, month and day\n to convert the string to datetime object\n Input: parameter of dates\n Outout: parameter of datetime objects\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "params",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "params",
"type": null,
"docstring": null,
"docstring_tokens":... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | insert_dates | <not_specific> | def insert_dates(self, midterm_start, midterm_end, final_start, final_end, session_id):
"""
Insert a start and end date for midterm and final review
Input: start and end date for midterm review and final reviews
Output: update the dates in the database
"""
review_dates = ... |
Insert a start and end date for midterm and final review
Input: start and end date for midterm review and final reviews
Output: update the dates in the database
| Insert a start and end date for midterm and final review
Input: start and end date for midterm review and final reviews
Output: update the dates in the database | [
"Insert",
"a",
"start",
"and",
"end",
"date",
"for",
"midterm",
"and",
"final",
"review",
"Input",
":",
"start",
"and",
"end",
"date",
"for",
"midterm",
"review",
"and",
"final",
"reviews",
"Output",
":",
"update",
"the",
"dates",
"in",
"the",
"database"
] | def insert_dates(self, midterm_start, midterm_end, final_start, final_end, session_id):
review_dates = {'midterm_start': midterm_start,
'midterm_end': midterm_end,
'final_start': final_start,
'final_end': final_end}
dates = self.spl... | [
"def",
"insert_dates",
"(",
"self",
",",
"midterm_start",
",",
"midterm_end",
",",
"final_start",
",",
"final_end",
",",
"session_id",
")",
":",
"review_dates",
"=",
"{",
"'midterm_start'",
":",
"midterm_start",
",",
"'midterm_end'",
":",
"midterm_end",
",",
"'f... | Insert a start and end date for midterm and final review
Input: start and end date for midterm review and final reviews
Output: update the dates in the database | [
"Insert",
"a",
"start",
"and",
"end",
"date",
"for",
"midterm",
"and",
"final",
"review",
"Input",
":",
"start",
"and",
"end",
"date",
"for",
"midterm",
"review",
"and",
"final",
"reviews",
"Output",
":",
"update",
"the",
"dates",
"in",
"the",
"database"
] | [
"\"\"\"\n Insert a start and end date for midterm and final review\n Input: start and end date for midterm review and final reviews\n Output: update the dates in the database\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "midterm_start",
"type": null
},
{
"param": "midterm_end",
"type": null
},
{
"param": "final_start",
"type": null
},
{
"param": "final_end",
"type": null
},
{
"param": "session_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "midterm_start",
"type": null,
"docstring": null,
"docstring_t... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_review_state | <not_specific> | def check_review_state(self, session_id, date):
"""
Given a capstone session id to check and a date,
this method determines the currently available review if any
Inputs: a capstone session id and a date which should be a python date time object
Outputs: 'final' if date is after t... |
Given a capstone session id to check and a date,
this method determines the currently available review if any
Inputs: a capstone session id and a date which should be a python date time object
Outputs: 'final' if date is after the final start date for the session
'midterm' if th... | Given a capstone session id to check and a date,
this method determines the currently available review if any
Inputs: a capstone session id and a date which should be a python date time object
Outputs: 'final' if date is after the final start date for the session
'midterm' if the date is between the midterm and final s... | [
"Given",
"a",
"capstone",
"session",
"id",
"to",
"check",
"and",
"a",
"date",
"this",
"method",
"determines",
"the",
"currently",
"available",
"review",
"if",
"any",
"Inputs",
":",
"a",
"capstone",
"session",
"id",
"and",
"a",
"date",
"which",
"should",
"b... | def check_review_state(self, session_id, date):
try:
session = capstone_session.query.filter(capstone_session.id == session_id).first()
if session.final_start is not None:
if date >= session.final_start:
return 'final'
elif session.midt... | [
"def",
"check_review_state",
"(",
"self",
",",
"session_id",
",",
"date",
")",
":",
"try",
":",
"session",
"=",
"capstone_session",
".",
"query",
".",
"filter",
"(",
"capstone_session",
".",
"id",
"==",
"session_id",
")",
".",
"first",
"(",
")",
"if",
"s... | Given a capstone session id to check and a date,
this method determines the currently available review if any
Inputs: a capstone session id and a date which should be a python date time object
Outputs: 'final' if date is after the final start date for the session
'midterm' if the date is between the midterm and final s... | [
"Given",
"a",
"capstone",
"session",
"id",
"to",
"check",
"and",
"a",
"date",
"this",
"method",
"determines",
"the",
"currently",
"available",
"review",
"if",
"any",
"Inputs",
":",
"a",
"capstone",
"session",
"id",
"and",
"a",
"date",
"which",
"should",
"b... | [
"\"\"\"\n Given a capstone session id to check and a date,\n this method determines the currently available review if any\n Inputs: a capstone session id and a date which should be a python date time object\n Outputs: 'final' if date is after the final start date for the session\n ... | [
{
"param": "self",
"type": null
},
{
"param": "session_id",
"type": null
},
{
"param": "date",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "session_id",
"type": null,
"docstring": null,
"docstring_toke... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | check_not_late | <not_specific> | def check_not_late(Self, session_id, date, type):
"""
This method is for determining is a review is late. It receives the type of review to check
and compares the date sent into the method with the review's end period
Inputs: session_id -- the value of the id for the capstone session to ... |
This method is for determining is a review is late. It receives the type of review to check
and compares the date sent into the method with the review's end period
Inputs: session_id -- the value of the id for the capstone session to check
date: the date that the review is submitted, ty... | This method is for determining is a review is late. | [
"This",
"method",
"is",
"for",
"determining",
"is",
"a",
"review",
"is",
"late",
"."
] | def check_not_late(Self, session_id, date, type):
try:
session = capstone_session.query.filter(capstone_session.id == session_id).first()
if type == 'midterm':
if session.midterm_end is not None:
if date <= session.midterm_end:
... | [
"def",
"check_not_late",
"(",
"Self",
",",
"session_id",
",",
"date",
",",
"type",
")",
":",
"try",
":",
"session",
"=",
"capstone_session",
".",
"query",
".",
"filter",
"(",
"capstone_session",
".",
"id",
"==",
"session_id",
")",
".",
"first",
"(",
")",... | This method is for determining is a review is late. | [
"This",
"method",
"is",
"for",
"determining",
"is",
"a",
"review",
"is",
"late",
"."
] | [
"\"\"\"\n This method is for determining is a review is late. It receives the type of review to check\n and compares the date sent into the method with the review's end period\n Inputs: session_id -- the value of the id for the capstone session to check\n date: the date that the review i... | [
{
"param": "Self",
"type": null
},
{
"param": "session_id",
"type": null
},
{
"param": "date",
"type": null
},
{
"param": "type",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "Self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "session_id",
"type": null,
"docstring": null,
"docstring_toke... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | insert_report | <not_specific> | def insert_report(self, sess_id, time, reviewer, tid, reviewee, tech,
ethic, com, coop, init, focus, cont, lead, org, dlg,
points, strn, wkn, traits, learned, proud, is_final, late):
"""
Stages a report to be inserted into the database -- This does NOT commit ... |
Stages a report to be inserted into the database -- This does NOT commit the add!
Inputs: Arguments for each individual field of the report
Outputs: true if adding was successful, false if not
| Stages a report to be inserted into the database -- This does NOT commit the add.
Inputs: Arguments for each individual field of the report
Outputs: true if adding was successful, false if not | [
"Stages",
"a",
"report",
"to",
"be",
"inserted",
"into",
"the",
"database",
"--",
"This",
"does",
"NOT",
"commit",
"the",
"add",
".",
"Inputs",
":",
"Arguments",
"for",
"each",
"individual",
"field",
"of",
"the",
"report",
"Outputs",
":",
"true",
"if",
"... | def insert_report(self, sess_id, time, reviewer, tid, reviewee, tech,
ethic, com, coop, init, focus, cont, lead, org, dlg,
points, strn, wkn, traits, learned, proud, is_final, late):
try:
new_report = reports(session_id=sess_id,
... | [
"def",
"insert_report",
"(",
"self",
",",
"sess_id",
",",
"time",
",",
"reviewer",
",",
"tid",
",",
"reviewee",
",",
"tech",
",",
"ethic",
",",
"com",
",",
"coop",
",",
"init",
",",
"focus",
",",
"cont",
",",
"lead",
",",
"org",
",",
"dlg",
",",
... | Stages a report to be inserted into the database -- This does NOT commit the add! | [
"Stages",
"a",
"report",
"to",
"be",
"inserted",
"into",
"the",
"database",
"--",
"This",
"does",
"NOT",
"commit",
"the",
"add!"
] | [
"\"\"\"\n Stages a report to be inserted into the database -- This does NOT commit the add!\n Inputs: Arguments for each individual field of the report\n Outputs: true if adding was successful, false if not\n \"\"\"",
"# Build Report object from method input",
"# add the report and r... | [
{
"param": "self",
"type": null
},
{
"param": "sess_id",
"type": null
},
{
"param": "time",
"type": null
},
{
"param": "reviewer",
"type": null
},
{
"param": "tid",
"type": null
},
{
"param": "reviewee",
"type": null
},
{
"param": "tech",
... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sess_id",
"type": null,
"docstring": null,
"docstring_tokens"... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | commit_reports | <not_specific> | def commit_reports(self, id, state, sess_id, success):
"""
Method to commit changes to the DB through the model while updating the user's state
input: None
output: True if successful, false otherwise
"""
# if adding reports was not successful, rollback changes to session
... |
Method to commit changes to the DB through the model while updating the user's state
input: None
output: True if successful, false otherwise
| Method to commit changes to the DB through the model while updating the user's state
input: None
output: True if successful, false otherwise | [
"Method",
"to",
"commit",
"changes",
"to",
"the",
"DB",
"through",
"the",
"model",
"while",
"updating",
"the",
"user",
"'",
"s",
"state",
"input",
":",
"None",
"output",
":",
"True",
"if",
"successful",
"false",
"otherwise"
] | def commit_reports(self, id, state, sess_id, success):
try:
if success is False:
try:
print('Rolling Back Reports')
db.session.rollback()
except exc.SQLAlchemyError:
return False
return False
... | [
"def",
"commit_reports",
"(",
"self",
",",
"id",
",",
"state",
",",
"sess_id",
",",
"success",
")",
":",
"try",
":",
"if",
"success",
"is",
"False",
":",
"try",
":",
"print",
"(",
"'Rolling Back Reports'",
")",
"db",
".",
"session",
".",
"rollback",
"(... | Method to commit changes to the DB through the model while updating the user's state
input: None
output: True if successful, false otherwise | [
"Method",
"to",
"commit",
"changes",
"to",
"the",
"DB",
"through",
"the",
"model",
"while",
"updating",
"the",
"user",
"'",
"s",
"state",
"input",
":",
"None",
"output",
":",
"True",
"if",
"successful",
"false",
"otherwise"
] | [
"\"\"\"\n Method to commit changes to the DB through the model while updating the user's state\n input: None\n output: True if successful, false otherwise\n \"\"\"",
"# if adding reports was not successful, rollback changes to session",
"# update appropriate student 'done' attribute"... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
},
{
"param": "state",
"type": null
},
{
"param": "sess_id",
"type": null
},
{
"param": "success",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
a6e381a0ddef00ffd917ab6e0453f03462c4d295 | BartMassey/capstone360 | gbmodel/model_sqlalchemy.py | [
"MIT"
] | Python | add_student | <not_specific> | def add_student(self, s):
"""
Insert removed students into remocved_students table
Input: student info
Output: return False if the info is empty
Otherwise, add student to the list and return True
"""
if s is None:
return False
current_d... |
Insert removed students into remocved_students table
Input: student info
Output: return False if the info is empty
Otherwise, add student to the list and return True
| Insert removed students into remocved_students table
Input: student info
Output: return False if the info is empty
Otherwise, add student to the list and return True | [
"Insert",
"removed",
"students",
"into",
"remocved_students",
"table",
"Input",
":",
"student",
"info",
"Output",
":",
"return",
"False",
"if",
"the",
"info",
"is",
"empty",
"Otherwise",
"add",
"student",
"to",
"the",
"list",
"and",
"return",
"True"
] | def add_student(self, s):
if s is None:
return False
current_date = datetime.datetime.now()
removed_student = removed_students(id=s.id,
tid=s.tid,
session_id=s.session_id,
... | [
"def",
"add_student",
"(",
"self",
",",
"s",
")",
":",
"if",
"s",
"is",
"None",
":",
"return",
"False",
"current_date",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"removed_student",
"=",
"removed_students",
"(",
"id",
"=",
"s",
".",
"id",
... | Insert removed students into remocved_students table
Input: student info
Output: return False if the info is empty
Otherwise, add student to the list and return True | [
"Insert",
"removed",
"students",
"into",
"remocved_students",
"table",
"Input",
":",
"student",
"info",
"Output",
":",
"return",
"False",
"if",
"the",
"info",
"is",
"empty",
"Otherwise",
"add",
"student",
"to",
"the",
"list",
"and",
"return",
"True"
] | [
"\"\"\"\n Insert removed students into remocved_students table\n Input: student info\n Output: return False if the info is empty\n Otherwise, add student to the list and return True\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "s",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "s",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
99a0d112a49d4fd2708492f3b85c4e047babc574 | BartMassey/capstone360 | view_review.py | [
"MIT"
] | Python | interperate_rating | <not_specific> | def interperate_rating(self, rating):
"""
A function to add a (or some) descriptor word(s) to flush out the numerical ratings we store as
answers to most of our review questions
INPUT: -self (a reference to the instance of the class the function is being called on?),
-rati... |
A function to add a (or some) descriptor word(s) to flush out the numerical ratings we store as
answers to most of our review questions
INPUT: -self (a reference to the instance of the class the function is being called on?),
-rating (the numerical rating that we will flush out)
... | A function to add a (or some) descriptor word(s) to flush out the numerical ratings we store as
answers to most of our review questions
INPUT: -self (a reference to the instance of the class the function is being called on?),
rating (the numerical rating that we will flush out)
OUTPUT: a string containing the numerical... | [
"A",
"function",
"to",
"add",
"a",
"(",
"or",
"some",
")",
"descriptor",
"word",
"(",
"s",
")",
"to",
"flush",
"out",
"the",
"numerical",
"ratings",
"we",
"store",
"as",
"answers",
"to",
"most",
"of",
"our",
"review",
"questions",
"INPUT",
":",
"-",
... | def interperate_rating(self, rating):
if rating is None:
return "No Rating Given"
else:
interpretation = ""
if rating == 1:
interpretation = "Poor"
elif rating == 2:
interpretation = "Does Not Meet Expectations"
... | [
"def",
"interperate_rating",
"(",
"self",
",",
"rating",
")",
":",
"if",
"rating",
"is",
"None",
":",
"return",
"\"No Rating Given\"",
"else",
":",
"interpretation",
"=",
"\"\"",
"if",
"rating",
"==",
"1",
":",
"interpretation",
"=",
"\"Poor\"",
"elif",
"rat... | A function to add a (or some) descriptor word(s) to flush out the numerical ratings we store as
answers to most of our review questions
INPUT: -self (a reference to the instance of the class the function is being called on? | [
"A",
"function",
"to",
"add",
"a",
"(",
"or",
"some",
")",
"descriptor",
"word",
"(",
"s",
")",
"to",
"flush",
"out",
"the",
"numerical",
"ratings",
"we",
"store",
"as",
"answers",
"to",
"most",
"of",
"our",
"review",
"questions",
"INPUT",
":",
"-",
... | [
"\"\"\"\n A function to add a (or some) descriptor word(s) to flush out the numerical ratings we store as\n answers to most of our review questions\n INPUT: -self (a reference to the instance of the class the function is being called on?),\n -rating (the numerical rating that we w... | [
{
"param": "self",
"type": null
},
{
"param": "rating",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "rating",
"type": null,
"docstring": null,
"docstring_tokens":... |
99a0d112a49d4fd2708492f3b85c4e047babc574 | BartMassey/capstone360 | view_review.py | [
"MIT"
] | Python | display_error | <not_specific> | def display_error(self, error):
"""
Prints a given error message to the console and return a rendering of the viewReview.html page with
a generic error message in it
INPUT: -self,
-error (the error we wil to print to the console)
OUTPUT: an error page rendering of ... |
Prints a given error message to the console and return a rendering of the viewReview.html page with
a generic error message in it
INPUT: -self,
-error (the error we wil to print to the console)
OUTPUT: an error page rendering of the viewReview template
| Prints a given error message to the console and return a rendering of the viewReview.html page with
a generic error message in it
INPUT: -self,
error (the error we wil to print to the console)
OUTPUT: an error page rendering of the viewReview template | [
"Prints",
"a",
"given",
"error",
"message",
"to",
"the",
"console",
"and",
"return",
"a",
"rendering",
"of",
"the",
"viewReview",
".",
"html",
"page",
"with",
"a",
"generic",
"error",
"message",
"in",
"it",
"INPUT",
":",
"-",
"self",
"error",
"(",
"the",... | def display_error(self, error):
logging.error("View Review - " + str(error))
return render_template('viewReview.html', error="Something went wrong") | [
"def",
"display_error",
"(",
"self",
",",
"error",
")",
":",
"logging",
".",
"error",
"(",
"\"View Review - \"",
"+",
"str",
"(",
"error",
")",
")",
"return",
"render_template",
"(",
"'viewReview.html'",
",",
"error",
"=",
"\"Something went wrong\"",
")"
] | Prints a given error message to the console and return a rendering of the viewReview.html page with
a generic error message in it
INPUT: -self,
error (the error we wil to print to the console)
OUTPUT: an error page rendering of the viewReview template | [
"Prints",
"a",
"given",
"error",
"message",
"to",
"the",
"console",
"and",
"return",
"a",
"rendering",
"of",
"the",
"viewReview",
".",
"html",
"page",
"with",
"a",
"generic",
"error",
"message",
"in",
"it",
"INPUT",
":",
"-",
"self",
"error",
"(",
"the",... | [
"\"\"\"\n Prints a given error message to the console and return a rendering of the viewReview.html page with\n a generic error message in it\n INPUT: -self,\n -error (the error we wil to print to the console)\n OUTPUT: an error page rendering of the viewReview template\n ... | [
{
"param": "self",
"type": null
},
{
"param": "error",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "error",
"type": null,
"docstring": null,
"docstring_tokens": ... |
99a0d112a49d4fd2708492f3b85c4e047babc574 | BartMassey/capstone360 | view_review.py | [
"MIT"
] | Python | post | <not_specific> | def post(self):
"""
Determines how the class will handle POST requests
INPUT: self
OUTPUT: It looks like it will return a rendering of the viewReview.html file. The information
included in this rendering depends on the POST request parameters.
Used as refe... |
Determines how the class will handle POST requests
INPUT: self
OUTPUT: It looks like it will return a rendering of the viewReview.html file. The information
included in this rendering depends on the POST request parameters.
Used as reference: http://flask.pocoo.o... | Determines how the class will handle POST requests
INPUT: self
OUTPUT: It looks like it will return a rendering of the viewReview.html file. The information
included in this rendering depends on the POST request parameters. | [
"Determines",
"how",
"the",
"class",
"will",
"handle",
"POST",
"requests",
"INPUT",
":",
"self",
"OUTPUT",
":",
"It",
"looks",
"like",
"it",
"will",
"return",
"a",
"rendering",
"of",
"the",
"viewReview",
".",
"html",
"file",
".",
"The",
"information",
"inc... | def post(self):
if not validate_professor():
return display_access_control_error()
reports = gbmodel.reports()
teams = gbmodel.teams()
students = gbmodel.students()
if not validate_professor():
return self.display_error(("A student (or someone else) tried ... | [
"def",
"post",
"(",
"self",
")",
":",
"if",
"not",
"validate_professor",
"(",
")",
":",
"return",
"display_access_control_error",
"(",
")",
"reports",
"=",
"gbmodel",
".",
"reports",
"(",
")",
"teams",
"=",
"gbmodel",
".",
"teams",
"(",
")",
"students",
... | Determines how the class will handle POST requests
INPUT: self
OUTPUT: It looks like it will return a rendering of the viewReview.html file. | [
"Determines",
"how",
"the",
"class",
"will",
"handle",
"POST",
"requests",
"INPUT",
":",
"self",
"OUTPUT",
":",
"It",
"looks",
"like",
"it",
"will",
"return",
"a",
"rendering",
"of",
"the",
"viewReview",
".",
"html",
"file",
"."
] | [
"\"\"\"\n Determines how the class will handle POST requests\n INPUT: self\n OUTPUT: It looks like it will return a rendering of the viewReview.html file. The information\n included in this rendering depends on the POST request parameters.\n Used as reference: http... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7af13fac8f9413a94053b0c88dc75de0b7978042 | BartMassey/capstone360 | report.py | [
"MIT"
] | Python | _make_printable_reports | <not_specific> | def _make_printable_reports(session_id, is_final):
"""
Compiles all reports for a session into one for printing.
This means we generate a bunch of anonymized reports, then concatenate them, since page breaks are
handled in the HTML template.
Keyword arguments:
session_id -- session to generate ... |
Compiles all reports for a session into one for printing.
This means we generate a bunch of anonymized reports, then concatenate them, since page breaks are
handled in the HTML template.
Keyword arguments:
session_id -- session to generate reports for
is_final -- if True, makes a final report.... | Compiles all reports for a session into one for printing.
This means we generate a bunch of anonymized reports, then concatenate them, since page breaks are
handled in the HTML template.
Keyword arguments:
session_id -- session to generate reports for
is_final -- if True, makes a final report. If False, generates a mi... | [
"Compiles",
"all",
"reports",
"for",
"a",
"session",
"into",
"one",
"for",
"printing",
".",
"This",
"means",
"we",
"generate",
"a",
"bunch",
"of",
"anonymized",
"reports",
"then",
"concatenate",
"them",
"since",
"page",
"breaks",
"are",
"handled",
"in",
"the... | def _make_printable_reports(session_id, is_final):
students = gbmodel.students().get_students_in_session(session_id)
if students is None or len(students) <= 0:
raise MissingStudentException("No students for this session.")
report = ""
for s in students:
report = report + _make_student_re... | [
"def",
"_make_printable_reports",
"(",
"session_id",
",",
"is_final",
")",
":",
"students",
"=",
"gbmodel",
".",
"students",
"(",
")",
".",
"get_students_in_session",
"(",
"session_id",
")",
"if",
"students",
"is",
"None",
"or",
"len",
"(",
"students",
")",
... | Compiles all reports for a session into one for printing. | [
"Compiles",
"all",
"reports",
"for",
"a",
"session",
"into",
"one",
"for",
"printing",
"."
] | [
"\"\"\"\n Compiles all reports for a session into one for printing.\n This means we generate a bunch of anonymized reports, then concatenate them, since page breaks are\n handled in the HTML template.\n\n Keyword arguments:\n session_id -- session to generate reports for\n is_final -- if True, mak... | [
{
"param": "session_id",
"type": null
},
{
"param": "is_final",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "session_id",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "is_final",
"type": null,
"docstring": null,
"docstring_... |
7af13fac8f9413a94053b0c88dc75de0b7978042 | BartMassey/capstone360 | report.py | [
"MIT"
] | Python | _make_student_report_pdf | <not_specific> | def _make_student_report_pdf(student_id, session_id, is_final, is_professor_report=False):
"""
Renders a report for a student, defaulting to the results of their midterm review.
Unless is_professor_report is set to True, the report will be anonymized.
Keyword arguments:
student_id -- id of the stud... |
Renders a report for a student, defaulting to the results of their midterm review.
Unless is_professor_report is set to True, the report will be anonymized.
Keyword arguments:
student_id -- id of the student to generate a report for
session_id -- session to generate reports for
is_final -- if ... | Renders a report for a student, defaulting to the results of their midterm review.
Unless is_professor_report is set to True, the report will be anonymized.
| [
"Renders",
"a",
"report",
"for",
"a",
"student",
"defaulting",
"to",
"the",
"results",
"of",
"their",
"midterm",
"review",
".",
"Unless",
"is_professor_report",
"is",
"set",
"to",
"True",
"the",
"report",
"will",
"be",
"anonymized",
"."
] | def _make_student_report_pdf(student_id, session_id, is_final, is_professor_report=False):
reports = gbmodel.reports().get_reports_for_student(student_id, session_id, is_final)
student = gbmodel.students().get_student_in_session(student_id, session_id)
if student is None:
raise MissingStudentExcepti... | [
"def",
"_make_student_report_pdf",
"(",
"student_id",
",",
"session_id",
",",
"is_final",
",",
"is_professor_report",
"=",
"False",
")",
":",
"reports",
"=",
"gbmodel",
".",
"reports",
"(",
")",
".",
"get_reports_for_student",
"(",
"student_id",
",",
"session_id",... | Renders a report for a student, defaulting to the results of their midterm review. | [
"Renders",
"a",
"report",
"for",
"a",
"student",
"defaulting",
"to",
"the",
"results",
"of",
"their",
"midterm",
"review",
"."
] | [
"\"\"\"\n Renders a report for a student, defaulting to the results of their midterm review.\n Unless is_professor_report is set to True, the report will be anonymized.\n\n Keyword arguments:\n student_id -- id of the student to generate a report for\n session_id -- session to generate reports for\n ... | [
{
"param": "student_id",
"type": null
},
{
"param": "session_id",
"type": null
},
{
"param": "is_final",
"type": null
},
{
"param": "is_professor_report",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "student_id",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "session_id",
"type": null,
"docstring": null,
"docstrin... |
8dba1b0359ab01fd85fbe39317212fd16d5fa390 | BartMassey/capstone360 | catCas.py | [
"MIT"
] | Python | validate_student | <not_specific> | def validate_student():
"""
function to grab cas username and passes the value to gbmmodel to vaidate
INPUT: none
OUTPUT: return False if the id does not exist
return student infomation otherwise
"""
cas = CAS()
username = cas.username
students = gbmodel.students()
found_... |
function to grab cas username and passes the value to gbmmodel to vaidate
INPUT: none
OUTPUT: return False if the id does not exist
return student infomation otherwise
| function to grab cas username and passes the value to gbmmodel to vaidate
INPUT: none
OUTPUT: return False if the id does not exist
return student infomation otherwise | [
"function",
"to",
"grab",
"cas",
"username",
"and",
"passes",
"the",
"value",
"to",
"gbmmodel",
"to",
"vaidate",
"INPUT",
":",
"none",
"OUTPUT",
":",
"return",
"False",
"if",
"the",
"id",
"does",
"not",
"exist",
"return",
"student",
"infomation",
"otherwise"... | def validate_student():
cas = CAS()
username = cas.username
students = gbmodel.students()
found_student = students.validate(username)
if found_student is False:
return False
return found_student | [
"def",
"validate_student",
"(",
")",
":",
"cas",
"=",
"CAS",
"(",
")",
"username",
"=",
"cas",
".",
"username",
"students",
"=",
"gbmodel",
".",
"students",
"(",
")",
"found_student",
"=",
"students",
".",
"validate",
"(",
"username",
")",
"if",
"found_s... | function to grab cas username and passes the value to gbmmodel to vaidate
INPUT: none
OUTPUT: return False if the id does not exist
return student infomation otherwise | [
"function",
"to",
"grab",
"cas",
"username",
"and",
"passes",
"the",
"value",
"to",
"gbmmodel",
"to",
"vaidate",
"INPUT",
":",
"none",
"OUTPUT",
":",
"return",
"False",
"if",
"the",
"id",
"does",
"not",
"exist",
"return",
"student",
"infomation",
"otherwise"... | [
"\"\"\"\n function to grab cas username and passes the value to gbmmodel to vaidate\n INPUT: none\n OUTPUT: return False if the id does not exist\n return student infomation otherwise\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
8dba1b0359ab01fd85fbe39317212fd16d5fa390 | BartMassey/capstone360 | catCas.py | [
"MIT"
] | Python | validate_professor | <not_specific> | def validate_professor():
"""
check to see if professor id is in the professor table
INPUT: none
OUTPUT: return False if the id does not exist
return True otherwise
"""
cas = CAS()
username = cas.username
professors = gbmodel.professors()
found_professors = professors.get... |
check to see if professor id is in the professor table
INPUT: none
OUTPUT: return False if the id does not exist
return True otherwise
| check to see if professor id is in the professor table
INPUT: none
OUTPUT: return False if the id does not exist
return True otherwise | [
"check",
"to",
"see",
"if",
"professor",
"id",
"is",
"in",
"the",
"professor",
"table",
"INPUT",
":",
"none",
"OUTPUT",
":",
"return",
"False",
"if",
"the",
"id",
"does",
"not",
"exist",
"return",
"True",
"otherwise"
] | def validate_professor():
cas = CAS()
username = cas.username
professors = gbmodel.professors()
found_professors = professors.get_professor(username)
if not found_professors:
return False
return found_professors | [
"def",
"validate_professor",
"(",
")",
":",
"cas",
"=",
"CAS",
"(",
")",
"username",
"=",
"cas",
".",
"username",
"professors",
"=",
"gbmodel",
".",
"professors",
"(",
")",
"found_professors",
"=",
"professors",
".",
"get_professor",
"(",
"username",
")",
... | check to see if professor id is in the professor table
INPUT: none
OUTPUT: return False if the id does not exist
return True otherwise | [
"check",
"to",
"see",
"if",
"professor",
"id",
"is",
"in",
"the",
"professor",
"table",
"INPUT",
":",
"none",
"OUTPUT",
":",
"return",
"False",
"if",
"the",
"id",
"does",
"not",
"exist",
"return",
"True",
"otherwise"
] | [
"\"\"\"\n check to see if professor id is in the professor table\n INPUT: none\n OUTPUT: return False if the id does not exist\n return True otherwise\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
cb846b00cc00733b44834466f47a7127f651ee62 | BartMassey/capstone360 | common_functions.py | [
"MIT"
] | Python | display_access_control_error | <not_specific> | def display_access_control_error():
"""
Returns a rendering of an access control violation error message page. Also logs the event
Input: self (so nothing really)
Output: a rendering of the errorMsg.html page with an access control violation message
"""
logging.warning("Someone, who wasn't a pro... |
Returns a rendering of an access control violation error message page. Also logs the event
Input: self (so nothing really)
Output: a rendering of the errorMsg.html page with an access control violation message
| Returns a rendering of an access control violation error message page. Also logs the event
Input: self (so nothing really)
Output: a rendering of the errorMsg.html page with an access control violation message | [
"Returns",
"a",
"rendering",
"of",
"an",
"access",
"control",
"violation",
"error",
"message",
"page",
".",
"Also",
"logs",
"the",
"event",
"Input",
":",
"self",
"(",
"so",
"nothing",
"really",
")",
"Output",
":",
"a",
"rendering",
"of",
"the",
"errorMsg",... | def display_access_control_error():
logging.warning("Someone, who wasn't a professor, tried to access the professor dashboard")
return render_template('errorMsg.html', msg="You can't access this page. You aren't a professor") | [
"def",
"display_access_control_error",
"(",
")",
":",
"logging",
".",
"warning",
"(",
"\"Someone, who wasn't a professor, tried to access the professor dashboard\"",
")",
"return",
"render_template",
"(",
"'errorMsg.html'",
",",
"msg",
"=",
"\"You can't access this page. You aren... | Returns a rendering of an access control violation error message page. | [
"Returns",
"a",
"rendering",
"of",
"an",
"access",
"control",
"violation",
"error",
"message",
"page",
"."
] | [
"\"\"\"\n Returns a rendering of an access control violation error message page. Also logs the event\n Input: self (so nothing really)\n Output: a rendering of the errorMsg.html page with an access control violation message\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
3fc6c6b3575941a9cf9300018fda11b7203f23df | BartMassey/capstone360 | student_register.py | [
"MIT"
] | Python | display_error | <not_specific> | def display_error(self, error_msg):
"""
Returns an error-page rendering of studentRegister.html that displays the given error_msg
Input: self, error_msg
Output: the error-page rendering of the studentRegister.html template
"""
return render_template("studentRegister.html"... |
Returns an error-page rendering of studentRegister.html that displays the given error_msg
Input: self, error_msg
Output: the error-page rendering of the studentRegister.html template
| Returns an error-page rendering of studentRegister.html that displays the given error_msg
Input: self, error_msg
Output: the error-page rendering of the studentRegister.html template | [
"Returns",
"an",
"error",
"-",
"page",
"rendering",
"of",
"studentRegister",
".",
"html",
"that",
"displays",
"the",
"given",
"error_msg",
"Input",
":",
"self",
"error_msg",
"Output",
":",
"the",
"error",
"-",
"page",
"rendering",
"of",
"the",
"studentRegister... | def display_error(self, error_msg):
return render_template("studentRegister.html", message=error_msg, is_error=True) | [
"def",
"display_error",
"(",
"self",
",",
"error_msg",
")",
":",
"return",
"render_template",
"(",
"\"studentRegister.html\"",
",",
"message",
"=",
"error_msg",
",",
"is_error",
"=",
"True",
")"
] | Returns an error-page rendering of studentRegister.html that displays the given error_msg
Input: self, error_msg
Output: the error-page rendering of the studentRegister.html template | [
"Returns",
"an",
"error",
"-",
"page",
"rendering",
"of",
"studentRegister",
".",
"html",
"that",
"displays",
"the",
"given",
"error_msg",
"Input",
":",
"self",
"error_msg",
"Output",
":",
"the",
"error",
"-",
"page",
"rendering",
"of",
"the",
"studentRegister... | [
"\"\"\"\n Returns an error-page rendering of studentRegister.html that displays the given error_msg\n Input: self, error_msg\n Output: the error-page rendering of the studentRegister.html template\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "error_msg",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "error_msg",
"type": null,
"docstring": null,
"docstring_token... |
3fc6c6b3575941a9cf9300018fda11b7203f23df | BartMassey/capstone360 | student_register.py | [
"MIT"
] | Python | post | <not_specific> | def post(self):
"""
Handles student registration requests, which come in the form of POST requests submitted via the form
that is generated in GET requests
Input: self
Output: a rendering of the student register page: with a success message and link to the student
... |
Handles student registration requests, which come in the form of POST requests submitted via the form
that is generated in GET requests
Input: self
Output: a rendering of the student register page: with a success message and link to the student
dashboard if everything we... | Handles student registration requests, which come in the form of POST requests submitted via the form
that is generated in GET requests
Input: self
Output: a rendering of the student register page: with a success message and link to the student
dashboard if everything went well, or with an error message if there was a ... | [
"Handles",
"student",
"registration",
"requests",
"which",
"come",
"in",
"the",
"form",
"of",
"POST",
"requests",
"submitted",
"via",
"the",
"form",
"that",
"is",
"generated",
"in",
"GET",
"requests",
"Input",
":",
"self",
"Output",
":",
"a",
"rendering",
"o... | def post(self):
students = gbmodel.students()
teams = gbmodel.teams()
try:
student_id = CAS().username
name = request.form.getlist('name')[0]
email_address = request.form.getlist('email_address')[0]
session_id = request.form.getlist('session_id')[0... | [
"def",
"post",
"(",
"self",
")",
":",
"students",
"=",
"gbmodel",
".",
"students",
"(",
")",
"teams",
"=",
"gbmodel",
".",
"teams",
"(",
")",
"try",
":",
"student_id",
"=",
"CAS",
"(",
")",
".",
"username",
"name",
"=",
"request",
".",
"form",
".",... | Handles student registration requests, which come in the form of POST requests submitted via the form
that is generated in GET requests
Input: self
Output: a rendering of the student register page: with a success message and link to the student
dashboard if everything went well, or with an error message if there was a ... | [
"Handles",
"student",
"registration",
"requests",
"which",
"come",
"in",
"the",
"form",
"of",
"POST",
"requests",
"submitted",
"via",
"the",
"form",
"that",
"is",
"generated",
"in",
"GET",
"requests",
"Input",
":",
"self",
"Output",
":",
"a",
"rendering",
"o... | [
"\"\"\"\n Handles student registration requests, which come in the form of POST requests submitted via the form\n that is generated in GET requests\n Input: self\n Output: a rendering of the student register page: with a success message and link to the student\n dashboard ... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
67c58fe1c79cb028759b8ddd832dc1b29c57def6 | BartMassey/capstone360 | form.py | [
"MIT"
] | Python | display_error | null | def display_error(self, err_str):
"""
If an unrecoverable error occurs and there is a need to abort,
report an internal server error and print the error to the console.
As the code indicates, this should be reserved for internal errors. User
error should not lead here.
in... |
If an unrecoverable error occurs and there is a need to abort,
report an internal server error and print the error to the console.
As the code indicates, this should be reserved for internal errors. User
error should not lead here.
input: self and a string to report to the conso... | If an unrecoverable error occurs and there is a need to abort,
report an internal server error and print the error to the console.
As the code indicates, this should be reserved for internal errors. User
error should not lead here.
input: self and a string to report to the console
output: none | [
"If",
"an",
"unrecoverable",
"error",
"occurs",
"and",
"there",
"is",
"a",
"need",
"to",
"abort",
"report",
"an",
"internal",
"server",
"error",
"and",
"print",
"the",
"error",
"to",
"the",
"console",
".",
"As",
"the",
"code",
"indicates",
"this",
"should"... | def display_error(self, err_str):
logging.error("Fill Out Review - {}".format(err_str))
abort(500) | [
"def",
"display_error",
"(",
"self",
",",
"err_str",
")",
":",
"logging",
".",
"error",
"(",
"\"Fill Out Review - {}\"",
".",
"format",
"(",
"err_str",
")",
")",
"abort",
"(",
"500",
")"
] | If an unrecoverable error occurs and there is a need to abort,
report an internal server error and print the error to the console. | [
"If",
"an",
"unrecoverable",
"error",
"occurs",
"and",
"there",
"is",
"a",
"need",
"to",
"abort",
"report",
"an",
"internal",
"server",
"error",
"and",
"print",
"the",
"error",
"to",
"the",
"console",
"."
] | [
"\"\"\"\n If an unrecoverable error occurs and there is a need to abort,\n report an internal server error and print the error to the console.\n As the code indicates, this should be reserved for internal errors. User\n error should not lead here.\n input: self and a string to rep... | [
{
"param": "self",
"type": null
},
{
"param": "err_str",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "err_str",
"type": null,
"docstring": null,
"docstring_tokens"... |
67c58fe1c79cb028759b8ddd832dc1b29c57def6 | BartMassey/capstone360 | form.py | [
"MIT"
] | Python | convert_to_int | <not_specific> | def convert_to_int(self, to_convert):
"""
Converts strings to integers and tests if the input was an integer.
User textarea input from reviews should not come into this method.
input: self and a number to be converted to the integer format
output: the same number as an integer
... |
Converts strings to integers and tests if the input was an integer.
User textarea input from reviews should not come into this method.
input: self and a number to be converted to the integer format
output: the same number as an integer
| Converts strings to integers and tests if the input was an integer.
User textarea input from reviews should not come into this method.
input: self and a number to be converted to the integer format
output: the same number as an integer | [
"Converts",
"strings",
"to",
"integers",
"and",
"tests",
"if",
"the",
"input",
"was",
"an",
"integer",
".",
"User",
"textarea",
"input",
"from",
"reviews",
"should",
"not",
"come",
"into",
"this",
"method",
".",
"input",
":",
"self",
"and",
"a",
"number",
... | def convert_to_int(self, to_convert):
try:
to_convert = int(to_convert)
except ValueError:
self.display_error('Expected integer was not a number')
return to_convert | [
"def",
"convert_to_int",
"(",
"self",
",",
"to_convert",
")",
":",
"try",
":",
"to_convert",
"=",
"int",
"(",
"to_convert",
")",
"except",
"ValueError",
":",
"self",
".",
"display_error",
"(",
"'Expected integer was not a number'",
")",
"return",
"to_convert"
] | Converts strings to integers and tests if the input was an integer. | [
"Converts",
"strings",
"to",
"integers",
"and",
"tests",
"if",
"the",
"input",
"was",
"an",
"integer",
"."
] | [
"\"\"\"\n Converts strings to integers and tests if the input was an integer.\n User textarea input from reviews should not come into this method.\n input: self and a number to be converted to the integer format\n output: the same number as an integer\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "to_convert",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "to_convert",
"type": null,
"docstring": null,
"docstring_toke... |
67c58fe1c79cb028759b8ddd832dc1b29c57def6 | BartMassey/capstone360 | form.py | [
"MIT"
] | Python | confirm_user | <not_specific> | def confirm_user(self, user_id, capstone_id):
"""
This method checks to ensure that the user trying to access
the review exists and has an open review.
Input: self and user_id
Output: A boolean indication for
if the user was successfully confirmed (true) or not (false)
... |
This method checks to ensure that the user trying to access
the review exists and has an open review.
Input: self and user_id
Output: A boolean indication for
if the user was successfully confirmed (true) or not (false)
| This method checks to ensure that the user trying to access
the review exists and has an open review.
Input: self and user_id
Output: A boolean indication for
if the user was successfully confirmed (true) or not (false) | [
"This",
"method",
"checks",
"to",
"ensure",
"that",
"the",
"user",
"trying",
"to",
"access",
"the",
"review",
"exists",
"and",
"has",
"an",
"open",
"review",
".",
"Input",
":",
"self",
"and",
"user_id",
"Output",
":",
"A",
"boolean",
"indication",
"for",
... | def confirm_user(self, user_id, capstone_id):
student = gbmodel.students().get_student_in_session(user_id, capstone_id)
if student is None:
return False
available = self.check_available(user_id, capstone_id)
if available is False:
return False
state = self... | [
"def",
"confirm_user",
"(",
"self",
",",
"user_id",
",",
"capstone_id",
")",
":",
"student",
"=",
"gbmodel",
".",
"students",
"(",
")",
".",
"get_student_in_session",
"(",
"user_id",
",",
"capstone_id",
")",
"if",
"student",
"is",
"None",
":",
"return",
"F... | This method checks to ensure that the user trying to access
the review exists and has an open review. | [
"This",
"method",
"checks",
"to",
"ensure",
"that",
"the",
"user",
"trying",
"to",
"access",
"the",
"review",
"exists",
"and",
"has",
"an",
"open",
"review",
"."
] | [
"\"\"\"\n This method checks to ensure that the user trying to access\n the review exists and has an open review.\n Input: self and user_id\n Output: A boolean indication for\n if the user was successfully confirmed (true) or not (false)\n \"\"\"",
"# check if the curren... | [
{
"param": "self",
"type": null
},
{
"param": "user_id",
"type": null
},
{
"param": "capstone_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "user_id",
"type": null,
"docstring": null,
"docstring_tokens"... |
79919584882a1b9ec0ac8ba9fb085a29e3d81ddc | BartMassey/capstone360 | student_dashboard.py | [
"MIT"
] | Python | valid_email | <not_specific> | def valid_email(self, email):
"""
Verify if the new email is in a correct syntax
by checking if it has '@' and '.'
Input: self and new email
Output: return True if it matches the format, False otherwise
"""
if len(email) > 7:
if re.match('^[_a-z0-9-]+(... |
Verify if the new email is in a correct syntax
by checking if it has '@' and '.'
Input: self and new email
Output: return True if it matches the format, False otherwise
| Verify if the new email is in a correct syntax
by checking if it has '@' and '.'
Input: self and new email
Output: return True if it matches the format, False otherwise | [
"Verify",
"if",
"the",
"new",
"email",
"is",
"in",
"a",
"correct",
"syntax",
"by",
"checking",
"if",
"it",
"has",
"'",
"@",
"'",
"and",
"'",
".",
"'",
"Input",
":",
"self",
"and",
"new",
"email",
"Output",
":",
"return",
"True",
"if",
"it",
"matche... | def valid_email(self, email):
if len(email) > 7:
if re.match('^[_a-z0-9-]+(|.[_a-z0-9-]+)*@[a-z0-9-]+'
'(|.[a-z0-9-]+)*(|.[a-z]{2,4})$', email) is not None:
return True
return False | [
"def",
"valid_email",
"(",
"self",
",",
"email",
")",
":",
"if",
"len",
"(",
"email",
")",
">",
"7",
":",
"if",
"re",
".",
"match",
"(",
"'^[_a-z0-9-]+(|.[_a-z0-9-]+)*@[a-z0-9-]+'",
"'(|.[a-z0-9-]+)*(|.[a-z]{2,4})$'",
",",
"email",
")",
"is",
"not",
"None",
... | Verify if the new email is in a correct syntax
by checking if it has '@' and '.' | [
"Verify",
"if",
"the",
"new",
"email",
"is",
"in",
"a",
"correct",
"syntax",
"by",
"checking",
"if",
"it",
"has",
"'",
"@",
"'",
"and",
"'",
".",
"'"
] | [
"\"\"\"\n Verify if the new email is in a correct syntax\n by checking if it has '@' and '.'\n Input: self and new email\n Output: return True if it matches the format, False otherwise\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "email",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "email",
"type": null,
"docstring": null,
"docstring_tokens": ... |
79919584882a1b9ec0ac8ba9fb085a29e3d81ddc | BartMassey/capstone360 | student_dashboard.py | [
"MIT"
] | Python | post | <not_specific> | def post(self):
"""
This method handles post request from editStudent.html
Input: only self
Output: prompt to the user error message if the inputs are invalid
Add new info to the database and return to studentDashboard.html
"""
student = gbmodel.students()... |
This method handles post request from editStudent.html
Input: only self
Output: prompt to the user error message if the inputs are invalid
Add new info to the database and return to studentDashboard.html
| This method handles post request from editStudent.html
Input: only self
Output: prompt to the user error message if the inputs are invalid
Add new info to the database and return to studentDashboard.html | [
"This",
"method",
"handles",
"post",
"request",
"from",
"editStudent",
".",
"html",
"Input",
":",
"only",
"self",
"Output",
":",
"prompt",
"to",
"the",
"user",
"error",
"message",
"if",
"the",
"inputs",
"are",
"invalid",
"Add",
"new",
"info",
"to",
"the",
... | def post(self):
student = gbmodel.students()
student_name = validate_student().name
user_name = validate_student().id
new_name = request.form.get('student_new_name')
new_email = request.form.get('student_new_email')
caps = gbmodel.students().get_user_sessions(user_name)
... | [
"def",
"post",
"(",
"self",
")",
":",
"student",
"=",
"gbmodel",
".",
"students",
"(",
")",
"student_name",
"=",
"validate_student",
"(",
")",
".",
"name",
"user_name",
"=",
"validate_student",
"(",
")",
".",
"id",
"new_name",
"=",
"request",
".",
"form"... | This method handles post request from editStudent.html
Input: only self
Output: prompt to the user error message if the inputs are invalid
Add new info to the database and return to studentDashboard.html | [
"This",
"method",
"handles",
"post",
"request",
"from",
"editStudent",
".",
"html",
"Input",
":",
"only",
"self",
"Output",
":",
"prompt",
"to",
"the",
"user",
"error",
"message",
"if",
"the",
"inputs",
"are",
"invalid",
"Add",
"new",
"info",
"to",
"the",
... | [
"\"\"\"\n This method handles post request from editStudent.html\n Input: only self\n Output: prompt to the user error message if the inputs are invalid\n Add new info to the database and return to studentDashboard.html\n \"\"\"",
"# Only check email validation if new em... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
4eae4a5396b6c3815938016485ade84b8eee42cb | TransitionProjects/IncidentReportDQ | incidentsdq.py | [
"MIT"
] | Python | create_summary | <not_specific> | def create_summary(self, data_frame):
"""
This method will take the data_frame parameter, turn it into a pivot table using pandas'
.pivot_table method and add a new Error Rate column
:data_frame: the errors data_frame
:return: Will return a pivot table using data from the ... |
This method will take the data_frame parameter, turn it into a pivot table using pandas'
.pivot_table method and add a new Error Rate column
:data_frame: the errors data_frame
:return: Will return a pivot table using data from the data_fram parameter
| This method will take the data_frame parameter, turn it into a pivot table using pandas'
.pivot_table method and add a new Error Rate column | [
"This",
"method",
"will",
"take",
"the",
"data_frame",
"parameter",
"turn",
"it",
"into",
"a",
"pivot",
"table",
"using",
"pandas",
"'",
".",
"pivot_table",
"method",
"and",
"add",
"a",
"new",
"Error",
"Rate",
"column"
] | def create_summary(self, data_frame):
staff_pivot = pd.pivot_table(
data_frame,
index=["Dept", "Name"],
values=["Client Uid", "Errors"],
aggfunc={"Client Uid": len, "Errors": np.sum}
)
staff_pivot["Error Rate"] = staff_pivot["Errors"] / (staff_pivo... | [
"def",
"create_summary",
"(",
"self",
",",
"data_frame",
")",
":",
"staff_pivot",
"=",
"pd",
".",
"pivot_table",
"(",
"data_frame",
",",
"index",
"=",
"[",
"\"Dept\"",
",",
"\"Name\"",
"]",
",",
"values",
"=",
"[",
"\"Client Uid\"",
",",
"\"Errors\"",
"]",... | This method will take the data_frame parameter, turn it into a pivot table using pandas'
.pivot_table method and add a new Error Rate column | [
"This",
"method",
"will",
"take",
"the",
"data_frame",
"parameter",
"turn",
"it",
"into",
"a",
"pivot",
"table",
"using",
"pandas",
"'",
".",
"pivot_table",
"method",
"and",
"add",
"a",
"new",
"Error",
"Rate",
"column"
] | [
"\"\"\"\r\n This method will take the data_frame parameter, turn it into a pivot table using pandas'\r\n .pivot_table method and add a new Error Rate column\r\n\r\n :data_frame: the errors data_frame\r\n :return: Will return a pivot table using data from the data_fram parameter\r\n ... | [
{
"param": "self",
"type": null
},
{
"param": "data_frame",
"type": null
}
] | {
"returns": [
{
"docstring": "Will return a pivot table using data from the data_fram parameter",
"docstring_tokens": [
"Will",
"return",
"a",
"pivot",
"table",
"using",
"data",
"from",
"the",
"data_fram",
"parame... |
4eae4a5396b6c3815938016485ade84b8eee42cb | TransitionProjects/IncidentReportDQ | incidentsdq.py | [
"MIT"
] | Python | process | <not_specific> | def process(self):
"""
This method will call the missing_data_check method then create a excel spreadsheet with moth an Errors sheet
and a Raw Data sheet. These will then be saved using an asksaveasfilename function call.
:return: True will be returned if the method completes corr... |
This method will call the missing_data_check method then create a excel spreadsheet with moth an Errors sheet
and a Raw Data sheet. These will then be saved using an asksaveasfilename function call.
:return: True will be returned if the method completes correctly.
| This method will call the missing_data_check method then create a excel spreadsheet with moth an Errors sheet
and a Raw Data sheet. These will then be saved using an asksaveasfilename function call. | [
"This",
"method",
"will",
"call",
"the",
"missing_data_check",
"method",
"then",
"create",
"a",
"excel",
"spreadsheet",
"with",
"moth",
"an",
"Errors",
"sheet",
"and",
"a",
"Raw",
"Data",
"sheet",
".",
"These",
"will",
"then",
"be",
"saved",
"using",
"an",
... | def process(self):
raw = self.raw_data.copy()[[
"Client Uid",
"Infraction User Creating",
"Infraction User Updating",
"Infraction Provider",
"Infraction Date Added",
"Infraction Banned Start Date",
"Infraction Banned End Date",
... | [
"def",
"process",
"(",
"self",
")",
":",
"raw",
"=",
"self",
".",
"raw_data",
".",
"copy",
"(",
")",
"[",
"[",
"\"Client Uid\"",
",",
"\"Infraction User Creating\"",
",",
"\"Infraction User Updating\"",
",",
"\"Infraction Provider\"",
",",
"\"Infraction Date Added\"... | This method will call the missing_data_check method then create a excel spreadsheet with moth an Errors sheet
and a Raw Data sheet. | [
"This",
"method",
"will",
"call",
"the",
"missing_data_check",
"method",
"then",
"create",
"a",
"excel",
"spreadsheet",
"with",
"moth",
"an",
"Errors",
"sheet",
"and",
"a",
"Raw",
"Data",
"sheet",
"."
] | [
"\"\"\"\r\n This method will call the missing_data_check method then create a excel spreadsheet with moth an Errors sheet\r\n and a Raw Data sheet. These will then be saved using an asksaveasfilename function call.\r\n\r\n :return: True will be returned if the method completes correctly.\r\n ... | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "True will be returned if the method completes correctly.",
"docstring_tokens": [
"True",
"will",
"be",
"returned",
"if",
"the",
"method",
"completes",
"correctly",
"."
],
"type": ... |
5c13d06f7cda5d6eca202dbb65d73a3c15e1d5af | rosefun/semi_supervised_methods | semisupervised/PseudoLabelSSL.py | [
"MIT"
] | Python | predict | <not_specific> | def predict(self, X):
"""
return 1-dim nd.array, scalar value of prediction.
"""
pred = self.model.predict(X, batch_size=self.batch_size, verbose=1)
pred = np.argmax(pred, axis=1)
return pred |
return 1-dim nd.array, scalar value of prediction.
| return 1-dim nd.array, scalar value of prediction. | [
"return",
"1",
"-",
"dim",
"nd",
".",
"array",
"scalar",
"value",
"of",
"prediction",
"."
] | def predict(self, X):
pred = self.model.predict(X, batch_size=self.batch_size, verbose=1)
pred = np.argmax(pred, axis=1)
return pred | [
"def",
"predict",
"(",
"self",
",",
"X",
")",
":",
"pred",
"=",
"self",
".",
"model",
".",
"predict",
"(",
"X",
",",
"batch_size",
"=",
"self",
".",
"batch_size",
",",
"verbose",
"=",
"1",
")",
"pred",
"=",
"np",
".",
"argmax",
"(",
"pred",
",",
... | return 1-dim nd.array, scalar value of prediction. | [
"return",
"1",
"-",
"dim",
"nd",
".",
"array",
"scalar",
"value",
"of",
"prediction",
"."
] | [
"\"\"\"\n\t\treturn 1-dim nd.array, scalar value of prediction. \n\t\t\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "X",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "X",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
341e5dc3be779a10590786febdb0bd36b5251013 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_checkout_debit_card_payment_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
authentication = CreatePaymentAuthenticationRequest.from_dictionary(dictionary.get('authentication')) if dictionary.get('authentication') else None
statement_descriptor = dictionary.get('... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"authentication",
"=",
"CreatePaymentAuthenticationRequest",
".",
"from_dictionary",
"(",
"dictionary",
".",
"get",
"(",
"'authentication'",
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
01688054b97a808a20cc103769b4d5093b6e203f | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_checkout_bank_transfer_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
bank = dictionary.get('bank')
retries = dictionary.get('retries')
return cls(bank,
retries) | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"bank",
"=",
"dictionary",
".",
"get",
"(",
"'bank'",
")",
"retries",
"=",
"dictionary",
".",
"get",
"(",
"'retries'",
")",
"retur... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
772657d057dd8a6c372bff13dfb29ba59f04b4f3 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_order_item_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
id = dictionary.get('id')
amount = dictionary.get('amount')
description = dictionary.get('description')
quantity = dictionary.get('quantity')
category = dictionary... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"id",
"=",
"dictionary",
".",
"get",
"(",
"'id'",
")",
"amount",
"=",
"dictionary",
".",
"get",
"(",
"'amount'",
")",
"description... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
9e97f3050e73ad10818ee2b2c6eaf8b369a9fbd6 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_subscription_item_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
description = dictionary.get('description')
pricing_scheme = CreatePricingSchemeRequest.from_dictionary(dictionary.get('pricing_scheme')) if dictionary.get('pricing_scheme') else None
... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"description",
"=",
"dictionary",
".",
"get",
"(",
"'description'",
")",
"pricing_scheme",
"=",
"CreatePricingSchemeRequest",
".",
"from_d... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
8c0cc1eaae599f02c7f942f740af4b6840d07683 | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/orders_controller.py | [
"MIT"
] | Python | create_order | <not_specific> | def create_order(self,
body,
idempotency_key=None):
"""Does a POST request to /orders.
Creates a new Order
Args:
body (CreateOrderRequest): Request for creating an order
idempotency_key (string, optional): TODO: type de... | Does a POST request to /orders.
Creates a new Order
Args:
body (CreateOrderRequest): Request for creating an order
idempotency_key (string, optional): TODO: type description here.
Returns:
GetOrderResponse: Response from the API.
Raises:... | Does a POST request to /orders.
Creates a new Order | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"orders",
".",
"Creates",
"a",
"new",
"Order"
] | def create_order(self,
body,
idempotency_key=None):
_url_path = '/orders'
_query_builder = self.config.get_base_uri()
_query_builder += _url_path
_query_url = APIHelper.clean_url(_query_builder)
_headers = {
'accept': 'applica... | [
"def",
"create_order",
"(",
"self",
",",
"body",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/orders'",
"_query_builder",
"=",
"self",
".",
"config",
".",
"get_base_uri",
"(",
")",
"_query_builder",
"+=",
"_url_path",
"_query_url",
"=",
... | Does a POST request to /orders. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"orders",
"."
] | [
"\"\"\"Does a POST request to /orders.\r\n\r\n Creates a new Order\r\n\r\n Args:\r\n body (CreateOrderRequest): Request for creating an order\r\n idempotency_key (string, optional): TODO: type description here.\r\n\r\n Returns:\r\n GetOrderResponse: Response fro... | [
{
"param": "self",
"type": null
},
{
"param": "body",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetOrderResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\nth... |
43d3155c522d2f14ea5b26a47338ffa2b94a6895 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_split_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
mtype = dictionary.get('type')
amount = dictionary.get('amount')
gateway_id = dictionary.get('gateway_id')
id = dictionary.get('id')
recipient = GetRecipientRespon... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"mtype",
"=",
"dictionary",
".",
"get",
"(",
"'type'",
")",
"amount",
"=",
"dictionary",
".",
"get",
"(",
"'amount'",
")",
"gatewa... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
939e06d75801810c57973df309f58e6998f5178b | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_checkout_pix_payment_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
expires_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires_at")).datetime if dictionary.get("expires_at") else None
additional_information = None
if dictionary.get(... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"expires_at",
"=",
"APIHelper",
".",
"RFC3339DateTime",
".",
"from_value",
"(",
"dictionary",
".",
"get",
"(",
"\"expires_at\"",
")",
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
c4f2d779bbe2bca677112a269a11848317fc7d60 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/list_seller_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
data = None
if dictionary.get('data') is not None:
data = [GetSellerResponse.from_dictionary(x) for x in dictionary.get('data')]
paging = PagingResponse.from_dictionar... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"data",
"=",
"None",
"if",
"dictionary",
".",
"get",
"(",
"'data'",
")",
"is",
"not",
"None",
":",
"data",
"=",
"[",
"GetSellerR... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
a4dfaf4527928a3b64b4ef34c31be4750c06e902 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/list_access_tokens_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
data = None
if dictionary.get('data') is not None:
data = [GetAccessTokenResponse.from_dictionary(x) for x in dictionary.get('data')]
paging = PagingResponse.from_dict... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"data",
"=",
"None",
"if",
"dictionary",
".",
"get",
"(",
"'data'",
")",
"is",
"not",
"None",
":",
"data",
"=",
"[",
"GetAccessT... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
7d2db7b328a85b7f8b1281bf51be8d2177318da9 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_debit_card_payment_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
statement_descriptor = dictionary.get('statement_descriptor')
card = CreateCardRequest.from_dictionary(dictionary.get('card')) if dictionary.get('card') else None
card_id = dictio... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"statement_descriptor",
"=",
"dictionary",
".",
"get",
"(",
"'statement_descriptor'",
")",
"card",
"=",
"CreateCardRequest",
".",
"from_di... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
7ed185780a685fe694b849015e9cf87507314b70 | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/transfers_controller.py | [
"MIT"
] | Python | create_transfer | <not_specific> | def create_transfer(self,
request):
"""Does a POST request to /transfers/recipients.
TODO: type endpoint description here.
Args:
request (CreateTransfer): TODO: type description here.
Returns:
GetTransfer: Response from the API... | Does a POST request to /transfers/recipients.
TODO: type endpoint description here.
Args:
request (CreateTransfer): TODO: type description here.
Returns:
GetTransfer: Response from the API.
Raises:
APIException: When an error occurs whil... | Does a POST request to /transfers/recipients.
TODO: type endpoint description here. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"transfers",
"/",
"recipients",
".",
"TODO",
":",
"type",
"endpoint",
"description",
"here",
"."
] | def create_transfer(self,
request):
_url_path = '/transfers/recipients'
_query_builder = self.config.get_base_uri()
_query_builder += _url_path
_query_url = APIHelper.clean_url(_query_builder)
_headers = {
'accept': 'application/json',
... | [
"def",
"create_transfer",
"(",
"self",
",",
"request",
")",
":",
"_url_path",
"=",
"'/transfers/recipients'",
"_query_builder",
"=",
"self",
".",
"config",
".",
"get_base_uri",
"(",
")",
"_query_builder",
"+=",
"_url_path",
"_query_url",
"=",
"APIHelper",
".",
"... | Does a POST request to /transfers/recipients. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"transfers",
"/",
"recipients",
"."
] | [
"\"\"\"Does a POST request to /transfers/recipients.\r\n\r\n TODO: type endpoint description here.\r\n\r\n Args:\r\n request (CreateTransfer): TODO: type description here.\r\n\r\n Returns:\r\n GetTransfer: Response from the API.\r\n\r\n Raises:\r\n APIExc... | [
{
"param": "self",
"type": null
},
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetTransfer"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\nthe rem... |
7b531396748a2e2bcaead502f5cce16a7e7559b1 | pagarme/pagarme-python-sdk | pagarmeapisdk/http/auth/basic_auth.py | [
"MIT"
] | Python | apply | null | def apply(self, http_request):
""" Add basic authentication to the request.
Args:
http_request (HttpRequest): The HttpRequest object to which
authentication will be added.
"""
username = self._basic_auth_user_name
password = self._basic_auth... | Add basic authentication to the request.
Args:
http_request (HttpRequest): The HttpRequest object to which
authentication will be added.
| Add basic authentication to the request. | [
"Add",
"basic",
"authentication",
"to",
"the",
"request",
"."
] | def apply(self, http_request):
username = self._basic_auth_user_name
password = self._basic_auth_password
joined = "{}:{}".format(username, password)
encoded = base64.b64encode(str.encode(joined)).decode('iso-8859-1')
header_value = "Basic {}".format(encoded)
http_request... | [
"def",
"apply",
"(",
"self",
",",
"http_request",
")",
":",
"username",
"=",
"self",
".",
"_basic_auth_user_name",
"password",
"=",
"self",
".",
"_basic_auth_password",
"joined",
"=",
"\"{}:{}\"",
".",
"format",
"(",
"username",
",",
"password",
")",
"encoded"... | Add basic authentication to the request. | [
"Add",
"basic",
"authentication",
"to",
"the",
"request",
"."
] | [
"\"\"\" Add basic authentication to the request.\r\n\r\n Args:\r\n http_request (HttpRequest): The HttpRequest object to which\r\n authentication will be added.\r\n\r\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "http_request",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "http_request",
"type": null,
"docstring": "The HttpRequest object t... |
7b531396748a2e2bcaead502f5cce16a7e7559b1 | pagarme/pagarme-python-sdk | pagarmeapisdk/http/auth/basic_auth.py | [
"MIT"
] | Python | error_message | <not_specific> | def error_message(self):
"""Display error message on occurrence of authentication faliure
in BasicAuth
"""
return "BasicAuth: _basic_auth_user_name or _basic_auth_password is undefined." | Display error message on occurrence of authentication faliure
in BasicAuth
| Display error message on occurrence of authentication faliure
in BasicAuth | [
"Display",
"error",
"message",
"on",
"occurrence",
"of",
"authentication",
"faliure",
"in",
"BasicAuth"
] | def error_message(self):
return "BasicAuth: _basic_auth_user_name or _basic_auth_password is undefined." | [
"def",
"error_message",
"(",
"self",
")",
":",
"return",
"\"BasicAuth: _basic_auth_user_name or _basic_auth_password is undefined.\""
] | Display error message on occurrence of authentication faliure
in BasicAuth | [
"Display",
"error",
"message",
"on",
"occurrence",
"of",
"authentication",
"faliure",
"in",
"BasicAuth"
] | [
"\"\"\"Display error message on occurrence of authentication faliure\r\n in BasicAuth\r\n\r\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55d9d4984c42b62c9048ae00f314c6b681e85027 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/update_subscription_payment_method_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
payment_method = dictionary.get('payment_method')
card_id = dictionary.get('card_id')
card = CreateCardRequest.from_dictionary(dictionary.get('card')) if dictionary.get('card') el... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"payment_method",
"=",
"dictionary",
".",
"get",
"(",
"'payment_method'",
")",
"card_id",
"=",
"dictionary",
".",
"get",
"(",
"'card_i... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
8d23ddd37c179187110dd384887e2336ccaf1b57 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_emv_decrypt_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
icc_data = dictionary.get('icc_data')
card_sequence_number = dictionary.get('card_sequence_number')
data = CreateEmvDataDecryptRequest.from_dictionary(dictionary.get('data')) if d... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"icc_data",
"=",
"dictionary",
".",
"get",
"(",
"'icc_data'",
")",
"card_sequence_number",
"=",
"dictionary",
".",
"get",
"(",
"'card_... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
b2830ae0504e3eb3b423a62dbcdc66e09be7e2fa | pagarme/pagarme-python-sdk | pagarmeapisdk/models/list_addresses_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
data = None
if dictionary.get('data') is not None:
data = [GetAddressResponse.from_dictionary(x) for x in dictionary.get('data')]
paging = PagingResponse.from_dictiona... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"data",
"=",
"None",
"if",
"dictionary",
".",
"get",
"(",
"'data'",
")",
"is",
"not",
"None",
":",
"data",
"=",
"[",
"GetAddress... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
d07525511e2ec99df703179306d9075ca126da1c | pagarme/pagarme-python-sdk | pagarmeapisdk/models/cancel_split_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
mtype = dictionary.get('type')
amount = dictionary.get('amount')
recipient_id = dictionary.get('recipient_id')
options = CreateSplitOptionsRequest.from_dictionary(dictiona... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"mtype",
"=",
"dictionary",
".",
"get",
"(",
"'type'",
")",
"amount",
"=",
"dictionary",
".",
"get",
"(",
"'amount'",
")",
"recipi... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
6af38c0dd8e95fecc9addea0e616d9e2c625e8c5 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/update_seller_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
name = dictionary.get('name')
code = dictionary.get('code')
description = dictionary.get('description')
document = dictionary.get('document')
status = dictionary.g... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"name",
"=",
"dictionary",
".",
"get",
"(",
"'name'",
")",
"code",
"=",
"dictionary",
".",
"get",
"(",
"'code'",
")",
"description... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
3d98127eda74d3999e71edb05169c94b3e1e697b | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_payment_authentication_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
mtype = dictionary.get('type')
threed_secure = CreateThreeDSecureRequest.from_dictionary(dictionary.get('threed_secure')) if dictionary.get('threed_secure') else None
return cls(m... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"mtype",
"=",
"dictionary",
".",
"get",
"(",
"'type'",
")",
"threed_secure",
"=",
"CreateThreeDSecureRequest",
".",
"from_dictionary",
"... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
b8edcdcb06d76347e91b7411a2d5266156a4f9e3 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_plan_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
id = dictionary.get('id')
name = dictionary.get('name')
description = dictionary.get('description')
url = dictionary.get('url')
statement_descriptor = dictionary.g... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"id",
"=",
"dictionary",
".",
"get",
"(",
"'id'",
")",
"name",
"=",
"dictionary",
".",
"get",
"(",
"'name'",
")",
"description",
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
c5867c8786c096fd3607598d515ad7ea58ddf303 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_charges_summary_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
total = dictionary.get('total')
return cls(total) | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"total",
"=",
"dictionary",
".",
"get",
"(",
"'total'",
")",
"return",
"cls",
"(",
"total",
")"
] | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
179f5b593a9655cb308d13d5474f99e4043fdc07 | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/charges_controller.py | [
"MIT"
] | Python | create_charge | <not_specific> | def create_charge(self,
request,
idempotency_key=None):
"""Does a POST request to /Charges.
Creates a new charge
Args:
request (CreateChargeRequest): Request for creating a charge
idempotency_key (string, optional): T... | Does a POST request to /Charges.
Creates a new charge
Args:
request (CreateChargeRequest): Request for creating a charge
idempotency_key (string, optional): TODO: type description here.
Returns:
GetChargeResponse: Response from the API.
... | Does a POST request to /Charges.
Creates a new charge | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"Charges",
".",
"Creates",
"a",
"new",
"charge"
] | def create_charge(self,
request,
idempotency_key=None):
_url_path = '/Charges'
_query_builder = self.config.get_base_uri()
_query_builder += _url_path
_query_url = APIHelper.clean_url(_query_builder)
_headers = {
'accept': '... | [
"def",
"create_charge",
"(",
"self",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/Charges'",
"_query_builder",
"=",
"self",
".",
"config",
".",
"get_base_uri",
"(",
")",
"_query_builder",
"+=",
"_url_path",
"_query_url",
... | Does a POST request to /Charges. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"Charges",
"."
] | [
"\"\"\"Does a POST request to /Charges.\r\n\r\n Creates a new charge\r\n\r\n Args:\r\n request (CreateChargeRequest): Request for creating a charge\r\n idempotency_key (string, optional): TODO: type description here.\r\n\r\n Returns:\r\n GetChargeResponse: Respo... | [
{
"param": "self",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetChargeResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\nt... |
ec35099fc401ebf2163fe762ec3daaffb9bd2dba | pagarme/pagarme-python-sdk | pagarmeapisdk/models/list_cycles_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
data = None
if dictionary.get('data') is not None:
data = [GetPeriodResponse.from_dictionary(x) for x in dictionary.get('data')]
paging = PagingResponse.from_dictionar... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"data",
"=",
"None",
"if",
"dictionary",
".",
"get",
"(",
"'data'",
")",
"is",
"not",
"None",
":",
"data",
"=",
"[",
"GetPeriodR... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
4bbe42e2f547846e9b861652945e6b3b0c73dfbc | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/plans_controller.py | [
"MIT"
] | Python | create_plan | <not_specific> | def create_plan(self,
body,
idempotency_key=None):
"""Does a POST request to /plans.
Creates a new plan
Args:
body (CreatePlanRequest): Request for creating a plan
idempotency_key (string, optional): TODO: type descriptio... | Does a POST request to /plans.
Creates a new plan
Args:
body (CreatePlanRequest): Request for creating a plan
idempotency_key (string, optional): TODO: type description here.
Returns:
GetPlanResponse: Response from the API.
Raises:
... | Does a POST request to /plans.
Creates a new plan | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"plans",
".",
"Creates",
"a",
"new",
"plan"
] | def create_plan(self,
body,
idempotency_key=None):
_url_path = '/plans'
_query_builder = self.config.get_base_uri()
_query_builder += _url_path
_query_url = APIHelper.clean_url(_query_builder)
_headers = {
'accept': 'application... | [
"def",
"create_plan",
"(",
"self",
",",
"body",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/plans'",
"_query_builder",
"=",
"self",
".",
"config",
".",
"get_base_uri",
"(",
")",
"_query_builder",
"+=",
"_url_path",
"_query_url",
"=",
... | Does a POST request to /plans. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"plans",
"."
] | [
"\"\"\"Does a POST request to /plans.\r\n\r\n Creates a new plan\r\n\r\n Args:\r\n body (CreatePlanRequest): Request for creating a plan\r\n idempotency_key (string, optional): TODO: type description here.\r\n\r\n Returns:\r\n GetPlanResponse: Response from the ... | [
{
"param": "self",
"type": null
},
{
"param": "body",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetPlanResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\nthe... |
ad03e35848a56732de7a01cf68a9935d52f8a642 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_pix_bank_account_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
bank_name = dictionary.get('bank_name')
ispb = dictionary.get('ispb')
branch_code = dictionary.get('branch_code')
account_number = dictionary.get('account_number')
... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"bank_name",
"=",
"dictionary",
".",
"get",
"(",
"'bank_name'",
")",
"ispb",
"=",
"dictionary",
".",
"get",
"(",
"'ispb'",
")",
"b... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
c9a67d2be29e8f21c5bf27fa661334073dec77cb | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/recipients_controller.py | [
"MIT"
] | Python | create_anticipation | <not_specific> | def create_anticipation(self,
recipient_id,
request,
idempotency_key=None):
"""Does a POST request to /recipients/{recipient_id}/anticipations.
Creates an anticipation
Args:
recipient_id (s... | Does a POST request to /recipients/{recipient_id}/anticipations.
Creates an anticipation
Args:
recipient_id (string): Recipient id
request (CreateAnticipationRequest): Anticipation data
idempotency_key (string, optional): TODO: type description here.
... | Does a POST request to /recipients/{recipient_id}/anticipations.
Creates an anticipation | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"anticipations",
".",
"Creates",
"an",
"anticipation"
] | def create_anticipation(self,
recipient_id,
request,
idempotency_key=None):
_url_path = '/recipients/{recipient_id}/anticipations'
_url_path = APIHelper.append_url_with_template_parameters(_url_path, {
'recip... | [
"def",
"create_anticipation",
"(",
"self",
",",
"recipient_id",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/recipients/{recipient_id}/anticipations'",
"_url_path",
"=",
"APIHelper",
".",
"append_url_with_template_parameters",
"(",
... | Does a POST request to /recipients/{recipient_id}/anticipations. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"anticipations",
"."
] | [
"\"\"\"Does a POST request to /recipients/{recipient_id}/anticipations.\r\n\r\n Creates an anticipation\r\n\r\n Args:\r\n recipient_id (string): Recipient id\r\n request (CreateAnticipationRequest): Anticipation data\r\n idempotency_key (string, optional): TODO: type d... | [
{
"param": "self",
"type": null
},
{
"param": "recipient_id",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetAnticipationResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data f... |
c9a67d2be29e8f21c5bf27fa661334073dec77cb | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/recipients_controller.py | [
"MIT"
] | Python | update_recipient_default_bank_account | <not_specific> | def update_recipient_default_bank_account(self,
recipient_id,
request,
idempotency_key=None):
"""Does a PATCH request to /recipients/{recipient_id}/default-bank-account.
... | Does a PATCH request to /recipients/{recipient_id}/default-bank-account.
Updates the default bank account from a recipient
Args:
recipient_id (string): Recipient id
request (UpdateRecipientBankAccountRequest): Bank account data
idempotency_key (string, option... | Does a PATCH request to /recipients/{recipient_id}/default-bank-account.
Updates the default bank account from a recipient | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"default",
"-",
"bank",
"-",
"account",
".",
"Updates",
"the",
"default",
"bank",
"account",
"from",
"a",
"recipient"
] | def update_recipient_default_bank_account(self,
recipient_id,
request,
idempotency_key=None):
_url_path = '/recipients/{recipient_id}/default-bank-account'
_url_path ... | [
"def",
"update_recipient_default_bank_account",
"(",
"self",
",",
"recipient_id",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/recipients/{recipient_id}/default-bank-account'",
"_url_path",
"=",
"APIHelper",
".",
"append_url_with_templ... | Does a PATCH request to /recipients/{recipient_id}/default-bank-account. | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"default",
"-",
"bank",
"-",
"account",
"."
] | [
"\"\"\"Does a PATCH request to /recipients/{recipient_id}/default-bank-account.\r\n\r\n Updates the default bank account from a recipient\r\n\r\n Args:\r\n recipient_id (string): Recipient id\r\n request (UpdateRecipientBankAccountRequest): Bank account data\r\n idempo... | [
{
"param": "self",
"type": null
},
{
"param": "recipient_id",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetRecipientResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from... |
c9a67d2be29e8f21c5bf27fa661334073dec77cb | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/recipients_controller.py | [
"MIT"
] | Python | create_transfer | <not_specific> | def create_transfer(self,
recipient_id,
request,
idempotency_key=None):
"""Does a POST request to /recipients/{recipient_id}/transfers.
Creates a transfer for a recipient
Args:
recipient_id (string): R... | Does a POST request to /recipients/{recipient_id}/transfers.
Creates a transfer for a recipient
Args:
recipient_id (string): Recipient Id
request (CreateTransferRequest): Transfer data
idempotency_key (string, optional): TODO: type description here.
... | Does a POST request to /recipients/{recipient_id}/transfers.
Creates a transfer for a recipient | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"transfers",
".",
"Creates",
"a",
"transfer",
"for",
"a",
"recipient"
] | def create_transfer(self,
recipient_id,
request,
idempotency_key=None):
_url_path = '/recipients/{recipient_id}/transfers'
_url_path = APIHelper.append_url_with_template_parameters(_url_path, {
'recipient_id': {'value': ... | [
"def",
"create_transfer",
"(",
"self",
",",
"recipient_id",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/recipients/{recipient_id}/transfers'",
"_url_path",
"=",
"APIHelper",
".",
"append_url_with_template_parameters",
"(",
"_url_p... | Does a POST request to /recipients/{recipient_id}/transfers. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"transfers",
"."
] | [
"\"\"\"Does a POST request to /recipients/{recipient_id}/transfers.\r\n\r\n Creates a transfer for a recipient\r\n\r\n Args:\r\n recipient_id (string): Recipient Id\r\n request (CreateTransferRequest): Transfer data\r\n idempotency_key (string, optional): TODO: type de... | [
{
"param": "self",
"type": null
},
{
"param": "recipient_id",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetTransferResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\... |
c9a67d2be29e8f21c5bf27fa661334073dec77cb | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/recipients_controller.py | [
"MIT"
] | Python | create_recipient | <not_specific> | def create_recipient(self,
request,
idempotency_key=None):
"""Does a POST request to /recipients.
Creates a new recipient
Args:
request (CreateRecipientRequest): Recipient data
idempotency_key (string, optional)... | Does a POST request to /recipients.
Creates a new recipient
Args:
request (CreateRecipientRequest): Recipient data
idempotency_key (string, optional): TODO: type description here.
Returns:
GetRecipientResponse: Response from the API.
Rai... | Does a POST request to /recipients.
Creates a new recipient | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"recipients",
".",
"Creates",
"a",
"new",
"recipient"
] | def create_recipient(self,
request,
idempotency_key=None):
_url_path = '/recipients'
_query_builder = self.config.get_base_uri()
_query_builder += _url_path
_query_url = APIHelper.clean_url(_query_builder)
_headers = {
... | [
"def",
"create_recipient",
"(",
"self",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/recipients'",
"_query_builder",
"=",
"self",
".",
"config",
".",
"get_base_uri",
"(",
")",
"_query_builder",
"+=",
"_url_path",
"_query_ur... | Does a POST request to /recipients. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"recipients",
"."
] | [
"\"\"\"Does a POST request to /recipients.\r\n\r\n Creates a new recipient\r\n\r\n Args:\r\n request (CreateRecipientRequest): Recipient data\r\n idempotency_key (string, optional): TODO: type description here.\r\n\r\n Returns:\r\n GetRecipientResponse: Response... | [
{
"param": "self",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetRecipientResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from... |
c9a67d2be29e8f21c5bf27fa661334073dec77cb | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/recipients_controller.py | [
"MIT"
] | Python | update_automatic_anticipation_settings | <not_specific> | def update_automatic_anticipation_settings(self,
recipient_id,
request,
idempotency_key=None):
"""Does a PATCH request to /recipients/{recipient_id}/automatic-anticipa... | Does a PATCH request to /recipients/{recipient_id}/automatic-anticipation-settings.
Updates recipient metadata
Args:
recipient_id (string): Recipient id
request (UpdateAutomaticAnticipationSettingsRequest): Metadata
idempotency_key (string, optional): TODO: t... | Does a PATCH request to /recipients/{recipient_id}/automatic-anticipation-settings.
Updates recipient metadata | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"automatic",
"-",
"anticipation",
"-",
"settings",
".",
"Updates",
"recipient",
"metadata"
] | def update_automatic_anticipation_settings(self,
recipient_id,
request,
idempotency_key=None):
_url_path = '/recipients/{recipient_id}/automatic-anticipation-settings'
... | [
"def",
"update_automatic_anticipation_settings",
"(",
"self",
",",
"recipient_id",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/recipients/{recipient_id}/automatic-anticipation-settings'",
"_url_path",
"=",
"APIHelper",
".",
"append_ur... | Does a PATCH request to /recipients/{recipient_id}/automatic-anticipation-settings. | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"recipients",
"/",
"{",
"recipient_id",
"}",
"/",
"automatic",
"-",
"anticipation",
"-",
"settings",
"."
] | [
"\"\"\"Does a PATCH request to /recipients/{recipient_id}/automatic-anticipation-settings.\r\n\r\n Updates recipient metadata\r\n\r\n Args:\r\n recipient_id (string): Recipient id\r\n request (UpdateAutomaticAnticipationSettingsRequest): Metadata\r\n idempotency_key (s... | [
{
"param": "self",
"type": null
},
{
"param": "recipient_id",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetRecipientResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from... |
920896aae256bf874fb37f86cab460d06540567f | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_payment_authentication_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
mtype = dictionary.get('type')
threed_secure = GetThreeDSecureResponse.from_dictionary(dictionary.get('threed_secure')) if dictionary.get('threed_secure') else None
return cls(mty... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"mtype",
"=",
"dictionary",
".",
"get",
"(",
"'type'",
")",
"threed_secure",
"=",
"GetThreeDSecureResponse",
".",
"from_dictionary",
"("... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
02e4fb9dc9e3efe7533c309d38ebee1418f1b31d | pagarme/pagarme-python-sdk | pagarmeapisdk/models/get_plan_item_response.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
id = dictionary.get('id')
name = dictionary.get('name')
status = dictionary.get('status')
created_at = APIHelper.RFC3339DateTime.from_value(dictionary.get("created_at")).d... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"id",
"=",
"dictionary",
".",
"get",
"(",
"'id'",
")",
"name",
"=",
"dictionary",
".",
"get",
"(",
"'name'",
")",
"status",
"=",... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
ff26d3762382df82199c3b3779eb1b80cd169781 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_token_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
mtype = dictionary.get("type") if dictionary.get("type") else 'card'
card = CreateCardTokenRequest.from_dictionary(dictionary.get('card')) if dictionary.get('card') else None
retu... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"mtype",
"=",
"dictionary",
".",
"get",
"(",
"\"type\"",
")",
"if",
"dictionary",
".",
"get",
"(",
"\"type\"",
")",
"else",
"'card... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
357b89dc6df4e5094193930ffe7ca8323ed05e01 | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/customers_controller.py | [
"MIT"
] | Python | create_address | <not_specific> | def create_address(self,
customer_id,
request,
idempotency_key=None):
"""Does a POST request to /customers/{customer_id}/addresses.
Creates a new address for a customer
Args:
customer_id (string): Custome... | Does a POST request to /customers/{customer_id}/addresses.
Creates a new address for a customer
Args:
customer_id (string): Customer Id
request (CreateAddressRequest): Request for creating an address
idempotency_key (string, optional): TODO: type description ... | Does a POST request to /customers/{customer_id}/addresses.
Creates a new address for a customer | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"customers",
"/",
"{",
"customer_id",
"}",
"/",
"addresses",
".",
"Creates",
"a",
"new",
"address",
"for",
"a",
"customer"
] | def create_address(self,
customer_id,
request,
idempotency_key=None):
_url_path = '/customers/{customer_id}/addresses'
_url_path = APIHelper.append_url_with_template_parameters(_url_path, {
'customer_id': {'value': customer... | [
"def",
"create_address",
"(",
"self",
",",
"customer_id",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/customers/{customer_id}/addresses'",
"_url_path",
"=",
"APIHelper",
".",
"append_url_with_template_parameters",
"(",
"_url_path"... | Does a POST request to /customers/{customer_id}/addresses. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"customers",
"/",
"{",
"customer_id",
"}",
"/",
"addresses",
"."
] | [
"\"\"\"Does a POST request to /customers/{customer_id}/addresses.\r\n\r\n Creates a new address for a customer\r\n\r\n Args:\r\n customer_id (string): Customer Id\r\n request (CreateAddressRequest): Request for creating an address\r\n idempotency_key (string, optional)... | [
{
"param": "self",
"type": null
},
{
"param": "customer_id",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetAddressResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\n... |
357b89dc6df4e5094193930ffe7ca8323ed05e01 | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/customers_controller.py | [
"MIT"
] | Python | create_customer | <not_specific> | def create_customer(self,
request,
idempotency_key=None):
"""Does a POST request to /customers.
Creates a new customer
Args:
request (CreateCustomerRequest): Request for creating a customer
idempotency_key (string... | Does a POST request to /customers.
Creates a new customer
Args:
request (CreateCustomerRequest): Request for creating a customer
idempotency_key (string, optional): TODO: type description here.
Returns:
GetCustomerResponse: Response from the API.
... | Does a POST request to /customers.
Creates a new customer | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"customers",
".",
"Creates",
"a",
"new",
"customer"
] | def create_customer(self,
request,
idempotency_key=None):
_url_path = '/customers'
_query_builder = self.config.get_base_uri()
_query_builder += _url_path
_query_url = APIHelper.clean_url(_query_builder)
_headers = {
'ac... | [
"def",
"create_customer",
"(",
"self",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/customers'",
"_query_builder",
"=",
"self",
".",
"config",
".",
"get_base_uri",
"(",
")",
"_query_builder",
"+=",
"_url_path",
"_query_url"... | Does a POST request to /customers. | [
"Does",
"a",
"POST",
"request",
"to",
"/",
"customers",
"."
] | [
"\"\"\"Does a POST request to /customers.\r\n\r\n Creates a new customer\r\n\r\n Args:\r\n request (CreateCustomerRequest): Request for creating a customer\r\n idempotency_key (string, optional): TODO: type description here.\r\n\r\n Returns:\r\n GetCustomerRespo... | [
{
"param": "self",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetCustomerResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\... |
357b89dc6df4e5094193930ffe7ca8323ed05e01 | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/customers_controller.py | [
"MIT"
] | Python | update_customer_metadata | <not_specific> | def update_customer_metadata(self,
customer_id,
request,
idempotency_key=None):
"""Does a PATCH request to /Customers/{customer_id}/metadata.
Updates the metadata a customer
Args:
... | Does a PATCH request to /Customers/{customer_id}/metadata.
Updates the metadata a customer
Args:
customer_id (string): The customer id
request (UpdateMetadataRequest): Request for updating the customer
metadata
idempotency_key (string, option... | Does a PATCH request to /Customers/{customer_id}/metadata.
Updates the metadata a customer | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"Customers",
"/",
"{",
"customer_id",
"}",
"/",
"metadata",
".",
"Updates",
"the",
"metadata",
"a",
"customer"
] | def update_customer_metadata(self,
customer_id,
request,
idempotency_key=None):
_url_path = '/Customers/{customer_id}/metadata'
_url_path = APIHelper.append_url_with_template_parameters(_url_path, {
... | [
"def",
"update_customer_metadata",
"(",
"self",
",",
"customer_id",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/Customers/{customer_id}/metadata'",
"_url_path",
"=",
"APIHelper",
".",
"append_url_with_template_parameters",
"(",
"_... | Does a PATCH request to /Customers/{customer_id}/metadata. | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"Customers",
"/",
"{",
"customer_id",
"}",
"/",
"metadata",
"."
] | [
"\"\"\"Does a PATCH request to /Customers/{customer_id}/metadata.\r\n\r\n Updates the metadata a customer\r\n\r\n Args:\r\n customer_id (string): The customer id\r\n request (UpdateMetadataRequest): Request for updating the customer\r\n metadata\r\n idem... | [
{
"param": "self",
"type": null
},
{
"param": "customer_id",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetCustomerResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\... |
a652e388d6dc9689f6e12ba1601c4680809180f4 | pagarme/pagarme-python-sdk | pagarmeapisdk/models/create_antifraud_request.py | [
"MIT"
] | Python | from_dictionary | <not_specific> | def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
key... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
Returns:
... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. The
keys MUST match property names in the API description.
An instance of this structure class. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | def from_dictionary(cls,
dictionary):
if dictionary is None:
return None
mtype = dictionary.get('type')
clearsale = CreateClearSaleRequest.from_dictionary(dictionary.get('clearsale')) if dictionary.get('clearsale') else None
return cls(mtype,
... | [
"def",
"from_dictionary",
"(",
"cls",
",",
"dictionary",
")",
":",
"if",
"dictionary",
"is",
"None",
":",
"return",
"None",
"mtype",
"=",
"dictionary",
".",
"get",
"(",
"'type'",
")",
"clearsale",
"=",
"CreateClearSaleRequest",
".",
"from_dictionary",
"(",
"... | Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object
as obtained from the deserialization of the server's response. | [
"Creates",
"an",
"instance",
"of",
"this",
"model",
"from",
"a",
"dictionary",
"Args",
":",
"dictionary",
"(",
"dictionary",
")",
":",
"A",
"dictionary",
"representation",
"of",
"the",
"object",
"as",
"obtained",
"from",
"the",
"deserialization",
"of",
"the",
... | [
"\"\"\"Creates an instance of this model from a dictionary\r\n\r\n Args:\r\n dictionary (dictionary): A dictionary representation of the object\r\n as obtained from the deserialization of the server's response. The\r\n keys MUST match property names in the API description.\r\... | [
{
"param": "cls",
"type": null
},
{
"param": "dictionary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dictionary",
"type": null,
"docstring": null,
"docstring_token... |
f75b03a35eb8fbc493908878114086e8f2549c2f | pagarme/pagarme-python-sdk | pagarmeapisdk/controllers/invoices_controller.py | [
"MIT"
] | Python | update_invoice_metadata | <not_specific> | def update_invoice_metadata(self,
invoice_id,
request,
idempotency_key=None):
"""Does a PATCH request to /invoices/{invoice_id}/metadata.
Updates the metadata from an invoice
Args:
... | Does a PATCH request to /invoices/{invoice_id}/metadata.
Updates the metadata from an invoice
Args:
invoice_id (string): The invoice id
request (UpdateMetadataRequest): Request for updating the invoice
metadata
idempotency_key (string, option... | Does a PATCH request to /invoices/{invoice_id}/metadata.
Updates the metadata from an invoice | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"invoices",
"/",
"{",
"invoice_id",
"}",
"/",
"metadata",
".",
"Updates",
"the",
"metadata",
"from",
"an",
"invoice"
] | def update_invoice_metadata(self,
invoice_id,
request,
idempotency_key=None):
_url_path = '/invoices/{invoice_id}/metadata'
_url_path = APIHelper.append_url_with_template_parameters(_url_path, {
'... | [
"def",
"update_invoice_metadata",
"(",
"self",
",",
"invoice_id",
",",
"request",
",",
"idempotency_key",
"=",
"None",
")",
":",
"_url_path",
"=",
"'/invoices/{invoice_id}/metadata'",
"_url_path",
"=",
"APIHelper",
".",
"append_url_with_template_parameters",
"(",
"_url_... | Does a PATCH request to /invoices/{invoice_id}/metadata. | [
"Does",
"a",
"PATCH",
"request",
"to",
"/",
"invoices",
"/",
"{",
"invoice_id",
"}",
"/",
"metadata",
"."
] | [
"\"\"\"Does a PATCH request to /invoices/{invoice_id}/metadata.\r\n\r\n Updates the metadata from an invoice\r\n\r\n Args:\r\n invoice_id (string): The invoice id\r\n request (UpdateMetadataRequest): Request for updating the invoice\r\n metadata\r\n idem... | [
{
"param": "self",
"type": null
},
{
"param": "invoice_id",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "idempotency_key",
"type": null
}
] | {
"returns": [
{
"docstring": "Response from the API.",
"docstring_tokens": [
"Response",
"from",
"the",
"API",
"."
],
"type": "GetInvoiceResponse"
}
],
"raises": [
{
"docstring": "When an error occurs while fetching the data from\n... |
55757275e784abfaeceb90d26f4a8d5c1e221a75 | pagarme/pagarme-python-sdk | pagarmeapisdk/http/requests_client.py | [
"MIT"
] | Python | force_retries | null | def force_retries(self, request, to_retry=None):
"""Reset retries according to each request
Args:
request (HttpRequest): The given HttpRequest to execute.
to_retry (boolean): whether to retry on a particular request
"""
adapters = self.session.adapters
... | Reset retries according to each request
Args:
request (HttpRequest): The given HttpRequest to execute.
to_retry (boolean): whether to retry on a particular request
| Reset retries according to each request | [
"Reset",
"retries",
"according",
"to",
"each",
"request"
] | def force_retries(self, request, to_retry=None):
adapters = self.session.adapters
if to_retry is False:
for adapter in adapters.values():
adapter.max_retries = False
elif to_retry is True:
for adapter in adapters.values():
adapter.max_retri... | [
"def",
"force_retries",
"(",
"self",
",",
"request",
",",
"to_retry",
"=",
"None",
")",
":",
"adapters",
"=",
"self",
".",
"session",
".",
"adapters",
"if",
"to_retry",
"is",
"False",
":",
"for",
"adapter",
"in",
"adapters",
".",
"values",
"(",
")",
":... | Reset retries according to each request | [
"Reset",
"retries",
"according",
"to",
"each",
"request"
] | [
"\"\"\"Reset retries according to each request\r\n\r\n Args:\r\n request (HttpRequest): The given HttpRequest to execute.\r\n to_retry (boolean): whether to retry on a particular request\r\n\r\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "to_retry",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "request",
"type": null,
"docstring": "The given HttpRequest to exec... |
55757275e784abfaeceb90d26f4a8d5c1e221a75 | pagarme/pagarme-python-sdk | pagarmeapisdk/http/requests_client.py | [
"MIT"
] | Python | execute_as_string | <not_specific> | def execute_as_string(self, request, to_retry=None):
"""Execute a given HttpRequest to get a string response back
Args:
request (HttpRequest): The given HttpRequest to execute.
to_retry (boolean): whether to retry on a particular request
Returns:
Htt... | Execute a given HttpRequest to get a string response back
Args:
request (HttpRequest): The given HttpRequest to execute.
to_retry (boolean): whether to retry on a particular request
Returns:
HttpResponse: The response of the HttpRequest.
| Execute a given HttpRequest to get a string response back | [
"Execute",
"a",
"given",
"HttpRequest",
"to",
"get",
"a",
"string",
"response",
"back"
] | def execute_as_string(self, request, to_retry=None):
old_adapters = self.session.adapters
self.force_retries(request, to_retry)
response = self.session.request(
HttpMethodEnum.to_string(request.http_method),
request.query_url,
headers=request.headers,
... | [
"def",
"execute_as_string",
"(",
"self",
",",
"request",
",",
"to_retry",
"=",
"None",
")",
":",
"old_adapters",
"=",
"self",
".",
"session",
".",
"adapters",
"self",
".",
"force_retries",
"(",
"request",
",",
"to_retry",
")",
"response",
"=",
"self",
".",... | Execute a given HttpRequest to get a string response back | [
"Execute",
"a",
"given",
"HttpRequest",
"to",
"get",
"a",
"string",
"response",
"back"
] | [
"\"\"\"Execute a given HttpRequest to get a string response back\r\n\r\n Args:\r\n request (HttpRequest): The given HttpRequest to execute.\r\n to_retry (boolean): whether to retry on a particular request\r\n\r\n Returns:\r\n HttpResponse: The response of the HttpReque... | [
{
"param": "self",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "to_retry",
"type": null
}
] | {
"returns": [
{
"docstring": "The response of the HttpRequest.",
"docstring_tokens": [
"The",
"response",
"of",
"the",
"HttpRequest",
"."
],
"type": "HttpResponse"
}
],
"raises": [],
"params": [
{
"identifier": "self",
... |
55757275e784abfaeceb90d26f4a8d5c1e221a75 | pagarme/pagarme-python-sdk | pagarmeapisdk/http/requests_client.py | [
"MIT"
] | Python | execute_as_binary | <not_specific> | def execute_as_binary(self, request, to_retry=None):
"""Execute a given HttpRequest to get a binary response back
Args:
request (HttpRequest): The given HttpRequest to execute.
to_retry (boolean): whether to retry on a particular request
Returns:
Htt... | Execute a given HttpRequest to get a binary response back
Args:
request (HttpRequest): The given HttpRequest to execute.
to_retry (boolean): whether to retry on a particular request
Returns:
HttpResponse: The response of the HttpRequest.
| Execute a given HttpRequest to get a binary response back | [
"Execute",
"a",
"given",
"HttpRequest",
"to",
"get",
"a",
"binary",
"response",
"back"
] | def execute_as_binary(self, request, to_retry=None):
old_adapters = self.session.adapters
self.force_retries(request, to_retry)
response = self.session.request(
HttpMethodEnum.to_string(request.http_method),
request.query_url,
headers=request.headers,
... | [
"def",
"execute_as_binary",
"(",
"self",
",",
"request",
",",
"to_retry",
"=",
"None",
")",
":",
"old_adapters",
"=",
"self",
".",
"session",
".",
"adapters",
"self",
".",
"force_retries",
"(",
"request",
",",
"to_retry",
")",
"response",
"=",
"self",
".",... | Execute a given HttpRequest to get a binary response back | [
"Execute",
"a",
"given",
"HttpRequest",
"to",
"get",
"a",
"binary",
"response",
"back"
] | [
"\"\"\"Execute a given HttpRequest to get a binary response back\r\n\r\n Args:\r\n request (HttpRequest): The given HttpRequest to execute.\r\n to_retry (boolean): whether to retry on a particular request\r\n\r\n Returns:\r\n HttpResponse: The response of the HttpReque... | [
{
"param": "self",
"type": null
},
{
"param": "request",
"type": null
},
{
"param": "to_retry",
"type": null
}
] | {
"returns": [
{
"docstring": "The response of the HttpRequest.",
"docstring_tokens": [
"The",
"response",
"of",
"the",
"HttpRequest",
"."
],
"type": "HttpResponse"
}
],
"raises": [],
"params": [
{
"identifier": "self",
... |
0573558ac537cd4037221fe0ba23658a3ce939ed | binggu56/lime | lime/ToBeErased/FranckCondon/MultiMode.py | [
"MIT"
] | Python | genMultiModeIntensities | null | def genMultiModeIntensities(Modes):
""" Modes is a list of Mode-type objects (see Modes.py)
"""
# number of dimensions
nModes = len(Modes)
range_ns = 5
# For example, if n would range from 0 to 4, and there were 3 modes,
# ListofNs would be [0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,].
# This is so that permutations can ... | Modes is a list of Mode-type objects (see Modes.py)
| Modes is a list of Mode-type objects | [
"Modes",
"is",
"a",
"list",
"of",
"Mode",
"-",
"type",
"objects"
] | def genMultiModeIntensities(Modes):
nModes = len(Modes)
range_ns = 5
ListOfNs = range(range_ns)*nModes;
FCFactors = []
FCFactorParts = []
for mode in Modes:
mode.computeFranckCondons(ListOfNs)
FCFactorParts += [mode.FrankCondons]
for n in range(range_ns):
for m in range(range_ns):
for p in range(range_n... | [
"def",
"genMultiModeIntensities",
"(",
"Modes",
")",
":",
"nModes",
"=",
"len",
"(",
"Modes",
")",
"range_ns",
"=",
"5",
"ListOfNs",
"=",
"range",
"(",
"range_ns",
")",
"*",
"nModes",
";",
"FCFactors",
"=",
"[",
"]",
"FCFactorParts",
"=",
"[",
"]",
"fo... | Modes is a list of Mode-type objects (see Modes.py) | [
"Modes",
"is",
"a",
"list",
"of",
"Mode",
"-",
"type",
"objects",
"(",
"see",
"Modes",
".",
"py",
")"
] | [
"\"\"\" Modes is a list of Mode-type objects (see Modes.py)\n\t\"\"\"",
"# number of dimensions",
"# For example, if n would range from 0 to 4, and there were 3 modes, ",
"# ListofNs would be [0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,].",
"# This is so that permutations can generate (0,0,0)",
"# FALSE: GIVES REPEATS... | [
{
"param": "Modes",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "Modes",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a4b8373542f40df96a85b547d9da134b7afd9e06 | binggu56/lime | lime/qnm.py | [
"MIT"
] | Python | resonance | <not_specific> | def resonance(omega):
"""
determine the resonance of the cavity mode.
Resonance frequency is the zeros of the returned determinantal function.
Parameters
----------
omega
Returns
-------
"""
k1 = omega / n1
k0 = omega / n0
return tan(k0 * L) + (k0/k1) * tan(k1 * d) |
determine the resonance of the cavity mode.
Resonance frequency is the zeros of the returned determinantal function.
Parameters
----------
omega
Returns
-------
| determine the resonance of the cavity mode.
Resonance frequency is the zeros of the returned determinantal function.
Parameters
omega
Returns | [
"determine",
"the",
"resonance",
"of",
"the",
"cavity",
"mode",
".",
"Resonance",
"frequency",
"is",
"the",
"zeros",
"of",
"the",
"returned",
"determinantal",
"function",
".",
"Parameters",
"omega",
"Returns"
] | def resonance(omega):
k1 = omega / n1
k0 = omega / n0
return tan(k0 * L) + (k0/k1) * tan(k1 * d) | [
"def",
"resonance",
"(",
"omega",
")",
":",
"k1",
"=",
"omega",
"/",
"n1",
"k0",
"=",
"omega",
"/",
"n0",
"return",
"tan",
"(",
"k0",
"*",
"L",
")",
"+",
"(",
"k0",
"/",
"k1",
")",
"*",
"tan",
"(",
"k1",
"*",
"d",
")"
] | determine the resonance of the cavity mode. | [
"determine",
"the",
"resonance",
"of",
"the",
"cavity",
"mode",
"."
] | [
"\"\"\"\n determine the resonance of the cavity mode.\n Resonance frequency is the zeros of the returned determinantal function.\n\n Parameters\n ----------\n omega\n\n Returns\n -------\n\n \"\"\""
] | [
{
"param": "omega",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "omega",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
0538d23bb0a134b06cbb741ac5ee8d3b2f19c254 | binggu56/lime | lime/polariton/cavity.py | [
"MIT"
] | Python | ham_ho | <not_specific> | def ham_ho(freq, n, ZPE=False):
"""
input:
freq: fundemental frequency in units of Energy
n : size of matrix
output:
h: hamiltonian of the harmonic oscilator
"""
if ZPE:
energy = np.arange(n + 0.5) * freq
else:
energy = np.arange(n) * freq
return... |
input:
freq: fundemental frequency in units of Energy
n : size of matrix
output:
h: hamiltonian of the harmonic oscilator
| fundemental frequency in units of Energy
n : size of matrix
output:
h: hamiltonian of the harmonic oscilator | [
"fundemental",
"frequency",
"in",
"units",
"of",
"Energy",
"n",
":",
"size",
"of",
"matrix",
"output",
":",
"h",
":",
"hamiltonian",
"of",
"the",
"harmonic",
"oscilator"
] | def ham_ho(freq, n, ZPE=False):
if ZPE:
energy = np.arange(n + 0.5) * freq
else:
energy = np.arange(n) * freq
return np.diagflat(energy) | [
"def",
"ham_ho",
"(",
"freq",
",",
"n",
",",
"ZPE",
"=",
"False",
")",
":",
"if",
"ZPE",
":",
"energy",
"=",
"np",
".",
"arange",
"(",
"n",
"+",
"0.5",
")",
"*",
"freq",
"else",
":",
"energy",
"=",
"np",
".",
"arange",
"(",
"n",
")",
"*",
"... | input:
freq: fundemental frequency in units of Energy
n : size of matrix
output:
h: hamiltonian of the harmonic oscilator | [
"input",
":",
"freq",
":",
"fundemental",
"frequency",
"in",
"units",
"of",
"Energy",
"n",
":",
"size",
"of",
"matrix",
"output",
":",
"h",
":",
"hamiltonian",
"of",
"the",
"harmonic",
"oscilator"
] | [
"\"\"\"\n input:\n freq: fundemental frequency in units of Energy\n n : size of matrix\n output:\n h: hamiltonian of the harmonic oscilator\n \"\"\""
] | [
{
"param": "freq",
"type": null
},
{
"param": "n",
"type": null
},
{
"param": "ZPE",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "freq",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
2c3b86aa72c1969a85d98e2cec084b06c8bf5921 | binggu56/lime | lime/ToBeErased/FranckCondon/RecursiveModes_Zeros.py | [
"MIT"
] | Python | depthFirstSearch | <not_specific> | def depthFirstSearch(threshold, Modes, values, E_electronic):
""" Threshold is the threshold Franck-Condon after which we assign the value 0.
Modes is a list of modes.
values is a list of values the modes can have (e.g. n = 0,1,2,3)
Returns a tuple (ListOfEnergies, ListOfIntensities).
... | Threshold is the threshold Franck-Condon after which we assign the value 0.
Modes is a list of modes.
values is a list of values the modes can have (e.g. n = 0,1,2,3)
Returns a tuple (ListOfEnergies, ListOfIntensities).
| Threshold is the threshold Franck-Condon after which we assign the value 0.
Modes is a list of modes.
values is a list of values the modes can have
| [
"Threshold",
"is",
"the",
"threshold",
"Franck",
"-",
"Condon",
"after",
"which",
"we",
"assign",
"the",
"value",
"0",
".",
"Modes",
"is",
"a",
"list",
"of",
"modes",
".",
"values",
"is",
"a",
"list",
"of",
"values",
"the",
"modes",
"can",
"have"
] | def depthFirstSearch(threshold, Modes, values, E_electronic):
ListOfIntensites = []
ListOfEnergies = []
fringe = Stack()
mode0 = Modes[0]
print "NumModes =", len(Modes)
for n in values:
FC = mode0.FrankCondons[n]
if FC >= threshold:
energy = E_electronic + mode0.excit... | [
"def",
"depthFirstSearch",
"(",
"threshold",
",",
"Modes",
",",
"values",
",",
"E_electronic",
")",
":",
"ListOfIntensites",
"=",
"[",
"]",
"ListOfEnergies",
"=",
"[",
"]",
"fringe",
"=",
"Stack",
"(",
")",
"mode0",
"=",
"Modes",
"[",
"0",
"]",
"print",
... | Threshold is the threshold Franck-Condon after which we assign the value 0. | [
"Threshold",
"is",
"the",
"threshold",
"Franck",
"-",
"Condon",
"after",
"which",
"we",
"assign",
"the",
"value",
"0",
"."
] | [
"\"\"\" Threshold is the threshold Franck-Condon after which we assign the value 0. \n Modes is a list of modes.\n values is a list of values the modes can have (e.g. n = 0,1,2,3)\n\n Returns a tuple (ListOfEnergies, ListOfIntensities).\n \"\"\"",
"# print \"Mode 0, n \", n, \"FC = \", FC... | [
{
"param": "threshold",
"type": null
},
{
"param": "Modes",
"type": null
},
{
"param": "values",
"type": null
},
{
"param": "E_electronic",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "threshold",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "Modes",
"type": null,
"docstring": null,
"docstring_toke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.