def _encode_hex_secret(self, secret):
    """Encodes a hex secret.

    Args:
      secret: The hex code string displayed by the Google TV.

    Returns:
      Binary encoded form of hex secret
    """
    result = bytearray(len(secret) / 2)
    for i in xrange(len(result)):
      start_index = 2 * i
      end_index = 2 * (i + 1)
      result[i] = int(secret[start_index:end_index], 16)
    return bytes(result)
dataset/ETHPy150Open stevenle/googletv-anymote/googletv/__init__.py/PairingProtocol._encode_hex_secret/original