Finds all documents which match with the given example

@param example
example object to construct query with
@param <S>
@return iterable of all matching documents
553748
@Override
	public <S extends T> Iterable<S> findAll(final Example<S> example) {
		final ArangoCursor cursor = findAllInternal((Pageable) null, example, new HashMap<>());
		return cursor;
	}
1245251
public List<ModelServiceInstance> queryModelInstances(ServiceInstanceQuery query){
        List<StringCommand> commands = new ArrayList<StringCommand>(query.getCriteria().size());
        for(QueryCriterion q : query.getCriteria()){
            commands.add((StringCommand) q);
        }
        List<ModelServiceInstance> instances = getDirectoryServiceClient().queryService(commands);
        return instances;

    }
920260
public static List<Example> asList( Example example )
    {
        if (example == null) return new ArrayList<Example>();

        List<Example> all = new ArrayList<Example>();
        for (Example each : example)
        {
            all.add( each );
        }
        return all;
    }
687062
def get_property_example(cls, property_, nested=None, **kw):
        
        paths = kw.get('paths', [])
        name = kw.get('name', '')
        result = None
        if name and paths:
            paths = list(map(lambda path: '.'.join((path, name)), paths))
            result, path = cls._get_custom_example(paths)
            if result is not None and property_['type'] in PRIMITIVE_TYPES:
                cls._example_validate(
                    path, result, property_['type'], property_['type_format'])
                return result

        if SchemaObjects.contains(property_['type']):
            schema = SchemaObjects.get(property_['type'])
            if result is not None:
                if schema.is_array:
                    if not isinstance(result, list):
                        result = [result] * cls.EXAMPLE_ARRAY_ITEMS_COUNT
                else:
                    if isinstance(result, list):
                        cls.logger.warning(
                            'Example type mismatch in path {}'.format(schema.ref_path))
            else:
                result = cls.get_example_by_schema(schema, **kw)

            if (not result) and schema.nested_schemas:
                for _schema_id in schema.nested_schemas:
                    _schema = SchemaObjects.get(_schema_id)
                    if _schema:
                        if isinstance(_schema, SchemaMapWrapper):
                            result[_schema.name] = cls.get_example_by_schema(_schema, **kw)
                        elif _schema.nested_schemas:
                            for _schema__id in _schema.nested_schemas:
                                _schema_ = SchemaObjects.get(_schema__id)
                                if isinstance(_schema_, SchemaMapWrapper):
                                    result[_schema.name] = cls.get_example_by_schema(_schema_, **kw)
        else:
            result = cls.get_example_value_for_primitive_type(
                property_['type'],
                property_['type_properties'],
                property_['type_format'],
                **kw
            )
        return result
984756
public static <T extends CcgExample> List<T> filterExampleCollection(
      final CcgParser parser, List<T> examples) {
    MapReduceExecutor executor = MapReduceConfiguration.getMapReduceExecutor();

    List<T> filteredExamples = executor.filter(examples, new Predicate<T>() {
      @Override
      public boolean apply(CcgExample example) {
        return isPossibleExample(parser, example);
      }
    });

    return filteredExamples;
  }
916815
@Override
    public Iterable<T> findAll(Iterable<I> ids) {
        List<T> results = new ArrayList<>();
        for (I id : ids) {
            T t = findOne(id);
            if (t != null) {
                results.add(t);
            }
        }
        return results;
    }
590000
public Set<DOCUMENT> query(@NonNull Iterable<KEY> keys, @NonNull Predicate<? super DOCUMENT> filter) {
      return Streams.asParallelStream(keys)
                    .flatMap(key -> index.get(key).stream())
                    .map(documents::get)
                    .filter(filter)
                    .collect(Collectors.toSet());
   }
927794
public static <E> E sample(final Iterable<E> iterable) {
        return newArrayList(iterable).get(new java.security.SecureRandom().nextInt(size(iterable)));
    }
1108873
public static Set<String> getPosTagVocabulary(Iterable<? extends CcgExample> examples) {
    Set<String> posTagVocabulary = Sets.newHashSet();
    for (CcgExample example : examples) {
      posTagVocabulary.addAll(example.getSentence().getPosTags());
    }
    return posTagVocabulary;
  }
