Best JavaScript code snippet using playwright-internal
shared.py
Source:shared.py
1# this_is_shared = "test of shared global"2#import copy3#from isp import skill_has_products4extra_cmd_prompts = {}5noise = "https://duy7y3nglgmh.cloudfront.net/FootballCrowdSound.mp3"6noise2 = "https://duy7y3nglgmh.cloudfront.net/SoccerStadiumSoundEffect.mp3"7noise3 = "https://duy7y3nglgmh.cloudfront.net/SportsStadiumCrowdCheering.mp3"8noise4 = "https://duy7y3nglgmh.cloudfront.net/116351765-soccer-crowd-huge-stadium-chee.mp3"9noise5 = "https://duy7y3nglgmh.cloudfront.net/027693942-soccer-stadium-crowd-chant-and.mp3"10noise6 = "https://duy7y3nglgmh.cloudfront.net/032526273-soccer-stadium-crowd-chant-and.mp3"11noise7 = "https://duy7y3nglgmh.cloudfront.net/043966652-football-stadium-ambience-socc.mp3"12noises = [noise,noise2,noise3,noise4,noise5,noise6,noise7]13noise_max_millis = 4 * 60 * 100014noise2_max_millis = 40 * 100015noise3_max_millis = 40 * 100016doc = "doc://alexa/apla/documents/unchanged_template_from_tools"17championship_table = {18 "dataTable": {19 "type": "object",20 "back": "Back",21 "properties": {22 "headings": [23 "",24 "Team",25 "Games",26 "Wins",27 "Draws",28 "Losses",29 "GD",30 "Points" 31 ],32 "rows": [33 {"backgroundColor": "green","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},34 {"backgroundColor": "green","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},35 {"backgroundColor": "blue","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},36 {"backgroundColor": "blue","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},37 {"backgroundColor": "blue","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},38 {"backgroundColor": "blue","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},39 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},40 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},41 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},42 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},43 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},44 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},45 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},46 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},47 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},48 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},49 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},50 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},51 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},52 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},53 {"backgroundColor": "black","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},54 {"backgroundColor": "red","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},55 {"backgroundColor": "red","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},56 {"backgroundColor": "red","cells": [{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},57 ],58 }59 60 } 61}62foo_table = {63 "dataTable": {64 "type": "object",65 "back": "Back",66 "properties": {67 "headings": [68 "",69 "Team",70 "Games",71 "Wins",72 "Draws",73 "Losses",74 "GF",75 "GA",76 "GD",77 "Points" 78 ],79 "rows": [80 {"backgroundColor": "goldenrod","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},81 {"backgroundColor": "green","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},82 {"backgroundColor": "green","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},83 {"backgroundColor": "green","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},84 {"backgroundColor": "blue","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},85 {"backgroundColor": "blue","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},86 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},87 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},88 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},89 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},90 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},91 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},92 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},93 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},94 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},95 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},96 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},97 {"backgroundColor": "red","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},98 {"backgroundColor": "red","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},99 {"backgroundColor": "red","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},100 101 ],102 "rows_old": [103 ["a","b","c", "d","e","f","g","h","I","J"],104 ["a","b","c", "d","e","f","g","h","I","J"],105 ["a","b","c", "d","e","f","g","h","I","J"],106 ["a","b","c", "d","e","f","g","h","I","J"],107 ["a","b","c", "d","e","f","g","h","I","J"],108 ["a","b","c", "d","e","f","g","h","I","J"],109 ["a","b","c", "d","e","f","g","h","I","J"],110 ["a","b","c", "d","e","f","g","h","I","J"],111 ["a","b","c", "d","e","f","g","h","I","J"],112 ["a","b","c", "d","e","f","g","h","I","J"],113 ["a","b","c", "d","e","f","g","h","I","J"],114 ["a","b","c", "d","e","f","g","h","I","J"],115 ["a","b","c", "d","e","f","g","h","I","J"],116 ["a","b","c", "d","e","f","g","h","I","J"],117 ["a","b","c", "d","e","f","g","h","I","J"],118 ["a","b","c", "d","e","f","g","h","I","J"],119 ["a","b","c", "d","e","f","g","h","I","J"],120 ["a","b","c", "d","e","f","g","h","I","J"],121 ["a","b","c", "d","e","f","g","h","I","J"],122 ["a","b","c", "d","e","f","g","h","I","J"],123 ]124 }125 }126}127results_table = {128 "dataTable": {129 "type": "object",130 "back": "Back",131 "properties": {132 "headings": [133 "",134 "",135 "" 136 ],137 "rows": [138 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},139 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},140 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},141 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},142 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},143 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},144 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},145 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},146 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},147 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},148 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},149 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},150 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},151 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},152 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},153 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},154 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},155 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},156 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},157 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},158 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},159 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},160 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},161 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},162 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},163 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},164 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},165 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},166 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},167 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},168 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},169 ]170 }171 }172}173portrait_table_results = {174 "dataTable": {175 "type": "object",176 "back": "Back",177 "properties": {178 "headings": [179 "",180 "Team",181 "Games",182 "Wins",183 "Draws",184 "Losses",185 "GF",186 "GA",187 "GD",188 "Points" 189 ],190 "rows": [191 {"backgroundColor": "goldenrod","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},192 {"backgroundColor": "green","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},193 {"backgroundColor": "green","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},194 {"backgroundColor": "green","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},195 {"backgroundColor": "blue","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},196 {"backgroundColor": "blue","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},197 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},198 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},199 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},200 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},201 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},202 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},203 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},204 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},205 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},206 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},207 {"backgroundColor": "black","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},208 {"backgroundColor": "red","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},209 {"backgroundColor": "red","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},210 {"backgroundColor": "red","cells": [{"text": "a"},{"text": "b"},{"text": "c"},{"text": "d"},{"text": "e"},{"text": "f"},{"text": "g"},{"text": "h"},{"text": "I"},{"text": "J"}]},211 212 ]213 }214 }, 215 "dataTable2": {216 "type": "object",217 "back": "Back",218 "properties": {219 "headings": [220 "",221 "",222 "" 223 ],224 "rows": [225 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},226 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},227 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},228 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},229 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},230 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},231 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},232 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},233 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},234 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},235 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},236 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},237 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},238 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},239 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},240 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},241 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},242 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},243 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},244 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},245 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},246 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},247 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},248 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},249 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},250 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},251 {"backgroundColor": "grey","cells": [{"text": "a"},{"text": "b"},{"text": "c"}]},252 ]253 }254 }255}256real_results_table = {257 "dataTable": {258 "type": "object",259 "back": "Back",260 "properties": {261 "headings": [262 "",263 "Team",264 "Team",265 "Team",266 "Team",267 "Team",268 "Team",269 "GP",270 "Win"271 ],272 "rows": [273 {274 "backgroundColor": "black",275 "cells": [276 {277 "text": "https://duy7y3nglgmh.cloudfront.net/Arsenal.png",278 "istext": "False"279 },280 {281 "text": "Arsenal",282 "istext": "True",283 "backgroundColor": "purple",284 "color": "white",285 "width": "36%"286 },287 {288 "text": "3-1",289 "istext": "True",290 "backgroundColor": "yellow",291 "color": "black",292 "width": "7%",293 "textAlign": "center"294 },295 {296 "text": "Liverpool",297 "istext": "True",298 "backgroundColor": "purple",299 "color": "white",300 "width": "36%"301 },302 {303 "text": "https://duy7y3nglgmh.cloudfront.net/Liverpool.png",304 "istext": "False"305 }306 ]307 },308 {309 "backgroundColor": "black",310 "cells": [311 {312 "text": "https://duy7y3nglgmh.cloudfront.net/TottenhamHotspur.png",313 "istext": "False"314 },315 {316 "text": "Tottenham",317 "istext": "True",318 "backgroundColor": "purple",319 "color": "white",320 "width": "36%"321 },322 {323 "text": "0-5",324 "istext": "True",325 "backgroundColor": "yellow",326 "color": "black",327 "width": "7%",328 "textAlign": "center"329 },330 {331 "text": "Everton",332 "istext": "True",333 "backgroundColor": "purple",334 "color": "white",335 "width": "36%"336 },337 {338 "text": "https://duy7y3nglgmh.cloudfront.net/Everton.png",339 "istext": "False"340 }341 ]342 },343 {344 "backgroundColor": "black",345 "cells": [346 {347 "text": "https://duy7y3nglgmh.cloudfront.net/LeicesterCity.png",348 "istext": "False"349 },350 {351 "text": "Leicester City",352 "istext": "True",353 "backgroundColor": "purple",354 "color": "white",355 "width": "36%"356 },357 {358 "text": "2-1",359 "istext": "True",360 "backgroundColor": "yellow",361 "color": "black",362 "width": "7%",363 "textAlign": "center"364 },365 {366 "text": "Manchester United",367 "istext": "True",368 "backgroundColor": "purple",369 "color": "white",370 "width": "36%"371 },372 {373 "text": "https://duy7y3nglgmh.cloudfront.net/ManchesterUnited.png",374 "istext": "False"375 }376 ]377 },378 {379 "backgroundColor": "black",380 "cells": [381 {382 "text": "https://duy7y3nglgmh.cloudfront.net/Chelsea.png",383 "istext": "False"384 },385 {386 "text": "Chelsea",387 "istext": "True",388 "backgroundColor": "purple",389 "color": "white",390 "width": "36%"391 },392 {393 "text": "7-10",394 "istext": "True",395 "backgroundColor": "yellow",396 "color": "black",397 "width": "7%",398 "textAlign": "center"399 },400 {401 "text": "Norwich",402 "istext": "True",403 "backgroundColor": "purple",404 "color": "white",405 "width": "36%"406 },407 {408 "text": "https://duy7y3nglgmh.cloudfront.net/NorwichCity.png",409 "istext": "False"410 }411 ]412 },413 {414 "backgroundColor": "black",415 "cells": [416 {417 "text": "https://duy7y3nglgmh.cloudfront.net/CrystalPalace.png",418 "istext": "False"419 },420 {421 "text": "CrystalPalace",422 "istext": "True",423 "backgroundColor": "purple",424 "color": "white",425 "width": "36%"426 },427 {428 "text": "1-1",429 "istext": "True",430 "backgroundColor": "yellow",431 "color": "black",432 "width": "7%",433 "textAlign": "center"434 },435 {436 "text": "Newcastle",437 "istext": "True",438 "backgroundColor": "purple",439 "color": "white",440 "width": "36%"441 },442 {443 "text": "https://duy7y3nglgmh.cloudfront.net/NewcastleUnited.png",444 "istext": "False"445 }446 ]447 },448 {449 "backgroundColor": "black",450 "cells": [451 {452 "text": "https://duy7y3nglgmh.cloudfront.net/Everton.png",453 "istext": "False"454 },455 {456 "text": "Everton",457 "istext": "True",458 "backgroundColor": "purple",459 "color": "white",460 "width": "36%"461 },462 {463 "text": "2-5",464 "istext": "True",465 "backgroundColor": "yellow",466 "color": "black",467 "width": "7%",468 "textAlign": "center"469 },470 {471 "text": "Watford",472 "istext": "True",473 "backgroundColor": "purple",474 "color": "white",475 "width": "36%"476 },477 {478 "text": "https://duy7y3nglgmh.cloudfront.net/Watford.png",479 "istext": "False"480 }481 ]482 },483 {484 "backgroundColor": "black",485 "cells": [486 {487 "text": "https://duy7y3nglgmh.cloudfront.net/LeedsUnited.png",488 "istext": "False"489 },490 {491 "text": "Leeds",492 "istext": "True",493 "backgroundColor": "purple",494 "color": "white",495 "width": "36%"496 },497 {498 "text": "1-1",499 "istext": "True",500 "backgroundColor": "yellow",501 "color": "black",502 "width": "7%",503 "textAlign": "center"504 },505 {506 "text": "Wolverhanpton",507 "istext": "True",508 "backgroundColor": "purple",509 "color": "white",510 "width": "36%"511 },512 {513 "text": "https://duy7y3nglgmh.cloudfront.net/WolverhamptonWanderers.png",514 "istext": "False"515 }516 ]517 },518 {519 "backgroundColor": "black",520 "cells": [521 {522 "text": "https://duy7y3nglgmh.cloudfront.net/Southampton.png",523 "istext": "False"524 },525 {526 "text": "Southampton",527 "istext": "True",528 "backgroundColor": "purple",529 "color": "white",530 "width": "36%"531 },532 {533 "text": "2-2",534 "istext": "True",535 "backgroundColor": "yellow",536 "color": "black",537 "width": "7%",538 "textAlign": "center"539 },540 {541 "text": "Burnley",542 "istext": "True",543 "backgroundColor": "purple",544 "color": "white",545 "width": "36%"546 },547 {548 "text": "https://duy7y3nglgmh.cloudfront.net/Burnley.png",549 "istext": "False"550 }551 ]552 },553 {554 "backgroundColor": "black",555 "cells": [556 {557 "text": "https://duy7y3nglgmh.cloudfront.net/BrightonAndHoveAlbion.png",558 "istext": "False"559 },560 {561 "text": "Brighton",562 "istext": "True",563 "backgroundColor": "purple",564 "color": "white",565 "width": "36%"566 },567 {568 "text": "2-1",569 "istext": "True",570 "backgroundColor": "yellow",571 "color": "black",572 "width": "7%",573 "textAlign": "center"574 },575 {576 "text": "Manchester City",577 "istext": "True",578 "backgroundColor": "purple",579 "color": "white",580 "width": "36%"581 },582 {583 "text": "https://duy7y3nglgmh.cloudfront.net/ManchesterCity.png",584 "istext": "False"585 }586 ]587 },588 {589 "backgroundColor": "black",590 "cells": [591 {592 "text": "https://duy7y3nglgmh.cloudfront.net/LeicesterCity.png",593 "istext": "False"594 },595 {596 "text": "Leicester City",597 "istext": "True",598 "backgroundColor": "purple",599 "color": "white",600 "width": "36%"601 },602 {603 "text": "2-1",604 "istext": "True",605 "backgroundColor": "yellow",606 "color": "black",607 "width": "7%",608 "textAlign": "center"609 },610 {611 "text": "Manchester United",612 "istext": "True",613 "backgroundColor": "purple",614 "color": "white",615 "width": "36%"616 },617 {618 "text": "https://duy7y3nglgmh.cloudfront.net/ManchesterUnited.png",619 "istext": "False"620 }621 ]622 },623 {624 "backgroundColor": "black",625 "cells": [626 {627 "text": "https://duy7y3nglgmh.cloudfront.net/Arsenal.png",628 "istext": "False"629 },630 {631 "text": "Arsenal",632 "istext": "True",633 "backgroundColor": "purple",634 "color": "white",635 "width": "36%"636 },637 {638 "text": "3-1",639 "istext": "True",640 "backgroundColor": "yellow",641 "color": "black",642 "width": "7%",643 "textAlign": "center"644 },645 {646 "text": "Liverpool",647 "istext": "True",648 "backgroundColor": "purple",649 "color": "white",650 "width": "36%"651 },652 {653 "text": "https://duy7y3nglgmh.cloudfront.net/Liverpool.png",654 "istext": "False"655 }656 ]657 },658 {659 "backgroundColor": "black",660 "cells": [661 {662 "text": "https://duy7y3nglgmh.cloudfront.net/TottenhamHotspur.png",663 "istext": "False"664 },665 {666 "text": "Tottenham",667 "istext": "True",668 "backgroundColor": "purple",669 "color": "white",670 "width": "36%"671 },672 {673 "text": "0-5",674 "istext": "True",675 "backgroundColor": "yellow",676 "color": "black",677 "width": "7%",678 "textAlign": "center"679 },680 {681 "text": "Everton",682 "istext": "True",683 "backgroundColor": "purple",684 "color": "white",685 "width": "36%"686 },687 {688 "text": "https://duy7y3nglgmh.cloudfront.net/Everton.png",689 "istext": "False"690 }691 ]692 },693 {694 "backgroundColor": "black",695 "cells": [696 {697 "text": "https://duy7y3nglgmh.cloudfront.net/LeicesterCity.png",698 "istext": "False"699 },700 {701 "text": "Leicester City",702 "istext": "True",703 "backgroundColor": "purple",704 "color": "white",705 "width": "36%"706 },707 {708 "text": "2-1",709 "istext": "True",710 "backgroundColor": "yellow",711 "color": "black",712 "width": "7%",713 "textAlign": "center"714 },715 {716 "text": "Manchester United",717 "istext": "True",718 "backgroundColor": "purple",719 "color": "white",720 "width": "36%"721 },722 {723 "text": "https://duy7y3nglgmh.cloudfront.net/ManchesterUnited.png",724 "istext": "False"725 }726 ]727 },728 {729 "backgroundColor": "black",730 "cells": [731 {732 "text": "https://duy7y3nglgmh.cloudfront.net/Chelsea.png",733 "istext": "False"734 },735 {736 "text": "Chelsea",737 "istext": "True",738 "backgroundColor": "purple",739 "color": "white",740 "width": "36%"741 },742 {743 "text": "7-10",744 "istext": "True",745 "backgroundColor": "yellow",746 "color": "black",747 "width": "7%",748 "textAlign": "center"749 },750 {751 "text": "Norwich",752 "istext": "True",753 "backgroundColor": "purple",754 "color": "white",755 "width": "36%"756 },757 {758 "text": "https://duy7y3nglgmh.cloudfront.net/NorwichCity.png",759 "istext": "False"760 }761 ]762 },763 {764 "backgroundColor": "black",765 "cells": [766 {767 "text": "https://duy7y3nglgmh.cloudfront.net/CrystalPalace.png",768 "istext": "False"769 },770 {771 "text": "CrystalPalace",772 "istext": "True",773 "backgroundColor": "purple",774 "color": "white",775 "width": "36%"776 },777 {778 "text": "1-1",779 "istext": "True",780 "backgroundColor": "yellow",781 "color": "black",782 "width": "7%",783 "textAlign": "center"784 },785 {786 "text": "Newcastle",787 "istext": "True",788 "backgroundColor": "purple",789 "color": "white",790 "width": "36%"791 },792 {793 "text": "https://duy7y3nglgmh.cloudfront.net/NewcastleUnited.png",794 "istext": "False"795 }796 ]797 },798 {799 "backgroundColor": "black",800 "cells": [801 {802 "text": "https://duy7y3nglgmh.cloudfront.net/Everton.png",803 "istext": "False"804 },805 {806 "text": "Everton",807 "istext": "True",808 "backgroundColor": "purple",809 "color": "white",810 "width": "36%"811 },812 {813 "text": "2-5",814 "istext": "True",815 "backgroundColor": "yellow",816 "color": "black",817 "width": "7%",818 "textAlign": "center"819 },820 {821 "text": "Watford",822 "istext": "True",823 "backgroundColor": "purple",824 "color": "white",825 "width": "36%"826 },827 {828 "text": "https://duy7y3nglgmh.cloudfront.net/Watford.png",829 "istext": "False"830 }831 ]832 },833 {834 "backgroundColor": "black",835 "cells": [836 {837 "text": "https://duy7y3nglgmh.cloudfront.net/LeedsUnited.png",838 "istext": "False"839 },840 {841 "text": "Leeds",842 "istext": "True",843 "backgroundColor": "purple",844 "color": "white",845 "width": "36%"846 },847 {848 "text": "1-1",849 "istext": "True",850 "backgroundColor": "yellow",851 "color": "black",852 "width": "7%",853 "textAlign": "center"854 },855 {856 "text": "Wolverhanpton",857 "istext": "True",858 "backgroundColor": "purple",859 "color": "white",860 "width": "36%"861 },862 {863 "text": "https://duy7y3nglgmh.cloudfront.net/WolverhamptonWanderers.png",864 "istext": "False"865 }866 ]867 },868 {869 "backgroundColor": "black",870 "cells": [871 {872 "text": "https://duy7y3nglgmh.cloudfront.net/Southampton.png",873 "istext": "False"874 },875 {876 "text": "Southampton",877 "istext": "True",878 "backgroundColor": "purple",879 "color": "white",880 "width": "36%"881 },882 {883 "text": "2-2",884 "istext": "True",885 "backgroundColor": "yellow",886 "color": "black",887 "width": "7%",888 "textAlign": "center"889 },890 {891 "text": "Burnley",892 "istext": "True",893 "backgroundColor": "purple",894 "color": "white",895 "width": "36%"896 },897 {898 "text": "https://duy7y3nglgmh.cloudfront.net/Burnley.png",899 "istext": "False"900 }901 ]902 },903 {904 "backgroundColor": "black",905 "cells": [906 {907 "text": "https://duy7y3nglgmh.cloudfront.net/BrightonAndHoveAlbion.png",908 "istext": "False"909 },910 {911 "text": "Brighton",912 "istext": "True",913 "backgroundColor": "purple",914 "color": "white",915 "width": "36%"916 },917 {918 "text": "2-1",919 "istext": "True",920 "backgroundColor": "yellow",921 "color": "black",922 "width": "7%",923 "textAlign": "center"924 },925 {926 "text": "Manchester City",927 "istext": "True",928 "backgroundColor": "purple",929 "color": "white",930 "width": "36%"931 },932 {933 "text": "https://duy7y3nglgmh.cloudfront.net/ManchesterCity.png",934 "istext": "False"935 }936 ]937 },938 {939 "backgroundColor": "black",940 "cells": [941 {942 "text": "https://duy7y3nglgmh.cloudfront.net/LeicesterCity.png",943 "istext": "False"944 },945 {946 "text": "Leicester City",947 "istext": "True",948 "backgroundColor": "purple",949 "color": "white",950 "width": "36%"951 },952 {953 "text": "2-1",954 "istext": "True",955 "backgroundColor": "yellow",956 "color": "black",957 "width": "7%",958 "textAlign": "center"959 },960 {961 "text": "Manchester United",962 "istext": "True",963 "backgroundColor": "purple",964 "color": "white",965 "width": "36%"966 },967 {968 "text": "https://duy7y3nglgmh.cloudfront.net/ManchesterUnited.png",969 "istext": "False"970 }971 ]972 }973 ]974 }975 }976}977other_leagues = {978 "gridListData": {979 "type": "object",980 "objectId": "gridListSample",981 "backgroundImage": {982 "contentDescription": "this is the content",983 "smallSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",984 "largeSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",985 "sources": [986 {987 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",988 "size": "small",989 "widthPixels": 0,990 "heightPixels": 0991 },992 {993 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",994 "size": "large",995 "widthPixels": 0,996 "heightPixels": 0997 }998 ]999 },1000 "title": "You can ask about ....",1001 "listItems": [1002 {1003 "primaryText": "Championship",1004 "imageSource": "https://duy7y3nglgmh.cloudfront.net/EFL2.png",1005 "primaryAction": [{"type": "SendEvent","arguments": ["championship"]}]1006 },1007 {1008 "primaryText": "Bundesliga",1009 "imageSource": "https://duy7y3nglgmh.cloudfront.net/bundesliga-logo-vector.gif",1010 "primaryAction": [{"type": "SendEvent","arguments": ["bundesliga"]}]1011 },1012 {1013 "primaryText": "La Liga",1014 "imageSource": "https://duy7y3nglgmh.cloudfront.net/la-liga-logo.png",1015 "primaryAction": [{"type": "SendEvent","arguments": ["laliga"]}]1016 },1017 {1018 "primaryText": "Serie A ",1019 "imageSource": "https://duy7y3nglgmh.cloudfront.net/serie-a-vector-logo.png",1020 "primaryAction": [{"type": "SendEvent","arguments": ["serie_a"]}]1021 },1022 {1023 "primaryText": "",1024 "imageSource": "https://duy7y3nglgmh.cloudfront.net/back.png",1025 "primaryAction": [{"type": "SendEvent","arguments": ["goBack"]}]1026 } 1027 ]1028 } 1029}1030statistics = {1031 "gridListData": {1032 "type": "object",1033 "objectId": "gridListSample",1034 "backgroundImage": {1035 "contentDescription": "this is the content",1036 "smallSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1037 "largeSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1038 "sources": [1039 {1040 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1041 "size": "small",1042 "widthPixels": 0,1043 "heightPixels": 01044 },1045 {1046 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1047 "size": "large",1048 "widthPixels": 0,1049 "heightPixels": 01050 }1051 ]1052 },1053 "title": "You can ask about ....",1054 "listItems": [1055 {1056 "primaryText": "Clean Sheets",1057 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_keeper.jpg",1058 "primaryAction": [{"type": "SendEvent","arguments": ["cleansheet"]}]1059 },1060 {1061 "primaryText": "Fouls",1062 "imageSource": "https://duy7y3nglgmh.cloudfront.net/fouls.png",1063 "primaryAction": [{"type": "SendEvent","arguments": ["fouls"]}]1064 },1065 {1066 "primaryText": "Goals",1067 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_goal.jpg",1068 "primaryAction": [{"type": "SendEvent","arguments": ["goals"]}]1069 },1070 {1071 "primaryText": "Red Card",1072 "imageSource": "https://duy7y3nglgmh.cloudfront.net/redcard.png",1073 "primaryAction": [{"type": "SendEvent","arguments": ["redcard"]}]1074 },1075 {1076 "primaryText": "Relegation",1077 "imageSource": "https://duy7y3nglgmh.cloudfront.net/relegation.png",1078 "primaryAction": [{"type": "SendEvent","arguments": ["relegation"]}]1079 },1080 {1081 "primaryText": "Tackles",1082 "imageSource": "https://duy7y3nglgmh.cloudfront.net/tackles.png",1083 "primaryAction": [{"type": "SendEvent","arguments": ["tackles"]}]1084 },1085 {1086 "primaryText": "Touches",1087 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_touches.jpg",1088 "primaryAction": [{"type": "SendEvent","arguments": ["touches"]}]1089 },1090 {1091 "primaryText": "Yellow Card",1092 "imageSource": "https://duy7y3nglgmh.cloudfront.net/yellowcard.png",1093 "primaryAction": [{"type": "SendEvent","arguments": ["yellowcard"]}]1094 },1095 {1096 "primaryText": "",1097 "imageSource": "https://duy7y3nglgmh.cloudfront.net/back.png",1098 "primaryAction": [{"type": "SendEvent","arguments": ["goBack"]}]1099 } 1100 ]1101 }1102}1103basic_charts = {1104 "gridListData": {1105 "type": "object",1106 "objectId": "gridListSample",1107 "backgroundImage": {1108 "contentDescription": "this is the content",1109 "smallSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1110 "largeSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1111 "sources": [1112 {1113 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1114 "size": "small",1115 "widthPixels": 0,1116 "heightPixels": 01117 },1118 {1119 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1120 "size": "large",1121 "widthPixels": 0,1122 "heightPixels": 01123 }1124 ]1125 },1126 "title": "Basic Charts",1127 "listItems": [1128 {1129 "primaryText": "Points By Week",1130 "imageSource": "https://duy7y3nglgmh.cloudfront.net/linechart.png",1131 "primaryAction": [{"type": "SendEvent","arguments": ["line"]}]1132 },1133 {1134 "primaryText": "Goal Difference",1135 "imageSource": "https://duy7y3nglgmh.cloudfront.net/GoalDifference.png",1136 "primaryAction": [{"type": "SendEvent","arguments": ["goaldifference"]}]1137 },1138 {1139 "primaryText": "Keeper Saves vs Goals",1140 "imageSource": "https://duy7y3nglgmh.cloudfront.net/savepercent.png",1141 "primaryAction": [{"type": "SendEvent","arguments": ["savepercent"]}]1142 },1143 {1144 "primaryText": "Goals vs Shots",1145 "imageSource": "https://duy7y3nglgmh.cloudfront.net/goals_shots.png",1146 "primaryAction": [{"type": "SendEvent","arguments": ["goals_shots"]}]1147 },1148 {1149 "primaryText": "Referees",1150 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_referee.jpg",1151 "primaryAction": [{"type": "SendEvent","arguments": ["referee"]}]1152 },1153 {1154 "primaryText": "",1155 "imageSource": "https://duy7y3nglgmh.cloudfront.net/back.png",1156 "primaryAction": [{"type": "SendEvent","arguments": ["goBack"]}]1157 } 1158 ]1159 }1160 }1161advanced_charts = {1162 "gridListData": {1163 "type": "object",1164 "objectId": "gridListSample",1165 "backgroundImage": {1166 "contentDescription": "this is the content",1167 "smallSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1168 "largeSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1169 "sources": [1170 {1171 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1172 "size": "small",1173 "widthPixels": 0,1174 "heightPixels": 01175 },1176 {1177 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1178 "size": "large",1179 "widthPixels": 0,1180 "heightPixels": 01181 }1182 ]1183 },1184 "title": "Advanced Analytics",1185 "listItems": [1186 {1187 "primaryText": "Attendance By Team",1188 "imageSource": "https://duy7y3nglgmh.cloudfront.net/attendance.png",1189 "primaryAction": [{"type": "SendEvent","arguments": ["attendance"]}]1190 },1191 {1192 "primaryText": "Possession By Team",1193 "imageSource": "https://duy7y3nglgmh.cloudfront.net/possession3.png",1194 "imageScpurchase advanced analyticsale": "best-fill",1195 "primaryAction": [{"type": "SendEvent","arguments": ["possession"]}]1196 },1197 {1198 "primaryText": "$ Goals In/Out Of Box",1199 "imageSource": "https://duy7y3nglgmh.cloudfront.net/long_shot.png",1200 "imageScale": "best-fill",1201 "primaryAction": [{"type": "SendEvent","arguments": ["in_out_box"]}]1202 },1203 {1204 "primaryText": "$ Corners By Team",1205 "imageSource": "https://duy7y3nglgmh.cloudfront.net/corners.png",1206 "imageScale": "best-fill",1207 "primaryAction": [{"type": "SendEvent","arguments": ["corners"]}]1208 },1209 {1210 "primaryText": "$ Offside",1211 "imageSource": "https://duy7y3nglgmh.cloudfront.net/offside2.png",1212 "imageScale": "best-fit",1213 "primaryAction": [{"type": "SendEvent","arguments": ["offside"]}]1214 },1215 {1216 "primaryText": "$ VAR Decisions",1217 "imageSource": "https://duy7y3nglgmh.cloudfront.net/var.png",1218 "imageScale": "best-fit",1219 "primaryAction": [{"type": "SendEvent","arguments": ["var"]}]1220 },1221 {1222 "primaryText": "$ Table Rank Changes",1223 "imageSource": "https://duy7y3nglgmh.cloudfront.net/rankchanges.png",1224 "imageScale": "best-fit",1225 "primaryAction": [{"type": "SendEvent","arguments": ["rankchanges"]}]1226 },1227 {1228 "primaryText": "",1229 "imageSource": "https://duy7y3nglgmh.cloudfront.net/back.png",1230 "primaryAction": [{"type": "SendEvent","arguments": ["goBack"]}]1231 } 1232 ]1233 }1234}1235datasources2 = {1236 "gridListData": {1237 "type": "object",1238 "objectId": "gridListSample",1239 "backgroundImage": {1240 "contentDescription": "this is the content",1241 "smallSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1242 "largeSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1243 "sources": [1244 {1245 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1246 "size": "small",1247 "widthPixels": 0,1248 "heightPixels": 01249 },1250 {1251 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1252 "size": "large",1253 "widthPixels": 0,1254 "heightPixels": 01255 }1256 ]1257 },1258 "title": "You can ask about ....",1259 "listItems": [1260 {1261 "primaryText": "The Table",1262 "imageSource": "https://duy7y3nglgmh.cloudfront.net/thetable.png",1263 "primaryAction": [{"type": "SendEvent","arguments": ["table"]}]1264 },1265 {1266 "primaryText": "Fixtures",1267 "imageSource": "https://duy7y3nglgmh.cloudfront.net/fixtures.png",1268 "primaryAction": [{"type": "SendEvent","arguments": ["fixtures"]}]1269 },1270 {1271 "primaryText": "Results",1272 "imageSource": "https://duy7y3nglgmh.cloudfront.net/results2.png",1273 "primaryAction": [{"type": "SendEvent","arguments": ["results"]}]1274 },1275 {1276 "primaryText": "Teams",1277 "imageSource": "https://duy7y3nglgmh.cloudfront.net/teams.png",1278 "primaryAction": [{"type": "SendEvent","arguments": ["teams"]}]1279 },1280 {1281 "primaryText": "Basic Charts",1282 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_119312334_XL.jpg",1283 "primaryAction": [{"type": "SendEvent","arguments": ["basic_charts"]}]1284 },1285 {1286 "primaryText": "$ Advanced Charts",1287 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_121024890_XL.jpg",1288 "primaryAction": [{"type": "SendEvent","arguments": ["advanced_charts"]}]1289 },1290 # "primaryText": "Points By Week",1291 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/linechart.png",1292 # "primaryAction": [{"type": "SendEvent","arguments": ["line"]}]1293 # },1294 # {1295 # "primaryText": "$ Attendance By Team",1296 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/attendance.png",1297 # "primaryAction": [{"type": "SendEvent","arguments": ["attendance"]}]1298 # },1299 # {1300 # "primaryText": "$ Possession By Team",1301 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/possession3.png",1302 # "imageScpurchase advanced analyticsale": "best-fill",1303 # "primaryAction": [{"type": "SendEvent","arguments": ["possession"]}]1304 # },1305 # {1306 # "primaryText": "$ Goals In/Out Of Box",1307 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/long_shot.png",1308 # "imageScale": "best-fill",1309 # "primaryAction": [{"type": "SendEvent","arguments": ["in_out_box"]}]1310 # },1311 # {1312 # "primaryText": "$ Corners By Team",1313 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/corners.png",1314 # "imageScale": "best-fill",1315 # "primaryAction": [{"type": "SendEvent","arguments": ["corners"]}]1316 # },1317 # {1318 # "primaryText": "$ Offside",1319 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/offside2.png",1320 # "imageScale": "best-fit",1321 # "primaryAction": [{"type": "SendEvent","arguments": ["offside"]}]1322 # },1323 # {1324 # "primaryText": "$ VAR Decisions",1325 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/var.png",1326 # "imageScale": "best-fit",1327 # "primaryAction": [{"type": "SendEvent","arguments": ["var"]}]1328 # },1329 # {1330 # "primaryText": "$ Table Rank Changes",1331 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/rankchanges.png",1332 # "imageScale": "best-fit",1333 # "primaryAction": [{"type": "SendEvent","arguments": ["rankchanges"]}]1334 # },1335 {1336 "primaryText": "Other League Tables",1337 "imageSource": "https://duy7y3nglgmh.cloudfront.net/other_tables.png",1338 "primaryAction": [{"type": "SendEvent","arguments": ["other_leagues"]}]1339 },1340 {1341 "primaryText": "Statistics",1342 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_119147050_XL.jpg",1343 "primaryAction": [{"type": "SendEvent","arguments": ["statistics"]}]1344 },1345 #{1346 # "primaryText": "Relegation",1347 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/relegation.png",1348 # "primaryAction": [{"type": "SendEvent","arguments": ["relegation"]}]1349 # },1350 # {1351 # "primaryText": "Clean Sheets",1352 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_keeper.jpg",1353 # "primaryAction": [{"type": "SendEvent","arguments": ["cleansheet"]}]1354 # },1355 # {1356 # "primaryText": "Fouls",1357 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/fouls.png",1358 # "primaryAction": [{"type": "SendEvent","arguments": ["fouls"]}]1359 # },1360 # {1361 # "primaryText": "Goals",1362 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_goal.jpg",1363 # "primaryAction": [{"type": "SendEvent","arguments": ["goals"]}]1364 # },1365 # {1366 # "primaryText": "Goal Difference",1367 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/GoalDifference.png",1368 # "primaryAction": [{"type": "SendEvent","arguments": ["goaldifference"]}]1369 # },1370 # {1371 # "primaryText": "Keeper Saves vs Goals",1372 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/savepercent.png",1373 # "primaryAction": [{"type": "SendEvent","arguments": ["savepercent"]}]1374 # },1375 # {1376 # "primaryText": "Goals vs Shots",1377 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/goals_shots.png",1378 # "primaryAction": [{"type": "SendEvent","arguments": ["goals_shots"]}]1379 # },1380 # {1381 # "primaryText": "Red Card",1382 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/redcard.png",1383 # "primaryAction": [{"type": "SendEvent","arguments": ["redcard"]}]1384 # },1385 # {1386 # "primaryText": "Referees",1387 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_referee.jpg",1388 # "primaryAction": [{"type": "SendEvent","arguments": ["referee"]}]1389 # },1390 # {1391 # "primaryText": "Tackles",1392 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/tackles.png",1393 # "primaryAction": [{"type": "SendEvent","arguments": ["tackles"]}]1394 # },1395 # {1396 # "primaryText": "Touches",1397 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_touches.jpg",1398 # "primaryAction": [{"type": "SendEvent","arguments": ["touches"]}]1399 # },1400 # {1401 # "primaryText": "Yellow Card",1402 # "imageSource": "https://duy7y3nglgmh.cloudfront.net/yellowcard.png",1403 # "primaryAction": [{"type": "SendEvent","arguments": ["yellowcard"]}]1404 # },1405 {1406 "primaryText": "Leave a Review",1407 "imageScale": "best-fit",1408 "imageSource": "https://duy7y3nglgmh.cloudfront.net/qr_code.png",1409 "primaryAction": [{"type": "SendEvent","arguments": ["Leave a Review"]}]1410 } 1411 ],1412 } 1413} 1414datasourcessp = {1415 "gridListData": {1416 "type": "object",1417 "objectId": "gridListSample",1418 "backgroundImage": {1419 "contentDescription": "this is the content",1420 "smallSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1421 "largeSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1422 "sources": [1423 {1424 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1425 "size": "small",1426 "widthPixels": 0,1427 "heightPixels": 01428 },1429 {1430 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1431 "size": "large",1432 "widthPixels": 0,1433 "heightPixels": 01434 }1435 ]1436 },1437 "title": "Puedes preguntar sobre ....",1438 "listItems": [1439 {1440 "primaryText": "La mesa",1441 "imageSource": "https://duy7y3nglgmh.cloudfront.net/thetable.png",1442 "primaryAction": [{"type": "SendEvent","arguments": ["table"]}]1443 },1444 {1445 "primaryText": "Otras Mesas",1446 "imageSource": "https://duy7y3nglgmh.cloudfront.net/other_tables.png",1447 "primaryAction": [{"type": "SendEvent","arguments": ["other_leagues"]}]1448 },1449 {1450 "primaryText": "los partidos",1451 "imageSource": "https://duy7y3nglgmh.cloudfront.net/fixturessp.png",1452 "primaryAction": [{"type": "SendEvent","arguments": ["fixtures"]}]1453 },1454 {1455 "primaryText": "Resultados",1456 "imageSource": "https://duy7y3nglgmh.cloudfront.net/results2.png",1457 "primaryAction": [{"type": "SendEvent","arguments": ["results"]}]1458 },1459 {1460 "primaryText": "Equipos",1461 "imageSource": "https://duy7y3nglgmh.cloudfront.net/teams.png",1462 "primaryAction": [{"type": "SendEvent","arguments": ["teams"]}]1463 },1464 {1465 "primaryText": "Puntos por semana",1466 "imageSource": "https://duy7y3nglgmh.cloudfront.net/linechart.png",1467 "primaryAction": [{"type": "SendEvent","arguments": ["line"]}]1468 },1469 {1470 "primaryText": "Descenso",1471 "imageSource": "https://duy7y3nglgmh.cloudfront.net/relegation.png",1472 "primaryAction": [{"type": "SendEvent","arguments": ["relegation"]}]1473 },1474 {1475 "primaryText": "Sábanas limpias",1476 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_keeper.jpg",1477 "primaryAction": [{"type": "SendEvent","arguments": ["cleansheet"]}]1478 },1479 {1480 "primaryText": "Faltas",1481 "imageSource": "https://duy7y3nglgmh.cloudfront.net/fouls.png",1482 "primaryAction": [{"type": "SendEvent","arguments": ["fouls"]}]1483 },1484 {1485 "primaryText": "Goles",1486 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_goal.jpg",1487 "primaryAction": [{"type": "SendEvent","arguments": ["goals"]}]1488 },1489 {1490 "primaryText": "Diferencia de goles",1491 "imageSource": "https://duy7y3nglgmh.cloudfront.net/GoalDifference.png",1492 "primaryAction": [{"type": "SendEvent","arguments": ["goaldifference"]}]1493 },1494 {1495 "primaryText": "El portero salva vs. Goles",1496 "imageSource": "https://duy7y3nglgmh.cloudfront.net/savepercent.png",1497 "primaryAction": [{"type": "SendEvent","arguments": ["savepercent"]}]1498 },1499 {1500 "primaryText": "Goles vs Disparos",1501 "imageSource": "https://duy7y3nglgmh.cloudfront.net/goals_shots.png",1502 "primaryAction": [{"type": "SendEvent","arguments": ["goals_shots"]}]1503 },1504 {1505 "primaryText": "Tarjetas rojas",1506 "imageSource": "https://duy7y3nglgmh.cloudfront.net/redcard.png",1507 "primaryAction": [{"type": "SendEvent","arguments": ["redcard"]}]1508 },1509 {1510 "primaryText": "Arbitros",1511 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_referee.jpg",1512 "primaryAction": [{"type": "SendEvent","arguments": ["referee"]}]1513 },1514 {1515 "primaryText": "Taclear",1516 "imageSource": "https://duy7y3nglgmh.cloudfront.net/tackles.png",1517 "primaryAction": [{"type": "SendEvent","arguments": ["tackles"]}]1518 },1519 {1520 "primaryText": "Toques",1521 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Depositphotos_touches.jpg",1522 "primaryAction": [{"type": "SendEvent","arguments": ["touches"]}]1523 },1524 {1525 "primaryText": "la tarjeta amarilla",1526 "imageSource": "https://duy7y3nglgmh.cloudfront.net/yellowcard.png",1527 "primaryAction": [{"type": "SendEvent","arguments": ["yellowcard"]}]1528 },1529 {1530 "primaryText": "Dejar un comentario",1531 "imageScale": "best-fit",1532 "imageSource": "https://duy7y3nglgmh.cloudfront.net/qr_code.png",1533 "primaryAction": [{"type": "SendEvent","arguments": ["Leave a Review"]}]1534 },1535 ],1536 } 1537} 1538test_speach_data = {1539 "referee" : "The most used referees are Martin Atkinson with 22 yellow cards and 4 red cards, \1540 Anthony Taylor with 3 yellow cards and 17 red cards",1541 "touches" : "The players with the most touches were Kane with all of them, Son with some of them, and Vardy with the rest of them ",1542 "tackles" : "Various players had various number of tackles, some fair and some not so fair",1543 "fouls" : "While you can argue about players diving there are certainly times when real fouls happen"1544}1545noise_data = [1546 ("https://duy7y3nglgmh.cloudfront.net/FootballCrowdSound.mp3", 4 * 60 * 1000),1547 ("https://duy7y3nglgmh.cloudfront.net/SoccerStadiumSoundEffect.mp3", 40 * 1000),1548 ("https://duy7y3nglgmh.cloudfront.net/SportsStadiumCrowdCheering.mp3", 40 * 1000)1549]1550teamsdatasource = {1551 "radioButtonExampleData": {1552 "radioButtonGroupItems": [1553 {1554 "radioButtonId": "Form",1555 "radioButtonText": "ShowTeamForm",1556 "radioButtonHeight": "15px",1557 "radioButtonChecked": "True",1558 "disabled": "True"1559 },1560 {1561 "radioButtonId": "Results",1562 "radioButtonText": "ShowTeamResults",1563 "radioButtonHeight": "15px",1564 "radioButtonChecked": "False",1565 "disabled": "True"1566 },1567 {1568 "radioButtonId": "Fixtures",1569 "radioButtonText": "ShowTeamFixtures",1570 "radioButtonHeight": "15px",1571 "disabled": "True",1572 "radioButtonChecked": "False"1573 }1574 ]1575 },1576 "gridListData": {1577 "type": "object",1578 "objectId": "gridListSample",1579 "backgroundImage": {1580 "contentDescription": "this is the content",1581 "smallSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1582 "largeSourceUrl": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1583 "sources": [1584 {1585 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1586 "size": "small",1587 "widthPixels": 0,1588 "heightPixels": 01589 },1590 {1591 "url": "https://duy7y3nglgmh.cloudfront.net/football_pitch.png",1592 "size": "large",1593 "widthPixels": 0,1594 "heightPixels": 01595 }1596 ]1597 },1598 "title": "You can ask about each team",1599 "listItems": [1600 {1601 "primaryText": "Arsenal",1602 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Arsenal.png",1603 "primaryAction": [{"type": "SendEvent","arguments": ["Arsenal", "${CurrentSelectedRadioButtonId}"]}]1604 },1605 {1606 "primaryText": "Aston Villa",1607 "imageSource": "https://duy7y3nglgmh.cloudfront.net/AstonVilla.png",1608 "primaryAction": [{"type": "SendEvent","arguments": ["Aston Villa"]}]1609 },1610 {1611 "primaryText": "Brentford",1612 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Brentford.png",1613 "primaryAction": [{"type": "SendEvent","arguments": ["Brentford"]}]1614 },1615 {1616 "primaryText": "Brighton",1617 "imageSource": "https://duy7y3nglgmh.cloudfront.net/BrightonAndHoveAlbion.png",1618 "primaryAction": [{"type": "SendEvent","arguments": ["Brighton and Hove Albion"]}]1619 },1620 {1621 "primaryText": "Burnley",1622 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Burnley.png",1623 "primaryAction": [{"type": "SendEvent","arguments": ["Burnley"]}]1624 },1625 {1626 "primaryText": "Chelsea",1627 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Chelsea.png",1628 "primaryAction": [{"type": "SendEvent","arguments": ["Chelsea"]}]1629 },1630 {1631 "primaryText": "Crystal Palace",1632 "imageSource": "https://duy7y3nglgmh.cloudfront.net/CrystalPalace.png",1633 "primaryAction": [{"type": "SendEvent","arguments": ["Crystal Palace"]}]1634 },1635 {1636 "primaryText": "Everton",1637 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Everton.png",1638 "primaryAction": [{"type": "SendEvent","arguments": ["Everton"]}]1639 },1640 {1641 "primaryText": "Leeds United",1642 "imageSource": "https://duy7y3nglgmh.cloudfront.net/LeedsUnited.png",1643 "primaryAction": [{"type": "SendEvent","arguments": ["Leeds United"]}]1644 },1645 {1646 "primaryText": "Leicester City",1647 "imageSource": "https://duy7y3nglgmh.cloudfront.net/LeicesterCity.png",1648 "primaryAction": [{"type": "SendEvent","arguments": ["Leicester City"]}]1649 },1650 {1651 "primaryText": "Liverpool",1652 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Liverpool.png",1653 "primaryAction": [{"type": "SendEvent","arguments": ["Liverpool"]}]1654 },1655 {1656 "primaryText": "Manchester City",1657 "imageSource": "https://duy7y3nglgmh.cloudfront.net/ManchesterCity.png",1658 "primaryAction": [{"type": "SendEvent","arguments": ["Manchester City"]}]1659 },1660 {1661 "primaryText": "Manchester United",1662 "imageSource": "https://duy7y3nglgmh.cloudfront.net/ManchesterUnited.png",1663 "primaryAction": [{"type": "SendEvent","arguments": ["Manchester United"]}]1664 },1665 {1666 "primaryText": "NewcastleUnited",1667 "imageSource": "https://duy7y3nglgmh.cloudfront.net/NewcastleUnited.png",1668 "primaryAction": [{"type": "SendEvent","arguments": ["Newcastle United"]}]1669 },1670 {1671 "primaryText": "Norwich City",1672 "imageSource": "https://duy7y3nglgmh.cloudfront.net/NorwichCity.png",1673 "primaryAction": [{"type": "SendEvent","arguments": ["Norwich City"]}]1674 },1675 {1676 "primaryText": "Southampton",1677 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Southampton.png",1678 "primaryAction": [{"type": "SendEvent","arguments": ["Southampton"]}]1679 },1680 {1681 "primaryText": "Tottenham Hotspur",1682 "imageSource": "https://duy7y3nglgmh.cloudfront.net/TottenhamHotspur.png",1683 "primaryAction": [{"type": "SendEvent","arguments": ["Tottenham Hotspur"]}]1684 },1685 {1686 "primaryText": "Watford",1687 "imageSource": "https://duy7y3nglgmh.cloudfront.net/Watford.png",1688 "primaryAction": [{"type": "SendEvent","arguments": ["Watford"]}]1689 },1690 {1691 "primaryText": "Westham United",1692 "imageSource": "https://duy7y3nglgmh.cloudfront.net/WestHamUnited.png",1693 "primaryAction": [{"type": "SendEvent","arguments": ["Westham United"]}]1694 },1695 {1696 "primaryText": "Wolverhampton Wanderers",1697 "imageSource": "https://duy7y3nglgmh.cloudfront.net/WolverhamptonWanderers.png",1698 "primaryAction": [{"type": "SendEvent","arguments": ["Wolverhampton Wanderers"]}]1699 },1700 {1701 "primaryText": " ",1702 "primaryAction": [{"type": "Idle","arguments": [""]}]1703 },1704 {1705 "primaryText": " ",1706 "primaryAction": [{"type": "Idle","arguments": [""]}]1707 }1708 ],1709 "logoUrl": "https://duy7y3nglgmh.cloudfront.net/redcard.png"1710 } ...
program03.py
Source:program03.py
1'''2Un documento HTML può essere rappresentato sotto forma di albero, come visto a lezione, che si chiama DOM (Document Object Model).3Un qualsiasi nodo di questo albero può essere individuato sulla base delle proprie caratteristiche:4 - tag un tag del tipo indicato5 - .classe una delle parole presenti nel valore dell'attributo "class"6 - #id il valore dell'attributo "id"7 - @[attributo="valore"] valore di un attributo generico8ed in base alla sua relazione con i tag che lo contengono:9 - avo discendente il tag 'avo' contiene un tag 'discendente' a qualsiasi profondità 10 - padre > figlio il tag 'padre' contiene il tag 'figlio' nel livello immediatamente sotto11Un selettore CSS è una successione di selettori di tag separati da spazio che serve ad individuare uno o più nodi all'interno del DOM.12Esempio:13 div .class1 > #main_window14 seleziona un qualsiasi tag che ha id="main_window"15 è il figlio di un tag che ha class="... class1 ..."16 e si trova all'interno (a qualsiasi livello di distanza) di un tag div17Esempio2:18 p table > tr > td > a19 seleziona un link (<a ...> </a>)20 figlio di una casella (<td> ... </td>)21 figlia di una riga (<tr> ... </tr>)22 figlia di una tabella (<table> ... </table>)23 contenuta a qualsiasi livello in un paragrafo (<p> .... </p>)24NOTA: questa definizione del CSS è una versione ridottissima che non segue lo standard completo.25In particolare, non è possibile usare più relazioni '>' consecutive o costruire selettori alternativi (in OR) e selettori in AND.26Le modifiche da attuare su un DOM possono essere di 3 tipi:27 - conteggio dei nodi che soddisfano il selettore CSS28 - eliminazione di tutti i tag individuati da un selettore CSS29 - modifica degli attributi di tutti i tag individuati da un selettore CSS30Realizzate le funzioni che esplorano e modificano l'albero:31 conta_nodi( fileIn, selettore)32 elimina_nodi( fileIn, selettore, fileOut)33 cambia_attributo( fileIn, selettore, chiave, valore, fileOut)34ATTENZIONE: nei test verrà utilizzato un timout globale di 1*N secondi (se il grader fa N test)35'''36from my_html import HTMLNode, fparse37from copy import copy38def cssSelector(selector, node):39 if selector[0] == '#' and 'id' in node.attr and node.attr['id'] == selector[1:]: return True40 if selector[0] =='.' and 'class' in node.attr and selector[1:] in node.attr['class']: return True41 if selector[0:2] == '@[':42 selector = selector.replace('@[','').replace(']','').replace('"','').split('=')43 if selector[0] in node.attr and node.attr[selector[0]] == selector[1]: return True44 if node.tag == selector: return True45 return False46def countNodes(node, selettore, count, inside=False):47 if node.istext(): return 0 #se il nodo è testo non contarlo48 checkA = cssSelector(selettore[0], node) #verifica la correttezza del nodo49 count=050 if checkA and not inside:51 del selettore[0]52 if len(selettore)==0:53 return 154 if len(selettore) and selettore[0] == '>':55 inside=True56 del selettore[0]57 elif not checkA and inside: return 058 elif checkA and inside:59 inside=False60 del selettore[0]61 if len(selettore) and selettore[0] == '>':62 inside=True63 del selettore[0]64 if len(selettore) == 0:65 return 166 for el in node.content:67 count += countNodes(el, copy(selettore), count, inside)68 return count69def conta_nodi(fileIn, selettore):70 '''Torna il numero di nodi dell'albero, che soddisfano il selettore CSS.'''71 page = fparse(fileIn)72 count=073 selettore = selettore.split(' ')74 return countNodes(page, selettore, count)75def delNodes(node, selettore, inside=False):76 if node.istext(): return False #se il nodo è testo non contarlo77 checkA = cssSelector(selettore[0], node) #verifica la correttezza del nodo78 if checkA and not inside:79 del selettore[0]80 if len(selettore)==0:81 return True82 if len(selettore) and selettore[0] == '>':83 inside=True84 del selettore[0]85 elif not checkA and inside: return False86 elif checkA and inside:87 inside=False88 del selettore[0]89 if len(selettore) and selettore[0] == '>':90 inside=True91 del selettore[0]92 if len(selettore) == 0:93 return True94 for el in node.content:95 if delNodes(el, copy(selettore), inside)==True:96 node.content.remove(el)97 return node98def elimina_nodi(fileIn, selettore, fileOut):99 '''Elimina dall'albero tutti i nodi che soddisfano il selettore CSS (compreso il loro contenuto)'''100 page = fparse(fileIn)101 selettore = selettore.split(' ')102 html = delNodes(page, selettore)103 with open(fileOut, 'wb') as f:104 f.write((html.to_string()).encode('utf8'))105def changeNode(node, selettore, chiave, valore, inside=False):106 if node.istext(): return node107 checkA = cssSelector(selettore[0], node) #verifica la correttezza del nodo108 if checkA and not inside:109 del selettore[0]110 if len(selettore)==0:111 node.attr[chiave] = valore112 return node113 if len(selettore) and selettore[0] == '>':114 inside=True115 del selettore[0]116 elif not checkA and inside: return node117 elif checkA and inside:118 inside=False119 del selettore[0]120 if len(selettore) and selettore[0] == '>':121 inside=True122 del selettore[0]123 if len(selettore) == 0:124 node.attr[chiave] = valore125 return node126 for el in node.content:127 changeNode(el, copy(selettore), chiave,valore, inside)128 return node129def cambia_attributo(fileIn, selettore, chiave, valore, fileOut):130 '''Modifica tutti i nodi dell'albero che soddisfano il selettore CSS'''131 page = fparse(fileIn)132 selettore = selettore.split(' ')133 html = ''134 html = changeNode(page, selettore, chiave, valore)135 with open(fileOut, 'wb') as f:136 f.write((html.to_string()).encode('utf8'))137# def countNodes(node,selector, count):138# if not node.istext():139# check = cssSelector(selector,node)140# if check: count+=1141# for el in node.content:142# count = countNodes(el,selector,count)143#144# return count145#146# def countNodesInParent(node, pSel,cSel,count):147# if not node.istext():148# # print(node.tag)149# checkP = cssSelector(pSel,node)150# if not checkP:151# for el in node.content:152# count = countNodesInParent(el,pSel,cSel,count)153# if checkP:154# for el in node.content:155# if not el.istext():156# count = countNodesInParent(el,pSel,cSel,count)157# checkC = cssSelector(cSel,el)158# if checkC: count+=1159# return count160#161#162# def countDescendent(node, aSel,dSel,count):163# if not node.istext():164# # print(node.tag,count)165# checkA = cssSelector(aSel,node)166# if not checkA:167# for el in node.content:168# if not el.istext():169# count = countDescendent(el,aSel,dSel,count)170# if checkA:171# if not node.istext():172# # print(node.tag,'aa')173# count = countNodes(node, dSel,count)174# # print(count)175# return count176# def delNodes(node,selector):177# if not node.istext():178# check = cssSelector(selector,node)179# if check: return True180# for el in node.content:181# if delNodes(el,selector) == True:182# node.content.remove(el)183#184# return node185#186# def delNodesInParent(node, pSel,cSel):187# if not node.istext():188# checkP = cssSelector(pSel,node)189# if not checkP:190# for el in node.content:191# print(el.tag)192# delNodesInParent(el,pSel,cSel)193# if checkP:194# for el in node.content:195# if not el.istext():196# checkC = cssSelector(cSel,el)197# if checkC: node.content.remove(el)198# return node199#200#201# def delDescendent(node, aSel,dSel):202# if not node.istext():203# # print(node.tag,count)204# checkA = cssSelector(aSel,node)205# if not checkA:206# for el in node.content:207# if not el.istext():208# delDescendent(el, aSel, dSel)209# if checkA:210# if not node.istext():211# # print(node.tag,'aa')212# delNodes(node, dSel)213# # print(count)214# return node215# def changeNode(node,selector, key, value):216# if not node.istext():217# check = cssSelector(selector,node)218# if check: node.attr[key] = value219# for el in node.content:220# changeNode(el,selector,key,value)221# return node222#223# def changeNodesInParent(node, pSel,cSel,key,value):224# if not node.istext():225# # print(node.tag)226# checkP = cssSelector(pSel,node)227# if not checkP:228# for el in node.content:229# count = countNodesInParent(el,pSel,cSel,count)230# if checkP:231# for el in node.content:232# if not el.istext():233# count = countNodesInParent(el,pSel,cSel,count)234# checkC = cssSelector(cSel,el)235# if checkC: count+=1236# return count237#238#239# def changeDescendent(node, aSel,dSel,key,value):240# if not node.istext():241# # print(node.tag,count)242# checkA = cssSelector(aSel,node)243# if not checkA:244# for el in node.content:245# if not el.istext():246# changeDescendent(el,aSel,dSel,key,value)247# if checkA:248# if not node.istext():249# # print(node.tag,'aa')250# changeNode(node, dSel,key,value)251# # print(count)...
EraTime.py
Source:EraTime.py
1import sys2# import erajs.api as a3class Plugin:4 name = 'EraTime'5 def reg(self):6 a.data['class']['time'] = EraTime7 a.data['entity']['time'] = EraTime(a.data)8class EraTime:9 '''æ¶/æ¥/å¨/æ/å£/å¹´10 æ¥ofå¨/æ¥ofæ/æ¥ofå¹´/æofå¹´/å£ofå¹´11 é»è®¤å¼ï¼1å¹´ = 4å£ = 8æ = 16å¨ = 112æ¥ = 224æ¼/å¤12 å¹´ï¼13 å£ï¼å¤ªé³ï¼æ¸©åº¦14 æï¼æ亮ï¼æ¹¿åº¦ï¼æ½®æ±ï¼15 å¨ï¼ææï¼æç«æ°´æ¨éåæ¥16 æ¥ï¼å°ç17 '''18 WEEKDAY_ORDER = ['æ', 'ç«', 'æ°´', 'æ¨', 'é', 'å', 'æ¥']19 TIME_ORDER = ['æ¼', 'å¤']20 SEASON_ORDER = ['æ¥', 'å¤', 'ç§', 'å¬']21 MONTH_ORDER = ['ä¹¾', 'å¤', 'é', 'å·½', 'å', '离', 'è®', 'å
']22 WEEKS_IN_A_MONTH = 223 MONTHS_IN_A_SEASON = 224 # 1...25 # 第1天 æ¥ä¹å¨ æ¥ææ¥ æ¥æ¼26 days_in_a_month = len(WEEKDAY_ORDER) * WEEKS_IN_A_MONTH27 days_in_a_season = days_in_a_month * MONTHS_IN_A_SEASON28 days_in_a_year = days_in_a_season * len(SEASON_ORDER)29 def __init__(self, data):30 self.data = data31 def get_time(self, isText=False):32 '''æ¼å¤'''33 if self.data['db']['time']['CURRENT_DAY'] % 1 == 0:34 if isText:35 return 'æ¼'36 return 037 elif self.data['db']['time']['CURRENT_DAY'] % 1 == 0.5:38 if isText:39 return 'å¤'40 return 141 def get_day(self, isText=False):42 '''第å 天ï¼ç»å¯¹ï¼'''43 if isText:44 return str(int(self.data['db']['time']['CURRENT_DAY'])+1)45 return int(self.data['db']['time']['CURRENT_DAY']) + 146 def get_week(self, isText=False):47 '''第å å¨ï¼ç»å¯¹ï¼'''48 if isText:49 return str(int(self.data['db']['time']['CURRENT_DAY']/len(self.WEEKDAY_ORDER)) + 1)50 return int(self.data['db']['time']['CURRENT_DAY']/len(self.WEEKDAY_ORDER)) + 151 def get_month(self, isText=False):52 '''第å æï¼ç»å¯¹ï¼'''53 if isText:54 return str(int(self.data['db']['time']['CURRENT_DAY']/self.days_in_a_month)+1)55 return int(self.data['db']['time']['CURRENT_DAY']/self.days_in_a_month) + 156 def get_season(self, isText=False):57 '''第å å£ï¼ç»å¯¹ï¼'''58 if isText:59 return str(int(self.data['db']['time']['CURRENT_DAY']/self.days_in_a_season)+1)60 return int(self.data['db']['time']['CURRENT_DAY']/self.days_in_a_season) + 161 def get_year(self, isText=False):62 '''第å å¹´ï¼ç»å¯¹ï¼'''63 if isText:64 return str(int(self.data['db']['time']['CURRENT_DAY'] / self.days_in_a_year)+1)65 return int(self.data['db']['time']['CURRENT_DAY'] / self.days_in_a_year) + 166 def get_day_in_week(self, isText=False):67 '''第å 天ï¼å¨å
ï¼ï¼ææå ï¼ï¼æ¥/æ/ç«/æ°´/æ¨/é/å'''68 if isText:69 return self.WEEKDAY_ORDER[int(self.data['db']['time']['CURRENT_DAY'] % len(self.WEEKDAY_ORDER))]70 return int(self.data['db']['time']['CURRENT_DAY'] % len(self.WEEKDAY_ORDER)) + 171 def get_day_in_month(self, isText=False):72 '''第å 天ï¼æå
ï¼'''73 return int(self.data['db']['time']['CURRENT_DAY'] % self.days_in_a_month) + 174 def get_day_in_year(self, isText=False):75 '''第å 天ï¼å¹´å
ï¼'''76 pass77 def get_month_in_year(self):78 '''第å æï¼å¹´å
ï¼'''79 return int(self.data['db']['time']['CURRENT_DAY']/self.WEEKS_IN_A_MONTH/len(self.WEEKDAY_ORDER)) + 180 def get_season_in_year(self, isText=False):81 '''第å å£ï¼å¹´å
ï¼ï¼æ¥/å¤/ç§/å¬'''82 if isText:83 return self.SEASON_ORDER[int(self.data['db']['time']['CURRENT_DAY'] % self.days_in_a_year / self.days_in_a_season)]84 return int(self.data['db']['time']['CURRENT_DAY'] % self.days_in_a_year / self.days_in_a_season) + 185 def get_sys_time(self):86 '''è·åæ¶é´åå§å¼'''87 return self.data['db']['time']['CURRENT_DAY']88 def set_sys_time(self, value):89 '''设å®æ¶é´åå§å¼'''90 self.data['db']['time']['CURRENT_DAY'] = value91 def get_full_time(self):92 '''è·åå
¨ææ¬æ¶é´'''93 # 1å¹´1æ1æ¥ æ¥ä¹å¨ æ¥ææ¥ æ¥æ¼94 temp = '第{0}å¹´ {1}æ{2}æ¥ ç¬¬{3}å¨ {4}èæ¥ {5}{6}'95 text_list = [96 self.get_year(),97 self.get_month_in_year(),98 self.get_day_in_month(),99 self.get_week(),100 self.get_day_in_week(True),101 self.get_season_in_year(True),102 self.get_time(True)103 ]104 return temp.format(*text_list)105 def tick(self):106 '''æ¶é´æµéä¸ä¸ªåä½'''107 self.data['db']['time']['CURRENT_DAY'] += 0.5108def register():109 global a, EraTime110 a.data['class']['time'] = EraTime111 a.data['entity']['time'] = EraTime(a.data)112 if not 'time' in a.data['db'].keys():113 a.data['db']['time'] = {114 'CURRENT_DAY': 0115 }116 else:117 a.data['entity']['time'].CURRENT_DAY = a.data['db']['time']['CURRENT_DAY']118 # data['entity']['time'].load(data['db']['time'])119 func_list = [120 a.data['entity']['time'].get_time,121 a.data['entity']['time'].get_day,122 a.data['entity']['time'].get_week,123 a.data['entity']['time'].get_month,124 a.data['entity']['time'].get_season,125 a.data['entity']['time'].get_year,126 a.data['entity']['time'].get_day_in_week,127 a.data['entity']['time'].get_day_in_month,128 a.data['entity']['time'].get_day_in_year,129 a.data['entity']['time'].get_month_in_year,130 a.data['entity']['time'].get_season_in_year,131 a.data['entity']['time'].get_sys_time,132 a.data['entity']['time'].set_sys_time,133 a.data['entity']['time'].get_full_time,134 a.data['entity']['time'].tick135 ]136 for each in func_list:137 a.data['api'][each.__name__] = each138a = sys.argv[0]...
data.py
Source:data.py
1import os2import re3import random4import copy5cur_path = os.getcwd() #è·åå½åæ件ç»å¯¹è·¯å¾6raw_dataDir = os.path.join(cur_path,"raw_data")7def baseline(file,tot,data,mark,istext=""):8 with open(cur_path+"/data/"+mark+"-"+str(tot)+"-"+file+istext,"w") as w:9 print(cur_path+"/data/"+mark+"-"+str(tot)+"-"+file)10 w.write(str(tot)+"\n")11 for i in range(0,len(data), 2):12 w.write(str(data[i])+" "+str(data[i+1])+"\n")13def deleteEdge(file,tot,data,rate,mark,istext=""):14 with open(cur_path+"/data/"+mark+"-"+str(tot)+"-"+file+"-DeleteEdge"+str(rate)+istext,"w") as w:15 print(cur_path+"/data/"+mark+"-"+str(tot)+"-"+file)16 w.write(str(tot)+"\n")17 flag=018 print(len(data))19 for i in range(0,len(data), 2):20 if random.random() < rate : continue;21 w.write(str(data[i])+" "+str(data[i+1])+"\n")22def AddEdge(file,tot,data,rate,mark,istext=""):23 dic = {}24 for i in range(0,len(data), 2):25 dic[(data[i],data[i+1])] = 126 if mark == "undirected" :27 dic[(data[i+1], data[i])] = 128 cnt = int(len(data)*rate)29 while(cnt != 0):30 cnt-=131 u = random.randint(1, tot)32 v = random.randint(1, tot)33 if u == v : continue34 if dic.get((u,v)) : continue35 data += [u, v]36 dic[(u, v)] = 137 if mark == "undirect":38 dic[(v, u)] = 139 with open(cur_path+"/data/"+mark+"-"+str(tot)+"-"+file+"-AddEdge"+str(rate)+istext,"w") as w:40 print(cur_path+"/data/"+mark+"-"+str(tot)+"-"+file)41 w.write(str(tot)+"\n")42 for i in range(0,len(data), 2):43 w.write(str(data[i])+" "+str(data[i+1])+"\n")44for file in os.listdir(raw_dataDir):45 data = []46 dic = {}47 tot = 048 cnt = 049 flag = 050 mark = ""51 istext = ""52 print(re.match("(.*).txt",file))53 if(re.match("(.*).txt",file)) :54 print("now solve "+file)55 with open(raw_dataDir+"/"+file,"r") as f:56 for line in f :57 if line[0] == '#' :58 if re.search(r'(.*)Directed(.*)',line) !=None :59 flag = 160 continue61 edge = re.split(r'[ \n\t]',line)62 edge.pop()63 if dic.get(edge[0]) == None :64 tot += 165 dic[edge[0]] = tot66 if dic.get(edge[1]) == None :67 tot += 168 dic[edge[1]] = tot69 data += [dic[edge[0]],dic[edge[1]]]70 cnt += 171 # if cnt%1000 == 0 : print(cnt)72 if flag == 0 : mark = "undirected"73 else : mark = "directed"74 elif(re.match(r"(.*).csv",file)):75 print("now solve "+file)76 istext = ".txt"77 with open(raw_dataDir+"/"+file,"r") as f:78 for line in f:79 edge = line.split(',')80 if edge[0].isdigit() == False : continue81 if dic.get(edge[0]) == None:82 tot += 183 dic[edge[0]] = tot84 if dic.get(edge[1]) == None:85 tot += 186 dic[edge[1]] = tot87 data += [dic[edge[0]], dic[edge[1]]]88 cnt += 189 # if cnt%1000 == 0 : print(cnt)90 if flag == 0:91 mark = "undirected"92 else:93 mark = "directed"94 flag2 = 095 with open(cur_path + "/data/" + mark + "-" + str(tot) + "-" + file+".txt", "w") as w:96 print(cur_path + "/data/" + mark + "-" + str(tot) + "-" + file+".txt")97 w.write(str(tot) + "\n")98 for item in data:99 w.write(str(item))100 if flag2 == 0:101 w.write(' ')102 else:103 w.write('\n')104 flag2 = (flag2 + 1) % 2105 if mark != "":106 deleteEdge(file=file,tot=tot,data=copy.deepcopy(data),rate=0.5,mark=mark,istext=istext)107 AddEdge(file=file,tot=tot,data=copy.deepcopy(data),rate=0.5,mark=mark,istext=istext)108 baseline(file=file, tot=tot, data=copy.deepcopy(data), mark=mark, istext=istext)109 ...
fileitem.py
Source:fileitem.py
1#!/usr/bin/pythonw 2# This file is part of JMRI.3#4# JMRI is free software; you can redistribute it and/or modify it under 5# the terms of version 2 of the GNU General Public License as published 6# by the Free Software Foundation. See the "COPYING" file for a copy7# of this license.8#9# JMRI is distributed in the hope that it will be useful, but WITHOUT 10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12# for more details.13#14# Revision $Revision: 20434 $15# by Simon Ginsburg (simon.ginsburg at bluewin.ch)16"""17This Python class represents one key of one single file for translation or one text18"""19class fileitem:20 def __init__(self, linenum, numlines, key, content, isText):21 #print linenum22 #print numlines23 #print content24 self.linenum = linenum25 self.numlines = numlines26 self.key = key27 self.content = content28 self.isText = isText29 self.nextitem = []30 self.previtem = []31 32 def copy(self):33 newitem = fileitem(self.linenum, self.numlines, self.key, self.content, self.isText)34 return newitem35 36 def iskey(self, seachstring):37 if self.isText:38 return 039 else:40 return (seachstring == self.key)41 42 def isitem(self, seachstring):43 if self.isText:44 return 045 else:46 if seachstring.strip() == self.getcontent():47 return 148 else:49 return 050 def istext(self, seachstring):51 if self.isText:52 if seachstring.strip() == self.content.strip():53 return 154 else:55 return 056 else:57 return 058 def moveposition(self, deltalines):59 self.linenum = self.linenum + deltalines60 61 def setitem(self, newstring, numlines):62 self.content = newstring63 self.numlines = numlines64 65 def getitem(self):66 return self.content67 68 def getlinenum(self):69 return self.linenum70 71 def getnumlines(self):72 return self.numlines73 74 def getcontent(self):75 if self.isText:76 return str(self.content)77 else:78 if self.numlines == 1:79 return str(self.key + " = " + str(self.content) + "\n")80 else:81 tempstr = str(self.key + " = ")82 initstr = ""83 followstr = self.addwhite(len(tempstr))84 for lines in self.content:85 tempstr = str(tempstr + initstr + lines + "\n")86 initstr = followstr87 return tempstr88 89 def write(self, filehandle):90 filehandle.write(self.getcontent())91 def addwhite(self, len):92 tempstr = ""93 for i in range(len):94 tempstr = tempstr + " "95 return str(tempstr)...
hw7.py
Source:hw7.py
1import urllib.request 2from html.parser import HTMLParser 34movieid = '5717'5targetURL = 'http://tw.movie.yahoo.com/movieinfo_main.html/id='+movieid6data = urllib.request.urlopen(targetURL) 7content = data.read().decode('utf_8') 8data.close()9file = open(movieid+'.txt','w',encoding = 'utf_8')1011class myparser(HTMLParser): 12 def __init__(self): 13 HTMLParser.__init__(self) 14 self.isText = 015 self.isTextBulletin = 016 self.isTextFull = 017 self.Title = ''18 self.MovieInfo = ''19 self.Text = ''20 21 def handle_data(self, data):22 #çå 23 if self.isText == 1:24 self.Title += data25 self.isText = 026 #è³è¨27 if self.isText == 2:28 self.MovieInfo += data29 30 if self.isTextFull == 1:31 self.Text += data32 33 def handle_starttag(self, tag, attrs):34 if tag == 'div' and attrs == [('class', 'text bulletin')]:35 self.isTextBulletin = 136 #ä¸æçå37 if self.isTextBulletin == 1 and tag == 'h4':38 self.isText = 139 #è±æçå 40 if self.isTextBulletin == 1 and tag == 'h5':41 self.isText = 142 #é»å½±è³è¨43 if self.isTextBulletin == 1 and tag == 'span' and attrs == [('class', 'dta')]:44 self.isText = 245 #é»å½±ä»ç´¹46 if tag == 'div' and attrs == [('class', 'text full')]:47 self.isTextFull = 148 49 def handle_endtag(self, tag):50 if self.isTextBulletin == 1 and tag == 'div':51 self.isTextBulletin = 052 53 if self.isTextBulletin == 1 and self.isText == 2 and tag == 'span':54 self.MovieInfo += '\n'55 self.isText = 056 57 if self.isTextFull == 1 and tag == 'div':58 self.isTextFull = 05960Parser = myparser() 61Parser.feed(content)62file.write(Parser.Title+'\n')63file.write(Parser.MovieInfo)64file.write(Parser.Text)
...
smartpdf.py
Source:smartpdf.py
1import os2import json3from codecs import open4from colormod import *5from buttoned import *6from contact import *7from doublelist import *8from readstr import *9from htype import *10posfun={"darken":darken,"sdarken":sdarken}11def smartml(q):12 fn=f"s/{q}.sml"13 if not os.path.isfile(fn):14 return "Not a valid path"15 with open(fn,"r", 'utf-8') as f:16 ac=f.read()17 18 istext=False19 # try:20 if 1:21 ac=eval(ac,posfun)#yes security risk, but...way less errors than json.loads()22 23 # except:24 # istext=True25 if istext or (type(ac) is not dict) or (not "type" in ac) or ac["type"]=="text":istext=True26 # print("THIS IS ",istext,type(ac),istext , (type(ac) is not dict) , (not "type" in ac))# , ac["type"]=="text")27 if istext:28 return readstr(ac)29 t=ac["type"]30 if t=="buttons":return buttonedpdf(ac)31 if t=="contact":return contactpdf(ac)32 if t=="doublelist":return doublelistpdf(ac)33 if t=="link":return linkingpagepdf(ac)34 ...
smartml.py
Source:smartml.py
1import os2import json3from codecs import open4from colormod import *5from buttoned import *6from contact import *7from doublelist import *8from readstr import *9from htype import *10posfun={"darken":darken,"sdarken":sdarken}11def smartml(q):12 fn=f"s/{q}.sml"13 if not os.path.isfile(fn):14 return "Not a valid path"15 with open(fn,"r", 'utf-8') as f:16 ac=f.read()17 18 istext=False19 # try:20 if 1:21 ac=eval(ac,posfun)#yes security risk, but...way less errors than json.loads()22 23 # except:24 # istext=True25 if istext or (type(ac) is not dict) or (not "type" in ac) or ac["type"]=="text":istext=True26 print("THIS IS ",istext,type(ac),istext , (type(ac) is not dict) , (not "type" in ac))# , ac["type"]=="text")27 if istext:28 return readstr(ac)29 t=ac["type"]30 if t=="buttons":return buttoned(ac)31 if t=="contact":return contact(ac)32 if t=="doublelist":return doublelist(ac)33 if t=="link":return linkingpage(ac)34 ...
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const title = await page.title();7 console.log(title);8 await browser.close();9})();
Using AI Code Generation
1const { isText } = require('playwright/lib/utils/utils');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 const text = await page.textContent('body');8 const isTextResult = isText(text);9 console.log(isTextResult);10 await browser.close();11})();12Example 2: isText() method with non-text data13const { isText } = require('playwright/lib/utils/utils');14const { chromium } = require('playwright');15(async () => {16 const browser = await chromium.launch();17 const context = await browser.newContext();18 const page = await context.newPage();19 const text = await page.textContent('img');20 const isTextResult = isText(text);21 console.log(isTextResult);22 await browser.close();23})();24Recommended Posts: Playwright | isString() method25Playwright | isNumber() method26Playwright | isBoolean() method27Playwright | isRegExp() method28Playwright | isObject() method29Playwright | isUndefined() method30Playwright | isNull() method31Playwright | isNullOrUndefined() method32Playwright | isFunction() method33Playwright | isDate() method34Playwright | isPromise() method35Playwright | isMap() method36Playwright | isSet() method37Playwright | isWeakMap() method38Playwright | isWeakSet() method39Playwright | isSymbol() method40Playwright | isPrimitive() method41Playwright | isMap() method42Playwright | isSet() method43Playwright | isWeakMap() method44Playwright | isWeakSet() method45Playwright | isSymbol() method46Playwright | isPrimitive() method47Playwright | isMap() method48Playwright | isSet() method49Playwright | isWeakMap() method50Playwright | isWeakSet() method51Playwright | isSymbol() method52Playwright | isPrimitive() method53Playwright | isMap() method
Using AI Code Generation
1const { isText } = require('playwright/lib/internal/utils');2const { chromium } = require('playwright');3(async () => {4 const browser = await chromium.launch();5 const context = await browser.newContext();6 const page = await context.newPage();7 const search = await page.$('input[name="q"]');8 await search.type('playwright');9 const button = await page.$('input[type="submit"]');10 await button.click();11 await page.waitForSelector('text=Playwright');12 const content = await page.$('body');13 const textContent = await content.innerText();14 console.log(isText(textContent));15 await browser.close();16})();
Using AI Code Generation
1const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');2const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');3const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');4const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');5const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');6const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');7const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');8const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');9const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');10const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');11const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');12const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');13const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');14const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');15const { isText } = require
Using AI Code Generation
1const { isText } = require('playwright/lib/internal/utils');2const { isText } = require('playwright/lib/internal/utils');3const { isText } = require('playwright/lib/internal/utils');4const { isText } = require('playwright/lib/internal/utils');5const { isText } = require('playwright/lib/internal/utils');6const { isText } = require('playwright/lib/internal/utils');7const { isText } = require('playwright/lib/internal/utils');8const { isText } = require('playwright/lib/internal/utils');9const { isText } = require('playwright/lib/internal/utils');10const { isText } = require('playwright/lib/internal/utils');11const { isText } = require('playwright/lib/internal/utils');12const { isText } = require('playwright/lib/internal/utils');13const { isText } = require('playwright/lib/internal/utils');14const { isText } = require('playwright/lib/internal/utils');15const { isText } = require('playwright/lib/internal/utils');16const { isText } = require('playwright/lib/internal/utils');17const { isText } = require('playwright/lib/internal/utils');
Using AI Code Generation
1const { isText } = require('playwright/lib/utils/utils');2const { Page } = require('playwright/lib/server/page');3const { ElementHandle } = require('playwright/lib/server/dom');4const { JSHandle } = require('playwright/lib/server/jsHandle');5const { isText } = require('playwright/lib/utils/utils');6const { Page } = require('playwright/lib/server/page');7const { ElementHandle } = require('playwright/lib/server/dom');8const { JSHandle } = require('playwright/lib/server/jsHandle');9const page = await browser.newPage();10await page.screenshot({ path: 'example.png' });11const puppeteer = require('puppeteer');12(async () => {13 const browser = await puppeteer.launch();14 const page = await browser.newPage();15 await page.screenshot({path: 'example.png'});16 await browser.close();17})();18const { chromium } = require('playwright');19(async () => {20 const browser = await chromium.launch();21 const context = await browser.newContext();22 const page = await context.newPage();23 await page.screenshot({ path: 'example.png' });24 await browser.close();25})();26const puppeteer = require('puppeteer');27(async () => {28 const browser = await puppeteer.launch();29 const page = await browser.newPage();30 await page.screenshot({path: 'example.png'});31 await browser.close();32})();33const { chromium } = require('playwright');34(async () => {35 const browser = await chromium.launch();36 const context = await browser.newContext();37 const page = await context.newPage();38 await page.screenshot({ path: 'example.png' });39 await browser.close();40})();41const puppeteer = require('puppeteer');42(async () => {43 const browser = await puppeteer.launch();44 const page = await browser.newPage();45 await page.screenshot({path: 'example.png'});46 await browser.close();47})();
Using AI Code Generation
1const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');2const text = await page.textContent("selector");3const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');4const text = await page.textContent("selector");5const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');6const text = await page.textContent("selector");7const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');8const text = await page.textContent("selector");9const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');10const text = await page.textContent("selector");11const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');12const text = await page.textContent("selector");13const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');14const text = await page.textContent("selector");15const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');16const text = await page.textContent("selector");17const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');18const text = await page.textContent("selector");19const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');20const text = await page.textContent("selector");21const { isText } = require('playwright/lib/server/supplements/recorder/recorderSupplement');22const text = await page.textContent("selector");23const { isText } = require('playwright/lib/server/s
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!