def assign_to_portfolio(self, portfolio_name, loan_id, order_id):
response = None<EOL>assert type(loan_id) == type(order_id), "<STR_LIT>"<EOL>assert type(loan_id) in (int, list), "<STR_LIT>"<EOL>assert type(loan_id) is int or (type(loan_id) is list and len(loan_id) == len(order_id)), "<STR_LIT>"<EOL>post = {<EOL>'<STR_LIT>': loan_id,<EOL>'<STR_LIT>': loan_id,<EOL>'<STR_LIT>': order_id<EOL>}<EOL>query = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': portfolio_name<EOL>}<EOL>existing = self.get_portfolio_list()<EOL>for folio in existing:<EOL><INDENT>if folio['<STR_LIT>'] == portfolio_name:<EOL><INDENT>query['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT><DEDENT>response = self.session.post('<STR_LIT>', query=query, data=post)<EOL>json_response = response.json()<EOL>if not self.session.json_success(json_response):<EOL><INDENT>raise LendingClubError('<STR_LIT>'.format(portfolio_name), response)<EOL><DEDENT>else:<EOL><INDENT>if '<STR_LIT>' in json_response and json_response['<STR_LIT>'] != portfolio_name:<EOL><INDENT>raise LendingClubError('<STR_LIT>'.format(json_response['<STR_LIT>'], portfolio_name))<EOL><DEDENT>else:<EOL><INDENT>self.__log('<STR_LIT>'.format(portfolio_name))<EOL><DEDENT>return True<EOL><DEDENT>return False<EOL>
Assign a note to a named portfolio. `loan_id` and `order_id` can be either
integer values or lists. If choosing lists, they both **MUST** be the same length
and line up. For example, `order_id[5]` must be the order ID for `loan_id[5]`

Parameters
----------
portfolio_name : string
    The name of the portfolio to assign a the loan note to -- new or existing
loan_id : int or list
    The loan ID, or list of loan IDs, to assign to the portfolio
order_id : int or list
    The order ID, or list of order IDs, that this loan note was invested with.
    You can find this in the dict returned from `get_note()`

Returns
-------
boolean
    True on success