def _describe_source(d):
 path = (d.get('path') or '')
 if (('num_lines' in d) and ('start_line' in d)):
  if (d['num_lines'] == 1):
   return ('line %d of %s' % ((d['start_line'] + 1), path))
  else:
   return ('lines %d-%d of %s' % ((d['start_line'] + 1), (d['start_line'] + d['num_lines']), path))
 else:
  return path

def _describe_source ( d ) : path = ( d . get ( 'path' ) or '' ) if ( ( 'num_lines' in d ) and ( 'start_line' in d ) ) : if ( d [ 'num_lines' ] == 1 ) : return ( 'line %d of %s' % ( ( d [ 'start_line' ] + 1 ) , path ) ) else : return ( 'lines %d-%d of %s' % ( ( d [ 'start_line' ] + 1 ) , ( d [ 'start_line' ] + d [ 'num_lines' ] ) , path ) ) else : return path
return either <path> or line n of <path> or lines m-n of <path> .