How to use _download method in avocado

Best Python code snippet using avocado_python

hubconf.py

Source:hubconf.py Github

copy

Full Screen

...11 mode='asuka'12 )13 if pretrained:14 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.0.0/Asuka-512x512-7de0e6.mat'15 model.load_state_dict(_download(checkpoint, progress=True))16 return model17def style_horo(pretrained=False):18 model = _m(19 layer_count=8,20 startf=32,21 maxf=512,22 truncation_psi=0.5,23 truncation_cutoff=8,24 mode='asuka'25 )26 if pretrained:27 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.1.0/Horo-512x512-822ee4.mat'28 model.load_state_dict(_download(checkpoint, progress=True))29 return model30def style_asashio(pretrained=False):31 model = _m(32 layer_count=8,33 startf=32,34 maxf=512,35 truncation_psi=0.5,36 truncation_cutoff=8,37 mode='asuka'38 )39 if pretrained:40 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.2.0/Asashio-512x512-a3c21a.mat'41 model.load_state_dict(_download(checkpoint, progress=True))42 return model43def style_anime_head(pretrained=False):44 model = _m(45 layer_count=8,46 startf=32,47 maxf=512,48 truncation_psi=0.5,49 truncation_cutoff=8,50 mode='asuka'51 )52 if pretrained:53 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.1.0/AnimeHead-512x512-960a82.mat'54 model.load_state_dict(_download(checkpoint, progress=True))55 return model56def style_anime_face_a(pretrained=False):57 model = _m(58 layer_count=8,59 startf=32,60 maxf=512,61 truncation_psi=0.5,62 truncation_cutoff=8,63 mode='asuka'64 )65 if pretrained:66 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.0.0/AnimeFaceC-512x512-47055c.mat'67 model.load_state_dict(_download(checkpoint, progress=True))68 return model69def style_anime_face_b(pretrained=False):70 model = _m(71 layer_count=8,72 startf=32,73 maxf=512,74 truncation_psi=0.5,75 truncation_cutoff=8,76 mode='asuka'77 )78 if pretrained:79 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.0.0/AnimeFaceA-512x512-feaff1.mat'80 model.load_state_dict(_download(checkpoint, progress=True))81 return model82def style_anime_face_c(pretrained=False):83 model = _m(84 layer_count=8,85 startf=32,86 maxf=512,87 truncation_psi=0.5,88 truncation_cutoff=8,89 mode='asuka'90 )91 if pretrained:92 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.0.0/AnimeFaceB-512x512-41bdee.mat'93 model.load_state_dict(_download(checkpoint, progress=True))94 return model95def style_anime_face_d(pretrained=False):96 model = _m(97 layer_count=8,98 startf=32,99 maxf=512,100 truncation_psi=0.5,101 truncation_cutoff=8,102 mode='asuka'103 )104 if pretrained:105 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.0.0/AnimeFaceD-512x512-3e59ff.mat'106 model.load_state_dict(_download(checkpoint, progress=True))107 return model108def style_anime_face_e(pretrained=False):109 model = _m(110 layer_count=8,111 startf=32,112 maxf=512,113 truncation_psi=0.4,114 truncation_cutoff=8,115 mode='asuka'116 )117 if pretrained:118 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.0.0/AnimeFaceE-512x512-9cfc38.mat'119 model.load_state_dict(_download(checkpoint, progress=True))120 return model121def style_art_a(pretrained=False):122 model = _m(123 layer_count=9,124 startf=16,125 maxf=512,126 truncation_psi=0.75,127 truncation_cutoff=8,128 mode='normal'129 )130 if pretrained:131 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.4.0/WikiArts-1024x1024-439e92.mat'132 model.load_state_dict(_download(checkpoint, progress=True))133 return model134def style_art_b(pretrained=False):135 model = _m(136 layer_count=8,137 startf=32,138 maxf=512,139 truncation_psi=0.5,140 truncation_cutoff=8,141 mode='asuka'142 )143 if pretrained:144 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.4.1/WikiArts-512x512-5955f8.mat'145 model.load_state_dict(_download(checkpoint, progress=True))146 return model147def style_ukiyoe_faces(pretrained=False):148 model = _m(149 layer_count=8,150 startf=32,151 maxf=512,152 truncation_psi=0.5,153 truncation_cutoff=8,154 mode='asuka'155 )156 if pretrained:157 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.5.0/UkiyoeFaces-512x512-e1d576.mat'158 model.load_state_dict(_download(checkpoint, progress=True))159 return model160def style_ffhq(pretrained=False):161 model = _m(162 layer_count=9,163 startf=16,164 maxf=512,165 truncation_psi=0.75,166 truncation_cutoff=8,167 mode='normal'168 )169 if pretrained:170 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.2.0/FFHQ-1024x1024-4a40cc.mat'171 model.load_state_dict(_download(checkpoint, progress=True))172 return model173def style_celeba_hq(pretrained=False):174 model = _m(175 layer_count=9,176 startf=16,177 maxf=512,178 truncation_psi=0.75,179 truncation_cutoff=8,180 mode='normal'181 )182 if pretrained:183 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.3.0/CelebaHQ-1024x1024-b5920a.mat'184 model.load_state_dict(_download(checkpoint, progress=True))185 return model186def style_baby(pretrained=False):187 model = _m(188 layer_count=9,189 startf=16,190 maxf=512,191 truncation_psi=0.75,192 truncation_cutoff=8,193 mode='normal'194 )195 if pretrained:196 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.8.0/Baby-1024x1024-b7d3cd.mat'197 model.load_state_dict(_download(checkpoint, progress=True))198 return model199def style_wanghong(pretrained=False):200 model = _m(201 layer_count=9,202 startf=16,203 maxf=512,204 truncation_psi=0.75,205 truncation_cutoff=8,206 mode='normal'207 )208 if pretrained:209 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.4.0/WangHong-1024x1024-3aff9a.mat'210 model.load_state_dict(_download(checkpoint, progress=True))211 return model212def style_asian_people(pretrained=False):213 model = _m(214 layer_count=9,215 startf=16,216 maxf=512,217 truncation_psi=0.75,218 truncation_cutoff=8,219 mode='normal'220 )221 if pretrained:222 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.5.0/AsianPeople-1024x1024-82c02f' \223 '.mat '224 model.load_state_dict(_download(checkpoint, progress=True))225 return model226def style_asian_star(pretrained=False):227 model = _m(228 layer_count=9,229 startf=16,230 maxf=512,231 truncation_psi=0.75,232 truncation_cutoff=8,233 mode='normal'234 )235 if pretrained:236 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.6.0/AsianStar-1024x1024-aff808.mat'237 model.load_state_dict(_download(checkpoint, progress=True))238 return model239def style_super_star(pretrained=False):240 model = _m(241 layer_count=9,242 startf=16,243 maxf=512,244 truncation_psi=0.75,245 truncation_cutoff=8,246 mode='normal'247 )248 if pretrained:249 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v1.7.0/SuperStar-1024x1024-4141b4.mat'250 model.load_state_dict(_download(checkpoint, progress=True))251 return model252def style_vessel(pretrained=False):253 model = _m(254 layer_count=9,255 startf=16,256 maxf=512,257 truncation_psi=0.75,258 truncation_cutoff=8,259 mode='normal'260 )261 if pretrained:262 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.3.0/Vessel-1024x1024-ea0817.mat'263 model.load_state_dict(_download(checkpoint, progress=True))264 return model265def style_qinghua(pretrained=False):266 model = _m(267 layer_count=9,268 startf=16,269 maxf=512,270 truncation_psi=0.75,271 truncation_cutoff=8,272 mode='normal'273 )274 if pretrained:275 checkpoint = 'https://github.com/GalAster/StyleGAN-Zoo/releases/download/v2.3.1/QingHua-1024x1024-649fe8.mat'276 model.load_state_dict(_download(checkpoint, progress=True))...

