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

    return (e for e in self if f(e))
520124
def is_dictlist(data):
    '''
    
    '''
    if isinstance(data, list):
        for element in data:
            if isinstance(element, dict):
                if len(element) != 1:
                    return False
            else:
                return False
        return True
    return False
138724
def listify(x, none_value=[]):
    """"""

    if isinstance(x, list):
        return x
    elif isinstance(x, tuple):
        return list(x)
    elif x is None:
        return none_value
    else:
        return [x]
964384
def p_expr_list(self, p):
        ''''''
        if len(p) == 4:
            p[1].append(p[3])
            p[0] = p[1]
        elif len(p) == 2:
            p[0] = [p[1]]
1372399
def is_list(self, key):
        """"""
        data = self.model.get_data()
        return isinstance(data[key], (tuple, list))
171108
def listify(val, return_type=tuple):
    
    # TODO: flatlistify((1, 2, 3), 4, (5, 6, 7))
    if val is None:
        return return_type()
    elif isiterable(val):
        return return_type(val)
    else:
        return return_type((val, ))
1240784
def Then4(self, f, arg1, arg2, arg3, *args, **kwargs):
        
        args = (arg1, arg2, arg3) + args
        return self.ThenAt(4, f, *args, **kwargs)
552819
def p_enum_list(self, p):
        ''''''
        if p[1] is None:
            p[0] = []
        elif len(p) == 4:
            p[1].append(p[3])
            p[0] = p[1]
        elif len(p) == 2:
            p[0] = [p[1]]
1120811
def p_comparison_in_list(self, p):
        
        if len(p) == 2:
            p[0] = Comparison(operator=p[1])
        else:
            p[0] = Comparison(operator='%s %s' % (p[1], p[2]))
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
1007258
def example():
    """"""
    proc = [[2,3,1],[4,2,3],[1,4,1]]
    p = {}
    for i in range(3):
        for j in range(3):
            p[i+1,j+1] = proc[j][i]
    return p
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
449096
def listify(*args):
    
    if (len(args) == 1) and callable(args[0]):
        func = args[0]

        @wraps(func)
        def _inner(*args, **kwargs):
            return list(func(*args, **kwargs))
        return _inner
    else:
        return list(args)
207127
def as_list(callable):
    """"""
    @wraps(callable)
    def wrapper(value_iter):
        return [callable(value) for value in value_iter]

    return wrapper
1208261
def _AssertDataIsList(key, lst):
  """"""

  # list and tuple are supported.  Not supported are direct strings
  # and dictionary; these indicate too much or two little structure.
  if not isinstance(lst, list) and not isinstance(lst, tuple):
    raise NotAListError('%s must be a list' % key)

  # each list entry must be a string
  for element in lst:
    if not isinstance(element, str):
      raise ElementNotAStringError('Unsupported list element %s found in %s',
                                   (element, lst))
150435
def map(self, func):
        
        return TList([func(k, v) for k, v in self.items()])
662919
def list_all_eq_to(list_, val, strict=True):
    
    if util_type.HAVE_NUMPY and isinstance(val, np.ndarray):
        return all([np.all(item == val) for item in list_])
    try:
        # FUTURE WARNING
        # FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', category=FutureWarning)
            flags = [item == val for item in list_]
            return all([np.all(flag) if hasattr(flag, '__array__') else flag
                        for flag in flags])
        #return all([item == val for item in list_])
    except ValueError:
        if not strict:
            return all([repr(item) == repr(val) for item in list_])
        else:
            raise