Build the output entry of the metadata.

        :return: list, containing dicts of partial metadata
166240
def get_output(self, worker_metadatas):
        
        outputs = []
        has_pulp_pull = PLUGIN_PULP_PULL_KEY in self.workflow.exit_results
        try:
            pulp_sync_results = self.workflow.postbuild_results[PLUGIN_PULP_SYNC_KEY]
            crane_registry = pulp_sync_results[0]
        except (KeyError, IndexError):
            crane_registry = None

        for platform in worker_metadatas:
            for instance in worker_metadatas[platform]['output']:
                instance['buildroot_id'] = '{}-{}'.format(platform, instance['buildroot_id'])

                if instance['type'] == 'docker-image':
                    # update image ID with pulp_pull results;
                    # necessary when using Pulp < 2.14. Only do this
                    # when building for a single architecture -- if
                    # building for many, we know Pulp has schema 2
                    # support.
                    if len(worker_metadatas) == 1 and has_pulp_pull:
                        if self.workflow.builder.image_id is not None:
                            instance['extra']['docker']['id'] = self.workflow.builder.image_id

                    # update repositories to point to Crane
                    if crane_registry:
                        pulp_pullspecs = []
                        docker = instance['extra']['docker']
                        for pullspec in docker['repositories']:
                            image = ImageName.parse(pullspec)
                            image.registry = crane_registry.registry
                            pulp_pullspecs.append(image.to_str())

                        docker['repositories'] = pulp_pullspecs

                outputs.append(instance)

        return outputs
1116231
def fullData(master):
    

    builders = []
    for b in master.config.builders:
        steps = []
        for step in b.factory.steps:
            steps.append(getName(step))
        builders.append(steps)
    return {'builders': builders}
1152822
def entries(self):
        """"""
        self.meta.seek(self.file_list_start)
        for i in range(0, self.num_files):
            yield self._get_node()
668860
def load_contents(self):
        
        with open(METADATA_FILE) as f:
            lines = f.readlines()

        lines = map(lambda x: x.strip(), lines)

        exclude_strings = ['<begin_table>', '<end_table>']

        list_of_databases_and_columns = filter(
            lambda x: not x[0] in exclude_strings, [
                list(value) for key, value in itertools.groupby(
                    lines,
                    lambda x: x in exclude_strings
                )
            ]
        )

        for iterator in list_of_databases_and_columns:
            self.create_table_raw(
                tablename=iterator[0],
                columns=iterator[1:][:],
            )

        for i in self.tables:
            i.load_contents()
713096
def toc(self):
        
        output = []
        for key in sorted(self.catalog.keys()):
            edition = self.catalog[key]['edition']
            length = len(self.catalog[key]['transliteration'])
            output.append(
                "Pnum: {key}, Edition: {edition}, length: {length} line(s)".format(
                    key=key, edition=edition, length=length))
        return output
846281
def chain_output_files(self):
        
        ret_list = []
        for key, val in self.file_dict.items():
            # For pure input files we only want output files that were not
            # marked as internal or temp
            if val & FileFlags.out_ch_mask == FileFlags.output_mask:
                ret_list.append(key)
        return ret_list
727939
def contents_list_pairs(self):
        ''''''
        return (tuple(getattr(self.generator, name) for name in names)
                for names in self.info.get('contents_lists', []))
251926
def _tables(self):
        
        return dict(
            (tag, _TableFactory(tag, self._stream, off, len_))
            for tag, off, len_ in self._iter_table_records()
        )
1350453
def _dbg_output(self):
        
        s = "["
        lst = []
        for segment in self._list:
            lst.append(repr(segment))
        s += ", ".join(lst)
        s += "]"
        return s
