docs: def find_version(segments, error, eci, micro, is_sa=False):
      """\
  
      """
      assert not (eci and micro)
      min_version = 1 if micro is False else consts.VERSION_M1
      max_version = 40 if micro is not True else consts.VERSION_M4
      if min_version < 1:
          min_version = max([find_minimum_version_for_mode(mode) for mode in segments.modes])
      if error is not None and micro is not False:
          min_version = consts.VERSION_M2
      for version in range(min_version, max_version + 1):
          if error is None and version != consts.VERSION_M1:
              error = consts.ERROR_LEVEL_L
          found = False
          try:
              found = consts.SYMBOL_CAPACITY[version][error] >= segments.bit_length_with_overhead(version, eci, is_sa)
          except KeyError:
              pass
          if found:
              return version
      help_txt = ''
      if micro is None:
          help_txt = '(Micro) '
      elif micro:
          help_txt = 'Micro '
      raise DataOverflowError('Data too large. No {0}QR Code can handle the '
                              'provided data'.format(help_txt))