code: def _dms_formatter(latitude, longitude, mode, unistr=False):
      
      if unistr:
          chars = ('°', '′', '″')
      else:
          chars = ('°', "'", '"')
  
      latitude_dms = tuple(map(abs, utils.to_dms(latitude, mode)))
      longitude_dms = tuple(map(abs, utils.to_dms(longitude, mode)))
      text = []
      if mode == 'dms':
          text.append('%%02i%s%%02i%s%%02i%s' % chars % latitude_dms)
      else:
          text.append('%%02i%s%%05.2f%s' % chars[:2] % latitude_dms)
      text.append('S' if latitude < 0 else 'N')
      if mode == 'dms':
          text.append(', %%03i%s%%02i%s%%02i%s' % chars % longitude_dms)
      else:
          text.append(', %%03i%s%%05.2f%s' % chars[:2] % longitude_dms)
      text.append('W' if longitude < 0 else 'E')
      return text
docs: Generate a human readable DM/DMS location string.
  
      Args:
          latitude (float): Location's latitude
          longitude (float): Location's longitude
          mode (str): Coordinate formatting system to use
          unistr (bool): Whether to use extended character set