Copy info from output WCSObject into outputnames for each chip
        for use in creating outputimage object.
435682
def updateOutputValues(self,output_wcs):
        
        outputvals = self.outputValues

        outputvals['output'] = output_wcs.outputNames['outFinal']
        outputvals['outnx'], outputvals['outny'] = output_wcs.wcs.pixel_shape
        outputvals['texptime'] = output_wcs._exptime
        outputvals['texpstart'] = output_wcs._expstart
        outputvals['texpend'] = output_wcs._expend
        outputvals['nimages'] = output_wcs.nimages

        outputvals['scale'] = output_wcs.wcs.pscale #/ self._image[self.scienceExt,1].wcs.pscale
        outputvals['exptime'] = self._exptime

        outnames = self.outputNames
        outnames['outMedian'] = output_wcs.outputNames['outMedian']
        outnames['outFinal'] = output_wcs.outputNames['outFinal']
        outnames['outSci'] = output_wcs.outputNames['outSci']
        outnames['outWeight'] = output_wcs.outputNames['outWeight']
        outnames['outContext'] = output_wcs.outputNames['outContext']
319515
def build_output_table(cls, name='inputTableName', output_name='output'):
        
        obj = cls(name)
        obj.exporter = 'get_output_table_name'
        obj.output_name = output_name
        return obj
485846
def _prepare_output(partitions, verbose):
    """"""
    out = {}
    partitions_count = len(partitions)
    out['raw'] = {
        'offline_count': partitions_count,
    }

    if partitions_count == 0:
        out['message'] = 'No offline partitions.'
    else:
        out['message'] = "{count} offline partitions.".format(count=partitions_count)
        if verbose:
            lines = (
                '{}:{}'.format(topic, partition)
                for (topic, partition) in partitions
            )
            out['verbose'] = "Partitions:\n" + "\n".join(lines)
        else:
            cmdline = sys.argv[:]
            cmdline.insert(1, '-v')
            out['message'] += '\nTo see all offline partitions run: ' + ' '.join(cmdline)

    if verbose:
        out['raw']['partitions'] = [
            {'topic': topic, 'partition': partition}
            for (topic, partition) in partitions
        ]

    return out
475523
public static void dumpSystemInfo(PrintWriter out) {
		out.println("--------------");
		out.println(getJvmSpecInfo());
		out.println("--------------");
		out.println(getJvmInfo());
		out.println("--------------");
		out.println(getJavaSpecInfo());
		out.println("--------------");
		out.println(getJavaInfo());
		out.println("--------------");
		out.println(getJavaRuntimeInfo());
		out.println("--------------");
		out.println(getOsInfo());
		out.println("--------------");
		out.println(getUserInfo());
		out.println("--------------");
		out.println(getHostInfo());
		out.println("--------------");
		out.println(getRuntimeInfo());
		out.println("--------------");
		out.flush();
	}
554541
public static void writeProcessorOutputToValues(
            final Object output,
            final Processor<?, ?> processor,
            final Values values) {
        Map<String, String> mapper = processor.getOutputMapperBiMap();
        if (mapper == null) {
            mapper = Collections.emptyMap();
        }

        final Collection<Field> fields = getAllAttributes(output.getClass());
        for (Field field: fields) {
            String name = getOutputValueName(processor.getOutputPrefix(), mapper, field);
            try {
                final Object value = field.get(output);
                if (value != null) {
                    values.put(name, value);
                } else {
                    values.remove(name);
                }
            } catch (IllegalAccessException e) {
                throw ExceptionUtils.getRuntimeException(e);
            }
        }
    }
422688
def transform_sqlvm_group_output(result):
    '''
    
    '''
    from collections import OrderedDict
    from msrestazure.tools import parse_resource_id
    try:
        resource_group = getattr(result, 'resource_group', None) or parse_resource_id(result.id)['resource_group']
        wsfc_object = format_wsfc_domain_profile(result.wsfc_domain_profile)
        # Create a dictionary with the relevant parameters
        output = OrderedDict([('id', result.id),
                              ('location', result.location),
                              ('name', result.name),
                              ('provisioningState', result.provisioning_state),
                              ('sqlImageOffer', result.sql_image_offer),
                              ('sqlImageSku', result.sql_image_sku),
                              ('resourceGroup', resource_group),
                              ('wsfcDomainProfile', wsfc_object),
                              ('tags', result.tags)])
        return output
    except AttributeError:
        # Return the response object if the formating fails
        return result
