def write_back_credentials(self, credentials):
        file_creds = {}
        try:
            file_data = open(self.filename)
            file_creds = json.load(file_data)
        except __HOLE__ as ioe:
            print "Credential file not found, will create..."

        user_creds = file_creds.get(credentials.identifier)
        if user_creds is None:
            user_creds = {}
        user_creds = credentials._populate_user_creds(user_creds)
        file_creds[credentials.identifier] = user_creds

        with open(self.filename, 'w') as outfile:
          json.dump(file_creds, outfile, indent=2, separators=(',', ': '))
dataset/ETHPy150Open SalesforceEng/Providence/Empire/creds/__init__.py/CredentialManager.write_back_credentials