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 local file.
  
  Parameters
  ----------
  filename: str
      The location of a file to read into the value from disk.
  
  **kwargs:
      The keyword arguments for `Media`
  
  Returns an `Media` with the value set from the filename.
docstr_tok: ["Create","an",":","class",":","`","Media","`","from","a","local","file",".","Parameters","--","--","--","--","--","filename",":","str","The","location","of","a","file","to","read","into","the","value","from","disk",".","*","*","kwargs",":","The","keyword","arguments","for","`","Media","`","Returns","an","`","Media","`","with","the","value","set","from","the","filename","."]
code: def _from_file(cls, tag, filename, **kwargs):
      """
      Create an :class:`Media` from a local file.
  
      Parameters
      ----------
      filename: str
          The location of a file to read into the value from disk.
  
      **kwargs:
          The keyword arguments for `Media`
  
      Returns an `Media` with the value set from the filename.
      """
      value = cls._load_file_value(filename)
  
      if "format" not in kwargs:
          format = cls._guess_format(tag, filename)
          if format is not None:
              kwargs["format"] = format
  
      return cls(value=value, **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 1 for calling the _Media obj's underlying member method code with example usage: obj._from_file(cls, tag, filename) and returns: cls