def ensure_local_plotly_files():
 if check_file_permissions():
  for fn in [CREDENTIALS_FILE, CONFIG_FILE]:
   utils.ensure_file_exists(fn)
   contents = utils.load_json_dict(fn)
   for (key, val) in list(FILE_CONTENT[fn].items()):
    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]
   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 community.plot.ly or upgrade to a Pro plan for 1-1 help: https://goo.gl/1YUVu9")

def ensure_local_plotly_files ( ) : if check_file_permissions ( ) : for fn in [ CREDENTIALS_FILE , CONFIG_FILE ] : utils . ensure_file_exists ( fn ) contents = utils . load_json_dict ( fn ) for ( key , val ) in list ( FILE_CONTENT [ fn ] . items ( ) ) : 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 ] 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 community.plot.ly or upgrade to a Pro plan for 1-1 help: https://goo.gl/1YUVu9" )
ensure that filesystem is setup/filled out in a valid way .