From d48245304bedc2d0c5fc44b1f7024558ec559ca3 Mon Sep 17 00:00:00 2001 From: ldavies99 Date: Tue, 11 Jul 2023 16:10:29 +0100 Subject: [PATCH 1/6] Add gridlines to all sheets except cover --- gptables/core/api.py | 4 ++-- gptables/core/wrappers.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gptables/core/api.py b/gptables/core/api.py index d7b10d24..eb3f4bc9 100644 --- a/gptables/core/api.py +++ b/gptables/core/api.py @@ -64,7 +64,7 @@ def produce_workbook( wb.set_theme(theme) if cover is not None: - ws = wb.add_worksheet(cover.cover_label) + ws = wb.add_worksheet(cover.cover_label, gridlines=2) ws.write_cover(cover) contentsheet = {} @@ -90,7 +90,7 @@ def produce_workbook( sheets = {**contentsheet, **notesheet, **sheets} for label, gptable in sheets.items(): - ws = wb.add_worksheet(label) + ws = wb.add_worksheet(label, gridlines=0) ws.write_gptable(gptable, auto_width, wb._annotations) return wb diff --git a/gptables/core/wrappers.py b/gptables/core/wrappers.py index 86ca122b..4fc0721a 100644 --- a/gptables/core/wrappers.py +++ b/gptables/core/wrappers.py @@ -990,7 +990,7 @@ def __init__(self, filename=None, options={}): # Set default theme self.set_theme(gptheme) - def add_worksheet(self, name=None): + def add_worksheet(self, name=None, gridlines=2): """ Overwrite add_worksheet() to create a GPWorksheet object. @@ -1007,7 +1007,7 @@ def add_worksheet(self, name=None): worksheet = super(GPWorkbook, self).add_worksheet(name, GPWorksheet) worksheet.theme = self.theme worksheet._workbook = self # Create reference to wb, for formatting - worksheet.hide_gridlines(2) + worksheet.hide_gridlines(gridlines) return worksheet From f4f8c90696c50700b07a1cb4acb4d3f3fd300d2b Mon Sep 17 00:00:00 2001 From: ldavies99 Date: Wed, 4 Oct 2023 14:09:56 +0100 Subject: [PATCH 2/6] Add options for user to show or hide gridlines --- gptables/core/api.py | 27 ++++++++++++++++++++++++--- gptables/test/actual_workbook.xlsx | Bin 0 -> 10557 bytes 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 gptables/test/actual_workbook.xlsx diff --git a/gptables/core/api.py b/gptables/core/api.py index eb3f4bc9..092d82d6 100644 --- a/gptables/core/api.py +++ b/gptables/core/api.py @@ -16,6 +16,8 @@ def produce_workbook( notesheet_label = "Notes", notesheet_options = {}, auto_width = True, + gridlines = 2, + cover_gridlines = False ): """ Produces a GPWorkbook, ready to be written to the specified `.xlsx` file @@ -50,6 +52,12 @@ def produce_workbook( auto_width : bool, optional indicate if column widths should be automatically determined. True by default. + gridlines : int, optional + option to hide or show gridlines on worksheets. 0 - don't hide gridlines, + 1 - hide printed gridlines only, or 2 - hide screen and printed gridlines. + cover_gridlines : bool, optional + indication if gridlines should apply to the cover worksheet. False + by default. Returns ------- @@ -64,7 +72,10 @@ def produce_workbook( wb.set_theme(theme) if cover is not None: - ws = wb.add_worksheet(cover.cover_label, gridlines=2) + if cover_gridlines: + ws = wb.add_worksheet(cover.cover_label, gridlines=gridlines) + else: + ws = wb.add_worksheet(cover.cover_label, gridlines=2) ws.write_cover(cover) contentsheet = {} @@ -90,7 +101,7 @@ def produce_workbook( sheets = {**contentsheet, **notesheet, **sheets} for label, gptable in sheets.items(): - ws = wb.add_worksheet(label, gridlines=0) + ws = wb.add_worksheet(label, gridlines=gridlines) ws.write_gptable(gptable, auto_width, wb._annotations) return wb @@ -108,6 +119,8 @@ def write_workbook( notesheet_label = "Notes", notesheet_options = {}, auto_width = True, + gridlines = 0, + cover_gridlines = False ): """ @@ -149,6 +162,12 @@ def write_workbook( auto_width : bool, optional indicate if column widths should be automatically determined. True by default. + gridlines : int, optional + option to hide or show gridlines on worksheets. 0 - don't hide gridlines, + 1 - hide printed gridlines only, or 2 - hide screen and printed gridlines. + cover_gridlines : bool, optional + indication if gridlines should apply to the cover worksheet. False + by default. contentsheet : str alias for contentsheet_label, deprecated in v1.1.0 @@ -169,6 +188,8 @@ def write_workbook( notes_table, notesheet_label, notesheet_options, - auto_width + auto_width, + gridlines, + cover_gridlines ) wb.close() diff --git a/gptables/test/actual_workbook.xlsx b/gptables/test/actual_workbook.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..1f9d1e68936ca9e37badabe1d1a6e3c158915d44 GIT binary patch literal 10557 zcma)i1yEdD)-~3+OA;(NL4&(XaCZsr1ZaZ0Yj6+l5S-uyXdHsO6I_D3OTJDrGnvP{ zng8#q+qa79y^6cex@WJw_fe3BhQWq_fPe>I0uU{b{R&Qy5D=f>ARw^7f6*2J+Blfl zIOwUk+M3wwymqm+8cJA}?_fmlU6#EkN(AAl2^xhP9Ir%)Q(*k?sanzynPG47J6?8Q zX!|6jZxGtNUv+tSccW{s4VSB$olD`OGEH9k+*uQbvQ{Zsvt#MiNIK6m19UM&YZP)T zl&@l)17YpP2M}b%>>n$6VVp;}3b?SLjP}|_LylCDvONtrf5gX4R7GyYXCemDqS*(AZg(az-!LiiDR zJdZatyJLj|tFB~7Pe<@`MTKWc?1b)n(aK)UdM3fLsU|dlaSd!0Oc4tSzkSYF7$R&B z*QEiuvf!=b1KfluaZL3TBaL@$aoTUTg(L%Upyt_xGy!?a3?=>|?TJz8u?w`NB@CSN!3V-a!u*dPm`_GEK3cW0*=gT1da%b{*P z(Buq?YCI-h_A9*md?B#rd{Bm_`>ncDUg0mxq~Iafz6)L+87K${B=B9&&cw=|;q}k& zve+RhXeM-@Bflf`t)-zlzYx|1X$&{4A~Z(IYJq)9tXRc*AP^m!w)T95DJ~fZ!ZmG4 ze#l#*+Vu7JHBt4?(Vs)fW;t&5)>!oI_iJD6@MUpkX$g!4D1ERK=qg2|FotfC zXrAF-$l%@jKo)p9VRuTknaoW%7C9TEJ9SYeCxAOjz%(_CE5TC_Q!60)C1A*!M`OOq z^8$NAG)xaSFuaJ2iBbMGed4-{b$|j7bGW?NVhQ&8|!x9;N7j0XJf}~=5LQ^F;lqF zWzc$FF_AfK5$5RtK?`CYIfe6@07-0r!PKUlx&*(dhrLb~ctdNXZ=7L>ZsfDZSI&DJ zR;u;sXmUzLfq7k-6ZV0 zjDry3xx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r|A{JjIvA1^{@2IpH|eZf68!*<2dLvbVXoi>7?ECm4TrArN{=-4#|b>i`K&;Th17i*Q# z^qQ+ad#|4)g<_k*9oN(Gnan*z3*?oqf5BC1W%}L$@xMSb*j=&uzK+j^hynKTa_F4)slwb=jDp zh1A8&_m$j=kcYW=Ejg;lC@ zO@dQA^v9a>%~I{_0z+ET)11+fIoHJJPnh)=#1MDqf|E4Jl;REPP;L9u4XYKxe52dA z6vM?Z`Rg@aRJ|Z7W`nuyI5FIHIc|IPQl0-`aB?XGaaPM1WH{dxzkh>HcDqeYk9x7l zaCcRC5O>4)Xc3Jztq!ti&-dsGIgD@*jj~<^`W(kkyDHjP!fO=x^s@H)HA@@8Eu5*d zH4rAg8r~Lb)t2u?%PZfirb{=-mt&(|YW;AFrXURoh5f5@^Y@2&z>E3oQ|J5h_BTg+ zo&r2QX7W260;0~h5G;^?J9P3i@abWUKY?Gsuj+q4n(-9p>EVPwIHzEBf^q)#sKQf} zrz7w`DC6KV@^4UnrO~G-Pe-GFP=21B`WuvAiRmfI)0x;G6j{W-MftT~KSg;u4*7%f z5&2&z{~V6|NAQy_{hwfd)L+5>(X)Sw@U&nu?+AZO=F{%&AB1A?p7R9Z zZ;5=`to(!U08Ry9g#Tz=K7ER(9jiYG+~Dr#PlSK1`HP?X>s#=yG4RuqLi`^T COA7t~ literal 0 HcmV?d00001 From cc0ac940e2550ca0d03c4773c6843f5adb9d7381 Mon Sep 17 00:00:00 2001 From: ldavies99 Date: Wed, 4 Oct 2023 14:28:27 +0100 Subject: [PATCH 3/6] Make gridlines off by default --- gptables/core/api.py | 2 +- gptables/test/actual_workbook.xlsx | Bin 10557 -> 0 bytes 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 gptables/test/actual_workbook.xlsx diff --git a/gptables/core/api.py b/gptables/core/api.py index 092d82d6..2d8845bf 100644 --- a/gptables/core/api.py +++ b/gptables/core/api.py @@ -119,7 +119,7 @@ def write_workbook( notesheet_label = "Notes", notesheet_options = {}, auto_width = True, - gridlines = 0, + gridlines = 2, cover_gridlines = False ): diff --git a/gptables/test/actual_workbook.xlsx b/gptables/test/actual_workbook.xlsx deleted file mode 100644 index 1f9d1e68936ca9e37badabe1d1a6e3c158915d44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10557 zcma)i1yEdD)-~3+OA;(NL4&(XaCZsr1ZaZ0Yj6+l5S-uyXdHsO6I_D3OTJDrGnvP{ zng8#q+qa79y^6cex@WJw_fe3BhQWq_fPe>I0uU{b{R&Qy5D=f>ARw^7f6*2J+Blfl zIOwUk+M3wwymqm+8cJA}?_fmlU6#EkN(AAl2^xhP9Ir%)Q(*k?sanzynPG47J6?8Q zX!|6jZxGtNUv+tSccW{s4VSB$olD`OGEH9k+*uQbvQ{Zsvt#MiNIK6m19UM&YZP)T zl&@l)17YpP2M}b%>>n$6VVp;}3b?SLjP}|_LylCDvONtrf5gX4R7GyYXCemDqS*(AZg(az-!LiiDR zJdZatyJLj|tFB~7Pe<@`MTKWc?1b)n(aK)UdM3fLsU|dlaSd!0Oc4tSzkSYF7$R&B z*QEiuvf!=b1KfluaZL3TBaL@$aoTUTg(L%Upyt_xGy!?a3?=>|?TJz8u?w`NB@CSN!3V-a!u*dPm`_GEK3cW0*=gT1da%b{*P z(Buq?YCI-h_A9*md?B#rd{Bm_`>ncDUg0mxq~Iafz6)L+87K${B=B9&&cw=|;q}k& zve+RhXeM-@Bflf`t)-zlzYx|1X$&{4A~Z(IYJq)9tXRc*AP^m!w)T95DJ~fZ!ZmG4 ze#l#*+Vu7JHBt4?(Vs)fW;t&5)>!oI_iJD6@MUpkX$g!4D1ERK=qg2|FotfC zXrAF-$l%@jKo)p9VRuTknaoW%7C9TEJ9SYeCxAOjz%(_CE5TC_Q!60)C1A*!M`OOq z^8$NAG)xaSFuaJ2iBbMGed4-{b$|j7bGW?NVhQ&8|!x9;N7j0XJf}~=5LQ^F;lqF zWzc$FF_AfK5$5RtK?`CYIfe6@07-0r!PKU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N0htuAXoM0Y{gP`5+MWY*43fG##6bXb0I8&JF618yIpMb!$Kf}#YAI5Y z##Q@)2Tr|A{JjIvA1^{@2IpH|eZf68!*<2dLvbVXoi>7?ECm4TrArN{=-4#|b>i`K&;Th17i*Q# z^qQ+ad#|4)g<_k*9oN(Gnan*z3*?oqf5BC1W%}L$@xMSb*j=&uzK+j^hynKTa_F4)slwb=jDp zh1A8&_m$j=kcYW=Ejg;lC@ zO@dQA^v9a>%~I{_0z+ET)11+fIoHJJPnh)=#1MDqf|E4Jl;REPP;L9u4XYKxe52dA z6vM?Z`Rg@aRJ|Z7W`nuyI5FIHIc|IPQl0-`aB?XGaaPM1WH{dxzkh>HcDqeYk9x7l zaCcRC5O>4)Xc3Jztq!ti&-dsGIgD@*jj~<^`W(kkyDHjP!fO=x^s@H)HA@@8Eu5*d zH4rAg8r~Lb)t2u?%PZfirb{=-mt&(|YW;AFrXURoh5f5@^Y@2&z>E3oQ|J5h_BTg+ zo&r2QX7W260;0~h5G;^?J9P3i@abWUKY?Gsuj+q4n(-9p>EVPwIHzEBf^q)#sKQf} zrz7w`DC6KV@^4UnrO~G-Pe-GFP=21B`WuvAiRmfI)0x;G6j{W-MftT~KSg;u4*7%f z5&2&z{~V6|NAQy_{hwfd)L+5>(X)Sw@U&nu?+AZO=F{%&AB1A?p7R9Z zZ;5=`to(!U08Ry9g#Tz=K7ER(9jiYG+~Dr#PlSK1`HP?X>s#=yG4RuqLi`^T COA7t~ From 7dc6ddf9cd4c9e026c7306cd347a5d99f963d0fe Mon Sep 17 00:00:00 2001 From: daviel9 Date: Fri, 28 Jun 2024 12:24:44 +0100 Subject: [PATCH 4/6] Apply suggested changes and add gridlines to expected workbook in test api --- gptables/core/api.py | 20 +++++++++++--------- gptables/core/wrappers.py | 15 +++++++++++++-- gptables/test/expected_workbook.xlsx | Bin 10631 -> 10594 bytes gptables/test/test_api.py | 2 ++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gptables/core/api.py b/gptables/core/api.py index 2d8845bf..d3deb224 100644 --- a/gptables/core/api.py +++ b/gptables/core/api.py @@ -16,7 +16,7 @@ def produce_workbook( notesheet_label = "Notes", notesheet_options = {}, auto_width = True, - gridlines = 2, + gridlines = "hide_all", cover_gridlines = False ): """ @@ -52,9 +52,10 @@ def produce_workbook( auto_width : bool, optional indicate if column widths should be automatically determined. True by default. - gridlines : int, optional - option to hide or show gridlines on worksheets. 0 - don't hide gridlines, - 1 - hide printed gridlines only, or 2 - hide screen and printed gridlines. + gridlines : string, optional + option to hide or show gridlines on worksheets. "show_all" - don't + hide gridlines, "hide_printed" - hide printed gridlines only, or + "hide_all" - hide screen and printed gridlines. cover_gridlines : bool, optional indication if gridlines should apply to the cover worksheet. False by default. @@ -75,7 +76,7 @@ def produce_workbook( if cover_gridlines: ws = wb.add_worksheet(cover.cover_label, gridlines=gridlines) else: - ws = wb.add_worksheet(cover.cover_label, gridlines=2) + ws = wb.add_worksheet(cover.cover_label, gridlines="hide_all") ws.write_cover(cover) contentsheet = {} @@ -119,7 +120,7 @@ def write_workbook( notesheet_label = "Notes", notesheet_options = {}, auto_width = True, - gridlines = 2, + gridlines = "hide_all", cover_gridlines = False ): @@ -162,9 +163,10 @@ def write_workbook( auto_width : bool, optional indicate if column widths should be automatically determined. True by default. - gridlines : int, optional - option to hide or show gridlines on worksheets. 0 - don't hide gridlines, - 1 - hide printed gridlines only, or 2 - hide screen and printed gridlines. + gridlines : string, optional + option to hide or show gridlines on worksheets. "show_all" - don't + hide gridlines, "hide_printed" - hide printed gridlines only, or + "hide_all" - hide screen and printed gridlines. cover_gridlines : bool, optional indication if gridlines should apply to the cover worksheet. False by default. diff --git a/gptables/core/wrappers.py b/gptables/core/wrappers.py index 855393e0..e2bc9b4d 100644 --- a/gptables/core/wrappers.py +++ b/gptables/core/wrappers.py @@ -1052,7 +1052,7 @@ def __init__(self, filename=None, options={}): # Set default theme self.set_theme(gptheme) - def add_worksheet(self, name=None, gridlines=2): + def add_worksheet(self, name=None, gridlines="hide_all"): """ Overwrite add_worksheet() to create a GPWorksheet object. @@ -1060,6 +1060,10 @@ def add_worksheet(self, name=None, gridlines=2): ---------- name : str (optional) name of the the worksheet to be created + gridlines : string, optional + option to hide or show gridlines on worksheets. "show_all" - don't + hide gridlines, "hide_printed" - hide printed gridlines only, or + "hide_all" - hide screen and printed gridlines. Returns ------- @@ -1069,7 +1073,14 @@ def add_worksheet(self, name=None, gridlines=2): worksheet = super(GPWorkbook, self).add_worksheet(name, GPWorksheet) worksheet.theme = self.theme worksheet._workbook = self # Create reference to wb, for formatting - worksheet.hide_gridlines(gridlines) + + worksheet.hide_gridlines({ + "show_all": 1, + "hide_printed": 2, + "hide_all": 3 + }[gridlines] + ) + return worksheet diff --git a/gptables/test/expected_workbook.xlsx b/gptables/test/expected_workbook.xlsx index 5248c69810de2a9329edb3e9959d050a22d2e861..31608fd83a4a980968c54d57b2d8ef6595a6165e 100644 GIT binary patch delta 2153 zcmZ8jc{J3E7atR2$=DjZH$xeQ6DA?V7)69+NuI1dr0fa9Q^r^yiQ#J*rm1 zA!94DuOXt8HA}L4-h1bF-tYIj=iGDex%d8Y&$*xbxi`xElUX?{gq{Cc>A@ls2qXaT zK+t%1c;rfsu4zd#1l9_7Y0LMJsC3ddm^|1w^+^||a97$n zx)YHUQgW-u*}5-ND+A*tb0MWGogJB-<$~TSJJ^vxBx6Wi&3v)qH?%LiMV)6e8rJUZ zHh_w+-+bZQd!AYk?am?$!xwdVqGr{<3gc6KV~F35qqEZ^Ex#919k~aLwUyZJRRj;N zxAZB#R6BaadR8PobXsrxszI3I&oul)p&lctRq>!aF5|$m(<17lGl-AU_Kc@e%1X(g$!L%v9zalYW6=hGhKB8R&6rr!3Y@n;ooV|h-D zzTJ8NZ@gwx#%zPLh85#Xyw|+|m|fu7M)?e%T!Frzd2YtX_q#i`FJqVAD2p74Vfn%j1^y#+0S?2d$$d?Bh^IST0~9x45TH0jh%~G zTKIi}LSHSk@$%heH8DKJ3; z?$2&ndwmdx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1ykGHh(-y0|K@@G1KtB&a*jA&|Th(v(2D9WF#27w4>45^utoVPs>=r<DLNk+T6)TCLXDYk)IB6K(P*lm1JrO3>9Q=YS8{@RC#5| zyjIPsnWrBmJ2x_%#!mg*_wyrB{dVg&oxfQDhTwt?P3L5|apU7Byoj?GV{yg{=h?+^ z3ve|L3b+@n;2IF*j*Rg0EgH=AK4Z!}W62UyRcm zRskI~z6et=CiKeh;RDkG*2shUC(%TWVjFzDgg&QKS&O*|UVFUnJE#7DRhL&KkM$~u zO@95jm4FlIY{aWop1-N^LI2@PVV5#J)b@Ge*E$h{b;6uEdfHp|HG8RFZSh8)Y79lW zz!h2;v@X5%ur4QQHEGFLFBdk&1{zRoyoioWY>@bPw}x4EhLnJAxo0%b&g5@zwy-pd zQW9vbzVZ8=+JqB<**8w)L>t%QqgzV4p}hhwyswPDG$D80IoZBguGr0Y-=aHNayb#DgB}b7Feoy&C#H4r0`zA0#tGNJ&l11 zYmmA$2mYUz%?Z~M{&l@UApW!N{@0owN79Icx=Mnz3uK!H(XE{p}1pb7}(6s|p zxF($|@GnU;_$fP(%FYWUOUlp<0!?SaB`)BHq%PfUKm(ycw+VzIbiqTyz@MT*zz9Ma yOcwc1C@!T89u++c;Xt&M3>bV7sE|?-`se(ARd@&-NomuW09T~NnRq1r*8c*2xc6KD diff --git a/gptables/test/test_api.py b/gptables/test/test_api.py index 64622e66..3d8683e6 100644 --- a/gptables/test/test_api.py +++ b/gptables/test/test_api.py @@ -58,6 +58,8 @@ def generate_gpworkbook(output_path): notes_table=notes_table, notesheet_label="Notes table", notesheet_options={"title": "Table with notes"}, + gridlines="show_all", + cover_gridlines=False ) return generate_gpworkbook From cd15e77958defec39a99da7fceeb1e69a8948a68 Mon Sep 17 00:00:00 2001 From: daviel9 Date: Fri, 28 Jun 2024 16:03:26 +0100 Subject: [PATCH 5/6] Fix numbering on gridlines --- gptables/core/wrappers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gptables/core/wrappers.py b/gptables/core/wrappers.py index e2bc9b4d..b05783f1 100644 --- a/gptables/core/wrappers.py +++ b/gptables/core/wrappers.py @@ -1075,9 +1075,9 @@ def add_worksheet(self, name=None, gridlines="hide_all"): worksheet._workbook = self # Create reference to wb, for formatting worksheet.hide_gridlines({ - "show_all": 1, - "hide_printed": 2, - "hide_all": 3 + "show_all": 0, + "hide_printed": 1, + "hide_all": 2 }[gridlines] ) From 8477a8abecf6ccfb4cf22c22ef502fae13bffc37 Mon Sep 17 00:00:00 2001 From: daviel9 Date: Tue, 2 Jul 2024 11:54:09 +0100 Subject: [PATCH 6/6] Update expected workbook --- gptables/test/expected_workbook.xlsx | Bin 10594 -> 10646 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gptables/test/expected_workbook.xlsx b/gptables/test/expected_workbook.xlsx index 31608fd83a4a980968c54d57b2d8ef6595a6165e..9ea668a515302af07d3f87c274148dc276ad6936 100644 GIT binary patch delta 2209 zcmZ9Oc{J4PAIHaF!jL6P879k&5wgu#BU{;8l&l%cbqQlIh(?x)vhTiw>|OoNxxe2%zt1_(`Ml5b`TX&m^Sqw-^O-cyxK(um!XD#nDYVZ7 z0-*sOh&bt*&xj&t)GG7#S&aSt?8dZNC@o&_ay3}gigPs33O_6;aV4S{(b;$wS(^1_ zugX9qZE_=xGJh~zBQyF?*{~se<|6b3laRAEE!|u0-YHn z*FYLGfkmMBy!%}4*oW#rH0QGt$&gr7qO!LCJSkh1HVmp@?u%Eyl6LtkT7Kb4mD10m z!t5w(!i(}y?j9})2#fz<<1(H0s>3tM?I zCcCrerDc8_53`E)OK&})@K6V#Kva!&V{%Mb+rnJT`Eaa~)-ZKz;xpb7$UJ$a0y!n_ z16+sOswwBWCEvF1_OV1v_eyaSoBTaepi6-@wB%8F^R~d|Vyu@QHk4sdS=S$t$06+e z?P-hVFkvBVzN)5Jr9Nzu@B6N)is!cr=<}^;Ca%D&OX@smyj@jZPg8UJSD9#8#%#b& zWH+PWGmek?jsA1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