@param string $pr

@return \Bitbucket\Api\Repositories\Users\PullRequests\Statuses
199770
public function statuses(string $pr)
    {
        return new Statuses($this->getHttpClient(), $this->username, $this->repo, $pr);
    }
799842
public function fget($remote)
    {
        if ($remote == '' || substr($remote, 0, 1) !== '/') {
            $remote = $this->dir . '/' . $remote;
        }
        $this->errorHandler->start();
        if (($handle = $this->driver->sftpFopen($this->resource, $remote, 'r+')) !== false) {
            rewind($handle);
            $this->errorHandler->stop();

            return $handle;
        }
        $this->errorHandler->stop();

        return false;
    }
807489
public function getStatistics($status)
    {
        $qb = $this->createQueryBuilder('q');
        $qb->select('SUBSTRING(q.job, 1, 200) AS class');
        $qb->where($qb->expr()->eq('q.status', $qb->expr()->literal($status)));

        $result = $qb->getQuery()->getScalarResult();

        $stats = [];
        foreach ($result as $item) {
            if (!preg_match('/"(.+?)"/', $item['class'], $match)) {
                continue;
            }
            $class = $match[1];
            if (!isset($stats[$class])) {
                $stats[$class] = 0;
            }
            ++$stats[$class];
        }

        return $stats;
    }
765160
public function decline(string $pr, array $params = [])
    {
        $path = $this->buildPullRequestsPath($pr, 'decline');

        return $this->post($path, $params);
    }
1282795
protected function filterStatus($status)
    {
        if (!is_integer($status) ||
            $status<StatusCode::HTTP_CONTINUE ||
            $status>StatusCode::HTTP_NETWORK_CONNECTION_TIMEOUT_ERROR
        ) {
            throw new InvalidArgumentException('Invalid HTTP status code');
        }

        return $status;
    }
822827
public function bitbucket($projectId)
    {
        $project = $this->fetchProject($projectId, 'bitbucket');
    
        // Support both old services and new webhooks
        if ($payload = $this->getParam('payload')) {
            return $this->bitbucketService(json_decode($payload, true), $project);
        }

        $payload = json_decode(file_get_contents("php://input"), true);

        if (empty($payload['push']['changes'])) {
            // Invalid event from bitbucket
            return [
                'status' => 'failed',
                'commits' => []
            ];
        }

        return $this->bitbucketWebhook($payload, $project);
    }
1003691
public function activityByPr(string $pr, array $params = [])
    {
        $path = $this->buildPullRequestsPath($pr, 'activity');

        return $this->get($path, $params);
    }
1051157
public function diff(string $pr)
    {
        return new Diff($this->getHttpClient(), $this->username, $this->repo, $pr);
    }
1308973
def get_pr(pr_num, config=None, repo=DEFAULT_REPO, raw=False):
    
    response = requests.get(PR_ENDPOINT.format(repo, pr_num), auth=get_auth_info(config))

    if raw:
        return response
    else:
        response.raise_for_status()
        return response.json()
472521
async function getPr(prNo) {
  const pr = (await api.get(
    `/2.0/repositories/${config.repository}/pullrequests/${prNo}`
  )).body;

  // istanbul ignore if
  if (!pr) {
    return null;
  }

  const res = {
    displayNumber: `Pull Request #${pr.id}`,
    ...utils.prInfo(pr),
  };

  if (utils.prStates.open.includes(pr.state)) {
    res.isConflicted = await isPrConflicted(prNo);
    const commits = await utils.accumulateValues(pr.links.commits.href);
    if (commits.length === 1) {
      res.canRebase = true;
    }
  }
  if (await branchExists(pr.source.branch.name)) {
    res.isStale = await isBranchStale(pr.source.branch.name);
  }

  return res;
}
299969
protected function aggregateStatus($candidates)
    {
        $filteredCandidates = [];
        foreach ($candidates as $candidate) {
            if (array_search($candidate->getCode(), $this->statusOrder) !== false) {
                $filteredCandidates[] = $candidate;
            }
        }

        if (count($filteredCandidates) === 0) {
            return new Status(Status::UNKNOWN);
        }

        usort($filteredCandidates, [$this, 'statusComparator']);

        return $filteredCandidates[0];
    }
900366
protected function ApiStatus2InternalStatus($status)
    {
        switch ($status) {
            case Api::Success:
                return self::Status_Success;
            case Api::Errors:
                return self::Status_Errors;
            case Api::Warnings:
                return self::Status_Warnings;
            case Api::Exception:
            default:
                return self::Status_Exception;
        }
    }
1345899
public function status($status = null) {
			if ($status != null) {
				if (array_key_exists($status, $this->_statusCode)) {
					$this->_status = $status;
				}

				return true;
			}
			else {
				return $this->_status;
			}
		}
983298
public function patch(string $pr)
    {
        return new Patch($this->getHttpClient(), $this->username, $this->repo, $pr);
    }
127469
public function getStatusClass($status)
    {
        switch ($status) {
            case static::Status_Success:
                $result = 'success';
                break;
            case static::Status_Info:
                $result = 'info';
                break;
            case static::Status_Warning:
                $result = 'warning';
                break;
            case static::Status_Error:
            default:
                $result = 'error';
                break;
        }
        return $result;
    }
167560
protected function getStatusFromProvider( $provider){
        $service = sprintf( self::API_CONNECTION_DDNS_STATUS, $provider);
        $rest = $this->getService( $service);
        $rest->GET();

        return $rest->getResult( models\Connection\DynDns\Status::class);
    }
353080
def get_pr_info(requester, reponame, number):
    ""
    resp = requester.get(
        'https://api.github.com/repos/%s/pulls/%s' % (reponame, number))
    return PRInfo(resp.json())