def compile_masks(masks):
if not masks:<EOL><INDENT>masks = []<EOL><DEDENT>elif not isinstance(masks, (list, tuple)):<EOL><INDENT>masks = [masks]<EOL><DEDENT>return [<EOL>re.compile(mask)<EOL>for mask in masks<EOL>]<EOL>
Compiles a list of regular expressions.

:param masks: the regular expressions to compile
:type masks: list(str) or str
:returns: list(regular expression object)