<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_container( self, container, blkio_weight=None, cpu_period=None, cpu_quota=None, cpu_shares=None, cpuset_cpus=None, cpuset_mems=None, mem_limit=None, mem_reservation=None, memswap_limit=None, kernel_memory=None, restart_policy=None ):
 """ Update resource configs of one or more containers. Args: container (str):
 The container to inspect blkio_weight (int):
 Block IO (relative weight), between 10 and 1000 cpu_period (int):
 Limit CPU CFS (Completely Fair Scheduler) period cpu_quota (int):
 Limit CPU CFS (Completely Fair Scheduler) quota cpu_shares (int):
 CPU shares (relative weight) cpuset_cpus (str):
 CPUs in which to allow execution cpuset_mems (str):
 MEMs in which to allow execution mem_limit (int or str):
 Memory limit mem_reservation (int or str):
 Memory soft limit memswap_limit (int or str):
 Total memory (memory + swap), -1 to disable swap kernel_memory (int or str):
 Kernel memory limit restart_policy (dict):
 Restart policy dictionary Returns: (dict):
 Dictionary containing a ``Warnings`` key. Raises: :py:class:`docker.errors.APIError` If the server returns an error. """

        url = self._url('/containers/{0}/update', container)
        data = {}
        if blkio_weight:
            data['BlkioWeight'] = blkio_weight
        if cpu_period:
            data['CpuPeriod'] = cpu_period
        if cpu_shares:
            data['CpuShares'] = cpu_shares
        if cpu_quota:
            data['CpuQuota'] = cpu_quota
        if cpuset_cpus:
            data['CpusetCpus'] = cpuset_cpus
        if cpuset_mems:
            data['CpusetMems'] = cpuset_mems
        if mem_limit:
            data['Memory'] = utils.parse_bytes(mem_limit)
        if mem_reservation:
            data['MemoryReservation'] = utils.parse_bytes(mem_reservation)
        if memswap_limit:
            data['MemorySwap'] = utils.parse_bytes(memswap_limit)
        if kernel_memory:
            data['KernelMemory'] = utils.parse_bytes(kernel_memory)
        if restart_policy:
            if utils.version_lt(self._version, '1.23'):
                raise errors.InvalidVersion(
                    'restart policy update is not supported '
                    'for API version < 1.23'
                )
            data['RestartPolicy'] = restart_policy

        res = self._post_json(url, data=data)
        return self._result(res, True)