<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_property(device_path: Union[Path, str], property_name: str) -> str: """Gets the given property for a device."""

    with open(str(Path(device_path, property_name))) as file:
        return file.readline().strip()