def get_function(name, kwargs = {})
      assert_type name, :String, :name

      css = if kwargs.has_key?("css")
              v = kwargs.delete("css")
              assert_type v, :Bool, :css
              v.value
            else
              false
            end

      if kwargs.any?
        raise ArgumentError.new("Illegal keyword argument '#{kwargs.keys.first}'")
      end

      if css
        return Sass::Script::Value::Function.new(
          Sass::Callable.new(name.value, nil, nil, nil, nil, nil, "function", :css))
      end

      callable = environment.caller.function(name.value) ||
        (Sass::Script::Functions.callable?(name.value.tr("-", "_")) &&
         Sass::Callable.new(name.value, nil, nil, nil, nil, nil, "function", :builtin))

      if callable
        Sass::Script::Value::Function.new(callable)
      else
        raise Sass::SyntaxError.new("Function not found: #{name}")
      end
    end
def get_function(name, kwargs = {})
      assert_type name, :String, :name

      css = if kwargs.has_key?("css")
              v = kwargs.delete("css")
              assert_type v, :Bool, :css
              v.value
            else
              false
            end

      if kwargs.any?
        raise ArgumentError.new("Illegal keyword argument '#{kwargs.keys.first}'")
      end

      if css
        return Sass::Script::Value::Function.new(
          Sass::Callable.new(name.value, nil, nil, nil, nil, nil, "function", :css))
      end

      callable = environment.caller.function(name.value) ||
        (Sass::Script::Functions.callable?(name.value.tr("-", "_")) &&
         Sass::Callable.new(name.value, nil, nil, nil, nil, nil, "function", :builtin))

      if callable
        Sass::Script::Value::Function.new(callable)
      else
        raise Sass::SyntaxError.new("Function not found: #{name}")
      end
    end
Returns a reference to a function for later invocation with the `call()` function.

 If `$css` is `false`, the function reference may refer to a function
 defined in your stylesheet or built-in to the host environment. If it's
 `true` it will refer to a plain-CSS function.

 @example
   get-function("rgb")

   @function myfunc { @return "something"; }
   get-function("myfunc")

 @overload get_function($name, $css: false)
   @param name [Sass::Script::Value::String] The name of the function being referenced.
   @param css [Sass::Script::Value::Bool] Whether to get a plain CSS function.

 @return [Sass::Script::Value::Function] A function reference.