def _choice(prompt, valid_values=None, file_exists=False, optional=False):

    choice = input(prompt).strip()
    if optional and choice == "":
        return None

    if valid_values is not None:
        while choice not in valid_values:
            print(choice + " is not a valid option.")
            choice = input(prompt).strip()
            if optional and choice == "":
                return None
    elif file_exists:
        while not os.path.isfile(choice):
            print("File " + choice + " does not exist.")
            choice = input(prompt).strip()
            if optional and choice == "":
                return None
        return os.path.abspath(choice)

    return choice
A method used to help prompt the user for input and validate user input. If
dataset/ETHPy150Open ibm-security-intelligence/api-samples/modules/config.py/_choice