def gather_hinting(config, rules, valid_paths):
hinting = collections.defaultdict(list)<EOL>for rule in rules:<EOL><INDENT>root, name = rule.code_path.split('<STR_LIT::>', <NUM_LIT:1>)<EOL>info = valid_paths[root][name]<EOL>if info['<STR_LIT>']:<EOL><INDENT>result = info['<STR_LIT>'](config=config, **rule.arguments)<EOL>if rule.negated and not info['<STR_LIT>']:<EOL><INDENT>continue<EOL><DEDENT>for key, values in result.items():<EOL><INDENT>key = '<STR_LIT>' + key if rule.negated else key<EOL>hinting[key].extend(values)<EOL><DEDENT><DEDENT>for key, value in info['<STR_LIT>'].items():<EOL><INDENT>if rule.negated and not info['<STR_LIT>']:<EOL><INDENT>continue<EOL><DEDENT>key = '<STR_LIT>' + key if rule.negated else key<EOL>hinting[key] += value<EOL><DEDENT><DEDENT>log.debug('<STR_LIT>', hinting)<EOL>return hinting<EOL>
Construct hint arguments for datanommer from a list of rules.