Duct tape to check if this is a sequelize DAOFactory
515062
function jsonReplacer(key, value) {
  if (value && (value.DAO || value.sequelize)) {
    return value.name || '';
  }
  return value;
}
350960
function (obj) {
        return Boolean(obj) && ((obj instanceof ItemGroup) ||
            _.inSuperChain(obj.constructor, '_postman_propertyName', ItemGroup._postman_propertyName));
    }
259289
function parseIncludes(field, fieldName, modelName, parent) {
		// check all attributes are strings and valid fields
		if (!field.attributes) {
			field.attributes = [];
		} else {
			if (!Array.isArray(field.attributes)) field.attributes = [field.attributes];

			_.forEach(field.attributes, function(attribute) {
				if (!_.isString(attribute)) throw new Sequelize.VirtualFieldsError("Attribute of virtual field '" + modelName + "'.'" + fieldName + "' is not a string");

				if (!parent.attributes[attribute]) throw new Sequelize.VirtualFieldsError("Attribute of virtual field '" + modelName + "'.'" + fieldName + "' refers to a nonexistent field '" + parent.name + "'.'" + attribute + "'");
			});
		}

		// format includes as {model: model, as: as} and convert strings to models
		if (field.include) {
			if (!Array.isArray(field.include)) field.include = [field.include];

			_.forEach(field.include, function(include, index) {
				include = parseClause(field.include, index, 'Include', modelName, fieldName, parent);

				parseIncludes(include, fieldName, modelName, include.model);
			});
		}
	}
19127
function wrapReturn(trace, clientState, hooks, rules){
  if (util.isFunction(trace.ret) && !trace.ret.__concurix_blacklisted) {
    wrapFunctions(trace.moduleName, trace.ret, -1, hooks, clientState, rules );
    trace.ret = wrap(trace.ret)
          .before(hooks.beforeHook)
          .after(hooks.afterHook)
          .state(clientState)
          .nameIfNeeded(trace.moduleName)
          .module(trace.moduleName)
          .getProxy();
  } else {
    wrapFunctions(trace.moduleName, trace.ret, -1, hooks, clientState, rules );
  }
}
669595
function makerelation (model, relation) {
	let options = {
		as: relation.As,
		foreignKey: relation.key
	};
	let target = exp.databases[inflector.pluralize(relation.Children)];
	if (relation.Rel !== 'manyToMany') {
		exp.databases[model][relation.Rel](target, options);
	} else {
		exp.databases[model].prototype.many2many = exp.databases[model].prototype.many2many || {};
		exp.databases[model].prototype.many2many[relation.Parent] = function (id, id2) {
			if (id && id2) {
				return exp.databases[relation.Children].findcre({
					[`${model}ID`]: id,
					[`${relation.Parent}ID`]: id2
				});
			}
			return exp.databases[relation.Children].find({
				where: {
					[`${model}ID`]: id
				}
			}).then(records => {
				let all = [];
				for (const record of records) {
					all.push(exp.databases[relation.Parent].findById(record[`${relation.Parent}ID`]));
				}
				return Promise.all(all);
			});
		};
	}
}
643590
function (obj) {
        return Boolean(obj) && ((obj instanceof Collection) ||
            _.inSuperChain(obj.constructor, '_postman_propertyName', Collection._postman_propertyName));
    }
1057915
function _isCpGetter2(node) {
  if (node.type !== "FunctionExpression") {
    return false;
  }
  var parent = node.parent;
  if (parent.type !== "CallExpression") {
    return false;
  }
  var callee = parent.callee;
  if (callee.type === "Identifier" && callee.name === "computed") {
    return true;
  }
  if (callee.type === "MemberExpression") {
    var caller = n.getCaller(callee);
    return caller === "Ember.computed" || caller === "Em.computed";
  }
  return false;
}
841258
function() {
        return new Promise(function(resolve, reject) {
            exec("find . ! -name '" + __filename.split('/').pop() + "' -iname '*\.js' | xargs grep 'CRUD.Entity.call(this);' -isl", {
                timeout: 3000,
                cwd: process.cwd()
            }, function(err, stdout, stdin) {
                var results = stdout.trim().split('\n');
                var entities = {};

                // iterate all found js files and search for CRUD.define calls
                results.map(function(filename) {
                    if (filename.trim() == '') return;
                    var code = fs.readFileSync(filename) + '';
                    var ast = UglifyJS.parse(code);
                    ast.walk(new UglifyJS.TreeWalker(function(node) {
                        if (node instanceof UglifyJS.AST_Call && node.start.value == 'CRUD' && node.expression.property == 'define') {
                            entities[node.args[0].start.value] = filename;
                        }
                    }));
                });

                resolve(entities);
            });
        });
    }
