code: def move_under(d, key_contents_to_move, key_to_move_under=None):
      """
      Moves the keys in nested dict with key key_contents_to_move under the dict defined by key_to_move_under.
      If no key_to_move_under is provided, the keys are moved under d.
      eg.
      Calling this on the following dict (d) with key_contents_to_move = "a":
      {
          "a": {
              "b": 1,
              "c": 2
          }
      }
      results in:
      {
          "b": 1,
          "c": 2
      }
      """
      if key_contents_to_move not in d:
          return
      for k, v in d[key_contents_to_move].items():
          if key_to_move_under:
              d[key_to_move_under][k] = v
          else:
              d[k] = v
      del d[key_contents_to_move]
  
file_path: mindsdb/mindsdb/integrations/handlers/sap_erp_handler/api.py
imports: import requests
  from urllib.parse import urljoin
  from mindsdb.utilities import log
label_desc: Use image node_id 1 for calling a global function with example usage: move_under(d, key_contents_to_move, key_to_move_under) without return types