Return extracted data (configured by fields array) from node.
1782
private function getFieldsData(
        Row $row,
        NodeInterface $node,
        $document,
        $fields,
        $templateKey,
        $webspaceKey,
        $locale
    ) {
        $fieldsData = [];
        foreach ($fields as $field) {
            // determine target for data in result array
            if (isset($field['target'])) {
                if (!isset($fieldsData[$field['target']])) {
                    $fieldsData[$field['target']] = [];
                }
                $target = &$fieldsData[$field['target']];
            } else {
                $target = &$fieldsData;
            }

            // create target
            if (!isset($target[$field['name']])) {
                $target[$field['name']] = '';
            }
            if (null !== ($data = $this->getFieldData(
                    $field,
                    $row,
                    $node,
                    $document,
                    $templateKey,
                    $webspaceKey,
                    $locale
                ))
            ) {
                $target[$field['name']] = $data;
            }
        }

        return $fieldsData;
    }
86050
def collect_and_execute_subfields(
        self,
        return_type: GraphQLObjectType,
        field_nodes: List[FieldNode],
        path: ResponsePath,
        result: Any,
    ) -> AwaitableOrValue[Dict[str, Any]]:
        """"""
        sub_field_nodes = self.collect_subfields(return_type, field_nodes)
        return self.execute_fields(return_type, result, path, sub_field_nodes)
373374
public function getFieldsData()
    {
        $fieldsData = array();
        foreach ($this->getFields() as $field) {
            $fieldData = $this->$field;
            // If the field is an Entity, decode it.
            if ($fieldData instanceof self) {
                $fieldData = $fieldData->getFieldsData();
            } elseif (@reset($fieldData) instanceof Entity) {
                // If the field is an array of Entity, decode them all.
                $newFieldData = array();
                foreach ($fieldData as $key => $entity) {
                    $newFieldData[$key] = $entity->getFieldsData();
                }
                $fieldData = $newFieldData;
            }

            $fieldsData[$field] = $fieldData;
        }

        return $fieldsData;
    }
