Print data to a file or STDOUT.

    Args:
        filename (str or None): If None, print to STDOUT; otherwise, print
            to the file with this name.
        data (str): Data to print.

def _print_results(filename, data):
    """Print data to a file or STDOUT.

    Args:
        filename (str or None): If None, print to STDOUT; otherwise, print
            to the file with this name.
        data (str): Data to print.
    """
    if filename:
        with open(filename, 'wb') as f:
            f.write(data)
    else:
        print data