code: def _parse_children_arg(
      *args: L | list[L], children: list[L] | None = None
  ) -> list[L]:
      # Set-up Children from args or kwargs
      if len(args) > 0 and children is not None:
          raise ValueError(
              "'children' keyword cannot be used with positional arguments"
          )
  
      if not children:
          if len(args) == 1:
              [arg] = args
              if isinstance(arg, list):
                  return arg
  
          return list(args)
  
      return children
  
imports: from __future__ import annotations
  import logging
  import math
  from collections import defaultdict
  from typing import TYPE_CHECKING, Any, Callable, Iterable, Iterator, Literal, Sequence, TypeVar, Union, overload
  from .core.enums import Location, LocationType, SizingModeType
  from .core.property.singletons import Undefined, UndefinedType
  from .models import Column, CopyTool, ExamineTool, FlexBox, FullscreenTool, GridBox, GridPlot, LayoutDOM, Plot, Row, SaveTool, Spacer, Tool, Toolbar, ToolProxy, UIElement
  from .util.dataclasses import dataclass
  from .util.warnings import warn
label_desc: Use image node_id 18 for calling a global function with example usage: _parse_children_arg() and returns: children, list, arg