Add a set of fields to each item in ``iterable``. The set of fields have a
    key=value format. '@' are added to the front of each key.
428278
def fields(iterable, fields=None):
    
    if not fields:
        for item in iterable:
            yield item

    prepared_fields = _prepare_fields(fields)

    for item in iterable:
        yield _process_fields(item, prepared_fields)
1092132
def set_fields(self, fields=None, *fields_args, **fields_kwargs):
        
        if fields_args:
            fields = [fields]
            fields.extend(fields_args)
            for field_name in fields:
                self.set_field(field_name)

        elif fields_kwargs:
            fields = make_dict(fields, fields_kwargs)
            for field_name, field_val in fields.items():
                self.set_field(field_name, field_val)

        else:
            if isinstance(fields, Mapping):
                for field_name, field_val in fields.items():
                    self.set_field(field_name, field_val)

            else:
                for field_name in fields:
                    self.set_field(field_name)

        return self
133981
def add_new_fields(data, data_to_add):
        
        for key, value in data_to_add.items():
            if not data.get(key):
                data[key] = value

        return data
1059005
def add_field(field, func, dict_sequence):
    
    for item in dict_sequence:
        if field not in item:
            item[field] = func(item)
        yield item
1191435
def items(iterable):
    
    if hasattr(iterable, 'iteritems'):
        return (p for p in iterable.iteritems())
    elif hasattr(iterable, 'items'):
        return (p for p in iterable.items())
    else:
        return (p for p in enumerate(iterable))
30286
def set_fields(
            self,
            new_fields):
        
        self.org_fields = {}
        self.fields_to_add = {}
        for k in new_fields:
            self.org_fields[k] = new_fields[k]
            self.fields_to_add[k] = new_fields[k]
587148
def iter_parsed_values(self, field: Field) -> Iterable[Tuple[str, Any]]:
        
        for key, func in self.parsers.items():
            value = func(field)
            if not value:
                continue
            yield key, value
705812
def add(self, attr, item):
        
        return self.set(attr, operation.Add([item]))
918780
def add(self, files, items):
        
        if isinstance(files, (str, bytes)):
            files = iter([files])
        for pathname in files:
            try:
                values = self._filemap[pathname]
            except KeyError:
                self._filemap[pathname] = items
            else:
                values.extend(items)
663705
def add_items_to_tree_iter(self, input_dict, treeiter, parent_dict_path=None):
        
        if parent_dict_path is None:
            parent_dict_path = []
        self.get_view_selection()
        for key, value in sorted(input_dict.items()):
            element_dict_path = copy.copy(parent_dict_path) + [key]
            if isinstance(value, dict):
                new_iter = self.tree_store.append(treeiter, [key, "", True, element_dict_path])
                self.add_items_to_tree_iter(value, new_iter, element_dict_path)
            else:
                self.tree_store.append(treeiter, [key, value, False, element_dict_path])
229965
private void addItems(Map<String, String> values) {
        for (String itemName : values.keySet()) {
            setItem(itemName, values.get(itemName));
        }
    }
2601
def iter_fields(self, schema: Schema) -> Iterable[Tuple[str, Field]]:
        
        for name in sorted(schema.fields.keys()):
            field = schema.fields[name]
            yield field.dump_to or name, field
429491
def extend(self, iterable):
        
        # perhaps: self[len(self):len(self)] = iterable
        self._values.extend(self.coerce_value(item) for item in iterable)
876493
ArrayTagSet addAll(Iterable<Tag> ts) {
    if (ts instanceof Collection) {
      Collection<Tag> data = (Collection<Tag>) ts;
      if (data.isEmpty()) {
        return this;
      } else {
        Tag[] newTags = new Tag[data.size()];
        int i = 0;
        for (Tag t : data) {
          newTags[i] = BasicTag.convert(t);
          ++i;
        }
        return addAll(newTags);
      }
    } else {
      List<Tag> data = new ArrayList<>();
      for (Tag t : ts) {
        data.add(t);
      }
      return addAll(data);
    }
  }
597737
def add(self, key, value):
        
        if isinstance(value, list):
            # TODO: support env vars in list w/masked values
            for val in value:
                self._add_arg_python(key, val)
        elif isinstance(value, dict):
            err = 'Dictionary types are not currently supported for field.'
            print('{}{}{}'.format(c.Style.BRIGHT, c.Fore.RED, err))
        else:
            mask = False
            env_var = re.compile(r'^\$env\.(.*)$')
            envs_var = re.compile(r'^\$envs\.(.*)$')

            if env_var.match(str(value)):
                # read value from environment variable
                env_key = env_var.match(str(value)).groups()[0]
                value = os.environ.get(env_key, value)
            elif envs_var.match(str(value)):
                # read secure value from environment variable
                env_key = envs_var.match(str(value)).groups()[0]
                value = os.environ.get(env_key, value)
                mask = True
            self._add_arg(key, value, mask)
797820
def append_field(self, path, name, value):
        
        path = make_path(path)
        container = self.get_container(path)
        current = container._values.get(name, None)
        if current is None:
            container._values[name] = value
        elif isinstance(current, ValueTree):
            raise TypeError()
        elif isinstance(current, list):
            container._values[name] = current + [value]
        else:
            container._values[name] = [current, value]
247465
def add(self, key: str, value: str):
        
        if key in self:
            # Use super to get mutable set
            super().__getitem__(key).add(value)
        else:
            self[key] = {value}