<commit_before><?php
namespace Aws\Signature;

use Aws\Credentials\CredentialsInterface;
use Aws\Service\S3\S3UriParser;
use GuzzleHttp\Message\RequestInterface;

/**
 * Default Amazon S3 signature implementation
 * @link http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
 */
class S3Signature implements PresignedUrlInterface
{
    /** @var array Query string values that must be signed */
    protected $signableQueryString = ['acl', 'cors', 'delete', 'lifecycle',
        'location', 'logging', 'notification', 'partNumber', 'policy',
        'requestPayment', 'response-cache-control', 'response-content-disposition',
        'response-content-encoding', 'response-content-language',
        'response-content-type', 'response-expires', 'restore', 'tagging',
        'torrent', 'uploadId', 'uploads', 'versionId', 'versioning',
        'versions', 'website'];

    /** @var array Sorted headers that must be signed */
    private $signableHeaders = ['Content-MD5', 'Content-Type'];

    /** @var \Aws\Service\S3\S3UriParser S3 URI parser */
    private $parser;

    public function __construct()
    {
        $this->parser = new S3UriParser();
    }

    public function signRequest(
        RequestInterface $request,
        CredentialsInterface $credentials
    ) {
        // Ensure that the signable query string parameters are sorted
        sort($this->signableQueryString);

        // Add the security token header if one is being used by the credentials
        if ($token = $credentials->getSecurityToken()) {
            $request->setHeader('X-Amz-Security-Token', $token);
        }<commit_msg>Cleaning up S3<commit_after><?php
namespace Aws\Signature;

use Aws\Credentials\CredentialsInterface;
use Aws\Service\S3\S3UriParser;
use GuzzleHttp\Message\RequestInterface;

/**
 * Default Amazon S3 signature implementation
 * @link http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
 */
class S3Signature implements PresignedUrlInterface
{
    /** @var array Query string values that must be signed */
    private $signableQueryString = [
        'acl', 'cors', 'delete', 'lifecycle', 'location', 'logging',
        'notification', 'partNumber', 'policy', 'requestPayment',
        'response-cache-control', 'response-content-disposition',
        'response-content-encoding', 'response-content-language',
        'response-content-type', 'response-expires', 'restore', 'tagging',
        'torrent', 'uploadId', 'uploads', 'versionId', 'versioning',
        'versions', 'website'
    ];

    /** @var array Sorted headers that must be signed */
    private $signableHeaders = ['Content-MD5', 'Content-Type'];

    /** @var \Aws\Service\S3\S3UriParser S3 URI parser */
    private $parser;

    public function __construct()
    {
        $this->parser = new S3UriParser();
    }

    public function signRequest(
        RequestInterface $request,
        CredentialsInterface $credentials
    ) {
        // Ensure that the signable query string parameters are sorted
        sort($this->signableQueryString);

        // Add the security token header if one is being used by the credentials
        if ($token = $credentials->getSecurityToken()) {
            $request->setHeader('X-Amz-Security-Token', $token);
        }
{'fraction_non_alphanumeric': 0.13044803413593417, 'fraction_numerical': 0.006400487656202377, 'mean_word_length': 3.33553500660502, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5691691', 'n_tokens_mistral': 911, 'n_tokens_neox': 902, 'n_words': 234}