def _args_to_val(func, args):
from .google_imports import gql  <EOL>vals = []<EOL>for arg in args:<EOL><INDENT>if isinstance(arg, (int, str)):<EOL><INDENT>val = Parameter(arg)<EOL><DEDENT>elif isinstance(arg, gql.Literal):<EOL><INDENT>val = arg.Get()<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>' % arg)<EOL><DEDENT>vals.append(val)<EOL><DEDENT>if func == '<STR_LIT>':<EOL><INDENT>if len(vals) != <NUM_LIT:1>:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>return vals[<NUM_LIT:0>]  <EOL><DEDENT>pfunc = ParameterizedFunction(func, vals)<EOL>if pfunc.is_parameterized():<EOL><INDENT>return pfunc<EOL><DEDENT>else:<EOL><INDENT>return pfunc.resolve({}, {})<EOL><DEDENT>
Helper for GQL parsing to extract values from GQL expressions.

    This can extract the value from a GQL literal, return a Parameter
    for a GQL bound parameter (:1 or :foo), and interprets casts like
    KEY(...) and plain lists of values like (1, 2, 3).

    Args:
      func: A string indicating what kind of thing this is.
      args: One or more GQL values, each integer, string, or GQL literal.