Return camera extended properties.
438416
def get_camera_extended_properties(self):
        """"""
        resource = 'cameras/{}'.format(self.device_id)
        resource_event = self.publish_and_get_event(resource)

        if resource_event is None:
            return None

        self._camera_extended_properties = resource_event.get('properties')
        return self._camera_extended_properties
836624
def properties(self):
        '''
        
        '''
        props = {}
        for line in self.adb_shell(['getprop']).splitlines():
            m = _PROP_PATTERN.match(line)
            if m:
                props[m.group('key')] = m.group('value')
        return props
236401
def getSizes(self):
        
        method = 'flickr.photos.getSizes'
        data = _doget(method, photo_id=self.id)
        ret = []
        # The given props are those that we return and the according types, since
        # return width and height as string would make "75">"100" be True, which 
        # is just error prone.
        props = {'url':str,'width':int,'height':int,'label':str,'source':str,'text':str}
        for psize in data.rsp.sizes.size:
            d = {}
            for prop,convert_to_type in props.items():
                d[prop] = convert_to_type(getattr(psize, prop))
            ret.append(d)
        return ret
1032940
def getCameraParams(self):
        '''
        
        '''
        c = self.coeffs['cameraMatrix']
        fx = c[0][0]
        fy = c[1][1]
        cx = c[0][2]
        cy = c[1][2]
        k1, k2, p1, p2, k3 = tuple(self.coeffs['distortionCoeffs'].tolist()[0])
        return fx, fy, cx, cy, k1, k2, k3, p1, p2
1074181
def check_bounds(self):
        """"""
        if not (self.camera_bounds == None):
            if self.__pan.X < self.camera_bounds.Left:
                self.__pan[0] = self.camera_bounds.Left

            if self.__pan.X > self.camera_bounds.Right:
                self.__pan[0] = self.camera_bounds.Right

            if self.__pan.Y < self.camera_bounds.Top:
                self.__pan[1] = self.camera_bounds.Top

            if self.__pan.Y > self.camera_bounds.Bottom:
                self.__pan[1] = self.camera_bounds.Bottom
519115
def _set_camera_properties(self, msg):
        
        focal_x = msg.K[0]
        focal_y = msg.K[4]
        center_x = msg.K[2]
        center_y = msg.K[5]
        im_height = msg.height
        im_width = msg.width
        self._camera_intr = CameraIntrinsics(self._frame, focal_x, focal_y,
                                             center_x, center_y,
                                             height=im_height,
                                             width=im_width)
1089625
def get_data(self, ftype='normal'):
        
        camfile_p = ffi.new("CameraFile**")
        lib.gp_file_new(camfile_p)
        lib.gp_camera_file_get(
            self._cam._cam, self.directory.path.encode(), self.name.encode(),
            backend.FILE_TYPES[ftype], camfile_p[0], self._cam._ctx)
        data_p = ffi.new("char**")
        length_p = ffi.new("unsigned long*")
        lib.gp_file_get_data_and_size(camfile_p[0], data_p, length_p)
        byt = bytes(ffi.buffer(data_p[0], length_p[0]))
        # gphoto2 camera files MUST be freed.
        lib.gp_file_free(camfile_p[0])
        # just to be safe.
        del data_p, length_p, camfile_p
        return byt
1219812
def camera_action(self, mouse_pos):
    """"""
    action = sc_pb.Action()
    action_spatial = mouse_pos.action_spatial(action)
    mouse_pos.obs_pos.assign_to(action_spatial.camera_move.center_minimap)
    return action
848885
def supported_cameras():
    
    ctx = lib.gp_context_new()
    abilities_list_p = new_gp_object("CameraAbilitiesList")
    lib.gp_abilities_list_load(abilities_list_p, ctx)
    abilities = ffi.new("CameraAbilities*")
    out = []
    for idx in range(lib.gp_abilities_list_count(abilities_list_p)):
        lib.gp_abilities_list_get_abilities(abilities_list_p, idx, abilities)
        if abilities.device_type == lib.GP_DEVICE_STILL_CAMERA:
            libname = os.path.basename(ffi.string(abilities.library)
                                       .decode())
            out.append((ffi.string(abilities.model).decode(), libname))
    lib.gp_abilities_list_free(abilities_list_p)
    key_func = lambda name, driver: driver
    out = sorted(out, key=key_func)
    return {k: tuple(x[0] for x in v)
            for k, v in itertools.groupby(out, key_func)}
    return out
