<s> """<STR_LIT>""" <EOL> def LVMPathSpecGetVolumeIndex ( path_spec ) : <EOL> """<STR_LIT>""" <EOL> volume_index = getattr ( path_spec , u'<STR_LIT>' , None ) <EOL> if volume_index is None : <EOL> location = getattr ( path_spec , u'<STR_LIT:location>' , None ) <EOL> if location is None or not location . startswith ( u'<STR_LIT>' ) : <EOL> return <EOL> volume_index = None <EOL> try : <EOL> volume_index = int ( location [ <NUM_LIT:4> : ] , <NUM_LIT:10> ) - <NUM_LIT:1> <EOL> except ValueError : <EOL> pass <EOL> if volume_index is None or volume_index < <NUM_LIT:0> : <EOL> return <EOL> return volume_index </s>
