'Return a cosmology instance from a string.'

@staticmethod
def get_cosmology_from_string(arg):

    if (arg == u'no_default'):
        cosmo = None
    else:
        try:
            cosmo = getattr(sys.modules[__name__], arg)
        except AttributeError:
            s = u"Unknown    cosmology    '{}'.    Valid    cosmologies:\n{}".format(arg, parameters.available)
            raise ValueError(s)
    return cosmo
