# 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_operators.py
# def shallow_copy_job_type(
#     job_type: job_blocks.JobTypeVar) -> job_blocks.JobTypeVar:
#   def apply_to_job_group(job_group: job_blocks.JobGroup) -> job_blocks.JobGroup:
# def populate_job_names(job_type: job_blocks.JobTypeVar) -> None:
#   def apply_to_job(prefix: Sequence[str], target: job_blocks.Job) -> None:
#   def apply_to_job_group(prefix: Sequence[str],
#                          target: job_blocks.JobGroup) -> None:
#   def ignore_unknown(_: Sequence[str], target: Any) -> None:
# def collect_jobs_by_filter(
#     job_group: job_blocks.JobGroup,
#     predicate: Callable[[job_blocks.Job], bool],
# ) -> List[job_blocks.Job]:
#   def match_job(job: job_blocks.Job) -> List[job_blocks.Job]:
#   def match_job_group(job_group: job_blocks.JobGroup) -> List[job_blocks.Job]:
# def aggregate_constraint_cliques(
#     job_group: job_blocks.JobGroup) -> List[ConstraintClique]:
#   def match_job(
#       job: job_blocks.Job
#   ) -> Tuple[List[ConstraintClique], List[job_blocks.Job]]:
#   def match_job_group(
#       job_group: job_blocks.JobGroup
#   ) -> Tuple[List[ConstraintClique], List[job_blocks.Job]]:
# def flatten_jobs(job_group: job_blocks.JobGroup) -> List[job_blocks.Job]:
# class ConstraintClique:
# 
# Path: xmanager/xm/testing.py
# class TestExperimentUnit(core.WorkUnit):
# class TestExperiment(core.Experiment):
# class TestExecutable(job_blocks.Executable):
# class TestExecutor(job_blocks.Executor):
# class TestConstraint(job_blocks.Constraint):
#   def __init__(
#       self,
#       experiment: core.Experiment,
#       work_unit_id_predictor: id_predictor.Predictor,
#       create_task: Callable[[Awaitable[Any]], futures.Future],
#       launched_jobs: List[job_blocks.JobType],
#       launched_jobs_args: List[Optional[Mapping[str, Any]]],
#       args: Optional[Mapping[str, Any]],
#       role: core.ExperimentUnitRole,
#   ) -> None:
#   async def _wait_until_complete(self) -> None:
#   async def _launch_job_group(self, job_group: job_blocks.JobGroup,
#                               args: Optional[Mapping[str, Any]]) -> None:
#   def work_unit_id(self) -> int:
#   def experiment_unit_name(self) -> str:
#   def __init__(self) -> None:
#   def _create_experiment_unit(
#       self, args, role=core.WorkUnitRole()) -> Awaitable[TestExperimentUnit]:
#   def work_unit_count(self) -> int:
#   def work_units(self):
#   def auxiliary_units(self):
#   def experiment_id(self) -> int:
#   def __init__(self):


import unittest
from xmanager.xm import job_blocks
from xmanager.xm import job_operators
from xmanager.xm import testing
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




def construct_job(name=None):
  return job_blocks.Job(
      name=name,
      executable=testing.TestExecutable(),

# 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_operators.py
# def shallow_copy_job_type(
#     job_type: job_blocks.JobTypeVar) -> job_blocks.JobTypeVar:
#   def apply_to_job_group(job_group: job_blocks.JobGroup) -> job_blocks.JobGroup:
# def populate_job_names(job_type: job_blocks.JobTypeVar) -> None:
#   def apply_to_job(prefix: Sequence[str], target: job_blocks.Job) -> None:
#   def apply_to_job_group(prefix: Sequence[str],
#                          target: job_blocks.JobGroup) -> None:
#   def ignore_unknown(_: Sequence[str], target: Any) -> None:
# def collect_jobs_by_filter(
#     job_group: job_blocks.JobGroup,
#     predicate: Callable[[job_blocks.Job], bool],
# ) -> List[job_blocks.Job]:
#   def match_job(job: job_blocks.Job) -> List[job_blocks.Job]:
#   def match_job_group(job_group: job_blocks.JobGroup) -> List[job_blocks.Job]:
# def aggregate_constraint_cliques(
#     job_group: job_blocks.JobGroup) -> List[ConstraintClique]:
#   def match_job(
#       job: job_blocks.Job
#   ) -> Tuple[List[ConstraintClique], List[job_blocks.Job]]:
#   def match_job_group(
#       job_group: job_blocks.JobGroup
#   ) -> Tuple[List[ConstraintClique], List[job_blocks.Job]]:
# def flatten_jobs(job_group: job_blocks.JobGroup) -> List[job_blocks.Job]:
# class ConstraintClique:
# 
# Path: xmanager/xm/testing.py
# class TestExperimentUnit(core.WorkUnit):
# class TestExperiment(core.Experiment):
# class TestExecutable(job_blocks.Executable):
# class TestExecutor(job_blocks.Executor):
# class TestConstraint(job_blocks.Constraint):
#   def __init__(
#       self,
#       experiment: core.Experiment,
#       work_unit_id_predictor: id_predictor.Predictor,
#       create_task: Callable[[Awaitable[Any]], futures.Future],
#       launched_jobs: List[job_blocks.JobType],
#       launched_jobs_args: List[Optional[Mapping[str, Any]]],
#       args: Optional[Mapping[str, Any]],
#       role: core.ExperimentUnitRole,
#   ) -> None:
#   async def _wait_until_complete(self) -> None:
#   async def _launch_job_group(self, job_group: job_blocks.JobGroup,
#                               args: Optional[Mapping[str, Any]]) -> None:
#   def work_unit_id(self) -> int:
#   def experiment_unit_name(self) -> str:
#   def __init__(self) -> None:
#   def _create_experiment_unit(
#       self, args, role=core.WorkUnitRole()) -> Awaitable[TestExperimentUnit]:
#   def work_unit_count(self) -> int:
#   def work_units(self):
#   def auxiliary_units(self):
#   def experiment_id(self) -> int:
#   def __init__(self):


# Path: xmanager/xm/job_operators_test.py
import unittest
from xmanager.xm import job_blocks
from xmanager.xm import job_operators
from xmanager.xm import testing

# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




def construct_job(name=None):
  return job_blocks.Job(
      name=name,
      executable=testing.TestExecutable(),

      executor=testing.TestExecutor())