<commit_before># coding: utf-8

# Copyright (c) 2015, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.

import session as session_handler
from tornado_botocore import Botocore
from tornado.concurrent import return_future
from thumbor.utils import logger


class Bucket(object):
    """
    This handles all communication with AWS API
    """
    _bucket      = None
    _region      = None
    _endopint    = None
    _local_cache = dict()

    def __init__(self, bucket, region, endpoint):
        """
        Constructor
        :param string bucket: The bucket name
        :param string region: The AWS API region to use
        :param string endpoint: A specific endpoint to use
        :return: The created bucket
        """
        self._bucket = bucket
        self._region = region
        self._endpoint = endpoint

    @return_future
    def get(self, path, callback=None):
        """
        Returns object at given path
        :param string path: Path or 'key' to retrieve AWS object
        :param callable callback: Callback function for once the retrieval is done
        """
        my_session = session_handler.get_session(self._endpoint)
        session = Botocore(service='s3', region_name=self._region,
                           operation='GetObject', session=my_session,
                           endpoint_url=self._endpoint)<commit_msg>Fix typo<commit_after># coding: utf-8

# Copyright (c) 2015, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.

import session as session_handler
from tornado_botocore import Botocore
from tornado.concurrent import return_future
from thumbor.utils import logger


class Bucket(object):
    """
    This handles all communication with AWS API
    """
    _bucket      = None
    _region      = None
    _endpoint    = None
    _local_cache = dict()

    def __init__(self, bucket, region, endpoint):
        """
        Constructor
        :param string bucket: The bucket name
        :param string region: The AWS API region to use
        :param string endpoint: A specific endpoint to use
        :return: The created bucket
        """
        self._bucket = bucket
        self._region = region
        self._endpoint = endpoint

    @return_future
    def get(self, path, callback=None):
        """
        Returns object at given path
        :param string path: Path or 'key' to retrieve AWS object
        :param callable callback: Callback function for once the retrieval is done
        """
        my_session = session_handler.get_session(self._endpoint)
        session = Botocore(service='s3', region_name=self._region,
                           operation='GetObject', session=my_session,
                           endpoint_url=self._endpoint)
{'fraction_non_alphanumeric': 0.06930346517325867, 'fraction_numerical': 0.004200210010500525, 'mean_word_length': 2.4350961538461537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5681275', 'n_tokens_mistral': 741, 'n_tokens_neox': 719, 'n_words': 274}