def process_document(document, client):

    """
    Calls the Amazon Textract analyze_document function and returns a dictionary with the
    results.

    Args:
        document (.png, .jpeg): image of a single-page document to be passed to textract.
        client (Client Object): A low - level interface to AWS returned by class cloudClientFactory

    Returns:
        dict: A dictionary containing information of all the elements analyzed in the document
        by textextract.
    """
    

    # Get the document from local machine
    with open(document, 'rb') as doc:
        docBytes = bytearray(doc.read())

    # Analyze the document
    response = client.analyze_document(Document={'Bytes': docBytes},
                                       FeatureTypes=["FORMS"])
    
    # with open('output_module.json', 'w') as out:
    #     json.dump(response, out, indent=6)
    return response