Check if an element from a list starts a string.

    :type elems: list
    :type line: str
332509
def isin_start(elems, line):
    
    found = False
    elems = [elems] if type(elems) is not list else elems
    for e in elems:
        if line.lstrip().lower().startswith(e):
            found = True
            break
    return found
872706
def convert_type_list_elements(
    list_object  = None,
    element_type = str
    ):
    
    if element_type is str:
        return [str(element) if not isinstance(element, list) else convert_type_list_elements(
            list_object  = element,
            element_type = str
        ) for element in list_object]
1236705
def __isListOfTexts(self, docs):
        
        return isinstance(docs, list) and \
               all(isinstance(d, (basestring, Text)) for d in docs)
265529
static <T> String join(Iterable<T> elems, String delim) {
        if (elems == null)
            return "";
        StringBuilder result = new StringBuilder();
        for (T elem : elems)
            result.append(elem).append(delim);
        if (result.length() > 0)
            result.setLength(result.length() - delim.length());
        return result.toString();
    }
919393
def lines
      begin
        if @scanner.scan(/#/)
          comment
        else
          msgctxt
        end
      rescue PoSyntaxError => pe
        # throw a normal ParserError to break the recursion
        raise ParserError, "Syntax error in lines\n" + pe.message, pe.backtrace
      end
    end
1156420
def startElement(self, name, attrs):
        
        if name in self.ignore_start:
            return
        try:
            handler = getattr(self, '_handle_start_%s' % name)
        except AttributeError:
            raise KeyError("Unknown element start '%s'" % name)
        handler(attrs)
1099403
def elements_as_text(self, elems, indent=2):
        
        assert elems
        text = ""
        for elename, eledesc in elems.items():
            if isinstance(eledesc, dict):
                desc_txt = self.elements_as_text(eledesc, indent + 2)
                desc_txt = ''.join(['\n', desc_txt])
            elif isinstance(eledesc, str):
                desc_txt = ''.join([eledesc, '\n'])
            else:
                assert False, "Only string or dictionary"
            ele_txt = "\t{0}{1: <22} {2}".format(' ' * indent, elename,
                                                 desc_txt)
            text = ''.join([text, ele_txt])
        return text
1164482
def find_first(data, what):
    '''
    
    '''
    for i, line in enumerate(data):
        if contains(line, what):
            return i
            
    return None
754123
def find_next(lines, find_str, start_index):
    
    mode = None
    if isinstance(find_str, basestring):
        mode = 'normal'
        message = find_str
    elif isinstance(find_str, Invert):
        mode = 'invert'
        message = str(find_str)
    else:
        raise TypeError("Unsupported message type")
    for i in range(start_index, len(lines)):
        if re.search(message, lines[i]):
            return mode == 'normal', i, lines[i]
        elif message in lines[i]:
            return mode == 'normal', i, lines[i]
    if mode == 'invert':
        return True, len(lines), None
    raise LookupError("Not found")
975144
def is_list(node):
    """"""
    return (isinstance(node, Node)
            and len(node.children) > 1
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[-1], Leaf)
            and node.children[0].value == u"["
            and node.children[-1].value == u"]")
1001217
def get_first_of_element(element, sub, contype=None):
    
    content = element.xpath(sub)
    return list_or_empty(content, contype)
1372338
def match(elem, seq_expr):
        
        if type(seq_expr) is str:  # wild-card
            if seq_expr == '.':  # match any element
                return True
            elif seq_expr == '\d':
                return elem.is_numerical()
            elif seq_expr == '\D':
                return not elem.is_numerical()
            else:  # invalid wild-card specified
                raise LookupError('{0} is not a valid wild-card'.format(seq_expr))
        else:  # date element
            return elem == seq_expr
1305788
private static boolean startsWith(List<?> list, List<?> other) {
    return list.size() >= other.size() && list.subList(0, other.size()).equals(other);
  }
164238
def _str_elem(config, key):

    '''
    
    '''

    _value = config.pop(key, '')
    if _valid_str(_value):
        config[key] = _value
1073933
def contains(self, value):
        
        str_value = StringConverter.to_nullable_string(value)

        for element in self:
            str_element = StringConverter.to_string(element)

            if str_value == None and str_element == None:
                return True
            if str_value == None or str_element == None:
                continue
            
            if str_value == str_element:
                return True

        return False
26655
def _judeNOtIn(self, raw_str, ele_list):
        '''
        
        '''
        for ele in ele_list:
            if ele in raw_str:
                return False
        return True
1279060
def fromElement(cls, elem):
        

        self = cls()

        self.oid = elem.get("OID")
        self.name = elem.get("Name")
        return self