Given a list of field names and a node referring to a type, finds each name in the list that does not match a field within the type.
359827
public static List<Integer> createListOfNonExistentFields(List<String> list, JavacNode type, boolean excludeStandard, boolean excludeTransient) {
		boolean[] matched = new boolean[list.size()];
		
		for (JavacNode child : type.down()) {
			if (list.isEmpty()) break;
			if (child.getKind() != Kind.FIELD) continue;
			JCVariableDecl field = (JCVariableDecl)child.get();
			if (excludeStandard) {
				if ((field.mods.flags & Flags.STATIC) != 0) continue;
				if (field.name.toString().startsWith("$")) continue;
			}
			if (excludeTransient && (field.mods.flags & Flags.TRANSIENT) != 0) continue;
			
			int idx = list.indexOf(child.getName());
			if (idx > -1) matched[idx] = true;
		}
		
		ListBuffer<Integer> problematic = new ListBuffer<Integer>();
		for (int i = 0 ; i < list.size() ; i++) {
			if (!matched[i]) problematic.append(i);
		}
		
		return problematic.toList();
	}
396665
def _bare_name_matches(self, nodes):
        """"""
        count = 0
        r = {}
        done = False
        max = len(nodes)
        while not done and count < max:
            done = True
            for leaf in self.content:
                if leaf[0].match(nodes[count], r):
                    count += 1
                    done = False
                    break
        r[self.name] = nodes[:count]
        return count, r
314328
private static Set<String> collectIntersectionPrefixes(FieldInfo fi)
      throws IOException {
    if (fi != null) {
      Set<String> result = new HashSet<>();
      String intersectingPrefixes = fi.getAttribute(
          MtasCodecPostingsFormat.MTAS_FIELDINFO_ATTRIBUTE_PREFIX_INTERSECTION);
      if (intersectingPrefixes != null) {
        String[] prefixes = intersectingPrefixes
            .split(Pattern.quote(MtasToken.DELIMITER));
        for (int i = 0; i < prefixes.length; i++) {
          String item = prefixes[i].trim();
          if (!item.equals("")) {
            result.add(item);
          }
        }
      }
      return result;
    } else {
      return Collections.emptySet();
    }
  }
1150421
def get_fields(node, fields_tag="field_list"):
    
    fields_nodes = [c for c in node.children if c.tagname == fields_tag]
    if len(fields_nodes) == 0:
        return {}
    assert len(fields_nodes) == 1, "multiple nodes with tag " + fields_tag
    fields_node = fields_nodes[0]
    fields = [
        {f.tagname: f.rawsource.strip() for f in n.children}
        for n in fields_node.children
        if n.tagname == "field"
    ]
    return {f["field_name"]: f["field_body"] for f in fields}
170483
def exclude(self, *fields):
        

        if len(fields) == 1 and isinstance(fields[0], list):
            exclude_fields = fields[0]
        else:
            exclude_fields = list(fields)

        exclude_fields = [self._defunc(it) for it in exclude_fields]
        exclude_fields = [field.name if not isinstance(field, six.string_types) else field
                          for field in exclude_fields]

        fields = [name for name in self._schema.names
                  if name not in exclude_fields]

        return self._project(fields)
812761
def _ExtractList(self, fields, ignores=(",",), terminators=()):
    """"""
    extracted = []
    i = 0
    for i, field in enumerate(fields):
      # Space-separated comma; ignore, but this is not a finished list.
      # Similar for any other specified ignores (eg, equals sign).
      if field in ignores:
        continue

      # However, some fields are specifically meant to terminate iteration.
      if field in terminators:
        break

      extracted.append(field.strip("".join(ignores)))
      # Check for continuation; this will either be a trailing comma or the
      # next field after this one being a comma. The lookahead here is a bit
      # nasty.
      if not (field.endswith(",") or
              set(fields[i + 1:i + 2]).intersection(ignores)):
        break

    return extracted, fields[i + 1:]
196276
def match_fields(fields, searches,
                 ignore_case=False, wholename=False, complement=False):
    
    if ignore_case:
        fields = [f.lower() for f in fields]
        searches = [s.lower() for s in searches]
    if wholename:
        match_found = _complete_match
    else:
        match_found = _partial_match

    fields = [(i, field) for i, field in enumerate(fields)]
    matched = []
    for search, (idx, field) in itertools.product(searches, fields):
        if not search:  ## don't return all fields for ''
            continue
        if match_found(search, field) and idx not in matched:
            matched.append(idx)

    if complement:
        matched = [idx for idx in list(zip(*fields))[0] if idx not in matched]

    return matched
154731
def check_unknown_fields(self, data, original_data):
        """"""
        if isinstance(original_data, list):
            for elem in original_data:
                self.check_unknown_fields(data, elem)
        else:
            for key in original_data:
                if key not in [
                        self.fields[field].attribute or field
                        for field in self.fields
                ]:
                    raise ValidationError(
                        'Unknown field name {}'.format(key), field_names=[key])
