repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 3
values | summary stringlengths 4 350 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
bykof/billomapy | billomapy/billomapy.py | Billomapy.mark_confirmation_as_clear | def mark_confirmation_as_clear(self, confirmation_id):
"""
Mark confirmation as clear
:param confirmation_id: the confirmation id
:return Response
"""
return self._create_put_request(
resource=CONFIRMATIONS,
billomat_id=confirmation_id,
... | python | def mark_confirmation_as_clear(self, confirmation_id):
"""
Mark confirmation as clear
:param confirmation_id: the confirmation id
:return Response
"""
return self._create_put_request(
resource=CONFIRMATIONS,
billomat_id=confirmation_id,
... | [
"def",
"mark_confirmation_as_clear",
"(",
"self",
",",
"confirmation_id",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"CONFIRMATIONS",
",",
"billomat_id",
"=",
"confirmation_id",
",",
"command",
"=",
"CLEAR",
",",
")"
] | Mark confirmation as clear
:param confirmation_id: the confirmation id
:return Response | [
"Mark",
"confirmation",
"as",
"clear"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L2984-L2995 | train | Mark the confirmation as clear |
bykof/billomapy | billomapy/billomapy.py | Billomapy.mark_confirmation_as_unclear | def mark_confirmation_as_unclear(self, confirmation_id):
"""
Mark confirmation as unclear
:param confirmation_id: the confirmation id
:return Response
"""
return self._create_put_request(
resource=CONFIRMATIONS,
billomat_id=confirmation_id,
... | python | def mark_confirmation_as_unclear(self, confirmation_id):
"""
Mark confirmation as unclear
:param confirmation_id: the confirmation id
:return Response
"""
return self._create_put_request(
resource=CONFIRMATIONS,
billomat_id=confirmation_id,
... | [
"def",
"mark_confirmation_as_unclear",
"(",
"self",
",",
"confirmation_id",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"CONFIRMATIONS",
",",
"billomat_id",
"=",
"confirmation_id",
",",
"command",
"=",
"UNCLEAR",
",",
")"
] | Mark confirmation as unclear
:param confirmation_id: the confirmation id
:return Response | [
"Mark",
"confirmation",
"as",
"unclear"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L2997-L3008 | train | Mark the confirmation as unclear. |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_items_of_confirmation_per_page | def get_items_of_confirmation_per_page(self, confirmation_id, per_page=1000, page=1):
"""
Get items of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return:... | python | def get_items_of_confirmation_per_page(self, confirmation_id, per_page=1000, page=1):
"""
Get items of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return:... | [
"def",
"get_items_of_confirmation_per_page",
"(",
"self",
",",
"confirmation_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"CONFIRMATION_ITEMS",
",",
"per_page",
"=",
"p... | Get items of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"items",
"of",
"confirmation",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3017-L3031 | train | Get items of confirmation per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_items_of_confirmation | def get_all_items_of_confirmation(self, confirmation_id):
"""
Get all items of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
... | python | def get_all_items_of_confirmation(self, confirmation_id):
"""
Get all items of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
... | [
"def",
"get_all_items_of_confirmation",
"(",
"self",
",",
"confirmation_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_items_of_confirmation_per_page",
",",
"resource",
"=",
"CONFIRMATION_ITEMS",
",",
"*",
"... | Get all items of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
:return: list | [
"Get",
"all",
"items",
"of",
"confirmation",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3033-L3046 | train | This will iterate over all pages and return a list of items of confirmation. |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_confirmation_item | def update_confirmation_item(self, confirmation_item_id, confirmation_item_dict):
"""
Updates a confirmation item
:param confirmation_item_id: the confirmation item id
:param confirmation_item_dict: dict
:return: dict
"""
return self._create_put_request(
... | python | def update_confirmation_item(self, confirmation_item_id, confirmation_item_dict):
"""
Updates a confirmation item
:param confirmation_item_id: the confirmation item id
:param confirmation_item_dict: dict
:return: dict
"""
return self._create_put_request(
... | [
"def",
"update_confirmation_item",
"(",
"self",
",",
"confirmation_item_id",
",",
"confirmation_item_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"CONFIRMATION_ITEMS",
",",
"billomat_id",
"=",
"confirmation_item_id",
",",
"send_da... | Updates a confirmation item
:param confirmation_item_id: the confirmation item id
:param confirmation_item_dict: dict
:return: dict | [
"Updates",
"a",
"confirmation",
"item"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3066-L3078 | train | Updates a confirmation item |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_comments_of_confirmation_per_page | def get_comments_of_confirmation_per_page(self, confirmation_id, per_page=1000, page=1):
"""
Get comments of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:r... | python | def get_comments_of_confirmation_per_page(self, confirmation_id, per_page=1000, page=1):
"""
Get comments of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:r... | [
"def",
"get_comments_of_confirmation_per_page",
"(",
"self",
",",
"confirmation_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"CONFIRMATION_COMMENTS",
",",
"per_page",
"="... | Get comments of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"comments",
"of",
"confirmation",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3096-L3110 | train | Get comments of confirmation per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_comments_of_confirmation | def get_all_comments_of_confirmation(self, confirmation_id):
"""
Get all comments of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmati... | python | def get_all_comments_of_confirmation(self, confirmation_id):
"""
Get all comments of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmati... | [
"def",
"get_all_comments_of_confirmation",
"(",
"self",
",",
"confirmation_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_comments_of_confirmation_per_page",
",",
"resource",
"=",
"CONFIRMATION_COMMENTS",
",",
... | Get all comments of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
:return: list | [
"Get",
"all",
"comments",
"of",
"confirmation",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will"... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3112-L3125 | train | This will iterate over all pages and return a list of all comments of confirmation. |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_confirmation_comment | def update_confirmation_comment(self, confirmation_comment_id, confirmation_comment_dict):
"""
Updates a confirmation comment
:param confirmation_comment_id: the confirmation comment id
:param confirmation_comment_dict: dict
:return: dict
"""
return self._create_... | python | def update_confirmation_comment(self, confirmation_comment_id, confirmation_comment_dict):
"""
Updates a confirmation comment
:param confirmation_comment_id: the confirmation comment id
:param confirmation_comment_dict: dict
:return: dict
"""
return self._create_... | [
"def",
"update_confirmation_comment",
"(",
"self",
",",
"confirmation_comment_id",
",",
"confirmation_comment_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"CONFIRMATION_COMMENTS",
",",
"billomat_id",
"=",
"confirmation_comment_id",
... | Updates a confirmation comment
:param confirmation_comment_id: the confirmation comment id
:param confirmation_comment_dict: dict
:return: dict | [
"Updates",
"a",
"confirmation",
"comment"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3145-L3157 | train | Updates a confirmation comment |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_tags_of_confirmation_per_page | def get_tags_of_confirmation_per_page(self, confirmation_id, per_page=1000, page=1):
"""
Get tags of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: l... | python | def get_tags_of_confirmation_per_page(self, confirmation_id, per_page=1000, page=1):
"""
Get tags of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: l... | [
"def",
"get_tags_of_confirmation_per_page",
"(",
"self",
",",
"confirmation_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"CONFIRMATION_TAGS",
",",
"per_page",
"=",
"per... | Get tags of confirmation per page
:param confirmation_id: the confirmation id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"tags",
"of",
"confirmation",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3174-L3188 | train | Get tags of confirmation per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_tags_of_confirmation | def get_all_tags_of_confirmation(self, confirmation_id):
"""
Get all tags of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
... | python | def get_all_tags_of_confirmation(self, confirmation_id):
"""
Get all tags of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
... | [
"def",
"get_all_tags_of_confirmation",
"(",
"self",
",",
"confirmation_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_tags_of_confirmation_per_page",
",",
"resource",
"=",
"CONFIRMATION_TAGS",
",",
"*",
"*",... | Get all tags of confirmation
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param confirmation_id: the confirmation id
:return: list | [
"Get",
"all",
"tags",
"of",
"confirmation",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3190-L3203 | train | This will iterate over all pages and return a list of all tags of confirmation |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_reminders_per_page | def get_reminders_per_page(self, per_page=1000, page=1, params=None):
"""
Get reminders per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
"""
... | python | def get_reminders_per_page(self, per_page=1000, page=1, params=None):
"""
Get reminders per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
"""
... | [
"def",
"get_reminders_per_page",
"(",
"self",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"REMINDERS",
",",
"per_page",
"=",
"per_page",
"... | Get reminders per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list | [
"Get",
"reminders",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3239-L3248 | train | Get reminders per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_reminders | def get_all_reminders(self, params=None):
"""
Get all reminders
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""
i... | python | def get_all_reminders(self, params=None):
"""
Get all reminders
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""
i... | [
"def",
"get_all_reminders",
"(",
"self",
",",
"params",
"=",
"None",
")",
":",
"if",
"not",
"params",
":",
"params",
"=",
"{",
"}",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"self",
".",
"get_reminders_per_page",
",",
"resource",
"=",
"REMINDERS"... | Get all reminders
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list | [
"Get",
"all",
"reminders",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"get",
"nothing"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3250-L3261 | train | This will iterate over all reminders and returns a list of all reminders |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_reminder | def update_reminder(self, reminder_id, reminder_dict):
"""
Updates a reminder
:param reminder_id: the reminder id
:param reminder_dict: dict
:return: dict
"""
return self._create_put_request(
resource=REMINDERS,
billomat_id=reminder_id,
... | python | def update_reminder(self, reminder_id, reminder_dict):
"""
Updates a reminder
:param reminder_id: the reminder id
:param reminder_dict: dict
:return: dict
"""
return self._create_put_request(
resource=REMINDERS,
billomat_id=reminder_id,
... | [
"def",
"update_reminder",
"(",
"self",
",",
"reminder_id",
",",
"reminder_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"REMINDERS",
",",
"billomat_id",
"=",
"reminder_id",
",",
"send_data",
"=",
"reminder_dict",
")"
] | Updates a reminder
:param reminder_id: the reminder id
:param reminder_dict: dict
:return: dict | [
"Updates",
"a",
"reminder"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3281-L3293 | train | Updates a reminder s metadata |
bykof/billomapy | billomapy/billomapy.py | Billomapy.complete_reminder | def complete_reminder(self, reminder_id, complete_dict):
"""
Completes a reminder
:param complete_dict: the complete dict with the template id
:param reminder_id: the reminder id
:return: Response
"""
return self._create_put_request(
resource=REMINDER... | python | def complete_reminder(self, reminder_id, complete_dict):
"""
Completes a reminder
:param complete_dict: the complete dict with the template id
:param reminder_id: the reminder id
:return: Response
"""
return self._create_put_request(
resource=REMINDER... | [
"def",
"complete_reminder",
"(",
"self",
",",
"reminder_id",
",",
"complete_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"REMINDERS",
",",
"billomat_id",
"=",
"reminder_id",
",",
"command",
"=",
"COMPLETE",
",",
"send_data... | Completes a reminder
:param complete_dict: the complete dict with the template id
:param reminder_id: the reminder id
:return: Response | [
"Completes",
"a",
"reminder"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3304-L3317 | train | Completes a reminder |
bykof/billomapy | billomapy/billomapy.py | Billomapy.reminder_pdf | def reminder_pdf(self, reminder_id):
"""
Opens a pdf of a reminder
:param reminder_id: the reminder id
:return: dict
"""
return self._create_get_request(resource=REMINDERS, billomat_id=reminder_id, command=PDF) | python | def reminder_pdf(self, reminder_id):
"""
Opens a pdf of a reminder
:param reminder_id: the reminder id
:return: dict
"""
return self._create_get_request(resource=REMINDERS, billomat_id=reminder_id, command=PDF) | [
"def",
"reminder_pdf",
"(",
"self",
",",
"reminder_id",
")",
":",
"return",
"self",
".",
"_create_get_request",
"(",
"resource",
"=",
"REMINDERS",
",",
"billomat_id",
"=",
"reminder_id",
",",
"command",
"=",
"PDF",
")"
] | Opens a pdf of a reminder
:param reminder_id: the reminder id
:return: dict | [
"Opens",
"a",
"pdf",
"of",
"a",
"reminder"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3319-L3326 | train | Opens a pdf of a reminder |
bykof/billomapy | billomapy/billomapy.py | Billomapy.send_reminder_email | def send_reminder_email(self, reminder_id, email_dict):
"""
Sends an reminder by email
If you want to send your email to more than one persons do:
'recipients': {'to': ['bykof@me.com', 'mbykovski@seibert-media.net']}}
:param reminder_id: the reminder id
:param email_dict... | python | def send_reminder_email(self, reminder_id, email_dict):
"""
Sends an reminder by email
If you want to send your email to more than one persons do:
'recipients': {'to': ['bykof@me.com', 'mbykovski@seibert-media.net']}}
:param reminder_id: the reminder id
:param email_dict... | [
"def",
"send_reminder_email",
"(",
"self",
",",
"reminder_id",
",",
"email_dict",
")",
":",
"return",
"self",
".",
"_create_post_request",
"(",
"resource",
"=",
"REMINDERS",
",",
"billomat_id",
"=",
"reminder_id",
",",
"send_data",
"=",
"email_dict",
",",
"comma... | Sends an reminder by email
If you want to send your email to more than one persons do:
'recipients': {'to': ['bykof@me.com', 'mbykovski@seibert-media.net']}}
:param reminder_id: the reminder id
:param email_dict: the email dict
:return dict | [
"Sends",
"an",
"reminder",
"by",
"email",
"If",
"you",
"want",
"to",
"send",
"your",
"email",
"to",
"more",
"than",
"one",
"persons",
"do",
":",
"recipients",
":",
"{",
"to",
":",
"[",
"bykof@me",
".",
"com",
"mbykovski@seibert",
"-",
"media",
".",
"ne... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3328-L3343 | train | Sends an email to a reminder by email_dict |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_items_of_reminder_per_page | def get_items_of_reminder_per_page(self, reminder_id, per_page=1000, page=1):
"""
Get items of reminder per page
:param reminder_id: the reminder id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
... | python | def get_items_of_reminder_per_page(self, reminder_id, per_page=1000, page=1):
"""
Get items of reminder per page
:param reminder_id: the reminder id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
... | [
"def",
"get_items_of_reminder_per_page",
"(",
"self",
",",
"reminder_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"REMINDER_ITEMS",
",",
"per_page",
"=",
"per_page",
... | Get items of reminder per page
:param reminder_id: the reminder id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"items",
"of",
"reminder",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3352-L3366 | train | Get items of reminder per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_items_of_reminder | def get_all_items_of_reminder(self, reminder_id):
"""
Get all items of reminder
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param reminder_id: the reminder id
:return: lis... | python | def get_all_items_of_reminder(self, reminder_id):
"""
Get all items of reminder
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param reminder_id: the reminder id
:return: lis... | [
"def",
"get_all_items_of_reminder",
"(",
"self",
",",
"reminder_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_items_of_reminder_per_page",
",",
"resource",
"=",
"REMINDER_ITEMS",
",",
"*",
"*",
"{",
"'r... | Get all items of reminder
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param reminder_id: the reminder id
:return: list | [
"Get",
"all",
"items",
"of",
"reminder",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"ge... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3368-L3381 | train | This will iterate over all pages until it gets all elements. If rate limit exceeded it will throw an Exception and you will get nothing |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_reminder_item | def update_reminder_item(self, reminder_item_id, reminder_item_dict):
"""
Updates a reminder item
:param reminder_item_id: the reminder item id
:param reminder_item_dict: dict
:return: dict
"""
return self._create_put_request(
resource=REMINDER_ITEMS,... | python | def update_reminder_item(self, reminder_item_id, reminder_item_dict):
"""
Updates a reminder item
:param reminder_item_id: the reminder item id
:param reminder_item_dict: dict
:return: dict
"""
return self._create_put_request(
resource=REMINDER_ITEMS,... | [
"def",
"update_reminder_item",
"(",
"self",
",",
"reminder_item_id",
",",
"reminder_item_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"REMINDER_ITEMS",
",",
"billomat_id",
"=",
"reminder_item_id",
",",
"send_data",
"=",
"remin... | Updates a reminder item
:param reminder_item_id: the reminder item id
:param reminder_item_dict: dict
:return: dict | [
"Updates",
"a",
"reminder",
"item"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3401-L3413 | train | Updates a reminder item |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_tags_of_reminder_per_page | def get_tags_of_reminder_per_page(self, reminder_id, per_page=1000, page=1):
"""
Get tags of reminder per page
:param reminder_id: the reminder id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
... | python | def get_tags_of_reminder_per_page(self, reminder_id, per_page=1000, page=1):
"""
Get tags of reminder per page
:param reminder_id: the reminder id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
... | [
"def",
"get_tags_of_reminder_per_page",
"(",
"self",
",",
"reminder_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"REMINDER_TAGS",
",",
"per_page",
"=",
"per_page",
",... | Get tags of reminder per page
:param reminder_id: the reminder id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"tags",
"of",
"reminder",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3430-L3444 | train | Get tags of reminder per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_tags_of_reminder | def get_all_tags_of_reminder(self, reminder_id):
"""
Get all tags of reminder
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param reminder_id: the reminder id
:return: list
... | python | def get_all_tags_of_reminder(self, reminder_id):
"""
Get all tags of reminder
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param reminder_id: the reminder id
:return: list
... | [
"def",
"get_all_tags_of_reminder",
"(",
"self",
",",
"reminder_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_tags_of_reminder_per_page",
",",
"resource",
"=",
"REMINDER_TAGS",
",",
"*",
"*",
"{",
"'remi... | Get all tags of reminder
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param reminder_id: the reminder id
:return: list | [
"Get",
"all",
"tags",
"of",
"reminder",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"get... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3446-L3459 | train | This will iterate over all pages until it gets all elements. So if the rate limit exceeded it will throw an Exception and you will get nothing |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_delivery_notes_per_page | def get_delivery_notes_per_page(self, per_page=1000, page=1, params=None):
"""
Get delivery notes per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
""... | python | def get_delivery_notes_per_page(self, per_page=1000, page=1, params=None):
"""
Get delivery notes per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
""... | [
"def",
"get_delivery_notes_per_page",
"(",
"self",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"DELIVERY_NOTES",
",",
"per_page",
"=",
"per_... | Get delivery notes per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list | [
"Get",
"delivery",
"notes",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3495-L3504 | train | Get delivery notes per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_delivery_notes | def get_all_delivery_notes(self, params=None):
"""
Get all delivery notes
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""... | python | def get_all_delivery_notes(self, params=None):
"""
Get all delivery notes
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""... | [
"def",
"get_all_delivery_notes",
"(",
"self",
",",
"params",
"=",
"None",
")",
":",
"if",
"not",
"params",
":",
"params",
"=",
"{",
"}",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"self",
".",
"get_delivery_notes_per_page",
",",
"resource",
"=",
"... | Get all delivery notes
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list | [
"Get",
"all",
"delivery",
"notes",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"get",
"n... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3506-L3521 | train | This will iterate over all the delivery notes and return a list of the delivery notes that are on the site. If rate limit exceeded it will throw an Exception. |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_delivery_note | def update_delivery_note(self, delivery_note_id, delivery_note_dict):
"""
Updates a delivery note
:param delivery_note_id: the delivery note id
:param delivery_note_dict: dict
:return: dict
"""
return self._create_put_request(
resource=DELIVERY_NOTES,... | python | def update_delivery_note(self, delivery_note_id, delivery_note_dict):
"""
Updates a delivery note
:param delivery_note_id: the delivery note id
:param delivery_note_dict: dict
:return: dict
"""
return self._create_put_request(
resource=DELIVERY_NOTES,... | [
"def",
"update_delivery_note",
"(",
"self",
",",
"delivery_note_id",
",",
"delivery_note_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"DELIVERY_NOTES",
",",
"billomat_id",
"=",
"delivery_note_id",
",",
"send_data",
"=",
"deliv... | Updates a delivery note
:param delivery_note_id: the delivery note id
:param delivery_note_dict: dict
:return: dict | [
"Updates",
"a",
"delivery",
"note"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3541-L3553 | train | Updates a delivery note |
bykof/billomapy | billomapy/billomapy.py | Billomapy.complete_delivery_note | def complete_delivery_note(self, delivery_note_id, complete_dict):
"""
Completes an delivery note
:param complete_dict: the complete dict with the template id
:param delivery_note_id: the delivery note id
:return: Response
"""
return self._create_put_request(
... | python | def complete_delivery_note(self, delivery_note_id, complete_dict):
"""
Completes an delivery note
:param complete_dict: the complete dict with the template id
:param delivery_note_id: the delivery note id
:return: Response
"""
return self._create_put_request(
... | [
"def",
"complete_delivery_note",
"(",
"self",
",",
"delivery_note_id",
",",
"complete_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"DELIVERY_NOTES",
",",
"billomat_id",
"=",
"delivery_note_id",
",",
"command",
"=",
"COMPLETE",... | Completes an delivery note
:param complete_dict: the complete dict with the template id
:param delivery_note_id: the delivery note id
:return: Response | [
"Completes",
"an",
"delivery",
"note"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3564-L3577 | train | Completes a delivery note |
bykof/billomapy | billomapy/billomapy.py | Billomapy.delivery_note_pdf | def delivery_note_pdf(self, delivery_note_id):
"""
Opens a pdf of a delivery note
:param delivery_note_id: the delivery note id
:return: dict
"""
return self._create_get_request(resource=DELIVERY_NOTES, billomat_id=delivery_note_id, command=PDF) | python | def delivery_note_pdf(self, delivery_note_id):
"""
Opens a pdf of a delivery note
:param delivery_note_id: the delivery note id
:return: dict
"""
return self._create_get_request(resource=DELIVERY_NOTES, billomat_id=delivery_note_id, command=PDF) | [
"def",
"delivery_note_pdf",
"(",
"self",
",",
"delivery_note_id",
")",
":",
"return",
"self",
".",
"_create_get_request",
"(",
"resource",
"=",
"DELIVERY_NOTES",
",",
"billomat_id",
"=",
"delivery_note_id",
",",
"command",
"=",
"PDF",
")"
] | Opens a pdf of a delivery note
:param delivery_note_id: the delivery note id
:return: dict | [
"Opens",
"a",
"pdf",
"of",
"a",
"delivery",
"note"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3579-L3586 | train | Opens a pdf of a delivery note |
bykof/billomapy | billomapy/billomapy.py | Billomapy.send_delivery_note_email | def send_delivery_note_email(self, delivery_note_id, email_dict):
"""
Sends an delivery note by email
If you want to send your email to more than one persons do:
'recipients': {'to': ['bykof@me.com', 'mbykovski@seibert-media.net']}}
:param delivery_note_id: the delivery note id
... | python | def send_delivery_note_email(self, delivery_note_id, email_dict):
"""
Sends an delivery note by email
If you want to send your email to more than one persons do:
'recipients': {'to': ['bykof@me.com', 'mbykovski@seibert-media.net']}}
:param delivery_note_id: the delivery note id
... | [
"def",
"send_delivery_note_email",
"(",
"self",
",",
"delivery_note_id",
",",
"email_dict",
")",
":",
"return",
"self",
".",
"_create_post_request",
"(",
"resource",
"=",
"DELIVERY_NOTES",
",",
"billomat_id",
"=",
"delivery_note_id",
",",
"send_data",
"=",
"email_di... | Sends an delivery note by email
If you want to send your email to more than one persons do:
'recipients': {'to': ['bykof@me.com', 'mbykovski@seibert-media.net']}}
:param delivery_note_id: the delivery note id
:param email_dict: the email dict
:return dict | [
"Sends",
"an",
"delivery",
"note",
"by",
"email",
"If",
"you",
"want",
"to",
"send",
"your",
"email",
"to",
"more",
"than",
"one",
"persons",
"do",
":",
"recipients",
":",
"{",
"to",
":",
"[",
"bykof@me",
".",
"com",
"mbykovski@seibert",
"-",
"media",
... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3588-L3603 | train | Sends an email to a specific delivery note by email_dict. |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_items_of_delivery_note_per_page | def get_items_of_delivery_note_per_page(self, delivery_note_id, per_page=1000, page=1):
"""
Get items of delivery note per page
:param delivery_note_id: the delivery note id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:re... | python | def get_items_of_delivery_note_per_page(self, delivery_note_id, per_page=1000, page=1):
"""
Get items of delivery note per page
:param delivery_note_id: the delivery note id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:re... | [
"def",
"get_items_of_delivery_note_per_page",
"(",
"self",
",",
"delivery_note_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"DELIVERY_NOTE_ITEMS",
",",
"per_page",
"=",
... | Get items of delivery note per page
:param delivery_note_id: the delivery note id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"items",
"of",
"delivery",
"note",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3612-L3626 | train | Get items of delivery note per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_items_of_delivery_note | def get_all_items_of_delivery_note(self, delivery_note_id):
"""
Get all items of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delivery not... | python | def get_all_items_of_delivery_note(self, delivery_note_id):
"""
Get all items of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delivery not... | [
"def",
"get_all_items_of_delivery_note",
"(",
"self",
",",
"delivery_note_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_items_of_delivery_note_per_page",
",",
"resource",
"=",
"DELIVERY_NOTE_ITEMS",
",",
"*",... | Get all items of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delivery note id
:return: list | [
"Get",
"all",
"items",
"of",
"delivery",
"note",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"wi... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3628-L3641 | train | This will iterate over all pages until it gets all elements. If rate limit exceeded it will throw an Exception and you will get nothing |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_delivery_note_item | def update_delivery_note_item(self, delivery_note_item_id, delivery_note_item_dict):
"""
Updates a delivery note item
:param delivery_note_item_id: delivery note item id
:param delivery_note_item_dict: dict
:return: dict
"""
return self._create_put_request(
... | python | def update_delivery_note_item(self, delivery_note_item_id, delivery_note_item_dict):
"""
Updates a delivery note item
:param delivery_note_item_id: delivery note item id
:param delivery_note_item_dict: dict
:return: dict
"""
return self._create_put_request(
... | [
"def",
"update_delivery_note_item",
"(",
"self",
",",
"delivery_note_item_id",
",",
"delivery_note_item_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"DELIVERY_NOTE_ITEMS",
",",
"billomat_id",
"=",
"delivery_note_item_id",
",",
"se... | Updates a delivery note item
:param delivery_note_item_id: delivery note item id
:param delivery_note_item_dict: dict
:return: dict | [
"Updates",
"a",
"delivery",
"note",
"item"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3661-L3673 | train | Updates a delivery note item |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_comments_of_delivery_note_per_page | def get_comments_of_delivery_note_per_page(self, delivery_note_id, per_page=1000, page=1):
"""
Get comments of delivery note per page
:param delivery_note_id: the delivery note
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
... | python | def get_comments_of_delivery_note_per_page(self, delivery_note_id, per_page=1000, page=1):
"""
Get comments of delivery note per page
:param delivery_note_id: the delivery note
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
... | [
"def",
"get_comments_of_delivery_note_per_page",
"(",
"self",
",",
"delivery_note_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"DELIVERY_NOTE_COMMENTS",
",",
"per_page",
... | Get comments of delivery note per page
:param delivery_note_id: the delivery note
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"comments",
"of",
"delivery",
"note",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3691-L3705 | train | Get the comments of a delivery note per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_comments_of_delivery_note | def get_all_comments_of_delivery_note(self, delivery_note_id):
"""
Get all comments of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delive... | python | def get_all_comments_of_delivery_note(self, delivery_note_id):
"""
Get all comments of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delive... | [
"def",
"get_all_comments_of_delivery_note",
"(",
"self",
",",
"delivery_note_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_comments_of_delivery_note_per_page",
",",
"resource",
"=",
"DELIVERY_NOTE_COMMENTS",
",... | Get all comments of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delivery note id
:return: list | [
"Get",
"all",
"comments",
"of",
"delivery",
"note",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3707-L3720 | train | This will iterate over all pages and get all comments of delivery note |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_delivery_note_comment | def update_delivery_note_comment(self, delivery_note_comment_id, delivery_note_comment_dict):
"""
Updates a delivery note comment
:param delivery_note_comment_id: the delivery note comment id
:param delivery_note_comment_dict: dict
:return: dict
"""
return self._... | python | def update_delivery_note_comment(self, delivery_note_comment_id, delivery_note_comment_dict):
"""
Updates a delivery note comment
:param delivery_note_comment_id: the delivery note comment id
:param delivery_note_comment_dict: dict
:return: dict
"""
return self._... | [
"def",
"update_delivery_note_comment",
"(",
"self",
",",
"delivery_note_comment_id",
",",
"delivery_note_comment_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"DELIVERY_NOTE_COMMENTS",
",",
"billomat_id",
"=",
"delivery_note_comment_id... | Updates a delivery note comment
:param delivery_note_comment_id: the delivery note comment id
:param delivery_note_comment_dict: dict
:return: dict | [
"Updates",
"a",
"delivery",
"note",
"comment"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3740-L3752 | train | Updates a delivery note comment |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_tags_of_delivery_note_per_page | def get_tags_of_delivery_note_per_page(self, delivery_note_id, per_page=1000, page=1):
"""
Get tags of delivery note per page
:param delivery_note_id: the delivery note id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:retu... | python | def get_tags_of_delivery_note_per_page(self, delivery_note_id, per_page=1000, page=1):
"""
Get tags of delivery note per page
:param delivery_note_id: the delivery note id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:retu... | [
"def",
"get_tags_of_delivery_note_per_page",
"(",
"self",
",",
"delivery_note_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"DELIVERY_NOTE_TAGS",
",",
"per_page",
"=",
"... | Get tags of delivery note per page
:param delivery_note_id: the delivery note id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"tags",
"of",
"delivery",
"note",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3769-L3783 | train | Get tags of delivery note per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_tags_of_delivery_note | def get_all_tags_of_delivery_note(self, delivery_note_id):
"""
Get all tags of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delivery note ... | python | def get_all_tags_of_delivery_note(self, delivery_note_id):
"""
Get all tags of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delivery note ... | [
"def",
"get_all_tags_of_delivery_note",
"(",
"self",
",",
"delivery_note_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_tags_of_delivery_note_per_page",
",",
"resource",
"=",
"DELIVERY_NOTE_TAGS",
",",
"*",
... | Get all tags of delivery note
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param delivery_note_id: the delivery note id
:return: list | [
"Get",
"all",
"tags",
"of",
"delivery",
"note",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"wil... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3785-L3798 | train | This will iterate over all pages until it gets all elements. If rate limit exceeded it will throw an Exception and you will get nothing |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_letters_per_page | def get_letters_per_page(self, per_page=1000, page=1, params=None):
"""
Get letters per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
"""
retu... | python | def get_letters_per_page(self, per_page=1000, page=1, params=None):
"""
Get letters per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
"""
retu... | [
"def",
"get_letters_per_page",
"(",
"self",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"LETTERS",
",",
"per_page",
"=",
"per_page",
",",
... | Get letters per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list | [
"Get",
"letters",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3834-L3843 | train | Get letters per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_letters | def get_all_letters(self, params=None):
"""
Get all letters
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""
if no... | python | def get_all_letters(self, params=None):
"""
Get all letters
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""
if no... | [
"def",
"get_all_letters",
"(",
"self",
",",
"params",
"=",
"None",
")",
":",
"if",
"not",
"params",
":",
"params",
"=",
"{",
"}",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"self",
".",
"get_letters_per_page",
",",
"resource",
"=",
"LETTERS",
",... | Get all letters
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list | [
"Get",
"all",
"letters",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"get",
"nothing"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3845-L3856 | train | This will iterate over all pages until it gets all elements. So if the rate limit exceeded it will throw an Exception and you will get nothing |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_letter | def update_letter(self, letter_id, letter_dict):
"""
Updates a letter
:param letter_id: the letter id
:param letter_dict: dict
:return: dict
"""
return self._create_put_request(
resource=LETTERS,
billomat_id=letter_id,
send_dat... | python | def update_letter(self, letter_id, letter_dict):
"""
Updates a letter
:param letter_id: the letter id
:param letter_dict: dict
:return: dict
"""
return self._create_put_request(
resource=LETTERS,
billomat_id=letter_id,
send_dat... | [
"def",
"update_letter",
"(",
"self",
",",
"letter_id",
",",
"letter_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"LETTERS",
",",
"billomat_id",
"=",
"letter_id",
",",
"send_data",
"=",
"letter_dict",
")"
] | Updates a letter
:param letter_id: the letter id
:param letter_dict: dict
:return: dict | [
"Updates",
"a",
"letter"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3876-L3888 | train | Updates a letter s metadata |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_comments_of_letter_per_page | def get_comments_of_letter_per_page(self, letter_id, per_page=1000, page=1):
"""
Get comments of letter per page
:param letter_id: the letter id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
... | python | def get_comments_of_letter_per_page(self, letter_id, per_page=1000, page=1):
"""
Get comments of letter per page
:param letter_id: the letter id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
... | [
"def",
"get_comments_of_letter_per_page",
"(",
"self",
",",
"letter_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"LETTER_COMMENTS",
",",
"per_page",
"=",
"per_page",
... | Get comments of letter per page
:param letter_id: the letter id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"comments",
"of",
"letter",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3906-L3920 | train | Get comments of a specific letter per page. |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_comments_of_letter | def get_all_comments_of_letter(self, letter_id):
"""
Get all comments of letter
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param letter_id: the letter id
:return: list
... | python | def get_all_comments_of_letter(self, letter_id):
"""
Get all comments of letter
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param letter_id: the letter id
:return: list
... | [
"def",
"get_all_comments_of_letter",
"(",
"self",
",",
"letter_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_comments_of_letter_per_page",
",",
"resource",
"=",
"LETTER_COMMENTS",
",",
"*",
"*",
"{",
"'... | Get all comments of letter
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param letter_id: the letter id
:return: list | [
"Get",
"all",
"comments",
"of",
"letter",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"g... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3922-L3935 | train | This will iterate over all pages and return a list of all comments of the given letter |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_letter_comment | def update_letter_comment(self, letter_comment_id, letter_comment_dict):
"""
Updates a letter comment
:param letter_comment_id: the letter command id
:param letter_comment_dict: dict
:return: dict
"""
return self._create_put_request(
resource=LETTER_C... | python | def update_letter_comment(self, letter_comment_id, letter_comment_dict):
"""
Updates a letter comment
:param letter_comment_id: the letter command id
:param letter_comment_dict: dict
:return: dict
"""
return self._create_put_request(
resource=LETTER_C... | [
"def",
"update_letter_comment",
"(",
"self",
",",
"letter_comment_id",
",",
"letter_comment_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"LETTER_COMMENTS",
",",
"billomat_id",
"=",
"letter_comment_id",
",",
"send_data",
"=",
"... | Updates a letter comment
:param letter_comment_id: the letter command id
:param letter_comment_dict: dict
:return: dict | [
"Updates",
"a",
"letter",
"comment"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3955-L3967 | train | Updates a letter comment |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_tags_of_letter_per_page | def get_tags_of_letter_per_page(self, letter_id, per_page=1000, page=1):
"""
Get tags of letter per page
:param letter_id: the letter id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
return... | python | def get_tags_of_letter_per_page(self, letter_id, per_page=1000, page=1):
"""
Get tags of letter per page
:param letter_id: the letter id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list
"""
return... | [
"def",
"get_tags_of_letter_per_page",
"(",
"self",
",",
"letter_id",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"LETTER_TAGS",
",",
"per_page",
"=",
"per_page",
",",
"... | Get tags of letter per page
:param letter_id: the letter id
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:return: list | [
"Get",
"tags",
"of",
"letter",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L3984-L3998 | train | Get tags of a specific letter per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_tags_of_letter | def get_all_tags_of_letter(self, letter_id):
"""
Get all tags of letter
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param letter_id: the letter id
:return: list
""... | python | def get_all_tags_of_letter(self, letter_id):
"""
Get all tags of letter
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param letter_id: the letter id
:return: list
""... | [
"def",
"get_all_tags_of_letter",
"(",
"self",
",",
"letter_id",
")",
":",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"get_function",
"=",
"self",
".",
"get_tags_of_letter_per_page",
",",
"resource",
"=",
"LETTER_TAGS",
",",
"*",
"*",
"{",
"'letter_id'",... | Get all tags of letter
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param letter_id: the letter id
:return: list | [
"Get",
"all",
"tags",
"of",
"letter",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"get",... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L4000-L4013 | train | This will iterate over all pages and return a list of tags of letter_id |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_email_templates_per_page | def get_email_templates_per_page(self, per_page=1000, page=1, params=None):
"""
Get e-mail templates per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
... | python | def get_email_templates_per_page(self, per_page=1000, page=1, params=None):
"""
Get e-mail templates per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
... | [
"def",
"get_email_templates_per_page",
"(",
"self",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"EMAIL_TEMPLATES",
",",
"per_page",
"=",
"pe... | Get e-mail templates per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list | [
"Get",
"e",
"-",
"mail",
"templates",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L4050-L4059 | train | Get e - mail templates per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_email_templates | def get_email_templates(self, params=None):
"""
Get all e-mail templates
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""... | python | def get_email_templates(self, params=None):
"""
Get all e-mail templates
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""... | [
"def",
"get_email_templates",
"(",
"self",
",",
"params",
"=",
"None",
")",
":",
"if",
"not",
"params",
":",
"params",
"=",
"{",
"}",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"self",
".",
"get_email_templates_per_page",
",",
"resource",
"=",
"EM... | Get all e-mail templates
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list | [
"Get",
"all",
"e",
"-",
"mail",
"templates",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",... | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L4061-L4073 | train | This will iterate over all e - mail templates and get all e - mail templates that are available on the server |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_email_template | def update_email_template(self, template_id, template_dict):
"""
Updates a emailtemplate
:param template_id: the template id
:param template_dict: dict
:return: dict
"""
return self._create_put_request(
resource=EMAIL_TEMPLATES,
billomat_i... | python | def update_email_template(self, template_id, template_dict):
"""
Updates a emailtemplate
:param template_id: the template id
:param template_dict: dict
:return: dict
"""
return self._create_put_request(
resource=EMAIL_TEMPLATES,
billomat_i... | [
"def",
"update_email_template",
"(",
"self",
",",
"template_id",
",",
"template_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"EMAIL_TEMPLATES",
",",
"billomat_id",
"=",
"template_id",
",",
"send_data",
"=",
"template_dict",
... | Updates a emailtemplate
:param template_id: the template id
:param template_dict: dict
:return: dict | [
"Updates",
"a",
"emailtemplate"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L4093-L4105 | train | Updates an email template |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_templates_per_page | def get_templates_per_page(self, per_page=1000, page=1, params=None):
"""
Get templates per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
"""
... | python | def get_templates_per_page(self, per_page=1000, page=1, params=None):
"""
Get templates per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list
"""
... | [
"def",
"get_templates_per_page",
"(",
"self",
",",
"per_page",
"=",
"1000",
",",
"page",
"=",
"1",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"_get_resource_per_page",
"(",
"resource",
"=",
"TEMPLATES",
",",
"per_page",
"=",
"per_page",
"... | Get templates per page
:param per_page: How many objects per page. Default: 1000
:param page: Which page. Default: 1
:param params: Search parameters. Default: {}
:return: list | [
"Get",
"templates",
"per",
"page"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L4123-L4132 | train | Get templates per page |
bykof/billomapy | billomapy/billomapy.py | Billomapy.get_all_templates | def get_all_templates(self, params=None):
"""
Get all templates
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""
i... | python | def get_all_templates(self, params=None):
"""
Get all templates
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
"""
i... | [
"def",
"get_all_templates",
"(",
"self",
",",
"params",
"=",
"None",
")",
":",
"if",
"not",
"params",
":",
"params",
"=",
"{",
"}",
"return",
"self",
".",
"_iterate_through_pages",
"(",
"self",
".",
"get_templates_per_page",
",",
"resource",
"=",
"TEMPLATES"... | Get all templates
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list | [
"Get",
"all",
"templates",
"This",
"will",
"iterate",
"over",
"all",
"pages",
"until",
"it",
"gets",
"all",
"elements",
".",
"So",
"if",
"the",
"rate",
"limit",
"exceeded",
"it",
"will",
"throw",
"an",
"Exception",
"and",
"you",
"will",
"get",
"nothing"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L4134-L4145 | train | This will iterate over all pages until it gets all elements. So if the rate limit exceeded it will throw an Exception and you will get nothing |
bykof/billomapy | billomapy/billomapy.py | Billomapy.update_template | def update_template(self, template_id, template_dict):
"""
Updates a template
:param template_id: the template id
:param template_dict: dict
:return: dict
"""
return self._create_put_request(
resource=TEMPLATES,
billomat_id=template_id,
... | python | def update_template(self, template_id, template_dict):
"""
Updates a template
:param template_id: the template id
:param template_dict: dict
:return: dict
"""
return self._create_put_request(
resource=TEMPLATES,
billomat_id=template_id,
... | [
"def",
"update_template",
"(",
"self",
",",
"template_id",
",",
"template_dict",
")",
":",
"return",
"self",
".",
"_create_put_request",
"(",
"resource",
"=",
"TEMPLATES",
",",
"billomat_id",
"=",
"template_id",
",",
"send_data",
"=",
"template_dict",
")"
] | Updates a template
:param template_id: the template id
:param template_dict: dict
:return: dict | [
"Updates",
"a",
"template"
] | a28ba69fd37654fa145d0411d52c200e7f8984ab | https://github.com/bykof/billomapy/blob/a28ba69fd37654fa145d0411d52c200e7f8984ab/billomapy/billomapy.py#L4165-L4177 | train | Updates a template with the given id and dict |
Kortemme-Lab/klab | klab/cloning/cloning.py | reverse_translate | def reverse_translate(
protein_seq,
template_dna=None, leading_seq=None, trailing_seq=None,
forbidden_seqs=(), include_stop=True, manufacturer=None):
"""
Generate a well-behaved DNA sequence from the given protein sequence. If a
template DNA sequence is specified, the returned DNA ... | python | def reverse_translate(
protein_seq,
template_dna=None, leading_seq=None, trailing_seq=None,
forbidden_seqs=(), include_stop=True, manufacturer=None):
"""
Generate a well-behaved DNA sequence from the given protein sequence. If a
template DNA sequence is specified, the returned DNA ... | [
"def",
"reverse_translate",
"(",
"protein_seq",
",",
"template_dna",
"=",
"None",
",",
"leading_seq",
"=",
"None",
",",
"trailing_seq",
"=",
"None",
",",
"forbidden_seqs",
"=",
"(",
")",
",",
"include_stop",
"=",
"True",
",",
"manufacturer",
"=",
"None",
")"... | Generate a well-behaved DNA sequence from the given protein sequence. If a
template DNA sequence is specified, the returned DNA sequence will be as
similar to it as possible. Any given restriction sites will not be
present in the sequence. And finally, the given leading and trailing
sequences wi... | [
"Generate",
"a",
"well",
"-",
"behaved",
"DNA",
"sequence",
"from",
"the",
"given",
"protein",
"sequence",
".",
"If",
"a",
"template",
"DNA",
"sequence",
"is",
"specified",
"the",
"returned",
"DNA",
"sequence",
"will",
"be",
"as",
"similar",
"to",
"it",
"a... | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L21-L46 | train | Reverse translate a given protein sequence into a well - behaved DNA sequence. |
Kortemme-Lab/klab | klab/cloning/cloning.py | make_codon_list | def make_codon_list(protein_seq, template_dna=None, include_stop=True):
"""
Return a list of codons that would be translated to the given protein
sequence. Codons are picked first to minimize the mutations relative to a
template DNA sequence and second to prefer "optimal" codons.
"""
codon_l... | python | def make_codon_list(protein_seq, template_dna=None, include_stop=True):
"""
Return a list of codons that would be translated to the given protein
sequence. Codons are picked first to minimize the mutations relative to a
template DNA sequence and second to prefer "optimal" codons.
"""
codon_l... | [
"def",
"make_codon_list",
"(",
"protein_seq",
",",
"template_dna",
"=",
"None",
",",
"include_stop",
"=",
"True",
")",
":",
"codon_list",
"=",
"[",
"]",
"if",
"template_dna",
"is",
"None",
":",
"template_dna",
"=",
"[",
"]",
"# Reverse translate each codon, pref... | Return a list of codons that would be translated to the given protein
sequence. Codons are picked first to minimize the mutations relative to a
template DNA sequence and second to prefer "optimal" codons. | [
"Return",
"a",
"list",
"of",
"codons",
"that",
"would",
"be",
"translated",
"to",
"the",
"given",
"protein",
"sequence",
".",
"Codons",
"are",
"picked",
"first",
"to",
"minimize",
"the",
"mutations",
"relative",
"to",
"a",
"template",
"DNA",
"sequence",
"and... | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L48-L85 | train | Return a list of codons that would be translated to the given protein_seq. |
Kortemme-Lab/klab | klab/cloning/cloning.py | sanitize_codon_list | def sanitize_codon_list(codon_list, forbidden_seqs=()):
"""
Make silent mutations to the given codon lists to remove any undesirable
sequences that are present within it. Undesirable sequences include
restriction sites, which may be optionally specified as a second argument,
and homopolymers abo... | python | def sanitize_codon_list(codon_list, forbidden_seqs=()):
"""
Make silent mutations to the given codon lists to remove any undesirable
sequences that are present within it. Undesirable sequences include
restriction sites, which may be optionally specified as a second argument,
and homopolymers abo... | [
"def",
"sanitize_codon_list",
"(",
"codon_list",
",",
"forbidden_seqs",
"=",
"(",
")",
")",
":",
"# Unit test missing for:",
"# Homopolymer fixing",
"for",
"codon",
"in",
"codon_list",
":",
"if",
"len",
"(",
"codon",
")",
"!=",
"3",
":",
"raise",
"ValueError",... | Make silent mutations to the given codon lists to remove any undesirable
sequences that are present within it. Undesirable sequences include
restriction sites, which may be optionally specified as a second argument,
and homopolymers above a pre-defined length. The return value is the
number of cor... | [
"Make",
"silent",
"mutations",
"to",
"the",
"given",
"codon",
"lists",
"to",
"remove",
"any",
"undesirable",
"sequences",
"that",
"are",
"present",
"within",
"it",
".",
"Undesirable",
"sequences",
"include",
"restriction",
"sites",
"which",
"may",
"be",
"optiona... | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L87-L134 | train | Sanitize a codon list to be consistent with the Gene9 module. |
Kortemme-Lab/klab | klab/cloning/cloning.py | remove_bad_sequence | def remove_bad_sequence(codon_list, bad_seq, bad_seqs):
"""
Make a silent mutation to the given codon list to remove the first instance
of the given bad sequence found in the gene sequence. If the bad sequence
isn't found, nothing happens and the function returns false. Otherwise the
function r... | python | def remove_bad_sequence(codon_list, bad_seq, bad_seqs):
"""
Make a silent mutation to the given codon list to remove the first instance
of the given bad sequence found in the gene sequence. If the bad sequence
isn't found, nothing happens and the function returns false. Otherwise the
function r... | [
"def",
"remove_bad_sequence",
"(",
"codon_list",
",",
"bad_seq",
",",
"bad_seqs",
")",
":",
"gene_seq",
"=",
"''",
".",
"join",
"(",
"codon_list",
")",
"problem",
"=",
"bad_seq",
".",
"search",
"(",
"gene_seq",
")",
"if",
"not",
"problem",
":",
"return",
... | Make a silent mutation to the given codon list to remove the first instance
of the given bad sequence found in the gene sequence. If the bad sequence
isn't found, nothing happens and the function returns false. Otherwise the
function returns true. You can use these return values to easily write a
... | [
"Make",
"a",
"silent",
"mutation",
"to",
"the",
"given",
"codon",
"list",
"to",
"remove",
"the",
"first",
"instance",
"of",
"the",
"given",
"bad",
"sequence",
"found",
"in",
"the",
"gene",
"sequence",
".",
"If",
"the",
"bad",
"sequence",
"isn",
"t",
"fou... | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L136-L173 | train | This function removes the first instance of a given bad sequence from the given codon list. |
Kortemme-Lab/klab | klab/cloning/cloning.py | problem_with_codon | def problem_with_codon(codon_index, codon_list, bad_seqs):
"""
Return true if the given codon overlaps with a bad sequence.
"""
base_1 = 3 * codon_index
base_3 = 3 * codon_index + 2
gene_seq = ''.join(codon_list)
for bad_seq in bad_seqs:
problem = bad_seq.search(gene_seq)
... | python | def problem_with_codon(codon_index, codon_list, bad_seqs):
"""
Return true if the given codon overlaps with a bad sequence.
"""
base_1 = 3 * codon_index
base_3 = 3 * codon_index + 2
gene_seq = ''.join(codon_list)
for bad_seq in bad_seqs:
problem = bad_seq.search(gene_seq)
... | [
"def",
"problem_with_codon",
"(",
"codon_index",
",",
"codon_list",
",",
"bad_seqs",
")",
":",
"base_1",
"=",
"3",
"*",
"codon_index",
"base_3",
"=",
"3",
"*",
"codon_index",
"+",
"2",
"gene_seq",
"=",
"''",
".",
"join",
"(",
"codon_list",
")",
"for",
"b... | Return true if the given codon overlaps with a bad sequence. | [
"Return",
"true",
"if",
"the",
"given",
"codon",
"overlaps",
"with",
"a",
"bad",
"sequence",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L175-L190 | train | Return True if the given codon overlaps with a bad sequence. |
Kortemme-Lab/klab | klab/cloning/cloning.py | sequences_from_fasta | def sequences_from_fasta(path):
"""
Extract multiple sequences from a FASTA file.
"""
from Bio import SeqIO
return {x.description: x.seq for x in SeqIO.parse(path, 'fasta')} | python | def sequences_from_fasta(path):
"""
Extract multiple sequences from a FASTA file.
"""
from Bio import SeqIO
return {x.description: x.seq for x in SeqIO.parse(path, 'fasta')} | [
"def",
"sequences_from_fasta",
"(",
"path",
")",
":",
"from",
"Bio",
"import",
"SeqIO",
"return",
"{",
"x",
".",
"description",
":",
"x",
".",
"seq",
"for",
"x",
"in",
"SeqIO",
".",
"parse",
"(",
"path",
",",
"'fasta'",
")",
"}"
] | Extract multiple sequences from a FASTA file. | [
"Extract",
"multiple",
"sequences",
"from",
"a",
"FASTA",
"file",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L204-L209 | train | Extract multiple sequences from a FASTA file. |
Kortemme-Lab/klab | klab/cloning/cloning.py | sequence_from_pdb | def sequence_from_pdb(pdb, chain=None, ref=None):
"""
Extract a protein sequence from a PDB file.
Arguments
=========
pdb: str
The path to a PDB file or a gzipped PDB file. Alternatively, a PDB id
to fetch and download from the internet.
chain: str
Which chain or ... | python | def sequence_from_pdb(pdb, chain=None, ref=None):
"""
Extract a protein sequence from a PDB file.
Arguments
=========
pdb: str
The path to a PDB file or a gzipped PDB file. Alternatively, a PDB id
to fetch and download from the internet.
chain: str
Which chain or ... | [
"def",
"sequence_from_pdb",
"(",
"pdb",
",",
"chain",
"=",
"None",
",",
"ref",
"=",
"None",
")",
":",
"seqs",
"=",
"chains_from_pdb",
"(",
"pdb",
")",
"if",
"chain",
"is",
"None",
":",
"if",
"len",
"(",
"seqs",
")",
"==",
"1",
":",
"return",
"next"... | Extract a protein sequence from a PDB file.
Arguments
=========
pdb: str
The path to a PDB file or a gzipped PDB file. Alternatively, a PDB id
to fetch and download from the internet.
chain: str
Which chain or chains to extract the sequence from, and how to combine
... | [
"Extract",
"a",
"protein",
"sequence",
"from",
"a",
"PDB",
"file",
".",
"Arguments",
"=========",
"pdb",
":",
"str",
"The",
"path",
"to",
"a",
"PDB",
"file",
"or",
"a",
"gzipped",
"PDB",
"file",
".",
"Alternatively",
"a",
"PDB",
"id",
"to",
"fetch",
"a... | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L211-L283 | train | Extract a protein sequence from a PDB file. |
Kortemme-Lab/klab | klab/cloning/cloning.py | write_sequences | def write_sequences(path, seqs):
"""
Write the given sequence to the given path, using the file format implied
by the path's file extension.
Arguments
=========
path: str or pathlib.Path
The name of the file to create. Allowed extensions are:
- *.fa, *.fas, *.fasta
... | python | def write_sequences(path, seqs):
"""
Write the given sequence to the given path, using the file format implied
by the path's file extension.
Arguments
=========
path: str or pathlib.Path
The name of the file to create. Allowed extensions are:
- *.fa, *.fas, *.fasta
... | [
"def",
"write_sequences",
"(",
"path",
",",
"seqs",
")",
":",
"path",
"=",
"Path",
"(",
"path",
")",
"if",
"path",
".",
"suffix",
"in",
"(",
"'.fa'",
",",
"'.fas'",
",",
"'.fasta'",
")",
":",
"write_sequences_to_fasta",
"(",
"path",
",",
"seqs",
")",
... | Write the given sequence to the given path, using the file format implied
by the path's file extension.
Arguments
=========
path: str or pathlib.Path
The name of the file to create. Allowed extensions are:
- *.fa, *.fas, *.fasta
- *.tsv, *.csv
- *.xlsx
se... | [
"Write",
"the",
"given",
"sequence",
"to",
"the",
"given",
"path",
"using",
"the",
"file",
"format",
"implied",
"by",
"the",
"path",
"s",
"file",
"extension",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L336-L372 | train | Writes the given dictionary of sequences to the given path. |
Kortemme-Lab/klab | klab/cloning/cloning.py | write_sequences_to_fasta | def write_sequences_to_fasta(path, seqs):
"""
Create a FASTA file listing the given sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create.
seqs: dict
A mapping of names to sequences, which can be either protein or DNA.
"""
from Bio impo... | python | def write_sequences_to_fasta(path, seqs):
"""
Create a FASTA file listing the given sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create.
seqs: dict
A mapping of names to sequences, which can be either protein or DNA.
"""
from Bio impo... | [
"def",
"write_sequences_to_fasta",
"(",
"path",
",",
"seqs",
")",
":",
"from",
"Bio",
"import",
"SeqIO",
"from",
"Bio",
".",
"Seq",
"import",
"Seq",
"from",
"Bio",
".",
"SeqRecord",
"import",
"SeqRecord",
"path",
"=",
"Path",
"(",
"path",
")",
"records",
... | Create a FASTA file listing the given sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create.
seqs: dict
A mapping of names to sequences, which can be either protein or DNA. | [
"Create",
"a",
"FASTA",
"file",
"listing",
"the",
"given",
"sequences",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L374-L397 | train | Create a FASTA file listing the given sequences. |
Kortemme-Lab/klab | klab/cloning/cloning.py | write_sequences_to_tsv | def write_sequences_to_tsv(path, seqs):
"""
Create a TSV (or CSV, depending on the extension) file listing the given
sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create. If the path extension is '.tsv',
fields will be delimited by tabs. If... | python | def write_sequences_to_tsv(path, seqs):
"""
Create a TSV (or CSV, depending on the extension) file listing the given
sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create. If the path extension is '.tsv',
fields will be delimited by tabs. If... | [
"def",
"write_sequences_to_tsv",
"(",
"path",
",",
"seqs",
")",
":",
"import",
"csv",
"path",
"=",
"Path",
"(",
"path",
")",
"delimiter",
"=",
"{",
"'.tsv'",
":",
"'\\t'",
",",
"'.csv'",
":",
"','",
"}",
"[",
"path",
".",
"suffix",
"]",
"with",
"path... | Create a TSV (or CSV, depending on the extension) file listing the given
sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create. If the path extension is '.tsv',
fields will be delimited by tabs. If the extension is '.csv', fields
will be de... | [
"Create",
"a",
"TSV",
"(",
"or",
"CSV",
"depending",
"on",
"the",
"extension",
")",
"file",
"listing",
"the",
"given",
"sequences",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L399-L421 | train | Create a TSV or CSV file listing the given dict of sequences. |
Kortemme-Lab/klab | klab/cloning/cloning.py | write_sequences_to_xlsx | def write_sequences_to_xlsx(path, seqs):
"""
Create a XLSX file listing the given sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create.
seqs: dict
A mapping of names to sequences, which can be either protein or DNA.
"""
from openpyxl i... | python | def write_sequences_to_xlsx(path, seqs):
"""
Create a XLSX file listing the given sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create.
seqs: dict
A mapping of names to sequences, which can be either protein or DNA.
"""
from openpyxl i... | [
"def",
"write_sequences_to_xlsx",
"(",
"path",
",",
"seqs",
")",
":",
"from",
"openpyxl",
"import",
"Workbook",
"wb",
"=",
"Workbook",
"(",
")",
"ws",
"=",
"wb",
".",
"active",
"for",
"row",
",",
"id",
"in",
"enumerate",
"(",
"seqs",
",",
"1",
")",
"... | Create a XLSX file listing the given sequences.
Arguments
=========
path: str or pathlib.Path
The name of the file to create.
seqs: dict
A mapping of names to sequences, which can be either protein or DNA. | [
"Create",
"a",
"XLSX",
"file",
"listing",
"the",
"given",
"sequences",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/cloning/cloning.py#L422-L443 | train | Create an XLSX file listing the given sequences. |
berkeley-cocosci/Wallace | wallace/networks.py | Chain.add_node | def add_node(self, node):
"""Add an agent, connecting it to the previous node."""
other_nodes = [n for n in self.nodes() if n.id != node.id]
if isinstance(node, Source) and other_nodes:
raise(Exception("Chain network already has a nodes, "
"can't add a so... | python | def add_node(self, node):
"""Add an agent, connecting it to the previous node."""
other_nodes = [n for n in self.nodes() if n.id != node.id]
if isinstance(node, Source) and other_nodes:
raise(Exception("Chain network already has a nodes, "
"can't add a so... | [
"def",
"add_node",
"(",
"self",
",",
"node",
")",
":",
"other_nodes",
"=",
"[",
"n",
"for",
"n",
"in",
"self",
".",
"nodes",
"(",
")",
"if",
"n",
".",
"id",
"!=",
"node",
".",
"id",
"]",
"if",
"isinstance",
"(",
"node",
",",
"Source",
")",
"and... | Add an agent, connecting it to the previous node. | [
"Add",
"an",
"agent",
"connecting",
"it",
"to",
"the",
"previous",
"node",
"."
] | 3650c0bc3b0804d0adb1d178c5eba9992babb1b0 | https://github.com/berkeley-cocosci/Wallace/blob/3650c0bc3b0804d0adb1d178c5eba9992babb1b0/wallace/networks.py#L17-L27 | train | Add an agent connecting it to the previous node. |
berkeley-cocosci/Wallace | wallace/networks.py | DiscreteGenerational.add_node | def add_node(self, node):
"""Link the agent to a random member of the previous generation."""
nodes = [n for n in self.nodes() if not isinstance(n, Source)]
num_agents = len(nodes)
curr_generation = int((num_agents - 1) / float(self.generation_size))
node.generation = curr_genera... | python | def add_node(self, node):
"""Link the agent to a random member of the previous generation."""
nodes = [n for n in self.nodes() if not isinstance(n, Source)]
num_agents = len(nodes)
curr_generation = int((num_agents - 1) / float(self.generation_size))
node.generation = curr_genera... | [
"def",
"add_node",
"(",
"self",
",",
"node",
")",
":",
"nodes",
"=",
"[",
"n",
"for",
"n",
"in",
"self",
".",
"nodes",
"(",
")",
"if",
"not",
"isinstance",
"(",
"n",
",",
"Source",
")",
"]",
"num_agents",
"=",
"len",
"(",
"nodes",
")",
"curr_gene... | Link the agent to a random member of the previous generation. | [
"Link",
"the",
"agent",
"to",
"a",
"random",
"member",
"of",
"the",
"previous",
"generation",
"."
] | 3650c0bc3b0804d0adb1d178c5eba9992babb1b0 | https://github.com/berkeley-cocosci/Wallace/blob/3650c0bc3b0804d0adb1d178c5eba9992babb1b0/wallace/networks.py#L138-L170 | train | Link the agent to a random member of the previous generation. |
berkeley-cocosci/Wallace | wallace/networks.py | ScaleFree.add_node | def add_node(self, node):
"""Add newcomers one by one, using linear preferential attachment."""
nodes = self.nodes()
# Start with a core of m0 fully-connected agents...
if len(nodes) <= self.m0:
other_nodes = [n for n in nodes if n.id != node.id]
for n in other_n... | python | def add_node(self, node):
"""Add newcomers one by one, using linear preferential attachment."""
nodes = self.nodes()
# Start with a core of m0 fully-connected agents...
if len(nodes) <= self.m0:
other_nodes = [n for n in nodes if n.id != node.id]
for n in other_n... | [
"def",
"add_node",
"(",
"self",
",",
"node",
")",
":",
"nodes",
"=",
"self",
".",
"nodes",
"(",
")",
"# Start with a core of m0 fully-connected agents...",
"if",
"len",
"(",
"nodes",
")",
"<=",
"self",
".",
"m0",
":",
"other_nodes",
"=",
"[",
"n",
"for",
... | Add newcomers one by one, using linear preferential attachment. | [
"Add",
"newcomers",
"one",
"by",
"one",
"using",
"linear",
"preferential",
"attachment",
"."
] | 3650c0bc3b0804d0adb1d178c5eba9992babb1b0 | https://github.com/berkeley-cocosci/Wallace/blob/3650c0bc3b0804d0adb1d178c5eba9992babb1b0/wallace/networks.py#L200-L232 | train | Add newcomers one by one using linear preferential attachment. |
berkeley-cocosci/Wallace | wallace/networks.py | SequentialMicrosociety.add_node | def add_node(self, node):
"""Add a node, connecting it to all the active nodes."""
nodes = sorted(
self.nodes(),
key=attrgetter('creation_time'), reverse=True)
other_nodes = [n for n in nodes if n.id != node.id]
connecting_nodes = other_nodes[0:(self.n - 1)]
... | python | def add_node(self, node):
"""Add a node, connecting it to all the active nodes."""
nodes = sorted(
self.nodes(),
key=attrgetter('creation_time'), reverse=True)
other_nodes = [n for n in nodes if n.id != node.id]
connecting_nodes = other_nodes[0:(self.n - 1)]
... | [
"def",
"add_node",
"(",
"self",
",",
"node",
")",
":",
"nodes",
"=",
"sorted",
"(",
"self",
".",
"nodes",
"(",
")",
",",
"key",
"=",
"attrgetter",
"(",
"'creation_time'",
")",
",",
"reverse",
"=",
"True",
")",
"other_nodes",
"=",
"[",
"n",
"for",
"... | Add a node, connecting it to all the active nodes. | [
"Add",
"a",
"node",
"connecting",
"it",
"to",
"all",
"the",
"active",
"nodes",
"."
] | 3650c0bc3b0804d0adb1d178c5eba9992babb1b0 | https://github.com/berkeley-cocosci/Wallace/blob/3650c0bc3b0804d0adb1d178c5eba9992babb1b0/wallace/networks.py#L249-L260 | train | Add a node connecting it to all the active nodes. |
TUNE-Archive/freight_forwarder | freight_forwarder/container/config.py | Config.docker_py_dict | def docker_py_dict(self):
"""Convert object to match valid docker-py properties.
"""
return {
'image': self.image,
'command': self.cmd,
'hostname': self.hostname,
'user': self.user,
'detach': self.detach,
'stdin_open': self.... | python | def docker_py_dict(self):
"""Convert object to match valid docker-py properties.
"""
return {
'image': self.image,
'command': self.cmd,
'hostname': self.hostname,
'user': self.user,
'detach': self.detach,
'stdin_open': self.... | [
"def",
"docker_py_dict",
"(",
"self",
")",
":",
"return",
"{",
"'image'",
":",
"self",
".",
"image",
",",
"'command'",
":",
"self",
".",
"cmd",
",",
"'hostname'",
":",
"self",
".",
"hostname",
",",
"'user'",
":",
"self",
".",
"user",
",",
"'detach'",
... | Convert object to match valid docker-py properties. | [
"Convert",
"object",
"to",
"match",
"valid",
"docker",
"-",
"py",
"properties",
"."
] | 6ea4a49f474ec04abb8bb81b175c774a16b5312f | https://github.com/TUNE-Archive/freight_forwarder/blob/6ea4a49f474ec04abb8bb81b175c774a16b5312f/freight_forwarder/container/config.py#L75-L94 | train | Convert object to match valid docker - py properties. |
TUNE-Archive/freight_forwarder | freight_forwarder/container/config.py | Config.merge_env | def merge_env(self, env):
"""
:param env:
:return:
"""
# convert to dict to allow update
current_env = dict(item.split('=') for item in self._env)
# do validation and set new values.
self.env = env
# convert to dict to allow update
new_en... | python | def merge_env(self, env):
"""
:param env:
:return:
"""
# convert to dict to allow update
current_env = dict(item.split('=') for item in self._env)
# do validation and set new values.
self.env = env
# convert to dict to allow update
new_en... | [
"def",
"merge_env",
"(",
"self",
",",
"env",
")",
":",
"# convert to dict to allow update",
"current_env",
"=",
"dict",
"(",
"item",
".",
"split",
"(",
"'='",
")",
"for",
"item",
"in",
"self",
".",
"_env",
")",
"# do validation and set new values.",
"self",
".... | :param env:
:return: | [
":",
"param",
"env",
":",
":",
"return",
":"
] | 6ea4a49f474ec04abb8bb81b175c774a16b5312f | https://github.com/TUNE-Archive/freight_forwarder/blob/6ea4a49f474ec04abb8bb81b175c774a16b5312f/freight_forwarder/container/config.py#L267-L285 | train | Merge environment variables into current environment. |
TUNE-Archive/freight_forwarder | freight_forwarder/container/config.py | Config.hostname | def hostname(self, hostname):
""" hostname setter
"""
if not isinstance(hostname, six.string_types):
raise TypeError("hostname must be a string. {0} was passed.".format(type(hostname)))
# if a host name is passed and its not valid raise else set hostname empty strings are ... | python | def hostname(self, hostname):
""" hostname setter
"""
if not isinstance(hostname, six.string_types):
raise TypeError("hostname must be a string. {0} was passed.".format(type(hostname)))
# if a host name is passed and its not valid raise else set hostname empty strings are ... | [
"def",
"hostname",
"(",
"self",
",",
"hostname",
")",
":",
"if",
"not",
"isinstance",
"(",
"hostname",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"TypeError",
"(",
"\"hostname must be a string. {0} was passed.\"",
".",
"format",
"(",
"type",
"(",
"ho... | hostname setter | [
"hostname",
"setter"
] | 6ea4a49f474ec04abb8bb81b175c774a16b5312f | https://github.com/TUNE-Archive/freight_forwarder/blob/6ea4a49f474ec04abb8bb81b175c774a16b5312f/freight_forwarder/container/config.py#L329-L340 | train | set the hostname of the object |
TUNE-Archive/freight_forwarder | freight_forwarder/container/config.py | Config._get_valid_port | def _get_valid_port(self, port):
"""
:param port:
:return "port/protocol":
"""
if '/' in port:
port, protocol = port.split('/')
else:
protocol = 'tcp'
try:
int(port)
except ValueError:
raise ValueError("{0} ... | python | def _get_valid_port(self, port):
"""
:param port:
:return "port/protocol":
"""
if '/' in port:
port, protocol = port.split('/')
else:
protocol = 'tcp'
try:
int(port)
except ValueError:
raise ValueError("{0} ... | [
"def",
"_get_valid_port",
"(",
"self",
",",
"port",
")",
":",
"if",
"'/'",
"in",
"port",
":",
"port",
",",
"protocol",
"=",
"port",
".",
"split",
"(",
"'/'",
")",
"else",
":",
"protocol",
"=",
"'tcp'",
"try",
":",
"int",
"(",
"port",
")",
"except",... | :param port:
:return "port/protocol": | [
":",
"param",
"port",
":",
":",
"return",
"port",
"/",
"protocol",
":"
] | 6ea4a49f474ec04abb8bb81b175c774a16b5312f | https://github.com/TUNE-Archive/freight_forwarder/blob/6ea4a49f474ec04abb8bb81b175c774a16b5312f/freight_forwarder/container/config.py#L494-L512 | train | Returns a valid port name. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_person_by_regid | def get_person_by_regid(self, regid):
"""
Returns a restclients.Person object for the given regid. If the
regid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwregid(regid):
raise... | python | def get_person_by_regid(self, regid):
"""
Returns a restclients.Person object for the given regid. If the
regid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwregid(regid):
raise... | [
"def",
"get_person_by_regid",
"(",
"self",
",",
"regid",
")",
":",
"if",
"not",
"self",
".",
"valid_uwregid",
"(",
"regid",
")",
":",
"raise",
"InvalidRegID",
"(",
"regid",
")",
"url",
"=",
"\"{}/{}/full.json\"",
".",
"format",
"(",
"PERSON_PREFIX",
",",
"... | Returns a restclients.Person object for the given regid. If the
regid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown. | [
"Returns",
"a",
"restclients",
".",
"Person",
"object",
"for",
"the",
"given",
"regid",
".",
"If",
"the",
"regid",
"isn",
"t",
"found",
"or",
"if",
"there",
"is",
"an",
"error",
"communicating",
"with",
"the",
"PWS",
"a",
"DataFailureException",
"will",
"b... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L38-L53 | train | Returns a restclients. Person object for the given regid. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_person_by_netid | def get_person_by_netid(self, netid):
"""
Returns a restclients.Person object for the given netid. If the
netid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwnetid(netid):
raise... | python | def get_person_by_netid(self, netid):
"""
Returns a restclients.Person object for the given netid. If the
netid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwnetid(netid):
raise... | [
"def",
"get_person_by_netid",
"(",
"self",
",",
"netid",
")",
":",
"if",
"not",
"self",
".",
"valid_uwnetid",
"(",
"netid",
")",
":",
"raise",
"InvalidNetID",
"(",
"netid",
")",
"url",
"=",
"\"{}/{}/full.json\"",
".",
"format",
"(",
"PERSON_PREFIX",
",",
"... | Returns a restclients.Person object for the given netid. If the
netid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown. | [
"Returns",
"a",
"restclients",
".",
"Person",
"object",
"for",
"the",
"given",
"netid",
".",
"If",
"the",
"netid",
"isn",
"t",
"found",
"or",
"if",
"there",
"is",
"an",
"error",
"communicating",
"with",
"the",
"PWS",
"a",
"DataFailureException",
"will",
"b... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L55-L70 | train | Returns a restclients. Person object for the given netid. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_person_by_employee_id | def get_person_by_employee_id(self, employee_id):
"""
Returns a restclients.Person object for the given employee id. If the
employee id isn't found, or if there is an error communicating with the
PWS, a DataFailureException will be thrown.
"""
if not self.valid_employee_... | python | def get_person_by_employee_id(self, employee_id):
"""
Returns a restclients.Person object for the given employee id. If the
employee id isn't found, or if there is an error communicating with the
PWS, a DataFailureException will be thrown.
"""
if not self.valid_employee_... | [
"def",
"get_person_by_employee_id",
"(",
"self",
",",
"employee_id",
")",
":",
"if",
"not",
"self",
".",
"valid_employee_id",
"(",
"employee_id",
")",
":",
"raise",
"InvalidEmployeeID",
"(",
"employee_id",
")",
"url",
"=",
"\"{}.json?{}\"",
".",
"format",
"(",
... | Returns a restclients.Person object for the given employee id. If the
employee id isn't found, or if there is an error communicating with the
PWS, a DataFailureException will be thrown. | [
"Returns",
"a",
"restclients",
".",
"Person",
"object",
"for",
"the",
"given",
"employee",
"id",
".",
"If",
"the",
"employee",
"id",
"isn",
"t",
"found",
"or",
"if",
"there",
"is",
"an",
"error",
"communicating",
"with",
"the",
"PWS",
"a",
"DataFailureExce... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L72-L94 | train | Returns a restclients. Person object for the given employee id. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_person_by_student_number | def get_person_by_student_number(self, student_number):
"""
Returns a restclients.Person object for the given student number. If
the student number isn't found, or if there is an error communicating
with the PWS, a DataFailureException will be thrown.
"""
if not self.val... | python | def get_person_by_student_number(self, student_number):
"""
Returns a restclients.Person object for the given student number. If
the student number isn't found, or if there is an error communicating
with the PWS, a DataFailureException will be thrown.
"""
if not self.val... | [
"def",
"get_person_by_student_number",
"(",
"self",
",",
"student_number",
")",
":",
"if",
"not",
"self",
".",
"valid_student_number",
"(",
"student_number",
")",
":",
"raise",
"InvalidStudentNumber",
"(",
"student_number",
")",
"url",
"=",
"\"{}.json?{}\"",
".",
... | Returns a restclients.Person object for the given student number. If
the student number isn't found, or if there is an error communicating
with the PWS, a DataFailureException will be thrown. | [
"Returns",
"a",
"restclients",
".",
"Person",
"object",
"for",
"the",
"given",
"student",
"number",
".",
"If",
"the",
"student",
"number",
"isn",
"t",
"found",
"or",
"if",
"there",
"is",
"an",
"error",
"communicating",
"with",
"the",
"PWS",
"a",
"DataFailu... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L96-L118 | train | Returns a restclients. Person object for the given student number. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_person_by_prox_rfid | def get_person_by_prox_rfid(self, prox_rfid):
"""
Returns a restclients.Person object for the given rfid. If the rfid
isn't found, or if there is an error communicating with the IdCard WS,
a DataFailureException will be thrown.
"""
if not self.valid_prox_rfid(prox_rfid):... | python | def get_person_by_prox_rfid(self, prox_rfid):
"""
Returns a restclients.Person object for the given rfid. If the rfid
isn't found, or if there is an error communicating with the IdCard WS,
a DataFailureException will be thrown.
"""
if not self.valid_prox_rfid(prox_rfid):... | [
"def",
"get_person_by_prox_rfid",
"(",
"self",
",",
"prox_rfid",
")",
":",
"if",
"not",
"self",
".",
"valid_prox_rfid",
"(",
"prox_rfid",
")",
":",
"raise",
"InvalidProxRFID",
"(",
"prox_rfid",
")",
"url",
"=",
"\"{}.json?{}\"",
".",
"format",
"(",
"CARD_PREFI... | Returns a restclients.Person object for the given rfid. If the rfid
isn't found, or if there is an error communicating with the IdCard WS,
a DataFailureException will be thrown. | [
"Returns",
"a",
"restclients",
".",
"Person",
"object",
"for",
"the",
"given",
"rfid",
".",
"If",
"the",
"rfid",
"isn",
"t",
"found",
"or",
"if",
"there",
"is",
"an",
"error",
"communicating",
"with",
"the",
"IdCard",
"WS",
"a",
"DataFailureException",
"wi... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L120-L141 | train | Returns a restclients. Person object for the given rfid. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_entity_by_regid | def get_entity_by_regid(self, regid):
"""
Returns a restclients.Entity object for the given regid. If the
regid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwregid(regid):
raise... | python | def get_entity_by_regid(self, regid):
"""
Returns a restclients.Entity object for the given regid. If the
regid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwregid(regid):
raise... | [
"def",
"get_entity_by_regid",
"(",
"self",
",",
"regid",
")",
":",
"if",
"not",
"self",
".",
"valid_uwregid",
"(",
"regid",
")",
":",
"raise",
"InvalidRegID",
"(",
"regid",
")",
"url",
"=",
"\"{}/{}.json\"",
".",
"format",
"(",
"ENTITY_PREFIX",
",",
"regid... | Returns a restclients.Entity object for the given regid. If the
regid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown. | [
"Returns",
"a",
"restclients",
".",
"Entity",
"object",
"for",
"the",
"given",
"regid",
".",
"If",
"the",
"regid",
"isn",
"t",
"found",
"or",
"if",
"there",
"is",
"an",
"error",
"communicating",
"with",
"the",
"PWS",
"a",
"DataFailureException",
"will",
"b... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L143-L158 | train | Returns a restclients. Entity object for the given regid. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_entity_by_netid | def get_entity_by_netid(self, netid):
"""
Returns a restclients.Entity object for the given netid. If the
netid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwnetid(netid):
raise... | python | def get_entity_by_netid(self, netid):
"""
Returns a restclients.Entity object for the given netid. If the
netid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwnetid(netid):
raise... | [
"def",
"get_entity_by_netid",
"(",
"self",
",",
"netid",
")",
":",
"if",
"not",
"self",
".",
"valid_uwnetid",
"(",
"netid",
")",
":",
"raise",
"InvalidNetID",
"(",
"netid",
")",
"url",
"=",
"\"{}/{}.json\"",
".",
"format",
"(",
"ENTITY_PREFIX",
",",
"netid... | Returns a restclients.Entity object for the given netid. If the
netid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown. | [
"Returns",
"a",
"restclients",
".",
"Entity",
"object",
"for",
"the",
"given",
"netid",
".",
"If",
"the",
"netid",
"isn",
"t",
"found",
"or",
"if",
"there",
"is",
"an",
"error",
"communicating",
"with",
"the",
"PWS",
"a",
"DataFailureException",
"will",
"b... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L160-L175 | train | Returns a restclients. Entity object for the given netid. |
uw-it-aca/uw-restclients-pws | uw_pws/__init__.py | PWS.get_idcard_photo | def get_idcard_photo(self, regid, size="medium"):
"""
Returns a jpeg image, for the passed uwregid. Size is configured as:
"small" (20w x 25h px),
"medium" (120w x 150h px),
"large" (240w x 300h px),
{height in pixels} (custom height, default aspect ratio)... | python | def get_idcard_photo(self, regid, size="medium"):
"""
Returns a jpeg image, for the passed uwregid. Size is configured as:
"small" (20w x 25h px),
"medium" (120w x 150h px),
"large" (240w x 300h px),
{height in pixels} (custom height, default aspect ratio)... | [
"def",
"get_idcard_photo",
"(",
"self",
",",
"regid",
",",
"size",
"=",
"\"medium\"",
")",
":",
"if",
"not",
"self",
".",
"valid_uwregid",
"(",
"regid",
")",
":",
"raise",
"InvalidRegID",
"(",
"regid",
")",
"size",
"=",
"str",
"(",
"size",
")",
"if",
... | Returns a jpeg image, for the passed uwregid. Size is configured as:
"small" (20w x 25h px),
"medium" (120w x 150h px),
"large" (240w x 300h px),
{height in pixels} (custom height, default aspect ratio) | [
"Returns",
"a",
"jpeg",
"image",
"for",
"the",
"passed",
"uwregid",
".",
"Size",
"is",
"configured",
"as",
":",
"small",
"(",
"20w",
"x",
"25h",
"px",
")",
"medium",
"(",
"120w",
"x",
"150h",
"px",
")",
"large",
"(",
"240w",
"x",
"300h",
"px",
")",... | 758d94b42a01762738140c5f984d05f389325b7a | https://github.com/uw-it-aca/uw-restclients-pws/blob/758d94b42a01762738140c5f984d05f389325b7a/uw_pws/__init__.py#L177-L207 | train | Returns a jpeg image for the passed uwregid. |
adaptive-learning/proso-apps | proso_concepts/models.py | generate_identifier | def generate_identifier(sender, instance, **kwargs):
"""
Generate and set identifier of concept before saving object to DB
Args:
sender (class): should be Concept
instance (Concept): saving concept
"""
identifier = Concept.create_identifier(instance.query)
qs = Concept.objects.f... | python | def generate_identifier(sender, instance, **kwargs):
"""
Generate and set identifier of concept before saving object to DB
Args:
sender (class): should be Concept
instance (Concept): saving concept
"""
identifier = Concept.create_identifier(instance.query)
qs = Concept.objects.f... | [
"def",
"generate_identifier",
"(",
"sender",
",",
"instance",
",",
"*",
"*",
"kwargs",
")",
":",
"identifier",
"=",
"Concept",
".",
"create_identifier",
"(",
"instance",
".",
"query",
")",
"qs",
"=",
"Concept",
".",
"objects",
".",
"filter",
"(",
"identifi... | Generate and set identifier of concept before saving object to DB
Args:
sender (class): should be Concept
instance (Concept): saving concept | [
"Generate",
"and",
"set",
"identifier",
"of",
"concept",
"before",
"saving",
"object",
"to",
"DB"
] | 8278c72e498d6ef8d392cc47b48473f4ec037142 | https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso_concepts/models.py#L369-L383 | train | Generate and set identifier of concept before saving object to DB
|
adaptive-learning/proso-apps | proso_concepts/models.py | ConceptManager.get_concept_item_mapping | def get_concept_item_mapping(self, concepts=None, lang=None):
"""
Get mapping of concepts to items belonging to concept.
Args:
concepts (list of Concept): Defaults to None meaning all concepts
lang (str): language of concepts, if None use language of concepts
Re... | python | def get_concept_item_mapping(self, concepts=None, lang=None):
"""
Get mapping of concepts to items belonging to concept.
Args:
concepts (list of Concept): Defaults to None meaning all concepts
lang (str): language of concepts, if None use language of concepts
Re... | [
"def",
"get_concept_item_mapping",
"(",
"self",
",",
"concepts",
"=",
"None",
",",
"lang",
"=",
"None",
")",
":",
"if",
"concepts",
"is",
"None",
":",
"concepts",
"=",
"self",
".",
"filter",
"(",
"active",
"=",
"True",
")",
"if",
"lang",
"is",
"not",
... | Get mapping of concepts to items belonging to concept.
Args:
concepts (list of Concept): Defaults to None meaning all concepts
lang (str): language of concepts, if None use language of concepts
Returns:
dict: concept (int) -> list of item ids (int) | [
"Get",
"mapping",
"of",
"concepts",
"to",
"items",
"belonging",
"to",
"concept",
"."
] | 8278c72e498d6ef8d392cc47b48473f4ec037142 | https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso_concepts/models.py#L66-L88 | train | Get mapping of concepts to items belonging to concept. |
adaptive-learning/proso-apps | proso_concepts/models.py | ConceptManager.get_item_concept_mapping | def get_item_concept_mapping(self, lang):
""" Get mapping of items_ids to concepts containing these items
Args:
lang (str): language of concepts
Returns:
dict: item (int) -> set of concepts (int)
"""
concepts = self.filter(active=True, lang=lang)
... | python | def get_item_concept_mapping(self, lang):
""" Get mapping of items_ids to concepts containing these items
Args:
lang (str): language of concepts
Returns:
dict: item (int) -> set of concepts (int)
"""
concepts = self.filter(active=True, lang=lang)
... | [
"def",
"get_item_concept_mapping",
"(",
"self",
",",
"lang",
")",
":",
"concepts",
"=",
"self",
".",
"filter",
"(",
"active",
"=",
"True",
",",
"lang",
"=",
"lang",
")",
"return",
"group_keys_by_value_lists",
"(",
"Concept",
".",
"objects",
".",
"get_concept... | Get mapping of items_ids to concepts containing these items
Args:
lang (str): language of concepts
Returns:
dict: item (int) -> set of concepts (int) | [
"Get",
"mapping",
"of",
"items_ids",
"to",
"concepts",
"containing",
"these",
"items"
] | 8278c72e498d6ef8d392cc47b48473f4ec037142 | https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso_concepts/models.py#L91-L102 | train | Get mapping of items_ids to concepts containing these items
|
adaptive-learning/proso-apps | proso_concepts/models.py | ConceptManager.get_concepts_to_recalculate | def get_concepts_to_recalculate(self, users, lang, concepts=None):
"""
Get concept which have same changes and have to be recalculated
Args:
users (list of users or user): users whose user stats we are interesting in
lang (str): language of used concepts
conc... | python | def get_concepts_to_recalculate(self, users, lang, concepts=None):
"""
Get concept which have same changes and have to be recalculated
Args:
users (list of users or user): users whose user stats we are interesting in
lang (str): language of used concepts
conc... | [
"def",
"get_concepts_to_recalculate",
"(",
"self",
",",
"users",
",",
"lang",
",",
"concepts",
"=",
"None",
")",
":",
"only_one_user",
"=",
"False",
"if",
"not",
"isinstance",
"(",
"users",
",",
"list",
")",
":",
"only_one_user",
"=",
"True",
"users",
"=",... | Get concept which have same changes and have to be recalculated
Args:
users (list of users or user): users whose user stats we are interesting in
lang (str): language of used concepts
concepts (Optional[list of concepts]): list of primary keys of concepts or concepts
... | [
"Get",
"concept",
"which",
"have",
"same",
"changes",
"and",
"have",
"to",
"be",
"recalculated"
] | 8278c72e498d6ef8d392cc47b48473f4ec037142 | https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso_concepts/models.py#L104-L150 | train | Get concept which have same changes and have to be recalculated |
adaptive-learning/proso-apps | proso_concepts/models.py | UserStatManager.recalculate_concepts | def recalculate_concepts(self, concepts, lang=None):
"""
Recalculated given concepts for given users
Args:
concepts (dict): user id (int -> set of concepts to recalculate)
lang(Optional[str]): language used to get items in all concepts (cached).
Defaults ... | python | def recalculate_concepts(self, concepts, lang=None):
"""
Recalculated given concepts for given users
Args:
concepts (dict): user id (int -> set of concepts to recalculate)
lang(Optional[str]): language used to get items in all concepts (cached).
Defaults ... | [
"def",
"recalculate_concepts",
"(",
"self",
",",
"concepts",
",",
"lang",
"=",
"None",
")",
":",
"if",
"len",
"(",
"concepts",
")",
"==",
"0",
":",
"return",
"if",
"lang",
"is",
"None",
":",
"items",
"=",
"Concept",
".",
"objects",
".",
"get_concept_it... | Recalculated given concepts for given users
Args:
concepts (dict): user id (int -> set of concepts to recalculate)
lang(Optional[str]): language used to get items in all concepts (cached).
Defaults to None, in that case are get items only in used concepts | [
"Recalculated",
"given",
"concepts",
"for",
"given",
"users"
] | 8278c72e498d6ef8d392cc47b48473f4ec037142 | https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso_concepts/models.py#L250-L300 | train | Recalculates given concepts for given users |
adaptive-learning/proso-apps | proso_concepts/models.py | UserStatManager.get_user_stats | def get_user_stats(self, users, lang=None, concepts=None, since=None, recalculate=True):
"""
Finds all UserStats of given concepts and users.
Recompute UserStats if necessary
Args:
users (Optional[list of users] or [user]): list of primary keys of user or users
... | python | def get_user_stats(self, users, lang=None, concepts=None, since=None, recalculate=True):
"""
Finds all UserStats of given concepts and users.
Recompute UserStats if necessary
Args:
users (Optional[list of users] or [user]): list of primary keys of user or users
... | [
"def",
"get_user_stats",
"(",
"self",
",",
"users",
",",
"lang",
"=",
"None",
",",
"concepts",
"=",
"None",
",",
"since",
"=",
"None",
",",
"recalculate",
"=",
"True",
")",
":",
"only_one_user",
"=",
"False",
"if",
"not",
"isinstance",
"(",
"users",
",... | Finds all UserStats of given concepts and users.
Recompute UserStats if necessary
Args:
users (Optional[list of users] or [user]): list of primary keys of user or users
Defaults to None meaning all users.
lang (string): use only concepts witch the lang. Defaults ... | [
"Finds",
"all",
"UserStats",
"of",
"given",
"concepts",
"and",
"users",
".",
"Recompute",
"UserStats",
"if",
"necessary"
] | 8278c72e498d6ef8d392cc47b48473f4ec037142 | https://github.com/adaptive-learning/proso-apps/blob/8278c72e498d6ef8d392cc47b48473f4ec037142/proso_concepts/models.py#L302-L346 | train | Returns a dict of UserStats for given concepts and users. |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | _getSortedString | def _getSortedString(o):
"""
Returns a string describing o, sorting the contents (case-insensitive on keys) if o is a dict.
"""
# todo: replace this with something like pprint on Python upgrade
# We assume here that any container type is either list or tuple which may not always hold
if isinstance(o, (dict)):
p... | python | def _getSortedString(o):
"""
Returns a string describing o, sorting the contents (case-insensitive on keys) if o is a dict.
"""
# todo: replace this with something like pprint on Python upgrade
# We assume here that any container type is either list or tuple which may not always hold
if isinstance(o, (dict)):
p... | [
"def",
"_getSortedString",
"(",
"o",
")",
":",
"# todo: replace this with something like pprint on Python upgrade",
"# We assume here that any container type is either list or tuple which may not always hold",
"if",
"isinstance",
"(",
"o",
",",
"(",
"dict",
")",
")",
":",
"pkeys"... | Returns a string describing o, sorting the contents (case-insensitive on keys) if o is a dict. | [
"Returns",
"a",
"string",
"describing",
"o",
"sorting",
"the",
"contents",
"(",
"case",
"-",
"insensitive",
"on",
"keys",
")",
"if",
"o",
"is",
"a",
"dict",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L501-L514 | train | Returns a string describing o sorting the contents ( case - insensitive on keys |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | DatabaseInterface.locked_execute | def locked_execute(self, sql, parameters = None, cursorClass = DictCursor, quiet = False):
'''We are lock-happy here but SQL performance is not currently an issue daemon-side.'''
return self.execute(sql, parameters, cursorClass, quiet = quiet, locked = True) | python | def locked_execute(self, sql, parameters = None, cursorClass = DictCursor, quiet = False):
'''We are lock-happy here but SQL performance is not currently an issue daemon-side.'''
return self.execute(sql, parameters, cursorClass, quiet = quiet, locked = True) | [
"def",
"locked_execute",
"(",
"self",
",",
"sql",
",",
"parameters",
"=",
"None",
",",
"cursorClass",
"=",
"DictCursor",
",",
"quiet",
"=",
"False",
")",
":",
"return",
"self",
".",
"execute",
"(",
"sql",
",",
"parameters",
",",
"cursorClass",
",",
"quie... | We are lock-happy here but SQL performance is not currently an issue daemon-side. | [
"We",
"are",
"lock",
"-",
"happy",
"here",
"but",
"SQL",
"performance",
"is",
"not",
"currently",
"an",
"issue",
"daemon",
"-",
"side",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L109-L111 | train | This is a lock - happy version of execute. |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | DatabaseInterface.execute | def execute(self, sql, parameters = None, cursorClass = DictCursor, quiet = False, locked = False, do_commit = True):
"""Execute SQL query. This uses DictCursor by default."""
i = 0
errcode = 0
caughte = None
cursor = None
if sql.find(";") != -1 or sql.find("\\G") != -1:
# Catches some injections
rais... | python | def execute(self, sql, parameters = None, cursorClass = DictCursor, quiet = False, locked = False, do_commit = True):
"""Execute SQL query. This uses DictCursor by default."""
i = 0
errcode = 0
caughte = None
cursor = None
if sql.find(";") != -1 or sql.find("\\G") != -1:
# Catches some injections
rais... | [
"def",
"execute",
"(",
"self",
",",
"sql",
",",
"parameters",
"=",
"None",
",",
"cursorClass",
"=",
"DictCursor",
",",
"quiet",
"=",
"False",
",",
"locked",
"=",
"False",
",",
"do_commit",
"=",
"True",
")",
":",
"i",
"=",
"0",
"errcode",
"=",
"0",
... | Execute SQL query. This uses DictCursor by default. | [
"Execute",
"SQL",
"query",
".",
"This",
"uses",
"DictCursor",
"by",
"default",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L116-L174 | train | Execute SQL query. This uses DictCursor by default. |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | DatabaseInterface.insertDict | def insertDict(self, tblname, d, fields = None):
'''Simple function for inserting a dictionary whose keys match the fieldnames of tblname.'''
if fields == None:
fields = sorted(d.keys())
values = None
try:
SQL = 'INSERT INTO %s (%s) VALUES (%s)' % (tblname, join(fields, ", "), join(['%s' for x in range... | python | def insertDict(self, tblname, d, fields = None):
'''Simple function for inserting a dictionary whose keys match the fieldnames of tblname.'''
if fields == None:
fields = sorted(d.keys())
values = None
try:
SQL = 'INSERT INTO %s (%s) VALUES (%s)' % (tblname, join(fields, ", "), join(['%s' for x in range... | [
"def",
"insertDict",
"(",
"self",
",",
"tblname",
",",
"d",
",",
"fields",
"=",
"None",
")",
":",
"if",
"fields",
"==",
"None",
":",
"fields",
"=",
"sorted",
"(",
"d",
".",
"keys",
"(",
")",
")",
"values",
"=",
"None",
"try",
":",
"SQL",
"=",
"... | Simple function for inserting a dictionary whose keys match the fieldnames of tblname. | [
"Simple",
"function",
"for",
"inserting",
"a",
"dictionary",
"whose",
"keys",
"match",
"the",
"fieldnames",
"of",
"tblname",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L176-L191 | train | Simple function for inserting a dictionary whose keys match the fieldnames of tblname. |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | RosettaDB.getData4ID | def getData4ID(self, tablename, ID):
"""get the whole row from the database and store it in a dict"""
fields = self._getFieldsInDB(tablename)
#DATE_ADD(EndDate, INTERVAL 8 DAY), TIMEDIFF(DATE_ADD(EndDate, INTERVAL 7 DAY), NOW()), TIMEDIFF(EndDate, StartDate)
SQL = '''SELECT *,DATE_ADD(EndDate, INTERVAL %... | python | def getData4ID(self, tablename, ID):
"""get the whole row from the database and store it in a dict"""
fields = self._getFieldsInDB(tablename)
#DATE_ADD(EndDate, INTERVAL 8 DAY), TIMEDIFF(DATE_ADD(EndDate, INTERVAL 7 DAY), NOW()), TIMEDIFF(EndDate, StartDate)
SQL = '''SELECT *,DATE_ADD(EndDate, INTERVAL %... | [
"def",
"getData4ID",
"(",
"self",
",",
"tablename",
",",
"ID",
")",
":",
"fields",
"=",
"self",
".",
"_getFieldsInDB",
"(",
"tablename",
")",
"#DATE_ADD(EndDate, INTERVAL 8 DAY), TIMEDIFF(DATE_ADD(EndDate, INTERVAL 7 DAY), NOW()), TIMEDIFF(EndDate, StartDate)",
"SQL",
"=",
... | get the whole row from the database and store it in a dict | [
"get",
"the",
"whole",
"row",
"from",
"the",
"database",
"and",
"store",
"it",
"in",
"a",
"dict"
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L540-L557 | train | get the whole row from the database and store it in a dict |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | RosettaDB.getData4cryptID | def getData4cryptID(self, tablename, ID):
"""get the whole row from the database and store it in a dict"""
fields = self._getFieldsInDB(tablename)
SQL = 'SELECT *,MAKETIME(0,0,TIMESTAMPDIFF(SECOND, StartDate, EndDate)),DATE_ADD(EndDate, INTERVAL %s DAY),TIMESTAMPDIFF(DAY,DATE_ADD(EndDate, INTERVAL %s DA... | python | def getData4cryptID(self, tablename, ID):
"""get the whole row from the database and store it in a dict"""
fields = self._getFieldsInDB(tablename)
SQL = 'SELECT *,MAKETIME(0,0,TIMESTAMPDIFF(SECOND, StartDate, EndDate)),DATE_ADD(EndDate, INTERVAL %s DAY),TIMESTAMPDIFF(DAY,DATE_ADD(EndDate, INTERVAL %s DA... | [
"def",
"getData4cryptID",
"(",
"self",
",",
"tablename",
",",
"ID",
")",
":",
"fields",
"=",
"self",
".",
"_getFieldsInDB",
"(",
"tablename",
")",
"SQL",
"=",
"'SELECT *,MAKETIME(0,0,TIMESTAMPDIFF(SECOND, StartDate, EndDate)),DATE_ADD(EndDate, INTERVAL %s DAY),TIMESTAMPDIFF(D... | get the whole row from the database and store it in a dict | [
"get",
"the",
"whole",
"row",
"from",
"the",
"database",
"and",
"store",
"it",
"in",
"a",
"dict"
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L559-L578 | train | get the whole row from the database and store it in a dict |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | RosettaDB.insertData | def insertData(self, tablename, list_value_pairs, list_SQLCMD_pairs=None):
"""insert data into table
- ID: identifier of the updated value
- list_value_pairs: contains the table field ID and the according value
- list_SQLCMD_pairs: contains the table field ID and a SQL command
"""
fields = self._getF... | python | def insertData(self, tablename, list_value_pairs, list_SQLCMD_pairs=None):
"""insert data into table
- ID: identifier of the updated value
- list_value_pairs: contains the table field ID and the according value
- list_SQLCMD_pairs: contains the table field ID and a SQL command
"""
fields = self._getF... | [
"def",
"insertData",
"(",
"self",
",",
"tablename",
",",
"list_value_pairs",
",",
"list_SQLCMD_pairs",
"=",
"None",
")",
":",
"fields",
"=",
"self",
".",
"_getFieldsInDB",
"(",
"tablename",
")",
"lst_field",
"=",
"[",
"]",
"lst_value",
"=",
"[",
"]",
"# no... | insert data into table
- ID: identifier of the updated value
- list_value_pairs: contains the table field ID and the according value
- list_SQLCMD_pairs: contains the table field ID and a SQL command | [
"insert",
"data",
"into",
"table",
"-",
"ID",
":",
"identifier",
"of",
"the",
"updated",
"value",
"-",
"list_value_pairs",
":",
"contains",
"the",
"table",
"field",
"ID",
"and",
"the",
"according",
"value",
"-",
"list_SQLCMD_pairs",
":",
"contains",
"the",
"... | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L581-L616 | train | insert data into table
|
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | RosettaDB.callproc | def callproc(self, procname, parameters = (), cursorClass = DictCursor, quiet = False):
"""Calls a MySQL stored procedure procname. This uses DictCursor by default."""
i = 0
errcode = 0
caughte = None
while i < self.numTries:
i += 1
try:
cursor = self.connection.cursor(cursorClass)
if type(para... | python | def callproc(self, procname, parameters = (), cursorClass = DictCursor, quiet = False):
"""Calls a MySQL stored procedure procname. This uses DictCursor by default."""
i = 0
errcode = 0
caughte = None
while i < self.numTries:
i += 1
try:
cursor = self.connection.cursor(cursorClass)
if type(para... | [
"def",
"callproc",
"(",
"self",
",",
"procname",
",",
"parameters",
"=",
"(",
")",
",",
"cursorClass",
"=",
"DictCursor",
",",
"quiet",
"=",
"False",
")",
":",
"i",
"=",
"0",
"errcode",
"=",
"0",
"caughte",
"=",
"None",
"while",
"i",
"<",
"self",
"... | Calls a MySQL stored procedure procname. This uses DictCursor by default. | [
"Calls",
"a",
"MySQL",
"stored",
"procedure",
"procname",
".",
"This",
"uses",
"DictCursor",
"by",
"default",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L625-L654 | train | Calls a MySQL stored procedure procname. This uses DictCursor by default. |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | RosettaDB.execQuery | def execQuery(self, sql, parameters = None, cursorClass = MySQLdb.cursors.Cursor, InnoDB = False):
"""Execute SQL query."""
i = 0
errcode = 0
caughte = None
while i < self.numTries:
i += 1
try:
cursor = self.connection.cursor(cursorClass)
if parameters:
errcode = cursor.execute(sql, parame... | python | def execQuery(self, sql, parameters = None, cursorClass = MySQLdb.cursors.Cursor, InnoDB = False):
"""Execute SQL query."""
i = 0
errcode = 0
caughte = None
while i < self.numTries:
i += 1
try:
cursor = self.connection.cursor(cursorClass)
if parameters:
errcode = cursor.execute(sql, parame... | [
"def",
"execQuery",
"(",
"self",
",",
"sql",
",",
"parameters",
"=",
"None",
",",
"cursorClass",
"=",
"MySQLdb",
".",
"cursors",
".",
"Cursor",
",",
"InnoDB",
"=",
"False",
")",
":",
"i",
"=",
"0",
"errcode",
"=",
"0",
"caughte",
"=",
"None",
"while"... | Execute SQL query. | [
"Execute",
"SQL",
"query",
"."
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L660-L696 | train | Execute SQL query. |
Kortemme-Lab/klab | klab/deprecated/rosettadb.py | RosettaDB._getFieldsInDB | def _getFieldsInDB(self, tablename):
"""get all the fields from a specific table"""
SQL = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns where TABLE_NAME="%s"' % tablename
array_data = self.execQuery(SQL)
return [x[0] for x in array_data] | python | def _getFieldsInDB(self, tablename):
"""get all the fields from a specific table"""
SQL = 'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns where TABLE_NAME="%s"' % tablename
array_data = self.execQuery(SQL)
return [x[0] for x in array_data] | [
"def",
"_getFieldsInDB",
"(",
"self",
",",
"tablename",
")",
":",
"SQL",
"=",
"'SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns where TABLE_NAME=\"%s\"'",
"%",
"tablename",
"array_data",
"=",
"self",
".",
"execQuery",
"(",
"SQL",
")",
"return",
"[",
"x",
"[",
"0"... | get all the fields from a specific table | [
"get",
"all",
"the",
"fields",
"from",
"a",
"specific",
"table"
] | 6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b | https://github.com/Kortemme-Lab/klab/blob/6d410ad08f1bd9f7cbbb28d7d946e94fbaaa2b6b/klab/deprecated/rosettadb.py#L699-L705 | train | get all the fields from a specific table |
ABI-Software/MeshParser | src/meshparser/stlparser/parser.py | _is_ascii_stl | def _is_ascii_stl(first_bytes):
"""
Determine if this is an ASCII based data stream, simply by checking the bytes for the word 'solid'.
"""
is_ascii = False
if 'solid' in first_bytes.decode("utf-8").lower():
is_ascii = True
return is_ascii | python | def _is_ascii_stl(first_bytes):
"""
Determine if this is an ASCII based data stream, simply by checking the bytes for the word 'solid'.
"""
is_ascii = False
if 'solid' in first_bytes.decode("utf-8").lower():
is_ascii = True
return is_ascii | [
"def",
"_is_ascii_stl",
"(",
"first_bytes",
")",
":",
"is_ascii",
"=",
"False",
"if",
"'solid'",
"in",
"first_bytes",
".",
"decode",
"(",
"\"utf-8\"",
")",
".",
"lower",
"(",
")",
":",
"is_ascii",
"=",
"True",
"return",
"is_ascii"
] | Determine if this is an ASCII based data stream, simply by checking the bytes for the word 'solid'. | [
"Determine",
"if",
"this",
"is",
"an",
"ASCII",
"based",
"data",
"stream",
"simply",
"by",
"checking",
"the",
"bytes",
"for",
"the",
"word",
"solid",
"."
] | 08dc0ce7c44d0149b443261ff6d3708e28a928e7 | https://github.com/ABI-Software/MeshParser/blob/08dc0ce7c44d0149b443261ff6d3708e28a928e7/src/meshparser/stlparser/parser.py#L108-L116 | train | Determine if this is an ASCII based data stream by checking the bytes for the word solid. |
ABI-Software/MeshParser | src/meshparser/stlparser/parser.py | _is_binary_stl | def _is_binary_stl(data):
"""
Determine if this is a binary file through unpacking the first value after the 80th character
and testing whether this value is greater than zero. This indicates the number of facets in the file.
Could possibly extend this to check that the remaining number of bytes is div... | python | def _is_binary_stl(data):
"""
Determine if this is a binary file through unpacking the first value after the 80th character
and testing whether this value is greater than zero. This indicates the number of facets in the file.
Could possibly extend this to check that the remaining number of bytes is div... | [
"def",
"_is_binary_stl",
"(",
"data",
")",
":",
"is_bin",
"=",
"False",
"start_byte",
"=",
"0",
"end_byte",
"=",
"80",
"_",
"=",
"data",
"[",
"start_byte",
":",
"end_byte",
"]",
"# header data",
"start_byte",
"=",
"end_byte",
"end_byte",
"+=",
"4",
"facet_... | Determine if this is a binary file through unpacking the first value after the 80th character
and testing whether this value is greater than zero. This indicates the number of facets in the file.
Could possibly extend this to check that the remaining number of bytes is divisible by 50. | [
"Determine",
"if",
"this",
"is",
"a",
"binary",
"file",
"through",
"unpacking",
"the",
"first",
"value",
"after",
"the",
"80th",
"character",
"and",
"testing",
"whether",
"this",
"value",
"is",
"greater",
"than",
"zero",
".",
"This",
"indicates",
"the",
"num... | 08dc0ce7c44d0149b443261ff6d3708e28a928e7 | https://github.com/ABI-Software/MeshParser/blob/08dc0ce7c44d0149b443261ff6d3708e28a928e7/src/meshparser/stlparser/parser.py#L119-L135 | train | Determines if this is a binary file. |
mardix/Mocha | mocha/extras/mocha_db.py | StorageObjectType.process_bind_param | def process_bind_param(self, obj, dialect):
"""Get a flask_cloudy.Object and save it as a dict"""
value = obj or {}
if isinstance(obj, flask_cloudy.Object):
value = {}
for k in self.DEFAULT_KEYS:
value[k] = getattr(obj, k)
return super(self.__clas... | python | def process_bind_param(self, obj, dialect):
"""Get a flask_cloudy.Object and save it as a dict"""
value = obj or {}
if isinstance(obj, flask_cloudy.Object):
value = {}
for k in self.DEFAULT_KEYS:
value[k] = getattr(obj, k)
return super(self.__clas... | [
"def",
"process_bind_param",
"(",
"self",
",",
"obj",
",",
"dialect",
")",
":",
"value",
"=",
"obj",
"or",
"{",
"}",
"if",
"isinstance",
"(",
"obj",
",",
"flask_cloudy",
".",
"Object",
")",
":",
"value",
"=",
"{",
"}",
"for",
"k",
"in",
"self",
"."... | Get a flask_cloudy.Object and save it as a dict | [
"Get",
"a",
"flask_cloudy",
".",
"Object",
"and",
"save",
"it",
"as",
"a",
"dict"
] | bce481cb31a0972061dd99bc548701411dcb9de3 | https://github.com/mardix/Mocha/blob/bce481cb31a0972061dd99bc548701411dcb9de3/mocha/extras/mocha_db.py#L105-L113 | train | Get a flask_cloudy. Object and save it as a dict |
mardix/Mocha | mocha/extras/mocha_db.py | StorageObject.from_storage | def from_storage(self, storage):
"""
To use a different storage
:param storage: flask_cloudy.Storage instance
"""
self._storage_obj = storage.get(self._data["name"])
self._storage_loaded = True | python | def from_storage(self, storage):
"""
To use a different storage
:param storage: flask_cloudy.Storage instance
"""
self._storage_obj = storage.get(self._data["name"])
self._storage_loaded = True | [
"def",
"from_storage",
"(",
"self",
",",
"storage",
")",
":",
"self",
".",
"_storage_obj",
"=",
"storage",
".",
"get",
"(",
"self",
".",
"_data",
"[",
"\"name\"",
"]",
")",
"self",
".",
"_storage_loaded",
"=",
"True"
] | To use a different storage
:param storage: flask_cloudy.Storage instance | [
"To",
"use",
"a",
"different",
"storage",
":",
"param",
"storage",
":",
"flask_cloudy",
".",
"Storage",
"instance"
] | bce481cb31a0972061dd99bc548701411dcb9de3 | https://github.com/mardix/Mocha/blob/bce481cb31a0972061dd99bc548701411dcb9de3/mocha/extras/mocha_db.py#L147-L153 | train | Load the object from the storage. |
assamite/creamas | creamas/util.py | create_tasks | def create_tasks(task_coro, addrs, *args, flatten=True, **kwargs):
'''Create and schedule a set of asynchronous tasks.
The function creates the tasks using a given list of agent addresses and
wraps each of them in :func:`asyncio.ensure_future`. The ``*args`` and
``**kwargs`` are passed down to :func:`t... | python | def create_tasks(task_coro, addrs, *args, flatten=True, **kwargs):
'''Create and schedule a set of asynchronous tasks.
The function creates the tasks using a given list of agent addresses and
wraps each of them in :func:`asyncio.ensure_future`. The ``*args`` and
``**kwargs`` are passed down to :func:`t... | [
"def",
"create_tasks",
"(",
"task_coro",
",",
"addrs",
",",
"*",
"args",
",",
"flatten",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"tasks",
"=",
"[",
"]",
"for",
"agent_addr",
"in",
"addrs",
":",
"task",
"=",
"asyncio",
".",
"ensure_future",
"(... | Create and schedule a set of asynchronous tasks.
The function creates the tasks using a given list of agent addresses and
wraps each of them in :func:`asyncio.ensure_future`. The ``*args`` and
``**kwargs`` are passed down to :func:`task_coro` when creating tasks for
each address in :attr:`addrs`.
... | [
"Create",
"and",
"schedule",
"a",
"set",
"of",
"asynchronous",
"tasks",
"."
] | 54dc3e31c97a3f938e58272f8ab80b6bcafeff58 | https://github.com/assamite/creamas/blob/54dc3e31c97a3f938e58272f8ab80b6bcafeff58/creamas/util.py#L12-L48 | train | Create and schedule a set of asynchronous tasks. |
assamite/creamas | creamas/util.py | wait_tasks | async def wait_tasks(tasks, flatten=True):
'''Gather a list of asynchronous tasks and wait their completion.
:param list tasks:
A list of *asyncio* tasks wrapped in :func:`asyncio.ensure_future`.
:param bool flatten:
If ``True`` the returned results are flattened into one list if the
... | python | async def wait_tasks(tasks, flatten=True):
'''Gather a list of asynchronous tasks and wait their completion.
:param list tasks:
A list of *asyncio* tasks wrapped in :func:`asyncio.ensure_future`.
:param bool flatten:
If ``True`` the returned results are flattened into one list if the
... | [
"async",
"def",
"wait_tasks",
"(",
"tasks",
",",
"flatten",
"=",
"True",
")",
":",
"rets",
"=",
"await",
"asyncio",
".",
"gather",
"(",
"*",
"tasks",
")",
"if",
"flatten",
"and",
"all",
"(",
"map",
"(",
"lambda",
"x",
":",
"hasattr",
"(",
"x",
",",... | Gather a list of asynchronous tasks and wait their completion.
:param list tasks:
A list of *asyncio* tasks wrapped in :func:`asyncio.ensure_future`.
:param bool flatten:
If ``True`` the returned results are flattened into one list if the
tasks return iterable objects. The parameter doe... | [
"Gather",
"a",
"list",
"of",
"asynchronous",
"tasks",
"and",
"wait",
"their",
"completion",
"."
] | 54dc3e31c97a3f938e58272f8ab80b6bcafeff58 | https://github.com/assamite/creamas/blob/54dc3e31c97a3f938e58272f8ab80b6bcafeff58/creamas/util.py#L51-L66 | train | Gather a list of asynchronous tasks and wait their completion. |
assamite/creamas | creamas/util.py | run | def run(task=None, loop=None):
'''Run the event loop forever or until the task/future *task* is finished.
:param task:
Optional. Task or Future which is run until complete. If parameter is
``None`` runs the event loop forever.
:param loop:
Optional. Event loop to use. If the paramet... | python | def run(task=None, loop=None):
'''Run the event loop forever or until the task/future *task* is finished.
:param task:
Optional. Task or Future which is run until complete. If parameter is
``None`` runs the event loop forever.
:param loop:
Optional. Event loop to use. If the paramet... | [
"def",
"run",
"(",
"task",
"=",
"None",
",",
"loop",
"=",
"None",
")",
":",
"if",
"loop",
"is",
"None",
":",
"loop",
"=",
"asyncio",
".",
"get_event_loop",
"(",
")",
"if",
"task",
"is",
"None",
":",
"return",
"loop",
".",
"run_forever",
"(",
")",
... | Run the event loop forever or until the task/future *task* is finished.
:param task:
Optional. Task or Future which is run until complete. If parameter is
``None`` runs the event loop forever.
:param loop:
Optional. Event loop to use. If the parameter is ``None`` uses
asyncio's ... | [
"Run",
"the",
"event",
"loop",
"forever",
"or",
"until",
"the",
"task",
"/",
"future",
"*",
"task",
"*",
"is",
"finished",
"."
] | 54dc3e31c97a3f938e58272f8ab80b6bcafeff58 | https://github.com/assamite/creamas/blob/54dc3e31c97a3f938e58272f8ab80b6bcafeff58/creamas/util.py#L88-L106 | train | Run the event loop forever or until the task is finished. |
assamite/creamas | creamas/util.py | split_addrs | def split_addrs(addrs):
'''Split addresses into dictionaries by hosts and ports.
:param list addrs: A list of addresses.
:returns:
A dictionary of dictionaries, where ``dict[HOST][PORT]`` holds a list
of all agent addresses in that environment.
'''
splitted = {}
for addr in add... | python | def split_addrs(addrs):
'''Split addresses into dictionaries by hosts and ports.
:param list addrs: A list of addresses.
:returns:
A dictionary of dictionaries, where ``dict[HOST][PORT]`` holds a list
of all agent addresses in that environment.
'''
splitted = {}
for addr in add... | [
"def",
"split_addrs",
"(",
"addrs",
")",
":",
"splitted",
"=",
"{",
"}",
"for",
"addr",
"in",
"addrs",
":",
"host",
",",
"port",
",",
"_",
"=",
"_addr_key",
"(",
"addr",
")",
"if",
"host",
"not",
"in",
"splitted",
":",
"splitted",
"[",
"host",
"]",... | Split addresses into dictionaries by hosts and ports.
:param list addrs: A list of addresses.
:returns:
A dictionary of dictionaries, where ``dict[HOST][PORT]`` holds a list
of all agent addresses in that environment. | [
"Split",
"addresses",
"into",
"dictionaries",
"by",
"hosts",
"and",
"ports",
"."
] | 54dc3e31c97a3f938e58272f8ab80b6bcafeff58 | https://github.com/assamite/creamas/blob/54dc3e31c97a3f938e58272f8ab80b6bcafeff58/creamas/util.py#L173-L190 | train | Split addresses into dictionaries by hosts and ports. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.