# Path: vizier/service/resources.py
# def _assert_not_empty(instance: Any, attribute: Any,
#                       value: Optional[Union[str, int]]):
#   def from_name(cls, resource_name: str):
#   def owner_id(self):
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
#   def owner_resource(self) -> OwnerResource:
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
#   def make_early_stopping_operation(self, operation_id: str = ''):
#   def study_resource(self) -> StudyResource:
#   def name(self) -> str:
#   def operation_id(self) -> str:
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
#   def trial(self) -> TrialResource:
#   def operation_id(self) -> str:
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
# class OwnerResource:
# class StudyResource:
# class TrialResource:
# class EarlyStoppingOperationResource:
# class SuggestionOperationResource:
# 
# Path: vizier/service/test_util.py
# def generate_study(owner_id: str = 'my_username',
#                    study_id: str = '1234',
#                    display_name: str = 'cifar10',
#                    **study_kwargs) -> study_pb2.Study:
# def generate_trials(trial_id_list: Sequence[int],
#                     owner_id: str = 'my_username',
#                     study_id: str = '1234',
#                     **trial_kwargs) -> List[study_pb2.Trial]:
# def generate_all_states_trials(start_trial_index: int,
#                                owner_id: str = 'my_username',
#                                study_id: str = '1234',
#                                **trial_kwargs) -> List[study_pb2.Trial]:
# def generate_suggestion_operations(
#     operation_numbers: Sequence[int],
#     owner_id: str = 'my_username',
#     client_id: str = 'client0',
#     **operation_kwargs) -> List[operations_pb2.Operation]:
# def generate_early_stopping_operations(
#     trial_id_list: Sequence[int],
#     owner_id: str = 'my_username',
#     study_id: str = '1234',
#     **operation_kwargs) -> List[vizier_oss_pb2.EarlyStoppingOperation]:
# def generate_all_four_parameter_specs(**study_spec_kwargs
#                                      ) -> study_pb2.StudySpec:


from vizier.service import resources
from vizier.service import study_pb2
from vizier.service import test_util
from absl.testing import absltest
from absl.testing import parameterized

    suggestion_op_resource = resources.SuggestionOperationResource(
        self.owner_id, self.client_id, self.operation_number)
    same_suggestion_op_resource = resources.SuggestionOperationResource.from_name(
        suggestion_op_resource.name)
    self.assertEqual(same_suggestion_op_resource, same_suggestion_op_resource)

  @parameterized.named_parameters(
      ('owner', 'owner/my_username', resources.OwnerResource),
      ('study', 'owners/my_username/study/cifar10', resources.StudyResource),
      ('trial', 'owners/my_username/studies/cifar10/trials/not_an_int',
       resources.TrialResource))
  def test_parsing_wrong(self, bad_name, resource_class):
    """Tests for incorrect resource strings, for input validation."""
    with self.assertRaises(ValueError):
      resource_class.from_name(bad_name)

  def test_generate_studies(self):
    study_spec = test_util.generate_all_four_parameter_specs()
    self.assertLen(study_spec.parameters, 4)

  def test_generate_trials(self):
    basic_trials = test_util.generate_trials(
        range(2), self.owner_id, self.study_id)
    self.assertLen(basic_trials, 2)
    all_states_trials = test_util.generate_all_states_trials(
        0, self.owner_id, self.study_id)
    self.assertLen(all_states_trials, len(study_pb2.Trial.State.keys()))

  def test_generate_suggestion_operations(self):

# Path: vizier/service/resources.py
# def _assert_not_empty(instance: Any, attribute: Any,
#                       value: Optional[Union[str, int]]):
#   def from_name(cls, resource_name: str):
#   def owner_id(self):
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
#   def owner_resource(self) -> OwnerResource:
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
#   def make_early_stopping_operation(self, operation_id: str = ''):
#   def study_resource(self) -> StudyResource:
#   def name(self) -> str:
#   def operation_id(self) -> str:
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
#   def trial(self) -> TrialResource:
#   def operation_id(self) -> str:
#   def name(self) -> str:
#   def from_name(cls, resource_name: str):
# class OwnerResource:
# class StudyResource:
# class TrialResource:
# class EarlyStoppingOperationResource:
# class SuggestionOperationResource:
# 
# Path: vizier/service/test_util.py
# def generate_study(owner_id: str = 'my_username',
#                    study_id: str = '1234',
#                    display_name: str = 'cifar10',
#                    **study_kwargs) -> study_pb2.Study:
# def generate_trials(trial_id_list: Sequence[int],
#                     owner_id: str = 'my_username',
#                     study_id: str = '1234',
#                     **trial_kwargs) -> List[study_pb2.Trial]:
# def generate_all_states_trials(start_trial_index: int,
#                                owner_id: str = 'my_username',
#                                study_id: str = '1234',
#                                **trial_kwargs) -> List[study_pb2.Trial]:
# def generate_suggestion_operations(
#     operation_numbers: Sequence[int],
#     owner_id: str = 'my_username',
#     client_id: str = 'client0',
#     **operation_kwargs) -> List[operations_pb2.Operation]:
# def generate_early_stopping_operations(
#     trial_id_list: Sequence[int],
#     owner_id: str = 'my_username',
#     study_id: str = '1234',
#     **operation_kwargs) -> List[vizier_oss_pb2.EarlyStoppingOperation]:
# def generate_all_four_parameter_specs(**study_spec_kwargs
#                                      ) -> study_pb2.StudySpec:


# Path: vizier/service/resources_test.py
from vizier.service import resources
from vizier.service import study_pb2
from vizier.service import test_util
from absl.testing import absltest
from absl.testing import parameterized


    suggestion_op_resource = resources.SuggestionOperationResource(
        self.owner_id, self.client_id, self.operation_number)
    same_suggestion_op_resource = resources.SuggestionOperationResource.from_name(
        suggestion_op_resource.name)
    self.assertEqual(same_suggestion_op_resource, same_suggestion_op_resource)

  @parameterized.named_parameters(
      ('owner', 'owner/my_username', resources.OwnerResource),
      ('study', 'owners/my_username/study/cifar10', resources.StudyResource),
      ('trial', 'owners/my_username/studies/cifar10/trials/not_an_int',
       resources.TrialResource))
  def test_parsing_wrong(self, bad_name, resource_class):
    """Tests for incorrect resource strings, for input validation."""
    with self.assertRaises(ValueError):
      resource_class.from_name(bad_name)

  def test_generate_studies(self):
    study_spec = test_util.generate_all_four_parameter_specs()
    self.assertLen(study_spec.parameters, 4)

  def test_generate_trials(self):
    basic_trials = test_util.generate_trials(
        range(2), self.owner_id, self.study_id)
    self.assertLen(basic_trials, 2)
    all_states_trials = test_util.generate_all_states_trials(
        0, self.owner_id, self.study_id)
    self.assertLen(all_states_trials, len(study_pb2.Trial.State.keys()))

  def test_generate_suggestion_operations(self):

    basic_operations = test_util.generate_suggestion_operations(