def get_site(self, site_id):
        if site_id:
            try:
                return Site.objects.get(pk=site_id)
            except (__HOLE__, Site.DoesNotExist):
                raise CommandError('There is no site with given site id.')
        else:
            return None
dataset/ETHPy150Open divio/django-cms/cms/management/commands/subcommands/copy.py/CopySiteCommand.get_site