MCPcopy
hub / github.com/zenml-io/zenml / add

Method add

src/zenml/utils/context_utils.py:115–125  ·  view source on GitHub ↗

Thread-safely add an item to the list. Args: item: The item to add to the list.

(self, item: T)

Source from the content-addressed store, hash-verified

113 return value if value is not None else []
114
115 def add(self, item: T) -> None:
116 """Thread-safely add an item to the list.
117
118 Args:
119 item: The item to add to the list.
120 """
121 with self._lock:
122 current_list = self.get()
123 if not any(x is item for x in current_list):
124 new_list = current_list + [item]
125 self._context_var.set(new_list)
126
127 def remove(self, item: T) -> None:
128 """Thread-safely remove an item from the list.

Callers 15

requirementsMethod · 0.80
createFieldFunction · 0.80
syncJsonToFormFunction · 0.80
setExpandedFunction · 0.80
attachEventListenersFunction · 0.80
build_dagFunction · 0.80
get_env_varsMethod · 0.80
bulk_log_metadataFunction · 0.80
parse_value_for_schemaFunction · 0.80
typing_utils.pyFile · 0.80

Calls 1

getMethod · 0.95