[
        {
            'self': [1, 2, 3],
            'n': 2,
            'assert': lambda ret: list(ret)  == [1, 2]
         }
    ]
181418
def Take(self: Iterable, n):
    

    for i, e in enumerate(self):
        if i == n:
            break
        yield e
539416
def Take(self: dict, n):
    

    for i, e in enumerate(self.items()):
        if i == n:
            break
        yield e
630689
def mset_list(item, index, value):
    ''
    if isinstance(index, (int, slice)):
        item[index] = value
    else:
        map(item.__setitem__, index, value)
744336
def List(self):
        
        print()
        for key in list(self.keys()):
            print(key,'=',self[key])
        print()
569101
def takes(*type_list):
    
    def inner(f):
        if enabled:
            # deal with the real function, not a wrapper
            f = getattr(f, 'wrapped_fn', f)

            # need to check if 'self' is the first arg,
            # since @pre doesn't want the self param
            member_function = is_member_function(f)

            # need metadata for defaults check
            method_args, method_defaults = inspect.getargspec(f)[0::3]
            if member_function:
                method_args = method_args[member_function:]

            def check_condition(args, kwargs):
                if method_defaults is not None and len(method_defaults) > 0 \
                and len(method_args) - len(method_defaults) <= len(args) < len(method_args):
                    args += method_defaults[len(args) - len(method_args):]

                for i, (arg, t) in enumerate(zip(args[member_function:], type_list)):
                    method_arg = method_args[i]
                    if method_arg not in kwargs and not check_type(t, arg):
                        raise AssertionError('Precondition failure, wrong type for argument')

                for kwarg in kwargs:
                    arg_position = method_args.index(kwarg)
                    if arg_position < len(type_list):
                        t = type_list[arg_position]
                        if not check_type(t, kwargs.get(kwarg)):
                            raise AssertionError('Precondition failure, wrong type for argument %s' % kwarg)

            # append to the rest of the postconditions attached to this method
            if not hasattr(f, 'preconditions'):
                f.preconditions = []
            f.preconditions.append(check_condition)

            return check(f)
        else:
            return f

    return inner
148270
def n_elements(self):
        
        if self.is_array:
            return functools.reduce(operator.mul, self.array_dimensions)
        else:
            return 1
638409
def from_list(cls, l):
        """"""
        if len(l) == 3:
                x, y, z = map(float, l)
                return cls(x, y, z)
        elif len(l) == 2:
            x, y = map(float, l)
            return cls(x, y)
        else:
            raise AttributeError
1063222
def CB(self):
        '''
        

        '''
        try:
            return self._CB
        except AttributeError:
            pass
        self._CB = [self.C, self.B]
        return self._CB
396866
def from_list(cls, values):
        """"""
        self = cls()
        for value in values:
            self.add(value)
        return self
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
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]]
1322849
def get_list_representation(self):
        """"""
        if self.is_list:
            return self.list_or_slice
        else:
            return self[list(range(self.num_examples))]
1070425
def tlist2dict(tuple_list,**kwargs):
    '''
        
    '''
    if('deepcopy' in kwargs):
        deepcopy = kwargs['deepcopy']
    else:
        deepcopy = 1
    if('check' in kwargs):
        check = kwargs['check']
    else:
        check = 1
    if(check):
        if(tltl.is_tlist(tuple_list)):
            pass
        else:
            return(None)
    else:
        pass
    j = {}
    if(deepcopy):
        new = copy.deepcopy(tuple_list)
    else:
        new = tuple_list
    for i in range(0,new.__len__()):
        temp = new[i]
        key = temp[0]
        value = temp[1]
        j[key] = value
    return(j)
314087
def n_list_comp_pypy27(self, node):
        """"""
        p = self.prec
        self.prec = 27
        if node[-1].kind == 'list_iter':
            n = node[-1]
        elif self.is_pypy and node[-1] == 'JUMP_BACK':
            n = node[-2]
        list_expr = node[1]

        if len(node) >= 3:
            store = node[3]
        elif self.is_pypy and n[0] == 'list_for':
            store = n[0][2]

        assert n == 'list_iter'
        assert store == 'store'

        # Find the list comprehension body. It is the inner-most
        # node.
        # FIXME: DRY with other use
        while n == 'list_iter':
            n = n[0] # iterate one nesting deeper
            if   n == 'list_for':	n = n[3]
            elif n == 'list_if':	n = n[2]
            elif n == 'list_if_not': n = n[2]
        assert n == 'lc_body'
        self.write( '[ ')

        expr = n[0]
        if self.is_pypy and node[-1] == 'JUMP_BACK':
            list_iter = node[-2]
        else:
            list_iter = node[-1]

        assert expr == 'expr'
        assert list_iter == 'list_iter'

        # FIXME: use source line numbers for directing line breaks

        self.preorder(expr)
        self.preorder(list_expr)
        self.write( ' ]')
        self.prec = p
        self.prune()
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]]
810174
def batch_iterable(l, n):
    ''' '''
    i = iter(l)
    piece = list(islice(i, n))
    while piece:
        yield piece
        piece = list(islice(i, n))
1308184
def p_statements(self, p):
        
        n = len(p)
        if n == 3:
            p[0] = p[1] + [p[2]]
        elif n == 2:
            p[0] = ['statements', p[1]]