fda0e0e7d1399a404788c33d19677c4a22583138,src/sagemaker/session.py,Session,__init__,#Session#Any#Any#Any#,59

Before Change


                If not provided, one will be created using this instance"s ``boto_session``.
        
        self._default_bucket = None
        self.boto_session = boto_session or boto3.Session()

        region = self.boto_session.region_name
        if region is None:
            raise ValueError("Must setup local AWS configuration with a region supported by SageMaker.")

        self.sagemaker_client = sagemaker_client or self.boto_session.client("sagemaker")
        prepend_user_agent(self.sagemaker_client)

        self.sagemaker_runtime_client = sagemaker_runtime_client or self.boto_session.client("runtime.sagemaker")
        prepend_user_agent(self.sagemaker_runtime_client)

        sagemaker_config_file = os.path.join(os.path.expanduser("~"), ".sagemaker", "config.yaml")
        if os.path.exists(sagemaker_config_file):

After Change


    a naming convention which includes the current AWS account ID.
    

    def __init__(self, boto_session=None, sagemaker_client=None, sagemaker_runtime_client=None):
        Initialize a SageMaker ``Session``.

        Args:
            boto_session (boto3.session.Session): The underlying Boto3 session which AWS service calls
                are delegated to (default: None). If not provided, one is created with default AWS configuration chain.
            sagemaker_client (boto3.SageMaker.Client): Client which makes Amazon SageMaker service calls other
                than ``InvokeEndpoint`` (default: None). Estimators created using this ``Session`` use this client.
                If not provided, one will be created using this instance"s ``boto_session``.
            sagemaker_runtime_client (boto3.SageMakerRuntime.Client): Client which makes ``InvokeEndpoint``
                calls to Amazon SageMaker (default: None). Predictors created using this ``Session`` use this client.
                If not provided, one will be created using this instance"s ``boto_session``.
        
        self._default_bucket = None

        sagemaker_config_file = os.path.join(os.path.expanduser("~"), ".sagemaker", "config.yaml")
        if os.path.exists(sagemaker_config_file):
            self.config = yaml.load(open(sagemaker_config_file, "r"))
        else:
            self.config = None

        self._initialize(boto_session, sagemaker_client, sagemaker_runtime_client)

    def _initialize(self, boto_session, sagemaker_client, sagemaker_runtime_client):
        Initialize this SageMaker Session.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: aws/sagemaker-python-sdk
Commit Name: fda0e0e7d1399a404788c33d19677c4a22583138
Time: 2018-05-10
Author: nacho950@gmail.com
File Name: src/sagemaker/session.py
Class Name: Session
Method Name: __init__


Project Name: maciejkula/spotlight
Commit Name: b0d50f3cccf54888ed59292f3213bea9b2f15dcf
Time: 2017-07-31
Author: ethanrosenthal@gmail.com
File Name: spotlight/factorization/explicit.py
Class Name: ExplicitFactorizationModel
Method Name: fit


Project Name: aws/sagemaker-python-sdk
Commit Name: fda0e0e7d1399a404788c33d19677c4a22583138
Time: 2018-05-10
Author: nacho950@gmail.com
File Name: src/sagemaker/session.py
Class Name: Session
Method Name: __init__


Project Name: maciejkula/spotlight
Commit Name: b0d50f3cccf54888ed59292f3213bea9b2f15dcf
Time: 2017-07-31
Author: ethanrosenthal@gmail.com
File Name: spotlight/factorization/implicit.py
Class Name: ImplicitFactorizationModel
Method Name: fit