758390
def copy(self, _):
        
        #l.debug("Copying %d bytes of memory with id %s." % (len(self.mem), self.id))
        c = SimSymbolicDbgMemory(
            mem=self.mem.branch(),
            memory_id=self.id,
            endness=self.endness,
            abstract_backer=self._abstract_backer,
            read_strategies=[ s.copy() for s in self.read_strategies ],
            write_strategies=[ s.copy() for s in self.write_strategies ],
            stack_region_map=self._stack_region_map,
            generic_region_map=self._generic_region_map
        )

        return c
1332989
def clone(self, name=None):
    
    if name is None:
      name = self.module_name + "_clone"

    return type(self)(output_channels=self.output_channels,
                      kernel_shape=self._kernel_shape,
                      stride=self._stride,
                      rate=self._rate,
                      padding=self._padding,
                      use_bias=self._use_bias,
                      initializers=self._initializers,
                      partitioners=self._partitioners,
                      regularizers=self._regularizers,
                      mask=self._mask,
                      data_format=self._data_format,
                      custom_getter=self._custom_getter,
                      name=name)
956893
def convert_ram_sdp_wf(ADDR_WIDTH=8, DATA_WIDTH=8):
    '''  '''
    clk = Signal(bool(0))
    we = Signal(bool(0))
    addrw = Signal(intbv(0)[ADDR_WIDTH:])
    addrr = Signal(intbv(0)[ADDR_WIDTH:])
    di = Signal(intbv(0)[DATA_WIDTH:])
    do = Signal(intbv(0)[DATA_WIDTH:])
    toVerilog(ram_sdp_wf, clk, we, addrw, addrr, di, do)
1331772
def createWcsHDU(wcs):  # noqa: N802
    
    header = wcs.to_header()

    header['EXTNAME'] = 'WCS'
    header['EXTVER'] = 1

    # Now, update original image size information
    header['NPIX1'] = (wcs.pixel_shape[0], "Length of array axis 1")
    header['NPIX2'] = (wcs.pixel_shape[1], "Length of array axis 2")
    header['PIXVALUE'] = (0.0, "values of pixels in array")

    if hasattr(wcs, 'orientat'):
        orientat = wcs.orientat
    else:
        # find orientat from CD or PC matrix
        if wcs.wcs.has_cd():
            cd12 = wcs.wcs.cd[0][1]
            cd22 = wcs.wcs.cd[1][1]
        elif wcs.wcs.has_pc():
            cd12 = wcs.wcs.cdelt[0] * wcs.wcs.pc[0][1]
            cd22 = wcs.wcs.cdelt[1] * wcs.wcs.pc[1][1]
        else:
            raise ValueError("Invalid WCS: WCS does not contain neither "
                             "a CD nor a PC matrix.")
        orientat = np.rad2deg(np.arctan2(cd12, cd22))
    header['ORIENTAT'] = (orientat, "position angle of "
                          "image y axis (deg. e of n)")

    return fits.ImageHDU(None, header)
735724
public static void copyToView(
			MemorySegment[] segments,
			int offset,
			int sizeInBytes,
			DataOutputView target) throws IOException {
		for (MemorySegment sourceSegment : segments) {
			int curSegRemain = sourceSegment.size() - offset;
			if (curSegRemain > 0) {
				int copySize = Math.min(curSegRemain, sizeInBytes);

				byte[] bytes = allocateReuseBytes(copySize);
				sourceSegment.get(offset, bytes, 0, copySize);
				target.write(bytes, 0, copySize);

				sizeInBytes -= copySize;
				offset = 0;
			} else {
				offset -= sourceSegment.size();
			}

			if (sizeInBytes == 0) {
				return;
			}
		}

		if (sizeInBytes != 0) {
			throw new RuntimeException("No copy finished, this should be a bug, " +
					"The remaining length is: " + sizeInBytes);
		}
	}
