<commit_before>
" Allows you to set global variables. Equivalent to `$`. @example `var(\"txt1\") { set(\"MYTEXT\") }` sets the variable of 'txt1' to 'MYTEXT'."
# @abstract The var function allows you to set global variables. 
# @name var
# @category Environment
# @scope Text,XMLNode
# @args Text %name
# @description 
# @example
# var("my_var") {
#   set("is set")
# }
# log($my_var)
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/var
# @guidetext Function Guide
# @guidelink
@func var(Text %name) Text Text

" Allows you to set global variables. Equivalent to `$`. @example `var(\"txt1\", \"MYTEXT\")` sets the variable of 'txt1' to 'MYTEXT'."
# @abstract The var function allows you to set global variables. 
# @name var
# @category Environment
# @scope Text,XMLNode
# @args Text %name,Text %value
# @description 
# @example
# var("my_var", "is set")
# log($my_var)
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/var
# @guidetext Function Guide
# @guidelink
@func var(Text %name, Text %value) Text Text

" Returns the time-to-execute (time units vary by implementation). @example `log(time())` will log the time taken to reach that point in the server logs. "
# @abstract The time function returns the time it has taken to reach that point thus far.
# @name time
# @category Environment
# @scope Text,XMLNode
# @args
# @description 
# @example
# log(time())
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/time
# @guidetext Function Guide
# @guidelink
@func time() Text

" Specifies a target (specified by **%target**) to be searched. To be used in conjunction with `with()` - [click for example](http://beta.moovweb.com/learn/training/function_guides/match). @example `match($path) { with(/product/) }` will match the path of the url to see if the regular expression 'product' matches."
# @abstract The match function is used for logic to check against the content of strings and variables.
# @name match
# @category Environment,Text
# @scope Text
# @args Text %target
# @description
# @example
#   $path = "product"
#   match($path) {
#     with(/product/) {
#       log("Match successful!")
#     }
#     else() {
#       log("Match unsuccessful.")
#     }
#   }
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/match
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/match
@func match(Text %match_target) Text

" Writes out a string (**%log_message**) to the console and debug log. @example `log(\"Importing home-page\")`. "
# @abstract The log function is used to write out a string to the console. It's often useful for debugging Tritium.
# @name log
# @category Environment
# @scope Text,XMLNode
# @args Text %log_message
# @description
# @example
#   log("I've reached this point in the code!")
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/log
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/log
@func log(Text %log_message) Text Text

" Returns the warning **%message** when a function is deprecated. Mostly useful when defining functions. @example `@func XMLNode.old() { deprecated(\"WARNING! This function has been deprecated\") }` will print out a server log message whenever the function is used. "
@func deprecated(Text %message) Text Text

" Used with `match()` as an opposite of `with()`. @example `match($var) { not('hi') }` will check that the '$var' is not set to 'hi'. "
@func not(Text %text) Text

" Used with `match()` as an opposite of `with()`. @example `match($var) { not(/hi/) }` will check that the '$var' is not set to 'hi'. "
@func not(Regexp %regexp) Text

" Used with `match()`. Allows the match function to specify what is being matched. @example `match($path) { with(\"product\") }` will check the path of the url matches 'product'."
@func with(Text %text) Text

" Used with `match()`. Allows the match function to specify what is being matched. @example `match($path) { with(/product/) }` will check the path of the url matches the regular expression 'product'."
@func with(Regexp %regexp) Text

" Convert from one encoding to another. (If you want a list of encodings, you can run `iconv -l` on your command line.) @example `text() { convert_encoding(\"gbk\", \"utf-8\") }` will convert the text from gbk to utf-8."
@func Text.convert_encoding(Text %from, Text %to) Text

" Guess the encoding from the input, the response header and html meta tag. "
@func Text.guess_encoding() Text
<commit_msg>base examples added to header.tf<commit_after>
" Allows you to set global variables. Equivalent to `$`. @example `var(\"txt1\") { set(\"MYTEXT\") }` sets the variable of 'txt1' to 'MYTEXT'."
# @abstract The var function allows you to set global variables. 
# @name var
# @category Environment
# @scope Text,XMLNode
# @args Text %name
# @description 
# @example
# var("my_var") {
#   set("is set")
# }
# log($my_var)
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/var
# @guidetext Function Guide
# @guidelink
@func var(Text %name) Text Text

" Allows you to set global variables. Equivalent to `$`. @example `var(\"txt1\", \"MYTEXT\")` sets the variable of 'txt1' to 'MYTEXT'."
# @abstract The var function allows you to set global variables. 
# @name var
# @category Environment
# @scope Text,XMLNode
# @args Text %name,Text %value
# @description 
# @example
# var("my_var", "is set")
# log($my_var)
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/var
# @guidetext Function Guide
# @guidelink
@func var(Text %name, Text %value) Text Text

