@classmethod
def from_links(cls, *links):
    'Convert a sequence of shortlinks to the matching Shortlink objects'
    if len(links):
        result = {}
        parsed_links = dict(((link, cls._parse_link(link)) for link in links))
        links_by_artifact = defaultdict(list)
        project_ids = set()
        for (link, d) in list(parsed_links.items()):
            if d:
                project_ids.add(d['project_id'])
                links_by_artifact[unquote(d['artifact'])].append(d)
            else:
                result[link] = parsed_links.pop(link)
        q = cls.query.find(dict(link={'$in': list(links_by_artifact.keys())}, project_id={'$in': list(project_ids)}), validate=False, sort=[('_id', pymongo.DESCENDING)])
        matches_by_artifact = dict(((link, list(matches)) for (link, matches) in groupby(q, key=(lambda s: unquote(s.link)))))
        for (link, d) in six.iteritems(parsed_links):
            matches = matches_by_artifact.get(unquote(d['artifact']), [])
            matches = (m for m in matches if ((m.project.shortname == d['project']) and (m.project.neighborhood_id == d['nbhd']) and (m.app_config is not None) and m.project.app_instance(m.app_config.options.mount_point)))
            if d['app']:
                matches = (m for m in matches if (m.app_config.options.mount_point == d['app']))
            result[link] = cls._get_correct_match(link, list(matches))
        return result
    else:
        return {}
Convert a sequence of shortlinks to the matching Shortlink objects
@classmethod
def from_links(cls, *links):
    
    if len(links):
        result = {}
        parsed_links = dict(((link, cls._parse_link(link)) for link in links))
        links_by_artifact = defaultdict(list)
        project_ids = set()
        for (link, d) in list(parsed_links.items()):
            if d:
                project_ids.add(d['project_id'])
                links_by_artifact[unquote(d['artifact'])].append(d)
            else:
                result[link] = parsed_links.pop(link)
        q = cls.query.find(dict(link={'$in': list(links_by_artifact.keys())}, project_id={'$in': list(project_ids)}), validate=False, sort=[('_id', pymongo.DESCENDING)])
        matches_by_artifact = dict(((link, list(matches)) for (link, matches) in groupby(q, key=(lambda s: unquote(s.link)))))
        for (link, d) in six.iteritems(parsed_links):
            matches = matches_by_artifact.get(unquote(d['artifact']), [])
            matches = (m for m in matches if ((m.project.shortname == d['project']) and (m.project.neighborhood_id == d['nbhd']) and (m.app_config is not None) and m.project.app_instance(m.app_config.options.mount_point)))
            if d['app']:
                matches = (m for m in matches if (m.app_config.options.mount_point == d['app']))
            result[link] = cls._get_correct_match(link, list(matches))
        return result
    else:
        return {}