If condition, return a new elem_list provided by executing action.
482452
def execute(self, elem_list):
        
        if self.condition.is_true(elem_list):
            return self.action.act(elem_list)
        else:
            return elem_list
45965
def p_const_vector_elem_list_list(p):
    
    if p[1] is None or p[3] is None:
        return

    if not is_static(p[3]):
        if isinstance(p[3], symbols.UNARY):
            tmp = make_constexpr(p.lineno(2), p[3])
        else:
            api.errmsg.syntax_error_not_constant(p.lineno(2))
            p[0] = None
            return
    else:
        tmp = p[3]

    if p[1] is not None:
        p[1].append(tmp)
    p[0] = p[1]
936561
def _do_element_absent(name, elem_type, data, server=None):
    '''
    
    '''
    ret = {'delete': False, 'error': None}
    try:
        elements = __salt__['glassfish.enum_{0}'.format(elem_type)]()
    except requests.ConnectionError as error:
        if __opts__['test']:
            ret['create'] = True
            return ret
        else:
            ret['error'] = "Can't connect to the server"
            return ret

    if elements and name in elements:
        ret['delete'] = True
        if not __opts__['test']:
            try:
                __salt__['glassfish.delete_{0}'.format(elem_type)](name, server=server, **data)
            except CommandExecutionError as error:
                ret['error'] = error
    return ret
485229
def ElemMatch(q, *conditions):
    
    new_condition = {}
    for condition in conditions:
        deep_merge(condition.to_dict(), new_condition)

    return Condition(q._path, new_condition, '$elemMatch')
1000274
def np_to_list(elem):
  """"""
  if isinstance(elem, list):
    return elem
  elif isinstance(elem, tuple):
    return list(elem)
  elif isinstance(elem, np.ndarray):
    return list(elem)
  else:
    raise ValueError(
        'Input elements of a sequence should be either a numpy array, a '
        'python list or tuple. Got {}'.format(type(elem)))
554509
def visit_list(self, node):
        """"""
        return "[%s]" % ", ".join(child.accept(self) for child in node.elts)
800407
def leaf_list(self, node, elem, module, path):
        """"""
        nel, newm, path = self.sample_element(node, elem, module, path)
        if path is None:
            return
        minel = node.search_one("min-elements")
        self.add_copies(node, elem, nel, minel)
        self.list_comment(node, nel, minel)
449798
private static <E extends Element> List<E> listFilter(Iterable<? extends Element> elements,
                                                          Set<ElementKind> targetKinds,
                                                          Class<E> clazz) {
        List<E> list = new ArrayList<E>();
        for (Element e : elements) {
            if (targetKinds.contains(e.getKind()))
                list.add(clazz.cast(e));
        }
        return list;
    }
483223
def _validate_list_data(self, expected, actual):
        """"""
        for e in expected:
            if e not in actual:
                return "expected item {} not found in actual list".format(e)
        return None
1071419
def p_new_elseif_list(p):
    ''''''
    if len(p) == 2:
        p[0] = []
    else:
        p[0] = p[1] + [ast.ElseIf(p[4], ast.Block(p[7], lineo=p.lineno(6)),
                                  lineno=p.lineno(2))]
14083
def visit_list(self, node, parent):
        """"""
        context = self._get_context(node)
        newnode = nodes.List(
            ctx=context, lineno=node.lineno, col_offset=node.col_offset, parent=parent
        )
        newnode.postinit([self.visit(child, newnode) for child in node.elts])
        return newnode
406368
def load(self, elem):
        
        self.testTag(elem, 'list')
        out = []
        for xitem in elem:
            out.append(XmlDataIO.fromXml(xitem))
        return out
90298
def list_conditions(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d/condition" % (service_id, version_number))
		return map(lambda x: FastlyCondition(self, x), content)
1096473
def _convertToElementList(elements_list):
    
    elements = []
    current_element = []
    for node_index in elements_list:
        if node_index == -1:
            elements.append(current_element)
            current_element = []
        else:
            current_element.append(node_index)

    return elements
707586
public T visitList(List elm, C context) {
        if (elm.getTypeSpecifier() != null) {
            visitElement(elm.getTypeSpecifier(), context);
        }
        for (Expression element : elm.getElement()) {
            visitElement(element, context);
        }
        return null;
    }
965789
def list(self, node, elem, module, path):
        """"""
        nel, newm, path = self.sample_element(node, elem, module, path)
        if path is None:
            return
        for kn in node.i_key:
            self.node_handler.get(kn.keyword, self.ignore)(
                kn, nel, newm, path)
        self.process_children(node, nel, newm, path, node.i_key)
        minel = node.search_one("min-elements")
        self.add_copies(node, elem, nel, minel)
        if self.annots:
            self.list_comment(node, nel, minel)
1053307
def index(self, elem):
        """"""
        if elem not in self:
            raise _coconut.ValueError(_coconut.repr(elem) + " is not in count")
        return (elem - self._start) // self._step