code: def get_headers():
      """
      Using session credentials/config, get headers for a V2 API request.
  
      Users may have their own proxy layer and so we free up the `authorization`
      header for this purpose (instead adding the user authorization in a new
      `plotly-authorization` header). See pull #239.
  
      :returns: (dict) Headers to add to a requests.request call.
  
      """
      from plotly import version
  
      creds = config.get_credentials()
  
      headers = {
          "plotly-client-platform": "python {}".format(
              version.stable_semver()
          ),
          "content-type": "application/json",
      }
  
      plotly_auth = basic_auth(creds["username"], creds["api_key"])
      proxy_auth = basic_auth(
          creds["proxy_username"], creds["proxy_password"]
      )
  
      if config.get_config()["plotly_proxy_authorization"]:
          headers["authorization"] = proxy_auth
          if creds["username"] and creds["api_key"]:
              headers["plotly-authorization"] = plotly_auth
      else:
          if creds["username"] and creds["api_key"]:
              headers["authorization"] = plotly_auth
  
      return headers
  
file_path: plotly.py/packages/python/chart-studio/chart_studio/api/v2/utils.py
imports: from __future__ import absolute_import
  import requests
  import json
  from requests.exceptions import RequestException
  from retrying import retry
  import _plotly_utils.exceptions
  from chart_studio import config, exceptions
  from chart_studio.api.utils import basic_auth
  from _plotly_utils.utils import PlotlyJSONEncoder
label_desc: Use image node_id 4 for calling a global function with example usage: get_headers() and returns: headers