def SetValue(self, value, raise_on_error=True):
    type_mappings = [(unicode, "string"), (str, "data"), (bool, "boolean"),
                     (int, "integer"), (long, "integer"), (dict, "dict"),
                     (float, "float")]

    if value is None:
      self.none = "None"

    elif isinstance(value, rdfvalue.RDFValue):
      self.rdf_value.data = value.SerializeToString()
      self.rdf_value.age = int(value.age)
      self.rdf_value.name = value.__class__.__name__

    elif isinstance(value, (list, tuple)):
      self.list.content.Extend([DataBlob().SetValue(
          v, raise_on_error=raise_on_error) for v in value])

    elif isinstance(value, dict):
      self.dict.FromDict(value, raise_on_error=raise_on_error)

    else:
      for type_mapping, member in type_mappings:
        if isinstance(value, type_mapping):
          setattr(self, member, value)

          return self

      message = "Unsupported type for ProtoDict: %s" % type(value)
      if raise_on_error:
        raise TypeError(message)

      setattr(self, "string", message)

    return self
Get string associated with the specified CULA status code.
dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/protodict.py/DataBlob.SetValue--crossover with--dataset/ETHPy150Open lebedov/scikit-cuda/skcuda/cula.py/culaGetStatusString