def get_pyfile_pair(filename):
    """ Given the filename of a Python source or byte compiled filename,
  returns a pair of the source and byte compiled filename. """
    if filename.endswith('.py'):
        filename = filename[:-3]
    elif filename.endswith('.pyc'):
        filename = filename[:-4]
    else:
        raise ValueError('filename does not end with .py or .pyc')
    return filename + '.py', filename + '.pyc'
