Context:
# Copyright (c) 2012, Cloudscaling
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import ast
import re

import pep8

"""
Guidelines for writing new hacking checks

 - Use only for Nova specific tests. OpenStack general tests
   should be submitted to the common 'hacking' module.
 - Pick numbers in the range N3xx. Find the current test with
   the highest allocated number and then pick the next value.
 - Keep the test method code in the source file ordered based
   on the N3xx value.
 - List the new rule in the top level HACKING.rst file
 - Add test cases for each new rule to nova/tests/test_hacking.py

"""

UNDERSCORE_IMPORT_FILES = []

session_check = re.compile(r"\w*def [a-zA-Z0-9].*[(].*session.*[)]")
cfg_re = re.compile(r".*\scfg\.")
vi_header_re = re.compile(r"^#\s+vim?:.+")
virt_file_re = re.compile(r"\./nova/(?:tests/)?virt/(\w+)/")
virt_import_re = re.compile(
    r"^\s*(?:import|from) nova\.(?:tests\.)?virt\.(\w+)")
virt_config_re = re.compile(
    r"CONF\.import_opt\('.*?', 'nova\.virt\.(\w+)('|.)")
author_tag_re = (re.compile("^\s*#\s*@?(a|A)uthor:"),
                 re.compile("^\.\.\s+moduleauthor::"))
asse_trueinst_re = re.compile(
                     r"(.)*assertTrue\(isinstance\((\w|\.|\'|\"|\[|\])+, "
                     "(\w|\.|\'|\"|\[|\])+\)\)")
asse_equal_type_re = re.compile(
                       r"(.)*assertEqual\(type\((\w|\.|\'|\"|\[|\])+\), "
                       "(\w|\.|\'|\"|\[|\])+\)")
asse_equal_end_with_none_re = re.compile(
                           r"assertEqual\(.*?,\s+None\)$")
asse_equal_start_with_none_re = re.compile(
                           r"assertEqual\(None,")
# NOTE(snikitin): Next two regexes weren't united to one for more readability.
#                 asse_true_false_with_in_or_not_in regex checks
#                 assertTrue/False(A in B) cases where B argument has no spaces
#                 asse_true_false_with_in_or_not_in_spaces regex checks cases
#                 where B argument has spaces and starts/ends with [, ', ".
#                 For example: [1, 2, 3], "some string", 'another string'.
#                 We have to separate these regexes to escape a false positives
#                 results. B argument should have spaces only if it starts
#                 with [, ", '. Otherwise checking of string
#                 "assertFalse(A in B and C in D)" will be false positives.
#                 In this case B argument is "B and C in D".
asse_true_false_with_in_or_not_in = re.compile(r"assert(True|False)\("
                    r"(\w|[][.'\"])+( not)? in (\w|[][.'\",])+(, .*)?\)")
asse_true_false_with_in_or_not_in_spaces = re.compile(r"assert(True|False)"
                    r"\((\w|[][.'\"])+( not)? in [\[|'|\"](\w|[][.'\", ])+"
                    r"[\[|'|\"](, .*)?\)")
asse_raises_regexp = re.compile(r"assertRaisesRegexp\(")
conf_attribute_set_re = re.compile(r"CONF\.[a-z0-9_.]+\s*=\s*\w")
log_translation = re.compile(
    r"(.)*LOG\.(audit|error|critical)\(\s*('|\")")
log_translation_info = re.compile(
    r"(.)*LOG\.(info)\(\s*(_\(|'|\")")
log_translation_exception = re.compile(
    r"(.)*LOG\.(exception)\(\s*(_\(|'|\")")
log_translation_LW = re.compile(
    r"(.)*LOG\.(warning)\(\s*(_\(|'|\")")
log_warn = re.compile(
    r"(.)*LOG\.(warn)\(\s*('|\"|_)")
translated_log = re.compile(
    r"(.)*LOG\.(audit|error|info|critical|exception)"
    "\(\s*_\(\s*('|\")")
mutable_default_args = re.compile(r"^\s*def .+\((.+=\{\}|.+=\[\])")
string_translation = re.compile(r"[^_]*_\(\s*('|\")")
underscore_import_check = re.compile(r"(.)*import _(.)*")
# We need this for cases where they have created their own _ function.
custom_underscore_check = re.compile(r"(.)*_\s*=\s*(.)*")
api_version_re = re.compile(r"@.*api_version")

# TODO(dims): When other oslo libraries switch over non-namespace'd
# imports, we need to add them to the regexp below.
oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](concurrency)")

class BaseASTChecker(ast.NodeVisitor):
    """Provides a simple framework for writing AST-based checks.

    Subclasses should implement visit_* methods like any other AST visitor
    implementation. When they detect an error for a particular node the
    method should call ``self.add_error(offending_node)``. Details about
    where in the code the error occurred will be pulled from the node
    object.

    Subclasses should also provide a class variable named CHECK_DESC to
    be used for the human readable error message.

    """

    def __init__(self, tree, filename):
        """This object is created automatically by pep8.

        :param tree: an AST tree
        :param filename: name of the file being analyzed
                         (ignored by our checks)
        """
        self._tree = tree
        self._errors = []

    def run(self):
        """Called automatically by pep8."""
        self.visit(self._tree)
        return self._errors

    def add_error(self, node, message=None):
        """Add an error caused by a node to the list of errors for pep8."""
        message = message or self.CHECK_DESC
        error = (node.lineno, node.col_offset, message, self.__class__)
        self._errors.append(error)

    def _check_call_names(self, call_node, names):
        if isinstance(call_node, ast.Call):
            if isinstance(call_node.func, ast.Name):
                if call_node.func.id in names:
                    return True
        return False

def import_no_db_in_virt(logical_line, filename):
    """Check for db calls from nova/virt

    As of grizzly-2 all the database calls have been removed from
    nova/virt, and we want to keep it that way.

    N307
    """
    if "nova/virt" in filename and not filename.endswith("fake.py"):
        if logical_line.startswith("from nova import db"):
            yield (0, "N307: nova.db import not allowed in nova/virt/*")

def no_db_session_in_public_api(logical_line, filename):
    if "db/api.py" in filename:
        if session_check.match(logical_line):
            yield (0, "N309: public db api methods may not accept session")

def use_timeutils_utcnow(logical_line, filename):
    # tools are OK to use the standard datetime module
    if "/tools/" in filename:
        return

    msg = "N310: timeutils.utcnow() must be used instead of datetime.%s()"

    datetime_funcs = ['now', 'utcnow']
    for f in datetime_funcs:
        pos = logical_line.find('datetime.%s' % f)
        if pos != -1:
            yield (pos, msg % f)

def _get_virt_name(regex, data):
    m = regex.match(data)
    if m is None:
        return None
    driver = m.group(1)
    # Ignore things we mis-detect as virt drivers in the regex
    if driver in ["test_virt_drivers", "driver", "firewall",
                  "disk", "api", "imagecache", "cpu", "hardware"]:
        return None
    # TODO(berrange): remove once bugs 1261826 and 126182 are
    # fixed, or baremetal driver is removed, which is first.
    if driver == "baremetal":
        return None
    return driver

def import_no_virt_driver_import_deps(physical_line, filename):
    """Check virt drivers' modules aren't imported by other drivers

    Modules under each virt driver's directory are
    considered private to that virt driver. Other drivers
    in Nova must not access those drivers. Any code that
    is to be shared should be refactored into a common
    module

    N311
    """
    thisdriver = _get_virt_name(virt_file_re, filename)
    thatdriver = _get_virt_name(virt_import_re, physical_line)
    if (thatdriver is not None and
        thisdriver is not None and
        thisdriver != thatdriver):
        return (0, "N311: importing code from other virt drivers forbidden")

def import_no_virt_driver_config_deps(physical_line, filename):
    """Check virt drivers' config vars aren't used by other drivers

    Modules under each virt driver's directory are
    considered private to that virt driver. Other drivers
    in Nova must not use their config vars. Any config vars
    that are to be shared should be moved into a common module

    N312
    """
    thisdriver = _get_virt_name(virt_file_re, filename)
    thatdriver = _get_virt_name(virt_config_re, physical_line)
    if (thatdriver is not None and
        thisdriver is not None and
        thisdriver != thatdriver):
        return (0, "N312: using config vars from other virt drivers forbidden")

def capital_cfg_help(logical_line, tokens):
    msg = "N313: capitalize help string"

    if cfg_re.match(logical_line):
        for t in range(len(tokens)):
            if tokens[t][1] == "help":
                txt = tokens[t + 2][1]
                if len(txt) > 1 and txt[1].islower():
                    yield(0, msg)

def no_vi_headers(physical_line, line_number, lines):
    """Check for vi editor configuration in source files.

    By default vi modelines can only appear in the first or
    last 5 lines of a source file.

    N314
    """
    # NOTE(gilliard): line_number is 1-indexed
    if line_number <= 5 or line_number > len(lines) - 5:
        if vi_header_re.match(physical_line):
            return 0, "N314: Don't put vi configuration in source files"

