docs: def value_to_display(value, minmax=False, level=0):
      """Convert value for display purpose"""
      # To save current Numpy printoptions
      np_printoptions = FakeObject
  
      try:
          numeric_numpy_types = (int64, int32, int16, int8,
                                 uint64, uint32, uint16, uint8,
                                 float64, float32, float16,
                                 complex128, complex64, bool_)
          if ndarray is not FakeObject:
              # Save printoptions
              np_printoptions = get_printoptions()
              # Set max number of elements to show for Numpy arrays
              # in our display
              set_printoptions(threshold=10)
          if isinstance(value, recarray):
              if level == 0:
                  fields = value.names
                  display = 'Field names: ' + ', '.join(fields)
              else:
                  display = 'Recarray'
          elif isinstance(value, MaskedArray):
              display = 'Masked array'
          elif isinstance(value, ndarray):
              if level == 0:
                  if minmax:
                      try:
                          display = 'Min: %r\nMax: %r' % (value.min(), value.max())
                      except (TypeError, ValueError):
                          if value.dtype.type in numeric_numpy_types:
                              display = str(value)
                          else:
                              display = default_display(value)
                  elif value.dtype.type in numeric_numpy_types:
                      display = str(value)
                  else:
                      display = default_display(value)
              else:
                  display = 'Numpy array'
          elif any([type(value) == t for t in [list, set, tuple, dict]]):
              display = collections_display(value, level+1)
          elif isinstance(value, Image):
              if level == 0:
                  display = '%s  Mode: %s' % (address(value), value.mode)
              else:
                  display = 'Image'
          elif isinstance(value, DataFrame):
              if level == 0:
                  cols = value.columns
                  if PY2 and len(cols) > 0:
                      # Get rid of possible BOM utf-8 data present at the
                      # beginning of a file, which gets attached to the first
                      # column header when headers are present in the first
                      # row.
                      # Fixes Issue 2514
                      try:
                          ini_col = to_text_string(cols[0], encoding='utf-8-sig')
                      except:
                          ini_col = to_text_string(cols[0])
                      cols = [ini_col] + [to_text_string(c) for c in cols[1:]]
                  else:
                      cols = [to_text_string(c) for c in cols]
                  display = 'Column names: ' + ', '.join(list(cols))
              else:
                  display = 'Dataframe'
          elif isinstance(value, NavigableString):
              # Fixes Issue 2448
              display = to_text_string(value)
              if level > 0:
                  display = u"'" + display + u"'"
          elif isinstance(value, Index):
              if level == 0:
                  try:
                      display = value._summary()
                  except AttributeError:
                      display = value.summary()
              else:
                  display = 'Index'
          elif is_binary_string(value):
              # We don't apply this to classes that extend string types
              # See issue 5636
              if is_type_text_string(value):
                  try:
                      display = to_text_string(value, 'utf8')
                      if level > 0:
                          display = u"'" + display + u"'"
                  except:
                      display = value
                      if level > 0:
                          display = b"'" + display + b"'"
              else:
                  display = default_display(value)
          elif is_text_string(value):
              # We don't apply this to classes that extend string types
              # See issue 5636
              if is_type_text_string(value):
                  display = value
                  if level > 0:
                      display = u"'" + display + u"'"
              else:
                  display = default_display(value)
          elif (isinstance(value, datetime.date) or
                isinstance(value, datetime.timedelta)):
              display = str(value)
          elif (isinstance(value, NUMERIC_TYPES) or
                isinstance(value, bool) or
                isinstance(value, numeric_numpy_types)):
              display = repr(value)
          else:
              if level == 0:
                  display = default_display(value)
              else:
                  display = default_display(value, with_module=False)
      except:
          display = default_display(value)
  
      # Truncate display at 70 chars to avoid freezing Spyder
      # because of large displays
      if len(display) > 70:
          if is_binary_string(display):
              ellipses = b' ...'
          else:
              ellipses = u' ...'
          display = display[:70].rstrip() + ellipses
  
      # Restore Numpy printoptions
      if np_printoptions is not FakeObject:
          set_printoptions(**np_printoptions)
  
      return display