Gets the actual object from a decorated or wrapped function
        @obj: (#object) the object to unwrap
428227
def unwrap_obj(obj):
    
    try:
        obj = obj.fget
    except (AttributeError, TypeError):
        pass
    try:
        # Cached properties
        if obj.func.__doc__ == obj.__doc__:
            obj = obj.func
    except AttributeError:
        pass
    try:
        # Setter/Getters
        obj = obj.getter
    except AttributeError:
        pass
    try:
        # Wrapped Funcs
        obj = inspect.unwrap(obj)
    except:
        pass
    return obj
751596
def get_object(objref, data=None, return_fields=None, max_results=None,
               ensure_none_or_one_result=False, **api_opts):
    '''
    
    '''
    if not data:
        data = {}
    infoblox = _get_infoblox(**api_opts)
    return infoblox.get_object(objref, data, return_fields,
                               max_results, ensure_none_or_one_result)
1180296
def get_object(self):
        """"""

        from ..util import AttrDict

        c = self.record.unpacked_contents

        if not c:
            c = yaml.safe_load(self.default)

        return AttrDict(c)
179110
def results_decorator(func):
    
    # Wrap function to maintian the original doc string, etc
    @wraps(func)
    def decorator(lookup_cls):
        # Construct a class decorator from the original function
        original = lookup_cls.results
        def inner(self, request):
            # Wrap lookup_cls.results by first calling func and checking the result
            result = func(request)
            if isinstance(result, HttpResponse):
                return result
            return original(self, request)
        # Replace original lookup_cls.results with wrapped version
        lookup_cls.results = inner
        return lookup_cls
    # Return the constructed decorator
    return decorator
813285
def undecorated(o):
    """"""
    # class decorator
    if type(o) is type:
        return o

    try:
        # python2
        closure = o.func_closure
    except AttributeError:
        pass

    try:
        # python3
        closure = o.__closure__
    except AttributeError:
        return

    if closure:
        for cell in closure:
            # avoid infinite recursion
            if cell.cell_contents is o:
                continue

            # check if the contents looks like a decorator; in that case
            # we need to go one level down into the dream, otherwise it
            # might just be a different closed-over variable, which we
            # can ignore.

            # Note: this favors supporting decorators defined without
            # @wraps to the detriment of function/method/class closures
            if looks_like_a_decorator(cell.cell_contents):
                undecd = undecorated(cell.cell_contents)
                if undecd:
                    return undecd
        else:
            return o
    else:
        return o
1180545
def unlocked(func_or_obj):
    
    if ismethod(func_or_obj) or isfunction(func_or_obj):
        return _unlocked_method(func_or_obj)
    else:
        return _UnlockedAttribute(func_or_obj)
441079
function () {
    var obj = {}, value;

    var keys = Object.keys(this);

    for (var i = 0, n = keys.length; i < n; i++) {
      var key = keys[i];
      if (key.substr(0, 2) === "__") continue;
      value = this[key];

      if(value && value.__isBindable) {
        value = value.toJSON();
      }

      obj[key] = value;
    }

    return obj;
  }
1313528
def get_object_handle(self, obj):
        
        if obj not in self._object_handles:
            self._object_handles[obj] = self._get_object_handle(obj=obj)

        return self._object_handles[obj]
389842
function getPatchedObject (obj, patcher, clone = true) {
  if (!patcher) {
    return obj
  }
  let newObj, newPatcher
  if (clone) {
    newObj = getDeepCopiedObject(obj)
    newPatcher = getDeepCopiedObject(patcher)
  } else {
    newObj = obj
    newPatcher = patcher
  }
  // patch
  const keys = Object.keys(newPatcher)
  for (let i = 0; i < keys.length; i++) {
    const key = keys[i]
    if ((key in newObj) && isRealObject(newObj[key]) && isRealObject(newPatcher[key])) {
      // recursive patch for if value type is newObject
      try {
        newObj[key] = getPatchedObject(newObj[key], newPatcher[key], false)
      } catch (error) {
      // do nothing, just skip
      }
    } else {
      // simple replacement if value type is not newObject
      newObj[key] = newPatcher[key]
    }
  }
  return newObj
}
1111552
def extract_view(view, decorators=None):
    
    # http://stackoverflow.com/questions/9222129/python-inspect-getmembers-does-not-return-the-actual-function-when-used-with-dec
    if decorators is None:
        decorators = []
    if getattr(view, 'func_closure', None) is not None:
        decorators.append(view)
        for closure in view.func_closure:
            if callable(closure.cell_contents):
                return extract_view(closure.cell_contents, decorators)
    if inspect.isfunction(view) or inspect.ismethod(view):
        pass
    elif inspect.isclass(view):
        pass
    else:
        view = view.__class__
    return view, decorators
484032
function objectToFunction(obj) {
  var fns = Object.keys(obj)
    .map(function (key) {
      return toBoolFunction(key, obj[key]);
    });
  return function(o){
    for (var i = 0; i < fns.length; i++) {
      if (!fns[i](o)) return false;
    }
    return true;
  }
}
1159213
function wrap(method) {
            return function() {
                // cast any arguments into an array, since they're
                // natively objects
                var args = Array.prototype.slice.apply(arguments);
                // make the first argument the array itself
                args.unshift(this);
                // return the result of the ss method
                return ss[method].apply(ss, args);
            };
        }
1125260
private static Object unwrap(Object object) {
        if (object instanceof Reflector) {
            return ((Reflector) object).get();
        }

        return object;
    }
1236286
def _unwrap_func(cls, decorated_func):
        '''
        
        '''
        if click is not None:
            # Workaround for click.command() decorator not setting
            # __wrapped__
            if isinstance(decorated_func, click.Command):
                return cls._unwrap_func(decorated_func.callback)

        if hasattr(decorated_func, '__wrapped__'):
            # Recursion: unwrap more if needed
            return cls._unwrap_func(decorated_func.__wrapped__)
        else:
            # decorated_func isn't actually decorated, no more
            # unwrapping to do
            return decorated_func
590981
def get_object(self, name, obj):
        
        return self[name](obj, **self.opts(name))
859725
function wrapGetterFn(_ref) {
        var _ref2 = slicedToArray(_ref, 2),
            key = _ref2[0],
            originalFn = _ref2[1];

        var newFn = function newFn() {
            var innerFn = originalFn.apply(this, arguments);

            if (typeof innerFn !== 'function') {
                /* istanbul ignore next */
                throw 'The getter ' + key + ' does not return a function. Try using the \'mapGetter\' helper instead';
            }

            return innerFn(this.id);
        };

        return [key, newFn];
    }
1173378
def _get_object(objname, objtype):
    '''
    
    '''
    ret = None
    if objname is None:
        return ret

    if isinstance(objname, string_types):
        if objname in __opts__:
            ret = __opts__[objname]
        master_opts = __pillar__.get('master', {})
        if objname in master_opts:
            ret = master_opts[objname]
        if objname in __pillar__:
            ret = __pillar__[objname]
    elif isinstance(objname, objtype):
        ret = objname

    if not isinstance(ret, objtype):
        ret = None

    return ret