def _resource_endpoint(object_uri):
 obj_parts = object_uri.split('/')
 plural_endpoint = ((len(obj_parts) % 2) == 0)
 if plural_endpoint:
  obj_parts = obj_parts[:(-1)]
 if (len(obj_parts) <= 2):
  return ('', False)
 resource_name = obj_parts[(-2)]
 resource_name = resource_name.rstrip('s')
 return (resource_name, plural_endpoint)

def _resource_endpoint ( object_uri ) : obj_parts = object_uri . split ( '/' ) plural_endpoint = ( ( len ( obj_parts ) % 2 ) == 0 ) if plural_endpoint : obj_parts = obj_parts [ : ( - 1 ) ] if ( len ( obj_parts ) <= 2 ) : return ( '' , False ) resource_name = obj_parts [ ( - 2 ) ] resource_name = resource_name . rstrip ( 's' ) return ( resource_name , plural_endpoint )
determine the resource name and whether it is the plural endpoint from the specified object_uri .