Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(11)  |  Call(9)  |  Derive(0)  |  Import(2)

        def colorize(s, color, bold=False):
    if os.getenv('ANSI_COLORS_DISABLED') is None and color != 'none':
        if bold:
            return '\033[1m\033[{}m{}\033[0m'.format(colors_c[color], s)
        return '\033[{}m{}\033[0m'.format(colors_c[color], s)
    return s
        


src/m/p/mpdc-HEAD/mpdc/mpdc_collections.py   mpdc(Download)
from mpdc.initialize import mpd, collectionsmanager, cache, colors, columns, \
                            enable_pager, pager
from mpdc.libs.utils import input_box, esc_quotes, info, warning, colorize, \
                            columns_width
from mpdc.libs.parser import parser
        header = ''
        for i, column in enumerate(columns):
            header += colorize(column.title().ljust(c_w[column]),
                               colors[i % len(colors)], True)
        if enable_pager:
                if len(tag) > c_w[column] - 1:
                    tag = tag[:c_w[column] - 2] + '…'
                row += colorize(tag.ljust(c_w[column]),
                                colors[i % len(colors)], bold)
            if enable_pager:
def format_alias(alias):
    if 'mpd_playlist' in collectionsmanager.c[alias]:
        return colorize('(playlist) ', colors[0]) + alias
    elif 'sort' in collectionsmanager.c[alias]:
        return colorize('@ ', colors[0]) + alias

src/m/p/mpdc-HEAD/mpdc/mpdc_database.py   mpdc(Download)
 
from mpdc.initialize import mpd, collectionsmanager, lastfm, cache, colors
from mpdc.libs.utils import repr_tags, info, warning, colorize
 
 
        missing_tags = [tag for tag, value in tags.items() if not value]
        if missing_tags:
            warning(colorize(song, colors[0]))
            print('missing tag(s): ' + colorize(', '.join(missing_tags),
                                                colors[1 % len(colors)]))
        print('------------------')
        for tags in duplicates:
            warning('Conflict with tags ' + colorize(repr_tags([tags['artist'],
                                                               tags['album'],
                                                               tags['title'],
                                                               tags['track']]),
                                                     colors[1 % len(colors)]))
            files_matched = mpd.find_multiple(**tags)
            print('files matched:\n' + colorize('\n'.join(files_matched),