def get_ldev(obj):
 if (not obj):
  return None
 ldev = obj.get('provider_location')
 if ((not ldev) or (not ldev.isdigit())):
  return None
 return int(ldev)

def get_ldev ( obj ) : if ( not obj ) : return None ldev = obj . get ( 'provider_location' ) if ( ( not ldev ) or ( not ldev . isdigit ( ) ) ) : return None return int ( ldev )
get the ldev number from the given object and return it as integer .