code: def encode_max_segments_accepted(arg):
      
      # unspecified
      if not arg:
          return 0
  
      if arg > 64:
          return 7
  
      # the largest number not greater than the arg
      for i in range(6, 0, -1):
          if _max_segments_accepted_encoding[i] <= arg:
              return i
  
      raise ValueError("invalid max max segments accepted: %r" % (arg,))
docs: Encode the maximum number of segments the device will accept, Section
      20.1.2.4, and if the device says it can only accept one segment it shouldn't
      say that it supports segmentation!