'Load the local zappa_settings file.
An existing boto session can be supplied, though this is likely for testing purposes.
Returns the loaded Zappa object.'

def load_settings(self, settings_file=None, session=None):

    if (not settings_file):
        settings_file = self.get_json_or_yaml_settings()
    if (not os.path.isfile(settings_file)):
        raise ClickException(u'Please    configure    your    zappa_settings    file.')
    self.load_settings_file(settings_file)
    for stage_name in self.zappa_settings.keys():
        try:
            self.check_stage_name(stage_name)
        except ValueError:
            raise ValueError(u"API    stage    names    must    match    a-zA-Z0-9_    ;    '{0!s}'    does    not.".format(stage_name))
    if (self.api_stage not in self.zappa_settings.keys()):
        raise ClickException(u"Please    define    stage    '{0!s}'    in    your    Zappa    settings.".format(self.api_stage))
    if (u'project_name' in self.stage_config):
        self.project_name = validate_name(self.stage_config[u'project_name'])
    else:
        self.project_name = slugify.slugify(os.getcwd().split(os.sep)[(-1)])[:15]
    self.lambda_name = slugify.slugify(((self.project_name + u'-') + self.api_stage))
    self.s3_bucket_name = self.stage_config.get(u's3_bucket', (u'zappa-' + u''.join((random.choice((string.ascii_lowercase + string.digits)) for _ in range(9)))))
    self.vpc_config = self.stage_config.get(u'vpc_config', {})
    self.memory_size = self.stage_config.get(u'memory_size', 512)
    self.app_function = self.stage_config.get(u'app_function', None)
    self.exception_handler = self.stage_config.get(u'exception_handler', None)
    self.aws_region = self.stage_config.get(u'aws_region', None)
    self.debug = self.stage_config.get(u'debug', True)
    self.prebuild_script = self.stage_config.get(u'prebuild_script', None)
    self.profile_name = self.stage_config.get(u'profile_name', None)
    self.log_level = self.stage_config.get(u'log_level', u'DEBUG')
    self.domain = self.stage_config.get(u'domain', None)
    self.timeout_seconds = self.stage_config.get(u'timeout_seconds', 30)
    dead_letter_arn = self.stage_config.get(u'dead_letter_arn', u'')
    self.dead_letter_config = ({u'TargetArn': dead_letter_arn} if dead_letter_arn else {})
    self.use_apigateway = self.stage_config.get(u'use_apigateway', True)
    if self.use_apigateway:
        self.use_apigateway = self.stage_config.get(u'apigateway_enabled', True)
    self.apigateway_description = self.stage_config.get(u'apigateway_description', None)
    self.lambda_handler = self.stage_config.get(u'lambda_handler', u'handler.lambda_handler')
    self.remote_env_bucket = self.stage_config.get(u'remote_env_bucket', None)
    self.remote_env_file = self.stage_config.get(u'remote_env_file', None)
    self.remote_env = self.stage_config.get(u'remote_env', None)
    self.settings_file = self.stage_config.get(u'settings_file', None)
    self.django_settings = self.stage_config.get(u'django_settings', None)
    self.manage_roles = self.stage_config.get(u'manage_roles', True)
    self.binary_support = self.stage_config.get(u'binary_support', True)
    self.api_key_required = self.stage_config.get(u'api_key_required', False)
    self.api_key = self.stage_config.get(u'api_key')
    self.iam_authorization = self.stage_config.get(u'iam_authorization', False)
    self.cors = self.stage_config.get(u'cors', False)
    self.lambda_description = self.stage_config.get(u'lambda_description', u'Zappa    Deployment')
    self.environment_variables = self.stage_config.get(u'environment_variables', {})
    self.aws_environment_variables = self.stage_config.get(u'aws_environment_variables', {})
    self.check_environment(self.environment_variables)
    self.authorizer = self.stage_config.get(u'authorizer', {})
    self.runtime = self.stage_config.get(u'runtime', get_runtime_from_python_version())
    self.aws_kms_key_arn = self.stage_config.get(u'aws_kms_key_arn', u'')
    self.context_header_mappings = self.stage_config.get(u'context_header_mappings', {})
    desired_role_name = (self.lambda_name + u'-ZappaLambdaExecutionRole')
    self.zappa = Zappa(boto_session=session, profile_name=self.profile_name, aws_region=self.aws_region, load_credentials=self.load_credentials, desired_role_name=desired_role_name, runtime=self.runtime)
    for setting in CUSTOM_SETTINGS:
        if (setting in self.stage_config):
            setting_val = self.stage_config[setting]
            if setting.endswith(u'policy'):
                with open(setting_val, u'r') as f:
                    setting_val = f.read()
            setattr(self.zappa, setting, setting_val)
    if self.app_function:
        self.collision_warning(self.app_function)
        if (self.app_function[(-3):] == u'.py'):
            click.echo((((click.style(u'Warning!', fg=u'red', bold=True) + u'    Your    app_function    is    pointing    to    a    ') + click.style(u'file    and    not    a    function', bold=True)) + u"!    It    should    probably    be    something    like    'my_file.app',    not    'my_file.py'!"))
    return self.zappa
