def snapshot_single_frame(
    emitter,
    features=defaults.DEFAULT_FEATURES_TO_CRAWL,
    options=defaults.DEFAULT_CRAWL_OPTIONS,
    crawler=None,
    inputfile="undefined",
    ignore_exceptions=True,
):

    # Special-casing Reading from a frame file as input here:
    # - Sweep through entire file, if feature.type is in features, emit
    #   feature.key and feature.value
    # - Emit also validates schema as usual, so do not try to pass
    #   noncompliant stuff in the input frame file; it will bounce.

    global should_exit
    crawlmode = crawler.crawl_mode
    if crawlmode == Modes.FILE:
        logger.debug(
            'Reading features from local frame file {0}'.format(inputfile))
        FeatureFormat = namedtuple('FeatureFormat', ['type', 'key',
                                                     'value'])
        if inputfile is None or not os.path.exists(inputfile):
            logger.error('Input frame file: ' + inputfile +
                         ' does not exist.')
        with open(inputfile, 'r') as fd:
            csv.field_size_limit(sys.maxsize)  # to handle large values
            csv_reader = csv.reader(fd, delimiter='\t', quotechar="'")
            num_features = 0
            for row in csv_reader:
                feature_data = FeatureFormat(
                    row[0], json.loads(
                        row[1]), json.loads(
                        row[2], object_pairs_hook=OrderedDict))

                num_features += 1

                # Emit only if in the specified features-to-crawl list

                if features in feature_data.type:
                    emitter.emit(feature_data.key, feature_data.value,
                                 feature_data.type)
            logger.info('Read %d feature rows from %s' % (num_features,
                                                          inputfile))
    else:
        for feature in features.split(','):
            feature_options = options.get(
                feature, defaults.DEFAULT_CRAWL_OPTIONS[feature])
            if should_exit:
                break
            if feature_options is None:
                continue
            try:
                _crawl_single_feature(feature,
                                      feature_options,
                                      crawlmode,
                                      crawler,
                                      emitter)
            except Exception as e:
                logger.exception(e)
                if not ignore_exceptions:
                    raise e
dataset/ETHPy150Open cloudviz/agentless-system-crawler/crawler/crawlutils.py/snapshot_single_frame/swapped operands of `in`