<pre>
{ field: <pattern>, include: <include>, recursive: <recursive> }
</pre>
162635
public static Projection field(String pattern,
                                   boolean include,
                                   boolean recursive) {
        Projection p = new Projection(false);
        p.add("field", pattern).add("include", include).add("recursive", recursive);
        return p;
    }
1277392
function pattern () {
    var targ0 = typeof arguments[0];
    var targ1 = typeof arguments[1];
    var targ2 = typeof arguments[2];
  
    // Shared vars
    var matcherFn, patternObj, patternFn, patternStr, successFn, chain, tree, last;
  
    // pattern(matcherFn, chain)
    if (targ0 == "function" && (targ1 == "undefined" || targ1 == "object")) { 
      matcherFn = arguments[0];
      chain = arguments[1];
  
      // Throw an error if the supplied function does not have a match chain.
      if (!matcherFn.__matchChain) throw new Error("Not a matcher function");
  
      // Splice the chains together.
      if (chain) {
        chain = chain.clone();
        chain.last().next = matcherFn.__matchChain.clone();
      } else {
        chain = matcherFn.__matchChain.clone();
      }
  
      last = chain.pop();
      return matcher(last.patternFn, last.successFn, chain);
    }
  
    // pattern(patternObj, chain)
    else if (targ0 == "object" && (targ1 == "undefined" || targ1 == "object")) {
      patternObj = arguments[0];
      chain = arguments[1] ? arguments[1].clone() : null;
      for (patternStr in patternObj) {
        matcherFn = pattern(patternStr, patternObj[patternStr], chain);
        chain = matcherFn.__matchChain;
      }
      return matcherFn;
    }
  
    // pattern(patternFn, successFn, chain)
    else if (targ0 == "function" && targ1 == "function") {
      chain = arguments[2] ? arguments[2].clone() : null;
      return matcher(arguments[0], arguments[1], chain);
    }
  
    // pattern(patternStr, successFn, chain)
    else {
      patternStr = arguments[0];
      successFn = arguments[1];
      chain = arguments[2] ? arguments[2].clone() : null;
      patternFn = getOrCompile(patternStr);
      return matcher(patternFn, successFn, chain);
    }
  }
787631
def include(pattern, matching):
    
    matching.matching_records = [
        MatchingRecord(
            PathTemplate(pattern) + child_path_template,
            case,
            child_name
        ) for child_path_template, case, child_name in matching.matching_records
    ]
    return matching
261449
def include?(pattern)
      self.each do |current|
        return true if File.fnmatch(pattern, current) || pattern == current
      end
      return false
    end
436882
static Map<SerializedField, Object> fieldsDelta(Map<SerializedField, Object> base,
            Map<SerializedField, Object> child) {
        Map<SerializedField, Object> m = new EnumMap<SerializedField, Object>(child);

        for (Map.Entry<SerializedField, Object> baseEntry : base.entrySet()) {
            SerializedField f = baseEntry.getKey();
            if (m.containsKey(f) && ConfigImplUtil.equalsHandlingNull(baseEntry.getValue(), m.get(f))) {
                // if field is unchanged, just remove it so we inherit
                m.remove(f);
            } else if (!m.containsKey(f)) {
                // if field has been removed, we have to add a deletion entry
                switch (f) {
                case ORIGIN_DESCRIPTION:
                    throw new ConfigException.BugOrBroken("origin missing description field? " + child);
                case ORIGIN_LINE_NUMBER:
                    m.put(SerializedField.ORIGIN_LINE_NUMBER, -1);
                    break;
                case ORIGIN_END_LINE_NUMBER:
                    m.put(SerializedField.ORIGIN_END_LINE_NUMBER, -1);
                    break;
                case ORIGIN_TYPE:
                    throw new ConfigException.BugOrBroken("should always be an ORIGIN_TYPE field");
                case ORIGIN_URL:
                    m.put(SerializedField.ORIGIN_NULL_URL, "");
                    break;
                case ORIGIN_RESOURCE:
                    m.put(SerializedField.ORIGIN_NULL_RESOURCE, "");
                    break;
                case ORIGIN_COMMENTS:
                    m.put(SerializedField.ORIGIN_NULL_COMMENTS, "");
                    break;
                case ORIGIN_NULL_URL: // FALL THRU
                case ORIGIN_NULL_RESOURCE: // FALL THRU
                case ORIGIN_NULL_COMMENTS:
                    throw new ConfigException.BugOrBroken("computing delta, base object should not contain " + f + " "
                            + base);
                case END_MARKER:
                case ROOT_VALUE:
                case ROOT_WAS_CONFIG:
                case UNKNOWN:
                case VALUE_DATA:
                case VALUE_ORIGIN:
                    throw new ConfigException.BugOrBroken("should not appear here: " + f);
                }
            } else {
                // field is in base and child, but differs, so leave it
            }
        }

        return m;
    }
