<s> from __future__ import ( absolute_import , division , generators , nested_scopes , print_function , <EOL> unicode_literals , with_statement ) <EOL> import six <EOL> from pants . build_graph . address import Address <EOL> class IntermediateTargetFactoryBase ( object ) : <EOL> """<STR_LIT>""" <EOL> class ExpectedAddressError ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , parse_context ) : <EOL> self . _parse_context = parse_context <EOL> self . __index = <NUM_LIT:0> <EOL> @ property <EOL> def extra_target_arguments ( self ) : <EOL> """<STR_LIT>""" <EOL> return { } <EOL> def __call__ ( self , address ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( address , six . string_types ) : <EOL> raise self . ExpectedAddressError ( "<STR_LIT>" <EOL> . format ( type ( address ) ) ) <EOL> address = Address . parse ( address , self . _parse_context . rel_path ) <EOL> self . __index += <NUM_LIT:1> <EOL> name = '<STR_LIT>' . format ( <EOL> name = address . target_name , <EOL> index = self . __index , <EOL> ) <EOL> self . _parse_context . create_object ( <EOL> '<STR_LIT:target>' , <EOL> name = name , <EOL> dependencies = [ address . spec ] , <EOL> ** self . extra_target_arguments <EOL> ) <EOL> return '<STR_LIT>' . format ( name ) <EOL> class IntransitiveDependencyFactory ( IntermediateTargetFactoryBase ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def extra_target_arguments ( self ) : <EOL> return dict ( _transitive = False ) <EOL> class ProvidedDependencyFactory ( IntermediateTargetFactoryBase ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def extra_target_arguments ( self ) : <EOL> return dict ( _transitive = False , scope = '<STR_LIT>' ) </s>
