def METHOD_NAME(source):
    """Remove most comments and docstrings from Python source code.
    """
    if not isinstance(source, mitogen.core.UnicodeType):
        source = source.decode('utf-8')
    tokens = tokenize.generate_tokens(StringIO(source).readline)
    tokens = strip_comments(tokens)
    tokens = strip_docstrings(tokens)
    tokens = reindent(tokens)
    return tokenize.untokenize(tokens)