def limits(self, value, square=False):
        """TODO: doc + server side implementation"""
        if isinstance(value, six.string_types):
            import re
            match = re.match(r"(\d*)(\D*)", value)
            if match is None:
                raise ValueError("do not understand limit specifier %r, examples are 90%, 3sigma")
            else:
                value, type = match.groups()
                import ast
                value = ast.literal_eval(value)
                type = type.strip()
                if type in ["s", "sigma"]:
                    return self.limits_sigma(value)
                elif type in ["ss", "sigmasquare"]:
                    return self.limits_sigma(value, square=True)
                elif type in ["%", "percent"]:
                    return self.limits_percentage(value)
                elif type in ["%s", "%square", "percentsquare"]:
                    return self.limits_percentage(value, square=True)
        if value is None:
            return self.limits_percentage(square=square)
        else:
            return value