# Path: xmanager/xm/job_blocks.py
# class SequentialArgs:
#   class _RegularItem:
#   class _KeywordItem:
# class ExecutableSpec(abc.ABC):
# class Executable(abc.ABC):
# class ExecutorSpec(abc.ABC):
# class Executor(abc.ABC):
# class Packageable:
# class Constraint(abc.ABC):
# class Job:
# class JobGroup:
#   def __init__(self) -> None:
#   def _ingest_regular_item(self, value: Any) -> None:
#   def _ingest_keyword_item(self, name: str, value: Any) -> None:
#   def _merge_from(self, args: 'SequentialArgs') -> None:
#     def import_regular_item(item: SequentialArgs._RegularItem):
#     def import_keyword_item(item: SequentialArgs._KeywordItem):
#   def from_collection(collection: Optional[UserArgs]) -> 'SequentialArgs':
#     def check_for_string(args: str) -> None:
#     def import_sequential_args(args: SequentialArgs) -> None:
#     def import_mapping(collection: Mapping[Any, Any]) -> None:
#     def import_sequence(collection: Sequence[Any]) -> None:
#   def to_list(
#       self,
#       escaper: Callable[[Any], str],
#       kwargs_joiner: Callable[[str, str], str] = utils.trivial_kwargs_joiner
#   ) -> List[str]:
#     def export_regular_item(item: SequentialArgs._RegularItem) -> str:
#     def export_keyword_item(item: SequentialArgs._KeywordItem) -> str:
#   def to_dict(self, kwargs_only: bool = False) -> Dict[str, Any]:
#     def export_regular_item(
#         item: SequentialArgs._RegularItem) -> Tuple[str, Any]:
#     def export_keyword_item(
#         item: SequentialArgs._KeywordItem) -> Tuple[str, Any]:
#   def __eq__(self, other) -> bool:
#   def __repr__(self) -> str:
# def merge_args(*operands: Union[SequentialArgs, UserArgs]) -> SequentialArgs:
#   def name(self) -> str:
#   def Spec(cls) -> ExecutorSpec:  # pylint: disable=invalid-name
#   def __init__(self,
#                *,
#                constraints: Optional[Sequence[Constraint]] = None,
#                **jobs: JobType) -> None:


import unittest
from xmanager.xm import job_blocks
        {
            'a': 'z',
            'b': 'y',
        },
        [2],
        {
            'b': 'x',
            'c': 't',
        },
        [3],
    )

    self.assertEqual(
        args.to_list(str), ['1', '--a=z', '--b=x', '2', '--c=t', '3'])

  def test_to_dict(self):
    args = job_blocks.merge_args(['--knob'], {1: False})

    self.assertEqual(args.to_dict(), {'--knob': True, '1': False})

  def test_to_list_bool(self):
    args = job_blocks.SequentialArgs.from_collection({'yes': True, 'no': False})

    self.assertEqual(args.to_list(str), ['--yes', '--nono'])

  def test_sequential_args_from_string(self):
    with self.assertRaisesRegex(
        ValueError,
        "Tried to construct xm.SequentialArgs from a string: '--foo'. "
        "Wrap it in a list: \\['--foo'\\] to make it a single argument."):

# Path: xmanager/xm/job_blocks.py
# class SequentialArgs:
#   class _RegularItem:
#   class _KeywordItem:
# class ExecutableSpec(abc.ABC):
# class Executable(abc.ABC):
# class ExecutorSpec(abc.ABC):
# class Executor(abc.ABC):
# class Packageable:
# class Constraint(abc.ABC):
# class Job:
# class JobGroup:
#   def __init__(self) -> None:
#   def _ingest_regular_item(self, value: Any) -> None:
#   def _ingest_keyword_item(self, name: str, value: Any) -> None:
#   def _merge_from(self, args: 'SequentialArgs') -> None:
#     def import_regular_item(item: SequentialArgs._RegularItem):
#     def import_keyword_item(item: SequentialArgs._KeywordItem):
#   def from_collection(collection: Optional[UserArgs]) -> 'SequentialArgs':
#     def check_for_string(args: str) -> None:
#     def import_sequential_args(args: SequentialArgs) -> None:
#     def import_mapping(collection: Mapping[Any, Any]) -> None:
#     def import_sequence(collection: Sequence[Any]) -> None:
#   def to_list(
#       self,
#       escaper: Callable[[Any], str],
#       kwargs_joiner: Callable[[str, str], str] = utils.trivial_kwargs_joiner
#   ) -> List[str]:
#     def export_regular_item(item: SequentialArgs._RegularItem) -> str:
#     def export_keyword_item(item: SequentialArgs._KeywordItem) -> str:
#   def to_dict(self, kwargs_only: bool = False) -> Dict[str, Any]:
#     def export_regular_item(
#         item: SequentialArgs._RegularItem) -> Tuple[str, Any]:
#     def export_keyword_item(
#         item: SequentialArgs._KeywordItem) -> Tuple[str, Any]:
#   def __eq__(self, other) -> bool:
#   def __repr__(self) -> str:
# def merge_args(*operands: Union[SequentialArgs, UserArgs]) -> SequentialArgs:
#   def name(self) -> str:
#   def Spec(cls) -> ExecutorSpec:  # pylint: disable=invalid-name
#   def __init__(self,
#                *,
#                constraints: Optional[Sequence[Constraint]] = None,
#                **jobs: JobType) -> None:


# Path: xmanager/xm/job_blocks_test.py
import unittest
from xmanager.xm import job_blocks

        {
            'a': 'z',
            'b': 'y',
        },
        [2],
        {
            'b': 'x',
            'c': 't',
        },
        [3],
    )

    self.assertEqual(
        args.to_list(str), ['1', '--a=z', '--b=x', '2', '--c=t', '3'])

  def test_to_dict(self):
    args = job_blocks.merge_args(['--knob'], {1: False})

    self.assertEqual(args.to_dict(), {'--knob': True, '1': False})

  def test_to_list_bool(self):
    args = job_blocks.SequentialArgs.from_collection({'yes': True, 'no': False})

    self.assertEqual(args.to_list(str), ['--yes', '--nono'])

  def test_sequential_args_from_string(self):
    with self.assertRaisesRegex(
        ValueError,
        "Tried to construct xm.SequentialArgs from a string: '--foo'. "
        "Wrap it in a list: \\['--foo'\\] to make it a single argument."):

      job_blocks.SequentialArgs.from_collection('--foo')