def parse_args(args):
    """Parses and validates command line arguments

    Args:
        args (argparse.Namespace): Pre-paresed command line arguments

    Returns:
        bool: verbose flag, indicates whether tag frequency dictionary should be printed
        bool: sandbox flag, indicates whether Evernote API calls should be made against the production or sandbox environment
        str: name of the file the tag cloud image should be saved to
        int: width of the tag cloud image
        int: height of the tag cloud image
        file: mask file to use when generating the tag cloud
        str: font file to use when generating the tag cloud
        int: maximum number of tags to include in the tag cloud
        int: ratio of horizontal tags in the tag cloud
        int: the impact of tag frequency (as opposed to tag ranking) on tag size
        str: the name of a matplotlib colormap to use for tag colors (see https://matplotlib.org/examples/color/colormaps_reference.html for available colormaps)
        str: the Evernote API authentication token

    Raises:
        ValueError: if numeric parameters have an invalid value
    """
    image_width_height = args.imageSize.split("x")
    if len(image_width_height) != 2:
        raise ValueError("invalid imageSize [%s] format, expected format is <width>x<height>", args.imageSize)

    image_width, image_height = int(image_width_height[0]), int(image_width_height[1])
    if image_width not in range(10, 10000):
        raise ValueError("invalid imageSize.width [%d], imageSize.width must be between 10 and 9999", image_width)

    if image_height not in range(10, 10000):
        raise ValueError("invalid imageSize.height [%d], imageSize.height must be between 10 and 9999", image_height)

    if args.maxTags not in range(1, 1000):
        raise ValueError("invalid maxTags [%d], maxTags must be between 1 and 999", args.maxTags)

    if args.horizontalTags < 0 or args.horizontalTags > 1 :
        raise ValueError("invalid horizontalTags [%f], horizontalTags must be between 0 and 1", args.horizontalTags)

    if args.tagScaling < 0 or args.tagScaling > 1:
        raise ValueError("invalid tagScaling [%f], tagScaling must be between 0 and 1", args.horizontalTags)

    font_file = None if args.fontFile == None else args.fontFile.name

    return args.verbose, args.sandbox, args.imageFile.name, image_width, image_height, args.maskFile, font_file, args.maxTags, args.horizontalTags, args.tagScaling, args.tagColorScheme, args.evernoteAuthToken