893094
function(parent, field, options) {  
  options = options || {};
  // Unique id for this node's generated method
  this.id = utils.generateId();
  // Link to parent node
  this.parent = parent;
  // The field related to this node
  this.field = field;
  // Perform type check or not on generation
  this.typeCheck = typeof options.typeCheck == 'boolean' ? options.typeCheck : false;
  // Validation language
  this.validation = options.validation ? options.validation : null;
  // Any options
  this.options = options;
  // All children attached to this node
  this.children = [];
  // Just some metadata
  this.type = 'enum';
}
579122
public Match include(String... fields) {
    if(fields != null) {
      includes.addAll(Arrays.asList(fields));
    }
    return this;
  }
204309
function(result, child_config, include_name_stack, properties) {

		if (include_name_stack.indexOf(child_config.name) != -1) Lava.t("Infinite include recursion");
		var include = Lava.view_manager.getInclude(this._parent_view, child_config);
		if (Lava.schema.DEBUG && include == null) Lava.t("Include not found: " + child_config.name);

		include_name_stack.push(child_config.name);
		this._createChildren(result, include, include_name_stack, properties);
		include_name_stack.pop();

	}
1275545
@Deprecated
    public String getFields(String pattern) {
        fp.set(pattern);
        StringBuilder newPattern = new StringBuilder();
        for (Object item : fp.getItems()) {
            if (item instanceof String) {
                newPattern.append(fp.quoteLiteral((String)item));
            } else {
                newPattern.append("{" + getName(item.toString()) + "}");
            }
        }
        return newPattern.toString();
    }
1254465
function (parentBuilder, field) {
    if (!dataUtils.isValidStr(field)) throw "Invalid field, should be a string: " + dataUtils.JSONstringify(field);

    /**
     * Ensures a comparison of the field with the value.
     * @param {string} comparator e.g. "$gt", "$gte", etc.
     * @param {*} value
     * @returns {QueryBuilder} the parent Builder. Use .andField()
     * to chain further with this builder.
     */
    this.is = function (comparator, value) {
        return parentBuilder._compare(field, comparator, value);
    };

    /**
     * Ensures that the field matches the given value. This is same
     * as calling matchAll([value]).
     * @param {*} value
     * @returns {QueryBuilder} the parent Builder. Use .andField()
     * to chain further with this builder.
     */
    this.matches = function (value) {
        return parentBuilder._matchesAll(field, [value]);
    };

    /**
     * Ensures that the field matches all the values.
     * @param {Array.<*>} values
     * @returns {QueryBuilder} the parent Builder. Use .andField()
     * to chain further with this builder.
     */
    this.matchesAll = function (values) {
        return parentBuilder._matchesAll(field, values);
    };

    /**
     * Ensures that the field matches at least one of the values.
     * @param {Array.<*>} values
     * @param {boolean} [addToExistingOr=false] If true, this will
     * be added to the existing OR list ($in), if any.
     * @returns {QueryBuilder} the parent Builder. Use .andField()
     * to chain further with this builder.
     */
    this.matchesAny = function (values, addToExistingOr) {
        return parentBuilder._matchesAny(field, values, addToExistingOr);
    };
}
260030
function createPatternVariations(pattern) {
    var lastCharIdx = pattern.length - 1,
        patternVariations = [pattern, '!' + pattern];

    if (pattern[lastCharIdx] === '/') {
        var unslashed = pattern.substring(0, lastCharIdx);

        patternVariations.push(unslashed);
        patternVariations.push('!' + unslashed);
    }

    return patternVariations;
}
417672
function resolveSubPatterns (pattern) {
        if(!pattern) { return; }

        var expression  = pattern.expression;
        var subPatterns = expression.match(subPatternsRegex) || [];

        subPatterns.forEach(function (matched) {
            // matched is: %{subPatternName} or %{subPatternName:fieldName}
            var subPatternName = matched.substr(2, matched.length - 3);

            var elements   = subPatternName.split(':');
            subPatternName = elements[0];
            var fieldName  = elements[1];

            var subPattern = patterns.get(subPatternName);
            if (!subPattern) {
                console.error('Error: pattern "' + subPatternName + '" not found!');
                return;
            }

            if (!subPattern.resolved) {
                resolvePattern(subPattern);
            }

            if (fieldName) {
                expression = expression.replace(matched, '(?<' + fieldName + '>' + subPattern.resolved + ')');
            } else {
                expression = expression.replace(matched, subPattern.resolved);
            }
        });

        pattern.resolved = expression;
        return pattern;
    }
