parameters: (self, data)
docstring: Send `data' to the server.
          ``data`` can be a string object, a bytes object, an array object, a
          file-like object that supports a .read() method, or an iterable object.
docstring_summary: Send `data' to the server.
          ``data`` can be a string object, a bytes object, an array object, a
          file-like object that supports a .read() method, or an iterable object.
docstring_tokens: Send data to the server . data can be a string object a bytes object an array object a file - like object that supports a . read () method or an iterable object .
function: def send(self, data):
          """Send `data' to the server.
          ``data`` can be a string object, a bytes object, an array object, a
          file-like object that supports a .read() method, or an iterable object.
          """
  
          if self.sock is None:
              if self.auto_open:
                  self.connect()
              else:
                  raise NotConnected()
  
          if self.debuglevel > 0:
              print("send:", repr(data))
          if hasattr(data, "read") :
              if self.debuglevel > 0:
                  print("sendIng a read()able")
              encode = self._is_textIO(data)
              if encode and self.debuglevel > 0:
                  print("encoding file using iso-8859-1")
              while 1:
                  datablock = data.read(self.blocksize)
                  if not datablock:
                      break
                  if encode:
                      datablock = datablock.encode("iso-8859-1")
                  self.sock.sendall(datablock)
              return
          try:
              self.sock.sendall(data)
          except TypeError:
              if isinstance(data, collections.abc.Iterable):
                  for d in data:
                      self.sock.sendall(d)
              else:
                  raise TypeError("data should be a bytes-like object "
                                  "or an iterable, got %r" % type(data))
function_tokens: def send ( self , data ) : if self . sock is None : if self . auto_open : self . connect ( ) else : raise NotConnected ( ) if self . debuglevel > 0 : print ( "send:" , repr ( data ) ) if hasattr ( data , "read" ) : if self . debuglevel > 0 : print ( "sendIng a read()able" ) encode = self . _is_textIO ( data ) if encode and self . debuglevel > 0 : print ( "encoding file using iso-8859-1" ) while 1 : datablock = data . read ( self . blocksize ) if not datablock : break if encode : datablock = datablock . encode ( "iso-8859-1" ) self . sock . sendall ( datablock ) return try : self . sock . sendall ( data ) except TypeError : if isinstance ( data , collections . abc . Iterable ) : for d in data : self . sock . sendall ( d ) else : raise TypeError ( "data should be a bytes-like object " "or an iterable, got %r" % type ( data ) )