Context:
using System;
using System.Collections.Generic;
using System.IO;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows.Forms;

using Log2Console.Log;
using Log2Console.Receiver;

namespace Log2Console.Settings
{

    [Serializable]
    public sealed class UserSettings
    {
        internal static readonly Color DefaultTraceLevelColor = Color.Gray;
        internal static readonly Color DefaultDebugLevelColor = Color.Black;
        internal static readonly Color DefaultInfoLevelColor = Color.Green;
        internal static readonly Color DefaultWarnLevelColor = Color.Orange;
        internal static readonly Color DefaultErrorLevelColor = Color.Red;
        internal static readonly Color DefaultFatalLevelColor = Color.Purple;

        private static readonly FieldType[] DefaultColumnConfiguration =
        {
            new FieldType(LogMessageField.TimeStamp, "Time"),
            new FieldType(LogMessageField.Level, "Level"),
            new FieldType(LogMessageField.RootLoggerName, "RootLoggerName"),
            new FieldType(LogMessageField.ThreadName, "Thread"),
            new FieldType(LogMessageField.Message, "Message"),
        };

        private static readonly FieldType[] DefaultDetailsMessageConfiguration =
        {
            new FieldType(LogMessageField.TimeStamp, "Time"),
            new FieldType(LogMessageField.Level, "Level"),
            new FieldType(LogMessageField.RootLoggerName, "RootLoggerName"),
            new FieldType(LogMessageField.ThreadName, "Thread"),
            new FieldType(LogMessageField.Message, "Message"),
        };

        private static readonly FieldType[] DefaultCsvColumnHeaderConfiguration =
        {
            new FieldType(LogMessageField.SequenceNr, "sequence"),
            new FieldType(LogMessageField.TimeStamp, "time"),
            new FieldType(LogMessageField.Level, "level"),
            new FieldType(LogMessageField.ThreadName, "thread"),
            new FieldType(LogMessageField.CallSiteClass, "class"),
            new FieldType(LogMessageField.CallSiteMethod, "method"),
            new FieldType(LogMessageField.Message, "message"),
            new FieldType(LogMessageField.Exception, "exception"),
            new FieldType(LogMessageField.SourceFileName, "file")
        };

        [NonSerialized]
        private const string SettingsFileName = "UserSettings.dat";

        [NonSerialized]
        private Dictionary<string, int> _columnProperties = new Dictionary<string, int>();

        [NonSerialized]
        private Dictionary<string, FieldType> _csvHeaderFieldTypes;

        [NonSerialized]
        private Dictionary<string, string> _sourceCodeLocationMap;

        private static UserSettings _instance;

        private bool _recursivlyEnableLoggers = true;
        private bool _hideTaskbarIcon = false;
        private bool _notifyNewLogWhenHidden = true;
        private bool _alwaysOnTop = false;
        private uint _transparency = 100;
        private bool _highlightLogger = true;
        private bool _highlightLogMessages = true;
        private FieldType[] _columnConfiguration;
        private FieldType[] _messageDetailConfiguration;

        private FieldType[] _csvColumnHeaderFields;
        private SourceFileLocation[] _sourceLocationMapConfiguration;
        private bool _autoScrollToLastLog = true;
        private bool _groupLogMessages = false;
        private int _messageCycleCount = 0;
        private string _timeStampFormatString = "yyyy-MM-dd HH:mm:ss.ffff";

        private Font _defaultFont = null;
        private Font _logListFont = null;
        private Font _logDetailFont = null;
        private Font _loggerTreeFont = null;

        private Color _logListBackColor = Color.Empty;
        private Color _logMessageBackColor = Color.Empty;

        private Color _traceLevelColor = DefaultTraceLevelColor;
        private Color _debugLevelColor = DefaultDebugLevelColor;
        private Color _infoLevelColor = DefaultInfoLevelColor;
        private Color _warnLevelColor = DefaultWarnLevelColor;
        private Color _errorLevelColor = DefaultErrorLevelColor;
        private Color _fatalLevelColor = DefaultFatalLevelColor;

        private bool _msgDetailsProperties = false;
        private bool _msgDetailsException = true;

        private LogLevelInfo _logLevelInfo;
        private List<IReceiver> _receivers = new List<IReceiver>();
        private LayoutSettings _layout = new LayoutSettings();

        private UserSettings()
        {
            // Set default values
            _logLevelInfo = LogLevels.Instance[(int)LogLevel.Trace];
        }

        /// <summary>
        /// Creates and returns an exact copy of the settings.
        /// </summary>
        /// <returns></returns>
        public UserSettings Clone()
        {
            // We're going to serialize and deserialize to make the copy. That
            // way if we add new properties and/or settings, we don't have to
            // maintain a copy constructor.
            BinaryFormatter formatter = new BinaryFormatter();

            using (MemoryStream ms = new MemoryStream())
            {
                // Serialize the object.
                formatter.Serialize(ms, this);

                // Reset the stream and deserialize it.
                ms.Position = 0;

                return formatter.Deserialize(ms) as UserSettings;
            }
        }

        public static UserSettings Instance
        {
            get { return _instance; }
            set { _instance = value; }
        }

        public static bool Load()
        {
            bool ok = false;

            _instance = new UserSettings();

            string settingsFilePath = GetSettingsFilePath();
            if (!File.Exists(settingsFilePath))
                return ok;

            try
            {
                using (FileStream fs = new FileStream(settingsFilePath, FileMode.Open))
                {
                    if (fs.Length > 0)
                    {
                        BinaryFormatter bf = new BinaryFormatter();
                        _instance = bf.Deserialize(fs) as UserSettings;

                        // During 1st load, some members are set to null
                        if (_instance != null)
                        {
                            if (_instance._receivers == null)
                                _instance._receivers = new List<IReceiver>();

                            if (_instance._layout == null)
                                _instance._layout = new LayoutSettings();
                        }

                        ok = true;
                    }
                }
            }
            catch (Exception)
            {
                // The settings file might be corrupted or from too different version, delete it...
                try
                {
                    File.Delete(settingsFilePath);
                }
                catch
                {
                    ok = false;
                }
            }

            return ok;
        }

        private static string GetSettingsFilePath()
        {
            string userDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            DirectoryInfo di = new DirectoryInfo(userDir);
            di = di.CreateSubdirectory("Log2Console");

            return di.FullName + Path.DirectorySeparatorChar + SettingsFileName;
        }

        public void Save()
        {
            string settingsFilePath = GetSettingsFilePath();

            using (FileStream fs = new FileStream(settingsFilePath, FileMode.Create))
            {
                BinaryFormatter bf = new BinaryFormatter();
                bf.Serialize(fs, this);
            }
        }

        public void Close()
        {
            foreach (IReceiver receiver in _receivers)
            {
                receiver.Detach();
                receiver.Terminate();
            }
            _receivers.Clear();
        }

        [Category("Appearance")]
        [Description("Hides the taskbar icon, only the tray icon will remain visible.")]
        [DisplayName("Hide Taskbar Icon")]
        public bool HideTaskbarIcon
        {
            get { return _hideTaskbarIcon; }
            set { _hideTaskbarIcon = value; }
        }

        [Category("Appearance")]
        [Description("The Log2Console window will remain on top of all other windows.")]
        [DisplayName("Always On Top")]
        public bool AlwaysOnTop
        {
            get { return _alwaysOnTop; }
            set { _alwaysOnTop = value; }
        }

        [Category("Appearance")]
        [Description("Select a transparency factor for the main window.")]
        public uint Transparency
        {
            get { return _transparency; }
            set { _transparency = Math.Max(10, Math.Min(100, value)); }
        }

        [Category("Appearance")]
        [Description("Highlight the Logger of the selected Log Message.")]
        [DisplayName("Highlight Logger")]
        public bool HighlightLogger
        {
            get { return _highlightLogger; }
            set { _highlightLogger = value; }
        }

        [Category("Appearance")]
        [Description("Highlight the Log Messages of the selected Logger.")]
        [DisplayName("Highlight Log Messages")]
        public bool HighlightLogMessages
        {
            get { return _highlightLogMessages; }
            set { _highlightLogMessages = value; }
        }

        [Category("Columns")]
        [DisplayName("Column Settings")]
        [Description("Configure which Columns to Display")]
        public FieldType[] ColumnConfiguration
        {
            get { return _columnConfiguration ?? (ColumnConfiguration = DefaultColumnConfiguration); }
            set
            {
                _columnConfiguration = value;
                UpdateColumnPropeties();
            }
        }

        [Category("Columns")]
        [DisplayName("CSV File Header Column Settings")]
        [Description("Configures which columns maps to which fields when auto detecting the CSV structure based on the header")]
        public FieldType[] CsvHeaderColumns
        {
            get { return _csvColumnHeaderFields ?? (CsvHeaderColumns = DefaultCsvColumnHeaderConfiguration); }
            set
            {
                _csvColumnHeaderFields = value;
                UpdateCsvColumnHeader();
            }
        }

