Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
AttributeHandler.update_state
(self, txn, prev_result, request, is_committed=False)
The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, then nothing is stored in attribute store, the trie stores a blank value ...
The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute is HASH, then nothing is stored in attribute store, the trie stores a blank value ...
def update_state(self, txn, prev_result, request, is_committed=False) -> None: """ The state trie stores the hash of the whole attribute data at: the did+attribute name if the data is plaintext (RAW) the did+hash(attribute) if the data is encrypted (ENC) If the attribute ...
[ "def", "update_state", "(", "self", ",", "txn", ",", "prev_result", ",", "request", ",", "is_committed", "=", "False", ")", "->", "None", ":", "self", ".", "_validate_txn_type", "(", "txn", ")", "attr_type", ",", "path", ",", "value", ",", "hashed_value", ...
[ 105, 4 ]
[ 118, 18 ]
python
en
['en', 'error', 'th']
False
AttributeHandler.prepare_attr_for_state
(txn, path_only=False)
Make key(path)-value pair for state from ATTRIB or GET_ATTR :return: state path, state value, value for attribute store
Make key(path)-value pair for state from ATTRIB or GET_ATTR :return: state path, state value, value for attribute store
def prepare_attr_for_state(txn, path_only=False): """ Make key(path)-value pair for state from ATTRIB or GET_ATTR :return: state path, state value, value for attribute store """ assert get_type(txn) == ATTRIB txn_data = get_payload_data(txn) nym = txn_data[TARGET_...
[ "def", "prepare_attr_for_state", "(", "txn", ",", "path_only", "=", "False", ")", ":", "assert", "get_type", "(", "txn", ")", "==", "ATTRIB", "txn_data", "=", "get_payload_data", "(", "txn", ")", "nym", "=", "txn_data", "[", "TARGET_NYM", "]", "attr_type", ...
[ 143, 4 ]
[ 159, 64 ]
python
en
['en', 'error', 'th']
False
AttributeHandler._extract_attr_typed_value
(txn_data)
ATTR and GET_ATTR can have one of 'raw', 'enc' and 'hash' fields. This method checks which of them presents and return it's name and value in it.
ATTR and GET_ATTR can have one of 'raw', 'enc' and 'hash' fields. This method checks which of them presents and return it's name and value in it.
def _extract_attr_typed_value(txn_data): """ ATTR and GET_ATTR can have one of 'raw', 'enc' and 'hash' fields. This method checks which of them presents and return it's name and value in it. """ existing_keys = [key for key in ALL_ATR_KEYS if key in txn_data] if l...
[ "def", "_extract_attr_typed_value", "(", "txn_data", ")", ":", "existing_keys", "=", "[", "key", "for", "key", "in", "ALL_ATR_KEYS", "if", "key", "in", "txn_data", "]", "if", "len", "(", "existing_keys", ")", "==", "0", ":", "raise", "ValueError", "(", "\"...
[ 178, 4 ]
[ 192, 51 ]
python
en
['en', 'error', 'th']
False
AttributeHandler.transform_txn_for_ledger
(self, txn)
Creating copy of result so that `RAW`, `ENC` or `HASH` can be replaced by their hashes. We do not insert actual attribute data in the ledger but only the hash of it.
Creating copy of result so that `RAW`, `ENC` or `HASH` can be replaced by their hashes. We do not insert actual attribute data in the ledger but only the hash of it.
def transform_txn_for_ledger(self, txn): """ Creating copy of result so that `RAW`, `ENC` or `HASH` can be replaced by their hashes. We do not insert actual attribute data in the ledger but only the hash of it. """ txn = deepcopy(txn) txn_data = get_payload_data(t...
[ "def", "transform_txn_for_ledger", "(", "self", ",", "txn", ")", ":", "txn", "=", "deepcopy", "(", "txn", ")", "txn_data", "=", "get_payload_data", "(", "txn", ")", "attr_type", ",", "_", ",", "value", "=", "self", ".", "parse_attr_txn", "(", "txn_data", ...
[ 202, 4 ]
[ 214, 18 ]
python
en
['en', 'error', 'th']
False
Metadata.read
(self)
Read the relevant metadata.
Read the relevant metadata.
def read(self): """ Read the relevant metadata. """ string = f'Metadata version {self.version_num}\n' string += f'Saved at: {self.datetime}\n' string += f'Self chat: {self.self_chat}\n' string += f'Speakers: {self.speakers}\n' string += 'Opt:\n' fo...
[ "def", "read", "(", "self", ")", ":", "string", "=", "f'Metadata version {self.version_num}\\n'", "string", "+=", "f'Saved at: {self.datetime}\\n'", "string", "+=", "f'Self chat: {self.self_chat}\\n'", "string", "+=", "f'Speakers: {self.speakers}\\n'", "string", "+=", "'Opt:\...
[ 53, 4 ]
[ 67, 21 ]
python
en
['en', 'error', 'th']
False
Metadata.save_metadata
(cls, datapath, opt, self_chat=False, speakers=None, **kwargs)
Dump conversation metadata to file.
Dump conversation metadata to file.
def save_metadata(cls, datapath, opt, self_chat=False, speakers=None, **kwargs): """ Dump conversation metadata to file. """ metadata = {} metadata['date'] = str(datetime.datetime.now()) metadata['opt'] = opt metadata['self_chat'] = self_chat metadata['spe...
[ "def", "save_metadata", "(", "cls", ",", "datapath", ",", "opt", ",", "self_chat", "=", "False", ",", "speakers", "=", "None", ",", "*", "*", "kwargs", ")", ":", "metadata", "=", "{", "}", "metadata", "[", "'date'", "]", "=", "str", "(", "datetime", ...
[ 79, 4 ]
[ 96, 41 ]
python
en
['en', 'error', 'th']
False
Conversation.__next__
(self)
Return the next conversation.
Return the next conversation.
def __next__(self): """ Return the next conversation. """ if self.iterator_idx >= len(self.turns): raise StopIteration conv = self.turns[self.iterator_idx] self.iterator_idx += 1 return conv
[ "def", "__next__", "(", "self", ")", ":", "if", "self", ".", "iterator_idx", ">=", "len", "(", "self", ".", "turns", ")", ":", "raise", "StopIteration", "conv", "=", "self", ".", "turns", "[", "self", ".", "iterator_idx", "]", "self", ".", "iterator_id...
[ 152, 4 ]
[ 162, 19 ]
python
en
['en', 'error', 'th']
False
Conversations._load_metadata
(self, datapath)
Load metadata. Metadata should be saved at <identifier>.metadata Metadata should be of the following format: { 'date': <date collected>, 'opt': <opt used to collect the data, 'speakers': <identity of speakers>, ... Other argum...
Load metadata.
def _load_metadata(self, datapath): """ Load metadata. Metadata should be saved at <identifier>.metadata Metadata should be of the following format: { 'date': <date collected>, 'opt': <opt used to collect the data, 'speakers': <identity of spe...
[ "def", "_load_metadata", "(", "self", ",", "datapath", ")", ":", "try", ":", "metadata", "=", "Metadata", "(", "datapath", ")", "return", "metadata", "except", "RuntimeError", ":", "logging", ".", "error", "(", "'Metadata does not exist. Please double check your dat...
[ 219, 4 ]
[ 238, 23 ]
python
en
['en', 'error', 'th']
False
Conversations.__next__
(self)
Return the next conversation.
Return the next conversation.
def __next__(self): """ Return the next conversation. """ if self.iterator_idx >= len(self): raise StopIteration conv = self.conversations[self.iterator_idx] self.iterator_idx += 1 return conv
[ "def", "__next__", "(", "self", ")", ":", "if", "self", ".", "iterator_idx", ">=", "len", "(", "self", ")", ":", "raise", "StopIteration", "conv", "=", "self", ".", "conversations", "[", "self", ".", "iterator_idx", "]", "self", ".", "iterator_idx", "+="...
[ 253, 4 ]
[ 263, 19 ]
python
en
['en', 'error', 'th']
False
Conversations.save_conversations
( cls, act_list, datapath, opt, save_keys='all', context_ids='context', self_chat=False, **kwargs, )
Write Conversations to file from an act list. Conversations assume the act list is of the following form: a list of episodes, each of which is comprised of a list of act pairs (i.e. a list dictionaries returned from one parley)
Write Conversations to file from an act list.
def save_conversations( cls, act_list, datapath, opt, save_keys='all', context_ids='context', self_chat=False, **kwargs, ): """ Write Conversations to file from an act list. Conversations assume the act list is of the following...
[ "def", "save_conversations", "(", "cls", ",", "act_list", ",", "datapath", ",", "opt", ",", "save_keys", "=", "'all'", ",", "context_ids", "=", "'context'", ",", "self_chat", "=", "False", ",", "*", "*", "kwargs", ",", ")", ":", "to_save", "=", "cls", ...
[ 279, 4 ]
[ 345, 9 ]
python
en
['en', 'error', 'th']
False
init_fill_field
(formtemplate, caller, formcallback, pretext="", posttext="", submitcmd="submit", borderstyle="cells", formhelptext=None, persistent=False, initial_formdata=None)
Initializes a menu presenting a player with a fillable form - once the form is submitted, the data will be passed as a dictionary to your chosen function. Args: formtemplate (list of dicts): The template for the form's fields. caller (obj): Player who will be filling out the form. ...
Initializes a menu presenting a player with a fillable form - once the form is submitted, the data will be passed as a dictionary to your chosen function.
def init_fill_field(formtemplate, caller, formcallback, pretext="", posttext="", submitcmd="submit", borderstyle="cells", formhelptext=None, persistent=False, initial_formdata=None): """ Initializes a menu presenting a player with a fillable form - once the form is su...
[ "def", "init_fill_field", "(", "formtemplate", ",", "caller", ",", "formcallback", ",", "pretext", "=", "\"\"", ",", "posttext", "=", "\"\"", ",", "submitcmd", "=", "\"submit\"", ",", "borderstyle", "=", "\"cells\"", ",", "formhelptext", "=", "None", ",", "p...
[ 168, 0 ]
[ 225, 65 ]
python
en
['en', 'error', 'th']
False
menunode_fieldfill
(caller, raw_string, **kwargs)
This is an EvMenu node, which calls itself over and over in order to allow a player to enter values into a fillable form. When the form is submitted, the form data is passed to a callback as a dictionary.
This is an EvMenu node, which calls itself over and over in order to allow a player to enter values into a fillable form. When the form is submitted, the form data is passed to a callback as a dictionary.
def menunode_fieldfill(caller, raw_string, **kwargs): """ This is an EvMenu node, which calls itself over and over in order to allow a player to enter values into a fillable form. When the form is submitted, the form data is passed to a callback as a dictionary. """ # Retrieve menu info - taken...
[ "def", "menunode_fieldfill", "(", "caller", ",", "raw_string", ",", "*", "*", "kwargs", ")", ":", "# Retrieve menu info - taken from ndb if not persistent or db if persistent", "if", "not", "caller", ".", "db", ".", "_menutree", ":", "formdata", "=", "caller", ".", ...
[ 228, 0 ]
[ 449, 24 ]
python
en
['en', 'error', 'th']
False
form_template_to_dict
(formtemplate)
Initializes a dictionary of form data from the given list-of-dictionaries form template, as formatted above. Args: formtemplate (list of dicts): Tempate for the form to be initialized. Returns: formdata (dict): Dictionary of initalized form data.
Initializes a dictionary of form data from the given list-of-dictionaries form template, as formatted above.
def form_template_to_dict(formtemplate): """ Initializes a dictionary of form data from the given list-of-dictionaries form template, as formatted above. Args: formtemplate (list of dicts): Tempate for the form to be initialized. Returns: formdata (dict): Dictionary of initalized f...
[ "def", "form_template_to_dict", "(", "formtemplate", ")", ":", "formdata", "=", "{", "}", "for", "field", "in", "formtemplate", ":", "# Value is blank by default", "fieldvalue", "=", "None", "if", "\"default\"", "in", "field", ":", "# Add in default value if present",...
[ 452, 0 ]
[ 473, 19 ]
python
en
['en', 'error', 'th']
False
display_formdata
(formtemplate, formdata, pretext="", posttext="", borderstyle="cells")
Displays a form's current data as a table. Used in the form menu. Args: formtemplate (list of dicts): Template for the form formdata (dict): Form's current data Options: pretext (str): Text to put before the form table. posttext (str): Text to put after the form table. ...
Displays a form's current data as a table. Used in the form menu.
def display_formdata(formtemplate, formdata, pretext="", posttext="", borderstyle="cells"): """ Displays a form's current data as a table. Used in the form menu. Args: formtemplate (list of dicts): Template for the form formdata (dict): Form's current data Options:...
[ "def", "display_formdata", "(", "formtemplate", ",", "formdata", ",", "pretext", "=", "\"\"", ",", "posttext", "=", "\"\"", ",", "borderstyle", "=", "\"cells\"", ")", ":", "formtable", "=", "evtable", ".", "EvTable", "(", "border", "=", "borderstyle", ",", ...
[ 476, 0 ]
[ 519, 60 ]
python
en
['en', 'error', 'th']
False
verify_online_player
(caller, value)
Example 'verify function' that matches player input to an online character or else rejects their input as invalid. Args: caller (obj): Player entering the form data. value (str): String player entered into the form, to be verified. Returns: matched_character (obj or False): db...
Example 'verify function' that matches player input to an online character or else rejects their input as invalid.
def verify_online_player(caller, value): """ Example 'verify function' that matches player input to an online character or else rejects their input as invalid. Args: caller (obj): Player entering the form data. value (str): String player entered into the form, to be verified. Retur...
[ "def", "verify_online_player", "(", "caller", ",", "value", ")", ":", "# Get a list of sessions", "session_list", "=", "SESSIONS", ".", "get_sessions", "(", ")", "char_list", "=", "[", "]", "matched_character", "=", "None", "# Get a list of online characters", "for", ...
[ 525, 0 ]
[ 568, 28 ]
python
en
['en', 'error', 'th']
False
sendmessage
(obj, text)
Callback to send a message to a player. Args: obj (obj): Player to message. text (str): Message.
Callback to send a message to a player.
def sendmessage(obj, text): """ Callback to send a message to a player. Args: obj (obj): Player to message. text (str): Message. """ obj.msg(text)
[ "def", "sendmessage", "(", "obj", ",", "text", ")", ":", "obj", ".", "msg", "(", "text", ")" ]
[ 634, 0 ]
[ 642, 17 ]
python
en
['en', 'error', 'th']
False
init_delayed_message
(caller, formdata)
Initializes a delayed message, using data from the example form. Args: caller (obj): Character submitting the message. formdata (dict): Data from submitted form.
Initializes a delayed message, using data from the example form.
def init_delayed_message(caller, formdata): """ Initializes a delayed message, using data from the example form. Args: caller (obj): Character submitting the message. formdata (dict): Data from submitted form. """ # Retrieve data from the filled out form. # We stored the charact...
[ "def", "init_delayed_message", "(", "caller", ",", "formdata", ")", ":", "# Retrieve data from the filled out form.", "# We stored the character to message as an object ref using a verifyfunc", "# So we don't have to do any more searching or matching here!", "player_to_message", "=", "form...
[ 645, 0 ]
[ 666, 10 ]
python
en
['en', 'error', 'th']
False
FieldEvMenu.node_formatter
(self, nodetext, optionstext)
Formats the entirety of the node. Args: nodetext (str): The node text as returned by `self.nodetext_formatter`. optionstext (str): The options display as returned by `self.options_formatter`. caller (Object, Account or None, optional): The caller of the node. ...
Formats the entirety of the node.
def node_formatter(self, nodetext, optionstext): """ Formats the entirety of the node. Args: nodetext (str): The node text as returned by `self.nodetext_formatter`. optionstext (str): The options display as returned by `self.options_formatter`. caller (Object...
[ "def", "node_formatter", "(", "self", ",", "nodetext", ",", "optionstext", ")", ":", "# Only return node text, no options or separators", "return", "nodetext" ]
[ 151, 4 ]
[ 165, 23 ]
python
en
['en', 'error', 'th']
False
CmdTestMenu.func
(self)
This performs the actual command.
This performs the actual command.
def func(self): """ This performs the actual command. """ pretext = "|cSend a delayed message to another player ---------------------------------------|n" posttext = ("|c--------------------------------------------------------------------------------|n|/" "Syn...
[ "def", "func", "(", "self", ")", ":", "pretext", "=", "\"|cSend a delayed message to another player ---------------------------------------|n\"", "posttext", "=", "(", "\"|c--------------------------------------------------------------------------------|n|/\"", "\"Syntax: type |c<field> = ...
[ 619, 4 ]
[ 631, 61 ]
python
en
['en', 'error', 'th']
False
_create_long_answer_from_span_html
(example)
Creates a list of long answer candidates, from their spans on the document. This function gets the full article from the input example dictionary (using key 'document_html'), then iterates through the long answer spans (from 'long_answer_candidates' key) and creates a list of slices from the article, ...
Creates a list of long answer candidates, from their spans on the document.
def _create_long_answer_from_span_html(example): """ Creates a list of long answer candidates, from their spans on the document. This function gets the full article from the input example dictionary (using key 'document_html'), then iterates through the long answer spans (from 'long_answer_candidat...
[ "def", "_create_long_answer_from_span_html", "(", "example", ")", ":", "context_text", "=", "example", "[", "_context_type_key", "(", "is_html", "=", "True", ")", "]", ".", "encode", "(", ")", "candidate_long_answers", "=", "[", "]", "for", "long_answer_span", "...
[ 34, 0 ]
[ 56, 33 ]
python
en
['en', 'error', 'th']
False
_create_long_answer_from_span_text
(simplified_example)
Creates a list of long answer candidates, from their spans on the document. This function gets the full article from the input simplified example dictionary (using key 'document_text'), then iterates through the long answer spans (from 'long_answer_candidates' key) and creates a list of slices fro...
Creates a list of long answer candidates, from their spans on the document.
def _create_long_answer_from_span_text(simplified_example): """ Creates a list of long answer candidates, from their spans on the document. This function gets the full article from the input simplified example dictionary (using key 'document_text'), then iterates through the long answer spans (from...
[ "def", "_create_long_answer_from_span_text", "(", "simplified_example", ")", ":", "context_text", "=", "simplified_example", "[", "_context_type_key", "(", "is_html", "=", "False", ")", "]", "candidate_long_answers", "=", "[", "]", "splitted_tokens", "=", "context_text"...
[ 59, 0 ]
[ 83, 33 ]
python
en
['en', 'error', 'th']
False
NaturalQuestionsTeacher.load_from_chunk
(self, chunk_idx: int)
Loads from a chunk of the dataset, given the chunk index. Returns a list of dictionaries. Each dictionary is an example from the main dataset and stores the components of that examples (e.g., contenxt, question, candidate answers etc.) as key-value pairs. :param chunk_...
Loads from a chunk of the dataset, given the chunk index.
def load_from_chunk(self, chunk_idx: int): """ Loads from a chunk of the dataset, given the chunk index. Returns a list of dictionaries. Each dictionary is an example from the main dataset and stores the components of that examples (e.g., contenxt, question, candidate an...
[ "def", "load_from_chunk", "(", "self", ",", "chunk_idx", ":", "int", ")", ":", "def", "_extract_labels_indices", "(", "example", ",", "candidate_labels", ")", ":", "labels", "=", "[", "]", "for", "label", "in", "example", "[", "'annotations'", "]", ":", "l...
[ 169, 4 ]
[ 210, 21 ]
python
en
['en', 'error', 'th']
False
ColorBar.bgcolor
(self)
Sets the color of padded area. The 'bgcolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
Sets the color of padded area. The 'bgcolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
def bgcolor(self): """ Sets the color of padded area. The 'bgcolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva str...
[ "def", "bgcolor", "(", "self", ")", ":", "return", "self", "[", "\"bgcolor\"", "]" ]
[ 59, 4 ]
[ 109, 30 ]
python
en
['en', 'error', 'th']
False
ColorBar.bordercolor
(self)
Sets the axis line color. The 'bordercolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
Sets the axis line color. The 'bordercolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
def bordercolor(self): """ Sets the axis line color. The 'bordercolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva ...
[ "def", "bordercolor", "(", "self", ")", ":", "return", "self", "[", "\"bordercolor\"", "]" ]
[ 118, 4 ]
[ 168, 34 ]
python
en
['en', 'error', 'th']
False
ColorBar.borderwidth
(self)
Sets the width (in px) or the border enclosing this color bar. The 'borderwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the width (in px) or the border enclosing this color bar. The 'borderwidth' property is a number and may be specified as: - An int or float in the interval [0, inf]
def borderwidth(self): """ Sets the width (in px) or the border enclosing this color bar. The 'borderwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["...
[ "def", "borderwidth", "(", "self", ")", ":", "return", "self", "[", "\"borderwidth\"", "]" ]
[ 177, 4 ]
[ 188, 34 ]
python
en
['en', 'error', 'th']
False
ColorBar.dtick
(self)
Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to "log" and "date" axes. If the axis `type` is "log", then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 1...
Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to "log" and "date" axes. If the axis `type` is "log", then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 1...
def dtick(self): """ Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to "log" and "date" axes. If the axis `type` is "log", then ticks are set every 10^(n*dtick) where n is the tick number. For example...
[ "def", "dtick", "(", "self", ")", ":", "return", "self", "[", "\"dtick\"", "]" ]
[ 197, 4 ]
[ 226, 28 ]
python
en
['en', 'error', 'th']
False
ColorBar.exponentformat
(self)
Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If "none", it appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If "power", 1x10^9 (with 9 in a super script). If "SI", 1G. If "B", 1B. The 'exponentformat' prop...
Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If "none", it appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If "power", 1x10^9 (with 9 in a super script). If "SI", 1G. If "B", 1B. The 'exponentformat' prop...
def exponentformat(self): """ Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If "none", it appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If "power", 1x10^9 (with 9 in a super script). If "SI", 1G. If "B", 1B. ...
[ "def", "exponentformat", "(", "self", ")", ":", "return", "self", "[", "\"exponentformat\"", "]" ]
[ 235, 4 ]
[ 251, 37 ]
python
en
['en', 'error', 'th']
False
ColorBar.len
(self)
Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends. The 'len' property is a number and may be specified as: - An int or float in the interval [0, inf] Return...
Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends. The 'len' property is a number and may be specified as: - An int or float in the interval [0, inf]
def len(self): """ Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends. The 'len' property is a number and may be specified as: - An int or float in the interva...
[ "def", "len", "(", "self", ")", ":", "return", "self", "[", "\"len\"", "]" ]
[ 260, 4 ]
[ 273, 26 ]
python
en
['en', 'error', 'th']
False
ColorBar.lenmode
(self)
Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot "fraction" or in *pixels. Use `len` to set the value. The 'lenmode' property is an enumeration that may be specified as: - One of the following enumerati...
Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot "fraction" or in *pixels. Use `len` to set the value. The 'lenmode' property is an enumeration that may be specified as: - One of the following enumerati...
def lenmode(self): """ Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot "fraction" or in *pixels. Use `len` to set the value. The 'lenmode' property is an enumeration that may be specified as: - ...
[ "def", "lenmode", "(", "self", ")", ":", "return", "self", "[", "\"lenmode\"", "]" ]
[ 282, 4 ]
[ 296, 30 ]
python
en
['en', 'error', 'th']
False
ColorBar.nticks
(self)
Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to "auto". The 'nticks' property is a integer and may be specified as: ...
Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to "auto". The 'nticks' property is a integer and may be specified as: ...
def nticks(self): """ Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to "auto". The 'nticks' property is a integer an...
[ "def", "nticks", "(", "self", ")", ":", "return", "self", "[", "\"nticks\"", "]" ]
[ 305, 4 ]
[ 320, 29 ]
python
en
['en', 'error', 'th']
False
ColorBar.outlinecolor
(self)
Sets the axis line color. The 'outlinecolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
Sets the axis line color. The 'outlinecolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
def outlinecolor(self): """ Sets the axis line color. The 'outlinecolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsv...
[ "def", "outlinecolor", "(", "self", ")", ":", "return", "self", "[", "\"outlinecolor\"", "]" ]
[ 329, 4 ]
[ 379, 35 ]
python
en
['en', 'error', 'th']
False
ColorBar.outlinewidth
(self)
Sets the width (in px) of the axis line. The 'outlinewidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the width (in px) of the axis line. The 'outlinewidth' property is a number and may be specified as: - An int or float in the interval [0, inf]
def outlinewidth(self): """ Sets the width (in px) of the axis line. The 'outlinewidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["outlinewidth"]
[ "def", "outlinewidth", "(", "self", ")", ":", "return", "self", "[", "\"outlinewidth\"", "]" ]
[ 388, 4 ]
[ 399, 35 ]
python
en
['en', 'error', 'th']
False
ColorBar.separatethousands
(self)
If "true", even 4-digit integers are separated The 'separatethousands' property must be specified as a bool (either True, or False) Returns ------- bool
If "true", even 4-digit integers are separated The 'separatethousands' property must be specified as a bool (either True, or False)
def separatethousands(self): """ If "true", even 4-digit integers are separated The 'separatethousands' property must be specified as a bool (either True, or False) Returns ------- bool """ return self["separatethousands"]
[ "def", "separatethousands", "(", "self", ")", ":", "return", "self", "[", "\"separatethousands\"", "]" ]
[ 408, 4 ]
[ 419, 40 ]
python
en
['en', 'error', 'th']
False
ColorBar.showexponent
(self)
If "all", all exponents are shown besides their significands. If "first", only the exponent of the first tick is shown. If "last", only the exponent of the last tick is shown. If "none", no exponents appear. The 'showexponent' property is an enumeration that may be specifie...
If "all", all exponents are shown besides their significands. If "first", only the exponent of the first tick is shown. If "last", only the exponent of the last tick is shown. If "none", no exponents appear. The 'showexponent' property is an enumeration that may be specifie...
def showexponent(self): """ If "all", all exponents are shown besides their significands. If "first", only the exponent of the first tick is shown. If "last", only the exponent of the last tick is shown. If "none", no exponents appear. The 'showexponent' property is ...
[ "def", "showexponent", "(", "self", ")", ":", "return", "self", "[", "\"showexponent\"", "]" ]
[ 428, 4 ]
[ 443, 35 ]
python
en
['en', 'error', 'th']
False
ColorBar.showticklabels
(self)
Determines whether or not the tick labels are drawn. The 'showticklabels' property must be specified as a bool (either True, or False) Returns ------- bool
Determines whether or not the tick labels are drawn. The 'showticklabels' property must be specified as a bool (either True, or False)
def showticklabels(self): """ Determines whether or not the tick labels are drawn. The 'showticklabels' property must be specified as a bool (either True, or False) Returns ------- bool """ return self["showticklabels"]
[ "def", "showticklabels", "(", "self", ")", ":", "return", "self", "[", "\"showticklabels\"", "]" ]
[ 452, 4 ]
[ 463, 37 ]
python
en
['en', 'error', 'th']
False
ColorBar.showtickprefix
(self)
If "all", all tick labels are displayed with a prefix. If "first", only the first tick is displayed with a prefix. If "last", only the last tick is displayed with a suffix. If "none", tick prefixes are hidden. The 'showtickprefix' property is an enumeration that may be spec...
If "all", all tick labels are displayed with a prefix. If "first", only the first tick is displayed with a prefix. If "last", only the last tick is displayed with a suffix. If "none", tick prefixes are hidden. The 'showtickprefix' property is an enumeration that may be spec...
def showtickprefix(self): """ If "all", all tick labels are displayed with a prefix. If "first", only the first tick is displayed with a prefix. If "last", only the last tick is displayed with a suffix. If "none", tick prefixes are hidden. The 'showtickprefix' proper...
[ "def", "showtickprefix", "(", "self", ")", ":", "return", "self", "[", "\"showtickprefix\"", "]" ]
[ 472, 4 ]
[ 487, 37 ]
python
en
['en', 'error', 'th']
False
ColorBar.showticksuffix
(self)
Same as `showtickprefix` but for tick suffixes. The 'showticksuffix' property is an enumeration that may be specified as: - One of the following enumeration values: ['all', 'first', 'last', 'none'] Returns ------- Any
Same as `showtickprefix` but for tick suffixes. The 'showticksuffix' property is an enumeration that may be specified as: - One of the following enumeration values: ['all', 'first', 'last', 'none']
def showticksuffix(self): """ Same as `showtickprefix` but for tick suffixes. The 'showticksuffix' property is an enumeration that may be specified as: - One of the following enumeration values: ['all', 'first', 'last', 'none'] Returns ------- ...
[ "def", "showticksuffix", "(", "self", ")", ":", "return", "self", "[", "\"showticksuffix\"", "]" ]
[ 496, 4 ]
[ 508, 37 ]
python
en
['en', 'error', 'th']
False
ColorBar.thickness
(self)
Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels. The 'thickness' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels. The 'thickness' property is a number and may be specified as: - An int or float in the interval [0, inf]
def thickness(self): """ Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels. The 'thickness' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- i...
[ "def", "thickness", "(", "self", ")", ":", "return", "self", "[", "\"thickness\"", "]" ]
[ 517, 4 ]
[ 529, 32 ]
python
en
['en', 'error', 'th']
False
ColorBar.thicknessmode
(self)
Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot "fraction" or in "pixels". Use `thickness` to set the value. The 'thicknessmode' property is an enumeration that may be specified as: - One of the foll...
Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot "fraction" or in "pixels". Use `thickness` to set the value. The 'thicknessmode' property is an enumeration that may be specified as: - One of the foll...
def thicknessmode(self): """ Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot "fraction" or in "pixels". Use `thickness` to set the value. The 'thicknessmode' property is an enumeration that may be speci...
[ "def", "thicknessmode", "(", "self", ")", ":", "return", "self", "[", "\"thicknessmode\"", "]" ]
[ 538, 4 ]
[ 552, 36 ]
python
en
['en', 'error', 'th']
False
ColorBar.tick0
(self)
Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is "log", then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2) except when `dtick`=*L<f>* (see `dtick` for more info). If the axis `ty...
Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is "log", then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2) except when `dtick`=*L<f>* (see `dtick` for more info). If the axis `ty...
def tick0(self): """ Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is "log", then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2) except when `dtick`=*L<f>* (see `dtick` for...
[ "def", "tick0", "(", "self", ")", ":", "return", "self", "[", "\"tick0\"", "]" ]
[ 561, 4 ]
[ 579, 28 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickangle
(self)
Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. The 'tickangle' property is a angle (in degrees) that may be specified as a number between -180 and 180. Numeric values outside this ...
Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. The 'tickangle' property is a angle (in degrees) that may be specified as a number between -180 and 180. Numeric values outside this ...
def tickangle(self): """ Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. The 'tickangle' property is a angle (in degrees) that may be specified as a number between -180 and 180. Num...
[ "def", "tickangle", "(", "self", ")", ":", "return", "self", "[", "\"tickangle\"", "]" ]
[ 588, 4 ]
[ 603, 32 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickcolor
(self)
Sets the tick color. The 'tickcolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
Sets the tick color. The 'tickcolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') ...
def tickcolor(self): """ Sets the tick color. The 'tickcolor' property is a color and may be specified as: - A hex string (e.g. '#ff0000') - An rgb/rgba string (e.g. 'rgb(255,0,0)') - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') - An hsv/hsva string (e...
[ "def", "tickcolor", "(", "self", ")", ":", "return", "self", "[", "\"tickcolor\"", "]" ]
[ 612, 4 ]
[ 662, 32 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickfont
(self)
Sets the color bar's tick label font The 'tickfont' property is an instance of Tickfont that may be specified as: - An instance of :class:`plotly.graph_objs.treemap.marker.colorbar.Tickfont` - A dict of string/value properties that will be passed to the Tick...
Sets the color bar's tick label font The 'tickfont' property is an instance of Tickfont that may be specified as: - An instance of :class:`plotly.graph_objs.treemap.marker.colorbar.Tickfont` - A dict of string/value properties that will be passed to the Tick...
def tickfont(self): """ Sets the color bar's tick label font The 'tickfont' property is an instance of Tickfont that may be specified as: - An instance of :class:`plotly.graph_objs.treemap.marker.colorbar.Tickfont` - A dict of string/value properties that will be...
[ "def", "tickfont", "(", "self", ")", ":", "return", "self", "[", "\"tickfont\"", "]" ]
[ 671, 4 ]
[ 708, 31 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickformat
(self)
Sets the tick label formatting rule using d3 formatting mini- languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format And for dates see: https://github.com/d3/d3-3.x-api- refer...
Sets the tick label formatting rule using d3 formatting mini- languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format And for dates see: https://github.com/d3/d3-3.x-api- refer...
def tickformat(self): """ Sets the tick label formatting rule using d3 formatting mini- languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api- reference/blob/master/Formatting.md#d3_format And for dates see: https://github...
[ "def", "tickformat", "(", "self", ")", ":", "return", "self", "[", "\"tickformat\"", "]" ]
[ 717, 4 ]
[ 737, 33 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickformatstops
(self)
The 'tickformatstops' property is a tuple of instances of Tickformatstop that may be specified as: - A list or tuple of instances of plotly.graph_objs.treemap.marker.colorbar.Tickformatstop - A list or tuple of dicts of string/value properties that will be passed to the ...
The 'tickformatstops' property is a tuple of instances of Tickformatstop that may be specified as: - A list or tuple of instances of plotly.graph_objs.treemap.marker.colorbar.Tickformatstop - A list or tuple of dicts of string/value properties that will be passed to the ...
def tickformatstops(self): """ The 'tickformatstops' property is a tuple of instances of Tickformatstop that may be specified as: - A list or tuple of instances of plotly.graph_objs.treemap.marker.colorbar.Tickformatstop - A list or tuple of dicts of string/value properties t...
[ "def", "tickformatstops", "(", "self", ")", ":", "return", "self", "[", "\"tickformatstops\"", "]" ]
[ 746, 4 ]
[ 794, 38 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickformatstopdefaults
(self)
When used in a template (as layout.template.data.treemap.marker .colorbar.tickformatstopdefaults), sets the default property values to use for elements of treemap.marker.colorbar.tickformatstops The 'tickformatstopdefaults' property is an instance of Tickformatstop ...
When used in a template (as layout.template.data.treemap.marker .colorbar.tickformatstopdefaults), sets the default property values to use for elements of treemap.marker.colorbar.tickformatstops The 'tickformatstopdefaults' property is an instance of Tickformatstop ...
def tickformatstopdefaults(self): """ When used in a template (as layout.template.data.treemap.marker .colorbar.tickformatstopdefaults), sets the default property values to use for elements of treemap.marker.colorbar.tickformatstops The 'tickformatstopdefaults' prope...
[ "def", "tickformatstopdefaults", "(", "self", ")", ":", "return", "self", "[", "\"tickformatstopdefaults\"", "]" ]
[ 803, 4 ]
[ 822, 45 ]
python
en
['en', 'error', 'th']
False
ColorBar.ticklen
(self)
Sets the tick length (in px). The 'ticklen' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the tick length (in px). The 'ticklen' property is a number and may be specified as: - An int or float in the interval [0, inf]
def ticklen(self): """ Sets the tick length (in px). The 'ticklen' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["ticklen"]
[ "def", "ticklen", "(", "self", ")", ":", "return", "self", "[", "\"ticklen\"", "]" ]
[ 831, 4 ]
[ 842, 30 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickmode
(self)
Sets the tick mode for this axis. If "auto", the number of ticks is set via `nticks`. If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` ("linear" is the default value if `tick0` and `dtick` are provided). If "array", the...
Sets the tick mode for this axis. If "auto", the number of ticks is set via `nticks`. If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` ("linear" is the default value if `tick0` and `dtick` are provided). If "array", the...
def tickmode(self): """ Sets the tick mode for this axis. If "auto", the number of ticks is set via `nticks`. If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` ("linear" is the default value if `tick0` and `dtick`...
[ "def", "tickmode", "(", "self", ")", ":", "return", "self", "[", "\"tickmode\"", "]" ]
[ 851, 4 ]
[ 869, 31 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickprefix
(self)
Sets a tick label prefix. The 'tickprefix' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str
Sets a tick label prefix. The 'tickprefix' property is a string and must be specified as: - A string - A number that will be converted to a string
def tickprefix(self): """ Sets a tick label prefix. The 'tickprefix' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str """ return self["tickprefix"]
[ "def", "tickprefix", "(", "self", ")", ":", "return", "self", "[", "\"tickprefix\"", "]" ]
[ 878, 4 ]
[ 890, 33 ]
python
en
['en', 'error', 'th']
False
ColorBar.ticks
(self)
Determines whether ticks are drawn or not. If "", this axis' ticks are not drawn. If "outside" ("inside"), this axis' are drawn outside (inside) the axis lines. The 'ticks' property is an enumeration that may be specified as: - One of the following enumeration values: ...
Determines whether ticks are drawn or not. If "", this axis' ticks are not drawn. If "outside" ("inside"), this axis' are drawn outside (inside) the axis lines. The 'ticks' property is an enumeration that may be specified as: - One of the following enumeration values: ...
def ticks(self): """ Determines whether ticks are drawn or not. If "", this axis' ticks are not drawn. If "outside" ("inside"), this axis' are drawn outside (inside) the axis lines. The 'ticks' property is an enumeration that may be specified as: - One of the follo...
[ "def", "ticks", "(", "self", ")", ":", "return", "self", "[", "\"ticks\"", "]" ]
[ 899, 4 ]
[ 913, 28 ]
python
en
['en', 'error', 'th']
False
ColorBar.ticksuffix
(self)
Sets a tick label suffix. The 'ticksuffix' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str
Sets a tick label suffix. The 'ticksuffix' property is a string and must be specified as: - A string - A number that will be converted to a string
def ticksuffix(self): """ Sets a tick label suffix. The 'ticksuffix' property is a string and must be specified as: - A string - A number that will be converted to a string Returns ------- str """ return self["ticksuffix"]
[ "def", "ticksuffix", "(", "self", ")", ":", "return", "self", "[", "\"ticksuffix\"", "]" ]
[ 922, 4 ]
[ 934, 33 ]
python
en
['en', 'error', 'th']
False
ColorBar.ticktext
(self)
Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to "array". Used with `tickvals`. The 'ticktext' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns -------...
Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to "array". Used with `tickvals`. The 'ticktext' property is an array that may be specified as a tuple, list, numpy array, or pandas Series
def ticktext(self): """ Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to "array". Used with `tickvals`. The 'ticktext' property is an array that may be specified as a tuple, list, numpy array, or pandas Series ...
[ "def", "ticktext", "(", "self", ")", ":", "return", "self", "[", "\"ticktext\"", "]" ]
[ 943, 4 ]
[ 956, 31 ]
python
en
['en', 'error', 'th']
False
ColorBar.ticktextsrc
(self)
Sets the source reference on Chart Studio Cloud for ticktext . The 'ticktextsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for ticktext . The 'ticktextsrc' property must be specified as a string or as a plotly.grid_objs.Column object
def ticktextsrc(self): """ Sets the source reference on Chart Studio Cloud for ticktext . The 'ticktextsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["ticktextsrc"]
[ "def", "ticktextsrc", "(", "self", ")", ":", "return", "self", "[", "\"ticktextsrc\"", "]" ]
[ 965, 4 ]
[ 976, 34 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickvals
(self)
Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `ticktext`. The 'tickvals' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- numpy.nda...
Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `ticktext`. The 'tickvals' property is an array that may be specified as a tuple, list, numpy array, or pandas Series
def tickvals(self): """ Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `ticktext`. The 'tickvals' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ...
[ "def", "tickvals", "(", "self", ")", ":", "return", "self", "[", "\"tickvals\"", "]" ]
[ 985, 4 ]
[ 997, 31 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickvalssrc
(self)
Sets the source reference on Chart Studio Cloud for tickvals . The 'tickvalssrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for tickvals . The 'tickvalssrc' property must be specified as a string or as a plotly.grid_objs.Column object
def tickvalssrc(self): """ Sets the source reference on Chart Studio Cloud for tickvals . The 'tickvalssrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["tickvalssrc"]
[ "def", "tickvalssrc", "(", "self", ")", ":", "return", "self", "[", "\"tickvalssrc\"", "]" ]
[ 1006, 4 ]
[ 1017, 34 ]
python
en
['en', 'error', 'th']
False
ColorBar.tickwidth
(self)
Sets the tick width (in px). The 'tickwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the tick width (in px). The 'tickwidth' property is a number and may be specified as: - An int or float in the interval [0, inf]
def tickwidth(self): """ Sets the tick width (in px). The 'tickwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["tickwidth"]
[ "def", "tickwidth", "(", "self", ")", ":", "return", "self", "[", "\"tickwidth\"", "]" ]
[ 1026, 4 ]
[ 1037, 32 ]
python
en
['en', 'error', 'th']
False
ColorBar.title
(self)
The 'title' property is an instance of Title that may be specified as: - An instance of :class:`plotly.graph_objs.treemap.marker.colorbar.Title` - A dict of string/value properties that will be passed to the Title constructor Supported dict properties: ...
The 'title' property is an instance of Title that may be specified as: - An instance of :class:`plotly.graph_objs.treemap.marker.colorbar.Title` - A dict of string/value properties that will be passed to the Title constructor Supported dict properties: ...
def title(self): """ The 'title' property is an instance of Title that may be specified as: - An instance of :class:`plotly.graph_objs.treemap.marker.colorbar.Title` - A dict of string/value properties that will be passed to the Title constructor ...
[ "def", "title", "(", "self", ")", ":", "return", "self", "[", "\"title\"", "]" ]
[ 1046, 4 ]
[ 1076, 28 ]
python
en
['en', 'error', 'th']
False
ColorBar.titlefont
(self)
Deprecated: Please use treemap.marker.colorbar.title.font instead. Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute. The 'font' property is an instance of Font that may be specified as: ...
Deprecated: Please use treemap.marker.colorbar.title.font instead. Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute. The 'font' property is an instance of Font that may be specified as: ...
def titlefont(self): """ Deprecated: Please use treemap.marker.colorbar.title.font instead. Sets this color bar's title font. Note that the title's font used to be set by the now deprecated `titlefont` attribute. The 'font' property is an instance of Font tha...
[ "def", "titlefont", "(", "self", ")", ":", "return", "self", "[", "\"titlefont\"", "]" ]
[ 1085, 4 ]
[ 1125, 32 ]
python
en
['en', 'error', 'th']
False
ColorBar.titleside
(self)
Deprecated: Please use treemap.marker.colorbar.title.side instead. Determines the location of color bar's title with respect to the color bar. Note that the title's location used to be set by the now deprecated `titleside` attribute. The 'side' property is an enumeration th...
Deprecated: Please use treemap.marker.colorbar.title.side instead. Determines the location of color bar's title with respect to the color bar. Note that the title's location used to be set by the now deprecated `titleside` attribute. The 'side' property is an enumeration th...
def titleside(self): """ Deprecated: Please use treemap.marker.colorbar.title.side instead. Determines the location of color bar's title with respect to the color bar. Note that the title's location used to be set by the now deprecated `titleside` attribute. The 'sid...
[ "def", "titleside", "(", "self", ")", ":", "return", "self", "[", "\"titleside\"", "]" ]
[ 1134, 4 ]
[ 1149, 32 ]
python
en
['en', 'error', 'th']
False
ColorBar.x
(self)
Sets the x position of the color bar (in plot fraction). The 'x' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float
Sets the x position of the color bar (in plot fraction). The 'x' property is a number and may be specified as: - An int or float in the interval [-2, 3]
def x(self): """ Sets the x position of the color bar (in plot fraction). The 'x' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float """ return self["x"]
[ "def", "x", "(", "self", ")", ":", "return", "self", "[", "\"x\"", "]" ]
[ 1158, 4 ]
[ 1169, 24 ]
python
en
['en', 'error', 'th']
False
ColorBar.xanchor
(self)
Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the color bar. The 'xanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['left',...
Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the color bar. The 'xanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['left',...
def xanchor(self): """ Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the color bar. The 'xanchor' property is an enumeration that may be specified as: - One of the following enumeration va...
[ "def", "xanchor", "(", "self", ")", ":", "return", "self", "[", "\"xanchor\"", "]" ]
[ 1178, 4 ]
[ 1192, 30 ]
python
en
['en', 'error', 'th']
False
ColorBar.xpad
(self)
Sets the amount of padding (in px) along the x direction. The 'xpad' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the amount of padding (in px) along the x direction. The 'xpad' property is a number and may be specified as: - An int or float in the interval [0, inf]
def xpad(self): """ Sets the amount of padding (in px) along the x direction. The 'xpad' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["xpad"]
[ "def", "xpad", "(", "self", ")", ":", "return", "self", "[", "\"xpad\"", "]" ]
[ 1201, 4 ]
[ 1212, 27 ]
python
en
['en', 'error', 'th']
False
ColorBar.y
(self)
Sets the y position of the color bar (in plot fraction). The 'y' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float
Sets the y position of the color bar (in plot fraction). The 'y' property is a number and may be specified as: - An int or float in the interval [-2, 3]
def y(self): """ Sets the y position of the color bar (in plot fraction). The 'y' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float """ return self["y"]
[ "def", "y", "(", "self", ")", ":", "return", "self", "[", "\"y\"", "]" ]
[ 1221, 4 ]
[ 1232, 24 ]
python
en
['en', 'error', 'th']
False
ColorBar.yanchor
(self)
Sets this color bar's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the color bar. The 'yanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['top', 'mi...
Sets this color bar's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the color bar. The 'yanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['top', 'mi...
def yanchor(self): """ Sets this color bar's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the color bar. The 'yanchor' property is an enumeration that may be specified as: - One of the following enumeration value...
[ "def", "yanchor", "(", "self", ")", ":", "return", "self", "[", "\"yanchor\"", "]" ]
[ 1241, 4 ]
[ 1255, 30 ]
python
en
['en', 'error', 'th']
False
ColorBar.ypad
(self)
Sets the amount of padding (in px) along the y direction. The 'ypad' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the amount of padding (in px) along the y direction. The 'ypad' property is a number and may be specified as: - An int or float in the interval [0, inf]
def ypad(self): """ Sets the amount of padding (in px) along the y direction. The 'ypad' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["ypad"]
[ "def", "ypad", "(", "self", ")", ":", "return", "self", "[", "\"ypad\"", "]" ]
[ 1264, 4 ]
[ 1275, 27 ]
python
en
['en', 'error', 'th']
False
ColorBar.__init__
( self, arg=None, bgcolor=None, bordercolor=None, borderwidth=None, dtick=None, exponentformat=None, len=None, lenmode=None, nticks=None, outlinecolor=None, outlinewidth=None, separatethousands=None, showexpo...
Construct a new ColorBar object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.treemap.marker.ColorBar` bgcolor Sets the color of padded area. ...
Construct a new ColorBar object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.treemap.marker.ColorBar` bgcolor Sets the color of padded area. ...
def __init__( self, arg=None, bgcolor=None, bordercolor=None, borderwidth=None, dtick=None, exponentformat=None, len=None, lenmode=None, nticks=None, outlinecolor=None, outlinewidth=None, separatethousands=None, ...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "bgcolor", "=", "None", ",", "bordercolor", "=", "None", ",", "borderwidth", "=", "None", ",", "dtick", "=", "None", ",", "exponentformat", "=", "None", ",", "len", "=", "None", ",", "lenm...
[ 1482, 4 ]
[ 1941, 34 ]
python
en
['en', 'error', 'th']
False
Line.color
(self)
Sets themarker.linecolor. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.line.cmin` and `marker.line.cmax` if set. The 'color' property is a color and may be ...
Sets themarker.linecolor. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.line.cmin` and `marker.line.cmax` if set. The 'color' property is a color and may be ...
def color(self): """ Sets themarker.linecolor. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.line.cmin` and `marker.line.cmax` if set. The 'color' pro...
[ "def", "color", "(", "self", ")", ":", "return", "self", "[", "\"color\"", "]" ]
[ 15, 4 ]
[ 69, 28 ]
python
en
['en', 'error', 'th']
False
Line.colorsrc
(self)
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object
def colorsrc(self): """ Sets the source reference on Chart Studio Cloud for color . The 'colorsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["colorsrc"]
[ "def", "colorsrc", "(", "self", ")", ":", "return", "self", "[", "\"colorsrc\"", "]" ]
[ 78, 4 ]
[ 89, 31 ]
python
en
['en', 'error', 'th']
False
Line.width
(self)
Sets the width (in px) of the lines bounding the marker points. The 'width' property is a number and may be specified as: - An int or float in the interval [0, inf] - A tuple, list, or one-dimensional numpy array of the above Returns ------- int|float|n...
Sets the width (in px) of the lines bounding the marker points. The 'width' property is a number and may be specified as: - An int or float in the interval [0, inf] - A tuple, list, or one-dimensional numpy array of the above
def width(self): """ Sets the width (in px) of the lines bounding the marker points. The 'width' property is a number and may be specified as: - An int or float in the interval [0, inf] - A tuple, list, or one-dimensional numpy array of the above Returns ...
[ "def", "width", "(", "self", ")", ":", "return", "self", "[", "\"width\"", "]" ]
[ 98, 4 ]
[ 110, 28 ]
python
en
['en', 'error', 'th']
False
Line.widthsrc
(self)
Sets the source reference on Chart Studio Cloud for width . The 'widthsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str
Sets the source reference on Chart Studio Cloud for width . The 'widthsrc' property must be specified as a string or as a plotly.grid_objs.Column object
def widthsrc(self): """ Sets the source reference on Chart Studio Cloud for width . The 'widthsrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["widthsrc"]
[ "def", "widthsrc", "(", "self", ")", ":", "return", "self", "[", "\"widthsrc\"", "]" ]
[ 119, 4 ]
[ 130, 31 ]
python
en
['en', 'error', 'th']
False
Line.__init__
( self, arg=None, color=None, colorsrc=None, width=None, widthsrc=None, **kwargs )
Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.choroplethmapbox.marker.Line` color Sets themarker.linecolor. It accepts...
Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.choroplethmapbox.marker.Line` color Sets themarker.linecolor. It accepts...
def __init__( self, arg=None, color=None, colorsrc=None, width=None, widthsrc=None, **kwargs ): """ Construct a new Line object Parameters ---------- arg dict of properties compatible with this constructor or an instance of ...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "color", "=", "None", ",", "colorsrc", "=", "None", ",", "width", "=", "None", ",", "widthsrc", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Line", ",", "self", ")", ...
[ 158, 4 ]
[ 242, 34 ]
python
en
['en', 'error', 'th']
False
parse_requirements
(filename)
Load requirements from a pip requirements file.
Load requirements from a pip requirements file.
def parse_requirements(filename): """Load requirements from a pip requirements file.""" lineiter = (line.strip() for line in open(filename)) return [line for line in lineiter if line and not line.startswith("#")]
[ "def", "parse_requirements", "(", "filename", ")", ":", "lineiter", "=", "(", "line", ".", "strip", "(", ")", "for", "line", "in", "open", "(", "filename", ")", ")", "return", "[", "line", "for", "line", "in", "lineiter", "if", "line", "and", "not", ...
[ 15, 0 ]
[ 18, 75 ]
python
en
['en', 'en', 'en']
True
RegexpTokenizer.__init__
(self, **kwargs)
Args: annotators: None or empty set (only tokenizes). substitutions: if true, normalizes some token types (e.g. quotes).
Args: annotators: None or empty set (only tokenizes). substitutions: if true, normalizes some token types (e.g. quotes).
def __init__(self, **kwargs): """ Args: annotators: None or empty set (only tokenizes). substitutions: if true, normalizes some token types (e.g. quotes). """ self._regexp = regex.compile( '(?P<digit>%s)|(?P<title>%s)|(?P<abbr>%s)|(?P<neg>%s)|(?P<hyph>...
[ "def", "__init__", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_regexp", "=", "regex", ".", "compile", "(", "'(?P<digit>%s)|(?P<title>%s)|(?P<abbr>%s)|(?P<neg>%s)|(?P<hyph>%s)|'", "'(?P<contr1>%s)|(?P<alphanum>%s)|(?P<contr2>%s)|(?P<sdquote>%s)|'", "'(?P<edq...
[ 38, 4 ]
[ 75, 62 ]
python
en
['en', 'error', 'th']
False
Stream.maxpoints
(self)
Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or float in the interval [0, 10000]...
Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or float in the interval [0, 10000]
def maxpoints(self): """ Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to 50, only the newest 50 points will be displayed on the plot. The 'maxpoints' property is a number and may be specified as: - An int or ...
[ "def", "maxpoints", "(", "self", ")", ":", "return", "self", "[", "\"maxpoints\"", "]" ]
[ 15, 4 ]
[ 28, 32 ]
python
en
['en', 'error', 'th']
False
Stream.token
(self)
The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string Returns ------- str
The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string
def token(self): """ The stream id number links a data trace on a plot with a stream. See https://chart-studio.plotly.com/settings for more details. The 'token' property is a string and must be specified as: - A non-empty string Returns ------- ...
[ "def", "token", "(", "self", ")", ":", "return", "self", "[", "\"token\"", "]" ]
[ 37, 4 ]
[ 50, 28 ]
python
en
['en', 'error', 'th']
False
Stream.__init__
(self, arg=None, maxpoints=None, token=None, **kwargs)
Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scatter.Stream` maxpoints Sets the maximum number of points to keep on...
Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scatter.Stream` maxpoints Sets the maximum number of points to keep on...
def __init__(self, arg=None, maxpoints=None, token=None, **kwargs): """ Construct a new Stream object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.scatter.Str...
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "maxpoints", "=", "None", ",", "token", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Stream", ",", "self", ")", ".", "__init__", "(", "\"stream\"", ")", "if", "\"_paren...
[ 72, 4 ]
[ 140, 34 ]
python
en
['en', 'error', 'th']
False
RSSReader.__init__
(self, factory, url, rate)
Initialize the reader. Args: factory (RSSFactory): The protocol factory. url (str): The RSS url. rate (int): The seconds between RSS lookups.
Initialize the reader.
def __init__(self, factory, url, rate): """ Initialize the reader. Args: factory (RSSFactory): The protocol factory. url (str): The RSS url. rate (int): The seconds between RSS lookups. """ self.url = url self.rate = rate self...
[ "def", "__init__", "(", "self", ",", "factory", ",", "url", ",", "rate", ")", ":", "self", ".", "url", "=", "url", "self", ".", "rate", "=", "rate", "self", ".", "factory", "=", "factory", "self", ".", "old_entries", "=", "{", "}" ]
[ 30, 4 ]
[ 43, 29 ]
python
en
['en', 'error', 'th']
False
RSSReader.get_new
(self)
Returns list of new items.
Returns list of new items.
def get_new(self): """ Returns list of new items. """ feed = feedparser.parse(self.url) new_entries = [] for entry in feed['entries']: idval = entry['id'] + entry.get("updated", "") if idval not in self.old_entries: self.old_entrie...
[ "def", "get_new", "(", "self", ")", ":", "feed", "=", "feedparser", ".", "parse", "(", "self", ".", "url", ")", "new_entries", "=", "[", "]", "for", "entry", "in", "feed", "[", "'entries'", "]", ":", "idval", "=", "entry", "[", "'id'", "]", "+", ...
[ 45, 4 ]
[ 57, 26 ]
python
en
['en', 'error', 'th']
False
RSSReader.disconnect
(self, reason=None)
Disconnect from feed. Args: reason (str, optional): Motivation for the disconnect.
Disconnect from feed.
def disconnect(self, reason=None): """ Disconnect from feed. Args: reason (str, optional): Motivation for the disconnect. """ if self.factory.task and self.factory.task.running: self.factory.task.stop() self.sessionhandler.disconnect(self)
[ "def", "disconnect", "(", "self", ",", "reason", "=", "None", ")", ":", "if", "self", ".", "factory", ".", "task", "and", "self", ".", "factory", ".", "task", ".", "running", ":", "self", ".", "factory", ".", "task", ".", "stop", "(", ")", "self", ...
[ 59, 4 ]
[ 69, 44 ]
python
en
['en', 'error', 'th']
False
RSSReader._callback
(self, new_entries, init)
Called when RSS returns. Args: new_entries (list): List of new RSS entries since last. init (bool): If this is a startup operation (at which point all entries are considered new).
Called when RSS returns.
def _callback(self, new_entries, init): """ Called when RSS returns. Args: new_entries (list): List of new RSS entries since last. init (bool): If this is a startup operation (at which point all entries are considered new). """ if not ini...
[ "def", "_callback", "(", "self", ",", "new_entries", ",", "init", ")", ":", "if", "not", "init", ":", "# for initialization we just ignore old entries", "for", "entry", "in", "reversed", "(", "new_entries", ")", ":", "self", ".", "data_in", "(", "entry", ")" ]
[ 71, 4 ]
[ 84, 35 ]
python
en
['en', 'error', 'th']
False
RSSReader.data_in
(self, text=None, **kwargs)
Data RSS -> Evennia. Kwargs: text (str): Incoming text kwargs (any): Options from protocol.
Data RSS -> Evennia.
def data_in(self, text=None, **kwargs): """ Data RSS -> Evennia. Kwargs: text (str): Incoming text kwargs (any): Options from protocol. """ self.sessionhandler.data_in(self, bot_data_in=text, **kwargs)
[ "def", "data_in", "(", "self", ",", "text", "=", "None", ",", "*", "*", "kwargs", ")", ":", "self", ".", "sessionhandler", ".", "data_in", "(", "self", ",", "bot_data_in", "=", "text", ",", "*", "*", "kwargs", ")" ]
[ 86, 4 ]
[ 95, 69 ]
python
en
['en', 'error', 'th']
False
RSSReader._errback
(self, fail)
Report error
Report error
def _errback(self, fail): "Report error" logger.log_err("RSS feed error: %s" % fail.value)
[ "def", "_errback", "(", "self", ",", "fail", ")", ":", "logger", ".", "log_err", "(", "\"RSS feed error: %s\"", "%", "fail", ".", "value", ")" ]
[ 97, 4 ]
[ 99, 57 ]
python
da
['da', 'nl', 'en']
False
RSSReader.update
(self, init=False)
Request the latest version of feed. Args: init (bool, optional): If this is an initialization call or not (during init, all entries are conidered new). Notes: This call is done in a separate thread to avoid blocking on slow connections. ...
Request the latest version of feed.
def update(self, init=False): """ Request the latest version of feed. Args: init (bool, optional): If this is an initialization call or not (during init, all entries are conidered new). Notes: This call is done in a separate thread to avoid block...
[ "def", "update", "(", "self", ",", "init", "=", "False", ")", ":", "return", "threads", ".", "deferToThread", "(", "self", ".", "get_new", ")", ".", "addCallback", "(", "self", ".", "_callback", ",", "init", ")", ".", "addErrback", "(", "self", ".", ...
[ 101, 4 ]
[ 114, 110 ]
python
en
['en', 'error', 'th']
False
RSSBotFactory.__init__
(self, sessionhandler, uid=None, url=None, rate=None)
Initialize the bot. Args: sessionhandler (PortalSessionHandler): The main sessionhandler object. uid (int): User id for the bot. url (str): The RSS URL. rate (int): How often for the RSS to request the latest RSS entries.
Initialize the bot.
def __init__(self, sessionhandler, uid=None, url=None, rate=None): """ Initialize the bot. Args: sessionhandler (PortalSessionHandler): The main sessionhandler object. uid (int): User id for the bot. url (str): The RSS URL. rate (int): How often f...
[ "def", "__init__", "(", "self", ",", "sessionhandler", ",", "uid", "=", "None", ",", "url", "=", "None", ",", "rate", "=", "None", ")", ":", "self", ".", "sessionhandler", "=", "sessionhandler", "self", ".", "url", "=", "url", "self", ".", "rate", "=...
[ 122, 4 ]
[ 138, 24 ]
python
en
['en', 'error', 'th']
False
RSSBotFactory.start
(self)
Called by portalsessionhandler. Starts te bot.
Called by portalsessionhandler. Starts te bot.
def start(self): """ Called by portalsessionhandler. Starts te bot. """ def errback(fail): logger.log_err(fail.value) # set up session and connect it to sessionhandler self.bot.init_session("rssbot", self.url, self.sessionhandler) self.bot.uid = self....
[ "def", "start", "(", "self", ")", ":", "def", "errback", "(", "fail", ")", ":", "logger", ".", "log_err", "(", "fail", ".", "value", ")", "# set up session and connect it to sessionhandler", "self", ".", "bot", ".", "init_session", "(", "\"rssbot\"", ",", "s...
[ 140, 4 ]
[ 157, 69 ]
python
en
['en', 'error', 'th']
False
clip_grad_norm
(params, max_norm)
Clips grad norm.
Clips grad norm.
def clip_grad_norm(params, max_norm): """ Clips grad norm. """ params = list(params) if len(params) == 1: p = params[0] grad_norm = torch.norm(p) if grad_norm > max_norm > 0: clip_coef = max_norm / (grad_norm + 1e-6) p.mul_(clip_coef) return gr...
[ "def", "clip_grad_norm", "(", "params", ",", "max_norm", ")", ":", "params", "=", "list", "(", "params", ")", "if", "len", "(", "params", ")", "==", "1", ":", "p", "=", "params", "[", "0", "]", "grad_norm", "=", "torch", ".", "norm", "(", "p", ")...
[ 58, 0 ]
[ 75, 9 ]
python
en
['en', 'error', 'th']
False
has_overflow
(grad_norm)
Detect inf and NaN in grad_norm.
Detect inf and NaN in grad_norm.
def has_overflow(grad_norm): """ Detect inf and NaN in grad_norm. """ if grad_norm == float('inf') or grad_norm != grad_norm: return True return False
[ "def", "has_overflow", "(", "grad_norm", ")", ":", "if", "grad_norm", "==", "float", "(", "'inf'", ")", "or", "grad_norm", "!=", "grad_norm", ":", "return", "True", "return", "False" ]
[ 78, 0 ]
[ 84, 16 ]
python
en
['en', 'error', 'th']
False
fp16_optimizer_wrapper
( optimizer: torch.optim.Optimizer, # type: ignore verbose: bool = False, dynamic_loss_scale: bool = True, loss_initial_scale: float = 2.0 ** 17, )
Wrap the an optimizer with FP16 loss scaling protection. Requires apex to be installed. Will throw an ImportError if it is not. :param optimizer: Any torch optimizer :param bool verbose: Enables verbose output in the FP16 optimizer. Turning this on can help debug when FP16 is ...
Wrap the an optimizer with FP16 loss scaling protection.
def fp16_optimizer_wrapper( optimizer: torch.optim.Optimizer, # type: ignore verbose: bool = False, dynamic_loss_scale: bool = True, loss_initial_scale: float = 2.0 ** 17, ): """ Wrap the an optimizer with FP16 loss scaling protection. Requires apex to be installed. Will throw an ImportErr...
[ "def", "fp16_optimizer_wrapper", "(", "optimizer", ":", "torch", ".", "optim", ".", "Optimizer", ",", "# type: ignore", "verbose", ":", "bool", "=", "False", ",", "dynamic_loss_scale", ":", "bool", "=", "True", ",", "loss_initial_scale", ":", "float", "=", "2....
[ 92, 0 ]
[ 134, 5 ]
python
en
['en', 'error', 'th']
False
DynamicLossScaler.__init__
( self, init_scale: float = 2.0 ** 15, scale_factor: float = 2.0, scale_window: int = 2000, tolerance: float = 0.05, threshold: float = None, )
:param init_scale: Initial loss scale. :param scale_factor: Factor by which to increase or decrease loss scale. :param scale_window: If we do not experience overflow in scale_window iterations, loss scale will increase by scale_factor. :pa...
:param init_scale: Initial loss scale. :param scale_factor: Factor by which to increase or decrease loss scale. :param scale_window: If we do not experience overflow in scale_window iterations, loss scale will increase by scale_factor. :pa...
def __init__( self, init_scale: float = 2.0 ** 15, scale_factor: float = 2.0, scale_window: int = 2000, tolerance: float = 0.05, threshold: float = None, ): """ :param init_scale: Initial loss scale. :param scale_factor: ...
[ "def", "__init__", "(", "self", ",", "init_scale", ":", "float", "=", "2.0", "**", "15", ",", "scale_factor", ":", "float", "=", "2.0", ",", "scale_window", ":", "int", "=", "2000", ",", "tolerance", ":", "float", "=", "0.05", ",", "threshold", ":", ...
[ 165, 4 ]
[ 196, 41 ]
python
en
['en', 'error', 'th']
False
DynamicLossScaler.update_scale
(self, overflow: bool)
Update the loss scale. If overflow exceeds our tolerance, we decrease the loss scale. If the number of iterations since the last overflow exceeds the scale window, we increase the loss scale.
Update the loss scale.
def update_scale(self, overflow: bool): """ Update the loss scale. If overflow exceeds our tolerance, we decrease the loss scale. If the number of iterations since the last overflow exceeds the scale window, we increase the loss scale. """ iter_since_rescale = se...
[ "def", "update_scale", "(", "self", ",", "overflow", ":", "bool", ")", ":", "iter_since_rescale", "=", "self", ".", "_iter", "-", "self", ".", "_last_rescale_iter", "if", "overflow", ":", "# calculate how often we overflowed already", "self", ".", "_last_overflow_it...
[ 198, 4 ]
[ 224, 23 ]
python
en
['en', 'error', 'th']
False
DynamicLossScaler._decrease_loss_scale
(self)
Decrease the loss scale by self.scale_factor. NOTE: the loss_scale will not go below self.threshold.
Decrease the loss scale by self.scale_factor.
def _decrease_loss_scale(self): """ Decrease the loss scale by self.scale_factor. NOTE: the loss_scale will not go below self.threshold. """ self.loss_scale /= self.scale_factor if self.threshold is not None: self.loss_scale = max(self.loss_scale, self.thresh...
[ "def", "_decrease_loss_scale", "(", "self", ")", ":", "self", ".", "loss_scale", "/=", "self", ".", "scale_factor", "if", "self", ".", "threshold", "is", "not", "None", ":", "self", ".", "loss_scale", "=", "max", "(", "self", ".", "loss_scale", ",", "sel...
[ 226, 4 ]
[ 234, 66 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.compatible_optimizers
()
List of compatible optimizers.
List of compatible optimizers.
def compatible_optimizers(): """ List of compatible optimizers. """ return ['adam', 'mem_eff_adam', 'adafactor']
[ "def", "compatible_optimizers", "(", ")", ":", "return", "[", "'adam'", ",", "'mem_eff_adam'", ",", "'adafactor'", "]" ]
[ 272, 4 ]
[ 276, 52 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.params
(self)
Return an iterable of the parameters held by the optimizer.
Return an iterable of the parameters held by the optimizer.
def params(self): """ Return an iterable of the parameters held by the optimizer. """ for param_group in self.optimizer.param_groups: for p in param_group['params']: yield p
[ "def", "params", "(", "self", ")", ":", "for", "param_group", "in", "self", ".", "optimizer", ".", "param_groups", ":", "for", "p", "in", "param_group", "[", "'params'", "]", ":", "yield", "p" ]
[ 279, 4 ]
[ 285, 23 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.clip_master_grads
(self, gradient_clip)
Clips gradient norm and updates dynamic loss scaler. Returns -1 if the most recently computed gradients overflowed.
Clips gradient norm and updates dynamic loss scaler.
def clip_master_grads(self, gradient_clip): """ Clips gradient norm and updates dynamic loss scaler. Returns -1 if the most recently computed gradients overflowed. """ self._unscale_grads() grad_norm = clip_grad_norm(self.params, gradient_clip) # detect overflow ...
[ "def", "clip_master_grads", "(", "self", ",", "gradient_clip", ")", ":", "self", ".", "_unscale_grads", "(", ")", "grad_norm", "=", "clip_grad_norm", "(", "self", ".", "params", ",", "gradient_clip", ")", "# detect overflow and adjust loss scale", "overflow", "=", ...
[ 312, 4 ]
[ 338, 24 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.multiply_grads
(self, c)
Multiplies grads by a constant `c`.
Multiplies grads by a constant `c`.
def multiply_grads(self, c): """ Multiplies grads by a constant `c`. """ if self._grads_are_scaled: self._unscale_grads(c) else: for p in self.params: if p.grad is not None: p.grad.data.mul_(c)
[ "def", "multiply_grads", "(", "self", ",", "c", ")", ":", "if", "self", ".", "_grads_are_scaled", ":", "self", ".", "_unscale_grads", "(", "c", ")", "else", ":", "for", "p", "in", "self", ".", "params", ":", "if", "p", ".", "grad", "is", "not", "No...
[ 344, 4 ]
[ 353, 39 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.backward
(self, loss, update_master_grads=False)
Computes the sum of gradients of the given tensor w.r.t. graph leaves. Compared to a regular backwards call , this function dynamically scales the loss to avoid gradient underflow.
Computes the sum of gradients of the given tensor w.r.t. graph leaves.
def backward(self, loss, update_master_grads=False): """ Computes the sum of gradients of the given tensor w.r.t. graph leaves. Compared to a regular backwards call , this function dynamically scales the loss to avoid gradient underflow. """ loss = loss * self.scaler.los...
[ "def", "backward", "(", "self", ",", "loss", ",", "update_master_grads", "=", "False", ")", ":", "loss", "=", "loss", "*", "self", ".", "scaler", ".", "loss_scale", "loss", ".", "backward", "(", ")", "self", ".", "_grads_are_scaled", "=", "True" ]
[ 355, 4 ]
[ 364, 37 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.step
(self, closure=None)
Performs a single optimization step.
Performs a single optimization step.
def step(self, closure=None): """ Performs a single optimization step. """ self._unscale_grads() self.optimizer.step(closure)
[ "def", "step", "(", "self", ",", "closure", "=", "None", ")", ":", "self", ".", "_unscale_grads", "(", ")", "self", ".", "optimizer", ".", "step", "(", "closure", ")" ]
[ 366, 4 ]
[ 371, 36 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.state_dict
(self)
Return the optimizer's state dict.
Return the optimizer's state dict.
def state_dict(self): """ Return the optimizer's state dict. """ state_dict = self.optimizer.state_dict() state_dict['loss_scaler'] = self.scaler return state_dict
[ "def", "state_dict", "(", "self", ")", ":", "state_dict", "=", "self", ".", "optimizer", ".", "state_dict", "(", ")", "state_dict", "[", "'loss_scaler'", "]", "=", "self", ".", "scaler", "return", "state_dict" ]
[ 373, 4 ]
[ 379, 25 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.load_state_dict
(self, state_dict)
Load an optimizer state dict. Override from PyTorch implementation to avoid casting to FP32.
Load an optimizer state dict.
def load_state_dict(self, state_dict): """ Load an optimizer state dict. Override from PyTorch implementation to avoid casting to FP32. """ if 'loss_scaler' in state_dict: # init from the state dict self.scaler = state_dict['loss_scaler'] self.op...
[ "def", "load_state_dict", "(", "self", ",", "state_dict", ")", ":", "if", "'loss_scaler'", "in", "state_dict", ":", "# init from the state dict", "self", ".", "scaler", "=", "state_dict", "[", "'loss_scaler'", "]", "self", ".", "optimizer", ".", "load_state_dict",...
[ 381, 4 ]
[ 416, 59 ]
python
en
['en', 'error', 'th']
False
MemoryEfficientFP16Optimizer.loss_scale
(self)
Convenience function which TorchAgent calls to get current scale value.
Convenience function which TorchAgent calls to get current scale value.
def loss_scale(self): """ Convenience function which TorchAgent calls to get current scale value. """ return self.scaler.loss_scale
[ "def", "loss_scale", "(", "self", ")", ":", "return", "self", ".", "scaler", ".", "loss_scale" ]
[ 419, 4 ]
[ 423, 37 ]
python
en
['en', 'error', 'th']
False