<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_chart(chart_type, time_span=None, rolling_average=None, api_code=None):
 """Get chart data of a specific chart type. :param str chart_type: type of chart :param str time_span: duration of the chart. Default is 1 year for most charts, 1 week for mempool charts (optional) (Example: 5weeks) :param str rolling_average: duration over which the data should be averaged (optional) :param str api_code: Blockchain.info API code (optional) :return: an instance of :class:`Chart` class """


    resource = 'charts/' + chart_type + '?format=json'
    if time_span is not None:
        resource += '&timespan=' + time_span
    if rolling_average is not None:
        resource += '&rollingAverage=' + rolling_average
    if api_code is not None:
        resource += '&api_code=' + api_code
    response = util.call_api(resource)
    json_response = json.loads(response)
    return Chart(json_response)