The _fromutc function is designed to take a timezone-aware datetime object that is in a specific timezone and convert it to a new timezone by calculating the associated timezone-aware datetime in the destination timezone. This function is crucial for handling timezone conversions accurately, especially during ambiguous timestamp situations such as Daylight Saving Time changes.
Task Description:
Functionality: Implement the _fromutc function to take in a timezone-aware datetime.datetime object. It should ensure that the provided datetime has a valid UTC offset and DST (Daylight Saving Time) value, and then apply the appropriate calculations to return a new timezone-aware datetime.
Input: The function accepts a parameter dt that must be a timezone-aware datetime.datetime object. It is expected that this datetime has valid UTC offset and DST values.
Output: The function returns a timezone-aware datetime.datetime that reflects the new timezone based on the calculations performed from the input dt.
Edge Cases: The function must handle cases where:
The passed datetime object has a None value for UTC offset or DST, raising ValueError.
Ensure the correct handling of ambiguous dates that may fall within the daylight savings transition.
Note: The solution should be placed in /app/solution.py. The function must be importable as: from solution import _fromutc.