def get(self):
<EOL>result = {}<EOL>if self.algorithm in self.valid_algorithms:<EOL><INDENT>if self.algorithm == "<STR_LIT:all>":<EOL><INDENT>del self.valid_algorithms[<NUM_LIT:0>]<EOL>for algo in self.valid_algorithms:<EOL><INDENT>if self.path and path.isfile(self.path):<EOL><INDENT>result[algo] = self._hash_file(algo)<EOL><DEDENT>elif self.data:<EOL><INDENT>result[algo] = self._hash_data(algo)<EOL><DEDENT>else:  <EOL><INDENT>return None<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if self.path and path.isfile(self.path):<EOL><INDENT>result[self.algorithm] = self._hash_file(self.algorithm)<EOL><DEDENT>elif self.data:<EOL><INDENT>result[self.algorithm] = self._hash_data(self.algorithm)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT><DEDENT><DEDENT>else:  <EOL><INDENT>return None<EOL><DEDENT>if self.algorithm != "<STR_LIT:all>" and self.only_hash:<EOL><INDENT>return result[self.algorithm]<EOL><DEDENT>return result<EOL>
Return the hash of the given file