human
I wrote the below code

    purchased_courses = PaidCourseRegistration.objects.filter(Q(course_id=course_id), (Q(status='purchased') | Q(status='refunded'))).order_by('order')
    purchased_course_reg_codes = CourseRegCodeItem.objects.filter(Q(course_id=course_id), (Q(status='purchased') | Q(status='refunded'))).order_by('order')
    def sale_order_info(purchased_course, features):
        '\n                                convert    purchase    transactions    to    dictionary\n                                '
        sale_order_features = [x for x in SALE_ORDER_FEATURES if (x in features)]
        order_item_features = [x for x in ORDER_ITEM_FEATURES if (x in features)]
        sale_order_dict = dict(((feature, getattr(purchased_course.order, feature)) for feature in sale_order_features))
        quantity = int(purchased_course.qty)
        unit_cost = float(purchased_course.unit_cost)
        sale_order_dict.update({'quantity': quantity})
        sale_order_dict.update({'total_amount': (quantity * unit_cost)})
        sale_order_dict.update({'logged_in_username': purchased_course.order.user.username})
        sale_order_dict.update({'logged_in_email': purchased_course.order.user.email})
        order_item_dict = dict(((feature, getattr(purchased_course, feature, None)) for feature in order_item_features))
        order_item_dict['list_price'] = purchased_course.get_list_price()
        sale_order_dict.update({'total_discount': ((order_item_dict['list_price'] - order_item_dict['unit_cost']) * quantity)})
        order_item_dict.update({'coupon_code': 'N/A'})
        coupon_redemption = CouponRedemption.objects.select_related('coupon').filter(order_id=purchased_course.order_id)
        if coupon_redemption.exists():
            coupon_codes = [redemption.coupon.code for redemption in coupon_redemption]
            order_item_dict.update({'coupon_code': ',    '.join(coupon_codes)})
        sale_order_dict.update(dict(order_item_dict.items()))
        return sale_order_dict
    csv_data = [sale_order_info(purchased_course,...

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def sale_order_record_features(course_id, features):