repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tweepy/tweepy | tweepy/api.py | API.favorites | def favorites(self):
""" :reference: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-favorites-list
:allowed_param:'screen_name', 'user_id', 'max_id', 'count', 'since_id', 'max_id'
"""
return bind_api(
api=self,
path='/favorites/... | python | def favorites(self):
""" :reference: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-favorites-list
:allowed_param:'screen_name', 'user_id', 'max_id', 'count', 'since_id', 'max_id'
"""
return bind_api(
api=self,
path='/favorites/... | [
"def",
"favorites",
"(",
"self",
")",
":",
"return",
"bind_api",
"(",
"api",
"=",
"self",
",",
"path",
"=",
"'/favorites/list.json'",
",",
"payload_type",
"=",
"'status'",
",",
"payload_list",
"=",
"True",
",",
"allowed_param",
"=",
"[",
"'screen_name'",
","... | :reference: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-favorites-list
:allowed_param:'screen_name', 'user_id', 'max_id', 'count', 'since_id', 'max_id' | [
":",
"reference",
":",
"https",
":",
"//",
"developer",
".",
"twitter",
".",
"com",
"/",
"en",
"/",
"docs",
"/",
"tweets",
"/",
"post",
"-",
"and",
"-",
"engage",
"/",
"api",
"-",
"reference",
"/",
"get",
"-",
"favorites",
"-",
"list",
":",
"allowe... | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/api.py#L739-L748 | train | Get a list of all the user s favorites. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/api.py | API.saved_searches | def saved_searches(self):
""" :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list """
return bind_api(
api=self,
path='/saved_searches/list.json',
payload_type='saved_search', payload_list=... | python | def saved_searches(self):
""" :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list """
return bind_api(
api=self,
path='/saved_searches/list.json',
payload_type='saved_search', payload_list=... | [
"def",
"saved_searches",
"(",
"self",
")",
":",
"return",
"bind_api",
"(",
"api",
"=",
"self",
",",
"path",
"=",
"'/saved_searches/list.json'",
",",
"payload_type",
"=",
"'saved_search'",
",",
"payload_list",
"=",
"True",
",",
"require_auth",
"=",
"True",
")"
... | :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/get-saved_searches-list | [
":",
"reference",
":",
"https",
":",
"//",
"developer",
".",
"twitter",
".",
"com",
"/",
"en",
"/",
"docs",
"/",
"accounts",
"-",
"and",
"-",
"users",
"/",
"manage",
"-",
"account",
"-",
"settings",
"/",
"api",
"-",
"reference",
"/",
"get",
"-",
"s... | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/api.py#L882-L889 | train | Get a list of saved searches for the current user. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/api.py | API.add_list_members | def add_list_members(self, screen_name=None, user_id=None, slug=None,
list_id=None, owner_id=None, owner_screen_name=None):
""" Perform bulk add of list members from user ID or screenname """
return self._add_list_members(list_to_csv(screen_name),
... | python | def add_list_members(self, screen_name=None, user_id=None, slug=None,
list_id=None, owner_id=None, owner_screen_name=None):
""" Perform bulk add of list members from user ID or screenname """
return self._add_list_members(list_to_csv(screen_name),
... | [
"def",
"add_list_members",
"(",
"self",
",",
"screen_name",
"=",
"None",
",",
"user_id",
"=",
"None",
",",
"slug",
"=",
"None",
",",
"list_id",
"=",
"None",
",",
"owner_id",
"=",
"None",
",",
"owner_screen_name",
"=",
"None",
")",
":",
"return",
"self",
... | Perform bulk add of list members from user ID or screenname | [
"Perform",
"bulk",
"add",
"of",
"list",
"members",
"from",
"user",
"ID",
"or",
"screenname"
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/api.py#L1072-L1078 | train | Perform bulk add of list members from user ID or screenname | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/api.py | API.remove_list_members | def remove_list_members(self, screen_name=None, user_id=None, slug=None,
list_id=None, owner_id=None, owner_screen_name=None):
""" Perform bulk remove of list members from user ID or screenname """
return self._remove_list_members(list_to_csv(screen_name),
... | python | def remove_list_members(self, screen_name=None, user_id=None, slug=None,
list_id=None, owner_id=None, owner_screen_name=None):
""" Perform bulk remove of list members from user ID or screenname """
return self._remove_list_members(list_to_csv(screen_name),
... | [
"def",
"remove_list_members",
"(",
"self",
",",
"screen_name",
"=",
"None",
",",
"user_id",
"=",
"None",
",",
"slug",
"=",
"None",
",",
"list_id",
"=",
"None",
",",
"owner_id",
"=",
"None",
",",
"owner_screen_name",
"=",
"None",
")",
":",
"return",
"self... | Perform bulk remove of list members from user ID or screenname | [
"Perform",
"bulk",
"remove",
"of",
"list",
"members",
"from",
"user",
"ID",
"or",
"screenname"
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/api.py#L1097-L1103 | train | Perform bulk remove of list members from user ID or screenname | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/streaming.py | StreamListener.on_data | def on_data(self, raw_data):
"""Called when raw data is received from connection.
Override this method if you wish to manually handle
the stream data. Return False to stop stream and close connection.
"""
data = json.loads(raw_data)
if 'in_reply_to_status_id' in data:
... | python | def on_data(self, raw_data):
"""Called when raw data is received from connection.
Override this method if you wish to manually handle
the stream data. Return False to stop stream and close connection.
"""
data = json.loads(raw_data)
if 'in_reply_to_status_id' in data:
... | [
"def",
"on_data",
"(",
"self",
",",
"raw_data",
")",
":",
"data",
"=",
"json",
".",
"loads",
"(",
"raw_data",
")",
"if",
"'in_reply_to_status_id'",
"in",
"data",
":",
"status",
"=",
"Status",
".",
"parse",
"(",
"self",
".",
"api",
",",
"data",
")",
"... | Called when raw data is received from connection.
Override this method if you wish to manually handle
the stream data. Return False to stop stream and close connection. | [
"Called",
"when",
"raw",
"data",
"is",
"received",
"from",
"connection",
"."
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/streaming.py#L45-L82 | train | Called when raw data is received from the connection. Return False to stop stream and close connection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/streaming.py | ReadBuffer.read_line | def read_line(self, sep=six.b('\n')):
"""Read the data stream until a given separator is found (default \n)
:param sep: Separator to read until. Must by of the bytes type (str in python 2,
bytes in python 3)
:return: The str of the data read until sep
"""
start = 0
... | python | def read_line(self, sep=six.b('\n')):
"""Read the data stream until a given separator is found (default \n)
:param sep: Separator to read until. Must by of the bytes type (str in python 2,
bytes in python 3)
:return: The str of the data read until sep
"""
start = 0
... | [
"def",
"read_line",
"(",
"self",
",",
"sep",
"=",
"six",
".",
"b",
"(",
"'\\n'",
")",
")",
":",
"start",
"=",
"0",
"while",
"not",
"self",
".",
"_stream",
".",
"closed",
":",
"loc",
"=",
"self",
".",
"_buffer",
".",
"find",
"(",
"sep",
",",
"st... | Read the data stream until a given separator is found (default \n)
:param sep: Separator to read until. Must by of the bytes type (str in python 2,
bytes in python 3)
:return: The str of the data read until sep | [
"Read",
"the",
"data",
"stream",
"until",
"a",
"given",
"separator",
"is",
"found",
"(",
"default",
"\\",
"n",
")"
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/streaming.py#L167-L182 | train | Read the data stream until a given separator is found. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/cursor.py | Cursor.pages | def pages(self, limit=0):
"""Return iterator for pages"""
if limit > 0:
self.iterator.limit = limit
return self.iterator | python | def pages(self, limit=0):
"""Return iterator for pages"""
if limit > 0:
self.iterator.limit = limit
return self.iterator | [
"def",
"pages",
"(",
"self",
",",
"limit",
"=",
"0",
")",
":",
"if",
"limit",
">",
"0",
":",
"self",
".",
"iterator",
".",
"limit",
"=",
"limit",
"return",
"self",
".",
"iterator"
] | Return iterator for pages | [
"Return",
"iterator",
"for",
"pages"
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/cursor.py#L27-L31 | train | Return iterator for pages | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/cursor.py | Cursor.items | def items(self, limit=0):
"""Return iterator for items in each page"""
i = ItemIterator(self.iterator)
i.limit = limit
return i | python | def items(self, limit=0):
"""Return iterator for items in each page"""
i = ItemIterator(self.iterator)
i.limit = limit
return i | [
"def",
"items",
"(",
"self",
",",
"limit",
"=",
"0",
")",
":",
"i",
"=",
"ItemIterator",
"(",
"self",
".",
"iterator",
")",
"i",
".",
"limit",
"=",
"limit",
"return",
"i"
] | Return iterator for items in each page | [
"Return",
"iterator",
"for",
"items",
"in",
"each",
"page"
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/cursor.py#L33-L37 | train | Return iterator for items in each page | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/cursor.py | IdIterator.next | def next(self):
"""Fetch a set of items with IDs less than current set."""
if self.limit and self.limit == self.num_tweets:
raise StopIteration
if self.index >= len(self.results) - 1:
data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kargs)
... | python | def next(self):
"""Fetch a set of items with IDs less than current set."""
if self.limit and self.limit == self.num_tweets:
raise StopIteration
if self.index >= len(self.results) - 1:
data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kargs)
... | [
"def",
"next",
"(",
"self",
")",
":",
"if",
"self",
".",
"limit",
"and",
"self",
".",
"limit",
"==",
"self",
".",
"num_tweets",
":",
"raise",
"StopIteration",
"if",
"self",
".",
"index",
">=",
"len",
"(",
"self",
".",
"results",
")",
"-",
"1",
":",... | Fetch a set of items with IDs less than current set. | [
"Fetch",
"a",
"set",
"of",
"items",
"with",
"IDs",
"less",
"than",
"current",
"set",
"."
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/cursor.py#L102-L139 | train | Fetch a set of items with IDs less than current set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
tweepy/tweepy | tweepy/cursor.py | IdIterator.prev | def prev(self):
"""Fetch a set of items with IDs greater than current set."""
if self.limit and self.limit == self.num_tweets:
raise StopIteration
self.index -= 1
if self.index < 0:
# There's no way to fetch a set of tweets directly 'above' the
# curr... | python | def prev(self):
"""Fetch a set of items with IDs greater than current set."""
if self.limit and self.limit == self.num_tweets:
raise StopIteration
self.index -= 1
if self.index < 0:
# There's no way to fetch a set of tweets directly 'above' the
# curr... | [
"def",
"prev",
"(",
"self",
")",
":",
"if",
"self",
".",
"limit",
"and",
"self",
".",
"limit",
"==",
"self",
".",
"num_tweets",
":",
"raise",
"StopIteration",
"self",
".",
"index",
"-=",
"1",
"if",
"self",
".",
"index",
"<",
"0",
":",
"# There's no w... | Fetch a set of items with IDs greater than current set. | [
"Fetch",
"a",
"set",
"of",
"items",
"with",
"IDs",
"greater",
"than",
"current",
"set",
"."
] | cc3894073905811c4d9fd816202f93454ed932da | https://github.com/tweepy/tweepy/blob/cc3894073905811c4d9fd816202f93454ed932da/tweepy/cursor.py#L141-L155 | train | Fetch a set of items with IDs greater than current set. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCache.add_bid | def add_bid(self, bid):
"""Add a bid to the cache
:param bid:
:return:
"""
self._bids[bid[0]] = float(bid[1])
if bid[1] == "0.00000000":
del self._bids[bid[0]] | python | def add_bid(self, bid):
"""Add a bid to the cache
:param bid:
:return:
"""
self._bids[bid[0]] = float(bid[1])
if bid[1] == "0.00000000":
del self._bids[bid[0]] | [
"def",
"add_bid",
"(",
"self",
",",
"bid",
")",
":",
"self",
".",
"_bids",
"[",
"bid",
"[",
"0",
"]",
"]",
"=",
"float",
"(",
"bid",
"[",
"1",
"]",
")",
"if",
"bid",
"[",
"1",
"]",
"==",
"\"0.00000000\"",
":",
"del",
"self",
".",
"_bids",
"["... | Add a bid to the cache
:param bid:
:return: | [
"Add",
"a",
"bid",
"to",
"the",
"cache"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L23-L32 | train | Add a bid to the cache. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCache.add_ask | def add_ask(self, ask):
"""Add an ask to the cache
:param ask:
:return:
"""
self._asks[ask[0]] = float(ask[1])
if ask[1] == "0.00000000":
del self._asks[ask[0]] | python | def add_ask(self, ask):
"""Add an ask to the cache
:param ask:
:return:
"""
self._asks[ask[0]] = float(ask[1])
if ask[1] == "0.00000000":
del self._asks[ask[0]] | [
"def",
"add_ask",
"(",
"self",
",",
"ask",
")",
":",
"self",
".",
"_asks",
"[",
"ask",
"[",
"0",
"]",
"]",
"=",
"float",
"(",
"ask",
"[",
"1",
"]",
")",
"if",
"ask",
"[",
"1",
"]",
"==",
"\"0.00000000\"",
":",
"del",
"self",
".",
"_asks",
"["... | Add an ask to the cache
:param ask:
:return: | [
"Add",
"an",
"ask",
"to",
"the",
"cache"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L34-L43 | train | Add an ask to the cache
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCache.sort_depth | def sort_depth(vals, reverse=False):
"""Sort bids or asks by price
"""
lst = [[float(price), quantity] for price, quantity in vals.items()]
lst = sorted(lst, key=itemgetter(0), reverse=reverse)
return lst | python | def sort_depth(vals, reverse=False):
"""Sort bids or asks by price
"""
lst = [[float(price), quantity] for price, quantity in vals.items()]
lst = sorted(lst, key=itemgetter(0), reverse=reverse)
return lst | [
"def",
"sort_depth",
"(",
"vals",
",",
"reverse",
"=",
"False",
")",
":",
"lst",
"=",
"[",
"[",
"float",
"(",
"price",
")",
",",
"quantity",
"]",
"for",
"price",
",",
"quantity",
"in",
"vals",
".",
"items",
"(",
")",
"]",
"lst",
"=",
"sorted",
"(... | Sort bids or asks by price | [
"Sort",
"bids",
"or",
"asks",
"by",
"price"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L112-L117 | train | Sort bids or asks by price | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCacheManager._init_cache | def _init_cache(self):
"""Initialise the depth cache calling REST endpoint
:return:
"""
self._last_update_id = None
self._depth_message_buffer = []
res = self._client.get_order_book(symbol=self._symbol, limit=self._limit)
# process bid and asks from the order b... | python | def _init_cache(self):
"""Initialise the depth cache calling REST endpoint
:return:
"""
self._last_update_id = None
self._depth_message_buffer = []
res = self._client.get_order_book(symbol=self._symbol, limit=self._limit)
# process bid and asks from the order b... | [
"def",
"_init_cache",
"(",
"self",
")",
":",
"self",
".",
"_last_update_id",
"=",
"None",
"self",
".",
"_depth_message_buffer",
"=",
"[",
"]",
"res",
"=",
"self",
".",
"_client",
".",
"get_order_book",
"(",
"symbol",
"=",
"self",
".",
"_symbol",
",",
"li... | Initialise the depth cache calling REST endpoint
:return: | [
"Initialise",
"the",
"depth",
"cache",
"calling",
"REST",
"endpoint"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L153-L181 | train | Initialise the depth cache calling REST endpoint
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCacheManager._start_socket | def _start_socket(self):
"""Start the depth cache socket
:return:
"""
if self._bm is None:
self._bm = BinanceSocketManager(self._client)
self._conn_key = self._bm.start_depth_socket(self._symbol, self._depth_event)
if not self._bm.is_alive():
sel... | python | def _start_socket(self):
"""Start the depth cache socket
:return:
"""
if self._bm is None:
self._bm = BinanceSocketManager(self._client)
self._conn_key = self._bm.start_depth_socket(self._symbol, self._depth_event)
if not self._bm.is_alive():
sel... | [
"def",
"_start_socket",
"(",
"self",
")",
":",
"if",
"self",
".",
"_bm",
"is",
"None",
":",
"self",
".",
"_bm",
"=",
"BinanceSocketManager",
"(",
"self",
".",
"_client",
")",
"self",
".",
"_conn_key",
"=",
"self",
".",
"_bm",
".",
"start_depth_socket",
... | Start the depth cache socket
:return: | [
"Start",
"the",
"depth",
"cache",
"socket"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L183-L197 | train | Start the depth cache socket | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCacheManager._depth_event | def _depth_event(self, msg):
"""Handle a depth event
:param msg:
:return:
"""
if 'e' in msg and msg['e'] == 'error':
# close the socket
self.close()
# notify the user by returning a None value
if self._callback:
... | python | def _depth_event(self, msg):
"""Handle a depth event
:param msg:
:return:
"""
if 'e' in msg and msg['e'] == 'error':
# close the socket
self.close()
# notify the user by returning a None value
if self._callback:
... | [
"def",
"_depth_event",
"(",
"self",
",",
"msg",
")",
":",
"if",
"'e'",
"in",
"msg",
"and",
"msg",
"[",
"'e'",
"]",
"==",
"'error'",
":",
"# close the socket",
"self",
".",
"close",
"(",
")",
"# notify the user by returning a None value",
"if",
"self",
".",
... | Handle a depth event
:param msg:
:return: | [
"Handle",
"a",
"depth",
"event"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L199-L219 | train | Handle a depth event. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCacheManager._process_depth_message | def _process_depth_message(self, msg, buffer=False):
"""Process a depth event message.
:param msg: Depth event message.
:return:
"""
if buffer and msg['u'] <= self._last_update_id:
# ignore any updates before the initial update id
return
elif ms... | python | def _process_depth_message(self, msg, buffer=False):
"""Process a depth event message.
:param msg: Depth event message.
:return:
"""
if buffer and msg['u'] <= self._last_update_id:
# ignore any updates before the initial update id
return
elif ms... | [
"def",
"_process_depth_message",
"(",
"self",
",",
"msg",
",",
"buffer",
"=",
"False",
")",
":",
"if",
"buffer",
"and",
"msg",
"[",
"'u'",
"]",
"<=",
"self",
".",
"_last_update_id",
":",
"# ignore any updates before the initial update id",
"return",
"elif",
"msg... | Process a depth event message.
:param msg: Depth event message.
:return: | [
"Process",
"a",
"depth",
"event",
"message",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L221-L254 | train | Process a depth event message. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/depthcache.py | DepthCacheManager.close | def close(self, close_socket=False):
"""Close the open socket for this manager
:return:
"""
self._bm.stop_socket(self._conn_key)
if close_socket:
self._bm.close()
time.sleep(1)
self._depth_cache = None | python | def close(self, close_socket=False):
"""Close the open socket for this manager
:return:
"""
self._bm.stop_socket(self._conn_key)
if close_socket:
self._bm.close()
time.sleep(1)
self._depth_cache = None | [
"def",
"close",
"(",
"self",
",",
"close_socket",
"=",
"False",
")",
":",
"self",
".",
"_bm",
".",
"stop_socket",
"(",
"self",
".",
"_conn_key",
")",
"if",
"close_socket",
":",
"self",
".",
"_bm",
".",
"close",
"(",
")",
"time",
".",
"sleep",
"(",
... | Close the open socket for this manager
:return: | [
"Close",
"the",
"open",
"socket",
"for",
"this",
"manager"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/depthcache.py#L264-L273 | train | Close the open socket for this manager. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | examples/save_historical_data.py | date_to_milliseconds | def date_to_milliseconds(date_str):
"""Convert UTC date to milliseconds
If using offset strings add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"
See dateparse docs for formats http://dateparser.readthedocs.io/en/latest/
:param date_str: date in readable format, i.e. "January 01, 2018", "11... | python | def date_to_milliseconds(date_str):
"""Convert UTC date to milliseconds
If using offset strings add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"
See dateparse docs for formats http://dateparser.readthedocs.io/en/latest/
:param date_str: date in readable format, i.e. "January 01, 2018", "11... | [
"def",
"date_to_milliseconds",
"(",
"date_str",
")",
":",
"# get epoch value in UTC",
"epoch",
"=",
"datetime",
".",
"utcfromtimestamp",
"(",
"0",
")",
".",
"replace",
"(",
"tzinfo",
"=",
"pytz",
".",
"utc",
")",
"# parse our date string",
"d",
"=",
"dateparser"... | Convert UTC date to milliseconds
If using offset strings add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"
See dateparse docs for formats http://dateparser.readthedocs.io/en/latest/
:param date_str: date in readable format, i.e. "January 01, 2018", "11 hours ago UTC", "now UTC"
:type date_s... | [
"Convert",
"UTC",
"date",
"to",
"milliseconds"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/examples/save_historical_data.py#L10-L29 | train | Convert a UTC date to milliseconds | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | examples/save_historical_data.py | interval_to_milliseconds | def interval_to_milliseconds(interval):
"""Convert a Binance interval string to milliseconds
:param interval: Binance interval string 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w
:type interval: str
:return:
None if unit not one of m, h, d or w
None if string not in corr... | python | def interval_to_milliseconds(interval):
"""Convert a Binance interval string to milliseconds
:param interval: Binance interval string 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w
:type interval: str
:return:
None if unit not one of m, h, d or w
None if string not in corr... | [
"def",
"interval_to_milliseconds",
"(",
"interval",
")",
":",
"ms",
"=",
"None",
"seconds_per_unit",
"=",
"{",
"\"m\"",
":",
"60",
",",
"\"h\"",
":",
"60",
"*",
"60",
",",
"\"d\"",
":",
"24",
"*",
"60",
"*",
"60",
",",
"\"w\"",
":",
"7",
"*",
"24",... | Convert a Binance interval string to milliseconds
:param interval: Binance interval string 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w
:type interval: str
:return:
None if unit not one of m, h, d or w
None if string not in correct format
int value of interval in mi... | [
"Convert",
"a",
"Binance",
"interval",
"string",
"to",
"milliseconds"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/examples/save_historical_data.py#L32-L57 | train | Convert a Binance interval string to milliseconds | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | examples/save_historical_data.py | get_historical_klines | def get_historical_klines(symbol, interval, start_str, end_str=None):
"""Get Historical Klines from Binance
See dateparse docs for valid start and end string formats http://dateparser.readthedocs.io/en/latest/
If using offset strings for dates add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"
... | python | def get_historical_klines(symbol, interval, start_str, end_str=None):
"""Get Historical Klines from Binance
See dateparse docs for valid start and end string formats http://dateparser.readthedocs.io/en/latest/
If using offset strings for dates add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"
... | [
"def",
"get_historical_klines",
"(",
"symbol",
",",
"interval",
",",
"start_str",
",",
"end_str",
"=",
"None",
")",
":",
"# create the Binance client, no need for api key",
"client",
"=",
"Client",
"(",
"\"\"",
",",
"\"\"",
")",
"# init our list",
"output_data",
"="... | Get Historical Klines from Binance
See dateparse docs for valid start and end string formats http://dateparser.readthedocs.io/en/latest/
If using offset strings for dates add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"
:param symbol: Name of symbol pair e.g BNBBTC
:type symbol: str
:p... | [
"Get",
"Historical",
"Klines",
"from",
"Binance"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/examples/save_historical_data.py#L60-L136 | train | Get the Historical Klines from Binance | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client._order_params | def _order_params(self, data):
"""Convert params to list with signature as last element
:param data:
:return:
"""
has_signature = False
params = []
for key, value in data.items():
if key == 'signature':
has_signature = True
... | python | def _order_params(self, data):
"""Convert params to list with signature as last element
:param data:
:return:
"""
has_signature = False
params = []
for key, value in data.items():
if key == 'signature':
has_signature = True
... | [
"def",
"_order_params",
"(",
"self",
",",
"data",
")",
":",
"has_signature",
"=",
"False",
"params",
"=",
"[",
"]",
"for",
"key",
",",
"value",
"in",
"data",
".",
"items",
"(",
")",
":",
"if",
"key",
"==",
"'signature'",
":",
"has_signature",
"=",
"T... | Convert params to list with signature as last element
:param data:
:return: | [
"Convert",
"params",
"to",
"list",
"with",
"signature",
"as",
"last",
"element"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L121-L139 | train | Convert params to list with signature as last element | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client._handle_response | def _handle_response(self, response):
"""Internal helper for handling API responses from the Binance server.
Raises the appropriate exceptions when necessary; otherwise, returns the
response.
"""
if not str(response.status_code).startswith('2'):
raise BinanceAPIExcept... | python | def _handle_response(self, response):
"""Internal helper for handling API responses from the Binance server.
Raises the appropriate exceptions when necessary; otherwise, returns the
response.
"""
if not str(response.status_code).startswith('2'):
raise BinanceAPIExcept... | [
"def",
"_handle_response",
"(",
"self",
",",
"response",
")",
":",
"if",
"not",
"str",
"(",
"response",
".",
"status_code",
")",
".",
"startswith",
"(",
"'2'",
")",
":",
"raise",
"BinanceAPIException",
"(",
"response",
")",
"try",
":",
"return",
"response"... | Internal helper for handling API responses from the Binance server.
Raises the appropriate exceptions when necessary; otherwise, returns the
response. | [
"Internal",
"helper",
"for",
"handling",
"API",
"responses",
"from",
"the",
"Binance",
"server",
".",
"Raises",
"the",
"appropriate",
"exceptions",
"when",
"necessary",
";",
"otherwise",
"returns",
"the",
"response",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L194-L204 | train | Internal helper for handling the response from the Binance server. Raises the appropriate exceptions when necessary ; otherwise returns the response. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_symbol_info | def get_symbol_info(self, symbol):
"""Return information about a symbol
:param symbol: required e.g BNBBTC
:type symbol: str
:returns: Dict if found, None if not
.. code-block:: python
{
"symbol": "ETHBTC",
"status": "TRADING",
... | python | def get_symbol_info(self, symbol):
"""Return information about a symbol
:param symbol: required e.g BNBBTC
:type symbol: str
:returns: Dict if found, None if not
.. code-block:: python
{
"symbol": "ETHBTC",
"status": "TRADING",
... | [
"def",
"get_symbol_info",
"(",
"self",
",",
"symbol",
")",
":",
"res",
"=",
"self",
".",
"_get",
"(",
"'exchangeInfo'",
")",
"for",
"item",
"in",
"res",
"[",
"'symbols'",
"]",
":",
"if",
"item",
"[",
"'symbol'",
"]",
"==",
"symbol",
".",
"upper",
"("... | Return information about a symbol
:param symbol: required e.g BNBBTC
:type symbol: str
:returns: Dict if found, None if not
.. code-block:: python
{
"symbol": "ETHBTC",
"status": "TRADING",
"baseAsset": "ETH",
... | [
"Return",
"information",
"about",
"a",
"symbol"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L298-L345 | train | Returns information about a symbol in the BNBBTC. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.aggregate_trade_iter | def aggregate_trade_iter(self, symbol, start_str=None, last_id=None):
"""Iterate over aggregate trade data from (start_time or last_id) to
the end of the history so far.
If start_time is specified, start with the first trade after
start_time. Meant to initialise a local cache of trade d... | python | def aggregate_trade_iter(self, symbol, start_str=None, last_id=None):
"""Iterate over aggregate trade data from (start_time or last_id) to
the end of the history so far.
If start_time is specified, start with the first trade after
start_time. Meant to initialise a local cache of trade d... | [
"def",
"aggregate_trade_iter",
"(",
"self",
",",
"symbol",
",",
"start_str",
"=",
"None",
",",
"last_id",
"=",
"None",
")",
":",
"if",
"start_str",
"is",
"not",
"None",
"and",
"last_id",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"'start_time an... | Iterate over aggregate trade data from (start_time or last_id) to
the end of the history so far.
If start_time is specified, start with the first trade after
start_time. Meant to initialise a local cache of trade data.
If last_id is specified, start with the trade after it. This is mea... | [
"Iterate",
"over",
"aggregate",
"trade",
"data",
"from",
"(",
"start_time",
"or",
"last_id",
")",
"to",
"the",
"end",
"of",
"the",
"history",
"so",
"far",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L579-L663 | train | Iterate over aggregate trade data from start_str or last_id. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client._get_earliest_valid_timestamp | def _get_earliest_valid_timestamp(self, symbol, interval):
"""Get earliest valid open timestamp from Binance
:param symbol: Name of symbol pair e.g BNBBTC
:type symbol: str
:param interval: Binance Kline interval
:type interval: str
:return: first valid timestamp
... | python | def _get_earliest_valid_timestamp(self, symbol, interval):
"""Get earliest valid open timestamp from Binance
:param symbol: Name of symbol pair e.g BNBBTC
:type symbol: str
:param interval: Binance Kline interval
:type interval: str
:return: first valid timestamp
... | [
"def",
"_get_earliest_valid_timestamp",
"(",
"self",
",",
"symbol",
",",
"interval",
")",
":",
"kline",
"=",
"self",
".",
"get_klines",
"(",
"symbol",
"=",
"symbol",
",",
"interval",
"=",
"interval",
",",
"limit",
"=",
"1",
",",
"startTime",
"=",
"0",
",... | Get earliest valid open timestamp from Binance
:param symbol: Name of symbol pair e.g BNBBTC
:type symbol: str
:param interval: Binance Kline interval
:type interval: str
:return: first valid timestamp | [
"Get",
"earliest",
"valid",
"open",
"timestamp",
"from",
"Binance"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L707-L725 | train | Get earliest valid open timestamp from Binance Kline | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_historical_klines | def get_historical_klines(self, symbol, interval, start_str, end_str=None,
limit=500):
"""Get Historical Klines from Binance
See dateparser docs for valid start and end string formats http://dateparser.readthedocs.io/en/latest/
If using offset strings for dates ad... | python | def get_historical_klines(self, symbol, interval, start_str, end_str=None,
limit=500):
"""Get Historical Klines from Binance
See dateparser docs for valid start and end string formats http://dateparser.readthedocs.io/en/latest/
If using offset strings for dates ad... | [
"def",
"get_historical_klines",
"(",
"self",
",",
"symbol",
",",
"interval",
",",
"start_str",
",",
"end_str",
"=",
"None",
",",
"limit",
"=",
"500",
")",
":",
"# init our list",
"output_data",
"=",
"[",
"]",
"# setup the max limit",
"limit",
"=",
"limit",
"... | Get Historical Klines from Binance
See dateparser docs for valid start and end string formats http://dateparser.readthedocs.io/en/latest/
If using offset strings for dates add "UTC" to date string e.g. "now UTC", "11 hours ago UTC"
:param symbol: Name of symbol pair e.g BNBBTC
:type s... | [
"Get",
"Historical",
"Klines",
"from",
"Binance"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L727-L810 | train | Get the historical klines from the Binance entry table. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_symbol_ticker | def get_symbol_ticker(self, **params):
"""Latest price for a symbol or symbols.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#24hr-ticker-price-change-statistics
:param symbol:
:type symbol: str
:returns: API response
.. code-bl... | python | def get_symbol_ticker(self, **params):
"""Latest price for a symbol or symbols.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#24hr-ticker-price-change-statistics
:param symbol:
:type symbol: str
:returns: API response
.. code-bl... | [
"def",
"get_symbol_ticker",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"return",
"self",
".",
"_get",
"(",
"'ticker/price'",
",",
"data",
"=",
"params",
",",
"version",
"=",
"self",
".",
"PRIVATE_API_VERSION",
")"
] | Latest price for a symbol or symbols.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#24hr-ticker-price-change-statistics
:param symbol:
:type symbol: str
:returns: API response
.. code-block:: python
{
"symbo... | [
"Latest",
"price",
"for",
"a",
"symbol",
"or",
"symbols",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L952-L987 | train | Get the latest price for a symbol or symbols. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_orderbook_ticker | def get_orderbook_ticker(self, **params):
"""Latest price for a symbol or symbols.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#symbol-order-book-ticker
:param symbol:
:type symbol: str
:returns: API response
.. code-block:: py... | python | def get_orderbook_ticker(self, **params):
"""Latest price for a symbol or symbols.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#symbol-order-book-ticker
:param symbol:
:type symbol: str
:returns: API response
.. code-block:: py... | [
"def",
"get_orderbook_ticker",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"return",
"self",
".",
"_get",
"(",
"'ticker/bookTicker'",
",",
"data",
"=",
"params",
",",
"version",
"=",
"self",
".",
"PRIVATE_API_VERSION",
")"
] | Latest price for a symbol or symbols.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#symbol-order-book-ticker
:param symbol:
:type symbol: str
:returns: API response
.. code-block:: python
{
"symbol": "LTCBTC... | [
"Latest",
"price",
"for",
"a",
"symbol",
"or",
"symbols",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L989-L1033 | train | Get the latest price for a symbol or symbols. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.order_limit | def order_limit(self, timeInForce=TIME_IN_FORCE_GTC, **params):
"""Send in a new limit order
Any order with an icebergQty MUST have timeInForce set to GTC.
:param symbol: required
:type symbol: str
:param side: required
:type side: str
:param quantity: required
... | python | def order_limit(self, timeInForce=TIME_IN_FORCE_GTC, **params):
"""Send in a new limit order
Any order with an icebergQty MUST have timeInForce set to GTC.
:param symbol: required
:type symbol: str
:param side: required
:type side: str
:param quantity: required
... | [
"def",
"order_limit",
"(",
"self",
",",
"timeInForce",
"=",
"TIME_IN_FORCE_GTC",
",",
"*",
"*",
"params",
")",
":",
"params",
".",
"update",
"(",
"{",
"'type'",
":",
"self",
".",
"ORDER_TYPE_LIMIT",
",",
"'timeInForce'",
":",
"timeInForce",
"}",
")",
"retu... | Send in a new limit order
Any order with an icebergQty MUST have timeInForce set to GTC.
:param symbol: required
:type symbol: str
:param side: required
:type side: str
:param quantity: required
:type quantity: decimal
:param price: required
:typ... | [
"Send",
"in",
"a",
"new",
"limit",
"order"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1151-L1186 | train | Send in a new limit order | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.order_limit_buy | def order_limit_buy(self, timeInForce=TIME_IN_FORCE_GTC, **params):
"""Send in a new limit buy order
Any order with an icebergQty MUST have timeInForce set to GTC.
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param... | python | def order_limit_buy(self, timeInForce=TIME_IN_FORCE_GTC, **params):
"""Send in a new limit buy order
Any order with an icebergQty MUST have timeInForce set to GTC.
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param... | [
"def",
"order_limit_buy",
"(",
"self",
",",
"timeInForce",
"=",
"TIME_IN_FORCE_GTC",
",",
"*",
"*",
"params",
")",
":",
"params",
".",
"update",
"(",
"{",
"'side'",
":",
"self",
".",
"SIDE_BUY",
",",
"}",
")",
"return",
"self",
".",
"order_limit",
"(",
... | Send in a new limit buy order
Any order with an icebergQty MUST have timeInForce set to GTC.
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param price: required
:type price: str
:param timeInForce: default G... | [
"Send",
"in",
"a",
"new",
"limit",
"buy",
"order"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1188-L1222 | train | Send in a new limit buy order | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.order_limit_sell | def order_limit_sell(self, timeInForce=TIME_IN_FORCE_GTC, **params):
"""Send in a new limit sell order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param price: required
:type price: str
:param timeInForce: ... | python | def order_limit_sell(self, timeInForce=TIME_IN_FORCE_GTC, **params):
"""Send in a new limit sell order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param price: required
:type price: str
:param timeInForce: ... | [
"def",
"order_limit_sell",
"(",
"self",
",",
"timeInForce",
"=",
"TIME_IN_FORCE_GTC",
",",
"*",
"*",
"params",
")",
":",
"params",
".",
"update",
"(",
"{",
"'side'",
":",
"self",
".",
"SIDE_SELL",
"}",
")",
"return",
"self",
".",
"order_limit",
"(",
"tim... | Send in a new limit sell order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param price: required
:type price: str
:param timeInForce: default Good till cancelled
:type timeInForce: str
:param newCli... | [
"Send",
"in",
"a",
"new",
"limit",
"sell",
"order"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1224-L1256 | train | Send in a new limit sell order | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.order_market | def order_market(self, **params):
"""Send in a new market order
:param symbol: required
:type symbol: str
:param side: required
:type side: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatic... | python | def order_market(self, **params):
"""Send in a new market order
:param symbol: required
:type symbol: str
:param side: required
:type side: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatic... | [
"def",
"order_market",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"params",
".",
"update",
"(",
"{",
"'type'",
":",
"self",
".",
"ORDER_TYPE_MARKET",
"}",
")",
"return",
"self",
".",
"create_order",
"(",
"*",
"*",
"params",
")"
] | Send in a new market order
:param symbol: required
:type symbol: str
:param side: required
:type side: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatically generated if not sent.
:type new... | [
"Send",
"in",
"a",
"new",
"market",
"order"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1258-L1284 | train | Send in a new market order | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.order_market_buy | def order_market_buy(self, **params):
"""Send in a new market buy order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatically generated if not sent.
:type newC... | python | def order_market_buy(self, **params):
"""Send in a new market buy order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatically generated if not sent.
:type newC... | [
"def",
"order_market_buy",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"params",
".",
"update",
"(",
"{",
"'side'",
":",
"self",
".",
"SIDE_BUY",
"}",
")",
"return",
"self",
".",
"order_market",
"(",
"*",
"*",
"params",
")"
] | Send in a new market buy order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatically generated if not sent.
:type newClientOrderId: str
:param newOrderRespType... | [
"Send",
"in",
"a",
"new",
"market",
"buy",
"order"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1286-L1310 | train | Send in a new market buy order | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.order_market_sell | def order_market_sell(self, **params):
"""Send in a new market sell order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatically generated if not sent.
:type ne... | python | def order_market_sell(self, **params):
"""Send in a new market sell order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatically generated if not sent.
:type ne... | [
"def",
"order_market_sell",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"params",
".",
"update",
"(",
"{",
"'side'",
":",
"self",
".",
"SIDE_SELL",
"}",
")",
"return",
"self",
".",
"order_market",
"(",
"*",
"*",
"params",
")"
] | Send in a new market sell order
:param symbol: required
:type symbol: str
:param quantity: required
:type quantity: decimal
:param newClientOrderId: A unique id for the order. Automatically generated if not sent.
:type newClientOrderId: str
:param newOrderRespTyp... | [
"Send",
"in",
"a",
"new",
"market",
"sell",
"order"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1312-L1336 | train | Send in a new market sell order | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_asset_balance | def get_asset_balance(self, asset, **params):
"""Get current asset balance.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-information-user_data
:param asset: required
:type asset: str
:param recvWindow: the number of milliseconds ... | python | def get_asset_balance(self, asset, **params):
"""Get current asset balance.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-information-user_data
:param asset: required
:type asset: str
:param recvWindow: the number of milliseconds ... | [
"def",
"get_asset_balance",
"(",
"self",
",",
"asset",
",",
"*",
"*",
"params",
")",
":",
"res",
"=",
"self",
".",
"get_account",
"(",
"*",
"*",
"params",
")",
"# find asset balance in list of balances",
"if",
"\"balances\"",
"in",
"res",
":",
"for",
"bal",
... | Get current asset balance.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#account-information-user_data
:param asset: required
:type asset: str
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
... | [
"Get",
"current",
"asset",
"balance",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1565-L1594 | train | Get current asset balance. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_account_status | def get_account_status(self, **params):
"""Get account status detail.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#account-status-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:re... | python | def get_account_status(self, **params):
"""Get account status detail.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#account-status-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:re... | [
"def",
"get_account_status",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"res",
"=",
"self",
".",
"_request_withdraw_api",
"(",
"'get'",
",",
"'accountStatus.html'",
",",
"True",
",",
"data",
"=",
"params",
")",
"if",
"not",
"res",
"[",
"'success'",
... | Get account status detail.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#account-status-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:returns: API response
.. code-block:: python... | [
"Get",
"account",
"status",
"detail",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1652-L1678 | train | Get account status detail. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_dust_log | def get_dust_log(self, **params):
"""Get log of small amounts exchanged for BNB.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#dustlog-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
... | python | def get_dust_log(self, **params):
"""Get log of small amounts exchanged for BNB.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#dustlog-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
... | [
"def",
"get_dust_log",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"res",
"=",
"self",
".",
"_request_withdraw_api",
"(",
"'get'",
",",
"'userAssetDribbletLog.html'",
",",
"True",
",",
"data",
"=",
"params",
")",
"if",
"not",
"res",
"[",
"'success'",
... | Get log of small amounts exchanged for BNB.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#dustlog-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:returns: API response
.. code-bloc... | [
"Get",
"log",
"of",
"small",
"amounts",
"exchanged",
"for",
"BNB",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1680-L1759 | train | Get log of small amounts exchanged for BNB. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_trade_fee | def get_trade_fee(self, **params):
"""Get trade fee.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#trade-fee-user_data
:param symbol: optional
:type symbol: str
:param recvWindow: the number of milliseconds the request is valid for
... | python | def get_trade_fee(self, **params):
"""Get trade fee.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#trade-fee-user_data
:param symbol: optional
:type symbol: str
:param recvWindow: the number of milliseconds the request is valid for
... | [
"def",
"get_trade_fee",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"res",
"=",
"self",
".",
"_request_withdraw_api",
"(",
"'get'",
",",
"'tradeFee.html'",
",",
"True",
",",
"data",
"=",
"params",
")",
"if",
"not",
"res",
"[",
"'success'",
"]",
":"... | Get trade fee.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#trade-fee-user_data
:param symbol: optional
:type symbol: str
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:returns: API... | [
"Get",
"trade",
"fee",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1761-L1796 | train | Get trade fee. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.get_asset_details | def get_asset_details(self, **params):
"""Fetch details on assets.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#asset-detail-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:returns... | python | def get_asset_details(self, **params):
"""Fetch details on assets.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#asset-detail-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:returns... | [
"def",
"get_asset_details",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"res",
"=",
"self",
".",
"_request_withdraw_api",
"(",
"'get'",
",",
"'assetDetail.html'",
",",
"True",
",",
"data",
"=",
"params",
")",
"if",
"not",
"res",
"[",
"'success'",
"]"... | Fetch details on assets.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#asset-detail-user_data
:param recvWindow: the number of milliseconds the request is valid for
:type recvWindow: int
:returns: API response
.. code-block:: python
... | [
"Fetch",
"details",
"on",
"assets",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1798-L1835 | train | Fetch details on assets. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.withdraw | def withdraw(self, **params):
"""Submit a withdraw request.
https://www.binance.com/restapipub.html
Assumptions:
- You must have Withdraw permissions enabled on your API key
- You must have withdrawn to the address specified through the website and approved the transaction via... | python | def withdraw(self, **params):
"""Submit a withdraw request.
https://www.binance.com/restapipub.html
Assumptions:
- You must have Withdraw permissions enabled on your API key
- You must have withdrawn to the address specified through the website and approved the transaction via... | [
"def",
"withdraw",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"# force a name for the withdrawal if one not set",
"if",
"'asset'",
"in",
"params",
"and",
"'name'",
"not",
"in",
"params",
":",
"params",
"[",
"'name'",
"]",
"=",
"params",
"[",
"'asset'",
... | Submit a withdraw request.
https://www.binance.com/restapipub.html
Assumptions:
- You must have Withdraw permissions enabled on your API key
- You must have withdrawn to the address specified through the website and approved the transaction via email
:param asset: required
... | [
"Submit",
"a",
"withdraw",
"request",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L1839-L1881 | train | Submit a withdraw request. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.stream_keepalive | def stream_keepalive(self, listenKey):
"""PING a user data stream to prevent a time out.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#keepalive-user-data-stream-user_stream
:param listenKey: required
:type listenKey: str
:returns: API r... | python | def stream_keepalive(self, listenKey):
"""PING a user data stream to prevent a time out.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#keepalive-user-data-stream-user_stream
:param listenKey: required
:type listenKey: str
:returns: API r... | [
"def",
"stream_keepalive",
"(",
"self",
",",
"listenKey",
")",
":",
"params",
"=",
"{",
"'listenKey'",
":",
"listenKey",
"}",
"return",
"self",
".",
"_put",
"(",
"'userDataStream'",
",",
"False",
",",
"data",
"=",
"params",
")"
] | PING a user data stream to prevent a time out.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#keepalive-user-data-stream-user_stream
:param listenKey: required
:type listenKey: str
:returns: API response
.. code-block:: python
... | [
"PING",
"a",
"user",
"data",
"stream",
"to",
"prevent",
"a",
"time",
"out",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L2039-L2059 | train | PING a user data stream to prevent a time out. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/client.py | Client.stream_close | def stream_close(self, listenKey):
"""Close out a user data stream.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#close-user-data-stream-user_stream
:param listenKey: required
:type listenKey: str
:returns: API response
.. code-... | python | def stream_close(self, listenKey):
"""Close out a user data stream.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#close-user-data-stream-user_stream
:param listenKey: required
:type listenKey: str
:returns: API response
.. code-... | [
"def",
"stream_close",
"(",
"self",
",",
"listenKey",
")",
":",
"params",
"=",
"{",
"'listenKey'",
":",
"listenKey",
"}",
"return",
"self",
".",
"_delete",
"(",
"'userDataStream'",
",",
"False",
",",
"data",
"=",
"params",
")"
] | Close out a user data stream.
https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#close-user-data-stream-user_stream
:param listenKey: required
:type listenKey: str
:returns: API response
.. code-block:: python
{}
:raise... | [
"Close",
"out",
"a",
"user",
"data",
"stream",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/client.py#L2061-L2081 | train | Close out a user data stream. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/websockets.py | BinanceSocketManager.start_depth_socket | def start_depth_socket(self, symbol, callback, depth=None):
"""Start a websocket for symbol market depth returning either a diff or a partial book
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#partial-book-depth-streams
:param symbol: required
... | python | def start_depth_socket(self, symbol, callback, depth=None):
"""Start a websocket for symbol market depth returning either a diff or a partial book
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#partial-book-depth-streams
:param symbol: required
... | [
"def",
"start_depth_socket",
"(",
"self",
",",
"symbol",
",",
"callback",
",",
"depth",
"=",
"None",
")",
":",
"socket_name",
"=",
"symbol",
".",
"lower",
"(",
")",
"+",
"'@depth'",
"if",
"depth",
"and",
"depth",
"!=",
"'1'",
":",
"socket_name",
"=",
"... | Start a websocket for symbol market depth returning either a diff or a partial book
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#partial-book-depth-streams
:param symbol: required
:type symbol: str
:param callback: callback function to... | [
"Start",
"a",
"websocket",
"for",
"symbol",
"market",
"depth",
"returning",
"either",
"a",
"diff",
"or",
"a",
"partial",
"book"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/websockets.py#L105-L172 | train | Start a websocket for the given symbol market depth | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/websockets.py | BinanceSocketManager.start_kline_socket | def start_kline_socket(self, symbol, callback, interval=Client.KLINE_INTERVAL_1MINUTE):
"""Start a websocket for symbol kline data
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#klinecandlestick-streams
:param symbol: required
:type symb... | python | def start_kline_socket(self, symbol, callback, interval=Client.KLINE_INTERVAL_1MINUTE):
"""Start a websocket for symbol kline data
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#klinecandlestick-streams
:param symbol: required
:type symb... | [
"def",
"start_kline_socket",
"(",
"self",
",",
"symbol",
",",
"callback",
",",
"interval",
"=",
"Client",
".",
"KLINE_INTERVAL_1MINUTE",
")",
":",
"socket_name",
"=",
"'{}@kline_{}'",
".",
"format",
"(",
"symbol",
".",
"lower",
"(",
")",
",",
"interval",
")"... | Start a websocket for symbol kline data
https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#klinecandlestick-streams
:param symbol: required
:type symbol: str
:param callback: callback function to handle messages
:type callback: funct... | [
"Start",
"a",
"websocket",
"for",
"symbol",
"kline",
"data"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/websockets.py#L174-L218 | train | Start a websocket for a given symbol kline. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/websockets.py | BinanceSocketManager.start_multiplex_socket | def start_multiplex_socket(self, streams, callback):
"""Start a multiplexed socket using a list of socket names.
User stream sockets can not be included.
Symbols in socket name must be lowercase i.e bnbbtc@aggTrade, neobtc@ticker
Combined stream events are wrapped as follows: {"stream"... | python | def start_multiplex_socket(self, streams, callback):
"""Start a multiplexed socket using a list of socket names.
User stream sockets can not be included.
Symbols in socket name must be lowercase i.e bnbbtc@aggTrade, neobtc@ticker
Combined stream events are wrapped as follows: {"stream"... | [
"def",
"start_multiplex_socket",
"(",
"self",
",",
"streams",
",",
"callback",
")",
":",
"stream_path",
"=",
"'streams={}'",
".",
"format",
"(",
"'/'",
".",
"join",
"(",
"streams",
")",
")",
"return",
"self",
".",
"_start_socket",
"(",
"stream_path",
",",
... | Start a multiplexed socket using a list of socket names.
User stream sockets can not be included.
Symbols in socket name must be lowercase i.e bnbbtc@aggTrade, neobtc@ticker
Combined stream events are wrapped as follows: {"stream":"<streamName>","data":<rawPayload>}
https://github.com... | [
"Start",
"a",
"multiplexed",
"socket",
"using",
"a",
"list",
"of",
"socket",
"names",
".",
"User",
"stream",
"sockets",
"can",
"not",
"be",
"included",
"."
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/websockets.py#L409-L430 | train | Start a multiplexed socket using a list of socket names. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/websockets.py | BinanceSocketManager.start_user_socket | def start_user_socket(self, callback):
"""Start a websocket for user data
https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md
:param callback: callback function to handle messages
:type callback: function
:returns: connection key strin... | python | def start_user_socket(self, callback):
"""Start a websocket for user data
https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md
:param callback: callback function to handle messages
:type callback: function
:returns: connection key strin... | [
"def",
"start_user_socket",
"(",
"self",
",",
"callback",
")",
":",
"# Get the user listen key",
"user_listen_key",
"=",
"self",
".",
"_client",
".",
"stream_get_listen_key",
"(",
")",
"# and start the socket with this specific key",
"conn_key",
"=",
"self",
".",
"_star... | Start a websocket for user data
https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md
:param callback: callback function to handle messages
:type callback: function
:returns: connection key string if successful, False otherwise
Message ... | [
"Start",
"a",
"websocket",
"for",
"user",
"data"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/websockets.py#L432-L448 | train | Start a websocket for the user data | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/websockets.py | BinanceSocketManager.stop_socket | def stop_socket(self, conn_key):
"""Stop a websocket given the connection key
:param conn_key: Socket connection key
:type conn_key: string
:returns: connection key string if successful, False otherwise
"""
if conn_key not in self._conns:
return
# d... | python | def stop_socket(self, conn_key):
"""Stop a websocket given the connection key
:param conn_key: Socket connection key
:type conn_key: string
:returns: connection key string if successful, False otherwise
"""
if conn_key not in self._conns:
return
# d... | [
"def",
"stop_socket",
"(",
"self",
",",
"conn_key",
")",
":",
"if",
"conn_key",
"not",
"in",
"self",
".",
"_conns",
":",
"return",
"# disable reconnecting if we are closing",
"self",
".",
"_conns",
"[",
"conn_key",
"]",
".",
"factory",
"=",
"WebSocketClientFacto... | Stop a websocket given the connection key
:param conn_key: Socket connection key
:type conn_key: string
:returns: connection key string if successful, False otherwise | [
"Stop",
"a",
"websocket",
"given",
"the",
"connection",
"key"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/websockets.py#L484-L502 | train | Stop a websocket given the connection key. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
sammchardy/python-binance | binance/websockets.py | BinanceSocketManager.close | def close(self):
"""Close all connections
"""
keys = set(self._conns.keys())
for key in keys:
self.stop_socket(key)
self._conns = {} | python | def close(self):
"""Close all connections
"""
keys = set(self._conns.keys())
for key in keys:
self.stop_socket(key)
self._conns = {} | [
"def",
"close",
"(",
"self",
")",
":",
"keys",
"=",
"set",
"(",
"self",
".",
"_conns",
".",
"keys",
"(",
")",
")",
"for",
"key",
"in",
"keys",
":",
"self",
".",
"stop_socket",
"(",
"key",
")",
"self",
".",
"_conns",
"=",
"{",
"}"
] | Close all connections | [
"Close",
"all",
"connections"
] | 31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc | https://github.com/sammchardy/python-binance/blob/31c0d0a32f9edd528c6c2c1dd3044d9a34ce43cc/binance/websockets.py#L519-L527 | train | Close all connections and remove all associated resources | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/plugins/heat_map_withtime.py | HeatMapWithTime._get_self_bounds | def _get_self_bounds(self):
"""
Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]].
"""
bounds = [[None, None], [None, None]]
for point in self.data:
bounds = [
[
... | python | def _get_self_bounds(self):
"""
Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]].
"""
bounds = [[None, None], [None, None]]
for point in self.data:
bounds = [
[
... | [
"def",
"_get_self_bounds",
"(",
"self",
")",
":",
"bounds",
"=",
"[",
"[",
"None",
",",
"None",
"]",
",",
"[",
"None",
",",
"None",
"]",
"]",
"for",
"point",
"in",
"self",
".",
"data",
":",
"bounds",
"=",
"[",
"[",
"none_min",
"(",
"bounds",
"[",... | Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]]. | [
"Computes",
"the",
"bounds",
"of",
"the",
"object",
"itself",
"(",
"not",
"including",
"it",
"s",
"children",
")",
"in",
"the",
"form",
"[[",
"lat_min",
"lon_min",
"]",
"[",
"lat_max",
"lon_max",
"]]",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/plugins/heat_map_withtime.py#L267-L285 | train | Computes the bounds of the object itself and its children. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/vector_layers.py | path_options | def path_options(line=False, radius=False, **kwargs):
"""
Contains options and constants shared between vector overlays
(Polygon, Polyline, Circle, CircleMarker, and Rectangle).
Parameters
----------
stroke: Bool, True
Whether to draw stroke along the path.
Set it to false to di... | python | def path_options(line=False, radius=False, **kwargs):
"""
Contains options and constants shared between vector overlays
(Polygon, Polyline, Circle, CircleMarker, and Rectangle).
Parameters
----------
stroke: Bool, True
Whether to draw stroke along the path.
Set it to false to di... | [
"def",
"path_options",
"(",
"line",
"=",
"False",
",",
"radius",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"extra_options",
"=",
"{",
"}",
"if",
"line",
":",
"extra_options",
"=",
"{",
"'smoothFactor'",
":",
"kwargs",
".",
"pop",
"(",
"'smooth_f... | Contains options and constants shared between vector overlays
(Polygon, Polyline, Circle, CircleMarker, and Rectangle).
Parameters
----------
stroke: Bool, True
Whether to draw stroke along the path.
Set it to false to disable borders on polygons or circles.
color: str, '#3388ff'
... | [
"Contains",
"options",
"and",
"constants",
"shared",
"between",
"vector",
"overlays",
"(",
"Polygon",
"Polyline",
"Circle",
"CircleMarker",
"and",
"Rectangle",
")",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/vector_layers.py#L16-L99 | train | Returns a list of options and constants shared between vector overlays and path elements. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | Vega.render | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
self.json = json.dumps(self.data)
self._parent.html.add_child(Element(Template("""
<div id="{{this.get_name()}}"></div>
""").render(this=self, kwargs=kwargs)), name=self.get_name())
... | python | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
self.json = json.dumps(self.data)
self._parent.html.add_child(Element(Template("""
<div id="{{this.get_name()}}"></div>
""").render(this=self, kwargs=kwargs)), name=self.get_name())
... | [
"def",
"render",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"json",
"=",
"json",
".",
"dumps",
"(",
"self",
".",
"data",
")",
"self",
".",
"_parent",
".",
"html",
".",
"add_child",
"(",
"Element",
"(",
"Template",
"(",
"\"\"\"\n ... | Renders the HTML representation of the element. | [
"Renders",
"the",
"HTML",
"representation",
"of",
"the",
"element",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L147-L188 | train | Renders the HTML representation of the element. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | VegaLite.render | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
vegalite_major_version = self._get_vegalite_major_versions(self.data)
self._parent.html.add_child(Element(Template("""
<div id="{{this.get_name()}}"></div>
""").render(this=self, kwargs=kwa... | python | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
vegalite_major_version = self._get_vegalite_major_versions(self.data)
self._parent.html.add_child(Element(Template("""
<div id="{{this.get_name()}}"></div>
""").render(this=self, kwargs=kwa... | [
"def",
"render",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"vegalite_major_version",
"=",
"self",
".",
"_get_vegalite_major_versions",
"(",
"self",
".",
"data",
")",
"self",
".",
"_parent",
".",
"html",
".",
"add_child",
"(",
"Element",
"(",
"Templat... | Renders the HTML representation of the element. | [
"Renders",
"the",
"HTML",
"representation",
"of",
"the",
"element",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L241-L271 | train | Renders the HTML representation of the element. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJson.process_data | def process_data(self, data):
"""Convert an unknown data input into a geojson dictionary."""
if isinstance(data, dict):
self.embed = True
return data
elif isinstance(data, str):
if data.lower().startswith(('http:', 'ftp:', 'https:')):
if not se... | python | def process_data(self, data):
"""Convert an unknown data input into a geojson dictionary."""
if isinstance(data, dict):
self.embed = True
return data
elif isinstance(data, str):
if data.lower().startswith(('http:', 'ftp:', 'https:')):
if not se... | [
"def",
"process_data",
"(",
"self",
",",
"data",
")",
":",
"if",
"isinstance",
"(",
"data",
",",
"dict",
")",
":",
"self",
".",
"embed",
"=",
"True",
"return",
"data",
"elif",
"isinstance",
"(",
"data",
",",
"str",
")",
":",
"if",
"data",
".",
"low... | Convert an unknown data input into a geojson dictionary. | [
"Convert",
"an",
"unknown",
"data",
"input",
"into",
"a",
"geojson",
"dictionary",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L469-L494 | train | Convert an unknown data input into a geojson dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJson.convert_to_feature_collection | def convert_to_feature_collection(self):
"""Convert data into a FeatureCollection if it is not already."""
if self.data['type'] == 'FeatureCollection':
return
if not self.embed:
raise ValueError(
'Data is not a FeatureCollection, but it should be to apply ... | python | def convert_to_feature_collection(self):
"""Convert data into a FeatureCollection if it is not already."""
if self.data['type'] == 'FeatureCollection':
return
if not self.embed:
raise ValueError(
'Data is not a FeatureCollection, but it should be to apply ... | [
"def",
"convert_to_feature_collection",
"(",
"self",
")",
":",
"if",
"self",
".",
"data",
"[",
"'type'",
"]",
"==",
"'FeatureCollection'",
":",
"return",
"if",
"not",
"self",
".",
"embed",
":",
"raise",
"ValueError",
"(",
"'Data is not a FeatureCollection, but it ... | Convert data into a FeatureCollection if it is not already. | [
"Convert",
"data",
"into",
"a",
"FeatureCollection",
"if",
"it",
"is",
"not",
"already",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L496-L510 | train | Convert data into a FeatureCollection if it is not already. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJson._validate_function | def _validate_function(self, func, name):
"""
Tests `self.style_function` and `self.highlight_function` to ensure
they are functions returning dictionaries.
"""
test_feature = self.data['features'][0]
if not callable(func) or not isinstance(func(test_feature), dict):
... | python | def _validate_function(self, func, name):
"""
Tests `self.style_function` and `self.highlight_function` to ensure
they are functions returning dictionaries.
"""
test_feature = self.data['features'][0]
if not callable(func) or not isinstance(func(test_feature), dict):
... | [
"def",
"_validate_function",
"(",
"self",
",",
"func",
",",
"name",
")",
":",
"test_feature",
"=",
"self",
".",
"data",
"[",
"'features'",
"]",
"[",
"0",
"]",
"if",
"not",
"callable",
"(",
"func",
")",
"or",
"not",
"isinstance",
"(",
"func",
"(",
"te... | Tests `self.style_function` and `self.highlight_function` to ensure
they are functions returning dictionaries. | [
"Tests",
"self",
".",
"style_function",
"and",
"self",
".",
"highlight_function",
"to",
"ensure",
"they",
"are",
"functions",
"returning",
"dictionaries",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L512-L521 | train | Validate that a function returns a dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJson.find_identifier | def find_identifier(self):
"""Find a unique identifier for each feature, create it if needed."""
features = self.data['features']
n = len(features)
feature = features[0]
if 'id' in feature and len(set(feat['id'] for feat in features)) == n:
return 'feature.id'
... | python | def find_identifier(self):
"""Find a unique identifier for each feature, create it if needed."""
features = self.data['features']
n = len(features)
feature = features[0]
if 'id' in feature and len(set(feat['id'] for feat in features)) == n:
return 'feature.id'
... | [
"def",
"find_identifier",
"(",
"self",
")",
":",
"features",
"=",
"self",
".",
"data",
"[",
"'features'",
"]",
"n",
"=",
"len",
"(",
"features",
")",
"feature",
"=",
"features",
"[",
"0",
"]",
"if",
"'id'",
"in",
"feature",
"and",
"len",
"(",
"set",
... | Find a unique identifier for each feature, create it if needed. | [
"Find",
"a",
"unique",
"identifier",
"for",
"each",
"feature",
"create",
"it",
"if",
"needed",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L523-L541 | train | Find a unique identifier for each feature create it if needed. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJsonStyleMapper._create_mapping | def _create_mapping(self, func, switch):
"""Internal function to create the mapping."""
mapping = {}
for feature in self.data['features']:
content = func(feature)
if switch == 'style':
for key, value in content.items():
if isinstance(va... | python | def _create_mapping(self, func, switch):
"""Internal function to create the mapping."""
mapping = {}
for feature in self.data['features']:
content = func(feature)
if switch == 'style':
for key, value in content.items():
if isinstance(va... | [
"def",
"_create_mapping",
"(",
"self",
",",
"func",
",",
"switch",
")",
":",
"mapping",
"=",
"{",
"}",
"for",
"feature",
"in",
"self",
".",
"data",
"[",
"'features'",
"]",
":",
"content",
"=",
"func",
"(",
"feature",
")",
"if",
"switch",
"==",
"'styl... | Internal function to create the mapping. | [
"Internal",
"function",
"to",
"create",
"the",
"mapping",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L583-L600 | train | Internal function to create the mapping. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJsonStyleMapper.get_feature_id | def get_feature_id(self, feature):
"""Return a value identifying the feature."""
fields = self.feature_identifier.split('.')[1:]
return functools.reduce(operator.getitem, fields, feature) | python | def get_feature_id(self, feature):
"""Return a value identifying the feature."""
fields = self.feature_identifier.split('.')[1:]
return functools.reduce(operator.getitem, fields, feature) | [
"def",
"get_feature_id",
"(",
"self",
",",
"feature",
")",
":",
"fields",
"=",
"self",
".",
"feature_identifier",
".",
"split",
"(",
"'.'",
")",
"[",
"1",
":",
"]",
"return",
"functools",
".",
"reduce",
"(",
"operator",
".",
"getitem",
",",
"fields",
"... | Return a value identifying the feature. | [
"Return",
"a",
"value",
"identifying",
"the",
"feature",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L602-L605 | train | Return a value identifying the feature. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJsonStyleMapper._to_key | def _to_key(d):
"""Convert dict to str and enable Jinja2 template syntax."""
as_str = json.dumps(d, sort_keys=True)
return as_str.replace('"{{', '{{').replace('}}"', '}}') | python | def _to_key(d):
"""Convert dict to str and enable Jinja2 template syntax."""
as_str = json.dumps(d, sort_keys=True)
return as_str.replace('"{{', '{{').replace('}}"', '}}') | [
"def",
"_to_key",
"(",
"d",
")",
":",
"as_str",
"=",
"json",
".",
"dumps",
"(",
"d",
",",
"sort_keys",
"=",
"True",
")",
"return",
"as_str",
".",
"replace",
"(",
"'\"{{'",
",",
"'{{'",
")",
".",
"replace",
"(",
"'}}\"'",
",",
"'}}'",
")"
] | Convert dict to str and enable Jinja2 template syntax. | [
"Convert",
"dict",
"to",
"str",
"and",
"enable",
"Jinja2",
"template",
"syntax",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L608-L611 | train | Convert dict to str and enable Jinja2 template syntax. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJsonStyleMapper._set_default_key | def _set_default_key(mapping):
"""Replace the field with the most features with a 'default' field."""
key_longest = sorted([(len(v), k) for k, v in mapping.items()],
reverse=True)[0][1]
mapping['default'] = key_longest
del (mapping[key_longest]) | python | def _set_default_key(mapping):
"""Replace the field with the most features with a 'default' field."""
key_longest = sorted([(len(v), k) for k, v in mapping.items()],
reverse=True)[0][1]
mapping['default'] = key_longest
del (mapping[key_longest]) | [
"def",
"_set_default_key",
"(",
"mapping",
")",
":",
"key_longest",
"=",
"sorted",
"(",
"[",
"(",
"len",
"(",
"v",
")",
",",
"k",
")",
"for",
"k",
",",
"v",
"in",
"mapping",
".",
"items",
"(",
")",
"]",
",",
"reverse",
"=",
"True",
")",
"[",
"0... | Replace the field with the most features with a 'default' field. | [
"Replace",
"the",
"field",
"with",
"the",
"most",
"features",
"with",
"a",
"default",
"field",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L614-L619 | train | Replace the field with the most features with a default field. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | TopoJson.style_data | def style_data(self):
"""Applies self.style_function to each feature of self.data."""
def recursive_get(data, keys):
if len(keys):
return recursive_get(data.get(keys[0]), keys[1:])
else:
return data
geometries = recursive_get(self.data, s... | python | def style_data(self):
"""Applies self.style_function to each feature of self.data."""
def recursive_get(data, keys):
if len(keys):
return recursive_get(data.get(keys[0]), keys[1:])
else:
return data
geometries = recursive_get(self.data, s... | [
"def",
"style_data",
"(",
"self",
")",
":",
"def",
"recursive_get",
"(",
"data",
",",
"keys",
")",
":",
"if",
"len",
"(",
"keys",
")",
":",
"return",
"recursive_get",
"(",
"data",
".",
"get",
"(",
"keys",
"[",
"0",
"]",
")",
",",
"keys",
"[",
"1"... | Applies self.style_function to each feature of self.data. | [
"Applies",
"self",
".",
"style_function",
"to",
"each",
"feature",
"of",
"self",
".",
"data",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L725-L736 | train | Applies self. style_function to each feature of self. data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | TopoJson.get_bounds | def get_bounds(self):
"""
Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]]
"""
if not self.embed:
raise ValueError('Cannot compute bounds of non-embedded TopoJSON.')
xmin, xmax, ymin,... | python | def get_bounds(self):
"""
Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]]
"""
if not self.embed:
raise ValueError('Cannot compute bounds of non-embedded TopoJSON.')
xmin, xmax, ymin,... | [
"def",
"get_bounds",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"embed",
":",
"raise",
"ValueError",
"(",
"'Cannot compute bounds of non-embedded TopoJSON.'",
")",
"xmin",
",",
"xmax",
",",
"ymin",
",",
"ymax",
"=",
"None",
",",
"None",
",",
"None",
... | Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]] | [
"Computes",
"the",
"bounds",
"of",
"the",
"object",
"itself",
"(",
"not",
"including",
"it",
"s",
"children",
")",
"in",
"the",
"form",
"[[",
"lat_min",
"lon_min",
"]",
"[",
"lat_max",
"lon_max",
"]]"
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L751-L780 | train | Computes the bounds of the object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJsonTooltip.warn_for_geometry_collections | def warn_for_geometry_collections(self):
"""Checks for GeoJson GeometryCollection features to warn user about incompatibility."""
geom_collections = [
feature.get('properties') if feature.get('properties') is not None else key
for key, feature in enumerate(self._parent.data['feat... | python | def warn_for_geometry_collections(self):
"""Checks for GeoJson GeometryCollection features to warn user about incompatibility."""
geom_collections = [
feature.get('properties') if feature.get('properties') is not None else key
for key, feature in enumerate(self._parent.data['feat... | [
"def",
"warn_for_geometry_collections",
"(",
"self",
")",
":",
"geom_collections",
"=",
"[",
"feature",
".",
"get",
"(",
"'properties'",
")",
"if",
"feature",
".",
"get",
"(",
"'properties'",
")",
"is",
"not",
"None",
"else",
"key",
"for",
"key",
",",
"fea... | Checks for GeoJson GeometryCollection features to warn user about incompatibility. | [
"Checks",
"for",
"GeoJson",
"GeometryCollection",
"features",
"to",
"warn",
"user",
"about",
"incompatibility",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L883-L894 | train | Checks for GeoJson GeometryCollection features to warn user about incompatibility. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | GeoJsonTooltip.render | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
if isinstance(self._parent, GeoJson):
keys = tuple(self._parent.data['features'][0]['properties'].keys())
self.warn_for_geometry_collections()
elif isinstance(self._parent, TopoJson):
... | python | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
if isinstance(self._parent, GeoJson):
keys = tuple(self._parent.data['features'][0]['properties'].keys())
self.warn_for_geometry_collections()
elif isinstance(self._parent, TopoJson):
... | [
"def",
"render",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"_parent",
",",
"GeoJson",
")",
":",
"keys",
"=",
"tuple",
"(",
"self",
".",
"_parent",
".",
"data",
"[",
"'features'",
"]",
"[",
"0",
"]",
"["... | Renders the HTML representation of the element. | [
"Renders",
"the",
"HTML",
"representation",
"of",
"the",
"element",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L896-L912 | train | Renders the HTML representation of the element. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/features.py | Choropleth.render | def render(self, **kwargs):
"""Render the GeoJson/TopoJson and color scale objects."""
if self.color_scale:
# ColorMap needs Map as its parent
assert isinstance(self._parent, Map), ('Choropleth must be added'
' to a Map object.')... | python | def render(self, **kwargs):
"""Render the GeoJson/TopoJson and color scale objects."""
if self.color_scale:
# ColorMap needs Map as its parent
assert isinstance(self._parent, Map), ('Choropleth must be added'
' to a Map object.')... | [
"def",
"render",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"color_scale",
":",
"# ColorMap needs Map as its parent",
"assert",
"isinstance",
"(",
"self",
".",
"_parent",
",",
"Map",
")",
",",
"(",
"'Choropleth must be added'",
"' to a ... | Render the GeoJson/TopoJson and color scale objects. | [
"Render",
"the",
"GeoJson",
"/",
"TopoJson",
"and",
"color",
"scale",
"objects",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/features.py#L1146-L1154 | train | Render the GeoJson / TopoJson and color scale objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | validate_location | def validate_location(location): # noqa: C901
"""Validate a single lat/lon coordinate pair and convert to a list
Validate that location:
* is a sized variable
* with size 2
* allows indexing (i.e. has an ordering)
* where both values are floats (or convertible to float)
* and both values a... | python | def validate_location(location): # noqa: C901
"""Validate a single lat/lon coordinate pair and convert to a list
Validate that location:
* is a sized variable
* with size 2
* allows indexing (i.e. has an ordering)
* where both values are floats (or convertible to float)
* and both values a... | [
"def",
"validate_location",
"(",
"location",
")",
":",
"# noqa: C901",
"if",
"isinstance",
"(",
"location",
",",
"np",
".",
"ndarray",
")",
"or",
"(",
"pd",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"location",
",",
"pd",
".",
"DataFrame",
")",
")",... | Validate a single lat/lon coordinate pair and convert to a list
Validate that location:
* is a sized variable
* with size 2
* allows indexing (i.e. has an ordering)
* where both values are floats (or convertible to float)
* and both values are not NaN
Returns
-------
list[float, fl... | [
"Validate",
"a",
"single",
"lat",
"/",
"lon",
"coordinate",
"pair",
"and",
"convert",
"to",
"a",
"list"
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L26-L66 | train | Validate that a single lat / lon coordinate pair and convert to a list of two - dimensional arrays. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | validate_locations | def validate_locations(locations):
"""Validate an iterable with multiple lat/lon coordinate pairs.
Returns
-------
list[list[float, float]] or list[list[list[float, float]]]
"""
locations = if_pandas_df_convert_to_numpy(locations)
try:
iter(locations)
except TypeError:
... | python | def validate_locations(locations):
"""Validate an iterable with multiple lat/lon coordinate pairs.
Returns
-------
list[list[float, float]] or list[list[list[float, float]]]
"""
locations = if_pandas_df_convert_to_numpy(locations)
try:
iter(locations)
except TypeError:
... | [
"def",
"validate_locations",
"(",
"locations",
")",
":",
"locations",
"=",
"if_pandas_df_convert_to_numpy",
"(",
"locations",
")",
"try",
":",
"iter",
"(",
"locations",
")",
"except",
"TypeError",
":",
"raise",
"TypeError",
"(",
"'Locations should be an iterable with ... | Validate an iterable with multiple lat/lon coordinate pairs.
Returns
-------
list[list[float, float]] or list[list[list[float, float]]] | [
"Validate",
"an",
"iterable",
"with",
"multiple",
"lat",
"/",
"lon",
"coordinate",
"pairs",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L69-L94 | train | Validate an iterable with multiple lat / lon coordinate pairs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | if_pandas_df_convert_to_numpy | def if_pandas_df_convert_to_numpy(obj):
"""Return a Numpy array from a Pandas dataframe.
Iterating over a DataFrame has weird side effects, such as the first
row being the column names. Converting to Numpy is more safe.
"""
if pd is not None and isinstance(obj, pd.DataFrame):
return obj.val... | python | def if_pandas_df_convert_to_numpy(obj):
"""Return a Numpy array from a Pandas dataframe.
Iterating over a DataFrame has weird side effects, such as the first
row being the column names. Converting to Numpy is more safe.
"""
if pd is not None and isinstance(obj, pd.DataFrame):
return obj.val... | [
"def",
"if_pandas_df_convert_to_numpy",
"(",
"obj",
")",
":",
"if",
"pd",
"is",
"not",
"None",
"and",
"isinstance",
"(",
"obj",
",",
"pd",
".",
"DataFrame",
")",
":",
"return",
"obj",
".",
"values",
"else",
":",
"return",
"obj"
] | Return a Numpy array from a Pandas dataframe.
Iterating over a DataFrame has weird side effects, such as the first
row being the column names. Converting to Numpy is more safe. | [
"Return",
"a",
"Numpy",
"array",
"from",
"a",
"Pandas",
"dataframe",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L97-L106 | train | Convert a Pandas dataframe to Numpy array. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | image_to_url | def image_to_url(image, colormap=None, origin='upper'):
"""
Infers the type of an image argument and transforms it into a URL.
Parameters
----------
image: string, file or array-like object
* If string, it will be written directly in the output file.
* If file, it's content will be ... | python | def image_to_url(image, colormap=None, origin='upper'):
"""
Infers the type of an image argument and transforms it into a URL.
Parameters
----------
image: string, file or array-like object
* If string, it will be written directly in the output file.
* If file, it's content will be ... | [
"def",
"image_to_url",
"(",
"image",
",",
"colormap",
"=",
"None",
",",
"origin",
"=",
"'upper'",
")",
":",
"if",
"isinstance",
"(",
"image",
",",
"str",
")",
"and",
"not",
"_is_url",
"(",
"image",
")",
":",
"fileformat",
"=",
"os",
".",
"path",
".",... | Infers the type of an image argument and transforms it into a URL.
Parameters
----------
image: string, file or array-like object
* If string, it will be written directly in the output file.
* If file, it's content will be converted as embedded in the
output file.
* If arr... | [
"Infers",
"the",
"type",
"of",
"an",
"image",
"argument",
"and",
"transforms",
"it",
"into",
"a",
"URL",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L109-L144 | train | Takes a string file or array - like object and transforms it into a URL. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | write_png | def write_png(data, origin='upper', colormap=None):
"""
Transform an array of data into a PNG string.
This can be written to disk using binary I/O, or encoded using base64
for an inline PNG like this:
>>> png_str = write_png(array)
>>> "data:image/png;base64,"+png_str.encode('base64')
Insp... | python | def write_png(data, origin='upper', colormap=None):
"""
Transform an array of data into a PNG string.
This can be written to disk using binary I/O, or encoded using base64
for an inline PNG like this:
>>> png_str = write_png(array)
>>> "data:image/png;base64,"+png_str.encode('base64')
Insp... | [
"def",
"write_png",
"(",
"data",
",",
"origin",
"=",
"'upper'",
",",
"colormap",
"=",
"None",
")",
":",
"if",
"colormap",
"is",
"None",
":",
"def",
"colormap",
"(",
"x",
")",
":",
"return",
"(",
"x",
",",
"x",
",",
"x",
",",
"1",
")",
"arr",
"=... | Transform an array of data into a PNG string.
This can be written to disk using binary I/O, or encoded using base64
for an inline PNG like this:
>>> png_str = write_png(array)
>>> "data:image/png;base64,"+png_str.encode('base64')
Inspired from
https://stackoverflow.com/questions/902761/saving-... | [
"Transform",
"an",
"array",
"of",
"data",
"into",
"a",
"PNG",
"string",
".",
"This",
"can",
"be",
"written",
"to",
"disk",
"using",
"binary",
"I",
"/",
"O",
"or",
"encoded",
"using",
"base64",
"for",
"an",
"inline",
"PNG",
"like",
"this",
":"
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L155-L239 | train | Transform an array of data into a PNG string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | mercator_transform | def mercator_transform(data, lat_bounds, origin='upper', height_out=None):
"""
Transforms an image computed in (longitude,latitude) coordinates into
the a Mercator projection image.
Parameters
----------
data: numpy array or equivalent list-like object.
Must be NxM (mono), NxMx3 (RGB) ... | python | def mercator_transform(data, lat_bounds, origin='upper', height_out=None):
"""
Transforms an image computed in (longitude,latitude) coordinates into
the a Mercator projection image.
Parameters
----------
data: numpy array or equivalent list-like object.
Must be NxM (mono), NxMx3 (RGB) ... | [
"def",
"mercator_transform",
"(",
"data",
",",
"lat_bounds",
",",
"origin",
"=",
"'upper'",
",",
"height_out",
"=",
"None",
")",
":",
"import",
"numpy",
"as",
"np",
"def",
"mercator",
"(",
"x",
")",
":",
"return",
"np",
".",
"arcsinh",
"(",
"np",
".",
... | Transforms an image computed in (longitude,latitude) coordinates into
the a Mercator projection image.
Parameters
----------
data: numpy array or equivalent list-like object.
Must be NxM (mono), NxMx3 (RGB) or NxMx4 (RGBA)
lat_bounds : length 2 tuple
Minimal and maximal value of t... | [
"Transforms",
"an",
"image",
"computed",
"in",
"(",
"longitude",
"latitude",
")",
"coordinates",
"into",
"the",
"a",
"Mercator",
"projection",
"image",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L242-L300 | train | This function transforms an image computed in ( longitude latitude ) coordinates into a Mercator projection image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | iter_coords | def iter_coords(obj):
"""
Returns all the coordinate tuples from a geometry or feature.
"""
if isinstance(obj, (tuple, list)):
coords = obj
elif 'features' in obj:
coords = [geom['geometry']['coordinates'] for geom in obj['features']]
elif 'geometry' in obj:
coords = obj... | python | def iter_coords(obj):
"""
Returns all the coordinate tuples from a geometry or feature.
"""
if isinstance(obj, (tuple, list)):
coords = obj
elif 'features' in obj:
coords = [geom['geometry']['coordinates'] for geom in obj['features']]
elif 'geometry' in obj:
coords = obj... | [
"def",
"iter_coords",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"coords",
"=",
"obj",
"elif",
"'features'",
"in",
"obj",
":",
"coords",
"=",
"[",
"geom",
"[",
"'geometry'",
"]",
"[",
"'coor... | Returns all the coordinate tuples from a geometry or feature. | [
"Returns",
"all",
"the",
"coordinate",
"tuples",
"from",
"a",
"geometry",
"or",
"feature",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L321-L340 | train | Iterate over all the coordinate tuples from a geometry or feature. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | _locations_mirror | def _locations_mirror(x):
"""
Mirrors the points in a list-of-list-of-...-of-list-of-points.
For example:
>>> _locations_mirror([[[1, 2], [3, 4]], [5, 6], [7, 8]])
[[[2, 1], [4, 3]], [6, 5], [8, 7]]
"""
if hasattr(x, '__iter__'):
if hasattr(x[0], '__iter__'):
return list... | python | def _locations_mirror(x):
"""
Mirrors the points in a list-of-list-of-...-of-list-of-points.
For example:
>>> _locations_mirror([[[1, 2], [3, 4]], [5, 6], [7, 8]])
[[[2, 1], [4, 3]], [6, 5], [8, 7]]
"""
if hasattr(x, '__iter__'):
if hasattr(x[0], '__iter__'):
return list... | [
"def",
"_locations_mirror",
"(",
"x",
")",
":",
"if",
"hasattr",
"(",
"x",
",",
"'__iter__'",
")",
":",
"if",
"hasattr",
"(",
"x",
"[",
"0",
"]",
",",
"'__iter__'",
")",
":",
"return",
"list",
"(",
"map",
"(",
"_locations_mirror",
",",
"x",
")",
")... | Mirrors the points in a list-of-list-of-...-of-list-of-points.
For example:
>>> _locations_mirror([[[1, 2], [3, 4]], [5, 6], [7, 8]])
[[[2, 1], [4, 3]], [6, 5], [8, 7]] | [
"Mirrors",
"the",
"points",
"in",
"a",
"list",
"-",
"of",
"-",
"list",
"-",
"of",
"-",
"...",
"-",
"of",
"-",
"list",
"-",
"of",
"-",
"points",
".",
"For",
"example",
":",
">>>",
"_locations_mirror",
"(",
"[[[",
"1",
"2",
"]",
"[",
"3",
"4",
"]... | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L343-L357 | train | Mirrors the points in a list - of - list - of - points. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | get_bounds | def get_bounds(locations, lonlat=False):
"""
Computes the bounds of the object in the form
[[lat_min, lon_min], [lat_max, lon_max]]
"""
bounds = [[None, None], [None, None]]
for point in iter_coords(locations):
bounds = [
[
none_min(bounds[0][0], point[0]),
... | python | def get_bounds(locations, lonlat=False):
"""
Computes the bounds of the object in the form
[[lat_min, lon_min], [lat_max, lon_max]]
"""
bounds = [[None, None], [None, None]]
for point in iter_coords(locations):
bounds = [
[
none_min(bounds[0][0], point[0]),
... | [
"def",
"get_bounds",
"(",
"locations",
",",
"lonlat",
"=",
"False",
")",
":",
"bounds",
"=",
"[",
"[",
"None",
",",
"None",
"]",
",",
"[",
"None",
",",
"None",
"]",
"]",
"for",
"point",
"in",
"iter_coords",
"(",
"locations",
")",
":",
"bounds",
"="... | Computes the bounds of the object in the form
[[lat_min, lon_min], [lat_max, lon_max]] | [
"Computes",
"the",
"bounds",
"of",
"the",
"object",
"in",
"the",
"form",
"[[",
"lat_min",
"lon_min",
"]",
"[",
"lat_max",
"lon_max",
"]]"
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L360-L380 | train | Returns the bounds of the object in the form of a sequence of locations. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | camelize | def camelize(key):
"""Convert a python_style_variable_name to lowerCamelCase.
Examples
--------
>>> camelize('variable_name')
'variableName'
>>> camelize('variableName')
'variableName'
"""
return ''.join(x.capitalize() if i > 0 else x
for i, x in enumerate(key.spl... | python | def camelize(key):
"""Convert a python_style_variable_name to lowerCamelCase.
Examples
--------
>>> camelize('variable_name')
'variableName'
>>> camelize('variableName')
'variableName'
"""
return ''.join(x.capitalize() if i > 0 else x
for i, x in enumerate(key.spl... | [
"def",
"camelize",
"(",
"key",
")",
":",
"return",
"''",
".",
"join",
"(",
"x",
".",
"capitalize",
"(",
")",
"if",
"i",
">",
"0",
"else",
"x",
"for",
"i",
",",
"x",
"in",
"enumerate",
"(",
"key",
".",
"split",
"(",
"'_'",
")",
")",
")"
] | Convert a python_style_variable_name to lowerCamelCase.
Examples
--------
>>> camelize('variable_name')
'variableName'
>>> camelize('variableName')
'variableName' | [
"Convert",
"a",
"python_style_variable_name",
"to",
"lowerCamelCase",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L383-L394 | train | Convert a python_style_variable_name to lowerCamelCase. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | normalize | def normalize(rendered):
"""Return the input string without non-functional spaces or newlines."""
out = ''.join([line.strip()
for line in rendered.splitlines()
if line.strip()])
out = out.replace(', ', ',')
return out | python | def normalize(rendered):
"""Return the input string without non-functional spaces or newlines."""
out = ''.join([line.strip()
for line in rendered.splitlines()
if line.strip()])
out = out.replace(', ', ',')
return out | [
"def",
"normalize",
"(",
"rendered",
")",
":",
"out",
"=",
"''",
".",
"join",
"(",
"[",
"line",
".",
"strip",
"(",
")",
"for",
"line",
"in",
"rendered",
".",
"splitlines",
"(",
")",
"if",
"line",
".",
"strip",
"(",
")",
"]",
")",
"out",
"=",
"o... | Return the input string without non-functional spaces or newlines. | [
"Return",
"the",
"input",
"string",
"without",
"non",
"-",
"functional",
"spaces",
"or",
"newlines",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L440-L446 | train | Return the input string without non - functional spaces or newlines. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | _tmp_html | def _tmp_html(data):
"""Yields the path of a temporary HTML file containing data."""
filepath = ''
try:
fid, filepath = tempfile.mkstemp(suffix='.html', prefix='folium_')
os.write(fid, data.encode('utf8'))
os.close(fid)
yield filepath
finally:
if os.path.isfile(fi... | python | def _tmp_html(data):
"""Yields the path of a temporary HTML file containing data."""
filepath = ''
try:
fid, filepath = tempfile.mkstemp(suffix='.html', prefix='folium_')
os.write(fid, data.encode('utf8'))
os.close(fid)
yield filepath
finally:
if os.path.isfile(fi... | [
"def",
"_tmp_html",
"(",
"data",
")",
":",
"filepath",
"=",
"''",
"try",
":",
"fid",
",",
"filepath",
"=",
"tempfile",
".",
"mkstemp",
"(",
"suffix",
"=",
"'.html'",
",",
"prefix",
"=",
"'folium_'",
")",
"os",
".",
"write",
"(",
"fid",
",",
"data",
... | Yields the path of a temporary HTML file containing data. | [
"Yields",
"the",
"path",
"of",
"a",
"temporary",
"HTML",
"file",
"containing",
"data",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L450-L460 | train | Yields the path of a temporary HTML file containing data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | deep_copy | def deep_copy(item_original):
"""Return a recursive deep-copy of item where each copy has a new ID."""
item = copy.copy(item_original)
item._id = uuid.uuid4().hex
if hasattr(item, '_children') and len(item._children) > 0:
children_new = collections.OrderedDict()
for subitem_original in i... | python | def deep_copy(item_original):
"""Return a recursive deep-copy of item where each copy has a new ID."""
item = copy.copy(item_original)
item._id = uuid.uuid4().hex
if hasattr(item, '_children') and len(item._children) > 0:
children_new = collections.OrderedDict()
for subitem_original in i... | [
"def",
"deep_copy",
"(",
"item_original",
")",
":",
"item",
"=",
"copy",
".",
"copy",
"(",
"item_original",
")",
"item",
".",
"_id",
"=",
"uuid",
".",
"uuid4",
"(",
")",
".",
"hex",
"if",
"hasattr",
"(",
"item",
",",
"'_children'",
")",
"and",
"len",... | Return a recursive deep-copy of item where each copy has a new ID. | [
"Return",
"a",
"recursive",
"deep",
"-",
"copy",
"of",
"item",
"where",
"each",
"copy",
"has",
"a",
"new",
"ID",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L463-L474 | train | Return a recursive deep - copy of item where each copy has a new ID. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | get_obj_in_upper_tree | def get_obj_in_upper_tree(element, cls):
"""Return the first object in the parent tree of class `cls`."""
if not hasattr(element, '_parent'):
raise ValueError('The top of the tree was reached without finding a {}'
.format(cls))
parent = element._parent
if not isinstance(... | python | def get_obj_in_upper_tree(element, cls):
"""Return the first object in the parent tree of class `cls`."""
if not hasattr(element, '_parent'):
raise ValueError('The top of the tree was reached without finding a {}'
.format(cls))
parent = element._parent
if not isinstance(... | [
"def",
"get_obj_in_upper_tree",
"(",
"element",
",",
"cls",
")",
":",
"if",
"not",
"hasattr",
"(",
"element",
",",
"'_parent'",
")",
":",
"raise",
"ValueError",
"(",
"'The top of the tree was reached without finding a {}'",
".",
"format",
"(",
"cls",
")",
")",
"... | Return the first object in the parent tree of class `cls`. | [
"Return",
"the",
"first",
"object",
"in",
"the",
"parent",
"tree",
"of",
"class",
"cls",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L477-L485 | train | Return the first object in the parent tree of class cls. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/utilities.py | parse_options | def parse_options(**kwargs):
"""Return a dict with lower-camelcase keys and non-None values.."""
return {camelize(key): value
for key, value in kwargs.items()
if value is not None} | python | def parse_options(**kwargs):
"""Return a dict with lower-camelcase keys and non-None values.."""
return {camelize(key): value
for key, value in kwargs.items()
if value is not None} | [
"def",
"parse_options",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"{",
"camelize",
"(",
"key",
")",
":",
"value",
"for",
"key",
",",
"value",
"in",
"kwargs",
".",
"items",
"(",
")",
"if",
"value",
"is",
"not",
"None",
"}"
] | Return a dict with lower-camelcase keys and non-None values.. | [
"Return",
"a",
"dict",
"with",
"lower",
"-",
"camelcase",
"keys",
"and",
"non",
"-",
"None",
"values",
".."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/utilities.py#L488-L492 | train | Return a dict with lower - camelcase keys and non - None values.. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/map.py | LayerControl.render | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
for item in self._parent._children.values():
if not isinstance(item, Layer) or not item.control:
continue
key = item.layer_name
if not item.overlay:
self.... | python | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
for item in self._parent._children.values():
if not isinstance(item, Layer) or not item.control:
continue
key = item.layer_name
if not item.overlay:
self.... | [
"def",
"render",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"item",
"in",
"self",
".",
"_parent",
".",
"_children",
".",
"values",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"item",
",",
"Layer",
")",
"or",
"not",
"item",
".",
"co... | Renders the HTML representation of the element. | [
"Renders",
"the",
"HTML",
"representation",
"of",
"the",
"element",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/map.py#L148-L162 | train | Renders the HTML representation of the element. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/map.py | Popup.render | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
for name, child in self._children.items():
child.render(**kwargs)
figure = self.get_root()
assert isinstance(figure, Figure), ('You cannot render this Element '
... | python | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
for name, child in self._children.items():
child.render(**kwargs)
figure = self.get_root()
assert isinstance(figure, Figure), ('You cannot render this Element '
... | [
"def",
"render",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"name",
",",
"child",
"in",
"self",
".",
"_children",
".",
"items",
"(",
")",
":",
"child",
".",
"render",
"(",
"*",
"*",
"kwargs",
")",
"figure",
"=",
"self",
".",
"get_root... | Renders the HTML representation of the element. | [
"Renders",
"the",
"HTML",
"representation",
"of",
"the",
"element",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/map.py#L354-L365 | train | Renders the HTML representation of the element. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/map.py | Tooltip.parse_options | def parse_options(self, kwargs):
"""Validate the provided kwargs and return options as json string."""
kwargs = {camelize(key): value for key, value in kwargs.items()}
for key in kwargs.keys():
assert key in self.valid_options, (
'The option {} is not in the available... | python | def parse_options(self, kwargs):
"""Validate the provided kwargs and return options as json string."""
kwargs = {camelize(key): value for key, value in kwargs.items()}
for key in kwargs.keys():
assert key in self.valid_options, (
'The option {} is not in the available... | [
"def",
"parse_options",
"(",
"self",
",",
"kwargs",
")",
":",
"kwargs",
"=",
"{",
"camelize",
"(",
"key",
")",
":",
"value",
"for",
"key",
",",
"value",
"in",
"kwargs",
".",
"items",
"(",
")",
"}",
"for",
"key",
"in",
"kwargs",
".",
"keys",
"(",
... | Validate the provided kwargs and return options as json string. | [
"Validate",
"the",
"provided",
"kwargs",
"and",
"return",
"options",
"as",
"json",
"string",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/map.py#L424-L436 | train | Validate the provided kwargs and return options as json string. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/folium.py | Map._repr_html_ | def _repr_html_(self, **kwargs):
"""Displays the HTML Map in a Jupyter notebook."""
if self._parent is None:
self.add_to(Figure())
out = self._parent._repr_html_(**kwargs)
self._parent = None
else:
out = self._parent._repr_html_(**kwargs)
r... | python | def _repr_html_(self, **kwargs):
"""Displays the HTML Map in a Jupyter notebook."""
if self._parent is None:
self.add_to(Figure())
out = self._parent._repr_html_(**kwargs)
self._parent = None
else:
out = self._parent._repr_html_(**kwargs)
r... | [
"def",
"_repr_html_",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_parent",
"is",
"None",
":",
"self",
".",
"add_to",
"(",
"Figure",
"(",
")",
")",
"out",
"=",
"self",
".",
"_parent",
".",
"_repr_html_",
"(",
"*",
"*",
"kw... | Displays the HTML Map in a Jupyter notebook. | [
"Displays",
"the",
"HTML",
"Map",
"in",
"a",
"Jupyter",
"notebook",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/folium.py#L288-L296 | train | Displays the HTML Map in a Jupyter notebook. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/folium.py | Map._to_png | def _to_png(self, delay=3):
"""Export the HTML to byte representation of a PNG image.
Uses selenium to render the HTML and record a PNG. You may need to
adjust the `delay` time keyword argument if maps render without data or tiles.
Examples
--------
>>> m._to_png()
... | python | def _to_png(self, delay=3):
"""Export the HTML to byte representation of a PNG image.
Uses selenium to render the HTML and record a PNG. You may need to
adjust the `delay` time keyword argument if maps render without data or tiles.
Examples
--------
>>> m._to_png()
... | [
"def",
"_to_png",
"(",
"self",
",",
"delay",
"=",
"3",
")",
":",
"if",
"self",
".",
"_png_image",
"is",
"None",
":",
"from",
"selenium",
"import",
"webdriver",
"options",
"=",
"webdriver",
".",
"firefox",
".",
"options",
".",
"Options",
"(",
")",
"opti... | Export the HTML to byte representation of a PNG image.
Uses selenium to render the HTML and record a PNG. You may need to
adjust the `delay` time keyword argument if maps render without data or tiles.
Examples
--------
>>> m._to_png()
>>> m._to_png(time=10) # Wait 10 s... | [
"Export",
"the",
"HTML",
"to",
"byte",
"representation",
"of",
"a",
"PNG",
"image",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/folium.py#L298-L326 | train | Export the HTML to byte representation of a PNG image. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/folium.py | Map.render | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
figure = self.get_root()
assert isinstance(figure, Figure), ('You cannot render this Element '
'if it is not in a Figure.')
# Set global switches
figure.... | python | def render(self, **kwargs):
"""Renders the HTML representation of the element."""
figure = self.get_root()
assert isinstance(figure, Figure), ('You cannot render this Element '
'if it is not in a Figure.')
# Set global switches
figure.... | [
"def",
"render",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"figure",
"=",
"self",
".",
"get_root",
"(",
")",
"assert",
"isinstance",
"(",
"figure",
",",
"Figure",
")",
",",
"(",
"'You cannot render this Element '",
"'if it is not in a Figure.'",
")",
"... | Renders the HTML representation of the element. | [
"Renders",
"the",
"HTML",
"representation",
"of",
"the",
"element",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/folium.py#L336-L372 | train | Renders the HTML representation of the element. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/folium.py | Map.fit_bounds | def fit_bounds(self, bounds, padding_top_left=None,
padding_bottom_right=None, padding=None, max_zoom=None):
"""Fit the map to contain a bounding box with the
maximum zoom level possible.
Parameters
----------
bounds: list of (latitude, longitude) points
... | python | def fit_bounds(self, bounds, padding_top_left=None,
padding_bottom_right=None, padding=None, max_zoom=None):
"""Fit the map to contain a bounding box with the
maximum zoom level possible.
Parameters
----------
bounds: list of (latitude, longitude) points
... | [
"def",
"fit_bounds",
"(",
"self",
",",
"bounds",
",",
"padding_top_left",
"=",
"None",
",",
"padding_bottom_right",
"=",
"None",
",",
"padding",
"=",
"None",
",",
"max_zoom",
"=",
"None",
")",
":",
"self",
".",
"add_child",
"(",
"FitBounds",
"(",
"bounds",... | Fit the map to contain a bounding box with the
maximum zoom level possible.
Parameters
----------
bounds: list of (latitude, longitude) points
Bounding box specified as two points [southwest, northeast]
padding_top_left: (x, y) point, default None
Padding... | [
"Fit",
"the",
"map",
"to",
"contain",
"a",
"bounding",
"box",
"with",
"the",
"maximum",
"zoom",
"level",
"possible",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/folium.py#L374-L406 | train | Fit the map to contain a bounding box with the maximum zoom level possible. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/folium.py | Map.choropleth | def choropleth(self, *args, **kwargs):
"""Call the Choropleth class with the same arguments.
This method may be deleted after a year from now (Nov 2018).
"""
warnings.warn(
'The choropleth method has been deprecated. Instead use the new '
'Choropleth class, whic... | python | def choropleth(self, *args, **kwargs):
"""Call the Choropleth class with the same arguments.
This method may be deleted after a year from now (Nov 2018).
"""
warnings.warn(
'The choropleth method has been deprecated. Instead use the new '
'Choropleth class, whic... | [
"def",
"choropleth",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"warnings",
".",
"warn",
"(",
"'The choropleth method has been deprecated. Instead use the new '",
"'Choropleth class, which has the same arguments. See the example '",
"'notebook \\'GeoJSON... | Call the Choropleth class with the same arguments.
This method may be deleted after a year from now (Nov 2018). | [
"Call",
"the",
"Choropleth",
"class",
"with",
"the",
"same",
"arguments",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/folium.py#L408-L420 | train | Call the Choropleth method with the same arguments. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/plugins/timestamped_geo_json.py | TimestampedGeoJson._get_self_bounds | def _get_self_bounds(self):
"""
Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]].
"""
if not self.embed:
raise ValueError('Cannot compute bounds of non-embedded GeoJSON.')
data = json... | python | def _get_self_bounds(self):
"""
Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]].
"""
if not self.embed:
raise ValueError('Cannot compute bounds of non-embedded GeoJSON.')
data = json... | [
"def",
"_get_self_bounds",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"embed",
":",
"raise",
"ValueError",
"(",
"'Cannot compute bounds of non-embedded GeoJSON.'",
")",
"data",
"=",
"json",
".",
"loads",
"(",
"self",
".",
"data",
")",
"if",
"'features'",... | Computes the bounds of the object itself (not including it's children)
in the form [[lat_min, lon_min], [lat_max, lon_max]]. | [
"Computes",
"the",
"bounds",
"of",
"the",
"object",
"itself",
"(",
"not",
"including",
"it",
"s",
"children",
")",
"in",
"the",
"form",
"[[",
"lat_min",
"lon_min",
"]",
"[",
"lat_max",
"lon_max",
"]]",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/plugins/timestamped_geo_json.py#L213-L243 | train | Compute the bounds of the object itself and its children. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-visualization/folium | folium/plugins/dual_map.py | DualMap.add_child | def add_child(self, child, name=None, index=None):
"""Add object `child` to the first map and store it for the second."""
self.m1.add_child(child, name, index)
if index is None:
index = len(self.m2._children)
self.children_for_m2.append((child, name, index)) | python | def add_child(self, child, name=None, index=None):
"""Add object `child` to the first map and store it for the second."""
self.m1.add_child(child, name, index)
if index is None:
index = len(self.m2._children)
self.children_for_m2.append((child, name, index)) | [
"def",
"add_child",
"(",
"self",
",",
"child",
",",
"name",
"=",
"None",
",",
"index",
"=",
"None",
")",
":",
"self",
".",
"m1",
".",
"add_child",
"(",
"child",
",",
"name",
",",
"index",
")",
"if",
"index",
"is",
"None",
":",
"index",
"=",
"len"... | Add object `child` to the first map and store it for the second. | [
"Add",
"object",
"child",
"to",
"the",
"first",
"map",
"and",
"store",
"it",
"for",
"the",
"second",
"."
] | 8595240517135d1637ca4cf7cc624045f1d911b3 | https://github.com/python-visualization/folium/blob/8595240517135d1637ca4cf7cc624045f1d911b3/folium/plugins/dual_map.py#L83-L88 | train | Add object child to the first map and store it for the second. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | tensorflowonspark/TFManager.py | start | def start(authkey, queues, mode='local'):
"""Create a new multiprocess.Manager (or return existing one).
Args:
:authkey: string authorization key
:queues: *INTERNAL_USE*
:mode: 'local' indicates that the manager will only be accessible from the same host, otherwise remotely accessible.
Returns:
... | python | def start(authkey, queues, mode='local'):
"""Create a new multiprocess.Manager (or return existing one).
Args:
:authkey: string authorization key
:queues: *INTERNAL_USE*
:mode: 'local' indicates that the manager will only be accessible from the same host, otherwise remotely accessible.
Returns:
... | [
"def",
"start",
"(",
"authkey",
",",
"queues",
",",
"mode",
"=",
"'local'",
")",
":",
"global",
"mgr",
",",
"qdict",
",",
"kdict",
"qdict",
".",
"clear",
"(",
")",
"kdict",
".",
"clear",
"(",
")",
"for",
"q",
"in",
"queues",
":",
"qdict",
"[",
"q... | Create a new multiprocess.Manager (or return existing one).
Args:
:authkey: string authorization key
:queues: *INTERNAL_USE*
:mode: 'local' indicates that the manager will only be accessible from the same host, otherwise remotely accessible.
Returns:
A TFManager instance, which is also cached in l... | [
"Create",
"a",
"new",
"multiprocess",
".",
"Manager",
"(",
"or",
"return",
"existing",
"one",
")",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/tensorflowonspark/TFManager.py#L40-L65 | train | Create a new multiprocess. Manager instance and return it. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | tensorflowonspark/TFManager.py | connect | def connect(address, authkey):
"""Connect to a multiprocess.Manager.
Args:
:address: unique address to the TFManager, either a unique connection string for 'local', or a (host, port) tuple for remote.
:authkey: string authorization key
Returns:
A TFManager instance referencing the remote TFManager a... | python | def connect(address, authkey):
"""Connect to a multiprocess.Manager.
Args:
:address: unique address to the TFManager, either a unique connection string for 'local', or a (host, port) tuple for remote.
:authkey: string authorization key
Returns:
A TFManager instance referencing the remote TFManager a... | [
"def",
"connect",
"(",
"address",
",",
"authkey",
")",
":",
"TFManager",
".",
"register",
"(",
"'get_queue'",
")",
"TFManager",
".",
"register",
"(",
"'get'",
")",
"TFManager",
".",
"register",
"(",
"'set'",
")",
"m",
"=",
"TFManager",
"(",
"address",
",... | Connect to a multiprocess.Manager.
Args:
:address: unique address to the TFManager, either a unique connection string for 'local', or a (host, port) tuple for remote.
:authkey: string authorization key
Returns:
A TFManager instance referencing the remote TFManager at the supplied address. | [
"Connect",
"to",
"a",
"multiprocess",
".",
"Manager",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/tensorflowonspark/TFManager.py#L68-L83 | train | Connect to a multiprocess. Manager.
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | examples/imagenet/inception/data/process_bounding_boxes.py | ProcessXMLAnnotation | def ProcessXMLAnnotation(xml_file):
"""Process a single XML file containing a bounding box."""
# pylint: disable=broad-except
try:
tree = ET.parse(xml_file)
except Exception:
print('Failed to parse: ' + xml_file, file=sys.stderr)
return None
# pylint: enable=broad-except
root = tree.getroot()
... | python | def ProcessXMLAnnotation(xml_file):
"""Process a single XML file containing a bounding box."""
# pylint: disable=broad-except
try:
tree = ET.parse(xml_file)
except Exception:
print('Failed to parse: ' + xml_file, file=sys.stderr)
return None
# pylint: enable=broad-except
root = tree.getroot()
... | [
"def",
"ProcessXMLAnnotation",
"(",
"xml_file",
")",
":",
"# pylint: disable=broad-except",
"try",
":",
"tree",
"=",
"ET",
".",
"parse",
"(",
"xml_file",
")",
"except",
"Exception",
":",
"print",
"(",
"'Failed to parse: '",
"+",
"xml_file",
",",
"file",
"=",
"... | Process a single XML file containing a bounding box. | [
"Process",
"a",
"single",
"XML",
"file",
"containing",
"a",
"bounding",
"box",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/imagenet/inception/data/process_bounding_boxes.py#L119-L168 | train | Processes a single XML file containing a bounding box. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | examples/imagenet/inception/dataset.py | Dataset.data_files | def data_files(self):
"""Returns a python list of all (sharded) data subset files.
Returns:
python list of all (sharded) data set files.
Raises:
ValueError: if there are not data_files matching the subset.
"""
tf_record_pattern = os.path.join(FLAGS.data_dir, '%s-*' % self.subset)
da... | python | def data_files(self):
"""Returns a python list of all (sharded) data subset files.
Returns:
python list of all (sharded) data set files.
Raises:
ValueError: if there are not data_files matching the subset.
"""
tf_record_pattern = os.path.join(FLAGS.data_dir, '%s-*' % self.subset)
da... | [
"def",
"data_files",
"(",
"self",
")",
":",
"tf_record_pattern",
"=",
"os",
".",
"path",
".",
"join",
"(",
"FLAGS",
".",
"data_dir",
",",
"'%s-*'",
"%",
"self",
".",
"subset",
")",
"data_files",
"=",
"tf",
".",
"gfile",
".",
"Glob",
"(",
"tf_record_pat... | Returns a python list of all (sharded) data subset files.
Returns:
python list of all (sharded) data set files.
Raises:
ValueError: if there are not data_files matching the subset. | [
"Returns",
"a",
"python",
"list",
"of",
"all",
"(",
"sharded",
")",
"data",
"subset",
"files",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/imagenet/inception/dataset.py#L76-L93 | train | Returns a python list of all data files in the dataset that match the subset. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | examples/cifar10/cifar10.py | _activation_summary | def _activation_summary(x):
"""Helper to create summaries for activations.
Creates a summary that provides a histogram of activations.
Creates a summary that measures the sparsity of activations.
Args:
x: Tensor
Returns:
nothing
"""
# Remove 'tower_[0-9]/' from the name in case this is a multi-G... | python | def _activation_summary(x):
"""Helper to create summaries for activations.
Creates a summary that provides a histogram of activations.
Creates a summary that measures the sparsity of activations.
Args:
x: Tensor
Returns:
nothing
"""
# Remove 'tower_[0-9]/' from the name in case this is a multi-G... | [
"def",
"_activation_summary",
"(",
"x",
")",
":",
"# Remove 'tower_[0-9]/' from the name in case this is a multi-GPU training",
"# session. This helps the clarity of presentation on tensorboard.",
"tensor_name",
"=",
"re",
".",
"sub",
"(",
"'%s_[0-9]*/'",
"%",
"TOWER_NAME",
",",
... | Helper to create summaries for activations.
Creates a summary that provides a histogram of activations.
Creates a summary that measures the sparsity of activations.
Args:
x: Tensor
Returns:
nothing | [
"Helper",
"to",
"create",
"summaries",
"for",
"activations",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/cifar10/cifar10.py#L79-L95 | train | Helper function to create summaries for activations. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | examples/cifar10/cifar10.py | _variable_on_cpu | def _variable_on_cpu(name, shape, initializer):
"""Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list of ints
initializer: initializer for Variable
Returns:
Variable Tensor
"""
with tf.device('/cpu:0'):
dtype = tf.float16 if FLAGS.use_fp16 else... | python | def _variable_on_cpu(name, shape, initializer):
"""Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list of ints
initializer: initializer for Variable
Returns:
Variable Tensor
"""
with tf.device('/cpu:0'):
dtype = tf.float16 if FLAGS.use_fp16 else... | [
"def",
"_variable_on_cpu",
"(",
"name",
",",
"shape",
",",
"initializer",
")",
":",
"with",
"tf",
".",
"device",
"(",
"'/cpu:0'",
")",
":",
"dtype",
"=",
"tf",
".",
"float16",
"if",
"FLAGS",
".",
"use_fp16",
"else",
"tf",
".",
"float32",
"var",
"=",
... | Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list of ints
initializer: initializer for Variable
Returns:
Variable Tensor | [
"Helper",
"to",
"create",
"a",
"Variable",
"stored",
"on",
"CPU",
"memory",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/cifar10/cifar10.py#L98-L112 | train | Helper to create a Variable stored on CPU memory. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | examples/cifar10/cifar10.py | _variable_with_weight_decay | def _variable_with_weight_decay(name, shape, stddev, wd):
"""Helper to create an initialized Variable with weight decay.
Note that the Variable is initialized with a truncated normal distribution.
A weight decay is added only if one is specified.
Args:
name: name of the variable
shape: list of ints
... | python | def _variable_with_weight_decay(name, shape, stddev, wd):
"""Helper to create an initialized Variable with weight decay.
Note that the Variable is initialized with a truncated normal distribution.
A weight decay is added only if one is specified.
Args:
name: name of the variable
shape: list of ints
... | [
"def",
"_variable_with_weight_decay",
"(",
"name",
",",
"shape",
",",
"stddev",
",",
"wd",
")",
":",
"dtype",
"=",
"tf",
".",
"float16",
"if",
"FLAGS",
".",
"use_fp16",
"else",
"tf",
".",
"float32",
"var",
"=",
"_variable_on_cpu",
"(",
"name",
",",
"shap... | Helper to create an initialized Variable with weight decay.
Note that the Variable is initialized with a truncated normal distribution.
A weight decay is added only if one is specified.
Args:
name: name of the variable
shape: list of ints
stddev: standard deviation of a truncated Gaussian
wd: ad... | [
"Helper",
"to",
"create",
"an",
"initialized",
"Variable",
"with",
"weight",
"decay",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/cifar10/cifar10.py#L115-L139 | train | Helper to create an initialized Variable with weight decay. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | examples/cifar10/cifar10.py | distorted_inputs | def distorted_inputs():
"""Construct distorted input for CIFAR training using the Reader ops.
Returns:
images: Images. 4D tensor of [batch_size, IMAGE_SIZE, IMAGE_SIZE, 3] size.
labels: Labels. 1D tensor of [batch_size] size.
Raises:
ValueError: If no data_dir
"""
if not FLAGS.data_dir:
rais... | python | def distorted_inputs():
"""Construct distorted input for CIFAR training using the Reader ops.
Returns:
images: Images. 4D tensor of [batch_size, IMAGE_SIZE, IMAGE_SIZE, 3] size.
labels: Labels. 1D tensor of [batch_size] size.
Raises:
ValueError: If no data_dir
"""
if not FLAGS.data_dir:
rais... | [
"def",
"distorted_inputs",
"(",
")",
":",
"if",
"not",
"FLAGS",
".",
"data_dir",
":",
"raise",
"ValueError",
"(",
"'Please supply a data_dir'",
")",
"data_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"FLAGS",
".",
"data_dir",
",",
"'cifar-10-batches-bin'",
... | Construct distorted input for CIFAR training using the Reader ops.
Returns:
images: Images. 4D tensor of [batch_size, IMAGE_SIZE, IMAGE_SIZE, 3] size.
labels: Labels. 1D tensor of [batch_size] size.
Raises:
ValueError: If no data_dir | [
"Construct",
"distorted",
"input",
"for",
"CIFAR",
"training",
"using",
"the",
"Reader",
"ops",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/cifar10/cifar10.py#L142-L160 | train | Construct distorted input for CIFAR training using the Reader ops. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
yahoo/TensorFlowOnSpark | examples/cifar10/cifar10.py | inference | def inference(images):
"""Build the CIFAR-10 model.
Args:
images: Images returned from distorted_inputs() or inputs().
Returns:
Logits.
"""
# We instantiate all variables using tf.get_variable() instead of
# tf.Variable() in order to share variables across multiple GPU training runs.
# If we onl... | python | def inference(images):
"""Build the CIFAR-10 model.
Args:
images: Images returned from distorted_inputs() or inputs().
Returns:
Logits.
"""
# We instantiate all variables using tf.get_variable() instead of
# tf.Variable() in order to share variables across multiple GPU training runs.
# If we onl... | [
"def",
"inference",
"(",
"images",
")",
":",
"# We instantiate all variables using tf.get_variable() instead of",
"# tf.Variable() in order to share variables across multiple GPU training runs.",
"# If we only ran this model on a single GPU, we could simplify this function",
"# by replacing all in... | Build the CIFAR-10 model.
Args:
images: Images returned from distorted_inputs() or inputs().
Returns:
Logits. | [
"Build",
"the",
"CIFAR",
"-",
"10",
"model",
"."
] | 5e4b6c185ab722fd0104ede0377e1149ea8d6f7c | https://github.com/yahoo/TensorFlowOnSpark/blob/5e4b6c185ab722fd0104ede0377e1149ea8d6f7c/examples/cifar10/cifar10.py#L188-L271 | train | Build the CIFAR - 10 model. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.