def __init__(<EOL>self, key_path=None, key_path_glob=None, key_path_regex=None):
key_path_arguments = [argument for argument in (<EOL>key_path, key_path_glob, key_path_regex) if argument]<EOL>if len(key_path_arguments) > <NUM_LIT:1>:<EOL><INDENT>raise ValueError((<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'))<EOL><DEDENT>super(FindSpec, self).__init__()<EOL>self._is_regex = False<EOL>self._key_path_segments = None<EOL>self._number_of_key_path_segments = <NUM_LIT:0><EOL>if key_path is not None:<EOL><INDENT>if isinstance(key_path, py2to3.STRING_TYPES):<EOL><INDENT>self._key_path_segments = key_paths.SplitKeyPath(key_path)<EOL><DEDENT>elif isinstance(key_path, list):<EOL><INDENT>self._key_path_segments = key_path<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'.format(<EOL>type(key_path)))<EOL><DEDENT><DEDENT>elif key_path_glob is not None:<EOL><INDENT>if isinstance(key_path_glob, py2to3.STRING_TYPES):<EOL><INDENT>key_path_regex = glob2regex.Glob2Regex(key_path_glob)<EOL>key_path_regex = key_path_regex.replace('<STR_LIT>', '<STR_LIT:/>')<EOL>self._key_path_segments = key_paths.SplitKeyPath(<EOL>key_path_regex, path_separator='<STR_LIT>')<EOL><DEDENT>elif isinstance(key_path_glob, list):<EOL><INDENT>self._key_path_segments = []<EOL>for key_path_segment in key_path_glob:<EOL><INDENT>key_path_regex = glob2regex.Glob2Regex(key_path_segment)<EOL>key_path_regex = key_path_regex.replace('<STR_LIT>', '<STR_LIT:/>')<EOL>self._key_path_segments.append(key_path_regex)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'.format(<EOL>type(key_path_glob)))<EOL><DEDENT>self._is_regex = True<EOL><DEDENT>elif key_path_regex is not None:<EOL><INDENT>if isinstance(key_path_regex, py2to3.STRING_TYPES):<EOL><INDENT>self._key_path_segments = key_paths.SplitKeyPath(<EOL>key_path_regex, path_separator='<STR_LIT>')<EOL><DEDENT>elif isinstance(key_path_regex, list):<EOL><INDENT>self._key_path_segments = key_path_regex<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'.format(<EOL>type(key_path_regex)))<EOL><DEDENT>self._is_regex = True<EOL><DEDENT>if self._key_path_segments is not None:<EOL><INDENT>self._number_of_key_path_segments = len(self._key_path_segments)<EOL><DEDENT>
Initializes a find specification.

        Args:
          key_path (Optional[str|list[str]]): key path or key path segments,
              where None indicates no preference. The key path should be defined
              relative to the root of the Windows Registry. Note that the string
              will be split into segments based on the key path segment separator.
          key_path_glob (Optional[str:list[str]]): key path glob or key path glob
              segments, where None indicates no preference. The key path glob
              should be defined relative to the root of the Windows Registry. The
              default is None. Note that the string will be split into segments
              based on the key path segment separator.
          key_path_regex (Optional[str|list[str]]): key path regular expression or
              key path regular expression segments, where None indicates no
              preference. The key path regular expression should be defined
              relative to the root of the Windows Registry. The default is None.
              Note that the string will be split into segments based on the key
              path segment separator.

        Raises:
          TypeError: if the key_path, key_path_glob or key_path_regex type
              is not supported.
          ValueError: if the key_path, key_path_glob or key_path_regex arguments
              are used at the same time.