code: def saddr(address):
      
      if isinstance(address, six.string_types):
          return address
      elif isinstance(address, tuple) and len(address) >= 2 and ':' in address[0]:
          return '[{}]:{}'.format(address[0], address[1])
      elif isinstance(address, tuple) and len(address) >= 2:
          return '{}:{}'.format(*address)
      else:
          raise TypeError('illegal address type: {!s}'.format(type(address)))
docs: Return a string representation for an address.
  
      The *address* paramater can be a pipe name, an IP address tuple, or a
      socket address.
  
      The return value is always a ``str`` instance.