<commit_before>from gppylib import gplog
from gppylib.commands.base import Command
from gppylib.commands import base
from gppylib.gparray import STATUS_DOWN

logger = gplog.get_default_logger()


def get_unreachable_segment_hosts(hosts, num_workers):
    pool = base.WorkerPool(numWorkers=num_workers)
    try:
        for host in hosts:
            cmd = Command(name='check %s is up' % host, cmdStr="ssh %s 'echo %s'" % (host, host))<commit_msg>gpMgmt: get_unreachable_segment_hosts(hosts=[]) should return []<commit_after>from gppylib import gplog
from gppylib.commands.base import Command
from gppylib.commands import base
from gppylib.gparray import STATUS_DOWN

logger = gplog.get_default_logger()


def get_unreachable_segment_hosts(hosts, num_workers):
    if not hosts:
        return []

    pool = base.WorkerPool(numWorkers=num_workers)
    try:
        for host in hosts:
            cmd = Command(name='check %s is up' % host, cmdStr="ssh %s 'echo %s'" % (host, host))
{'fraction_non_alphanumeric': 0.09674134419551934, 'fraction_numerical': 0.0, 'mean_word_length': 4.313513513513514, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2649608', 'n_tokens_mistral': 340, 'n_tokens_neox': 327, 'n_words': 87}