code: def _try_import_matplotlib():
      global matplotlib, _available
      global _plot_color, _plot_color_trans, _plot_common_kwargs
      try:
          import matplotlib
  
          _available = True
      except ImportError:
          _available = False
  
      if _available:
          if hasattr(matplotlib.colors, "to_rgba"):
              _to_rgba = matplotlib.colors.to_rgba
          else:
              # For matplotlib 1.x
              _to_rgba = matplotlib.colors.ColorConverter().to_rgba
          _plot_color = _to_rgba("#1f77b4")  # C0 color
          _plot_color_trans = _plot_color[:3] + (0.2,)  # apply alpha
          _plot_common_kwargs = {
              "alpha": 0.2,
              "linewidth": 0,
              "color": _plot_color_trans,
          }
  
imports: from __future__ import division
  import os
  import warnings
  import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer.training import extension
  from chainer.training import trigger
  from chainer.utils import argument
label_desc: Use image node_id 1 for calling a global function with example usage: _try_import_matplotlib() without return types