def brackets_insanity_check(p_string):
if p_string.count(FORK_TOKEN) != p_string.count(CLOSE_TOKEN):<EOL><INDENT>dict_values = {<EOL>FORK_TOKEN: p_string.count(FORK_TOKEN),<EOL>CLOSE_TOKEN: p_string.count(CLOSE_TOKEN)<EOL>}<EOL>max_bracket = max(dict_values, key=dict_values.get)<EOL>raise SanityError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>str(abs(<EOL>p_string.count(FORK_TOKEN) - p_string.count(CLOSE_TOKEN))),<EOL>max_bracket))<EOL><DEDENT>
This function performs a check for different number of '(' and ')'
characters, which indicates that some forks are poorly constructed.

Parameters
----------
p_string: str
     String with the definition of the pipeline, e.g.::
         'processA processB processC(ProcessD | ProcessE)'