+ return res
+
+def remove_item_from_list(input_list, item):
+ """\
+ Remove all occurences of item from input_list
+
+ :param input_list List: The list to modify
+ :return: The without any item
+ :rtype: List
+ """
+ res = []
+ for elem in input_list:
+ if elem == item:
+ continue
+ res.append(elem)
+ return res
+
+def parse_date(date):
+ """\
+ Transform YYYYMMDD_hhmmss into YYYY-MM-DD hh:mm:ss.
+
+ :param date str: The date to transform
+ :return: The date in the new format
+ :rtype: str
+ """
+ if len(date) != 15:
+ return date
+ res = "%s-%s-%s %s:%s:%s" % (date[0:4],
+ date[4:6],
+ date[6:8],
+ date[9:11],
+ date[11:13],
+ date[13:])
+ return res
+
+def merge_dicts(*dict_args):
+ """\
+ Given any number of dicts, shallow copy and merge into a new dict,
+ precedence goes to key value pairs in latter dicts.
+ """
+ result = {}
+ for dictionary in dict_args:
+ result.update(dictionary)
+ return result
+
+def replace_in_file(filein, strin, strout):
+ """Replace <strin> by <strout> in file <filein>"""
+ shutil.move(filein, filein + "_old")
+ fileout= filein
+ filein = filein + "_old"
+ fin = open(filein, "r")
+ fout = open(fileout, "w")
+ for line in fin:
+ fout.write(line.replace(strin, strout))
+
+def get_property_in_product_cfg(product_cfg, pprty):
+ if not "properties" in product_cfg:
+ return None
+ if not pprty in product_cfg.properties:
+ return None
+ return product_cfg.properties[pprty]
+
+def activate_mesa_property(config):
+ """Add mesa property into application properties
+
+ :param config Config: The global configuration. It must have an application!
+ """
+ # Verify the existence of the file
+ if not 'properties' in config.APPLICATION:
+ config.APPLICATION.addMapping( 'properties', pyconf.Mapping(), None )
+ config.APPLICATION.properties.use_mesa="yes"
+