def create_linkextractor_from_specs(specs):
 specs = specs.copy()
 (ltype, value) = (specs.pop('type'), specs.pop('value'))
 if (ltype == 'module'):
  cls = load_object(value)
  return cls(**specs)
 for (key, cls, ignore) in _TYPE_MAP:
  if (key == ltype):
   if ignore:
    return cls(**specs)
   return cls(value, **specs)
 raise ValueError('Invalid link extractor type specification')

def create_linkextractor_from_specs ( specs ) : specs = specs . copy ( ) ( ltype , value ) = ( specs . pop ( 'type' ) , specs . pop ( 'value' ) ) if ( ltype == 'module' ) : cls = load_object ( value ) return cls ( ** specs ) for ( key , cls , ignore ) in _TYPE_MAP : if ( key == ltype ) : if ignore : return cls ( ** specs ) return cls ( value , ** specs ) raise ValueError ( 'Invalid link extractor type specification' )
return a link extractor instance from specs .