def build_ignore_files(self):
        metadata_excludes = [
            'git',
            'shadow',
            'operation.log',
            'subtasks',
        ]
        with codecs.open(
            self.get_local_path(constants.GIT_EXCLUDE_FILE),
            'w',
            'utf-8'
        ) as out:
            for line in metadata_excludes:
                out.write(
                    '%s/%s\n' % (
                        constants.METADATA_DIR,
                        line,
                    )
                )
            subtask_list_path = self.get_metadata_path('subtasks')
            if os.path.exists(subtask_list_path):
                with open(subtask_list_path, 'r') as in_:
                    for line in in_:
                        out.write(
                            '%s/*\n' % line.strip()
                        )

        with codecs.open(
            self.get_metadata_path('combined_ignore'),
            'w',
            'utf-8'
        ) as out:
            try:
                out.write('# ~/%s\n' % constants.GIT_IGNORE_FILE_PARTIAL)
                with codecs.open(
                    os.path.expanduser(
                        '~/%s' % constants.GIT_IGNORE_FILE_PARTIAL
                    ),
                    'r',
                    'utf-8'
                ) as in_:
                    for line in in_:
                        out.write(
                            '%s\n' % line.strip()
                        )
            except:
                pass

            try:
                out.write(
                    '# %s\n' % (
                        self.get_path(constants.GIT_IGNORE_FILE_PARTIAL)
                    )
                )
                with codecs.open(
                    self.get_path(constants.GIT_IGNORE_FILE_PARTIAL),
                    'r',
                    'utf-8'
                ) as in_:
                    for line in in_:
                        out.write('%s\n' % line.strip())
            except:
                pass
dataset/ETHPy150Open coddingtonbear/jirafs/jirafs/ticketfolder.py/TicketFolder.build_ignore_files/original