<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exec_start(self, exec_id, detach=False, tty=False, stream=False, socket=False, demux=False):
 """ Start a previously set up exec instance. Args: exec_id (str):
 ID of the exec instance detach (bool):
 If true, detach from the exec command. Default: False tty (bool):
 Allocate a pseudo-TTY. Default: False stream (bool):
 Stream response data. Default: False socket (bool):
 Return the connection socket to allow custom read/write operations. demux (bool):
 Return stdout and stderr separately Returns: (generator or str or tuple):
 If ``stream=True``, a generator yielding response chunks. If ``socket=True``, a socket object for the connection. A string containing response data otherwise. If ``demux=True``, a tuple with two elements of type byte: stdout and stderr. Raises: :py:class:`docker.errors.APIError` If the server returns an error. """

        # we want opened socket if socket == True

        data = {
            'Tty': tty,
            'Detach': detach
        }

        headers = {} if detach else {
            'Connection': 'Upgrade',
            'Upgrade': 'tcp'
        }

        res = self._post_json(
            self._url('/exec/{0}/start', exec_id),
            headers=headers,
            data=data,
            stream=True
        )
        if detach:
            return self._result(res)
        if socket:
            return self._get_raw_response_socket(res)
        return self._read_from_socket(res, stream, tty=tty, demux=demux)