def list_files(client, dataset, total=None, limit=None):
    """List dataset files.

	Args:
	    :client: the pyAMI client [ pyAMI.client.Client ]
	    :dataset: the logical dataset name [ str ]
	    :total: produce a grand total [ bool | None]
	    :limit: limit number of results [ int | tuple<int,int> | None ]

	Returns:
	    an array of python dictionnaries.
	"""
    command = ['AMIListFiles', '-logicalDatasetName="%s"' % dataset]
    if total:
        command.append('-total=yes')
    else:
        command.append('-total=no')
    if limit:
        if isinstance(limit, (list, tuple)):
            command.append('-limit=%i,%i' % (limit[0], limit[1]))
        else:
            command.append('-limit=0,%i' % limit)
    return client.execute(command, format='dom_object').get_rows()
