def METHOD_NAME(locations):
    dept_ids = []
    for location in str(locations).split(','):
        if location:
            location = int(location)
            department_id = job_location_to_department_id.get(location)
            if department_id:
                dept_ids.append(department_id)
    return dept_ids