885072
def copy(self):
        
        s = MemoryData(self.address, self.size, self.sort, pointer_addr=self.pointer_addr, max_size=self.max_size)
        s.content = self.content

        return s
840349
def get_commands(self, command_name, **kwargs):
        
        chip_id = kwargs.pop("ChipID", self.chip_id_bitarray)
        commands = []
        if command_name == "zeros":
            bv = bitarray(endian='little')
            if "length" in kwargs:
                bv += bitarray(kwargs["length"], endian='little')  # initialized from int, bits may be random
            elif kwargs:
                raise ValueError("Unknown parameter(s): %s" % ", ".join(kwargs.iterkeys()))
            bv.setall(0)  # all bits to zero
            commands.append(bv)
        elif command_name == "ones":
            bv = bitarray(endian='little')
            if "length" in kwargs:
                bv += bitarray(kwargs["length"], endian='little')  # initialized from int, bits may be random
            elif kwargs:
                raise ValueError("Unknown parameter(s): %s" % ", ".join(kwargs.iterkeys()))
            bv.setall(1)  # all bits to one
            commands.append(bv)
        elif command_name == "WrRegister":
            register_addresses = self.get_global_register_attributes("addresses", **kwargs)
            register_bitsets = self.get_global_register_bitsets(register_addresses)
            commands.extend([self.build_command(command_name, Address=register_address, GlobalData=register_bitset, ChipID=chip_id, **kwargs) for register_address, register_bitset in zip(register_addresses, register_bitsets)])
        elif command_name == "RdRegister":
            register_addresses = self.get_global_register_attributes('addresses', **kwargs)
            commands.extend([self.build_command(command_name, Address=register_address, ChipID=chip_id) for register_address in register_addresses])
        elif command_name == "WrFrontEnd":
            registers = ["S0", "S1", "SR_Clr", "CalEn", "DIGHITIN_SEL", "GateHitOr", "ReadErrorReq", "StopClkPulse", "SR_Clock", "Efuse_Sense", "HITLD_IN", "Colpr_Mode", "Colpr_Addr"]
            if self.fei4a:
                registers.append("ReadSkipped")
            elif self.fei4b:
                registers.append("SR_Read")
            self.create_restore_point()
            dcs = kwargs.pop("dcs", range(40))  # set the double columns to latch
            # in case of empty list
            if not dcs:
                dcs = range(40)
            joint_write = kwargs.pop("joint_write", False)
            same_mask_for_all_dc = kwargs.pop("same_mask_for_all_dc", False)
            register_objects = self.get_pixel_register_objects(do_sort=['pxstrobe'], **kwargs)
            # prepare for writing pixel registers
            if not self.broadcast:
                self.set_global_register_value("Colpr_Mode", 0)  # write only to the addressed double-column
                self.set_global_register_value("Colpr_Addr", 40)  # ivalid address, grounded
                # Broadcasting ConfMode not necessary, writing registers is also possible in RunMode
