@classmethod<EOL><INDENT>def get_partition_name(cls, region=None):<DEDENT>
if region is None:<EOL><INDENT>region = boto3.session.Session().region_name<EOL><DEDENT>region_string = region.lower()<EOL>if region_string.startswith("<STR_LIT>"):<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>elif region_string.startswith("<STR_LIT>"):<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>
Gets the name of the partition given the region name. If region name is not provided, this method will
use Boto3 to get name of the region where this code is running.

This implementation is borrowed from AWS CLI
https://github.com/aws/aws-cli/blob/1.11.139/awscli/customizations/emr/createdefaultroles.py#L59

:param region: Optional name of the region
:return: Partition name