hunk.code_window:     # Test enable eager install. This flag is set to True by default.
       runtime_env = {"conda": {"dependencies": ["toolz"]}}
       env_count = len(get_conda_env_list())
       ray.init(runtime_env=runtime_env)
       wait_for_condition(lambda: len(get_conda_env_list()) == env_count + 1, timeout=60)
       ray.shutdown()
       # Test disable eager install
  
hunk.labels: keep keep keep replace keep keep keep
hunk.after_edit:     ray.init(runtime_env=runtime_env_class(**runtime_env))
  
hunk.file_path: python/ray/tests/test_runtime_env_complicated.py
hunk.type: replace
file: package io.ray.serve;
  
  import io.ray.serve.poll.KeyType;
  import io.ray.serve.poll.LongPollClientFactory;
  import java.io.Serializable;
  import java.util.function.Function;
  
  public class UpdatedObject implements Serializable {
  
    private static final long serialVersionUID = 4079205733405537177L;
  
    private int snapshotId;
  
    private Object objectSnapshot;
  
    public int getSnapshotId() {
      return snapshotId;
    }
  
    public void setSnapshotId(int snapshotId) {
      this.snapshotId = snapshotId;
    }
  
    public Object getObjectSnapshot() {
      return objectSnapshot;
    }
  
    public void setObjectSnapshot(Object objectSnapshot) {
      this.objectSnapshot = objectSnapshot;
    }
  
    public static UpdatedObject parseFrom(
        KeyType keyType, io.ray.serve.generated.UpdatedObject pbUpdatedObject) {
      if (pbUpdatedObject == null) {
        return null;
      }
      UpdatedObject updatedObject = new UpdatedObject();
      updatedObject.setSnapshotId(pbUpdatedObject.getSnapshotId());
  
      Function<byte[], Object> deserializer =
          LongPollClientFactory.DESERIALIZERS.get(keyType.getLongPollNamespace());
      if (deserializer == null) {
        throw new RayServeException(
            "No deserializer for LongPollNamespace: " + keyType.getLongPollNamespace());
      }
      updatedObject.setObjectSnapshot(
          deserializer.apply(pbUpdatedObject.getObjectSnapshot().toByteArray()));
      return updatedObject;
    }
  }
  