code: def clear_state(state=None):
      session_state_file = os.path.expanduser("~/.clearml_data.json")
      # noinspection PyBroadException
      try:
          with open(session_state_file, "wt") as f:
              json.dump(state or dict(), f, sort_keys=True)
      except Exception:
          pass
  
imports: import json
  import os
  import shutil
  from argparse import ArgumentParser, HelpFormatter
  from functools import partial
  from typing import Sequence
  from pathlib2 import Path
  import clearml.backend_api.session
  from clearml.datasets import Dataset
  from clearml.version import __version__
label_desc: Use image node_id 4 for calling a global function with example usage: clear_state(state) without return types