#                 commands.extend(self.get_commands("ConfMode", ChipID=8))  # set all chips to conf mode to receive commands#
                # set all other chips to invalid addresses, to make broadcasting of WrRegister command possible
                commands.extend(self.get_commands("WrRegister", name=["Colpr_Mode", "Colpr_Addr"], ChipID=8))  # braodcast
            self.set_global_register_value("S0", 0)
            self.set_global_register_value("S1", 0)
            self.set_global_register_value("SR_Clr", 0)
            self.set_global_register_value("CalEn", 0)
            self.set_global_register_value("DIGHITIN_SEL", 0)
            self.set_global_register_value("GateHitOr", 0)
            self.set_global_register_value("ReadErrorReq", 0)
            self.set_global_register_value("StopClkPulse", 0)
            self.set_global_register_value("SR_Clock", 0)
            self.set_global_register_value("Efuse_Sense", 0)
            self.set_global_register_value("HITLD_IN", 0)
            self.set_global_register_value("Colpr_Mode", 3 if same_mask_for_all_dc else 0)  # write only the addressed double-column
            self.set_global_register_value("Colpr_Addr", 0)
            if self.fei4a:
                self.set_global_register_value("ReadSkipped", 0)
            elif self.fei4b:
                self.set_global_register_value("SR_Read", 0)
            commands.extend(self.get_commands("WrRegister", name=registers))

            if joint_write:
                pxstrobes = 0
                first_read = True
                do_latch = False
                for register_object in register_objects:
                    if register_object['bitlength'] != 1:
                        raise ValueError('Pixel register %s: joint write not supported for pixel DACs' % register_object['name'])
                    pxstrobe = register_object['pxstrobe']
                    if not isinstance(pxstrobe, basestring):
                        do_latch = True
                        pxstrobes += 2 ** register_object['pxstrobe']
                    if first_read:
                        pixel_reg_value = register_object['value']
                        first_read = False
                    else:
                        if np.array_equal(pixel_reg_value, register_object['value']):
                            pixel_reg_value = register_object['value']
                        else:
                            raise ValueError('Pixel register %s: joint write not supported, pixel register values must be equal' % register_object['name'])
                if do_latch:
                    self.set_global_register_value("Latch_En", 1)
                else:
                    self.set_global_register_value("Latch_En", 0)
                self.set_global_register_value("Pixel_Strobes", pxstrobes)
                commands.extend(self.get_commands("WrRegister", name=["Pixel_Strobes", "Latch_En"]))
                for dc_no in (dcs[:1] if same_mask_for_all_dc else dcs):
                    self.set_global_register_value("Colpr_Addr", dc_no)
                    commands.extend(self.get_commands("WrRegister", name=["Colpr_Addr"]))
                    register_bitset = self.get_pixel_register_bitset(register_objects[0], 0, dc_no)
                    commands.extend([self.build_command(command_name, PixelData=register_bitset, ChipID=8, **kwargs)])  # broadcast
                    if do_latch:
                        commands.extend(self.get_commands("GlobalPulse", Width=0))
            else:
                for register_object in register_objects:
                    pxstrobe = register_object['pxstrobe']
                    if isinstance(pxstrobe, basestring):
                        do_latch = False
                        self.set_global_register_value("Pixel_Strobes", 0)  # no latch
                        self.set_global_register_value("Latch_En", 0)
                        commands.extend(self.get_commands("WrRegister", name=["Pixel_Strobes", "Latch_En"]))
                    else:
                        do_latch = True
                        self.set_global_register_value("Latch_En", 1)
                        commands.extend(self.get_commands("WrRegister", name=["Latch_En"]))
                    bitlength = register_object['bitlength']
                    for bit_no, pxstrobe_bit_no in (enumerate(range(bitlength)) if (register_object['littleendian'] is False) else enumerate(reversed(range(bitlength)))):
                        if do_latch:
                            self.set_global_register_value("Pixel_Strobes", 2 ** (pxstrobe + bit_no))
                            commands.extend(self.get_commands("WrRegister", name=["Pixel_Strobes"]))
                        for dc_no in (dcs[:1] if same_mask_for_all_dc else dcs):
                            self.set_global_register_value("Colpr_Addr", dc_no)
                            commands.extend(self.get_commands("WrRegister", name=["Colpr_Addr"]))
                            register_bitset = self.get_pixel_register_bitset(register_object, pxstrobe_bit_no, dc_no)
                            commands.extend([self.build_command(command_name, PixelData=register_bitset, ChipID=8, **kwargs)])  # broadcast
                            if do_latch:
                                commands.extend(self.get_commands("GlobalPulse", Width=0))
            self.restore(pixel_register=False)
            commands.extend(self.get_commands("WrRegister", name=registers))
        elif command_name == "RdFrontEnd":
            registers = ["Conf_AddrEnable", "S0", "S1", "SR_Clr", "CalEn", "DIGHITIN_SEL", "GateHitOr", "ReadErrorReq", "StopClkPulse", "SR_Clock", "Efuse_Sense", "HITLD_IN", "Colpr_Mode", "Colpr_Addr", "Pixel_Strobes", "Latch_En"]
            if self.fei4a:
                registers.append("ReadSkipped")
            elif self.fei4b:
                registers.append("SR_Read")
            self.create_restore_point()
            dcs = kwargs.pop("dcs", range(40))  # set the double columns to latch
            # in case of empty list
            if not dcs:
                dcs = range(40)
            register_objects = self.get_pixel_register_objects(**kwargs)
            self.set_global_register_value('Conf_AddrEnable', 1)
            self.set_global_register_value("S0", 0)
            self.set_global_register_value("S1", 0)
            self.set_global_register_value("SR_Clr", 0)
            if self.fei4b:
                self.set_global_register_value("SR_Read", 0)
            self.set_global_register_value("CalEn", 0)
            self.set_global_register_value("DIGHITIN_SEL", 0)
            self.set_global_register_value("GateHitOr", 0)
            if self.fei4a:
                self.set_global_register_value("ReadSkipped", 0)
            self.set_global_register_value("ReadErrorReq", 0)
            self.set_global_register_value("StopClkPulse", 0)
            self.set_global_register_value("SR_Clock", 0)
            self.set_global_register_value("Efuse_Sense", 0)
            self.set_global_register_value("HITLD_IN", 0)
            self.set_global_register_value("Colpr_Mode", 0)  # write only the addressed double-column
            self.set_global_register_value("Colpr_Addr", 0)
            self.set_global_register_value("Latch_En", 0)
            self.set_global_register_value("Pixel_Strobes", 0)
            commands.extend(self.get_commands("WrRegister", name=registers))
            for index, register_object in enumerate(register_objects):  # make sure that EnableDigInj is first read back, because it is not latched
                if register_object['name'] == 'EnableDigInj':
                    register_objects[0], register_objects[index] = register_objects[index], register_objects[0]
                    break
            for register_object in register_objects:
                pxstrobe = register_object['pxstrobe']
                bitlength = register_object['bitlength']
                for pxstrobe_bit_no in range(bitlength):
                    logging.debug('Pixel Register %s Bit %d', register_object['name'], pxstrobe_bit_no)
                    do_latch = True
                    try:
                        self.set_global_register_value("Pixel_Strobes", 2 ** (pxstrobe + pxstrobe_bit_no))
                    except TypeError:  # thrown for not latched digInjection
                        self.set_global_register_value("Pixel_Strobes", 0)  # do not latch
                        do_latch = False
                    commands.extend(self.get_commands("WrRegister", name=["Pixel_Strobes"]))
                    for dc_no in dcs:
                        self.set_global_register_value("Colpr_Addr", dc_no)
                        commands.extend(self.get_commands("WrRegister", name=["Colpr_Addr"]))
                        if do_latch is True:
                            self.set_global_register_value("S0", 1)
                            self.set_global_register_value("S1", 1)
                            self.set_global_register_value("SR_Clock", 1)
                            commands.extend(self.get_commands("WrRegister", name=["S0", "S1", "SR_Clock"]))
                            commands.extend(self.get_commands("GlobalPulse", Width=0))
                        self.set_global_register_value("S0", 0)
                        self.set_global_register_value("S1", 0)
                        self.set_global_register_value("SR_Clock", 0)
                        commands.extend(self.get_commands("WrRegister", name=["S0", "S1", "SR_Clock"]))
                        register_bitset = self.get_pixel_register_bitset(register_object, pxstrobe_bit_no if (register_object['littleendian'] is False) else register_object['bitlength'] - pxstrobe_bit_no - 1, dc_no)
                        if self.fei4b:
                            self.set_global_register_value("SR_Read", 1)
                            commands.extend(self.get_commands("WrRegister", name=["SR_Read"]))
                        commands.extend([self.build_command("WrFrontEnd", PixelData=register_bitset, ChipID=chip_id)])
                        if self.fei4b:
                            self.set_global_register_value("SR_Read", 0)
                            commands.extend(self.get_commands("WrRegister", name=["SR_Read"]))
            self.restore(pixel_register=False)
            commands.extend(self.get_commands("WrRegister", name=registers))
        else:
            commands.append(self.build_command(command_name, ChipID=chip_id, **kwargs))
        return commands
