def _prepare_args(target_log_prob_fn, state, step_size,<EOL>target_log_prob=None, maybe_expand=False,<EOL>description='<STR_LIT>'):
state_parts = list(state) if mcmc_util.is_list_like(state) else [state]<EOL>state_parts = [<EOL>tf.convert_to_tensor(value=s, name='<STR_LIT>') for s in state_parts<EOL>]<EOL>target_log_prob = _maybe_call_fn(<EOL>target_log_prob_fn,<EOL>state_parts,<EOL>target_log_prob,<EOL>description)<EOL>step_sizes = (list(step_size) if mcmc_util.is_list_like(step_size)<EOL>else [step_size])<EOL>step_sizes = [<EOL>tf.convert_to_tensor(<EOL>value=s, name='<STR_LIT>', dtype=target_log_prob.dtype)<EOL>for s in step_sizes<EOL>]<EOL>if len(step_sizes) == <NUM_LIT:1>:<EOL><INDENT>step_sizes *= len(state_parts)<EOL><DEDENT>if len(state_parts) != len(step_sizes):<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>def maybe_flatten(x):<EOL><INDENT>return x if maybe_expand or mcmc_util.is_list_like(state) else x[<NUM_LIT:0>]<EOL><DEDENT>return [<EOL>maybe_flatten(state_parts),<EOL>maybe_flatten(step_sizes),<EOL>target_log_prob<EOL>]<EOL>
Processes input args to meet list-like assumptions.