code: def validate_filename(filename, platform=None, min_len=1, max_len=_DEFAULT_MAX_FILENAME_LEN):
      
  
      FileNameSanitizer(platform=platform, min_len=min_len, max_len=max_len).validate(filename)
docs: Verifying whether the ``filename`` is a valid file name or not.
  
      Args:
          filename (str):
              Filename to validate.
          platform (str, optional):
              .. include:: platform.txt
          min_len (int, optional):
              Minimum length of the ``filename``. The value must be greater or equal to one.
              Defaults to ``1``.
          max_len (int, optional):
              Maximum length the ``filename``. The value must be lower than:
  
                  - ``Linux``: 4096
                  - ``macOS``: 1024
                  - ``Windows``: 260
                  - ``Universal``: 260
  
              Defaults to ``255``.
  
      Raises:
          InvalidLengthError:
              If the ``filename`` is longer than ``max_len`` characters.
          InvalidCharError:
              If the ``filename`` includes invalid character(s) for a filename:
              |invalid_filename_chars|.
              The following characters are also invalid for Windows platform:
              |invalid_win_filename_chars|.
          ReservedNameError:
              If the ``filename`` equals reserved name by OS.
              Windows reserved name is as follows:
              ``"CON"``, ``"PRN"``, ``"AUX"``, ``"NUL"``, ``"COM[1-9]"``, ``"LPT[1-9]"``.
  
      Example:
          :ref:`example-validate-filename`
  
      See Also:
          `Naming Files, Paths, and Namespaces (Windows)
          <https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx>`__