683935
def include(self, pattern):
        """"""
        found = [f for f in glob(pattern) if not os.path.isdir(f)]
        self.extend(found)
        return bool(found)
1088975
static boolean includePreference(File file, Set<Pattern> excludePattern, Set<Pattern> includePattern, boolean includeByDefault) {
        boolean include = includeByDefault;

        // Iterate over exclude patterns, if there is any match, exclude
        if (include) {
            for (Pattern pattern : excludePattern) {
                Matcher excludeMatcher = pattern.matcher(file.getAbsolutePath());
                if (excludeMatcher.find()) {
                    include = false;
                    break;
                }
            }
        }

        // Iterate over include patterns, if there is any match, include
        if (!include) {
            for (Pattern pattern : includePattern) {
                Matcher includeMatcher = pattern.matcher(file.getAbsolutePath());
                if (includeMatcher.find()) {
                    include = true; // If we are here, we are overriding an exclude
                    break;
                }
            }
        }

        return include;
    }
181033
@Requires({
    "isValidPattern(pattern)",
    "rule != null"
  })
  @Ensures({
    "rule.equals(get(pattern))",
    "!isOverriden(pattern)"
  })
  public void put(String pattern, R rule) {
    String canon = pattern.replace('/', '.');
    boolean exact = !canon.endsWith(".*");
    if (!exact) {
      canon = canon.substring(0, canon.length() - 2);
    }

    String[] parts = canon.split("\\.");

    TernaryNode current = root;
    TernaryNode parent = root;
    int parentIndex = -1;
    for (int i = 0; i < parts.length; ++i) {
      TernaryNode next = current.children.get(parts[i]);
      if (next == null) {
        next = new TernaryNode(null, false);
        current.children.put(parts[i], next);
      }
      if (next.rule != null && !next.exact) {
        parent = next;
        parentIndex = i;
      }
      current = next;
    }

    if (!exact) {
      /* Override patterns beginning with this one. */
      current.children.clear();
    }

    if (!rule.equals(parent.rule)) {
      current.rule = rule;
      current.exact = exact;
    } else {
      /*
       * The new rule we are inserting is already specified through
       * inheritance. Remove spurious nodes. This ensures that any
       * overriding branch is meaningful; that is, it specifies a rule
       * value different from the inherited one.
       */
      current = parent;
      for (int i = parentIndex + 1; i < parts.length; ++i) {
        TernaryNode next = current.children.get(parts[i]);
        if (next.rule == null) {
          current.children.remove(parts[i]);
          break;
        }
      }
    }
  }
273286
public void addInclude(PathPatternType pattern)
  {
    if (_includeList == null)
      _includeList = new ArrayList<PathPatternType>();

    _includeList.add(pattern);
  }
58460
public FieldsFilter withFields(String fields, boolean includeFields) {
        parameters.put("fields", fields);
        parameters.put("include_fields", includeFields);
        return this;
    }