<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def get_topic_attributes(TopicArn, region=None, key=None, keyid=None, profile=None):
    '''
    Returns all of the properties of a topic.  Topic properties returned might differ based on the
    authorization of the user.

    CLI example::

        salt myminion boto3_sns.get_topic_attributes someTopic region=us-west-1
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        return conn.get_topic_attributes(TopicArn=TopicArn).get('Attributes')
    except botocore.exceptions.ClientError as e:
        log.error('Failed to garner attributes for SNS topic %s: %s', TopicArn, e)
        return None