def location_to_string(locationID):
 loc = ['{}-'.format((locationID >> 24))]
 while (locationID & 15728640):
  if (len(loc) > 1):
   loc.append('.')
  loc.append('{}'.format(((locationID >> 20) & 15)))
  locationID <<= 4
 return ''.join(loc)

def location_to_string ( locationID ) : loc = [ '{}-' . format ( ( locationID >> 24 ) ) ] while ( locationID & 15728640 ) : if ( len ( loc ) > 1 ) : loc . append ( '.' ) loc . append ( '{}' . format ( ( ( locationID >> 20 ) & 15 ) ) ) locationID <<= 4 return '' . join ( loc )
helper to calculate port and bus number from locationid .