Sing a colorful song.
543503
def do_sing(self, arg):
        """"""
        color_escape = COLORS.get(self.songcolor, Fore.RESET)
        self.poutput(arg, color=color_escape)
632019
def is_rhyme(d, w1, w2):
    """"""
    for p1 in d[w1]:
        # extract only "rhyming portion"
        p1 = p1.split("'")[-1]
        m = VOWELS_RE.search(p1)
        if not m:
            print(p1)
        p1 = p1[m.start():]
        for p2 in d[w2]:
            p2 = p2.split("'")[-1]
            m = VOWELS_RE.search(p2)
            if not m:
                print(w2, p2)
            p2 = p2[m.start():]
            if p1 == p2:
                return True
    return False
728190
public void printString(ColorEnum color, PrintWriter writer) {
        switch(color) {
        case Red:
            writer.print("red");
            break;
        case Green:
            writer.print("green");
            break;
        case Blue:
            writer.print("blue");
            break;
        }
    }
967547
public boolean play (SoundType type, String pkgPath, String key, int delay)
    {
        return play(type, pkgPath, key, delay, PAN_CENTER);
    }
1072816
async def play(self, ctx, *, query):
        """"""

        source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(query))
        ctx.voice_client.play(source, after=lambda e: print('Player error: %s' % e) if e else None)

        await ctx.send('Now playing: {}'.format(query))
246404
def highlight(str1, str2):
    """"""
    print('------------------------------')
    try:
        str2 = str2[0]
    except IndexError:
        str2 = None
    if str1 and str2:
        return str1.replace(str2, "<b>{}</b>".format(str2))
    else:
        return str1
1077355
public static String addColor(String orgString, String replaceString, int color) {
        return orgString.replace(replaceString, "<font color=\"" + colorToHexString(color) + "\">" + replaceString + "</font>");
    }
427245
def blue(cls, string, auto=False):
        
        return cls.colorize('blue', string, auto=auto)
530664
function colorise(theme, key, s) {
  var chalk = theme[key]
  if (key === 'op' || key === 'kind') {
    chalk = chalk[s]
  }
  return chalk ? chalk(s) : s
}
990702
function ( color ) {
		var digits, red, green, blue, result, i, nth;

		if ( color.charAt( 0 ) === "#" ) {
		    result = color;
		}
		else {
			digits = string.explode( color.replace( /.*\(|\)/g, "" ) );
			red    = number.parse( digits[0] || 0 );
			green  = number.parse( digits[1] || 0 );
			blue   = number.parse( digits[2] || 0 );
			result = ( blue | ( green << 8 ) | ( red << 16 ) ).toString( 16 );

			if ( result.length < 6 ) {
				nth = number.diff( result.length, 6 );
				i   = -1;

				while ( ++i < nth ) {
					result = "0" + result;
				}
			}

			result = "#" + result;
		}

		return result;
	}
274871
def sprint(string, *args, **kwargs):
    """"""
    try:
        print(string, *args, **kwargs)
    except UnicodeEncodeError:
        string = string.encode('utf-8', errors='ignore')\
                       .decode('ascii', errors='ignore')
        print(string, *args, **kwargs)
1057263
def _new_song(self):
        '''
        
        '''
        # We'll need this later
        s = self.song
        
        if self.shuffle:
            # If shuffle is on, we need to (1) get a random song that 
            # (2) accounts for weighting. This line does both.
            self.song = self.shuffles[random.randrange(len(self.shuffles))]
        else:
            # Nice and easy, just get the next song...
            self.song += 1
            # But wait! need to make sure it exists!
            if self.song >= len(self.loop):
                # It doesn't, so start over at the beginning.
                self.song = 0
        # Set flag if we have the same song as we had before.
        self.dif_song = s != self.song
        # Reset the position within the metasong
        self.pos = 0
232053
def colorstart(fgcolor, bgcolor, weight):
    '''  '''
    if weight:
        weight = bold
    else:
        weight = norm
    if bgcolor:
        out('\x1b[%s;%s;%sm' % (weight, fgcolor, bgcolor))
    else:
        out('\x1b[%s;%sm' % (weight, fgcolor))
670571
def makeSong(self):
        
        self.makeVisualSong()
        self.makeAudibleSong()
        if self.make_video:
            self.makeAnimation()
1342756
function () {

      function draw(color, n) {
        n = Math.max(parseInt(n), 0);

        write(' ');
        write('\u001b[' + color + 'm' + n + '\u001b[0m');
        write('\n');
      }

      draw(colors.green, this.passed);
      draw(colors.fail, this.failed);
      draw(colors.pending, this.pending + ' ');
      write('\n');

      cursor.up(this.numberOfLines);
    }
684651
function (msg, colors) {

        if (!colors) {
            return msg;
        }

        if (typeof colors === 'string') {
            colors = [colors];
        }

        colors.forEach(function (color) {
            if (typeof colorsjs[color] === 'function') {
                msg = colorsjs[color](msg);
            }
        });

        return msg;
    }
489246
def highlight_multi_regex(str_, pat_to_color, reflags=0):
    
    #import colorama
    # from colorama import Fore, Style
    #color = Fore.MAGENTA
    # color = Fore.RED
    #match = re.search(pat, str_, flags=reflags)

    colored = str_

    to_replace = []
    for pat, color in pat_to_color.items():
        matches = list(re.finditer(pat, str_, flags=reflags))

        for match in matches:
            start = match.start()
            end = match.end()
            to_replace.append((end, start, color))

    for tup in reversed(sorted(to_replace)):
        end, start, color = tup
        colored_part = color_text(colored[start:end], color)
        colored = colored[:start] + colored_part + colored[end:]

    return colored