MCPcopy Index your code
hub / github.com/PaddlePaddle/FastDeploy / pop

Method pop

fastdeploy/worker/input_batch.py:46–64  ·  view source on GitHub ↗

Pop an attribute, similar to dict's pop method Args: key: Name of the attribute to pop default: Default value to return if attribute does not exist Returns: Popped attribute value, or default if attribute doesn't exist and default is pro

(self, key, default=None)

Source from the content-addressed store, hash-verified

44 setattr(self, key, value)
45
46 def pop(self, key, default=None):
47 """
48 Pop an attribute, similar to dict's pop method
49
50 Args:
51 key: Name of the attribute to pop
52 default: Default value to return if attribute does not exist
53
54 Returns:
55 Popped attribute value, or default if attribute doesn't exist and default is provided
56 """
57 if hasattr(self, key):
58 value = getattr(self, key)
59 delattr(self, key)
60 return value
61 elif default is not None:
62 return default
63 else:
64 raise KeyError(f"'{key}' is not a valid attribute of InputBatch")
65
66 def __delitem__(self, key):
67 """

Callers 15

__init__Method · 0.80
read_model_configMethod · 0.80
_recycleMethod · 0.80
_recycleMethod · 0.80
readMethod · 0.80
loop_scheduleMethod · 0.80
runMethod · 0.80
calculate_logits_entropyFunction · 0.80
load_weightMethod · 0.80
load_state_dictMethod · 0.80
load_state_dictMethod · 0.80

Calls

no outgoing calls

Tested by 15

_check_expirationMethod · 0.64
rpopMethod · 0.64
brpopMethod · 0.64
deleteMethod · 0.64
_recycleMethod · 0.64
deleteMethod · 0.64
lpopMethod · 0.64
blpopMethod · 0.64
zremMethod · 0.64
temp_envFunction · 0.64
setUpMethod · 0.64