def assert_true_instance(logical_line):
    """Check for assertTrue(isinstance(a, b)) sentences

    N316
    """
    if asse_trueinst_re.match(logical_line):
        yield (0, "N316: assertTrue(isinstance(a, b)) sentences not allowed")

def assert_equal_type(logical_line):
    """Check for assertEqual(type(A), B) sentences

    N317
    """
    if asse_equal_type_re.match(logical_line):
        yield (0, "N317: assertEqual(type(A), B) sentences not allowed")

def assert_equal_none(logical_line):
    """Check for assertEqual(A, None) or assertEqual(None, A) sentences

    N318
    """
    res = (asse_equal_start_with_none_re.search(logical_line) or
           asse_equal_end_with_none_re.search(logical_line))
    if res:
        yield (0, "N318: assertEqual(A, None) or assertEqual(None, A) "
               "sentences not allowed")

def no_translate_debug_logs(logical_line, filename):
    """Check for 'LOG.debug(_('

    As per our translation policy,
    https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation
    we shouldn't translate debug level logs.

    * This check assumes that 'LOG' is a logger.
    * Use filename so we can start enforcing this in specific folders instead
      of needing to do so all at once.

    N319
    """
    if logical_line.startswith("LOG.debug(_("):
        yield(0, "N319 Don't translate debug level logs")

def no_setting_conf_directly_in_tests(logical_line, filename):
    """Check for setting CONF.* attributes directly in tests

    The value can leak out of tests affecting how subsequent tests run.
    Using self.flags(option=value) is the preferred method to temporarily
    set config options in tests.

    N320
    """
    if 'nova/tests/' in filename:
        res = conf_attribute_set_re.match(logical_line)
        if res:
            yield (0, "N320: Setting CONF.* attributes directly in tests is "
                      "forbidden. Use self.flags(option=value) instead")

def validate_log_translations(logical_line, physical_line, filename):
    # Translations are not required in the test directory
    # and the Xen utilities
    if ("nova/tests" in filename or
        "plugins/xenserver/xenapi/etc/xapi.d" in filename or
        # TODO(Mike_D):Needs to be remove with:
        # I075ab2a522272f2082c292dfedc877abd8ebe328
            "nova/virt/libvirt" in filename):
        return
    if pep8.noqa(physical_line):
        return
    msg = "N328: LOG.info messages require translations `_LI()`!"
    if log_translation_info.match(logical_line):
        yield (0, msg)
    msg = "N329: LOG.exception messages require translations `_LE()`!"
    if log_translation_exception.match(logical_line):
        yield (0, msg)
    msg = "N330: LOG.warning messages require translations `_LW()`!"
    if log_translation_LW.match(logical_line):
        yield (0, msg)
    msg = "N331: Use LOG.warning due to compatibility with py3"
    if log_warn.match(logical_line):
        yield (0, msg)
    msg = "N321: Log messages require translations!"
    if log_translation.match(logical_line):
        yield (0, msg)

def no_mutable_default_args(logical_line):
    msg = "N322: Method's default argument shouldn't be mutable!"
    if mutable_default_args.match(logical_line):
        yield (0, msg)

def check_explicit_underscore_import(logical_line, filename):
    """Check for explicit import of the _ function

    We need to ensure that any files that are using the _() function
    to translate logs are explicitly importing the _ function.  We
    can't trust unit test to catch whether the import has been
    added so we need to check for it here.
    """

    # Build a list of the files that have _ imported.  No further
    # checking needed once it is found.
    if filename in UNDERSCORE_IMPORT_FILES:
        pass
    elif (underscore_import_check.match(logical_line) or
          custom_underscore_check.match(logical_line)):
        UNDERSCORE_IMPORT_FILES.append(filename)
    elif (translated_log.match(logical_line) or
         string_translation.match(logical_line)):
        yield(0, "N323: Found use of _() without explicit import of _ !")

def use_jsonutils(logical_line, filename):
    # the code below that path is not meant to be executed from neutron
    # tree where jsonutils module is present, so don't enforce its usage
    # for this subdirectory
    if "plugins/xenserver" in filename:
        return

    # tools are OK to use the standard json module
    if "/tools/" in filename:
        return

    msg = "N324: jsonutils.%(fun)s must be used instead of json.%(fun)s"

    if "json." in logical_line:
        json_funcs = ['dumps(', 'dump(', 'loads(', 'load(']

Answer: for f in json_funcs:

<think>
The function use_jsonutils is checking for usage of the standard json module. After detecting "json." in the line, it defines a list of json functions to look for. The next logical step is to iterate over that list to check each function in the line, so the next line should start a for-loop over json_funcs.
</think>
for fun in json_funcs:


Context:
/*
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch licenses this file to you under
 * the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.elasticsearch.action.termvectors;

import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.DocumentRequest;
import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.action.get.MultiGetRequest;
import org.elasticsearch.action.support.single.shard.SingleShardOperationRequest;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.lucene.uid.Versions;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.VersionType;

import java.io.IOException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;

import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;

/**
 * Request returning the term vector (doc frequency, positions, offsets) for a
 * document.
 *

 * Note, the {@link #index()}, {@link #type(String)} and {@link #id(String)} are
 * required.
 */
public class TermVectorsRequest extends SingleShardOperationRequest<TermVectorsRequest> implements DocumentRequest<TermVectorsRequest> {

    private String type;

    private String id;

    private BytesReference doc;

    private String routing;

    private VersionType versionType = VersionType.INTERNAL;

    private long version = Versions.MATCH_ANY;

    protected String preference;

    private static final AtomicInteger randomInt = new AtomicInteger(0);

    // TODO: change to String[]
    private Set<String> selectedFields;

    Boolean realtime;

    private Map<String, String> perFieldAnalyzer;

    private EnumSet<Flag> flagsEnum = EnumSet.of(Flag.Positions, Flag.Offsets, Flag.Payloads,
            Flag.FieldStatistics);

    long startTime;

    public TermVectorsRequest() {
    }

    /**
     * Constructs a new term vector request for a document that will be fetch
     * from the provided index. Use {@link #type(String)} and
     * {@link #id(String)} to specify the document to load.
     */
    public TermVectorsRequest(String index, String type, String id) {
        super(index);
        this.id = id;
        this.type = type;
    }

    /**
     * Constructs a new term vector request for a document that will be fetch
     * from the provided index. Use {@link #type(String)} and
     * {@link #id(String)} to specify the document to load.
     */
    public TermVectorsRequest(TermVectorsRequest other) {
        super(other.index());
        this.id = other.id();
        this.type = other.type();
        if (this.doc != null) {
            this.doc = other.doc().copyBytesArray();
        }
        this.flagsEnum = other.getFlags().clone();
        this.preference = other.preference();
        this.routing = other.routing();
        if (other.selectedFields != null) {
            this.selectedFields = new HashSet<>(other.selectedFields);
        }
        if (other.perFieldAnalyzer != null) {
            this.perFieldAnalyzer = new HashMap<>(other.perFieldAnalyzer);
        }
        this.realtime = other.realtime();
        this.version = other.version();
        this.versionType = VersionType.fromValue(other.versionType().getValue());
        this.startTime = other.startTime();
    }

    public TermVectorsRequest(MultiGetRequest.Item item) {
        super(item.index());
        this.id = item.id();
        this.type = item.type();
        this.selectedFields(item.fields());
        this.routing(item.routing());
    }

    public EnumSet<Flag> getFlags() {
        return flagsEnum;
    }

    /**
     * Sets the type of document to get the term vector for.
     */
    public TermVectorsRequest type(String type) {
        this.type = type;
        return this;
    }

    /**
     * Returns the type of document to get the term vector for.
     */
    @Override
    public String type() {
        return type;
    }

    /**
     * Returns the id of document the term vector is requested for.
     */
    @Override
    public String id() {
        return id;
    }

    /**
     * Sets the id of document the term vector is requested for.
     */
    public TermVectorsRequest id(String id) {
        this.id = id;
        return this;
    }

    /**
     * Returns the artificial document from which term vectors are requested for.
     */
    public BytesReference doc() {
        return doc;
    }

    /**
     * Sets an artificial document from which term vectors are requested for.
     */
    public TermVectorsRequest doc(XContentBuilder documentBuilder) {
        return this.doc(documentBuilder.bytes(), true);
    }

    /**
     * Sets an artificial document from which term vectors are requested for.
     */
    public TermVectorsRequest doc(BytesReference doc, boolean generateRandomId) {
        // assign a random id to this artificial document, for routing
        if (generateRandomId) {
            this.id(String.valueOf(randomInt.getAndAdd(1)));
        }
        this.doc = doc;
        return this;
    }

    /**
     * @return The routing for this request.
     */
    @Override
    public String routing() {
        return routing;
    }

