def _Parse(self, defdirectory, def_type):
    """Parse files of a particular type for tokens and values.

    Given a directory name and the type (services|networks) to
    process, grab all the appropriate files in that directory
    and parse them for definitions.

    Args:
      defdirectory: Path to directory containing definition files.
      def_type: Type of definitions to parse

    Raises:
      NoDefinitionsError: if no definitions are found.
    """
    file_names = []
    get_files = {'services': lambda: glob.glob(defdirectory + '/*.svc'),
                 'networks': lambda: glob.glob(defdirectory + '/*.net')}

    if get_files in def_type:
      file_names = get_files[def_type]()
    else:
      raise NoDefinitionsError('Unknown definitions type.')
    if not file_names:
      raise NoDefinitionsError('No definition files for %s in %s found.' %
                               (def_type, defdirectory))

    for current_file in file_names:
      try:
        file_handle = open(current_file, 'r').readlines()
        for line in file_handle:
          self._ParseLine(line, def_type)
      except IOError as error_info:
        raise NoDefinitionsError('%s', error_info)
dataset/ETHPy150Open google/capirca/lib/naming.py/Naming._Parse/swapped operands of `in`