# Path: openelex/tasks/validate.py
# def run_validation(state, validators):
#     passed = []
#     failed = []
#     print()
#     for validator in validators:
#         try:
#             validator()
#             passed.append(validator.__name__)
#         except Exception as e:
#             failed.append("Error: %s - %s - %s" %
#                           (state.upper(), validator.__name__, e))
# 
#     print("\n\nVALIDATION RESULTS")
#     print("Passed: %s" % len(passed))
#     print("Failed: %s" % len(failed))
#     for fail in failed:
#         print("\t%s" % fail)
#     print()
# 
# Path: openelex/tasks/utils.py
# def load_module(state, mod_list=[]):
#     """Dynamically load modules for states
# 
#     USAGE
# 
#        mod = load_module(state, ['datasource', 'loader'])
#        mod.datasource.Datasource()
# 
#     """
#     return __import__('openelex.us.%s' % state.lower(), fromlist=mod_list)
# 
# def split_args(raw_args, separator=','):
#     """Helper for parsing command-line options"""
#     return [func_name.strip() for func_name in raw_args.split(separator)]


import sys
import click
from .validate import run_validation
from .utils import load_module, split_args
from __future__ import print_function
from __future__ import absolute_import




@click.command(name='transform.list', help="Show available data transformations")
@click.option('--state', required=True, help="Two-letter state postal, e.g. NY")
@click.option('--raw', is_flag=True, help="List raw transforms")

# Path: openelex/tasks/validate.py
# def run_validation(state, validators):
#     passed = []
#     failed = []
#     print()
#     for validator in validators:
#         try:
#             validator()
#             passed.append(validator.__name__)
#         except Exception as e:
#             failed.append("Error: %s - %s - %s" %
#                           (state.upper(), validator.__name__, e))
# 
#     print("\n\nVALIDATION RESULTS")
#     print("Passed: %s" % len(passed))
#     print("Failed: %s" % len(failed))
#     for fail in failed:
#         print("\t%s" % fail)
#     print()
# 
# Path: openelex/tasks/utils.py
# def load_module(state, mod_list=[]):
#     """Dynamically load modules for states
# 
#     USAGE
# 
#        mod = load_module(state, ['datasource', 'loader'])
#        mod.datasource.Datasource()
# 
#     """
#     return __import__('openelex.us.%s' % state.lower(), fromlist=mod_list)
# 
# def split_args(raw_args, separator=','):
#     """Helper for parsing command-line options"""
#     return [func_name.strip() for func_name in raw_args.split(separator)]


# Path: openelex/tasks/transform.py
import sys
import click
from .validate import run_validation
from .utils import load_module, split_args

from __future__ import print_function
from __future__ import absolute_import




@click.command(name='transform.list', help="Show available data transformations")
@click.option('--state', required=True, help="Two-letter state postal, e.g. NY")
@click.option('--raw', is_flag=True, help="List raw transforms")

def list(state, raw=False):