code: def make_http_credentials(username=None, password=None):
      
      credentials = ''
      if username is None:
          return credentials
      if username is not None:
          if ':' in username:
              return credentials
          credentials += username
      if credentials and password is not None:
          credentials += ":%s" % password
      return "%s@" % credentials
docs: Build auth part for api_url.