142578
function createJqCompatiblePromise(fnPromise, oContext) {

		var oOriginalPromise = new Promise(fnPromise);

		// if no context is set, use the promise as context
		oContext = oContext || oOriginalPromise;

		// track the promise state (for state method)
		var bResolved = false, bRejected = false;

		oOriginalPromise.then(function(v) {
			bResolved = true;
			return v;
		}, function(e) {
			bRejected = true;
			throw e;
		});

		// save original standard methods
		var mOriginalMethods = {
				then: oOriginalPromise.then,
				"catch": oOriginalPromise["catch"]
		};

		function makePromiseJqCompatible(oPromise) {

			// Wrap standard promise methods

			oPromise.then = function(fnSuccessCallback, fnErrorCallback) {
				// TODO: handle multiple arguments + array of callbacks
				var aArgs = [ wrapCallback(fnSuccessCallback, oContext), wrapCallback(fnErrorCallback, oContext) ];
				return makePromiseJqCompatible(mOriginalMethods.then.apply(oPromise, aArgs), oContext);
			};
			oPromise["catch"] = function(fnCallback) {
				var aArgs = [ wrapCallback(fnCallback, oContext) ];
				return makePromiseJqCompatible(mOriginalMethods["catch"].apply(oPromise, aArgs), oContext);
			};

			// Map jQuery Promise methods to standard methods and add a deprecation warning

			[ {
				jq: "done",
				es6: "then"
			}, {
				jq: "fail",
				es6: "catch"
			}, {
				jq: "always",
				es6: "then"
			}].forEach(function(mConfig) {
				oPromise[mConfig.jq] = function() {
					printJqPromiseDeprecationWarning(mConfig.jq);
					var oReturnPromise = null;
					Array.prototype.concat.apply([], arguments).forEach(function(fnCallback) {
						var fnWrappedCallback = wrapCallback(fnCallback, oContext);
						var fnFinalCallback = function(v) {
							fnWrappedCallback.apply(this, arguments);
							return v;
						};
						var aArgs = [ fnFinalCallback ];
						if (mConfig.jq === "always") {
							// use same callback for success / error handler
							aArgs.push(fnFinalCallback);
						}
						if (!oReturnPromise) {
							oReturnPromise = mOriginalMethods[mConfig.es6].apply(oPromise, aArgs);
						} else {
							oReturnPromise = oReturnPromise[mConfig.es6].apply(oReturnPromise, aArgs);
						}
					});
					return makePromiseJqCompatible(oReturnPromise, oContext);
				};
			});
			oPromise.pipe = function(fnDoneCallback, fnFailCallback) {
				printJqPromiseDeprecationWarning("pipe");
				return oPromise.then(fnDoneCallback, fnFailCallback);
			};
			oPromise.state = function() {
				printJqPromiseDeprecationWarning("state");
				if (bResolved) {
					return "resolved";
				} else if (bRejected) {
					return "rejected";
				} else {
					return "pending";
				}
			};

			return oPromise;
		}

		return makePromiseJqCompatible(oOriginalPromise);

	}
646729
function checkStoreShape({ subscribe, dispatch, getState }) {
    return isFunction(subscribe) &&
	isFunction(dispatch) &&
	isFunction(getState)
}
468531
function(methodDef, callback, params, payload) {
        // check required params
        for (var index in methodDef.required_params) {
            var requiredParamName = methodDef.required_params[index];
            if (!params.hasOwnProperty(requiredParamName)) {
                callback(requiredParamName +' param is required');
                return false;
            }
        }
        // check unattended params
        if (methodDef.unattended_params === false) {
            for (var param in params) {
                if (methodDef.optional_params.indexOf(param) == -1
                    && methodDef.required_params.indexOf(param) == -1) {
                    callback('unattended param '+ param);
                    return false;
                }
            }
        }
        // TODO: optional_payload is also on spore specification
        if (!payload && methodDef.required_payload === true) {
            callback("payload is required");
            return false;
        }
        return true;
    }
410837
function isLintablePromiseCatch(node) {
	const {callee} = node;

	if (callee.type !== 'MemberExpression') {
		return false;
	}

	const {property} = callee;

	if (property.type !== 'Identifier' || property.name !== 'catch') {
		return false;
	}

	if (node.arguments.length === 0) {
		return false;
	}

	const [arg0] = node.arguments;

	return arg0.type === 'FunctionExpression' || arg0.type === 'ArrowFunctionExpression';
}
338371
function validateUniqueness(attr, conf, err, done) {
    var cond = {where: {}};
    cond.where[attr] = this[attr];
    this.constructor.all(cond, function (error, found) {
        if (found.length > 1) {
            err();
        } else if (found.length === 1 && (!this.id || !found[0].id || found[0].id.toString() !== this.id.toString())) {
            err();
        }
        done();
    }.bind(this));
}
279042
function mayImplement(
  schema: GraphQLSchema,
  type: GraphQLType,
  typeName: string,
): boolean {
  const unmodifiedType = getRawType(type);
  return (
    unmodifiedType.toString() === typeName ||
    implementsInterface(unmodifiedType, typeName) ||
    (isAbstractType(unmodifiedType) &&
      hasConcreteTypeThatImplements(schema, unmodifiedType, typeName))
  );
}
432464
async function checkSchema() {
  const schema = await execa.stdout("node", ["scripts/generate-schema.js"]);
  const remoteSchema = await logPromise(
    "Checking current schema in SchemaStore",
    fetch(RAW_URL)
      .then(r => r.text())
      .then(t => t.trim())
  );

  if (schema === remoteSchema) {
    return;
  }

  return dedent(chalk`
    {bold.underline The schema in {yellow SchemaStore} needs an update.}
    - Open {cyan.underline ${EDIT_URL}}
    - Run {yellow node scripts/generate-schema.js} and copy the new schema
    - Paste it on GitHub interface
    - Open a PR
  `);
}
1022827
function (obj) {
        return Boolean(obj) && ((obj instanceof CookieList) ||
          _.inSuperChain(obj.constructor, '_postman_propertyName', CookieList._postman_propertyName));
    }
60808
def _isPromise(obj):
    
    return hasattr(obj, "fulfill") and \
        _isFunction(getattr(obj, "fulfill")) and \
        hasattr(obj, "reject") and \
        _isFunction(getattr(obj, "reject")) and \
        hasattr(obj, "then") and \
        _isFunction(getattr(obj, "then"))