human
Write me a Python code to test if optional passed.
assistant
Here is a Python code to test if optional passed

import argparse

def args_test(args, optional=None):
    """Returns a list of the arguments provided to the function."""
    if optional is None:
        return args
    else:
        return args + [optional]

# Enter the arguments
args = ['-a', '1', '-b', '2']

# Calling the function
print((args_test(args)))

#Example Output
# ['-a', '1', '-b', '2']

#Remember to inspect code for bugs.