def check_hexsha(hex, error_msg):
 if (not valid_hexsha(hex)):
  raise ObjectFormatException(('%s %s' % (error_msg, hex)))

def check_hexsha ( hex , error_msg ) : if ( not valid_hexsha ( hex ) ) : raise ObjectFormatException ( ( '%s %s' % ( error_msg , hex ) ) )
check if a string is a valid hex sha string .