<s> import os . path <EOL> import sys <EOL> import click <EOL> from . utils import default_state_options , load_module <EOL> @ click . command ( name = '<STR_LIT>' , help = "<STR_LIT>" ) <EOL> @ default_state_options <EOL> @ click . argument ( '<STR_LIT>' , nargs = - <NUM_LIT:1> ) <EOL> def run ( state , datefilter = '<STR_LIT>' , filenames = [ ] ) : <EOL> """<STR_LIT>""" <EOL> state_mod = load_module ( state , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> datasrc = state_mod . datasource . Datasource ( ) <EOL> loader = state_mod . load . LoadResults ( ) <EOL> if datefilter and len ( filenames ) : <EOL> sys . stderr . write ( "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> if len ( filenames ) : <EOL> mappings = [ datasrc . mapping_for_file ( os . path . basename ( fn ) ) <EOL> for fn in filenames ] <EOL> else : <EOL> mappings = datasrc . mappings ( datefilter ) <EOL> for mapping in mappings : <EOL> loader . run ( mapping ) </s>
