class_docstr: FuzzingHelper makes handling FuzzedDataProvider easier with TensorFlow Python fuzzing.
class_docstr_tok: ["FuzzingHelper","makes","handling","FuzzedDataProvider","easier","with","TensorFlow","Python","fuzzing","."]
docstr: Return a random tensorflow dtype.
  
  Args:
    allowed_set: An allowlisted set of dtypes to choose from instead of all of
    them.
  
  Returns:
    A random type from the list containing all TensorFlow types.
docstr_tok: ["Return","a","random","tensorflow","dtype",".","Args",":","allowed_set",":","An","allowlisted","set","of","dtypes","to","choose","from","instead","of","all","of","them",".","Returns",":","A","random","type","from","the","list","containing","all","TensorFlow","types","."]
code: def get_tf_dtype(self, allowed_set=None):
      """Return a random tensorflow dtype.
  
      Args:
        allowed_set: An allowlisted set of dtypes to choose from instead of all of
        them.
  
      Returns:
        A random type from the list containing all TensorFlow types.
      """
      if allowed_set:
          index = self.get_int(0, len(allowed_set) - 1)
          if allowed_set[index] not in _TF_DTYPES:
              raise tf.errors.InvalidArgumentError(
                  None,
                  None,
                  "Given dtype {} is not accepted.".format(
                      allowed_set[index]
                  ),
              )
          return allowed_set[index]
      else:
          index = self.get_int(0, len(_TF_DTYPES) - 1)
          return _TF_DTYPES[index]
  
file_path: tensorflow-upstream/tensorflow/security/fuzzing/python_fuzzing.py
imports: import atheris
  import tensorflow
label_desc: Use image node_id 8 for calling the FuzzingHelper obj's underlying member method code with example usage: obj.get_tf_dtype(allowed_set) and returns: allowed_set, _TF_DTYPES