'Parse the restart policy from the configuration of a Docker container
in the format returned by ``self._client.inspect_container`` and return
an ``IRestartPolicy``.
:param dict data: The data structure representing the restart policy of
a container, e.g.
{"Name": "policy-name", "MaximumRetryCount": 0}
:return IRestartPolicy: The model of the restart policy.
:raises ValueError: if an unknown policy is passed.'

def _parse_restart_policy(self, data):

    POLICIES = {u'': (lambda data: RestartNever()), u'always': (lambda data: RestartAlways()), u'on-failure': (lambda data: RestartOnFailure(maximum_retry_count=(data[u'MaximumRetryCount'] or None)))}
    try:
        return POLICIES[data[u'Name']](data)
    except KeyError:
        raise ValueError(('Unknown    restart    policy:    %r' % (data[u'Name'],)))