934515
public static QueryBuilder byInstance(Object instance){
        Validate.argumentsAreNotNull(instance);
        return new QueryBuilder(new InstanceFilterDefinition(instance));
    }
965478
@Override
	public <S extends T> Optional<S> findOne(final Example<S> example) {
		final ArangoCursor cursor = findAllInternal((Pageable) null, example, new HashMap());
		return cursor.hasNext() ? Optional.ofNullable((S) cursor.next()) : Optional.empty();
	}
313464
public List<Match<E>> findAll(List<E> tokens) {
        List<Match<E>> results = new ArrayList<Match<E>>();

        int start = 0;
        Match<E> match;
        do {
            match = this.find(tokens, start);

            if (match != null) {
                start = match.endIndex();

                // match may be empty query string has all optional parts
                if (!match.isEmpty()) {
                    results.add(match);
                }
            }
        } while (match != null);

        return results;
    }
642537
@Override
	public <S extends T> long count(final Example<S> example) {
		final Map<String, Object> bindVars = new HashMap<>();
		final String predicate = exampleConverter.convertExampleToPredicate(example, bindVars);
		final String filter = predicate.length() == 0 ? "" : " FILTER " + predicate;
		final String query = String.format("FOR e IN %s%s COLLECT WITH COUNT INTO length RETURN length",
			getCollectionName(), filter);
		final ArangoCursor<Long> cursor = arangoOperations.query(query, bindVars, null, Long.class);
		return cursor.next();
	}
608664
public final ExampleData getSelectedExampleData() {
		Set<String> allSelectedItems = getSelectedRows();
		if (allSelectedItems == null || allSelectedItems.isEmpty()) {
			return null;
		}
		for (String selectedItem : allSelectedItems) {
			// Only interested in the first selected item as it is a single select list.
			List<Integer> rowIndex = TreeItemUtil.rowIndexStringToList(selectedItem);
			return getTreeModel().getExampleData(rowIndex);
		}
		return null;
	}
814824
public static PactDslRootValue booleanType(Boolean example) {
    PactDslRootValue value = new PactDslRootValue();
    value.setValue(example);
    value.setMatcher(TypeMatcher.INSTANCE);
    return value;
  }
944210
def retrieve_instances(self, query=None):
        
        if query is None:
            data = javabridge.call(self.jobject, "retrieveInstances", "()Lweka/core/Instances;")
        else:
            data = javabridge.call(self.jobject, "retrieveInstances", "(Ljava/lang/String;)Lweka/core/Instances;")
        return Instances(data)
539493
function queryExamplesData(graphql) {
  return graphql(`
    {
      site {
        siteMetadata {
          config {
            EXAMPLES {
              image
              title
              path
              componentUrl
            }
          }
        }
      }
      allImageSharp {
        edges {
          node {
            parent {
              id
            }
            resize(width: 150, height: 150) {
              src
            }
          }
        }
      }
      allFile {
        edges {
          node {
            id
            relativePath
          }
        }
      }
    }
  `)
  .then(result => {
    console.log(result);

    if (result.errors) {
      /* eslint no-console: "off" */
      console.log(result.errors);
      throw new Error(result.errors);
    }

    const { EXAMPLES } = result.data.site.siteMetadata.config;
    // build a lookup map that matches relative paths of images with their public URLs
    const thumbnailsPublicUrls = getExampleThumbnails(result.data);

    // matches public urls to paths of images
    const examplesWithImages = EXAMPLES.map(example => ({
      ...example,
      imageSrc: thumbnailsPublicUrls[example.image]
    }));

    return examplesWithImages;
  })
  .catch(error => {
    log.log(
      { color: COLOR.BRIGHT_YELLOW },
      `error in createPage query with images: ${error}`
    )();
    return graphql(`
      {
        site {
          siteMetadata {
            config {
              EXAMPLES {
                title
                path
              }
            }
          }
        }
      }
    `).then(result => {
      if (result.errors) {
        /* eslint no-console: "off" */
        console.log(result.errors);
        throw new Error(result.errors);
      }
      const { EXAMPLES } = result.data.site.siteMetadata.config;
      return EXAMPLES;
    });
  });
}