Upload items to ElasticSearch.

        :param items: items to be uploaded.
515283
def write(self, items):
        
        if self._read_only:
            raise IOError("Cannot write, Connector created as Read Only")

        # Uploading info to the new ES
        docs = []
        for item in items:
            doc = {
                "_index": self._es_index,
                "_type": "item",
                "_id": item["_id"],
                "_source": item["_source"]
            }
            docs.append(doc)
        # TODO exception and error handling
        helpers.bulk(self._es_conn, docs)
        logger.info(self.__log_prefix + " Written: " + str(len(docs)))
1320300
def _upload_files(item, files, upload_kwargs, prev_identifier=None, archive_session=None):
    """"""
    responses = []
    if (upload_kwargs['verbose']) and (prev_identifier != item.identifier):
        print('{0}:'.format(item.identifier))

    try:
        response = item.upload(files, **upload_kwargs)
        responses += response
    except HTTPError as exc:
        responses += [exc.response]
    finally:
        # Debug mode.
        if upload_kwargs['debug']:
            for i, r in enumerate(responses):
                if i != 0:
                    print('---')
                headers = '\n'.join(
                    [' {0}:{1}'.format(k, v) for (k, v) in r.headers.items()]
                )
                print('Endpoint:\n {0}\n'.format(r.url))
                print('HTTP Headers:\n{0}'.format(headers))
                return responses

        # Format error message for any non 200 responses that
        # we haven't caught yet,and write to stderr.
        if responses and responses[-1].status_code and responses[-1].status_code != 200:
            if not responses[-1].status_code:
                return responses
            filename = responses[-1].request.url.split('/')[-1]
            try:
                msg = get_s3_xml_text(responses[-1].content)
            except:
                msg = responses[-1].content
            print(' error uploading {}: {}'.format(filename, msg), file=sys.stderr)

    return responses
929762
def append(self, item):
    
    if self.should_flush():
      self.flush()
    self.items.append(item)
871951
public void setItems(java.util.Collection<Item> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<Item>(items);
    }
990703
def add_fields(self, field_dict):
    
    for key, field in field_dict.items():
      self.add_field(key, field)
329313
public ModelAdapter<?, Item> add(List<Item> items) {
        if (mOriginalItems != null && items.size() > 0) {
            if (mItemAdapter.isUseIdDistributor()) {
                mItemAdapter.getIdDistributor().checkIds(items);
            }
            mOriginalItems.addAll(items);
            publishResults(mConstraint, performFiltering(mConstraint));
            return mItemAdapter;
        } else {
            return mItemAdapter.addInternal(items);
        }
    }
878386
def load_items(self, items):
        
        loaded_items = {}
        requests = collections.deque(create_batch_get_chunks(items))
        while requests:
            request = requests.pop()
            try:
                response = self.dynamodb_client.batch_get_item(RequestItems=request)
            except botocore.exceptions.ClientError as error:
                raise BloopException("Unexpected error while loading items.") from error

            # Accumulate results
            for table_name, table_items in response.get("Responses", {}).items():
                loaded_items.setdefault(table_name, []).extend(table_items)

            # Push additional request onto the deque.
            # "UnprocessedKeys" is {} if this request is done
            if response["UnprocessedKeys"]:
                requests.append(response["UnprocessedKeys"])
        return loaded_items
362458
def put (self, item):
        
        with self.mutex:
            self._put(item)
            self.not_empty.notify()
26668
public void setItems(java.util.Collection<Model> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<Model>(items);
    }
683931
def _update_items(self, items):
        
        self.items = items
        self.map = {item: idx for (idx, item) in enumerate(items)}
749205
async def add_items(self, *items):
    '''
    '''
    items = [item.id for item in await self.process(items)]
    if not items:
      return

    await self.connector.post('Playlists/{Id}/Items'.format(Id=self.id),
      data={'Ids': ','.join(items)}, remote=False
    )
887528
def _items_to_es(self, json_items):
        

        if len(json_items) == 0:
            return

        logger.info("Adding items to Ocean for %s (%i items)" %
                    (self, len(json_items)))

        field_id = self.get_field_unique_id()

        inserted = self.elastic.bulk_upload(json_items, field_id)

        if len(json_items) != inserted:
            missing = len(json_items) - inserted
            info = json_items[0]

            name = info['backend_name']
            version = info['backend_version']
            origin = info['origin']

            logger.warning("%s/%s missing JSON items for backend %s [ver. %s], origin %s",
                           str(missing),
                           str(len(json_items)),
                           name, version, origin)

        return inserted
92881
public void setItems(java.util.Collection<RouteResponse> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<RouteResponse>(items);
    }
1084932
def put(self, item):
        ''' 
        '''
        if isinstance(item, self._item_class):
            self._put_one(item)
        elif isinstance(item, (list, tuple)):
            self._put_many(item)
        else:
            raise RuntimeError('Unknown item(s) type, %s' % type(item))
906214
def items
      item.items if item.respond_to?(:items) && item.items && item.items.any?
    end
793620
def extend(self, items):
        
        print('\n'.join(items))
        super(MyList, self).extend(items)
281083
def _put(self, *args, **kwargs):
        
        if 'data' in kwargs:
            kwargs['data'] = json.dumps(kwargs['data'])
        response = requests.put(*args, **kwargs)
        response.raise_for_status()