def METHOD_NAME(hostdirs: str, base_ssh_port: int,
                     base_rest_port: int) -> list:
    '''Run one or more sessions given the dir and port'''
    processes = []
    bindir = f'{get_sq_install_dir()}/utilities'
    for i, hostd in enumerate(sorted(hostdirs)):
        if base_ssh_port:
            ssh_port = base_ssh_port + i
            cmd = [
                "python", f"{bindir}/sq_simnode_ssh.py",
                "-p", str(ssh_port),
                "-d", hostd,
            ]
            # pylint: disable=consider-using-with
            proc = subprocess.Popen(cmd)
            print(
                f'Running ssh node with input dir {hostd} '
                f'for {hostd.parts[-1]} on port {ssh_port}')
            processes.append(proc)
        if base_rest_port:
            rest_port = base_rest_port + i
            cmd = [
                "python", f"{bindir}/sq_simnode_rest.py",
                "-p", str(rest_port),
                "-d", hostd,
            ]
            # pylint: disable=consider-using-with
            proc = subprocess.Popen(cmd)
            print(
                f'Running REST node with input dir {hostd} '
                f'for {hostd.parts[-1]} on port {rest_port}')
            processes.append(proc)
    return processes