Full Screen

Full Screen

conanfile.py

Source:conanfile.py Github

copy

Full Screen

...13 def source(self):14 # download OpenGL headers from the Khronos Registry https://www.khronos.org/registry/OpenGL/index_gl.php15 for directory in ["GL", 'KHR', "EGL", "GLES", "GLES2", "GLES3"]:16 os.makedirs(directory)17 def _download(url, sha256):18 from six.moves.urllib.parse import urlparse19 filename = os.path.basename(urlparse(url).path)20 tools.download(url, filename)21 tools.check_sha256(filename, sha256)22 with tools.chdir("GL"):23 _download("https://www.khronos.org/registry/OpenGL/api/GL/glext.h",24 "3e7f19e54717473a8882050b00ed982dc59fe929afcab6c4beb19891d5cf784a")25 _download("https://www.khronos.org/registry/OpenGL/api/GL/glcorearb.h",26 "68e25c8ff756195574b6e329b4666c205c5f5a26b4632a5ffd9f377631655f65")27 _download("https://www.khronos.org/registry/OpenGL/api/GL/glxext.h",28 "c1386ade12a9ea0986eb1e3ac8038d08ef4b5dd31949047905a458f22787457c")29 _download("https://www.khronos.org/registry/OpenGL/api/GL/wglext.h",30 "f581bd8340b3a41abc07c4b0144537cab76bc6ad759ae4929ec2159d336a988b")31 with tools.chdir("KHR"):32 _download("https://www.khronos.org/registry/EGL/api/KHR/khrplatform.h",33 "bbca133eec0bd0b62fc6f8d27d993aedda3c79f0de8ad3637f8cf42ffbeb8e7b")34 with tools.chdir("EGL"):35 _download("https://www.khronos.org/registry/EGL/api/EGL/egl.h",36 "70207b48ccd7257473ae7517c2a9cab3f8268e073df303e58df66a2ac171f75c")37 _download("https://www.khronos.org/registry/EGL/api/EGL/eglext.h",38 "5045357621c4c0729e6f3c425788a5837dcfdcb09d256cb7e9f96918fb2836a0")39 _download("https://www.khronos.org/registry/EGL/api/EGL/eglplatform.h",40 "bce59928d5b82d5ed799c291d273d6f8fe44428beffcb48556ad90a23ac7754f")41 with tools.chdir("GLES"):42 _download("https://www.khronos.org/registry/OpenGL/api/GLES/gl.h",43 "2f1d453d859f4e73a02ae720b962198c0adea91492ddc6f9404e764e18671845")44 _download("https://www.khronos.org/registry/OpenGL/api/GLES/glext.h",45 "ae395b86cb96f325b526cfc5bbde4e0c17f411f8c74f554f8219d093d31f0cba")46 _download("https://www.khronos.org/registry/OpenGL/api/GLES/glplatform.h",47 "857bf0685ecb0dddf692157ea9ef98c95e9f58b5ed0c41b26fd3fe51ed1a3624")48 _download("https://www.khronos.org/registry/OpenGL/api/GLES/egl.h",49 "1ba84c782436b5e103cd1ee8060840846b96ec4727d00944cee59d1c44db0dda")50 with tools.chdir("GLES2"):51 _download("https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h",52 "64fae5ff4a48463468be60439ea5869ebcb77cc80306538cad28ebb8e0a04299")53 _download("https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h",54 "551e4082c1630e784a2397b64c748b3575ff43e200bd1658aca207f68d919828")55 _download("https://www.khronos.org/registry/OpenGL/api/GLES2/gl2platform.h",56 "8f25443c4c5b3c8e702c3510f12b6ec8c23c2e3c1ca1c71bb07d148653696d9a")57 with tools.chdir("GLES3"):58 _download("https://www.khronos.org/registry/OpenGL/api/GLES3/gl3.h",59 "b71b52974d2fdb2ccf49632bfb13f262f979c2179d0dd4f4b7718d2521065e17")60 _download("https://www.khronos.org/registry/OpenGL/api/GLES3/gl31.h",61 "7fb6d736b3e2a4036f279e654230f6cd04ddfb564f5505c39036316fe40c9e94")62 _download("https://www.khronos.org/registry/OpenGL/api/GLES3/gl32.h",63 "a2cfd7d890f16f67665e01e6f514a7c75bfc702e50c8861a44d04536271fffd1")64 _download("https://www.khronos.org/registry/OpenGL/api/GLES2/gl2ext.h",65 "551e4082c1630e784a2397b64c748b3575ff43e200bd1658aca207f68d919828")66 _download("https://www.khronos.org/registry/OpenGL/api/GLES3/gl3platform.h",67 "b4595aafef1eb9b4705cf8a69e29aadb8eb8e3dd3baf8b34ab702c9174dcb549")68 def package_id(self):69 self.info.header_only()70 def package(self):71 self.copy(pattern="LICENSE", dst="licenses", src=".")72 self.copy(pattern="*.h", dst="include", src=".", keep_path=True)73 def package_info(self):74 if self.settings.os == "Macos":75 self.cpp_info.defines.append("GL_SILENCE_DEPRECATION=1")76 self.cpp_info.exelinkflags.append("-framework OpenGL")77 self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags78 elif str(self.settings.os) in ["iOS", "watchOS", "tvOS"]:79 self.cpp_info.exelinkflags.append("-framework OpenGLES")80 self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags...

Full Screen

Full Screen

RecordFailure.py

Source:RecordFailure.py Github

copy

Full Screen

1import pandas as pd2import datetime3import json4import os5def record_download(station, time, message='fail'):6 filepath = 'cache/data/' + station + '/download.json'7 if os.path.exists(filepath):8 with open(filepath, 'r+') as f:9 _download = json.load(f)10 else:11 _download = dict()12 if message == 'success':13 _download[time] = 014 elif message == 'inter':15 _download[time] = -116 elif message == 'missing':17 _download[time] = -218 else:19 try:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful