def _get_site_profile(self, local_site):
    if not hasattr(self, '_site_profiles'):
        self._site_profiles = {}

    if local_site.pk not in self._site_profiles:
        site_profile = \
            LocalSiteProfile.objects.get(user=self, local_site=local_site)
        site_profile.user = self
        site_profile.local_site = local_site
        self._site_profiles[local_site.pk] = site_profile

    return self._site_profiles[local_site.pk]
Activate pylab mode in the user's namespace.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/accounts/models.py/_get_site_profile--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/lib/pylabtools.py/pylab_activate