def METHOD_NAME(regions, policy_config):
    if 'all' in regions:
        session_factory = SessionFactory(
            region='us-east-1',
            assume_role=policy_config.assume_role,
            profile=policy_config.profile,
            external_id=policy_config.external_id)
        client = session_factory().client('ec2')
        return [region['RegionName'] for region in client.describe_regions()['Regions']]
    return regions