class_docstr: Base class for Image, Audio and Video widgets.
  
  The `value` of this widget accepts a byte string.  The byte string is the
  raw data that you want the browser to display.
  
  If you pass `"url"` to the `"format"` trait, `value` will be interpreted
  as a URL as bytes encoded in UTF-8.
docstr: Create an :class:`Media` from a URL.
  
  :code:`Media.from_url(url)` is equivalent to:
  
  .. code-block: python
  
      med = Media(value=url, format='url')
  
  But both unicode and bytes arguments are allowed for ``url``.
  
  Parameters
  ----------
  url: [str, bytes]
      The location of a URL to load.
docstr_tok: ["Create","an",":","class",":","`","Media","`","from","a","URL",".",":","code",":","`","Media.from_url","(","url",")","`","is","equivalent","to",":","..","code-block",":","python","med","=","Media","(","value=url",",","format='url","'",")","But","both","unicode","and","bytes","arguments","are","allowed","for","``","url","``",".","Parameters","--","--","--","--","--","url",":","[","str",",","bytes","]","The","location","of","a","URL","to","load","."]
code: def from_url(cls, url, **kwargs):
      """
      Create an :class:`Media` from a URL.
  
      :code:`Media.from_url(url)` is equivalent to:
  
      .. code-block: python
  
          med = Media(value=url, format='url')
  
      But both unicode and bytes arguments are allowed for ``url``.
  
      Parameters
      ----------
      url: [str, bytes]
          The location of a URL to load.
      """
      if isinstance(url, str):
          # If str, it needs to be encoded to bytes
          url = url.encode("utf-8")
  
      return cls(value=url, format="url", **kwargs)
  
imports: import mimetypes
  from .widget_core import CoreWidget
  from .domwidget import DOMWidget
  from .valuewidget import ValueWidget
  from .widget import register
  from traitlets import Unicode, CUnicode, Bool
  from .trait_types import CByteMemoryView
label_desc: Use image node_id 2 for calling the _Media obj's underlying member method code with example usage: obj.from_url(cls, url) and returns: cls