def get_example_rule_functions():
    """some example rule functions"""
    example = """
#custom functions to be used in rules
def replace_hello_with_goodbye(input):
    #val=input['k']['in.1']
    #print('rf:replace_hello_with_goodbye:k:in.1',val)
    ret=input.replace('Hello','Goodbye')
    return ret

#to override a function delivered with bubble, just redefine and register.
#def equal(a,b):
#    r=False
#    if str(a)==str(b):
#        r=True
#    #print('Rule:equal:',a,type(a),b,type(b),'>>>',r)
#    return r


def substring(sub,string):
    r=False
    if str(sub) in str(string):
        r=True
    #print('Rule:substring:',sub,type(sub),string,type(string),'>>>',r)
    return r

def slicing(mystr,start=0,stop=-1,step=1):
    return mystr[int(start):int(stop):int(step)]
    #return str[slice(start,stop,step)]



################################################################################
#register
################################################################################
from bubble.functions import register
#, trace,timer

register(replace_hello_with_goodbye)
register(replace_hello_with_goodbye,'say_goodbye') #alias

#register(equal)
register(substring)
register(slicing)

# this module will imported during the transformation process,
# and all the functions in rule_functions will be added to the transformer
# the functions should return base python types, any other objects,
# will be string represented with repr(object) as value
# you can use all python functions,
# as long as the returned value is json dumpable
"""
    return example
