code: def ensure_file_exists(filename):
      """Given a valid filename, make sure it exists (will create if DNE)."""
      if not os.path.exists(filename):
          head, tail = os.path.split(filename)
          ensure_dir_exists(head)
          with open(filename, "w") as f:
              pass
  
file_path: plotly.py/packages/python/chart-studio/chart_studio/utils.py
imports: from __future__ import absolute_import
  import os.path
  import re
  import threading
  import warnings
  import json
  from _plotly_utils.exceptions import PlotlyError
  from _plotly_utils.optional_imports import get_module
label_desc: Use image node_id 3 for calling a global function with example usage: ensure_file_exists(filename) without return types