/*
mixin( key, val )
mixin( obj )
- key (String): The method name
- val (Function): The function to assign
- obj (Object): object with many `key: fn` pairs

Apply mixin methods to decorator base.
357108
function mixin( key, val ){

        if ( typeof key === 'object' ){
            proto = extend(proto, key);
            proto.type = type;
            return;
        }

        if ( key !== 'type' && Physics.util.isFunction( val ) ){
            proto[ key ] = val;
        }
    }
569988
function(obj) {
    _.forEach(obj, function(val, key) {
      if (_.isString(val)) {
        if (Mixins.isObjectId(val)) {
          obj[key] = Mixins.newObjectId(val);
        } else if (Mixins.isValidISO8601String(val)) {
          obj[key] = new Date(val);
        }
      } else if (_.isDate(val)) {
        obj[key] = val;
      } else if (_.isObject(val)) {
        if (val['$oid']) {
          obj[key] = val['$oid'];
        } else {
          obj[key] = this.cast(val);
        }
      }
    }.bind(this));

    return obj;
  }
245397
function alias (obj, method) {
  switch (type(method)) {
    case 'object': return aliasByDictionary(clone(obj), method);
    case 'function': return aliasByFunction(clone(obj), method);
  }
}
713402
function(name, observable, oneTime) {
      var property = this.propertyForAttribute(name);
      if (!property) {
        // TODO(sjmiles): this mixin method must use the special form
        // of `super` installed by `mixinMethod` in declaration/prototype.js
        return this.mixinSuper(arguments);
      } else {
        // use n-way Polymer binding
        var observer = this.bindProperty(property, observable, oneTime);
        // NOTE: reflecting binding information is typically required only for
        // tooling. It has a performance cost so it's opt-in in Node.bind.
        if (Platform.enableBindingsReflection && observer) {
          observer.path = observable.path_;
          this._recordBinding(property, observer);
        }
        if (this.reflect[property]) {
          this.reflectPropertyToAttribute(property);
        }
        return observer;
      }
    }
48672
function mixin$1(name, mix, g) {
  // Unnamed global
  if (isObject(name)) {
    mixin$1(("__" + (mixins_id++) + "__"), name, true);
    return
  }

  var store = g ? globals : mixins;

  // Getter
  if (!mix) {
    if (isUndefined(store[name]))
      { throw new Error(("Unregistered mixin: " + name)) }

    return store[name]
  }

  // Setter
  store[name] = isFunction(mix) ?
    extend(mix.prototype, store[name] || {}) && mix :
    extend(store[name] || {}, mix);
}
814114
function () {
        /*  remember information  */
        var obj = this;
        var clz = arguments.callee;
        var arg = arguments;

        /*  support also calls like "foo()" instead of "new foo()"  */
        if (!(obj instanceof clz))
            return new clz(); /* RECURSION */

        /*  initialize all mixin traits and this class (or trait)  */
        var init = function (obj, clz, arg, exec_cons) {
            /*  depth-first visit of parent class  */
            var extend = _cs.annotation(clz, "extend");
            if (extend !== null)
                arguments.callee(obj, extend, arg, false); /* RECURSION */

            /*  depth-first visit of mixin traits  */
            var mixin = _cs.annotation(clz, "mixin");
            if (mixin !== null)
                for (var i = 0; i < mixin.length; i++)
                    arguments.callee(obj, mixin[i], arg, true); /* RECURSION */

            /*  establish clones of all own dynamic fields  */
            var dynamics = _cs.annotation(clz, "dynamics");
            if (dynamics !== null) {
                for (var field in dynamics) {
                    if (_cs.isown(dynamics, field)) {
                        if (   _cs.istypeof(dynamics[field]) !== "null"
                            && _cs.istypeof(dynamics[field].clone) === "function")
                            obj[field] = dynamics[field].clone();
                        else
                            obj[field] = _cs.clone(dynamics[field]);
                    }
                }
            }

            /*  explicitly call optional constructor function
                NOTICE: a clazz gets supplied the original constructor
                parameters (we assume that it knows what to do with
                all or at least the N initial parameters as it is a
                real parent/base/super class) and has to call its own
                parent/base/super constructor itself via this.base(),
                but a trait intentionally gets no constructor parameters
                passed-through (as it cannot know where it gets mixed
                into, so it cannot know what to do with the parameters)  */
            if (exec_cons) {
                var cons = _cs.annotation(clz, "cons");
                if (cons !== null) {
                    if (_cs.istypeof(clz) === "clazz")
                        cons.apply(obj, arg);
                    else
                        cons.call(obj);
                }
            }
        };
        init(obj, clz, arg, true);

        return obj;
    }
381188
function() {
  var mix = {};
  [].forEach.call(arguments, function(arg) {
    for (var name in arg) {
      if (arg.hasOwnProperty(name)) {
        mix[name] = arg[name];
      }
    }
  });
  return mix;
}
1344186
def set_property(key, value):
    
    def decorate_func(func):
        setattr(func, key, value)
        if func.__doc__ and key == "fctype":
            func.__doc__ = func.__doc__ + "\n\n    *This function is of type: " + value + "*\n"
        return func
    return decorate_func
