<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _GetDatabaseAccount(self):
 """Gets the database account first by using the default endpoint, and if that doesn't returns use the endpoints for the preferred locations in the order they are specified to get the database account. """

        try:
            database_account = self._GetDatabaseAccountStub(self.DefaultEndpoint)
            return database_account
        # If for any reason(non-globaldb related), we are not able to get the database account from the above call to GetDatabaseAccount,
        # we would try to get this information from any of the preferred locations that the user might have specified(by creating a locational endpoint)
        # and keeping eating the exception until we get the database account and return None at the end, if we are not able to get that info from any endpoints
        except errors.HTTPFailure:
            for location_name in self.PreferredLocations:
                locational_endpoint = _GlobalEndpointManager.GetLocationalEndpoint(self.DefaultEndpoint, location_name)
                try:
                    database_account = self._GetDatabaseAccountStub(locational_endpoint)
                    return database_account
                except errors.HTTPFailure:
                    pass

            return None