code: def merge_intervals(intervals):
      """Merge intervals in the form of a list."""
      if intervals is None:
          return None
      intervals.sort(key=lambda i: i[0])
      out = [intervals.pop(0)]
      for i in intervals:
          if out[-1][-1] >= i[0]:
              out[-1][-1] = max(out[-1][-1], i[-1])
          else:
              out.append(i)
      return out
  
file_path: keon-algos/algorithms/arrays/merge_intervals.py
label_desc: Use image node_id 1 for calling a global function with example usage: merge_intervals(intervals) and returns: out, None