1020180
def filter_fields(self, fields=[], exclude=[], include_all_if_empty=True):
        
        if not include_all_if_empty and not fields:
            return []
        ret = []
        for f in self.visible_fields():
            if fields and f.name not in fields:
                continue
            if exclude and f.name in exclude:
                continue
            ret.append(f)
        return ret
862693
private boolean matchLemmaList(AnalyzedTokenReadings aToken,
      List<String> list) {
    boolean matches = false;
    for (AnalyzedToken analyzedToken : aToken) {
      if (list.contains(analyzedToken.getLemma())) {
          matches = true;
          break;
      }
    }
    return matches;
  }
1191921
def node_field?(field)
      type = field.type.unwrap
      kind = type.kind

      if kind.object?
        node_types.include?(type)
      elsif kind.interface? || kind.union?
        possible_node_types(type).any?
      end
    end
121533
function hasField(selection, fieldNames) {
  if (!selection || selection.type === 'empty') {
    return false;
  }
  const fieldsToLookup = [].concat(fieldNames);

  if (selection.type === 'range') {
    const fields = Object.keys(selection.range.variables);
    const match = intersect(fieldsToLookup, fields);
    return match.length > 0;
  }
  if (selection.type === 'partition') {
    return fieldsToLookup.indexOf(selection.partition.variable) !== -1;
  }

  console.log(
    'SelectionBuilder::hasField does not handle selection of type',
    selection.type
  );

  return false;
}
856142
public boolean containsFieldName(String field) {
    for (SortElement e : elements) {
      if (e.getName().equals(field)) {
        return true;
      }
    }
    return false;
  }
1374636
public void collectTermsByPrefixesForListOfHitPositions(String field,
      int docId, ArrayList<String> prefixes,
      ArrayList<IntervalTreeNodeData<String>> positionsHits)
      throws IOException {
    IndexDoc doc = getDoc(field, docId);
    IndexInput inIndexObjectPosition = indexInputList
        .get("indexObjectPosition");
    IndexInput inTerm = indexInputList.get("term");
    // create tree interval hits
    IntervalRBTree<String> positionTree = new IntervalRBTree<String>(
        positionsHits);

    // find prefixIds
    Map<String, Integer> prefixIds = getPrefixesIds(field, prefixes);
    // search matching tokens
    if (prefixIds != null) {
      CodecSearchTree.searchMtasTreeWithIntervalTree(prefixIds.values(),
          positionTree, inIndexObjectPosition, doc.fpIndexObjectPosition,
          doc.smallestObjectFilepointer);

      // reverse list
      Map<Integer, String> idPrefixes = new HashMap<>();
      for (Entry<String, Integer> entry : prefixIds.entrySet()) {
        idPrefixes.put(entry.getValue(), entry.getKey());
      }
      // term administration
      Map<Long, String> refTerms = new HashMap<>();

      for (IntervalTreeNodeData<String> positionHit : positionsHits) {
        for (MtasTreeHit<String> hit : positionHit.list) {
          if (hit.idData == null) {
            hit.idData = idPrefixes.get(hit.additionalId);
            if (!refTerms.containsKey(hit.additionalRef)) {
              refTerms.put(hit.additionalRef,
                  MtasCodecPostingsFormat.getTerm(inTerm, hit.additionalRef));
            }
            hit.refData = refTerms.get(hit.additionalRef);
          }
        }
      }
    }
  }
1262216
def _infer_schema(row, names=None):
    """"""
    if isinstance(row, dict):
        items = sorted(row.items())

    elif isinstance(row, (tuple, list)):
        if hasattr(row, "__fields__"):  # Row
            items = zip(row.__fields__, tuple(row))
        elif hasattr(row, "_fields"):  # namedtuple
            items = zip(row._fields, tuple(row))
        else:
            if names is None:
                names = ['_%d' % i for i in range(1, len(row) + 1)]
            elif len(names) < len(row):
                names.extend('_%d' % i for i in range(len(names) + 1, len(row) + 1))
            items = zip(names, row)

    elif hasattr(row, "__dict__"):  # object
        items = sorted(row.__dict__.items())

    else:
        raise TypeError("Can not infer schema for type: %s" % type(row))

    fields = [StructField(k, _infer_type(v), True) for k, v in items]
    return StructType(fields)
46552
def selector(self, fieldname):
        """"""
        finder = self._finders[fieldname]
        return (finder._by, finder._selector)
555378
private int findIndexForName(String[] fieldNames, String searchName)
    {
        for(int i = 0; i < fieldNames.length; i++)
        {
            if(searchName.equals(fieldNames[i]))
            {
                return i;
            }
        }
        throw new PersistenceBrokerException("Can't find field name '" + searchName +
                "' in given array of field names");
    }