def _format_range_context(start, stop):
 beginning = (start + 1)
 length = (stop - start)
 if (not length):
  beginning -= 1
 if (length <= 1):
  return '{}'.format(beginning)
 return '{},{}'.format(beginning, ((beginning + length) - 1))

def _format_range_context ( start , stop ) : beginning = ( start + 1 ) length = ( stop - start ) if ( not length ) : beginning -= 1 if ( length <= 1 ) : return '{}' . format ( beginning ) return '{},{}' . format ( beginning , ( ( beginning + length ) - 1 ) )
convert range to the "ed" format .