def post_grade(course, assignment, student, score):
    "Takes a course object, an assignment name, student id, and score to upload. Posts to Canvas.\n\n    Example:\n    course.post_grades(dsci100, 'worksheet_01', '23423', 10)"
    assignment_id = get_assignment_id(course, assignment)
    url_post_path = posixpath.join('api', 'v1', 'courses', course['course_id'], 'assignments', assignment_id, 'submissions', student)
    api_url = urllib.parse.urljoin(course['hostname'], url_post_path)
    token = course['token']
    resp = requests.put(url=urllib.parse.urljoin(api_url, student), headers={'Authorization': f'Bearer {token}', 'Accept': 'application/json+canvas-string-ids'}, json={'submission': {'posted_grade': score}})
Takes a course object, an assignment name, student id, and score to upload. Posts to Canvas.

Example:
course.post_grades(dsci100, 'worksheet_01', '23423', 10)
def post_grade(course, assignment, student, score):
    "Takes a course object, an assignment name, student id, and score to upload. Posts to Canvas.\n\n    Example:\n    course.post_grades(dsci100, 'worksheet_01', '23423', 10)"
    assignment_id = get_assignment_id(course, assignment)
    url_post_path = posixpath.join('api', 'v1', 'courses', course['course_id'], 'assignments', assignment_id, 'submissions', student)
    api_url = urllib.parse.urljoin(course['hostname'], url_post_path)
    token = course['token']
    resp = requests.put(url=urllib.parse.urljoin(api_url, student), headers={'Authorization': f'Bearer {token}', 'Accept': 'application/json+canvas-string-ids'}, json={'submission': {'posted_grade': score}})