def getpygamecolor(value):
    if type(value) in (tuple, list):
        alpha = len(value) > 3 and value[3] or 255
        return pygame.Color(value[0], value[1], value[2], alpha)
    elif str(type(value)) in ("<class 'pygame.Color'>", "<type 'pygame.Color'>"):
        return value
    elif value in colornames:
        return colornames[value]
    else:
        raise Exception('Color set to invalid value: %s' % (repr(value)))

    if type(color) in (tuple, list):
        return pygame.Color(*color)
    return color
Get a NIC's Network.
dataset/ETHPy150Open asweigart/pygcurse/pygcurse/__init__.py/getpygamecolor--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetInstNicNetworkName