MCPcopy Index your code
hub / github.com/plotly/plotly.py / pop

Method pop

plotly/basedatatypes.py:935–964  ·  view source on GitHub ↗

Remove the value associated with the specified key and return it Parameters ---------- key: str Property name dflt The default value to return if key was not found in figure Returns ------- value T

(self, key, *args)

Source from the content-addressed store, hash-verified

933 return self
934
935 def pop(self, key, *args):
936 """
937 Remove the value associated with the specified key and return it
938
939 Parameters
940 ----------
941 key: str
942 Property name
943 dflt
944 The default value to return if key was not found in figure
945
946 Returns
947 -------
948 value
949 The removed value that was previously associated with key
950
951 Raises
952 ------
953 KeyError
954 If key is not in object and no dflt argument specified
955 """
956 # Handle default
957 if key not in self and args:
958 return args[0]
959 elif key in self:
960 val = self[key]
961 self[key] = None
962 return val
963 else:
964 raise KeyError(key)
965
966 # Data
967 # ----

Callers 15

make_subplotsFunction · 0.45
__init__Method · 0.45
decode_unicodeFunction · 0.45
__init__Method · 0.45
_set_inMethod · 0.45
__setitem__Method · 0.45
_set_propMethod · 0.45
_set_compound_propMethod · 0.45
_set_array_propMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected