@staticmethod
    def _create_scoped_credentials(credentials, scope):
        if credentials:
            try:
                if credentials.create_scoped_required():
                    credentials = credentials.create_scoped(scope)
            except AttributeError:
                pass
        return credentials
Create a scoped set of credentials if it is required.
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/connection.py/Connection._create_scoped_credentials