code: def patch_uri(uri):
      
      index = uri.find(':')
      if uri[:index] == 'amqps':
          uri = uri.replace('amqps', 'https', 1)
      elif uri[:index] == 'amqp':
          uri = uri.replace('amqp', 'http', 1)
      return uri
docs: If a custom uri schema is used with python 2.6 (e.g. amqps),
      it will ignore some of the parsing logic.
  
          As a work-around for this we change the amqp/amqps schema
          internally to use http/https.
  
      :param str uri: AMQP Connection string
      :rtype: str