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 |
---|---|---|---|---|---|---|---|---|---|---|---|
_load_fido_apps | () | Load FIDO apps from `fido/*.json` | Load FIDO apps from `fido/*.json` | def _load_fido_apps():
"""Load FIDO apps from `fido/*.json`"""
apps = []
for filename in sorted(glob.glob(os.path.join(DEFS_DIR, "fido", "*.json"))):
app_name = os.path.basename(filename)[:-5].lower()
app = load_json(filename)
app.setdefault("use_sign_count", None)
app.setdefault("use_self_attestation", None)
app.setdefault("u2f", [])
app.setdefault("webauthn", [])
icon_path = os.path.join(DEFS_DIR, "fido", app_name + ".png")
if not os.path.exists(icon_path):
icon_path = None
app.update(key=app_name, icon=icon_path)
apps.append(app)
return apps | [
"def",
"_load_fido_apps",
"(",
")",
":",
"apps",
"=",
"[",
"]",
"for",
"filename",
"in",
"sorted",
"(",
"glob",
".",
"glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"DEFS_DIR",
",",
"\"fido\"",
",",
"\"*.json\"",
")",
")",
")",
":",
"app_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"filename",
")",
"[",
":",
"-",
"5",
"]",
".",
"lower",
"(",
")",
"app",
"=",
"load_json",
"(",
"filename",
")",
"app",
".",
"setdefault",
"(",
"\"use_sign_count\"",
",",
"None",
")",
"app",
".",
"setdefault",
"(",
"\"use_self_attestation\"",
",",
"None",
")",
"app",
".",
"setdefault",
"(",
"\"u2f\"",
",",
"[",
"]",
")",
"app",
".",
"setdefault",
"(",
"\"webauthn\"",
",",
"[",
"]",
")",
"icon_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"DEFS_DIR",
",",
"\"fido\"",
",",
"app_name",
"+",
"\".png\"",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"icon_path",
")",
":",
"icon_path",
"=",
"None",
"app",
".",
"update",
"(",
"key",
"=",
"app_name",
",",
"icon",
"=",
"icon_path",
")",
"apps",
".",
"append",
"(",
"app",
")",
"return",
"apps"
] | [
276,
0
] | [
294,
15
] | python | en | ['en', 'fy', 'en'] | True |
get_support_data | () | Get raw support data from `support.json`. | Get raw support data from `support.json`. | def get_support_data():
"""Get raw support data from `support.json`."""
return load_json("support.json") | [
"def",
"get_support_data",
"(",
")",
":",
"return",
"load_json",
"(",
"\"support.json\"",
")"
] | [
304,
0
] | [
306,
36
] | python | en | ['en', 'en', 'en'] | True |
latest_releases | () | Get latest released firmware versions for Trezor 1 and 2 | Get latest released firmware versions for Trezor 1 and 2 | def latest_releases():
"""Get latest released firmware versions for Trezor 1 and 2"""
if not requests:
raise RuntimeError("requests library is required for getting release info")
latest = {}
for v in ("1", "2"):
releases = requests.get(RELEASES_URL.format(v)).json()
latest["trezor" + v] = max(tuple(r["version"]) for r in releases)
return latest | [
"def",
"latest_releases",
"(",
")",
":",
"if",
"not",
"requests",
":",
"raise",
"RuntimeError",
"(",
"\"requests library is required for getting release info\"",
")",
"latest",
"=",
"{",
"}",
"for",
"v",
"in",
"(",
"\"1\"",
",",
"\"2\"",
")",
":",
"releases",
"=",
"requests",
".",
"get",
"(",
"RELEASES_URL",
".",
"format",
"(",
"v",
")",
")",
".",
"json",
"(",
")",
"latest",
"[",
"\"trezor\"",
"+",
"v",
"]",
"=",
"max",
"(",
"tuple",
"(",
"r",
"[",
"\"version\"",
"]",
")",
"for",
"r",
"in",
"releases",
")",
"return",
"latest"
] | [
309,
0
] | [
318,
17
] | python | en | ['en', 'en', 'en'] | True |
support_info_single | (support_data, coin) | Extract a support dict from `support.json` data.
Returns a dict of support values for each "device", i.e., `support.json`
top-level key.
The support value for each device is determined in order of priority:
* if the coin is a duplicate ERC20 token, all support values are `None`
* if the coin has an entry in `unsupported`, its support is `None`
* if the coin has an entry in `supported` its support is that entry
(usually a version string, or `True` for connect/webwallet)
* otherwise support is presumed "soon"
| Extract a support dict from `support.json` data. | def support_info_single(support_data, coin):
"""Extract a support dict from `support.json` data.
Returns a dict of support values for each "device", i.e., `support.json`
top-level key.
The support value for each device is determined in order of priority:
* if the coin is a duplicate ERC20 token, all support values are `None`
* if the coin has an entry in `unsupported`, its support is `None`
* if the coin has an entry in `supported` its support is that entry
(usually a version string, or `True` for connect/webwallet)
* otherwise support is presumed "soon"
"""
support_info = {}
key = coin["key"]
dup = coin.get("duplicate")
for device, values in support_data.items():
if key in values["unsupported"]:
support_value = False
elif key in values["supported"]:
support_value = values["supported"][key]
elif device in MISSING_SUPPORT_MEANS_NO:
support_value = False
elif is_token(coin):
if dup:
# if duplicate token that is not explicitly listed, it's unsupported
support_value = False
else:
# otherwise implicitly supported in next
support_value = "soon"
else:
support_value = None
support_info[device] = support_value
return support_info | [
"def",
"support_info_single",
"(",
"support_data",
",",
"coin",
")",
":",
"support_info",
"=",
"{",
"}",
"key",
"=",
"coin",
"[",
"\"key\"",
"]",
"dup",
"=",
"coin",
".",
"get",
"(",
"\"duplicate\"",
")",
"for",
"device",
",",
"values",
"in",
"support_data",
".",
"items",
"(",
")",
":",
"if",
"key",
"in",
"values",
"[",
"\"unsupported\"",
"]",
":",
"support_value",
"=",
"False",
"elif",
"key",
"in",
"values",
"[",
"\"supported\"",
"]",
":",
"support_value",
"=",
"values",
"[",
"\"supported\"",
"]",
"[",
"key",
"]",
"elif",
"device",
"in",
"MISSING_SUPPORT_MEANS_NO",
":",
"support_value",
"=",
"False",
"elif",
"is_token",
"(",
"coin",
")",
":",
"if",
"dup",
":",
"# if duplicate token that is not explicitly listed, it's unsupported",
"support_value",
"=",
"False",
"else",
":",
"# otherwise implicitly supported in next",
"support_value",
"=",
"\"soon\"",
"else",
":",
"support_value",
"=",
"None",
"support_info",
"[",
"device",
"]",
"=",
"support_value",
"return",
"support_info"
] | [
325,
0
] | [
358,
23
] | python | en | ['en', 'en', 'en'] | True |
support_info | (coins) | Generate Trezor support information.
Takes a collection of coins and generates a support-info entry for each.
The support-info is a dict with keys based on `support.json` keys.
These are usually: "trezor1", "trezor2", "connect" and "webwallet".
The `coins` argument can be a `CoinsInfo` object, a list or a dict of
coin items.
Support information is taken from `support.json`.
| Generate Trezor support information. | def support_info(coins):
"""Generate Trezor support information.
Takes a collection of coins and generates a support-info entry for each.
The support-info is a dict with keys based on `support.json` keys.
These are usually: "trezor1", "trezor2", "connect" and "webwallet".
The `coins` argument can be a `CoinsInfo` object, a list or a dict of
coin items.
Support information is taken from `support.json`.
"""
if isinstance(coins, CoinsInfo):
coins = coins.as_list()
elif isinstance(coins, dict):
coins = coins.values()
support_data = get_support_data()
support = {}
for coin in coins:
support[coin["key"]] = support_info_single(support_data, coin)
return support | [
"def",
"support_info",
"(",
"coins",
")",
":",
"if",
"isinstance",
"(",
"coins",
",",
"CoinsInfo",
")",
":",
"coins",
"=",
"coins",
".",
"as_list",
"(",
")",
"elif",
"isinstance",
"(",
"coins",
",",
"dict",
")",
":",
"coins",
"=",
"coins",
".",
"values",
"(",
")",
"support_data",
"=",
"get_support_data",
"(",
")",
"support",
"=",
"{",
"}",
"for",
"coin",
"in",
"coins",
":",
"support",
"[",
"coin",
"[",
"\"key\"",
"]",
"]",
"=",
"support_info_single",
"(",
"support_data",
",",
"coin",
")",
"return",
"support"
] | [
361,
0
] | [
383,
18
] | python | en | ['ro', 'en', 'it'] | False |
_ensure_mandatory_values | (coins) | Checks that every coin has the mandatory fields: name, shortcut, key | Checks that every coin has the mandatory fields: name, shortcut, key | def _ensure_mandatory_values(coins):
"""Checks that every coin has the mandatory fields: name, shortcut, key"""
for coin in coins:
if not all(coin.get(k) for k in ("name", "shortcut", "key")):
raise ValueError(coin) | [
"def",
"_ensure_mandatory_values",
"(",
"coins",
")",
":",
"for",
"coin",
"in",
"coins",
":",
"if",
"not",
"all",
"(",
"coin",
".",
"get",
"(",
"k",
")",
"for",
"k",
"in",
"(",
"\"name\"",
",",
"\"shortcut\"",
",",
"\"key\"",
")",
")",
":",
"raise",
"ValueError",
"(",
"coin",
")"
] | [
389,
0
] | [
393,
34
] | python | en | ['en', 'en', 'en'] | True |
mark_duplicate_shortcuts | (coins) | Finds coins with identical symbols and sets their `duplicate` field.
"Symbol" here means the first part of `shortcut` (separated by space),
so, e.g., "BTL (Battle)" and "BTL (Bitlle)" have the same symbol "BTL".
The result of this function is a dictionary of _buckets_, each of which is
indexed by the duplicated symbol, or `_override`. The `_override` bucket will
contain all coins that are set to `true` in `duplicity_overrides.json`.
Each coin in every bucket will have its "duplicate" property set to True, unless
it's explicitly marked as `false` in `duplicity_overrides.json`.
| Finds coins with identical symbols and sets their `duplicate` field. | def mark_duplicate_shortcuts(coins):
"""Finds coins with identical symbols and sets their `duplicate` field.
"Symbol" here means the first part of `shortcut` (separated by space),
so, e.g., "BTL (Battle)" and "BTL (Bitlle)" have the same symbol "BTL".
The result of this function is a dictionary of _buckets_, each of which is
indexed by the duplicated symbol, or `_override`. The `_override` bucket will
contain all coins that are set to `true` in `duplicity_overrides.json`.
Each coin in every bucket will have its "duplicate" property set to True, unless
it's explicitly marked as `false` in `duplicity_overrides.json`.
"""
dup_symbols = defaultdict(list)
for coin in coins:
symbol, _ = symbol_from_shortcut(coin["shortcut"].lower())
dup_symbols[symbol].append(coin)
dup_symbols = {k: v for k, v in dup_symbols.items() if len(v) > 1}
# load overrides and put them into their own bucket
overrides = load_json("duplicity_overrides.json")
override_bucket = []
for coin in coins:
if overrides.get(coin["key"], False):
coin["duplicate"] = True
override_bucket.append(coin)
# mark duplicate symbols
for values in dup_symbols.values():
for coin in values:
# allow overrides to skip this; if not listed in overrides, assume True
is_dup = overrides.get(coin["key"], True)
if is_dup:
coin["duplicate"] = True
# again: still in dups, but not marked as duplicate and not deleted
dup_symbols["_override"] = override_bucket
return dup_symbols | [
"def",
"mark_duplicate_shortcuts",
"(",
"coins",
")",
":",
"dup_symbols",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"coin",
"in",
"coins",
":",
"symbol",
",",
"_",
"=",
"symbol_from_shortcut",
"(",
"coin",
"[",
"\"shortcut\"",
"]",
".",
"lower",
"(",
")",
")",
"dup_symbols",
"[",
"symbol",
"]",
".",
"append",
"(",
"coin",
")",
"dup_symbols",
"=",
"{",
"k",
":",
"v",
"for",
"k",
",",
"v",
"in",
"dup_symbols",
".",
"items",
"(",
")",
"if",
"len",
"(",
"v",
")",
">",
"1",
"}",
"# load overrides and put them into their own bucket",
"overrides",
"=",
"load_json",
"(",
"\"duplicity_overrides.json\"",
")",
"override_bucket",
"=",
"[",
"]",
"for",
"coin",
"in",
"coins",
":",
"if",
"overrides",
".",
"get",
"(",
"coin",
"[",
"\"key\"",
"]",
",",
"False",
")",
":",
"coin",
"[",
"\"duplicate\"",
"]",
"=",
"True",
"override_bucket",
".",
"append",
"(",
"coin",
")",
"# mark duplicate symbols",
"for",
"values",
"in",
"dup_symbols",
".",
"values",
"(",
")",
":",
"for",
"coin",
"in",
"values",
":",
"# allow overrides to skip this; if not listed in overrides, assume True",
"is_dup",
"=",
"overrides",
".",
"get",
"(",
"coin",
"[",
"\"key\"",
"]",
",",
"True",
")",
"if",
"is_dup",
":",
"coin",
"[",
"\"duplicate\"",
"]",
"=",
"True",
"# again: still in dups, but not marked as duplicate and not deleted",
"dup_symbols",
"[",
"\"_override\"",
"]",
"=",
"override_bucket",
"return",
"dup_symbols"
] | [
401,
0
] | [
440,
22
] | python | en | ['en', 'en', 'en'] | True |
deduplicate_erc20 | (buckets, networks) | Apply further processing to ERC20 duplicate buckets.
This function works on results of `mark_duplicate_shortcuts`.
Buckets that contain at least one non-token are ignored - symbol collisions
with non-tokens always apply.
Otherwise the following rules are applied:
1. If _all tokens_ in the bucket have shortcuts with distinct suffixes, e.g.,
`CAT (BitClave)` and `CAT (Blockcat)`, the bucket is cleared - all are considered
non-duplicate.
(If even one token in the bucket _does not_ have a distinct suffix, e.g.,
`MIT` and `MIT (Mychatcoin)`, this rule does not apply and ALL tokens in the bucket
are still considered duplicate.)
2. If there is only one "main" token in the bucket, the bucket is cleared.
That means that all other tokens must either be on testnets, or they must be marked
as deprecated, with a deprecation pointing to the "main" token.
| Apply further processing to ERC20 duplicate buckets. | def deduplicate_erc20(buckets, networks):
"""Apply further processing to ERC20 duplicate buckets.
This function works on results of `mark_duplicate_shortcuts`.
Buckets that contain at least one non-token are ignored - symbol collisions
with non-tokens always apply.
Otherwise the following rules are applied:
1. If _all tokens_ in the bucket have shortcuts with distinct suffixes, e.g.,
`CAT (BitClave)` and `CAT (Blockcat)`, the bucket is cleared - all are considered
non-duplicate.
(If even one token in the bucket _does not_ have a distinct suffix, e.g.,
`MIT` and `MIT (Mychatcoin)`, this rule does not apply and ALL tokens in the bucket
are still considered duplicate.)
2. If there is only one "main" token in the bucket, the bucket is cleared.
That means that all other tokens must either be on testnets, or they must be marked
as deprecated, with a deprecation pointing to the "main" token.
"""
testnet_networks = {n["chain"] for n in networks if "Testnet" in n["name"]}
overrides = buckets["_override"]
def clear_bucket(bucket):
# allow all coins, except those that are explicitly marked through overrides
for coin in bucket:
if coin not in overrides:
coin["duplicate"] = False
for bucket in buckets.values():
# Only check buckets that contain purely ERC20 tokens. Collision with
# a non-token is always forbidden.
if not all(is_token(c) for c in bucket):
continue
splits = (symbol_from_shortcut(coin["shortcut"]) for coin in bucket)
suffixes = {suffix for _, suffix in splits}
# if 1. all suffixes are distinct and 2. none of them are empty
if len(suffixes) == len(bucket) and all(suffixes):
clear_bucket(bucket)
continue
# protected categories:
testnets = [coin for coin in bucket if coin["chain"] in testnet_networks]
deprecated_by_same = [
coin
for coin in bucket
if "deprecation" in coin
and any(
other["address"] == coin["deprecation"]["new_address"]
for other in bucket
)
]
remaining = [
coin
for coin in bucket
if coin not in testnets and coin not in deprecated_by_same
]
if len(remaining) <= 1:
for coin in deprecated_by_same:
deprecated_symbol = "[deprecated] " + coin["symbol"]
coin["shortcut"] = coin["symbol"] = deprecated_symbol
coin["key"] += ":deprecated"
clear_bucket(bucket) | [
"def",
"deduplicate_erc20",
"(",
"buckets",
",",
"networks",
")",
":",
"testnet_networks",
"=",
"{",
"n",
"[",
"\"chain\"",
"]",
"for",
"n",
"in",
"networks",
"if",
"\"Testnet\"",
"in",
"n",
"[",
"\"name\"",
"]",
"}",
"overrides",
"=",
"buckets",
"[",
"\"_override\"",
"]",
"def",
"clear_bucket",
"(",
"bucket",
")",
":",
"# allow all coins, except those that are explicitly marked through overrides",
"for",
"coin",
"in",
"bucket",
":",
"if",
"coin",
"not",
"in",
"overrides",
":",
"coin",
"[",
"\"duplicate\"",
"]",
"=",
"False",
"for",
"bucket",
"in",
"buckets",
".",
"values",
"(",
")",
":",
"# Only check buckets that contain purely ERC20 tokens. Collision with",
"# a non-token is always forbidden.",
"if",
"not",
"all",
"(",
"is_token",
"(",
"c",
")",
"for",
"c",
"in",
"bucket",
")",
":",
"continue",
"splits",
"=",
"(",
"symbol_from_shortcut",
"(",
"coin",
"[",
"\"shortcut\"",
"]",
")",
"for",
"coin",
"in",
"bucket",
")",
"suffixes",
"=",
"{",
"suffix",
"for",
"_",
",",
"suffix",
"in",
"splits",
"}",
"# if 1. all suffixes are distinct and 2. none of them are empty",
"if",
"len",
"(",
"suffixes",
")",
"==",
"len",
"(",
"bucket",
")",
"and",
"all",
"(",
"suffixes",
")",
":",
"clear_bucket",
"(",
"bucket",
")",
"continue",
"# protected categories:",
"testnets",
"=",
"[",
"coin",
"for",
"coin",
"in",
"bucket",
"if",
"coin",
"[",
"\"chain\"",
"]",
"in",
"testnet_networks",
"]",
"deprecated_by_same",
"=",
"[",
"coin",
"for",
"coin",
"in",
"bucket",
"if",
"\"deprecation\"",
"in",
"coin",
"and",
"any",
"(",
"other",
"[",
"\"address\"",
"]",
"==",
"coin",
"[",
"\"deprecation\"",
"]",
"[",
"\"new_address\"",
"]",
"for",
"other",
"in",
"bucket",
")",
"]",
"remaining",
"=",
"[",
"coin",
"for",
"coin",
"in",
"bucket",
"if",
"coin",
"not",
"in",
"testnets",
"and",
"coin",
"not",
"in",
"deprecated_by_same",
"]",
"if",
"len",
"(",
"remaining",
")",
"<=",
"1",
":",
"for",
"coin",
"in",
"deprecated_by_same",
":",
"deprecated_symbol",
"=",
"\"[deprecated] \"",
"+",
"coin",
"[",
"\"symbol\"",
"]",
"coin",
"[",
"\"shortcut\"",
"]",
"=",
"coin",
"[",
"\"symbol\"",
"]",
"=",
"deprecated_symbol",
"coin",
"[",
"\"key\"",
"]",
"+=",
"\":deprecated\"",
"clear_bucket",
"(",
"bucket",
")"
] | [
443,
0
] | [
509,
32
] | python | en | ['en', 'en', 'en'] | True |
collect_coin_info | () | Returns all definition as dict organized by coin type.
`coins` for btc-like coins,
`eth` for ethereum networks,
`erc20` for ERC20 tokens,
`nem` for NEM mosaics,
`misc` for other networks.
| Returns all definition as dict organized by coin type.
`coins` for btc-like coins,
`eth` for ethereum networks,
`erc20` for ERC20 tokens,
`nem` for NEM mosaics,
`misc` for other networks.
| def collect_coin_info():
"""Returns all definition as dict organized by coin type.
`coins` for btc-like coins,
`eth` for ethereum networks,
`erc20` for ERC20 tokens,
`nem` for NEM mosaics,
`misc` for other networks.
"""
all_coins = CoinsInfo(
bitcoin=_load_btc_coins(),
eth=_load_ethereum_networks(),
erc20=_load_erc20_tokens(),
nem=_load_nem_mosaics(),
misc=_load_misc(),
)
for k, coins in all_coins.items():
_ensure_mandatory_values(coins)
return all_coins | [
"def",
"collect_coin_info",
"(",
")",
":",
"all_coins",
"=",
"CoinsInfo",
"(",
"bitcoin",
"=",
"_load_btc_coins",
"(",
")",
",",
"eth",
"=",
"_load_ethereum_networks",
"(",
")",
",",
"erc20",
"=",
"_load_erc20_tokens",
"(",
")",
",",
"nem",
"=",
"_load_nem_mosaics",
"(",
")",
",",
"misc",
"=",
"_load_misc",
"(",
")",
",",
")",
"for",
"k",
",",
"coins",
"in",
"all_coins",
".",
"items",
"(",
")",
":",
"_ensure_mandatory_values",
"(",
"coins",
")",
"return",
"all_coins"
] | [
535,
0
] | [
554,
20
] | python | en | ['en', 'en', 'en'] | True |
coin_info_with_duplicates | () | Collects coin info, detects duplicates but does not remove them.
Returns the CoinsInfo object and duplicate buckets.
| Collects coin info, detects duplicates but does not remove them. | def coin_info_with_duplicates():
"""Collects coin info, detects duplicates but does not remove them.
Returns the CoinsInfo object and duplicate buckets.
"""
all_coins = collect_coin_info()
buckets = mark_duplicate_shortcuts(all_coins.as_list())
deduplicate_erc20(buckets, all_coins.eth)
deduplicate_keys(all_coins.as_list())
sort_coin_infos(all_coins)
return all_coins, buckets | [
"def",
"coin_info_with_duplicates",
"(",
")",
":",
"all_coins",
"=",
"collect_coin_info",
"(",
")",
"buckets",
"=",
"mark_duplicate_shortcuts",
"(",
"all_coins",
".",
"as_list",
"(",
")",
")",
"deduplicate_erc20",
"(",
"buckets",
",",
"all_coins",
".",
"eth",
")",
"deduplicate_keys",
"(",
"all_coins",
".",
"as_list",
"(",
")",
")",
"sort_coin_infos",
"(",
"all_coins",
")",
"return",
"all_coins",
",",
"buckets"
] | [
571,
0
] | [
582,
29
] | python | en | ['en', 'en', 'en'] | True |
coin_info | () | Collects coin info, fills out support info and returns the result.
Does not auto-delete duplicates. This should now be based on support info.
| Collects coin info, fills out support info and returns the result. | def coin_info():
"""Collects coin info, fills out support info and returns the result.
Does not auto-delete duplicates. This should now be based on support info.
"""
all_coins, _ = coin_info_with_duplicates()
# all_coins["erc20"] = [
# coin for coin in all_coins["erc20"] if not coin.get("duplicate")
# ]
return all_coins | [
"def",
"coin_info",
"(",
")",
":",
"all_coins",
",",
"_",
"=",
"coin_info_with_duplicates",
"(",
")",
"# all_coins[\"erc20\"] = [",
"# coin for coin in all_coins[\"erc20\"] if not coin.get(\"duplicate\")",
"# ]",
"return",
"all_coins"
] | [
585,
0
] | [
594,
20
] | python | en | ['en', 'en', 'en'] | True |
fido_info | () | Returns info about known FIDO/U2F apps. | Returns info about known FIDO/U2F apps. | def fido_info():
"""Returns info about known FIDO/U2F apps."""
return _load_fido_apps() | [
"def",
"fido_info",
"(",
")",
":",
"return",
"_load_fido_apps",
"(",
")"
] | [
597,
0
] | [
599,
28
] | python | en | ['en', 'en', 'en'] | True |
Request.signingPayloadState | (self, identifier=None) |
Special signing state where the the data for an attribute is hashed
before signing
:return: state to be used when signing
|
Special signing state where the the data for an attribute is hashed
before signing
:return: state to be used when signing
| def signingPayloadState(self, identifier=None):
"""
Special signing state where the the data for an attribute is hashed
before signing
:return: state to be used when signing
"""
if self.operation.get(TXN_TYPE) == ATTRIB:
d = deepcopy(super().signingPayloadState(identifier=identifier))
op = d[OPERATION]
keyName = {RAW, ENC, HASH}.intersection(set(op.keys())).pop()
op[keyName] = sha256(op[keyName].encode()).hexdigest()
return d
return super().signingPayloadState(identifier=identifier) | [
"def",
"signingPayloadState",
"(",
"self",
",",
"identifier",
"=",
"None",
")",
":",
"if",
"self",
".",
"operation",
".",
"get",
"(",
"TXN_TYPE",
")",
"==",
"ATTRIB",
":",
"d",
"=",
"deepcopy",
"(",
"super",
"(",
")",
".",
"signingPayloadState",
"(",
"identifier",
"=",
"identifier",
")",
")",
"op",
"=",
"d",
"[",
"OPERATION",
"]",
"keyName",
"=",
"{",
"RAW",
",",
"ENC",
",",
"HASH",
"}",
".",
"intersection",
"(",
"set",
"(",
"op",
".",
"keys",
"(",
")",
")",
")",
".",
"pop",
"(",
")",
"op",
"[",
"keyName",
"]",
"=",
"sha256",
"(",
"op",
"[",
"keyName",
"]",
".",
"encode",
"(",
")",
")",
".",
"hexdigest",
"(",
")",
"return",
"d",
"return",
"super",
"(",
")",
".",
"signingPayloadState",
"(",
"identifier",
"=",
"identifier",
")"
] | [
51,
4
] | [
63,
65
] | python | en | ['en', 'error', 'th'] | False |
CrowdDataWorld.prep_save_data | (self, workers) |
This prepares data to be saved for later review, including chats from individual
worker perspectives.
|
This prepares data to be saved for later review, including chats from individual
worker perspectives.
| def prep_save_data(self, workers):
"""
This prepares data to be saved for later review, including chats from individual
worker perspectives.
"""
custom_data = self.get_custom_task_data()
save_data = {'custom_data': custom_data, 'worker_data': {}}
return save_data | [
"def",
"prep_save_data",
"(",
"self",
",",
"workers",
")",
":",
"custom_data",
"=",
"self",
".",
"get_custom_task_data",
"(",
")",
"save_data",
"=",
"{",
"'custom_data'",
":",
"custom_data",
",",
"'worker_data'",
":",
"{",
"}",
"}",
"return",
"save_data"
] | [
10,
4
] | [
17,
24
] | python | en | ['en', 'error', 'th'] | False |
CrowdDataWorld.get_custom_task_data | (self) |
This function should take the contents of whatever was collected during this
task that should be saved and return it in some format, preferrably a dict
containing acts.
If you need some extraordinary data storage that this doesn't cover, you can
extend the ParlAIChatBlueprint and write your own ParlAIChatAgentState that
defines the behavior you want.
|
This function should take the contents of whatever was collected during this
task that should be saved and return it in some format, preferrably a dict
containing acts. | def get_custom_task_data(self):
"""
This function should take the contents of whatever was collected during this
task that should be saved and return it in some format, preferrably a dict
containing acts.
If you need some extraordinary data storage that this doesn't cover, you can
extend the ParlAIChatBlueprint and write your own ParlAIChatAgentState that
defines the behavior you want.
"""
# return {
# 'acts': [self.important_turn1, self.important_turn2]
# 'context': self.some_context_data_of_importance
# }
pass | [
"def",
"get_custom_task_data",
"(",
"self",
")",
":",
"# return {",
"# 'acts': [self.important_turn1, self.important_turn2]",
"# 'context': self.some_context_data_of_importance",
"# }",
"pass"
] | [
19,
4
] | [
33,
12
] | python | en | ['en', 'error', 'th'] | False |
CrowdOnboardWorld.__init__ | (self, opt, agent) |
Init should set up resources for running the onboarding world.
|
Init should set up resources for running the onboarding world.
| def __init__(self, opt, agent):
"""
Init should set up resources for running the onboarding world.
"""
self.agent = agent
self.episodeDone = False | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"agent",
")",
":",
"self",
".",
"agent",
"=",
"agent",
"self",
".",
"episodeDone",
"=",
"False"
] | [
41,
4
] | [
46,
32
] | python | en | ['en', 'error', 'th'] | False |
CrowdOnboardWorld.parley | (self) |
A parley should represent one turn of your onboarding task.
|
A parley should represent one turn of your onboarding task.
| def parley(self):
"""
A parley should represent one turn of your onboarding task.
"""
self.episodeDone = True | [
"def",
"parley",
"(",
"self",
")",
":",
"self",
".",
"episodeDone",
"=",
"True"
] | [
48,
4
] | [
52,
31
] | python | en | ['en', 'error', 'th'] | False |
CrowdOnboardWorld.shutdown | (self) |
Clear up resources needed for this world.
|
Clear up resources needed for this world.
| def shutdown(self):
"""
Clear up resources needed for this world.
"""
pass | [
"def",
"shutdown",
"(",
"self",
")",
":",
"pass"
] | [
57,
4
] | [
61,
12
] | python | en | ['en', 'error', 'th'] | False |
CrowdTaskWorld.__init__ | (self, opt, agent) |
Init should set up resources for running the task world.
|
Init should set up resources for running the task world.
| def __init__(self, opt, agent):
"""
Init should set up resources for running the task world.
"""
self.agent = agent
self.episodeDone = False | [
"def",
"__init__",
"(",
"self",
",",
"opt",
",",
"agent",
")",
":",
"self",
".",
"agent",
"=",
"agent",
"self",
".",
"episodeDone",
"=",
"False"
] | [
69,
4
] | [
74,
32
] | python | en | ['en', 'error', 'th'] | False |
CrowdTaskWorld.parley | (self) |
A parley should represent one turn of your task.
|
A parley should represent one turn of your task.
| def parley(self):
"""
A parley should represent one turn of your task.
"""
self.episodeDone = True | [
"def",
"parley",
"(",
"self",
")",
":",
"self",
".",
"episodeDone",
"=",
"True"
] | [
76,
4
] | [
80,
31
] | python | en | ['en', 'error', 'th'] | False |
CrowdTaskWorld.episode_done | (self) |
A ParlAI-Mephisto task ends and allows workers to be marked complete when the
world is finished.
|
A ParlAI-Mephisto task ends and allows workers to be marked complete when the
world is finished.
| def episode_done(self):
"""
A ParlAI-Mephisto task ends and allows workers to be marked complete when the
world is finished.
"""
return self.episodeDone | [
"def",
"episode_done",
"(",
"self",
")",
":",
"return",
"self",
".",
"episodeDone"
] | [
82,
4
] | [
87,
31
] | python | en | ['en', 'error', 'th'] | False |
CrowdTaskWorld.shutdown | (self) |
Should be used to free the world's resources and shut down the agents.
|
Should be used to free the world's resources and shut down the agents.
| def shutdown(self):
"""
Should be used to free the world's resources and shut down the agents.
"""
self.agent.shutdown() | [
"def",
"shutdown",
"(",
"self",
")",
":",
"self",
".",
"agent",
".",
"shutdown",
"(",
")"
] | [
89,
4
] | [
93,
29
] | python | en | ['en', 'error', 'th'] | False |
CrowdTaskWorld.review_work | (self) |
Programmatically approve/reject this work. Doing this now (if possible) means
that you don't need to do the work of reviewing later on.
For example:
.. code-block:: python
mephisto_agent = self.agent.mephisto_agent
if self.response == '0':
mephisto_agent.reject_work(
'You rated our model's response as a 0/10 but we '
'know we\'re better than that'
)
else:
if self.response == '10':
mephisto_agent.pay_bonus(1, 'Thanks for a great rating!')
mephisto_agent.approve_work()
|
Programmatically approve/reject this work. Doing this now (if possible) means
that you don't need to do the work of reviewing later on. | def review_work(self):
"""
Programmatically approve/reject this work. Doing this now (if possible) means
that you don't need to do the work of reviewing later on.
For example:
.. code-block:: python
mephisto_agent = self.agent.mephisto_agent
if self.response == '0':
mephisto_agent.reject_work(
'You rated our model's response as a 0/10 but we '
'know we\'re better than that'
)
else:
if self.response == '10':
mephisto_agent.pay_bonus(1, 'Thanks for a great rating!')
mephisto_agent.approve_work()
"""
# mephisto_agent = self.agent.mephisto_agent
# mephisto_agent.approve_work()
# mephisto_agent.reject_work()
# mephisto_agent.pay_bonus(1000) # Pay $1000 as bonus
# mephisto_agent.block_worker() # Block this worker from future work
pass | [
"def",
"review_work",
"(",
"self",
")",
":",
"# mephisto_agent = self.agent.mephisto_agent",
"# mephisto_agent.approve_work()",
"# mephisto_agent.reject_work()",
"# mephisto_agent.pay_bonus(1000) # Pay $1000 as bonus",
"# mephisto_agent.block_worker() # Block this worker from future work",
"pass"
] | [
95,
4
] | [
118,
12
] | 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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | 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 string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["bgcolor"] | [
"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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | 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 string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["bordercolor"] | [
"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["borderwidth"] | [
"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, 10, 100, 1000, ... set dtick
to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2.
To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special values;
"L<f>", where `f` is a positive number, gives ticks linearly
spaced in value (but not position). For example `tick0` = 0.1,
`dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To
show powers of 10 plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and
"D2". If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval between
ticks to one day, set `dtick` to 86400000.0. "date" also has
special values "M<n>" gives ticks spaced by a number of months.
`n` must be a positive integer. To set ticks on the 15th of
every third month, set `tick0` to "2000-01-15" and `dtick` to
"M3". To set ticks every 4 years, set `dtick` to "M48"
The 'dtick' property accepts values of any type
Returns
-------
Any
|
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, 10, 100, 1000, ... set dtick
to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2.
To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special values;
"L<f>", where `f` is a positive number, gives ticks linearly
spaced in value (but not position). For example `tick0` = 0.1,
`dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To
show powers of 10 plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and
"D2". If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval between
ticks to one day, set `dtick` to 86400000.0. "date" also has
special values "M<n>" gives ticks spaced by a number of months.
`n` must be a positive integer. To set ticks on the 15th of
every third month, set `tick0` to "2000-01-15" and `dtick` to
"M3". To set ticks every 4 years, set `dtick` to "M48"
The 'dtick' property accepts values of any type | 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, to set a tick mark at 1, 10, 100, 1000, ... set dtick
to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2.
To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special values;
"L<f>", where `f` is a positive number, gives ticks linearly
spaced in value (but not position). For example `tick0` = 0.1,
`dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To
show powers of 10 plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and
"D2". If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval between
ticks to one day, set `dtick` to 86400000.0. "date" also has
special values "M<n>" gives ticks spaced by a number of months.
`n` must be a positive integer. To set ticks on the 15th of
every third month, set `tick0` to "2000-01-15" and `dtick` to
"M3". To set ticks every 4 years, set `dtick` to "M48"
The 'dtick' property accepts values of any type
Returns
-------
Any
"""
return self["dtick"] | [
"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' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'e', 'E', 'power', 'SI', 'B']
Returns
-------
Any
|
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' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'e', 'E', 'power', 'SI', 'B'] | 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.
The 'exponentformat' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'e', 'E', 'power', 'SI', 'B']
Returns
-------
Any
"""
return self["exponentformat"] | [
"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]
Returns
-------
int|float
|
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 interval [0, inf]
Returns
-------
int|float
"""
return self["len"] | [
"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 enumeration values:
['fraction', 'pixels']
Returns
-------
Any
|
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 enumeration values:
['fraction', 'pixels'] | 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:
- One of the following enumeration values:
['fraction', 'pixels']
Returns
-------
Any
"""
return self["lenmode"] | [
"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:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
|
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:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | 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 and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
"""
return self["nticks"] | [
"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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | 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/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["outlinecolor"] | [
"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 specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
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 specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | 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 an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
"""
return self["showexponent"] | [
"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 specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
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 specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | 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' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
"""
return self["showtickprefix"] | [
"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
-------
Any
"""
return self["showticksuffix"] | [
"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
-------
int|float
"""
return self["thickness"] | [
"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 following enumeration values:
['fraction', 'pixels']
Returns
-------
Any
|
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 following enumeration values:
['fraction', 'pixels'] | 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 specified as:
- One of the following enumeration values:
['fraction', 'pixels']
Returns
-------
Any
"""
return self["thicknessmode"] | [
"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 `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type
Returns
-------
Any
|
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 `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type | 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 more info). If the axis `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type
Returns
-------
Any
"""
return self["tick0"] | [
"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
range are converted to the equivalent value
(e.g. 270 is converted to -90).
Returns
-------
int|float
|
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
range are converted to the equivalent value
(e.g. 270 is converted to -90). | 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. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90).
Returns
-------
int|float
"""
return self["tickangle"] | [
"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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | 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.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["tickcolor"] | [
"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.parcats.line.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.parcats.line.colorbar.Tickfont
|
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.parcats.line.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size | 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.parcats.line.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.parcats.line.colorbar.Tickfont
"""
return self["tickfont"] | [
"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-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
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-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string | 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.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["tickformat"] | [
"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.parcats.line.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat"
Returns
-------
tuple[plotly.graph_objs.parcats.line.colorbar.Tickformatstop]
|
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.parcats.line.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat" | 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.parcats.line.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat"
Returns
-------
tuple[plotly.graph_objs.parcats.line.colorbar.Tickformatstop]
"""
return self["tickformatstops"] | [
"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.parcats.line.c
olorbar.tickformatstopdefaults), sets the default property
values to use for elements of
parcats.line.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.parcats.line.colorbar.Tickformatstop
|
When used in a template (as layout.template.data.parcats.line.c
olorbar.tickformatstopdefaults), sets the default property
values to use for elements of
parcats.line.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties: | def tickformatstopdefaults(self):
"""
When used in a template (as layout.template.data.parcats.line.c
olorbar.tickformatstopdefaults), sets the default property
values to use for elements of
parcats.line.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.parcats.line.colorbar.Tickformatstop
"""
return self["tickformatstopdefaults"] | [
"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 placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array']
Returns
-------
Any
|
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 placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array'] | 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` are provided). If "array", the placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array']
Returns
-------
Any
"""
return self["tickmode"] | [
"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:
['outside', 'inside', '']
Returns
-------
Any
|
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:
['outside', 'inside', ''] | 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 following enumeration values:
['outside', 'inside', '']
Returns
-------
Any
"""
return self["ticks"] | [
"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
-------
numpy.ndarray
|
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
Returns
-------
numpy.ndarray
"""
return self["ticktext"] | [
"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.ndarray
|
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
-------
numpy.ndarray
"""
return self["tickvals"] | [
"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.parcats.line.colorbar.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
font
Sets this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
side
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.
text
Sets the title of the color bar. Note that
before the existence of `title.text`, the
title's contents used to be defined as the
`title` attribute itself. This behavior has
been deprecated.
Returns
-------
plotly.graph_objs.parcats.line.colorbar.Title
|
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
font
Sets this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
side
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.
text
Sets the title of the color bar. Note that
before the existence of `title.text`, the
title's contents used to be defined as the
`title` attribute itself. This behavior has
been deprecated. | def title(self):
"""
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
font
Sets this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
side
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.
text
Sets the title of the color bar. Note that
before the existence of `title.text`, the
title's contents used to be defined as the
`title` attribute itself. This behavior has
been deprecated.
Returns
-------
plotly.graph_objs.parcats.line.colorbar.Title
"""
return self["title"] | [
"def",
"title",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"title\"",
"]"
] | [
1046,
4
] | [
1076,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.titlefont | (self) |
Deprecated: Please use parcats.line.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:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
|
Deprecated: Please use parcats.line.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:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size | def titlefont(self):
"""
Deprecated: Please use parcats.line.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:
- An instance of :class:`plotly.graph_objs.parcats.line.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
"""
return self["titlefont"] | [
"def",
"titlefont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"titlefont\"",
"]"
] | [
1085,
4
] | [
1125,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.titleside | (self) |
Deprecated: Please use parcats.line.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 that may be specified as:
- One of the following enumeration values:
['right', 'top', 'bottom']
Returns
-------
|
Deprecated: Please use parcats.line.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 that may be specified as:
- One of the following enumeration values:
['right', 'top', 'bottom'] | def titleside(self):
"""
Deprecated: Please use parcats.line.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 that may be specified as:
- One of the following enumeration values:
['right', 'top', 'bottom']
Returns
-------
"""
return self["titleside"] | [
"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', 'center', 'right']
Returns
-------
Any
|
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', 'center', 'right'] | 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 values:
['left', 'center', 'right']
Returns
-------
Any
"""
return self["xanchor"] | [
"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', 'middle', 'bottom']
Returns
-------
Any
|
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', 'middle', 'bottom'] | 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 values:
['top', 'middle', 'bottom']
Returns
-------
Any
"""
return self["yanchor"] | [
"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,
showexponent=None,
showticklabels=None,
showtickprefix=None,
showticksuffix=None,
thickness=None,
thicknessmode=None,
tick0=None,
tickangle=None,
tickcolor=None,
tickfont=None,
tickformat=None,
tickformatstops=None,
tickformatstopdefaults=None,
ticklen=None,
tickmode=None,
tickprefix=None,
ticks=None,
ticksuffix=None,
ticktext=None,
ticktextsrc=None,
tickvals=None,
tickvalssrc=None,
tickwidth=None,
title=None,
titlefont=None,
titleside=None,
x=None,
xanchor=None,
xpad=None,
y=None,
yanchor=None,
ypad=None,
**kwargs
) |
Construct a new ColorBar object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcats.line.ColorBar`
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing this
color bar.
dtick
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, 10, 100, 1000, ... set dtick to 1. To set tick marks
at 1, 100, 10000, ... set dtick to 2. To set tick marks
at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special
values; "L<f>", where `f` is a positive number, gives
ticks linearly spaced in value (but not position). For
example `tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus
small digits between, use "D1" (all digits) or "D2"
(only 2 and 5). `tick0` is ignored for "D1" and "D2".
If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to 86400000.0.
"date" also has special values "M<n>" gives ticks
spaced by a number of months. `n` must be a positive
integer. To set ticks on the 15th of every third month,
set `tick0` to "2000-01-15" and `dtick` to "M3". To set
ticks every 4 years, set `dtick` to "M48"
exponentformat
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.
len
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.
lenmode
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.
nticks
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".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
separatethousands
If "true", even 4-digit integers are separated
showexponent
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.
showticklabels
Determines whether or not the tick labels are drawn.
showtickprefix
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.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thickness
Sets the thickness of the color bar This measure
excludes the size of the padding, ticks and labels.
thicknessmode
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.
tick0
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 `type` is "date", it should be a date string, like
date data. If the axis `type` is "category", it should
be a number, using the scale where each category is
assigned a serial number from zero in the order it
appears.
tickangle
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the
tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the color bar's tick label font
tickformat
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-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.parcats.line.co
lorbar.Tickformatstop` instances or dicts with
compatible properties
tickformatstopdefaults
When used in a template (as layout.template.data.parcat
s.line.colorbar.tickformatstopdefaults), sets the
default property values to use for elements of
parcats.line.colorbar.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
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 placement of the ticks is set via
`tickvals` and the tick text is `ticktext`. ("array" is
the default value if `tickvals` is provided).
tickprefix
Sets a tick label prefix.
ticks
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.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position via
`tickvals`. Only has an effect if `tickmode` is set to
"array". Used with `tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud for
ticktext .
tickvals
Sets the values at which ticks on this axis appear.
Only has an effect if `tickmode` is set to "array".
Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud for
tickvals .
tickwidth
Sets the tick width (in px).
title
:class:`plotly.graph_objects.parcats.line.colorbar.Titl
e` instance or dict with compatible properties
titlefont
Deprecated: Please use parcats.line.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.
titleside
Deprecated: Please use parcats.line.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.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position anchor. This
anchor binds the `x` position to the "left", "center"
or "right" of the color bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor This
anchor binds the `y` position to the "top", "middle" or
"bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction.
Returns
-------
ColorBar
|
Construct a new ColorBar object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcats.line.ColorBar`
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing this
color bar.
dtick
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, 10, 100, 1000, ... set dtick to 1. To set tick marks
at 1, 100, 10000, ... set dtick to 2. To set tick marks
at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special
values; "L<f>", where `f` is a positive number, gives
ticks linearly spaced in value (but not position). For
example `tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus
small digits between, use "D1" (all digits) or "D2"
(only 2 and 5). `tick0` is ignored for "D1" and "D2".
If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to 86400000.0.
"date" also has special values "M<n>" gives ticks
spaced by a number of months. `n` must be a positive
integer. To set ticks on the 15th of every third month,
set `tick0` to "2000-01-15" and `dtick` to "M3". To set
ticks every 4 years, set `dtick` to "M48"
exponentformat
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.
len
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.
lenmode
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.
nticks
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".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
separatethousands
If "true", even 4-digit integers are separated
showexponent
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.
showticklabels
Determines whether or not the tick labels are drawn.
showtickprefix
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.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thickness
Sets the thickness of the color bar This measure
excludes the size of the padding, ticks and labels.
thicknessmode
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.
tick0
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 `type` is "date", it should be a date string, like
date data. If the axis `type` is "category", it should
be a number, using the scale where each category is
assigned a serial number from zero in the order it
appears.
tickangle
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the
tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the color bar's tick label font
tickformat
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-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.parcats.line.co
lorbar.Tickformatstop` instances or dicts with
compatible properties
tickformatstopdefaults
When used in a template (as layout.template.data.parcat
s.line.colorbar.tickformatstopdefaults), sets the
default property values to use for elements of
parcats.line.colorbar.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
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 placement of the ticks is set via
`tickvals` and the tick text is `ticktext`. ("array" is
the default value if `tickvals` is provided).
tickprefix
Sets a tick label prefix.
ticks
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.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position via
`tickvals`. Only has an effect if `tickmode` is set to
"array". Used with `tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud for
ticktext .
tickvals
Sets the values at which ticks on this axis appear.
Only has an effect if `tickmode` is set to "array".
Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud for
tickvals .
tickwidth
Sets the tick width (in px).
title
:class:`plotly.graph_objects.parcats.line.colorbar.Titl
e` instance or dict with compatible properties
titlefont
Deprecated: Please use parcats.line.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.
titleside
Deprecated: Please use parcats.line.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.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position anchor. This
anchor binds the `x` position to the "left", "center"
or "right" of the color bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor This
anchor binds the `y` position to the "top", "middle" or
"bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction. | 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,
showexponent=None,
showticklabels=None,
showtickprefix=None,
showticksuffix=None,
thickness=None,
thicknessmode=None,
tick0=None,
tickangle=None,
tickcolor=None,
tickfont=None,
tickformat=None,
tickformatstops=None,
tickformatstopdefaults=None,
ticklen=None,
tickmode=None,
tickprefix=None,
ticks=None,
ticksuffix=None,
ticktext=None,
ticktextsrc=None,
tickvals=None,
tickvalssrc=None,
tickwidth=None,
title=None,
titlefont=None,
titleside=None,
x=None,
xanchor=None,
xpad=None,
y=None,
yanchor=None,
ypad=None,
**kwargs
):
"""
Construct a new ColorBar object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcats.line.ColorBar`
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing this
color bar.
dtick
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, 10, 100, 1000, ... set dtick to 1. To set tick marks
at 1, 100, 10000, ... set dtick to 2. To set tick marks
at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special
values; "L<f>", where `f` is a positive number, gives
ticks linearly spaced in value (but not position). For
example `tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus
small digits between, use "D1" (all digits) or "D2"
(only 2 and 5). `tick0` is ignored for "D1" and "D2".
If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to 86400000.0.
"date" also has special values "M<n>" gives ticks
spaced by a number of months. `n` must be a positive
integer. To set ticks on the 15th of every third month,
set `tick0` to "2000-01-15" and `dtick` to "M3". To set
ticks every 4 years, set `dtick` to "M48"
exponentformat
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.
len
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.
lenmode
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.
nticks
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".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
separatethousands
If "true", even 4-digit integers are separated
showexponent
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.
showticklabels
Determines whether or not the tick labels are drawn.
showtickprefix
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.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thickness
Sets the thickness of the color bar This measure
excludes the size of the padding, ticks and labels.
thicknessmode
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.
tick0
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 `type` is "date", it should be a date string, like
date data. If the axis `type` is "category", it should
be a number, using the scale where each category is
assigned a serial number from zero in the order it
appears.
tickangle
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the
tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the color bar's tick label font
tickformat
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-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.parcats.line.co
lorbar.Tickformatstop` instances or dicts with
compatible properties
tickformatstopdefaults
When used in a template (as layout.template.data.parcat
s.line.colorbar.tickformatstopdefaults), sets the
default property values to use for elements of
parcats.line.colorbar.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
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 placement of the ticks is set via
`tickvals` and the tick text is `ticktext`. ("array" is
the default value if `tickvals` is provided).
tickprefix
Sets a tick label prefix.
ticks
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.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position via
`tickvals`. Only has an effect if `tickmode` is set to
"array". Used with `tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud for
ticktext .
tickvals
Sets the values at which ticks on this axis appear.
Only has an effect if `tickmode` is set to "array".
Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud for
tickvals .
tickwidth
Sets the tick width (in px).
title
:class:`plotly.graph_objects.parcats.line.colorbar.Titl
e` instance or dict with compatible properties
titlefont
Deprecated: Please use parcats.line.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.
titleside
Deprecated: Please use parcats.line.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.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position anchor. This
anchor binds the `x` position to the "left", "center"
or "right" of the color bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor This
anchor binds the `y` position to the "top", "middle" or
"bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction.
Returns
-------
ColorBar
"""
super(ColorBar, self).__init__("colorbar")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.parcats.line.ColorBar
constructor must be a dict or
an instance of :class:`plotly.graph_objs.parcats.line.ColorBar`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("bgcolor", None)
_v = bgcolor if bgcolor is not None else _v
if _v is not None:
self["bgcolor"] = _v
_v = arg.pop("bordercolor", None)
_v = bordercolor if bordercolor is not None else _v
if _v is not None:
self["bordercolor"] = _v
_v = arg.pop("borderwidth", None)
_v = borderwidth if borderwidth is not None else _v
if _v is not None:
self["borderwidth"] = _v
_v = arg.pop("dtick", None)
_v = dtick if dtick is not None else _v
if _v is not None:
self["dtick"] = _v
_v = arg.pop("exponentformat", None)
_v = exponentformat if exponentformat is not None else _v
if _v is not None:
self["exponentformat"] = _v
_v = arg.pop("len", None)
_v = len if len is not None else _v
if _v is not None:
self["len"] = _v
_v = arg.pop("lenmode", None)
_v = lenmode if lenmode is not None else _v
if _v is not None:
self["lenmode"] = _v
_v = arg.pop("nticks", None)
_v = nticks if nticks is not None else _v
if _v is not None:
self["nticks"] = _v
_v = arg.pop("outlinecolor", None)
_v = outlinecolor if outlinecolor is not None else _v
if _v is not None:
self["outlinecolor"] = _v
_v = arg.pop("outlinewidth", None)
_v = outlinewidth if outlinewidth is not None else _v
if _v is not None:
self["outlinewidth"] = _v
_v = arg.pop("separatethousands", None)
_v = separatethousands if separatethousands is not None else _v
if _v is not None:
self["separatethousands"] = _v
_v = arg.pop("showexponent", None)
_v = showexponent if showexponent is not None else _v
if _v is not None:
self["showexponent"] = _v
_v = arg.pop("showticklabels", None)
_v = showticklabels if showticklabels is not None else _v
if _v is not None:
self["showticklabels"] = _v
_v = arg.pop("showtickprefix", None)
_v = showtickprefix if showtickprefix is not None else _v
if _v is not None:
self["showtickprefix"] = _v
_v = arg.pop("showticksuffix", None)
_v = showticksuffix if showticksuffix is not None else _v
if _v is not None:
self["showticksuffix"] = _v
_v = arg.pop("thickness", None)
_v = thickness if thickness is not None else _v
if _v is not None:
self["thickness"] = _v
_v = arg.pop("thicknessmode", None)
_v = thicknessmode if thicknessmode is not None else _v
if _v is not None:
self["thicknessmode"] = _v
_v = arg.pop("tick0", None)
_v = tick0 if tick0 is not None else _v
if _v is not None:
self["tick0"] = _v
_v = arg.pop("tickangle", None)
_v = tickangle if tickangle is not None else _v
if _v is not None:
self["tickangle"] = _v
_v = arg.pop("tickcolor", None)
_v = tickcolor if tickcolor is not None else _v
if _v is not None:
self["tickcolor"] = _v
_v = arg.pop("tickfont", None)
_v = tickfont if tickfont is not None else _v
if _v is not None:
self["tickfont"] = _v
_v = arg.pop("tickformat", None)
_v = tickformat if tickformat is not None else _v
if _v is not None:
self["tickformat"] = _v
_v = arg.pop("tickformatstops", None)
_v = tickformatstops if tickformatstops is not None else _v
if _v is not None:
self["tickformatstops"] = _v
_v = arg.pop("tickformatstopdefaults", None)
_v = tickformatstopdefaults if tickformatstopdefaults is not None else _v
if _v is not None:
self["tickformatstopdefaults"] = _v
_v = arg.pop("ticklen", None)
_v = ticklen if ticklen is not None else _v
if _v is not None:
self["ticklen"] = _v
_v = arg.pop("tickmode", None)
_v = tickmode if tickmode is not None else _v
if _v is not None:
self["tickmode"] = _v
_v = arg.pop("tickprefix", None)
_v = tickprefix if tickprefix is not None else _v
if _v is not None:
self["tickprefix"] = _v
_v = arg.pop("ticks", None)
_v = ticks if ticks is not None else _v
if _v is not None:
self["ticks"] = _v
_v = arg.pop("ticksuffix", None)
_v = ticksuffix if ticksuffix is not None else _v
if _v is not None:
self["ticksuffix"] = _v
_v = arg.pop("ticktext", None)
_v = ticktext if ticktext is not None else _v
if _v is not None:
self["ticktext"] = _v
_v = arg.pop("ticktextsrc", None)
_v = ticktextsrc if ticktextsrc is not None else _v
if _v is not None:
self["ticktextsrc"] = _v
_v = arg.pop("tickvals", None)
_v = tickvals if tickvals is not None else _v
if _v is not None:
self["tickvals"] = _v
_v = arg.pop("tickvalssrc", None)
_v = tickvalssrc if tickvalssrc is not None else _v
if _v is not None:
self["tickvalssrc"] = _v
_v = arg.pop("tickwidth", None)
_v = tickwidth if tickwidth is not None else _v
if _v is not None:
self["tickwidth"] = _v
_v = arg.pop("title", None)
_v = title if title is not None else _v
if _v is not None:
self["title"] = _v
_v = arg.pop("titlefont", None)
_v = titlefont if titlefont is not None else _v
if _v is not None:
self["titlefont"] = _v
_v = arg.pop("titleside", None)
_v = titleside if titleside is not None else _v
if _v is not None:
self["titleside"] = _v
_v = arg.pop("x", None)
_v = x if x is not None else _v
if _v is not None:
self["x"] = _v
_v = arg.pop("xanchor", None)
_v = xanchor if xanchor is not None else _v
if _v is not None:
self["xanchor"] = _v
_v = arg.pop("xpad", None)
_v = xpad if xpad is not None else _v
if _v is not None:
self["xpad"] = _v
_v = arg.pop("y", None)
_v = y if y is not None else _v
if _v is not None:
self["y"] = _v
_v = arg.pop("yanchor", None)
_v = yanchor if yanchor is not None else _v
if _v is not None:
self["yanchor"] = _v
_v = arg.pop("ypad", None)
_v = ypad if ypad is not None else _v
if _v is not None:
self["ypad"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"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",
",",
"showexponent",
"=",
"None",
",",
"showticklabels",
"=",
"None",
",",
"showtickprefix",
"=",
"None",
",",
"showticksuffix",
"=",
"None",
",",
"thickness",
"=",
"None",
",",
"thicknessmode",
"=",
"None",
",",
"tick0",
"=",
"None",
",",
"tickangle",
"=",
"None",
",",
"tickcolor",
"=",
"None",
",",
"tickfont",
"=",
"None",
",",
"tickformat",
"=",
"None",
",",
"tickformatstops",
"=",
"None",
",",
"tickformatstopdefaults",
"=",
"None",
",",
"ticklen",
"=",
"None",
",",
"tickmode",
"=",
"None",
",",
"tickprefix",
"=",
"None",
",",
"ticks",
"=",
"None",
",",
"ticksuffix",
"=",
"None",
",",
"ticktext",
"=",
"None",
",",
"ticktextsrc",
"=",
"None",
",",
"tickvals",
"=",
"None",
",",
"tickvalssrc",
"=",
"None",
",",
"tickwidth",
"=",
"None",
",",
"title",
"=",
"None",
",",
"titlefont",
"=",
"None",
",",
"titleside",
"=",
"None",
",",
"x",
"=",
"None",
",",
"xanchor",
"=",
"None",
",",
"xpad",
"=",
"None",
",",
"y",
"=",
"None",
",",
"yanchor",
"=",
"None",
",",
"ypad",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"ColorBar",
",",
"self",
")",
".",
"__init__",
"(",
"\"colorbar\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.parcats.line.ColorBar \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.parcats.line.ColorBar`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolor\"",
",",
"None",
")",
"_v",
"=",
"bgcolor",
"if",
"bgcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolor\"",
",",
"None",
")",
"_v",
"=",
"bordercolor",
"if",
"bordercolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"borderwidth\"",
",",
"None",
")",
"_v",
"=",
"borderwidth",
"if",
"borderwidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"borderwidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"dtick\"",
",",
"None",
")",
"_v",
"=",
"dtick",
"if",
"dtick",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dtick\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"exponentformat\"",
",",
"None",
")",
"_v",
"=",
"exponentformat",
"if",
"exponentformat",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"exponentformat\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"len\"",
",",
"None",
")",
"_v",
"=",
"len",
"if",
"len",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"len\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"lenmode\"",
",",
"None",
")",
"_v",
"=",
"lenmode",
"if",
"lenmode",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"lenmode\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"nticks\"",
",",
"None",
")",
"_v",
"=",
"nticks",
"if",
"nticks",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"nticks\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"outlinecolor\"",
",",
"None",
")",
"_v",
"=",
"outlinecolor",
"if",
"outlinecolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"outlinecolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"outlinewidth\"",
",",
"None",
")",
"_v",
"=",
"outlinewidth",
"if",
"outlinewidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"outlinewidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"separatethousands\"",
",",
"None",
")",
"_v",
"=",
"separatethousands",
"if",
"separatethousands",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"separatethousands\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showexponent\"",
",",
"None",
")",
"_v",
"=",
"showexponent",
"if",
"showexponent",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showexponent\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showticklabels\"",
",",
"None",
")",
"_v",
"=",
"showticklabels",
"if",
"showticklabels",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showticklabels\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showtickprefix\"",
",",
"None",
")",
"_v",
"=",
"showtickprefix",
"if",
"showtickprefix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showtickprefix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showticksuffix\"",
",",
"None",
")",
"_v",
"=",
"showticksuffix",
"if",
"showticksuffix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showticksuffix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"thickness\"",
",",
"None",
")",
"_v",
"=",
"thickness",
"if",
"thickness",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"thickness\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"thicknessmode\"",
",",
"None",
")",
"_v",
"=",
"thicknessmode",
"if",
"thicknessmode",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"thicknessmode\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tick0\"",
",",
"None",
")",
"_v",
"=",
"tick0",
"if",
"tick0",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tick0\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickangle\"",
",",
"None",
")",
"_v",
"=",
"tickangle",
"if",
"tickangle",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickangle\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickcolor\"",
",",
"None",
")",
"_v",
"=",
"tickcolor",
"if",
"tickcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickfont\"",
",",
"None",
")",
"_v",
"=",
"tickfont",
"if",
"tickfont",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickfont\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickformat\"",
",",
"None",
")",
"_v",
"=",
"tickformat",
"if",
"tickformat",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickformat\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickformatstops\"",
",",
"None",
")",
"_v",
"=",
"tickformatstops",
"if",
"tickformatstops",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickformatstops\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickformatstopdefaults\"",
",",
"None",
")",
"_v",
"=",
"tickformatstopdefaults",
"if",
"tickformatstopdefaults",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickformatstopdefaults\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticklen\"",
",",
"None",
")",
"_v",
"=",
"ticklen",
"if",
"ticklen",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticklen\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickmode\"",
",",
"None",
")",
"_v",
"=",
"tickmode",
"if",
"tickmode",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickmode\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickprefix\"",
",",
"None",
")",
"_v",
"=",
"tickprefix",
"if",
"tickprefix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickprefix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticks\"",
",",
"None",
")",
"_v",
"=",
"ticks",
"if",
"ticks",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticks\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticksuffix\"",
",",
"None",
")",
"_v",
"=",
"ticksuffix",
"if",
"ticksuffix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticksuffix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticktext\"",
",",
"None",
")",
"_v",
"=",
"ticktext",
"if",
"ticktext",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticktext\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticktextsrc\"",
",",
"None",
")",
"_v",
"=",
"ticktextsrc",
"if",
"ticktextsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticktextsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickvals\"",
",",
"None",
")",
"_v",
"=",
"tickvals",
"if",
"tickvals",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickvals\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickvalssrc\"",
",",
"None",
")",
"_v",
"=",
"tickvalssrc",
"if",
"tickvalssrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickvalssrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickwidth\"",
",",
"None",
")",
"_v",
"=",
"tickwidth",
"if",
"tickwidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickwidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"title\"",
",",
"None",
")",
"_v",
"=",
"title",
"if",
"title",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"title\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"titlefont\"",
",",
"None",
")",
"_v",
"=",
"titlefont",
"if",
"titlefont",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"titlefont\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"titleside\"",
",",
"None",
")",
"_v",
"=",
"titleside",
"if",
"titleside",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"titleside\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"x\"",
",",
"None",
")",
"_v",
"=",
"x",
"if",
"x",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"x\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xanchor\"",
",",
"None",
")",
"_v",
"=",
"xanchor",
"if",
"xanchor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xanchor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xpad\"",
",",
"None",
")",
"_v",
"=",
"xpad",
"if",
"xpad",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xpad\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"y\"",
",",
"None",
")",
"_v",
"=",
"y",
"if",
"y",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"y\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"yanchor\"",
",",
"None",
")",
"_v",
"=",
"yanchor",
"if",
"yanchor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"yanchor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ypad\"",
",",
"None",
")",
"_v",
"=",
"ypad",
"if",
"ypad",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ypad\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
1482,
4
] | [
1941,
34
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.dtickrange | (self) |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
|
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type | def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
"""
return self["dtickrange"] | [
"def",
"dtickrange",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtickrange\"",
"]"
] | [
15,
4
] | [
31,
33
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.enabled | (self) |
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False) | def enabled(self):
"""
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["enabled"] | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"enabled\"",
"]"
] | [
40,
4
] | [
52,
30
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.name | (self) |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def name(self):
"""
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["name"] | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
61,
4
] | [
79,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.templateitemname | (self) |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def templateitemname(self):
"""
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["templateitemname"] | [
"def",
"templateitemname",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"templateitemname\"",
"]"
] | [
88,
4
] | [
107,
39
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.value | (self) |
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["value"] | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
116,
4
] | [
129,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.__init__ | (
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
) |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatterternary
.marker.colorbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
|
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatterternary
.marker.colorbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level, the same
as "tickformat" | def __init__(
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
):
"""
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatterternary
.marker.colorbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
"""
super(Tickformatstop, self).__init__("tickformatstops")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scatterternary.marker.colorbar.Tickformatstop
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scatterternary.marker.colorbar.Tickformatstop`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("dtickrange", None)
_v = dtickrange if dtickrange is not None else _v
if _v is not None:
self["dtickrange"] = _v
_v = arg.pop("enabled", None)
_v = enabled if enabled is not None else _v
if _v is not None:
self["enabled"] = _v
_v = arg.pop("name", None)
_v = name if name is not None else _v
if _v is not None:
self["name"] = _v
_v = arg.pop("templateitemname", None)
_v = templateitemname if templateitemname is not None else _v
if _v is not None:
self["templateitemname"] = _v
_v = arg.pop("value", None)
_v = value if value is not None else _v
if _v is not None:
self["value"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"dtickrange",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickformatstop",
",",
"self",
")",
".",
"__init__",
"(",
"\"tickformatstops\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scatterternary.marker.colorbar.Tickformatstop \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scatterternary.marker.colorbar.Tickformatstop`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"dtickrange\"",
",",
"None",
")",
"_v",
"=",
"dtickrange",
"if",
"dtickrange",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dtickrange\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"enabled\"",
",",
"None",
")",
"_v",
"=",
"enabled",
"if",
"enabled",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"enabled\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"name\"",
",",
"None",
")",
"_v",
"=",
"name",
"if",
"name",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"name\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"templateitemname\"",
",",
"None",
")",
"_v",
"=",
"templateitemname",
"if",
"templateitemname",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"templateitemname\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"value\"",
",",
"None",
")",
"_v",
"=",
"value",
"if",
"value",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"value\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
172,
4
] | [
282,
34
] | python | en | ['en', 'error', 'th'] | False |
parse_configuration_file | (config_path) |
Read the config file for an experiment to get ParlAI settings.
:param config_path:
path to config
:return:
parsed configuration dictionary
|
Read the config file for an experiment to get ParlAI settings. | def parse_configuration_file(config_path):
"""
Read the config file for an experiment to get ParlAI settings.
:param config_path:
path to config
:return:
parsed configuration dictionary
"""
result = {}
result["configs"] = {}
with open(config_path) as f:
cfg = yaml.load(f.read(), Loader=yaml.SafeLoader)
# get world path
result["world_path"] = cfg.get("world_module")
if not result["world_path"]:
raise ValueError("Did not specify world module")
result["overworld"] = cfg.get("overworld")
if not result["overworld"]:
raise ValueError("Did not specify overworld")
result["max_workers"] = cfg.get("max_workers")
if not result["max_workers"]:
raise ValueError("Did not specify max_workers")
result["task_name"] = cfg.get("task_name")
if not result["task_name"]:
raise ValueError("Did not specify task name")
task_world = cfg.get("tasks")
if task_world is None or len(task_world) == 0:
raise ValueError("task not in config file")
# get task file
for task_name, configuration in task_world.items():
if "task_world" not in configuration:
raise ValueError("{} does not specify a task".format(task_name))
result["configs"][task_name] = WorldConfig(
world_name=task_name,
onboarding_name=configuration.get("onboard_world"),
task_name=configuration.get("task_world"),
max_time_in_pool=configuration.get("timeout") or 300,
agents_required=configuration.get("agents_required") or 1,
backup_task=configuration.get("backup_task"),
)
# get world options, additional args
result["world_opt"] = cfg.get("opt", {})
result["additional_args"] = cfg.get("additional_args", {})
return result | [
"def",
"parse_configuration_file",
"(",
"config_path",
")",
":",
"result",
"=",
"{",
"}",
"result",
"[",
"\"configs\"",
"]",
"=",
"{",
"}",
"with",
"open",
"(",
"config_path",
")",
"as",
"f",
":",
"cfg",
"=",
"yaml",
".",
"load",
"(",
"f",
".",
"read",
"(",
")",
",",
"Loader",
"=",
"yaml",
".",
"SafeLoader",
")",
"# get world path",
"result",
"[",
"\"world_path\"",
"]",
"=",
"cfg",
".",
"get",
"(",
"\"world_module\"",
")",
"if",
"not",
"result",
"[",
"\"world_path\"",
"]",
":",
"raise",
"ValueError",
"(",
"\"Did not specify world module\"",
")",
"result",
"[",
"\"overworld\"",
"]",
"=",
"cfg",
".",
"get",
"(",
"\"overworld\"",
")",
"if",
"not",
"result",
"[",
"\"overworld\"",
"]",
":",
"raise",
"ValueError",
"(",
"\"Did not specify overworld\"",
")",
"result",
"[",
"\"max_workers\"",
"]",
"=",
"cfg",
".",
"get",
"(",
"\"max_workers\"",
")",
"if",
"not",
"result",
"[",
"\"max_workers\"",
"]",
":",
"raise",
"ValueError",
"(",
"\"Did not specify max_workers\"",
")",
"result",
"[",
"\"task_name\"",
"]",
"=",
"cfg",
".",
"get",
"(",
"\"task_name\"",
")",
"if",
"not",
"result",
"[",
"\"task_name\"",
"]",
":",
"raise",
"ValueError",
"(",
"\"Did not specify task name\"",
")",
"task_world",
"=",
"cfg",
".",
"get",
"(",
"\"tasks\"",
")",
"if",
"task_world",
"is",
"None",
"or",
"len",
"(",
"task_world",
")",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"task not in config file\"",
")",
"# get task file",
"for",
"task_name",
",",
"configuration",
"in",
"task_world",
".",
"items",
"(",
")",
":",
"if",
"\"task_world\"",
"not",
"in",
"configuration",
":",
"raise",
"ValueError",
"(",
"\"{} does not specify a task\"",
".",
"format",
"(",
"task_name",
")",
")",
"result",
"[",
"\"configs\"",
"]",
"[",
"task_name",
"]",
"=",
"WorldConfig",
"(",
"world_name",
"=",
"task_name",
",",
"onboarding_name",
"=",
"configuration",
".",
"get",
"(",
"\"onboard_world\"",
")",
",",
"task_name",
"=",
"configuration",
".",
"get",
"(",
"\"task_world\"",
")",
",",
"max_time_in_pool",
"=",
"configuration",
".",
"get",
"(",
"\"timeout\"",
")",
"or",
"300",
",",
"agents_required",
"=",
"configuration",
".",
"get",
"(",
"\"agents_required\"",
")",
"or",
"1",
",",
"backup_task",
"=",
"configuration",
".",
"get",
"(",
"\"backup_task\"",
")",
",",
")",
"# get world options, additional args",
"result",
"[",
"\"world_opt\"",
"]",
"=",
"cfg",
".",
"get",
"(",
"\"opt\"",
",",
"{",
"}",
")",
"result",
"[",
"\"additional_args\"",
"]",
"=",
"cfg",
".",
"get",
"(",
"\"additional_args\"",
",",
"{",
"}",
")",
"return",
"result"
] | [
25,
0
] | [
71,
17
] | python | en | ['en', 'error', 'th'] | False |
Project.x | (self) |
Determines whether or not these contour lines are projected on
the x plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'x' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not these contour lines are projected on
the x plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'x' property must be specified as a bool
(either True, or False) | def x(self):
"""
Determines whether or not these contour lines are projected on
the x plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'x' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
15,
4
] | [
29,
24
] | python | en | ['en', 'error', 'th'] | False |
Project.y | (self) |
Determines whether or not these contour lines are projected on
the y plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'y' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not these contour lines are projected on
the y plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'y' property must be specified as a bool
(either True, or False) | def y(self):
"""
Determines whether or not these contour lines are projected on
the y plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'y' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
38,
4
] | [
52,
24
] | python | en | ['en', 'error', 'th'] | False |
Project.z | (self) |
Determines whether or not these contour lines are projected on
the z plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'z' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not these contour lines are projected on
the z plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'z' property must be specified as a bool
(either True, or False) | def z(self):
"""
Determines whether or not these contour lines are projected on
the z plane. If `highlight` is set to True (the default), the
projected lines are shown on hover. If `show` is set to True,
the projected lines are shown in permanence.
The 'z' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["z"] | [
"def",
"z",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"z\"",
"]"
] | [
61,
4
] | [
75,
24
] | python | en | ['en', 'error', 'th'] | False |
Project.__init__ | (self, arg=None, x=None, y=None, z=None, **kwargs) |
Construct a new Project object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.contours.z.Project`
x
Determines whether or not these contour lines are
projected on the x plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
y
Determines whether or not these contour lines are
projected on the y plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
z
Determines whether or not these contour lines are
projected on the z plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
Returns
-------
Project
|
Construct a new Project object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.contours.z.Project`
x
Determines whether or not these contour lines are
projected on the x plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
y
Determines whether or not these contour lines are
projected on the y plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
z
Determines whether or not these contour lines are
projected on the z plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence. | def __init__(self, arg=None, x=None, y=None, z=None, **kwargs):
"""
Construct a new Project object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.contours.z.Project`
x
Determines whether or not these contour lines are
projected on the x plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
y
Determines whether or not these contour lines are
projected on the y plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
z
Determines whether or not these contour lines are
projected on the z plane. If `highlight` is set to True
(the default), the projected lines are shown on hover.
If `show` is set to True, the projected lines are shown
in permanence.
Returns
-------
Project
"""
super(Project, self).__init__("project")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.surface.contours.z.Project
constructor must be a dict or
an instance of :class:`plotly.graph_objs.surface.contours.z.Project`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("x", None)
_v = x if x is not None else _v
if _v is not None:
self["x"] = _v
_v = arg.pop("y", None)
_v = y if y is not None else _v
if _v is not None:
self["y"] = _v
_v = arg.pop("z", None)
_v = z if z is not None else _v
if _v is not None:
self["z"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"z",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Project",
",",
"self",
")",
".",
"__init__",
"(",
"\"project\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.surface.contours.z.Project \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.surface.contours.z.Project`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"x\"",
",",
"None",
")",
"_v",
"=",
"x",
"if",
"x",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"x\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"y\"",
",",
"None",
")",
"_v",
"=",
"y",
"if",
"y",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"y\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"z\"",
",",
"None",
")",
"_v",
"=",
"z",
"if",
"z",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"z\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
106,
4
] | [
187,
34
] | python | en | ['en', 'error', 'th'] | False |
setup_args | () |
Set up args.
|
Set up args.
| def setup_args():
"""
Set up args.
"""
parser = ParlaiParser(False, False)
parser.add_parlai_data_path()
parser.add_messenger_args()
return parser.parse_args() | [
"def",
"setup_args",
"(",
")",
":",
"parser",
"=",
"ParlaiParser",
"(",
"False",
",",
"False",
")",
"parser",
".",
"add_parlai_data_path",
"(",
")",
"parser",
".",
"add_messenger_args",
"(",
")",
"return",
"parser",
".",
"parse_args",
"(",
")"
] | [
16,
0
] | [
23,
30
] | python | en | ['en', 'error', 'th'] | False |
run | (opt) |
Run MessengerManager.
|
Run MessengerManager.
| def run(opt):
"""
Run MessengerManager.
"""
opt['service'] = SERVICE_NAME
manager = MessengerManager(opt)
try:
manager.start_task()
except BaseException:
raise
finally:
manager.shutdown() | [
"def",
"run",
"(",
"opt",
")",
":",
"opt",
"[",
"'service'",
"]",
"=",
"SERVICE_NAME",
"manager",
"=",
"MessengerManager",
"(",
"opt",
")",
"try",
":",
"manager",
".",
"start_task",
"(",
")",
"except",
"BaseException",
":",
"raise",
"finally",
":",
"manager",
".",
"shutdown",
"(",
")"
] | [
26,
0
] | [
37,
26
] | python | en | ['en', 'error', 'th'] | False |
load_checkpoint | (sess, checkpoint_dir, filename=None, blacklist=(), prefix=None, variable_mapping=None,
whitelist=None, reverse_mapping=None) |
if `filename` is None, we load last checkpoint, otherwise
we ignore `checkpoint_dir` and load the given checkpoint file.
|
if `filename` is None, we load last checkpoint, otherwise
we ignore `checkpoint_dir` and load the given checkpoint file.
| def load_checkpoint(sess, checkpoint_dir, filename=None, blacklist=(), prefix=None, variable_mapping=None,
whitelist=None, reverse_mapping=None):
"""
if `filename` is None, we load last checkpoint, otherwise
we ignore `checkpoint_dir` and load the given checkpoint file.
"""
variable_mapping = variable_mapping or []
reverse_mapping = reverse_mapping or []
variable_mapping = list(variable_mapping) + global_variable_mapping
reverse_mapping = list(reverse_mapping) + global_reverse_mapping
if filename is None:
# load last checkpoint
ckpt = tf.train.get_checkpoint_state(checkpoint_dir)
if ckpt is not None:
filename = ckpt.model_checkpoint_path
else:
checkpoint_dir = os.path.dirname(filename)
vars_ = []
var_names = []
for var in tf.global_variables():
if prefix is None or var.name.startswith(prefix):
name = var.name if prefix is None else var.name[len(prefix) + 1:]
vars_.append(var)
var_names.append(name)
var_file = os.path.join(checkpoint_dir, 'vars.pkl')
if os.path.exists(var_file):
with open(var_file, 'rb') as f:
old_names = pickle.load(f)
else:
old_names = list(var_names)
name_mapping = {}
for name in old_names:
name_ = name
for key, value in variable_mapping:
name_ = re.sub(key, value, name_)
name_mapping[name] = name_
var_names_ = []
for name in var_names:
name_ = name
for key, value in reverse_mapping:
name_ = re.sub(key, value, name_)
if name_ in list(name_mapping.values()):
name = name_
var_names_.append(name)
vars_ = dict(zip(var_names_, vars_))
variables = {old_name[:-2]: vars_[new_name] for old_name, new_name in name_mapping.items()
if new_name in vars_ and not any(prefix in new_name for prefix in blacklist) and
(whitelist is None or new_name in whitelist)}
if filename is not None:
utils.log('reading model parameters from {}'.format(filename))
tf.train.Saver(variables).restore(sess, filename)
utils.debug('retrieved parameters ({})'.format(len(variables)))
for var in sorted(variables.values(), key=lambda var: var.name):
utils.debug(' {} {}'.format(var.name, var.get_shape())) | [
"def",
"load_checkpoint",
"(",
"sess",
",",
"checkpoint_dir",
",",
"filename",
"=",
"None",
",",
"blacklist",
"=",
"(",
")",
",",
"prefix",
"=",
"None",
",",
"variable_mapping",
"=",
"None",
",",
"whitelist",
"=",
"None",
",",
"reverse_mapping",
"=",
"None",
")",
":",
"variable_mapping",
"=",
"variable_mapping",
"or",
"[",
"]",
"reverse_mapping",
"=",
"reverse_mapping",
"or",
"[",
"]",
"variable_mapping",
"=",
"list",
"(",
"variable_mapping",
")",
"+",
"global_variable_mapping",
"reverse_mapping",
"=",
"list",
"(",
"reverse_mapping",
")",
"+",
"global_reverse_mapping",
"if",
"filename",
"is",
"None",
":",
"# load last checkpoint",
"ckpt",
"=",
"tf",
".",
"train",
".",
"get_checkpoint_state",
"(",
"checkpoint_dir",
")",
"if",
"ckpt",
"is",
"not",
"None",
":",
"filename",
"=",
"ckpt",
".",
"model_checkpoint_path",
"else",
":",
"checkpoint_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"filename",
")",
"vars_",
"=",
"[",
"]",
"var_names",
"=",
"[",
"]",
"for",
"var",
"in",
"tf",
".",
"global_variables",
"(",
")",
":",
"if",
"prefix",
"is",
"None",
"or",
"var",
".",
"name",
".",
"startswith",
"(",
"prefix",
")",
":",
"name",
"=",
"var",
".",
"name",
"if",
"prefix",
"is",
"None",
"else",
"var",
".",
"name",
"[",
"len",
"(",
"prefix",
")",
"+",
"1",
":",
"]",
"vars_",
".",
"append",
"(",
"var",
")",
"var_names",
".",
"append",
"(",
"name",
")",
"var_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"checkpoint_dir",
",",
"'vars.pkl'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"var_file",
")",
":",
"with",
"open",
"(",
"var_file",
",",
"'rb'",
")",
"as",
"f",
":",
"old_names",
"=",
"pickle",
".",
"load",
"(",
"f",
")",
"else",
":",
"old_names",
"=",
"list",
"(",
"var_names",
")",
"name_mapping",
"=",
"{",
"}",
"for",
"name",
"in",
"old_names",
":",
"name_",
"=",
"name",
"for",
"key",
",",
"value",
"in",
"variable_mapping",
":",
"name_",
"=",
"re",
".",
"sub",
"(",
"key",
",",
"value",
",",
"name_",
")",
"name_mapping",
"[",
"name",
"]",
"=",
"name_",
"var_names_",
"=",
"[",
"]",
"for",
"name",
"in",
"var_names",
":",
"name_",
"=",
"name",
"for",
"key",
",",
"value",
"in",
"reverse_mapping",
":",
"name_",
"=",
"re",
".",
"sub",
"(",
"key",
",",
"value",
",",
"name_",
")",
"if",
"name_",
"in",
"list",
"(",
"name_mapping",
".",
"values",
"(",
")",
")",
":",
"name",
"=",
"name_",
"var_names_",
".",
"append",
"(",
"name",
")",
"vars_",
"=",
"dict",
"(",
"zip",
"(",
"var_names_",
",",
"vars_",
")",
")",
"variables",
"=",
"{",
"old_name",
"[",
":",
"-",
"2",
"]",
":",
"vars_",
"[",
"new_name",
"]",
"for",
"old_name",
",",
"new_name",
"in",
"name_mapping",
".",
"items",
"(",
")",
"if",
"new_name",
"in",
"vars_",
"and",
"not",
"any",
"(",
"prefix",
"in",
"new_name",
"for",
"prefix",
"in",
"blacklist",
")",
"and",
"(",
"whitelist",
"is",
"None",
"or",
"new_name",
"in",
"whitelist",
")",
"}",
"if",
"filename",
"is",
"not",
"None",
":",
"utils",
".",
"log",
"(",
"'reading model parameters from {}'",
".",
"format",
"(",
"filename",
")",
")",
"tf",
".",
"train",
".",
"Saver",
"(",
"variables",
")",
".",
"restore",
"(",
"sess",
",",
"filename",
")",
"utils",
".",
"debug",
"(",
"'retrieved parameters ({})'",
".",
"format",
"(",
"len",
"(",
"variables",
")",
")",
")",
"for",
"var",
"in",
"sorted",
"(",
"variables",
".",
"values",
"(",
")",
",",
"key",
"=",
"lambda",
"var",
":",
"var",
".",
"name",
")",
":",
"utils",
".",
"debug",
"(",
"' {} {}'",
".",
"format",
"(",
"var",
".",
"name",
",",
"var",
".",
"get_shape",
"(",
")",
")",
")"
] | [
738,
0
] | [
800,
68
] | python | en | ['en', 'error', 'th'] | False |
TranslationModel.evaluate | (self, score_functions, on_dev=True, output=None, remove_unk=False, max_dev_size=None,
raw_output=False, fix_edits=True, max_test_size=None, post_process_script=None,
unk_replace=False, **kwargs) |
Decode a dev or test set, and perform evaluation with respect to gold standard, using the provided
scoring function. If `output` is defined, also save the decoding output to this file.
When evaluating development data (`on_dev` to True), several dev sets can be specified (`dev_prefix` parameter
in configuration files), and a score is computed for each of them.
:param score_function: name of the scoring function used to score and rank models (typically 'bleu_score')
:param on_dev: if True, evaluate the dev corpus, otherwise evaluate the test corpus
:param output: save the hypotheses to this file
:param remove_unk: remove the UNK symbols from the output
:param max_dev_size: maximum number of lines to read from dev files
:param max_test_size: maximum number of lines to read from test files
:param raw_output: save raw decoder output (don't do post-processing like UNK deletion or subword
concatenation). The evaluation is still done with the post-processed output.
:param fix_edits: when predicting edit operations, pad shorter hypotheses with KEEP symbols.
:return: scores of each corpus to evaluate
|
Decode a dev or test set, and perform evaluation with respect to gold standard, using the provided
scoring function. If `output` is defined, also save the decoding output to this file.
When evaluating development data (`on_dev` to True), several dev sets can be specified (`dev_prefix` parameter
in configuration files), and a score is computed for each of them. | def evaluate(self, score_functions, on_dev=True, output=None, remove_unk=False, max_dev_size=None,
raw_output=False, fix_edits=True, max_test_size=None, post_process_script=None,
unk_replace=False, **kwargs):
"""
Decode a dev or test set, and perform evaluation with respect to gold standard, using the provided
scoring function. If `output` is defined, also save the decoding output to this file.
When evaluating development data (`on_dev` to True), several dev sets can be specified (`dev_prefix` parameter
in configuration files), and a score is computed for each of them.
:param score_function: name of the scoring function used to score and rank models (typically 'bleu_score')
:param on_dev: if True, evaluate the dev corpus, otherwise evaluate the test corpus
:param output: save the hypotheses to this file
:param remove_unk: remove the UNK symbols from the output
:param max_dev_size: maximum number of lines to read from dev files
:param max_test_size: maximum number of lines to read from test files
:param raw_output: save raw decoder output (don't do post-processing like UNK deletion or subword
concatenation). The evaluation is still done with the post-processed output.
:param fix_edits: when predicting edit operations, pad shorter hypotheses with KEEP symbols.
:return: scores of each corpus to evaluate
"""
utils.log('starting evaluation')
if on_dev:
filenames = self.filenames.dev
else:
filenames = [self.filenames.test]
# convert `output` into a list, for zip
if isinstance(output, str):
output = [output]
elif output is None:
output = [None] * len(filenames)
scores = []
# evaluation on multiple corpora
for dev_id, (filenames_, output_, prefix) in enumerate(zip(filenames, output, self.dev_prefix)):
if self.ref_ext is not None:
filenames_ = filenames_[:len(self.src_ext)] + filenames_[-1:]
if self.dev_batches:
dev_batches = self.dev_batches[dev_id]
dev_loss = sum(self.seq2seq_model.step(batch, update_model=False).loss * len(batch)
for batch in dev_batches)
dev_loss /= sum(map(len, dev_batches))
else: # TODO
dev_loss = 0
src_lines = list(utils.read_lines(filenames_[:len(self.src_ext)], binary=self.binary[:len(self.src_ext)]))
trg_lines = list(utils.read_lines([filenames_[len(self.src_ext)]]))
assert len(trg_lines) % len(src_lines) == 0
references = []
ref_count = len(trg_lines) // len(src_lines)
for i in range(len(src_lines)):
ref = trg_lines[i * ref_count:(i + 1) * ref_count]
ref = [ref_[0].strip().replace('@@ ', '').replace('@@', '') for ref_ in ref]
references.append(ref)
if on_dev and max_dev_size:
max_size = max_dev_size
elif not on_dev and max_test_size:
max_size = max_test_size
else:
max_size = len(src_lines)
src_lines = src_lines[:max_size]
references = references[:max_size]
hypotheses = []
output_file = None
try:
if output_ is not None:
output_file = open(output_, 'w')
hypothesis_iter = self.decode_batch(src_lines, self.batch_size, remove_unk=remove_unk,
fix_edits=fix_edits, unk_replace=unk_replace)
if post_process_script is not None:
hypotheses, raw = zip(*hypothesis_iter)
data = '\n'.join(hypotheses).encode()
data = Popen([post_process_script], stdout=PIPE, stdin=PIPE).communicate(input=data)[0].decode()
hypotheses = data.splitlines()
hypothesis_iter = zip(hypotheses, raw)
for i, hypothesis in enumerate(hypothesis_iter):
hypothesis, raw = hypothesis
hypotheses.append(hypothesis)
if output_file is not None:
if raw_output:
hypothesis = raw
output_file.write(hypothesis + '\n')
output_file.flush()
finally:
if output_file is not None:
output_file.close()
scores_ = []
summary = None
for score_function in score_functions:
try:
if score_function != 'bleu':
references_ = [ref[0] for ref in references]
else:
references_ = references
if score_function == 'loss':
score = dev_loss
reversed_ = True
else:
fun = getattr(evaluation, 'corpus_' + score_function)
try:
reversed_ = fun.reversed
except AttributeError:
reversed_ = False
score, score_summary = fun(hypotheses, references_)
summary = summary or score_summary
scores_.append((score_function, score, reversed_))
except:
pass
score_info = ['{}={:.2f}'.format(key, value) for key, value, _ in scores_]
score_info.insert(0, prefix)
if summary:
score_info.append(summary)
if self.name is not None:
score_info.insert(0, self.name)
utils.log(' '.join(map(str, score_info)))
# main score
_, score, reversed_ = scores_[0]
scores.append(-score if reversed_ else score)
return scores | [
"def",
"evaluate",
"(",
"self",
",",
"score_functions",
",",
"on_dev",
"=",
"True",
",",
"output",
"=",
"None",
",",
"remove_unk",
"=",
"False",
",",
"max_dev_size",
"=",
"None",
",",
"raw_output",
"=",
"False",
",",
"fix_edits",
"=",
"True",
",",
"max_test_size",
"=",
"None",
",",
"post_process_script",
"=",
"None",
",",
"unk_replace",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"utils",
".",
"log",
"(",
"'starting evaluation'",
")",
"if",
"on_dev",
":",
"filenames",
"=",
"self",
".",
"filenames",
".",
"dev",
"else",
":",
"filenames",
"=",
"[",
"self",
".",
"filenames",
".",
"test",
"]",
"# convert `output` into a list, for zip",
"if",
"isinstance",
"(",
"output",
",",
"str",
")",
":",
"output",
"=",
"[",
"output",
"]",
"elif",
"output",
"is",
"None",
":",
"output",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"filenames",
")",
"scores",
"=",
"[",
"]",
"# evaluation on multiple corpora",
"for",
"dev_id",
",",
"(",
"filenames_",
",",
"output_",
",",
"prefix",
")",
"in",
"enumerate",
"(",
"zip",
"(",
"filenames",
",",
"output",
",",
"self",
".",
"dev_prefix",
")",
")",
":",
"if",
"self",
".",
"ref_ext",
"is",
"not",
"None",
":",
"filenames_",
"=",
"filenames_",
"[",
":",
"len",
"(",
"self",
".",
"src_ext",
")",
"]",
"+",
"filenames_",
"[",
"-",
"1",
":",
"]",
"if",
"self",
".",
"dev_batches",
":",
"dev_batches",
"=",
"self",
".",
"dev_batches",
"[",
"dev_id",
"]",
"dev_loss",
"=",
"sum",
"(",
"self",
".",
"seq2seq_model",
".",
"step",
"(",
"batch",
",",
"update_model",
"=",
"False",
")",
".",
"loss",
"*",
"len",
"(",
"batch",
")",
"for",
"batch",
"in",
"dev_batches",
")",
"dev_loss",
"/=",
"sum",
"(",
"map",
"(",
"len",
",",
"dev_batches",
")",
")",
"else",
":",
"# TODO",
"dev_loss",
"=",
"0",
"src_lines",
"=",
"list",
"(",
"utils",
".",
"read_lines",
"(",
"filenames_",
"[",
":",
"len",
"(",
"self",
".",
"src_ext",
")",
"]",
",",
"binary",
"=",
"self",
".",
"binary",
"[",
":",
"len",
"(",
"self",
".",
"src_ext",
")",
"]",
")",
")",
"trg_lines",
"=",
"list",
"(",
"utils",
".",
"read_lines",
"(",
"[",
"filenames_",
"[",
"len",
"(",
"self",
".",
"src_ext",
")",
"]",
"]",
")",
")",
"assert",
"len",
"(",
"trg_lines",
")",
"%",
"len",
"(",
"src_lines",
")",
"==",
"0",
"references",
"=",
"[",
"]",
"ref_count",
"=",
"len",
"(",
"trg_lines",
")",
"//",
"len",
"(",
"src_lines",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"src_lines",
")",
")",
":",
"ref",
"=",
"trg_lines",
"[",
"i",
"*",
"ref_count",
":",
"(",
"i",
"+",
"1",
")",
"*",
"ref_count",
"]",
"ref",
"=",
"[",
"ref_",
"[",
"0",
"]",
".",
"strip",
"(",
")",
".",
"replace",
"(",
"'@@ '",
",",
"''",
")",
".",
"replace",
"(",
"'@@'",
",",
"''",
")",
"for",
"ref_",
"in",
"ref",
"]",
"references",
".",
"append",
"(",
"ref",
")",
"if",
"on_dev",
"and",
"max_dev_size",
":",
"max_size",
"=",
"max_dev_size",
"elif",
"not",
"on_dev",
"and",
"max_test_size",
":",
"max_size",
"=",
"max_test_size",
"else",
":",
"max_size",
"=",
"len",
"(",
"src_lines",
")",
"src_lines",
"=",
"src_lines",
"[",
":",
"max_size",
"]",
"references",
"=",
"references",
"[",
":",
"max_size",
"]",
"hypotheses",
"=",
"[",
"]",
"output_file",
"=",
"None",
"try",
":",
"if",
"output_",
"is",
"not",
"None",
":",
"output_file",
"=",
"open",
"(",
"output_",
",",
"'w'",
")",
"hypothesis_iter",
"=",
"self",
".",
"decode_batch",
"(",
"src_lines",
",",
"self",
".",
"batch_size",
",",
"remove_unk",
"=",
"remove_unk",
",",
"fix_edits",
"=",
"fix_edits",
",",
"unk_replace",
"=",
"unk_replace",
")",
"if",
"post_process_script",
"is",
"not",
"None",
":",
"hypotheses",
",",
"raw",
"=",
"zip",
"(",
"*",
"hypothesis_iter",
")",
"data",
"=",
"'\\n'",
".",
"join",
"(",
"hypotheses",
")",
".",
"encode",
"(",
")",
"data",
"=",
"Popen",
"(",
"[",
"post_process_script",
"]",
",",
"stdout",
"=",
"PIPE",
",",
"stdin",
"=",
"PIPE",
")",
".",
"communicate",
"(",
"input",
"=",
"data",
")",
"[",
"0",
"]",
".",
"decode",
"(",
")",
"hypotheses",
"=",
"data",
".",
"splitlines",
"(",
")",
"hypothesis_iter",
"=",
"zip",
"(",
"hypotheses",
",",
"raw",
")",
"for",
"i",
",",
"hypothesis",
"in",
"enumerate",
"(",
"hypothesis_iter",
")",
":",
"hypothesis",
",",
"raw",
"=",
"hypothesis",
"hypotheses",
".",
"append",
"(",
"hypothesis",
")",
"if",
"output_file",
"is",
"not",
"None",
":",
"if",
"raw_output",
":",
"hypothesis",
"=",
"raw",
"output_file",
".",
"write",
"(",
"hypothesis",
"+",
"'\\n'",
")",
"output_file",
".",
"flush",
"(",
")",
"finally",
":",
"if",
"output_file",
"is",
"not",
"None",
":",
"output_file",
".",
"close",
"(",
")",
"scores_",
"=",
"[",
"]",
"summary",
"=",
"None",
"for",
"score_function",
"in",
"score_functions",
":",
"try",
":",
"if",
"score_function",
"!=",
"'bleu'",
":",
"references_",
"=",
"[",
"ref",
"[",
"0",
"]",
"for",
"ref",
"in",
"references",
"]",
"else",
":",
"references_",
"=",
"references",
"if",
"score_function",
"==",
"'loss'",
":",
"score",
"=",
"dev_loss",
"reversed_",
"=",
"True",
"else",
":",
"fun",
"=",
"getattr",
"(",
"evaluation",
",",
"'corpus_'",
"+",
"score_function",
")",
"try",
":",
"reversed_",
"=",
"fun",
".",
"reversed",
"except",
"AttributeError",
":",
"reversed_",
"=",
"False",
"score",
",",
"score_summary",
"=",
"fun",
"(",
"hypotheses",
",",
"references_",
")",
"summary",
"=",
"summary",
"or",
"score_summary",
"scores_",
".",
"append",
"(",
"(",
"score_function",
",",
"score",
",",
"reversed_",
")",
")",
"except",
":",
"pass",
"score_info",
"=",
"[",
"'{}={:.2f}'",
".",
"format",
"(",
"key",
",",
"value",
")",
"for",
"key",
",",
"value",
",",
"_",
"in",
"scores_",
"]",
"score_info",
".",
"insert",
"(",
"0",
",",
"prefix",
")",
"if",
"summary",
":",
"score_info",
".",
"append",
"(",
"summary",
")",
"if",
"self",
".",
"name",
"is",
"not",
"None",
":",
"score_info",
".",
"insert",
"(",
"0",
",",
"self",
".",
"name",
")",
"utils",
".",
"log",
"(",
"' '",
".",
"join",
"(",
"map",
"(",
"str",
",",
"score_info",
")",
")",
")",
"# main score",
"_",
",",
"score",
",",
"reversed_",
"=",
"scores_",
"[",
"0",
"]",
"scores",
".",
"append",
"(",
"-",
"score",
"if",
"reversed_",
"else",
"score",
")",
"return",
"scores"
] | [
319,
4
] | [
456,
21
] | python | en | ['en', 'error', 'th'] | False |
TranslationModel.initialize | (self, checkpoints=None, reset=False, reset_learning_rate=False, max_to_keep=1,
keep_every_n_hours=0, sess=None, whitelist=None, blacklist=None, **kwargs) |
:param checkpoints: list of checkpoints to load (instead of latest checkpoint)
:param reset: don't load latest checkpoint, reset learning rate and global step
:param reset_learning_rate: reset the learning rate to its initial value
:param max_to_keep: keep this many latest checkpoints at all times
:param keep_every_n_hours: and keep checkpoints every n hours
|
:param checkpoints: list of checkpoints to load (instead of latest checkpoint)
:param reset: don't load latest checkpoint, reset learning rate and global step
:param reset_learning_rate: reset the learning rate to its initial value
:param max_to_keep: keep this many latest checkpoints at all times
:param keep_every_n_hours: and keep checkpoints every n hours
| def initialize(self, checkpoints=None, reset=False, reset_learning_rate=False, max_to_keep=1,
keep_every_n_hours=0, sess=None, whitelist=None, blacklist=None, **kwargs):
"""
:param checkpoints: list of checkpoints to load (instead of latest checkpoint)
:param reset: don't load latest checkpoint, reset learning rate and global step
:param reset_learning_rate: reset the learning rate to its initial value
:param max_to_keep: keep this many latest checkpoints at all times
:param keep_every_n_hours: and keep checkpoints every n hours
"""
sess = sess or tf.get_default_session()
if keep_every_n_hours <= 0 or keep_every_n_hours is None:
keep_every_n_hours = float('inf')
self.saver = tf.train.Saver(max_to_keep=max_to_keep, keep_checkpoint_every_n_hours=keep_every_n_hours,
sharded=False)
sess.run(tf.global_variables_initializer())
# load pre-trained embeddings
for encoder_or_decoder, vocab in zip(self.encoders + self.decoders, self.vocabs):
if encoder_or_decoder.embedding_file:
utils.log('loading embeddings from: {}'.format(encoder_or_decoder.embedding_file))
embeddings = {}
with open(encoder_or_decoder.embedding_file) as embedding_file:
for line in embedding_file:
word, vector = line.split(' ', 1)
if word in vocab.vocab:
embeddings[word] = np.array(list(map(float, vector.split())))
# standardize (mean of 0, std of 0.01)
mean = sum(embeddings.values()) / len(embeddings)
std = np.sqrt(sum((value - mean)**2 for value in embeddings.values())) / (len(embeddings) - 1)
for key in embeddings:
embeddings[key] = 0.01 * (embeddings[key] - mean) / std
# change TensorFlow variable's value
with tf.variable_scope(tf.get_variable_scope(), reuse=True):
embedding_var = tf.get_variable('embedding_' + encoder_or_decoder.name)
embedding_value = embedding_var.eval()
for word, i in vocab.vocab.items():
if word in embeddings:
embedding_value[i] = embeddings[word]
sess.run(embedding_var.assign(embedding_value))
if whitelist:
with open(whitelist) as f:
whitelist = list(line.strip() for line in f)
if blacklist:
with open(blacklist) as f:
blacklist = list(line.strip() for line in f)
else:
blacklist = []
blacklist.append('dropout_keep_prob')
if reset_learning_rate or reset:
blacklist.append('learning_rate')
if reset:
blacklist.append('global_step')
params = {k: kwargs.get(k) for k in ('variable_mapping', 'reverse_mapping')}
if checkpoints and len(self.models) > 1:
assert len(self.models) == len(checkpoints)
for i, checkpoint in enumerate(checkpoints, 1):
load_checkpoint(sess, None, checkpoint, blacklist=blacklist, whitelist=whitelist,
prefix='model_{}'.format(i), **params)
elif checkpoints: # load partial checkpoints
for checkpoint in checkpoints: # checkpoint files to load
load_checkpoint(sess, None, checkpoint, blacklist=blacklist, whitelist=whitelist, **params)
elif not reset:
load_checkpoint(sess, self.checkpoint_dir, blacklist=blacklist, whitelist=whitelist, **params)
utils.debug('global step: {}'.format(self.global_step.eval()))
utils.debug('baseline step: {}'.format(self.baseline_step.eval())) | [
"def",
"initialize",
"(",
"self",
",",
"checkpoints",
"=",
"None",
",",
"reset",
"=",
"False",
",",
"reset_learning_rate",
"=",
"False",
",",
"max_to_keep",
"=",
"1",
",",
"keep_every_n_hours",
"=",
"0",
",",
"sess",
"=",
"None",
",",
"whitelist",
"=",
"None",
",",
"blacklist",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"sess",
"=",
"sess",
"or",
"tf",
".",
"get_default_session",
"(",
")",
"if",
"keep_every_n_hours",
"<=",
"0",
"or",
"keep_every_n_hours",
"is",
"None",
":",
"keep_every_n_hours",
"=",
"float",
"(",
"'inf'",
")",
"self",
".",
"saver",
"=",
"tf",
".",
"train",
".",
"Saver",
"(",
"max_to_keep",
"=",
"max_to_keep",
",",
"keep_checkpoint_every_n_hours",
"=",
"keep_every_n_hours",
",",
"sharded",
"=",
"False",
")",
"sess",
".",
"run",
"(",
"tf",
".",
"global_variables_initializer",
"(",
")",
")",
"# load pre-trained embeddings",
"for",
"encoder_or_decoder",
",",
"vocab",
"in",
"zip",
"(",
"self",
".",
"encoders",
"+",
"self",
".",
"decoders",
",",
"self",
".",
"vocabs",
")",
":",
"if",
"encoder_or_decoder",
".",
"embedding_file",
":",
"utils",
".",
"log",
"(",
"'loading embeddings from: {}'",
".",
"format",
"(",
"encoder_or_decoder",
".",
"embedding_file",
")",
")",
"embeddings",
"=",
"{",
"}",
"with",
"open",
"(",
"encoder_or_decoder",
".",
"embedding_file",
")",
"as",
"embedding_file",
":",
"for",
"line",
"in",
"embedding_file",
":",
"word",
",",
"vector",
"=",
"line",
".",
"split",
"(",
"' '",
",",
"1",
")",
"if",
"word",
"in",
"vocab",
".",
"vocab",
":",
"embeddings",
"[",
"word",
"]",
"=",
"np",
".",
"array",
"(",
"list",
"(",
"map",
"(",
"float",
",",
"vector",
".",
"split",
"(",
")",
")",
")",
")",
"# standardize (mean of 0, std of 0.01)",
"mean",
"=",
"sum",
"(",
"embeddings",
".",
"values",
"(",
")",
")",
"/",
"len",
"(",
"embeddings",
")",
"std",
"=",
"np",
".",
"sqrt",
"(",
"sum",
"(",
"(",
"value",
"-",
"mean",
")",
"**",
"2",
"for",
"value",
"in",
"embeddings",
".",
"values",
"(",
")",
")",
")",
"/",
"(",
"len",
"(",
"embeddings",
")",
"-",
"1",
")",
"for",
"key",
"in",
"embeddings",
":",
"embeddings",
"[",
"key",
"]",
"=",
"0.01",
"*",
"(",
"embeddings",
"[",
"key",
"]",
"-",
"mean",
")",
"/",
"std",
"# change TensorFlow variable's value",
"with",
"tf",
".",
"variable_scope",
"(",
"tf",
".",
"get_variable_scope",
"(",
")",
",",
"reuse",
"=",
"True",
")",
":",
"embedding_var",
"=",
"tf",
".",
"get_variable",
"(",
"'embedding_'",
"+",
"encoder_or_decoder",
".",
"name",
")",
"embedding_value",
"=",
"embedding_var",
".",
"eval",
"(",
")",
"for",
"word",
",",
"i",
"in",
"vocab",
".",
"vocab",
".",
"items",
"(",
")",
":",
"if",
"word",
"in",
"embeddings",
":",
"embedding_value",
"[",
"i",
"]",
"=",
"embeddings",
"[",
"word",
"]",
"sess",
".",
"run",
"(",
"embedding_var",
".",
"assign",
"(",
"embedding_value",
")",
")",
"if",
"whitelist",
":",
"with",
"open",
"(",
"whitelist",
")",
"as",
"f",
":",
"whitelist",
"=",
"list",
"(",
"line",
".",
"strip",
"(",
")",
"for",
"line",
"in",
"f",
")",
"if",
"blacklist",
":",
"with",
"open",
"(",
"blacklist",
")",
"as",
"f",
":",
"blacklist",
"=",
"list",
"(",
"line",
".",
"strip",
"(",
")",
"for",
"line",
"in",
"f",
")",
"else",
":",
"blacklist",
"=",
"[",
"]",
"blacklist",
".",
"append",
"(",
"'dropout_keep_prob'",
")",
"if",
"reset_learning_rate",
"or",
"reset",
":",
"blacklist",
".",
"append",
"(",
"'learning_rate'",
")",
"if",
"reset",
":",
"blacklist",
".",
"append",
"(",
"'global_step'",
")",
"params",
"=",
"{",
"k",
":",
"kwargs",
".",
"get",
"(",
"k",
")",
"for",
"k",
"in",
"(",
"'variable_mapping'",
",",
"'reverse_mapping'",
")",
"}",
"if",
"checkpoints",
"and",
"len",
"(",
"self",
".",
"models",
")",
">",
"1",
":",
"assert",
"len",
"(",
"self",
".",
"models",
")",
"==",
"len",
"(",
"checkpoints",
")",
"for",
"i",
",",
"checkpoint",
"in",
"enumerate",
"(",
"checkpoints",
",",
"1",
")",
":",
"load_checkpoint",
"(",
"sess",
",",
"None",
",",
"checkpoint",
",",
"blacklist",
"=",
"blacklist",
",",
"whitelist",
"=",
"whitelist",
",",
"prefix",
"=",
"'model_{}'",
".",
"format",
"(",
"i",
")",
",",
"*",
"*",
"params",
")",
"elif",
"checkpoints",
":",
"# load partial checkpoints",
"for",
"checkpoint",
"in",
"checkpoints",
":",
"# checkpoint files to load",
"load_checkpoint",
"(",
"sess",
",",
"None",
",",
"checkpoint",
",",
"blacklist",
"=",
"blacklist",
",",
"whitelist",
"=",
"whitelist",
",",
"*",
"*",
"params",
")",
"elif",
"not",
"reset",
":",
"load_checkpoint",
"(",
"sess",
",",
"self",
".",
"checkpoint_dir",
",",
"blacklist",
"=",
"blacklist",
",",
"whitelist",
"=",
"whitelist",
",",
"*",
"*",
"params",
")",
"utils",
".",
"debug",
"(",
"'global step: {}'",
".",
"format",
"(",
"self",
".",
"global_step",
".",
"eval",
"(",
")",
")",
")",
"utils",
".",
"debug",
"(",
"'baseline step: {}'",
".",
"format",
"(",
"self",
".",
"baseline_step",
".",
"eval",
"(",
")",
")",
")"
] | [
651,
4
] | [
725,
74
] | python | en | ['en', 'error', 'th'] | False |
swatches_cyclical | (template=None) |
Parameters
----------
template : str or dict or plotly.graph_objects.layout.Template instance
The figure template name or definition.
Returns
-------
fig : graph_objects.Figure containing the displayed image
A `Figure` object. This figure demonstrates the color scales and
sequences in this module, as polar bar charts.
|
Parameters
----------
template : str or dict or plotly.graph_objects.layout.Template instance
The figure template name or definition. | def swatches_cyclical(template=None):
"""
Parameters
----------
template : str or dict or plotly.graph_objects.layout.Template instance
The figure template name or definition.
Returns
-------
fig : graph_objects.Figure containing the displayed image
A `Figure` object. This figure demonstrates the color scales and
sequences in this module, as polar bar charts.
"""
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from plotly.express._core import apply_default_cascade
args = dict(template=template)
apply_default_cascade(args)
rows = 2
cols = 4
scales = ["Twilight", "IceFire", "Edge", "Phase", "HSV", "mrybm", "mygbm"]
fig = make_subplots(
rows=rows,
cols=cols,
subplot_titles=scales,
specs=[[{"type": "polar"}] * cols] * rows,
)
for i, scale in enumerate(scales):
fig.add_trace(
go.Barpolar(
r=[1] * int(360 / 5),
theta=list(range(0, 360, 5)),
marker_color=list(range(0, 360, 5)),
marker_cmin=0,
marker_cmax=360,
marker_colorscale=scale,
name=scale,
),
row=int(i / cols) + 1,
col=i % cols + 1,
)
fig.update_traces(width=5.2, marker_line_width=0, base=0.5, showlegend=False)
fig.update_polars(angularaxis_visible=False, radialaxis_visible=False)
fig.update_layout(title="plotly.colors.cyclical", template=args["template"])
return fig | [
"def",
"swatches_cyclical",
"(",
"template",
"=",
"None",
")",
":",
"import",
"plotly",
".",
"graph_objects",
"as",
"go",
"from",
"plotly",
".",
"subplots",
"import",
"make_subplots",
"from",
"plotly",
".",
"express",
".",
"_core",
"import",
"apply_default_cascade",
"args",
"=",
"dict",
"(",
"template",
"=",
"template",
")",
"apply_default_cascade",
"(",
"args",
")",
"rows",
"=",
"2",
"cols",
"=",
"4",
"scales",
"=",
"[",
"\"Twilight\"",
",",
"\"IceFire\"",
",",
"\"Edge\"",
",",
"\"Phase\"",
",",
"\"HSV\"",
",",
"\"mrybm\"",
",",
"\"mygbm\"",
"]",
"fig",
"=",
"make_subplots",
"(",
"rows",
"=",
"rows",
",",
"cols",
"=",
"cols",
",",
"subplot_titles",
"=",
"scales",
",",
"specs",
"=",
"[",
"[",
"{",
"\"type\"",
":",
"\"polar\"",
"}",
"]",
"*",
"cols",
"]",
"*",
"rows",
",",
")",
"for",
"i",
",",
"scale",
"in",
"enumerate",
"(",
"scales",
")",
":",
"fig",
".",
"add_trace",
"(",
"go",
".",
"Barpolar",
"(",
"r",
"=",
"[",
"1",
"]",
"*",
"int",
"(",
"360",
"/",
"5",
")",
",",
"theta",
"=",
"list",
"(",
"range",
"(",
"0",
",",
"360",
",",
"5",
")",
")",
",",
"marker_color",
"=",
"list",
"(",
"range",
"(",
"0",
",",
"360",
",",
"5",
")",
")",
",",
"marker_cmin",
"=",
"0",
",",
"marker_cmax",
"=",
"360",
",",
"marker_colorscale",
"=",
"scale",
",",
"name",
"=",
"scale",
",",
")",
",",
"row",
"=",
"int",
"(",
"i",
"/",
"cols",
")",
"+",
"1",
",",
"col",
"=",
"i",
"%",
"cols",
"+",
"1",
",",
")",
"fig",
".",
"update_traces",
"(",
"width",
"=",
"5.2",
",",
"marker_line_width",
"=",
"0",
",",
"base",
"=",
"0.5",
",",
"showlegend",
"=",
"False",
")",
"fig",
".",
"update_polars",
"(",
"angularaxis_visible",
"=",
"False",
",",
"radialaxis_visible",
"=",
"False",
")",
"fig",
".",
"update_layout",
"(",
"title",
"=",
"\"plotly.colors.cyclical\"",
",",
"template",
"=",
"args",
"[",
"\"template\"",
"]",
")",
"return",
"fig"
] | [
16,
0
] | [
63,
14
] | python | en | ['en', 'error', 'th'] | False |
Gradient.color | (self) |
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
The 'color' 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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
The 'color' 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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above | def color(self):
"""
Sets the final color of the gradient fill: the center color for
radial, the right for horizontal, or the bottom for vertical.
The 'color' 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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
67,
28
] | python | en | ['en', 'error', 'th'] | False |
Gradient.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\"",
"]"
] | [
76,
4
] | [
87,
31
] | python | en | ['en', 'error', 'th'] | False |
Gradient.type | (self) |
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
|
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensional numpy array of the above | def type(self):
"""
Sets the type of gradient used to fill the markers
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radial', 'horizontal', 'vertical', 'none']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["type"] | [
"def",
"type",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"type\"",
"]"
] | [
96,
4
] | [
109,
27
] | python | en | ['en', 'error', 'th'] | False |
Gradient.typesrc | (self) |
Sets the source reference on Chart Studio Cloud for type .
The 'typesrc' 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 type .
The 'typesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def typesrc(self):
"""
Sets the source reference on Chart Studio Cloud for type .
The 'typesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["typesrc"] | [
"def",
"typesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"typesrc\"",
"]"
] | [
118,
4
] | [
129,
30
] | python | en | ['en', 'error', 'th'] | False |
Gradient.__init__ | (
self, arg=None, color=None, colorsrc=None, type=None, typesrc=None, **kwargs
) |
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatterternary
.marker.Gradient`
color
Sets the final color of the gradient fill: the center
color for radial, the right for horizontal, or the
bottom for vertical.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
type
Sets the type of gradient used to fill the markers
typesrc
Sets the source reference on Chart Studio Cloud for
type .
Returns
-------
Gradient
|
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatterternary
.marker.Gradient`
color
Sets the final color of the gradient fill: the center
color for radial, the right for horizontal, or the
bottom for vertical.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
type
Sets the type of gradient used to fill the markers
typesrc
Sets the source reference on Chart Studio Cloud for
type . | def __init__(
self, arg=None, color=None, colorsrc=None, type=None, typesrc=None, **kwargs
):
"""
Construct a new Gradient object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatterternary
.marker.Gradient`
color
Sets the final color of the gradient fill: the center
color for radial, the right for horizontal, or the
bottom for vertical.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
type
Sets the type of gradient used to fill the markers
typesrc
Sets the source reference on Chart Studio Cloud for
type .
Returns
-------
Gradient
"""
super(Gradient, self).__init__("gradient")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scatterternary.marker.Gradient
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scatterternary.marker.Gradient`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("colorsrc", None)
_v = colorsrc if colorsrc is not None else _v
if _v is not None:
self["colorsrc"] = _v
_v = arg.pop("type", None)
_v = type if type is not None else _v
if _v is not None:
self["type"] = _v
_v = arg.pop("typesrc", None)
_v = typesrc if typesrc is not None else _v
if _v is not None:
self["typesrc"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"type",
"=",
"None",
",",
"typesrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Gradient",
",",
"self",
")",
".",
"__init__",
"(",
"\"gradient\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scatterternary.marker.Gradient \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scatterternary.marker.Gradient`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorsrc\"",
",",
"None",
")",
"_v",
"=",
"colorsrc",
"if",
"colorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"type\"",
",",
"None",
")",
"_v",
"=",
"type",
"if",
"type",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"type\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"typesrc\"",
",",
"None",
")",
"_v",
"=",
"typesrc",
"if",
"typesrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"typesrc\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
154,
4
] | [
235,
34
] | python | en | ['en', 'error', 'th'] | False |
BallQuery.forward | (ctx, min_radius: float, max_radius: float, sample_num: int,
xyz: torch.Tensor, center_xyz: torch.Tensor) | forward.
Args:
min_radius (float): minimum radius of the balls.
max_radius (float): maximum radius of the balls.
sample_num (int): maximum number of features in the balls.
xyz (Tensor): (B, N, 3) xyz coordinates of the features.
center_xyz (Tensor): (B, npoint, 3) centers of the ball query.
Returns:
Tensor: (B, npoint, nsample) tensor with the indicies of
the features that form the query balls.
| forward. | def forward(ctx, min_radius: float, max_radius: float, sample_num: int,
xyz: torch.Tensor, center_xyz: torch.Tensor) -> torch.Tensor:
"""forward.
Args:
min_radius (float): minimum radius of the balls.
max_radius (float): maximum radius of the balls.
sample_num (int): maximum number of features in the balls.
xyz (Tensor): (B, N, 3) xyz coordinates of the features.
center_xyz (Tensor): (B, npoint, 3) centers of the ball query.
Returns:
Tensor: (B, npoint, nsample) tensor with the indicies of
the features that form the query balls.
"""
assert center_xyz.is_contiguous()
assert xyz.is_contiguous()
assert min_radius < max_radius
B, N, _ = xyz.size()
npoint = center_xyz.size(1)
idx = torch.cuda.IntTensor(B, npoint, sample_num).zero_()
ball_query_ext.ball_query_wrapper(B, N, npoint, min_radius, max_radius,
sample_num, center_xyz, xyz, idx)
ctx.mark_non_differentiable(idx)
return idx | [
"def",
"forward",
"(",
"ctx",
",",
"min_radius",
":",
"float",
",",
"max_radius",
":",
"float",
",",
"sample_num",
":",
"int",
",",
"xyz",
":",
"torch",
".",
"Tensor",
",",
"center_xyz",
":",
"torch",
".",
"Tensor",
")",
"->",
"torch",
".",
"Tensor",
":",
"assert",
"center_xyz",
".",
"is_contiguous",
"(",
")",
"assert",
"xyz",
".",
"is_contiguous",
"(",
")",
"assert",
"min_radius",
"<",
"max_radius",
"B",
",",
"N",
",",
"_",
"=",
"xyz",
".",
"size",
"(",
")",
"npoint",
"=",
"center_xyz",
".",
"size",
"(",
"1",
")",
"idx",
"=",
"torch",
".",
"cuda",
".",
"IntTensor",
"(",
"B",
",",
"npoint",
",",
"sample_num",
")",
".",
"zero_",
"(",
")",
"ball_query_ext",
".",
"ball_query_wrapper",
"(",
"B",
",",
"N",
",",
"npoint",
",",
"min_radius",
",",
"max_radius",
",",
"sample_num",
",",
"center_xyz",
",",
"xyz",
",",
"idx",
")",
"ctx",
".",
"mark_non_differentiable",
"(",
"idx",
")",
"return",
"idx"
] | [
13,
4
] | [
39,
18
] | python | en | ['en', 'cy', 'en'] | False |
_createServer | (host, port) |
Create async server that listens host:port, reads client request and puts
value to some future that can be used then for checks
:return: reference to server and future for request
|
Create async server that listens host:port, reads client request and puts
value to some future that can be used then for checks | async def _createServer(host, port):
"""
Create async server that listens host:port, reads client request and puts
value to some future that can be used then for checks
:return: reference to server and future for request
"""
indicator = asyncio.Future()
async def _handle(reader, writer):
raw = await reader.readline()
request = raw.decode("utf-8")
indicator.set_result(request)
server = await asyncio.start_server(_handle, host, port)
return server, indicator | [
"async",
"def",
"_createServer",
"(",
"host",
",",
"port",
")",
":",
"indicator",
"=",
"asyncio",
".",
"Future",
"(",
")",
"async",
"def",
"_handle",
"(",
"reader",
",",
"writer",
")",
":",
"raw",
"=",
"await",
"reader",
".",
"readline",
"(",
")",
"request",
"=",
"raw",
".",
"decode",
"(",
"\"utf-8\"",
")",
"indicator",
".",
"set_result",
"(",
"request",
")",
"server",
"=",
"await",
"asyncio",
".",
"start_server",
"(",
"_handle",
",",
"host",
",",
"port",
")",
"return",
"server",
",",
"indicator"
] | [
11,
0
] | [
25,
28
] | python | en | ['en', 'error', 'th'] | False |
_checkFuture | (future) |
Wrapper for futures that lets checking of their status using 'eventually'
|
Wrapper for futures that lets checking of their status using 'eventually'
| def _checkFuture(future):
"""
Wrapper for futures that lets checking of their status using 'eventually'
"""
def _check():
if future.cancelled():
return None
if future.done():
return future.result()
raise Exception()
return _check | [
"def",
"_checkFuture",
"(",
"future",
")",
":",
"def",
"_check",
"(",
")",
":",
"if",
"future",
".",
"cancelled",
"(",
")",
":",
"return",
"None",
"if",
"future",
".",
"done",
"(",
")",
":",
"return",
"future",
".",
"result",
"(",
")",
"raise",
"Exception",
"(",
")",
"return",
"_check"
] | [
35,
0
] | [
45,
17
] | python | en | ['en', 'error', 'th'] | False |
testScheduleNodeUpgrade | (tconf, nodeSet) |
Tests that upgrade scheduling works. For that it starts mock
control service, schedules upgrade for near future and then checks that
service received notification.
|
Tests that upgrade scheduling works. For that it starts mock
control service, schedules upgrade for near future and then checks that
service received notification.
| def testScheduleNodeUpgrade(tconf, nodeSet):
"""
Tests that upgrade scheduling works. For that it starts mock
control service, schedules upgrade for near future and then checks that
service received notification.
"""
loop = asyncio.get_event_loop()
server, indicator = loop.run_until_complete(
_createServer(
host=tconf.controlServiceHost,
port=tconf.controlServicePort
)
)
indicator.add_done_callback(_stopServer(server))
node = nodeSet[0]
# ATTENTION! nodeId and ledger must not be None, but there
# we do not call methods that use them, so we can pass None
# We do it because node from nodeSet is some testable object, not real
# node, so it has no nodeId and ledger that we can use
upgrader = Upgrader(nodeId=None,
nodeName=None,
dataDir=node.dataLocation,
config=tconf,
ledger=None)
version = bumpedVersion()
ev_data = UpgradeLogData(
datetime.utcnow(), version, 'some_id', tconf.UPGRADE_ENTRY)
upgrader._callUpgradeAgent(ev_data, 1000)
result = loop.run_until_complete(eventuallySoon(_checkFuture(indicator)))
expectedResult = UpgradeMessage(version, tconf.UPGRADE_ENTRY)
assert result == expectedResult.toJson() | [
"def",
"testScheduleNodeUpgrade",
"(",
"tconf",
",",
"nodeSet",
")",
":",
"loop",
"=",
"asyncio",
".",
"get_event_loop",
"(",
")",
"server",
",",
"indicator",
"=",
"loop",
".",
"run_until_complete",
"(",
"_createServer",
"(",
"host",
"=",
"tconf",
".",
"controlServiceHost",
",",
"port",
"=",
"tconf",
".",
"controlServicePort",
")",
")",
"indicator",
".",
"add_done_callback",
"(",
"_stopServer",
"(",
"server",
")",
")",
"node",
"=",
"nodeSet",
"[",
"0",
"]",
"# ATTENTION! nodeId and ledger must not be None, but there",
"# we do not call methods that use them, so we can pass None",
"# We do it because node from nodeSet is some testable object, not real",
"# node, so it has no nodeId and ledger that we can use",
"upgrader",
"=",
"Upgrader",
"(",
"nodeId",
"=",
"None",
",",
"nodeName",
"=",
"None",
",",
"dataDir",
"=",
"node",
".",
"dataLocation",
",",
"config",
"=",
"tconf",
",",
"ledger",
"=",
"None",
")",
"version",
"=",
"bumpedVersion",
"(",
")",
"ev_data",
"=",
"UpgradeLogData",
"(",
"datetime",
".",
"utcnow",
"(",
")",
",",
"version",
",",
"'some_id'",
",",
"tconf",
".",
"UPGRADE_ENTRY",
")",
"upgrader",
".",
"_callUpgradeAgent",
"(",
"ev_data",
",",
"1000",
")",
"result",
"=",
"loop",
".",
"run_until_complete",
"(",
"eventuallySoon",
"(",
"_checkFuture",
"(",
"indicator",
")",
")",
")",
"expectedResult",
"=",
"UpgradeMessage",
"(",
"version",
",",
"tconf",
".",
"UPGRADE_ENTRY",
")",
"assert",
"result",
"==",
"expectedResult",
".",
"toJson",
"(",
")"
] | [
48,
0
] | [
81,
44
] | python | en | ['en', 'error', 'th'] | False |
Line.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
default palette will be chosen according to whether numbers in
the `color` array are all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
default palette will be chosen according to whether numbers in
the `color` array are all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False) | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.line.colorscale`. Has an effect only if in
`marker.line.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is true, the
default palette will be chosen according to whether numbers in
the `color` array are all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["autocolorscale"] | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
28,
4
] | [
45,
37
] | python | en | ['en', 'error', 'th'] | False |
Line.cauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `marker.line.cmin` and
`marker.line.cmax` are set by the user.
The 'cauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `marker.line.cmin` and
`marker.line.cmax` are set by the user.
The 'cauto' property must be specified as a bool
(either True, or False) | def cauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.line.color`) or the
bounds set in `marker.line.cmin` and `marker.line.cmax` Has an
effect only if in `marker.line.color`is set to a numerical
array. Defaults to `false` when `marker.line.cmin` and
`marker.line.cmax` are set by the user.
The 'cauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["cauto"] | [
"def",
"cauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cauto\"",
"]"
] | [
54,
4
] | [
70,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.cmax | (self) |
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float | def cmax(self):
"""
Sets the upper bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmin` must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmax"] | [
"def",
"cmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmax\"",
"]"
] | [
79,
4
] | [
93,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmid | (self) |
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when `marker.line.cauto`
is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when `marker.line.cauto`
is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float | def cmid(self):
"""
Sets the mid-point of the color domain by scaling
`marker.line.cmin` and/or `marker.line.cmax` to be equidistant
to this point. Has an effect only if in `marker.line.color`is
set to a numerical array. Value should have the same units as
in `marker.line.color`. Has no effect when `marker.line.cauto`
is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmid"] | [
"def",
"cmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmid\"",
"]"
] | [
102,
4
] | [
118,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.cmin | (self) |
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float | def cmin(self):
"""
Sets the lower bound of the color domain. Has an effect only if
in `marker.line.color`is set to a numerical array. Value should
have the same units as in `marker.line.color` and if set,
`marker.line.cmax` must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmin"] | [
"def",
"cmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmin\"",
"]"
] | [
127,
4
] | [
141,
27
] | 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 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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A number that will be interpreted as a color
according to barpolar.marker.line.colorscale
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
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 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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A number that will be interpreted as a color
according to barpolar.marker.line.colorscale
- A list or array of any of the above | 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' 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%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A number that will be interpreted as a color
according to barpolar.marker.line.colorscale
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
150,
4
] | [
206,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.coloraxis | (self) |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
|
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.) | def coloraxis(self):
"""
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
"""
return self["coloraxis"] | [
"def",
"coloraxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"coloraxis\"",
"]"
] | [
215,
4
] | [
233,
32
] | python | en | ['en', 'error', 'th'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.