docs: def detect_format(fn, format_bytes=50, verbose=False, *args, **kwargs):
      """Detect Amira file format (AmiraMesh or HyperSurface)
      
      :param str fn: file name
      :param int format_bytes: number of bytes in which to search for the format [default: 50]
      :param bool verbose: verbose (default) or not
      :return str file_format: either ``AmiraMesh`` or ``HyperSurface``
      """
      assert format_bytes > 0
      assert verbose in [True, False]
      
      with open(fn, 'rb') as f:
          rough_header = f.read(format_bytes)
          
          if re.match(r'.*AmiraMesh.*', rough_header):
              file_format = "AmiraMesh"
          elif re.match(r'.*HyperSurface.*', rough_header):
              file_format = "HyperSurface"
          else:
              file_format = "Undefined"
      
      if verbose:
          print >> sys.stderr,  "{} file detected...".format(file_format)
      
      return file_format