def main():

    import argparse

    parser = argparse.ArgumentParser()

    parser.add_argument('--pig', default='tk')
    parser.add_argument('--wave')
    parser.add_argument('--gallery', nargs='*', default=['.', '../gallery'])
    parser.add_argument('--images', default=False, action='store_true')

    parser.add_argument('--thresh', type=float, default=10.0)

    parser.add_argument('--monitor', action='store_true')
    parser.add_argument('--nomon', action='store_false', default=True)
    parser.add_argument('--words', default='diceware.wordlist.asc')
    parser.add_argument(
        '--files',
        nargs='+',
        default=__file__)
    parser.add_argument('--nomick', action='store_true')
    parser.add_argument('--sense', action='store_true',
                        help="if you have a sense hat")

    parser.add_argument('--path')

    args = parser.parse_args()

    # import from pig stuff here, after talking to joy
    from karmapi import joy
    joy.set_backend(args.pig)


    from karmapi import piglet
    from karmapi import widgets
    from karmapi import sonogram

    # what's this doing here?
    #import tkinter

    farm = pigfarm.PigFarm()

    print('building farm')
    farm.status()
    from karmapi.mclock2 import GuidoClock
    from karmapi.tankrain import TankRain
    from karmapi import diceware as dice
    from karmapi import talk

    if args.monitor:
        from karmapi import milk
        farm.add(milk.Curio)

    images = [
        dict(image='climate_karma_pi_and_jupyter.png', title=''),
        dict(image='gil_ly_.png', title=''),
        dict(image='princess_cricket.jpg', title='Princess Cricket'),
        dict(image='fork_in_road.jpg', title='Fork in the Road'),
        dict(image='tree_of_hearts.jpg', title='Tree of Hearts'),
        #dict(image='chess.jpg', title='Branching'),
        dict(image='lock.jpg', title='Global Interpreter Lock'),
        dict(image='air_water.jpg', title='async def(): await run()'),
        dict(image='venus.jpg', title='Jupyter')]


    from karmapi import sunny, noddy

    farm.files = args.files

    print('galleries', args.gallery)

    im_info = dict(galleries=args.gallery)

    if args.images:
        for im in images:
            im_info.update(im)
            farm.add(piglet.Image, im_info.copy())


    words = Path(args.words)
    if words.exists():
        words = words.open()
    else:
        words = None

    data = None
    if args.path:
        path = Path(args.path)
        if path.exists():
            data = base.load_folder(path)