hexsha stringlengths 40 40 | repo stringlengths 7 114 | path stringlengths 4 124 | license listlengths 1 9 | language stringclasses 1
value | identifier stringlengths 1 71 | return_type stringlengths 1 749 ⌀ | original_string stringlengths 76 22.7k | original_docstring stringlengths 16 7.61k | docstring stringlengths 16 2.47k | docstring_tokens listlengths 6 477 | code stringlengths 14 10.2k | code_tokens listlengths 6 996 | short_docstring stringlengths 2 644 | short_docstring_tokens listlengths 1 116 | comment listlengths 1 89 | parameters listlengths 0 64 | docstring_params dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | talk_to_chatbot | <not_specific> | def talk_to_chatbot(self, text, **kwargs): # noqa: E501
"""Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say. # noqa: E501
This method ... | Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asyn... | Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str text: ... | [
"Talk",
"to",
"Chatbot",
"#",
"noqa",
":",
"E501",
"This",
"endpoint",
"can",
"be",
"used",
"to",
"have",
"a",
"conversation",
"about",
"food",
"with",
"the",
"spoonacular",
"chatbot",
".",
"Use",
"the",
"\\",
"\"",
"Get",
"Conversation",
"Suggests",
"\\",... | def talk_to_chatbot(self, text, **kwargs):
"""Talk to Chatbot
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say.
This method makes a synchronous HTTP request by d... | [
"def",
"talk_to_chatbot",
"(",
"self",
",",
"text",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"talk_to_chatbot_with_http_info",
... | Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. | [
"Talk",
"to",
"Chatbot",
"#",
"noqa",
":",
"E501",
"This",
"endpoint",
"can",
"be",
"used",
"to",
"have",
"a",
"conversation",
"about",
"food",
"with",
"the",
"spoonacular",
"chatbot",
"."
] | [
"# noqa: E501",
"\"\"\"Talk to Chatbot # noqa: E501\n\n This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \\\"Get Conversation Suggests\\\" endpoint to show your user what he or she can say. # noqa: E501\n This method makes a synchronous HTTP request... | [
{
"param": "self",
"type": null
},
{
"param": "text",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "text",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | talk_to_chatbot_with_http_info | <not_specific> | def talk_to_chatbot_with_http_info(self, text, **kwargs): # noqa: E501
"""Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say. # noqa: E501
... | Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asyn... | Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str text: ... | [
"Talk",
"to",
"Chatbot",
"#",
"noqa",
":",
"E501",
"This",
"endpoint",
"can",
"be",
"used",
"to",
"have",
"a",
"conversation",
"about",
"food",
"with",
"the",
"spoonacular",
"chatbot",
".",
"Use",
"the",
"\\",
"\"",
"Get",
"Conversation",
"Suggests",
"\\",... | def talk_to_chatbot_with_http_info(self, text, **kwargs):
"""Talk to Chatbot
This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \"Get Conversation Suggests\" endpoint to show your user what he or she can say.
This method makes a synchronous HT... | [
"def",
"talk_to_chatbot_with_http_info",
"(",
"self",
",",
"text",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'text'",
",",
"'context_id'",
"]",
"all_params",
".",
"append",
"(",
"'async_req'",
")",
"... | Talk to Chatbot # noqa: E501
This endpoint can be used to have a conversation about food with the spoonacular chatbot. | [
"Talk",
"to",
"Chatbot",
"#",
"noqa",
":",
"E501",
"This",
"endpoint",
"can",
"be",
"used",
"to",
"have",
"a",
"conversation",
"about",
"food",
"with",
"the",
"spoonacular",
"chatbot",
"."
] | [
"# noqa: E501",
"\"\"\"Talk to Chatbot # noqa: E501\n\n This endpoint can be used to have a conversation about food with the spoonacular chatbot. Use the \\\"Get Conversation Suggests\\\" endpoint to show your user what he or she can say. # noqa: E501\n This method makes a synchronous HTTP request... | [
{
"param": "self",
"type": null
},
{
"param": "text",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "text",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_equipment | <not_specific> | def visualize_equipment(self, instructions, **kwargs): # noqa: E501
"""Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous... | Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_equ... | Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str instructions: The recipe's instructions. | [
"Visualize",
"Equipment",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"equipment",
"used",
"to",
"make",
"a",
"recipe",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"syn... | def visualize_equipment(self, instructions, **kwargs):
"""Visualize Equipment
Visualize the equipment used to make a recipe. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=... | [
"def",
"visualize_equipment",
"(",
"self",
",",
"instructions",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_equipment_wi... | Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. | [
"Visualize",
"Equipment",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"equipment",
"used",
"to",
"make",
"a",
"recipe",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Equipment # noqa: E501\n\n Visualize the equipment used to make a recipe. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "instructions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "instructions",
"type": null,
"docstring": null,
"docstring_to... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_equipment_with_http_info | <not_specific> | def visualize_equipment_with_http_info(self, instructions, **kwargs): # noqa: E501
"""Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
... | Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_equ... | Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str instructions: The recipe's instructions. | [
"Visualize",
"Equipment",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"equipment",
"used",
"to",
"make",
"a",
"recipe",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"syn... | def visualize_equipment_with_http_info(self, instructions, **kwargs):
"""Visualize Equipment
Visualize the equipment used to make a recipe. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please ... | [
"def",
"visualize_equipment_with_http_info",
"(",
"self",
",",
"instructions",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'instructions'",
",",
"'view'",
",",
"'default_css'",
",",
"'show_backlink'",
"]",
... | Visualize Equipment # noqa: E501
Visualize the equipment used to make a recipe. | [
"Visualize",
"Equipment",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"equipment",
"used",
"to",
"make",
"a",
"recipe",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Equipment # noqa: E501\n\n Visualize the equipment used to make a recipe. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "instructions",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "instructions",
"type": null,
"docstring": null,
"docstring_to... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_ingredients | <not_specific> | def visualize_ingredients(self, ingredient_list, servings, **kwargs): # noqa: E501
"""Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchr... | Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_ingredients(i... | Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient per line. (required)
:param float ser... | [
"Visualize",
"Ingredients",
"#",
"noqa",
":",
"E501",
"Visualize",
"ingredients",
"of",
"a",
"recipe",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"r... | def visualize_ingredients(self, ingredient_list, servings, **kwargs):
"""Visualize Ingredients
Visualize ingredients of a recipe. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async... | [
"def",
"visualize_ingredients",
"(",
"self",
",",
"ingredient_list",
",",
"servings",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",... | Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. | [
"Visualize",
"Ingredients",
"#",
"noqa",
":",
"E501",
"Visualize",
"ingredients",
"of",
"a",
"recipe",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Ingredients # noqa: E501\n\n Visualize ingredients of a recipe. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> th... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
},
{
"param": "servings",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_ingredients_with_http_info | <not_specific> | def visualize_ingredients_with_http_info(self, ingredient_list, servings, **kwargs): # noqa: E501
"""Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
... | Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_ingredients_w... | Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient per line. (required)
:param float ser... | [
"Visualize",
"Ingredients",
"#",
"noqa",
":",
"E501",
"Visualize",
"ingredients",
"of",
"a",
"recipe",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"r... | def visualize_ingredients_with_http_info(self, ingredient_list, servings, **kwargs):
"""Visualize Ingredients
Visualize ingredients of a recipe. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, pl... | [
"def",
"visualize_ingredients_with_http_info",
"(",
"self",
",",
"ingredient_list",
",",
"servings",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'ingredient_list'",
",",
"'servings'",
",",
"'measure'",
",",
... | Visualize Ingredients # noqa: E501
Visualize ingredients of a recipe. | [
"Visualize",
"Ingredients",
"#",
"noqa",
":",
"E501",
"Visualize",
"ingredients",
"of",
"a",
"recipe",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Ingredients # noqa: E501\n\n Visualize ingredients of a recipe. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> th... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
},
{
"param": "servings",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_menu_item_nutrition_by_id | <not_specific> | def visualize_menu_item_nutrition_by_id(self, id, **kwargs): # noqa: E501
"""Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynch... | Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_men... | Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The menu item id. (required)
:param bool default_css: Whether the default CSS should be ... | [
"Visualize",
"Menu",
"Item",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"menu",
"item",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"sy... | def visualize_menu_item_nutrition_by_id(self, id, **kwargs):
"""Visualize Menu Item Nutrition by ID
Visualize a menu item's nutritional information as HTML including CSS.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asyn... | [
"def",
"visualize_menu_item_nutrition_by_id",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_menu_i... | Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. | [
"Visualize",
"Menu",
"Item",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"menu",
"item",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Menu Item Nutrition by ID # noqa: E501\n\n Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_menu_item_nutrition_by_id_with_http_info | <not_specific> | def visualize_menu_item_nutrition_by_id_with_http_info(self, id, **kwargs): # noqa: E501
"""Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an... | Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_men... | Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The menu item id. (required)
:param bool default_css: Whether the default CSS should be ... | [
"Visualize",
"Menu",
"Item",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"menu",
"item",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"sy... | def visualize_menu_item_nutrition_by_id_with_http_info(self, id, **kwargs):
"""Visualize Menu Item Nutrition by ID
Visualize a menu item's nutritional information as HTML including CSS.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, p... | [
"def",
"visualize_menu_item_nutrition_by_id_with_http_info",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'id'",
",",
"'default_css'",
"]",
"all_params",
".",
"append",
"(",
"'async_... | Visualize Menu Item Nutrition by ID # noqa: E501
Visualize a menu item's nutritional information as HTML including CSS. | [
"Visualize",
"Menu",
"Item",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"menu",
"item",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Menu Item Nutrition by ID # noqa: E501\n\n Visualize a menu item's nutritional information as HTML including CSS. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_price_breakdown | <not_specific> | def visualize_price_breakdown(self, ingredient_list, servings, **kwargs): # noqa: E501
"""Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an... | Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_p... | Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient per line. (required)
:par... | [
"Visualize",
"Price",
"Breakdown",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"price",
"breakdown",
"of",
"a",
"recipe",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"s... | def visualize_price_breakdown(self, ingredient_list, servings, **kwargs):
"""Visualize Price Breakdown
Visualize the price breakdown of a recipe. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, p... | [
"def",
"visualize_price_breakdown",
"(",
"self",
",",
"ingredient_list",
",",
"servings",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
... | Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. | [
"Visualize",
"Price",
"Breakdown",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"price",
"breakdown",
"of",
"a",
"recipe",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Price Breakdown # noqa: E501\n\n Visualize the price breakdown of a recipe. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
},
{
"param": "servings",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_price_breakdown_with_http_info | <not_specific> | def visualize_price_breakdown_with_http_info(self, ingredient_list, servings, **kwargs): # noqa: E501
"""Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by defa... | Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_p... | Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient per line. (required)
:par... | [
"Visualize",
"Price",
"Breakdown",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"price",
"breakdown",
"of",
"a",
"recipe",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"s... | def visualize_price_breakdown_with_http_info(self, ingredient_list, servings, **kwargs):
"""Visualize Price Breakdown
Visualize the price breakdown of a recipe. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchronous ... | [
"def",
"visualize_price_breakdown_with_http_info",
"(",
"self",
",",
"ingredient_list",
",",
"servings",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'ingredient_list'",
",",
"'servings'",
",",
"'mode'",
",",... | Visualize Price Breakdown # noqa: E501
Visualize the price breakdown of a recipe. | [
"Visualize",
"Price",
"Breakdown",
"#",
"noqa",
":",
"E501",
"Visualize",
"the",
"price",
"breakdown",
"of",
"a",
"recipe",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Price Breakdown # noqa: E501\n\n Visualize the price breakdown of a recipe. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
},
{
"param": "servings",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_product_nutrition_by_id | <not_specific> | def visualize_product_nutrition_by_id(self, id, **kwargs): # noqa: E501
"""Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous... | Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_product... | Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The id of the product. (required)
:param bool default_css: Whether the default CSS should be... | [
"Visualize",
"Product",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"product",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
... | def visualize_product_nutrition_by_id(self, id, **kwargs):
"""Visualize Product Nutrition by ID
Visualize a product's nutritional information as HTML including CSS.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=... | [
"def",
"visualize_product_nutrition_by_id",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_product_... | Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. | [
"Visualize",
"Product",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"product",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Product Nutrition by ID # noqa: E501\n\n Visualize a product's nutritional information as HTML including CSS. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_product_nutrition_by_id_with_http_info | <not_specific> | def visualize_product_nutrition_by_id_with_http_info(self, id, **kwargs): # noqa: E501
"""Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
... | Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_product... | Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The id of the product. (required)
:param bool default_css: Whether the default CSS should be... | [
"Visualize",
"Product",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"product",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
... | def visualize_product_nutrition_by_id_with_http_info(self, id, **kwargs):
"""Visualize Product Nutrition by ID
Visualize a product's nutritional information as HTML including CSS.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please ... | [
"def",
"visualize_product_nutrition_by_id_with_http_info",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'id'",
",",
"'default_css'",
"]",
"all_params",
".",
"append",
"(",
"'async_re... | Visualize Product Nutrition by ID # noqa: E501
Visualize a product's nutritional information as HTML including CSS. | [
"Visualize",
"Product",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"product",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Product Nutrition by ID # noqa: E501\n\n Visualize a product's nutritional information as HTML including CSS. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n ... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_equipment_by_id | <not_specific> | def visualize_recipe_equipment_by_id(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_r... | Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_equipment_by_id(id, async_req=Tru... | Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to the response.
:return: str
If t... | [
"Visualize",
"Recipe",
"Equipment",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"equipment",
"list",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"request",
"by",
"default",
".",
":... | def visualize_recipe_equipment_by_id(self, id, **kwargs):
"""Visualize Recipe Equipment by ID
Visualize a recipe's equipment list.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visu... | [
"def",
"visualize_recipe_equipment_by_id",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_recipe_eq... | Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. | [
"Visualize",
"Recipe",
"Equipment",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"equipment",
"list",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Equipment by ID # noqa: E501\n\n Visualize a recipe's equipment list. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.visualize_recipe... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_equipment_by_id_with_http_info | <not_specific> | def visualize_recipe_equipment_by_id_with_http_info(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, plea... | Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_equipment_by_id_with_http_info(id... | Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to the response.
:return: str
If t... | [
"Visualize",
"Recipe",
"Equipment",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"equipment",
"list",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"request",
"by",
"default",
".",
":... | def visualize_recipe_equipment_by_id_with_http_info(self, id, **kwargs):
"""Visualize Recipe Equipment by ID
Visualize a recipe's equipment list.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> th... | [
"def",
"visualize_recipe_equipment_by_id_with_http_info",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'id'",
",",
"'default_css'",
"]",
"all_params",
".",
"append",
"(",
"'async_req... | Visualize Recipe Equipment by ID # noqa: E501
Visualize a recipe's equipment list. | [
"Visualize",
"Recipe",
"Equipment",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"equipment",
"list",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Equipment by ID # noqa: E501\n\n Visualize a recipe's equipment list. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.visualize_recipe... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_ingredients_by_id | <not_specific> | def visualize_recipe_ingredients_by_id(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass as... | Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_ingredients_by_id(id, async_re... | Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to the response.
:return: str
I... | [
"Visualize",
"Recipe",
"Ingredients",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"ingredient",
"list",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"request",
"by",
"default",
".",
... | def visualize_recipe_ingredients_by_id(self, id, **kwargs):
"""Visualize Recipe Ingredients by ID
Visualize a recipe's ingredient list.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api... | [
"def",
"visualize_recipe_ingredients_by_id",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_recipe_... | Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. | [
"Visualize",
"Recipe",
"Ingredients",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"ingredient",
"list",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Ingredients by ID # noqa: E501\n\n Visualize a recipe's ingredient list. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.visualize_rec... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_ingredients_by_id_with_http_info | <not_specific> | def visualize_recipe_ingredients_by_id_with_http_info(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request,... | Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_ingredients_by_id_with_http_in... | Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to the response.
:return: str
I... | [
"Visualize",
"Recipe",
"Ingredients",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"ingredient",
"list",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"request",
"by",
"default",
".",
... | def visualize_recipe_ingredients_by_id_with_http_info(self, id, **kwargs):
"""Visualize Recipe Ingredients by ID
Visualize a recipe's ingredient list.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>... | [
"def",
"visualize_recipe_ingredients_by_id_with_http_info",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'id'",
",",
"'default_css'",
"]",
"all_params",
".",
"append",
"(",
"'async_r... | Visualize Recipe Ingredients by ID # noqa: E501
Visualize a recipe's ingredient list. | [
"Visualize",
"Recipe",
"Ingredients",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"ingredient",
"list",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Ingredients by ID # noqa: E501\n\n Visualize a recipe's ingredient list. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.visualize_rec... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_nutrition | <not_specific> | def visualize_recipe_nutrition(self, ingredient_list, servings, **kwargs): # noqa: E501
"""Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP req... | Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>... | Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient... | [
"Visualize",
"Recipe",
"Nutrition",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E50... | def visualize_recipe_nutrition(self, ingredient_list, servings, **kwargs):
"""Visualize Recipe Nutrition
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
a... | [
"def",
"visualize_recipe_nutrition",
"(",
"self",
",",
"ingredient_list",
",",
"servings",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
... | Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. | [
"Visualize",
"Recipe",
"Nutrition",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Nutrition # noqa: E501\n\n Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, plea... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
},
{
"param": "servings",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_nutrition_with_http_info | <not_specific> | def visualize_recipe_nutrition_with_http_info(self, ingredient_list, servings, **kwargs): # noqa: E501
"""Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synch... | Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>... | Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient... | [
"Visualize",
"Recipe",
"Nutrition",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E50... | def visualize_recipe_nutrition_with_http_info(self, ingredient_list, servings, **kwargs):
"""Visualize Recipe Nutrition
Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To ma... | [
"def",
"visualize_recipe_nutrition_with_http_info",
"(",
"self",
",",
"ingredient_list",
",",
"servings",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'ingredient_list'",
",",
"'servings'",
",",
"'default_css'"... | Visualize Recipe Nutrition # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. | [
"Visualize",
"Recipe",
"Nutrition",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Nutrition # noqa: E501\n\n Visualize a recipe's nutritional information as HTML including CSS. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, plea... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
},
{
"param": "servings",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_nutrition_by_id | <not_specific> | def visualize_recipe_nutrition_by_id(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HT... | Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_nu... | Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to ... | [
"Visualize",
"Recipe",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"H... | def visualize_recipe_nutrition_by_id(self, id, **kwargs):
"""Visualize Recipe Nutrition by ID
Visualize a recipe's nutritional information as HTML including CSS.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=Tru... | [
"def",
"visualize_recipe_nutrition_by_id",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_recipe_nu... | Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. | [
"Visualize",
"Recipe",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Nutrition by ID # noqa: E501\n\n Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_nutrition_by_id_with_http_info | <not_specific> | def visualize_recipe_nutrition_by_id_with_http_info(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
... | Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_nu... | Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to ... | [
"Visualize",
"Recipe",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"H... | def visualize_recipe_nutrition_by_id_with_http_info(self, id, **kwargs):
"""Visualize Recipe Nutrition by ID
Visualize a recipe's nutritional information as HTML including CSS.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pas... | [
"def",
"visualize_recipe_nutrition_by_id_with_http_info",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'id'",
",",
"'default_css'",
"]",
"all_params",
".",
"append",
"(",
"'async_req... | Visualize Recipe Nutrition by ID # noqa: E501
Visualize a recipe's nutritional information as HTML including CSS. | [
"Visualize",
"Recipe",
"Nutrition",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"nutritional",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Nutrition by ID # noqa: E501\n\n Visualize a recipe's nutritional information as HTML including CSS. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_price_breakdown_by_id | <not_specific> | def visualize_recipe_price_breakdown_by_id(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please... | Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_price_breakdown_by_id(id, ... | Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to the response.
:return: s... | [
"Visualize",
"Recipe",
"Price",
"Breakdown",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"price",
"breakdown",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"request",
"by",
"default",... | def visualize_recipe_price_breakdown_by_id(self, id, **kwargs):
"""Visualize Recipe Price Breakdown by ID
Visualize a recipe's price breakdown.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thre... | [
"def",
"visualize_recipe_price_breakdown_by_id",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_rec... | Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. | [
"Visualize",
"Recipe",
"Price",
"Breakdown",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"price",
"breakdown",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Price Breakdown by ID # noqa: E501\n\n Visualize a recipe's price breakdown. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.visualize... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_price_breakdown_by_id_with_http_info | <not_specific> | def visualize_recipe_price_breakdown_by_id_with_http_info(self, id, **kwargs): # noqa: E501
"""Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP ... | Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.visualize_recipe_price_breakdown_by_id_with... | Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param float id: The recipe id. (required)
:param bool default_css: Whether the default CSS should be added to the response.
:return: s... | [
"Visualize",
"Recipe",
"Price",
"Breakdown",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"price",
"breakdown",
".",
"#",
"noqa",
":",
"E501",
"This",
"method",
"makes",
"a",
"synchronous",
"HTTP",
"request",
"by",
"default",... | def visualize_recipe_price_breakdown_by_id_with_http_info(self, id, **kwargs):
"""Visualize Recipe Price Breakdown by ID
Visualize a recipe's price breakdown.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
... | [
"def",
"visualize_recipe_price_breakdown_by_id_with_http_info",
"(",
"self",
",",
"id",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'id'",
",",
"'default_css'",
"]",
"all_params",
".",
"append",
"(",
"'asy... | Visualize Recipe Price Breakdown by ID # noqa: E501
Visualize a recipe's price breakdown. | [
"Visualize",
"Recipe",
"Price",
"Breakdown",
"by",
"ID",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"price",
"breakdown",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Price Breakdown by ID # noqa: E501\n\n Visualize a recipe's price breakdown. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api.visualize... | [
{
"param": "self",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "id",
"type": null,
"docstring": null,
"docstring_tokens": [],... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_taste | <not_specific> | def visualize_recipe_taste(self, ingredient_list, **kwargs): # noqa: E501
"""Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make... | Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread =... | Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient per line.... | [
"Visualize",
"Recipe",
"Taste",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"taste",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"Thi... | def visualize_recipe_taste(self, ingredient_list, **kwargs):
"""Visualize Recipe Taste
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request... | [
"def",
"visualize_recipe_taste",
"(",
"self",
",",
"ingredient_list",
",",
"**",
"kwargs",
")",
":",
"kwargs",
"[",
"'_return_http_data_only'",
"]",
"=",
"True",
"if",
"kwargs",
".",
"get",
"(",
"'async_req'",
")",
":",
"return",
"self",
".",
"visualize_recipe... | Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. | [
"Visualize",
"Recipe",
"Taste",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"taste",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Taste # noqa: E501\n\n Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass as... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
5bfd72a50dac5ff819de892874fd69ba27ccd7a5 | mikaylakonst/spoonacular-api-clients | python/spoonacular/com/spoonacular/default_api.py | [
"MIT"
] | Python | visualize_recipe_taste_with_http_info | <not_specific> | def visualize_recipe_taste_with_http_info(self, ingredient_list, **kwargs): # noqa: E501
"""Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by d... | Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint! # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread =... | Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint. # noqa: E501
This method makes a synchronous HTTP request by default.
:param async_req bool
:param str ingredient_list: The ingredient list of the recipe, one ingredient per line.... | [
"Visualize",
"Recipe",
"Taste",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"taste",
"information",
"as",
"HTML",
"including",
"CSS",
".",
"You",
"can",
"play",
"around",
"with",
"that",
"endpoint",
".",
"#",
"noqa",
":",
"E501",
"Thi... | def visualize_recipe_taste_with_http_info(self, ingredient_list, **kwargs):
"""Visualize Recipe Taste
Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint!
This method makes a synchronous HTTP request by default. To make an
asynchrono... | [
"def",
"visualize_recipe_taste_with_http_info",
"(",
"self",
",",
"ingredient_list",
",",
"**",
"kwargs",
")",
":",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'ingredient_list'",
"]",
"all_params",
".",
"append",
"(",
"'async_req'",
")",... | Visualize Recipe Taste # noqa: E501
Visualize a recipe's taste information as HTML including CSS. | [
"Visualize",
"Recipe",
"Taste",
"#",
"noqa",
":",
"E501",
"Visualize",
"a",
"recipe",
"'",
"s",
"taste",
"information",
"as",
"HTML",
"including",
"CSS",
"."
] | [
"# noqa: E501",
"\"\"\"Visualize Recipe Taste # noqa: E501\n\n Visualize a recipe's taste information as HTML including CSS. You can play around with that endpoint! # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass as... | [
{
"param": "self",
"type": null
},
{
"param": "ingredient_list",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ingredient_list",
"type": null,
"docstring": null,
"docstring... |
1b225f94ee6c773f4127a586e9e2290fb4c68d32 | mrolinek/alpha_skat | algorithms/mcts_basic.py | [
"MIT"
] | Python | choose | <not_specific> | def choose(self):
"Choose the best successor of node. (Choose a move in the game)"
if self.root_node.is_terminal():
raise RuntimeError(
f"choose called on terminal node {self.root_node}")
if self.root_node not in self.children:
raise RuntimeError(f"No ite... | Choose the best successor of node. (Choose a move in the game) | Choose the best successor of node. (Choose a move in the game) | [
"Choose",
"the",
"best",
"successor",
"of",
"node",
".",
"(",
"Choose",
"a",
"move",
"in",
"the",
"game",
")"
] | def choose(self):
if self.root_node.is_terminal():
raise RuntimeError(
f"choose called on terminal node {self.root_node}")
if self.root_node not in self.children:
raise RuntimeError(f"No iterations performed {self.root_node}")
def all_value_functions(n):
... | [
"def",
"choose",
"(",
"self",
")",
":",
"if",
"self",
".",
"root_node",
".",
"is_terminal",
"(",
")",
":",
"raise",
"RuntimeError",
"(",
"f\"choose called on terminal node {self.root_node}\"",
")",
"if",
"self",
".",
"root_node",
"not",
"in",
"self",
".",
"chi... | Choose the best successor of node. | [
"Choose",
"the",
"best",
"successor",
"of",
"node",
"."
] | [
"\"Choose the best successor of node. (Choose a move in the game)\"",
"# average reward"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1b225f94ee6c773f4127a586e9e2290fb4c68d32 | mrolinek/alpha_skat | algorithms/mcts_basic.py | [
"MIT"
] | Python | do_rollout | null | def do_rollout(self):
"Make the tree one layer better. (Train for one iteration.)"
path = self._select(self.root_node)
leaf = path[-1]
self._expand(leaf)
reward = self._simulate(leaf)
self._backpropagate(path, reward) | Make the tree one layer better. (Train for one iteration.) | Make the tree one layer better. (Train for one iteration.) | [
"Make",
"the",
"tree",
"one",
"layer",
"better",
".",
"(",
"Train",
"for",
"one",
"iteration",
".",
")"
] | def do_rollout(self):
path = self._select(self.root_node)
leaf = path[-1]
self._expand(leaf)
reward = self._simulate(leaf)
self._backpropagate(path, reward) | [
"def",
"do_rollout",
"(",
"self",
")",
":",
"path",
"=",
"self",
".",
"_select",
"(",
"self",
".",
"root_node",
")",
"leaf",
"=",
"path",
"[",
"-",
"1",
"]",
"self",
".",
"_expand",
"(",
"leaf",
")",
"reward",
"=",
"self",
".",
"_simulate",
"(",
... | Make the tree one layer better. | [
"Make",
"the",
"tree",
"one",
"layer",
"better",
"."
] | [
"\"Make the tree one layer better. (Train for one iteration.)\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1b225f94ee6c773f4127a586e9e2290fb4c68d32 | mrolinek/alpha_skat | algorithms/mcts_basic.py | [
"MIT"
] | Python | _expand | <not_specific> | def _expand(self, node):
"Update the `children` dict with the children of `node`"
if node in self.children:
return # already expanded
if node.is_terminal():
self.children[node] = []
else:
self.children[node] = node.find_children() | Update the `children` dict with the children of `node` | Update the `children` dict with the children of `node` | [
"Update",
"the",
"`",
"children",
"`",
"dict",
"with",
"the",
"children",
"of",
"`",
"node",
"`"
] | def _expand(self, node):
if node in self.children:
return
if node.is_terminal():
self.children[node] = []
else:
self.children[node] = node.find_children() | [
"def",
"_expand",
"(",
"self",
",",
"node",
")",
":",
"if",
"node",
"in",
"self",
".",
"children",
":",
"return",
"if",
"node",
".",
"is_terminal",
"(",
")",
":",
"self",
".",
"children",
"[",
"node",
"]",
"=",
"[",
"]",
"else",
":",
"self",
".",... | Update the `children` dict with the children of `node` | [
"Update",
"the",
"`",
"children",
"`",
"dict",
"with",
"the",
"children",
"of",
"`",
"node",
"`"
] | [
"\"Update the `children` dict with the children of `node`\"",
"# already expanded"
] | [
{
"param": "self",
"type": null
},
{
"param": "node",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "node",
"type": null,
"docstring": null,
"docstring_tokens": [... |
1b225f94ee6c773f4127a586e9e2290fb4c68d32 | mrolinek/alpha_skat | algorithms/mcts_basic.py | [
"MIT"
] | Python | _simulate | <not_specific> | def _simulate(self, node):
"Returns the reward for a random simulation (to completion) of `node`"
while True:
if node.is_terminal():
rewards = node.rewards()
return rewards
node = node.find_random_child() | Returns the reward for a random simulation (to completion) of `node` | Returns the reward for a random simulation (to completion) of `node` | [
"Returns",
"the",
"reward",
"for",
"a",
"random",
"simulation",
"(",
"to",
"completion",
")",
"of",
"`",
"node",
"`"
] | def _simulate(self, node):
while True:
if node.is_terminal():
rewards = node.rewards()
return rewards
node = node.find_random_child() | [
"def",
"_simulate",
"(",
"self",
",",
"node",
")",
":",
"while",
"True",
":",
"if",
"node",
".",
"is_terminal",
"(",
")",
":",
"rewards",
"=",
"node",
".",
"rewards",
"(",
")",
"return",
"rewards",
"node",
"=",
"node",
".",
"find_random_child",
"(",
... | Returns the reward for a random simulation (to completion) of `node` | [
"Returns",
"the",
"reward",
"for",
"a",
"random",
"simulation",
"(",
"to",
"completion",
")",
"of",
"`",
"node",
"`"
] | [
"\"Returns the reward for a random simulation (to completion) of `node`\""
] | [
{
"param": "self",
"type": null
},
{
"param": "node",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "node",
"type": null,
"docstring": null,
"docstring_tokens": [... |
1b225f94ee6c773f4127a586e9e2290fb4c68d32 | mrolinek/alpha_skat | algorithms/mcts_basic.py | [
"MIT"
] | Python | _uct_select | <not_specific> | def _uct_select(self, node):
"Select a child of node, balancing exploration & exploitation"
# All children of node should already be expanded:
assert all(n in self.children for n in self.children[node])
assert all(n in self.N for n in self.children[node])
if len(self.children[n... | Select a child of node, balancing exploration & exploitation | Select a child of node, balancing exploration & exploitation | [
"Select",
"a",
"child",
"of",
"node",
"balancing",
"exploration",
"&",
"exploitation"
] | def _uct_select(self, node):
assert all(n in self.children for n in self.children[node])
assert all(n in self.N for n in self.children[node])
if len(self.children[node]) == 1:
return list(self.children[node])[0]
sqrt_parent_visits = math.sqrt(self.N[node])
player = no... | [
"def",
"_uct_select",
"(",
"self",
",",
"node",
")",
":",
"assert",
"all",
"(",
"n",
"in",
"self",
".",
"children",
"for",
"n",
"in",
"self",
".",
"children",
"[",
"node",
"]",
")",
"assert",
"all",
"(",
"n",
"in",
"self",
".",
"N",
"for",
"n",
... | Select a child of node, balancing exploration & exploitation | [
"Select",
"a",
"child",
"of",
"node",
"balancing",
"exploration",
"&",
"exploitation"
] | [
"\"Select a child of node, balancing exploration & exploitation\"",
"# All children of node should already be expanded:",
"\"Upper confidence bound for trees\""
] | [
{
"param": "self",
"type": null
},
{
"param": "node",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "node",
"type": null,
"docstring": null,
"docstring_tokens": [... |
f928e36712ce4f15a78c778fdb3340f39a17d514 | noironetworks/deployment-support | agent/policy_config.py | [
"Apache-2.0"
] | Python | list_l3_eps | null | def list_l3_eps(self):
"""List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL3Ep
"""
self.list_objects_by_type('EpdrLocalL3Ep') | List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL3Ep
| List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL3Ep | [
"List",
"all",
"of",
"the",
"Layer",
"3",
"policy",
"objects",
"Find",
"all",
"of",
"the",
"objects",
"of",
"type",
"EpdrLocalL3Ep"
] | def list_l3_eps(self):
self.list_objects_by_type('EpdrLocalL3Ep') | [
"def",
"list_l3_eps",
"(",
"self",
")",
":",
"self",
".",
"list_objects_by_type",
"(",
"'EpdrLocalL3Ep'",
")"
] | List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL3Ep | [
"List",
"all",
"of",
"the",
"Layer",
"3",
"policy",
"objects",
"Find",
"all",
"of",
"the",
"objects",
"of",
"type",
"EpdrLocalL3Ep"
] | [
"\"\"\"List all of the Layer 3 policy objects\n\n Find all of the objects of type EpdrLocalL3Ep\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f928e36712ce4f15a78c778fdb3340f39a17d514 | noironetworks/deployment-support | agent/policy_config.py | [
"Apache-2.0"
] | Python | list_l2_eps | null | def list_l2_eps(self):
"""List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL2Ep
"""
self.list_objects_by_type('EpdrLocalL2Ep') | List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL2Ep
| List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL2Ep | [
"List",
"all",
"of",
"the",
"Layer",
"3",
"policy",
"objects",
"Find",
"all",
"of",
"the",
"objects",
"of",
"type",
"EpdrLocalL2Ep"
] | def list_l2_eps(self):
self.list_objects_by_type('EpdrLocalL2Ep') | [
"def",
"list_l2_eps",
"(",
"self",
")",
":",
"self",
".",
"list_objects_by_type",
"(",
"'EpdrLocalL2Ep'",
")"
] | List all of the Layer 3 policy objects
Find all of the objects of type EpdrLocalL2Ep | [
"List",
"all",
"of",
"the",
"Layer",
"3",
"policy",
"objects",
"Find",
"all",
"of",
"the",
"objects",
"of",
"type",
"EpdrLocalL2Ep"
] | [
"\"\"\"List all of the Layer 3 policy objects\n\n Find all of the objects of type EpdrLocalL2Ep\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f928e36712ce4f15a78c778fdb3340f39a17d514 | noironetworks/deployment-support | agent/policy_config.py | [
"Apache-2.0"
] | Python | list_vms | null | def list_vms(self):
"""List all the VM policy objects
Find all the objects of type GbpeVMEp
"""
self.list_objects_by_type('GbpeVMEp') | List all the VM policy objects
Find all the objects of type GbpeVMEp
| List all the VM policy objects
Find all the objects of type GbpeVMEp | [
"List",
"all",
"the",
"VM",
"policy",
"objects",
"Find",
"all",
"the",
"objects",
"of",
"type",
"GbpeVMEp"
] | def list_vms(self):
self.list_objects_by_type('GbpeVMEp') | [
"def",
"list_vms",
"(",
"self",
")",
":",
"self",
".",
"list_objects_by_type",
"(",
"'GbpeVMEp'",
")"
] | List all the VM policy objects
Find all the objects of type GbpeVMEp | [
"List",
"all",
"the",
"VM",
"policy",
"objects",
"Find",
"all",
"the",
"objects",
"of",
"type",
"GbpeVMEp"
] | [
"\"\"\"List all the VM policy objects\n\n Find all the objects of type GbpeVMEp\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
97637537444dcbaf2d3dfc7e73ea5fc0b5379681 | nembery/aframe | endpoints/views.py | [
"Apache-2.0"
] | Python | add_endpoints_to_queue | <not_specific> | def add_endpoints_to_queue(request):
"""
takes a list of selected endpoints and adds them to the user session under a key named
"endpoint_queue". Also adds another list of "endpoint_queue_names" to avoid limitations with django template
language stuff to show already selected items in the queue
"""... |
takes a list of selected endpoints and adds them to the user session under a key named
"endpoint_queue". Also adds another list of "endpoint_queue_names" to avoid limitations with django template
language stuff to show already selected items in the queue
| takes a list of selected endpoints and adds them to the user session under a key named
"endpoint_queue". Also adds another list of "endpoint_queue_names" to avoid limitations with django template
language stuff to show already selected items in the queue | [
"takes",
"a",
"list",
"of",
"selected",
"endpoints",
"and",
"adds",
"them",
"to",
"the",
"user",
"session",
"under",
"a",
"key",
"named",
"\"",
"endpoint_queue",
"\"",
".",
"Also",
"adds",
"another",
"list",
"of",
"\"",
"endpoint_queue_names",
"\"",
"to",
... | def add_endpoints_to_queue(request):
logger.info("__ endpoints add_endpoints_to_queue __")
required_fields = set(["endpoints", "group_id"])
if not required_fields.issubset(request.POST):
logger.error("not all required fields found in request")
return render(request, "error.html", {"error": "... | [
"def",
"add_endpoints_to_queue",
"(",
"request",
")",
":",
"logger",
".",
"info",
"(",
"\"__ endpoints add_endpoints_to_queue __\"",
")",
"required_fields",
"=",
"set",
"(",
"[",
"\"endpoints\"",
",",
"\"group_id\"",
"]",
")",
"if",
"not",
"required_fields",
".",
... | takes a list of selected endpoints and adds them to the user session under a key named
"endpoint_queue". | [
"takes",
"a",
"list",
"of",
"selected",
"endpoints",
"and",
"adds",
"them",
"to",
"the",
"user",
"session",
"under",
"a",
"key",
"named",
"\"",
"endpoint_queue",
"\"",
"."
] | [
"\"\"\"\n takes a list of selected endpoints and adds them to the user session under a key named\n \"endpoint_queue\". Also adds another list of \"endpoint_queue_names\" to avoid limitations with django template\n language stuff to show already selected items in the queue\n\n \"\"\""
] | [
{
"param": "request",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "request",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
97637537444dcbaf2d3dfc7e73ea5fc0b5379681 | nembery/aframe | endpoints/views.py | [
"Apache-2.0"
] | Python | search | <not_specific> | def search(request):
"""
used for UI autocomplete searches. Will search all configured endpoint groups! Be careful with nmap based
groups as this will take a long time!
:param request: term
:return: json list of dicts of type {'value': 'provider.id:endpoint.id', 'label': 'group_name/endpoint_name'}
... |
used for UI autocomplete searches. Will search all configured endpoint groups! Be careful with nmap based
groups as this will take a long time!
:param request: term
:return: json list of dicts of type {'value': 'provider.id:endpoint.id', 'label': 'group_name/endpoint_name'}
| used for UI autocomplete searches. Will search all configured endpoint groups. Be careful with nmap based
groups as this will take a long time! | [
"used",
"for",
"UI",
"autocomplete",
"searches",
".",
"Will",
"search",
"all",
"configured",
"endpoint",
"groups",
".",
"Be",
"careful",
"with",
"nmap",
"based",
"groups",
"as",
"this",
"will",
"take",
"a",
"long",
"time!"
] | def search(request):
logger.info("__ input_forms search __")
term = request.GET["term"]
results = []
provider_list = EndpointGroup.objects.all().order_by("name")
for provider in provider_list:
provider_instance = endpoint_provider.get_provider_instance_from_group(provider.id)
provide... | [
"def",
"search",
"(",
"request",
")",
":",
"logger",
".",
"info",
"(",
"\"__ input_forms search __\"",
")",
"term",
"=",
"request",
".",
"GET",
"[",
"\"term\"",
"]",
"results",
"=",
"[",
"]",
"provider_list",
"=",
"EndpointGroup",
".",
"objects",
".",
"all... | used for UI autocomplete searches. | [
"used",
"for",
"UI",
"autocomplete",
"searches",
"."
] | [
"\"\"\"\n used for UI autocomplete searches. Will search all configured endpoint groups! Be careful with nmap based\n groups as this will take a long time!\n :param request: term\n :return: json list of dicts of type {'value': 'provider.id:endpoint.id', 'label': 'group_name/endpoint_name'}\n \"\"\""
... | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "json list of dicts of type {'value': 'provider.id:endpoint.id', 'label': 'group_name/endpoint_name'}",
"docstring_tokens": [
"json",
"list",
"of",
"dicts",
"of",
"type",
"{",
"'",
"value",
"'... |
97637537444dcbaf2d3dfc7e73ea5fc0b5379681 | nembery/aframe | endpoints/views.py | [
"Apache-2.0"
] | Python | search_ip | <not_specific> | def search_ip(request):
"""
used for UI autocomplete searches. Will search all configured endpoint groups! Be careful with nmap based
groups as this will take a long time!
:param request: term
:return: json list of dicts of type {'value': 'provider.id:endpoint.ip', 'label': 'group_name/endpoint_name... |
used for UI autocomplete searches. Will search all configured endpoint groups! Be careful with nmap based
groups as this will take a long time!
:param request: term
:return: json list of dicts of type {'value': 'provider.id:endpoint.ip', 'label': 'group_name/endpoint_name'}
| used for UI autocomplete searches. Will search all configured endpoint groups. Be careful with nmap based
groups as this will take a long time! | [
"used",
"for",
"UI",
"autocomplete",
"searches",
".",
"Will",
"search",
"all",
"configured",
"endpoint",
"groups",
".",
"Be",
"careful",
"with",
"nmap",
"based",
"groups",
"as",
"this",
"will",
"take",
"a",
"long",
"time!"
] | def search_ip(request):
logger.info("__ input_forms search_ip __")
term = request.GET["term"]
results = []
provider_list = EndpointGroup.objects.all().order_by("name")
for provider in provider_list:
provider_instance = endpoint_provider.get_provider_instance_from_group(provider.id)
p... | [
"def",
"search_ip",
"(",
"request",
")",
":",
"logger",
".",
"info",
"(",
"\"__ input_forms search_ip __\"",
")",
"term",
"=",
"request",
".",
"GET",
"[",
"\"term\"",
"]",
"results",
"=",
"[",
"]",
"provider_list",
"=",
"EndpointGroup",
".",
"objects",
".",
... | used for UI autocomplete searches. | [
"used",
"for",
"UI",
"autocomplete",
"searches",
"."
] | [
"\"\"\"\n used for UI autocomplete searches. Will search all configured endpoint groups! Be careful with nmap based\n groups as this will take a long time!\n :param request: term\n :return: json list of dicts of type {'value': 'provider.id:endpoint.ip', 'label': 'group_name/endpoint_name'}\n \"\"\""
... | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "json list of dicts of type {'value': 'provider.id:endpoint.ip', 'label': 'group_name/endpoint_name'}",
"docstring_tokens": [
"json",
"list",
"of",
"dicts",
"of",
"type",
"{",
"'",
"value",
"'... |
97faa46d346951ddf03773abe47bb4e27e9fb8b0 | nembery/aframe | endpoints/plugins/SaltMinion.py | [
"Apache-2.0"
] | Python | load_instance_config | <not_specific> | def load_instance_config(self, config):
"""
set the configuration on the object
:param config: the configuration from the endpoint group settings
"""
self.username = self.get_config_value("username")
self.password = self.get_config_value("password")
self.host = se... |
set the configuration on the object
:param config: the configuration from the endpoint group settings
| set the configuration on the object | [
"set",
"the",
"configuration",
"on",
"the",
"object"
] | def load_instance_config(self, config):
self.username = self.get_config_value("username")
self.password = self.get_config_value("password")
self.host = self.get_config_value("host")
self.protocol = self.get_config_value("protocol")
self.load_iterator()
return None | [
"def",
"load_instance_config",
"(",
"self",
",",
"config",
")",
":",
"self",
".",
"username",
"=",
"self",
".",
"get_config_value",
"(",
"\"username\"",
")",
"self",
".",
"password",
"=",
"self",
".",
"get_config_value",
"(",
"\"password\"",
")",
"self",
"."... | set the configuration on the object | [
"set",
"the",
"configuration",
"on",
"the",
"object"
] | [
"\"\"\"\n set the configuration on the object\n :param config: the configuration from the endpoint group settings\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "config",
"type": null,
"docstring": "the configuration from the end... |
97faa46d346951ddf03773abe47bb4e27e9fb8b0 | nembery/aframe | endpoints/plugins/SaltMinion.py | [
"Apache-2.0"
] | Python | __connect_to_saltapi | <not_specific> | def __connect_to_saltapi(self):
"""
connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method
:return: boolean if successful
"""
_auth_json = """
{
"username" : "%s",
... |
connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method
:return: boolean if successful
| connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method | [
"connects",
"to",
"salt",
"api",
"endpoint",
"to",
"get",
"a",
"token",
"with",
"the",
"specified",
"user",
"and",
"password",
"defaults",
"to",
"'",
"pam",
"'",
"eauth",
"method"
] | def __connect_to_saltapi(self):
_auth_json = """
{
"username" : "%s",
"password" : "%s",
"eauth": "pam"
}
""" % (self.username, self.password)
if ':' not in self.host:
self.host += ':8000'
... | [
"def",
"__connect_to_saltapi",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n {\n \"username\" : \"%s\",\n \"password\" : \"%s\",\n \"eauth\": \"pam\"\n }\n \"\"\"",
"%",
"(",
"self",
".",
"userna... | connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method | [
"connects",
"to",
"salt",
"api",
"endpoint",
"to",
"get",
"a",
"token",
"with",
"the",
"specified",
"user",
"and",
"password",
"defaults",
"to",
"'",
"pam",
"'",
"eauth",
"method"
] | [
"\"\"\"\n connects to salt api endpoint to get a token with the specified user and password\n\n defaults to 'pam' eauth method\n\n :return: boolean if successful\n\n \"\"\"",
"# if we don't have a port specified, let's add the default of 8000 here"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
bfa872a416f6170b6bea9508da7886cebf1803a0 | nembery/aframe | a_frame/utils/action_providers/SSHRemoteExecution.py | [
"Apache-2.0"
] | Python | execute_template | <not_specific> | def execute_template(self, template):
"""
switches based on request_type chosen from template configuration
:param template:
:return: String results from the endpoint netconf subsystem
"""
# let's ensure we don't have silly dos style line breaks
template = templ... |
switches based on request_type chosen from template configuration
:param template:
:return: String results from the endpoint netconf subsystem
| switches based on request_type chosen from template configuration | [
"switches",
"based",
"on",
"request_type",
"chosen",
"from",
"template",
"configuration"
] | def execute_template(self, template):
template = template.replace("\r\n", "\n")
template = template.replace("\r", "\n")
if self.request_type == "scp":
return self.scp_template(template)
elif self.request_type == "scp_and_execute":
self.scp_template(template)
... | [
"def",
"execute_template",
"(",
"self",
",",
"template",
")",
":",
"template",
"=",
"template",
".",
"replace",
"(",
"\"\\r\\n\"",
",",
"\"\\n\"",
")",
"template",
"=",
"template",
".",
"replace",
"(",
"\"\\r\"",
",",
"\"\\n\"",
")",
"if",
"self",
".",
"... | switches based on request_type chosen from template configuration | [
"switches",
"based",
"on",
"request_type",
"chosen",
"from",
"template",
"configuration"
] | [
"\"\"\"\n switches based on request_type chosen from template configuration\n\n :param template:\n :return: String results from the endpoint netconf subsystem\n \"\"\"",
"# let's ensure we don't have silly dos style line breaks",
"# first copy over the template",
"# this will updat... | [
{
"param": "self",
"type": null
},
{
"param": "template",
"type": null
}
] | {
"returns": [
{
"docstring": "String results from the endpoint netconf subsystem",
"docstring_tokens": [
"String",
"results",
"from",
"the",
"endpoint",
"netconf",
"subsystem"
],
"type": null
}
],
"raises": [],
"params": [
... |
bfa872a416f6170b6bea9508da7886cebf1803a0 | nembery/aframe | a_frame/utils/action_providers/SSHRemoteExecution.py | [
"Apache-2.0"
] | Python | scp_template | <not_specific> | def scp_template(self, template):
"""
Uses scp to copy the template to the remote endpoint
Hint, the file_path parameter can be overridden with the {{ syntax }}
:param template:
:return:
"""
try:
if self.file_path.endswith("/"):
# bad ... |
Uses scp to copy the template to the remote endpoint
Hint, the file_path parameter can be overridden with the {{ syntax }}
:param template:
:return:
| Uses scp to copy the template to the remote endpoint
Hint, the file_path parameter can be overridden with the {{ syntax }} | [
"Uses",
"scp",
"to",
"copy",
"the",
"template",
"to",
"the",
"remote",
"endpoint",
"Hint",
"the",
"file_path",
"parameter",
"can",
"be",
"overridden",
"with",
"the",
"{{",
"syntax",
"}}"
] | def scp_template(self, template):
try:
if self.file_path.endswith("/"):
new_path = self.file_path + str(uuid.uuid4())
self.file_path = new_path
script_path = "/".join(self.file_path.split('/')[:-1])
transport = paramiko.Transport((self.endpoint... | [
"def",
"scp_template",
"(",
"self",
",",
"template",
")",
":",
"try",
":",
"if",
"self",
".",
"file_path",
".",
"endswith",
"(",
"\"/\"",
")",
":",
"new_path",
"=",
"self",
".",
"file_path",
"+",
"str",
"(",
"uuid",
".",
"uuid4",
"(",
")",
")",
"se... | Uses scp to copy the template to the remote endpoint
Hint, the file_path parameter can be overridden with the {{ syntax }} | [
"Uses",
"scp",
"to",
"copy",
"the",
"template",
"to",
"the",
"remote",
"endpoint",
"Hint",
"the",
"file_path",
"parameter",
"can",
"be",
"overridden",
"with",
"the",
"{{",
"syntax",
"}}"
] | [
"\"\"\"\n Uses scp to copy the template to the remote endpoint\n Hint, the file_path parameter can be overridden with the {{ syntax }}\n :param template:\n :return:\n \"\"\"",
"# bad news! no actual file name! let's use a random file name and continue",
"# remove last thing af... | [
{
"param": "self",
"type": null
},
{
"param": "template",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
a4ed72bb3388d911378a3bfeca1a9ef92721a6e4 | nembery/aframe | a_frame/utils/action_providers/ShellExecution.py | [
"Apache-2.0"
] | Python | execute_template | <not_specific> | def execute_template(self, template):
"""
writes the template to a tmp file and executes it on the server.
Potentially very dangerous. You probably shouldn"t do this!
If you do want to do this ( you shouldn"t ), your script should
look for the device endpoint parameters stored i... |
writes the template to a tmp file and executes it on the server.
Potentially very dangerous. You probably shouldn"t do this!
If you do want to do this ( you shouldn"t ), your script should
look for the device endpoint parameters stored in the env as
ENDPOINT_USERNAME
EN... | writes the template to a tmp file and executes it on the server.
Potentially very dangerous. You probably shouldn"t do this!
If you do want to do this ( you shouldn"t ), your script should
look for the device endpoint parameters stored in the env as
ENDPOINT_USERNAME
ENDPOINT_PASSWORD
ENDPOINT_IP | [
"writes",
"the",
"template",
"to",
"a",
"tmp",
"file",
"and",
"executes",
"it",
"on",
"the",
"server",
".",
"Potentially",
"very",
"dangerous",
".",
"You",
"probably",
"shouldn",
"\"",
"t",
"do",
"this!",
"If",
"you",
"do",
"want",
"to",
"do",
"this",
... | def execute_template(self, template):
cleaned_template = template.replace('\r\n', '\n')
path = "/tmp/" + str(uuid.uuid4())
f = open(path, "w+")
f.write(cleaned_template)
f.flush()
time.sleep(.5)
filename = f.name
os.chmod(filename, 0700)
f.close()
... | [
"def",
"execute_template",
"(",
"self",
",",
"template",
")",
":",
"cleaned_template",
"=",
"template",
".",
"replace",
"(",
"'\\r\\n'",
",",
"'\\n'",
")",
"path",
"=",
"\"/tmp/\"",
"+",
"str",
"(",
"uuid",
".",
"uuid4",
"(",
")",
")",
"f",
"=",
"open"... | writes the template to a tmp file and executes it on the server. | [
"writes",
"the",
"template",
"to",
"a",
"tmp",
"file",
"and",
"executes",
"it",
"on",
"the",
"server",
"."
] | [
"\"\"\"\n writes the template to a tmp file and executes it on the server.\n Potentially very dangerous. You probably shouldn\"t do this!\n\n If you do want to do this ( you shouldn\"t ), your script should\n look for the device endpoint parameters stored in the env as\n ENDPOINT_... | [
{
"param": "self",
"type": null
},
{
"param": "template",
"type": null
}
] | {
"returns": [
{
"docstring": "String results from the output of the script",
"docstring_tokens": [
"String",
"results",
"from",
"the",
"output",
"of",
"the",
"script"
],
"type": null
}
],
"raises": [],
"params": [
... |
3c730c302d1c0227c801997b27d04ea3b4bfd31f | nembery/aframe | endpoints/plugins/JunosSpaceDeviceList.py | [
"Apache-2.0"
] | Python | load_instance_config | <not_specific> | def load_instance_config(self, config):
"""
set the configuration on the object
:param instance_config: the configuration from the endpoint group settings
"""
self.username = self.get_config_value("username")
self.password = self.get_config_value("password")
self.... |
set the configuration on the object
:param instance_config: the configuration from the endpoint group settings
| set the configuration on the object | [
"set",
"the",
"configuration",
"on",
"the",
"object"
] | def load_instance_config(self, config):
self.username = self.get_config_value("username")
self.password = self.get_config_value("password")
self.host = self.get_config_value("host")
self.load_iterator()
return None | [
"def",
"load_instance_config",
"(",
"self",
",",
"config",
")",
":",
"self",
".",
"username",
"=",
"self",
".",
"get_config_value",
"(",
"\"username\"",
")",
"self",
".",
"password",
"=",
"self",
".",
"get_config_value",
"(",
"\"password\"",
")",
"self",
"."... | set the configuration on the object | [
"set",
"the",
"configuration",
"on",
"the",
"object"
] | [
"\"\"\"\n set the configuration on the object\n :param instance_config: the configuration from the endpoint group settings\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "config",
"type": null,
"docstring": null,
"docstring_tokens":... |
c5a83c3558972f41a86112cc2a315f7b5d8694dc | nembery/aframe | endpoints/plugins/NmapDiscovery.py | [
"Apache-2.0"
] | Python | load_instance_config | <not_specific> | def load_instance_config(self, config):
"""
Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results
:param data: configuration data from the settings.py file
:return: None
"""
global results
# remove "/" from network... |
Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results
:param data: configuration data from the settings.py file
:return: None
| Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results | [
"Attempt",
"to",
"load",
"the",
"results",
"from",
"the",
"cache",
".",
"If",
"no",
"cache",
"exists",
"run",
"a",
"new",
"scan",
"and",
"cache",
"those",
"results"
] | def load_instance_config(self, config):
global results
cache_network_name = self.get_config_value("network").replace("/", "-")
cache_key_name = "NmapDiscovery_%s" % cache_network_name
results = cache.get(cache_key_name)
if results is None:
print "No results found - pe... | [
"def",
"load_instance_config",
"(",
"self",
",",
"config",
")",
":",
"global",
"results",
"cache_network_name",
"=",
"self",
".",
"get_config_value",
"(",
"\"network\"",
")",
".",
"replace",
"(",
"\"/\"",
",",
"\"-\"",
")",
"cache_key_name",
"=",
"\"NmapDiscover... | Attempt to load the results from the cache. | [
"Attempt",
"to",
"load",
"the",
"results",
"from",
"the",
"cache",
"."
] | [
"\"\"\"\n Attempt to load the results from the cache. If no cache exists, run a new scan and cache those results\n :param data: configuration data from the settings.py file\n :return: None\n \"\"\"",
"# remove \"/\" from network name so we can use it for our cache",
"# query the cach... | [
{
"param": "self",
"type": null
},
{
"param": "config",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
1fa78cba4f84e038b43dd4a5eb74cf1c80eff316 | nembery/aframe | a_frame/utils/action_providers/NetconfAction.py | [
"Apache-2.0"
] | Python | execute_template | <not_specific> | def execute_template(self, template):
"""
switches based on request_type chosen from template configuration
:param template:
:return: String results from the endpoint netconf subsystem
"""
if self.dev is None:
return self.result_msg
if self.request_t... |
switches based on request_type chosen from template configuration
:param template:
:return: String results from the endpoint netconf subsystem
| switches based on request_type chosen from template configuration | [
"switches",
"based",
"on",
"request_type",
"chosen",
"from",
"template",
"configuration"
] | def execute_template(self, template):
if self.dev is None:
return self.result_msg
if self.request_type == "apply_template":
return self.apply_template(template)
elif self.request_type == "execute_cheat_command":
return self.execute_cheat_command(template)
... | [
"def",
"execute_template",
"(",
"self",
",",
"template",
")",
":",
"if",
"self",
".",
"dev",
"is",
"None",
":",
"return",
"self",
".",
"result_msg",
"if",
"self",
".",
"request_type",
"==",
"\"apply_template\"",
":",
"return",
"self",
".",
"apply_template",
... | switches based on request_type chosen from template configuration | [
"switches",
"based",
"on",
"request_type",
"chosen",
"from",
"template",
"configuration"
] | [
"\"\"\"\n switches based on request_type chosen from template configuration\n\n :param template:\n :return: String results from the endpoint netconf subsystem\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "template",
"type": null
}
] | {
"returns": [
{
"docstring": "String results from the endpoint netconf subsystem",
"docstring_tokens": [
"String",
"results",
"from",
"the",
"endpoint",
"netconf",
"subsystem"
],
"type": null
}
],
"raises": [],
"params": [
... |
1fa78cba4f84e038b43dd4a5eb74cf1c80eff316 | nembery/aframe | a_frame/utils/action_providers/NetconfAction.py | [
"Apache-2.0"
] | Python | format_results | <not_specific> | def format_results(results):
"""
detects string format (xml || json) and formats appropriately
:param results: string from urlopen
:return: formatted string output
"""
# print results
try:
if type(results) is str:
results = etree.froms... |
detects string format (xml || json) and formats appropriately
:param results: string from urlopen
:return: formatted string output
| detects string format (xml || json) and formats appropriately | [
"detects",
"string",
"format",
"(",
"xml",
"||",
"json",
")",
"and",
"formats",
"appropriately"
] | def format_results(results):
try:
if type(results) is str:
results = etree.fromstring(results)
print "found valid xml, formatting and returning"
return etree.tostring(results, pretty_print=True)
except XMLSyntaxError:
pass
except Va... | [
"def",
"format_results",
"(",
"results",
")",
":",
"try",
":",
"if",
"type",
"(",
"results",
")",
"is",
"str",
":",
"results",
"=",
"etree",
".",
"fromstring",
"(",
"results",
")",
"print",
"\"found valid xml, formatting and returning\"",
"return",
"etree",
".... | detects string format (xml || json) and formats appropriately | [
"detects",
"string",
"format",
"(",
"xml",
"||",
"json",
")",
"and",
"formats",
"appropriately"
] | [
"\"\"\"\n detects string format (xml || json) and formats appropriately\n\n :param results: string from urlopen\n :return: formatted string output\n \"\"\"",
"# print results",
"# use pretty_print if we have an xml document returned",
"# is the result valid json?"
] | [
{
"param": "results",
"type": null
}
] | {
"returns": [
{
"docstring": "formatted string output",
"docstring_tokens": [
"formatted",
"string",
"output"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "results",
"type": null,
"docstring": "string from urlopen",... |
5f4f5d1a053a4611b27d34b478ed443802b5d1c9 | nembery/aframe | a_frame/utils/action_providers/GitAction.py | [
"Apache-2.0"
] | Python | execute_template | <not_specific> | def execute_template(self, template):
"""
We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on executio... |
We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on execution outcome.
| We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on execution outcome. | [
"We",
"now",
"have",
"the",
"global",
"config",
"(",
"if",
"any",
")",
"the",
"instance",
"config",
"and",
"the",
"completed",
"template",
"from",
"the",
"input_form",
"and",
"can",
"perform",
"the",
"desired",
"request",
":",
"param",
"template",
":",
"th... | def execute_template(self, template):
print "executing %s" % template
local_directory = '/var/cache/aframe/' + self.repository_name
if not os.path.exists(self.local_directory):
os.makedirs(self.local_directory)
try:
repo = git.Repo(self.local_directory)
ex... | [
"def",
"execute_template",
"(",
"self",
",",
"template",
")",
":",
"print",
"\"executing %s\"",
"%",
"template",
"local_directory",
"=",
"'/var/cache/aframe/'",
"+",
"self",
".",
"repository_name",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".... | We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on execution outcome. | [
"We",
"now",
"have",
"the",
"global",
"config",
"(",
"if",
"any",
")",
"the",
"instance",
"config",
"and",
"the",
"completed",
"template",
"from",
"the",
"input_form",
"and",
"can",
"perform",
"the",
"desired",
"request",
":",
"param",
"template",
":",
"th... | [
"\"\"\"\n We now have the global config (if any), the instance config, and the completed template from the input_form\n and can perform the desired request\n :param template: the completed template from the user or API\n :return Boolean based on execution outcome.\n \"\"\"",
"# ... | [
{
"param": "self",
"type": null
},
{
"param": "template",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "template",
"type": null,
"docstring": null,
"docstring_tokens... |
5f4f5d1a053a4611b27d34b478ed443802b5d1c9 | nembery/aframe | a_frame/utils/action_providers/GitAction.py | [
"Apache-2.0"
] | Python | format_results | <not_specific> | def format_results(results):
"""
detects string format (xml || json) and formats appropriately
:param results: string from urlopen
:return: formatted string output
"""
# use pretty_print if we have an xml document returned
if results.startswith("<?xml"):
... |
detects string format (xml || json) and formats appropriately
:param results: string from urlopen
:return: formatted string output
| detects string format (xml || json) and formats appropriately | [
"detects",
"string",
"format",
"(",
"xml",
"||",
"json",
")",
"and",
"formats",
"appropriately"
] | def format_results(results):
if results.startswith("<?xml"):
print "Found XML results - using pretty_print"
print results
xml = etree.fromstring(results)
return etree.tostring(xml, pretty_print=True)
try:
json_string = json.loads(results)
... | [
"def",
"format_results",
"(",
"results",
")",
":",
"if",
"results",
".",
"startswith",
"(",
"\"<?xml\"",
")",
":",
"print",
"\"Found XML results - using pretty_print\"",
"print",
"results",
"xml",
"=",
"etree",
".",
"fromstring",
"(",
"results",
")",
"return",
"... | detects string format (xml || json) and formats appropriately | [
"detects",
"string",
"format",
"(",
"xml",
"||",
"json",
")",
"and",
"formats",
"appropriately"
] | [
"\"\"\"\n detects string format (xml || json) and formats appropriately\n\n :param results: string from urlopen\n :return: formatted string output\n \"\"\"",
"# use pretty_print if we have an xml document returned",
"# is the result valid json?",
"# this isn't xml or json, so just ... | [
{
"param": "results",
"type": null
}
] | {
"returns": [
{
"docstring": "formatted string output",
"docstring_tokens": [
"formatted",
"string",
"output"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "results",
"type": null,
"docstring": "string from urlopen",... |
5f4f5d1a053a4611b27d34b478ed443802b5d1c9 | nembery/aframe | a_frame/utils/action_providers/GitAction.py | [
"Apache-2.0"
] | Python | connect_to_keystone | <not_specific> | def connect_to_keystone(self):
"""
connects to Keystone in the specified project scope
:return: boolean if successful
"""
_auth_json = """
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
... |
connects to Keystone in the specified project scope
:return: boolean if successful
| connects to Keystone in the specified project scope | [
"connects",
"to",
"Keystone",
"in",
"the",
"specified",
"project",
"scope"
] | def connect_to_keystone(self):
_auth_json = """
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"name": "%s",
"domain": { "id": "default" },
... | [
"def",
"connect_to_keystone",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n { \"auth\": {\n \"identity\": {\n \"methods\": [\"password\"],\n \"password\": {\n \"user\": {\n \"name\": \"%s\",\n ... | connects to Keystone in the specified project scope | [
"connects",
"to",
"Keystone",
"in",
"the",
"specified",
"project",
"scope"
] | [
"\"\"\"\n connects to Keystone in the specified project scope\n\n :return: boolean if successful\n\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
5f4f5d1a053a4611b27d34b478ed443802b5d1c9 | nembery/aframe | a_frame/utils/action_providers/GitAction.py | [
"Apache-2.0"
] | Python | connect_to_oauth2 | <not_specific> | def connect_to_oauth2(self):
"""
connects to OAuth2 with the specified user and password
:return: boolean if successful
"""
_auth_json = """
{ "grant_type": "password",
"username": "%s",
"password": "%s"
}
""" % (... |
connects to OAuth2 with the specified user and password
:return: boolean if successful
| connects to OAuth2 with the specified user and password | [
"connects",
"to",
"OAuth2",
"with",
"the",
"specified",
"user",
"and",
"password"
] | def connect_to_oauth2(self):
_auth_json = """
{ "grant_type": "password",
"username": "%s",
"password": "%s"
}
""" % (self.username, self.password)
full_url = self.protocol + "://" + self.host + self._oauth2_auth_path
print full_url... | [
"def",
"connect_to_oauth2",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n { \"grant_type\": \"password\",\n \"username\": \"%s\",\n \"password\": \"%s\"\n }\n \"\"\"",
"%",
"(",
"self",
".",
"username",
",",
"self",
"."... | connects to OAuth2 with the specified user and password | [
"connects",
"to",
"OAuth2",
"with",
"the",
"specified",
"user",
"and",
"password"
] | [
"\"\"\"\n connects to OAuth2 with the specified user and password\n\n :return: boolean if successful\n\n \"\"\"",
"# disables SSL cert checking!"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
5f4f5d1a053a4611b27d34b478ed443802b5d1c9 | nembery/aframe | a_frame/utils/action_providers/GitAction.py | [
"Apache-2.0"
] | Python | connect_to_ruckus | <not_specific> | def connect_to_ruckus(self):
"""
connects to Ruckus REST server to get a Cookie with the specified user and password
:return: boolean if successful
"""
_auth_json = """
{
"username" : "%s",
"password" : "%s"
}
""" % (s... |
connects to Ruckus REST server to get a Cookie with the specified user and password
:return: boolean if successful
| connects to Ruckus REST server to get a Cookie with the specified user and password | [
"connects",
"to",
"Ruckus",
"REST",
"server",
"to",
"get",
"a",
"Cookie",
"with",
"the",
"specified",
"user",
"and",
"password"
] | def connect_to_ruckus(self):
_auth_json = """
{
"username" : "%s",
"password" : "%s"
}
""" % (self.username, self.password)
full_url = self.protocol + "://" + self.host + self._ruckus_auth_path
print full_url
request = urllib2.Re... | [
"def",
"connect_to_ruckus",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n {\n \"username\" : \"%s\",\n \"password\" : \"%s\"\n }\n \"\"\"",
"%",
"(",
"self",
".",
"username",
",",
"self",
".",
"password",
")",
"full_ur... | connects to Ruckus REST server to get a Cookie with the specified user and password | [
"connects",
"to",
"Ruckus",
"REST",
"server",
"to",
"get",
"a",
"Cookie",
"with",
"the",
"specified",
"user",
"and",
"password"
] | [
"\"\"\"\n connects to Ruckus REST server to get a Cookie with the specified user and password\n\n :return: boolean if successful\n\n \"\"\"",
"# disables SSL cert checking!"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
7d926dd681e7d2854aecf4b837be6de4d581c361 | nembery/aframe | tools/views.py | [
"Apache-2.0"
] | Python | clone | <not_specific> | def clone(request, template_id):
"""
Clones a template. Allows quickly creating new templates from existing ones.
:param request:
:param template_id: id of the template to be cloned
:return: redirect to edit screen of new template!
"""
template = get_object_or_404(ConfigTemplate, pk=templat... |
Clones a template. Allows quickly creating new templates from existing ones.
:param request:
:param template_id: id of the template to be cloned
:return: redirect to edit screen of new template!
| Clones a template. Allows quickly creating new templates from existing ones. | [
"Clones",
"a",
"template",
".",
"Allows",
"quickly",
"creating",
"new",
"templates",
"from",
"existing",
"ones",
"."
] | def clone(request, template_id):
template = get_object_or_404(ConfigTemplate, pk=template_id)
dolly = ConfigTemplate()
dolly.name = template.name + " Clone"
dolly.description = template.description
dolly.action_provider = template.action_provider
dolly.action_provider_options = template.action_p... | [
"def",
"clone",
"(",
"request",
",",
"template_id",
")",
":",
"template",
"=",
"get_object_or_404",
"(",
"ConfigTemplate",
",",
"pk",
"=",
"template_id",
")",
"dolly",
"=",
"ConfigTemplate",
"(",
")",
"dolly",
".",
"name",
"=",
"template",
".",
"name",
"+"... | Clones a template. | [
"Clones",
"a",
"template",
"."
] | [
"\"\"\"\n Clones a template. Allows quickly creating new templates from existing ones.\n\n :param request:\n :param template_id: id of the template to be cloned\n :return: redirect to edit screen of new template!\n \"\"\"",
"# create our Dolly the sheep (clone)",
"# attempt to save any existing i... | [
{
"param": "request",
"type": null
},
{
"param": "template_id",
"type": null
}
] | {
"returns": [
{
"docstring": "redirect to edit screen of new template!",
"docstring_tokens": [
"redirect",
"to",
"edit",
"screen",
"of",
"new",
"template!"
],
"type": null
}
],
"raises": [],
"params": [
{
"identif... |
7d926dd681e7d2854aecf4b837be6de4d581c361 | nembery/aframe | tools/views.py | [
"Apache-2.0"
] | Python | execute_template | <not_specific> | def execute_template(request):
"""
Executes an automation template, you must supply at least a template_id or template_name
If the automation template requires input parameters or action options, those must also be supplied as well
:param request: HTTPRequest
:return: json object of the form:
... |
Executes an automation template, you must supply at least a template_id or template_name
If the automation template requires input parameters or action options, those must also be supplied as well
:param request: HTTPRequest
:return: json object of the form:
{"output": "output of the automatio... | Executes an automation template, you must supply at least a template_id or template_name
If the automation template requires input parameters or action options, those must also be supplied as well | [
"Executes",
"an",
"automation",
"template",
"you",
"must",
"supply",
"at",
"least",
"a",
"template_id",
"or",
"template_name",
"If",
"the",
"automation",
"template",
"requires",
"input",
"parameters",
"or",
"action",
"options",
"those",
"must",
"also",
"be",
"su... | def execute_template(request):
post_vars = request.POST.dict()
response = aframe_utils.execute_template(post_vars)
return HttpResponse(json.dumps(response), content_type="application/json") | [
"def",
"execute_template",
"(",
"request",
")",
":",
"post_vars",
"=",
"request",
".",
"POST",
".",
"dict",
"(",
")",
"response",
"=",
"aframe_utils",
".",
"execute_template",
"(",
"post_vars",
")",
"return",
"HttpResponse",
"(",
"json",
".",
"dumps",
"(",
... | Executes an automation template, you must supply at least a template_id or template_name
If the automation template requires input parameters or action options, those must also be supplied as well | [
"Executes",
"an",
"automation",
"template",
"you",
"must",
"supply",
"at",
"least",
"a",
"template_id",
"or",
"template_name",
"If",
"the",
"automation",
"template",
"requires",
"input",
"parameters",
"or",
"action",
"options",
"those",
"must",
"also",
"be",
"su... | [
"\"\"\"\n Executes an automation template, you must supply at least a template_id or template_name\n If the automation template requires input parameters or action options, those must also be supplied as well\n\n :param request: HTTPRequest\n :return: json object of the form:\n {\"output\": \"out... | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "json object of the form:\n{\"output\": \"output of the automation template\", \"status\": \"0 or 1 for success or failure\"",
"docstring_tokens": [
"json",
"object",
"of",
"the",
"form",
":",
"{",
"\"",
... |
7d926dd681e7d2854aecf4b837be6de4d581c361 | nembery/aframe | tools/views.py | [
"Apache-2.0"
] | Python | search | <not_specific> | def search(request):
"""
used for UI autocomplete searches. Only used on the endpoint details page. Filter out standalone type templates
:param request:
:return:
"""
term = request.GET["term"]
template_list = ConfigTemplate.objects.filter(name__contains=term)
results = []
for templat... |
used for UI autocomplete searches. Only used on the endpoint details page. Filter out standalone type templates
:param request:
:return:
| used for UI autocomplete searches. Only used on the endpoint details page. Filter out standalone type templates | [
"used",
"for",
"UI",
"autocomplete",
"searches",
".",
"Only",
"used",
"on",
"the",
"endpoint",
"details",
"page",
".",
"Filter",
"out",
"standalone",
"type",
"templates"
] | def search(request):
term = request.GET["term"]
template_list = ConfigTemplate.objects.filter(name__contains=term)
results = []
for template in template_list:
results.append(template.name)
return HttpResponse(json.dumps(results), content_type="application/json") | [
"def",
"search",
"(",
"request",
")",
":",
"term",
"=",
"request",
".",
"GET",
"[",
"\"term\"",
"]",
"template_list",
"=",
"ConfigTemplate",
".",
"objects",
".",
"filter",
"(",
"name__contains",
"=",
"term",
")",
"results",
"=",
"[",
"]",
"for",
"templat... | used for UI autocomplete searches. | [
"used",
"for",
"UI",
"autocomplete",
"searches",
"."
] | [
"\"\"\"\n used for UI autocomplete searches. Only used on the endpoint details page. Filter out standalone type templates\n :param request:\n :return:\n \"\"\""
] | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "request",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
7d926dd681e7d2854aecf4b837be6de4d581c361 | nembery/aframe | tools/views.py | [
"Apache-2.0"
] | Python | chain_template | <not_specific> | def chain_template(request):
"""
Populates the input_variables of one template from POSTed form data or json encoded http request body
This allows you to chain the output of one template to another one
if the input_variable of a template is in the form 'some.variable.with.periods'
then the input jso... |
Populates the input_variables of one template from POSTed form data or json encoded http request body
This allows you to chain the output of one template to another one
if the input_variable of a template is in the form 'some.variable.with.periods'
then the input json object will be searched for that v... | Populates the input_variables of one template from POSTed form data or json encoded http request body
This allows you to chain the output of one template to another one
if the input_variable of a template is in the form 'some.variable.with.periods'
then the input json object will be searched for that value | [
"Populates",
"the",
"input_variables",
"of",
"one",
"template",
"from",
"POSTed",
"form",
"data",
"or",
"json",
"encoded",
"http",
"request",
"body",
"This",
"allows",
"you",
"to",
"chain",
"the",
"output",
"of",
"one",
"template",
"to",
"another",
"one",
"i... | def chain_template(request):
print(request.META["CONTENT_TYPE"])
if request.META["CONTENT_TYPE"] == "application/json":
try:
data = json.loads(request.body)
template_id = data["template_id"]
except ValueError:
error = {"output": "missing required template_id p... | [
"def",
"chain_template",
"(",
"request",
")",
":",
"print",
"(",
"request",
".",
"META",
"[",
"\"CONTENT_TYPE\"",
"]",
")",
"if",
"request",
".",
"META",
"[",
"\"CONTENT_TYPE\"",
"]",
"==",
"\"application/json\"",
":",
"try",
":",
"data",
"=",
"json",
".",... | Populates the input_variables of one template from POSTed form data or json encoded http request body
This allows you to chain the output of one template to another one
if the input_variable of a template is in the form 'some.variable.with.periods'
then the input json object will be searched for that value | [
"Populates",
"the",
"input_variables",
"of",
"one",
"template",
"from",
"POSTed",
"form",
"data",
"or",
"json",
"encoded",
"http",
"request",
"body",
"This",
"allows",
"you",
"to",
"chain",
"the",
"output",
"of",
"one",
"template",
"to",
"another",
"one",
"i... | [
"\"\"\"\n Populates the input_variables of one template from POSTed form data or json encoded http request body\n This allows you to chain the output of one template to another one\n if the input_variable of a template is in the form 'some.variable.with.periods'\n then the input json object will be sear... | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "the output of the template specified by the template_id parameter",
"docstring_tokens": [
"the",
"output",
"of",
"the",
"template",
"specified",
"by",
"the",
"template_id",
"parameter"
... |
236414ccc4d2eb6232fe527242dac74e79a5575b | nembery/aframe | a_frame/utils/action_providers/RestAction.py | [
"Apache-2.0"
] | Python | execute_template | <not_specific> | def execute_template(self, template):
"""
We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on executio... |
We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on execution outcome.
| We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on execution outcome. | [
"We",
"now",
"have",
"the",
"global",
"config",
"(",
"if",
"any",
")",
"the",
"instance",
"config",
"and",
"the",
"completed",
"template",
"from",
"the",
"input_form",
"and",
"can",
"perform",
"the",
"desired",
"request",
":",
"param",
"template",
":",
"th... | def execute_template(self, template):
print("executing %s" % template)
if not self.url.startswith(':') and not self.url.startswith('/'):
self.url = "/" + self.url
handler = urllib2.HTTPHandler(debuglevel=1)
opener = urllib2.build_opener(handler)
urllib2.install_opener... | [
"def",
"execute_template",
"(",
"self",
",",
"template",
")",
":",
"print",
"(",
"\"executing %s\"",
"%",
"template",
")",
"if",
"not",
"self",
".",
"url",
".",
"startswith",
"(",
"':'",
")",
"and",
"not",
"self",
".",
"url",
".",
"startswith",
"(",
"'... | We now have the global config (if any), the instance config, and the completed template from the input_form
and can perform the desired request
:param template: the completed template from the user or API
:return Boolean based on execution outcome. | [
"We",
"now",
"have",
"the",
"global",
"config",
"(",
"if",
"any",
")",
"the",
"instance",
"config",
"and",
"the",
"completed",
"template",
"from",
"the",
"input_form",
"and",
"can",
"perform",
"the",
"desired",
"request",
":",
"param",
"template",
":",
"th... | [
"\"\"\"\n We now have the global config (if any), the instance config, and the completed template from the input_form\n and can perform the desired request\n :param template: the completed template from the user or API\n :return Boolean based on execution outcome.\n \"\"\"",
"# ... | [
{
"param": "self",
"type": null
},
{
"param": "template",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "template",
"type": null,
"docstring": null,
"docstring_tokens... |
236414ccc4d2eb6232fe527242dac74e79a5575b | nembery/aframe | a_frame/utils/action_providers/RestAction.py | [
"Apache-2.0"
] | Python | __connect_to_keystone | <not_specific> | def __connect_to_keystone(self):
"""
connects to Keystone in the specified project scope
:return: boolean if successful
"""
_auth_json = """
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
... |
connects to Keystone in the specified project scope
:return: boolean if successful
| connects to Keystone in the specified project scope | [
"connects",
"to",
"Keystone",
"in",
"the",
"specified",
"project",
"scope"
] | def __connect_to_keystone(self):
_auth_json = """
{ "auth": {
"identity": {
"methods": ["password"],
"password": {
"user": {
"name": "%s",
"domain": { "id": "default" },
... | [
"def",
"__connect_to_keystone",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n { \"auth\": {\n \"identity\": {\n \"methods\": [\"password\"],\n \"password\": {\n \"user\": {\n \"name\": \"%s\",\n... | connects to Keystone in the specified project scope | [
"connects",
"to",
"Keystone",
"in",
"the",
"specified",
"project",
"scope"
] | [
"\"\"\"\n connects to Keystone in the specified project scope\n\n :return: boolean if successful\n\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
236414ccc4d2eb6232fe527242dac74e79a5575b | nembery/aframe | a_frame/utils/action_providers/RestAction.py | [
"Apache-2.0"
] | Python | __connect_to_oauth2 | <not_specific> | def __connect_to_oauth2(self):
"""
connects to OAuth2 with the specified user and password
:return: boolean if successful
"""
_auth_json = """
{ "grant_type": "password",
"username": "%s",
"password": "%s"
}
""" %... |
connects to OAuth2 with the specified user and password
:return: boolean if successful
| connects to OAuth2 with the specified user and password | [
"connects",
"to",
"OAuth2",
"with",
"the",
"specified",
"user",
"and",
"password"
] | def __connect_to_oauth2(self):
_auth_json = """
{ "grant_type": "password",
"username": "%s",
"password": "%s"
}
""" % (self.username, self.password)
full_url = self.protocol + "://" + self.host + self._oauth2_auth_path
print(full_u... | [
"def",
"__connect_to_oauth2",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n { \"grant_type\": \"password\",\n \"username\": \"%s\",\n \"password\": \"%s\"\n }\n \"\"\"",
"%",
"(",
"self",
".",
"username",
",",
"self",
"... | connects to OAuth2 with the specified user and password | [
"connects",
"to",
"OAuth2",
"with",
"the",
"specified",
"user",
"and",
"password"
] | [
"\"\"\"\n connects to OAuth2 with the specified user and password\n\n :return: boolean if successful\n\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
236414ccc4d2eb6232fe527242dac74e79a5575b | nembery/aframe | a_frame/utils/action_providers/RestAction.py | [
"Apache-2.0"
] | Python | __connect_to_ruckus | <not_specific> | def __connect_to_ruckus(self):
"""
connects to Ruckus REST server to get a Cookie with the specified user and password
:return: boolean if successful
"""
_auth_json = """
{
"username" : "%s",
"password" : "%s"
}
""" % ... |
connects to Ruckus REST server to get a Cookie with the specified user and password
:return: boolean if successful
| connects to Ruckus REST server to get a Cookie with the specified user and password | [
"connects",
"to",
"Ruckus",
"REST",
"server",
"to",
"get",
"a",
"Cookie",
"with",
"the",
"specified",
"user",
"and",
"password"
] | def __connect_to_ruckus(self):
_auth_json = """
{
"username" : "%s",
"password" : "%s"
}
""" % (self.username, self.password)
full_url = self.protocol + "://" + self.host + self._ruckus_auth_path
print(full_url)
request = urllib2... | [
"def",
"__connect_to_ruckus",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n {\n \"username\" : \"%s\",\n \"password\" : \"%s\"\n }\n \"\"\"",
"%",
"(",
"self",
".",
"username",
",",
"self",
".",
"password",
")",
"full_... | connects to Ruckus REST server to get a Cookie with the specified user and password | [
"connects",
"to",
"Ruckus",
"REST",
"server",
"to",
"get",
"a",
"Cookie",
"with",
"the",
"specified",
"user",
"and",
"password"
] | [
"\"\"\"\n connects to Ruckus REST server to get a Cookie with the specified user and password\n\n :return: boolean if successful\n\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
236414ccc4d2eb6232fe527242dac74e79a5575b | nembery/aframe | a_frame/utils/action_providers/RestAction.py | [
"Apache-2.0"
] | Python | __connect_to_saltapi | <not_specific> | def __connect_to_saltapi(self):
"""
connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method
:return: boolean if successful
"""
_auth_json = """
{
"username" : "%s",
"pa... |
connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method
:return: boolean if successful
| connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method | [
"connects",
"to",
"salt",
"api",
"endpoint",
"to",
"get",
"a",
"token",
"with",
"the",
"specified",
"user",
"and",
"password",
"defaults",
"to",
"'",
"pam",
"'",
"eauth",
"method"
] | def __connect_to_saltapi(self):
_auth_json = """
{
"username" : "%s",
"password" : "%s",
"eauth": "pam"
}
""" % (self.username, self.password)
full_url = self.protocol + "://" + self.host + self._saltapi_auth_path
print(full_... | [
"def",
"__connect_to_saltapi",
"(",
"self",
")",
":",
"_auth_json",
"=",
"\"\"\"\n {\n \"username\" : \"%s\",\n \"password\" : \"%s\",\n \"eauth\": \"pam\"\n }\n \"\"\"",
"%",
"(",
"self",
".",
"username",
",",
"self",
... | connects to salt api endpoint to get a token with the specified user and password
defaults to 'pam' eauth method | [
"connects",
"to",
"salt",
"api",
"endpoint",
"to",
"get",
"a",
"token",
"with",
"the",
"specified",
"user",
"and",
"password",
"defaults",
"to",
"'",
"pam",
"'",
"eauth",
"method"
] | [
"\"\"\"\n connects to salt api endpoint to get a token with the specified user and password\n \n defaults to 'pam' eauth method\n\n :return: boolean if successful\n\n \"\"\"",
"# catch the case where the result object is not a valid respone,",
"# i.e. an error string or None"
... | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "boolean if successful",
"docstring_tokens": [
"boolean",
"if",
"successful"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens... |
236414ccc4d2eb6232fe527242dac74e79a5575b | nembery/aframe | a_frame/utils/action_providers/RestAction.py | [
"Apache-2.0"
] | Python | __format_results | <not_specific> | def __format_results(results):
"""
detects string format (xml || json) and formats appropriately
:param results: string from urlopen
:return: formatted string output
"""
if results is None:
print("no actual results to process")
return results
... |
detects string format (xml || json) and formats appropriately
:param results: string from urlopen
:return: formatted string output
| detects string format (xml || json) and formats appropriately | [
"detects",
"string",
"format",
"(",
"xml",
"||",
"json",
")",
"and",
"formats",
"appropriately"
] | def __format_results(results):
if results is None:
print("no actual results to process")
return results
try:
if type(results) == "str" and results.startswith("<?xml"):
print("Found XML results - using pretty_print")
print(results)
... | [
"def",
"__format_results",
"(",
"results",
")",
":",
"if",
"results",
"is",
"None",
":",
"print",
"(",
"\"no actual results to process\"",
")",
"return",
"results",
"try",
":",
"if",
"type",
"(",
"results",
")",
"==",
"\"str\"",
"and",
"results",
".",
"start... | detects string format (xml || json) and formats appropriately | [
"detects",
"string",
"format",
"(",
"xml",
"||",
"json",
")",
"and",
"formats",
"appropriately"
] | [
"\"\"\"\n detects string format (xml || json) and formats appropriately\n\n :param results: string from urlopen\n :return: formatted string output\n \"\"\"",
"# use pretty_print(if we have an xml document returned)",
"# is the result valid json?",
"# this isn't xml or json, so just... | [
{
"param": "results",
"type": null
}
] | {
"returns": [
{
"docstring": "formatted string output",
"docstring_tokens": [
"formatted",
"string",
"output"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "results",
"type": null,
"docstring": "string from urlopen",... |
d4c49e33bd2b8c573c10f4c41f15d841eda26183 | nembery/aframe | screens/views.py | [
"Apache-2.0"
] | Python | load_widget_config | <not_specific> | def load_widget_config(request):
"""
Load the configuration for a given screen widget
:param request: http request
:return: html template
"""
logger.info("__ screens load_widget_config __")
required_fields = set(["widget_id", "widget_layout_id"])
if not required_fields.issubset(request.P... |
Load the configuration for a given screen widget
:param request: http request
:return: html template
| Load the configuration for a given screen widget | [
"Load",
"the",
"configuration",
"for",
"a",
"given",
"screen",
"widget"
] | def load_widget_config(request):
logger.info("__ screens load_widget_config __")
required_fields = set(["widget_id", "widget_layout_id"])
if not required_fields.issubset(request.POST):
logger.error("Did no find all required fields in request")
return render(request, "overlay_basic.html", {"m... | [
"def",
"load_widget_config",
"(",
"request",
")",
":",
"logger",
".",
"info",
"(",
"\"__ screens load_widget_config __\"",
")",
"required_fields",
"=",
"set",
"(",
"[",
"\"widget_id\"",
",",
"\"widget_layout_id\"",
"]",
")",
"if",
"not",
"required_fields",
".",
"i... | Load the configuration for a given screen widget | [
"Load",
"the",
"configuration",
"for",
"a",
"given",
"screen",
"widget"
] | [
"\"\"\"\n Load the configuration for a given screen widget\n :param request: http request\n :return: html template\n \"\"\"",
"# grab the widget global configuration if it exists and set on the context",
"# FIXME - widget_type and widget_id are used interchangeably, this should just be widget_id bas... | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "request",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
d4c49e33bd2b8c573c10f4c41f15d841eda26183 | nembery/aframe | screens/views.py | [
"Apache-2.0"
] | Python | load_widget | <not_specific> | def load_widget(request):
"""
Load the configuration for a given screen widget
Widgets can provide any functionality to the screen
widgets can store data in 3 different places:
Global widget configuration is stored in the ScreenWidgetConfig db table
Global widget data is stored in the S... |
Load the configuration for a given screen widget
Widgets can provide any functionality to the screen
widgets can store data in 3 different places:
Global widget configuration is stored in the ScreenWidgetConfig db table
Global widget data is stored in the ScreenWidgetData db table
... | Load the configuration for a given screen widget
Widgets can provide any functionality to the screen
widgets can store data in 3 different places:
Global widget configuration is stored in the ScreenWidgetConfig db table
Global widget data is stored in the ScreenWidgetData db table
Per Screen / Per Widget instance data ... | [
"Load",
"the",
"configuration",
"for",
"a",
"given",
"screen",
"widget",
"Widgets",
"can",
"provide",
"any",
"functionality",
"to",
"the",
"screen",
"widgets",
"can",
"store",
"data",
"in",
"3",
"different",
"places",
":",
"Global",
"widget",
"configuration",
... | def load_widget(request):
logger.info("__ screens load_widget_ __")
required_fields = set(["widget_id"])
if not required_fields.issubset(request.POST):
logger.error("Did not find all required fields in request")
return render(request, "error.html", {"error": "Invalid Parameters in POST"})
... | [
"def",
"load_widget",
"(",
"request",
")",
":",
"logger",
".",
"info",
"(",
"\"__ screens load_widget_ __\"",
")",
"required_fields",
"=",
"set",
"(",
"[",
"\"widget_id\"",
"]",
")",
"if",
"not",
"required_fields",
".",
"issubset",
"(",
"request",
".",
"POST",... | Load the configuration for a given screen widget
Widgets can provide any functionality to the screen
widgets can store data in 3 different places:
Global widget configuration is stored in the ScreenWidgetConfig db table
Global widget data is stored in the ScreenWidgetData db table
Per Screen / Per Widget instance data ... | [
"Load",
"the",
"configuration",
"for",
"a",
"given",
"screen",
"widget",
"Widgets",
"can",
"provide",
"any",
"functionality",
"to",
"the",
"screen",
"widgets",
"can",
"store",
"data",
"in",
"3",
"different",
"places",
":",
"Global",
"widget",
"configuration",
... | [
"\"\"\"\n Load the configuration for a given screen widget\n\n Widgets can provide any functionality to the screen\n widgets can store data in 3 different places:\n Global widget configuration is stored in the ScreenWidgetConfig db table\n Global widget data is stored in the ScreenWidgetData ... | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "request",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
... |
d4c49e33bd2b8c573c10f4c41f15d841eda26183 | nembery/aframe | screens/views.py | [
"Apache-2.0"
] | Python | search | <not_specific> | def search(request):
"""
used for UI autocomplete searches. Only used on the endpoint details page.
:param request:
:return: dict containing label and value keys
"""
logger.info("__ screens search __")
term = request.GET["term"]
screen_list = Screen.objects.filter(Q(name__contains=term... |
used for UI autocomplete searches. Only used on the endpoint details page.
:param request:
:return: dict containing label and value keys
| used for UI autocomplete searches. Only used on the endpoint details page. | [
"used",
"for",
"UI",
"autocomplete",
"searches",
".",
"Only",
"used",
"on",
"the",
"endpoint",
"details",
"page",
"."
] | def search(request):
logger.info("__ screens search __")
term = request.GET["term"]
screen_list = Screen.objects.filter(Q(name__contains=term) | Q(description__contains=term))
results = []
for screen in screen_list:
r = dict()
r["value"] = str(screen.id)
r["label"] = screen.n... | [
"def",
"search",
"(",
"request",
")",
":",
"logger",
".",
"info",
"(",
"\"__ screens search __\"",
")",
"term",
"=",
"request",
".",
"GET",
"[",
"\"term\"",
"]",
"screen_list",
"=",
"Screen",
".",
"objects",
".",
"filter",
"(",
"Q",
"(",
"name__contains",
... | used for UI autocomplete searches. | [
"used",
"for",
"UI",
"autocomplete",
"searches",
"."
] | [
"\"\"\"\n used for UI autocomplete searches. Only used on the endpoint details page. \n :param request:\n :return: dict containing label and value keys\n \"\"\""
] | [
{
"param": "request",
"type": null
}
] | {
"returns": [
{
"docstring": "dict containing label and value keys",
"docstring_tokens": [
"dict",
"containing",
"label",
"and",
"value",
"keys"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "request",
... |
77e0a207b3c7ed207bd14248c3c554fb7a6492e2 | nembery/aframe | common/lib/aframe_utils.py | [
"Apache-2.0"
] | Python | _load_secrets | <not_specific> | def _load_secrets():
"""
find the secrets.yml file in the 'conf' directory and return the yaml parsed value
:return: secrets object in the form {'secrets': {'key': {'label': 'some label', 'value': 'some_password' } } }
"""
common_lib_dir = os.path.dirname(os.path.abspath(__file__))
conf_dir = os... |
find the secrets.yml file in the 'conf' directory and return the yaml parsed value
:return: secrets object in the form {'secrets': {'key': {'label': 'some label', 'value': 'some_password' } } }
| find the secrets.yml file in the 'conf' directory and return the yaml parsed value | [
"find",
"the",
"secrets",
".",
"yml",
"file",
"in",
"the",
"'",
"conf",
"'",
"directory",
"and",
"return",
"the",
"yaml",
"parsed",
"value"
] | def _load_secrets():
common_lib_dir = os.path.dirname(os.path.abspath(__file__))
conf_dir = os.path.abspath(os.path.join(common_lib_dir, '../../conf'))
secrets_file_path = os.path.join(conf_dir, 'secrets.yml')
with open(secrets_file_path, 'r') as secrets_file:
try:
secrets = yaml.loa... | [
"def",
"_load_secrets",
"(",
")",
":",
"common_lib_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"__file__",
")",
")",
"conf_dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"jo... | find the secrets.yml file in the 'conf' directory and return the yaml parsed value | [
"find",
"the",
"secrets",
".",
"yml",
"file",
"in",
"the",
"'",
"conf",
"'",
"directory",
"and",
"return",
"the",
"yaml",
"parsed",
"value"
] | [
"\"\"\"\n find the secrets.yml file in the 'conf' directory and return the yaml parsed value\n :return: secrets object in the form {'secrets': {'key': {'label': 'some label', 'value': 'some_password' } } }\n \"\"\""
] | [] | {
"returns": [
{
"docstring": "secrets object in the form {'secrets': {'key': {'label': 'some label', 'value': 'some_password' } } }",
"docstring_tokens": [
"secrets",
"object",
"in",
"the",
"form",
"{",
"'",
"secrets",
"'",
... |
77e0a207b3c7ed207bd14248c3c554fb7a6492e2 | nembery/aframe | common/lib/aframe_utils.py | [
"Apache-2.0"
] | Python | lookup_secret | <not_specific> | def lookup_secret(key):
"""
load the secrets file and return the value by key
:param key: key to use for lookup
:return: string value of the secret
"""
secrets = _load_secrets()
if 'secrets' in secrets:
if key in secrets['secrets']:
return secrets['secrets'][key]['value']... |
load the secrets file and return the value by key
:param key: key to use for lookup
:return: string value of the secret
| load the secrets file and return the value by key | [
"load",
"the",
"secrets",
"file",
"and",
"return",
"the",
"value",
"by",
"key"
] | def lookup_secret(key):
secrets = _load_secrets()
if 'secrets' in secrets:
if key in secrets['secrets']:
return secrets['secrets'][key]['value']
else:
logger.warn('desired secret key was not found!')
return 'password123' | [
"def",
"lookup_secret",
"(",
"key",
")",
":",
"secrets",
"=",
"_load_secrets",
"(",
")",
"if",
"'secrets'",
"in",
"secrets",
":",
"if",
"key",
"in",
"secrets",
"[",
"'secrets'",
"]",
":",
"return",
"secrets",
"[",
"'secrets'",
"]",
"[",
"key",
"]",
"["... | load the secrets file and return the value by key | [
"load",
"the",
"secrets",
"file",
"and",
"return",
"the",
"value",
"by",
"key"
] | [
"\"\"\"\n load the secrets file and return the value by key\n :param key: key to use for lookup\n :return: string value of the secret\n \"\"\""
] | [
{
"param": "key",
"type": null
}
] | {
"returns": [
{
"docstring": "string value of the secret",
"docstring_tokens": [
"string",
"value",
"of",
"the",
"secret"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "key",
"type": null,
"docstring"... |
77e0a207b3c7ed207bd14248c3c554fb7a6492e2 | nembery/aframe | common/lib/aframe_utils.py | [
"Apache-2.0"
] | Python | execute_template | <not_specific> | def execute_template(post_vars):
"""
Refactored out of tools/views.py as this is used in a couple of different places (tools/views and screens/views)
:param post_vars: copy of all variables passed in via the operation
:return: response object of form {'output': whatever, 'status': 1 }
"""
if 'te... |
Refactored out of tools/views.py as this is used in a couple of different places (tools/views and screens/views)
:param post_vars: copy of all variables passed in via the operation
:return: response object of form {'output': whatever, 'status': 1 }
| Refactored out of tools/views.py as this is used in a couple of different places (tools/views and screens/views) | [
"Refactored",
"out",
"of",
"tools",
"/",
"views",
".",
"py",
"as",
"this",
"is",
"used",
"in",
"a",
"couple",
"of",
"different",
"places",
"(",
"tools",
"/",
"views",
"and",
"screens",
"/",
"views",
")"
] | def execute_template(post_vars):
if 'template_id' not in post_vars and 'template_name' not in post_vars:
error = {'output': 'missing required template_id or template_name parameter', 'status': 1}
return error
if 'template_id' in post_vars:
template_id = int(post_vars['template_id'])
... | [
"def",
"execute_template",
"(",
"post_vars",
")",
":",
"if",
"'template_id'",
"not",
"in",
"post_vars",
"and",
"'template_name'",
"not",
"in",
"post_vars",
":",
"error",
"=",
"{",
"'output'",
":",
"'missing required template_id or template_name parameter'",
",",
"'sta... | Refactored out of tools/views.py as this is used in a couple of different places (tools/views and screens/views) | [
"Refactored",
"out",
"of",
"tools",
"/",
"views",
".",
"py",
"as",
"this",
"is",
"used",
"in",
"a",
"couple",
"of",
"different",
"places",
"(",
"tools",
"/",
"views",
"and",
"screens",
"/",
"views",
")"
] | [
"\"\"\"\n Refactored out of tools/views.py as this is used in a couple of different places (tools/views and screens/views)\n :param post_vars: copy of all variables passed in via the operation\n :return: response object of form {'output': whatever, 'status': 1 }\n \"\"\"",
"# compiled_template = get_t... | [
{
"param": "post_vars",
"type": null
}
] | {
"returns": [
{
"docstring": "response object of form {'output': whatever, 'status': 1 }",
"docstring_tokens": [
"response",
"object",
"of",
"form",
"{",
"'",
"output",
"'",
":",
"whatever",
"'",
"status",... |
77e0a207b3c7ed207bd14248c3c554fb7a6492e2 | nembery/aframe | common/lib/aframe_utils.py | [
"Apache-2.0"
] | Python | import_form | <not_specific> | def import_form(jd):
"""
Imports an input_from from serialized json data
:param jd: json_data object generated from the export_input_form function
:return: id of the input form or id of the input form if it already exists
"""
template_options = jd["template"]
form_options = jd["form"]
i... |
Imports an input_from from serialized json data
:param jd: json_data object generated from the export_input_form function
:return: id of the input form or id of the input form if it already exists
| Imports an input_from from serialized json data | [
"Imports",
"an",
"input_from",
"from",
"serialized",
"json",
"data"
] | def import_form(jd):
template_options = jd["template"]
form_options = jd["form"]
if not ConfigTemplate.objects.filter(name=template_options['name']).exists():
template = ConfigTemplate()
template.name = template_options["name"]
template.description = template_options["description"]
... | [
"def",
"import_form",
"(",
"jd",
")",
":",
"template_options",
"=",
"jd",
"[",
"\"template\"",
"]",
"form_options",
"=",
"jd",
"[",
"\"form\"",
"]",
"if",
"not",
"ConfigTemplate",
".",
"objects",
".",
"filter",
"(",
"name",
"=",
"template_options",
"[",
"'... | Imports an input_from from serialized json data | [
"Imports",
"an",
"input_from",
"from",
"serialized",
"json",
"data"
] | [
"\"\"\"\n Imports an input_from from serialized json data\n :param jd: json_data object generated from the export_input_form function\n :return: id of the input form or id of the input form if it already exists\n \"\"\""
] | [
{
"param": "jd",
"type": null
}
] | {
"returns": [
{
"docstring": "id of the input form or id of the input form if it already exists",
"docstring_tokens": [
"id",
"of",
"the",
"input",
"form",
"or",
"id",
"of",
"the",
"input",
"form",
"if",
... |
ec1937fa3c34678b74b59c5d78ef4a42db6bc8d9 | nembery/aframe | endpoints/plugins/endpoint_base.py | [
"Apache-2.0"
] | Python | create_endpoint | <not_specific> | def create_endpoint(endpoint_id, endpoint_name, ip, username, password, endpoint_type):
"""
Returns a basic pyObject representing the most basic information for a endpoint
feel free to override this to include more specific data members if needed
:param endpoint_id: unique id
:pa... |
Returns a basic pyObject representing the most basic information for a endpoint
feel free to override this to include more specific data members if needed
:param endpoint_id: unique id
:param endpoint_name: name
:param ip: IPv4 address of the endpoint
:param username: us... | Returns a basic pyObject representing the most basic information for a endpoint
feel free to override this to include more specific data members if needed | [
"Returns",
"a",
"basic",
"pyObject",
"representing",
"the",
"most",
"basic",
"information",
"for",
"a",
"endpoint",
"feel",
"free",
"to",
"override",
"this",
"to",
"include",
"more",
"specific",
"data",
"members",
"if",
"needed"
] | def create_endpoint(endpoint_id, endpoint_name, ip, username, password, endpoint_type):
endpoint_data = {
"id": endpoint_id,
"name": endpoint_name,
"ip": ip,
"username": username,
"password": password,
"type": endpoint_type
}
... | [
"def",
"create_endpoint",
"(",
"endpoint_id",
",",
"endpoint_name",
",",
"ip",
",",
"username",
",",
"password",
",",
"endpoint_type",
")",
":",
"endpoint_data",
"=",
"{",
"\"id\"",
":",
"endpoint_id",
",",
"\"name\"",
":",
"endpoint_name",
",",
"\"ip\"",
":",... | Returns a basic pyObject representing the most basic information for a endpoint
feel free to override this to include more specific data members if needed | [
"Returns",
"a",
"basic",
"pyObject",
"representing",
"the",
"most",
"basic",
"information",
"for",
"a",
"endpoint",
"feel",
"free",
"to",
"override",
"this",
"to",
"include",
"more",
"specific",
"data",
"members",
"if",
"needed"
] | [
"\"\"\"\n Returns a basic pyObject representing the most basic information for a endpoint\n feel free to override this to include more specific data members if needed\n :param endpoint_id: unique id\n :param endpoint_name: name\n :param ip: IPv4 address of the endpoint\n :p... | [
{
"param": "endpoint_id",
"type": null
},
{
"param": "endpoint_name",
"type": null
},
{
"param": "ip",
"type": null
},
{
"param": "username",
"type": null
},
{
"param": "password",
"type": null
},
{
"param": "endpoint_type",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "endpoint_id",
"type": null,
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"is_optional": null
},
{
"identifier": "endpoint_name",
"type": null,
"docstri... |
ec1937fa3c34678b74b59c5d78ef4a42db6bc8d9 | nembery/aframe | endpoints/plugins/endpoint_base.py | [
"Apache-2.0"
] | Python | available_filters | <not_specific> | def available_filters(self):
"""
feel free to override the available filters
if necessary
"""
return self.default_filters |
feel free to override the available filters
if necessary
| feel free to override the available filters
if necessary | [
"feel",
"free",
"to",
"override",
"the",
"available",
"filters",
"if",
"necessary"
] | def available_filters(self):
return self.default_filters | [
"def",
"available_filters",
"(",
"self",
")",
":",
"return",
"self",
".",
"default_filters"
] | feel free to override the available filters
if necessary | [
"feel",
"free",
"to",
"override",
"the",
"available",
"filters",
"if",
"necessary"
] | [
"\"\"\"\n feel free to override the available filters\n if necessary\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
efe5c622530ac93c7ee9f2eed5130b2d327441fe | vickydasta/aha | app/apps.py | [
"MIT"
] | Python | generate_id | <not_specific> | def generate_id():
"""
generate random string with randomly picked
string
"""
return ''.join(random.choice(string.ascii_uppercase
+ string.digits + string.lowercase) for _ in range(5)) |
generate random string with randomly picked
string
| generate random string with randomly picked
string | [
"generate",
"random",
"string",
"with",
"randomly",
"picked",
"string"
] | def generate_id():
return ''.join(random.choice(string.ascii_uppercase
+ string.digits + string.lowercase) for _ in range(5)) | [
"def",
"generate_id",
"(",
")",
":",
"return",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"string",
".",
"ascii_uppercase",
"+",
"string",
".",
"digits",
"+",
"string",
".",
"lowercase",
")",
"for",
"_",
"in",
"range",
"(",
"5",
")",
")"
] | generate random string with randomly picked
string | [
"generate",
"random",
"string",
"with",
"randomly",
"picked",
"string"
] | [
"\"\"\"\n generate random string with randomly picked\n string\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
efe5c622530ac93c7ee9f2eed5130b2d327441fe | vickydasta/aha | app/apps.py | [
"MIT"
] | Python | expand | <not_specific> | def expand(key):
"""
get key from list with GET command
"""
return r.get("url:{}:id".format(key)) |
get key from list with GET command
| get key from list with GET command | [
"get",
"key",
"from",
"list",
"with",
"GET",
"command"
] | def expand(key):
return r.get("url:{}:id".format(key)) | [
"def",
"expand",
"(",
"key",
")",
":",
"return",
"r",
".",
"get",
"(",
"\"url:{}:id\"",
".",
"format",
"(",
"key",
")",
")"
] | get key from list with GET command | [
"get",
"key",
"from",
"list",
"with",
"GET",
"command"
] | [
"\"\"\"\n get key from list with GET command\n \"\"\""
] | [
{
"param": "key",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "key",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
efe5c622530ac93c7ee9f2eed5130b2d327441fe | vickydasta/aha | app/apps.py | [
"MIT"
] | Python | redirect_url | <not_specific> | def redirect_url(key):
"""
redirect to related url with key
:params: key : string
"""
url = expand(key)
if url:
return redirect(url, 301)
return jsonify({"msg": "key not found!"}) |
redirect to related url with key
:params: key : string
| redirect to related url with key | [
"redirect",
"to",
"related",
"url",
"with",
"key"
] | def redirect_url(key):
url = expand(key)
if url:
return redirect(url, 301)
return jsonify({"msg": "key not found!"}) | [
"def",
"redirect_url",
"(",
"key",
")",
":",
"url",
"=",
"expand",
"(",
"key",
")",
"if",
"url",
":",
"return",
"redirect",
"(",
"url",
",",
"301",
")",
"return",
"jsonify",
"(",
"{",
"\"msg\"",
":",
"\"key not found!\"",
"}",
")"
] | redirect to related url with key | [
"redirect",
"to",
"related",
"url",
"with",
"key"
] | [
"\"\"\"\n redirect to related url with key\n\n :params: key : string\n \"\"\""
] | [
{
"param": "key",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "key",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": [
{
"identifier": "params",
"docstring": "key : str... |
1c84b97bc9b355be7160df285cc984b80ecff2fb | BalaBalaYi/Ambari-Elasticsearch-Service | KIBANA-6.4.x/package/scripts/kibana_server.py | [
"Apache-2.0"
] | Python | stop | null | def stop(self, env):
import params
env.set_params(params)
# Stop Kibana
"""
Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
command, it will try to kill with -9 option (hard kill)
... |
Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
command, it will try to kill with -9 option (hard kill)
| Kill the process by pid file, then check the process is running or not. If the process is still running after the kill
command, it will try to kill with -9 option (hard kill) | [
"Kill",
"the",
"process",
"by",
"pid",
"file",
"then",
"check",
"the",
"process",
"is",
"running",
"or",
"not",
".",
"If",
"the",
"process",
"is",
"still",
"running",
"after",
"the",
"kill",
"command",
"it",
"will",
"try",
"to",
"kill",
"with",
"-",
"9... | def stop(self, env):
import params
env.set_params(params)
pid_file = params.pid_file
pid = os.popen('cat {pid_file}'.format(pid_file=pid_file)).read()
process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p {pid} >/dev/null 2>&1")
kill_cmd = format("kil... | [
"def",
"stop",
"(",
"self",
",",
"env",
")",
":",
"import",
"params",
"env",
".",
"set_params",
"(",
"params",
")",
"pid_file",
"=",
"params",
".",
"pid_file",
"pid",
"=",
"os",
".",
"popen",
"(",
"'cat {pid_file}'",
".",
"format",
"(",
"pid_file",
"="... | Kill the process by pid file, then check the process is running or not. | [
"Kill",
"the",
"process",
"by",
"pid",
"file",
"then",
"check",
"the",
"process",
"is",
"running",
"or",
"not",
"."
] | [
"# Stop Kibana",
"\"\"\"\n Kill the process by pid file, then check the process is running or not. If the process is still running after the kill\n command, it will try to kill with -9 option (hard kill)\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "env",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "env",
"type": null,
"docstring": null,
"docstring_tokens": []... |
031dead0832eaf05ccbd9761993bf099f4125a3b | SUPERSAIYANSLAYIN/droidlysis | droidproperties.py | [
"MIT"
] | Python | clear_fields | null | def clear_fields(self):
"""Re-initialize all fields of the object - to default values"""
self.file_nb_classes = 0
self.file_nb_dir = 0
self.file_size = 0
self.file_small = False
self.filetype = droidutil.UNKNOWN
self.file_innerzips = False
self.certificat... | Re-initialize all fields of the object - to default values | Re-initialize all fields of the object - to default values | [
"Re",
"-",
"initialize",
"all",
"fields",
"of",
"the",
"object",
"-",
"to",
"default",
"values"
] | def clear_fields(self):
self.file_nb_classes = 0
self.file_nb_dir = 0
self.file_size = 0
self.file_small = False
self.filetype = droidutil.UNKNOWN
self.file_innerzips = False
self.certificate.clear()
self.certificate = { 'av' : False, \
... | [
"def",
"clear_fields",
"(",
"self",
")",
":",
"self",
".",
"file_nb_classes",
"=",
"0",
"self",
".",
"file_nb_dir",
"=",
"0",
"self",
".",
"file_size",
"=",
"0",
"self",
".",
"file_small",
"=",
"False",
"self",
".",
"filetype",
"=",
"droidutil",
".",
"... | Re-initialize all fields of the object - to default values | [
"Re",
"-",
"initialize",
"all",
"fields",
"of",
"the",
"object",
"-",
"to",
"default",
"values"
] | [
"\"\"\"Re-initialize all fields of the object - to default values\"\"\"",
"# automatically adding smali properties. ",
"# automatically adding wide properties",
"# automatically add ARM properties",
"# automatically set to False kit properties",
"# END OF reinit to default values"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b96af3fc9ad306cb9c12990d9d8b46e6a4a86976 | SUPERSAIYANSLAYIN/droidlysis | droidziprar.py | [
"MIT"
] | Python | extract_one_file | null | def extract_one_file(self, filename, outdir):
"""Extracts from a ZIP or a RAR
- file: file to extract
- outdir: directory to extract to
Will use a password if necessary
"""
if self.zipmode:
# the unzip command works better... (manages to unzip more)
... | Extracts from a ZIP or a RAR
- file: file to extract
- outdir: directory to extract to
Will use a password if necessary
| Extracts from a ZIP or a RAR
file: file to extract
outdir: directory to extract to
Will use a password if necessary | [
"Extracts",
"from",
"a",
"ZIP",
"or",
"a",
"RAR",
"file",
":",
"file",
"to",
"extract",
"outdir",
":",
"directory",
"to",
"extract",
"to",
"Will",
"use",
"a",
"password",
"if",
"necessary"
] | def extract_one_file(self, filename, outdir):
if self.zipmode:
subprocess.call([ "/usr/bin/unzip" , "-o", "-qq", "-P", self.password, "-d", outdir, self.archive_name, filename])
else:
assert self.handle != None, "zip/rar file handle has been closed"
self.handle.extrac... | [
"def",
"extract_one_file",
"(",
"self",
",",
"filename",
",",
"outdir",
")",
":",
"if",
"self",
".",
"zipmode",
":",
"subprocess",
".",
"call",
"(",
"[",
"\"/usr/bin/unzip\"",
",",
"\"-o\"",
",",
"\"-qq\"",
",",
"\"-P\"",
",",
"self",
".",
"password",
",... | Extracts from a ZIP or a RAR
file: file to extract
outdir: directory to extract to
Will use a password if necessary | [
"Extracts",
"from",
"a",
"ZIP",
"or",
"a",
"RAR",
"file",
":",
"file",
"to",
"extract",
"outdir",
":",
"directory",
"to",
"extract",
"to",
"Will",
"use",
"a",
"password",
"if",
"necessary"
] | [
"\"\"\"Extracts from a ZIP or a RAR\n - file: file to extract\n - outdir: directory to extract to\n Will use a password if necessary\n \"\"\"",
"# the unzip command works better... (manages to unzip more)",
"# beware this may raise errors KeyError, RuntimeError..."
] | [
{
"param": "self",
"type": null
},
{
"param": "filename",
"type": null
},
{
"param": "outdir",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "filename",
"type": null,
"docstring": null,
"docstring_tokens... |
b96af3fc9ad306cb9c12990d9d8b46e6a4a86976 | SUPERSAIYANSLAYIN/droidlysis | droidziprar.py | [
"MIT"
] | Python | extract_pattern | <not_specific> | def extract_pattern(self, outdir, pattern):
"""Unzips (or unrars) files matching a given regexp to a given output directory.
Returns a list of what has been unzipped.
"""
assert self.handle != None, "zip/rar file handle has been closed"
all_files = self.handle.namelist()
... | Unzips (or unrars) files matching a given regexp to a given output directory.
Returns a list of what has been unzipped.
| Unzips (or unrars) files matching a given regexp to a given output directory.
Returns a list of what has been unzipped. | [
"Unzips",
"(",
"or",
"unrars",
")",
"files",
"matching",
"a",
"given",
"regexp",
"to",
"a",
"given",
"output",
"directory",
".",
"Returns",
"a",
"list",
"of",
"what",
"has",
"been",
"unzipped",
"."
] | def extract_pattern(self, outdir, pattern):
assert self.handle != None, "zip/rar file handle has been closed"
all_files = self.handle.namelist()
list = [x for x in all_files if re.search(pattern, x)]
for file in list:
self.extract_one_file(file, outdir)
return list | [
"def",
"extract_pattern",
"(",
"self",
",",
"outdir",
",",
"pattern",
")",
":",
"assert",
"self",
".",
"handle",
"!=",
"None",
",",
"\"zip/rar file handle has been closed\"",
"all_files",
"=",
"self",
".",
"handle",
".",
"namelist",
"(",
")",
"list",
"=",
"[... | Unzips (or unrars) files matching a given regexp to a given output directory. | [
"Unzips",
"(",
"or",
"unrars",
")",
"files",
"matching",
"a",
"given",
"regexp",
"to",
"a",
"given",
"output",
"directory",
"."
] | [
"\"\"\"Unzips (or unrars) files matching a given regexp to a given output directory.\n Returns a list of what has been unzipped.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "outdir",
"type": null
},
{
"param": "pattern",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "outdir",
"type": null,
"docstring": null,
"docstring_tokens":... |
86da74658631408a433b4817ebc79f18ec3dae69 | akhmerov/sphinx-book-theme | sphinx_book_theme/launch.py | [
"BSD-3-Clause"
] | Python | add_hub_urls | <not_specific> | def add_hub_urls(
app: Sphinx,
pagename: str,
templatename: str,
context: Dict[str, Any],
doctree: Optional[document],
):
"""Builds a binder link and inserts it in HTML context for use in templating.
This is a ``html-page-context`` sphinx event (see :ref:`sphinx:events`).
:param pagena... | Builds a binder link and inserts it in HTML context for use in templating.
This is a ``html-page-context`` sphinx event (see :ref:`sphinx:events`).
:param pagename: The sphinx docname related to the page
:param context: A dictionary of values that are given to the template engine,
to render the pa... | Builds a binder link and inserts it in HTML context for use in templating.
This is a ``html-page-context`` sphinx event . | [
"Builds",
"a",
"binder",
"link",
"and",
"inserts",
"it",
"in",
"HTML",
"context",
"for",
"use",
"in",
"templating",
".",
"This",
"is",
"a",
"`",
"`",
"html",
"-",
"page",
"-",
"context",
"`",
"`",
"sphinx",
"event",
"."
] | def add_hub_urls(
app: Sphinx,
pagename: str,
templatename: str,
context: Dict[str, Any],
doctree: Optional[document],
):
path = app.env.doc2path(pagename)
extension = Path(path).suffix
config_theme = app.config["html_theme_options"]
launch_buttons = config_theme.get("launch_buttons"... | [
"def",
"add_hub_urls",
"(",
"app",
":",
"Sphinx",
",",
"pagename",
":",
"str",
",",
"templatename",
":",
"str",
",",
"context",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
",",
"doctree",
":",
"Optional",
"[",
"document",
"]",
",",
")",
":",
"path",
... | Builds a binder link and inserts it in HTML context for use in templating. | [
"Builds",
"a",
"binder",
"link",
"and",
"inserts",
"it",
"in",
"HTML",
"context",
"for",
"use",
"in",
"templating",
"."
] | [
"\"\"\"Builds a binder link and inserts it in HTML context for use in templating.\n\n This is a ``html-page-context`` sphinx event (see :ref:`sphinx:events`).\n\n :param pagename: The sphinx docname related to the page\n :param context: A dictionary of values that are given to the template engine,\n ... | [
{
"param": "app",
"type": "Sphinx"
},
{
"param": "pagename",
"type": "str"
},
{
"param": "templatename",
"type": "str"
},
{
"param": "context",
"type": "Dict[str, Any]"
},
{
"param": "doctree",
"type": "Optional[document]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "app",
"type": "Sphinx",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pagename",
"type": "str",
"docstring": "The sphinx docname relat... |
9bc4fa1d567955c9487c12bfa8416a6ff14b502d | abhmul/Vid4K43 | src/data.py | [
"MIT"
] | Python | crappfier | <not_specific> | def crappfier(factor, noise=True):
"""A simple function to get a bilinear resizer with given factor"""
# Do nothing if we're not crappifying
if factor == 1.0:
return lambda x: x
def crappify_img(npimg):
npimg = imresize(
imresize(npimg, factor, interp="bilinear"), 1 / facto... | A simple function to get a bilinear resizer with given factor | A simple function to get a bilinear resizer with given factor | [
"A",
"simple",
"function",
"to",
"get",
"a",
"bilinear",
"resizer",
"with",
"given",
"factor"
] | def crappfier(factor, noise=True):
if factor == 1.0:
return lambda x: x
def crappify_img(npimg):
npimg = imresize(
imresize(npimg, factor, interp="bilinear"), 1 / factor, interp="bilinear"
)
if noise:
npimg = random_noise(npimg)
else:
n... | [
"def",
"crappfier",
"(",
"factor",
",",
"noise",
"=",
"True",
")",
":",
"if",
"factor",
"==",
"1.0",
":",
"return",
"lambda",
"x",
":",
"x",
"def",
"crappify_img",
"(",
"npimg",
")",
":",
"npimg",
"=",
"imresize",
"(",
"imresize",
"(",
"npimg",
",",
... | A simple function to get a bilinear resizer with given factor | [
"A",
"simple",
"function",
"to",
"get",
"a",
"bilinear",
"resizer",
"with",
"given",
"factor"
] | [
"\"\"\"A simple function to get a bilinear resizer with given factor\"\"\"",
"# Do nothing if we're not crappifying",
"# convert to float"
] | [
{
"param": "factor",
"type": null
},
{
"param": "noise",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "factor",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "noise",
"type": null,
"docstring": null,
"docstring_tokens"... |
4998b12bc3a9c179380fff1214808a3a5a881de1 | abhmul/Vid4K43 | src/pretrain.py | [
"MIT"
] | Python | evaluate | null | def evaluate(test_datagen, model, model_path):
"""An evaluation loop that runs each batch in the test gen and displays the original - prediction - GT"""
# Load the model
print(f"Loading model from {model_path}")
model.load_state(model_path)
for x, y in test_datagen:
print(x.shape)
pr... | An evaluation loop that runs each batch in the test gen and displays the original - prediction - GT | An evaluation loop that runs each batch in the test gen and displays the original - prediction - GT | [
"An",
"evaluation",
"loop",
"that",
"runs",
"each",
"batch",
"in",
"the",
"test",
"gen",
"and",
"displays",
"the",
"original",
"-",
"prediction",
"-",
"GT"
] | def evaluate(test_datagen, model, model_path):
print(f"Loading model from {model_path}")
model.load_state(model_path)
for x, y in test_datagen:
print(x.shape)
print(y.shape)
pred = model.predict_on_batch(x)
for xi, predi, yi in zip(x, pred, y):
plot_output(xi, pre... | [
"def",
"evaluate",
"(",
"test_datagen",
",",
"model",
",",
"model_path",
")",
":",
"print",
"(",
"f\"Loading model from {model_path}\"",
")",
"model",
".",
"load_state",
"(",
"model_path",
")",
"for",
"x",
",",
"y",
"in",
"test_datagen",
":",
"print",
"(",
"... | An evaluation loop that runs each batch in the test gen and displays the original - prediction - GT | [
"An",
"evaluation",
"loop",
"that",
"runs",
"each",
"batch",
"in",
"the",
"test",
"gen",
"and",
"displays",
"the",
"original",
"-",
"prediction",
"-",
"GT"
] | [
"\"\"\"An evaluation loop that runs each batch in the test gen and displays the original - prediction - GT\"\"\"",
"# Load the model"
] | [
{
"param": "test_datagen",
"type": null
},
{
"param": "model",
"type": null
},
{
"param": "model_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "test_datagen",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "model",
"type": null,
"docstring": null,
"docstring_t... |
f02cfbf698547cd066fe32b1b5f2e48263cee4e7 | zmurchok/1d-reaction-diffusion-examples | RacRho.py | [
"MIT"
] | Python | rdPDE | <not_specific> | def rdPDE(t, y, D, Di, dx):
"""
The ODEs are derived using the method of lines.
https://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html#mol
"""
# The vectors R, Ri, rho, rhoi are interleaved in y for computational speed
# every fourth entry is...
R = y[0::4]
Ri = y[1::4]
r... |
The ODEs are derived using the method of lines.
https://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html#mol
| The ODEs are derived using the method of lines. | [
"The",
"ODEs",
"are",
"derived",
"using",
"the",
"method",
"of",
"lines",
"."
] | def rdPDE(t, y, D, Di, dx):
R = y[0::4]
Ri = y[1::4]
rho = y[2::4]
rhoi = y[3::4]
dydt = np.empty_like(y)
dRdt = dydt[0::4]
dRidt = dydt[1::4]
drhodt = dydt[2::4]
drhoidt = dydt[3::4]
dRdt[0] = f(R[0], Ri[0], rho[0], rhoi[0]) + D * (-2.0*R[0] + 2.0*R[1]) / dx**2
... | [
"def",
"rdPDE",
"(",
"t",
",",
"y",
",",
"D",
",",
"Di",
",",
"dx",
")",
":",
"R",
"=",
"y",
"[",
"0",
":",
":",
"4",
"]",
"Ri",
"=",
"y",
"[",
"1",
":",
":",
"4",
"]",
"rho",
"=",
"y",
"[",
"2",
":",
":",
"4",
"]",
"rhoi",
"=",
"... | The ODEs are derived using the method of lines. | [
"The",
"ODEs",
"are",
"derived",
"using",
"the",
"method",
"of",
"lines",
"."
] | [
"\"\"\"\n The ODEs are derived using the method of lines.\n https://docs.scipy.org/doc/scipy/reference/tutorial/integrate.html#mol\n \"\"\"",
"# The vectors R, Ri, rho, rhoi are interleaved in y for computational speed",
"# every fourth entry is...",
"# dydt is the return value of this function."
] | [
{
"param": "t",
"type": null
},
{
"param": "y",
"type": null
},
{
"param": "D",
"type": null
},
{
"param": "Di",
"type": null
},
{
"param": "dx",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "t",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "y",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
2426e0ca85d527ed27e7b60e792c42cbf355e32e | eddie-dunn/py3status | py3status/modules/imap.py | [
"BSD-3-Clause"
] | Python | _idle | <not_specific> | def _idle(self):
"""
since imaplib doesn't support IMAP4r1 IDLE, we'll do it by hand
"""
socket = None
try:
# build a new command tag (Xnnn) as bytes:
self.command_tag = (self.command_tag + 1) % 1000
command_tag = b'X' + bytes(str(self.command... |
since imaplib doesn't support IMAP4r1 IDLE, we'll do it by hand
| since imaplib doesn't support IMAP4r1 IDLE, we'll do it by hand | [
"since",
"imaplib",
"doesn",
"'",
"t",
"support",
"IMAP4r1",
"IDLE",
"we",
"'",
"ll",
"do",
"it",
"by",
"hand"
] | def _idle(self):
socket = None
try:
self.command_tag = (self.command_tag + 1) % 1000
command_tag = b'X' + bytes(str(self.command_tag).zfill(3), 'ascii')
directories = self.mailbox.split(',')
self.connection.select(directories[0])
socket = self.... | [
"def",
"_idle",
"(",
"self",
")",
":",
"socket",
"=",
"None",
"try",
":",
"self",
".",
"command_tag",
"=",
"(",
"self",
".",
"command_tag",
"+",
"1",
")",
"%",
"1000",
"command_tag",
"=",
"b'X'",
"+",
"bytes",
"(",
"str",
"(",
"self",
".",
"command... | since imaplib doesn't support IMAP4r1 IDLE, we'll do it by hand | [
"since",
"imaplib",
"doesn",
"'",
"t",
"support",
"IMAP4r1",
"IDLE",
"we",
"'",
"ll",
"do",
"it",
"by",
"hand"
] | [
"\"\"\"\n since imaplib doesn't support IMAP4r1 IDLE, we'll do it by hand\n \"\"\"",
"# build a new command tag (Xnnn) as bytes:",
"# make sure we have selected anything before idling:",
"# send IDLE command and check response:",
"# wait for changes (EXISTS, EXPUNGE, etc.):",
"# ignore '* OK... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
605fdde3d98f3175d38f212c3cbf5eae25e6614c | Ipuch/OnDynamicsForSommersaults | custom_dynamics/implicit_dynamics_taudot_driven.py | [
"MIT"
] | Python | custom_configure_taudot_implicit | null | def custom_configure_taudot_implicit(ocp: OptimalControlProgram, nlp: NonLinearProgram):
"""
Tell the program which variables are states and controls.
The user is expected to use the ConfigureProblem.configure_xxx functions.
Parameters
----------
ocp: OptimalControlProgram
A reference t... |
Tell the program which variables are states and controls.
The user is expected to use the ConfigureProblem.configure_xxx functions.
Parameters
----------
ocp: OptimalControlProgram
A reference to the ocp
nlp: NonLinearProgram
A reference to the phase
| Tell the program which variables are states and controls.
The user is expected to use the ConfigureProblem.configure_xxx functions.
Parameters
OptimalControlProgram
A reference to the ocp
nlp: NonLinearProgram
A reference to the phase | [
"Tell",
"the",
"program",
"which",
"variables",
"are",
"states",
"and",
"controls",
".",
"The",
"user",
"is",
"expected",
"to",
"use",
"the",
"ConfigureProblem",
".",
"configure_xxx",
"functions",
".",
"Parameters",
"OptimalControlProgram",
"A",
"reference",
"to",... | def custom_configure_taudot_implicit(ocp: OptimalControlProgram, nlp: NonLinearProgram):
ConfigureProblem.configure_q(nlp, as_states=True, as_controls=False)
ConfigureProblem.configure_qdot(nlp, as_states=True, as_controls=False)
ConfigureProblem.configure_tau(nlp, as_states=True, as_controls=False)
Con... | [
"def",
"custom_configure_taudot_implicit",
"(",
"ocp",
":",
"OptimalControlProgram",
",",
"nlp",
":",
"NonLinearProgram",
")",
":",
"ConfigureProblem",
".",
"configure_q",
"(",
"nlp",
",",
"as_states",
"=",
"True",
",",
"as_controls",
"=",
"False",
")",
"Configure... | Tell the program which variables are states and controls. | [
"Tell",
"the",
"program",
"which",
"variables",
"are",
"states",
"and",
"controls",
"."
] | [
"\"\"\"\n Tell the program which variables are states and controls.\n The user is expected to use the ConfigureProblem.configure_xxx functions.\n\n Parameters\n ----------\n ocp: OptimalControlProgram\n A reference to the ocp\n nlp: NonLinearProgram\n A reference to the phase\n \"... | [
{
"param": "ocp",
"type": "OptimalControlProgram"
},
{
"param": "nlp",
"type": "NonLinearProgram"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ocp",
"type": "OptimalControlProgram",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "nlp",
"type": "NonLinearProgram",
"docstring": nu... |
2879b7ca7fd7cdcb596f8aeba7a909cb50009a30 | Ipuch/OnDynamicsForSommersaults | main_convergence.py | [
"MIT"
] | Python | generate_calls | <not_specific> | def generate_calls(
n,
Date,
n_shooting_list: list,
dynamics_types: list,
ode_solver: OdeSolver,
nstep: int,
n_threads: int,
out_path_raw: str,
model_str: str,
extra_obj: bool,
):
"""
This functions generates the calls to the miller_run with different random seeds for eac... |
This functions generates the calls to the miller_run with different random seeds for each simulation
while testing different dynamics and equations of motion.
Parameters
----------
n : int
Number of random seeds to generate.
Date : str
Date of the simulation.
n_shooting_lis... | This functions generates the calls to the miller_run with different random seeds for each simulation
while testing different dynamics and equations of motion.
Parameters
n : int
Number of random seeds to generate.
Date : str
Date of the simulation.
n_shooting_list : list
List of tuples with the number of shooting nod... | [
"This",
"functions",
"generates",
"the",
"calls",
"to",
"the",
"miller_run",
"with",
"different",
"random",
"seeds",
"for",
"each",
"simulation",
"while",
"testing",
"different",
"dynamics",
"and",
"equations",
"of",
"motion",
".",
"Parameters",
"n",
":",
"int",... | def generate_calls(
n,
Date,
n_shooting_list: list,
dynamics_types: list,
ode_solver: OdeSolver,
nstep: int,
n_threads: int,
out_path_raw: str,
model_str: str,
extra_obj: bool,
):
calls = []
for i, dynamics_type in enumerate(dynamics_types):
for n_shooting in n_sh... | [
"def",
"generate_calls",
"(",
"n",
",",
"Date",
",",
"n_shooting_list",
":",
"list",
",",
"dynamics_types",
":",
"list",
",",
"ode_solver",
":",
"OdeSolver",
",",
"nstep",
":",
"int",
",",
"n_threads",
":",
"int",
",",
"out_path_raw",
":",
"str",
",",
"m... | This functions generates the calls to the miller_run with different random seeds for each simulation
while testing different dynamics and equations of motion. | [
"This",
"functions",
"generates",
"the",
"calls",
"to",
"the",
"miller_run",
"with",
"different",
"random",
"seeds",
"for",
"each",
"simulation",
"while",
"testing",
"different",
"dynamics",
"and",
"equations",
"of",
"motion",
"."
] | [
"\"\"\"\n This functions generates the calls to the miller_run with different random seeds for each simulation\n while testing different dynamics and equations of motion.\n\n Parameters\n ----------\n n : int\n Number of random seeds to generate.\n Date : str\n Date of the simulation... | [
{
"param": "n",
"type": null
},
{
"param": "Date",
"type": null
},
{
"param": "n_shooting_list",
"type": "list"
},
{
"param": "dynamics_types",
"type": "list"
},
{
"param": "ode_solver",
"type": "OdeSolver"
},
{
"param": "nstep",
"type": "int"
},... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "n",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "Date",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
e115bd83c59f2725215f80877fc082ed3c30dc1c | Ipuch/OnDynamicsForSommersaults | analyses/analyse_text_info_converge.py | [
"MIT"
] | Python | batch_computation | float | def batch_computation(df_results: DataFrame, key: str, d: str) -> float:
"""
This function is used to compute the ratio between the min and the max for a given dynamics d and a given key.
Parameters
----------
df_results : DataFrame
The dataframe containing the results.
key : str
... |
This function is used to compute the ratio between the min and the max for a given dynamics d and a given key.
Parameters
----------
df_results : DataFrame
The dataframe containing the results.
key : str
The key suc as "computation_time" or "cost".
d : str
The dynamics ... | This function is used to compute the ratio between the min and the max for a given dynamics d and a given key.
Parameters
df_results : DataFrame
The dataframe containing the results.
key : str
The key suc as "computation_time" or "cost".
d : str
The dynamics type such as the one contained in dynamics_type_label.
Retu... | [
"This",
"function",
"is",
"used",
"to",
"compute",
"the",
"ratio",
"between",
"the",
"min",
"and",
"the",
"max",
"for",
"a",
"given",
"dynamics",
"d",
"and",
"a",
"given",
"key",
".",
"Parameters",
"df_results",
":",
"DataFrame",
"The",
"dataframe",
"conta... | def batch_computation(df_results: DataFrame, key: str, d: str) -> float:
df = df_results[key]
n_shoot_max = df_results["n_shooting_tot"][df_results["dynamics_type_label"] == d].max()
df = df[df_results["dynamics_type_label"] == d]
df_max = df[df_results["n_shooting_tot"] == n_shoot_max]
df_min = df[... | [
"def",
"batch_computation",
"(",
"df_results",
":",
"DataFrame",
",",
"key",
":",
"str",
",",
"d",
":",
"str",
")",
"->",
"float",
":",
"df",
"=",
"df_results",
"[",
"key",
"]",
"n_shoot_max",
"=",
"df_results",
"[",
"\"n_shooting_tot\"",
"]",
"[",
"df_r... | This function is used to compute the ratio between the min and the max for a given dynamics d and a given key. | [
"This",
"function",
"is",
"used",
"to",
"compute",
"the",
"ratio",
"between",
"the",
"min",
"and",
"the",
"max",
"for",
"a",
"given",
"dynamics",
"d",
"and",
"a",
"given",
"key",
"."
] | [
"\"\"\"\n This function is used to compute the ratio between the min and the max for a given dynamics d and a given key.\n\n Parameters\n ----------\n df_results : DataFrame\n The dataframe containing the results.\n key : str\n The key suc as \"computation_time\" or \"cost\".\n d : s... | [
{
"param": "df_results",
"type": "DataFrame"
},
{
"param": "key",
"type": "str"
},
{
"param": "d",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "df_results",
"type": "DataFrame",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "key",
"type": "str",
"docstring": null,
"docstri... |
1d97a17c5a79a850c8907affb33cc3a98185617f | Ipuch/OnDynamicsForSommersaults | main_comparison.py | [
"MIT"
] | Python | generate_calls | list | def generate_calls(
n: Union[int, list],
Date,
n_shooting: tuple,
dynamics_types: list,
ode_solver: list,
nstep: int,
n_threads: int,
out_path_raw: str,
model_str: str,
extra_obj: bool,
) -> list:
"""
Generate the list of calls to be used in multiprocessing
Parameter... |
Generate the list of calls to be used in multiprocessing
Parameters
----------
n : Union[int, list]
The int of list of irand to be run
Date : str
The date of the run
n_shooting : tuple
The number of shooting points for each phase
dynamics_types : list
The li... | Generate the list of calls to be used in multiprocessing
Parameters
Returns
list
The list of calls to be run | [
"Generate",
"the",
"list",
"of",
"calls",
"to",
"be",
"used",
"in",
"multiprocessing",
"Parameters",
"Returns",
"list",
"The",
"list",
"of",
"calls",
"to",
"be",
"run"
] | def generate_calls(
n: Union[int, list],
Date,
n_shooting: tuple,
dynamics_types: list,
ode_solver: list,
nstep: int,
n_threads: int,
out_path_raw: str,
model_str: str,
extra_obj: bool,
) -> list:
if isinstance(n, int):
rand_loop = range(n)
else:
rand_loop... | [
"def",
"generate_calls",
"(",
"n",
":",
"Union",
"[",
"int",
",",
"list",
"]",
",",
"Date",
",",
"n_shooting",
":",
"tuple",
",",
"dynamics_types",
":",
"list",
",",
"ode_solver",
":",
"list",
",",
"nstep",
":",
"int",
",",
"n_threads",
":",
"int",
"... | Generate the list of calls to be used in multiprocessing
Parameters | [
"Generate",
"the",
"list",
"of",
"calls",
"to",
"be",
"used",
"in",
"multiprocessing",
"Parameters"
] | [
"\"\"\"\n Generate the list of calls to be used in multiprocessing\n\n Parameters\n ----------\n n : Union[int, list]\n The int of list of irand to be run\n Date : str\n The date of the run\n n_shooting : tuple\n The number of shooting points for each phase\n dynamics_types... | [
{
"param": "n",
"type": "Union[int, list]"
},
{
"param": "Date",
"type": null
},
{
"param": "n_shooting",
"type": "tuple"
},
{
"param": "dynamics_types",
"type": "list"
},
{
"param": "ode_solver",
"type": "list"
},
{
"param": "nstep",
"type": "int"... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "n",
"type": "Union[int, list]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "Date",
"type": null,
"docstring": null,
"docstring... |
1d97a17c5a79a850c8907affb33cc3a98185617f | Ipuch/OnDynamicsForSommersaults | main_comparison.py | [
"MIT"
] | Python | run_pool | null | def run_pool(calls: list, pool_nb: int):
"""
Run the pool of processes
Parameters
----------
calls : list
The list of calls to be run
pool_nb : int
The number of processes to be used in parallel
"""
with Pool(pool_nb) as p: # should be 4
p.map(miller_run.main, c... |
Run the pool of processes
Parameters
----------
calls : list
The list of calls to be run
pool_nb : int
The number of processes to be used in parallel
| Run the pool of processes
Parameters
calls : list
The list of calls to be run
pool_nb : int
The number of processes to be used in parallel | [
"Run",
"the",
"pool",
"of",
"processes",
"Parameters",
"calls",
":",
"list",
"The",
"list",
"of",
"calls",
"to",
"be",
"run",
"pool_nb",
":",
"int",
"The",
"number",
"of",
"processes",
"to",
"be",
"used",
"in",
"parallel"
] | def run_pool(calls: list, pool_nb: int):
with Pool(pool_nb) as p:
p.map(miller_run.main, calls) | [
"def",
"run_pool",
"(",
"calls",
":",
"list",
",",
"pool_nb",
":",
"int",
")",
":",
"with",
"Pool",
"(",
"pool_nb",
")",
"as",
"p",
":",
"p",
".",
"map",
"(",
"miller_run",
".",
"main",
",",
"calls",
")"
] | Run the pool of processes
Parameters | [
"Run",
"the",
"pool",
"of",
"processes",
"Parameters"
] | [
"\"\"\"\n Run the pool of processes\n\n Parameters\n ----------\n calls : list\n The list of calls to be run\n pool_nb : int\n The number of processes to be used in parallel\n \"\"\"",
"# should be 4"
] | [
{
"param": "calls",
"type": "list"
},
{
"param": "pool_nb",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "calls",
"type": "list",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pool_nb",
"type": "int",
"docstring": null,
"docstring_tok... |
1d97a17c5a79a850c8907affb33cc3a98185617f | Ipuch/OnDynamicsForSommersaults | main_comparison.py | [
"MIT"
] | Python | run_the_missing_ones | null | def run_the_missing_ones(
out_path_raw: str,
Date,
n_shooting: tuple,
dynamics_types: list,
ode_solver: list,
nstep: int,
n_threads: int,
model_str: str,
extra_obj: bool,
pool_nb: int,
):
"""
This function is used to run the process that were not run during the previous p... |
This function is used to run the process that were not run during the previous pool of processes
Parameters
----------
out_path_raw : str
The path to store the raw results
Date : str
The date of the run
n_shooting : tuple
The number of shooting points for each phase
... | This function is used to run the process that were not run during the previous pool of processes
Parameters
| [
"This",
"function",
"is",
"used",
"to",
"run",
"the",
"process",
"that",
"were",
"not",
"run",
"during",
"the",
"previous",
"pool",
"of",
"processes",
"Parameters"
] | def run_the_missing_ones(
out_path_raw: str,
Date,
n_shooting: tuple,
dynamics_types: list,
ode_solver: list,
nstep: int,
n_threads: int,
model_str: str,
extra_obj: bool,
pool_nb: int,
):
files = os.listdir(out_path_raw)
files.sort()
new_calls = {dynamics_types[0].val... | [
"def",
"run_the_missing_ones",
"(",
"out_path_raw",
":",
"str",
",",
"Date",
",",
"n_shooting",
":",
"tuple",
",",
"dynamics_types",
":",
"list",
",",
"ode_solver",
":",
"list",
",",
"nstep",
":",
"int",
",",
"n_threads",
":",
"int",
",",
"model_str",
":",... | This function is used to run the process that were not run during the previous pool of processes
Parameters | [
"This",
"function",
"is",
"used",
"to",
"run",
"the",
"process",
"that",
"were",
"not",
"run",
"during",
"the",
"previous",
"pool",
"of",
"processes",
"Parameters"
] | [
"\"\"\"\n This function is used to run the process that were not run during the previous pool of processes\n\n Parameters\n ----------\n out_path_raw : str\n The path to store the raw results\n Date : str\n The date of the run\n n_shooting : tuple\n The number of shooting poin... | [
{
"param": "out_path_raw",
"type": "str"
},
{
"param": "Date",
"type": null
},
{
"param": "n_shooting",
"type": "tuple"
},
{
"param": "dynamics_types",
"type": "list"
},
{
"param": "ode_solver",
"type": "list"
},
{
"param": "nstep",
"type": "int"
... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "out_path_raw",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "Date",
"type": null,
"docstring": null,
"docstring_t... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | comdot_time_series | <not_specific> | def comdot_time_series(m: biorbd.Model, q: np.array, qdot: np.array):
"""
Compute the comdot time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
"""
n = q.shape[1]
... |
Compute the comdot time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
| Compute the comdot time series
Parameters
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities | [
"Compute",
"the",
"comdot",
"time",
"series",
"Parameters",
"m",
":",
"biorbd",
".",
"Model",
"Biorbd",
"Model",
"q",
":",
"numpy",
".",
"array",
"generalized",
"coordinates",
"qdot",
":",
"numpy",
".",
"array",
"generalized",
"velocities"
] | def comdot_time_series(m: biorbd.Model, q: np.array, qdot: np.array):
n = q.shape[1]
comdot = np.zeros((3, n))
for ii in range(n):
comdot[:, ii] = m.CoMdot(q[:, ii], qdot[:, ii], True).to_array()
return comdot | [
"def",
"comdot_time_series",
"(",
"m",
":",
"biorbd",
".",
"Model",
",",
"q",
":",
"np",
".",
"array",
",",
"qdot",
":",
"np",
".",
"array",
")",
":",
"n",
"=",
"q",
".",
"shape",
"[",
"1",
"]",
"comdot",
"=",
"np",
".",
"zeros",
"(",
"(",
"3... | Compute the comdot time series
Parameters | [
"Compute",
"the",
"comdot",
"time",
"series",
"Parameters"
] | [
"\"\"\"\n Compute the comdot time series\n\n Parameters\n ----------\n m : biorbd.Model\n Biorbd Model\n q : numpy.array\n generalized coordinates\n qdot : numpy.array\n generalized velocities\n \"\"\""
] | [
{
"param": "m",
"type": "biorbd.Model"
},
{
"param": "q",
"type": "np.array"
},
{
"param": "qdot",
"type": "np.array"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "m",
"type": "biorbd.Model",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "q",
"type": "np.array",
"docstring": null,
"docstring_... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | comddot_time_series | <not_specific> | def comddot_time_series(m: biorbd.Model, q: np.array, qdot: np.array, qddot: np.array):
"""
Compute the comddot time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
qddot... |
Compute the comddot time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
qddot : numpy.array
generalized accelerations
| Compute the comddot time series
Parameters
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
qddot : numpy.array
generalized accelerations | [
"Compute",
"the",
"comddot",
"time",
"series",
"Parameters",
"m",
":",
"biorbd",
".",
"Model",
"Biorbd",
"Model",
"q",
":",
"numpy",
".",
"array",
"generalized",
"coordinates",
"qdot",
":",
"numpy",
".",
"array",
"generalized",
"velocities",
"qddot",
":",
"n... | def comddot_time_series(m: biorbd.Model, q: np.array, qdot: np.array, qddot: np.array):
n = q.shape[1]
comddot = np.zeros((3, n))
for ii in range(n):
comddot[:, ii] = m.CoMddot(q[:, ii], qdot[:, ii], qddot[:, ii], True).to_array()
return comddot | [
"def",
"comddot_time_series",
"(",
"m",
":",
"biorbd",
".",
"Model",
",",
"q",
":",
"np",
".",
"array",
",",
"qdot",
":",
"np",
".",
"array",
",",
"qddot",
":",
"np",
".",
"array",
")",
":",
"n",
"=",
"q",
".",
"shape",
"[",
"1",
"]",
"comddot"... | Compute the comddot time series
Parameters | [
"Compute",
"the",
"comddot",
"time",
"series",
"Parameters"
] | [
"\"\"\"\n Compute the comddot time series\n\n Parameters\n ----------\n m : biorbd.Model\n Biorbd Model\n q : numpy.array\n generalized coordinates\n qdot : numpy.array\n generalized velocities\n qddot : numpy.array\n generalized accelerations\n \"\"\""
] | [
{
"param": "m",
"type": "biorbd.Model"
},
{
"param": "q",
"type": "np.array"
},
{
"param": "qdot",
"type": "np.array"
},
{
"param": "qddot",
"type": "np.array"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "m",
"type": "biorbd.Model",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "q",
"type": "np.array",
"docstring": null,
"docstring_... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | angular_momentum_time_series | <not_specific> | def angular_momentum_time_series(m: biorbd.Model, q: np.array, qdot: np.array):
"""
Compute the angular momentum time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
"""
... |
Compute the angular momentum time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
| Compute the angular momentum time series
Parameters
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities | [
"Compute",
"the",
"angular",
"momentum",
"time",
"series",
"Parameters",
"m",
":",
"biorbd",
".",
"Model",
"Biorbd",
"Model",
"q",
":",
"numpy",
".",
"array",
"generalized",
"coordinates",
"qdot",
":",
"numpy",
".",
"array",
"generalized",
"velocities"
] | def angular_momentum_time_series(m: biorbd.Model, q: np.array, qdot: np.array):
n = q.shape[1]
angular_momentum = np.zeros((3, n))
for ii in range(n):
angular_momentum[:, ii] = m.angularMomentum(q[:, ii], qdot[:, ii], True).to_array()
return angular_momentum | [
"def",
"angular_momentum_time_series",
"(",
"m",
":",
"biorbd",
".",
"Model",
",",
"q",
":",
"np",
".",
"array",
",",
"qdot",
":",
"np",
".",
"array",
")",
":",
"n",
"=",
"q",
".",
"shape",
"[",
"1",
"]",
"angular_momentum",
"=",
"np",
".",
"zeros"... | Compute the angular momentum time series
Parameters | [
"Compute",
"the",
"angular",
"momentum",
"time",
"series",
"Parameters"
] | [
"\"\"\"\n Compute the angular momentum time series\n\n Parameters\n ----------\n m : biorbd.Model\n Biorbd Model\n q : numpy.array\n generalized coordinates\n qdot : numpy.array\n generalized velocities\n \"\"\""
] | [
{
"param": "m",
"type": "biorbd.Model"
},
{
"param": "q",
"type": "np.array"
},
{
"param": "qdot",
"type": "np.array"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "m",
"type": "biorbd.Model",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "q",
"type": "np.array",
"docstring": null,
"docstring_... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | residual_torque_time_series | <not_specific> | def residual_torque_time_series(m: biorbd.Model, q: np.array, qdot: np.array, qddot: np.array):
"""
Compute the residual torque time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velo... |
Compute the residual torque time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
qddot : numpy.array
generalized accelerations
| Compute the residual torque time series
Parameters
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
qddot : numpy.array
generalized accelerations | [
"Compute",
"the",
"residual",
"torque",
"time",
"series",
"Parameters",
"m",
":",
"biorbd",
".",
"Model",
"Biorbd",
"Model",
"q",
":",
"numpy",
".",
"array",
"generalized",
"coordinates",
"qdot",
":",
"numpy",
".",
"array",
"generalized",
"velocities",
"qddot"... | def residual_torque_time_series(m: biorbd.Model, q: np.array, qdot: np.array, qddot: np.array):
n = q.shape[1]
residual_torque = np.zeros((6, n))
for ii in range(n):
residual_torque[:, ii] = m.InverseDynamics(q[:, ii], qdot[:, ii], qddot[:, ii]).to_array()[:6]
return residual_torque | [
"def",
"residual_torque_time_series",
"(",
"m",
":",
"biorbd",
".",
"Model",
",",
"q",
":",
"np",
".",
"array",
",",
"qdot",
":",
"np",
".",
"array",
",",
"qddot",
":",
"np",
".",
"array",
")",
":",
"n",
"=",
"q",
".",
"shape",
"[",
"1",
"]",
"... | Compute the residual torque time series
Parameters | [
"Compute",
"the",
"residual",
"torque",
"time",
"series",
"Parameters"
] | [
"\"\"\"\n Compute the residual torque time series\n\n Parameters\n ----------\n m : biorbd.Model\n Biorbd Model\n q : numpy.array\n generalized coordinates\n qdot : numpy.array\n generalized velocities\n qddot : numpy.array\n generalized accelerations\n \"\"\""
] | [
{
"param": "m",
"type": "biorbd.Model"
},
{
"param": "q",
"type": "np.array"
},
{
"param": "qdot",
"type": "np.array"
},
{
"param": "qddot",
"type": "np.array"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "m",
"type": "biorbd.Model",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "q",
"type": "np.array",
"docstring": null,
"docstring_... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | linear_momentum_time_series | <not_specific> | def linear_momentum_time_series(m: biorbd.Model, q: np.array, qdot: np.array):
"""
Compute the linear momentum time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
"""
... |
Compute the linear momentum time series
Parameters
----------
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities
| Compute the linear momentum time series
Parameters
m : biorbd.Model
Biorbd Model
q : numpy.array
generalized coordinates
qdot : numpy.array
generalized velocities | [
"Compute",
"the",
"linear",
"momentum",
"time",
"series",
"Parameters",
"m",
":",
"biorbd",
".",
"Model",
"Biorbd",
"Model",
"q",
":",
"numpy",
".",
"array",
"generalized",
"coordinates",
"qdot",
":",
"numpy",
".",
"array",
"generalized",
"velocities"
] | def linear_momentum_time_series(m: biorbd.Model, q: np.array, qdot: np.array):
n = q.shape[1]
linear_momentum = np.zeros((3, n))
for ii in range(n):
linear_momentum[:, ii] = m.mass() * m.CoMdot(q[:, ii], qdot[:, ii], True).to_array()
return linear_momentum | [
"def",
"linear_momentum_time_series",
"(",
"m",
":",
"biorbd",
".",
"Model",
",",
"q",
":",
"np",
".",
"array",
",",
"qdot",
":",
"np",
".",
"array",
")",
":",
"n",
"=",
"q",
".",
"shape",
"[",
"1",
"]",
"linear_momentum",
"=",
"np",
".",
"zeros",
... | Compute the linear momentum time series
Parameters | [
"Compute",
"the",
"linear",
"momentum",
"time",
"series",
"Parameters"
] | [
"\"\"\"\n Compute the linear momentum time series\n\n Parameters\n ----------\n m : biorbd.Model\n Biorbd Model\n q : numpy.array\n generalized coordinates\n qdot : numpy.array\n generalized velocities\n \"\"\""
] | [
{
"param": "m",
"type": "biorbd.Model"
},
{
"param": "q",
"type": "np.array"
},
{
"param": "qdot",
"type": "np.array"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "m",
"type": "biorbd.Model",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "q",
"type": "np.array",
"docstring": null,
"docstring_... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | angular_momentum_deviation | <not_specific> | def angular_momentum_deviation(angular_momentum: np.array):
"""
Compute the angular momentum deviation
Parameters
----------
angular_momentum : numpy.array
Angular momentum
"""
n = angular_momentum.shape[1]
angular_momentum_norm = np.zeros(n)
for i in range(n):
angul... |
Compute the angular momentum deviation
Parameters
----------
angular_momentum : numpy.array
Angular momentum
| Compute the angular momentum deviation
Parameters
angular_momentum : numpy.array
Angular momentum | [
"Compute",
"the",
"angular",
"momentum",
"deviation",
"Parameters",
"angular_momentum",
":",
"numpy",
".",
"array",
"Angular",
"momentum"
] | def angular_momentum_deviation(angular_momentum: np.array):
n = angular_momentum.shape[1]
angular_momentum_norm = np.zeros(n)
for i in range(n):
angular_momentum_norm[i] = np.linalg.norm(angular_momentum[:, i])
return rmse(angular_momentum_norm, np.repeat(np.linalg.norm(angular_momentum[:, 0:1])... | [
"def",
"angular_momentum_deviation",
"(",
"angular_momentum",
":",
"np",
".",
"array",
")",
":",
"n",
"=",
"angular_momentum",
".",
"shape",
"[",
"1",
"]",
"angular_momentum_norm",
"=",
"np",
".",
"zeros",
"(",
"n",
")",
"for",
"i",
"in",
"range",
"(",
"... | Compute the angular momentum deviation
Parameters | [
"Compute",
"the",
"angular",
"momentum",
"deviation",
"Parameters"
] | [
"\"\"\"\n Compute the angular momentum deviation\n\n Parameters\n ----------\n angular_momentum : numpy.array\n Angular momentum\n \"\"\""
] | [
{
"param": "angular_momentum",
"type": "np.array"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "angular_momentum",
"type": "np.array",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | stack_states | <not_specific> | def stack_states(states: list[dict], key: str = "q"):
"""
Stack the controls in one vector
Parameters
----------
states : list[dict]
List of dictionaries containing the states
key : str
Key of the states to stack such as "q" or "qdot"
"""
return np.hstack((states[0][key]... |
Stack the controls in one vector
Parameters
----------
states : list[dict]
List of dictionaries containing the states
key : str
Key of the states to stack such as "q" or "qdot"
| Stack the controls in one vector
Parameters
states : list[dict]
List of dictionaries containing the states
key : str
Key of the states to stack such as "q" or "qdot" | [
"Stack",
"the",
"controls",
"in",
"one",
"vector",
"Parameters",
"states",
":",
"list",
"[",
"dict",
"]",
"List",
"of",
"dictionaries",
"containing",
"the",
"states",
"key",
":",
"str",
"Key",
"of",
"the",
"states",
"to",
"stack",
"such",
"as",
"\"",
"q"... | def stack_states(states: list[dict], key: str = "q"):
return np.hstack((states[0][key][:, :-1], states[1][key][:, :])) | [
"def",
"stack_states",
"(",
"states",
":",
"list",
"[",
"dict",
"]",
",",
"key",
":",
"str",
"=",
"\"q\"",
")",
":",
"return",
"np",
".",
"hstack",
"(",
"(",
"states",
"[",
"0",
"]",
"[",
"key",
"]",
"[",
":",
",",
":",
"-",
"1",
"]",
",",
... | Stack the controls in one vector
Parameters | [
"Stack",
"the",
"controls",
"in",
"one",
"vector",
"Parameters"
] | [
"\"\"\"\n Stack the controls in one vector\n\n Parameters\n ----------\n states : list[dict]\n List of dictionaries containing the states\n key : str\n Key of the states to stack such as \"q\" or \"qdot\"\n \"\"\""
] | [
{
"param": "states",
"type": "list[dict]"
},
{
"param": "key",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "states",
"type": "list[dict]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "key",
"type": "str",
"docstring": null,
"docstring_... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | stack_controls | <not_specific> | def stack_controls(controls: list[dict], key: str = "tau"):
"""
Stack the controls in one vector
Parameters
----------
controls : list[dict]
List of dictionaries containing the controls
key : str
Key of the controls to stack such as "tau" or "qddot"
"""
return np.hstack(... |
Stack the controls in one vector
Parameters
----------
controls : list[dict]
List of dictionaries containing the controls
key : str
Key of the controls to stack such as "tau" or "qddot"
| Stack the controls in one vector
Parameters
controls : list[dict]
List of dictionaries containing the controls
key : str
Key of the controls to stack such as "tau" or "qddot" | [
"Stack",
"the",
"controls",
"in",
"one",
"vector",
"Parameters",
"controls",
":",
"list",
"[",
"dict",
"]",
"List",
"of",
"dictionaries",
"containing",
"the",
"controls",
"key",
":",
"str",
"Key",
"of",
"the",
"controls",
"to",
"stack",
"such",
"as",
"\"",... | def stack_controls(controls: list[dict], key: str = "tau"):
return np.hstack((controls[0][key][:, :-1], controls[1][key][:, :])) | [
"def",
"stack_controls",
"(",
"controls",
":",
"list",
"[",
"dict",
"]",
",",
"key",
":",
"str",
"=",
"\"tau\"",
")",
":",
"return",
"np",
".",
"hstack",
"(",
"(",
"controls",
"[",
"0",
"]",
"[",
"key",
"]",
"[",
":",
",",
":",
"-",
"1",
"]",
... | Stack the controls in one vector
Parameters | [
"Stack",
"the",
"controls",
"in",
"one",
"vector",
"Parameters"
] | [
"\"\"\"\n Stack the controls in one vector\n\n Parameters\n ----------\n controls : list[dict]\n List of dictionaries containing the controls\n key : str\n Key of the controls to stack such as \"tau\" or \"qddot\"\n \"\"\""
] | [
{
"param": "controls",
"type": "list[dict]"
},
{
"param": "key",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "controls",
"type": "list[dict]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "key",
"type": "str",
"docstring": null,
"docstrin... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | define_time | <not_specific> | def define_time(time: list, n_shooting: tuple):
"""
Create the time vector
Parameters
----------
time : list
List of duration of each phase of the simulation
n_shooting : tuple
Number of shooting points for each phase
"""
time_vector = np.hstack(
(
np... |
Create the time vector
Parameters
----------
time : list
List of duration of each phase of the simulation
n_shooting : tuple
Number of shooting points for each phase
| Create the time vector
Parameters
time : list
List of duration of each phase of the simulation
n_shooting : tuple
Number of shooting points for each phase | [
"Create",
"the",
"time",
"vector",
"Parameters",
"time",
":",
"list",
"List",
"of",
"duration",
"of",
"each",
"phase",
"of",
"the",
"simulation",
"n_shooting",
":",
"tuple",
"Number",
"of",
"shooting",
"points",
"for",
"each",
"phase"
] | def define_time(time: list, n_shooting: tuple):
time_vector = np.hstack(
(
np.linspace(0, float(time[0]) - 1 / n_shooting[0] * float(time[0]), n_shooting[0]),
np.linspace(float(time[0]), float(time[0]) + float(time[1]), n_shooting[1] + 1),
)
)
return time_vector | [
"def",
"define_time",
"(",
"time",
":",
"list",
",",
"n_shooting",
":",
"tuple",
")",
":",
"time_vector",
"=",
"np",
".",
"hstack",
"(",
"(",
"np",
".",
"linspace",
"(",
"0",
",",
"float",
"(",
"time",
"[",
"0",
"]",
")",
"-",
"1",
"/",
"n_shooti... | Create the time vector
Parameters | [
"Create",
"the",
"time",
"vector",
"Parameters"
] | [
"\"\"\"\n Create the time vector\n\n Parameters\n ----------\n time : list\n List of duration of each phase of the simulation\n n_shooting : tuple\n Number of shooting points for each phase\n \"\"\""
] | [
{
"param": "time",
"type": "list"
},
{
"param": "n_shooting",
"type": "tuple"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "time",
"type": "list",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n_shooting",
"type": "tuple",
"docstring": null,
"docstring... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | define_integrated_time | <not_specific> | def define_integrated_time(time: list, n_shooting: tuple, nstep: int):
"""
Create the time vector corresponding to the integrated time
Parameters
----------
time : list
List of duration of each phase of the simulation
n_shooting : tuple
Number of shooting points for each phase
... |
Create the time vector corresponding to the integrated time
Parameters
----------
time : list
List of duration of each phase of the simulation
n_shooting : tuple
Number of shooting points for each phase
nstep : int
Number of integration steps
| Create the time vector corresponding to the integrated time
Parameters
time : list
List of duration of each phase of the simulation
n_shooting : tuple
Number of shooting points for each phase
nstep : int
Number of integration steps | [
"Create",
"the",
"time",
"vector",
"corresponding",
"to",
"the",
"integrated",
"time",
"Parameters",
"time",
":",
"list",
"List",
"of",
"duration",
"of",
"each",
"phase",
"of",
"the",
"simulation",
"n_shooting",
":",
"tuple",
"Number",
"of",
"shooting",
"point... | def define_integrated_time(time: list, n_shooting: tuple, nstep: int):
time_integrated = np.array([])
cum_time = get_cum_time(time)
for i, n_shoot in enumerate(n_shooting):
periode = (cum_time[i + 1] - cum_time[i]) / n_shoot
for ii in range(n_shoot):
t_linspace = np.linspace(cum_... | [
"def",
"define_integrated_time",
"(",
"time",
":",
"list",
",",
"n_shooting",
":",
"tuple",
",",
"nstep",
":",
"int",
")",
":",
"time_integrated",
"=",
"np",
".",
"array",
"(",
"[",
"]",
")",
"cum_time",
"=",
"get_cum_time",
"(",
"time",
")",
"for",
"i... | Create the time vector corresponding to the integrated time
Parameters | [
"Create",
"the",
"time",
"vector",
"corresponding",
"to",
"the",
"integrated",
"time",
"Parameters"
] | [
"\"\"\"\n Create the time vector corresponding to the integrated time\n\n Parameters\n ----------\n time : list\n List of duration of each phase of the simulation\n n_shooting : tuple\n Number of shooting points for each phase\n nstep : int\n Number of integration steps\n \... | [
{
"param": "time",
"type": "list"
},
{
"param": "n_shooting",
"type": "tuple"
},
{
"param": "nstep",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "time",
"type": "list",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n_shooting",
"type": "tuple",
"docstring": null,
"docstring... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | define_control_integrated | <not_specific> | def define_control_integrated(controls: list, nstep: int, key: str = "tau"):
"""
Creates the integrated vector of controls for a chosen key
Parameters
----------
controls : list[dict]
List of controls
nstep : int
Number of steps of the OdeSolver
key : str
Key of the ... |
Creates the integrated vector of controls for a chosen key
Parameters
----------
controls : list[dict]
List of controls
nstep : int
Number of steps of the OdeSolver
key : str
Key of the chosen control such as "tau" or "qddot"
| Creates the integrated vector of controls for a chosen key
Parameters
controls : list[dict]
List of controls
nstep : int
Number of steps of the OdeSolver
key : str
Key of the chosen control such as "tau" or "qddot" | [
"Creates",
"the",
"integrated",
"vector",
"of",
"controls",
"for",
"a",
"chosen",
"key",
"Parameters",
"controls",
":",
"list",
"[",
"dict",
"]",
"List",
"of",
"controls",
"nstep",
":",
"int",
"Number",
"of",
"steps",
"of",
"the",
"OdeSolver",
"key",
":",
... | def define_control_integrated(controls: list, nstep: int, key: str = "tau"):
tau_integrated = np.hstack(
(
np.repeat(controls[0][key], nstep + 1, axis=1)[:, :-nstep],
np.repeat(controls[1][key], nstep + 1, axis=1)[:, :-nstep],
)
)
return tau_integrated | [
"def",
"define_control_integrated",
"(",
"controls",
":",
"list",
",",
"nstep",
":",
"int",
",",
"key",
":",
"str",
"=",
"\"tau\"",
")",
":",
"tau_integrated",
"=",
"np",
".",
"hstack",
"(",
"(",
"np",
".",
"repeat",
"(",
"controls",
"[",
"0",
"]",
"... | Creates the integrated vector of controls for a chosen key
Parameters | [
"Creates",
"the",
"integrated",
"vector",
"of",
"controls",
"for",
"a",
"chosen",
"key",
"Parameters"
] | [
"\"\"\"\n Creates the integrated vector of controls for a chosen key\n\n Parameters\n ----------\n controls : list[dict]\n List of controls\n nstep : int\n Number of steps of the OdeSolver\n key : str\n Key of the chosen control such as \"tau\" or \"qddot\"\n \"\"\""
] | [
{
"param": "controls",
"type": "list"
},
{
"param": "nstep",
"type": "int"
},
{
"param": "key",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "controls",
"type": "list",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "nstep",
"type": "int",
"docstring": null,
"docstring_to... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | root_explicit_dynamics | <not_specific> | def root_explicit_dynamics(m: biorbd.Model(), q: np.array, qdot: np.array, qddot_joints: np.array):
"""
Compute the root acceleration from the explicit dynamics
Parameters
----------
m : biorbd.Model
biorbd model
q : np.array
generalized coordinates
qdot : np.array
g... |
Compute the root acceleration from the explicit dynamics
Parameters
----------
m : biorbd.Model
biorbd model
q : np.array
generalized coordinates
qdot : np.array
generalized velocities
qddot_joints : np.array
generalized accelerations of the joints
| Compute the root acceleration from the explicit dynamics
Parameters
m : biorbd.Model
biorbd model
q : np.array
generalized coordinates
qdot : np.array
generalized velocities
qddot_joints : np.array
generalized accelerations of the joints | [
"Compute",
"the",
"root",
"acceleration",
"from",
"the",
"explicit",
"dynamics",
"Parameters",
"m",
":",
"biorbd",
".",
"Model",
"biorbd",
"model",
"q",
":",
"np",
".",
"array",
"generalized",
"coordinates",
"qdot",
":",
"np",
".",
"array",
"generalized",
"v... | def root_explicit_dynamics(m: biorbd.Model(), q: np.array, qdot: np.array, qddot_joints: np.array):
mass_matrix_nl_effects = m.InverseDynamics(q, qdot, np.hstack((np.zeros((6,)), qddot_joints))).to_array()[:6]
mass_matrix = m.massMatrix(q).to_array()
qddot_base = -np.linalg.solve(mass_matrix[:6, :6], np.eye... | [
"def",
"root_explicit_dynamics",
"(",
"m",
":",
"biorbd",
".",
"Model",
"(",
")",
",",
"q",
":",
"np",
".",
"array",
",",
"qdot",
":",
"np",
".",
"array",
",",
"qddot_joints",
":",
"np",
".",
"array",
")",
":",
"mass_matrix_nl_effects",
"=",
"m",
"."... | Compute the root acceleration from the explicit dynamics
Parameters | [
"Compute",
"the",
"root",
"acceleration",
"from",
"the",
"explicit",
"dynamics",
"Parameters"
] | [
"\"\"\"\n Compute the root acceleration from the explicit dynamics\n\n Parameters\n ----------\n m : biorbd.Model\n biorbd model\n q : np.array\n generalized coordinates\n qdot : np.array\n generalized velocities\n qddot_joints : np.array\n generalized accelerations ... | [
{
"param": "m",
"type": "biorbd.Model()"
},
{
"param": "q",
"type": "np.array"
},
{
"param": "qdot",
"type": "np.array"
},
{
"param": "qddot_joints",
"type": "np.array"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "m",
"type": "biorbd.Model()",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "q",
"type": "np.array",
"docstring": null,
"docstrin... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | my_shaded_trace | <not_specific> | def my_shaded_trace(
fig: go.Figure, df: DataFrame, d: str, color: str, grps: list, key: str, col=None, row=None, show_legend=True
):
"""
Add a shaded trace to a plotly figure
Parameters
----------
fig : go.Figure
The figure to which the trace will be added
df : DataFrame
Th... |
Add a shaded trace to a plotly figure
Parameters
----------
fig : go.Figure
The figure to which the trace will be added
df : DataFrame
The dataframe containing the data
d : str
The dynamics type of concern
color : str
The color of the trace
grps : list
... | Add a shaded trace to a plotly figure
Parameters
| [
"Add",
"a",
"shaded",
"trace",
"to",
"a",
"plotly",
"figure",
"Parameters"
] | def my_shaded_trace(
fig: go.Figure, df: DataFrame, d: str, color: str, grps: list, key: str, col=None, row=None, show_legend=True
):
my_boolean = df["dynamics_type_label"] == d
c_rgb = px.colors.hex_to_rgb(color)
c_alpha = str(f"rgba({c_rgb[0]},{c_rgb[1]},{c_rgb[2]},0.2)")
fig.add_scatter(
... | [
"def",
"my_shaded_trace",
"(",
"fig",
":",
"go",
".",
"Figure",
",",
"df",
":",
"DataFrame",
",",
"d",
":",
"str",
",",
"color",
":",
"str",
",",
"grps",
":",
"list",
",",
"key",
":",
"str",
",",
"col",
"=",
"None",
",",
"row",
"=",
"None",
","... | Add a shaded trace to a plotly figure
Parameters | [
"Add",
"a",
"shaded",
"trace",
"to",
"a",
"plotly",
"figure",
"Parameters"
] | [
"\"\"\"\n Add a shaded trace to a plotly figure\n\n Parameters\n ----------\n fig : go.Figure\n The figure to which the trace will be added\n df : DataFrame\n The dataframe containing the data\n d : str\n The dynamics type of concern\n color : str\n The color of the ... | [
{
"param": "fig",
"type": "go.Figure"
},
{
"param": "df",
"type": "DataFrame"
},
{
"param": "d",
"type": "str"
},
{
"param": "color",
"type": "str"
},
{
"param": "grps",
"type": "list"
},
{
"param": "key",
"type": "str"
},
{
"param": "col",... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fig",
"type": "go.Figure",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "df",
"type": "DataFrame",
"docstring": null,
"docstring... |
6294fbedb86c7df2a987c45fc9ad1194e6f40a42 | Ipuch/OnDynamicsForSommersaults | analyses/utils.py | [
"MIT"
] | Python | generate_windows_size | tuple | def generate_windows_size(nb: int) -> tuple:
"""
Defines the number of column and rows of subplots from the number of variables to plot.
Parameters
----------
nb: int
Number of variables to plot
Returns
-------
The optimized number of rows and columns
"""
n_rows = int(... |
Defines the number of column and rows of subplots from the number of variables to plot.
Parameters
----------
nb: int
Number of variables to plot
Returns
-------
The optimized number of rows and columns
| Defines the number of column and rows of subplots from the number of variables to plot.
Parameters
int
Number of variables to plot
Returns
The optimized number of rows and columns | [
"Defines",
"the",
"number",
"of",
"column",
"and",
"rows",
"of",
"subplots",
"from",
"the",
"number",
"of",
"variables",
"to",
"plot",
".",
"Parameters",
"int",
"Number",
"of",
"variables",
"to",
"plot",
"Returns",
"The",
"optimized",
"number",
"of",
"rows",... | def generate_windows_size(nb: int) -> tuple:
n_rows = int(round(np.sqrt(nb)))
return n_rows + 1 if n_rows * n_rows < nb else n_rows, n_rows | [
"def",
"generate_windows_size",
"(",
"nb",
":",
"int",
")",
"->",
"tuple",
":",
"n_rows",
"=",
"int",
"(",
"round",
"(",
"np",
".",
"sqrt",
"(",
"nb",
")",
")",
")",
"return",
"n_rows",
"+",
"1",
"if",
"n_rows",
"*",
"n_rows",
"<",
"nb",
"else",
... | Defines the number of column and rows of subplots from the number of variables to plot. | [
"Defines",
"the",
"number",
"of",
"column",
"and",
"rows",
"of",
"subplots",
"from",
"the",
"number",
"of",
"variables",
"to",
"plot",
"."
] | [
"\"\"\"\n Defines the number of column and rows of subplots from the number of variables to plot.\n\n Parameters\n ----------\n nb: int\n Number of variables to plot\n\n Returns\n -------\n The optimized number of rows and columns\n \"\"\""
] | [
{
"param": "nb",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "nb",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.