Repository: mandiant/capa
File: capa/render/proto/__init__.py (Python)

Code before:
        return frzf.CharacteristicFeature(characteristic=ff.characteristic, description=ff.description or None)
    elif type_ == "export":
        ff = f.export
        return frzf.ExportFeature(export=ff.export, description=ff.description or None)
    elif type_ == "import_":
        ff = f.import_
        return frzf.ImportFeature(import_=ff.import_, description=ff.description or None)  # type: ignore
        # Mypy is unable to recognize `import_` as an argument
    elif type_ == "section":
        ff = f.section
        return frzf.SectionFeature(section=ff.section, description=ff.description or None)
    elif type_ == "function_name":
        ff = f.function_name
        return frzf.FunctionNameFeature(function_name=ff.function_name, description=ff.description or None)  # type: ignore
    elif type_ == "substring":
        ff = f.substring
        return frzf.SubstringFeature(substring=ff.substring, description=ff.description or None)
    elif type_ == "regex":
        ff = f.regex
        return frzf.RegexFeature(regex=ff.regex, description=ff.description or None)
    elif type_ == "string":
        ff = f.string
        return frzf.StringFeature(string=ff.string, description=ff.description or None)
    elif type_ == "class_":
        ff = f.class_
        return frzf.ClassFeature(class_=ff.class_, description=ff.description or None)  # type: ignore
    elif type_ == "namespace":
        ff = f.namespace
        return frzf.NamespaceFeature(namespace=ff.namespace, description=ff.description or None)
    elif type_ == "api":
        ff = f.api
        return frzf.APIFeature(api=ff.api, description=ff.description or None)
    elif type_ == "property_":
        ff = f.property_
        return frzf.PropertyFeature(property=ff.property_, access=ff.access or None, description=ff.description or None)
    elif type_ == "number":
        ff = f.number
        return frzf.NumberFeature(number=number_from_pb2(ff.number), description=ff.description or None)
    elif type_ == "bytes":
        ff = f.bytes
        return frzf.BytesFeature(bytes=ff.bytes, description=ff.description or None)
    elif type_ == "offset":
        ff = f.offset
        return frzf.OffsetFeature(offset=int_from_pb2(ff.offset), description=ff.description or None)
    elif type_ == "mnemonic":
        ff = f.mnemonic
        return frzf.MnemonicFeature(mnemonic=ff.mnemonic, description=ff.description or None)
    elif type_ == "operand_number":
        ff = f.operand_number
        return frzf.OperandNumberFeature(
            index=ff.index, operand_number=number_from_pb2(ff.operand_number), description=ff.description or None

Review comment (suggestion):
```suggestion
        return frzf.ClassFeature(class_=ff.class_, description=ff.description or None)  # type: ignore
        # Mypy is unable to recognize `class_` as an argument due to aliasing
```

Code after:
        return frzf.CharacteristicFeature(characteristic=ff.characteristic, description=ff.description or None)
    elif type_ == "export":
        ff = f.export
        return frzf.ExportFeature(export=ff.export, description=ff.description or None)
    elif type_ == "import_":
        ff = f.import_
        return frzf.ImportFeature(import_=ff.import_, description=ff.description or None)  # type: ignore
        # Mypy is unable to recognize `import_` as an argument
    elif type_ == "section":
        ff = f.section
        return frzf.SectionFeature(section=ff.section, description=ff.description or None)
    elif type_ == "function_name":
        ff = f.function_name
        return frzf.FunctionNameFeature(function_name=ff.function_name, description=ff.description or None)  # type: ignore
    elif type_ == "substring":
        ff = f.substring
        return frzf.SubstringFeature(substring=ff.substring, description=ff.description or None)
    elif type_ == "regex":
        ff = f.regex
        return frzf.RegexFeature(regex=ff.regex, description=ff.description or None)
    elif type_ == "string":
        ff = f.string
        return frzf.StringFeature(string=ff.string, description=ff.description or None)
    elif type_ == "class_":
        ff = f.class_
        return frzf.ClassFeature(class_=ff.class_, description=ff.description or None)  # type: ignore
        # Mypy is unable to recognize `class_` as an argument due to aliasing
    elif type_ == "namespace":
        ff = f.namespace
        return frzf.NamespaceFeature(namespace=ff.namespace, description=ff.description or None)
    elif type_ == "api":
        ff = f.api
        return frzf.APIFeature(api=ff.api, description=ff.description or None)
    elif type_ == "property_":
        ff = f.property_
        return frzf.PropertyFeature(property=ff.property_, access=ff.access or None, description=ff.description or None)
    elif type_ == "number":
        ff = f.number
        return frzf.NumberFeature(number=number_from_pb2(ff.number), description=ff.description or None)
    elif type_ == "bytes":
        ff = f.bytes
        return frzf.BytesFeature(bytes=ff.bytes, description=ff.description or None)
    elif type_ == "offset":
        ff = f.offset
        return frzf.OffsetFeature(offset=int_from_pb2(ff.offset), description=ff.description or None)
    elif type_ == "mnemonic":
        ff = f.mnemonic
        return frzf.MnemonicFeature(mnemonic=ff.mnemonic, description=ff.description or None)
    elif type_ == "operand_number":
        ff = f.operand_number
        return frzf.OperandNumberFeature(