def get_cache_stats():
    hostnames = get_memcached_hosts()

    if not hostnames:
        return None

    all_stats = []

    for hostname in hostnames:
        try:
            host, port = hostname.split(":")
            if host == 'unix':
                socket_af = socket.AF_UNIX
                connect_param = port
            else:
                socket_af = socket.AF_INET
                connect_param = (host, int(port))

        except ValueError:
            logging.error('Invalid cache hostname "%s"' % hostname)
            continue

        s = socket.socket(socket_af, socket.SOCK_STREAM)
        try:
            s.connect(connect_param)
        except socket.error:
            s.close()
            continue

        s.send(b"stats\r\n")
        data = s.recv(2048).decode('ascii')
        s.close()

        stats = {}

        for line in data.splitlines():
            info = line.split(" ")

            if info[0] == "STAT":
                try:
                    value = int(info[2])
                except ValueError:
                    value = info[2]

                stats[info[1]] = value

        if stats['cmd_get'] == 0:
            stats['hit_rate'] = 0
            stats['miss_rate'] = 0
        else:
            stats['hit_rate'] = 100 * stats['get_hits'] / stats['cmd_get']
            stats['miss_rate'] = 100 * stats['get_misses'] / stats['cmd_get']

        all_stats.append((hostname, stats))

    return all_stats
Returns a list with the subtitles info.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/cache_stats.py/get_cache_stats--crossover with--dataset/ETHPy150Open agonzalezro/python-opensubtitles/pythonopensubtitles/opensubtitles.py/OpenSubtitles.search_subtitles