<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def services(doc):
 """View for getting services"""

    for service_id, service in doc.get('services', {}).items():
        service_type = service.get('service_type')
        org = doc['_id']
        service['id'] = service_id
        service['organisation_id'] = org

        yield service_id, service
        yield [service_type, org], service
        yield [service_type, None], service
        yield [None, org], service
        yield [None, None], service