<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def listdir_stat(dirname, show_hidden=True):
 """Returns a list of tuples for each file contained in the named directory, or None if the directory does not exist. Each tuple contains the filename, followed by the tuple returned by calling os.stat on the filename. """

    import os
    try:
        files = os.listdir(dirname)
    except OSError:
        return None
    if dirname == '/':
        return list((file, stat('/' + file)) for file in files if is_visible(file) or show_hidden)
    return list((file, stat(dirname + '/' + file)) for file in files if is_visible(file) or show_hidden)