317826
def mix(self, cls):
        

        if hasattr(cls, 'unmixed_class'):
            base_class = cls.unmixed_class
            old_mixins = cls.__bases__[1:]  # Skip the original unmixed class
            mixins = old_mixins + tuple(
                mixin
                for mixin in self._mixins
                if mixin not in old_mixins
            )
        else:
            base_class = cls
            mixins = self._mixins

        mixin_key = (base_class, mixins)

        if mixin_key not in _CLASS_CACHE:
            # Only lock if we're about to make a new class
            with _CLASS_CACHE_LOCK:
                # Use setdefault so that if someone else has already
                # created a class before we got the lock, we don't
                # overwrite it
                return _CLASS_CACHE.setdefault(mixin_key, type(
                    base_class.__name__ + str('WithMixins'),  # type() requires native str
                    (base_class, ) + mixins,
                    {'unmixed_class': base_class}
                ))
        else:
            return _CLASS_CACHE[mixin_key]
93336
def key_assoc_val(d, func, exclude=None):
    
    vs = list(d.values())
    ks = list(d.keys())
    key = ks[vs.index(func(vs))]
    return key
1125829
function addTo(name) {
            var indexName = name,
                match = name.match(/^([^\(]*)\s*\(([^\)]*)\)\s*/),
                params = match && match[2];
            name = match && match[1] || name;

            if (!index[indexName]) {
                if (params) {
                    // there can be no function calls here because of the regex match
                    /*jshint evil: true */
                    params = eval('[' + params + ']');
                }
                var mixin = _mixins[name],
                    checkAgain = false,
                    skip = false;

                if (mixin) {
                    if (typeof mixin === 'function') {
                        if (_initiatedOnce[name]) {
                            if (!initiatedOnce[name]) {
                                initiatedOnce[name] = [];
                                // add the placeholder so the mixin ends up in the right place
                                // we will replace all names with the appropriate mixins at the end
                                // (so we have all of the appropriate arguments)
                                mixin = name;
                            } else {
                                // but we only want to add it a single time
                                skip = true;
                            }
                            if (params) {
                                initiatedOnce[name].push(params);
                            }
                        } else {
                            mixin = mixin.apply(this, params || []);
                            checkAgain = true;
                        }
                    } else if (params) {
                        throw new Error('the mixin "' + name + '" does not support parameters');
                    }
                    get(_dependsOn[name], index, initiatedOnce, rtn);
                    get(_dependsInjected[name], index, initiatedOnce, rtn);

                    index[indexName] = true;
                    if (checkAgain) {
                        get([mixin], index, initiatedOnce, rtn);
                    } else if (!skip) {
                        checkForInlineMixins(mixin, rtn);
                        rtn.push(mixin);
                    }

                } else {
                    throw new Error('invalid mixin "' + name + '"');
                }
            }
        }
306420
function wrapValue (val, type) {
  var basetype = type.type ? type.type : type;
  if(basetype == '@' || basetype == '#') return createObject(val, basetype);
  else if (basetype[0] == '@') return createObject(val, '@');
  else if (basetype == '@?') return createObject(createBlock(val, '@'));
  else if (basetype == '^?') return createUnwrapperFunction(val, type);
  else if (basetype == ':') return objc.sel_getName(val);
  else if (basetype == 'B') return val ? true : false;
  else if (basetype == 'c' && val === 1) return true;
  else if (basetype == 'c' && val === 0) return false;
  else return val;
}
325750
function mixin (target, source, options) {
        options = options || {};
        options.skip = options.skip || [];
        for (let key in source) {
            if (typeof source[key] === 'function' && key.indexOf('_') !== 0 && options.skip.indexOf(key) === -1) {
                target[key] = source[key].bind(source);
            }
        }
    }
1093955
function mixin(obj, props) {
    var argi = 1,
        argc = arguments.length,
        source, property, value;

    if (!obj) {
        obj = {};
    }

    while (argi < argc) {
        source = arguments[argi];
        for (property in source) {
            if (source.hasOwnProperty(property)) {
                value = source[property];
                if (obj[property] !== value) {
                    obj[property] = value;
                }
            }
        }
        argi += 1;
    }
    return obj; // Object
}
408635
function define(obj, key, val) {
  Reflect.defineProperty(obj, key, {
    configurable: true,
    enumerable: false,
    writeable: true,
    value: val
  });
}
126564
function() {
		if(this.init) { this.init.apply(this, arguments) }
		for (var i=0, mixin; mixin = mixins[i]; i++) {
			if (mixin.init) { mixin.init.apply(this) }
		}
	}
460438
function mixinConstructor(source)
{
  var keys = Object.keys(source)
    , i    = keys.length
    ;

  while (i-- > 0) {
    this[keys[i]] = source[keys[i]];
  }
}