def configure_recording(self, recording_options=None):
        """Called at start of top-level run to configure case recording.
        Returns set of paths for changing inputs."""
        if self.parent is None:
            if self.recorders:
                recording_options = self.recording_options
                for recorder in self.recorders:
                    recorder.startup()
            else:
                recording_options = None

        if recording_options:
            includes = recording_options.includes
            excludes = recording_options.excludes
            save_problem_formulation = recording_options.save_problem_formulation
        else:
            includes = excludes = save_problem_formulation = None

        # Determine (changing) inputs and outputs to record
        inputs = set()
        constants = {}
        for name in self.list_containers():
            obj = getattr(self, name)
            if has_interface(obj, IDriver, IAssembly):
                inps, consts = obj.configure_recording(recording_options)
                inputs.update(inps)
                constants.update(consts)

        # If nothing to record, return after configuring workflows.
        if not save_problem_formulation and not includes:
            return (inputs, constants)

        # Locate top level assembly.
        top = self
        while top.parent:
            top = top.parent
        prefix_drop = len(top.name)+1 if top.name else 0

        # Determine constant inputs.
        objs = [self]
        objs.extend(getattr(self, name) for name in self.list_containers())
        for obj in objs:
            if has_interface(obj, IComponent):
                prefix = obj.get_pathname()[prefix_drop:]
                if prefix:
                    prefix += '.'

                in_names = obj.list_inputs()
                if obj.parent is not None:
                    conn = obj.parent.connected_inputs(obj.name)
                    for name in conn:
                        obj_name, _, in_name = name.partition('.')
                        if in_name in in_names:
                            in_names.remove(in_name)

                for name in in_names:
                    path = prefix+name
                    if path in inputs:
                        continue  # Changing input.

                    record_constant = False
                    for pattern in includes:
                        if fnmatch(path, pattern):
                            record_constant = True

                    if record_constant:
                        for pattern in excludes:
                            if fnmatch(path, pattern):
                                record_constant = False

                    if record_constant:
                        val = getattr(obj, name)
                        if isinstance(val, VariableTree):
                            for path, val in _expand_tree(path, val):
                                constants[path] = val
                        else:
                            constants[path] = val

        # Record constant inputs.
        if self.parent is None:
            for recorder in self.recorders:
                recorder.record_constants(constants)

        return (inputs, constants)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/assembly.py/Assembly.configure_recording/original