id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
53,200 | jumpscale7/python-consistent-toml | contoml/file/toplevels.py | identify | def identify(file_elements):
"""
Outputs an ordered sequence of instances of TopLevel types.
Elements start with an optional TableElement, followed by zero or more pairs of (TableHeaderElement, TableElement).
"""
if not file_elements:
return
_validate_file_elements(file_elements)
... | python | def identify(file_elements):
"""
Outputs an ordered sequence of instances of TopLevel types.
Elements start with an optional TableElement, followed by zero or more pairs of (TableHeaderElement, TableElement).
"""
if not file_elements:
return
_validate_file_elements(file_elements)
... | [
"def",
"identify",
"(",
"file_elements",
")",
":",
"if",
"not",
"file_elements",
":",
"return",
"_validate_file_elements",
"(",
"file_elements",
")",
"# An iterator over enumerate(the non-metadata) elements",
"iterator",
"=",
"PeekableIterator",
"(",
"(",
"element_i",
","... | Outputs an ordered sequence of instances of TopLevel types.
Elements start with an optional TableElement, followed by zero or more pairs of (TableHeaderElement, TableElement). | [
"Outputs",
"an",
"ordered",
"sequence",
"of",
"instances",
"of",
"TopLevel",
"types",
"."
] | a0149c65313ccb8170aa99a0cc498e76231292b9 | https://github.com/jumpscale7/python-consistent-toml/blob/a0149c65313ccb8170aa99a0cc498e76231292b9/contoml/file/toplevels.py#L103-L142 |
53,201 | Scoppio/RagnarokEngine3 | Tutorials/Platforming Block - PyGame Release/Game/Code/LevelData.py | load_character | def load_character(tile_map, gamescreen):
"""Create an instance of the main character and return it."""
tile_obj = thc.TileHeroCharacter(tile_map, gamescreen)
tile_obj.load_texture("..//Textures//character.png")
tile_obj.origin = r.Vector2(0, 0)
tile_obj.hazard_touched_method = hazard_touched_method... | python | def load_character(tile_map, gamescreen):
"""Create an instance of the main character and return it."""
tile_obj = thc.TileHeroCharacter(tile_map, gamescreen)
tile_obj.load_texture("..//Textures//character.png")
tile_obj.origin = r.Vector2(0, 0)
tile_obj.hazard_touched_method = hazard_touched_method... | [
"def",
"load_character",
"(",
"tile_map",
",",
"gamescreen",
")",
":",
"tile_obj",
"=",
"thc",
".",
"TileHeroCharacter",
"(",
"tile_map",
",",
"gamescreen",
")",
"tile_obj",
".",
"load_texture",
"(",
"\"..//Textures//character.png\"",
")",
"tile_obj",
".",
"origin... | Create an instance of the main character and return it. | [
"Create",
"an",
"instance",
"of",
"the",
"main",
"character",
"and",
"return",
"it",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/Tutorials/Platforming Block - PyGame Release/Game/Code/LevelData.py#L18-L25 |
53,202 | neighbordog/deviantart | deviantart/api.py | Api.auth_uri | def auth_uri(self):
"""The authorzation URL that should be provided to the user"""
return self.oauth.auth_uri(redirect_uri=self.redirect_uri, scope=self.scope) | python | def auth_uri(self):
"""The authorzation URL that should be provided to the user"""
return self.oauth.auth_uri(redirect_uri=self.redirect_uri, scope=self.scope) | [
"def",
"auth_uri",
"(",
"self",
")",
":",
"return",
"self",
".",
"oauth",
".",
"auth_uri",
"(",
"redirect_uri",
"=",
"self",
".",
"redirect_uri",
",",
"scope",
"=",
"self",
".",
"scope",
")"
] | The authorzation URL that should be provided to the user | [
"The",
"authorzation",
"URL",
"that",
"should",
"be",
"provided",
"to",
"the",
"user"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L126-L130 |
53,203 | neighbordog/deviantart | deviantart/api.py | Api.browse_dailydeviations | def browse_dailydeviations(self):
"""Retrieves Daily Deviations"""
response = self._req('/browse/dailydeviations')
deviations = []
for item in response['results']:
d = Deviation()
d.from_dict(item)
deviations.append(d)
return deviations | python | def browse_dailydeviations(self):
"""Retrieves Daily Deviations"""
response = self._req('/browse/dailydeviations')
deviations = []
for item in response['results']:
d = Deviation()
d.from_dict(item)
deviations.append(d)
return deviations | [
"def",
"browse_dailydeviations",
"(",
"self",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/browse/dailydeviations'",
")",
"deviations",
"=",
"[",
"]",
"for",
"item",
"in",
"response",
"[",
"'results'",
"]",
":",
"d",
"=",
"Deviation",
"(",
")",
... | Retrieves Daily Deviations | [
"Retrieves",
"Daily",
"Deviations"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L134-L147 |
53,204 | neighbordog/deviantart | deviantart/api.py | Api.browse_userjournals | def browse_userjournals(self, username, featured=False, offset=0, limit=10):
"""Fetch user journals from user
:param username: name of user to retrieve journals from
:param featured: fetch only featured or not
:param offset: the pagination offset
:param limit: the pagination li... | python | def browse_userjournals(self, username, featured=False, offset=0, limit=10):
"""Fetch user journals from user
:param username: name of user to retrieve journals from
:param featured: fetch only featured or not
:param offset: the pagination offset
:param limit: the pagination li... | [
"def",
"browse_userjournals",
"(",
"self",
",",
"username",
",",
"featured",
"=",
"False",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/browse/user/journals'",
",",
"{",
"\"username\"",
":",
"u... | Fetch user journals from user
:param username: name of user to retrieve journals from
:param featured: fetch only featured or not
:param offset: the pagination offset
:param limit: the pagination limit | [
"Fetch",
"user",
"journals",
"from",
"user"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L151-L179 |
53,205 | neighbordog/deviantart | deviantart/api.py | Api.browse_morelikethis_preview | def browse_morelikethis_preview(self, seed):
"""Fetch More Like This preview result for a seed deviation
:param seed: The deviationid to fetch more like
"""
response = self._req('/browse/morelikethis/preview', {
"seed":seed
})
returned_seed = response['see... | python | def browse_morelikethis_preview(self, seed):
"""Fetch More Like This preview result for a seed deviation
:param seed: The deviationid to fetch more like
"""
response = self._req('/browse/morelikethis/preview', {
"seed":seed
})
returned_seed = response['see... | [
"def",
"browse_morelikethis_preview",
"(",
"self",
",",
"seed",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/browse/morelikethis/preview'",
",",
"{",
"\"seed\"",
":",
"seed",
"}",
")",
"returned_seed",
"=",
"response",
"[",
"'seed'",
"]",
"author",
... | Fetch More Like This preview result for a seed deviation
:param seed: The deviationid to fetch more like | [
"Fetch",
"More",
"Like",
"This",
"preview",
"result",
"for",
"a",
"seed",
"deviation"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L183-L218 |
53,206 | neighbordog/deviantart | deviantart/api.py | Api.browse | def browse(self, endpoint="hot", category_path="", seed="", q="", timerange="24hr", tag="", offset=0, limit=10):
"""Fetch deviations from public endpoints
:param endpoint: The endpoint from which the deviations will be fetched (hot/morelikethis/newest/undiscovered/popular/tags)
:param category... | python | def browse(self, endpoint="hot", category_path="", seed="", q="", timerange="24hr", tag="", offset=0, limit=10):
"""Fetch deviations from public endpoints
:param endpoint: The endpoint from which the deviations will be fetched (hot/morelikethis/newest/undiscovered/popular/tags)
:param category... | [
"def",
"browse",
"(",
"self",
",",
"endpoint",
"=",
"\"hot\"",
",",
"category_path",
"=",
"\"\"",
",",
"seed",
"=",
"\"\"",
",",
"q",
"=",
"\"\"",
",",
"timerange",
"=",
"\"24hr\"",
",",
"tag",
"=",
"\"\"",
",",
"offset",
"=",
"0",
",",
"limit",
"=... | Fetch deviations from public endpoints
:param endpoint: The endpoint from which the deviations will be fetched (hot/morelikethis/newest/undiscovered/popular/tags)
:param category_path: category path to fetch from
:param q: Search query term
:param timerange: The timerange
:param... | [
"Fetch",
"deviations",
"from",
"public",
"endpoints"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L222-L295 |
53,207 | neighbordog/deviantart | deviantart/api.py | Api.get_categories | def get_categories(self, catpath="/"):
"""Fetch the categorytree
:param catpath: The category to list children of
"""
response = self._req('/browse/categorytree', {
"catpath":catpath
})
categories = response['categories']
return categories | python | def get_categories(self, catpath="/"):
"""Fetch the categorytree
:param catpath: The category to list children of
"""
response = self._req('/browse/categorytree', {
"catpath":catpath
})
categories = response['categories']
return categories | [
"def",
"get_categories",
"(",
"self",
",",
"catpath",
"=",
"\"/\"",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/browse/categorytree'",
",",
"{",
"\"catpath\"",
":",
"catpath",
"}",
")",
"categories",
"=",
"response",
"[",
"'categories'",
"]",
"... | Fetch the categorytree
:param catpath: The category to list children of | [
"Fetch",
"the",
"categorytree"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L299-L312 |
53,208 | neighbordog/deviantart | deviantart/api.py | Api.search_tags | def search_tags(self, tag_name):
"""Searches for tags
:param tag_name: Partial tag name to get autocomplete suggestions for
"""
response = self._req('/browse/tags/search', {
"tag_name":tag_name
})
tags = list()
for item in response['results']:
... | python | def search_tags(self, tag_name):
"""Searches for tags
:param tag_name: Partial tag name to get autocomplete suggestions for
"""
response = self._req('/browse/tags/search', {
"tag_name":tag_name
})
tags = list()
for item in response['results']:
... | [
"def",
"search_tags",
"(",
"self",
",",
"tag_name",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/browse/tags/search'",
",",
"{",
"\"tag_name\"",
":",
"tag_name",
"}",
")",
"tags",
"=",
"list",
"(",
")",
"for",
"item",
"in",
"response",
"[",
... | Searches for tags
:param tag_name: Partial tag name to get autocomplete suggestions for | [
"Searches",
"for",
"tags"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L316-L332 |
53,209 | neighbordog/deviantart | deviantart/api.py | Api.get_deviation | def get_deviation(self, deviationid):
"""Fetch a single deviation
:param deviationid: The deviationid you want to fetch
"""
response = self._req('/deviation/{}'.format(deviationid))
d = Deviation()
d.from_dict(response)
return d | python | def get_deviation(self, deviationid):
"""Fetch a single deviation
:param deviationid: The deviationid you want to fetch
"""
response = self._req('/deviation/{}'.format(deviationid))
d = Deviation()
d.from_dict(response)
return d | [
"def",
"get_deviation",
"(",
"self",
",",
"deviationid",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/deviation/{}'",
".",
"format",
"(",
"deviationid",
")",
")",
"d",
"=",
"Deviation",
"(",
")",
"d",
".",
"from_dict",
"(",
"response",
")",
... | Fetch a single deviation
:param deviationid: The deviationid you want to fetch | [
"Fetch",
"a",
"single",
"deviation"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L336-L347 |
53,210 | neighbordog/deviantart | deviantart/api.py | Api.whofaved_deviation | def whofaved_deviation(self, deviationid, offset=0, limit=10):
"""Fetch a list of users who faved the deviation
:param deviationid: The deviationid you want to fetch
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/devi... | python | def whofaved_deviation(self, deviationid, offset=0, limit=10):
"""Fetch a list of users who faved the deviation
:param deviationid: The deviationid you want to fetch
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/devi... | [
"def",
"whofaved_deviation",
"(",
"self",
",",
"deviationid",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/deviation/whofaved'",
",",
"get_data",
"=",
"{",
"'deviationid'",
":",
"deviationid",
",... | Fetch a list of users who faved the deviation
:param deviationid: The deviationid you want to fetch
:param offset: the pagination offset
:param limit: the pagination limit | [
"Fetch",
"a",
"list",
"of",
"users",
"who",
"faved",
"the",
"deviation"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L351-L380 |
53,211 | neighbordog/deviantart | deviantart/api.py | Api.get_deviation_metadata | def get_deviation_metadata(self, deviationids, ext_submission=False, ext_camera=False, ext_stats=False, ext_collection=False):
"""Fetch deviation metadata for a set of deviations
:param deviationid: The deviationid you want to fetch
:param ext_submission: Return extended information - submissi... | python | def get_deviation_metadata(self, deviationids, ext_submission=False, ext_camera=False, ext_stats=False, ext_collection=False):
"""Fetch deviation metadata for a set of deviations
:param deviationid: The deviationid you want to fetch
:param ext_submission: Return extended information - submissi... | [
"def",
"get_deviation_metadata",
"(",
"self",
",",
"deviationids",
",",
"ext_submission",
"=",
"False",
",",
"ext_camera",
"=",
"False",
",",
"ext_stats",
"=",
"False",
",",
"ext_collection",
"=",
"False",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",... | Fetch deviation metadata for a set of deviations
:param deviationid: The deviationid you want to fetch
:param ext_submission: Return extended information - submission information
:param ext_camera: Return extended information - EXIF information (if available)
:param ext_stats: Return ex... | [
"Fetch",
"deviation",
"metadata",
"for",
"a",
"set",
"of",
"deviations"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L384-L435 |
53,212 | neighbordog/deviantart | deviantart/api.py | Api.get_deviation_embeddedcontent | def get_deviation_embeddedcontent(self, deviationid, offset_deviationid="", offset=0, limit=10):
"""Fetch content embedded in a deviation
:param deviationid: The deviationid of container deviation
:param offset_deviationid: UUID of embedded deviation to use as an offset
:param offset: ... | python | def get_deviation_embeddedcontent(self, deviationid, offset_deviationid="", offset=0, limit=10):
"""Fetch content embedded in a deviation
:param deviationid: The deviationid of container deviation
:param offset_deviationid: UUID of embedded deviation to use as an offset
:param offset: ... | [
"def",
"get_deviation_embeddedcontent",
"(",
"self",
",",
"deviationid",
",",
"offset_deviationid",
"=",
"\"\"",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/deviation/embeddedcontent'",
",",
"{",
... | Fetch content embedded in a deviation
:param deviationid: The deviationid of container deviation
:param offset_deviationid: UUID of embedded deviation to use as an offset
:param offset: the pagination offset
:param limit: the pagination limit | [
"Fetch",
"content",
"embedded",
"in",
"a",
"deviation"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L439-L471 |
53,213 | neighbordog/deviantart | deviantart/api.py | Api.get_deviation_content | def get_deviation_content(self, deviationid):
"""Fetch full data that is not included in the main devaition object
The endpoint works with journals and literatures. Deviation objects returned from API contain only excerpt of a journal, use this endpoint to load full content.
Any custom CSS ru... | python | def get_deviation_content(self, deviationid):
"""Fetch full data that is not included in the main devaition object
The endpoint works with journals and literatures. Deviation objects returned from API contain only excerpt of a journal, use this endpoint to load full content.
Any custom CSS ru... | [
"def",
"get_deviation_content",
"(",
"self",
",",
"deviationid",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/deviation/content'",
",",
"{",
"'deviationid'",
":",
"deviationid",
"}",
")",
"content",
"=",
"{",
"}",
"if",
"\"html\"",
"in",
"response... | Fetch full data that is not included in the main devaition object
The endpoint works with journals and literatures. Deviation objects returned from API contain only excerpt of a journal, use this endpoint to load full content.
Any custom CSS rules and fonts applied to journal are also returned.
... | [
"Fetch",
"full",
"data",
"that",
"is",
"not",
"included",
"in",
"the",
"main",
"devaition",
"object"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L475-L500 |
53,214 | neighbordog/deviantart | deviantart/api.py | Api.get_collections | def get_collections(self, username="", calculate_size=False, ext_preload=False, offset=0, limit=10):
"""Fetch collection folders
:param username: The user to list folders for, if omitted the authenticated user is used
:param calculate_size: The option to include the content count per each coll... | python | def get_collections(self, username="", calculate_size=False, ext_preload=False, offset=0, limit=10):
"""Fetch collection folders
:param username: The user to list folders for, if omitted the authenticated user is used
:param calculate_size: The option to include the content count per each coll... | [
"def",
"get_collections",
"(",
"self",
",",
"username",
"=",
"\"\"",
",",
"calculate_size",
"=",
"False",
",",
"ext_preload",
"=",
"False",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"if",
"not",
"username",
"and",
"self",
".",
"standa... | Fetch collection folders
:param username: The user to list folders for, if omitted the authenticated user is used
:param calculate_size: The option to include the content count per each collection folder
:param ext_preload: Include first 5 deviations from the folder
:param offset: the p... | [
"Fetch",
"collection",
"folders"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L520-L574 |
53,215 | neighbordog/deviantart | deviantart/api.py | Api.get_collection | def get_collection(self, folderid, username="", offset=0, limit=10):
"""Fetch collection folder contents
:param folderid: UUID of the folder to list
:param username: The user to list folders for, if omitted the authenticated user is used
:param offset: the pagination offset
:pa... | python | def get_collection(self, folderid, username="", offset=0, limit=10):
"""Fetch collection folder contents
:param folderid: UUID of the folder to list
:param username: The user to list folders for, if omitted the authenticated user is used
:param offset: the pagination offset
:pa... | [
"def",
"get_collection",
"(",
"self",
",",
"folderid",
",",
"username",
"=",
"\"\"",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"if",
"not",
"username",
"and",
"self",
".",
"standard_grant_type",
"==",
"\"authorization_code\"",
":",
"respo... | Fetch collection folder contents
:param folderid: UUID of the folder to list
:param username: The user to list folders for, if omitted the authenticated user is used
:param offset: the pagination offset
:param limit: the pagination limit | [
"Fetch",
"collection",
"folder",
"contents"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L578-L620 |
53,216 | neighbordog/deviantart | deviantart/api.py | Api.fave | def fave(self, deviationid, folderid=""):
"""Add deviation to favourites
:param deviationid: Id of the Deviation to favourite
:param folderid: Optional UUID of the Collection folder to add the favourite into
"""
if self.standard_grant_type is not "authorization_code":
... | python | def fave(self, deviationid, folderid=""):
"""Add deviation to favourites
:param deviationid: Id of the Deviation to favourite
:param folderid: Optional UUID of the Collection folder to add the favourite into
"""
if self.standard_grant_type is not "authorization_code":
... | [
"def",
"fave",
"(",
"self",
",",
"deviationid",
",",
"folderid",
"=",
"\"\"",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is re... | Add deviation to favourites
:param deviationid: Id of the Deviation to favourite
:param folderid: Optional UUID of the Collection folder to add the favourite into | [
"Add",
"deviation",
"to",
"favourites"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L624-L644 |
53,217 | neighbordog/deviantart | deviantart/api.py | Api.get_gallery_all | def get_gallery_all(self, username='', offset=0, limit=10):
"""
Get all of a user's deviations
:param username: The user to query, defaults to current user
:param offset: the pagination offset
:param limit: the pagination limit
"""
if not username:
ra... | python | def get_gallery_all(self, username='', offset=0, limit=10):
"""
Get all of a user's deviations
:param username: The user to query, defaults to current user
:param offset: the pagination offset
:param limit: the pagination limit
"""
if not username:
ra... | [
"def",
"get_gallery_all",
"(",
"self",
",",
"username",
"=",
"''",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"if",
"not",
"username",
":",
"raise",
"DeviantartError",
"(",
"'No username defined.'",
")",
"response",
"=",
"self",
".",
"_r... | Get all of a user's deviations
:param username: The user to query, defaults to current user
:param offset: the pagination offset
:param limit: the pagination limit | [
"Get",
"all",
"of",
"a",
"user",
"s",
"deviations"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L731-L763 |
53,218 | neighbordog/deviantart | deviantart/api.py | Api.get_user | def get_user(self, username="", ext_collections=False, ext_galleries=False):
"""Get user profile information
:param username: username to lookup profile of
:param ext_collections: Include collection folder info
:param ext_galleries: Include gallery folder info
"""
if n... | python | def get_user(self, username="", ext_collections=False, ext_galleries=False):
"""Get user profile information
:param username: username to lookup profile of
:param ext_collections: Include collection folder info
:param ext_galleries: Include gallery folder info
"""
if n... | [
"def",
"get_user",
"(",
"self",
",",
"username",
"=",
"\"\"",
",",
"ext_collections",
"=",
"False",
",",
"ext_galleries",
"=",
"False",
")",
":",
"if",
"not",
"username",
"and",
"self",
".",
"standard_grant_type",
"==",
"\"authorization_code\"",
":",
"response... | Get user profile information
:param username: username to lookup profile of
:param ext_collections: Include collection folder info
:param ext_galleries: Include gallery folder info | [
"Get",
"user",
"profile",
"information"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L816-L840 |
53,219 | neighbordog/deviantart | deviantart/api.py | Api.get_users | def get_users(self, usernames):
"""Fetch user info for given usernames
:param username: The usernames you want metadata for (max. 50)
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) ... | python | def get_users(self, usernames):
"""Fetch user info for given usernames
:param username: The usernames you want metadata for (max. 50)
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) ... | [
"def",
"get_users",
"(",
"self",
",",
"usernames",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required in order to connect to this ... | Fetch user info for given usernames
:param username: The usernames you want metadata for (max. 50) | [
"Fetch",
"user",
"info",
"for",
"given",
"usernames"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L867-L888 |
53,220 | neighbordog/deviantart | deviantart/api.py | Api.watch | def watch(
self,
username,
watch={
"friend":True,
"deviations":True,
"journals":True,
"forum_threads":True,
"critiques":True,
"scraps":True,
"activity":True,
"collections":True
}
):
... | python | def watch(
self,
username,
watch={
"friend":True,
"deviations":True,
"journals":True,
"forum_threads":True,
"critiques":True,
"scraps":True,
"activity":True,
"collections":True
}
):
... | [
"def",
"watch",
"(",
"self",
",",
"username",
",",
"watch",
"=",
"{",
"\"friend\"",
":",
"True",
",",
"\"deviations\"",
":",
"True",
",",
"\"journals\"",
":",
"True",
",",
"\"forum_threads\"",
":",
"True",
",",
"\"critiques\"",
":",
"True",
",",
"\"scraps\... | Watch a user
:param username: The username you want to watch | [
"Watch",
"a",
"user"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L892-L926 |
53,221 | neighbordog/deviantart | deviantart/api.py | Api.unwatch | def unwatch(self, username):
"""Unwatch a user
:param username: The username you want to unwatch
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order to connect to th... | python | def unwatch(self, username):
"""Unwatch a user
:param username: The username you want to unwatch
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order to connect to th... | [
"def",
"unwatch",
"(",
"self",
",",
"username",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required in order to connect to this end... | Unwatch a user
:param username: The username you want to unwatch | [
"Unwatch",
"a",
"user"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L930-L942 |
53,222 | neighbordog/deviantart | deviantart/api.py | Api.is_watching | def is_watching(self, username):
"""Check if user is being watched by the given user
:param username: Check if username is watching you
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type... | python | def is_watching(self, username):
"""Check if user is being watched by the given user
:param username: Check if username is watching you
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type... | [
"def",
"is_watching",
"(",
"self",
",",
"username",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required in order to connect to this... | Check if user is being watched by the given user
:param username: Check if username is watching you | [
"Check",
"if",
"user",
"is",
"being",
"watched",
"by",
"the",
"given",
"user"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L946-L958 |
53,223 | neighbordog/deviantart | deviantart/api.py | Api.update_user | def update_user(self, user_is_artist="", artist_level="", artist_specialty="", real_name="", tagline="", countryid="", website="", bio=""):
"""Update the users profile information
:param user_is_artist: Is the user an artist?
:param artist_level: If the user is an artist, what level are they
... | python | def update_user(self, user_is_artist="", artist_level="", artist_specialty="", real_name="", tagline="", countryid="", website="", bio=""):
"""Update the users profile information
:param user_is_artist: Is the user an artist?
:param artist_level: If the user is an artist, what level are they
... | [
"def",
"update_user",
"(",
"self",
",",
"user_is_artist",
"=",
"\"\"",
",",
"artist_level",
"=",
"\"\"",
",",
"artist_specialty",
"=",
"\"\"",
",",
"real_name",
"=",
"\"\"",
",",
"tagline",
"=",
"\"\"",
",",
"countryid",
"=",
"\"\"",
",",
"website",
"=",
... | Update the users profile information
:param user_is_artist: Is the user an artist?
:param artist_level: If the user is an artist, what level are they
:param artist_specialty: If the user is an artist, what is their specialty
:param real_name: The users real name
:param tagline: ... | [
"Update",
"the",
"users",
"profile",
"information"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L962-L1009 |
53,224 | neighbordog/deviantart | deviantart/api.py | Api.get_watchers | def get_watchers(self, username, offset=0, limit=10):
"""Get the user's list of watchers
:param username: The username you want to get a list of watchers of
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/user/watchers... | python | def get_watchers(self, username, offset=0, limit=10):
"""Get the user's list of watchers
:param username: The username you want to get a list of watchers of
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/user/watchers... | [
"def",
"get_watchers",
"(",
"self",
",",
"username",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/user/watchers/{}'",
".",
"format",
"(",
"username",
")",
",",
"{",
"'offset'",
":",
"offset",... | Get the user's list of watchers
:param username: The username you want to get a list of watchers of
:param offset: the pagination offset
:param limit: the pagination limit | [
"Get",
"the",
"user",
"s",
"list",
"of",
"watchers"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1024-L1063 |
53,225 | neighbordog/deviantart | deviantart/api.py | Api.get_friends | def get_friends(self, username, offset=0, limit=10):
"""Get the users list of friends
:param username: The username you want to get a list of friends of
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/user/friends/{}'.... | python | def get_friends(self, username, offset=0, limit=10):
"""Get the users list of friends
:param username: The username you want to get a list of friends of
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/user/friends/{}'.... | [
"def",
"get_friends",
"(",
"self",
",",
"username",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/user/friends/{}'",
".",
"format",
"(",
"username",
")",
",",
"{",
"'offset'",
":",
"offset",
... | Get the users list of friends
:param username: The username you want to get a list of friends of
:param offset: the pagination offset
:param limit: the pagination limit | [
"Get",
"the",
"users",
"list",
"of",
"friends"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1067-L1106 |
53,226 | neighbordog/deviantart | deviantart/api.py | Api.get_statuses | def get_statuses(self, username, offset=0, limit=10):
"""Fetch status updates of a user
:param username: The username you want to get a list of status updates from
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/user/s... | python | def get_statuses(self, username, offset=0, limit=10):
"""Fetch status updates of a user
:param username: The username you want to get a list of status updates from
:param offset: the pagination offset
:param limit: the pagination limit
"""
response = self._req('/user/s... | [
"def",
"get_statuses",
"(",
"self",
",",
"username",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/user/statuses/'",
",",
"{",
"\"username\"",
":",
"username",
",",
"'offset'",
":",
"offset",
... | Fetch status updates of a user
:param username: The username you want to get a list of status updates from
:param offset: the pagination offset
:param limit: the pagination limit | [
"Fetch",
"status",
"updates",
"of",
"a",
"user"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1110-L1136 |
53,227 | neighbordog/deviantart | deviantart/api.py | Api.get_status | def get_status(self, statusid):
"""Fetch the status
:param statusid: Status uuid
"""
response = self._req('/user/statuses/{}'.format(statusid))
s = Status()
s.from_dict(response)
return s | python | def get_status(self, statusid):
"""Fetch the status
:param statusid: Status uuid
"""
response = self._req('/user/statuses/{}'.format(statusid))
s = Status()
s.from_dict(response)
return s | [
"def",
"get_status",
"(",
"self",
",",
"statusid",
")",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/user/statuses/{}'",
".",
"format",
"(",
"statusid",
")",
")",
"s",
"=",
"Status",
"(",
")",
"s",
".",
"from_dict",
"(",
"response",
")",
"return"... | Fetch the status
:param statusid: Status uuid | [
"Fetch",
"the",
"status"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1140-L1152 |
53,228 | neighbordog/deviantart | deviantart/api.py | Api.post_status | def post_status(self, body="", id="", parentid="", stashid=""):
"""Post a status
:param username: The body of the status
:param id: The id of the object you wish to share
:param parentid: The parentid of the object you wish to share
:param stashid: The stashid of the object you... | python | def post_status(self, body="", id="", parentid="", stashid=""):
"""Post a status
:param username: The body of the status
:param id: The id of the object you wish to share
:param parentid: The parentid of the object you wish to share
:param stashid: The stashid of the object you... | [
"def",
"post_status",
"(",
"self",
",",
"body",
"=",
"\"\"",
",",
"id",
"=",
"\"\"",
",",
"parentid",
"=",
"\"\"",
",",
"stashid",
"=",
"\"\"",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"Devi... | Post a status
:param username: The body of the status
:param id: The id of the object you wish to share
:param parentid: The parentid of the object you wish to share
:param stashid: The stashid of the object you wish to add to the status | [
"Post",
"a",
"status"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1156-L1176 |
53,229 | neighbordog/deviantart | deviantart/api.py | Api.get_data | def get_data(self, endpoint="privacy"):
"""Returns policies of DeviantArt"""
if endpoint == "privacy":
response = self._req('/data/privacy')
elif endpoint == "submission":
response = self._req('/data/submission')
elif endpoint == "tos":
response = se... | python | def get_data(self, endpoint="privacy"):
"""Returns policies of DeviantArt"""
if endpoint == "privacy":
response = self._req('/data/privacy')
elif endpoint == "submission":
response = self._req('/data/submission')
elif endpoint == "tos":
response = se... | [
"def",
"get_data",
"(",
"self",
",",
"endpoint",
"=",
"\"privacy\"",
")",
":",
"if",
"endpoint",
"==",
"\"privacy\"",
":",
"response",
"=",
"self",
".",
"_req",
"(",
"'/data/privacy'",
")",
"elif",
"endpoint",
"==",
"\"submission\"",
":",
"response",
"=",
... | Returns policies of DeviantArt | [
"Returns",
"policies",
"of",
"DeviantArt"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1192-L1205 |
53,230 | neighbordog/deviantart | deviantart/api.py | Api.get_messages | def get_messages(self, folderid="", stack=1, cursor=""):
"""Feed of all messages
:param folderid: The folder to fetch messages from, defaults to inbox
:param stack: True to use stacked mode, false to use flat mode
"""
if self.standard_grant_type is not "authorization_code":
... | python | def get_messages(self, folderid="", stack=1, cursor=""):
"""Feed of all messages
:param folderid: The folder to fetch messages from, defaults to inbox
:param stack: True to use stacked mode, false to use flat mode
"""
if self.standard_grant_type is not "authorization_code":
... | [
"def",
"get_messages",
"(",
"self",
",",
"folderid",
"=",
"\"\"",
",",
"stack",
"=",
"1",
",",
"cursor",
"=",
"\"\"",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authenti... | Feed of all messages
:param folderid: The folder to fetch messages from, defaults to inbox
:param stack: True to use stacked mode, false to use flat mode | [
"Feed",
"of",
"all",
"messages"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1324-L1354 |
53,231 | neighbordog/deviantart | deviantart/api.py | Api.delete_message | def delete_message(self, messageid="", folderid="", stackid=""):
"""Delete a message or a message stack
:param folderid: The folder to delete the message from, defaults to inbox
:param messageid: The message to delete
:param stackid: The stack to delete
"""
if self.sta... | python | def delete_message(self, messageid="", folderid="", stackid=""):
"""Delete a message or a message stack
:param folderid: The folder to delete the message from, defaults to inbox
:param messageid: The message to delete
:param stackid: The stack to delete
"""
if self.sta... | [
"def",
"delete_message",
"(",
"self",
",",
"messageid",
"=",
"\"\"",
",",
"folderid",
"=",
"\"\"",
",",
"stackid",
"=",
"\"\"",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"... | Delete a message or a message stack
:param folderid: The folder to delete the message from, defaults to inbox
:param messageid: The message to delete
:param stackid: The stack to delete | [
"Delete",
"a",
"message",
"or",
"a",
"message",
"stack"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1358-L1376 |
53,232 | neighbordog/deviantart | deviantart/api.py | Api.get_feedback | def get_feedback(self, feedbacktype="comments", folderid="", stack=1, offset=0, limit=10):
"""Fetch feedback messages
:param feedbacktype: Type of feedback messages to fetch (comments/replies/activity)
:param folderid: The folder to fetch messages from, defaults to inbox
:param stack: ... | python | def get_feedback(self, feedbacktype="comments", folderid="", stack=1, offset=0, limit=10):
"""Fetch feedback messages
:param feedbacktype: Type of feedback messages to fetch (comments/replies/activity)
:param folderid: The folder to fetch messages from, defaults to inbox
:param stack: ... | [
"def",
"get_feedback",
"(",
"self",
",",
"feedbacktype",
"=",
"\"comments\"",
",",
"folderid",
"=",
"\"\"",
",",
"stack",
"=",
"1",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"au... | Fetch feedback messages
:param feedbacktype: Type of feedback messages to fetch (comments/replies/activity)
:param folderid: The folder to fetch messages from, defaults to inbox
:param stack: True to use stacked mode, false to use flat mode
:param offset: the pagination offset
:... | [
"Fetch",
"feedback",
"messages"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1380-L1415 |
53,233 | neighbordog/deviantart | deviantart/api.py | Api.get_feedback_in_stack | def get_feedback_in_stack(self, stackid, offset=0, limit=10):
"""Fetch feedback messages in a stack
:param stackid: Id of the stack
:param offset: the pagination offset
:param limit: the pagination limit
"""
if self.standard_grant_type is not "authorization_code":
... | python | def get_feedback_in_stack(self, stackid, offset=0, limit=10):
"""Fetch feedback messages in a stack
:param stackid: Id of the stack
:param offset: the pagination offset
:param limit: the pagination limit
"""
if self.standard_grant_type is not "authorization_code":
... | [
"def",
"get_feedback_in_stack",
"(",
"self",
",",
"stackid",
",",
"offset",
"=",
"0",
",",
"limit",
"=",
"10",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication thro... | Fetch feedback messages in a stack
:param stackid: Id of the stack
:param offset: the pagination offset
:param limit: the pagination limit | [
"Fetch",
"feedback",
"messages",
"in",
"a",
"stack"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1419-L1449 |
53,234 | neighbordog/deviantart | deviantart/api.py | Api.get_note | def get_note(self, noteid):
"""Fetch a single note
:param folderid: The UUID of the note
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order to connect to this endpo... | python | def get_note(self, noteid):
"""Fetch a single note
:param folderid: The UUID of the note
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order to connect to this endpo... | [
"def",
"get_note",
"(",
"self",
",",
"noteid",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required in order to connect to this endp... | Fetch a single note
:param folderid: The UUID of the note | [
"Fetch",
"a",
"single",
"note"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1574-L1586 |
53,235 | neighbordog/deviantart | deviantart/api.py | Api.send_note | def send_note(self, to, subject="", body="", noetid=""):
"""Send a note
:param to: The username(s) that this note is to
:param subject: The subject of the note
:param body: The body of the note
:param noetid: The UUID of the note that is being responded to
"""
... | python | def send_note(self, to, subject="", body="", noetid=""):
"""Send a note
:param to: The username(s) that this note is to
:param subject: The subject of the note
:param body: The body of the note
:param noetid: The UUID of the note that is being responded to
"""
... | [
"def",
"send_note",
"(",
"self",
",",
"to",
",",
"subject",
"=",
"\"\"",
",",
"body",
"=",
"\"\"",
",",
"noetid",
"=",
"\"\"",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
... | Send a note
:param to: The username(s) that this note is to
:param subject: The subject of the note
:param body: The body of the note
:param noetid: The UUID of the note that is being responded to | [
"Send",
"a",
"note"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1590-L1620 |
53,236 | neighbordog/deviantart | deviantart/api.py | Api.move_notes | def move_notes(self, noteids, folderid):
"""Move notes to a folder
:param noteids: The noteids to move
:param folderid: The folderid to move notes to
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authoriz... | python | def move_notes(self, noteids, folderid):
"""Move notes to a folder
:param noteids: The noteids to move
:param folderid: The folderid to move notes to
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authoriz... | [
"def",
"move_notes",
"(",
"self",
",",
"noteids",
",",
"folderid",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required in order... | Move notes to a folder
:param noteids: The noteids to move
:param folderid: The folderid to move notes to | [
"Move",
"notes",
"to",
"a",
"folder"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1624-L1640 |
53,237 | neighbordog/deviantart | deviantart/api.py | Api.delete_notes | def delete_notes(self, noteids):
"""Delete a note or notes
:param noteids: The noteids to delete
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order to connect to th... | python | def delete_notes(self, noteids):
"""Delete a note or notes
:param noteids: The noteids to delete
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order to connect to th... | [
"def",
"delete_notes",
"(",
"self",
",",
"noteids",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required in order to connect to this... | Delete a note or notes
:param noteids: The noteids to delete | [
"Delete",
"a",
"note",
"or",
"notes"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1644-L1658 |
53,238 | neighbordog/deviantart | deviantart/api.py | Api.rename_notes_folder | def rename_notes_folder(self, title, folderid):
"""Rename a folder
:param title: New title of the folder
:param folderid: The UUID of the folder to rename
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Aut... | python | def rename_notes_folder(self, title, folderid):
"""Rename a folder
:param title: New title of the folder
:param folderid: The UUID of the folder to rename
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Aut... | [
"def",
"rename_notes_folder",
"(",
"self",
",",
"title",
",",
"folderid",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required i... | Rename a folder
:param title: New title of the folder
:param folderid: The UUID of the folder to rename | [
"Rename",
"a",
"folder"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1715-L1730 |
53,239 | neighbordog/deviantart | deviantart/api.py | Api.delete_notes_folder | def delete_notes_folder(self, folderid):
"""Delete note folder
:param folderid: The UUID of the folder to delete
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order ... | python | def delete_notes_folder(self, folderid):
"""Delete note folder
:param folderid: The UUID of the folder to delete
"""
if self.standard_grant_type is not "authorization_code":
raise DeviantartError("Authentication through Authorization Code (Grant Type) is required in order ... | [
"def",
"delete_notes_folder",
"(",
"self",
",",
"folderid",
")",
":",
"if",
"self",
".",
"standard_grant_type",
"is",
"not",
"\"authorization_code\"",
":",
"raise",
"DeviantartError",
"(",
"\"Authentication through Authorization Code (Grant Type) is required in order to connect... | Delete note folder
:param folderid: The UUID of the folder to delete | [
"Delete",
"note",
"folder"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1734-L1746 |
53,240 | neighbordog/deviantart | deviantart/api.py | Api._req | def _req(self, endpoint, get_data=dict(), post_data=dict()):
"""Helper method to make API calls
:param endpoint: The endpoint to make the API call to
:param get_data: data send through GET
:param post_data: data send through POST
"""
if get_data:
request_pa... | python | def _req(self, endpoint, get_data=dict(), post_data=dict()):
"""Helper method to make API calls
:param endpoint: The endpoint to make the API call to
:param get_data: data send through GET
:param post_data: data send through POST
"""
if get_data:
request_pa... | [
"def",
"_req",
"(",
"self",
",",
"endpoint",
",",
"get_data",
"=",
"dict",
"(",
")",
",",
"post_data",
"=",
"dict",
"(",
")",
")",
":",
"if",
"get_data",
":",
"request_parameter",
"=",
"\"{}?{}\"",
".",
"format",
"(",
"endpoint",
",",
"urlencode",
"(",... | Helper method to make API calls
:param endpoint: The endpoint to make the API call to
:param get_data: data send through GET
:param post_data: data send through POST | [
"Helper",
"method",
"to",
"make",
"API",
"calls"
] | 5612f1d5e2139a48c9d793d7fd19cde7e162d7b1 | https://github.com/neighbordog/deviantart/blob/5612f1d5e2139a48c9d793d7fd19cde7e162d7b1/deviantart/api.py#L1750-L1771 |
53,241 | Rediker-Software/doac | doac/models.py | AuthorizationToken.revoke_tokens | def revoke_tokens(self):
"""
Revoke the authorization token and all tokens that were generated using it.
"""
self.is_active = False
self.save()
self.refresh_token.revoke_tokens() | python | def revoke_tokens(self):
"""
Revoke the authorization token and all tokens that were generated using it.
"""
self.is_active = False
self.save()
self.refresh_token.revoke_tokens() | [
"def",
"revoke_tokens",
"(",
"self",
")",
":",
"self",
".",
"is_active",
"=",
"False",
"self",
".",
"save",
"(",
")",
"self",
".",
"refresh_token",
".",
"revoke_tokens",
"(",
")"
] | Revoke the authorization token and all tokens that were generated using it. | [
"Revoke",
"the",
"authorization",
"token",
"and",
"all",
"tokens",
"that",
"were",
"generated",
"using",
"it",
"."
] | 398fdd64452e4ff8662297b0381926addd77505a | https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/models.py#L145-L153 |
53,242 | Rediker-Software/doac | doac/models.py | RefreshToken.revoke_tokens | def revoke_tokens(self):
"""
Revokes the refresh token and all access tokens that were generated using it.
"""
self.is_active = False
self.save()
for access_token in self.access_tokens.all():
access_token.revoke() | python | def revoke_tokens(self):
"""
Revokes the refresh token and all access tokens that were generated using it.
"""
self.is_active = False
self.save()
for access_token in self.access_tokens.all():
access_token.revoke() | [
"def",
"revoke_tokens",
"(",
"self",
")",
":",
"self",
".",
"is_active",
"=",
"False",
"self",
".",
"save",
"(",
")",
"for",
"access_token",
"in",
"self",
".",
"access_tokens",
".",
"all",
"(",
")",
":",
"access_token",
".",
"revoke",
"(",
")"
] | Revokes the refresh token and all access tokens that were generated using it. | [
"Revokes",
"the",
"refresh",
"token",
"and",
"all",
"access",
"tokens",
"that",
"were",
"generated",
"using",
"it",
"."
] | 398fdd64452e4ff8662297b0381926addd77505a | https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/models.py#L242-L251 |
53,243 | richardcornish/django-applepodcast | podcast/feeds.py | ItunesFeed.write | def write(self, outfile, encoding):
"""Method override to create self-closing elements.
https://docs.djangoproject.com/en/2.0/ref/utils/#django.utils.feedgenerator.SyndicationFeed.write
https://github.com/django/django/blob/2.0/django/utils/feedgenerator.py#L216
"""
try:
... | python | def write(self, outfile, encoding):
"""Method override to create self-closing elements.
https://docs.djangoproject.com/en/2.0/ref/utils/#django.utils.feedgenerator.SyndicationFeed.write
https://github.com/django/django/blob/2.0/django/utils/feedgenerator.py#L216
"""
try:
... | [
"def",
"write",
"(",
"self",
",",
"outfile",
",",
"encoding",
")",
":",
"try",
":",
"handler",
"=",
"EscapeFriendlyXMLGenerator",
"(",
"outfile",
",",
"encoding",
",",
"short_empty_elements",
"=",
"True",
")",
"except",
"TypeError",
":",
"# Python 2",
"handler... | Method override to create self-closing elements.
https://docs.djangoproject.com/en/2.0/ref/utils/#django.utils.feedgenerator.SyndicationFeed.write
https://github.com/django/django/blob/2.0/django/utils/feedgenerator.py#L216 | [
"Method",
"override",
"to",
"create",
"self",
"-",
"closing",
"elements",
"."
] | 50732acfbe1ca258e5afb44c117a6ac5fa0c1219 | https://github.com/richardcornish/django-applepodcast/blob/50732acfbe1ca258e5afb44c117a6ac5fa0c1219/podcast/feeds.py#L16-L32 |
53,244 | Rediker-Software/doac | doac/middleware.py | AuthenticationMiddleware.process_request | def process_request(self, request):
"""
Try to authenticate the user based on any given tokens that have been provided
to the request object. This will try to detect the authentication type and assign
the detected User object to the `request.user` variable, similar to the standard
... | python | def process_request(self, request):
"""
Try to authenticate the user based on any given tokens that have been provided
to the request object. This will try to detect the authentication type and assign
the detected User object to the `request.user` variable, similar to the standard
... | [
"def",
"process_request",
"(",
"self",
",",
"request",
")",
":",
"request",
".",
"auth_type",
"=",
"None",
"http_authorization",
"=",
"request",
".",
"META",
".",
"get",
"(",
"\"HTTP_AUTHORIZATION\"",
",",
"None",
")",
"if",
"not",
"http_authorization",
":",
... | Try to authenticate the user based on any given tokens that have been provided
to the request object. This will try to detect the authentication type and assign
the detected User object to the `request.user` variable, similar to the standard
Django authentication. | [
"Try",
"to",
"authenticate",
"the",
"user",
"based",
"on",
"any",
"given",
"tokens",
"that",
"have",
"been",
"provided",
"to",
"the",
"request",
"object",
".",
"This",
"will",
"try",
"to",
"detect",
"the",
"authentication",
"type",
"and",
"assign",
"the",
... | 398fdd64452e4ff8662297b0381926addd77505a | https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/middleware.py#L8-L43 |
53,245 | Rediker-Software/doac | doac/middleware.py | AuthenticationMiddleware.load_handler | def load_handler(self):
"""
Load the detected handler.
"""
handler_path = self.handler_name.split(".")
handler_module = __import__(".".join(handler_path[:-1]), {}, {}, str(handler_path[-1]))
self.handler = getattr(handler_module, handler_path[-1])() | python | def load_handler(self):
"""
Load the detected handler.
"""
handler_path = self.handler_name.split(".")
handler_module = __import__(".".join(handler_path[:-1]), {}, {}, str(handler_path[-1]))
self.handler = getattr(handler_module, handler_path[-1])() | [
"def",
"load_handler",
"(",
"self",
")",
":",
"handler_path",
"=",
"self",
".",
"handler_name",
".",
"split",
"(",
"\".\"",
")",
"handler_module",
"=",
"__import__",
"(",
"\".\"",
".",
"join",
"(",
"handler_path",
"[",
":",
"-",
"1",
"]",
")",
",",
"{"... | Load the detected handler. | [
"Load",
"the",
"detected",
"handler",
"."
] | 398fdd64452e4ff8662297b0381926addd77505a | https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/middleware.py#L45-L53 |
53,246 | Rediker-Software/doac | doac/middleware.py | AuthenticationMiddleware.validate_auth_type | def validate_auth_type(self):
"""
Validate the detected authorization type against the list of handlers. This will return the full
module path to the detected handler.
"""
for handler in HANDLERS:
handler_type = handler.split(".")[-2]
if han... | python | def validate_auth_type(self):
"""
Validate the detected authorization type against the list of handlers. This will return the full
module path to the detected handler.
"""
for handler in HANDLERS:
handler_type = handler.split(".")[-2]
if han... | [
"def",
"validate_auth_type",
"(",
"self",
")",
":",
"for",
"handler",
"in",
"HANDLERS",
":",
"handler_type",
"=",
"handler",
".",
"split",
"(",
"\".\"",
")",
"[",
"-",
"2",
"]",
"if",
"handler_type",
"==",
"self",
".",
"auth_type",
":",
"self",
".",
"h... | Validate the detected authorization type against the list of handlers. This will return the full
module path to the detected handler. | [
"Validate",
"the",
"detected",
"authorization",
"type",
"against",
"the",
"list",
"of",
"handlers",
".",
"This",
"will",
"return",
"the",
"full",
"module",
"path",
"to",
"the",
"detected",
"handler",
"."
] | 398fdd64452e4ff8662297b0381926addd77505a | https://github.com/Rediker-Software/doac/blob/398fdd64452e4ff8662297b0381926addd77505a/doac/middleware.py#L55-L69 |
53,247 | richardcornish/django-applepodcast | podcast/templatetags/podcast_tags.py | show_url | def show_url(context, **kwargs):
"""Return the show feed URL with different protocol."""
if len(kwargs) != 2:
raise TemplateSyntaxError(_('"show_url" tag takes exactly two keyword arguments.'))
request = context['request']
current_site = get_current_site(request)
url = add_domain(current_sit... | python | def show_url(context, **kwargs):
"""Return the show feed URL with different protocol."""
if len(kwargs) != 2:
raise TemplateSyntaxError(_('"show_url" tag takes exactly two keyword arguments.'))
request = context['request']
current_site = get_current_site(request)
url = add_domain(current_sit... | [
"def",
"show_url",
"(",
"context",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"kwargs",
")",
"!=",
"2",
":",
"raise",
"TemplateSyntaxError",
"(",
"_",
"(",
"'\"show_url\" tag takes exactly two keyword arguments.'",
")",
")",
"request",
"=",
"context"... | Return the show feed URL with different protocol. | [
"Return",
"the",
"show",
"feed",
"URL",
"with",
"different",
"protocol",
"."
] | 50732acfbe1ca258e5afb44c117a6ac5fa0c1219 | https://github.com/richardcornish/django-applepodcast/blob/50732acfbe1ca258e5afb44c117a6ac5fa0c1219/podcast/templatetags/podcast_tags.py#L17-L24 |
53,248 | jumpscale7/python-consistent-toml | contoml/__init__.py | loads | def loads(text):
"""
Parses TOML text into a dict-like object and returns it.
"""
from prettytoml.parser import parse_tokens
from prettytoml.lexer import tokenize as lexer
from .file import TOMLFile
tokens = tuple(lexer(text, is_top_level=True))
elements = parse_tokens(tokens)
retur... | python | def loads(text):
"""
Parses TOML text into a dict-like object and returns it.
"""
from prettytoml.parser import parse_tokens
from prettytoml.lexer import tokenize as lexer
from .file import TOMLFile
tokens = tuple(lexer(text, is_top_level=True))
elements = parse_tokens(tokens)
retur... | [
"def",
"loads",
"(",
"text",
")",
":",
"from",
"prettytoml",
".",
"parser",
"import",
"parse_tokens",
"from",
"prettytoml",
".",
"lexer",
"import",
"tokenize",
"as",
"lexer",
"from",
".",
"file",
"import",
"TOMLFile",
"tokens",
"=",
"tuple",
"(",
"lexer",
... | Parses TOML text into a dict-like object and returns it. | [
"Parses",
"TOML",
"text",
"into",
"a",
"dict",
"-",
"like",
"object",
"and",
"returns",
"it",
"."
] | a0149c65313ccb8170aa99a0cc498e76231292b9 | https://github.com/jumpscale7/python-consistent-toml/blob/a0149c65313ccb8170aa99a0cc498e76231292b9/contoml/__init__.py#L6-L16 |
53,249 | jumpscale7/python-consistent-toml | contoml/__init__.py | dumps | def dumps(value):
"""
Dumps a data structure to TOML source code.
The given value must be either a dict of dict values, a dict, or a TOML file constructed by this module.
"""
from contoml.file.file import TOMLFile
if not isinstance(value, TOMLFile):
raise RuntimeError("Can only dump a... | python | def dumps(value):
"""
Dumps a data structure to TOML source code.
The given value must be either a dict of dict values, a dict, or a TOML file constructed by this module.
"""
from contoml.file.file import TOMLFile
if not isinstance(value, TOMLFile):
raise RuntimeError("Can only dump a... | [
"def",
"dumps",
"(",
"value",
")",
":",
"from",
"contoml",
".",
"file",
".",
"file",
"import",
"TOMLFile",
"if",
"not",
"isinstance",
"(",
"value",
",",
"TOMLFile",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Can only dump a TOMLFile instance loaded by load() or lo... | Dumps a data structure to TOML source code.
The given value must be either a dict of dict values, a dict, or a TOML file constructed by this module. | [
"Dumps",
"a",
"data",
"structure",
"to",
"TOML",
"source",
"code",
"."
] | a0149c65313ccb8170aa99a0cc498e76231292b9 | https://github.com/jumpscale7/python-consistent-toml/blob/a0149c65313ccb8170aa99a0cc498e76231292b9/contoml/__init__.py#L26-L38 |
53,250 | jumpscale7/python-consistent-toml | contoml/__init__.py | dump | def dump(obj, file_path, prettify=False):
"""
Dumps a data structure to the filesystem as TOML.
The given value must be either a dict of dict values, a dict, or a TOML file constructed by this module.
"""
with open(file_path, 'w') as fp:
fp.write(dumps(obj)) | python | def dump(obj, file_path, prettify=False):
"""
Dumps a data structure to the filesystem as TOML.
The given value must be either a dict of dict values, a dict, or a TOML file constructed by this module.
"""
with open(file_path, 'w') as fp:
fp.write(dumps(obj)) | [
"def",
"dump",
"(",
"obj",
",",
"file_path",
",",
"prettify",
"=",
"False",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"'w'",
")",
"as",
"fp",
":",
"fp",
".",
"write",
"(",
"dumps",
"(",
"obj",
")",
")"
] | Dumps a data structure to the filesystem as TOML.
The given value must be either a dict of dict values, a dict, or a TOML file constructed by this module. | [
"Dumps",
"a",
"data",
"structure",
"to",
"the",
"filesystem",
"as",
"TOML",
"."
] | a0149c65313ccb8170aa99a0cc498e76231292b9 | https://github.com/jumpscale7/python-consistent-toml/blob/a0149c65313ccb8170aa99a0cc498e76231292b9/contoml/__init__.py#L41-L48 |
53,251 | akarat/exchange | exchange.py | rate | def rate(base, target, error_log=None):
"""Get current exchange rate.
:param base: A base currency
:param target: Convert to the target currency
:param error_log: A callable function to track the exception
It parses current exchange rate from these services:
1) Yahoo finance
2) fi... | python | def rate(base, target, error_log=None):
"""Get current exchange rate.
:param base: A base currency
:param target: Convert to the target currency
:param error_log: A callable function to track the exception
It parses current exchange rate from these services:
1) Yahoo finance
2) fi... | [
"def",
"rate",
"(",
"base",
",",
"target",
",",
"error_log",
"=",
"None",
")",
":",
"if",
"base",
"==",
"target",
":",
"return",
"decimal",
".",
"Decimal",
"(",
"1.00",
")",
"services",
"=",
"[",
"yahoo",
",",
"fixer",
",",
"ecb",
"]",
"if",
"error... | Get current exchange rate.
:param base: A base currency
:param target: Convert to the target currency
:param error_log: A callable function to track the exception
It parses current exchange rate from these services:
1) Yahoo finance
2) fixer.io
3) European Central Bank
It... | [
"Get",
"current",
"exchange",
"rate",
"."
] | 36d5246b4b5bd57b72f6f1d54aedcb983368c328 | https://github.com/akarat/exchange/blob/36d5246b4b5bd57b72f6f1d54aedcb983368c328/exchange.py#L24-L57 |
53,252 | akarat/exchange | exchange.py | yahoo | def yahoo(base, target):
"""Parse data from Yahoo."""
api_url = 'http://download.finance.yahoo.com/d/quotes.csv'
resp = requests.get(
api_url,
params={
'e': '.csv',
'f': 'sl1d1t1',
's': '{0}{1}=X'.format(base, target)
},
timeout=1,
)
... | python | def yahoo(base, target):
"""Parse data from Yahoo."""
api_url = 'http://download.finance.yahoo.com/d/quotes.csv'
resp = requests.get(
api_url,
params={
'e': '.csv',
'f': 'sl1d1t1',
's': '{0}{1}=X'.format(base, target)
},
timeout=1,
)
... | [
"def",
"yahoo",
"(",
"base",
",",
"target",
")",
":",
"api_url",
"=",
"'http://download.finance.yahoo.com/d/quotes.csv'",
"resp",
"=",
"requests",
".",
"get",
"(",
"api_url",
",",
"params",
"=",
"{",
"'e'",
":",
"'.csv'",
",",
"'f'",
":",
"'sl1d1t1'",
",",
... | Parse data from Yahoo. | [
"Parse",
"data",
"from",
"Yahoo",
"."
] | 36d5246b4b5bd57b72f6f1d54aedcb983368c328 | https://github.com/akarat/exchange/blob/36d5246b4b5bd57b72f6f1d54aedcb983368c328/exchange.py#L64-L77 |
53,253 | akarat/exchange | exchange.py | fixer | def fixer(base, target):
"""Parse data from fixer.io."""
api_url = 'http://api.fixer.io/latest'
resp = requests.get(
api_url,
params={
'base': base,
'symbols': target,
},
timeout=1,
)
data = resp.json()
return decimal.Decimal(data['rates'][... | python | def fixer(base, target):
"""Parse data from fixer.io."""
api_url = 'http://api.fixer.io/latest'
resp = requests.get(
api_url,
params={
'base': base,
'symbols': target,
},
timeout=1,
)
data = resp.json()
return decimal.Decimal(data['rates'][... | [
"def",
"fixer",
"(",
"base",
",",
"target",
")",
":",
"api_url",
"=",
"'http://api.fixer.io/latest'",
"resp",
"=",
"requests",
".",
"get",
"(",
"api_url",
",",
"params",
"=",
"{",
"'base'",
":",
"base",
",",
"'symbols'",
":",
"target",
",",
"}",
",",
"... | Parse data from fixer.io. | [
"Parse",
"data",
"from",
"fixer",
".",
"io",
"."
] | 36d5246b4b5bd57b72f6f1d54aedcb983368c328 | https://github.com/akarat/exchange/blob/36d5246b4b5bd57b72f6f1d54aedcb983368c328/exchange.py#L80-L92 |
53,254 | akarat/exchange | exchange.py | ecb | def ecb(base, target):
"""Parse data from European Central Bank."""
api_url = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'
resp = requests.get(api_url, timeout=1)
text = resp.text
def _find_rate(symbol):
if symbol == 'EUR':
return decimal.Decimal(1.00)
... | python | def ecb(base, target):
"""Parse data from European Central Bank."""
api_url = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'
resp = requests.get(api_url, timeout=1)
text = resp.text
def _find_rate(symbol):
if symbol == 'EUR':
return decimal.Decimal(1.00)
... | [
"def",
"ecb",
"(",
"base",
",",
"target",
")",
":",
"api_url",
"=",
"'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'",
"resp",
"=",
"requests",
".",
"get",
"(",
"api_url",
",",
"timeout",
"=",
"1",
")",
"text",
"=",
"resp",
".",
"text",
"def",
... | Parse data from European Central Bank. | [
"Parse",
"data",
"from",
"European",
"Central",
"Bank",
"."
] | 36d5246b4b5bd57b72f6f1d54aedcb983368c328 | https://github.com/akarat/exchange/blob/36d5246b4b5bd57b72f6f1d54aedcb983368c328/exchange.py#L95-L107 |
53,255 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | dot | def dot(vec1, vec2):
"""Returns the dot product of two Vectors"""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3):
return (vec1.x * vec2.x) + (vec1.y * vec2.y) + (vec1.z * vec2.z)
elif isinstance(vec1, Vector4) and isinstance(vec2, Vector4):
return (vec1.x * vec2.x) + (vec1.y * ve... | python | def dot(vec1, vec2):
"""Returns the dot product of two Vectors"""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3):
return (vec1.x * vec2.x) + (vec1.y * vec2.y) + (vec1.z * vec2.z)
elif isinstance(vec1, Vector4) and isinstance(vec2, Vector4):
return (vec1.x * vec2.x) + (vec1.y * ve... | [
"def",
"dot",
"(",
"vec1",
",",
"vec2",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector3",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector3",
")",
":",
"return",
"(",
"vec1",
".",
"x",
"*",
"vec2",
".",
"x",
")",
"+",
"(",
"vec1",
"... | Returns the dot product of two Vectors | [
"Returns",
"the",
"dot",
"product",
"of",
"two",
"Vectors"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L730-L737 |
53,256 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | angle | def angle(vec1, vec2):
"""Returns the angle between two vectors"""
dot_vec = dot(vec1, vec2)
mag1 = vec1.length()
mag2 = vec2.length()
result = dot_vec / (mag1 * mag2)
return math.acos(result) | python | def angle(vec1, vec2):
"""Returns the angle between two vectors"""
dot_vec = dot(vec1, vec2)
mag1 = vec1.length()
mag2 = vec2.length()
result = dot_vec / (mag1 * mag2)
return math.acos(result) | [
"def",
"angle",
"(",
"vec1",
",",
"vec2",
")",
":",
"dot_vec",
"=",
"dot",
"(",
"vec1",
",",
"vec2",
")",
"mag1",
"=",
"vec1",
".",
"length",
"(",
")",
"mag2",
"=",
"vec2",
".",
"length",
"(",
")",
"result",
"=",
"dot_vec",
"/",
"(",
"mag1",
"*... | Returns the angle between two vectors | [
"Returns",
"the",
"angle",
"between",
"two",
"vectors"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L746-L752 |
53,257 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | project | def project(vec1, vec2):
"""Project vector1 onto vector2."""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3) \
or isinstance(vec1, Vector4) and isinstance(vec2, Vector4):
return dot(vec1, vec2) / vec2.length() * vec2.normalize_copy()
else:
raise ValueError("vec1 and ve... | python | def project(vec1, vec2):
"""Project vector1 onto vector2."""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3) \
or isinstance(vec1, Vector4) and isinstance(vec2, Vector4):
return dot(vec1, vec2) / vec2.length() * vec2.normalize_copy()
else:
raise ValueError("vec1 and ve... | [
"def",
"project",
"(",
"vec1",
",",
"vec2",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector3",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector3",
")",
"or",
"isinstance",
"(",
"vec1",
",",
"Vector4",
")",
"and",
"isinstance",
"(",
"vec2",
... | Project vector1 onto vector2. | [
"Project",
"vector1",
"onto",
"vector2",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L755-L761 |
53,258 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | component_add | def component_add(vec1, vec2):
"""Add each of the components of vec1 and vec2 together and return a new vector."""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3):
addVec = Vector3()
addVec.x = vec1.x + vec2.x
addVec.y = vec1.y + vec2.y
addVec.z = vec1.z + vec2.z
... | python | def component_add(vec1, vec2):
"""Add each of the components of vec1 and vec2 together and return a new vector."""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3):
addVec = Vector3()
addVec.x = vec1.x + vec2.x
addVec.y = vec1.y + vec2.y
addVec.z = vec1.z + vec2.z
... | [
"def",
"component_add",
"(",
"vec1",
",",
"vec2",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector3",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector3",
")",
":",
"addVec",
"=",
"Vector3",
"(",
")",
"addVec",
".",
"x",
"=",
"vec1",
".",
... | Add each of the components of vec1 and vec2 together and return a new vector. | [
"Add",
"each",
"of",
"the",
"components",
"of",
"vec1",
"and",
"vec2",
"together",
"and",
"return",
"a",
"new",
"vector",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L764-L779 |
53,259 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | reflect | def reflect(vec1, vec2):
"""Take vec1 and reflect it about vec2."""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3) \
or isinstance(vec1, Vector4) and isinstance(vec2, Vector4):
return 2 * dot(vec1, vec2) * vec2 - vec2
else:
raise ValueError("vec1 and vec2 must both be... | python | def reflect(vec1, vec2):
"""Take vec1 and reflect it about vec2."""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3) \
or isinstance(vec1, Vector4) and isinstance(vec2, Vector4):
return 2 * dot(vec1, vec2) * vec2 - vec2
else:
raise ValueError("vec1 and vec2 must both be... | [
"def",
"reflect",
"(",
"vec1",
",",
"vec2",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector3",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector3",
")",
"or",
"isinstance",
"(",
"vec1",
",",
"Vector4",
")",
"and",
"isinstance",
"(",
"vec2",
... | Take vec1 and reflect it about vec2. | [
"Take",
"vec1",
"and",
"reflect",
"it",
"about",
"vec2",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L782-L788 |
53,260 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.copy | def copy(self):
"""Create a copy of this Vector"""
new_vec = Vector2()
new_vec.X = self.X
new_vec.Y = self.Y
return new_vec | python | def copy(self):
"""Create a copy of this Vector"""
new_vec = Vector2()
new_vec.X = self.X
new_vec.Y = self.Y
return new_vec | [
"def",
"copy",
"(",
"self",
")",
":",
"new_vec",
"=",
"Vector2",
"(",
")",
"new_vec",
".",
"X",
"=",
"self",
".",
"X",
"new_vec",
".",
"Y",
"=",
"self",
".",
"Y",
"return",
"new_vec"
] | Create a copy of this Vector | [
"Create",
"a",
"copy",
"of",
"this",
"Vector"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L167-L172 |
53,261 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.length | def length(self):
"""Gets the length of this Vector"""
return math.sqrt((self.X * self.X) + (self.Y * self.Y)) | python | def length(self):
"""Gets the length of this Vector"""
return math.sqrt((self.X * self.X) + (self.Y * self.Y)) | [
"def",
"length",
"(",
"self",
")",
":",
"return",
"math",
".",
"sqrt",
"(",
"(",
"self",
".",
"X",
"*",
"self",
".",
"X",
")",
"+",
"(",
"self",
".",
"Y",
"*",
"self",
".",
"Y",
")",
")"
] | Gets the length of this Vector | [
"Gets",
"the",
"length",
"of",
"this",
"Vector"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L174-L176 |
53,262 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.distance | def distance(vec1, vec2):
"""Calculate the distance between two Vectors"""
if isinstance(vec1, Vector2) \
and isinstance(vec2, Vector2):
dist_vec = vec2 - vec1
return dist_vec.length()
else:
raise TypeError("vec1 and vec2 must be Vector2's") | python | def distance(vec1, vec2):
"""Calculate the distance between two Vectors"""
if isinstance(vec1, Vector2) \
and isinstance(vec2, Vector2):
dist_vec = vec2 - vec1
return dist_vec.length()
else:
raise TypeError("vec1 and vec2 must be Vector2's") | [
"def",
"distance",
"(",
"vec1",
",",
"vec2",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector2",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector2",
")",
":",
"dist_vec",
"=",
"vec2",
"-",
"vec1",
"return",
"dist_vec",
".",
"length",
"(",
"... | Calculate the distance between two Vectors | [
"Calculate",
"the",
"distance",
"between",
"two",
"Vectors"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L194-L201 |
53,263 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.dot | def dot(vec1, vec2):
"""Calculate the dot product between two Vectors"""
if isinstance(vec1, Vector2) \
and isinstance(vec2, Vector2):
return ((vec1.X * vec2.X) + (vec1.Y * vec2.Y))
else:
raise TypeError("vec1 and vec2 must be Vector2's") | python | def dot(vec1, vec2):
"""Calculate the dot product between two Vectors"""
if isinstance(vec1, Vector2) \
and isinstance(vec2, Vector2):
return ((vec1.X * vec2.X) + (vec1.Y * vec2.Y))
else:
raise TypeError("vec1 and vec2 must be Vector2's") | [
"def",
"dot",
"(",
"vec1",
",",
"vec2",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector2",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector2",
")",
":",
"return",
"(",
"(",
"vec1",
".",
"X",
"*",
"vec2",
".",
"X",
")",
"+",
"(",
"vec... | Calculate the dot product between two Vectors | [
"Calculate",
"the",
"dot",
"product",
"between",
"two",
"Vectors"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L204-L210 |
53,264 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.angle | def angle(vec1, vec2):
"""Calculate the angle between two Vector2's"""
dotp = Vector2.dot(vec1, vec2)
mag1 = vec1.length()
mag2 = vec2.length()
result = dotp / (mag1 * mag2)
return math.acos(result) | python | def angle(vec1, vec2):
"""Calculate the angle between two Vector2's"""
dotp = Vector2.dot(vec1, vec2)
mag1 = vec1.length()
mag2 = vec2.length()
result = dotp / (mag1 * mag2)
return math.acos(result) | [
"def",
"angle",
"(",
"vec1",
",",
"vec2",
")",
":",
"dotp",
"=",
"Vector2",
".",
"dot",
"(",
"vec1",
",",
"vec2",
")",
"mag1",
"=",
"vec1",
".",
"length",
"(",
")",
"mag2",
"=",
"vec2",
".",
"length",
"(",
")",
"result",
"=",
"dotp",
"/",
"(",
... | Calculate the angle between two Vector2's | [
"Calculate",
"the",
"angle",
"between",
"two",
"Vector2",
"s"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L213-L219 |
53,265 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.lerp | def lerp(vec1, vec2, time):
"""Lerp between vec1 to vec2 based on time. Time is clamped between 0 and 1."""
if isinstance(vec1, Vector2) \
and isinstance(vec2, Vector2):
# Clamp the time value into the 0-1 range.
if time < 0:
time = 0
e... | python | def lerp(vec1, vec2, time):
"""Lerp between vec1 to vec2 based on time. Time is clamped between 0 and 1."""
if isinstance(vec1, Vector2) \
and isinstance(vec2, Vector2):
# Clamp the time value into the 0-1 range.
if time < 0:
time = 0
e... | [
"def",
"lerp",
"(",
"vec1",
",",
"vec2",
",",
"time",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector2",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector2",
")",
":",
"# Clamp the time value into the 0-1 range.",
"if",
"time",
"<",
"0",
":",
"... | Lerp between vec1 to vec2 based on time. Time is clamped between 0 and 1. | [
"Lerp",
"between",
"vec1",
"to",
"vec2",
"based",
"on",
"time",
".",
"Time",
"is",
"clamped",
"between",
"0",
"and",
"1",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L222-L236 |
53,266 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.from_polar | def from_polar(degrees, magnitude):
"""Convert polar coordinates to Carteasian Coordinates"""
vec = Vector2()
vec.X = math.cos(math.radians(degrees)) * magnitude
# Negate because y in screen coordinates points down, oppisite from what is
# expected in traditional mathematics.
... | python | def from_polar(degrees, magnitude):
"""Convert polar coordinates to Carteasian Coordinates"""
vec = Vector2()
vec.X = math.cos(math.radians(degrees)) * magnitude
# Negate because y in screen coordinates points down, oppisite from what is
# expected in traditional mathematics.
... | [
"def",
"from_polar",
"(",
"degrees",
",",
"magnitude",
")",
":",
"vec",
"=",
"Vector2",
"(",
")",
"vec",
".",
"X",
"=",
"math",
".",
"cos",
"(",
"math",
".",
"radians",
"(",
"degrees",
")",
")",
"*",
"magnitude",
"# Negate because y in screen coordinates p... | Convert polar coordinates to Carteasian Coordinates | [
"Convert",
"polar",
"coordinates",
"to",
"Carteasian",
"Coordinates"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L239-L247 |
53,267 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.component_mul | def component_mul(vec1, vec2):
"""Multiply the components of the vectors and return the result."""
new_vec = Vector2()
new_vec.X = vec1.X * vec2.X
new_vec.Y = vec1.Y * vec2.Y
return new_vec | python | def component_mul(vec1, vec2):
"""Multiply the components of the vectors and return the result."""
new_vec = Vector2()
new_vec.X = vec1.X * vec2.X
new_vec.Y = vec1.Y * vec2.Y
return new_vec | [
"def",
"component_mul",
"(",
"vec1",
",",
"vec2",
")",
":",
"new_vec",
"=",
"Vector2",
"(",
")",
"new_vec",
".",
"X",
"=",
"vec1",
".",
"X",
"*",
"vec2",
".",
"X",
"new_vec",
".",
"Y",
"=",
"vec1",
".",
"Y",
"*",
"vec2",
".",
"Y",
"return",
"ne... | Multiply the components of the vectors and return the result. | [
"Multiply",
"the",
"components",
"of",
"the",
"vectors",
"and",
"return",
"the",
"result",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L250-L255 |
53,268 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector2.component_div | def component_div(vec1, vec2):
"""Divide the components of the vectors and return the result."""
new_vec = Vector2()
new_vec.X = vec1.X / vec2.X
new_vec.Y = vec1.Y / vec2.Y
return new_vec | python | def component_div(vec1, vec2):
"""Divide the components of the vectors and return the result."""
new_vec = Vector2()
new_vec.X = vec1.X / vec2.X
new_vec.Y = vec1.Y / vec2.Y
return new_vec | [
"def",
"component_div",
"(",
"vec1",
",",
"vec2",
")",
":",
"new_vec",
"=",
"Vector2",
"(",
")",
"new_vec",
".",
"X",
"=",
"vec1",
".",
"X",
"/",
"vec2",
".",
"X",
"new_vec",
".",
"Y",
"=",
"vec1",
".",
"Y",
"/",
"vec2",
".",
"Y",
"return",
"ne... | Divide the components of the vectors and return the result. | [
"Divide",
"the",
"components",
"of",
"the",
"vectors",
"and",
"return",
"the",
"result",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L258-L263 |
53,269 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector3.to_vec4 | def to_vec4(self, isPoint):
"""Converts this vector3 into a vector4 instance."""
vec4 = Vector4()
vec4.x = self.x
vec4.y = self.y
vec4.z = self.z
if isPoint:
vec4.w = 1
else:
vec4.w = 0
return vec4 | python | def to_vec4(self, isPoint):
"""Converts this vector3 into a vector4 instance."""
vec4 = Vector4()
vec4.x = self.x
vec4.y = self.y
vec4.z = self.z
if isPoint:
vec4.w = 1
else:
vec4.w = 0
return vec4 | [
"def",
"to_vec4",
"(",
"self",
",",
"isPoint",
")",
":",
"vec4",
"=",
"Vector4",
"(",
")",
"vec4",
".",
"x",
"=",
"self",
".",
"x",
"vec4",
".",
"y",
"=",
"self",
".",
"y",
"vec4",
".",
"z",
"=",
"self",
".",
"z",
"if",
"isPoint",
":",
"vec4"... | Converts this vector3 into a vector4 instance. | [
"Converts",
"this",
"vector3",
"into",
"a",
"vector4",
"instance",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L429-L440 |
53,270 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector3.tuple_as_vec | def tuple_as_vec(xyz):
"""
Generates a Vector3 from a tuple or list.
"""
vec = Vector3()
vec[0] = xyz[0]
vec[1] = xyz[1]
vec[2] = xyz[2]
return vec | python | def tuple_as_vec(xyz):
"""
Generates a Vector3 from a tuple or list.
"""
vec = Vector3()
vec[0] = xyz[0]
vec[1] = xyz[1]
vec[2] = xyz[2]
return vec | [
"def",
"tuple_as_vec",
"(",
"xyz",
")",
":",
"vec",
"=",
"Vector3",
"(",
")",
"vec",
"[",
"0",
"]",
"=",
"xyz",
"[",
"0",
"]",
"vec",
"[",
"1",
"]",
"=",
"xyz",
"[",
"1",
"]",
"vec",
"[",
"2",
"]",
"=",
"xyz",
"[",
"2",
"]",
"return",
"ve... | Generates a Vector3 from a tuple or list. | [
"Generates",
"a",
"Vector3",
"from",
"a",
"tuple",
"or",
"list",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L480-L488 |
53,271 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector3.cross | def cross(vec1, vec2):
"""Returns the cross product of two Vectors"""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3):
vec3 = Vector3()
vec3.x = (vec1.y * vec2.z) - (vec1.z * vec2.y)
vec3.y = (vec1.z * vec2.x) - (vec1.x * vec2.z)
vec3.z = (vec1.... | python | def cross(vec1, vec2):
"""Returns the cross product of two Vectors"""
if isinstance(vec1, Vector3) and isinstance(vec2, Vector3):
vec3 = Vector3()
vec3.x = (vec1.y * vec2.z) - (vec1.z * vec2.y)
vec3.y = (vec1.z * vec2.x) - (vec1.x * vec2.z)
vec3.z = (vec1.... | [
"def",
"cross",
"(",
"vec1",
",",
"vec2",
")",
":",
"if",
"isinstance",
"(",
"vec1",
",",
"Vector3",
")",
"and",
"isinstance",
"(",
"vec2",
",",
"Vector3",
")",
":",
"vec3",
"=",
"Vector3",
"(",
")",
"vec3",
".",
"x",
"=",
"(",
"vec1",
".",
"y",
... | Returns the cross product of two Vectors | [
"Returns",
"the",
"cross",
"product",
"of",
"two",
"Vectors"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L491-L500 |
53,272 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector4.to_vec3 | def to_vec3(self):
"""Convert this vector4 instance into a vector3 instance."""
vec3 = Vector3()
vec3.x = self.x
vec3.y = self.y
vec3.z = self.z
if self.w != 0:
vec3 /= self.w
return vec3 | python | def to_vec3(self):
"""Convert this vector4 instance into a vector3 instance."""
vec3 = Vector3()
vec3.x = self.x
vec3.y = self.y
vec3.z = self.z
if self.w != 0:
vec3 /= self.w
return vec3 | [
"def",
"to_vec3",
"(",
"self",
")",
":",
"vec3",
"=",
"Vector3",
"(",
")",
"vec3",
".",
"x",
"=",
"self",
".",
"x",
"vec3",
".",
"y",
"=",
"self",
".",
"y",
"vec3",
".",
"z",
"=",
"self",
".",
"z",
"if",
"self",
".",
"w",
"!=",
"0",
":",
... | Convert this vector4 instance into a vector3 instance. | [
"Convert",
"this",
"vector4",
"instance",
"into",
"a",
"vector3",
"instance",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L665-L675 |
53,273 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector4.length | def length(self):
"""Gets the length of the Vector"""
return math.sqrt((self.x * self.x) + (self.y * self.y) + (self.z * self.z) + (self.w * self.w)) | python | def length(self):
"""Gets the length of the Vector"""
return math.sqrt((self.x * self.x) + (self.y * self.y) + (self.z * self.z) + (self.w * self.w)) | [
"def",
"length",
"(",
"self",
")",
":",
"return",
"math",
".",
"sqrt",
"(",
"(",
"self",
".",
"x",
"*",
"self",
".",
"x",
")",
"+",
"(",
"self",
".",
"y",
"*",
"self",
".",
"y",
")",
"+",
"(",
"self",
".",
"z",
"*",
"self",
".",
"z",
")",... | Gets the length of the Vector | [
"Gets",
"the",
"length",
"of",
"the",
"Vector"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L677-L679 |
53,274 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector4.clamp | def clamp(self, clampVal):
"""Clamps all the components in the vector to the specified clampVal."""
if self.x > clampVal:
self.x = clampVal
if self.y > clampVal:
self.y = clampVal
if self.z > clampVal:
self.z = clampVal
if self.w > clampVal:
... | python | def clamp(self, clampVal):
"""Clamps all the components in the vector to the specified clampVal."""
if self.x > clampVal:
self.x = clampVal
if self.y > clampVal:
self.y = clampVal
if self.z > clampVal:
self.z = clampVal
if self.w > clampVal:
... | [
"def",
"clamp",
"(",
"self",
",",
"clampVal",
")",
":",
"if",
"self",
".",
"x",
">",
"clampVal",
":",
"self",
".",
"x",
"=",
"clampVal",
"if",
"self",
".",
"y",
">",
"clampVal",
":",
"self",
".",
"y",
"=",
"clampVal",
"if",
"self",
".",
"z",
">... | Clamps all the components in the vector to the specified clampVal. | [
"Clamps",
"all",
"the",
"components",
"in",
"the",
"vector",
"to",
"the",
"specified",
"clampVal",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L700-L709 |
53,275 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Vector4.tuple_as_vec | def tuple_as_vec(xyzw):
"""
Generates a Vector4 from a tuple or list.
"""
vec = Vector4()
vec[0] = xyzw[0]
vec[1] = xyzw[1]
vec[2] = xyzw[2]
vec[3] = xyzw[3]
return vec | python | def tuple_as_vec(xyzw):
"""
Generates a Vector4 from a tuple or list.
"""
vec = Vector4()
vec[0] = xyzw[0]
vec[1] = xyzw[1]
vec[2] = xyzw[2]
vec[3] = xyzw[3]
return vec | [
"def",
"tuple_as_vec",
"(",
"xyzw",
")",
":",
"vec",
"=",
"Vector4",
"(",
")",
"vec",
"[",
"0",
"]",
"=",
"xyzw",
"[",
"0",
"]",
"vec",
"[",
"1",
"]",
"=",
"xyzw",
"[",
"1",
"]",
"vec",
"[",
"2",
"]",
"=",
"xyzw",
"[",
"2",
"]",
"vec",
"[... | Generates a Vector4 from a tuple or list. | [
"Generates",
"a",
"Vector4",
"from",
"a",
"tuple",
"or",
"list",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L718-L727 |
53,276 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Matrix4.transpose | def transpose(self):
"""Create a transpose of this matrix."""
ma4 = Matrix4(self.get_col(0),
self.get_col(1),
self.get_col(2),
self.get_col(3))
return ma4 | python | def transpose(self):
"""Create a transpose of this matrix."""
ma4 = Matrix4(self.get_col(0),
self.get_col(1),
self.get_col(2),
self.get_col(3))
return ma4 | [
"def",
"transpose",
"(",
"self",
")",
":",
"ma4",
"=",
"Matrix4",
"(",
"self",
".",
"get_col",
"(",
"0",
")",
",",
"self",
".",
"get_col",
"(",
"1",
")",
",",
"self",
".",
"get_col",
"(",
"2",
")",
",",
"self",
".",
"get_col",
"(",
"3",
")",
... | Create a transpose of this matrix. | [
"Create",
"a",
"transpose",
"of",
"this",
"matrix",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L919-L925 |
53,277 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Matrix4.translate | def translate(translationAmt):
"""Create a translation matrix."""
if not isinstance(translationAmt, Vector3):
raise ValueError("translationAmt must be a Vector3")
ma4 = Matrix4((1, 0, 0, translationAmt.x),
(0, 1, 0, translationAmt.y),
(0, ... | python | def translate(translationAmt):
"""Create a translation matrix."""
if not isinstance(translationAmt, Vector3):
raise ValueError("translationAmt must be a Vector3")
ma4 = Matrix4((1, 0, 0, translationAmt.x),
(0, 1, 0, translationAmt.y),
(0, ... | [
"def",
"translate",
"(",
"translationAmt",
")",
":",
"if",
"not",
"isinstance",
"(",
"translationAmt",
",",
"Vector3",
")",
":",
"raise",
"ValueError",
"(",
"\"translationAmt must be a Vector3\"",
")",
"ma4",
"=",
"Matrix4",
"(",
"(",
"1",
",",
"0",
",",
"0"... | Create a translation matrix. | [
"Create",
"a",
"translation",
"matrix",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L958-L967 |
53,278 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Matrix4.scale | def scale(scaleAmt):
"""
Create a scale matrix.
scaleAmt is a Vector3 defining the x, y, and z scale values.
"""
if not isinstance(scaleAmt, Vector3):
raise ValueError("scaleAmt must be a Vector3")
ma4 = Matrix4((scaleAmt.x, 0, 0, 0),
(0... | python | def scale(scaleAmt):
"""
Create a scale matrix.
scaleAmt is a Vector3 defining the x, y, and z scale values.
"""
if not isinstance(scaleAmt, Vector3):
raise ValueError("scaleAmt must be a Vector3")
ma4 = Matrix4((scaleAmt.x, 0, 0, 0),
(0... | [
"def",
"scale",
"(",
"scaleAmt",
")",
":",
"if",
"not",
"isinstance",
"(",
"scaleAmt",
",",
"Vector3",
")",
":",
"raise",
"ValueError",
"(",
"\"scaleAmt must be a Vector3\"",
")",
"ma4",
"=",
"Matrix4",
"(",
"(",
"scaleAmt",
".",
"x",
",",
"0",
",",
"0",... | Create a scale matrix.
scaleAmt is a Vector3 defining the x, y, and z scale values. | [
"Create",
"a",
"scale",
"matrix",
".",
"scaleAmt",
"is",
"a",
"Vector3",
"defining",
"the",
"x",
"y",
"and",
"z",
"scale",
"values",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L970-L982 |
53,279 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Matrix4.z_rotate | def z_rotate(rotationAmt):
"""Create a matrix that rotates around the z axis."""
ma4 = Matrix4((math.cos(rotationAmt), -math.sin(rotationAmt), 0, 0),
(math.sin(rotationAmt), math.cos(rotationAmt), 0, 0),
(0, 0, 1, 0),
(0, 0, 0, 1))
... | python | def z_rotate(rotationAmt):
"""Create a matrix that rotates around the z axis."""
ma4 = Matrix4((math.cos(rotationAmt), -math.sin(rotationAmt), 0, 0),
(math.sin(rotationAmt), math.cos(rotationAmt), 0, 0),
(0, 0, 1, 0),
(0, 0, 0, 1))
... | [
"def",
"z_rotate",
"(",
"rotationAmt",
")",
":",
"ma4",
"=",
"Matrix4",
"(",
"(",
"math",
".",
"cos",
"(",
"rotationAmt",
")",
",",
"-",
"math",
".",
"sin",
"(",
"rotationAmt",
")",
",",
"0",
",",
"0",
")",
",",
"(",
"math",
".",
"sin",
"(",
"r... | Create a matrix that rotates around the z axis. | [
"Create",
"a",
"matrix",
"that",
"rotates",
"around",
"the",
"z",
"axis",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L985-L992 |
53,280 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Matrix4.y_rotate | def y_rotate(rotationAmt):
"""Create a matrix that rotates around the y axis."""
ma4 = Matrix4((math.cos(rotationAmt), 0, math.sin(rotationAmt), 0),
(0, 1, 0, 0),
(-math.sin(rotationAmt), 0, math.cos(rotationAmt), 0),
(0, 0, 0, 1))
... | python | def y_rotate(rotationAmt):
"""Create a matrix that rotates around the y axis."""
ma4 = Matrix4((math.cos(rotationAmt), 0, math.sin(rotationAmt), 0),
(0, 1, 0, 0),
(-math.sin(rotationAmt), 0, math.cos(rotationAmt), 0),
(0, 0, 0, 1))
... | [
"def",
"y_rotate",
"(",
"rotationAmt",
")",
":",
"ma4",
"=",
"Matrix4",
"(",
"(",
"math",
".",
"cos",
"(",
"rotationAmt",
")",
",",
"0",
",",
"math",
".",
"sin",
"(",
"rotationAmt",
")",
",",
"0",
")",
",",
"(",
"0",
",",
"1",
",",
"0",
",",
... | Create a matrix that rotates around the y axis. | [
"Create",
"a",
"matrix",
"that",
"rotates",
"around",
"the",
"y",
"axis",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L995-L1001 |
53,281 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Matrix4.x_rotate | def x_rotate(rotationAmt):
"""Create a matrix that rotates around the x axis."""
ma4 = Matrix4((1, 0, 0, 0),
(0, math.cos(rotationAmt), -math.sin(rotationAmt), 0),
(0, math.sin(rotationAmt), math.cos(rotationAmt), 0),
(0, 0, 0, 1))
... | python | def x_rotate(rotationAmt):
"""Create a matrix that rotates around the x axis."""
ma4 = Matrix4((1, 0, 0, 0),
(0, math.cos(rotationAmt), -math.sin(rotationAmt), 0),
(0, math.sin(rotationAmt), math.cos(rotationAmt), 0),
(0, 0, 0, 1))
... | [
"def",
"x_rotate",
"(",
"rotationAmt",
")",
":",
"ma4",
"=",
"Matrix4",
"(",
"(",
"1",
",",
"0",
",",
"0",
",",
"0",
")",
",",
"(",
"0",
",",
"math",
".",
"cos",
"(",
"rotationAmt",
")",
",",
"-",
"math",
".",
"sin",
"(",
"rotationAmt",
")",
... | Create a matrix that rotates around the x axis. | [
"Create",
"a",
"matrix",
"that",
"rotates",
"around",
"the",
"x",
"axis",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1004-L1011 |
53,282 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Matrix4.build_rotation | def build_rotation(vec3):
"""
Build a rotation matrix.
vec3 is a Vector3 defining the axis about which to rotate the object.
"""
if not isinstance(vec3, Vector3):
raise ValueError("rotAmt must be a Vector3")
return Matrix4.x_rotate(vec3.x) * Matrix4.y_rotate(v... | python | def build_rotation(vec3):
"""
Build a rotation matrix.
vec3 is a Vector3 defining the axis about which to rotate the object.
"""
if not isinstance(vec3, Vector3):
raise ValueError("rotAmt must be a Vector3")
return Matrix4.x_rotate(vec3.x) * Matrix4.y_rotate(v... | [
"def",
"build_rotation",
"(",
"vec3",
")",
":",
"if",
"not",
"isinstance",
"(",
"vec3",
",",
"Vector3",
")",
":",
"raise",
"ValueError",
"(",
"\"rotAmt must be a Vector3\"",
")",
"return",
"Matrix4",
".",
"x_rotate",
"(",
"vec3",
".",
"x",
")",
"*",
"Matri... | Build a rotation matrix.
vec3 is a Vector3 defining the axis about which to rotate the object. | [
"Build",
"a",
"rotation",
"matrix",
".",
"vec3",
"is",
"a",
"Vector3",
"defining",
"the",
"axis",
"about",
"which",
"to",
"rotate",
"the",
"object",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1014-L1021 |
53,283 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Ragnarok.__handle_events | def __handle_events(self):
"""This is the place to put all event handeling."""
events = pygame.event.get()
for event in events:
if event.type == pygame.QUIT:
self.exit() | python | def __handle_events(self):
"""This is the place to put all event handeling."""
events = pygame.event.get()
for event in events:
if event.type == pygame.QUIT:
self.exit() | [
"def",
"__handle_events",
"(",
"self",
")",
":",
"events",
"=",
"pygame",
".",
"event",
".",
"get",
"(",
")",
"for",
"event",
"in",
"events",
":",
"if",
"event",
".",
"type",
"==",
"pygame",
".",
"QUIT",
":",
"self",
".",
"exit",
"(",
")"
] | This is the place to put all event handeling. | [
"This",
"is",
"the",
"place",
"to",
"put",
"all",
"event",
"handeling",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1085-L1090 |
53,284 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Pool.__init_object | def __init_object(self):
"""Create a new object for the pool."""
# Check to see if the user created a specific initalization function for this object.
if self.init_function is not None:
new_obj = self.init_function()
self.__enqueue(new_obj)
else:
raise... | python | def __init_object(self):
"""Create a new object for the pool."""
# Check to see if the user created a specific initalization function for this object.
if self.init_function is not None:
new_obj = self.init_function()
self.__enqueue(new_obj)
else:
raise... | [
"def",
"__init_object",
"(",
"self",
")",
":",
"# Check to see if the user created a specific initalization function for this object.",
"if",
"self",
".",
"init_function",
"is",
"not",
"None",
":",
"new_obj",
"=",
"self",
".",
"init_function",
"(",
")",
"self",
".",
"... | Create a new object for the pool. | [
"Create",
"a",
"new",
"object",
"for",
"the",
"pool",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1156-L1163 |
53,285 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Sprite.center_origin | def center_origin(self):
"""Sets the origin to the center of the image."""
self.set_origin(Vector2(self.image.get_width() / 2.0, self.image.get_height() / 2.0)) | python | def center_origin(self):
"""Sets the origin to the center of the image."""
self.set_origin(Vector2(self.image.get_width() / 2.0, self.image.get_height() / 2.0)) | [
"def",
"center_origin",
"(",
"self",
")",
":",
"self",
".",
"set_origin",
"(",
"Vector2",
"(",
"self",
".",
"image",
".",
"get_width",
"(",
")",
"/",
"2.0",
",",
"self",
".",
"image",
".",
"get_height",
"(",
")",
"/",
"2.0",
")",
")"
] | Sets the origin to the center of the image. | [
"Sets",
"the",
"origin",
"to",
"the",
"center",
"of",
"the",
"image",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1306-L1308 |
53,286 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Sprite.scale_to | def scale_to(self, width_height=Vector2()):
"""Scale the texture to the specfied width and height."""
scale_amt = Vector2()
scale_amt.X = float(width_height.X) / self.image.get_width()
scale_amt.Y = float(width_height.Y) / self.image.get_height()
self.set_scale(scale_amt) | python | def scale_to(self, width_height=Vector2()):
"""Scale the texture to the specfied width and height."""
scale_amt = Vector2()
scale_amt.X = float(width_height.X) / self.image.get_width()
scale_amt.Y = float(width_height.Y) / self.image.get_height()
self.set_scale(scale_amt) | [
"def",
"scale_to",
"(",
"self",
",",
"width_height",
"=",
"Vector2",
"(",
")",
")",
":",
"scale_amt",
"=",
"Vector2",
"(",
")",
"scale_amt",
".",
"X",
"=",
"float",
"(",
"width_height",
".",
"X",
")",
"/",
"self",
".",
"image",
".",
"get_width",
"(",... | Scale the texture to the specfied width and height. | [
"Scale",
"the",
"texture",
"to",
"the",
"specfied",
"width",
"and",
"height",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1325-L1330 |
53,287 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Sprite.set_hflip | def set_hflip(self, val):
"""val is True or False that determines if we should horizontally flip the surface or not."""
if self.__horizontal_flip is not val:
self.__horizontal_flip = val
self.image = pygame.transform.flip(self.untransformed_image, val, self.__vertical_flip) | python | def set_hflip(self, val):
"""val is True or False that determines if we should horizontally flip the surface or not."""
if self.__horizontal_flip is not val:
self.__horizontal_flip = val
self.image = pygame.transform.flip(self.untransformed_image, val, self.__vertical_flip) | [
"def",
"set_hflip",
"(",
"self",
",",
"val",
")",
":",
"if",
"self",
".",
"__horizontal_flip",
"is",
"not",
"val",
":",
"self",
".",
"__horizontal_flip",
"=",
"val",
"self",
".",
"image",
"=",
"pygame",
".",
"transform",
".",
"flip",
"(",
"self",
".",
... | val is True or False that determines if we should horizontally flip the surface or not. | [
"val",
"is",
"True",
"or",
"False",
"that",
"determines",
"if",
"we",
"should",
"horizontally",
"flip",
"the",
"surface",
"or",
"not",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1344-L1348 |
53,288 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Sprite.load_texture | def load_texture(self, file_path):
"""Generate our sprite's surface by loading the specified image from disk.
Note that this automatically centers the origin."""
self.image = pygame.image.load(file_path)
self.apply_texture(self.image) | python | def load_texture(self, file_path):
"""Generate our sprite's surface by loading the specified image from disk.
Note that this automatically centers the origin."""
self.image = pygame.image.load(file_path)
self.apply_texture(self.image) | [
"def",
"load_texture",
"(",
"self",
",",
"file_path",
")",
":",
"self",
".",
"image",
"=",
"pygame",
".",
"image",
".",
"load",
"(",
"file_path",
")",
"self",
".",
"apply_texture",
"(",
"self",
".",
"image",
")"
] | Generate our sprite's surface by loading the specified image from disk.
Note that this automatically centers the origin. | [
"Generate",
"our",
"sprite",
"s",
"surface",
"by",
"loading",
"the",
"specified",
"image",
"from",
"disk",
".",
"Note",
"that",
"this",
"automatically",
"centers",
"the",
"origin",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1365-L1369 |
53,289 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Sprite.__execute_rot | def __execute_rot(self, surface):
"""Executes the rotating operation"""
self.image = pygame.transform.rotate(surface, self.__rotation)
self.__resize_surface_extents() | python | def __execute_rot(self, surface):
"""Executes the rotating operation"""
self.image = pygame.transform.rotate(surface, self.__rotation)
self.__resize_surface_extents() | [
"def",
"__execute_rot",
"(",
"self",
",",
"surface",
")",
":",
"self",
".",
"image",
"=",
"pygame",
".",
"transform",
".",
"rotate",
"(",
"surface",
",",
"self",
".",
"__rotation",
")",
"self",
".",
"__resize_surface_extents",
"(",
")"
] | Executes the rotating operation | [
"Executes",
"the",
"rotating",
"operation"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1403-L1406 |
53,290 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Sprite.__handle_scale_rot | def __handle_scale_rot(self):
"""Handle scaling and rotation of the surface"""
if self.__is_rot_pending:
self.__execute_rot(self.untransformed_image)
self.__is_rot_pending = False
# Scale the image using the recently rotated surface to keep the orientation correct
... | python | def __handle_scale_rot(self):
"""Handle scaling and rotation of the surface"""
if self.__is_rot_pending:
self.__execute_rot(self.untransformed_image)
self.__is_rot_pending = False
# Scale the image using the recently rotated surface to keep the orientation correct
... | [
"def",
"__handle_scale_rot",
"(",
"self",
")",
":",
"if",
"self",
".",
"__is_rot_pending",
":",
"self",
".",
"__execute_rot",
"(",
"self",
".",
"untransformed_image",
")",
"self",
".",
"__is_rot_pending",
"=",
"False",
"# Scale the image using the recently rotated sur... | Handle scaling and rotation of the surface | [
"Handle",
"scaling",
"and",
"rotation",
"of",
"the",
"surface"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1408-L1421 |
53,291 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Text.load_font | def load_font(self, font_path, font_size):
"""Load the specified font from a file."""
self.__font_path = font_path
self.__font_size = font_size
if font_path != "":
self.__font = pygame.font.Font(font_path, font_size)
self.__set_text(self.__text) | python | def load_font(self, font_path, font_size):
"""Load the specified font from a file."""
self.__font_path = font_path
self.__font_size = font_size
if font_path != "":
self.__font = pygame.font.Font(font_path, font_size)
self.__set_text(self.__text) | [
"def",
"load_font",
"(",
"self",
",",
"font_path",
",",
"font_size",
")",
":",
"self",
".",
"__font_path",
"=",
"font_path",
"self",
".",
"__font_size",
"=",
"font_size",
"if",
"font_path",
"!=",
"\"\"",
":",
"self",
".",
"__font",
"=",
"pygame",
".",
"f... | Load the specified font from a file. | [
"Load",
"the",
"specified",
"font",
"from",
"a",
"file",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1474-L1480 |
53,292 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | Particle.initalize | def initalize(self, physics_dta):
"""
Prepare our particle for use.
physics_dta describes the velocity, coordinates, and acceleration of the particle.
"""
self.rotation = random.randint(self.rotation_range[0], self.rotation_range[1])
self.current_time = 0.0
self.c... | python | def initalize(self, physics_dta):
"""
Prepare our particle for use.
physics_dta describes the velocity, coordinates, and acceleration of the particle.
"""
self.rotation = random.randint(self.rotation_range[0], self.rotation_range[1])
self.current_time = 0.0
self.c... | [
"def",
"initalize",
"(",
"self",
",",
"physics_dta",
")",
":",
"self",
".",
"rotation",
"=",
"random",
".",
"randint",
"(",
"self",
".",
"rotation_range",
"[",
"0",
"]",
",",
"self",
".",
"rotation_range",
"[",
"1",
"]",
")",
"self",
".",
"current_time... | Prepare our particle for use.
physics_dta describes the velocity, coordinates, and acceleration of the particle. | [
"Prepare",
"our",
"particle",
"for",
"use",
".",
"physics_dta",
"describes",
"the",
"velocity",
"coordinates",
"and",
"acceleration",
"of",
"the",
"particle",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1585-L1594 |
53,293 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | ParticleEmitter.__release_particle | def __release_particle(self):
"""Pull a particle from the queue and add it to the active list."""
# Calculate a potential angle for the particle.
angle = random.randint(int(self.direction_range[0]), int(self.direction_range[1]))
velocity = Vector2.from_polar(angle, self.particle_speed)
... | python | def __release_particle(self):
"""Pull a particle from the queue and add it to the active list."""
# Calculate a potential angle for the particle.
angle = random.randint(int(self.direction_range[0]), int(self.direction_range[1]))
velocity = Vector2.from_polar(angle, self.particle_speed)
... | [
"def",
"__release_particle",
"(",
"self",
")",
":",
"# Calculate a potential angle for the particle.",
"angle",
"=",
"random",
".",
"randint",
"(",
"int",
"(",
"self",
".",
"direction_range",
"[",
"0",
"]",
")",
",",
"int",
"(",
"self",
".",
"direction_range",
... | Pull a particle from the queue and add it to the active list. | [
"Pull",
"a",
"particle",
"from",
"the",
"queue",
"and",
"add",
"it",
"to",
"the",
"active",
"list",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1652-L1662 |
53,294 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | SpriteSheet.load_texture | def load_texture(self, file_path, cell_size=(256, 256)):
"""
Load a spritesheet texture.
cell_size is the uniform size of each cell in the spritesheet.
"""
super(SpriteSheet, self).load_texture(file_path)
self.__cell_bounds = cell_size
self.__generate_cells() | python | def load_texture(self, file_path, cell_size=(256, 256)):
"""
Load a spritesheet texture.
cell_size is the uniform size of each cell in the spritesheet.
"""
super(SpriteSheet, self).load_texture(file_path)
self.__cell_bounds = cell_size
self.__generate_cells() | [
"def",
"load_texture",
"(",
"self",
",",
"file_path",
",",
"cell_size",
"=",
"(",
"256",
",",
"256",
")",
")",
":",
"super",
"(",
"SpriteSheet",
",",
"self",
")",
".",
"load_texture",
"(",
"file_path",
")",
"self",
".",
"__cell_bounds",
"=",
"cell_size",... | Load a spritesheet texture.
cell_size is the uniform size of each cell in the spritesheet. | [
"Load",
"a",
"spritesheet",
"texture",
".",
"cell_size",
"is",
"the",
"uniform",
"size",
"of",
"each",
"cell",
"in",
"the",
"spritesheet",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1718-L1725 |
53,295 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | SpriteSheet.draw | def draw(self, milliseconds, surface, cell):
"""Draw out the specified cell"""
# print self.cells[cell]
self.source = self.cells[cell].copy()
# Find the current scale of the image in relation to its original scale.
current_scale = Vector2()
current_scale.X = self.rect.wid... | python | def draw(self, milliseconds, surface, cell):
"""Draw out the specified cell"""
# print self.cells[cell]
self.source = self.cells[cell].copy()
# Find the current scale of the image in relation to its original scale.
current_scale = Vector2()
current_scale.X = self.rect.wid... | [
"def",
"draw",
"(",
"self",
",",
"milliseconds",
",",
"surface",
",",
"cell",
")",
":",
"# print self.cells[cell]",
"self",
".",
"source",
"=",
"self",
".",
"cells",
"[",
"cell",
"]",
".",
"copy",
"(",
")",
"# Find the current scale of the image in relation to i... | Draw out the specified cell | [
"Draw",
"out",
"the",
"specified",
"cell"
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1747-L1759 |
53,296 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | AnimationList.set_coords | def set_coords(self, value):
"""Set all the images contained in the animation to the specified value."""
self.__coords = value
for image in self.images:
image.coords = value | python | def set_coords(self, value):
"""Set all the images contained in the animation to the specified value."""
self.__coords = value
for image in self.images:
image.coords = value | [
"def",
"set_coords",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"__coords",
"=",
"value",
"for",
"image",
"in",
"self",
".",
"images",
":",
"image",
".",
"coords",
"=",
"value"
] | Set all the images contained in the animation to the specified value. | [
"Set",
"all",
"the",
"images",
"contained",
"in",
"the",
"animation",
"to",
"the",
"specified",
"value",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1874-L1878 |
53,297 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | AnimationList.set_hflip | def set_hflip(self, val):
"""Flip all the images in the animation list horizontally."""
self.__horizontal_flip = val
for image in self.images:
image.h_flip = val | python | def set_hflip(self, val):
"""Flip all the images in the animation list horizontally."""
self.__horizontal_flip = val
for image in self.images:
image.h_flip = val | [
"def",
"set_hflip",
"(",
"self",
",",
"val",
")",
":",
"self",
".",
"__horizontal_flip",
"=",
"val",
"for",
"image",
"in",
"self",
".",
"images",
":",
"image",
".",
"h_flip",
"=",
"val"
] | Flip all the images in the animation list horizontally. | [
"Flip",
"all",
"the",
"images",
"in",
"the",
"animation",
"list",
"horizontally",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1884-L1888 |
53,298 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | AnimationList.set_vflip | def set_vflip(self, val):
"""Flip all the images in the animation list vertically."""
self.__vertical_flip = val
for image in self.images:
image.v_flip = val | python | def set_vflip(self, val):
"""Flip all the images in the animation list vertically."""
self.__vertical_flip = val
for image in self.images:
image.v_flip = val | [
"def",
"set_vflip",
"(",
"self",
",",
"val",
")",
":",
"self",
".",
"__vertical_flip",
"=",
"val",
"for",
"image",
"in",
"self",
".",
"images",
":",
"image",
".",
"v_flip",
"=",
"val"
] | Flip all the images in the animation list vertically. | [
"Flip",
"all",
"the",
"images",
"in",
"the",
"animation",
"list",
"vertically",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1894-L1898 |
53,299 | Scoppio/RagnarokEngine3 | RagnarokEngine3/RE3.py | AnimationList.copy | def copy(self):
"""Create a copy of the animation."""
animation = AnimationList()
animation.set_frame_rate(self.frame_rate)
animation.__coords = self.__coords
animation.__horizontal_flip = self.__horizontal_flip
animation.__vertical_flip = self.__vertical_flip
ani... | python | def copy(self):
"""Create a copy of the animation."""
animation = AnimationList()
animation.set_frame_rate(self.frame_rate)
animation.__coords = self.__coords
animation.__horizontal_flip = self.__horizontal_flip
animation.__vertical_flip = self.__vertical_flip
ani... | [
"def",
"copy",
"(",
"self",
")",
":",
"animation",
"=",
"AnimationList",
"(",
")",
"animation",
".",
"set_frame_rate",
"(",
"self",
".",
"frame_rate",
")",
"animation",
".",
"__coords",
"=",
"self",
".",
"__coords",
"animation",
".",
"__horizontal_flip",
"="... | Create a copy of the animation. | [
"Create",
"a",
"copy",
"of",
"the",
"animation",
"."
] | 4395d419ccd64fe9327c41f200b72ee0176ad896 | https://github.com/Scoppio/RagnarokEngine3/blob/4395d419ccd64fe9327c41f200b72ee0176ad896/RagnarokEngine3/RE3.py#L1906-L1922 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.