<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_colour_handler(extranames: List[str] = None, with_process_id: bool = False, with_thread_id: bool = False, stream: TextIO = None) -> logging.StreamHandler: """ Gets a colour log handler using a standard format. Args: extranames: additional names to append to the logger's name with_process_id: include the process ID in the logger's name? with_thread_id: include the thread ID in the logger's name? stream: ``TextIO`` stream to send log output to Returns: the :class:`logging.StreamHandler` """

    fmt = "%(white)s%(asctime)s.%(msecs)03d"  # this is dim white = grey
    if with_process_id or with_thread_id:
        procinfo = []  # type: List[str]
        if with_process_id:
            procinfo.append("p%(process)d")
        if with_thread_id:
            procinfo.append("t%(thread)d")
        fmt += " [{}]".format(".".join(procinfo))
    extras = ":" + ":".join(extranames) if extranames else ""
    fmt += " %(name)s{extras}:%(levelname)s: ".format(extras=extras)
    fmt += "%(reset)s%(log_color)s%(message)s"
    cf = ColoredFormatter(fmt,
                          datefmt=LOG_DATEFMT,
                          reset=True,
                          log_colors=LOG_COLORS,
                          secondary_log_colors={},
                          style='%')
    ch = logging.StreamHandler(stream)
    ch.setFormatter(cf)
    return ch