def add_batch(self, loans, batch_amount=None):
assert batch_amount is None or batch_amount % <NUM_LIT> == <NUM_LIT:0>, '<STR_LIT>'<EOL>assert type(loans) is list, '<STR_LIT>'.format(type(loans))<EOL>for loan in loans:<EOL><INDENT>loan_id = loan<EOL>amount = batch_amount<EOL>if type(loan) is dict:<EOL><INDENT>assert '<STR_LIT>' in loan, '<STR_LIT>'<EOL>assert batch_amount or '<STR_LIT>' in loan, '<STR_LIT>'.format(loan['<STR_LIT>'])<EOL>loan_id = loan['<STR_LIT>']<EOL>if amount is None and '<STR_LIT>' in loan:<EOL><INDENT>amount = loan['<STR_LIT>']<EOL><DEDENT><DEDENT>assert amount is not None, '<STR_LIT>'.format(loan_id)<EOL>assert amount % <NUM_LIT> == <NUM_LIT:0>, '<STR_LIT>'.format(loan_id)<EOL>self.add(loan_id, amount)<EOL><DEDENT>
Add a batch of loans to your order.

Parameters
----------
loans : list
    A list of dictionary objects representing each loan and the amount you want to invest in it (see examples below).
batch_amount : int, optional
    The dollar amount you want to set on ALL loans in this batch.
    **NOTE:** This will override the invest_amount value for each loan.

Examples
--------
Each item in the loans list can either be a loan ID OR a dictionary object containing `loan_id` and
`invest_amount` values. The invest_amount value is the dollar amount you wish to invest in this loan.

**List of IDs**::

    # Invest $50 in 3 loans
    order.add_batch([1234, 2345, 3456], 50)

**List of Dictionaries**::

    # Invest different amounts in each loans
    order.add_batch([
        {'loan_id': 1234, invest_amount: 50},
        {'loan_id': 2345, invest_amount: 25},
        {'loan_id': 3456, invest_amount: 150}
    ])