code: def read_source_script(filepath):
      """Read the contents of `filepath`
  
      Parameters
      ----------
      filepath: Str
          Absolute path to a Python file. Expected to end with '.py', or '.ipynb'
  
      Returns
      -------
      source: Str
          The contents of `filepath`"""
      if filepath.endswith(".ipynb"):
          with open(filepath, "r") as f:
              from nbconvert import PythonExporter
              import nbformat
  
              notebook = nbformat.reads(f.read(), nbformat.NO_CONVERT)
              exporter = PythonExporter()
              source, _ = exporter.from_notebook_node(notebook)
      else:
          with open(filepath, "r") as f:
              source = f.read()
  
      return source
  
imports: from hyperparameter_hunter.utils.file_utils import RetryMakeDirs
  from ast import NodeVisitor, parse
  from inspect import getsource
  from operator import attrgetter
  import os
  import re
label_desc: Use image node_id 3 for calling a global function with example usage: read_source_script(filepath) and returns: source