code: def _sign_url(self, base_url=None, params=None, client_secret=None):
          
          import hashlib
          import hmac
          import base64
          if six.PY3:
              from urllib.parse import urlparse, urlencode
          else:
              from urllib import urlencode
              from urlparse import urlparse
  
          # Return if any parameters aren't given
          if not base_url or not self.client_secret or not self.client:
              return None
  
          # assuming parameters will be submitted to Requests in identical order!
          url = urlparse(base_url + "?" + urlencode(params))
  
          # We only need to sign the path+query part of the string
          url_to_sign = (url.path + "?" + url.query).encode('utf-8')
  
          # Decode the private key into its binary format
          # We need to decode the URL-encoded private key
          decoded_key = base64.urlsafe_b64decode(client_secret)
  
          # Create a signature using the private key and the URL-encoded
          # string using HMAC SHA1. This signature will be binary.
          signature = hmac.new(decoded_key, url_to_sign, hashlib.sha1)
  
          # Encode the binary signature into base64 for use within a URL
          encoded_signature = base64.urlsafe_b64encode(signature.digest())
  
          # Return signature (to be appended as a 'signature' in params)
          return encoded_signature
docs: Sign a request URL with a Crypto Key.
          Usage:
          from urlsigner import sign_url
          signed_url = sign_url(base_url=my_url,
                                params=url_params,
                                client_secret=CLIENT_SECRET)
          Args:
          base_url - The trunk of the URL to sign. E.g. https://maps.googleapis.com/maps/api/geocode/json
          params - List of tuples of URL parameters INCLUDING YOUR CLIENT ID ('client','gme-...')
          client_secret - Your Crypto Key from Google for Work
          Returns:
          The signature as a dictionary #signed request URL