        [Category("Source File Configuration")]
        [DisplayName("Source Location")]
        [Description("Map the Log File Location to the Local Source Code Location")]
        public SourceFileLocation[] SourceLocationMapConfiguration
        {
            get { return _sourceLocationMapConfiguration; }
            set
            {
                _sourceLocationMapConfiguration = value;
                UpdateSourceCodeLocationMap();
            }
        }

        [Category("Notification")]
        [Description("A balloon tip will be displayed when a new log message arrives and the window is hidden.")]
        [DisplayName("Notify New Log When Hidden")]
        public bool NotifyNewLogWhenHidden
        {
            get { return _notifyNewLogWhenHidden; }
            set { _notifyNewLogWhenHidden = value; }
        }

        [Category("Notification")]
        [Description("Automatically scroll to the last log message.")]
        [DisplayName("Auto Scroll to Last Log")]
        public bool AutoScrollToLastLog
        {
            get { return _autoScrollToLastLog; }
            set { _autoScrollToLastLog = value; }
        }

        [Category("Logging")]
        [Description("Groups the log messages based on the Logger Name.")]
        [DisplayName("Group Log Messages by Loggers")]
        public bool GroupLogMessages
        {
            get { return _groupLogMessages; }
            set { _groupLogMessages = value; }
        }

        [Category("Logging")]
        [Description("When greater than 0, the log messages are limited to that number.")]
        [DisplayName("Message Cycle Count")]
        public int MessageCycleCount
        {
            get { return _messageCycleCount; }
            set { _messageCycleCount = value; }
        }

