code: def identity_to_string(identity_dict):
      
      result = []
      if identity_dict.get('proto'):
          result.append(identity_dict['proto'] + '://')
      if identity_dict.get('user'):
          result.append(identity_dict['user'] + '@')
      result.append(identity_dict['host'])
      if identity_dict.get('port'):
          result.append(':' + identity_dict['port'])
      if identity_dict.get('path'):
          result.append(identity_dict['path'])
      log.debug('identity parts: %s', result)
      return ''.join(result)
docs: Dump Identity dictionary into its string representation.