Returns:
        wrapped_obj, was_scalar
181558
def wrap_iterable(obj):
    
    was_scalar = not isiterable(obj)
    wrapped_obj = [obj] if was_scalar else obj
    return wrapped_obj, was_scalar
823877
def as_ppmodel(cls, obj):
        
        if isinstance(obj, cls):
            return obj

        # obj is a string
        if ":" not in obj:
            mode, plasmon_freq = obj, None
        else:
            # Extract mode and plasmon_freq
            mode, plasmon_freq = obj.split(":")
            try:
                plasmon_freq = float(plasmon_freq)
            except ValueError:
                plasmon_freq, unit = plasmon_freq.split()
                plasmon_freq = units.Energy(float(plasmon_freq), unit).to("Ha")

        return cls(mode=mode, plasmon_freq=plasmon_freq)
1262816
def is_nested_object(obj):
    

    if isinstance(obj, ABCSeries) and is_object_dtype(obj):

        if any(isinstance(v, ABCSeries) for v in obj.values):
            return True

    return False
654284
def _get_object(class_, obj):
        
        if isinstance(obj, list):
            return [Serializable._get_object(class_, i) for i in obj]
        elif isinstance(obj, dict):
            return class_(**keys_to_snake_case(obj))
        else:
            return obj
1002545
def check_scalar(self, scalar_dict):
        
        table = {k: np.array([v]) for k, v in scalar_dict.items()}
        return self.mask(table)[0]
1056254
def _find_scalar_parameter(expr):
    
    op = expr.op()

    if isinstance(op, ops.ScalarParameter):
        result = op, expr.get_name()
    else:
        result = None
    return lin.proceed, result
919585
def as_ompenv(cls, obj):
        """"""
        if isinstance(obj, cls): return obj
        if obj is None: return cls()
        return cls(**obj)
240195
def obj(extract=None, child_transform=None, transform=None):
  """"""
  return lambda source: get_obj(source, extract, child_transform, transform)
1047448
def _conj(self, f):
        """"""
        def f_conj(x, **kwargs):
            result = np.asarray(f(x, **kwargs),
                                dtype=self.scalar_out_dtype)
            return result.conj()

        if is_real_dtype(self.out_dtype):
            return f
        else:
            return self.element(f_conj)
514134
def _obj_getattr(obj, fqdn, start=1):
    
    node = obj
    for chain in fqdn.split('.')[start:]:
        if hasattr(node, chain):
            node = getattr(node, chain)
        else:
            node = None
            break
    return node
601513
def eval_objfn(self):
        

        dfd = self.obfn_dfd()
        prj = sp.proj_l1(self.obfn_gvar(), self.gamma, axis=0)
        cns = np.linalg.norm(prj - self.obfn_gvar())
        return (dfd, cns)
125170
def isseq(obj):
  '''
  
  '''
  return \
    not isstr(obj) \
    and not isdict(obj) \
    and ( isinstance(obj, (list, tuple)) \
          or callable(getattr(obj, '__iter__', None)))
782459
def flatten(self, shallow=None):
        
        return self._wrap(self._flatten(self.obj, shallow))
776152
def _capture_original_object(self):
        """"""
        try:
            self._doubles_target = getattr(self.target, self._name)
        except AttributeError:
            raise VerifyingDoubleError(self.target, self._name)
680294
def isvector_or_scalar(a):
    
    try:
        return a.size and a.ndim-a.shape.count(1) <= 1
    except:
        return False
899572
def _vector_or_scalar(x, type='row'):
    """"""
    if isinstance(x, (list, tuple)):
        x = np.array(x)
    if isinstance(x, np.ndarray):
        assert x.ndim == 1
        if type == 'column':
            x = x[:, None]
    return x
1037087
def is_unwrapped(f):
    """"""
    try:
        g = look_up(object_name(f))
        return g != f and unwrap(g) == f

    except (AttributeError, TypeError, ImportError):
        return False