def get_bundle(self, bundle_id=None):
        # type: (Union[Bundle, int]) -> Bundle
        """
        Retrieves the :class:`~pelix.framework.Bundle` object for the bundle
        matching the given ID (int). If no ID is given (None), the bundle
        associated to this context is returned.

        :param bundle_id: A bundle ID (optional)
        :return: The requested :class:`~pelix.framework.Bundle` object
        :raise BundleException: The given ID doesn't exist or is invalid
        """
        if bundle_id is None:
            # Current bundle
            return self.__bundle
        elif isinstance(bundle_id, Bundle):
            # Got a bundle (compatibility with older install_bundle())
            bundle_id = bundle_id.get_bundle_id()

        return self.__framework.get_bundle_by_id(bundle_id)
def get_bundle ( self , bundle_id = None ) : if bundle_id is None : return self . __bundle elif isinstance ( bundle_id , Bundle ) : bundle_id = bundle_id . get_bundle_id ( ) return self . __framework . get_bundle_by_id ( bundle_id )
Retrieves the :class:`~pelix.framework.Bundle` object for the bundle
        matching the given ID (int). If no ID is given (None), the bundle
        associated to this context is returned.

        :param bundle_id: A bundle ID (optional)
        :return: The requested :class:`~pelix.framework.Bundle` object
        :raise BundleException: The given ID doesn't exist or is invalid