code: def from_pb(cls, instance_pb, client):
          
          match = _INSTANCE_NAME_RE.match(instance_pb.name)
          if match is None:
              raise ValueError(
                  "Instance protobuf name was not in the " "expected format.",
                  instance_pb.name,
              )
          if match.group("project") != client.project:
              raise ValueError(
                  "Project ID on instance does not match the " "project ID on the client"
              )
          instance_id = match.group("instance_id")
          configuration_name = instance_pb.config
  
          result = cls(instance_id, client, configuration_name)
          result._update_from_pb(instance_pb)
          return result
docs: Creates an instance from a protobuf.
  
          :type instance_pb:
              :class:`google.spanner.v2.spanner_instance_admin_pb2.Instance`
          :param instance_pb: A instance protobuf object.
  
          :type client: :class:`~google.cloud.spanner_v1.client.Client`
          :param client: The client that owns the instance.
  
          :rtype: :class:`Instance`
          :returns: The instance parsed from the protobuf response.
          :raises ValueError:
              if the instance name does not match
              ``projects/{project}/instances/{instance_id}`` or if the parsed
              project ID does not match the project ID on the client.