<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def size(filename, use_cache_only=False):
 """Return the number of lines in filename. If `use_cache_only' is False, we'll try to fetch the file if it is not cached."""

    filename = unmap_file(filename)
    if filename not in file_cache:
        if not use_cache_only: cache_file(filename)
        if filename not in file_cache:
            return None
        pass
    return len(file_cache[filename].lines['plain'])