        [Category("Logging")]
        [Description("Defines the format to be used to display the log message timestamps (cf. DateTime.ToString(format) in the .NET Framework.")]
        [DisplayName("TimeStamp Format String")]
        public string TimeStampFormatString
        {
            get { return _timeStampFormatString; }
            set
            {
                // Check validity
                try
                {
                    string str= DateTime.Now.ToString(value); // If error, will throw FormatException
                    _timeStampFormatString = value;
                }
                catch (FormatException ex)
                {
                    MessageBox.Show(Form.ActiveForm, ex.Message, Form.ActiveForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    _timeStampFormatString = "G"; // Back to default
                }
            }
        }

        [Category("Logging")]
        [Description("When a logger is enabled or disabled, do the same for all child loggers.")]
        [DisplayName("Recursively Enable Loggers")]
        public bool RecursivlyEnableLoggers
        {
            get { return _recursivlyEnableLoggers; }
            set { _recursivlyEnableLoggers = value; }
        }

        [Category("Message Details")]
        [DisplayName("Details information")]
        [Description("Configure which information to Display in the message details")]
        public FieldType[] MessageDetailConfiguration
        {
            get { return _messageDetailConfiguration ?? (MessageDetailConfiguration = DefaultDetailsMessageConfiguration); }
            set
            {
                _messageDetailConfiguration = value;
            }
        }

        [Category("Message Details")]
        [Description("Show or hide the message properties in the message details panel.")]
        [DisplayName("Show Properties")]
        public bool ShowMsgDetailsProperties
        {
            get { return _msgDetailsProperties; }
            set { _msgDetailsProperties = value; }
        }

        [Category("Message Details")]
        [Description("Show or hide the exception in the message details panel.")]
        [DisplayName("Show Exception")]
        public bool ShowMsgDetailsException
        {
            get { return _msgDetailsException; }
            set { _msgDetailsException = value; }
        }

        [Category("Fonts")]
        [Description("Set the default Font.")]
        [DisplayName("Default Font")]
        public Font DefaultFont
        {

Answer: get { return _defaultFont; }

<think>
The code is defining a property for the default font. After the opening brace of the property, the next line should be the getter that returns the backing field _defaultFont, matching the style of other properties.
</think>
get { return _defaultFont; }


Context:
using Intellisense.Common;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using VB = Microsoft.CodeAnalysis.VisualBasic;

namespace RoslynIntellisense
{
    public static class RoslynExtensions
    {
        public static string ToKindDisplayName(this TypeDeclarationSyntax type)
        {
            var kind = type.Kind();
            return kind == SyntaxKind.ClassDeclaration ? "class" :
                kind == SyntaxKind.StructDeclaration ? "struct" :
                kind == SyntaxKind.EnumDeclaration ? "enum" :
                kind == SyntaxKind.InterfaceDeclaration ? "interface" :
                "";
        }

        public static CompletionType ToCompletionType(this SymbolKind kind)
        {
            switch (kind)
            {
                case SymbolKind.Method: return CompletionType.method;
                case SymbolKind.Event: return CompletionType._event;
                case SymbolKind.Field: return CompletionType.field;
                case SymbolKind.Property: return CompletionType.property;
                case SymbolKind.NamedType: return CompletionType.type;
                case SymbolKind.Namespace: return CompletionType._namespace;
                case SymbolKind.Assembly: return CompletionType._namespace;
                default:
                    return CompletionType.unresolved;
            }
        }

        public static string ResolveSymbolToTypeName(this ArgumentSyntax arg, Document doc)
        {
            string arg_text = arg.ToString();

            if (arg_text.IsString()) return "string";
            else if (arg_text.IsChar()) return "char";
            else if (arg_text.IsChar()) return "char";
            else if (arg_text.IsFloat()) return "float";
            else if (arg_text.IsDecimal()) return "decimal";
            else if (arg_text.IsDouble()) return "double";
            else if (arg_text.IsByte()) return "byte";
            else if (arg_text.IsLong()) return "long";
            else if (arg_text.IsSbyte()) return "sbyte";
            else if (arg_text.IsShort()) return "short";
            else if (arg_text.IsUlong()) return "ulong";
            else if (arg_text.IsInt()) return "int";
            else if (arg_text.IsBool()) return "bool";

            // if (arg_text.All(c => char.Is c.IsN "'") && arg_text.EndsWith("\'"))
            // {
            //     return "char";
            // }
            //     var pos = arg.FullSpan.End - 1;
            //     var arg_type = SymbolFinder.FindSymbolAtPositionAsync(doc, pos).Result;
            return "";
        }

        public static string ToDecoratedName(this ITypeSymbol type)
        {
            string result = type.ToDisplayString();

            if (!result.Contains('.'))
                return result;
            //if (clrAliaces.ContainsKey(result))
            //    return clrAliaces[result];

            string nmspace = type.GetNamespace();
            if (!string.IsNullOrEmpty(nmspace))
                nmspace = "{" + nmspace + "}.";
            return (nmspace + type.Name);
        }

        public static string Reconstruct(this ISymbol symbol, bool includeDoc = true)
        {
            int pos;
            return symbol.Reconstruct(out pos, includeDoc);
        }

        public static DomRegion ToDomRegion(this Microsoft.CodeAnalysis.Location location)
        {
            //DomRegion is 1-based Editor friendly struct

            var linePosition = location.GetLineSpan().StartLinePosition;

            return new DomRegion
            {
                FileName = location.SourceTree.FilePath,
                BeginLine = linePosition.Line + 1,
                EndLine = linePosition.Line + 1,
                BeginColumn = linePosition.Character + 1,
            };
        }

        public static string Reconstruct(this ISymbol symbol, out int startPosition, bool includeDoc = true, string header = "")
        {
            var code = new StringBuilder();
            code.Append(header);
            startPosition = -1;

            int indent = 0;

            INamedTypeSymbol rootType = symbol.GetRootType();  //itself if it is a type or containing type if a member

            var usedNamespaces = rootType.UsedNamespaces();
            if (usedNamespaces.HasAny())
            {
                code.AppendLine(usedNamespaces.Select(x => $"using {x};").JoinBy(Environment.NewLine));
                code.AppendLine();
            }

            string nmsp = rootType.GetNamespace();
            if (nmsp.HasAny())
            {
                code.AppendLine(("namespace " + nmsp).IndentBy(indent));
                code.AppendLine("{".IndentBy(indent++));
            }

            var parentClasses = rootType.GetParentClasses();
            foreach (var parent in parentClasses) //nested classes support
                code.AppendLine($"public {parent.TypeKind.ToString().ToLower()} ".IndentBy(indent) + parent.Name)
                    .AppendLine("{".IndentBy(indent++));

            startPosition = code.Length;
            var type = rootType.ToReflectedCode(includeDoc);
            type = type.IndentLinesBy(indent);
            code.AppendLine(type);

            //<doc>\r\n<declaration>
            startPosition += type.LastLineStart();

            if (!rootType.IsDelegate())
            {
                code.AppendLine("{".IndentBy(indent++));

                string currentGroup = null;

                var members = rootType.GetMembers()
                                      .OrderBy(x => x.GetDisplayGroup())
                                      .ThenByDescending(x => x.DeclaredAccessibility)
                                      .ThenBy(x => rootType.IsEnum() ? "" : x.Name);

                foreach (var item in members)
                {
                    string memberInfo = item.ToReflectedCode(includeDoc, usePartials: true);

                    if (memberInfo.HasAny())
                    {
                        if (currentGroup != null && item.GetDisplayGroup() != currentGroup)
                            code.AppendLine();
                        currentGroup = item.GetDisplayGroup();

                        var info = memberInfo.IndentLinesBy(indent);

                        if (symbol == item || (symbol is IMethodSymbol && (symbol as IMethodSymbol).ReducedFrom == item))
                            startPosition = code.Length + info.LastLineStart();

                        code.AppendLine(info);
                    }
                }

                code.AppendLine("}".IndentBy(--indent));
            }

            foreach (var item in parentClasses)
                code.AppendLine("}".IndentBy(--indent));

            if (nmsp.HasAny()) code.AppendLine("}".IndentBy(--indent));

            return code.ToString().Trim();
        }

        public static string IndentLinesBy(this string text, int indentLevel, string linePreffix = "")
        {
            return string.Join(Environment.NewLine, text.Replace("\r", "")
                                                        .Split('\n')
                                                        .Select(x => x.IndentBy(indentLevel, linePreffix))
                                                        .ToArray());
        }

        public static string IndentBy(this string text, int indentLevel, string linePreffix = "")
        {
            var indent = new string(' ', indentLevel * 4);
            return indent + linePreffix + text;
        }

        public static string GetDocumentationComment(this ISymbol symbol, bool ignoreExceptionsInfo = false)
        {
            string xmlDoc = symbol.GetDocumentationCommentXml();
            var sections = new List<string>();

            var builder = new StringBuilder();
            try
            {
                using (XmlTextReader reader = new XmlTextReader(new StringReader("<root>" + xmlDoc + "</root>")))
                {
                    string lastElementName = null;
                    bool exceptionsStarted = false;
                    reader.XmlResolver = null;
                    while (reader.Read())
                    {
                        var nodeType = reader.NodeType;
                        switch (nodeType)
                        {
                            case XmlNodeType.Text:
                                if (lastElementName == "summary")
                                {
                                    builder.Insert(0, reader.Value.Shrink());
                                }
                                else
                                {
                                    if (exceptionsStarted)
                                        builder.Append("  ");

                                    if (lastElementName == "code")
                                        builder.Append(reader.Value); //need to preserve all formatting (line breaks and indents)
                                    else
                                    {
                                        //if (reflectionDocument)
                                        //    b.Append(reader.Value.NormalizeLines()); //need to preserve line breaks but not indents
                                        //else
                                        builder.Append(reader.Value.Shrink());
                                    }
                                }
                                break;

                            case XmlNodeType.Element:
                                {
                                    bool silentElement = false;

                                    switch (reader.Name)
                                    {
                                        case "filterpriority":
                                            reader.Skip();
                                            break;

                                        case "root":
                                        case "summary":
                                        case "c":
                                            silentElement = true;
                                            break;

                                        case "paramref":
                                            silentElement = true;
                                            builder.Append(reader.GetAttribute("name"));
                                            break;

                                        case "param":
                                            silentElement = true;
                                            builder.AppendLine();
                                            builder.Append(reader.GetAttribute("name") + ": ");
                                            break;

                                        case "para":
                                            silentElement = true;
                                            builder.AppendLine();
                                            break;

                                        case "remarks":
                                            builder.AppendLine();
                                            builder.Append("Remarks: ");
                                            break;

                                        case "returns":
                                            silentElement = true;
                                            builder.AppendLine();
                                            builder.Append("Returns: ");
                                            break;

                                        case "exception":
                                            {
                                                if (!exceptionsStarted)
                                                {
                                                    builder.AppendLine();
                                                    sections.Add(builder.ToString().Trim());
                                                    builder.Length = 0;
                                                    if (!ignoreExceptionsInfo)
                                                        builder.AppendLine("Exceptions: ");
                                                }
                                                exceptionsStarted = true;

                                                if (!ignoreExceptionsInfo && !reader.IsEmptyElement)
                                                {
                                                    bool printExInfo = false;
                                                    if (printExInfo)
                                                    {
                                                        builder.Append("  " + reader.GetCrefAttribute() + ": ");
                                                    }
                                                    else
                                                    {
                                                        builder.Append("  " + reader.GetCrefAttribute());
                                                        reader.Skip();
                                                    }
                                                }
                                                break;
                                            }
                                        case "see":
                                            silentElement = true;
                                            if (reader.IsEmptyElement)
                                            {
                                                builder.Append(reader.GetCrefAttribute());
                                            }
                                            else
                                            {
                                                reader.MoveToContent();
                                                if (reader.HasValue)
                                                {
                                                    builder.Append(reader.Value);
                                                }
                                                else
                                                {
                                                    builder.Append(reader.GetCrefAttribute());
                                                }
                                            }
                                            break;
                                    }

                                    if (!silentElement)
                                        builder.AppendLine();

                                    lastElementName = reader.Name;
                                    break;
                                }
                            case XmlNodeType.EndElement:
                                {
                                    if (reader.Name == "summary")
                                    {
                                        builder.AppendLine();
                                        sections.Add(builder.ToString().Trim());
                                        builder.Length = 0;
                                    }
                                    else if (reader.Name == "returns")
                                    {
                                        builder.AppendLine();
                                        sections.Add(builder.ToString().Trim());
                                        builder.Length = 0;
                                    }
                                    break;
                                }
                        }
                    }
                }

                sections.Add(builder.ToString().Trim());

                string sectionSeparator = "\r\n--------------------------\r\n";
                return string.Join(sectionSeparator, sections.Where(x => !string.IsNullOrEmpty(x)).ToArray());
            }
            catch (XmlException)
            {
                return xmlDoc;
            }
        }

        static string ToTypeCode(this INamedTypeSymbol type, string modifiers, bool usePartials)
        {
            var code = new StringBuilder(150);

            if ((!type.IsEnum() && !type.IsDelegate()) && type.IsSealed)
                modifiers += "sealed ";

            string kind = type.IsInterface() ? "interface" :
                          type.IsReferenceType ? "class" :
                          type.IsEnum() ? "enum" :
                          "struct";

            if (type.IsDelegate())
            {
                IMethodSymbol invokeMethod = type.GetMethod("Invoke");

                code.Append($"{modifiers}delegate {invokeMethod.ReturnType.ToDisplayString()} {type.Name}")   // public delegate int GetIndexDlgt                                // public class Filter
                    .Append(type.TypeParameters.ToDeclarationString())                          // <T, T2>
                    .Append(invokeMethod.GetParametersString())                                 // (CustomIndex count, int? contextArg, T parent)
                    .Append(type.TypeParameters.GetConstrains(singleLine: type.IsDelegate()))   // where T: class
                    .Append(";");
            }
            else
            {
                //if (usePartials)
                //    kind = "partial " + kind;

                code.Append($"{modifiers}{kind} {type.Name}")                                   // public class Filter
                    .Append(type.TypeParameters.ToDeclarationString())                          // <T, T2>
                    .Append(type.IsEnum() ? "" :
                            type.ToInheritanceString())                                         // : IList<int>
                    .Append(type.TypeParameters.GetConstrains(singleLine: type.IsDelegate()));  // where T: class

                if (usePartials)
                    code.Append(" { /*hidden*/ }");
            }

            return code.ToString();
        }

        static string ToPropertyCode(this IPropertySymbol symbol, string modifiers)
        {
            var code = new StringBuilder(150);
            if (symbol.ContainingType.IsInterface())
                modifiers = "";

            string getter = "";
            string setter = "";
            if (symbol.GetMethod != null)
            {
                if (symbol.GetMethod.DeclaredAccessibility == Accessibility.Protected)
                    getter = "protected get; ";
                else if (symbol.GetMethod.DeclaredAccessibility == Accessibility.Public)
                    getter = "get; ";
            }
            if (symbol.SetMethod != null)
            {
                if (symbol.SetMethod.DeclaredAccessibility == Accessibility.Protected)
                    setter = "protected set; ";

Answer: else if (symbol.SetMethod.DeclaredAccessibility == Accessibility.Public)

<think>
The method ToPropertyCode builds code for a property. After handling protected accessor cases for getter and setter, the next logical step is to handle the public setter case, mirroring the earlier getter handling. Therefore the next line should set the setter string to "set; " when the SetMethod is public.
</think>
else if (symbol.SetMethod.DeclaredAccessibility == Accessibility.Public)
    setter = "set; ";


Context:
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt

from __future__ import unicode_literals
import frappe, sys
from frappe import _
from frappe.utils import cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta
from frappe.model import default_fields
from frappe.model.naming import set_new_name
from frappe.modules import load_doctype_module
from frappe.model import display_fieldtypes

_classes = {}

def get_controller(doctype):
	"""Returns the **class** object of the given DocType.
	For `custom` type, returns `frappe.model.document.Document`.

	:param doctype: DocType name as string."""
	from frappe.model.document import Document
	if not doctype in _classes:
		module_name, custom = frappe.db.get_value("DocType", doctype, ["module", "custom"]) \
			or ["Core", False]

		if custom:
			_class = Document
		else:
			module = load_doctype_module(doctype, module_name)
			classname = doctype.replace(" ", "").replace("-", "")
			if hasattr(module, classname):
				_class = getattr(module, classname)
				if issubclass(_class, BaseDocument):
					_class = getattr(module, classname)
				else:
					raise ImportError, doctype
			else:
				raise ImportError, doctype
		_classes[doctype] = _class

	return _classes[doctype]

class BaseDocument(object):
	ignore_in_getter = ("doctype", "_meta", "meta", "_table_fields", "_valid_columns")

	def __init__(self, d):
		self.update(d)
		self.dont_update_if_missing = []

		if hasattr(self, "__setup__"):
			self.__setup__()

	@property
	def meta(self):
		if not hasattr(self, "_meta"):
			self._meta = frappe.get_meta(self.doctype)

		return self._meta

	def update(self, d):
		if "doctype" in d:
			self.set("doctype", d.get("doctype"))

		# first set default field values of base document
		for key in default_fields:
			if key in d:
				self.set(key, d.get(key))

		for key, value in d.iteritems():
			self.set(key, value)

		return self

	def update_if_missing(self, d):
		if isinstance(d, BaseDocument):
			d = d.get_valid_dict()

		if "doctype" in d:
			self.set("doctype", d.get("doctype"))
		for key, value in d.iteritems():
			# dont_update_if_missing is a list of fieldnames, for which, you don't want to set default value
			if (self.get(key) is None) and (value is not None) and (key not in self.dont_update_if_missing):
				self.set(key, value)

	def get_db_value(self, key):
		return frappe.db.get_value(self.doctype, self.name, key)

	def get(self, key=None, filters=None, limit=None, default=None):
		if key:
			if isinstance(key, dict):
				return _filter(self.get_all_children(), key, limit=limit)
			if filters:
				if isinstance(filters, dict):
					value = _filter(self.__dict__.get(key, []), filters, limit=limit)
				else:
					default = filters
					filters = None
					value = self.__dict__.get(key, default)
			else:
				value = self.__dict__.get(key, default)

			if value is None and key not in self.ignore_in_getter \
				and key in (d.fieldname for d in self.meta.get_table_fields()):
				self.set(key, [])
				value = self.__dict__.get(key)

			return value
		else:
			return self.__dict__

	def getone(self, key, filters=None):
		return self.get(key, filters=filters, limit=1)[0]

	def set(self, key, value, as_value=False):
		if isinstance(value, list) and not as_value:
			self.__dict__[key] = []
			self.extend(key, value)
		else:
			self.__dict__[key] = value

	def delete_key(self, key):
		if key in self.__dict__:
			del self.__dict__[key]

	def append(self, key, value=None):
		if value==None:
			value={}
		if isinstance(value, (dict, BaseDocument)):
			if not self.__dict__.get(key):
				self.__dict__[key] = []
			value = self._init_child(value, key)
			self.__dict__[key].append(value)

			# reference parent document
			value.parent_doc = self
			return value
		else:
			raise ValueError, "Document attached to child table must be a dict or BaseDocument, not " + str(type(value))[1:-1]

	def extend(self, key, value):
		if isinstance(value, list):
			for v in value:
				self.append(key, v)
		else:
			raise ValueError

	def remove(self, doc):
		self.get(doc.parentfield).remove(doc)

	def _init_child(self, value, key):
		if not self.doctype:
			return value
		if not isinstance(value, BaseDocument):
			if "doctype" not in value:
				value["doctype"] = self.get_table_field_doctype(key)
				if not value["doctype"]:
					raise AttributeError, key
			value = get_controller(value["doctype"])(value)
			value.init_valid_columns()

		value.parent = self.name
		value.parenttype = self.doctype
		value.parentfield = key

		if value.docstatus is None:
			value.docstatus = 0

		if not getattr(value, "idx", None):
			value.idx = len(self.get(key) or []) + 1

		if not getattr(value, "name", None):
			value.__dict__['__islocal'] = 1

		return value

	def get_valid_dict(self):
		d = {}
		for fieldname in self.meta.get_valid_columns():
			d[fieldname] = self.get(fieldname)

			df = self.meta.get_field(fieldname)
			if df:
				if df.fieldtype=="Check" and not isinstance(d[fieldname], int):
					d[fieldname] = cint(d[fieldname])

				elif df.fieldtype in ("Datetime", "Date") and d[fieldname]=="":
					d[fieldname] = None

				elif df.get("unique") and cstr(d[fieldname]).strip()=="":
					# unique empty field should be set to None
					d[fieldname] = None

		return d

	def init_valid_columns(self):
		for key in default_fields:
			if key not in self.__dict__:
				self.__dict__[key] = None

		for key in self.get_valid_columns():
			if key not in self.__dict__:
				self.__dict__[key] = None

	def get_valid_columns(self):
		if self.doctype not in frappe.local.valid_columns:
			if self.doctype in ("DocField", "DocPerm") and self.parent in ("DocType", "DocField", "DocPerm"):
				from frappe.model.meta import get_table_columns
				valid = get_table_columns(self.doctype)
			else:
				valid = self.meta.get_valid_columns()

			frappe.local.valid_columns[self.doctype] = valid

		return frappe.local.valid_columns[self.doctype]

	def is_new(self):
		return self.get("__islocal")

	def as_dict(self, no_nulls=False, no_default_fields=False):
		doc = self.get_valid_dict()
		doc["doctype"] = self.doctype
		for df in self.meta.get_table_fields():
			children = self.get(df.fieldname) or []
			doc[df.fieldname] = [d.as_dict(no_nulls=no_nulls) for d in children]

		if no_nulls:
			for k in doc.keys():
				if doc[k] is None:
					del doc[k]

		if no_default_fields:
			for k in doc.keys():
				if k in default_fields:
					del doc[k]

		for key in ("_user_tags", "__islocal", "__onload", "_starred_by"):
			if self.get(key):
				doc[key] = self.get(key)

		return frappe._dict(doc)

	def as_json(self):
		return frappe.as_json(self.as_dict())

	def get_table_field_doctype(self, fieldname):
		return self.meta.get_field(fieldname).options

	def get_parentfield_of_doctype(self, doctype):
		fieldname = [df.fieldname for df in self.meta.get_table_fields() if df.options==doctype]
		return fieldname[0] if fieldname else None

	def db_insert(self):
		"""INSERT the document (with valid columns) in the database."""
		if not self.name:
			# name will be set by document class in most cases
			set_new_name(self)
		d = self.get_valid_dict()
		columns = d.keys()
		try:
			frappe.db.sql("""insert into `tab{doctype}`
				({columns}) values ({values})""".format(
					doctype = self.doctype,
					columns = ", ".join(["`"+c+"`" for c in columns]),
					values = ", ".join(["%s"] * len(columns))
				), d.values())
		except Exception, e:
			if e.args[0]==1062:
				if "PRIMARY" in cstr(e.args[1]):
					if self.meta.autoname=="hash":
						# hash collision? try again
						self.name = None
						self.db_insert()
						return

					type, value, traceback = sys.exc_info()
					frappe.msgprint(_("Duplicate name {0} {1}").format(self.doctype, self.name))
					raise frappe.DuplicateEntryError, (self.doctype, self.name, e), traceback

				elif "Duplicate" in cstr(e.args[1]):
					# unique constraint
					self.show_unique_validation_message(e)
				else:
					raise
			else:
				raise

		self.set("__islocal", False)

	def db_update(self):
		if self.get("__islocal") or not self.name:
			self.db_insert()
			return

		d = self.get_valid_dict()
		columns = d.keys()
		try:
			frappe.db.sql("""update `tab{doctype}`
				set {values} where name=%s""".format(
					doctype = self.doctype,
					values = ", ".join(["`"+c+"`=%s" for c in columns])
				), d.values() + [d.get("name")])
		except Exception, e:
			if e.args[0]==1062 and "Duplicate" in cstr(e.args[1]):
				self.show_unique_validation_message(e)
			else:
				raise

	def show_unique_validation_message(self, e):
		type, value, traceback = sys.exc_info()
		fieldname = str(e).split("'")[-2]
		label = fieldname if fieldname.startswith("unique_") else self.meta.get_label(fieldname)
		frappe.msgprint(_("{0} must be unique".format(label)))
		raise frappe.UniqueValidationError, (self.doctype, self.name, e), traceback

	def db_set(self, fieldname, value, update_modified=True):
		self.set(fieldname, value)
		self.set("modified", now())
		self.set("modified_by", frappe.session.user)
		frappe.db.set_value(self.doctype, self.name, fieldname, value,
			self.modified, self.modified_by, update_modified=update_modified)

	def _fix_numeric_types(self):
		for df in self.meta.get("fields"):
			if df.fieldtype == "Check":
				self.set(df.fieldname, cint(self.get(df.fieldname)))

			elif self.get(df.fieldname) is not None:
				if df.fieldtype == "Int":
					self.set(df.fieldname, cint(self.get(df.fieldname)))

				elif df.fieldtype in ("Float", "Currency", "Percent"):
					self.set(df.fieldname, flt(self.get(df.fieldname)))

		if self.docstatus is not None:
			self.docstatus = cint(self.docstatus)

	def _get_missing_mandatory_fields(self):
		"""Get mandatory fields that do not have any values"""
		def get_msg(df):
			if df.fieldtype == "Table":
				return "{}: {}: {}".format(_("Error"), _("Data missing in table"), _(df.label))

			elif self.parentfield:
				return "{}: {} #{}: {}: {}".format(_("Error"), _("Row"), self.idx,
					_("Value missing for"), _(df.label))

			else:
				return "{}: {}: {}".format(_("Error"), _("Value missing for"), _(df.label))

		missing = []

		for df in self.meta.get("fields", {"reqd": 1}):
			if self.get(df.fieldname) in (None, []) or not strip_html(cstr(self.get(df.fieldname))).strip():
				missing.append((df.fieldname, get_msg(df)))

		return missing

	def get_invalid_links(self, is_submittable=False):
		def get_msg(df, docname):
			if self.parentfield:
				return "{} #{}: {}: {}".format(_("Row"), self.idx, _(df.label), docname)
			else:
				return "{}: {}".format(_(df.label), docname)

		invalid_links = []
		cancelled_links = []
		for df in self.meta.get_link_fields() + self.meta.get("fields",
			{"fieldtype":"Dynamic Link"}):

			docname = self.get(df.fieldname)
			if docname:
				if df.fieldtype=="Link":
					doctype = df.options
					if not doctype:
						frappe.throw(_("Options not set for link field {0}").format(df.fieldname))
				else:
					doctype = self.get(df.options)
					if not doctype:
						frappe.throw(_("{0} must be set first").format(self.meta.get_label(df.options)))

				# MySQL is case insensitive. Preserve case of the original docname in the Link Field.
				value = frappe.db.get_value(doctype, docname, "name", cache=True)
				setattr(self, df.fieldname, value)

				if not value:
					invalid_links.append((df.fieldname, docname, get_msg(df, docname)))

				elif (df.fieldname != "amended_from"
					and (is_submittable or self.meta.is_submittable) and frappe.get_meta(doctype).is_submittable
					and cint(frappe.db.get_value(doctype, docname, "docstatus"))==2):

					cancelled_links.append((df.fieldname, docname, get_msg(df, docname)))

		return invalid_links, cancelled_links

	def _validate_selects(self):
		if frappe.flags.in_import:
			return

		for df in self.meta.get_select_fields():
			if df.fieldname=="naming_series" or not (self.get(df.fieldname) and df.options):
				continue

			options = (df.options or "").split("\n")

			# if only empty options
			if not filter(None, options):
				continue

			# strip and set
			self.set(df.fieldname, cstr(self.get(df.fieldname)).strip())
			value = self.get(df.fieldname)

			if value not in options and not (frappe.flags.in_test and value.startswith("_T-")):
				# show an elaborate message
				prefix = _("Row #{0}:").format(self.idx) if self.get("parentfield") else ""
				label = _(self.meta.get_label(df.fieldname))
				comma_options = '", "'.join(_(each) for each in options)

				frappe.throw(_('{0} {1} cannot be "{2}". It should be one of "{3}"').format(prefix, label,
					value, comma_options))

	def _validate_constants(self):
		if frappe.flags.in_import or self.is_new():
			return

		constants = [d.fieldname for d in self.meta.get("fields", {"set_only_once": 1})]
		if constants:
			values = frappe.db.get_value(self.doctype, self.name, constants, as_dict=True)

		for fieldname in constants:
			if self.get(fieldname) != values.get(fieldname):
				frappe.throw(_("Value cannot be changed for {0}").format(self.meta.get_label(fieldname)),
					frappe.CannotChangeConstantError)

	def _validate_update_after_submit(self):
		db_values = frappe.db.get_value(self.doctype, self.name, "*", as_dict=True)
		for key, db_value in db_values.iteritems():
			df = self.meta.get_field(key)

Answer: if df and not df.allow_on_submit and (self.get(key) or db_value):

<think>
The method _validate_update_after_submit fetches current DB values and iterates over them. For each field key, it retrieves the field metadata (df). The next logical step is to check if the field exists, is not allowed to be changed after submit, and its value differs from the current document value, then raise an error. Hence the next line is the conditional that performs this check.
</think>
if df and not df.allow_on_submit and db_value != self.get(key):


Context:
# Copyright 2018 The TensorFlow Authors. 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.
# ==============================================================================
"""Various classes representing distributed inputs."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from tensorflow.python.data.experimental.ops import batching
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.ops import multi_device_iterator_ops
from tensorflow.python.distribute import device_util
from tensorflow.python.distribute import distribution_strategy_context
from tensorflow.python.distribute import input_ops
from tensorflow.python.distribute import values
from tensorflow.python.eager import context
from tensorflow.python.framework import device as tf_device
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_util

class InputWorkers(object):
  """A 1-to-many mapping from input worker devices to compute devices."""

  def __init__(self, device_map, worker_device_pairs=None, logical_device=0):
    """Initialize an `InputWorkers` object.

    Args:
      device_map: A `DeviceMap` with the computation devices fed by the
        input workers.
      worker_device_pairs: A sequence of pairs:
        `(input device, a tuple of compute devices fed by that input device)`.
      logical_device: The logical device of `device_map` to feed.
    """
    self._device_map = device_map
    self._logical_device = logical_device
    if worker_device_pairs is None:
      worker_device_pairs = ((
          device_util.canonicalize("/device:CPU:0"),
          device_map.logical_to_actual_devices(logical_device)),)
    self._input_worker_devices = tuple(d for d, _ in worker_device_pairs)
    self._fed_devices = tuple(tuple(device_util.canonicalize(d) for d in f)
                              for _, f in worker_device_pairs)
    flattened = tuple(d for l in self._fed_devices for d in l)
    assert (flattened ==
            device_map.logical_to_actual_devices(logical_device)), (
                "flattened: %s logical device %d: %s" %
                (flattened, logical_device,
                 device_map.logical_to_actual_devices(logical_device)))

  @property
  def device_map(self):
    return self._device_map

  @property
  def logical_device(self):
    return self._logical_device

  @property
  def num_workers(self):
    return len(self._input_worker_devices)

  @property
  def worker_devices(self):
    return self._input_worker_devices

  def compute_devices_for_worker(self, worker_index):
    return self._fed_devices[worker_index]

  def __repr__(self):
    devices = self.worker_devices
    debug_repr = ",\n".join("  %d %s: %s" %
                            (i, devices[i], self._fed_devices[i])
                            for i in range(len(devices)))
    return "%s:{\n%s\n  device_map: %s}" % (
        self.__class__.__name__, debug_repr, self._device_map)

class InputIterator(object):
  """An input iterator, intended to be passed to `DistributionStrategy.run`."""

  def get_next(self):
    """Returns the next inputs for all replicas."""
    raise NotImplementedError("must be implemented in descendants")

  def initialize(self):
    """Initialize the underlying input dataset, when applicable.

    In eager mode, this will create a new iterator and return it.
    In graph mode, this will initialize the same underlying iterator(s).

    Users are required to call this if
    - This iterator was returned from a call to `make_input_fn_iterator` with an
      input function that returns a dataset.
    - Or this iterator was returned from a call to `make_dataset_iterator`.

    Returns:
      A list of initialization ops to be executed.
    """
    raise NotImplementedError("must be implemented in descendants")

class InputIteratorImpl(InputIterator):
  """Common implementation for all input iterators."""

  def __init__(self, input_workers, iterators):
    assert isinstance(input_workers, InputWorkers)
    if not input_workers.worker_devices:
      raise ValueError("Should have at least one worker for input iterator.")

    self._iterators = iterators
    self._input_workers = input_workers

  def get_next(self, name=None):
    """Returns the next input from the iterator for all replicas."""
    replicas = []
    for i, worker in enumerate(self._input_workers.worker_devices):
      if name is not None:
        d = tf_device.DeviceSpec.from_string(worker)
        new_name = "%s_%s_%d" % (name, d.job, d.task)
      else:
        new_name = None
      with ops.device(worker):
        # Make `replicas` a flat list of values across all replicas.
        replicas.extend(self._iterators[i].get_next_as_list(new_name))

    return values.regroup(self._input_workers.device_map, replicas)

  def initialize(self):
    """Initialze underlying iterators.

    Returns:
      A list of any initializer ops that should be run.
    """
    init_ops = []
    for it in self._iterators:
      init_ops.extend(it.initialize())
    return init_ops

  # TODO(priyag): Remove when we switch to using `MultiDeviceIterator` for TPUs.
  @property
  def output_classes(self):
    return self._iterators[0].output_classes

  # TODO(priyag): Remove when we switch to using `MultiDeviceIterator` for TPUs.
  @property
  def output_shapes(self):
    return self._iterators[0].output_shapes

  # TODO(priyag): Remove when we switch to using `MultiDeviceIterator` for TPUs.
  @property
  def output_types(self):
    return self._iterators[0].output_types

  # TODO(priyag): Remove when we switch to using `MultiDeviceIterator` for TPUs.
  def get_iterator(self, worker):
    for i, w in enumerate(self._input_workers.worker_devices):
      if worker == w:
        return self._iterators[i]
    return None

class InputFunctionIterator(InputIteratorImpl):
  """Iterator created from input function."""

  def __init__(self, input_fn, input_workers, input_contexts):
    """Make an iterator for input provided via an input function.

    Currently implements PER_WORKER mode, in which the `input_fn` is called
    once on each worker.

    TODO(priyag): Add other replication modes.

    Args:
      input_fn: Input function that returns a `tf.data.Dataset` object.
      input_workers: an `InputWorkers` object.
      input_contexts: A list of `InputContext` instances to be passed to call(s)
        to `input_fn`. Length and order should match worker order in
        `worker_device_pairs`.
    """
    assert isinstance(input_workers, InputWorkers)
    if input_workers.num_workers != len(input_contexts):
      raise ValueError(
          "Number of input workers (%d) is not same as number of "
          "input_contexts (%d)" %
          (input_workers.num_workers, len(input_contexts)))

    iterators = []
    for i, ctx in enumerate(input_contexts):
      worker = input_workers.worker_devices[i]
      with ops.device(worker):
        result = input_fn(ctx)
        devices = input_workers.compute_devices_for_worker(i)
        if isinstance(result, dataset_ops.DatasetV2):
          iterator = _SingleWorkerDatasetIterator(result, worker, devices)
        elif callable(result):
          iterator = _SingleWorkerCallableIterator(result, worker, devices)
        else:
          raise ValueError(
              "input_fn must return a tf.data.Dataset or a callable.")
        iterators.append(iterator)

    super(InputFunctionIterator, self).__init__(input_workers, iterators)

class DatasetIterator(InputIteratorImpl):
  """Iterator created from input dataset."""

  def __init__(self, dataset, input_workers, split_batch_by=None):
    """Make an iterator for the dataset on given devices.

    If `split_batch_by` is not None, we "split" each batch of the
    dataset by `split_batch_by` value. To achieve this, we first unbatch the
    input dataset and then rebatch it with the per replica batch size that is
    calculated using `global_batch_size // split_batch_by`.
    The currently supported datasets are as follows:
    `dataset.batch()` is the last operation on the dataset OR
    `dataset.apply(map_and_batch)` is the last operation on the dataset OR
    `dataset.batch().prefetch()` are the last 2 operations on the dataset OR
    `dataset.apply(map_and_batch).prefetch()` are the last 2 operations.

    TODO(priyag): Support multi worker / host cases properly by cloning
    and sharding the dataset on each worker. Current setup will only work in
    some cases, such as in-graph multi worker GPU case. If the input pipeline
    has random shuffling (with a different seed on each worker), each worker
    will see random input from the same overall dataset in each step. Otherwise,
    each worker will see the same input in each step.

    Args:
      dataset: `tf.data.Dataset` that will be used as the input source.
      input_workers: an `InputWorkers` object.
      split_batch_by: Optional integer. If present, we "split" each batch of the
        dataset by `split_batch_by` value.
    """
    assert isinstance(input_workers, InputWorkers)
    if split_batch_by:
      dataset = batching._RebatchDataset(dataset, split_batch_by)  # pylint: disable=protected-access

    iterators = []
    for i, worker in enumerate(input_workers.worker_devices):
      with ops.device(worker):
        worker_devices = input_workers.compute_devices_for_worker(i)
        cloned_dataset = dataset
        if not context.executing_eagerly():
          cloned_dataset = input_ops._clone_dataset(dataset)  # pylint: disable=protected-access
          cloned_dataset = cloned_dataset.with_options(dataset.options())
        iterator = _SingleWorkerDatasetIterator(cloned_dataset, worker,
                                                worker_devices)
        iterators.append(iterator)

    self._element_structure = dataset._element_structure  # pylint: disable=protected-access

    super(DatasetIterator, self).__init__(input_workers, iterators)

class _SingleWorkerDatasetIterator(object):
  """Iterator for a single `tf.data.Dataset`."""

  def __init__(self, dataset, worker, devices):
    """Create iterator for the `dataset` to fetch data to worker's `devices` .

    `MultiDeviceIterator` is used to prefetch input to the devices on the
    given worker.

    Args:
      dataset: A `tf.data.Dataset` instance.
      worker: Worker on which ops should be created.
      devices: Distribute data from `dataset` to these devices.
    """
    self._dataset = dataset
    self._worker = worker
    self._devices = devices
    self._make_iterator()

  def _make_iterator(self):
    """Make appropriate iterator on the dataset."""
    with ops.device(self._worker):

Answer: self._iterator = multi_device_iterator_ops.MultiDeviceIterator(

<think>
Inside the _make_iterator method, after setting the device context to the worker, the code needs to create a MultiDeviceIterator that will handle fetching data from the dataset and distributing it across the specified devices. The typical TensorFlow implementation assigns this iterator to self._iterator using multi_device_iterator_ops.MultiDeviceIterator with the dataset and device list as arguments.
</think>
self._iterator = multi_device_iterator_ops.MultiDeviceIterator(self._dataset, self._devices)


Context:
from __future__ import unicode_literals

from unittest import TestCase

from django import template
from django.utils import six

from .templatetags import custom

class CustomFilterTests(TestCase):
    def test_filter(self):
        t = template.Template("{% load custom %}{{ string|trim:5 }}")
        self.assertEqual(
            t.render(template.Context({"string": "abcdefghijklmnopqrstuvwxyz"})),
            "abcde"
        )

class CustomTagTests(TestCase):
    def verify_tag(self, tag, name):
        self.assertEqual(tag.__name__, name)
        self.assertEqual(tag.__doc__, 'Expected %s __doc__' % name)
        self.assertEqual(tag.__dict__['anything'], 'Expected %s __dict__' % name)

    def test_simple_tags(self):
        c = template.Context({'value': 42})

        t = template.Template('{% load custom %}{% no_params %}')
        self.assertEqual(t.render(c), 'no_params - Expected result')

        t = template.Template('{% load custom %}{% one_param 37 %}')
        self.assertEqual(t.render(c), 'one_param - Expected result: 37')

        t = template.Template('{% load custom %}{% explicit_no_context 37 %}')
        self.assertEqual(t.render(c), 'explicit_no_context - Expected result: 37')

        t = template.Template('{% load custom %}{% no_params_with_context %}')
        self.assertEqual(t.render(c), 'no_params_with_context - Expected result (context value: 42)')

        t = template.Template('{% load custom %}{% params_and_context 37 %}')
        self.assertEqual(t.render(c), 'params_and_context - Expected result (context value: 42): 37')

        t = template.Template('{% load custom %}{% simple_two_params 37 42 %}')
        self.assertEqual(t.render(c), 'simple_two_params - Expected result: 37, 42')

        t = template.Template('{% load custom %}{% simple_one_default 37 %}')
        self.assertEqual(t.render(c), 'simple_one_default - Expected result: 37, hi')

        t = template.Template('{% load custom %}{% simple_one_default 37 two="hello" %}')
        self.assertEqual(t.render(c), 'simple_one_default - Expected result: 37, hello')

        t = template.Template('{% load custom %}{% simple_one_default one=99 two="hello" %}')
        self.assertEqual(t.render(c), 'simple_one_default - Expected result: 99, hello')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'simple_one_default' received unexpected keyword argument 'three'",
            template.Template, '{% load custom %}{% simple_one_default 99 two="hello" three="foo" %}')

        t = template.Template('{% load custom %}{% simple_one_default 37 42 %}')
        self.assertEqual(t.render(c), 'simple_one_default - Expected result: 37, 42')

        t = template.Template('{% load custom %}{% simple_unlimited_args 37 %}')
        self.assertEqual(t.render(c), 'simple_unlimited_args - Expected result: 37, hi')

        t = template.Template('{% load custom %}{% simple_unlimited_args 37 42 56 89 %}')
        self.assertEqual(t.render(c), 'simple_unlimited_args - Expected result: 37, 42, 56, 89')

        t = template.Template('{% load custom %}{% simple_only_unlimited_args %}')
        self.assertEqual(t.render(c), 'simple_only_unlimited_args - Expected result: ')

        t = template.Template('{% load custom %}{% simple_only_unlimited_args 37 42 56 89 %}')
        self.assertEqual(t.render(c), 'simple_only_unlimited_args - Expected result: 37, 42, 56, 89')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'simple_two_params' received too many positional arguments",
            template.Template, '{% load custom %}{% simple_two_params 37 42 56 %}')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'simple_one_default' received too many positional arguments",
            template.Template, '{% load custom %}{% simple_one_default 37 42 56 %}')

        t = template.Template('{% load custom %}{% simple_unlimited_args_kwargs 37 40|add:2 56 eggs="scrambled" four=1|add:3 %}')
        self.assertEqual(t.render(c), 'simple_unlimited_args_kwargs - Expected result: 37, 42, 56 / eggs=scrambled, four=4')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'simple_unlimited_args_kwargs' received some positional argument\(s\) after some keyword argument\(s\)",
            template.Template, '{% load custom %}{% simple_unlimited_args_kwargs 37 40|add:2 eggs="scrambled" 56 four=1|add:3 %}')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'simple_unlimited_args_kwargs' received multiple values for keyword argument 'eggs'",
            template.Template, '{% load custom %}{% simple_unlimited_args_kwargs 37 eggs="scrambled" eggs="scrambled" %}')

    def test_simple_tag_registration(self):
        # Test that the decorators preserve the decorated function's docstring, name and attributes.
        self.verify_tag(custom.no_params, 'no_params')
        self.verify_tag(custom.one_param, 'one_param')
        self.verify_tag(custom.explicit_no_context, 'explicit_no_context')
        self.verify_tag(custom.no_params_with_context, 'no_params_with_context')
        self.verify_tag(custom.params_and_context, 'params_and_context')
        self.verify_tag(custom.simple_unlimited_args_kwargs, 'simple_unlimited_args_kwargs')
        self.verify_tag(custom.simple_tag_without_context_parameter, 'simple_tag_without_context_parameter')

    def test_simple_tag_missing_context(self):
        # The 'context' parameter must be present when takes_context is True
        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'simple_tag_without_context_parameter' is decorated with takes_context=True so it must have a first argument of 'context'",
            template.Template, '{% load custom %}{% simple_tag_without_context_parameter 123 %}')

    def test_inclusion_tags(self):
        c = template.Context({'value': 42})

        t = template.Template('{% load custom %}{% inclusion_no_params %}')
        self.assertEqual(t.render(c), 'inclusion_no_params - Expected result\n')

        t = template.Template('{% load custom %}{% inclusion_one_param 37 %}')
        self.assertEqual(t.render(c), 'inclusion_one_param - Expected result: 37\n')

        t = template.Template('{% load custom %}{% inclusion_explicit_no_context 37 %}')
        self.assertEqual(t.render(c), 'inclusion_explicit_no_context - Expected result: 37\n')

        t = template.Template('{% load custom %}{% inclusion_no_params_with_context %}')
        self.assertEqual(t.render(c), 'inclusion_no_params_with_context - Expected result (context value: 42)\n')

        t = template.Template('{% load custom %}{% inclusion_params_and_context 37 %}')
        self.assertEqual(t.render(c), 'inclusion_params_and_context - Expected result (context value: 42): 37\n')

        t = template.Template('{% load custom %}{% inclusion_two_params 37 42 %}')
        self.assertEqual(t.render(c), 'inclusion_two_params - Expected result: 37, 42\n')

        t = template.Template('{% load custom %}{% inclusion_one_default 37 %}')
        self.assertEqual(t.render(c), 'inclusion_one_default - Expected result: 37, hi\n')

        t = template.Template('{% load custom %}{% inclusion_one_default 37 two="hello" %}')
        self.assertEqual(t.render(c), 'inclusion_one_default - Expected result: 37, hello\n')

        t = template.Template('{% load custom %}{% inclusion_one_default one=99 two="hello" %}')
        self.assertEqual(t.render(c), 'inclusion_one_default - Expected result: 99, hello\n')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_one_default' received unexpected keyword argument 'three'",
            template.Template, '{% load custom %}{% inclusion_one_default 99 two="hello" three="foo" %}')

        t = template.Template('{% load custom %}{% inclusion_one_default 37 42 %}')
        self.assertEqual(t.render(c), 'inclusion_one_default - Expected result: 37, 42\n')

        t = template.Template('{% load custom %}{% inclusion_unlimited_args 37 %}')
        self.assertEqual(t.render(c), 'inclusion_unlimited_args - Expected result: 37, hi\n')

        t = template.Template('{% load custom %}{% inclusion_unlimited_args 37 42 56 89 %}')
        self.assertEqual(t.render(c), 'inclusion_unlimited_args - Expected result: 37, 42, 56, 89\n')

        t = template.Template('{% load custom %}{% inclusion_only_unlimited_args %}')
        self.assertEqual(t.render(c), 'inclusion_only_unlimited_args - Expected result: \n')

        t = template.Template('{% load custom %}{% inclusion_only_unlimited_args 37 42 56 89 %}')
        self.assertEqual(t.render(c), 'inclusion_only_unlimited_args - Expected result: 37, 42, 56, 89\n')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_two_params' received too many positional arguments",
            template.Template, '{% load custom %}{% inclusion_two_params 37 42 56 %}')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_one_default' received too many positional arguments",
            template.Template, '{% load custom %}{% inclusion_one_default 37 42 56 %}')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_one_default' did not receive value\(s\) for the argument\(s\): 'one'",
            template.Template, '{% load custom %}{% inclusion_one_default %}')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_unlimited_args' did not receive value\(s\) for the argument\(s\): 'one'",
            template.Template, '{% load custom %}{% inclusion_unlimited_args %}')

        t = template.Template('{% load custom %}{% inclusion_unlimited_args_kwargs 37 40|add:2 56 eggs="scrambled" four=1|add:3 %}')
        self.assertEqual(t.render(c), 'inclusion_unlimited_args_kwargs - Expected result: 37, 42, 56 / eggs=scrambled, four=4\n')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_unlimited_args_kwargs' received some positional argument\(s\) after some keyword argument\(s\)",
            template.Template, '{% load custom %}{% inclusion_unlimited_args_kwargs 37 40|add:2 eggs="scrambled" 56 four=1|add:3 %}')

        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_unlimited_args_kwargs' received multiple values for keyword argument 'eggs'",
            template.Template, '{% load custom %}{% inclusion_unlimited_args_kwargs 37 eggs="scrambled" eggs="scrambled" %}')

    def test_include_tag_missing_context(self):
        # The 'context' parameter must be present when takes_context is True
        six.assertRaisesRegex(self, template.TemplateSyntaxError,
            "'inclusion_tag_without_context_parameter' is decorated with takes_context=True so it must have a first argument of 'context'",
            template.Template, '{% load custom %}{% inclusion_tag_without_context_parameter 123 %}')

    def test_inclusion_tags_from_template(self):
        c = template.Context({'value': 42})

        t = template.Template('{% load custom %}{% inclusion_no_params_from_template %}')
        self.assertEqual(t.render(c), 'inclusion_no_params_from_template - Expected result\n')

        t = template.Template('{% load custom %}{% inclusion_one_param_from_template 37 %}')
        self.assertEqual(t.render(c), 'inclusion_one_param_from_template - Expected result: 37\n')

        t = template.Template('{% load custom %}{% inclusion_explicit_no_context_from_template 37 %}')
        self.assertEqual(t.render(c), 'inclusion_explicit_no_context_from_template - Expected result: 37\n')

        t = template.Template('{% load custom %}{% inclusion_no_params_with_context_from_template %}')
        self.assertEqual(t.render(c), 'inclusion_no_params_with_context_from_template - Expected result (context value: 42)\n')

        t = template.Template('{% load custom %}{% inclusion_params_and_context_from_template 37 %}')
        self.assertEqual(t.render(c), 'inclusion_params_and_context_from_template - Expected result (context value: 42): 37\n')

        t = template.Template('{% load custom %}{% inclusion_two_params_from_template 37 42 %}')
        self.assertEqual(t.render(c), 'inclusion_two_params_from_template - Expected result: 37, 42\n')

        t = template.Template('{% load custom %}{% inclusion_one_default_from_template 37 %}')
        self.assertEqual(t.render(c), 'inclusion_one_default_from_template - Expected result: 37, hi\n')

        t = template.Template('{% load custom %}{% inclusion_one_default_from_template 37 42 %}')
        self.assertEqual(t.render(c), 'inclusion_one_default_from_template - Expected result: 37, 42\n')

        t = template.Template('{% load custom %}{% inclusion_unlimited_args_from_template 37 %}')

Answer: self.assertEqual(t.render(c), 'inclusion_unlimited_args_from_template - Expected result: 37, hi\n')

<think>
The test method is defining a template and then checking its rendered output. Following the pattern used earlier in the file, after creating the Template object for the inclusion_unlimited_args_from_template tag, the next line should assert the expected rendered string. The expected string mirrors the non‑template version but includes the '_from_template' suffix and a trailing newline.
</think>
self.assertEqual(t.render(c), 'inclusion_unlimited_args_from_template - Expected result: 37, hi\n')


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.index.search.child;

import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.SortedDocValues;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BitsFilteredDocIdSet;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.CollectionTerminatedException;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.Filter;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.Weight;
import org.apache.lucene.search.XFilteredDocIdSetIterator;
import org.apache.lucene.search.join.BitDocIdSetFilter;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.ToStringUtils;
import org.elasticsearch.common.lease.Releasable;
import org.elasticsearch.common.lease.Releasables;
import org.elasticsearch.common.lucene.IndexCacheableQuery;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.lucene.search.NoopCollector;
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.common.util.FloatArray;
import org.elasticsearch.common.util.IntArray;
import org.elasticsearch.common.util.LongHash;
import org.elasticsearch.index.fielddata.IndexParentChildFieldData;
import org.elasticsearch.index.fielddata.plain.ParentChildIndexFieldData;
import org.elasticsearch.search.internal.SearchContext;
import org.elasticsearch.search.internal.SearchContext.Lifetime;

import java.io.IOException;
import java.util.Set;

/**
 * A query implementation that executes the wrapped child query and connects all the matching child docs to the related
 * parent documents using {@link ParentChildIndexFieldData}.
 * <p/>
 * This query is executed in two rounds. The first round resolves all the matching child documents and groups these
 * documents by parent uid value. Also the child scores are aggregated per parent uid value. During the second round
 * all parent documents having the same uid value that is collected in the first phase are emitted as hit including
 * a score based on the aggregated child scores and score type.
 */
public final class ChildrenQuery extends IndexCacheableQuery {

    protected final ParentChildIndexFieldData ifd;
    protected final String parentType;
    protected final String childType;
    protected final Filter parentFilter;
    protected final ScoreType scoreType;
    protected Query childQuery;
    protected final int minChildren;
    protected final int maxChildren;
    protected final int shortCircuitParentDocSet;
    protected final BitDocIdSetFilter nonNestedDocsFilter;

    public ChildrenQuery(ParentChildIndexFieldData ifd, String parentType, String childType, Filter parentFilter, Query childQuery, ScoreType scoreType, int minChildren, int maxChildren, int shortCircuitParentDocSet, BitDocIdSetFilter nonNestedDocsFilter) {
        this.ifd = ifd;
        this.parentType = parentType;
        this.childType = childType;
        this.parentFilter = parentFilter;
        this.childQuery = childQuery;
        this.scoreType = scoreType;
        this.shortCircuitParentDocSet = shortCircuitParentDocSet;
        this.nonNestedDocsFilter = nonNestedDocsFilter;
        assert maxChildren == 0 || minChildren <= maxChildren;
        this.minChildren = minChildren > 1 ? minChildren : 0;
        this.maxChildren = maxChildren;
    }

    @Override
    public Query rewrite(IndexReader reader) throws IOException {
        final Query childRewritten = childQuery.rewrite(reader);
        if (childRewritten != childQuery) {
            Query rewritten = new ChildrenQuery(ifd, parentType, childType, parentFilter, childRewritten, scoreType, minChildren, maxChildren, shortCircuitParentDocSet, nonNestedDocsFilter);
            rewritten.setBoost(getBoost());
            return rewritten;
        }
        return super.rewrite(reader);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (super.equals(obj) == false) {
            return false;
        }

        ChildrenQuery that = (ChildrenQuery) obj;
        if (!childQuery.equals(that.childQuery)) {
            return false;
        }
        if (!childType.equals(that.childType)) {
            return false;
        }
        if (minChildren != that.minChildren) {
            return false;
        }
        if (maxChildren != that.maxChildren) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + childQuery.hashCode();
        result = 31 * result + childType.hashCode();
        result = 31 * result + minChildren;
        result = 31 * result + maxChildren;
        return result;
    }

    @Override
    public String toString(String field) {
        int max = maxChildren == 0 ? Integer.MAX_VALUE : maxChildren;
        return "ChildrenQuery[min(" + Integer.toString(minChildren) + ") max(" + Integer.toString(max) + ")of " + childType + "/"
                + parentType + "](" + childQuery.toString(field) + ')' + ToStringUtils.boost(getBoost());
    }

    @Override
    public Weight doCreateWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
        SearchContext sc = SearchContext.current();

        IndexParentChildFieldData globalIfd = ifd.loadGlobal(searcher.getIndexReader());
        if (globalIfd == null) {
            // No docs of the specified type exist on this shard
            return new BooleanQuery().createWeight(searcher, needsScores);
        }
        IndexSearcher indexSearcher = new IndexSearcher(searcher.getIndexReader());
        indexSearcher.setSimilarity(searcher.getSimilarity(true));
        indexSearcher.setQueryCache(null);

        boolean abort = true;
        long numFoundParents;
        ParentCollector collector = null;
        try {
            if (minChildren == 0 && maxChildren == 0 && scoreType != ScoreType.NONE) {
                switch (scoreType) {
                case MIN:
                    collector = new MinCollector(globalIfd, sc, parentType);
                    break;
                case MAX:
                    collector = new MaxCollector(globalIfd, sc, parentType);
                    break;
                case SUM:
                    collector = new SumCollector(globalIfd, sc, parentType);
                    break;
                }
            }
            if (collector == null) {
                switch (scoreType) {
                case MIN:
                    collector = new MinCountCollector(globalIfd, sc, parentType);
                    break;
                case MAX:
                    collector = new MaxCountCollector(globalIfd, sc, parentType);
                    break;
                case SUM:
                case AVG:
                    collector = new SumCountAndAvgCollector(globalIfd, sc, parentType);
                    break;
                case NONE:
                    collector = new CountCollector(globalIfd, sc, parentType);
                    break;
                default:
                    throw new RuntimeException("Are we missing a score type here? -- " + scoreType);
                }
            }

            indexSearcher.search(childQuery, collector);
            numFoundParents = collector.foundParents();
            if (numFoundParents == 0) {
                return new BooleanQuery().createWeight(searcher, needsScores);
            }
            abort = false;
        } finally {
            if (abort) {
                Releasables.close(collector);
            }
        }
        sc.addReleasable(collector, Lifetime.COLLECTION);
        final Filter parentFilter;
        if (numFoundParents <= shortCircuitParentDocSet) {
            parentFilter = ParentIdsFilter.createShortCircuitFilter(nonNestedDocsFilter, sc, parentType, collector.values,
                    collector.parentIdxs, numFoundParents);
        } else {
            parentFilter = this.parentFilter;
        }
        return new ParentWeight(this, childQuery.createWeight(searcher, needsScores), parentFilter, numFoundParents, collector, minChildren,
                maxChildren);
    }

    protected class ParentWeight extends Weight {

        protected final Weight childWeight;
        protected final Filter parentFilter;
        protected final ParentCollector collector;
        protected final int minChildren;
        protected final int maxChildren;

        protected long remaining;
        protected float queryNorm;
        protected float queryWeight;

        protected ParentWeight(Query query, Weight childWeight, Filter parentFilter, long remaining, ParentCollector collector, int minChildren, int maxChildren) {
            super(query);
            this.childWeight = childWeight;
            this.parentFilter = parentFilter;
            this.remaining = remaining;
            this.collector = collector;
            this.minChildren = minChildren;
            this.maxChildren = maxChildren;
        }

        @Override
        public void extractTerms(Set<Term> terms) {
        }

        @Override
        public Explanation explain(LeafReaderContext context, int doc) throws IOException {
            return Explanation.match(getBoost(), "not implemented yet...");
        }

        @Override
        public void normalize(float norm, float topLevelBoost) {
            this.queryNorm = norm * topLevelBoost;
            queryWeight *= this.queryNorm;
        }

        @Override
        public float getValueForNormalization() throws IOException {
            queryWeight = getBoost();
            if (scoreType == ScoreType.NONE) {
                return queryWeight * queryWeight;
            }
            float sum = childWeight.getValueForNormalization();
            sum *= queryWeight * queryWeight;
            return sum;
        }

        @Override
        public Scorer scorer(LeafReaderContext context, Bits acceptDocs) throws IOException {
            DocIdSet parentsSet = parentFilter.getDocIdSet(context, acceptDocs);
            if (Lucene.isEmpty(parentsSet) || remaining == 0) {
                return null;
            }

            // We can't be sure of the fact that liveDocs have been applied, so we apply it here. The "remaining"
            // count down (short circuit) logic will then work as expected.
            DocIdSetIterator parents = BitsFilteredDocIdSet.wrap(parentsSet, context.reader().getLiveDocs()).iterator();

            if (parents != null) {
                SortedDocValues bytesValues = collector.globalIfd.load(context).getOrdinalsValues(parentType);
                if (bytesValues == null) {
                    return null;
                }

                if (minChildren > 0 || maxChildren != 0 || scoreType == ScoreType.NONE) {
                    switch (scoreType) {
                    case NONE:
                        DocIdSetIterator parentIdIterator = new CountParentOrdIterator(this, parents, collector, bytesValues,
                                minChildren, maxChildren);
                        return ConstantScorer.create(parentIdIterator, this, queryWeight);
                    case AVG:
                        return new AvgParentCountScorer(this, parents, collector, bytesValues, minChildren, maxChildren);
                    default:
                        return new ParentCountScorer(this, parents, collector, bytesValues, minChildren, maxChildren);
                    }
                }
                switch (scoreType) {
                case AVG:
                    return new AvgParentScorer(this, parents, collector, bytesValues);
                default:
                    return new ParentScorer(this, parents, collector, bytesValues);
                }
            }
            return null;
        }
    }

    protected abstract static class ParentCollector extends NoopCollector implements Releasable {

        protected final IndexParentChildFieldData globalIfd;
        protected final LongHash parentIdxs;
        protected final BigArrays bigArrays;
        protected final SearchContext searchContext;
        protected final String parentType;

        protected SortedDocValues values;
        protected Scorer scorer;

        protected ParentCollector(IndexParentChildFieldData globalIfd, SearchContext searchContext, String parentType) {
            this.globalIfd = globalIfd;
            this.searchContext = searchContext;
            this.bigArrays = searchContext.bigArrays();
            this.parentIdxs = new LongHash(512, bigArrays);

Answer: this.parentType = parentType;

<think>
The constructor of ParentCollector initializes its member fields. The fields declared earlier include globalIfd, parentIdxs, bigArrays, searchContext, and parentType. The code already sets the first four fields; the next logical line is to assign the passed parentType argument to the class's parentType field.
</think>
this.parentType = parentType;