Query the image record from database, if imagename is None, all
        of the image records will be returned, otherwise only the specified
        image record will be returned.
194021
def image_query_record(self, imagename=None):
        """"""

        if imagename:
            with get_image_conn() as conn:
                result = conn.execute("SELECT * FROM image WHERE "
                                      "imagename=?", (imagename,))
                image_list = result.fetchall()
            if not image_list:
                obj_desc = "Image with name: %s" % imagename
                raise exception.SDKObjectNotExistError(obj_desc=obj_desc,
                                                   modID=self._module_id)
        else:
            with get_image_conn() as conn:
                result = conn.execute("SELECT * FROM image")
                image_list = result.fetchall()

        # Map each image record to be a dict, with the key is the field name in
        # image DB
        image_keys_list = ['imagename', 'imageosdistro', 'md5sum',
                      'disk_size_units', 'image_size_in_bytes', 'type',
                      'comments']

        image_result = []
        for item in image_list:
            image_item = dict(zip(image_keys_list, item))
            image_result.append(image_item)
        return image_result
432245
public function getImages(ImagesQuery $query = null) {
        if (!$query) {
            $query = new ImagesQuery();
        }

        $params = array(
            'user' => $this->getUser(),
            'page' => $query->page(),
            'limit' => $query->limit(),
        );

        if ($query->metadata()) {
            $params['metadata'] = true;
        }

        if ($from = $query->from()) {
            $params['from'] = $from;
        }

        if ($to = $query->to()) {
            $params['to'] = $to;
        }

        if ($fields = $query->fields()) {
            $params['fields'] = $fields;
        }

        if ($sort = $query->sort()) {
            $params['sort'] = $sort;
        }

        if ($ids = $query->ids()) {
            $params['ids'] = $ids;
        }

        if ($checksums = $query->checksums()) {
            $params['checksums'] = $checksums;
        }

        if ($originalChecksums = $query->originalChecksums()) {
            $params['originalChecksums'] = $originalChecksums;
        }

        $response = $this->getCommand('GetImages', $params)->execute();
        $response['images'] = array_map(
            array('ImboClient\Helper\PublicKeyFallback', 'fallback'),
            $response['images']
        );

        return $response;
    }
870859
@Override
  public Images getAvailableImages(Integer pageNo, Integer perPage)
      throws DigitalOceanException, RequestUnsuccessfulException {
    validatePageNo(pageNo);
    return (Images) perform(new ApiRequest(ApiAction.AVAILABLE_IMAGES, pageNo, perPage)).getData();
  }
309572
async def get_object_or_none(cls, db, **kwargs):
        
        async for obj in cls.filter_by(db, limit=1, **kwargs):
            return obj
        return None
38578
def has_image(self, image_name):
        

        try:
            self.docker_client.images.get(image_name)
            return True
        except docker.errors.ImageNotFound:
            return False
674894
def search_image(name=None, path=['.']):
    
    name = strutils.decode(name)
    for image_dir in path:
        if not os.path.isdir(image_dir):
            continue
        image_dir = strutils.decode(image_dir)
        image_path = os.path.join(image_dir, name)
        if os.path.isfile(image_path):
            return strutils.encode(image_path)

        for image_path in list_all_image(image_dir):
            if not image_name_match(name, image_path):
                continue
            return strutils.encode(image_path)
    return None
90740
def get_records(self, sequence_id, gt=None, gte=None, lt=None, lte=None, limit=None,
                    query_ascending=True, results_ascending=True):
        
1136364
def query(options, collection_name, num_to_skip,
          num_to_return, query, field_selector, opts, check_keys=False):
    
    data = struct.pack("<I", options)
    data += bson._make_c_string(collection_name)
    data += struct.pack("<i", num_to_skip)
    data += struct.pack("<i", num_to_return)
    encoded = bson.BSON.encode(query, check_keys, opts)
    data += encoded
    max_bson_size = len(encoded)
    if field_selector is not None:
        encoded = bson.BSON.encode(field_selector, False, opts)
        data += encoded
        max_bson_size = max(len(encoded), max_bson_size)
    (request_id, query_message) = __pack_message(2004, data)
    return (request_id, query_message, max_bson_size)
994433
def is_image(name, exts=None):
    """"""

    default = ['jpg', 'png', 'gif', 'jpeg']
    if exts:
        default += exts

    flag = False
    for ext in default:
        if name.lower().endswith(ext):
            flag = True
            break
    return flag
629292
def image_search(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.search_images(**kwargs)
1229024
def is_image(self, key):
        """"""
        data = self.model.get_data()
        return isinstance(data[key], Image)
597495
def _get_album_or_image(json, imgur):
    """"""
    if json['is_album']:
        return Gallery_album(json, imgur, has_fetched=False)
    return Gallery_image(json, imgur)
444505
def has_cover_image?(check = nil)
    	post = obtain_record(check)
    	!post.blank? && !post.cover_image.blank? ? true : false
    end
420673
def all(self, query=None):
        

        if query is None:
            query = {}
        return self.client._get(
            self._url(),
            query
        )
1127268
def _get_image_information(self):
        
        result = yield from self.manager.query("GET", "images/{}/json".format(self._image))
        return result
613783
def image_get(request, image_id):
    """"""
    image = glanceclient(request).images.get(image_id)
    return Image(image)
1195250
def previous(params = {})
      query = Picture.ransack(params[:q])
      Picture.search_by(params, query).where("name < ?", name).last
    end