    @Override
    public TermVectorsRequest routing(String routing) {
        this.routing = routing;
        return this;
    }

    /**
     * Sets the parent id of this document. Will simply set the routing to this
     * value, as it is only used for routing with delete requests.
     */
    public TermVectorsRequest parent(String parent) {
        if (routing == null) {
            routing = parent;
        }
        return this;
    }

    public String preference() {
        return this.preference;
    }

    /**
     * Sets the preference to execute the search. Defaults to randomize across
     * shards. Can be set to <tt>_local</tt> to prefer local shards,
     * <tt>_primary</tt> to execute only on primary shards, or a custom value,
     * which guarantees that the same order will be used across different
     * requests.
     */
    public TermVectorsRequest preference(String preference) {
        this.preference = preference;
        return this;
    }

    /**
     * Return the start and stop offsets for each term if they were stored or
     * skip offsets.
     */
    public TermVectorsRequest offsets(boolean offsets) {
        setFlag(Flag.Offsets, offsets);
        return this;
    }

    /**
     * @return true if term offsets should be returned. Otherwise
     * false
     */
    public boolean offsets() {
        return flagsEnum.contains(Flag.Offsets);
    }

    /**
     * Return the positions for each term if stored or skip.
     */
    public TermVectorsRequest positions(boolean positions) {
        setFlag(Flag.Positions, positions);
        return this;
    }

    /**
     * @return Returns if the positions for each term should be returned if
     *         stored or skip.
     */
    public boolean positions() {
        return flagsEnum.contains(Flag.Positions);
    }

    /**
     * @return true if term payloads should be returned. Otherwise
     * false
     */
    public boolean payloads() {
        return flagsEnum.contains(Flag.Payloads);
    }

    /**
     * Return the payloads for each term or skip.
     */
    public TermVectorsRequest payloads(boolean payloads) {
        setFlag(Flag.Payloads, payloads);
        return this;
    }

    /**
     * @return true if term statistics should be returned.
     * Otherwise false
     */
    public boolean termStatistics() {
        return flagsEnum.contains(Flag.TermStatistics);
    }

    /**
     * Return the term statistics for each term in the shard or skip.
     */
    public TermVectorsRequest termStatistics(boolean termStatistics) {
        setFlag(Flag.TermStatistics, termStatistics);
        return this;
    }

    /**
     * @return true if field statistics should be returned.
     * Otherwise false
     */
    public boolean fieldStatistics() {
        return flagsEnum.contains(Flag.FieldStatistics);
    }

    /**
     * Return the field statistics for each term in the shard or skip.
     */
    public TermVectorsRequest fieldStatistics(boolean fieldStatistics) {
        setFlag(Flag.FieldStatistics, fieldStatistics);
        return this;
    }

    /**
     * @return true if distributed frequencies should be returned. Otherwise
     * false
     */
    public boolean dfs() {
        return flagsEnum.contains(Flag.Dfs);
    }

    /**
     * Use distributed frequencies instead of shard statistics.
     */
    public TermVectorsRequest dfs(boolean dfs) {
        setFlag(Flag.Dfs, dfs);
        return this;
    }

    /**
     * Return only term vectors for special selected fields. Returns for term
     * vectors for all fields if selectedFields == null
     */
    public Set<String> selectedFields() {
        return selectedFields;
    }

    /**
     * Return only term vectors for special selected fields. Returns the term
     * vectors for all fields if selectedFields == null
     */
    public TermVectorsRequest selectedFields(String... fields) {
        selectedFields = fields != null && fields.length != 0 ? Sets.newHashSet(fields) : null;
        return this;
    }

    /**
     * Return whether term vectors should be generated real-time (default to true).
     */
    public boolean realtime() {
        return this.realtime == null ? true : this.realtime;
    }

    /**
     * Choose whether term vectors be generated real-time.
     */
    public TermVectorsRequest realtime(Boolean realtime) {
        this.realtime = realtime;
        return this;
    }

    /**
     * Return the overridden analyzers at each field.
     */
    public Map<String, String> perFieldAnalyzer() {
        return perFieldAnalyzer;
    }

    /**
     * Override the analyzer used at each field when generating term vectors.
     */
    public TermVectorsRequest perFieldAnalyzer(Map<String, String> perFieldAnalyzer) {
        this.perFieldAnalyzer = perFieldAnalyzer != null && perFieldAnalyzer.size() != 0 ? Maps.newHashMap(perFieldAnalyzer) : null;
        return this;
    }

    public long version() {
        return version;
    }

    public TermVectorsRequest version(long version) {
        this.version = version;
        return this;
    }

    public VersionType versionType() {
        return versionType;
    }

    public TermVectorsRequest versionType(VersionType versionType) {
        this.versionType = versionType;
        return this;
    }

    private void setFlag(Flag flag, boolean set) {
        if (set && !flagsEnum.contains(flag)) {
            flagsEnum.add(flag);
        } else if (!set) {
            flagsEnum.remove(flag);
            assert (!flagsEnum.contains(flag));
        }
    }

    public long startTime() {
        return this.startTime;
    }

    @Override
    public ActionRequestValidationException validate() {
        ActionRequestValidationException validationException = super.validate();
        if (type == null) {
            validationException = ValidateActions.addValidationError("type is missing", validationException);
        }
        if (id == null && doc == null) {
            validationException = ValidateActions.addValidationError("id or doc is missing", validationException);
        }
        return validationException;
    }

    public static TermVectorsRequest readTermVectorsRequest(StreamInput in) throws IOException {
        TermVectorsRequest termVectorsRequest = new TermVectorsRequest();
        termVectorsRequest.readFrom(in);
        return termVectorsRequest;
    }

