You should not hash the string "0102030405060701". What you actually need to do is hash the bytes which are represented by that hexadecimal value in your code.
You may use the code which is mentioned below:
>>> import hashlib
>>> import binascii
You should note that hashing the string directly won't fetch what you are seeking. You should convert the string to binary using unhexlify in Solidity.