user: Describe NodeSocket(bpy_struct) from the Blender manual or Python API, including usage steps and snippets.

assistant: # NodeSocket(bpy_struct)

base class — [`bpy_struct`](bpy.types.bpy_struct.html#bpy.types.bpy_struct "bpy.types.bpy_struct")

subclasses —
[`NodeSocketStandard`](bpy.types.NodeSocketStandard.html#bpy.types.NodeSocketStandard "bpy.types.NodeSocketStandard")

*class* bpy.types.NodeSocket(*bpy_struct*)
:   Input or output socket of a node

    bl_idname
    :   Type:
        :   string, default “”, (never None)

    bl_label
    :   Label to display for the socket type in the UI

        Type:
        :   string, default “”, (never None)

    bl_subtype_label
    :   Label to display for the socket subtype in the UI

        Type:
        :   string, default “”, (never None)

    description
    :   Socket tooltip

        Type:
        :   string, default “”, (never None)

    display_shape
    :   Socket shape

        Type:
        :   enum in [`'CIRCLE'`, `'SQUARE'`, `'DIAMOND'`, `'CIRCLE_DOT'`, `'SQUARE_DOT'`, `'DIAMOND_DOT'`, `'LINE'`, `'VOLUME_GRID'`, `'LIST'`], default `'CIRCLE'`

    enabled
    :   Enable the socket

        Type:
        :   boolean, default False

    hide
    :   Hide the socket

        Type:
        :   boolean, default False

    hide_value
    :   Hide the socket input value

        Type:
        :   boolean, default False

    identifier
    :   Unique identifier for mapping sockets

        Type:
        :   string, default “”, (readonly, never None)

    inferred_structure_type
    :   Best known structure type of the socket. This may not match the socket shape, e.g. for unlinked input sockets

        Type:
        :   enum in [Node Socket Structure Type Items](bpy_types_enum_items/node_socket_structure_type_items.html#rna-enum-node-socket-structure-type-items), default `'AUTO'`, (readonly)

    is_icon_visible
    :   Socket is drawn as interactive icon in the node editor

        Type:
        :   boolean, default False, (readonly)

    is_inactive
    :   Socket is grayed out because it has been detected to not have any effect on the output

        Type:
        :   boolean, default False, (readonly)

    is_linked
    :   True if the socket is connected

        Type:
        :   boolean, default False, (readonly)

    is_multi_input
    :   True if the socket can accept multiple ordered input links

        Type:
        :   boolean, default False, (readonly)

    is_output
    :   True if the socket is an output, otherwise input

        Type:
        :   boolean, default False, (readonly)

    is_unavailable
    :   True if the socket is unavailable

        Type:
        :   boolean, default False, (readonly)

    label
    :   Custom dynamic defined socket label

        Type:
        :   string, default “”, (readonly, never None)

    link_limit
    :   Max number of links allowed for this socket

        Type:
        :   int in [1, 4095], default 0

    name
    :   Socket name

        Type:
        :   string, default “”, (never None)

    node
    :   Node owning this socket

        Type:
        :   [`Node`](bpy.types.Node.html#bpy.types.Node "bpy.types.Node"), (readonly)

    pin_gizmo
    :   Keep gizmo visible even when the node is not selected

        Type:
        :   boolean, default False

    select
    :   True if the socket is selected

        Type:
        :   boolean, default False, (readonly)

    show_expanded
    :   Socket links are expanded in the user interface

        Type:
        :   boolean, default False

    type
    :   Data type

        Type:
        :   enum in [Node Socket Type Items](bpy_types_enum_items/node_socket_type_items.html#rna-enum-node-socket-type-items), default `'VALUE'`

    links
    :   List of node links from or to this socket.

        Type:
        :   [`NodeLinks`](bpy.types.NodeLinks.html#bpy.types.NodeLinks "bpy.types.NodeLinks")

        (readonly)

    bl_system_properties_get(*\**, *do_create=False*)
    :   DEBUG ONLY. Internal access to runtime-defined RNA data storage, intended solely for testing and debugging purposes. Do not access it in regular scripting work, and in particular, do not assume that it contains writable data

        Parameters:
        :   **do_create** (*boolean**,* *(**optional**)*) – Ensure that system properties are created if they do not exist yet

        Returns:
        :   The system properties root container, or None if there are no system properties stored in this data yet, and its creation was not requested

        Return type:
        :   [`PropertyGroup`](bpy.types.PropertyGroup.html#bpy.types.PropertyGroup "bpy.types.PropertyGroup")

    draw(*context*, *layout*, *node*, *text*)
    :   Draw socket

        Parameters:
        :   - **layout** ([`UILayout`](bpy.types.UILayout.html#bpy.types.UILayout "bpy.types.UILayout"), (never None)) – Layout, Layout in the UI
            - **node** ([`Node`](bpy.types.Node.html#bpy.types.Node "bpy.types.Node"), (never None)) – Node, Node the socket belongs to
            - **text** (*string**,* *(**never None**)*) – Text, Text label to draw alongside properties

    draw_color(*context*, *node*)
    :   Color of the socket icon

        Parameters:
        :   **node** ([`Node`](bpy.types.Node.html#bpy.types.Node "bpy.types.Node"), (never None)) – Node, Node the socket belongs to

        Returns:
        :   Color

        Return type:
        :   float array of 4 items in [0, 1]

    *classmethod* draw_color_simple()
    :   Color of the socket icon. Used to draw sockets in places where the socket does not belong to a node, like the node interface panel. Also used to draw node sockets if draw_color is not defined.

        Returns:
        :   Color

        Return type:
        :   float array of 4 items in [0, 1]

    *classmethod* bl_rna_get_subclass(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The RNA type or default when not found.

        Return type:
        :   [`bpy.types.Struct`](bpy.types.Struct.html#bpy.types.Struct "bpy.types.Struct") subclass

    *classmethod* bl_rna_get_subclass_py(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The class or default when not found.

        Return type:
        :   [type](#bpy.types.NodeSocket.type "bpy.types.NodeSocket.type")