" Returns the time-to-execute (time units vary by implementation). @example `log(time())` will log the time taken to reach that point in the server logs. "
# @abstract The time function returns the time it has taken to reach that point thus far.
# @name time
# @category Environment
# @scope Text,XMLNode
# @args
# @description 
# @example
# log(time())
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/time
# @guidetext Function Guide
# @guidelink
@func time() Text

" Specifies a target (specified by **%target**) to be searched. To be used in conjunction with `with()` - [click for example](http://beta.moovweb.com/learn/training/function_guides/match). @example `match($path) { with(/product/) }` will match the path of the url to see if the regular expression 'product' matches."
# @abstract The match function is used for logic to check against the content of strings and variables.
# @name match
# @category Environment,Text
# @scope Text
# @args Text %target
# @description
# @example
#   $path = "product"
#   match($path) {
#     with(/product/) {
#       log("Match successful!")
#     }
#     else() {
#       log("Match unsuccessful.")
#     }
#   }
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/match
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/match
@func match(Text %match_target) Text

" Writes out a string (**%log_message**) to the console and debug log. @example `log(\"Importing home-page\")`. "
# @abstract The log function is used to write out a string to the console. It's often useful for debugging Tritium.
# @name log
# @category Environment
# @scope Text,XMLNode
# @args Text %log_message
# @description
# @example
#   log("I've reached this point in the code!")
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/log
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/log
@func log(Text %log_message) Text Text

" Returns the warning **%message** when a function is deprecated. Mostly useful when defining functions. @example `@func XMLNode.old() { deprecated(\"WARNING! This function has been deprecated\") }` will print out a server log message whenever the function is used. "
@func deprecated(Text %message) Text Text

" Used with `match()` as an opposite of `with()`. @example `match($var) { not('hi') }` will check that the '$var' is not set to 'hi'. "
# @abstract The not function is used with match() as an opposite to with().
# @name not
# @category Environment,Text
# @scope Text,XMLNode
# @args Text %text
# @description
# @example
# $var = "Match Me"
# match($var) {
#   not("Match You") {
#     log("Match unsuccessful!")
#   }
# }
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/not
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/match
@func not(Text %text) Text

" Used with `match()` as an opposite of `with()`. @example `match($var) { not(/hi/) }` will check that the '$var' is not set to 'hi'. "
# @abstract The not function is used with match() as an opposite to with().
# @name not
# @category Environment,Text
# @scope Text,XMLNode
# @args Regexp %regexp
# @description
# @example
# $var = "Match Me"
# match($var) {
#   not(/Match You/) {
#     log("Match unsuccessful!")
#   }
# }
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/not
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/match
@func not(Regexp %regexp) Text

" Used with `match()`. Allows the match function to specify what is being matched. @example `match($path) { with(\"product\") }` will check the path of the url matches 'product'."
# @abstract The with function is used with match() to match a variable with multiple possibilities.
# @name with
# @category Environment,Text
# @scope Text,XMLNode
# @args Text %text
# @description
# @example
# $var = "Match Me"
# match($var) {
#   with("Match Me") {
#     log("Match successful!")
#   }
# }
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/with
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/match
@func with(Text %text) Text

" Used with `match()`. Allows the match function to specify what is being matched. @example `match($path) { with(/product/) }` will check the path of the url matches the regular expression 'product'."
# @abstract The with function is used with match() to match a variable with multiple possibilities.
# @name with
# @category Environment,Text
# @scope Text,XMLNode
# @args Regexp %regexp
# @description
# @example
# $var = "Match Me"
# match($var) {
#   with(/Match Me/) {
#     log("Match successful!")
#   }
# }
# @exampletext Tritium Tester Example
# @examplelink http://tritium.moovweb.com/base/test/examples/with
# @guidetext Function Guide
# @guidelink http://beta.moovweb.com/learn/training/function_guides/match
@func with(Regexp %regexp) Text

" Convert from one encoding to another. (If you want a list of encodings, you can run `iconv -l` on your command line.) @example `text() { convert_encoding(\"gbk\", \"utf-8\") }` will convert the text from gbk to utf-8."
@func Text.convert_encoding(Text %from, Text %to) Text

" Guess the encoding from the input, the response header and html meta tag. "
@func Text.guess_encoding() Text

{'fraction_non_alphanumeric': 0.13557094032074316, 'fraction_numerical': 0.00105161686092367, 'mean_word_length': 4.476007677543186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '205433', 'n_tokens_mistral': 3575, 'n_tokens_neox': 3522, 'n_words': 1272}