{"id":1561,"date":"2023-03-25T11:26:10","date_gmt":"2023-03-25T03:26:10","guid":{"rendered":""},"modified":"2023-03-25T11:26:10","modified_gmt":"2023-03-25T03:26:10","slug":"Python\u722c\u866b\u591a\u7ebf\u7a0b","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/1561.html","title":{"rendered":"Python\u722c\u866b\u591a\u7ebf\u7a0b"},"content":{"rendered":"


\n <\/head>
\n <\/p>\n

\n

Python\u722c\u866b\u591a\u7ebf\u7a0b<\/h1>\n

Python \u591a\u7ebf\u7a0b\u8be6\u7ec6\u6559\u7a0b<\/span>\n <\/div>\n

Python\u591a\u7ebf\u7a0b<\/h2>\n
\n \u722c\u866b\u5982\u679c\u8981\u9ad8\u6548\uff0c\u80af\u5b9a\u4f1a\u7528\u5230\u591a\u7ebf\u7a0b\uff0c\u591a\u7ebf\u7a0b\u548c\u5355\u7ebf\u7a0b\u76f8\u6bd4\u76f8\u5f53\u4e8e\u628a\u4efb\u52a1\u5206\u89e3\u5230\u591a\u4e2a\u4eba\u540c\u65f6\u6267\u884c\uff0c\u5982\u4eca\u51e0\u4e4e\u5927\u591a\u6570\u7684\u7535\u8111\u548c\u670d\u52a1\u5668CPU\u90fd\u662f\u591a\u6838\u7684\uff0c\u6240\u4ee5\u591a\u7ebf\u7a0b\u89e3\u51b3\u4e86\u5f88\u5927\u7684\u6548\u7387\u95ee\u9898\u3002\n <\/div>\n
\n \u4f46\u662f\u548cJava\u4e0d\u540c\u7684\u662f\uff0cPython\u4ee3\u7801\u5728\u89e3\u91ca\u5668\u6267\u884c\u4e2d\uff0c\u540c\u4e00\u65f6\u523b\u53ea\u80fd\u6709\u4e00\u4e2a\u4e3b\u7ebf\u7a0b\u6267\u884c\uff0c\u50cf\u5728\u5355CPU\u7684\u7535\u8111\u4e0a\u8fd0\u884c\u591a\u4e2a\u8fdb\u7a0b\u90a3\u6837\u3002\u5185\u5b58\u8fd8\u662f\u53ef\u4ee5\u5b58\u653e\u591a\u4e2a\u7a0b\u5e8f\u7684\u3002\u8fd9\u662f\u7531\u4e8ePython\u7684\u8bbf\u95ee\u7531\u5168\u5c40\u89e3\u91ca\u5668\u9501\uff08GIL\uff09\u63a7\u5236\u7684\uff0c\u8fd9\u4e2a\u9501\u4fdd\u8bc1\u540c\u65f6\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u5728\u8fd0\u884c\u3002\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\uff0cPython\u865a\u62df\u673a\u6267\u884c\u6d41\u7a0b\u5982\u4e0b\uff1a\n <\/div>\n

1\u3001\u8bbe\u7f6eGIL\u3002<\/span>
\n 2\u3001\u5207\u6362\u5230\u4e00\u4e2a\u7ebf\u7a0b\u53bb\u6267\u884c\u3002<\/span>
\n 3\u3001\u8fd0\u884c\u3002<\/span>
\n 4\u3001\u628a\u7ebf\u7a0b\u8bbe\u7f6e\u4e3a\u7761\u7720\u72b6\u6001\u3002<\/span>
\n 5\u3001\u89e3\u9501GIL\u3002<\/span>
\n 6\u3001\u518d\u6b21\u91cd\u590d\u4ee5\u4e0a\u6b65\u9aa4\u3002<\/span> <\/p>\n

\n \u6240\u4ee5\u4ece\u67d0\u79cd\u610f\u4e49\u4e0a\u8bf4Python\u7684\u591a\u7ebf\u7a0b\u5f88\u9e21\u808b\uff0c\u5176\u5b9e\u5c31\u662f\u56e0\u4e3aPython\u591a\u7ebf\u7a0b\u7528\u5230\u4e86\u5168\u5c40\u89e3\u91ca\u5668\u9501\uff08GIL\u9501\uff09\u3002\u4e0d\u7ba1\u5982\u4f55\u6211\u4eec\u4e0b\u9762\u6765\u8bb2\u89e3\u4e0b\uff0cPython\u591a\u7ebf\u7a0b\u5728\u722c\u866b\u4e2d\u7684\u5e94\u7528\u3002\n <\/div>\n
\n \u63a8\u8350\u9605\u8bfb\uff1a
\n Python\u591a\u7ebf\u7a0b\u6559\u7a0b\n <\/div>\n

\u7ebf\u7a0b\u5b89\u5168\u7684\u961f\u5217 Queue<\/h2>\n
\n \u961f\u5217\u662f\u5148\u8fdb\u5148\u51fa\uff0c\u5728Python\u7684\u6807\u51c6\u5e93\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7ebf\u7a0b\u5b89\u5168\u7684\u961f\u5217\u53ef\u7528\u4e8e\u591a\u7ebf\u7a0b\u7684\u5148\u8fdb\u5148\u51fa\uff0c\u53ef\u4ee5\u7528\u6765\u5728\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u7ebf\u7a0b\u4e4b\u95f4\u5b89\u5168\u5730\u4f20\u9012\u6d88\u606f\u6216\u5176\u4ed6\u6570\u636e\u3002Queue \u7684\u5927\u5c0f\uff08\u5176\u4e2d\u5305\u542b\u7684\u5143\u7d20\u4e2a\u6570\uff09\u53ef\u80fd\u8981\u53d7\u9650\uff0c\u4ee5\u9650\u5236\u5185\u5b58\u4f7f\u7528\u6216\u5904\u7406\u3002\n <\/div>\n
\n \u5728Python3\u4e2d\u8981\u5f15\u5165Queue\u548cPython2\u4e2d\u5f15\u5165Queue\u662f\u4e0d\u540c\uff0c\u5f15\u5165\u65b9\u5f0f\u5982\u4e0b\uff1a\n <\/div>\n
\n
 # Filename : example.py<\/span>
# Copyright : 2020 By Lidihuo<\/span>
# Author by : www.lidihuo.com<\/span>
# Date : 2020-09-11<\/span>
#python 2
<\/span> import <\/span>Queue
# python 3
<\/span> from <\/span>queue import <\/span>Queue
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n \u56e0\u4e3a\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c\u5f88\u81ea\u7136\u5c31\u53ef\u4ee5\u5229\u7528Queue\u6765\u5b9e\u73b0\u4e00\u4e2a\u591a\u7ebf\u7a0b\u722c\u866b\u54af\uff0c\u800cQueue\u7684\u4e00\u4e9b\u5e38\u89c1\u64cd\u4f5c\u5982\u4e0b\uff1a\n <\/div>\n
\n
 # Filename : example.py<\/span>
# Copyright : 2020 By Lidihuo<\/span>
# Author by : www.lidihuo.com<\/span>
# Date : 2020-09-11<\/span>
# \u5b9e\u4f8b\u5316\u4e00\u4e2a\u961f\u5217\uff0c\u53ef\u4ee5\u5728\u6307\u5b9a\u961f\u5217\u5927\u5c0f
<\/span> q = Queue.Queue<\/span>()
q_50 = Queue.Queue<\/span>(50) # \u6307\u5b9a\u4e00\u4e2a\u957f\u5ea6\u4e3a50\u7684\u961f\u5217
<\/span> # \u5165\u961f\u4e00\u4e2a\u6570\u636edata
<\/span> q.put<\/span>(data)
# \u51fa\u961f\u5e76\u8d4b\u503c\u7ed9item
<\/span> item = q.get<\/span>()
# \u5224\u65ad\u961f\u5217\u662f\u5426\u4e3a\u7a7a\uff0c\u662f\u5426\u6ee1
<\/span> if <\/span>q.empty<\/span>()\uff1a
    print('\u961f\u5217\u4e3a\u7a7a'<\/span>)
if <\/span>q.full<\/span>():
    print('\u961f\u5217\u6ee1'<\/span>)
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n
 # Filename : example.py<\/span>
# Copyright : 2020 By Lidihuo<\/span>
# Author by : www.lidihuo.com<\/span>
# Date : 2020-08-21<\/span>
from <\/span>pyquery import <\/span>PyQuery as <\/span>pq
doc = pq(filename='example.html'<\/span>)
print doc.html<\/span>()
print type(doc)
li = doc('li'<\/span>)
print type(li)
print li.text<\/span>()
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n \u9664\u4e86\u666e\u901a\u961f\u5217\uff0c\u6807\u51c6\u5e93\u4e2d\u8fd8\u6709\u4f18\u5148\u961f\u5217\u548c\u540e\u8fdb\u5148\u51fa\u961f\u5217\u8fd9\u4e24\u4e2a\u961f\u5217\uff0c\u5206\u522b\u4e3aLifoQueue\u548cPriorityQueue\uff0c\u5176\u5f15\u7528\u65b9\u5f0f\u4e0eQueue\u7c7b\u4f3c\u3002\n <\/div>\n

\u4e09\u3001\u57fa\u4e8e\u591a\u7ebf\u7a0b\u722c\u866b\u722c\u53d6\u7cd7\u4e8b\u767e\u79d1\u7684\u6bb5\u5b50<\/h2>\n
\n \u4e0b\u9762\u8fdb\u5165\u5b9e\u6218\u7684\u4e00\u4e2a\u4ee3\u7801\uff0c\u4ee3\u7801\u7684\u7406\u89e3\u4e5f\u76f8\u5bf9\u7b80\u5355\uff0c\u76f8\u4fe1\u7ecf\u8fc7\u8fd9\u4e2a\u4ee3\u7801\uff0c\u5927\u5bb6\u4e5f\u53ef\u4ee5\u81ea\u884c\u5199\u51fa\u4e00\u4e2a\u591a\u7ebf\u7a0b\u722c\u866b\u3002\n <\/div>\n
\n \u5b9e\u73b0\u601d\u8def\u548c\u6574\u4f53\u6d41\u7a0b\n <\/div>\n

1\u3001\u6784\u9020\u4efb\u52a1\u961f\u5217pageQueue \uff0c\u5b58\u653e\u6240\u6709\u8981\u722c\u53d6\u7684\u9875\u9762url\u3002<\/span>
\n 2\u3001\u7528\u591a\u7ebf\u7a0b\u722c\u866b\u4ece\u7cd7\u4e8b\u767e\u79d1\u4e0a\u6293\u53d6\u7cd7\u4e8b\uff0c\u7136\u540e\u5c06\u6293\u53d6\u7684\u9875\u9762\u5185\u5bb9\u5b58\u653e\u5230data_queue\u4e2d<\/span>
\n 3\u3001\u7528\u591a\u7ebf\u7a0b\u7a0b\u5e8f\u5bf9data_queue\u4e2d\u7684\u9875\u9762\u5185\u5bb9\u8fdb\u884c\u89e3\u6790\uff0c\u5206\u522b\u63d0\u53d6 \u7cd7\u4e8b\u7684\u56fe\u7247url\uff0c\u7cd7\u4e8b\u7684\u9898\u76ee\u548c\u7cd7\u4e8b\u5185\u5bb9\uff0c\u7136\u540e\u5b58\u653e\u5230\u7684json\u6587\u4ef6\u4e2d\uff08\u4e00\u4e2a\u65f6\u95f4\u70b9\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u53ef\u4ee5\u5199\u6587\u4ef6IO,\u6ce8\u610f\u5230Python\u7684\u591a\u7ebf\u7a0b\u673a\u5236\u4f7f\u7528\u4e86GIL\u9501\uff09 <\/span> <\/p>\n

\n
 # Filename : example.py<\/span>
# Copyright : 2020 By Lidihuo<\/span>
# Author by : www.lidihuo.com<\/span>
# Date : 2020-09-11<\/span>
import <\/span>requests
from <\/span>lxml import <\/span>etree
from <\/span>queue import <\/span>Queue
import <\/span>threading
import <\/span>json
''<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span>'
Queue.qsize<\/span>(\u961f\u5217\u540d) #\u8fd4\u56de\u961f\u5217\u7684\u5927\u5c0f
<\/span> Queue.empty<\/span>(\u961f\u5217\u540d) # \u961f\u5217\u4e3a\u7a7a\u8fd4\u56detrue\uff0c\u5426\u5219\u4e3afalse
<\/span> Queue.full<\/span>(\u961f\u5217\u540d) # \u961f\u5217\u6ee1\u8fd4\u56detrue
<\/span> Queue.get<\/span>(\u961f\u5217\u540d,\u503c) # \u51fa\u961f
<\/span> Queue.put<\/span>(\u961f\u5217\u540d,\u503c) # \u5165\u961f
<\/span> FIFO \u5148\u8fdb\u5148\u51fa
'''
class <\/span>Crawl_thread(threading.Thread):
    '''
    \u6293\u53d6\u7ebf\u7a0b\u7c7b\uff0c\u6ce8\u610f\u9700\u8981\u7ee7\u627f\u7ebf\u7a0b\u7c7bThread
    '''
    def <\/span>__init__(self,thread_id,queue):
        threading.Thread.__init__<\/span>(self) # \u9700\u8981\u5bf9\u7236\u7c7b\u7684\u6784\u9020\u51fd\u6570\u8fdb\u884c\u521d\u59cb\u5316
<\/span>         self.thread_id = thread_id
        self.queue = queue # \u4efb\u52a1\u961f\u5217
<\/span>     def <\/span>run(self):
        '''
        \u7ebf\u7a0b\u5728\u8c03\u7528\u8fc7\u7a0b\u4e2d\u5c31\u4f1a\u8c03\u7528\u5bf9\u5e94\u7684run\u65b9\u6cd5
        :return:
        '''
        print('\u542f\u52a8\u7ebf\u7a0b\uff1a'<\/span><\/span>,self.thread_id)
        self.crawl_spider<\/span>()
        print('\u9000\u51fa\u4e86\u8be5\u7ebf\u7a0b\uff1a'<\/span><\/span>,self.thread_id)
    def <\/span>crawl_spider(self):
        while True<\/span>:
            if <\/span>self.queue.empty<\/span>(): #\u5982\u679c\u961f\u5217\u4e3a\u7a7a\uff0c\u5219\u8df3\u51fa
<\/span>                 break
            else:<\/span>
                page = self.queue.get<\/span>()
                print('\u5f53\u524d\u5de5\u4f5c\u7684\u7ebf\u7a0b\u4e3a\uff1a'<\/span>,self.thread_id,\" \u6b63\u5728\u91c7\u96c6\uff1a\"<\/span>,page)
                url = 'https:\/\/www.qiushibaike.com\/Shr\/page\/{}\/'<\/span>.format<\/span>(str(page))
                headers = {
                    'User-Agent'<\/span>:'Mozilla\/5.0 <\/span>(Windows NT 6.1) AppleWebKit\/537.36 <\/span>(KHTML, like Gecko) Chrome\/67.0.3371.0 Safari\/537.36'<\/span>
                }
                try:
                    content = requests.get<\/span>(url,headers=headers)
                    data_queue.put<\/span>(content.text) # \u5c06\u91c7\u96c6\u7684\u7ed3\u679c\u653e\u5165data_queue\u4e2d
<\/span>                 except <\/span>Exception as <\/span>e:
                    print('\u91c7\u96c6\u7ebf\u7a0b\u9519\u8bef'<\/span>,e)
class <\/span>Parser_thread(threading.Thread):
    '''
    \u89e3\u6790\u7f51\u9875\u7684\u7c7b\uff0c\u5c31\u662f\u5bf9\u91c7\u96c6\u7ed3\u679c\u8fdb\u884c\u89e3\u6790\uff0c\u4e5f\u662f\u591a\u7ebf\u7a0b\u65b9\u5f0f\u8fdb\u884c\u89e3\u6790
    '''
    def <\/span>__init__(self,thread_id,queue,file):
        threading.Thread.__init__<\/span>(self)
        self.thread_id = thread_id
        self.queue = queue
        self.file = file
    def <\/span>run(self):
        print('\u542f\u52a8\u7ebf\u7a0b\uff1a', self.thread_id)
        while not <\/span>flag:
            try:
                item = self.queue.get<\/span>(False) # get\u53c2\u6570\u4e3afalse\u65f6\u961f\u5217\u4e3a\u7a7a\uff0c\u4f1a\u629b\u51fa\u5f02\u5e38
<\/span>                 if <\/span>not item:
                    pass
                self.parse_data<\/span>(item)
                self.queue.task_done<\/span>() # \u6bcf\u5f53\u53d1\u51fa\u4e00\u6b21get\u64cd\u4f5c\uff0c\u5c31\u4f1a\u63d0\u793a\u662f\u5426\u5835\u585e
<\/span>             except <\/span>Exception as <\/span>e:
                pass
        print('\u9000\u51fa\u4e86\u8be5\u7ebf\u7a0b\uff1a', self.thread_id)
    def <\/span>parse_data(self,item):
        '''
        \u89e3\u6790\u7f51\u9875\u5185\u5bb9\u7684\u51fd\u6570
        :param item:
        :return:
        '''
        try:
            html = etree.HTML<\/span>(item)
            result = html.xpath<\/span>('\/\/div[contains(@id,\"<\/span>qiushi_tag\")]'<\/span>) # \u5339\u914d\u6240\u6709\u6bb5\u5b50\u5185\u5bb9
<\/span>             for <\/span>site in <\/span>result:
                try:
                    img_url = site.xpath<\/span>('.\/\/img\/@src'<\/span>)[0] # \u7cd7\u4e8b\u56fe\u7247
<\/span>                     title = site.xpath<\/span>('.\/\/h2'<\/span>)[0].text # \u7cd7\u4e8b\u9898\u76ee
<\/span>                     content = site.xpath<\/span>('.\/\/div[@class=\"<\/span>content\"]\/span'<\/span>)[0].text.strip<\/span>() # \u7cd7\u4e8b\u5185\u5bb9
<\/span>                     response={
                        'img_url'<\/span>:img_url,
                        'title'<\/span>:title,
                        'content'<\/span>:content
                    } #\u6784\u9020json
<\/span>                     json.dump<\/span>(response,fp=self.file,ensure_ascii=False) # \u5b58\u653ejson\u6587\u4ef6
<\/span>                 except <\/span>Exception as <\/span>e:
                    print('parse 2: '<\/span>, e)
        except <\/span>Exception as <\/span>e:
            print('parse 1: '<\/span>,e)
data_queue = Queue() # \u5b58\u653e\u89e3\u6790\u6570\u636e\u7684queue
<\/span> flag = False<\/span>
def <\/span>main():
    output = open('qiushi.json'<\/span>,'a'<\/span>,encoding='utf-8'<\/span>) # \u5c06\u7ed3\u679c\u4fdd\u5b58\u5230\u4e00\u4e2ajson\u6587\u4ef6\u4e2d
<\/span>     pageQueue = Queue(50) # \u4efb\u52a1\u961f\u5217\uff0c\u5b58\u653e\u7f51\u9875\u7684\u961f\u5217
<\/span>     for <\/span>page in <\/span>range(1,11):
        pageQueue.put<\/span>(page) # \u6784\u9020\u4efb\u52a1\u961f\u5217
<\/span>     # \u521d\u59cb\u5316\u91c7\u96c6\u7ebf\u7a0b
<\/span>     crawl_threads = []
    crawl_name_list = ['crawl_1'<\/span>,'crawl_2'<\/span>,'crawl_3'<\/span>] # \u603b\u5171\u6784\u90203\u4e2a\u722c\u866b\u7ebf\u7a0b
<\/span>     for <\/span>thread_id in <\/span>crawl_name_list:
        thread = Crawl_thread(thread_id,pageQueue) # \u542f\u52a8\u722c\u866b\u7ebf\u7a0b
<\/span>         thread.start<\/span>() # \u542f\u52a8\u7ebf\u7a0b
<\/span><\/span>         crawl_threads.append<\/span>(thread)
    # \u521d\u59cb\u5316\u89e3\u6790\u7ebf\u7a0b
<\/span>     parse_thread = []
    parser_name_list = ['parse_1'<\/span>,'parse_2'<\/span>,'parse_3'<\/span>]
    for <\/span>thread_id in <\/span>parser_name_list: #
<\/span>         thread = Parser_thread(thread_id,data_queue,output)
        thread.start<\/span>() # \u542f\u52a8\u7ebf\u7a0b
        parse_thread.append<\/span>(thread)
    # \u7b49\u5f85\u961f\u5217\u60c5\u51b5\uff0c\u5148\u8fdb\u884c\u7f51\u9875\u7684\u6293\u53d6
<\/span>     while not <\/span>pageQueue.empty<\/span>(): # \u5224\u65ad\u662f\u5426\u4e3a\u7a7a
<\/span>         pass <\/span># \u4e0d\u4e3a\u7a7a\uff0c\u5219\u7ee7\u7eed\u963b\u585e
<\/span>     # \u7b49\u5f85\u6240\u6709\u7ebf\u7a0b\u7ed3\u675f
<\/span>     for <\/span>t in <\/span>crawl_threads:
        t.join<\/span>()
    # \u7b49\u5f85\u961f\u5217\u60c5\u51b5\uff0c\u5bf9\u91c7\u96c6\u7684\u9875\u9762\u961f\u5217\u4e2d\u7684\u9875\u9762\u8fdb\u884c\u89e3\u6790\uff0c\u7b49\u5f85\u6240\u6709\u9875\u9762\u89e3\u6790\u5b8c\u6210
<\/span>     while not <\/span>data_queue.empty<\/span>():
        pass
    # \u901a\u77e5\u7ebf\u7a0b\u9000\u51fa
<\/span>     global<\/span> flag
    flag = True<\/span>
    for <\/span>t in <\/span>parse_thread:
        t.join<\/span>() # \u7b49\u5f85\u6240\u6709\u7ebf\u7a0b\u6267\u884c\u5230\u6b64\u5904\u518d\u7ee7\u7eed\u5f80\u4e0b\u6267\u884c
<\/span>     print('\u9000\u51fa\u4e3b\u7ebf\u7a0b'<\/span>)
    output.close<\/span>()
if <\/span>__name__ == '__main__'<\/span>:
    main()
<\/span><\/code><\/pre>\n<\/p><\/div>\n

<\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"Python\u722c\u866b\u591a\u7ebf\u7a0bzh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[145],"tags":[],"class_list":["post-1561","post","type-post","status-publish","format-standard","hentry","category-pythonpcjc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1561"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=1561"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1561\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=1561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=1561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=1561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}