{"id":1029435,"date":"2024-12-31T11:08:13","date_gmt":"2024-12-31T03:08:13","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1029435.html"},"modified":"2024-12-31T11:08:15","modified_gmt":"2024-12-31T03:08:15","slug":"python%e5%a6%82%e4%bd%95%e5%8f%aa%e6%89%a7%e8%a1%8c%e4%b8%80%e6%ac%a1%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1029435.html","title":{"rendered":"python\u5982\u4f55\u53ea\u6267\u884c\u4e00\u6b21\u4ee3\u7801"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/4ddc4330-be62-42aa-981e-991852231552.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u53ea\u6267\u884c\u4e00\u6b21\u4ee3\u7801\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u53ea\u6267\u884c\u4e00\u6b21\u4ee3\u7801\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\u3001\u51fd\u6570\u88c5\u9970\u5668\u3001\u5355\u4f8b\u6a21\u5f0f\u7b49<\/strong>\u3002\u5176\u4e2d\u4f7f\u7528\u51fd\u6570\u88c5\u9970\u5668\u662f\u6bd4\u8f83\u63a8\u8350\u7684\u65b9\u6cd5\uff0c\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u51fd\u6570\u88c5\u9970\u5668\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u5728Python\u7f16\u7a0b\u4e2d\uff0c\u6709\u65f6\u5019\u6211\u4eec\u9700\u8981\u786e\u4fdd\u67d0\u6bb5\u4ee3\u7801\u53ea\u88ab\u6267\u884c\u4e00\u6b21\uff0c\u65e0\u8bba\u8be5\u4ee3\u7801\u5757\u88ab\u8c03\u7528\u591a\u5c11\u6b21\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u65b9\u6cd5\u548c\u5b9e\u73b0\u65b9\u5f0f\uff1a<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5168\u5c40\u53d8\u91cf<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u5168\u5c40\u53d8\u91cf\u53ef\u4ee5\u63a7\u5236\u4ee3\u7801\u7684\u6267\u884c\u6b21\u6570\u3002\u5168\u5c40\u53d8\u91cf\u7684\u4f5c\u7528\u662f\u8bb0\u5f55\u4ee3\u7801\u662f\u5426\u5df2\u7ecf\u6267\u884c\u8fc7\uff0c\u5982\u679c\u5df2\u7ecf\u6267\u884c\u8fc7\u5219\u4e0d\u4f1a\u518d\u6267\u884c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">executed = False<\/p>\n<p>def execute_once():<\/p>\n<p>    global executed<\/p>\n<p>    if not executed:<\/p>\n<p>        print(&quot;This code runs only once.&quot;)<\/p>\n<p>        executed = True<\/p>\n<h2><strong>Test<\/strong><\/h2>\n<p>execute_once()<\/p>\n<p>execute_once()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>executed<\/code>\u53d8\u91cf\u5728\u7b2c\u4e00\u6b21\u8c03\u7528<code>execute_once<\/code>\u51fd\u6570\u65f6\u88ab\u8bbe\u7f6e\u4e3a<code>True<\/code>\uff0c\u56e0\u6b64\u540e\u7eed\u7684\u8c03\u7528\u5c06\u4e0d\u4f1a\u518d\u6267\u884c\u4ee3\u7801\u5757\u5185\u7684\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u51fd\u6570\u88c5\u9970\u5668<\/p>\n<\/p>\n<p><p>\u51fd\u6570\u88c5\u9970\u5668\u662f\u4e00\u79cd\u4f18\u96c5\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u53ef\u4ee5\u5c01\u88c5\u51fd\u6570\u7684\u884c\u4e3a\uff0c\u4f7f\u5176\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def run_once(f):<\/p>\n<p>    def wrapper(*args, kwargs):<\/p>\n<p>        if not wrapper.has_run:<\/p>\n<p>            result = f(*args, kwargs)<\/p>\n<p>            wrapper.has_run = True<\/p>\n<p>            return result<\/p>\n<p>    wrapper.has_run = False<\/p>\n<p>    return wrapper<\/p>\n<p>@run_once<\/p>\n<p>def my_function():<\/p>\n<p>    print(&quot;This code runs only once.&quot;)<\/p>\n<h2><strong>Test<\/strong><\/h2>\n<p>my_function()<\/p>\n<p>my_function()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u88c5\u9970\u5668<code>run_once<\/code>\u786e\u4fdd<code>my_function<\/code>\u51fd\u6570\u53ea\u6267\u884c\u4e00\u6b21\u3002\u7b2c\u4e00\u6b21\u8c03\u7528\u65f6\uff0c<code>wrapper.has_run<\/code>\u88ab\u8bbe\u7f6e\u4e3a<code>True<\/code>\uff0c\u56e0\u6b64\u540e\u7eed\u8c03\u7528\u5c06\u4e0d\u4f1a\u518d\u6267\u884c\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u5355\u4f8b\u6a21\u5f0f<\/p>\n<\/p>\n<p><p>\u5355\u4f8b\u6a21\u5f0f\u786e\u4fdd\u4e00\u4e2a\u7c7b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u5168\u5c40\u8bbf\u95ee\u70b9\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u786e\u4fdd\u67d0\u4e9b\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class Singleton:<\/p>\n<p>    _instance = None<\/p>\n<p>    def __new__(cls, *args, kwargs):<\/p>\n<p>        if not cls._instance:<\/p>\n<p>            cls._instance = super().__new__(cls, *args, kwargs)<\/p>\n<p>        return cls._instance<\/p>\n<p>    def run_once(self):<\/p>\n<p>        if not hasattr(self, &#39;_has_run&#39;):<\/p>\n<p>            print(&quot;This code runs only once.&quot;)<\/p>\n<p>            self._has_run = True<\/p>\n<h2><strong>Test<\/strong><\/h2>\n<p>singleton = Singleton()<\/p>\n<p>singleton.run_once()<\/p>\n<p>singleton.run_once()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>Singleton<\/code>\u7c7b\u901a\u8fc7<code>__new__<\/code>\u65b9\u6cd5\u786e\u4fdd\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\u5b58\u5728\uff0c<code>run_once<\/code>\u65b9\u6cd5\u786e\u4fdd\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528\u7f13\u5b58\uff08Memoization\uff09<\/p>\n<\/p>\n<p><p>\u7f13\u5b58\u662f\u4e00\u79cd\u4f18\u5316\u6280\u672f\uff0c\u53ef\u4ee5\u5b58\u50a8\u51fd\u6570\u7684\u8ba1\u7b97\u7ed3\u679c\uff0c\u907f\u514d\u91cd\u590d\u8ba1\u7b97\u3002\u901a\u8fc7\u7f13\u5b58\u673a\u5236\u53ef\u4ee5\u786e\u4fdd\u51fd\u6570\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from functools import lru_cache<\/p>\n<p>@lru_cache(maxsize=1)<\/p>\n<p>def my_function():<\/p>\n<p>    print(&quot;This code runs only once.&quot;)<\/p>\n<p>    return &quot;result&quot;<\/p>\n<h2><strong>Test<\/strong><\/h2>\n<p>my_function()<\/p>\n<p>my_function()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>lru_cache<\/code>\u88c5\u9970\u5668\u786e\u4fdd<code>my_function<\/code>\u53ea\u6267\u884c\u4e00\u6b21\uff0c\u540e\u7eed\u8c03\u7528\u5c06\u76f4\u63a5\u8fd4\u56de\u7f13\u5b58\u7684\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668<\/p>\n<\/p>\n<p><p>\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u53ef\u4ee5\u7528\u4e8e\u7ba1\u7406\u8d44\u6e90\u7684\u4f7f\u7528\uff0c\u901a\u8fc7\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u53ef\u4ee5\u786e\u4fdd\u67d0\u4e9b\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class RunOnceContext:<\/p>\n<p>    def __init__(self):<\/p>\n<p>        self.has_run = False<\/p>\n<p>    def __enter__(self):<\/p>\n<p>        if not self.has_run:<\/p>\n<p>            self.has_run = True<\/p>\n<p>            return True<\/p>\n<p>        return False<\/p>\n<p>    def __exit__(self, exc_type, exc_val, exc_tb):<\/p>\n<p>        pass<\/p>\n<h2><strong>Test<\/strong><\/h2>\n<p>with RunOnceContext() as run_once:<\/p>\n<p>    if run_once:<\/p>\n<p>        print(&quot;This code runs only once.&quot;)<\/p>\n<p>with RunOnceContext() as run_once:<\/p>\n<p>    if run_once:<\/p>\n<p>        print(&quot;This code will not run.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>RunOnceContext<\/code>\u7c7b\u901a\u8fc7\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u673a\u5236\u786e\u4fdd\u4ee3\u7801\u5757\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u7ebf\u7a0b\u5b89\u5168\u7684\u5355\u4f8b\u6a21\u5f0f<\/p>\n<\/p>\n<p><p>\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\uff0c\u786e\u4fdd\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u9700\u8981\u8003\u8651\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\u3002\u53ef\u4ee5\u4f7f\u7528\u7ebf\u7a0b\u9501\u6765\u786e\u4fdd\u7ebf\u7a0b\u5b89\u5168\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import threading<\/p>\n<p>class Thread<a href=\"https:\/\/docs.pingcode.com\/agile\/agile-at-scale\/what-is-safe\" target=\"_blank\">SAFe<\/a>Singleton:<\/p>\n<p>    _instance = None<\/p>\n<p>    _lock = threading.Lock()<\/p>\n<p>    def __new__(cls, *args, kwargs):<\/p>\n<p>        with cls._lock:<\/p>\n<p>            if not cls._instance:<\/p>\n<p>                cls._instance = super().__new__(cls, *args, kwargs)<\/p>\n<p>        return cls._instance<\/p>\n<p>    def run_once(self):<\/p>\n<p>        if not hasattr(self, &#39;_has_run&#39;):<\/p>\n<p>            print(&quot;This code runs only once.&quot;)<\/p>\n<p>            self._has_run = True<\/p>\n<h2><strong>Test<\/strong><\/h2>\n<p>singleton = ThreadSafeSingleton()<\/p>\n<p>singleton.run_once()<\/p>\n<p>singleton.run_once()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>ThreadSafeSingleton<\/code>\u7c7b\u901a\u8fc7\u7ebf\u7a0b\u9501\u786e\u4fdd\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e0b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\u5b58\u5728\uff0c\u5e76\u786e\u4fdd\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\uff1a<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u51e0\u79cd\u65b9\u6cd5\u53ef\u4ee5\u786e\u4fddPython\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u3002\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\u3001\u51fd\u6570\u88c5\u9970\u5668\u3001\u5355\u4f8b\u6a21\u5f0f\u3001\u7f13\u5b58\u3001\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u4ee5\u53ca\u7ebf\u7a0b\u5b89\u5168\u7684\u5355\u4f8b\u6a21\u5f0f\u90fd\u53ef\u4ee5\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002\u5177\u4f53\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u548c\u5e94\u7528\u573a\u666f\u6765\u51b3\u5b9a\u3002\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u90fd\u8981\u6ce8\u610f\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u7ef4\u62a4\u6027\uff0c\u786e\u4fdd\u4ee3\u7801\u7b80\u6d01\u3001\u6e05\u6670\u3001\u6613\u4e8e\u7406\u89e3\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u786e\u4fdd\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u6a21\u5757\u7ea7\u522b\u7684\u4ee3\u7801\u6216\u8005\u51fd\u6570\u88c5\u9970\u5668\u6765\u786e\u4fdd\u67d0\u6bb5\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u3002\u5e38\u89c1\u7684\u505a\u6cd5\u662f\u5c06\u4ee3\u7801\u653e\u7f6e\u5728\u4e00\u4e2a\u51fd\u6570\u4e2d\uff0c\u5e76\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\u6216\u5355\u4f8b\u6a21\u5f0f\u6765\u63a7\u5236\u6267\u884c\u3002\u8fd8\u53ef\u4ee5\u5229\u7528<code>threading<\/code>\u6a21\u5757\u4e2d\u7684<code>Lock<\/code>\u7c7b\u6765\u786e\u4fdd\u591a\u7ebf\u7a0b\u73af\u5883\u4e0b\u7684\u5355\u6b21\u6267\u884c\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u4f7f\u7528\u7c7b\u7684\u9759\u6001\u65b9\u6cd5\u6765\u6267\u884c\u4e00\u6b21\u4ee3\u7801\u6709\u4ec0\u4e48\u597d\u5904\uff1f<\/strong><br \/>\u901a\u8fc7\u7c7b\u7684\u9759\u6001\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5c06\u6267\u884c\u903b\u8f91\u4e0e\u7c7b\u7684\u5176\u4ed6\u529f\u80fd\u89e3\u8026\uff0c\u63d0\u4f9b\u66f4\u6e05\u6670\u7684\u4ee3\u7801\u7ed3\u6784\u3002\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u4ec5\u80fd\u5b9e\u73b0\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\u7684\u9700\u6c42\uff0c\u8fd8\u80fd\u65b9\u4fbf\u540e\u7eed\u7684\u7ef4\u62a4\u548c\u6269\u5c55\u3002\u4f7f\u7528\u7c7b\u7684\u9759\u6001\u65b9\u6cd5\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u7c7b\u5c5e\u6027\u6765\u8ddf\u8e2a\u662f\u5426\u5df2\u6267\u884c\u8fc7\u4ee3\u7801\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\u786e\u4fdd\u67d0\u6bb5\u4ee3\u7801\u53ea\u6267\u884c\u4e00\u6b21\uff1f<\/strong><br \/>\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>threading.Lock<\/code>\u7c7b\u6765\u786e\u4fdd\u67d0\u6bb5\u4ee3\u7801\u7684\u7ebf\u7a0b\u5b89\u5168\u6027\u3002\u901a\u8fc7\u5728\u4ee3\u7801\u5757\u524d\u540e\u52a0\u9501\u548c\u89e3\u9501\uff0c\u53ef\u4ee5\u9632\u6b62\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u6267\u884c\u8be5\u4ee3\u7801\uff0c\u4ece\u800c\u786e\u4fdd\u5176\u53ea\u6267\u884c\u4e00\u6b21\u3002\u4f7f\u7528\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u53ef\u4ee5\u4f7f\u9501\u7684\u7ba1\u7406\u66f4\u52a0\u7b80\u6d01\u548c\u5b89\u5168\u3002<\/p>\n<p><strong>\u6709\u6ca1\u6709\u7b80\u5355\u7684\u65b9\u6cd5\u5728\u811a\u672c\u6267\u884c\u65f6\u53ea\u8fd0\u884c\u4e00\u6b21\u7279\u5b9a\u4ee3\u7801\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u5c06\u7279\u5b9a\u4ee3\u7801\u653e\u5165\u4e00\u4e2a\u51fd\u6570\u4e2d\uff0c\u5e76\u5728\u811a\u672c\u5f00\u59cb\u65f6\u8c03\u7528\u8be5\u51fd\u6570\u3002\u7ed3\u5408\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\u6765\u6807\u8bc6\u8be5\u51fd\u6570\u662f\u5426\u5df2\u88ab\u8c03\u7528\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u63a7\u5236\u4ee3\u7801\u7684\u6267\u884c\u3002\u6b64\u65b9\u6cd5\u7b80\u5355\u6613\u884c\uff0c\u9002\u5408\u5c0f\u578b\u811a\u672c\u548c\u7b80\u5355\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u53ea\u6267\u884c\u4e00\u6b21\u4ee3\u7801\u7684\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\u3001\u51fd\u6570\u88c5\u9970\u5668\u3001\u5355\u4f8b\u6a21\u5f0f\u7b49\u3002\u5176\u4e2d\u4f7f\u7528\u51fd\u6570\u88c5\u9970\u5668\u662f\u6bd4\u8f83\u63a8\u8350\u7684 [&hellip;]","protected":false},"author":3,"featured_media":1029440,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1029435"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1029435"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1029435\/revisions"}],"predecessor-version":[{"id":1029441,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1029435\/revisions\/1029441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1029440"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1029435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1029435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1029435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}