def get_object(network, name):
    """
    Get object from network.

    Get object based on the name provided.

    Args:
        network: The network from where the data should be found.
        name: Name indicating the object being searched for.

    Returns:
        The found object.

    """
    if name == "network":
        return network.service.data_manager.network
    elif name == "device":
        return network.service.data_manager.network.devices[0]
    elif name == "value":
        return network.service.data_manager.network.devices[0].values[0]
    elif name == "control_state":
        return network.service.data_manager.network.devices[0].values[0].get_control_state()
    elif name == "report_state":
        return network.service.data_manager.network.devices[0].values[0].get_report_state()
    return None