def _apply_relations(self, limit=CHUNK_SIZE):
        links = []
        for link_type, ids in self._relations.items():
            for from_id, to_ids in ids.items():
                for to_id in to_ids:
                    link = youtrack.Link()
                    link.typeName = link_type
                    try:
                        link.source = self._to_yt_issue_id(from_id)
                        link.target = self._to_yt_issue_id(to_id)
                    except __HOLE__, e:
                        print "Cannot apply link (%s) to issues: %d and %d" % \
                            (link_type, from_id, to_id)
                        print "Some issues were not imported to YouTrack"
                        raise e
                    links.append(link)
                    if len(links) >= limit:
                        self._target.importLinks(links)
                        del links[0:]
        if links:
            self._target.importLinks(links)
dataset/ETHPy150Open JetBrains/youtrack-rest-python-library/python/redmine2youtrack.py/RedmineImporter._apply_relations