@classmethod
  def _remove_coding_header(cls, blob):
    """
    There is a bug in ast.parse that cause it to throw a syntax error if
    you have a header similar to...
    # coding=utf-8,

    we replace this line with something else to bypass the bug.
    :param blob: file text contents
    :return: adjusted blob
    """
    # Remove the # coding=utf-8 to avoid AST erroneous parse errors
    #   https://bugs.python.org/issue22221
    lines = blob.split('\n')
    if lines and 'coding=utf-8' in lines[0]:
      lines[0] = '#remove coding'
    return '\n'.join(lines).encode('ascii', errors='replace')
dataset/ETHPy150Open pantsbuild/pants/contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/common.py/PythonFile._remove_coding_header/original