Creates a OR IN clause
@param mixed $item  Subject of comparison
@param array $list  A list of values
@param string $cond OR|AND
@param boolean $not
512780
public function orIn($item, array $list, $cond = 'or', $not = false)
    {
        return $this->in($item, $list, $cond, $not);
    }
700711
function in($field, $filter,$not = false) {
        if(!$filter) return $this;
        $not = $not?'NOT':'';
        if(is_array($filter)){
            $comma = '';
            $setFields = '';
            foreach ($filter as $key => $value) {
                $params[] = $value;
                $setFields .= "{$comma}?";
                $comma = ',';
            }
            $this->where .= $this->w . $field.' '.$not.' in('.$setFields.')';
            $this->params = array_merge($this->params,$params);
        }
        else {
            $this->where .= $this->w . $field.' in('.$filter.')';
        }
        $this->w = ' AND ';
        return $this;
    }
767747
def _clause_formatter(self, cond):
        '''
        '''

        if len(cond) == 2 :
            cond = ' '.join(cond)
            return cond

        if 'in' in cond[1].lower() :
            if not isinstance(cond[2], (tuple, list)):
                    raise TypeError('("{0}") must be of type <type tuple> or <type list>'.format(cond[2]))

            if 'select' not in cond[2][0].lower() :
                cond[2] = "({0})".format(','.join(map(str,["'{0}'".format(e) for e in cond[2]])))
            else:
                cond[2] = "({0})".format(','.join(map(str,["{0}".format(e) for e in cond[2]])))

            cond = " ".join(cond)
        else: 
            #if isinstance(cond[2], str):
            #    var = re.match('^@(\w+)$', cond[2])
            #else:
            #    var = None
            #if var :
            if isinstance(cond[2], str) and cond[2].startswith('@'):
                cond[2] = "{0}".format(cond[2])
            else :
                cond[2] = "'{0}'".format(cond[2])
            cond = ' '.join(cond)

        return cond
676561
public function isOwnedBy($item, $user = [])
    {
        if (!is_array($item)) {
            $item = $item->toArray();
        }

        if (empty($user)) {
            return false;
        }

        $itemUserId = $item[$this->config('column')];
        $userId = $user['id'];

        if ($itemUserId === $userId) {
            return true;
        }

        return false;
    }
699943
public function where($cond, $params, $symbol = 'AND')
    {
        if ($cond instanceof \Closure) {
            $this->where[] = '(';
            $cond();
            $this->where[] = ')';
        }
        $this->where[] = [
            $symbol, $cond, is_array($params) ? $params : [$params]
        ];
        return $this;
    }
793012
protected function _buildCondition($property, $condition, $value) {
		switch ($condition) {
			// var = ?
			case self::COND_EQUAL:
				return [$property => $value];
			
			// var in(?)
			case self::COND_IN:
				return [$property => [
					self::MONGO_IN => (array) $value
				]];
			
			// var not in(?)
			case self::COND_NOT_IN:
				return [$property => [
					self::MONGO_NOT_IN => (array) $value
				]];
			
			// var < ?
			case self::COND_LESS:
				return [$property => [
					self::MONGO_LESS => $value
				]];
			
			// var > ?
			case self::COND_MORE:
				return [$property => [
					self::MONGO_MORE => $value
				]];
			
			// var <= ?
			case self::COND_LESS_EQUAL:
				return array($property => array(
					self::MONGO_LESS_EQUAL => $value
				));
			
			// var >= ?
			case self::COND_MORE_EQUAL:
				return [$property => [
					self::MONGO_MORE_EQUAL => $value
				]];
			
			// var != ?
			case self::COND_NOT_EQUAL:
			case self::COND_NOT_EQUAL_ALT:
				return [$property => [
					self::MONGO_NOT_EQUAL => $value
				]];
			
			// var in array(?)
			case self::COND_IN_ARRAY:
				return [$property => [
					self::MONGO_IN_ARRAY => (array) $value
				]];
			
			// var exists(?)
			case self::COND_EXISTS:
				return [$property => [
					self::MONGO_EXISTS => $value
				]];
			
			// var type(?)
			case self::COND_TYPE:
				return [$property => [
					self::MONGO_TYPE => $value
				]];
				
			// var is array()
			case self::COND_IS_ARRAY:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_ARRAY
				]];
			
			// var is int()
			case self::COND_IS_INT:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_INT32
				]];
			
			// var is string()
			case self::COND_IS_STRING:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_STRING
				]];
			
			// var is bool()
			case self::COND_IS_BOOL:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_BOOLEAN
				]];
			
			// var is null()
			case self::COND_IS_NULL:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_NULL
				]];
			
			// var regexp(?)
			case self::COND_REGEXP:
				return [$property => new MongoRegex($value)];
			
			// var like ?
			case self::COND_LIKE:
				$regex = preg_quote(trim($value, '%'));
				
				if ($value[0] !== '%') {
					$regex = '^' . $regex;
				}
				
				if ($value[strlen($value) - 1] !== '%') {
					$regex .= '$';
				}
				
				return [$property => new MongoRegex('/' . $regex . '/')];
				
			// var array size ?
			case self::COND_ARRAY_COUNT:
			case self::COND_ARRAY_COUNT_ALT:
				return [$property => [
					self::MONGO_SIZE => $value
				]];
			
			default:
				throw new Exception('Uncnown condition: "' . $condition . '"');
		}
	}
