def perform_step(file_contents, step):
    """Performs a step of the transformation.

    :param text file_contents: Contends of the cheetah template
    :param function step: Function taking xmldoc and returning new contents
    :returns: new contents of the file.
    """
    assert type(file_contents) is not bytes
    xmldoc = parse(file_contents)
    return step(xmldoc)
def perform_step ( file_contents , step ) : assert type ( file_contents ) is not bytes xmldoc = parse ( file_contents ) return step ( xmldoc )
Performs a step of the transformation.

    :param text file_contents: Contends of the cheetah template
    :param function step: Function taking xmldoc and returning new contents
    :returns: new contents of the file.