def bind(self, socket, addr_or_name=None):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if (not (socket.addr is None)):
        raise Error(errno.EINVAL)
    if (addr_or_name is None):
        self._bind_by_none(socket)
    elif (type(addr_or_name) is IntType):
        self._bind_by_addr(socket, addr_or_name)
    elif (type(addr_or_name) is StringType):
        self._bind_by_name(socket, addr_or_name)
    else:
        raise Error(errno.EFAULT)
def bind(self, socket, addr_or_name=None):
    if (not isinstance(socket, TransmissionControlObject)):
        raise Error(errno.ENOTSOCK)
    if (not (socket.addr is None)):
        raise Error(errno.EINVAL)
    if (addr_or_name is None):
        self._bind_by_none(socket)
    elif (type(addr_or_name) is IntType):
        self._bind_by_addr(socket, addr_or_name)
    elif (type(addr_or_name) is StringType):
        self._bind_by_name(socket, addr_or_name)
    else:
        raise Error(errno.EFAULT)