code: def set_composite_filter(filter_proto, op, *filters):
    
    filter_proto.Clear()
    cf = filter_proto.composite_filter
    cf.op = op
    for f in filters:
      cf.filters.add().CopyFrom(f)
    return filter_proto
docs: Set composite filter contraint in the given datastore.Filter proto message.
  
    Args:
      filter_proto: datastore.Filter proto message
      op: datastore.CompositeFilter.Operation
      filters: vararg list of datastore.Filter
  
    Returns:
     the same datastore.Filter.
  
    Usage:
      >>> set_composite_filter(filter_proto, datastore.CompositeFilter.AND,
      ...   set_property_filter(datastore.Filter(), ...),
      ...   set_property_filter(datastore.Filter(), ...)) # WHERE ... AND ...