def make_input(const_context, builder, variables):
    """
    Ensure that variables, if const, are added to builder.

    variables: list[Var] or Var or str. Inputs for an nn layer.

    Returns:
        list[str] or str: variables' names.
    """
    if isinstance(variables, (list, tuple)):
        return [make_input(const_context, builder, v) for v in variables]
    if isinstance(variables, str):
        return variables

    v = variables  # variables is Var
    if v.op is not None and v.op.op_type == "const" and v.name not in const_context[-1]:
        add_const(const_context, builder, v.name, v.val)
    return v.name

    Ensure that variables, if const, are added to builder.

    variables: list[Var] or Var or str. Inputs for an nn layer.

    Returns:
        list[str] or str: variables' names.
    
coremltools/converters/mil/backend/nn/op_mapping.py