Get the container with the given name or ID (str). No side effects.
    Idempotent. Returns None if the container does not exist. Otherwise, the
    continer is returned
503317
def getContainer(name_or_id):
    ''''''
    require_str("name_or_id", name_or_id)

    container = None
    try:
        container = client.containers.get(name_or_id)
    except NotFound as exc:
        # Return None when the container is not found
        pass
    except APIError as exc:
        eprint("Unhandled error")
        raise exc

    return container
1010762
def get_by_id(cls, id):
        

        if any((isinstance(id, basestring) and id.isdigit(), isinstance(id,
               (int, float)))):
            return cls.query.get(int(id))
        return None
335295
def container_exists(self, id=None, name=None):
        
        exists = False
        if id and self.container_by_id(id):
            exists = True
        elif name and self.container_by_name(name):
            exists = True

        return exists
841837
def _get_one(self, id):
        
        try:
            return self._to_dict(models.User.objects.get(pk=id))
        except models.User.DoesNotExist:
            raise errors.NotFound()
74594
def get(self, id_):
        
        if self.api.queue_exists(id_):
            return Queue(self, {"queue": {"name": id_, "id_": id_}}, key="queue")
        raise exc.NotFound("The queue '%s' does not exist." % id_)
574510
def _get_object(self, name):
        
        if self.use_pyrax:
            try:
                return self.container.get_object(name)
            except pyrax.exceptions.NoSuchObject:
                return None
        elif swiftclient:
            try:
                return self.container.get_object(name)
            except swiftclient.exceptions.ClientException:
                return None
        else:
            return self.container.get_object(name)
829340
function(cid) {

    // Find a generic container.
    return findGenericContainer(cid)
    .then(function(container) {
      if (container) {
        // Map container id to a docker container.
        return dockerInstance().call('getContainer', container.id);
      } else {
        return undefined;
      }
    });

  }
214800
def get(self, name: str, sig: Tuple) -> Optional[object]:
        
        if name not in self._cache:
            return None
        if self._cache[name].sig != sig:
            del self._cache[name]
            self._update()
            return None
        with open(self._cache[name].loc, 'rb') as f:
            return pickle.load(f)
38407
def get(self, id):
        
        id = self.as_id(id)
        url = '%s/%s' % (self, id)
        response = self.http.get(url, auth=self.auth)
        response.raise_for_status()
        return response.json()
1300047
def getNamedItem(self, name: str) -> Optional[Attr]:
        
        return self._dict.get(name, None)
955279
def get_sds_by_id(self,id):
        
        for sds in self.sds:
            if sds.id == id:
                return sds
        raise KeyError("SDS with that ID not found")
630676
def pid(name):
    '''
    
    '''
    try:
        return int(info(name).get('PID'))
    except (TypeError, ValueError) as exc:
        raise CommandExecutionError(
            'Unable to get PID for container \'{0}\': {1}'.format(name, exc)
        )
678879
public Container getMandatoryContainer(String containerIdOrName) throws DockerAccessException {
        Container container = getContainer(containerIdOrName);
        if (container == null) {
            throw new DockerAccessException("Cannot find container %s", containerIdOrName);
        }
        return container;
    }
604779
def get_project(id=None, name=None):
    
    content = get_project_raw(id, name)
    if content:
        return utils.format_json(content)
528617
def inspect(self, refresh=True):
        
        if refresh or not self._inspect_data:
            identifier = self._id or self.name
            if not identifier:
                raise ConuException("This container does not have a valid identifier.")
            self._inspect_data = self._inspect(identifier)
        return self._inspect_data
39494
def _get_container_id(self, labels):
        
        namespace = CadvisorPrometheusScraperMixin._get_container_label(labels, "namespace")
        pod_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "pod_name")
        container_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "container_name")
        return self.pod_list_utils.get_cid_by_name_tuple((namespace, pod_name, container_name))
1051359
def get(cls, id):
        '''  '''

        if not id:
            return None

        redis = cls.get_redis()
        key = '{}:{}:obj'.format(cls.cls_key(), id)

        if not redis.exists(key):
            return None

        obj = cls(id=id)
        obj._persisted = True

        data = debyte_hash(redis.hgetall(key))

        for fieldname, field in obj.proxy:
            value = field.recover(data, redis)

            setattr(
                obj,
                fieldname,
                value
            )

        return obj