def hex_to_signed(source):
    """Convert a string hex value to a signed hexidecimal value.
    This assumes that source is the proper length, and the sign bit
    is the first bit in the first byte of the correct length.
    hex_to_signed("F") should return -1.
    hex_to_signed("0F") should return 15.
    """
    if not isinstance(source, str):
        raise ValueError('string type required')
    sign_bit_mask = 1 << len(source) * 4 - 1
    other_bits_mask = sign_bit_mask - 1
    value = int(source, 16)
    return -(value & sign_bit_mask) | value & other_bits_mask
