code: def uncompress(pub):
      '''
      Input must be hex string, and a valid compressed public key.
      Check if it's a valid key first, using the validatepubkey()
      function below, and then verify that the str len is 66.
      '''
  
      yp = int(pub[:2],16) - 2
      x = int(pub[2:],16)
      a = (pow_mod(x,3,P) + 7) % P
      y = pow_mod(a, (P+1)//4, P)
      if y % 2 != yp:
          y = -y % P
      x = dechex(x,32)
      y = dechex(y,32)
      return '04' + x + f uncompress(pub):
      '''
      Input must be hex string, and a valid compressed public key.
      Check if it's a valid key first, using the validatepubkey()
      function below, and then verify that the str len is 66.
      '''
  
      yp = int(pub[:2],16) - 2
      x = int(pub[2:],16)
      a = (pow_mod(x,3,P) + 7) % P
      y = pow_mod(a, (P+1)//4, P)
      if y % 2 != yp:
          y = -y % P
      x = dechex(x,32)
      y = dechex(y,32)
      return '04' + x + y
docs: Input must be hex string, and a valid compressed public key.
      Check if it's a valid key first, using the validatepubkey()
      function below, and then verify that the str len is 66.