[
        {
            'self': [1, 2, 3],
            'f': lambda e: e%2,
            'assert': lambda ret: list(ret)  == [1, 3]
         }
    ]
17536
def TakeIf(self: dict, f):
    
    if is_to_destruct(f):
        f = destruct_func(f)

    return (e for e in self.items() if f(e))
1050792
def _(f, x):
    
    return {k: v for k, v in x.items() if f(k, v)}
284974
def _all_correct_list(array):
    
    if type(array) not in _ITERABLE_TYPES:
        return False

    for item in array:
        if not type(item) in _ITERABLE_TYPES:
            return False

        if len(item) != 2:
            return False

    return True
150435
def map(self, func):
        
        return TList([func(k, v) for k, v in self.items()])
255994
def p_lconst_list(self, p):
        ''''''
        if len(p) == 4:
            p[1].append(p[3])
            p[0] = p[1]
        elif len(p) == 2:
            p[0] = [p[1]]
12320
def list_check(*args, func=None):
    """"""
    func = func or inspect.stack()[2][3]
    for var in args:
        if not isinstance(var, (list, collections.UserList, collections.abc.MutableSequence)):
            name = type(var).__name__
            raise ListError(
                f'Function {func} expected list, {name} got instead.')
289576
def group_by(fn: Callable[[T], TR]):
    

    def inner(seq: ActualIterable[T]) -> Dict[TR, List[T]]:
        ret = defaultdict(list)
        for each in seq:
            ret[fn(each)].append(each)

        return ret

    return inner
1104256
def ensure_list(value: Union[T, Sequence[T]]) -> Sequence[T]:
    """"""
    if value is None:
        return []
    return value if isinstance(value, list) else [value]
794332
def _(f, x):
    
    result = {}
    for k, v in x.items():
        k_, v_ = f(k, v)
        result[k_] = v_
    return result
367648
def comparison(self, t):
        
        assert(len(t) == 3)

        d = {"PropertyIsEqualTo": [
                t[0], t[1], t[2]
            ]}

        #parts = [str(p.value) for p in t]
        #v = " ".join(parts)

        #v = "( {} )".format(v)
        #t[0].value = v
        #return t[0]
        return d
274865
function each(list, fn) {
  var len = list ? list.length : 0;
  var i = 0;
  for (; i < len; ++i) {
    fn(list[i], i);
  }
  return list
}
686134
def walk(self, o):
        
        if isinstance(o, dict):
            d = o if self._dx is None else self._dx(o)
            return {k: self.walk(v) for k, v in d.items()}
        elif isinstance(o, list):
            return [self.walk(v) for v in o]
        else:
            return o if self._vx is None else self._vx(o)
1372399
def is_list(self, key):
        """"""
        data = self.model.get_data()
        return isinstance(data[key], (tuple, list))
645505
def tail(self) -> 'List':
        """"""

        lambda_list = self._get_value()
        return List(lambda_list(lambda _, tail: tail))
1306013
def p_argument_list(self, p):
        
        if len(p) == 2:
            p[0] = [p[1]]
        else:
            p[1].append(p[3])
            p[0] = p[1]
714604
function findIndex(list, predicate) {
  for (var i = 0, item; item = list[i]; i++)
    if (predicate(item)) return i;

  return -1;
}
477262
def within(self, key, include_self=True, exclusive=False, biggest_first=True, only=None):
        
        possibles = self.topology if only is None else {k: self[k] for k in only}
        _ = lambda key: [key] if key in possibles else []
        if 'RoW' not in self and key == 'RoW':
            answer = [] + _('RoW') + _('GLO')
            return list(reversed(answer)) if biggest_first else answer

        faces = self[key]
        lst = [
            (k, len(v))
            for k, v in possibles.items()
            if faces.issubset(v)
        ]
        return self._finish_filter(lst, key, include_self, exclusive, biggest_first)