1007549
def pickdata(self, data):
        
        """
        attrs = data.get(self.__options['attrkey']) or {}
        values = data.get(self.__options['valuekey']) or ''
        return (attrs, values)
1355501
def _extract_from_included(self, data):
        
        return (item for item in self.included_data
                if item['type'] == data['type'] and
                str(item['id']) == str(data['id']))
331463
def get_fields(self):
        """"""
        fields = super(DataSerializer, self).get_fields()

        # Hide collections/entities fields on list views as fetching them may be expensive.
        if self.parent is not None:
            del fields['collections']
            del fields['entities']

        return fields
491674
def extract(self, content, output):
    """"""

    # First apply default options.
    plugin_settings = DEFAULT_OPTIONS.copy()
    plugin_settings.update(self['lines'])
    self['lines'] = plugin_settings

    # Validate settings
    assert 'start' in self['lines'], 'Lines start regex missing'
    assert 'end' in self['lines'], 'Lines end regex missing'
    assert 'line' in self['lines'], 'Line regex missing'

    start = re.search(self['lines']['start'], content)
    end = re.search(self['lines']['end'], content)
    if not start or not end:
        logger.warning('no lines found - start %s, end %s', start, end)
        return
    content = content[start.end(): end.start()]
    lines = []
    current_row = {}
    if 'first_line' not in self['lines'] and 'last_line' not in self['lines']:
        self['lines']['first_line'] = self['lines']['line']
    for line in re.split(self['lines']['line_separator'], content):
        # if the line has empty lines in it , skip them
        if not line.strip('').strip('\n') or not line:
            continue
        if 'first_line' in self['lines']:
            match = re.search(self['lines']['first_line'], line)
            if match:
                if 'last_line' not in self['lines']:
                    if current_row:
                        lines.append(current_row)
                    current_row = {}
                if current_row:
                    lines.append(current_row)
                current_row = {
                    field: value.strip() if value else ''
                    for field, value in match.groupdict().items()
                }
                continue
        if 'last_line' in self['lines']:
            match = re.search(self['lines']['last_line'], line)
            if match:
                for field, value in match.groupdict().items():
                    current_row[field] = '%s%s%s' % (
                        current_row.get(field, ''),
                        current_row.get(field, '') and '\n' or '',
                        value.strip() if value else '',
                    )
                if current_row:
                    lines.append(current_row)
                current_row = {}
                continue
        match = re.search(self['lines']['line'], line)
        if match:
            for field, value in match.groupdict().items():
                current_row[field] = '%s%s%s' % (
                    current_row.get(field, ''),
                    current_row.get(field, '') and '\n' or '',
                    value.strip() if value else '',
                )
            continue
        logger.debug('ignoring *%s* because it doesn\'t match anything', line)
    if current_row:
        lines.append(current_row)

    types = self['lines'].get('types', [])
    for row in lines:
        for name in row.keys():
            if name in types:
                row[name] = self.coerce_type(row[name], types[name])

    if lines:
        output['lines'] = lines
1103431
def _extract(node, name, index=0):
    """"""

    nodes = node.getElementsByTagName(name)

    if len(nodes):
        if nodes[index].firstChild:
            return _unescape_htmlentity(nodes[index].firstChild.data.strip())
    else:
        return None
957553
def _parse_fields(self, result, field_name):
        
        field_list = []
        for key, value in result.get('schema', {}).get(field_name, {}).items():
            if key not in field_list:
                field_list.append(key)
        return field_list
92536
def extract_data(self, page):
        """"""
        response_keys = set(page.keys())
        uncommon_keys = response_keys - self.common_keys

        for possible_data_key in uncommon_keys:
            element = page[possible_data_key]
            if isinstance(element, dict):
                return [self.representation(self.client, self.service_name,
                                            element)]
            if isinstance(element, list):
                return [self.representation(self.client, self.service_name, x)
                        for x in element]
1271111
protected function extractData($fields)
    {
        if ($this->readCallback !== null) {
            if (!isset($fields['data'])) {
                $fields['data'] = '';
            }
            $extraData = call_user_func($this->readCallback, $fields);
            if (!empty($extraData)) {
                session_decode($fields['data']);
                $_SESSION = array_merge((array) $_SESSION, (array) $extraData);
                return session_encode();
            }

            return $fields['data'];
        }

        return $fields['data'] ?? '';
    }
1090556
function ( fields ) {

            var field, data = {}, key, value;

            for ( var i = fields.length - 1; i >= 0; i-- ) {

                field = fields[ i ];

                field.removeAttribute( 'name' );
                key = field.getAttribute( this.fieldNameAttribute );
                value = field.value;

                // Cater for select boxes
                if ( field.options && typeof field.selectedIndex !== "undefined" ) {
                    value = field.options[ field.selectedIndex ].value;
                }

                data[ key ] = value;

            }
            
            return data;

        }
1024387
def _from_fields(self, fields):
        '''
        

        '''
        return _np.dtype(self.dtype()).type(next(fields))
485072
function extractAllItems (result) {
  if (!result) return null;

  if (!Array.isArray(result)) result = ('data' in result) ? result.data : result;
  if (!result) return null;
  
  if (!Array.isArray(result)) result = [result];

  return result;
}
796302
public static ArrayNode getArray(ObjectNode obj, String fieldName) {
		return obj == null ? null : array(obj.get(fieldName));
	}
992318
def _to_fields(self, data):
        '''
        

        '''
        (len_t, val_t) = self.list_dtype()

        data = _np.asarray(data, dtype=val_t).ravel()

        yield _np.dtype(len_t).type(data.size)
        for x in data:
            yield x
825523
def data(self):
        '''
        '''
        d = {}
        for val, key in self._fields.items():
            val = getattr(self, val)
            if val is not None:
                d[key] = val
        return d