def get_blocks(time=None, pool_name=None, api_code=None):
resource = '<STR_LIT>'<EOL>if api_code is not None:<EOL><INDENT>resource += '<STR_LIT>' + api_code<EOL><DEDENT>if time is not None:<EOL><INDENT>resource = resource.format(time)<EOL><DEDENT>elif pool_name is not None:<EOL><INDENT>resource = resource.format(pool_name)<EOL><DEDENT>else:<EOL><INDENT>resource = resource.format('<STR_LIT>')<EOL><DEDENT>response = util.call_api(resource)<EOL>json_response = json.loads(response)<EOL>return [SimpleBlock(b) for b in json_response['<STR_LIT>']]<EOL>
Get a list of blocks for a specific day or mining pool.
    Both parameters are optional but at least one is required.

    :param int time: time in milliseconds
    :param str pool_name: name of the mining pool
    :param str api_code: Blockchain.info API code (optional)
    :return: an array of :class:`SimpleBlock` objects