def GetValue(self, ignore_error=True):
    if self.HasField("none"):
      return None

    field_names = ["integer", "string", "data", "boolean", "list", "dict",
                   "rdf_value", "float"]

    values = [getattr(self, x) for x in field_names if self.HasField(x)]

    if len(values) != 1:
      return None

    if self.HasField("boolean"):
      return bool(values[0])

    # Unpack RDFValues.
    if self.HasField("rdf_value"):
      try:
        return rdfvalue.RDFValue.classes[self.rdf_value.name](
            initializer=self.rdf_value.data,
            age=self.rdf_value.age)
      except (ValueError, KeyError) as e:
        if ignore_error:
          return e

        raise

    elif self.HasField("list"):
      return [x.GetValue() for x in self.list.content]

    else:
      return values[0]
Ensures a request has permission to access the given quota class.
dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/protodict.py/DataBlob.GetValue--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/context.py/authorize_quota_class_context