Get the Virtual Media Information
 @raise [RuntimeError] if the request failed
 @return [String] virtual_media
356159
def get_virtual_media
      response = rest_get('/redfish/v1/Managers/1/VirtualMedia/')
      media = {}
      response_handler(response)['links']['Member'].each do |vm|
        response = rest_get(vm['href'])
        virtual_media = response_handler(response)
        media[virtual_media['Id']] = {
          'Image' => virtual_media['Image'],
          'MediaTypes' => virtual_media['MediaTypes']
        }
      end
      media
    end
1198728
def info
      response = connection.get("/playback-info").response
      plist = CFPropertyList::List.new(data: response.body)
      hash = CFPropertyList.native_types(plist.value)
      PlaybackInfo.new(hash)
    end
170806
def endpoint
      # get object that we want an oembed_response from
      # based on url
      # and get its oembed_response
      media_item = ::OembedProviderEngine::OembedProvider.find_provided_from(params[:url])
      options = Hash.new
      max_dimensions = [:maxwidth, :maxheight]
      unless media_item.class::OembedResponse.providable_oembed_type == :link
        max_dimensions.each { |dimension| options[dimension] = params[dimension] if params[dimension].present? }
      end

      @oembed_response = media_item.oembed_response(options)

      # to_xml and to_json overidden in oembed_providable module
      # to be properly formatted
      # TODO: handle unauthorized case
      respond_to do |format|
        if @oembed_response
          format.html { render_json @oembed_response.to_json } # return json for default
          format.json { render_json @oembed_response.to_json }
          format.xml  { render :xml => @oembed_response }
        else
          format.all { render_404 }
        end
      end
    end
1011575
def get_media_descriptions_metadata(self):
        
        metadata = dict(self._media_descriptions_metadata)
        metadata.update({'existing_string_values': [t['text'] for t in self.my_osid_object_form._my_map['mediaDescriptions']]})
        return Metadata(**metadata)
375684
def virtual_wa_ns(self):
        
        api_version = self._get_api_version('virtual_wa_ns')
        if api_version == '2018-04-01':
            from .v2018_04_01.operations import VirtualWANsOperations as OperationClass
        else:
            raise NotImplementedError("APIVersion {} is not available".format(api_version))
        return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
792117
def getMedia(self, uri):
        """"""

        r = self.doQuery('media/' + uri)

        if r.status_code == 200:
            content_type = 'application/octet-stream'

            if 'content-type' in r.headers:
                content_type = r.headers['content-type']

            cache_control = None

            if 'cache-control' in r.headers:
                cache_control = r.headers['cache-control']

            return (r.content, content_type, cache_control)
        else:
            return (None, None, None)
750090
def get_content(media_or_io)
      case true
      when is_binary?(media_or_io) then media_or_io
      when is_file?(media_or_io)   then File.read(media_or_io)
      when is_url?(media_or_io)    then open(media_or_io).read
      when is_string?(media_or_io) then media_or_io
      when is_io?(media_or_io)     then media_or_io.read
      else raise UnsupportedType.new("That media type is unsupported")
      end
    end
587742
def get_vr(self, epoch=None):
        
        version = self.get_tag('Version', expand_macros=True)
        e = None
        if epoch is None or epoch:
            try:
                e = self.get_tag('Epoch')
            except exception.SpecFileParseError:
                pass
        if epoch is None and e:
            epoch = True
        if epoch:
            if not e:
                e = '0'
            version = '%s:%s' % (e, version)
        release = self.get_tag('Release')
        release = re.sub(r'%\{?\??dist\}?$', '', release)
        release = self.expand_macro(release)
        if release:
            return '%s-%s' % (version, release)
        return version
