code: def ensure_local_plotly_files():
      """Ensure that filesystem is setup/filled out in a valid way.
      If the config or credential files aren't filled out, then write them
      to the disk.
      """
      if ensure_writable_plotly_dir():
          for fn in [CREDENTIALS_FILE, CONFIG_FILE]:
              utils.ensure_file_exists(fn)
              contents = utils.load_json_dict(fn)
              contents_orig = contents.copy()
              for key, val in list(FILE_CONTENT[fn].items()):
                  # TODO: removed type checking below, may want to revisit
                  if key not in contents:
                      contents[key] = val
              contents_keys = list(contents.keys())
              for key in contents_keys:
                  if key not in FILE_CONTENT[fn]:
                      del contents[key]
              # save only if contents has changed.
              # This is to avoid .credentials or .config file to be overwritten randomly,
              # which we constantly keep experiencing
              # (sync issues? the file might be locked for writing by other process in file._permissions)
              if contents_orig.keys() != contents.keys():
                  utils.save_json_dict(fn, contents)
  
      else:
          warnings.warn(
              "Looks like you don't have 'read-write' permission to "
              "your 'home' ('~') directory or to our '~/.plotly' "
              "directory. That means plotly's python api can't setup "
              "local configuration files. No problem though! You'll "
              "just have to sign-in using 'plotly.plotly.sign_in()'. "
              "For help with that: 'help(plotly.plotly.sign_in)'."
              "\nQuestions? Visit https://support.plotly.com"
          )
  
imports: from __future__ import absolute_import
  import urllib
  import warnings
  import copy
  from _plotly_utils import optional_imports
  import _plotly_utils.exceptions
  from _plotly_utils.files import ensure_writable_plotly_dir
  from chart_studio import session, utils
  from chart_studio.files import CONFIG_FILE, CREDENTIALS_FILE, FILE_CONTENT
label_desc: Use image node_id 2 for calling a global function with example usage: ensure_local_plotly_files() without return types