@staticmethod<EOL><INDENT>def _calc_hash(op, args, keywords):<DEDENT>
args_tup = tuple(a if type(a) in (int, float) else hash(a) for a in args)<EOL>to_hash = (<EOL>op, args_tup,<EOL>str(keywords.get('<STR_LIT>', None)),<EOL>hash(keywords['<STR_LIT>']),<EOL>keywords['<STR_LIT>'],<EOL>hash(keywords.get('<STR_LIT>', None)),<EOL>)<EOL>hd = hashlib.md5(pickle.dumps(to_hash, -<NUM_LIT:1>)).digest()<EOL>return md5_unpacker.unpack(hd)[<NUM_LIT:0>]<EOL>
Calculates the hash of an AST, given the operation, args, and kwargs.

:param op:          The operation.
:param args:        The arguments to the operation.
:param keywords:    A dict including the 'symbolic', 'variables', and 'length' items.
:returns:           a hash.

We do it using md5 to avoid hash collisions.
(hash(-1) == hash(-2), for example)