code: def normalize_node(node, headers=None):
      
      headers = {} if headers is None else headers
      if isinstance(node, str):
          url = normalize_url(node)
          return {'endpoint': url, 'headers': headers}
  
      url = normalize_url(node['endpoint'])
      node_headers = node.get('headers', {})
      return {'endpoint': url, 'headers': {**headers, **node_headers}}
docs: Normalizes given node as str or dict with headers