code: def get_master(self, host, port, sentinel_port, sentinel_name):
          
          if sentinel_port and sentinel_name:
              master = Sentinel([(host, sentinel_port)], socket_timeout=1)\
                  .discover_master(sentinel_name)
              return master
          return host, port
docs: :param host: Redis host to send request
          :param port: Redis port to send request
          :param sentinel_port: sentinel_port optional
          :param sentinel_name: sentinel_name optional
          :return: master ip and port