1310730
public void copyStructure( DMatrixSparseCSC orig ) {
        reshape(orig.numRows, orig.numCols, orig.nz_length);
        this.nz_length = orig.nz_length;
        System.arraycopy(orig.col_idx,0,col_idx,0,orig.numCols+1);
        System.arraycopy(orig.nz_rows,0,nz_rows,0,orig.nz_length);
    }
742024
def output_command(info, image_info, pretty=False):
    ''''''

    sep = pretty and ' \\\n    ' or ' '

    short_options = ''
    options = []

    container = info['Name'][1:]
    conf = info['Config']
    hconf = info['HostConfig']

    options.append("--name={name}".format(name=container))

    if not conf['AttachStdout']:
        short_options += 'd'

    if conf['OpenStdin']:
        short_options += 'i'

    if conf['Tty']:
        short_options += 't'

    if len(short_options) > 0:
        options.append('-' + short_options)

    options.append("-h {hostname}".format(hostname=conf['Hostname']))

    # Volumes
    if 'Binds' in hconf and isinstance(hconf['Binds'], list):
        for volume in hconf['Binds']:
            options.append("-v {volume}".format(volume=volume))

    # PortBindings
    if 'PortBindings' in hconf and isinstance(hconf['PortBindings'], dict):
        for port, hosts in hconf['PortBindings'].items():
            for host in hosts:
                portbinding = ''
                if 'HostIp' in host and host['HostIp']:
                    portbinding += host['HostIp'] + ':'
                if 'HostPort' in host and host['HostPort']:
                    portbinding += host['HostPort'] + ':'
                portbinding += port
                options.append("-p {portbinding}".format(portbinding=portbinding))

    # Devices
    if 'Devices' in hconf and isinstance(hconf['Devices'], list):
        for device in hconf['Devices']:
            options.append("--device={device}".format(device=device))

    # RestartPolicy
    if 'RestartPolicy' in hconf and hconf['RestartPolicy']['Name']:
        policy = hconf['RestartPolicy']['Name']
        if hconf['RestartPolicy']['MaximumRetryCount'] > 0:
            policy += ':' + str(hconf['RestartPolicy']['MaximumRetryCount'])
        options.append("--restart={policy}".format(policy=policy))

    # Privileged
    if hconf['Privileged']:
        options.append('--privileged')

    # DNS
    if 'Dns' in hconf and isinstance(hconf['Dns'], list):
        for dns in hconf['Dns']:
            options.append("-dns={dns}".format(dns=dns))

    # ExposedPorts
    if 'ExposedPorts' in conf and isinstance(conf['ExposedPorts'], dict):
        for port, _ in conf['ExposedPorts'].items():
            if ('ExposedPorts' not in image_info['Config'] or
                    port not in image_info['Config']['ExposedPorts']):
                options.append("--expose={port}".format(port=port))

    # Env
    if isinstance(conf['Env'], list):
        for env in conf['Env']:
            if env not in image_info['Config']['Env']:
                options.append("-e {env}".format(env=pipes.quote(env)))

    # EntryPoint
    if conf['Entrypoint'] != image_info['Config']['Entrypoint']:
        entry = []
        if isinstance(conf['Entrypoint'], list):
            for entry_item in conf['Entrypoint']:
                entry.append(pipes.quote(entry_item))
        elif isinstance(conf['Entrypoint'], str):
            entry.append(pipes.quote(conf['Entrypoint']))
        if len(entry) > 0:
            options.append("--entrypoint={entry}".format(entry=pipes.quote(' '.join(entry))))

    # WorkingDir
    if image_info['Config']['WorkingDir'] != conf['WorkingDir']:
        options.append("-w {dir}".format(dir=pipes.quote(conf['WorkingDir'])))

    # User
    if conf['User'] and image_info['Config']['User'] != conf['User']:
        options.append("-u {user}".format(user=pipes.quote(conf['User'])))

    # Cmd
    cmd = []
    if conf['Cmd'] != image_info['Config']['Cmd']:
        if isinstance(conf['Cmd'], list):
            for cmd_item in conf['Cmd']:
                cmd.append(pipes.quote(cmd_item))
        elif isinstance(conf['Cmd'], str):
            cmd.append(pipes.quote(conf['Cmd']))

    print('# docker-run command for {container}'.format(container=container))
    cmd_str = 'docker run{sep}{options}{sep}{image}'.format(
        options=sep.join(options), sep=sep, image=conf['Image'])

    if len(cmd) > 0:
        cmd_str += ' ' + ' '.join(cmd)

    print(cmd_str)
    print()
