code: def _oauth10a_signature(
      consumer_token, method, url, parameters={}, token=None
  ):
      """Calculates the HMAC-SHA1 OAuth 1.0a signature for the given request.
  
      See http://oauth.net/core/1.0a/#signing_process
      """
      parts = urlparse.urlparse(url)
      scheme, netloc, path = parts[:3]
      normalized_url = scheme.lower() + "://" + netloc.lower() + path
  
      base_elems = []
      base_elems.append(method.upper())
      base_elems.append(normalized_url)
      base_elems.append(
          "&".join(
              "%s=%s" % (k, _oauth_escape(str(v)))
              for k, v in sorted(parameters.items())
          )
      )
  
      base_string = "&".join(_oauth_escape(e) for e in base_elems)
      key_elems = [
          escape.utf8(
              urllib_parse.quote(consumer_token["secret"], safe="~")
          )
      ]
      key_elems.append(
          escape.utf8(
              urllib_parse.quote(token["secret"], safe="~")
              if token
              else ""
          )
      )
      key = b"&".join(key_elems)
  
      hash = hmac.new(key, escape.utf8(base_string), hashlib.sha1)
      return binascii.b2a_base64(hash.digest())[:-1]
  
imports: from __future__ import absolute_import, division, print_function
  import base64
  import binascii
  import functools
  import hashlib
  import hmac
  import time
  import uuid
  from tornado.concurrent import TracebackFuture, return_future, chain_future
  from tornado import gen
  from tornado import httpclient
  from tornado import escape
  from tornado.httputil import url_concat
  from tornado.log import gen_log
  from tornado.stack_context import ExceptionStackContext
  from tornado.util import unicode_type, ArgReplacer, PY3
label_desc: Use image node_id 4 for calling a global function with example usage: _oauth10a_signature(consumer_token, method, url, parameters, token) and returns: binascii