A :func:`list` of screen lines as unicode strings.
324805
def display(self):
        """"""
        def render(line):
            is_wide_char = False
            for x in range(self.columns):
                if is_wide_char:  # Skip stub
                    is_wide_char = False
                    continue
                char = line[x].data
                assert sum(map(wcwidth, char[1:])) == 0
                is_wide_char = wcwidth(char[0]) == 2
                yield char

        return ["".join(render(self.buffer[y])) for y in range(self.lines)]
253379
def description_of(lines, name='stdin'):
    
    u = UniversalDetector()
    for line in lines:
        u.feed(line)
    u.close()
    result = u.result
    if result['encoding']:
        return '{0}: {1} with confidence {2}'.format(name, result['encoding'],
                                                     result['confidence'])
    else:
        return '{0}: no result'.format(name)
877648
def _unicode_decode_extracted_tb(extracted_tb):
    """"""
    return [(_decode(file), line_number, _decode(function), _decode(text))
            for file, line_number, function, text in extracted_tb]
908707
def arabicrange():
    
    """
    mylist = []
    for i in range(0x0600, 0x00653):
        try:
            mylist.append(unichr(i))
        except NameError:
            # python 3 compatible
            mylist.append(chr(i))
        except ValueError:
            pass
    return mylist
433046
def one_screen? str
    cols, lines = `tput cols`.to_i, `tput lines`.to_i
    (str.count("\n") + 2) <= lines && # count last line and prompt
      str.gsub(/\e\[[^m]*m/, '').size <= cols * lines
  end
937349
def readlines(filename, encoding='utf-8'):
    
    text, encoding = read(filename, encoding)
    return text.split(os.linesep), encoding
486635
def deep_unicode(s, encodings=None):
    """"""
    if encodings is None:
        encodings = ['utf-8', 'latin-1']
    if isinstance(s, (list, tuple)):
        return [deep_unicode(i) for i in s]
    if isinstance(s, dict):
        return dict([
            (deep_unicode(key), deep_unicode(s[key]))
            for key in s
        ])
        # in_dict = {}
        # for key in s:
        #     in_dict[to_unicode(key)] = to_unicode(s[key])
        # return in_dict
    elif isinstance(s, str):
        for encoding in encodings:
            try:
                return s.decode(encoding)
            except:
                pass
    return s
414458
def remove_line_breaks(text):
    
    return unicode(text, 'utf-8').replace('\f', '').replace('\n', '') \
        .replace('\r', '').replace(u'\xe2\x80\xa8', '') \
        .replace(u'\xe2\x80\xa9', '').replace(u'\xc2\x85', '') \
        .encode('utf-8')
761336
def get_all_lines(self):
        """"""
        output = []
        line = []
        lineno = 1
        for char in self.string:
            line.append(char)
            if char == '\n':
                output.append(SourceLine(''.join(line), lineno))
                line = []
                lineno += 1
        if line:
            output.append(SourceLine(''.join(line), lineno))

        return output
357513
def get_names():
    
    return [n.strip() for n in codecs.open(os.path.join("data", "names.txt"),"rb",'utf8').readlines()]
476354
def validlines(self):
		""""""

		return [ln for ln in self.lines() if (not ln.isBroken() and not ln.ignoreMe)]
687631
def readlines(self, *args, **kwargs):
        """"""
        return list(iter(partial(self.readline, *args, **kwargs), u''))
908543
def get_lines(self, key):
        """"""
        if key in self._indices:
            return self._indices[key].values()
        else:
            return []
1102119
def _document_lines(self, text):
        
        inlines = text.split('\n')
        doc_lines = [(re.sub(r'^ +| +$', '', line), num)
                     for line, num
                     in zip(inlines, xrange(1, len(inlines) + 1))]
        return doc_lines
894405
def get_import_lines(self):
        
        if self.imports:
            return ["from %s import %s" % (value, key) for key, value in self.imports.items()]
        else:
            return []
761235
def align_lines(lines: list, column_separator: str='|') -> list:
    
    rows = []
    col_len = []
    for line in lines:
        line = str(line)
        cols = []
        for col_index, col in enumerate(line.split(column_separator)):
            col = str(col).strip()
            cols.append(col)
            if col_index >= len(col_len):
                col_len.append(0)
            col_len[col_index] = max(col_len[col_index], len(col))
        rows.append(cols)

    lines_out = []
    for row in rows:
        cols_out = []
        for col_index, col in enumerate(row):
            if col_index == 0:
                col = col.ljust(col_len[col_index])
            else:
                col = col.rjust(col_len[col_index])
            cols_out.append(col)
        lines_out.append(' '.join(cols_out))
    return lines_out
491815
def readlines(self, encoding=None):
        """"""
        try:
            encoding = encoding or ENCODING
            with codecs.open(self.path, encoding=None) as fi:
                return fi.readlines()
        except:
            return []