1017351
def combine_inputs_with_outputs(nb_source, nb_outputs, fmt=None):
    """"""

    output_code_cells = [cell for cell in nb_outputs.cells if cell.cell_type == 'code']
    output_other_cells = [cell for cell in nb_outputs.cells if cell.cell_type != 'code']

    fmt = long_form_one_format(fmt)
    text_repr = nb_source.metadata.get('jupytext', {}).get('text_representation', {})
    ext = fmt.get('extension') or text_repr.get('extension')
    format_name = fmt.get('format_name') or text_repr.get('format_name')

    nb_outputs_filtered_metadata = copy(nb_outputs.metadata)
    filter_metadata(nb_outputs_filtered_metadata,
                    nb_source.metadata.get('jupytext', {}).get('notebook_metadata_filter'),
                    _DEFAULT_NOTEBOOK_METADATA)

    for key in nb_outputs.metadata:
        if key not in nb_outputs_filtered_metadata:
            nb_source.metadata[key] = nb_outputs.metadata[key]

    source_is_md_version_one = ext in ['.md', '.Rmd'] and text_repr.get('format_version') == '1.0'
    if nb_source.metadata.get('jupytext', {}).get('formats') or ext in ['.md', '.Rmd']:
        nb_source.metadata.get('jupytext', {}).pop('text_representation', None)

    if not nb_source.metadata.get('jupytext', {}):
        nb_source.metadata.pop('jupytext', {})

    for cell in nb_source.cells:
        # Remove outputs to warranty that trust of returned notebook is that of second notebook
        if cell.cell_type == 'code':
            cell.execution_count = None
            cell.outputs = []

            for i, ocell in enumerate(output_code_cells):
                if same_content(cell.source, ocell.source):
                    # Fill outputs with that of second notebook
                    cell.execution_count = ocell.execution_count
                    cell.outputs = ocell.outputs

                    # Append cell metadata that was filtered
                    if format_name in ['bare', 'sphinx'] or source_is_md_version_one:
                        ocell_filtered_metadata = {}
                    else:
                        ocell_filtered_metadata = copy(ocell.metadata)
                        filter_metadata(ocell_filtered_metadata,
                                        nb_source.metadata.get('jupytext', {}).get('cell_metadata_filter'),
                                        _IGNORE_CELL_METADATA)

                    for key in ocell.metadata:
                        if key not in ocell_filtered_metadata and key not in _JUPYTEXT_CELL_METADATA:
                            cell.metadata[key] = ocell.metadata[key]

                    output_code_cells = output_code_cells[(i + 1):]
                    break
        else:
            for i, ocell in enumerate(output_other_cells):
                if cell.cell_type == ocell.cell_type and same_content(cell.source, ocell.source):
                    if format_name in ['spin', 'bare', 'sphinx'] or source_is_md_version_one:
                        ocell_filtered_metadata = {}
                    else:
                        ocell_filtered_metadata = copy(ocell.metadata)
                        filter_metadata(ocell_filtered_metadata,
                                        nb_source.metadata.get('jupytext', {}).get('cell_metadata_filter'),
                                        _IGNORE_CELL_METADATA)

                    for key in ocell.metadata:
                        if key not in ocell_filtered_metadata:
                            cell.metadata[key] = ocell.metadata[key]

                    output_other_cells = output_other_cells[(i + 1):]
                    break

    return nb_source
391686
def returnAllChips(self,extname=None,exclude=None):
        
        extensions = self._findExtnames(extname=extname,exclude=exclude)
        chiplist = []
        for i in range(1,self._nextend+1,1):
            if 'extver' in self._image[i].header:
                extver = self._image[i].header['extver']
            else:
                extver = 1
            if hasattr(self._image[i],'_extension') and \
                "IMAGE" in self._image[i]._extension:
                if (self._image[i].extname in extensions) and self._image[self.scienceExt,extver].group_member:
                    chiplist.append(self._image[i])
        return chiplist