589326
def get_customs_properties_by_inheritance(self, obj):
        
        for t_id in obj.templates:
            template = self.templates[t_id]
            tpl_cv = self.get_customs_properties_by_inheritance(template)
            if tpl_cv:
                for prop in tpl_cv:
                    if prop not in obj.customs:
                        value = tpl_cv[prop]
                    else:
                        value = obj.customs[prop]
                    if obj.has_plus(prop):
                        value.insert(0, obj.get_plus_and_delete(prop))
                        # value = self.get_plus_and_delete(prop) + ',' + value
                    obj.customs[prop] = value
        for prop in obj.customs:
            value = obj.customs[prop]
            if obj.has_plus(prop):
                value.insert(0, obj.get_plus_and_delete(prop))
                obj.customs[prop] = value
        # We can get custom properties in plus, we need to get all
        # entires and put
        # them into customs
        cust_in_plus = obj.get_all_plus_and_delete()
        for prop in cust_in_plus:
            obj.customs[prop] = cust_in_plus[prop]
        return obj.customs
133652
def parse_extended_properties(extended_properties) # :nodoc
      query_parts = []
      ['shared', 'private'].each do |prop_type|
        next unless extended_properties[prop_type]
        query_parts << extended_properties[prop_type].map {|key, value| (prop_type == "shared" ? "sharedExtendedProperty=" : "privateExtendedProperty=") + "#{key}%3D#{value}" }.join("&")
      end
      query_parts.join('&')
    end
890486
def look_at(self, x, y, z):
        """"""
        for camera in self.cameras:
            camera.look_at(x, y, z)
828979
def _get_extended(scene, resp):
    
    root = ElementTree.fromstring(resp.text)
    items = root.findall("eemetadata:metadataFields/eemetadata:metadataField", NAMESPACES)
    scene['extended'] = {item.attrib.get('name').strip(): xsi.get(item[0]) for item in items}

    return scene
796079
def frame2expnum(frameid):
    """"""
    result = {}
    parts = re.search('(?P<expnum>\d{7})(?P<type>\S)(?P<ccd>\d\d)', frameid)
    assert parts is not None
    result['expnum'] = parts.group('expnum')
    result['ccd'] = parts.group('ccd')
    result['version'] = parts.group('type')
    return result
393850
def properties(self):
        """"""
        value = self._schema.get("properties", {})
        if not isinstance(value, dict):
            raise SchemaError(
                "properties value {0!r} is not an object".format(value))
        return value
576936
def get_extents(self):
        """"""
        if self._sprite_dirty:
            # redrawing merely because we need fresh extents of the sprite
            context = cairo.Context(cairo.ImageSurface(cairo.FORMAT_A1, 0, 0))
            context.transform(self.get_matrix())
            self.emit("on-render")
            self.__dict__["_sprite_dirty"] = False
            self.graphics._draw(context, 1)


        if not self.graphics.paths:
            self.graphics._draw(cairo.Context(cairo.ImageSurface(cairo.FORMAT_A1, 0, 0)), 1)

        if not self.graphics.paths:
            return None

        context = cairo.Context(cairo.ImageSurface(cairo.FORMAT_A1, 0, 0))

        # bit of a hack around the problem - looking for clip instructions in parent
        # so extents would not get out of it
        clip_extents = None
        for parent in self.get_parents():
            context.transform(parent.get_local_matrix())
            if parent.graphics.paths:
                clip_regions = []
                for instruction, type, path in parent.graphics.paths:
                    if instruction == "clip":
                        context.append_path(path)
                        context.save()
                        context.identity_matrix()

                        clip_regions.append(context.fill_extents())
                        context.restore()
                        context.new_path()
                    elif instruction == "restore" and clip_regions:
                        clip_regions.pop()

                for ext in clip_regions:
                    ext = get_gdk_rectangle(int(ext[0]), int(ext[1]), int(ext[2] - ext[0]), int(ext[3] - ext[1]))
                    intersect, clip_extents = gdk.rectangle_intersect((clip_extents or ext), ext)

        context.transform(self.get_local_matrix())

        for instruction, type, path in self.graphics.paths:
            if type == "path":
                context.append_path(path)
            else:
                getattr(context, instruction)(*path)

        context.identity_matrix()


        ext = context.path_extents()
        ext = get_gdk_rectangle(int(ext[0]), int(ext[1]),
                                int(ext[2] - ext[0]), int(ext[3] - ext[1]))
        if clip_extents:
            intersect, ext = gdk.rectangle_intersect(clip_extents, ext)

        if not ext.width and not ext.height:
            ext = None

        self.__dict__['_stroke_context'] = context

        return ext
1329473
def getAdditionalImages(self):
        '''
        
        '''

        self._additionalImages = self._client.getAdditionalImages(self.setID)
        return self._additionalImages