<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run(self, container, input_data=None, warm=False):
 """ Create and run a Docker container based on the given configuration. :param samcli.local.docker.container.Container container: Container to create and run :param input_data: Optional. Input data sent to the container through container's stdin. :param bool warm: Indicates if an existing container can be reused. Defaults False ie. a new container will be created for every request. :raises DockerImagePullFailedException: If the Docker image was not available in the server """


        if warm:
            raise ValueError("The facility to invoke warm container does not exist")

        image_name = container.image

        is_image_local = self.has_image(image_name)

        # Skip Pulling a new image if: a) Image name is samcli/lambda OR b) Image is available AND
        # c) We are asked to skip pulling the image
        if (is_image_local and self.skip_pull_image) or image_name.startswith('samcli/lambda'):
            LOG.info("Requested to skip pulling images ...\n")
        else:
            try:
                self.pull_image(image_name)
            except DockerImagePullFailedException:
                if not is_image_local:
                    raise DockerImagePullFailedException(
                        "Could not find {} image locally and failed to pull it from docker.".format(image_name))

                LOG.info(
                    "Failed to download a new %s image. Invoking with the already downloaded image.", image_name)

        if not container.is_created():
            # Create the container first before running.
            # Create the container in appropriate Docker network
            container.network_id = self.docker_network_id
            container.create()

        container.start(input_data=input_data)