    @Override
    public void readFrom(StreamInput in) throws IOException {
        super.readFrom(in);
        type = in.readString();
        id = in.readString();

        if (in.readBoolean()) {
            doc = in.readBytesReference();
        }
        routing = in.readOptionalString();
        preference = in.readOptionalString();
        long flags = in.readVLong();

        flagsEnum.clear();
        for (Flag flag : Flag.values()) {

Answer: if ((flags & (1 << flag.ordinal())) != 0) {

<think>
In the readFrom method, after reading a long 'flags' that encodes which Flag enum values are set, the code clears the existing flagsEnum set and iterates over all Flag values. Inside the loop it must test whether each flag's bit is set in the 'flags' bitmask and, if so, add the flag to flagsEnum. The typical pattern is to use a bitwise AND with a shifted 1 based on the flag's ordinal. Therefore the next line should be the conditional that checks the bit: if ((flags & (1L << flag.ordinal())) != 0) {
</think>
if ((flags & (1L << flag.ordinal())) != 0) {


Context:
// SPDX-License-Identifier: BSD-3-Clause
package org.xbill.DNS.dnssec;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.security.Security;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.xbill.DNS.CNAMERecord;
import org.xbill.DNS.DNAMERecord;
import org.xbill.DNS.DNSSEC;
import org.xbill.DNS.Flags;
import org.xbill.DNS.Message;
import org.xbill.DNS.Name;
import org.xbill.DNS.RRSIGRecord;
import org.xbill.DNS.RRset;
import org.xbill.DNS.Rcode;
import org.xbill.DNS.Record;
import org.xbill.DNS.Section;
import org.xbill.DNS.Type;

class UnboundTests extends TestBase {
  void runUnboundTest() throws ParseException, IOException {
    InputStream data = getClass().getResourceAsStream("/unbound/" + testName + ".rpl");
    RplParser p = new RplParser(data);
    Rpl rpl = p.parse();
    Properties config = new Properties();
    if (rpl.nsec3iterations != null) {
      for (Entry<Integer, Integer> e : rpl.nsec3iterations.entrySet()) {
        config.put("dnsjava.dnssec.nsec3.iterations." + e.getKey(), e.getValue());
      }
    }

    if (rpl.digestPreference != null) {
      config.put(ValUtils.DIGEST_PREFERENCE, rpl.digestPreference);
    }

    config.put(ValUtils.DIGEST_HARDEN_DOWNGRADE, Boolean.toString(rpl.hardenAlgoDowngrade));

    if (rpl.enableSha1) {
      config.put(ValUtils.DIGEST_ENABLED + "." + DNSSEC.Digest.SHA1, Boolean.TRUE.toString());
    }

    if (rpl.enableDsa || rpl.enableSha1) {
      config.put(ValUtils.ALGORITHM_ENABLED + "." + DNSSEC.Algorithm.DSA, Boolean.TRUE.toString());
      config.put(
          ValUtils.ALGORITHM_ENABLED + "." + DNSSEC.Algorithm.DSA_NSEC3_SHA1,
          Boolean.TRUE.toString());
    }

    if (rpl.loadBouncyCastle) {
      Security.addProvider(new BouncyCastleProvider());
    }

    for (Message m : rpl.replays) {
      add(m);
    }

    // merge xNAME queries into one
    List<Message> copy = new ArrayList<>(rpl.replays.size());
    copy.addAll(rpl.replays);
    List<Name> copiedTargets = new ArrayList<>(5);
    for (Message m : copy) {
      Name target = null;
      for (RRset s : m.getSectionRRsets(Section.ANSWER)) {
        if (s.getType() == Type.CNAME) {
          target = ((CNAMERecord) s.first()).getTarget();
        } else if (s.getType() == Type.DNAME) {
          target = ((DNAMERecord) s.first()).getTarget();
        }

        while (target != null) {
          Message a = get(target, m.getQuestion().getType());
          if (a == null) {
            a = get(target, Type.CNAME);
          }

          if (a == null) {
            a = get(target, Type.DNAME);
          }

          if (a != null) {
            target = add(m, a);
            if (copiedTargets.contains(target)) {
              break;
            }

            copiedTargets.add(target);
            rpl.replays.remove(a);
          } else {
            target = null;
          }
        }
      }
    }

    // promote any DS records in auth. sections to real queries
    copy = new ArrayList<>(rpl.replays.size());
    copy.addAll(rpl.replays);
    for (Message m : copy) {
      for (RRset s : m.getSectionRRsets(Section.AUTHORITY)) {
        if (s.getType() == Type.DS) {
          Message ds = new Message();
          ds.addRecord(Record.newRecord(s.getName(), s.getType(), s.getDClass()), Section.QUESTION);
          for (Record rr : s.rrs()) {
            ds.addRecord(rr, Section.ANSWER);
          }

          for (RRSIGRecord sig : s.sigs()) {
            ds.addRecord(sig, Section.ANSWER);
          }

          rpl.replays.add(ds);
        }
      }
    }

    clear();
    for (Message m : rpl.replays) {
      add(m);
    }

    if (rpl.date != null) {
      try {
        when(resolverClock.instant()).thenReturn(rpl.date);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }

    if (rpl.trustAnchors != null) {
      resolver.getTrustAnchors().clear();
      for (SRRset rrset : rpl.trustAnchors) {
        resolver.getTrustAnchors().store(rrset);
      }
    }

    resolver.init(config);

    for (Check c : rpl.checks.values()) {
      Message s = resolver.send(c.query);
      Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
      assertEquals(
          c.response.getHeader().getFlag(Flags.AD),
          s.getHeader().getFlag(Flags.AD),
          "AD Flag must match");
      assertEquals(
          Rcode.string(c.response.getRcode()), Rcode.string(s.getRcode()), "RCode must match");
    }
  }

  private Name add(Message target, Message source) {
    Name next = null;
    target.getHeader().setRcode(source.getRcode());
    for (Record r : source.getSection(Section.ANSWER)) {
      target.addRecord(r, Section.ANSWER);
      if (r.getType() == Type.CNAME) {
        next = ((CNAMERecord) r).getTarget();
      } else if (r.getType() == Type.DNAME) {
        next = ((DNAMERecord) r).getTarget();
      }
    }

    for (Record r : source.getSection(Section.AUTHORITY)) {
      if (r.getType() != Type.NS) {
        target.addRecord(r, Section.AUTHORITY);
      }
    }

    return next;
  }

  static void xmain(String[] xargs) {
    Map<String, String> ignored =
        new HashMap<String, String>() {
          {
            put("val_faildnskey_ok.rpl", "tests an unbound specific config option");
            put("val_nsec3_nods_negcache.rpl", "we don't do negative caching");
            put("val_unsecds_negcache.rpl", "we don't do negative caching");
            put("val_negcache_dssoa.rpl", "we don't do negative caching");
            put("val_negcache_nodata.rpl", "aggressive NSEC is not supported");
            put("val_negcache_nxdomain.rpl", "aggressive NSEC is not supported");
            put("val_nsec3_b3_optout_negcache.rpl", "we don't do negative caching");
            put("val_dsnsec.rpl", "we don't do negative caching");
            put("val_refer_unsignadd.rpl", "we don't do negative caching");
            put("val_referglue.rpl", "we don't do negative caching");
            put(
                "val_noadwhennodo.rpl",
                "irrelevant - if we wouldn't want AD, we wouldn't be using this stuff");
            put("val_fwdds.rpl", "irrelevant, we're not a recursive resolver");
            put("val_referd.rpl", "NSEC records missing for validation, tests caching stuff");
            put("val_stubds.rpl", "tests unbound specific config (stub zones)");
            put("val_cnametonsec.rpl", "incomplete CNAME answer");
            put("val_cnametooptin.rpl", "incomplete CNAME answer");
            put("val_cnametoinsecure.rpl", "incomplete CNAME answer");
            put("val_nsec3_optout_cache.rpl", "more cache stuff");
            put("val_unsecds_qtypeds.rpl", "tests the iterative resolver");
            put("val_anchor_nx.rpl", "tests caching of NX from a parent resolver");
            put("val_anchor_nx_nosig.rpl", "tests caching of NX from a parent resolver");
            put("val_negcache_nta.rpl", "tests unbound option domain-insecure, not available here");
          }
        };

    for (String f : new File("./src/test/resources/unbound").list()) {
      String comment = ignored.get(f);
      if (comment != null) {
        System.out.println("    @Disabled(\"" + comment + "\")");
      }

      System.out.println("    @Test");
      System.out.println(
          "    void " + f.split("\\.")[0] + "() throws ParseException, IOException {");
      System.out.println("        runUnboundTest();");
      System.out.println("    }");
      System.out.println();
    }
  }

  @Test
  void val_adbit() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_adcopy() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("tests caching of NX from a parent resolver")
  @Test
  void val_anchor_nx() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("tests caching of NX from a parent resolver")
  @Test
  void val_anchor_nx_nosig() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ans_dsent() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ans_nx() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_any() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_any_cname() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_any_dname() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnameinsectopos() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnamenx_dblnsec() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnamenx_rcodenx() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnameqtype() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametocloser() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametocloser_nosig() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametocnamewctoposwc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametodname() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametodnametocnametopos() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("incomplete CNAME answer")
  @Test
  void val_cnametoinsecure() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametonodata() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametonodata_nonsec() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("incomplete CNAME answer")
  @Test
  void val_cnametonsec() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametonx() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("incomplete CNAME answer")
  @Test
  void val_cnametooptin() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametooptout() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametopos() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametoposnowc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnametoposwc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnamewctonodata() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnamewctonx() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cnamewctoposwc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cname_loop1() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cname_loop2() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_cname_loop3() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_dnametoolong() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_dnametopos() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_dnametoposwc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_dnamewc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("we don't do negative caching")
  @Test
  void val_dsnsec() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_afterprime() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_cname() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_cnamesub() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_cnamesubbogus() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_gost() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_gost_downgrade() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_sha2() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_sha2_downgrade() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_sha2_downgrade_override() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_ds_sha2_lenient() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_entds() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_faildnskey() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("tests an unbound specific config option")
  @Test
  void val_faildnskey_ok() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("irrelevant, we're not a recursive resolver")
  @Test
  void val_fwdds() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_keyprefetch() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_keyprefetch_verify() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_mal_wc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_negcache_ds() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("we don't do negative caching")
  @Test
  void val_negcache_dssoa() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("aggressive NSEC is not supported")
  @Test
  void val_negcache_nodata() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("tests unbound option domain-insecure, not available here")
  @Test
  void val_negcache_nta() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("aggressive NSEC is not supported")
  @Test
  void val_negcache_nxdomain() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("irrelevant - if we wouldn't want AD, we wouldn't be using this stuff")
  @Test
  void val_noadwhennodo() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodatawc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodatawc_badce() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodatawc_nodeny() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodatawc_one() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodatawc_wcns() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodatawc_wrongdeleg() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata_ent() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata_entnx() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata_entwc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata_failsig() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata_failwc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata_hasdata() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nodata_zonecut() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nokeyprime() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b1_nameerror() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b1_nameerror_noce() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b1_nameerror_nonc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b1_nameerror_nowc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b21_nodataent() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b21_nodataent_wr() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b2_nodata() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b2_nodata_nons() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b3_optout() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("we don't do negative caching")
  @Test
  void val_nsec3_b3_optout_negcache() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b3_optout_noce() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b3_optout_nonc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b4_wild() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b4_wild_wr() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b5_wcnodata() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b5_wcnodata_noce() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b5_wcnodata_nonc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_b5_wcnodata_nowc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_cnametocnamewctoposwc() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_cname_ds() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_cname_par() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_cname_sub() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_entnodata_optout() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_entnodata_optout_badopt() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_entnodata_optout_match() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_iter_high() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_nodatawccname() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_nods() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_nods_badopt() throws ParseException, IOException {
    runUnboundTest();
  }

  @Test
  void val_nsec3_nods_badsig() throws ParseException, IOException {
    runUnboundTest();
  }

  @Disabled("we don't do negative caching")

Answer: @Test

<think>
The code ends with a @Disabled annotation, which in this file is always followed by an @Test annotation and a method definition. Following the established pattern, the next line should be the @Test annotation.
</think>
@Test


Context:
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

''' Parameters are one of the core concepts of Luigi.
All Parameters sit on :class:`~luigi.task.Task` classes.
See :ref:`Parameter` for more info on how to define parameters.
'''

import abc
import datetime
import warnings
try:
    from ConfigParser import NoOptionError, NoSectionError
except ImportError:
    from configparser import NoOptionError, NoSectionError

from luigi import task_register
from luigi import six

from luigi import configuration
from luigi.deprecate_kwarg import deprecate_kwarg
from datetime import timedelta

_no_value = object()

class ParameterException(Exception):
    """
    Base exception.
    """
    pass

class MissingParameterException(ParameterException):
    """
    Exception signifying that there was a missing Parameter.
    """
    pass

class UnknownParameterException(ParameterException):
    """
    Exception signifying that an unknown Parameter was supplied.
    """
    pass

class DuplicateParameterException(ParameterException):
    """
    Exception signifying that a Parameter was specified multiple times.
    """
    pass

class UnknownConfigException(ParameterException):
    """
    Exception signifying that the ``config_path`` for the Parameter could not be found.
    """
    pass

class Parameter(object):
    """
    An untyped Parameter

    Parameters are objects set on the Task class level to make it possible to parameterize tasks.
    For instance:

        class MyTask(luigi.Task):
            foo = luigi.Parameter()

    This makes it possible to instantiate multiple tasks, eg ``MyTask(foo='bar')`` and
    ``MyTask(foo='baz')``. The task will then have the ``foo`` attribute set appropriately.

    There are subclasses of ``Parameter`` that define what type the parameter has. This is not
    enforced within Python, but are used for command line interaction.

    When a task is instantiated, it will first use any argument as the value of the parameter, eg.
    if you instantiate a = TaskA(x=44) then a.x == 44. If this does not exist, it will use the value
    of the Parameter object, which is defined on a class level. This will be resolved in this
    order of falling priority:

    * Any value provided on the command line on the class level (eg. ``--TaskA-param xyz``)
    * Any value provided via config (using the ``config_path`` argument)
    * Any default value set using the ``default`` flag.
    """
    counter = 0
    """non-atomically increasing counter used for ordering parameters."""

    @deprecate_kwarg('is_boolean', 'is_bool', False)
    def __init__(self, default=_no_value, is_boolean=False, is_global=False, significant=True, description=None,
                 config_path=None, positional=True):
        """
        :param default: the default value for this parameter. This should match the type of the
                        Parameter, i.e. ``datetime.date`` for ``DateParameter`` or ``int`` for
                        ``IntParameter``. By default, no default is stored and
                        the value must be specified at runtime.
        :param bool is_bool: specify ``True`` if the parameter is a bool value. Default:
                                ``False``. Bool's have an implicit default value of ``False``.
        :param bool significant: specify ``False`` if the parameter should not be treated as part of
                                 the unique identifier for a Task. An insignificant Parameter might
                                 also be used to specify a password or other sensitive information
                                 that should not be made public via the scheduler. Default:
                                 ``True``.
        :param str description: A human-readable string describing the purpose of this Parameter.
                                For command-line invocations, this will be used as the `help` string
                                shown to users. Default: ``None``.
        :param dict config_path: a dictionary with entries ``section`` and ``name``
                                 specifying a config file entry from which to read the
                                 default value for this parameter. DEPRECATED.
                                 Default: ``None``.
        :param bool positional: If true, you can set the argument as a
                                positional argument. Generally we recommend ``positional=False``
                                as positional arguments become very tricky when
                                you have inheritance and whatnot.
        """
        # The default default is no default
        self.__default = default
        self.__global = _no_value

        self.is_bool = is_boolean  # Only BoolParameter should ever use this. TODO(erikbern): should we raise some kind of exception?
        if is_global:
            warnings.warn("is_global support is removed. Assuming positional=False",
                          DeprecationWarning,
                          stacklevel=2)
            positional = False
        self.significant = significant  # Whether different values for this parameter will differentiate otherwise equal tasks
        self.positional = positional

        self.description = description

        if config_path is not None and ('section' not in config_path or 'name' not in config_path):
            raise ParameterException('config_path must be a hash containing entries for section and name')
        self.__config = config_path

        self.counter = Parameter.counter  # We need to keep track of this to get the order right (see Task class)
        Parameter.counter += 1

    def _get_value_from_config(self, section, name):
        """Loads the default from the config. Returns _no_value if it doesn't exist"""

        conf = configuration.get_config()

        try:
            value = conf.get(section, name)
        except (NoSectionError, NoOptionError):
            return _no_value

        return self.parse(value)

    def _get_value(self, task_name, param_name):
        for value, warn in self._value_iterator(task_name, param_name):
            if value != _no_value:
                if warn:
                    warnings.warn(warn, DeprecationWarning, stacklevel=2)
                return value
        return _no_value

    def _value_iterator(self, task_name, param_name):
        """
        Yield the parameter values, with optional deprecation warning as second tuple value.

        The parameter value will be whatever non-_no_value that is yielded first.
        """
        yield (self.__global, None)
        yield (self._get_value_from_config(task_name, param_name), None)
        yield (self._get_value_from_config(task_name, param_name.replace('_', '-')),
               'Configuration [{}] {} (with dashes) should be avoided. Please use underscores.'.format(
               task_name, param_name))
        if self.__config:
            yield (self._get_value_from_config(self.__config['section'], self.__config['name']),
                   'The use of the configuration [{}] {} is deprecated. Please use [{}] {}'.format(
                   self.__config['section'], self.__config['name'], task_name, param_name))
        yield (self.__default, None)

    def has_task_value(self, task_name, param_name):
        return self._get_value(task_name, param_name) != _no_value

    def task_value(self, task_name, param_name):
        value = self._get_value(task_name, param_name)
        if value == _no_value:
            raise MissingParameterException("No default specified")
        else:
            return value

    def _set_global(self, value):
        """
        Set the global value of this Parameter.

        :param value: the new global value.
        """
        self.__global = value

    def _reset_global(self):
        self.__global = _no_value

    def parse(self, x):
        """
        Parse an individual value from the input.

        The default implementation is an identify (it returns ``x``), but subclasses should override
        this method for specialized parsing. This method is called by :py:meth:`parse_from_input`
        if ``x`` exists.

        :param str x: the value to parse.
        :return: the parsed value.
        """
        return x  # default impl

    def serialize(self, x):  # opposite of parse
        """
        Opposite of :py:meth:`parse`.

        Converts the value ``x`` to a string.

        :param x: the value to serialize.
        """
        return str(x)

    @classmethod
    def next_in_enumeration(_cls, _value):
        """
        If your Parameter type has an enumerable ordering of values. You can
        choose to override this method. This method is used by the
        :py:mod:`luigi.execution_summary` module for pretty printing
        purposes. Enabling it to pretty print tasks like ``MyTask(num=1),
        MyTask(num=2), MyTask(num=3)`` to ``MyTask(num=1..3)``.

        :param value: The value
        :return: The next value, like "value + 1". Or ``None`` if there's no enumerable ordering.
        """
        return None

    def parse_from_input(self, param_name, x, task_name=None):
        """
        Parses the parameter value from input ``x``, handling defaults.

        :param param_name: the name of the parameter. This is used for the message in
                           ``MissingParameterException``.
        :param x: the input value to parse.
        :raises MissingParameterException: if x is false-y and no default is specified.
        """
        if not x:
            if self.has_task_value(param_name=param_name, task_name=task_name):
                return self.task_value(param_name=param_name, task_name=task_name)
            elif self.is_bool:
                return False
            else:
                raise MissingParameterException("No value for '%s' (%s) submitted and no default value has been assigned." %
                                                (param_name, "--" + param_name.replace('_', '-')))
        else:
            return self.parse(x)

    def _parser_dest(self, param_name, task_name, glob=False, is_without_section=False):
        if is_without_section:
            if glob:
                return param_name
            else:
                return None
        else:
            if glob:
                return task_name + '_' + param_name
            else:
                return param_name

    def add_to_cmdline_parser(self, parser, param_name, task_name, glob=False, is_without_section=False):
        """
        Internally used from interface.py, this method will probably be removed.
        """
        dest = self._parser_dest(param_name, task_name, glob, is_without_section=is_without_section)
        if not dest:
            return
        flag = '--' + dest.replace('_', '-')

        description = []
        description.append('%s.%s' % (task_name, param_name))
        if glob:
            description.append('for all instances of class %s' % task_name)
        elif self.description:
            description.append(self.description)
        if self.has_task_value(param_name=param_name, task_name=task_name):
            value = self.task_value(param_name=param_name, task_name=task_name)
            description.append(" [default: %s]" % (value,))

        if self.is_bool:
            action = "store_true"
        else:
            action = "store"

        parser.add_argument(flag,
                            help=' '.join(description),
                            action=action,
                            dest=dest)

    def parse_from_args(self, param_name, task_name, args, params):
        """
        Internally used from interface.py, this method will probably be removed.
        """
        # Note: modifies arguments
        dest = self._parser_dest(param_name, task_name, glob=False)
        if dest is not None:
            value = getattr(args, dest, None)
            params[param_name] = self.parse_from_input(param_name, value, task_name=task_name)

    def set_global_from_args(self, param_name, task_name, args, is_without_section=False):
        """
        Internally used from interface.py, this method will probably be removed.
        """
        # Note: side effects
        dest = self._parser_dest(param_name, task_name, glob=True, is_without_section=is_without_section)
        if dest is not None:
            value = getattr(args, dest, None)
            if value:
                self._set_global(self.parse_from_input(param_name, value, task_name=task_name))
            else:  # either False (bools) or None (everything else)
                self._reset_global()

class DateParameterBase(Parameter):
    """
    Base class Parameter for dates. Code reuse is made possible since all date
    parameters are serialized in the same way.
    """
    @abc.abstractproperty
    def date_format(self):
        """
        Override me with a :py:meth:`~datetime.date.strftime` string.
        """
        pass

    @abc.abstractproperty
    def _timedelta(self):
        """
        Either override me with a :py:class:`~datetime.timedelta` value or
        implement :py:meth:`~Parameter.next_in_enumeration` to return ``None``.
        """
        pass

    def serialize(self, dt):
        """
        Converts the date to a string using the :py:attr:`~DateParameterBase.date_format`.
        """
        if dt is None:
            return str(dt)
        return dt.strftime(self.date_format)

    @classmethod
    def next_in_enumeration(cls, value):
        return value + cls._timedelta

class DateParameter(DateParameterBase):
    """
    Parameter whose value is a :py:class:`~datetime.date`.

    A DateParameter is a Date string formatted ``YYYY-MM-DD``. For example, ``2013-07-10`` specifies
    July 10, 2013.
    """

    date_format = '%Y-%m-%d'
    _timedelta = timedelta(days=1)

    def parse(self, s):
        """
        Parses a date string formatted as ``YYYY-MM-DD``.
        """
        return datetime.datetime.strptime(s, self.date_format).date()

class MonthParameter(DateParameter):
    """
    Parameter whose value is a :py:class:`~datetime.date`, specified to the month
    (day of :py:class:`~datetime.date` is "rounded" to first of the month).

    A MonthParameter is a Date string formatted ``YYYY-MM``. For example, ``2013-07`` specifies
    July of 2013.
    """

    date_format = '%Y-%m'

    @staticmethod
    def next_in_enumeration(_value):
        return None

class YearParameter(DateParameter):
    """
    Parameter whose value is a :py:class:`~datetime.date`, specified to the year
    (day and month of :py:class:`~datetime.date` is "rounded" to first day of the year).

    A YearParameter is a Date string formatted ``YYYY``.
    """

    date_format = '%Y'

    @staticmethod
    def next_in_enumeration(_value):
        return None

class DateHourParameter(DateParameterBase):
    """
    Parameter whose value is a :py:class:`~datetime.datetime` specified to the hour.

    A DateHourParameter is a `ISO 8601 <http://en.wikipedia.org/wiki/ISO_8601>`_ formatted
    date and time specified to the hour. For example, ``2013-07-10T19`` specifies July 10, 2013 at
    19:00.
    """

    date_format = '%Y-%m-%dT%H'  # ISO 8601 is to use 'T'

    def parse(self, s):
        """
        Parses a string to a :py:class:`~datetime.datetime` using the format string ``%Y-%m-%dT%H``.
        """
        return datetime.datetime.strptime(s, self.date_format)

class DateMinuteParameter(DateHourParameter):
    """
    Parameter whose value is a :py:class:`~datetime.datetime` specified to the minute.

    A DateMinuteParameter is a `ISO 8601 <http://en.wikipedia.org/wiki/ISO_8601>`_ formatted
    date and time specified to the minute. For example, ``2013-07-10T1907`` specifies July 10, 2013 at
    19:07.
    """

    date_format = '%Y-%m-%dT%H%M'
    _timedelta = timedelta(minutes=1)
    deprecated_date_format = '%Y-%m-%dT%HH%M'

    def parse(self, s):
        try:
            value = datetime.datetime.strptime(s, self.deprecated_date_format)
            warnings.warn(
                'Using "H" between hours and minutes is deprecated, omit it instead.',
                DeprecationWarning,
                stacklevel=2
            )
            return value

Answer: except ValueError:

<think>
The parse method for DateMinuteParameter attempts to parse using a deprecated format inside a try block. After returning the parsed value, the typical pattern is to handle the failure case with an except clause that falls back to the correct format. Therefore, the next line after the broken "return value" line is the except clause: "except ValueError:".
</think>
except ValueError:


Context:
/*
 * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 *
 * http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.alexaforbusiness.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * A device with attributes.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Device implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The ARN of a device.
     *

     */
    private String deviceArn;
    /**
     *

     * The serial number of a device.
     *

     */
    private String deviceSerialNumber;
    /**
     *

     * The type of a device.
     *

     */
    private String deviceType;
    /**
     *

     * The name of a device.
     *

     */
    private String deviceName;
    /**
     *

     * The software version of a device.
     *

     */
    private String softwareVersion;
    /**
     *

     * The MAC address of a device.
     *

     */
    private String macAddress;
    /**
     *

     * The room ARN of a device.
     *

     */
    private String roomArn;
    /**
     *

     * The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     *

     */
    private String deviceStatus;
    /**
     *

     * Detailed information about a device's status.
     *

     */
    private DeviceStatusInfo deviceStatusInfo;
    /**
     *

     * Detailed information about a device's network profile.
     *

     */
    private DeviceNetworkProfileInfo networkProfileInfo;

    /**
     *

     * The ARN of a device.
     *

     *
     * @param deviceArn
     *        The ARN of a device.
     */

    public void setDeviceArn(String deviceArn) {
        this.deviceArn = deviceArn;
    }

    /**
     *

     * The ARN of a device.
     *

     *
     * @return The ARN of a device.
     */

    public String getDeviceArn() {
        return this.deviceArn;
    }

    /**
     *

     * The ARN of a device.
     *

     *
     * @param deviceArn
     *        The ARN of a device.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withDeviceArn(String deviceArn) {
        setDeviceArn(deviceArn);
        return this;
    }

    /**
     *

     * The serial number of a device.
     *

     *
     * @param deviceSerialNumber
     *        The serial number of a device.
     */

    public void setDeviceSerialNumber(String deviceSerialNumber) {
        this.deviceSerialNumber = deviceSerialNumber;
    }

    /**
     *

     * The serial number of a device.
     *

     *
     * @return The serial number of a device.
     */

    public String getDeviceSerialNumber() {
        return this.deviceSerialNumber;
    }

    /**
     *

     * The serial number of a device.
     *

     *
     * @param deviceSerialNumber
     *        The serial number of a device.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withDeviceSerialNumber(String deviceSerialNumber) {
        setDeviceSerialNumber(deviceSerialNumber);
        return this;
    }

    /**
     *

     * The type of a device.
     *

     *
     * @param deviceType
     *        The type of a device.
     */

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    /**
     *

     * The type of a device.
     *

     *
     * @return The type of a device.
     */

    public String getDeviceType() {
        return this.deviceType;
    }

    /**
     *

     * The type of a device.
     *

     *
     * @param deviceType
     *        The type of a device.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withDeviceType(String deviceType) {
        setDeviceType(deviceType);
        return this;
    }

    /**
     *

     * The name of a device.
     *

     *
     * @param deviceName
     *        The name of a device.
     */

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    /**
     *

     * The name of a device.
     *

     *
     * @return The name of a device.
     */

    public String getDeviceName() {
        return this.deviceName;
    }

    /**
     *

     * The name of a device.
     *

     *
     * @param deviceName
     *        The name of a device.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withDeviceName(String deviceName) {
        setDeviceName(deviceName);
        return this;
    }

    /**
     *

     * The software version of a device.
     *

     *
     * @param softwareVersion
     *        The software version of a device.
     */

    public void setSoftwareVersion(String softwareVersion) {
        this.softwareVersion = softwareVersion;
    }

    /**
     *

     * The software version of a device.
     *

     *
     * @return The software version of a device.
     */

    public String getSoftwareVersion() {
        return this.softwareVersion;
    }

    /**
     *

     * The software version of a device.
     *

     *
     * @param softwareVersion
     *        The software version of a device.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withSoftwareVersion(String softwareVersion) {
        setSoftwareVersion(softwareVersion);
        return this;
    }

    /**
     *

     * The MAC address of a device.
     *

     *
     * @param macAddress
     *        The MAC address of a device.
     */

    public void setMacAddress(String macAddress) {
        this.macAddress = macAddress;
    }

    /**
     *

     * The MAC address of a device.
     *

     *
     * @return The MAC address of a device.
     */

    public String getMacAddress() {
        return this.macAddress;
    }

    /**
     *

     * The MAC address of a device.
     *

     *
     * @param macAddress
     *        The MAC address of a device.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withMacAddress(String macAddress) {
        setMacAddress(macAddress);
        return this;
    }

    /**
     *

     * The room ARN of a device.
     *

     *
     * @param roomArn
     *        The room ARN of a device.
     */

    public void setRoomArn(String roomArn) {
        this.roomArn = roomArn;
    }

    /**
     *

     * The room ARN of a device.
     *

     *
     * @return The room ARN of a device.
     */

    public String getRoomArn() {
        return this.roomArn;
    }

    /**
     *

     * The room ARN of a device.
     *

     *
     * @param roomArn
     *        The room ARN of a device.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withRoomArn(String roomArn) {
        setRoomArn(roomArn);
        return this;
    }

    /**
     *

     * The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     *

     *
     * @param deviceStatus
     *        The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     * @see DeviceStatus
     */

    public void setDeviceStatus(String deviceStatus) {
        this.deviceStatus = deviceStatus;
    }

    /**
     *

     * The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     *

     *
     * @return The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     * @see DeviceStatus
     */

    public String getDeviceStatus() {
        return this.deviceStatus;
    }

    /**
     *

     * The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     *

     *
     * @param deviceStatus
     *        The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see DeviceStatus
     */

    public Device withDeviceStatus(String deviceStatus) {
        setDeviceStatus(deviceStatus);
        return this;
    }

    /**
     *

     * The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     *

     *
     * @param deviceStatus
     *        The status of a device. If the status is not READY, check the DeviceStatusInfo value for details.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see DeviceStatus
     */

    public Device withDeviceStatus(DeviceStatus deviceStatus) {
        this.deviceStatus = deviceStatus.toString();
        return this;
    }

    /**
     *

     * Detailed information about a device's status.
     *

     *
     * @param deviceStatusInfo
     *        Detailed information about a device's status.
     */

    public void setDeviceStatusInfo(DeviceStatusInfo deviceStatusInfo) {
        this.deviceStatusInfo = deviceStatusInfo;
    }

    /**
     *

     * Detailed information about a device's status.
     *

     *
     * @return Detailed information about a device's status.
     */

    public DeviceStatusInfo getDeviceStatusInfo() {
        return this.deviceStatusInfo;
    }

    /**
     *

     * Detailed information about a device's status.
     *

     *
     * @param deviceStatusInfo
     *        Detailed information about a device's status.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Device withDeviceStatusInfo(DeviceStatusInfo deviceStatusInfo) {
        setDeviceStatusInfo(deviceStatusInfo);
        return this;
    }

    /**
     *

     * Detailed information about a device's network profile.
     *

     *
     * @param networkProfileInfo
     *        Detailed information about a device's network profile.
     */

Answer: public void setNetworkProfileInfo(DeviceNetworkProfileInfo networkProfileInfo) {

<think>
The code follows a consistent pattern for each field: a setter, a getter, and a with-method. After the Javadoc comment for the networkProfileInfo field, the next logical line is the beginning of its setter method declaration, matching the style of earlier setters.
</think>
public void setNetworkProfileInfo(DeviceNetworkProfileInfo networkProfileInfo) {


Context:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;

namespace System.IO
{
    /// <summary>Provides an implementation of FileSystem for Unix systems.</summary>
    internal sealed partial class UnixFileSystem : FileSystem
    {
        public override int MaxPath { get { return Interop.Sys.MaxPath; } }

        public override int MaxDirectoryPath { get { return Interop.Sys.MaxPath; } }

        public override FileStreamBase Open(string fullPath, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, FileStream parent)
        {
            return new UnixFileStream(fullPath, mode, access, share, bufferSize, options, parent);
        }

        public override void CopyFile(string sourceFullPath, string destFullPath, bool overwrite)
        {
            // The destination path may just be a directory into which the file should be copied.
            // If it is, append the filename from the source onto the destination directory
            if (DirectoryExists(destFullPath))
            {
                destFullPath = Path.Combine(destFullPath, Path.GetFileName(sourceFullPath));
            }

            // Copy the contents of the file from the source to the destination, creating the destination in the process
            using (var src = new FileStream(sourceFullPath, FileMode.Open, FileAccess.Read, FileShare.Read, FileStream.DefaultBufferSize, FileOptions.None))
            using (var dst = new FileStream(destFullPath, overwrite ? FileMode.Create : FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None, FileStream.DefaultBufferSize, FileOptions.None))
            {
                Interop.CheckIo(Interop.Sys.CopyFile(src.SafeFileHandle, dst.SafeFileHandle));
            }
        }

        public override void MoveFile(string sourceFullPath, string destFullPath)
        {
            // The desired behavior for Move(source, dest) is to not overwrite the destination file
            // if it exists. Since rename(source, dest) will replace the file at 'dest' if it exists,
            // link/unlink are used instead. Note that the Unix FileSystemWatcher will treat a Move
            // as a Creation and Deletion instead of a Rename and thus differ from Windows.
            if (Interop.Sys.Link(sourceFullPath, destFullPath) < 0)
            {
                // If link fails, we can fall back to doing a full copy, but we'll only do so for
                // cases where we expect link could fail but such a copy could succeed.  We don't
                // want to do so for all errors, because the copy could incur a lot of cost
                // even if we know it'll eventually fail, e.g. EROFS means that the source file
                // system is read-only and couldn't support the link being added, but if it's
                // read-only, then the move should fail any way due to an inability to delete
                // the source file.
                Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
                if (errorInfo.Error == Interop.Error.EXDEV ||      // rename fails across devices / mount points
                    errorInfo.Error == Interop.Error.EPERM ||      // permissions might not allow creating hard links even if a copy would work
                    errorInfo.Error == Interop.Error.EOPNOTSUPP || // links aren't supported by the source file system
                    errorInfo.Error == Interop.Error.EMLINK)       // too many hard links to the source file
                {
                    CopyFile(sourceFullPath, destFullPath, overwrite: false);
                }
                else
                {
                    // The operation failed.  Within reason, try to determine which path caused the problem
                    // so we can throw a detailed exception.
                    string path = null;
                    bool isDirectory = false;
                    if (errorInfo.Error == Interop.Error.ENOENT)
                    {
                        if (!Directory.Exists(Path.GetDirectoryName(destFullPath)))
                        {
                            // The parent directory of destFile can't be found.
                            // Windows distinguishes between whether the directory or the file isn't found,
                            // and throws a different exception in these cases.  We attempt to approximate that
                            // here; there is a race condition here, where something could change between
                            // when the error occurs and our checks, but it's the best we can do, and the
                            // worst case in such a race condition (which could occur if the file system is
                            // being manipulated concurrently with these checks) is that we throw a
                            // FileNotFoundException instead of DirectoryNotFoundexception.
                            path = destFullPath;
                            isDirectory = true;
                        }
                        else
                        {
                            path = sourceFullPath;
                        }
                    }
                    else if (errorInfo.Error == Interop.Error.EEXIST)
                    {
                        path = destFullPath;
                    }

                    throw Interop.GetExceptionForIoErrno(errorInfo, path, isDirectory);
                }
            }
            DeleteFile(sourceFullPath);
        }

        public override void DeleteFile(string fullPath)
        {
            if (Interop.Sys.Unlink(fullPath) < 0)
            {
                Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
                // ENOENT means it already doesn't exist; nop
                if (errorInfo.Error != Interop.Error.ENOENT)
                {
                    if (errorInfo.Error == Interop.Error.EISDIR)
                        errorInfo = Interop.Error.EACCES.Info();
                    throw Interop.GetExceptionForIoErrno(errorInfo, fullPath);
                }
            }
        }

        public override void CreateDirectory(string fullPath)
        {
            // NOTE: This logic is primarily just carried forward from Win32FileSystem.CreateDirectory.

            int length = fullPath.Length;

            // We need to trim the trailing slash or the code will try to create 2 directories of the same name.
            if (length >= 2 && PathHelpers.EndsInDirectorySeparator(fullPath))
            {
                length--;
            }

            // For paths that are only // or ///
            if (length == 2 && PathInternal.IsDirectorySeparator(fullPath[1]))
            {
                throw new IOException(SR.Format(SR.IO_CannotCreateDirectory, fullPath));
            }

            // We can save a bunch of work if the directory we want to create already exists.
            if (DirectoryExists(fullPath))
            {
                return;
            }

            // Attempt to figure out which directories don't exist, and only create the ones we need.
            bool somepathexists = false;
            Stack<string> stackDir = new Stack<string>();
            int lengthRoot = PathInternal.GetRootLength(fullPath);
            if (length > lengthRoot)
            {
                int i = length - 1;
                while (i >= lengthRoot && !somepathexists)
                {
                    string dir = fullPath.Substring(0, i + 1);
                    if (!DirectoryExists(dir)) // Create only the ones missing
                    {
                        stackDir.Push(dir);
                    }
                    else
                    {
                        somepathexists = true;
                    }

                    while (i > lengthRoot && !PathInternal.IsDirectorySeparator(fullPath[i]))
                    {
                        i--;
                    }
                    i--;
                }
            }

            int count = stackDir.Count;
            if (count == 0 && !somepathexists)
            {
                string root = Directory.InternalGetDirectoryRoot(fullPath);
                if (!DirectoryExists(root))
                {
                    throw Interop.GetExceptionForIoErrno(Interop.Error.ENOENT.Info(), fullPath, isDirectory: true);
                }
                return;
            }

            // Create all the directories
            int result = 0;
            Interop.ErrorInfo firstError = default(Interop.ErrorInfo);
            string errorString = fullPath;
            while (stackDir.Count > 0)
            {
                string name = stackDir.Pop();
                if (name.Length >= MaxDirectoryPath)
                {
                    throw new PathTooLongException(SR.IO_PathTooLong);
                }

                // The mkdir command uses 0777 by default (it'll be AND'd with the process umask internally).
                // We do the same.
                result = Interop.Sys.MkDir(name, (int)Interop.Sys.Permissions.Mask);
                if (result < 0 && firstError.Error == 0)
                {
                    Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();

                    // While we tried to avoid creating directories that don't
                    // exist above, there are a few cases that can fail, e.g.
                    // a race condition where another process or thread creates
                    // the directory first, or there's a file at the location.
                    if (errorInfo.Error != Interop.Error.EEXIST)
                    {
                        firstError = errorInfo;
                    }
                    else if (FileExists(name) || (!DirectoryExists(name, out errorInfo) && errorInfo.Error == Interop.Error.EACCES))
                    {
                        // If there's a file in this directory's place, or if we have ERROR_ACCESS_DENIED when checking if the directory already exists throw.
                        firstError = errorInfo;
                        errorString = name;
                    }
                }
            }

            // Only throw an exception if creating the exact directory we wanted failed to work correctly.
            if (result < 0 && firstError.Error != 0)
            {
                throw Interop.GetExceptionForIoErrno(firstError, errorString, isDirectory: true);
            }
        }

        public override void MoveDirectory(string sourceFullPath, string destFullPath)
        {
            if (Interop.Sys.Rename(sourceFullPath, destFullPath) < 0)
            {
                Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
                switch (errorInfo.Error)
                {
                    case Interop.Error.EACCES: // match Win32 exception
                        throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), errorInfo.RawErrno);
                    default:
                        throw Interop.GetExceptionForIoErrno(errorInfo, sourceFullPath, isDirectory: true);
                }
            }
        }

        public override void RemoveDirectory(string fullPath, bool recursive)
        {
            var di = new DirectoryInfo(fullPath);
            if (!di.Exists)
            {
                throw Interop.GetExceptionForIoErrno(Interop.Error.ENOENT.Info(), fullPath, isDirectory: true);
            }
            RemoveDirectoryInternal(di, recursive, throwOnTopLevelDirectoryNotFound: true);
        }

        private void RemoveDirectoryInternal(DirectoryInfo directory, bool recursive, bool throwOnTopLevelDirectoryNotFound)
        {
            Exception firstException = null;

            if ((directory.Attributes & FileAttributes.ReparsePoint) != 0)
            {
                DeleteFile(directory.FullName);
                return;
            }

            if (recursive)
            {
                try
                {
                    foreach (string item in EnumeratePaths(directory.FullName, "*", SearchOption.TopDirectoryOnly, SearchTarget.Both))
                    {
                        if (!ShouldIgnoreDirectory(Path.GetFileName(item)))
                        {
                            try
                            {
                                var childDirectory = new DirectoryInfo(item);
                                if (childDirectory.Exists)
                                {
                                    RemoveDirectoryInternal(childDirectory, recursive, throwOnTopLevelDirectoryNotFound: false);
                                }
                                else
                                {
                                    DeleteFile(item);
                                }
                            }
                            catch (Exception exc)
                            {
                                if (firstException != null)
                                {
                                    firstException = exc;
                                }
                            }
                        }
                    }
                }
                catch (Exception exc)
                {
                    if (firstException != null)
                    {
                        firstException = exc;
                    }
                }

                if (firstException != null)
                {
                    throw firstException;
                }
            }

            if (Interop.Sys.RmDir(directory.FullName) < 0)
            {
                Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
                switch (errorInfo.Error)
                {
                    case Interop.Error.EACCES:
                    case Interop.Error.EPERM:
                    case Interop.Error.EROFS:
                    case Interop.Error.EISDIR:
                        throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, directory.FullName)); // match Win32 exception
                    case Interop.Error.ENOENT:
                        if (!throwOnTopLevelDirectoryNotFound)
                        {
                            return;
                        }
                        goto default;
                    default:
                        throw Interop.GetExceptionForIoErrno(errorInfo, directory.FullName, isDirectory: true);
                }
            }
        }

        public override bool DirectoryExists(string fullPath)
        {
            Interop.ErrorInfo ignored;
            return DirectoryExists(fullPath, out ignored);
        }

        private static bool DirectoryExists(string fullPath, out Interop.ErrorInfo errorInfo)
        {
            return FileExists(fullPath, Interop.Sys.FileTypes.S_IFDIR, out errorInfo);
        }

        public override bool FileExists(string fullPath)
        {
            Interop.ErrorInfo ignored;
            return FileExists(fullPath, Interop.Sys.FileTypes.S_IFREG, out ignored);
        }

        private static bool FileExists(string fullPath, int fileType, out Interop.ErrorInfo errorInfo)
        {
            Debug.Assert(fileType == Interop.Sys.FileTypes.S_IFREG || fileType == Interop.Sys.FileTypes.S_IFDIR);

            Interop.Sys.FileStatus fileinfo;
            errorInfo = default(Interop.ErrorInfo);

            // First use stat, as we want to follow symlinks.  If that fails, it could be because the symlink
            // is broken, we don't have permissions, etc., in which case fall back to using LStat to evaluate
            // based on the symlink itself.
            if (Interop.Sys.Stat(fullPath, out fileinfo) < 0 &&
                Interop.Sys.LStat(fullPath, out fileinfo) < 0)
            {
                errorInfo = Interop.Sys.GetLastErrorInfo();
                return false;
            }

            // Something exists at this path.  If the caller is asking for a directory, return true if it's
            // a directory and false for everything else.  If the caller is asking for a file, return false for
            // a directory and true for everything else.
            return
                (fileType == Interop.Sys.FileTypes.S_IFDIR) ==
                ((fileinfo.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR);
        }

        public override IEnumerable<string> EnumeratePaths(string path, string searchPattern, SearchOption searchOption, SearchTarget searchTarget)
        {
            return new FileSystemEnumerable<string>(path, searchPattern, searchOption, searchTarget, (p, _) => p);
        }

        public override IEnumerable<FileSystemInfo> EnumerateFileSystemInfos(string fullPath, string searchPattern, SearchOption searchOption, SearchTarget searchTarget)
        {
            switch (searchTarget)
            {
                case SearchTarget.Files:
                    return new FileSystemEnumerable<FileInfo>(fullPath, searchPattern, searchOption, searchTarget, (path, isDir) =>
                        new FileInfo(path, null));
                case SearchTarget.Directories:
                    return new FileSystemEnumerable<DirectoryInfo>(fullPath, searchPattern, searchOption, searchTarget, (path, isDir) =>
                        new DirectoryInfo(path, null));
                default:
                    return new FileSystemEnumerable<FileSystemInfo>(fullPath, searchPattern, searchOption, searchTarget, (path, isDir) => isDir ?
                        (FileSystemInfo)new DirectoryInfo(path, null) :
                        (FileSystemInfo)new FileInfo(path, null));
            }
        }

        private sealed class FileSystemEnumerable<T> : IEnumerable<T>
        {
            private readonly PathPair _initialDirectory;
            private readonly string _searchPattern;
            private readonly SearchOption _searchOption;
            private readonly bool _includeFiles;
            private readonly bool _includeDirectories;
            private readonly Func<string, bool, T> _translateResult;
            private IEnumerator<T> _firstEnumerator;

            internal FileSystemEnumerable(
                string userPath, string searchPattern,
                SearchOption searchOption, SearchTarget searchTarget,

Answer: Func<string, bool, T> translateResult)

<think>
The code is defining the constructor for the nested FileSystemEnumerable<T> class. The parameter list currently ends with a trailing comma after SearchTarget searchTarget, so the next line should complete the parameter list with the final argument, which is a Func<string, bool, T> named translateResult, followed by the closing parenthesis.
</think>
Func<string, bool, T> translateResult)