951906
def py2dict(elements):
    """"""
    metadata_dict = {}
    # Loop through all elements in the Python object.
    for element in elements.children:
        # Start an empty element list if an entry for the element
        # list hasn't been made in the dictionary.
        if element.tag not in metadata_dict:
            metadata_dict[element.tag] = []
        element_dict = {}
        if hasattr(element, 'qualifier') and element.qualifier is not None:
            element_dict['qualifier'] = element.qualifier
        # Set the element's content as a dictionary
        # of children elements.
        if len(element.children) > 0:
            child_dict = {}
            for child in element.children:
                if child.content is not None:
                    child_dict[child.tag] = child.content
            element_dict['content'] = child_dict
        # Set element content that is not children.
        elif element.content is not None:
            if element.content.strip() != '':
                element_dict['content'] = element.content
        # Append the dictionary to the element list
        # if the element has content or children.
        if element_dict.get('content', False):
            metadata_dict[element.tag].append(element_dict)

    return metadata_dict
778062
def build(self):
        
        keys = self._param_grid.keys()
        grid_values = self._param_grid.values()

        def to_key_value_pairs(keys, values):
            return [(key, key.typeConverter(value)) for key, value in zip(keys, values)]

        return [dict(to_key_value_pairs(keys, prod)) for prod in itertools.product(*grid_values)]
869261
def write_metadata res
      File.open(@options[:output_parameters], 'wb') do |f|
        f.write(JSON.pretty_generate(res))
      end
    end
1208158
def get_output_fields(self):
        
        # Re-engineer list from output format
        # XXX TODO: Would be better to use a FieldRecorder class to catch the full field names
        emit_fields = list(i.lower() for i in re.sub(r"[^_A-Z]+", ' ', self.format_item(None)).split())

        # Validate result
        result = []
        for name in emit_fields[:]:
            if name not in engine.FieldDefinition.FIELDS:
                self.LOG.warn("Omitted unknown name '%s' from statistics and output format sorting" % name)
            else:
                result.append(name)

        return result
717935
def metadata(self):
        

        sheet = self.result.add_sheet("metadata")
        self.header(sheet, "metadata")

        n_row = 1  # row number

        for k in self.po.metadata:
            row = sheet.row(n_row)
            row.write(0, k)
            row.write(1, self.po.metadata[k])
            n_row += 1
            sheet.flush_row_data()
448429
def get_metadata(self):
        
        try:
            metadata = get_build_json()["metadata"]
            self.build_id = metadata["name"]
        except KeyError:
            self.log.error("No build metadata")
            raise

        for image in self.workflow.tag_conf.unique_images:
            self.pullspec_image = image
            break

        for image in self.workflow.tag_conf.primary_images:
            # dash at first/last postition does not count
            if '-' in image.tag[1:-1]:
                self.pullspec_image = image
                break

        if not self.pullspec_image:
            raise RuntimeError('Unable to determine pullspec_image')

        metadata_version = 0

        buildroot = self.get_buildroot(build_id=self.build_id)
        output_files = self.get_output(buildroot['id'])

        output = [output.metadata for output in output_files]
        koji_metadata = {
            'metadata_version': metadata_version,
            'buildroots': [buildroot],
            'output': output,
        }
        self.update_buildroot_koji(buildroot, output)

        return koji_metadata, output_files
58967
def build_model_output(cls, name='output'):
        
        return cls(name, PortDirection.OUTPUT, type=PortType.MODEL)
566307
def write_catalogue(self, output_file, key_list=SORTED_ATTRIBUTE_LIST):
        

        with open(output_file, 'w') as of:
            writer = csv.DictWriter(of, fieldnames=key_list)
            writer.writeheader()
            for i in range(self.get_number_events()):
                row_dict = {}
                for key in key_list:
                    if len(self.data[key]) > 0:
                        data = self.data[key][i]
                        if key in self.INT_ATTRIBUTE_LIST:
                            if np.isnan(data):
                                data = ''
                            else:
                                data = int(data)
                        if key in self.FLOAT_ATTRIBUTE_LIST:
                            if np.isnan(data):
                                data = ''
                            else:
                                data = float(data)
                    row_dict[key] = data
                writer.writerow(row_dict)