code: def match_filename( filename ):
      
      f = next( ( '{}{}'.format( filename, extension ) for extension in [ '', '.gz' ]
          if Path( '{}{}'.format( filename, extension ) ).is_file() ), None ) 
      return f
docs: Checks whether a file exists, either as named, or as a a gzippped file (filename.gz)
  
      Args:
          (Str): The root filename.
  
      Returns:
          (Str|None): if the file exists (either as the root filename, or gzipped), the return
              value will be the actual filename. If no matching filename is found the return
              value is set to None