def _process(G, name, value):
    """
    Determines whether parameter is a template or a value. Adds graph nodes and edges accordingly.
    """
    # Jinja defaults to ascii parser in python 2.x unless you set utf-8 support on per module level
    # Instead we're just assuming every string to be a unicode string
    if isinstance(value, str):
        value = to_unicode(value)

    complex_value_str = None
    if isinstance(value, list) or isinstance(value, dict):
        complex_value_str = str(value)

    is_jinja_expr = jinja_utils.is_jinja_expression(
        value
    ) or jinja_utils.is_jinja_expression(complex_value_str)

    if is_jinja_expr:
        try:
            template_ast = ENV.parse(value)
            G.add_node(name, template=value)

            LOG.debug("Template ast: %s", template_ast)
            # Dependencies of the node represent jinja variables used in the template
            # We're connecting nodes with an edge for every depencency to traverse them
            # in the right order and also make sure that we don't have missing or cyclic
            # dependencies upfront.
            dependencies = meta.find_undeclared_variables(template_ast)
            LOG.debug("Dependencies: %s", dependencies)
            if dependencies:
                for dependency in dependencies:
                    G.add_edge(dependency, name)
        except exceptions.TemplateSyntaxError:
            G.add_node(name, value=value)
            # not jinja after all
            # is_jinga_expression only checks for {{ or {{% for speed
    else:
        G.add_node(name, value=value)

    Determines whether parameter is a template or a value. Adds graph nodes and edges accordingly.
    
st2common/st2common/util/param.py