def get_ammo_generator(self):
af_readers = {<EOL>'<STR_LIT>': missile.AmmoFileReader,<EOL>'<STR_LIT>': missile.SlowLogReader,<EOL>'<STR_LIT>': missile.LineReader,<EOL>'<STR_LIT>': missile.UriReader,<EOL>'<STR_LIT>': missile.UriPostReader,<EOL>'<STR_LIT>': missile.AccessLogReader,<EOL>'<STR_LIT>': missile.CaseLineReader,<EOL>}<EOL>if self.uris and self.ammo_file:<EOL><INDENT>raise StepperConfigurationError(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>elif self.uris:<EOL><INDENT>ammo_gen = missile.UriStyleGenerator(<EOL>self.uris, self.headers, http_ver=self.http_ver)<EOL><DEDENT>elif self.ammo_file:<EOL><INDENT>if self.ammo_type in af_readers:<EOL><INDENT>if self.ammo_type == '<STR_LIT>':<EOL><INDENT>opener = resource.get_opener(self.ammo_file)<EOL>with opener(self.use_cache) as ammo:<EOL><INDENT>try:<EOL><INDENT>if not ammo.next()[<NUM_LIT:0>].isdigit():<EOL><INDENT>self.ammo_type = '<STR_LIT>'<EOL>self.log.info(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>else:<EOL><INDENT>self.log.info(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>except StopIteration:<EOL><INDENT>self.log.exception(<EOL>"<STR_LIT>")<EOL>raise AmmoFileError(<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise NotImplementedError(<EOL>'<STR_LIT>' % self.ammo_type)<EOL><DEDENT>ammo_gen = af_readers[self.ammo_type](<EOL>self.ammo_file, headers=self.headers, http_ver=self.http_ver, use_cache=self.use_cache)<EOL><DEDENT>else:<EOL><INDENT>raise StepperConfigurationError(<EOL>'<STR_LIT>')<EOL><DEDENT>self.log.info("<STR_LIT>" % type(ammo_gen).__name__)<EOL>return ammo_gen<EOL>
return ammo generator