<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def proxy_callback_allowed(service, pgturl):
 """Check if a given proxy callback is allowed for the given service identifier."""

    if hasattr(settings, 'MAMA_CAS_SERVICES'):
        return _is_allowed('proxy_callback_allowed', service, pgturl)
    return _is_valid_service_url(service)