# 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:


from typing import List, Sequence
from vizier.service import resources
from vizier.service import study_pb2
from vizier.service import vizier_oss_pb2
from google.longrunning import operations_pb2
    trials.append(trial)
  return trials


def generate_all_states_trials(start_trial_index: int,
                               owner_id: str = 'my_username',
                               study_id: str = '1234',
                               **trial_kwargs) -> List[study_pb2.Trial]:
  """Generates a trial for each possible trial state."""
  trials = []
  for i, state in enumerate(study_pb2.Trial.State.keys()):
    trial_id = start_trial_index + i
    trial = study_pb2.Trial(
        name=resources.TrialResource(owner_id, study_id, trial_id).name,
        id=str(trial_id),
        state=state,
        **trial_kwargs)
    trials.append(trial)
  return trials


def generate_suggestion_operations(
    operation_numbers: Sequence[int],
    owner_id: str = 'my_username',
    client_id: str = 'client0',
    **operation_kwargs) -> List[operations_pb2.Operation]:
  """Generates arbitrary suggestion operations."""
  operations = []
  for operation_number in operation_numbers:
    operation = operations_pb2.Operation(

# 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
from typing import List, Sequence
from vizier.service import resources
from vizier.service import study_pb2
from vizier.service import vizier_oss_pb2
from google.longrunning import operations_pb2

    trials.append(trial)
  return trials


def generate_all_states_trials(start_trial_index: int,
                               owner_id: str = 'my_username',
                               study_id: str = '1234',
                               **trial_kwargs) -> List[study_pb2.Trial]:
  """Generates a trial for each possible trial state."""
  trials = []
  for i, state in enumerate(study_pb2.Trial.State.keys()):
    trial_id = start_trial_index + i
    trial = study_pb2.Trial(
        name=resources.TrialResource(owner_id, study_id, trial_id).name,
        id=str(trial_id),
        state=state,
        **trial_kwargs)
    trials.append(trial)
  return trials


def generate_suggestion_operations(
    operation_numbers: Sequence[int],
    owner_id: str = 'my_username',
    client_id: str = 'client0',
    **operation_kwargs) -> List[operations_pb2.Operation]:
  """Generates arbitrary suggestion operations."""
  operations = []
  for operation_number in operation_numbers:
    operation = operations_pb2.Operation(

        name=resources.SuggestionOperationResource(owner_id, client_id,