code: def assign(
      target, objs, deepcopy=False, reserved=False, predicate=None
  ):
      """
      Copies (shallow) all the instance properties from objs to obj.
      The last property added takes precedence over the previous ones.
      For example, when applying ``assign(obj, ext1, ext2)``:
      if all `obj`, `ext1` and `ext2` contain the property `prop` then the final object will be assigned `prop` from `ext2`.
      :param target: the instance that will receive the properties from others.
      :param objs: the instances whose properties will be added to the first instance.
      :param deepcopy: True if the added properties should be deep copied (default: False).
      :param reserved: True if reserved properties (e.g. __dict__, __doc__, ...) should also be assigned (default: False).
      :param predicate: function fn(key, value) returning True for the properties that should be assigned.
          If None (default), then all are assigned.
      :return: the modified instance `obj`.
      """
      _filter = (
          (
              lambda k, v: not _is_reserved_name(k)
              and (predicate is None or predicate(k, v))
          )
          if not reserved
          else predicate
      )
      objs = filter(
          None, objs if isinstance(objs, (list, tuple)) else [objs]
      )
      for o in objs:
          props = vars(o)
          if _filter:
              props = {k: v for k, v in props.items() if _filter(k, v)}
          if deepcopy:
              props = copy.deepcopy(props)
          for k, v in props.items():
              setattr(target, k, v)
      return target
  
file_path: h2o-3/h2o-py/h2o/utils/mixin.py
imports: import copy
  from importlib import import_module
  import sys
  import types
label_desc: Use image node_id 6 for calling a global function with example usage: assign(target, objs, deepcopy, reserved, predicate) and returns: target