<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_branch_info(self):
 """ Retrieve branch_info from Satellite Server """

        branch_info = None
        if os.path.exists(constants.cached_branch_info):
            # use cached branch info file if less than 10 minutes old
            #  (failsafe, should be deleted at end of client run normally)
            logger.debug(u'Reading branch info from cached file.')
            ctime = datetime.utcfromtimestamp(
                os.path.getctime(constants.cached_branch_info))
            if datetime.utcnow() < (ctime + timedelta(minutes=5)):
                with io.open(constants.cached_branch_info, encoding='utf8', mode='r') as f:
                    branch_info = json.load(f)
                return branch_info
            else:
                logger.debug(u'Cached branch info is older than 5 minutes.')

        logger.debug(u'Obtaining branch information from %s',
                     self.branch_info_url)
        net_logger.info(u'GET %s', self.branch_info_url)
        response = self.session.get(self.branch_info_url,
                                    timeout=self.config.http_timeout)
        logger.debug(u'GET branch_info status: %s', response.status_code)
        if response.status_code != 200:
            logger.debug("There was an error obtaining branch information.")
            logger.debug(u'Bad status from server: %s', response.status_code)
            logger.debug("Assuming default branch information %s" % self.branch_info)
            return False

        branch_info = response.json()
        logger.debug(u'Branch information: %s', json.dumps(branch_info))

        # Determine if we are connected to Satellite 5
        if ((branch_info[u'remote_branch'] is not -1 and
             branch_info[u'remote_leaf'] is -1)):
            self.get_satellite5_info(branch_info)

        logger.debug(u'Saving branch info to file.')
        with io.open(constants.cached_branch_info, encoding='utf8', mode='w') as f:
            # json.dump is broke in py2 so use dumps
            bi_str = json.dumps(branch_info, ensure_ascii=False)
            f.write(bi_str)
        self.branch_info = branch_info
        return branch_info