code: def _validate_type(type):
      valid = ("text", "binary", "dir")
      if type is not None and type not in valid:
          raise ValueError(
              f"invalid value for type {type!r}: expected one of {', '.join(valid)}"
          )
      return type
  
imports: import fnmatch
  import glob
  import logging
  import os
  import re
  import shutil
  from guild import util
label_desc: Use image node_id 7 for calling the FileSelectRule obj's underlying member method code with example usage: obj._validate_type(type) and returns: type