1070007
def get_input_media(
        media, *,
        is_photo=False, attributes=None, force_document=False,
        voice_note=False, video_note=False, supports_streaming=False
):
    
    try:
        if media.SUBCLASS_OF_ID == 0xfaf846f4:  # crc32(b'InputMedia')
            return media
        elif media.SUBCLASS_OF_ID == 0x846363e0:  # crc32(b'InputPhoto')
            return types.InputMediaPhoto(media)
        elif media.SUBCLASS_OF_ID == 0xf33fdb68:  # crc32(b'InputDocument')
            return types.InputMediaDocument(media)
    except AttributeError:
        _raise_cast_fail(media, 'InputMedia')

    if isinstance(media, types.MessageMediaPhoto):
        return types.InputMediaPhoto(
            id=get_input_photo(media.photo),
            ttl_seconds=media.ttl_seconds
        )

    if isinstance(media, (types.Photo, types.photos.Photo, types.PhotoEmpty)):
        return types.InputMediaPhoto(
            id=get_input_photo(media)
        )

    if isinstance(media, types.MessageMediaDocument):
        return types.InputMediaDocument(
            id=get_input_document(media.document),
            ttl_seconds=media.ttl_seconds
        )

    if isinstance(media, (types.Document, types.DocumentEmpty)):
        return types.InputMediaDocument(
            id=get_input_document(media)
        )

    if isinstance(media, (types.InputFile, types.InputFileBig)):
        if is_photo:
            return types.InputMediaUploadedPhoto(file=media)
        else:
            attrs, mime = get_attributes(
                media,
                attributes=attributes,
                force_document=force_document,
                voice_note=voice_note,
                video_note=video_note,
                supports_streaming=supports_streaming
            )
            return types.InputMediaUploadedDocument(
                file=media, mime_type=mime, attributes=attrs)

    if isinstance(media, types.MessageMediaGame):
        return types.InputMediaGame(id=media.game.id)

    if isinstance(media, types.MessageMediaContact):
        return types.InputMediaContact(
            phone_number=media.phone_number,
            first_name=media.first_name,
            last_name=media.last_name,
            vcard=''
        )

    if isinstance(media, types.MessageMediaGeo):
        return types.InputMediaGeoPoint(geo_point=get_input_geo(media.geo))

    if isinstance(media, types.MessageMediaVenue):
        return types.InputMediaVenue(
            geo_point=get_input_geo(media.geo),
            title=media.title,
            address=media.address,
            provider=media.provider,
            venue_id=media.venue_id,
            venue_type=''
        )

    if isinstance(media, (
            types.MessageMediaEmpty, types.MessageMediaUnsupported,
            types.ChatPhotoEmpty, types.UserProfilePhotoEmpty,
            types.ChatPhoto, types.UserProfilePhoto,
            types.FileLocationToBeDeprecated)):
        return types.InputMediaEmpty()

    if isinstance(media, types.Message):
        return get_input_media(media.media, is_photo=is_photo)

    _raise_cast_fail(media, 'InputMedia')
1140735
def virtualfields(self):
        
        if self._virtualfields is None:
            vfs = tuple()
        else:
            vfs = tuple(self._virtualfields)
        return vfs
83985
def images(self):
        
        return [
            MediaImage(item.get('url'), item.get('height'), item.get('width'))
            for item in self.media_metadata.get('images', [])
        ]
1217444
def libvlc_media_get_user_data(p_md):
    '''
    '''
    f = _Cfunctions.get('libvlc_media_get_user_data', None) or \
        _Cfunction('libvlc_media_get_user_data', ((1,),), None,
                    ctypes.c_void_p, Media)
    return f(p_md)
1134152
def get_images(img_type)
      images = Hash.new

      if img_type == "OSImage"
        response = @connection.query_azure("images")
      elsif img_type == "VMImage"
        response = @connection.query_azure("vmimages")
      end

      unless response.to_s.empty?
        osimages = response.css(img_type)

        osimages.each do |image|
          item = Image.new(image)
          images[item.name] = item
        end
      end

      images
    end
1363378
def insert_virtual_media(self, url, device='FLOPPY'):
        """"""
        dic = {
            'DEVICE': device.upper(),
            'IMAGE_URL': url,
        }
        data = self._execute_command(
            'INSERT_VIRTUAL_MEDIA', 'RIB_INFO', 'write', dic)
        return data
511049
async def download_media(self, *args, **kwargs):
        
        return await self._client.download_media(self, *args, **kwargs)
1042479
def info(self, media_id):
        
        dr = self.__app.native_api_call('media', 'i/' + media_id, {}, self.__options, False, None, False, http_path="/api/meta/v1/", http_method='GET')
        return json.loads(dr.text)
1264576
private Dimension getRequestedDimension() {

    // check for fixed dimensions from media args
    if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
      return new Dimension(mediaArgs.getFixedWidth(), mediaArgs.getFixedHeight());
    }

    // check for dimensions from mediaformat (evaluate only first media format)
    MediaFormat[] mediaFormats = mediaArgs.getMediaFormats();
    if (mediaFormats != null && mediaFormats.length > 0) {
      Dimension dimension = mediaFormats[0].getMinDimension();
      if (dimension != null) {
        return dimension;
      }
    }

    // fallback to 0/0 - no specific dimension requested
    return new Dimension(0, 0);
  }