145939
public function in($column, array $values, $conjunction = 'AND')
    {
        return $this->addExpression(new Condition\In($column, $values, $conjunction));
    }
1058183
protected function createItem(Order $order, array $item)
    {
        if ($this->itemContainsABuyable($item)) {
            /** @var Buyable $product */
            $product = $item['product'];
            $item    = array_merge($item, [
                'product_type' => $product->morphTypeName(),
                'product_id'   => $product->getId(),
                'price'        => $product->getPrice(),
                'name'         => $product->getName()
            ]);
            unset($item['product']);
        }

        $order->items()->create($item);
    }
473561
function any(arr, contition) {
  let result = false;

  util.forEach(arr, item => {
    result = contition(item);

    return !result;
  });

  return result;
}
797491
public function orWhereNotIn($column, $in, $filter = false)
    {
        return $this->createWhereIn('OR', $column, $in, true, $filter);
    }
453994
public function whereIn($column, $values, $boolean = 'and', $not = false)
    {
        $type = $not ? 'NotIn' : 'In';

        // If the value is a query builder instance we will assume the developer wants to
        // look for any values that exists within this given query. So we will add the
        // query accordingly so that this query is properly executed when it is run.
        if ($values instanceof static) {
            return $this->whereInExistingQuery(
                $column,
                $values,
                $boolean,
                $not
            );
        }

        // If the value of the where in clause is actually a Closure, we will assume that
        // the developer is using a full sub-select for this "in" statement, and will
        // execute those Closures, then we can re-construct the entire sub-selects.
        if ($values instanceof Closure) {
            return $this->whereInSub($column, $values, $boolean, $not);
        }

        // Next, if the value is Arrayable we need to cast it to its raw array form so we
        // have the underlying array value instead of an Arrayable object which is not
        // able to be added as a binding, etc. We will then add to the wheres array.
        if ($values instanceof Arrayable) {
            $values = $values->toArray();
        }

        $this->wheres[] = compact('type', 'column', 'values', 'boolean');

        // Finally we'll add a binding for each values unless that value is an expression
        // in which case we will just skip over it since it will be the query as a raw
        // string and not as a parameterized place-holder to be replaced by the PDO.
        foreach ($values as $value) {
            if (!$value instanceof Expression) {
                $this->addBinding($value, 'where');
            }
        }

        return $this;
    }
252737
public function andNotIn($column, $argument)
    {
        $this->conditions[] = 'AND ' . $this->grammar->buildId($column) . ' NOT IN(' . $argument . ')';

        return $this;
    }
69496
public static function isConsistent($listElement, array $list = [])
    {
        // empty list
        if (!count($list)) {
            return true;
        }

        $listElement = self::getBodyOfListElement($listElement);

        // list element is a string
        if (is_string($listElement)) {
            return true;
        }

        // list element is an array or an object
        if (is_array($listElement) || is_object($listElement)) {
            if (count(array_diff_key(
                (array) $listElement,
                (array) self::getBodyOfFirstElementOfList($list)
            ))) {
                return false;
            }
        }

        return true;
    }
210408
public function in($item, array $list, $cond = null, $not = false)
    {
        $inClause = '';

        if (null == $this->oosql_where && null == $this->oosql_in && null == $this->oosql_between) {
            $inClause .= ' WHERE ';
        } else {
            $cnd = ' AND ';

            if (null != $cond) {

                if (strtolower($cond) == 'or') {
                    $cnd = ' OR ';
                }

            }
            $inClause .= $cnd;
        }
        if ($not) {
            $item = $item . ' NOT ';
        }
        $inClause .= $item . ' IN ';

        $obj = $this;

        $list = array_map(function ($data) use ($obj) {
            return (!$obj->validInt($data)) ? $obj->quote($data) : $data;
        }, $list);

        $inClause .= '(' . implode(',', $list) . ')';

        $this->oosql_in = $inClause;

        return $this;
    }
282398
public function tryLoadBy($field, $cond = UNDEFINED, $value = UNDEFINED)
    {
        try {
            $this->loadBy($field, $cond, $value);
        } catch (Exception_NotFound $e) {
            // ignore not-found exception
        }

        return $this;
    }
647151
function item($item, $index = '')
	{
		if ($index == '')
		{
			if ( ! isset($this->config[$item]))
			{
				return FALSE;
			}

			$pref = $this->config[$item];
		}
		else
		{
			if ( ! isset($this->config[$index]))
			{
				return FALSE;
			}

			if ( ! isset($this->config[$index][$item]))
			{
				return FALSE;
			}

			$pref = $this->config[$index][$item];
		}

		return $pref;
	}
259831
protected function coerceList($item, $delim = ",") {
        if (!is_null($item) && $item[0] == "list") {
            return $item;
        }

        return array("list", $delim, is_null($item) ? array(): array($item));
    }