data/data_collection.py
def _get_reverted_pull_request_info(
            self, pull_request_info: dict) -> Tuple[int, int]:
        """Retrieves the original pull request of the reverted pull request.

        Args:
            pull_request_info: A dict of a pull request information.
        Returns:
            A tuple of two integers indicating the original pull request id,
            and the revert time between the reverted pull request and the
            original pull request.
        """
        body = pull_request_info['body']
        reverted_pull_request_number = 0
        pull_request_revert_time = 0
        pull_request_created_time = to_timestamp(
            pull_request_info['created_at'])

        if body and 'revert' in body.lower():
            matches = re.findall('#[0-9]+', body)
            if not matches or len(matches) == 0:
                return 0, 0
            reverted_pull_request_number = int(re.sub('#', '', matches[0]))
            reverted_pull_request_info = get_pull_request_info(
                self._repo_name, reverted_pull_request_number, self._auth)
            if not reverted_pull_request_info:
                return 0, 0
            reverted_pull_request_created_time = to_timestamp(
                reverted_pull_request_info['created_at'])
            pull_request_revert_time = pull_request_created_time - \
                reverted_pull_request_created_time

        return reverted_pull_request_number, pull_request_revert_time
Retrieves the original pull request of the reverted pull request.

        Args:
            pull_request_info: A dict of a pull request information.
        Returns:
            A tuple of two integers indicating the original pull request id,
            and the revert time between the reverted pull request and the
            original pull request.
        
Retrieves the original pull request of the reverted pull request.
Retrieves the original pull request of the reverted pull request .
def _get_reverted_pull_request_info(
            self, pull_request_info: dict) -> Tuple[int, int]:
        body = pull_request_info['body']
        reverted_pull_request_number = 0
        pull_request_revert_time = 0
        pull_request_created_time = to_timestamp(
            pull_request_info['created_at'])
        if body and 'revert' in body.lower():
            matches = re.findall('#[0-9]+', body)
            if not matches or len(matches) == 0:
                return 0, 0
            reverted_pull_request_number = int(re.sub('#', '', matches[0]))
            reverted_pull_request_info = get_pull_request_info(
                self._repo_name, reverted_pull_request_number, self._auth)
            if not reverted_pull_request_info:
                return 0, 0
            reverted_pull_request_created_time = to_timestamp(
                reverted_pull_request_info['created_at'])
            pull_request_revert_time = pull_request_created_time - \
                reverted_pull_request_created_time
        return reverted_pull_request_number, pull_request_revert_time
def _get_reverted_pull_request_info ( self , pull_request_info : dict ) -> Tuple [ int , int ] : body = pull_request_info [ 'body' ] reverted_pull_request_number = 0 pull_request_revert_time = 0 pull_request_created_time = to_timestamp ( pull_request_info [ 'created_at' ] ) if body and 'revert' in body . lower ( ) : matches = re . findall ( '#[0-9]+' , body ) if not matches or len ( matches ) == 0 : return 0 , 0 reverted_pull_request_number = int ( re . sub ( '#' , '' , matches [ 0 ] ) ) reverted_pull_request_info = get_pull_request_info ( self . _repo_name , reverted_pull_request_number , self . _auth ) if not reverted_pull_request_info : return 0 , 0 reverted_pull_request_created_time = to_timestamp ( reverted_pull_request_info [ 'created_at' ] ) pull_request_revert_time = pull_request_created_time - reverted_pull_request_created_time return reverted_pull_request_number , pull_request_revert_time
Retrieves the original pull request of the reverted pull request.
Retrieves the original pull request of the reverted pull request .
"""Retrieves the original pull request of the reverted pull request.

        Args:
            pull_request_info: A dict of a pull request information.
        Returns:
            A tuple of two integers indicating the original pull request id,
            and the revert time between the reverted pull request and the
            original pull request.
        """
A tuple of two integers indicating the original pull request id,
and the revert time between the reverted pull request and the
original pull request.
A tuple of two integers indicating the original pull request id and the revert time between the reverted pull request and the original pull request .
self
pull_request_info
dict
A dict of a pull request information.
A dict of a pull request information .