diff --git "a/swe-bench-lite/pallets#flask#4c288bc97ea371817199908d0d9b12de9dae327e.graph.json" "b/swe-bench-lite/pallets#flask#4c288bc97ea371817199908d0d9b12de9dae327e.graph.json" new file mode 100644--- /dev/null +++ "b/swe-bench-lite/pallets#flask#4c288bc97ea371817199908d0d9b12de9dae327e.graph.json" @@ -0,0 +1 @@ +{"edges":[{"edgeType":"contains","source":2190,"target":2206},{"edgeType":"contains","source":7,"target":1435},{"edgeType":"contains","source":22,"target":970},{"edgeType":"contains","source":49,"target":133},{"edgeType":"calls","source":1547,"target":302},{"edgeType":"contains","source":12,"target":487},{"edgeType":"calls","source":1400,"target":367},{"edgeType":"contains","source":2134,"target":2356},{"edgeType":"calls","source":1641,"target":295},{"edgeType":"contains","source":1507,"target":1710},{"edgeType":"contains","source":2,"target":5},{"edgeType":"contains","source":536,"target":627},{"edgeType":"calls","source":1391,"target":381},{"edgeType":"contains","source":1075,"target":1095},{"edgeType":"calls","source":1268,"target":1287},{"edgeType":"calls","source":1718,"target":286},{"edgeType":"contains","source":61,"target":2404},{"edgeType":"contains","source":107,"target":2035},{"edgeType":"imports","source":2079,"target":1496},{"edgeType":"contains","source":2179,"target":2283},{"edgeType":"calls","source":1359,"target":316},{"edgeType":"calls","source":2137,"target":2097},{"edgeType":"contains","source":272,"target":355},{"edgeType":"calls","source":1290,"target":1398},{"edgeType":"contains","source":2190,"target":2207},{"edgeType":"calls","source":1641,"target":294},{"edgeType":"calls","source":817,"target":733},{"edgeType":"contains","source":2438,"target":2447},{"edgeType":"calls","source":1385,"target":302},{"edgeType":"calls","source":865,"target":302},{"edgeType":"calls","source":345,"target":302},{"edgeType":"contains","source":357,"target":362},{"edgeType":"contains","source":2426,"target":2555},{"edgeType":"contains","source":2134,"target":2357},{"edgeType":"contains","source":536,"target":626},{"edgeType":"contains","source":354,"target":2304},{"edgeType":"calls","source":608,"target":342},{"edgeType":"contains","source":1882,"target":1978},{"edgeType":"calls","source":2570,"target":302},{"edgeType":"calls","source":1268,"target":1286},{"edgeType":"contains","source":2179,"target":2284},{"edgeType":"contains","source":357,"target":890},{"edgeType":"contains","source":327,"target":1820},{"edgeType":"calls","source":1391,"target":380},{"edgeType":"contains","source":1604,"target":1611},{"edgeType":"contains","source":770,"target":775},{"edgeType":"contains","source":1513,"target":200},{"edgeType":"calls","source":1465,"target":732},{"edgeType":"contains","source":1702,"target":419},{"edgeType":"calls","source":522,"target":368},{"edgeType":"contains","source":270,"target":948},{"edgeType":"calls","source":757,"target":746},{"edgeType":"contains","source":1513,"target":1522},{"edgeType":"contains","source":2,"target":7},{"edgeType":"contains","source":536,"target":629},{"edgeType":"contains","source":2179,"target":2281},{"edgeType":"contains","source":1711,"target":1726},{"edgeType":"calls","source":1363,"target":987},{"edgeType":"calls","source":811,"target":394},{"edgeType":"imports","source":1075,"target":641},{"edgeType":"calls","source":2137,"target":2095},{"edgeType":"contains","source":2190,"target":2204},{"edgeType":"calls","source":757,"target":745},{"edgeType":"calls","source":1641,"target":296},{"edgeType":"contains","source":98,"target":993},{"edgeType":"calls","source":1391,"target":382},{"edgeType":"calls","source":1718,"target":287},{"edgeType":"contains","source":536,"target":628},{"edgeType":"contains","source":2179,"target":2282},{"edgeType":"contains","source":1673,"target":1848},{"edgeType":"calls","source":522,"target":367},{"edgeType":"contains","source":107,"target":2036},{"edgeType":"calls","source":1385,"target":304},{"edgeType":"calls","source":1363,"target":986},{"edgeType":"calls","source":811,"target":393},{"edgeType":"contains","source":2190,"target":2205},{"edgeType":"contains","source":2438,"target":2450},{"edgeType":"calls","source":1710,"target":266},{"edgeType":"calls","source":1570,"target":378},{"edgeType":"calls","source":532,"target":316},{"edgeType":"contains","source":2190,"target":2210},{"edgeType":"contains","source":536,"target":632},{"edgeType":"calls","source":1774,"target":396},{"edgeType":"imports","source":1075,"target":111},{"edgeType":"imports","source":70,"target":83},{"edgeType":"contains","source":1596,"target":1862},{"edgeType":"contains","source":1595,"target":1893},{"edgeType":"contains","source":1443,"target":1584},{"edgeType":"calls","source":2097,"target":1747},{"edgeType":"calls","source":2290,"target":785},{"edgeType":"calls","source":1068,"target":348},{"edgeType":"contains","source":536,"target":631},{"edgeType":"calls","source":774,"target":742},{"edgeType":"contains","source":2088,"target":87},{"edgeType":"calls","source":905,"target":909},{"edgeType":"contains","source":2438,"target":2451},{"edgeType":"calls","source":1710,"target":265},{"edgeType":"calls","source":689,"target":733},{"edgeType":"calls","source":737,"target":302},{"edgeType":"calls","source":1774,"target":395},{"edgeType":"contains","source":2190,"target":2211},{"edgeType":"calls","source":1570,"target":377},{"edgeType":"contains","source":2,"target":1593},{"edgeType":"contains","source":536,"target":630},{"edgeType":"calls","source":731,"target":753},{"edgeType":"contains","source":357,"target":894},{"edgeType":"calls","source":2364,"target":342},{"edgeType":"imports","source":2426,"target":511},{"edgeType":"contains","source":1496,"target":1528},{"edgeType":"calls","source":386,"target":349},{"edgeType":"imports","source":1595,"target":111},{"edgeType":"calls","source":1641,"target":293},{"edgeType":"contains","source":2190,"target":2208},{"edgeType":"contains","source":63,"target":2612},{"edgeType":"calls","source":817,"target":732},{"edgeType":"contains","source":2438,"target":2448},{"edgeType":"calls","source":757,"target":742},{"edgeType":"contains","source":536,"target":634},{"edgeType":"calls","source":1434,"target":368},{"edgeType":"contains","source":1090,"target":1165},{"edgeType":"contains","source":1672,"target":1882},{"edgeType":"imports","source":98,"target":270},{"edgeType":"calls","source":656,"target":702},{"edgeType":"calls","source":1774,"target":398},{"edgeType":"calls","source":1962,"target":1969},{"edgeType":"contains","source":1596,"target":1860},{"edgeType":"calls","source":1402,"target":302},{"edgeType":"calls","source":1434,"target":367},{"edgeType":"contains","source":1513,"target":1526},{"edgeType":"contains","source":2179,"target":2285},{"edgeType":"calls","source":1391,"target":379},{"edgeType":"contains","source":659,"target":520},{"edgeType":"contains","source":1496,"target":1789},{"edgeType":"calls","source":352,"target":349},{"edgeType":"contains","source":2190,"target":2209},{"edgeType":"calls","source":1417,"target":365},{"edgeType":"contains","source":2438,"target":2449},{"edgeType":"contains","source":270,"target":951},{"edgeType":"contains","source":219,"target":418},{"edgeType":"contains","source":1090,"target":1164},{"edgeType":"contains","source":1487,"target":1540},{"edgeType":"imports","source":2115,"target":108},{"edgeType":"contains","source":536,"target":633},{"edgeType":"calls","source":1774,"target":397},{"edgeType":"calls","source":2499,"target":2497},{"edgeType":"imports","source":896,"target":902},{"edgeType":"contains","source":27,"target":28},{"edgeType":"contains","source":1596,"target":1861},{"edgeType":"calls","source":1068,"target":349},{"edgeType":"contains","source":107,"target":1776},{"edgeType":"contains","source":1513,"target":1527},{"edgeType":"calls","source":2290,"target":784},{"edgeType":"contains","source":1596,"target":1597},{"edgeType":"contains","source":1503,"target":1573},{"edgeType":"calls","source":352,"target":348},{"edgeType":"imports","source":81,"target":270},{"edgeType":"contains","source":1373,"target":1375},{"edgeType":"contains","source":827,"target":864},{"edgeType":"contains","source":1769,"target":1788},{"edgeType":"contains","source":2426,"target":2562},{"edgeType":"contains","source":1487,"target":1545},{"edgeType":"calls","source":771,"target":302},{"edgeType":"calls","source":1743,"target":296},{"edgeType":"calls","source":2679,"target":349},{"edgeType":"contains","source":2190,"target":2214},{"edgeType":"contains","source":354,"target":2050},{"edgeType":"contains","source":536,"target":636},{"edgeType":"contains","source":133,"target":708},{"edgeType":"calls","source":1597,"target":1386},{"edgeType":"contains","source":1596,"target":1866},{"edgeType":"calls","source":2091,"target":342},{"edgeType":"contains","source":2134,"target":2365},{"edgeType":"contains","source":83,"target":409},{"edgeType":"calls","source":2143,"target":317},{"edgeType":"contains","source":2161,"target":2585},{"edgeType":"contains","source":1720,"target":1722},{"edgeType":"contains","source":2438,"target":2454},{"edgeType":"contains","source":1431,"target":1432},{"edgeType":"calls","source":2704,"target":367},{"edgeType":"calls","source":2103,"target":1029},{"edgeType":"calls","source":1743,"target":295},{"edgeType":"contains","source":2190,"target":2215},{"edgeType":"contains","source":536,"target":635},{"edgeType":"contains","source":270,"target":689},{"edgeType":"contains","source":1090,"target":1166},{"edgeType":"calls","source":731,"target":748},{"edgeType":"contains","source":83,"target":408},{"edgeType":"contains","source":1595,"target":1898},{"edgeType":"contains","source":2,"target":12},{"edgeType":"contains","source":107,"target":2306},{"edgeType":"contains","source":1917,"target":1958},{"edgeType":"contains","source":1753,"target":1757},{"edgeType":"calls","source":1331,"target":382},{"edgeType":"calls","source":1005,"target":978},{"edgeType":"contains","source":270,"target":956},{"edgeType":"calls","source":689,"target":732},{"edgeType":"contains","source":105,"target":2107},{"edgeType":"calls","source":1774,"target":394},{"edgeType":"contains","source":2438,"target":2452},{"edgeType":"contains","source":1487,"target":1543},{"edgeType":"calls","source":1570,"target":376},{"edgeType":"contains","source":2190,"target":2212},{"edgeType":"contains","source":2190,"target":1419},{"edgeType":"contains","source":1496,"target":1793},{"edgeType":"contains","source":1596,"target":1864},{"edgeType":"contains","source":1595,"target":1895},{"edgeType":"calls","source":1359,"target":1367},{"edgeType":"contains","source":1753,"target":1754},{"edgeType":"contains","source":2,"target":1072},{"edgeType":"calls","source":386,"target":348},{"edgeType":"calls","source":1774,"target":393},{"edgeType":"contains","source":2438,"target":2453},{"edgeType":"calls","source":1631,"target":1655},{"edgeType":"contains","source":2190,"target":2213},{"edgeType":"contains","source":1580,"target":511},{"edgeType":"calls","source":1347,"target":153},{"edgeType":"contains","source":1443,"target":1587},{"edgeType":"contains","source":1596,"target":1865},{"edgeType":"calls","source":2679,"target":348},{"edgeType":"contains","source":1496,"target":1530},{"edgeType":"contains","source":1753,"target":1755},{"edgeType":"contains","source":2,"target":14},{"edgeType":"calls","source":1525,"target":1505},{"edgeType":"contains","source":1487,"target":1549},{"edgeType":"contains","source":357,"target":1168},{"edgeType":"contains","source":1596,"target":1870},{"edgeType":"calls","source":2730,"target":349},{"edgeType":"calls","source":1723,"target":383},{"edgeType":"contains","source":2190,"target":2218},{"edgeType":"calls","source":1370,"target":756},{"edgeType":"contains","source":327,"target":1834},{"edgeType":"contains","source":22,"target":2040},{"edgeType":"calls","source":1249,"target":278},{"edgeType":"contains","source":63,"target":769},{"edgeType":"calls","source":371,"target":278},{"edgeType":"contains","source":461,"target":586},{"edgeType":"contains","source":1811,"target":1812},{"edgeType":"contains","source":1917,"target":1961},{"edgeType":"calls","source":1331,"target":379},{"edgeType":"contains","source":83,"target":413},{"edgeType":"contains","source":1496,"target":1535},{"edgeType":"calls","source":1902,"target":1440},{"edgeType":"calls","source":1532,"target":1547},{"edgeType":"imports","source":70,"target":357},{"edgeType":"contains","source":1487,"target":1550},{"edgeType":"contains","source":105,"target":2108},{"edgeType":"calls","source":1963,"target":1927},{"edgeType":"calls","source":1723,"target":382},{"edgeType":"calls","source":1370,"target":755},{"edgeType":"calls","source":724,"target":168},{"edgeType":"contains","source":1580,"target":253},{"edgeType":"contains","source":1503,"target":1583},{"edgeType":"calls","source":1747,"target":1752},{"edgeType":"calls","source":1249,"target":1335},{"edgeType":"contains","source":2190,"target":2219},{"edgeType":"contains","source":2,"target":1601},{"edgeType":"contains","source":2190,"target":1427},{"edgeType":"contains","source":2,"target":16},{"edgeType":"calls","source":1069,"target":308},{"edgeType":"contains","source":2134,"target":2370},{"edgeType":"calls","source":1953,"target":1976},{"edgeType":"calls","source":1560,"target":153},{"edgeType":"contains","source":2,"target":19},{"edgeType":"calls","source":1743,"target":294},{"edgeType":"imports","source":1494,"target":1663},{"edgeType":"contains","source":1075,"target":317},{"edgeType":"contains","source":2190,"target":2216},{"edgeType":"calls","source":275,"target":349},{"edgeType":"calls","source":731,"target":747},{"edgeType":"contains","source":1443,"target":1590},{"edgeType":"contains","source":19,"target":21},{"edgeType":"imports","source":2426,"target":254},{"edgeType":"imports","source":70,"target":354},{"edgeType":"contains","source":83,"target":415},{"edgeType":"contains","source":1753,"target":1758},{"edgeType":"contains","source":219,"target":427},{"edgeType":"calls","source":1331,"target":381},{"edgeType":"contains","source":1882,"target":1987},{"edgeType":"contains","source":219,"target":426},{"edgeType":"contains","source":1487,"target":1548},{"edgeType":"calls","source":1743,"target":293},{"edgeType":"contains","source":1443,"target":1591},{"edgeType":"calls","source":275,"target":348},{"edgeType":"contains","source":2190,"target":2217},{"edgeType":"calls","source":2730,"target":348},{"edgeType":"calls","source":1723,"target":384},{"edgeType":"calls","source":1403,"target":791},{"edgeType":"contains","source":770,"target":786},{"edgeType":"contains","source":2134,"target":2368},{"edgeType":"calls","source":1331,"target":380},{"edgeType":"contains","source":83,"target":414},{"edgeType":"contains","source":2161,"target":2588},{"edgeType":"contains","source":1917,"target":1960},{"edgeType":"contains","source":695,"target":703},{"edgeType":"calls","source":734,"target":681},{"edgeType":"calls","source":1461,"target":342},{"edgeType":"contains","source":1445,"target":1501},{"edgeType":"calls","source":2113,"target":2064},{"edgeType":"contains","source":2179,"target":2266},{"edgeType":"calls","source":1597,"target":883},{"edgeType":"imports","source":2426,"target":1293},{"edgeType":"imports","source":1494,"target":1909},{"edgeType":"contains","source":2479,"target":2480},{"edgeType":"contains","source":1003,"target":668},{"edgeType":"calls","source":432,"target":530},{"edgeType":"contains","source":616,"target":773},{"edgeType":"calls","source":762,"target":342},{"edgeType":"contains","source":2066,"target":2070},{"edgeType":"contains","source":1033,"target":1059},{"edgeType":"calls","source":1570,"target":662},{"edgeType":"calls","source":1772,"target":1535},{"edgeType":"contains","source":2134,"target":2340},{"edgeType":"calls","source":1539,"target":302},{"edgeType":"calls","source":2095,"target":1830},{"edgeType":"calls","source":2137,"target":528},{"edgeType":"calls","source":734,"target":680},{"edgeType":"imports","source":1075,"target":100},{"edgeType":"imports","source":70,"target":72},{"edgeType":"contains","source":1281,"target":1565},{"edgeType":"contains","source":1445,"target":1502},{"edgeType":"calls","source":346,"target":288},{"edgeType":"contains","source":2179,"target":2267},{"edgeType":"calls","source":687,"target":287},{"edgeType":"calls","source":1094,"target":1148},{"edgeType":"contains","source":2479,"target":2481},{"edgeType":"contains","source":896,"target":1077},{"edgeType":"contains","source":327,"target":1539},{"edgeType":"contains","source":51,"target":54},{"edgeType":"contains","source":1003,"target":667},{"edgeType":"imports","source":1494,"target":1908},{"edgeType":"calls","source":432,"target":529},{"edgeType":"calls","source":1874,"target":1279},{"edgeType":"contains","source":2066,"target":2071},{"edgeType":"contains","source":1711,"target":1713},{"edgeType":"contains","source":1033,"target":1058},{"edgeType":"calls","source":2137,"target":529},{"edgeType":"calls","source":2095,"target":1827},{"edgeType":"calls","source":2137,"target":525},{"edgeType":"contains","source":695,"target":705},{"edgeType":"calls","source":734,"target":683},{"edgeType":"contains","source":2179,"target":2264},{"edgeType":"contains","source":1281,"target":1562},{"edgeType":"calls","source":1570,"target":665},{"edgeType":"contains","source":1445,"target":1499},{"edgeType":"calls","source":2492,"target":1148},{"edgeType":"contains","source":2066,"target":2068},{"edgeType":"imports","source":1494,"target":1907},{"edgeType":"contains","source":1777,"target":1778},{"edgeType":"calls","source":2130,"target":2064},{"edgeType":"contains","source":51,"target":57},{"edgeType":"contains","source":1487,"target":726},{"edgeType":"contains","source":896,"target":1080},{"edgeType":"contains","source":1033,"target":1061},{"edgeType":"contains","source":2134,"target":2338},{"edgeType":"calls","source":2095,"target":1828},{"edgeType":"calls","source":2137,"target":526},{"edgeType":"contains","source":695,"target":704},{"edgeType":"calls","source":734,"target":682},{"edgeType":"contains","source":943,"target":944},{"edgeType":"calls","source":1597,"target":884},{"edgeType":"contains","source":536,"target":612},{"edgeType":"calls","source":1570,"target":664},{"edgeType":"contains","source":2179,"target":2265},{"edgeType":"calls","source":1971,"target":1974},{"edgeType":"calls","source":2103,"target":2109},{"edgeType":"calls","source":1397,"target":741},{"edgeType":"contains","source":2066,"target":2069},{"edgeType":"contains","source":1003,"target":669},{"edgeType":"imports","source":1494,"target":1906},{"edgeType":"contains","source":896,"target":1079},{"edgeType":"contains","source":51,"target":56},{"edgeType":"calls","source":1979,"target":1990},{"edgeType":"contains","source":1777,"target":1779},{"edgeType":"calls","source":432,"target":531},{"edgeType":"contains","source":107,"target":434},{"edgeType":"calls","source":1570,"target":663},{"edgeType":"contains","source":1033,"target":1060},{"edgeType":"calls","source":2611,"target":367},{"edgeType":"calls","source":2095,"target":1829},{"edgeType":"calls","source":2137,"target":527},{"edgeType":"contains","source":2134,"target":2344},{"edgeType":"calls","source":2137,"target":523},{"edgeType":"contains","source":695,"target":707},{"edgeType":"contains","source":2179,"target":2270},{"edgeType":"calls","source":420,"target":369},{"edgeType":"calls","source":2330,"target":2468},{"edgeType":"calls","source":2398,"target":360},{"edgeType":"calls","source":432,"target":526},{"edgeType":"calls","source":1979,"target":1985},{"edgeType":"calls","source":1641,"target":307},{"edgeType":"contains","source":2190,"target":2194},{"edgeType":"calls","source":1971,"target":1440},{"edgeType":"calls","source":803,"target":388},{"edgeType":"contains","source":51,"target":59},{"edgeType":"calls","source":1411,"target":302},{"edgeType":"calls","source":2095,"target":1826},{"edgeType":"contains","source":695,"target":706},{"edgeType":"calls","source":2517,"target":1957},{"edgeType":"calls","source":2306,"target":2156},{"edgeType":"contains","source":1339,"target":1357},{"edgeType":"contains","source":1496,"target":1775},{"edgeType":"contains","source":2179,"target":2271},{"edgeType":"calls","source":2356,"target":342},{"edgeType":"contains","source":109,"target":110},{"edgeType":"contains","source":2190,"target":2195},{"edgeType":"contains","source":51,"target":58},{"edgeType":"calls","source":803,"target":387},{"edgeType":"calls","source":1375,"target":360},{"edgeType":"calls","source":1249,"target":302},{"edgeType":"contains","source":896,"target":1081},{"edgeType":"contains","source":1777,"target":1785},{"edgeType":"calls","source":432,"target":525},{"edgeType":"contains","source":1067,"target":1069},{"edgeType":"imports","source":1595,"target":357},{"edgeType":"calls","source":1069,"target":336},{"edgeType":"contains","source":1281,"target":1566},{"edgeType":"contains","source":1917,"target":1934},{"edgeType":"contains","source":2553,"target":2566},{"edgeType":"calls","source":734,"target":679},{"edgeType":"calls","source":1417,"target":1440},{"edgeType":"contains","source":2179,"target":2268},{"edgeType":"contains","source":1580,"target":1282},{"edgeType":"calls","source":687,"target":286},{"edgeType":"calls","source":709,"target":661},{"edgeType":"contains","source":1496,"target":1772},{"edgeType":"calls","source":2500,"target":367},{"edgeType":"contains","source":2129,"target":1969},{"edgeType":"calls","source":958,"target":342},{"edgeType":"calls","source":438,"target":342},{"edgeType":"calls","source":432,"target":528},{"edgeType":"contains","source":2066,"target":2072},{"edgeType":"contains","source":1496,"target":1508},{"edgeType":"contains","source":270,"target":935},{"edgeType":"contains","source":896,"target":1084},{"edgeType":"calls","source":433,"target":233},{"edgeType":"contains","source":2444,"target":1981},{"edgeType":"contains","source":1033,"target":1065},{"edgeType":"contains","source":49,"target":1443},{"edgeType":"contains","source":2134,"target":2343},{"edgeType":"calls","source":509,"target":518},{"edgeType":"calls","source":2095,"target":1824},{"edgeType":"calls","source":1401,"target":1406},{"edgeType":"calls","source":734,"target":678},{"edgeType":"calls","source":2398,"target":359},{"edgeType":"contains","source":2479,"target":2483},{"edgeType":"contains","source":2179,"target":2269},{"edgeType":"calls","source":432,"target":527},{"edgeType":"contains","source":2190,"target":2193},{"edgeType":"calls","source":1094,"target":1145},{"edgeType":"calls","source":1641,"target":308},{"edgeType":"calls","source":314,"target":221},{"edgeType":"contains","source":51,"target":60},{"edgeType":"contains","source":1487,"target":1524},{"edgeType":"contains","source":107,"target":438},{"edgeType":"contains","source":1033,"target":1064},{"edgeType":"calls","source":2492,"target":1145},{"edgeType":"calls","source":803,"target":389},{"edgeType":"contains","source":896,"target":1083},{"edgeType":"imports","source":2305,"target":1088},{"edgeType":"contains","source":2134,"target":2348},{"edgeType":"calls","source":2095,"target":1821},{"edgeType":"calls","source":1015,"target":947},{"edgeType":"calls","source":1789,"target":1793},{"edgeType":"contains","source":63,"target":219},{"edgeType":"contains","source":200,"target":201},{"edgeType":"contains","source":2179,"target":2274},{"edgeType":"contains","source":105,"target":1031},{"edgeType":"calls","source":651,"target":603},{"edgeType":"imports","source":896,"target":899},{"edgeType":"contains","source":2179,"target":2275},{"edgeType":"calls","source":893,"target":501},{"edgeType":"imports","source":107,"target":254},{"edgeType":"contains","source":270,"target":937},{"edgeType":"imports","source":1281,"target":327},{"edgeType":"contains","source":2190,"target":2198},{"edgeType":"contains","source":896,"target":1086},{"edgeType":"calls","source":675,"target":388},{"edgeType":"contains","source":1769,"target":2301},{"edgeType":"calls","source":2095,"target":1822},{"edgeType":"contains","source":2479,"target":2489},{"edgeType":"contains","source":1067,"target":1334},{"edgeType":"calls","source":2463,"target":456},{"edgeType":"calls","source":1535,"target":153},{"edgeType":"imports","source":1595,"target":1428},{"edgeType":"contains","source":2179,"target":2276},{"edgeType":"contains","source":2190,"target":2199},{"edgeType":"contains","source":1670,"target":1671},{"edgeType":"contains","source":1848,"target":1702},{"edgeType":"calls","source":675,"target":387},{"edgeType":"calls","source":1387,"target":780},{"edgeType":"calls","source":997,"target":978},{"edgeType":"imports","source":858,"target":490},{"edgeType":"calls","source":1290,"target":1409},{"edgeType":"contains","source":200,"target":203},{"edgeType":"contains","source":1067,"target":1337},{"edgeType":"contains","source":2179,"target":2272},{"edgeType":"calls","source":656,"target":715},{"edgeType":"calls","source":736,"target":349},{"edgeType":"contains","source":1835,"target":1838},{"edgeType":"calls","source":893,"target":503},{"edgeType":"contains","source":2190,"target":2196},{"edgeType":"calls","source":1375,"target":359},{"edgeType":"contains","source":1513,"target":1514},{"edgeType":"contains","source":357,"target":885},{"edgeType":"calls","source":908,"target":302},{"edgeType":"contains","source":1281,"target":1571},{"edgeType":"contains","source":1777,"target":1786},{"edgeType":"calls","source":436,"target":400},{"edgeType":"calls","source":1387,"target":779},{"edgeType":"imports","source":1494,"target":1914},{"edgeType":"calls","source":1290,"target":1408},{"edgeType":"contains","source":200,"target":202},{"edgeType":"contains","source":36,"target":2114},{"edgeType":"contains","source":2179,"target":2273},{"edgeType":"contains","source":105,"target":1032},{"edgeType":"contains","source":1711,"target":1719},{"edgeType":"imports","source":107,"target":253},{"edgeType":"calls","source":893,"target":502},{"edgeType":"calls","source":736,"target":348},{"edgeType":"calls","source":1290,"target":1407},{"edgeType":"contains","source":219,"target":405},{"edgeType":"contains","source":2190,"target":2197},{"edgeType":"calls","source":675,"target":389},{"edgeType":"contains","source":896,"target":1087},{"edgeType":"contains","source":1777,"target":1787},{"edgeType":"calls","source":432,"target":523},{"edgeType":"contains","source":2479,"target":2492},{"edgeType":"calls","source":2555,"target":1034},{"edgeType":"contains","source":2446,"target":2458},{"edgeType":"contains","source":836,"target":837},{"edgeType":"contains","source":1496,"target":1782},{"edgeType":"calls","source":484,"target":491},{"edgeType":"calls","source":905,"target":917},{"edgeType":"imports","source":1494,"target":1913},{"edgeType":"contains","source":2134,"target":2352},{"edgeType":"calls","source":1743,"target":308},{"edgeType":"calls","source":2715,"target":302},{"edgeType":"imports","source":2426,"target":1033},{"edgeType":"contains","source":1359,"target":1537},{"edgeType":"contains","source":68,"target":69},{"edgeType":"contains","source":270,"target":941},{"edgeType":"contains","source":2083,"target":2084},{"edgeType":"contains","source":2179,"target":2279},{"edgeType":"calls","source":811,"target":396},{"edgeType":"calls","source":2028,"target":986},{"edgeType":"contains","source":1513,"target":1520},{"edgeType":"contains","source":2190,"target":2202},{"edgeType":"imports","source":1002,"target":253},{"edgeType":"contains","source":133,"target":695},{"edgeType":"calls","source":1465,"target":733},{"edgeType":"contains","source":200,"target":204},{"edgeType":"calls","source":1743,"target":307},{"edgeType":"contains","source":1067,"target":1338},{"edgeType":"imports","source":1494,"target":1912},{"edgeType":"contains","source":63,"target":1280},{"edgeType":"contains","source":101,"target":102},{"edgeType":"contains","source":2083,"target":2085},{"edgeType":"contains","source":1513,"target":1521},{"edgeType":"contains","source":2179,"target":2280},{"edgeType":"contains","source":1711,"target":1725},{"edgeType":"calls","source":1363,"target":988},{"edgeType":"calls","source":811,"target":395},{"edgeType":"contains","source":2190,"target":2203},{"edgeType":"contains","source":357,"target":886},{"edgeType":"contains","source":327,"target":1816},{"edgeType":"imports","source":1494,"target":327},{"edgeType":"contains","source":1769,"target":1777},{"edgeType":"contains","source":770,"target":771},{"edgeType":"calls","source":1748,"target":1741},{"edgeType":"calls","source":565,"target":360},{"edgeType":"contains","source":98,"target":990},{"edgeType":"imports","source":1494,"target":1911},{"edgeType":"contains","source":536,"target":625},{"edgeType":"contains","source":2179,"target":2277},{"edgeType":"calls","source":823,"target":819},{"edgeType":"contains","source":81,"target":725},{"edgeType":"calls","source":760,"target":658},{"edgeType":"calls","source":2028,"target":988},{"edgeType":"calls","source":2732,"target":302},{"edgeType":"contains","source":2190,"target":2200},{"edgeType":"calls","source":811,"target":398},{"edgeType":"calls","source":1971,"target":1962},{"edgeType":"calls","source":1277,"target":1278},{"edgeType":"calls","source":484,"target":492},{"edgeType":"contains","source":803,"target":804},{"edgeType":"calls","source":565,"target":359},{"edgeType":"contains","source":2161,"target":2571},{"edgeType":"calls","source":685,"target":603},{"edgeType":"imports","source":1494,"target":1910},{"edgeType":"contains","source":2305,"target":2335},{"edgeType":"contains","source":536,"target":624},{"edgeType":"contains","source":2179,"target":2278},{"edgeType":"contains","source":1711,"target":1723},{"edgeType":"calls","source":2028,"target":987},{"edgeType":"contains","source":2190,"target":2201},{"edgeType":"contains","source":338,"target":420},{"edgeType":"calls","source":811,"target":397},{"edgeType":"calls","source":2138,"target":975},{"edgeType":"calls","source":1867,"target":391},{"edgeType":"contains","source":199,"target":207},{"edgeType":"contains","source":1033,"target":1043},{"edgeType":"contains","source":2305,"target":2308},{"edgeType":"contains","source":1095,"target":1235},{"edgeType":"contains","source":2134,"target":2323},{"edgeType":"contains","source":1788,"target":1951},{"edgeType":"contains","source":670,"target":668},{"edgeType":"contains","source":2179,"target":2250},{"edgeType":"contains","source":1677,"target":1692},{"edgeType":"calls","source":702,"target":567},{"edgeType":"contains","source":2115,"target":2120},{"edgeType":"calls","source":1438,"target":741},{"edgeType":"contains","source":1078,"target":1233},{"edgeType":"contains","source":1727,"target":1728},{"edgeType":"calls","source":445,"target":342},{"edgeType":"calls","source":794,"target":93},{"edgeType":"calls","source":2138,"target":976},{"edgeType":"contains","source":2379,"target":2393},{"edgeType":"contains","source":868,"target":872},{"edgeType":"contains","source":769,"target":770},{"edgeType":"contains","source":199,"target":206},{"edgeType":"contains","source":1677,"target":1693},{"edgeType":"contains","source":1033,"target":1042},{"edgeType":"contains","source":2134,"target":2324},{"edgeType":"calls","source":1535,"target":111},{"edgeType":"contains","source":2115,"target":2121},{"edgeType":"contains","source":670,"target":667},{"edgeType":"calls","source":1813,"target":1535},{"edgeType":"contains","source":1078,"target":1232},{"edgeType":"contains","source":2179,"target":2251},{"edgeType":"contains","source":109,"target":2467},{"edgeType":"contains","source":1727,"target":1729},{"edgeType":"calls","source":2138,"target":977},{"edgeType":"calls","source":1820,"target":1582},{"edgeType":"contains","source":68,"target":2420},{"edgeType":"calls","source":2138,"target":973},{"edgeType":"calls","source":334,"target":349},{"edgeType":"contains","source":199,"target":209},{"edgeType":"contains","source":2379,"target":2390},{"edgeType":"calls","source":1578,"target":367},{"edgeType":"calls","source":538,"target":367},{"edgeType":"contains","source":2134,"target":2321},{"edgeType":"calls","source":2749,"target":530},{"edgeType":"calls","source":1867,"target":393},{"edgeType":"contains","source":2526,"target":2590},{"edgeType":"contains","source":2161,"target":2541},{"edgeType":"contains","source":1033,"target":1045},{"edgeType":"contains","source":612,"target":619},{"edgeType":"contains","source":81,"target":431},{"edgeType":"calls","source":1931,"target":787},{"edgeType":"contains","source":2115,"target":2118},{"edgeType":"calls","source":789,"target":779},{"edgeType":"contains","source":1507,"target":1675},{"edgeType":"contains","source":2179,"target":2248},{"edgeType":"contains","source":1677,"target":1690},{"edgeType":"imports","source":2426,"target":1604},{"edgeType":"contains","source":2426,"target":1461},{"edgeType":"calls","source":1094,"target":308},{"edgeType":"calls","source":2749,"target":531},{"edgeType":"calls","source":538,"target":368},{"edgeType":"calls","source":2138,"target":974},{"edgeType":"calls","source":334,"target":348},{"edgeType":"contains","source":327,"target":1525},{"edgeType":"contains","source":199,"target":208},{"edgeType":"contains","source":1033,"target":1044},{"edgeType":"calls","source":2626,"target":2230},{"edgeType":"contains","source":2305,"target":2307},{"edgeType":"contains","source":2134,"target":2322},{"edgeType":"calls","source":2311,"target":368},{"edgeType":"contains","source":612,"target":618},{"edgeType":"contains","source":1859,"target":1863},{"edgeType":"calls","source":2537,"target":233},{"edgeType":"contains","source":2115,"target":2119},{"edgeType":"contains","source":670,"target":669},{"edgeType":"calls","source":1718,"target":254},{"edgeType":"imports","source":1281,"target":103},{"edgeType":"calls","source":607,"target":342},{"edgeType":"contains","source":2179,"target":2249},{"edgeType":"contains","source":1677,"target":1691},{"edgeType":"calls","source":1094,"target":307},{"edgeType":"calls","source":1069,"target":1082},{"edgeType":"calls","source":1279,"target":650},{"edgeType":"calls","source":786,"target":342},{"edgeType":"contains","source":1702,"target":1709},{"edgeType":"contains","source":612,"target":621},{"edgeType":"contains","source":199,"target":211},{"edgeType":"calls","source":2138,"target":971},{"edgeType":"calls","source":947,"target":895},{"edgeType":"contains","source":991,"target":1028},{"edgeType":"calls","source":481,"target":278},{"edgeType":"contains","source":1677,"target":1696},{"edgeType":"calls","source":2749,"target":528},{"edgeType":"calls","source":1928,"target":1931},{"edgeType":"contains","source":1033,"target":1047},{"edgeType":"calls","source":402,"target":349},{"edgeType":"calls","source":1367,"target":295},{"edgeType":"calls","source":648,"target":387},{"edgeType":"imports","source":1494,"target":1426},{"edgeType":"calls","source":2688,"target":570},{"edgeType":"calls","source":2127,"target":784},{"edgeType":"contains","source":327,"target":1792},{"edgeType":"calls","source":2303,"target":349},{"edgeType":"calls","source":1922,"target":531},{"edgeType":"contains","source":2179,"target":2254},{"edgeType":"contains","source":1595,"target":1596},{"edgeType":"contains","source":2115,"target":2124},{"edgeType":"contains","source":7,"target":85},{"edgeType":"contains","source":1075,"target":273},{"edgeType":"calls","source":2759,"target":2597},{"edgeType":"contains","source":1727,"target":1732},{"edgeType":"contains","source":1002,"target":1479},{"edgeType":"contains","source":1339,"target":1340},{"edgeType":"contains","source":2379,"target":2396},{"edgeType":"contains","source":612,"target":620},{"edgeType":"calls","source":2138,"target":972},{"edgeType":"contains","source":199,"target":210},{"edgeType":"calls","source":412,"target":302},{"edgeType":"calls","source":2749,"target":529},{"edgeType":"calls","source":2149,"target":367},{"edgeType":"calls","source":2689,"target":275},{"edgeType":"calls","source":1979,"target":349},{"edgeType":"calls","source":402,"target":348},{"edgeType":"contains","source":1677,"target":1697},{"edgeType":"contains","source":81,"target":432},{"edgeType":"contains","source":1033,"target":1046},{"edgeType":"contains","source":2134,"target":2329},{"edgeType":"calls","source":1367,"target":294},{"edgeType":"calls","source":2127,"target":785},{"edgeType":"calls","source":1614,"target":1622},{"edgeType":"calls","source":2507,"target":368},{"edgeType":"calls","source":1922,"target":530},{"edgeType":"contains","source":560,"target":646},{"edgeType":"contains","source":354,"target":1747},{"edgeType":"calls","source":2465,"target":1406},{"edgeType":"imports","source":2134,"target":83},{"edgeType":"contains","source":2179,"target":2255},{"edgeType":"contains","source":49,"target":896},{"edgeType":"contains","source":612,"target":623},{"edgeType":"calls","source":2678,"target":349},{"edgeType":"contains","source":270,"target":919},{"edgeType":"contains","source":219,"target":386},{"edgeType":"contains","source":1677,"target":1694},{"edgeType":"calls","source":1671,"target":1708},{"edgeType":"contains","source":2444,"target":1965},{"edgeType":"calls","source":2749,"target":526},{"edgeType":"calls","source":1271,"target":367},{"edgeType":"calls","source":648,"target":389},{"edgeType":"contains","source":1033,"target":1049},{"edgeType":"calls","source":2759,"target":2595},{"edgeType":"contains","source":98,"target":966},{"edgeType":"contains","source":2115,"target":2122},{"edgeType":"contains","source":2179,"target":2252},{"edgeType":"contains","source":1661,"target":1662},{"edgeType":"calls","source":2306,"target":254},{"edgeType":"contains","source":1720,"target":1947},{"edgeType":"contains","source":2513,"target":354},{"edgeType":"contains","source":1369,"target":1465},{"edgeType":"contains","source":1496,"target":1756},{"edgeType":"contains","source":612,"target":622},{"edgeType":"contains","source":827,"target":828},{"edgeType":"calls","source":1504,"target":278},{"edgeType":"calls","source":2749,"target":527},{"edgeType":"calls","source":2159,"target":2169},{"edgeType":"contains","source":1677,"target":1695},{"edgeType":"calls","source":736,"target":302},{"edgeType":"contains","source":1033,"target":1048},{"edgeType":"contains","source":1095,"target":1240},{"edgeType":"calls","source":1367,"target":296},{"edgeType":"calls","source":2759,"target":2596},{"edgeType":"calls","source":648,"target":388},{"edgeType":"contains","source":61,"target":2112},{"edgeType":"contains","source":2134,"target":2327},{"edgeType":"contains","source":1917,"target":1919},{"edgeType":"calls","source":427,"target":368},{"edgeType":"calls","source":2303,"target":348},{"edgeType":"contains","source":2179,"target":2253},{"edgeType":"contains","source":1727,"target":1731},{"edgeType":"contains","source":2379,"target":2395},{"edgeType":"calls","source":2465,"target":2461},{"edgeType":"calls","source":2038,"target":367},{"edgeType":"calls","source":2516,"target":348},{"edgeType":"contains","source":2553,"target":2556},{"edgeType":"calls","source":436,"target":348},{"edgeType":"calls","source":1440,"target":1464},{"edgeType":"contains","source":1677,"target":1700},{"edgeType":"contains","source":2161,"target":2287},{"edgeType":"contains","source":1033,"target":1051},{"edgeType":"contains","source":2041,"target":2044},{"edgeType":"calls","source":2759,"target":2593},{"edgeType":"contains","source":270,"target":392},{"edgeType":"calls","source":1922,"target":527},{"edgeType":"calls","source":2539,"target":2542},{"edgeType":"imports","source":1002,"target":1362},{"edgeType":"contains","source":2179,"target":2258},{"edgeType":"contains","source":2179,"target":2259},{"edgeType":"contains","source":1677,"target":1701},{"edgeType":"calls","source":1988,"target":1916},{"edgeType":"contains","source":2526,"target":2601},{"edgeType":"calls","source":2678,"target":348},{"edgeType":"calls","source":2516,"target":349},{"edgeType":"contains","source":1281,"target":1557},{"edgeType":"imports","source":2426,"target":1614},{"edgeType":"contains","source":49,"target":107},{"edgeType":"calls","source":2749,"target":525},{"edgeType":"calls","source":1705,"target":1704},{"edgeType":"calls","source":674,"target":368},{"edgeType":"calls","source":2759,"target":2594},{"edgeType":"contains","source":1882,"target":1953},{"edgeType":"contains","source":1033,"target":1050},{"edgeType":"contains","source":1281,"target":1293},{"edgeType":"calls","source":1922,"target":526},{"edgeType":"contains","source":2041,"target":2045},{"edgeType":"calls","source":1523,"target":1532},{"edgeType":"contains","source":100,"target":112},{"edgeType":"calls","source":689,"target":699},{"edgeType":"contains","source":1485,"target":1836},{"edgeType":"contains","source":2,"target":2360},{"edgeType":"contains","source":1003,"target":662},{"edgeType":"contains","source":695,"target":697},{"edgeType":"calls","source":1979,"target":348},{"edgeType":"contains","source":2553,"target":2554},{"edgeType":"contains","source":1677,"target":1698},{"edgeType":"calls","source":2159,"target":2164},{"edgeType":"contains","source":2041,"target":2042},{"edgeType":"calls","source":1367,"target":293},{"edgeType":"calls","source":2149,"target":360},{"edgeType":"contains","source":327,"target":741},{"edgeType":"calls","source":2097,"target":915},{"edgeType":"contains","source":1033,"target":1053},{"edgeType":"contains","source":2115,"target":2126},{"edgeType":"calls","source":1922,"target":529},{"edgeType":"contains","source":2179,"target":2256},{"edgeType":"contains","source":199,"target":217},{"edgeType":"contains","source":1075,"target":1336},{"edgeType":"calls","source":689,"target":698},{"edgeType":"contains","source":695,"target":696},{"edgeType":"contains","source":896,"target":1071},{"edgeType":"calls","source":436,"target":349},{"edgeType":"calls","source":2749,"target":523},{"edgeType":"contains","source":1677,"target":1699},{"edgeType":"contains","source":1711,"target":1702},{"edgeType":"contains","source":1033,"target":1052},{"edgeType":"calls","source":1372,"target":401},{"edgeType":"calls","source":2759,"target":2592},{"edgeType":"contains","source":2134,"target":2331},{"edgeType":"calls","source":1922,"target":528},{"edgeType":"imports","source":1281,"target":111},{"edgeType":"contains","source":2179,"target":2257},{"edgeType":"imports","source":1494,"target":641},{"edgeType":"imports","source":2161,"target":2162},{"edgeType":"contains","source":2179,"target":2262},{"edgeType":"calls","source":1094,"target":294},{"edgeType":"contains","source":1281,"target":1560},{"edgeType":"contains","source":1003,"target":664},{"edgeType":"calls","source":1922,"target":523},{"edgeType":"contains","source":2041,"target":2048},{"edgeType":"calls","source":1440,"target":1459},{"edgeType":"contains","source":1033,"target":1055},{"edgeType":"imports","source":1595,"target":153},{"edgeType":"contains","source":1496,"target":1766},{"edgeType":"calls","source":2759,"target":2589},{"edgeType":"contains","source":2,"target":777},{"edgeType":"contains","source":896,"target":1074},{"edgeType":"contains","source":1369,"target":1475},{"edgeType":"contains","source":1788,"target":1963},{"edgeType":"contains","source":1095,"target":1247},{"edgeType":"contains","source":2525,"target":785},{"edgeType":"calls","source":2507,"target":359},{"edgeType":"calls","source":1969,"target":387},{"edgeType":"calls","source":430,"target":266},{"edgeType":"calls","source":958,"target":809},{"edgeType":"contains","source":2179,"target":2263},{"edgeType":"calls","source":1094,"target":293},{"edgeType":"contains","source":1445,"target":1498},{"edgeType":"contains","source":1003,"target":663},{"edgeType":"calls","source":1963,"target":308},{"edgeType":"contains","source":63,"target":735},{"edgeType":"calls","source":2558,"target":1950},{"edgeType":"contains","source":2066,"target":2067},{"edgeType":"calls","source":2149,"target":359},{"edgeType":"imports","source":1075,"target":153},{"edgeType":"calls","source":1440,"target":1458},{"edgeType":"contains","source":1369,"target":1476},{"edgeType":"contains","source":1810,"target":1811},{"edgeType":"contains","source":1033,"target":1054},{"edgeType":"calls","source":2168,"target":1620},{"edgeType":"contains","source":2134,"target":2337},{"edgeType":"contains","source":199,"target":218},{"edgeType":"calls","source":2507,"target":360},{"edgeType":"calls","source":430,"target":265},{"edgeType":"contains","source":2179,"target":2260},{"edgeType":"calls","source":1094,"target":296},{"edgeType":"calls","source":674,"target":367},{"edgeType":"calls","source":1522,"target":1034},{"edgeType":"contains","source":1003,"target":666},{"edgeType":"calls","source":512,"target":368},{"edgeType":"contains","source":695,"target":701},{"edgeType":"contains","source":2165,"target":2166},{"edgeType":"contains","source":51,"target":53},{"edgeType":"calls","source":1962,"target":342},{"edgeType":"calls","source":1440,"target":1461},{"edgeType":"contains","source":2041,"target":2046},{"edgeType":"calls","source":2097,"target":911},{"edgeType":"calls","source":1922,"target":525},{"edgeType":"contains","source":1033,"target":1057},{"edgeType":"contains","source":2134,"target":2334},{"edgeType":"calls","source":1969,"target":389},{"edgeType":"calls","source":978,"target":984},{"edgeType":"calls","source":2337,"target":342},{"edgeType":"contains","source":2179,"target":2261},{"edgeType":"calls","source":1069,"target":1070},{"edgeType":"calls","source":1094,"target":295},{"edgeType":"calls","source":1096,"target":233},{"edgeType":"calls","source":2137,"target":2314},{"edgeType":"contains","source":1003,"target":665},{"edgeType":"calls","source":512,"target":367},{"edgeType":"contains","source":51,"target":52},{"edgeType":"contains","source":1075,"target":1604},{"edgeType":"calls","source":366,"target":401},{"edgeType":"contains","source":1369,"target":1474},{"edgeType":"contains","source":1033,"target":1056},{"edgeType":"calls","source":1440,"target":1460},{"edgeType":"contains","source":1095,"target":1248},{"edgeType":"contains","source":2525,"target":784},{"edgeType":"calls","source":1969,"target":388},{"edgeType":"calls","source":958,"target":839},{"edgeType":"calls","source":1663,"target":918},{"edgeType":"calls","source":2166,"target":388},{"edgeType":"contains","source":2179,"target":2233},{"edgeType":"contains","source":1078,"target":1217},{"edgeType":"calls","source":674,"target":658},{"edgeType":"calls","source":1723,"target":379},{"edgeType":"calls","source":336,"target":302},{"edgeType":"contains","source":517,"target":638},{"edgeType":"calls","source":1903,"target":348},{"edgeType":"contains","source":83,"target":87},{"edgeType":"contains","source":1097,"target":1156},{"edgeType":"calls","source":2746,"target":378},{"edgeType":"contains","source":66,"target":878},{"edgeType":"contains","source":107,"target":1721},{"edgeType":"contains","source":109,"target":1659},{"edgeType":"contains","source":2161,"target":2527},{"edgeType":"imports","source":1002,"target":1339},{"edgeType":"calls","source":958,"target":838},{"edgeType":"calls","source":2338,"target":342},{"edgeType":"calls","source":2166,"target":389},{"edgeType":"contains","source":2179,"target":2234},{"edgeType":"calls","source":2635,"target":1970},{"edgeType":"contains","source":1078,"target":1216},{"edgeType":"contains","source":354,"target":1991},{"edgeType":"imports","source":1673,"target":1677},{"edgeType":"calls","source":353,"target":302},{"edgeType":"imports","source":858,"target":253},{"edgeType":"calls","source":1978,"target":1986},{"edgeType":"contains","source":1396,"target":1403},{"edgeType":"contains","source":1097,"target":1155},{"edgeType":"contains","source":487,"target":510},{"edgeType":"contains","source":1251,"target":1670},{"edgeType":"contains","source":451,"target":569},{"edgeType":"contains","source":1487,"target":1489},{"edgeType":"calls","source":802,"target":389},{"edgeType":"calls","source":1359,"target":302},{"edgeType":"contains","source":2526,"target":2573},{"edgeType":"calls","source":1963,"target":1926},{"edgeType":"contains","source":2179,"target":2231},{"edgeType":"contains","source":105,"target":2049},{"edgeType":"calls","source":724,"target":167},{"edgeType":"calls","source":1723,"target":381},{"edgeType":"contains","source":270,"target":370},{"edgeType":"imports","source":1673,"target":1676},{"edgeType":"contains","source":1078,"target":1219},{"edgeType":"contains","source":1596,"target":1542},{"edgeType":"contains","source":517,"target":640},{"edgeType":"contains","source":513,"target":764},{"edgeType":"calls","source":1477,"target":1400},{"edgeType":"contains","source":1586,"target":1588},{"edgeType":"contains","source":1396,"target":1400},{"edgeType":"contains","source":1097,"target":1158},{"edgeType":"calls","source":2746,"target":376},{"edgeType":"calls","source":1069,"target":307},{"edgeType":"contains","source":2179,"target":2232},{"edgeType":"calls","source":724,"target":166},{"edgeType":"calls","source":2166,"target":387},{"edgeType":"contains","source":1075,"target":254},{"edgeType":"contains","source":1078,"target":1218},{"edgeType":"calls","source":1723,"target":380},{"edgeType":"contains","source":517,"target":639},{"edgeType":"contains","source":451,"target":571},{"edgeType":"contains","source":24,"target":1917},{"edgeType":"contains","source":1586,"target":1589},{"edgeType":"calls","source":1903,"target":349},{"edgeType":"contains","source":1097,"target":1157},{"edgeType":"calls","source":2746,"target":377},{"edgeType":"contains","source":2484,"target":2560},{"edgeType":"contains","source":1097,"target":1161},{"edgeType":"calls","source":1268,"target":1267},{"edgeType":"calls","source":392,"target":411},{"edgeType":"calls","source":1434,"target":349},{"edgeType":"contains","source":2179,"target":2237},{"edgeType":"contains","source":2601,"target":2633},{"edgeType":"imports","source":1673,"target":1674},{"edgeType":"contains","source":1078,"target":1221},{"edgeType":"contains","source":16,"target":1904},{"edgeType":"calls","source":728,"target":302},{"edgeType":"contains","source":1075,"target":1578},{"edgeType":"contains","source":1753,"target":1702},{"edgeType":"calls","source":2038,"target":387},{"edgeType":"contains","source":2479,"target":72},{"edgeType":"calls","source":1953,"target":1965},{"edgeType":"calls","source":1718,"target":265},{"edgeType":"contains","source":1677,"target":1680},{"edgeType":"calls","source":907,"target":302},{"edgeType":"contains","source":1097,"target":1160},{"edgeType":"imports","source":2441,"target":327},{"edgeType":"contains","source":2484,"target":2561},{"edgeType":"contains","source":858,"target":641},{"edgeType":"calls","source":392,"target":410},{"edgeType":"calls","source":1434,"target":348},{"edgeType":"contains","source":2179,"target":2238},{"edgeType":"calls","source":774,"target":724},{"edgeType":"contains","source":272,"target":309},{"edgeType":"contains","source":270,"target":371},{"edgeType":"calls","source":1069,"target":1093},{"edgeType":"contains","source":1078,"target":1220},{"edgeType":"calls","source":655,"target":714},{"edgeType":"calls","source":1743,"target":282},{"edgeType":"contains","source":327,"target":1510},{"edgeType":"calls","source":1837,"target":275},{"edgeType":"calls","source":1476,"target":367},{"edgeType":"contains","source":1677,"target":1681},{"edgeType":"contains","source":1097,"target":1159},{"edgeType":"contains","source":2161,"target":2529},{"edgeType":"calls","source":1524,"target":1525},{"edgeType":"contains","source":1097,"target":1163},{"edgeType":"contains","source":2479,"target":1656},{"edgeType":"contains","source":2484,"target":2558},{"edgeType":"calls","source":330,"target":221},{"edgeType":"calls","source":774,"target":727},{"edgeType":"contains","source":2179,"target":2235},{"edgeType":"contains","source":1720,"target":1930},{"edgeType":"contains","source":42,"target":43},{"edgeType":"imports","source":1002,"target":1067},{"edgeType":"contains","source":1078,"target":1223},{"edgeType":"calls","source":2485,"target":1592},{"edgeType":"imports","source":1580,"target":327},{"edgeType":"calls","source":2038,"target":389},{"edgeType":"contains","source":1677,"target":1678},{"edgeType":"calls","source":802,"target":388},{"edgeType":"contains","source":1097,"target":1162},{"edgeType":"contains","source":2,"target":1810},{"edgeType":"contains","source":2134,"target":2310},{"edgeType":"calls","source":2695,"target":368},{"edgeType":"calls","source":1367,"target":1370},{"edgeType":"contains","source":2484,"target":2559},{"edgeType":"contains","source":2179,"target":2236},{"edgeType":"contains","source":354,"target":676},{"edgeType":"contains","source":1078,"target":1222},{"edgeType":"calls","source":802,"target":387},{"edgeType":"calls","source":2038,"target":388},{"edgeType":"calls","source":1718,"target":266},{"edgeType":"contains","source":1677,"target":1679},{"edgeType":"contains","source":7,"target":598},{"edgeType":"contains","source":1033,"target":1035},{"edgeType":"contains","source":1720,"target":1936},{"edgeType":"calls","source":774,"target":721},{"edgeType":"contains","source":2161,"target":2535},{"edgeType":"contains","source":327,"target":1516},{"edgeType":"calls","source":1367,"target":308},{"edgeType":"imports","source":133,"target":273},{"edgeType":"calls","source":852,"target":681},{"edgeType":"calls","source":691,"target":387},{"edgeType":"contains","source":2179,"target":2241},{"edgeType":"contains","source":1078,"target":1225},{"edgeType":"calls","source":852,"target":682},{"edgeType":"contains","source":63,"target":451},{"edgeType":"contains","source":1586,"target":1598},{"edgeType":"contains","source":1507,"target":1669},{"edgeType":"contains","source":133,"target":659},{"edgeType":"contains","source":1677,"target":1684},{"edgeType":"contains","source":1066,"target":1068},{"edgeType":"contains","source":1033,"target":1034},{"edgeType":"imports","source":2305,"target":327},{"edgeType":"calls","source":774,"target":720},{"edgeType":"contains","source":777,"target":778},{"edgeType":"calls","source":2501,"target":302},{"edgeType":"contains","source":1485,"target":1823},{"edgeType":"calls","source":1069,"target":296},{"edgeType":"contains","source":16,"target":585},{"edgeType":"calls","source":1532,"target":1534},{"edgeType":"contains","source":2,"target":2076},{"edgeType":"calls","source":1367,"target":307},{"edgeType":"calls","source":852,"target":680},{"edgeType":"calls","source":1867,"target":398},{"edgeType":"contains","source":2179,"target":2242},{"edgeType":"calls","source":1991,"target":782},{"edgeType":"contains","source":1078,"target":1224},{"edgeType":"contains","source":2179,"target":2243},{"edgeType":"contains","source":1677,"target":1685},{"edgeType":"contains","source":42,"target":44},{"edgeType":"contains","source":1002,"target":1466},{"edgeType":"contains","source":63,"target":1507},{"edgeType":"contains","source":1487,"target":1497},{"edgeType":"imports","source":1673,"target":100},{"edgeType":"contains","source":1586,"target":1599},{"edgeType":"contains","source":1702,"target":1703},{"edgeType":"calls","source":2680,"target":2681},{"edgeType":"contains","source":2032,"target":986},{"edgeType":"contains","source":2134,"target":2313},{"edgeType":"imports","source":1580,"target":1396},{"edgeType":"calls","source":774,"target":723},{"edgeType":"contains","source":1033,"target":1037},{"edgeType":"contains","source":81,"target":423},{"edgeType":"calls","source":691,"target":389},{"edgeType":"calls","source":1856,"target":1535},{"edgeType":"contains","source":2569,"target":2570},{"edgeType":"calls","source":1978,"target":1981},{"edgeType":"calls","source":453,"target":368},{"edgeType":"contains","source":2179,"target":2239},{"edgeType":"contains","source":2379,"target":2382},{"edgeType":"contains","source":109,"target":876},{"edgeType":"contains","source":670,"target":662},{"edgeType":"calls","source":2402,"target":2311},{"edgeType":"contains","source":1078,"target":1227},{"edgeType":"contains","source":1677,"target":1682},{"edgeType":"contains","source":1033,"target":1036},{"edgeType":"contains","source":327,"target":1781},{"edgeType":"calls","source":774,"target":722},{"edgeType":"contains","source":7,"target":866},{"edgeType":"contains","source":1593,"target":1644},{"edgeType":"calls","source":453,"target":367},{"edgeType":"contains","source":2179,"target":2240},{"edgeType":"contains","source":2313,"target":2315},{"edgeType":"contains","source":199,"target":200},{"edgeType":"calls","source":691,"target":388},{"edgeType":"contains","source":1002,"target":1468},{"edgeType":"calls","source":852,"target":683},{"edgeType":"contains","source":1487,"target":1495},{"edgeType":"contains","source":270,"target":905},{"edgeType":"contains","source":1078,"target":1226},{"edgeType":"calls","source":2102,"target":2099},{"edgeType":"contains","source":1677,"target":1683},{"edgeType":"contains","source":1790,"target":1620},{"edgeType":"contains","source":61,"target":781},{"edgeType":"calls","source":774,"target":717},{"edgeType":"contains","source":1033,"target":1039},{"edgeType":"contains","source":868,"target":869},{"edgeType":"contains","source":2379,"target":2388},{"edgeType":"contains","source":81,"target":425},{"edgeType":"calls","source":1867,"target":395},{"edgeType":"calls","source":1069,"target":293},{"edgeType":"calls","source":757,"target":716},{"edgeType":"contains","source":670,"target":664},{"edgeType":"contains","source":2179,"target":2246},{"edgeType":"calls","source":2721,"target":348},{"edgeType":"contains","source":1677,"target":1688},{"edgeType":"calls","source":2137,"target":2332},{"edgeType":"contains","source":2115,"target":2116},{"edgeType":"contains","source":1078,"target":1229},{"edgeType":"contains","source":12,"target":979},{"edgeType":"contains","source":1002,"target":1471},{"edgeType":"calls","source":504,"target":367},{"edgeType":"imports","source":2426,"target":801},{"edgeType":"contains","source":63,"target":2569},{"edgeType":"contains","source":1702,"target":1706},{"edgeType":"contains","source":50,"target":65},{"edgeType":"calls","source":774,"target":716},{"edgeType":"contains","source":1033,"target":1038},{"edgeType":"contains","source":2134,"target":2320},{"edgeType":"calls","source":1867,"target":394},{"edgeType":"calls","source":2137,"target":2333},{"edgeType":"contains","source":2115,"target":2117},{"edgeType":"calls","source":1931,"target":788},{"edgeType":"contains","source":670,"target":663},{"edgeType":"calls","source":2721,"target":349},{"edgeType":"calls","source":789,"target":780},{"edgeType":"contains","source":1078,"target":1228},{"edgeType":"contains","source":2179,"target":2247},{"edgeType":"contains","source":1677,"target":1689},{"edgeType":"calls","source":450,"target":454},{"edgeType":"contains","source":1002,"target":1470},{"edgeType":"contains","source":1702,"target":1707},{"edgeType":"calls","source":1514,"target":1034},{"edgeType":"contains","source":2134,"target":2317},{"edgeType":"contains","source":354,"target":685},{"edgeType":"contains","source":199,"target":205},{"edgeType":"contains","source":2161,"target":2537},{"edgeType":"contains","source":1033,"target":1041},{"edgeType":"calls","source":1069,"target":295},{"edgeType":"calls","source":1532,"target":1533},{"edgeType":"contains","source":835,"target":2158},{"edgeType":"imports","source":70,"target":2484},{"edgeType":"calls","source":852,"target":679},{"edgeType":"calls","source":1867,"target":397},{"edgeType":"contains","source":2179,"target":2244},{"edgeType":"contains","source":1677,"target":1686},{"edgeType":"contains","source":670,"target":666},{"edgeType":"calls","source":1743,"target":277},{"edgeType":"calls","source":1510,"target":365},{"edgeType":"contains","source":1702,"target":1704},{"edgeType":"contains","source":1078,"target":1231},{"edgeType":"contains","source":1413,"target":1414},{"edgeType":"contains","source":2032,"target":987},{"edgeType":"contains","source":835,"target":836},{"edgeType":"contains","source":1033,"target":1040},{"edgeType":"calls","source":1774,"target":901},{"edgeType":"calls","source":1867,"target":396},{"edgeType":"calls","source":450,"target":456},{"edgeType":"calls","source":257,"target":361},{"edgeType":"calls","source":1069,"target":294},{"edgeType":"calls","source":852,"target":678},{"edgeType":"calls","source":911,"target":963},{"edgeType":"calls","source":1434,"target":342},{"edgeType":"contains","source":670,"target":665},{"edgeType":"contains","source":2179,"target":2245},{"edgeType":"contains","source":1677,"target":1687},{"edgeType":"contains","source":1002,"target":1472},{"edgeType":"calls","source":856,"target":819},{"edgeType":"contains","source":835,"target":2421},{"edgeType":"contains","source":2032,"target":988},{"edgeType":"contains","source":1078,"target":1230},{"edgeType":"contains","source":1702,"target":1705},{"edgeType":"contains","source":1413,"target":1415},{"edgeType":"contains","source":2444,"target":1401},{"edgeType":"contains","source":801,"target":803},{"edgeType":"calls","source":754,"target":639},{"edgeType":"calls","source":1627,"target":531},{"edgeType":"calls","source":438,"target":393},{"edgeType":"calls","source":1542,"target":523},{"edgeType":"calls","source":1539,"target":1145},{"edgeType":"contains","source":1097,"target":1140},{"edgeType":"contains","source":2134,"target":2290},{"edgeType":"contains","source":740,"target":844},{"edgeType":"contains","source":327,"target":2019},{"edgeType":"contains","source":2,"target":2053},{"edgeType":"calls","source":978,"target":302},{"edgeType":"contains","source":1759,"target":1760},{"edgeType":"contains","source":362,"target":670},{"edgeType":"contains","source":1078,"target":1200},{"edgeType":"contains","source":1073,"target":1355},{"edgeType":"imports","source":2426,"target":2432},{"edgeType":"contains","source":1503,"target":1504},{"edgeType":"contains","source":7,"target":48},{"edgeType":"calls","source":418,"target":221},{"edgeType":"contains","source":1602,"target":1606},{"edgeType":"contains","source":272,"target":289},{"edgeType":"contains","source":740,"target":843},{"edgeType":"contains","source":7,"target":2425},{"edgeType":"calls","source":363,"target":603},{"edgeType":"calls","source":754,"target":638},{"edgeType":"calls","source":1627,"target":530},{"edgeType":"contains","source":801,"target":802},{"edgeType":"contains","source":1702,"target":356},{"edgeType":"contains","source":1097,"target":1139},{"edgeType":"calls","source":1989,"target":1992},{"edgeType":"contains","source":81,"target":660},{"edgeType":"calls","source":2690,"target":348},{"edgeType":"contains","source":1759,"target":1761},{"edgeType":"contains","source":327,"target":2018},{"edgeType":"calls","source":486,"target":490},{"edgeType":"calls","source":1385,"target":368},{"edgeType":"imports","source":2426,"target":317},{"edgeType":"contains","source":1078,"target":1199},{"edgeType":"contains","source":1073,"target":1354},{"edgeType":"calls","source":775,"target":780},{"edgeType":"contains","source":1280,"target":1283},{"edgeType":"contains","source":1602,"target":1607},{"edgeType":"contains","source":2475,"target":2552},{"edgeType":"calls","source":1525,"target":788},{"edgeType":"calls","source":2507,"target":732},{"edgeType":"contains","source":327,"target":1493},{"edgeType":"calls","source":438,"target":395},{"edgeType":"contains","source":24,"target":51},{"edgeType":"contains","source":83,"target":336},{"edgeType":"contains","source":1097,"target":1142},{"edgeType":"contains","source":740,"target":846},{"edgeType":"imports","source":2612,"target":100},{"edgeType":"calls","source":2143,"target":389},{"edgeType":"calls","source":254,"target":286},{"edgeType":"calls","source":222,"target":221},{"edgeType":"calls","source":438,"target":396},{"edgeType":"calls","source":1542,"target":525},{"edgeType":"contains","source":272,"target":291},{"edgeType":"calls","source":734,"target":733},{"edgeType":"contains","source":1078,"target":1202},{"edgeType":"contains","source":14,"target":96},{"edgeType":"calls","source":1525,"target":787},{"edgeType":"contains","source":2601,"target":2611},{"edgeType":"contains","source":991,"target":992},{"edgeType":"imports","source":1494,"target":1988},{"edgeType":"calls","source":438,"target":394},{"edgeType":"calls","source":2507,"target":733},{"edgeType":"contains","source":735,"target":736},{"edgeType":"contains","source":2134,"target":2289},{"edgeType":"contains","source":1097,"target":1141},{"edgeType":"calls","source":1922,"target":1957},{"edgeType":"contains","source":327,"target":2020},{"edgeType":"calls","source":1766,"target":1772},{"edgeType":"calls","source":1530,"target":367},{"edgeType":"contains","source":1078,"target":1201},{"edgeType":"calls","source":2766,"target":368},{"edgeType":"contains","source":461,"target":509},{"edgeType":"imports","source":1494,"target":1989},{"edgeType":"imports","source":107,"target":327},{"edgeType":"contains","source":272,"target":290},{"edgeType":"calls","source":734,"target":732},{"edgeType":"calls","source":762,"target":387},{"edgeType":"calls","source":1385,"target":365},{"edgeType":"contains","source":1090,"target":1097},{"edgeType":"calls","source":610,"target":342},{"edgeType":"calls","source":2494,"target":1926},{"edgeType":"calls","source":860,"target":784},{"edgeType":"contains","source":327,"target":2024},{"edgeType":"contains","source":1097,"target":1144},{"edgeType":"calls","source":2143,"target":387},{"edgeType":"contains","source":354,"target":1979},{"edgeType":"contains","source":49,"target":600},{"edgeType":"calls","source":1782,"target":1535},{"edgeType":"calls","source":2633,"target":2638},{"edgeType":"calls","source":1627,"target":526},{"edgeType":"contains","source":327,"target":702},{"edgeType":"contains","source":1369,"target":1434},{"edgeType":"contains","source":1078,"target":1204},{"edgeType":"contains","source":49,"target":70},{"edgeType":"contains","source":520,"target":532},{"edgeType":"imports","source":2441,"target":641},{"edgeType":"calls","source":2494,"target":1927},{"edgeType":"contains","source":327,"target":2023},{"edgeType":"contains","source":2362,"target":2363},{"edgeType":"contains","source":1097,"target":1143},{"edgeType":"calls","source":2143,"target":388},{"edgeType":"calls","source":2038,"target":733},{"edgeType":"contains","source":327,"target":2022},{"edgeType":"contains","source":1494,"target":2052},{"edgeType":"calls","source":362,"target":366},{"edgeType":"imports","source":2426,"target":1634},{"edgeType":"imports","source":2441,"target":112},{"edgeType":"contains","source":2287,"target":2309},{"edgeType":"calls","source":1627,"target":525},{"edgeType":"imports","source":2426,"target":2427},{"edgeType":"contains","source":2444,"target":1406},{"edgeType":"imports","source":2426,"target":1370},{"edgeType":"calls","source":852,"target":503},{"edgeType":"contains","source":1078,"target":1203},{"edgeType":"contains","source":1078,"target":1207},{"edgeType":"calls","source":762,"target":389},{"edgeType":"calls","source":1627,"target":529},{"edgeType":"contains","source":327,"target":2026},{"edgeType":"contains","source":1097,"target":1146},{"edgeType":"contains","source":695,"target":659},{"edgeType":"calls","source":1627,"target":528},{"edgeType":"calls","source":2137,"target":307},{"edgeType":"contains","source":1602,"target":1608},{"edgeType":"calls","source":775,"target":779},{"edgeType":"calls","source":1535,"target":1530},{"edgeType":"contains","source":1078,"target":1206},{"edgeType":"calls","source":2459,"target":367},{"edgeType":"calls","source":762,"target":388},{"edgeType":"contains","source":219,"target":352},{"edgeType":"calls","source":860,"target":785},{"edgeType":"contains","source":327,"target":2025},{"edgeType":"contains","source":1825,"target":1831},{"edgeType":"contains","source":816,"target":871},{"edgeType":"contains","source":2079,"target":2149},{"edgeType":"calls","source":1402,"target":367},{"edgeType":"calls","source":1991,"target":342},{"edgeType":"calls","source":1627,"target":527},{"edgeType":"calls","source":2137,"target":308},{"edgeType":"contains","source":1280,"target":1285},{"edgeType":"contains","source":1078,"target":1205},{"edgeType":"contains","source":2475,"target":2557},{"edgeType":"imports","source":2066,"target":108},{"edgeType":"contains","source":1078,"target":1209},{"edgeType":"calls","source":969,"target":308},{"edgeType":"calls","source":1411,"target":348},{"edgeType":"contains","source":1494,"target":2055},{"edgeType":"calls","source":1741,"target":1745},{"edgeType":"contains","source":105,"target":2567},{"edgeType":"calls","source":1657,"target":385},{"edgeType":"contains","source":76,"target":560},{"edgeType":"contains","source":272,"target":297},{"edgeType":"calls","source":1897,"target":1401},{"edgeType":"contains","source":2,"target":2061},{"edgeType":"contains","source":520,"target":537},{"edgeType":"contains","source":513,"target":754},{"edgeType":"contains","source":1759,"target":1768},{"edgeType":"imports","source":2426,"target":1911},{"edgeType":"contains","source":1078,"target":1208},{"edgeType":"calls","source":807,"target":308},{"edgeType":"calls","source":969,"target":307},{"edgeType":"contains","source":1788,"target":2191},{"edgeType":"contains","source":327,"target":2027},{"edgeType":"contains","source":2362,"target":2367},{"edgeType":"contains","source":107,"target":390},{"edgeType":"contains","source":801,"target":810},{"edgeType":"calls","source":1438,"target":302},{"edgeType":"contains","source":1097,"target":1147},{"edgeType":"calls","source":1539,"target":342},{"edgeType":"calls","source":717,"target":720},{"edgeType":"contains","source":36,"target":2063},{"edgeType":"calls","source":1737,"target":282},{"edgeType":"contains","source":1002,"target":1453},{"edgeType":"calls","source":2330,"target":397},{"edgeType":"imports","source":81,"target":83},{"edgeType":"imports","source":2426,"target":1910},{"edgeType":"calls","source":2667,"target":785},{"edgeType":"contains","source":1078,"target":1211},{"edgeType":"calls","source":2188,"target":307},{"edgeType":"calls","source":2038,"target":732},{"edgeType":"contains","source":2134,"target":2297},{"edgeType":"imports","source":2426,"target":2438},{"edgeType":"contains","source":1097,"target":1150},{"edgeType":"contains","source":272,"target":299},{"edgeType":"calls","source":2130,"target":784},{"edgeType":"contains","source":1280,"target":1288},{"edgeType":"calls","source":2647,"target":348},{"edgeType":"calls","source":2650,"target":784},{"edgeType":"calls","source":808,"target":809},{"edgeType":"contains","source":520,"target":539},{"edgeType":"calls","source":2336,"target":1533},{"edgeType":"calls","source":1461,"target":1442},{"edgeType":"contains","source":81,"target":671},{"edgeType":"imports","source":2426,"target":1909},{"edgeType":"calls","source":2330,"target":398},{"edgeType":"contains","source":1078,"target":1210},{"edgeType":"contains","source":14,"target":104},{"edgeType":"calls","source":2647,"target":349},{"edgeType":"calls","source":644,"target":342},{"edgeType":"contains","source":2585,"target":2587},{"edgeType":"contains","source":49,"target":76},{"edgeType":"contains","source":327,"target":2029},{"edgeType":"calls","source":2188,"target":308},{"edgeType":"calls","source":1411,"target":349},{"edgeType":"contains","source":107,"target":2507},{"edgeType":"calls","source":2336,"target":1534},{"edgeType":"contains","source":83,"target":344},{"edgeType":"contains","source":272,"target":298},{"edgeType":"contains","source":1097,"target":1149},{"edgeType":"calls","source":2130,"target":785},{"edgeType":"contains","source":2134,"target":2298},{"edgeType":"calls","source":2650,"target":785},{"edgeType":"contains","source":2287,"target":2311},{"edgeType":"contains","source":327,"target":1500},{"edgeType":"calls","source":1627,"target":523},{"edgeType":"contains","source":1272,"target":1273},{"edgeType":"contains","source":1727,"target":1702},{"edgeType":"contains","source":2179,"target":2229},{"edgeType":"calls","source":2537,"target":2170},{"edgeType":"imports","source":2426,"target":1908},{"edgeType":"contains","source":1078,"target":1213},{"edgeType":"calls","source":2330,"target":395},{"edgeType":"contains","source":2,"target":1272},{"edgeType":"contains","source":327,"target":711},{"edgeType":"calls","source":1840,"target":1843},{"edgeType":"contains","source":338,"target":369},{"edgeType":"imports","source":2426,"target":1379},{"edgeType":"contains","source":1097,"target":1152},{"edgeType":"contains","source":2134,"target":2303},{"edgeType":"calls","source":361,"target":390},{"edgeType":"calls","source":2330,"target":396},{"edgeType":"contains","source":2179,"target":2230},{"edgeType":"contains","source":327,"target":2031},{"edgeType":"contains","source":1078,"target":1212},{"edgeType":"calls","source":2722,"target":400},{"edgeType":"calls","source":2330,"target":1982},{"edgeType":"contains","source":1097,"target":1151},{"edgeType":"calls","source":2667,"target":784},{"edgeType":"contains","source":520,"target":540},{"edgeType":"contains","source":81,"target":672},{"edgeType":"calls","source":2330,"target":393},{"edgeType":"calls","source":807,"target":307},{"edgeType":"contains","source":327,"target":2034},{"edgeType":"imports","source":2426,"target":1906},{"edgeType":"calls","source":405,"target":349},{"edgeType":"contains","source":1078,"target":1215},{"edgeType":"contains","source":338,"target":372},{"edgeType":"calls","source":524,"target":360},{"edgeType":"calls","source":2543,"target":397},{"edgeType":"calls","source":2519,"target":348},{"edgeType":"calls","source":717,"target":719},{"edgeType":"contains","source":1097,"target":1154},{"edgeType":"contains","source":1759,"target":1770},{"edgeType":"contains","source":513,"target":760},{"edgeType":"contains","source":451,"target":568},{"edgeType":"calls","source":2330,"target":1715},{"edgeType":"contains","source":81,"target":674},{"edgeType":"contains","source":2179,"target":2228},{"edgeType":"contains","source":270,"target":893},{"edgeType":"contains","source":327,"target":2033},{"edgeType":"calls","source":2330,"target":394},{"edgeType":"calls","source":405,"target":348},{"edgeType":"calls","source":1614,"target":658},{"edgeType":"calls","source":2519,"target":349},{"edgeType":"contains","source":1078,"target":1214},{"edgeType":"calls","source":2543,"target":398},{"edgeType":"calls","source":524,"target":359},{"edgeType":"contains","source":816,"target":879},{"edgeType":"contains","source":1097,"target":1153},{"edgeType":"contains","source":1759,"target":1771},{"edgeType":"contains","source":1396,"target":1397},{"edgeType":"calls","source":717,"target":718},{"edgeType":"contains","source":219,"target":330},{"edgeType":"calls","source":1340,"target":988},{"edgeType":"contains","source":2079,"target":2129},{"edgeType":"contains","source":81,"target":644},{"edgeType":"contains","source":2460,"target":2474},{"edgeType":"imports","source":1882,"target":253},{"edgeType":"calls","source":1604,"target":732},{"edgeType":"contains","source":1078,"target":1184},{"edgeType":"contains","source":2287,"target":2288},{"edgeType":"calls","source":2397,"target":2311},{"edgeType":"contains","source":513,"target":729},{"edgeType":"contains","source":16,"target":17},{"edgeType":"calls","source":2485,"target":2490},{"edgeType":"calls","source":1385,"target":914},{"edgeType":"calls","source":1240,"target":388},{"edgeType":"calls","source":2743,"target":570},{"edgeType":"contains","source":1097,"target":1123},{"edgeType":"contains","source":1293,"target":1391},{"edgeType":"calls","source":2131,"target":780},{"edgeType":"calls","source":1504,"target":396},{"edgeType":"calls","source":1534,"target":523},{"edgeType":"calls","source":1340,"target":987},{"edgeType":"calls","source":288,"target":302},{"edgeType":"contains","source":2484,"target":2524},{"edgeType":"calls","source":2507,"target":223},{"edgeType":"contains","source":2446,"target":2645},{"edgeType":"contains","source":1078,"target":1183},{"edgeType":"contains","source":357,"target":808},{"edgeType":"contains","source":49,"target":50},{"edgeType":"calls","source":499,"target":368},{"edgeType":"contains","source":14,"target":78},{"edgeType":"contains","source":327,"target":1473},{"edgeType":"calls","source":1385,"target":913},{"edgeType":"contains","source":1097,"target":1122},{"edgeType":"calls","source":1240,"target":387},{"edgeType":"calls","source":2682,"target":348},{"edgeType":"calls","source":916,"target":918},{"edgeType":"calls","source":1504,"target":395},{"edgeType":"calls","source":947,"target":1014},{"edgeType":"calls","source":1846,"target":367},{"edgeType":"contains","source":2460,"target":2472},{"edgeType":"contains","source":327,"target":2005},{"edgeType":"calls","source":1564,"target":124},{"edgeType":"contains","source":76,"target":801},{"edgeType":"contains","source":14,"target":1666},{"edgeType":"calls","source":2138,"target":296},{"edgeType":"contains","source":1002,"target":1428},{"edgeType":"contains","source":2484,"target":2521},{"edgeType":"contains","source":2446,"target":2642},{"edgeType":"contains","source":354,"target":904},{"edgeType":"contains","source":2,"target":1245},{"edgeType":"contains","source":1078,"target":1186},{"edgeType":"calls","source":2127,"target":373},{"edgeType":"calls","source":1504,"target":398},{"edgeType":"contains","source":513,"target":731},{"edgeType":"calls","source":1534,"target":525},{"edgeType":"imports","source":1494,"target":916},{"edgeType":"calls","source":1244,"target":266},{"edgeType":"calls","source":1249,"target":111},{"edgeType":"contains","source":1841,"target":1842},{"edgeType":"contains","source":1369,"target":1411},{"edgeType":"contains","source":1097,"target":1125},{"edgeType":"contains","source":7,"target":825},{"edgeType":"contains","source":2460,"target":2473},{"edgeType":"contains","source":327,"target":2004},{"edgeType":"calls","source":1564,"target":123},{"edgeType":"calls","source":1604,"target":733},{"edgeType":"contains","source":2446,"target":2643},{"edgeType":"contains","source":1078,"target":1185},{"edgeType":"calls","source":685,"target":417},{"edgeType":"contains","source":2484,"target":2522},{"edgeType":"contains","source":2475,"target":2536},{"edgeType":"contains","source":513,"target":730},{"edgeType":"imports","source":2426,"target":1091},{"edgeType":"calls","source":2709,"target":302},{"edgeType":"calls","source":2191,"target":240},{"edgeType":"contains","source":1773,"target":1837},{"edgeType":"contains","source":2484,"target":1993},{"edgeType":"contains","source":1097,"target":1124},{"edgeType":"calls","source":1244,"target":265},{"edgeType":"calls","source":1240,"target":389},{"edgeType":"contains","source":451,"target":538},{"edgeType":"calls","source":2131,"target":779},{"edgeType":"contains","source":1293,"target":1390},{"edgeType":"calls","source":1504,"target":397},{"edgeType":"contains","source":816,"target":854},{"edgeType":"calls","source":518,"target":304},{"edgeType":"calls","source":2507,"target":1275},{"edgeType":"calls","source":1531,"target":348},{"edgeType":"calls","source":734,"target":743},{"edgeType":"contains","source":1507,"target":1631},{"edgeType":"calls","source":2695,"target":732},{"edgeType":"calls","source":2138,"target":294},{"edgeType":"contains","source":777,"target":1270},{"edgeType":"contains","source":1078,"target":1188},{"edgeType":"contains","source":1002,"target":1430},{"edgeType":"contains","source":2155,"target":2156},{"edgeType":"contains","source":197,"target":223},{"edgeType":"calls","source":2695,"target":733},{"edgeType":"calls","source":936,"target":295},{"edgeType":"contains","source":219,"target":334},{"edgeType":"contains","source":2036,"target":2145},{"edgeType":"contains","source":22,"target":99},{"edgeType":"contains","source":1097,"target":1127},{"edgeType":"contains","source":2484,"target":2528},{"edgeType":"calls","source":1461,"target":1460},{"edgeType":"contains","source":327,"target":2006},{"edgeType":"calls","source":2138,"target":295},{"edgeType":"contains","source":63,"target":2526},{"edgeType":"contains","source":66,"target":2433},{"edgeType":"contains","source":1078,"target":1187},{"edgeType":"contains","source":1073,"target":1342},{"edgeType":"contains","source":2155,"target":2157},{"edgeType":"contains","source":1790,"target":523},{"edgeType":"contains","source":16,"target":20},{"edgeType":"imports","source":2426,"target":1089},{"edgeType":"calls","source":2097,"target":2095},{"edgeType":"calls","source":936,"target":294},{"edgeType":"calls","source":1411,"target":367},{"edgeType":"contains","source":1097,"target":1126},{"edgeType":"contains","source":2087,"target":565},{"edgeType":"contains","source":1097,"target":1130},{"edgeType":"calls","source":2605,"target":349},{"edgeType":"calls","source":1340,"target":986},{"edgeType":"contains","source":338,"target":347},{"edgeType":"contains","source":2446,"target":2646},{"edgeType":"contains","source":2079,"target":2131},{"edgeType":"contains","source":272,"target":279},{"edgeType":"calls","source":1749,"target":1784},{"edgeType":"contains","source":2475,"target":2540},{"edgeType":"contains","source":816,"target":856},{"edgeType":"calls","source":2138,"target":2142},{"edgeType":"calls","source":499,"target":367},{"edgeType":"calls","source":1761,"target":1676},{"edgeType":"contains","source":1078,"target":1190},{"edgeType":"contains","source":1073,"target":1345},{"edgeType":"contains","source":197,"target":225},{"edgeType":"contains","source":1075,"target":490},{"edgeType":"contains","source":2036,"target":2143},{"edgeType":"imports","source":2426,"target":1088},{"edgeType":"contains","source":1293,"target":1393},{"edgeType":"calls","source":1891,"target":1874},{"edgeType":"calls","source":1385,"target":912},{"edgeType":"calls","source":1504,"target":394},{"edgeType":"contains","source":327,"target":2009},{"edgeType":"calls","source":2507,"target":1274},{"edgeType":"calls","source":734,"target":744},{"edgeType":"contains","source":816,"target":855},{"edgeType":"contains","source":1097,"target":1129},{"edgeType":"calls","source":1461,"target":1462},{"edgeType":"calls","source":1531,"target":349},{"edgeType":"calls","source":1749,"target":1783},{"edgeType":"calls","source":2138,"target":293},{"edgeType":"contains","source":1788,"target":2168},{"edgeType":"contains","source":2287,"target":2291},{"edgeType":"calls","source":1524,"target":302},{"edgeType":"contains","source":2444,"target":2445},{"edgeType":"contains","source":1078,"target":1189},{"edgeType":"contains","source":1073,"target":1344},{"edgeType":"calls","source":405,"target":373},{"edgeType":"contains","source":197,"target":224},{"edgeType":"calls","source":2137,"target":853},{"edgeType":"contains","source":1882,"target":1897},{"edgeType":"calls","source":936,"target":296},{"edgeType":"calls","source":1504,"target":393},{"edgeType":"contains","source":2460,"target":2477},{"edgeType":"contains","source":327,"target":2008},{"edgeType":"contains","source":1097,"target":1128},{"edgeType":"contains","source":354,"target":910},{"edgeType":"contains","source":1097,"target":1132},{"edgeType":"calls","source":1977,"target":788},{"edgeType":"calls","source":1504,"target":388},{"edgeType":"calls","source":2570,"target":639},{"edgeType":"contains","source":272,"target":281},{"edgeType":"contains","source":1790,"target":526},{"edgeType":"contains","source":520,"target":521},{"edgeType":"calls","source":1626,"target":1627},{"edgeType":"calls","source":908,"target":894},{"edgeType":"calls","source":1461,"target":1457},{"edgeType":"contains","source":1720,"target":1903},{"edgeType":"contains","source":1078,"target":1192},{"edgeType":"contains","source":197,"target":227},{"edgeType":"calls","source":2716,"target":342},{"edgeType":"contains","source":2155,"target":2160},{"edgeType":"contains","source":327,"target":2011},{"edgeType":"calls","source":2615,"target":302},{"edgeType":"calls","source":2143,"target":1721},{"edgeType":"contains","source":1288,"target":1290},{"edgeType":"calls","source":1542,"target":531},{"edgeType":"contains","source":2036,"target":2150},{"edgeType":"calls","source":2605,"target":348},{"edgeType":"contains","source":560,"target":601},{"edgeType":"contains","source":1097,"target":1131},{"edgeType":"calls","source":1504,"target":387},{"edgeType":"calls","source":1977,"target":787},{"edgeType":"contains","source":1790,"target":527},{"edgeType":"calls","source":1825,"target":1535},{"edgeType":"calls","source":2132,"target":1534},{"edgeType":"calls","source":420,"target":430},{"edgeType":"contains","source":1002,"target":1433},{"edgeType":"calls","source":1461,"target":1456},{"edgeType":"contains","source":816,"target":857},{"edgeType":"contains","source":41,"target":42},{"edgeType":"contains","source":2,"target":1251},{"edgeType":"contains","source":197,"target":226},{"edgeType":"contains","source":1078,"target":1191},{"edgeType":"contains","source":1073,"target":1346},{"edgeType":"calls","source":2127,"target":368},{"edgeType":"imports","source":2441,"target":108},{"edgeType":"contains","source":1773,"target":1847},{"edgeType":"calls","source":648,"target":233},{"edgeType":"calls","source":1542,"target":530},{"edgeType":"contains","source":1443,"target":1503},{"edgeType":"calls","source":1497,"target":1400},{"edgeType":"calls","source":1461,"target":1459},{"edgeType":"contains","source":1097,"target":1134},{"edgeType":"contains","source":272,"target":283},{"edgeType":"calls","source":481,"target":392},{"edgeType":"contains","source":101,"target":2413},{"edgeType":"contains","source":487,"target":489},{"edgeType":"contains","source":816,"target":860},{"edgeType":"contains","source":2601,"target":2602},{"edgeType":"contains","source":81,"target":654},{"edgeType":"contains","source":2345,"target":2346},{"edgeType":"calls","source":936,"target":293},{"edgeType":"contains","source":1078,"target":1194},{"edgeType":"contains","source":1073,"target":1349},{"edgeType":"contains","source":327,"target":2013},{"edgeType":"contains","source":1673,"target":1773},{"edgeType":"contains","source":109,"target":2428},{"edgeType":"contains","source":354,"target":911},{"edgeType":"contains","source":2484,"target":2530},{"edgeType":"contains","source":1097,"target":1133},{"edgeType":"calls","source":1370,"target":1372},{"edgeType":"calls","source":1504,"target":389},{"edgeType":"contains","source":1790,"target":1582},{"edgeType":"calls","source":2570,"target":638},{"edgeType":"contains","source":487,"target":488},{"edgeType":"contains","source":81,"target":653},{"edgeType":"contains","source":2345,"target":2347},{"edgeType":"calls","source":518,"target":565},{"edgeType":"calls","source":1461,"target":1458},{"edgeType":"calls","source":1915,"target":1918},{"edgeType":"contains","source":197,"target":228},{"edgeType":"contains","source":1078,"target":1193},{"edgeType":"contains","source":1790,"target":525},{"edgeType":"contains","source":327,"target":2012},{"edgeType":"contains","source":1773,"target":1845},{"edgeType":"calls","source":2153,"target":349},{"edgeType":"contains","source":338,"target":353},{"edgeType":"calls","source":1859,"target":1535},{"edgeType":"contains","source":1097,"target":1136},{"edgeType":"calls","source":2336,"target":1547},{"edgeType":"contains","source":2134,"target":2286},{"edgeType":"contains","source":1790,"target":530},{"edgeType":"contains","source":2601,"target":2608},{"edgeType":"contains","source":2432,"target":1505},{"edgeType":"contains","source":2,"target":991},{"edgeType":"contains","source":76,"target":812},{"edgeType":"imports","source":2161,"target":2179},{"edgeType":"contains","source":327,"target":2015},{"edgeType":"contains","source":1078,"target":1196},{"edgeType":"contains","source":1485,"target":2586},{"edgeType":"contains","source":2179,"target":1420},{"edgeType":"calls","source":438,"target":398},{"edgeType":"calls","source":1542,"target":527},{"edgeType":"contains","source":1445,"target":1448},{"edgeType":"calls","source":2186,"target":1441},{"edgeType":"calls","source":1975,"target":1902},{"edgeType":"contains","source":2036,"target":2154},{"edgeType":"contains","source":1097,"target":1135},{"edgeType":"calls","source":1464,"target":302},{"edgeType":"calls","source":1539,"target":1148},{"edgeType":"calls","source":1385,"target":901},{"edgeType":"contains","source":1790,"target":531},{"edgeType":"calls","source":254,"target":287},{"edgeType":"imports","source":107,"target":317},{"edgeType":"contains","source":1078,"target":1195},{"edgeType":"contains","source":1073,"target":1350},{"edgeType":"calls","source":767,"target":768},{"edgeType":"calls","source":438,"target":397},{"edgeType":"calls","source":1542,"target":526},{"edgeType":"contains","source":327,"target":2014},{"edgeType":"contains","source":1602,"target":1603},{"edgeType":"contains","source":7,"target":1364},{"edgeType":"contains","source":2036,"target":2151},{"edgeType":"contains","source":740,"target":842},{"edgeType":"calls","source":999,"target":978},{"edgeType":"calls","source":1609,"target":302},{"edgeType":"contains","source":1097,"target":1138},{"edgeType":"contains","source":1790,"target":528},{"edgeType":"calls","source":1359,"target":389},{"edgeType":"calls","source":1461,"target":1455},{"edgeType":"calls","source":2511,"target":348},{"edgeType":"contains","source":66,"target":67},{"edgeType":"calls","source":2690,"target":349},{"edgeType":"contains","source":76,"target":814},{"edgeType":"calls","source":1359,"target":388},{"edgeType":"contains","source":327,"target":2017},{"edgeType":"calls","source":1710,"target":342},{"edgeType":"contains","source":49,"target":858},{"edgeType":"contains","source":1078,"target":1198},{"edgeType":"contains","source":1073,"target":1353},{"edgeType":"calls","source":1542,"target":529},{"edgeType":"contains","source":1445,"target":1446},{"edgeType":"calls","source":1011,"target":342},{"edgeType":"contains","source":354,"target":1973},{"edgeType":"contains","source":740,"target":841},{"edgeType":"calls","source":2153,"target":348},{"edgeType":"calls","source":2511,"target":349},{"edgeType":"contains","source":354,"target":651},{"edgeType":"contains","source":867,"target":868},{"edgeType":"calls","source":676,"target":684},{"edgeType":"contains","source":2036,"target":2152},{"edgeType":"contains","source":1097,"target":1137},{"edgeType":"calls","source":1981,"target":1982},{"edgeType":"calls","source":1461,"target":1454},{"edgeType":"contains","source":1790,"target":529},{"edgeType":"contains","source":76,"target":813},{"edgeType":"contains","source":327,"target":2016},{"edgeType":"calls","source":1359,"target":387},{"edgeType":"contains","source":1078,"target":1197},{"edgeType":"contains","source":1073,"target":1352},{"edgeType":"contains","source":1002,"target":1439},{"edgeType":"calls","source":2336,"target":2339},{"edgeType":"contains","source":2526,"target":2553},{"edgeType":"contains","source":2155,"target":2163},{"edgeType":"calls","source":1542,"target":528},{"edgeType":"contains","source":896,"target":996},{"edgeType":"calls","source":1448,"target":233},{"edgeType":"calls","source":2599,"target":2606},{"edgeType":"contains","source":357,"target":1321},{"edgeType":"contains","source":1097,"target":1107},{"edgeType":"calls","source":656,"target":737},{"edgeType":"contains","source":835,"target":2094},{"edgeType":"imports","source":1494,"target":1496},{"edgeType":"calls","source":2611,"target":384},{"edgeType":"contains","source":2612,"target":2766},{"edgeType":"contains","source":219,"target":313},{"edgeType":"calls","source":890,"target":883},{"edgeType":"contains","source":32,"target":33},{"edgeType":"calls","source":2723,"target":348},{"edgeType":"contains","source":816,"target":833},{"edgeType":"calls","source":1384,"target":367},{"edgeType":"calls","source":1660,"target":267},{"edgeType":"contains","source":354,"target":2470},{"edgeType":"contains","source":1097,"target":1106},{"edgeType":"contains","source":357,"target":1320},{"edgeType":"contains","source":2612,"target":2767},{"edgeType":"contains","source":219,"target":312},{"edgeType":"calls","source":2723,"target":349},{"edgeType":"calls","source":1370,"target":271},{"edgeType":"calls","source":762,"target":93},{"edgeType":"contains","source":2475,"target":2519},{"edgeType":"calls","source":1247,"target":388},{"edgeType":"contains","source":255,"target":257},{"edgeType":"calls","source":2507,"target":2549},{"edgeType":"contains","source":1097,"target":1109},{"edgeType":"contains","source":32,"target":35},{"edgeType":"contains","source":344,"target":404},{"edgeType":"calls","source":805,"target":349},{"edgeType":"contains","source":2612,"target":2764},{"edgeType":"calls","source":2709,"target":780},{"edgeType":"calls","source":1009,"target":367},{"edgeType":"calls","source":2599,"target":2604},{"edgeType":"calls","source":798,"target":830},{"edgeType":"contains","source":1078,"target":1169},{"edgeType":"calls","source":674,"target":710},{"edgeType":"contains","source":461,"target":477},{"edgeType":"contains","source":1601,"target":1602},{"edgeType":"contains","source":103,"target":212},{"edgeType":"calls","source":1660,"target":269},{"edgeType":"calls","source":1094,"target":1167},{"edgeType":"contains","source":1733,"target":1738},{"edgeType":"calls","source":1247,"target":387},{"edgeType":"imports","source":968,"target":888},{"edgeType":"calls","source":1370,"target":274},{"edgeType":"contains","source":1097,"target":1108},{"edgeType":"contains","source":451,"target":522},{"edgeType":"calls","source":2611,"target":383},{"edgeType":"contains","source":255,"target":256},{"edgeType":"contains","source":32,"target":34},{"edgeType":"contains","source":219,"target":314},{"edgeType":"calls","source":352,"target":385},{"edgeType":"calls","source":805,"target":348},{"edgeType":"contains","source":2612,"target":2765},{"edgeType":"contains","source":816,"target":834},{"edgeType":"calls","source":890,"target":884},{"edgeType":"contains","source":344,"target":403},{"edgeType":"contains","source":1285,"target":300},{"edgeType":"calls","source":1660,"target":268},{"edgeType":"calls","source":2690,"target":2691},{"edgeType":"contains","source":357,"target":1325},{"edgeType":"contains","source":887,"target":1015},{"edgeType":"imports","source":1882,"target":1884},{"edgeType":"calls","source":805,"target":342},{"edgeType":"calls","source":2507,"target":2547},{"edgeType":"contains","source":1097,"target":1111},{"edgeType":"contains","source":344,"target":406},{"edgeType":"contains","source":14,"target":1652},{"edgeType":"calls","source":1403,"target":302},{"edgeType":"calls","source":361,"target":365},{"edgeType":"contains","source":461,"target":479},{"edgeType":"calls","source":1094,"target":368},{"edgeType":"contains","source":103,"target":214},{"edgeType":"calls","source":1930,"target":349},{"edgeType":"contains","source":66,"target":1361},{"edgeType":"contains","source":1078,"target":1171},{"edgeType":"calls","source":2348,"target":342},{"edgeType":"contains","source":2526,"target":2531},{"edgeType":"calls","source":2507,"target":2548},{"edgeType":"contains","source":2612,"target":2772},{"edgeType":"contains","source":1097,"target":1110},{"edgeType":"contains","source":2460,"target":2463},{"edgeType":"contains","source":2427,"target":2429},{"edgeType":"contains","source":1281,"target":1487},{"edgeType":"calls","source":361,"target":364},{"edgeType":"contains","source":2612,"target":2771},{"edgeType":"calls","source":2709,"target":779},{"edgeType":"calls","source":762,"target":89},{"edgeType":"contains","source":461,"target":478},{"edgeType":"imports","source":1595,"target":1003},{"edgeType":"contains","source":1369,"target":1402},{"edgeType":"imports","source":2426,"target":2460},{"edgeType":"calls","source":2330,"target":2486},{"edgeType":"contains","source":103,"target":213},{"edgeType":"calls","source":489,"target":360},{"edgeType":"calls","source":1930,"target":348},{"edgeType":"contains","source":1078,"target":1170},{"edgeType":"calls","source":1426,"target":1438},{"edgeType":"contains","source":103,"target":216},{"edgeType":"calls","source":2744,"target":2597},{"edgeType":"contains","source":1078,"target":1174},{"edgeType":"calls","source":1915,"target":1874},{"edgeType":"calls","source":493,"target":503},{"edgeType":"contains","source":354,"target":363},{"edgeType":"contains","source":357,"target":1327},{"edgeType":"calls","source":1768,"target":1674},{"edgeType":"calls","source":2507,"target":2545},{"edgeType":"contains","source":63,"target":1720},{"edgeType":"calls","source":386,"target":385},{"edgeType":"contains","source":1097,"target":1113},{"edgeType":"calls","source":1718,"target":317},{"edgeType":"contains","source":14,"target":1654},{"edgeType":"contains","source":647,"target":793},{"edgeType":"contains","source":327,"target":1464},{"edgeType":"contains","source":1078,"target":1173},{"edgeType":"contains","source":103,"target":215},{"edgeType":"calls","source":2622,"target":302},{"edgeType":"contains","source":887,"target":1016},{"edgeType":"contains","source":891,"target":892},{"edgeType":"contains","source":7,"target":1341},{"edgeType":"calls","source":2507,"target":2546},{"edgeType":"contains","source":270,"target":852},{"edgeType":"calls","source":967,"target":342},{"edgeType":"contains","source":1673,"target":1753},{"edgeType":"calls","source":2628,"target":2230},{"edgeType":"contains","source":2460,"target":2461},{"edgeType":"contains","source":896,"target":1001},{"edgeType":"contains","source":1097,"target":1112},{"edgeType":"calls","source":1963,"target":1970},{"edgeType":"contains","source":84,"target":276},{"edgeType":"contains","source":344,"target":407},{"edgeType":"calls","source":1718,"target":316},{"edgeType":"contains","source":27,"target":1250},{"edgeType":"contains","source":14,"target":1653},{"edgeType":"contains","source":1002,"target":357},{"edgeType":"contains","source":109,"target":822},{"edgeType":"contains","source":1078,"target":1172},{"edgeType":"contains","source":880,"target":968},{"edgeType":"contains","source":1436,"target":1437},{"edgeType":"calls","source":2744,"target":2595},{"edgeType":"contains","source":1078,"target":1176},{"edgeType":"contains","source":1073,"target":1331},{"edgeType":"calls","source":1971,"target":396},{"edgeType":"calls","source":1660,"target":788},{"edgeType":"contains","source":24,"target":25},{"edgeType":"contains","source":1097,"target":1115},{"edgeType":"contains","source":659,"target":687},{"edgeType":"contains","source":1369,"target":1405},{"edgeType":"contains","source":647,"target":795},{"edgeType":"calls","source":2168,"target":368},{"edgeType":"calls","source":1971,"target":395},{"edgeType":"contains","source":354,"target":2478},{"edgeType":"calls","source":1387,"target":1322},{"edgeType":"calls","source":2744,"target":2596},{"edgeType":"contains","source":1078,"target":1175},{"edgeType":"contains","source":357,"target":1328},{"edgeType":"calls","source":1660,"target":787},{"edgeType":"calls","source":656,"target":728},{"edgeType":"calls","source":336,"target":342},{"edgeType":"contains","source":327,"target":1994},{"edgeType":"contains","source":1673,"target":1759},{"edgeType":"calls","source":1438,"target":269},{"edgeType":"contains","source":1097,"target":1114},{"edgeType":"contains","source":22,"target":86},{"edgeType":"contains","source":2484,"target":2515},{"edgeType":"imports","source":1073,"target":1078},{"edgeType":"calls","source":2507,"target":2544},{"edgeType":"calls","source":567,"target":316},{"edgeType":"contains","source":647,"target":794},{"edgeType":"calls","source":1734,"target":342},{"edgeType":"contains","source":858,"target":863},{"edgeType":"calls","source":2744,"target":2593},{"edgeType":"contains","source":1078,"target":1178},{"edgeType":"calls","source":1971,"target":398},{"edgeType":"calls","source":481,"target":342},{"edgeType":"contains","source":896,"target":1006},{"edgeType":"contains","source":327,"target":1997},{"edgeType":"contains","source":2036,"target":2130},{"edgeType":"contains","source":2427,"target":2430},{"edgeType":"contains","source":70,"target":2564},{"edgeType":"calls","source":1947,"target":349},{"edgeType":"imports","source":2426,"target":357},{"edgeType":"contains","source":1097,"target":1117},{"edgeType":"contains","source":7,"target":818},{"edgeType":"contains","source":2179,"target":2190},{"edgeType":"contains","source":1593,"target":1594},{"edgeType":"contains","source":647,"target":797},{"edgeType":"calls","source":489,"target":359},{"edgeType":"calls","source":2705,"target":367},{"edgeType":"contains","source":357,"target":1330},{"edgeType":"calls","source":2744,"target":2594},{"edgeType":"contains","source":1078,"target":1177},{"edgeType":"calls","source":1971,"target":397},{"edgeType":"contains","source":1293,"target":1381},{"edgeType":"contains","source":2460,"target":2465},{"edgeType":"contains","source":327,"target":1996},{"edgeType":"calls","source":1947,"target":348},{"edgeType":"contains","source":70,"target":2563},{"edgeType":"contains","source":1097,"target":1116},{"edgeType":"contains","source":2036,"target":1339},{"edgeType":"contains","source":1494,"target":2021},{"edgeType":"contains","source":647,"target":796},{"edgeType":"contains","source":81,"target":637},{"edgeType":"contains","source":2526,"target":2538},{"edgeType":"contains","source":1871,"target":1702},{"edgeType":"contains","source":327,"target":1999},{"edgeType":"calls","source":1570,"target":667},{"edgeType":"contains","source":1078,"target":1180},{"edgeType":"calls","source":894,"target":746},{"edgeType":"contains","source":659,"target":692},{"edgeType":"calls","source":2461,"target":265},{"edgeType":"contains","source":536,"target":541},{"edgeType":"contains","source":647,"target":799},{"edgeType":"contains","source":24,"target":29},{"edgeType":"contains","source":1097,"target":1119},{"edgeType":"calls","source":229,"target":221},{"edgeType":"contains","source":357,"target":1333},{"edgeType":"calls","source":911,"target":1012},{"edgeType":"contains","source":7,"target":1877},{"edgeType":"contains","source":357,"target":1332},{"edgeType":"calls","source":894,"target":745},{"edgeType":"calls","source":386,"target":373},{"edgeType":"calls","source":907,"target":342},{"edgeType":"calls","source":1570,"target":666},{"edgeType":"contains","source":2460,"target":2471},{"edgeType":"calls","source":2744,"target":2592},{"edgeType":"contains","source":1078,"target":1179},{"edgeType":"contains","source":659,"target":691},{"edgeType":"contains","source":2484,"target":2520},{"edgeType":"contains","source":327,"target":1998},{"edgeType":"calls","source":2461,"target":266},{"edgeType":"contains","source":107,"target":361},{"edgeType":"contains","source":70,"target":2565},{"edgeType":"contains","source":461,"target":486},{"edgeType":"contains","source":1097,"target":1118},{"edgeType":"calls","source":1478,"target":1403},{"edgeType":"contains","source":354,"target":2482},{"edgeType":"imports","source":70,"target":1249},{"edgeType":"calls","source":1570,"target":669},{"edgeType":"calls","source":1971,"target":394},{"edgeType":"calls","source":352,"target":373},{"edgeType":"contains","source":1733,"target":1750},{"edgeType":"contains","source":1078,"target":1182},{"edgeType":"contains","source":659,"target":694},{"edgeType":"contains","source":2484,"target":2517},{"edgeType":"contains","source":357,"target":807},{"edgeType":"calls","source":918,"target":269},{"edgeType":"calls","source":1438,"target":268},{"edgeType":"calls","source":1597,"target":360},{"edgeType":"contains","source":84,"target":285},{"edgeType":"contains","source":1097,"target":1121},{"edgeType":"calls","source":2744,"target":2589},{"edgeType":"calls","source":493,"target":495},{"edgeType":"calls","source":2137,"target":530},{"edgeType":"calls","source":782,"target":785},{"edgeType":"calls","source":1971,"target":393},{"edgeType":"calls","source":1570,"target":668},{"edgeType":"calls","source":859,"target":775},{"edgeType":"contains","source":327,"target":2000},{"edgeType":"contains","source":1078,"target":1181},{"edgeType":"calls","source":2530,"target":503},{"edgeType":"contains","source":659,"target":693},{"edgeType":"contains","source":1733,"target":1751},{"edgeType":"contains","source":2446,"target":2639},{"edgeType":"contains","source":357,"target":806},{"edgeType":"calls","source":918,"target":267},{"edgeType":"contains","source":647,"target":800},{"edgeType":"imports","source":1002,"target":366},{"edgeType":"calls","source":918,"target":268},{"edgeType":"calls","source":1597,"target":359},{"edgeType":"contains","source":1097,"target":1120},{"edgeType":"contains","source":84,"target":284},{"edgeType":"contains","source":49,"target":2426},{"edgeType":"calls","source":2137,"target":531},{"edgeType":"calls","source":1438,"target":267},{"edgeType":"calls","source":782,"target":784},{"edgeType":"contains","source":2612,"target":2750},{"edgeType":"calls","source":2330,"target":2505},{"edgeType":"calls","source":1814,"target":531},{"edgeType":"contains","source":81,"target":611},{"edgeType":"contains","source":1072,"target":1073},{"edgeType":"calls","source":774,"target":531},{"edgeType":"contains","source":1673,"target":1733},{"edgeType":"calls","source":2137,"target":296},{"edgeType":"contains","source":1790,"target":1806},{"edgeType":"calls","source":834,"target":785},{"edgeType":"contains","source":14,"target":45},{"edgeType":"calls","source":2038,"target":986},{"edgeType":"contains","source":49,"target":1075},{"edgeType":"contains","source":2392,"target":1906},{"edgeType":"calls","source":1473,"target":531},{"edgeType":"calls","source":1993,"target":531},{"edgeType":"contains","source":1369,"target":1380},{"edgeType":"contains","source":1551,"target":1552},{"edgeType":"contains","source":133,"target":849},{"edgeType":"contains","source":451,"target":504},{"edgeType":"contains","source":357,"target":1304},{"edgeType":"calls","source":567,"target":342},{"edgeType":"calls","source":2543,"target":395},{"edgeType":"contains","source":81,"target":610},{"edgeType":"calls","source":515,"target":367},{"edgeType":"contains","source":2612,"target":2751},{"edgeType":"calls","source":1814,"target":530},{"edgeType":"calls","source":774,"target":530},{"edgeType":"contains","source":1790,"target":1807},{"edgeType":"calls","source":2137,"target":2147},{"edgeType":"calls","source":834,"target":784},{"edgeType":"calls","source":1743,"target":1145},{"edgeType":"calls","source":1993,"target":530},{"edgeType":"calls","source":1473,"target":530},{"edgeType":"calls","source":925,"target":342},{"edgeType":"contains","source":708,"target":728},{"edgeType":"contains","source":327,"target":1440},{"edgeType":"contains","source":107,"target":2182},{"edgeType":"calls","source":2021,"target":719},{"edgeType":"contains","source":2392,"target":1907},{"edgeType":"contains","source":133,"target":848},{"edgeType":"calls","source":2608,"target":2609},{"edgeType":"contains","source":357,"target":1303},{"edgeType":"calls","source":2543,"target":396},{"edgeType":"contains","source":2612,"target":2748},{"edgeType":"contains","source":816,"target":819},{"edgeType":"calls","source":2137,"target":294},{"edgeType":"calls","source":2038,"target":988},{"edgeType":"contains","source":107,"target":2185},{"edgeType":"calls","source":1743,"target":1148},{"edgeType":"calls","source":1737,"target":277},{"edgeType":"calls","source":371,"target":342},{"edgeType":"contains","source":1369,"target":1378},{"edgeType":"imports","source":76,"target":511},{"edgeType":"calls","source":2694,"target":733},{"edgeType":"calls","source":1947,"target":1959},{"edgeType":"contains","source":1790,"target":1804},{"edgeType":"calls","source":750,"target":749},{"edgeType":"contains","source":354,"target":2456},{"edgeType":"calls","source":230,"target":221},{"edgeType":"calls","source":1600,"target":1617},{"edgeType":"calls","source":2543,"target":393},{"edgeType":"calls","source":969,"target":302},{"edgeType":"contains","source":327,"target":1971},{"edgeType":"contains","source":2134,"target":2504},{"edgeType":"calls","source":792,"target":767},{"edgeType":"contains","source":2612,"target":2749},{"edgeType":"contains","source":70,"target":2010},{"edgeType":"contains","source":1917,"target":2096},{"edgeType":"calls","source":2137,"target":295},{"edgeType":"calls","source":2497,"target":234},{"edgeType":"imports","source":1281,"target":153},{"edgeType":"contains","source":2446,"target":2610},{"edgeType":"calls","source":798,"target":845},{"edgeType":"calls","source":2038,"target":987},{"edgeType":"calls","source":2664,"target":342},{"edgeType":"contains","source":357,"target":1305},{"edgeType":"contains","source":1790,"target":1805},{"edgeType":"contains","source":354,"target":2455},{"edgeType":"calls","source":2543,"target":394},{"edgeType":"contains","source":133,"target":850},{"edgeType":"calls","source":2674,"target":2675},{"edgeType":"calls","source":774,"target":527},{"edgeType":"contains","source":327,"target":1974},{"edgeType":"imports","source":133,"target":327},{"edgeType":"contains","source":14,"target":1635},{"edgeType":"calls","source":519,"target":240},{"edgeType":"contains","source":2446,"target":2615},{"edgeType":"contains","source":2612,"target":2754},{"edgeType":"contains","source":2484,"target":2494},{"edgeType":"calls","source":1814,"target":527},{"edgeType":"calls","source":798,"target":840},{"edgeType":"calls","source":1557,"target":302},{"edgeType":"calls","source":2091,"target":396},{"edgeType":"calls","source":1359,"target":362},{"edgeType":"contains","source":107,"target":2188},{"edgeType":"calls","source":2766,"target":348},{"edgeType":"contains","source":2392,"target":1910},{"edgeType":"calls","source":752,"target":681},{"edgeType":"calls","source":1473,"target":527},{"edgeType":"calls","source":1993,"target":527},{"edgeType":"calls","source":2517,"target":2518},{"edgeType":"contains","source":1369,"target":1384},{"edgeType":"calls","source":865,"target":349},{"edgeType":"contains","source":255,"target":506},{"edgeType":"contains","source":1075,"target":1512},{"edgeType":"calls","source":345,"target":349},{"edgeType":"calls","source":969,"target":296},{"edgeType":"calls","source":2418,"target":302},{"edgeType":"contains","source":1485,"target":1488},{"edgeType":"calls","source":2340,"target":342},{"edgeType":"calls","source":774,"target":526},{"edgeType":"contains","source":816,"target":820},{"edgeType":"calls","source":2571,"target":316},{"edgeType":"contains","source":81,"target":614},{"edgeType":"contains","source":2612,"target":2755},{"edgeType":"calls","source":1814,"target":526},{"edgeType":"calls","source":1874,"target":780},{"edgeType":"calls","source":2130,"target":1567},{"edgeType":"calls","source":2137,"target":293},{"edgeType":"calls","source":2091,"target":395},{"edgeType":"contains","source":1720,"target":1867},{"edgeType":"imports","source":2426,"target":2444},{"edgeType":"contains","source":2392,"target":1912},{"edgeType":"calls","source":1993,"target":526},{"edgeType":"calls","source":2766,"target":349},{"edgeType":"contains","source":327,"target":1444},{"edgeType":"contains","source":107,"target":2186},{"edgeType":"contains","source":2392,"target":1911},{"edgeType":"calls","source":752,"target":680},{"edgeType":"contains","source":896,"target":982},{"edgeType":"calls","source":1738,"target":503},{"edgeType":"contains","source":255,"target":505},{"edgeType":"calls","source":696,"target":302},{"edgeType":"calls","source":345,"target":348},{"edgeType":"calls","source":2740,"target":1420},{"edgeType":"calls","source":865,"target":348},{"edgeType":"calls","source":2694,"target":732},{"edgeType":"contains","source":1293,"target":1363},{"edgeType":"calls","source":969,"target":295},{"edgeType":"calls","source":807,"target":296},{"edgeType":"contains","source":354,"target":2457},{"edgeType":"calls","source":1473,"target":526},{"edgeType":"contains","source":2036,"target":2113},{"edgeType":"calls","source":353,"target":367},{"edgeType":"calls","source":1814,"target":529},{"edgeType":"contains","source":816,"target":823},{"edgeType":"contains","source":1790,"target":1808},{"edgeType":"calls","source":774,"target":529},{"edgeType":"calls","source":767,"target":746},{"edgeType":"contains","source":2612,"target":2752},{"edgeType":"contains","source":560,"target":567},{"edgeType":"calls","source":1294,"target":1322},{"edgeType":"calls","source":2091,"target":398},{"edgeType":"contains","source":14,"target":1901},{"edgeType":"imports","source":2426,"target":1386},{"edgeType":"calls","source":535,"target":275},{"edgeType":"calls","source":2021,"target":718},{"edgeType":"contains","source":2392,"target":1908},{"edgeType":"calls","source":2715,"target":342},{"edgeType":"calls","source":1473,"target":529},{"edgeType":"calls","source":1993,"target":529},{"edgeType":"calls","source":436,"target":437},{"edgeType":"calls","source":752,"target":683},{"edgeType":"calls","source":2682,"target":2686},{"edgeType":"calls","source":2188,"target":295},{"edgeType":"contains","source":896,"target":985},{"edgeType":"calls","source":2507,"target":712},{"edgeType":"contains","source":1485,"target":1486},{"edgeType":"calls","source":1814,"target":528},{"edgeType":"contains","source":2426,"target":327},{"edgeType":"contains","source":1790,"target":1809},{"edgeType":"calls","source":774,"target":528},{"edgeType":"calls","source":767,"target":745},{"edgeType":"contains","source":2612,"target":2753},{"edgeType":"contains","source":1075,"target":1249},{"edgeType":"calls","source":2091,"target":397},{"edgeType":"contains","source":1600,"target":1621},{"edgeType":"calls","source":2137,"target":2141},{"edgeType":"calls","source":1473,"target":528},{"edgeType":"calls","source":1993,"target":528},{"edgeType":"contains","source":255,"target":507},{"edgeType":"calls","source":2507,"target":713},{"edgeType":"contains","source":2392,"target":1909},{"edgeType":"contains","source":1369,"target":1383},{"edgeType":"calls","source":685,"target":645},{"edgeType":"calls","source":752,"target":682},{"edgeType":"calls","source":2357,"target":342},{"edgeType":"calls","source":2188,"target":296},{"edgeType":"calls","source":2682,"target":2687},{"edgeType":"contains","source":327,"target":1975},{"edgeType":"contains","source":2460,"target":2444},{"edgeType":"calls","source":2476,"target":349},{"edgeType":"contains","source":1097,"target":1099},{"edgeType":"contains","source":107,"target":2192},{"edgeType":"calls","source":1993,"target":523},{"edgeType":"calls","source":1504,"target":1148},{"edgeType":"calls","source":1385,"target":1401},{"edgeType":"calls","source":1543,"target":1524},{"edgeType":"contains","source":354,"target":2462},{"edgeType":"contains","source":451,"target":512},{"edgeType":"calls","source":1546,"target":638},{"edgeType":"contains","source":2612,"target":2758},{"edgeType":"contains","source":708,"target":737},{"edgeType":"calls","source":2682,"target":2684},{"edgeType":"calls","source":807,"target":293},{"edgeType":"calls","source":1841,"target":1535},{"edgeType":"calls","source":774,"target":523},{"edgeType":"calls","source":1473,"target":523},{"edgeType":"calls","source":2188,"target":293},{"edgeType":"contains","source":2162,"target":2174},{"edgeType":"calls","source":642,"target":387},{"edgeType":"contains","source":354,"target":84},{"edgeType":"contains","source":1097,"target":1098},{"edgeType":"contains","source":2484,"target":2499},{"edgeType":"calls","source":1524,"target":791},{"edgeType":"imports","source":1673,"target":430},{"edgeType":"contains","source":7,"target":1062},{"edgeType":"contains","source":816,"target":824},{"edgeType":"calls","source":1973,"target":349},{"edgeType":"contains","source":7,"target":1063},{"edgeType":"calls","source":2103,"target":2136},{"edgeType":"contains","source":1788,"target":2142},{"edgeType":"contains","source":2612,"target":2759},{"edgeType":"calls","source":2188,"target":294},{"edgeType":"calls","source":1375,"target":389},{"edgeType":"calls","source":1446,"target":302},{"edgeType":"calls","source":2682,"target":2685},{"edgeType":"contains","source":2162,"target":2175},{"edgeType":"contains","source":327,"target":1977},{"edgeType":"calls","source":1874,"target":779},{"edgeType":"contains","source":327,"target":1716},{"edgeType":"calls","source":774,"target":525},{"edgeType":"calls","source":1814,"target":525},{"edgeType":"contains","source":1097,"target":1101},{"edgeType":"contains","source":1507,"target":1600},{"edgeType":"calls","source":2091,"target":394},{"edgeType":"contains","source":1788,"target":2138},{"edgeType":"contains","source":2475,"target":2511},{"edgeType":"contains","source":451,"target":515},{"edgeType":"calls","source":1756,"target":1530},{"edgeType":"contains","source":2392,"target":1913},{"edgeType":"calls","source":1993,"target":525},{"edgeType":"calls","source":993,"target":342},{"edgeType":"calls","source":752,"target":679},{"edgeType":"imports","source":76,"target":255},{"edgeType":"contains","source":2086,"target":300},{"edgeType":"calls","source":1539,"target":1386},{"edgeType":"calls","source":493,"target":516},{"edgeType":"calls","source":969,"target":294},{"edgeType":"calls","source":642,"target":389},{"edgeType":"contains","source":708,"target":739},{"edgeType":"calls","source":807,"target":295},{"edgeType":"contains","source":1075,"target":1518},{"edgeType":"contains","source":1485,"target":1490},{"edgeType":"contains","source":2612,"target":2756},{"edgeType":"contains","source":2,"target":1485},{"edgeType":"contains","source":2162,"target":2172},{"edgeType":"calls","source":1570,"target":1746},{"edgeType":"contains","source":66,"target":1615},{"edgeType":"calls","source":1473,"target":525},{"edgeType":"calls","source":1370,"target":282},{"edgeType":"contains","source":327,"target":1715},{"edgeType":"calls","source":2476,"target":348},{"edgeType":"calls","source":675,"target":686},{"edgeType":"contains","source":2484,"target":2497},{"edgeType":"contains","source":1097,"target":1100},{"edgeType":"contains","source":24,"target":1066},{"edgeType":"calls","source":2091,"target":393},{"edgeType":"calls","source":493,"target":514},{"edgeType":"calls","source":1563,"target":113},{"edgeType":"imports","source":133,"target":338},{"edgeType":"calls","source":1914,"target":1916},{"edgeType":"contains","source":1496,"target":357},{"edgeType":"calls","source":752,"target":678},{"edgeType":"contains","source":2079,"target":518},{"edgeType":"contains","source":66,"target":2407},{"edgeType":"calls","source":969,"target":293},{"edgeType":"calls","source":642,"target":388},{"edgeType":"contains","source":708,"target":738},{"edgeType":"calls","source":807,"target":294},{"edgeType":"contains","source":2162,"target":2173},{"edgeType":"contains","source":1485,"target":1491},{"edgeType":"calls","source":1814,"target":523},{"edgeType":"contains","source":2612,"target":2757},{"edgeType":"imports","source":76,"target":520},{"edgeType":"calls","source":1963,"target":1982},{"edgeType":"calls","source":2682,"target":2683},{"edgeType":"contains","source":1677,"target":1617},{"edgeType":"calls","source":1278,"target":1279},{"edgeType":"contains","source":327,"target":1718},{"edgeType":"imports","source":2426,"target":1396},{"edgeType":"contains","source":1097,"target":1103},{"edgeType":"contains","source":816,"target":829},{"edgeType":"contains","source":14,"target":1643},{"edgeType":"calls","source":1370,"target":277},{"edgeType":"contains","source":14,"target":851},{"edgeType":"contains","source":7,"target":2125},{"edgeType":"calls","source":824,"target":819},{"edgeType":"contains","source":659,"target":675},{"edgeType":"contains","source":1667,"target":1668},{"edgeType":"contains","source":1733,"target":1736},{"edgeType":"contains","source":2446,"target":2623},{"edgeType":"calls","source":1387,"target":278},{"edgeType":"calls","source":798,"target":832},{"edgeType":"contains","source":327,"target":1717},{"edgeType":"calls","source":762,"target":97},{"edgeType":"imports","source":98,"target":100},{"edgeType":"contains","source":1097,"target":1102},{"edgeType":"calls","source":1760,"target":342},{"edgeType":"contains","source":354,"target":2466},{"edgeType":"calls","source":1473,"target":254},{"edgeType":"contains","source":7,"target":10},{"edgeType":"contains","source":1002,"target":1404},{"edgeType":"calls","source":353,"target":356},{"edgeType":"calls","source":2103,"target":2132},{"edgeType":"calls","source":1247,"target":389},{"edgeType":"contains","source":2612,"target":2763},{"edgeType":"contains","source":2484,"target":2503},{"edgeType":"contains","source":769,"target":967},{"edgeType":"contains","source":66,"target":1619},{"edgeType":"contains","source":1075,"target":1523},{"edgeType":"contains","source":1848,"target":1868},{"edgeType":"calls","source":2097,"target":2050},{"edgeType":"calls","source":1375,"target":388},{"edgeType":"imports","source":1494,"target":2010},{"edgeType":"contains","source":1097,"target":1105},{"edgeType":"calls","source":865,"target":342},{"edgeType":"contains","source":14,"target":1645},{"edgeType":"contains","source":354,"target":2469},{"edgeType":"calls","source":764,"target":302},{"edgeType":"calls","source":2330,"target":2491},{"edgeType":"calls","source":1973,"target":348},{"edgeType":"contains","source":219,"target":311},{"edgeType":"calls","source":1546,"target":636},{"edgeType":"contains","source":327,"target":1984},{"edgeType":"contains","source":1733,"target":1734},{"edgeType":"calls","source":1385,"target":342},{"edgeType":"contains","source":2612,"target":2760},{"edgeType":"contains","source":2162,"target":2176},{"edgeType":"contains","source":1848,"target":1869},{"edgeType":"calls","source":1375,"target":387},{"edgeType":"contains","source":2475,"target":2516},{"edgeType":"contains","source":1097,"target":1104},{"edgeType":"calls","source":1504,"target":1145},{"edgeType":"calls","source":361,"target":374},{"edgeType":"contains","source":327,"target":1983},{"edgeType":"calls","source":353,"target":358},{"edgeType":"calls","source":2520,"target":302},{"edgeType":"contains","source":357,"target":789},{"edgeType":"contains","source":2484,"target":2501},{"edgeType":"contains","source":2162,"target":2177},{"edgeType":"calls","source":1853,"target":367},{"edgeType":"contains","source":2612,"target":2761},{"edgeType":"contains","source":107,"target":2167},{"edgeType":"calls","source":1589,"target":718},{"edgeType":"contains","source":84,"target":237},{"edgeType":"calls","source":798,"target":398},{"edgeType":"calls","source":430,"target":443},{"edgeType":"calls","source":2566,"target":293},{"edgeType":"contains","source":2,"target":930},{"edgeType":"contains","source":2612,"target":2733},{"edgeType":"contains","source":1251,"target":2379},{"edgeType":"imports","source":1075,"target":511},{"edgeType":"calls","source":918,"target":378},{"edgeType":"contains","source":896,"target":962},{"edgeType":"contains","source":1720,"target":1846},{"edgeType":"contains","source":84,"target":236},{"edgeType":"calls","source":1336,"target":368},{"edgeType":"calls","source":798,"target":397},{"edgeType":"contains","source":81,"target":594},{"edgeType":"contains","source":2458,"target":2487},{"edgeType":"contains","source":2612,"target":2734},{"edgeType":"imports","source":2426,"target":647},{"edgeType":"contains","source":70,"target":1992},{"edgeType":"calls","source":2566,"target":294},{"edgeType":"contains","source":542,"target":572},{"edgeType":"calls","source":315,"target":308},{"edgeType":"calls","source":918,"target":377},{"edgeType":"calls","source":1979,"target":782},{"edgeType":"calls","source":750,"target":567},{"edgeType":"contains","source":708,"target":715},{"edgeType":"calls","source":493,"target":342},{"edgeType":"calls","source":2131,"target":2148},{"edgeType":"calls","source":808,"target":883},{"edgeType":"calls","source":1610,"target":333},{"edgeType":"contains","source":84,"target":239},{"edgeType":"contains","source":354,"target":2440},{"edgeType":"calls","source":2364,"target":1532},{"edgeType":"contains","source":107,"target":2697},{"edgeType":"contains","source":63,"target":98},{"edgeType":"contains","source":1072,"target":2115},{"edgeType":"calls","source":2503,"target":2508},{"edgeType":"calls","source":1780,"target":348},{"edgeType":"contains","source":107,"target":55},{"edgeType":"contains","source":2612,"target":2731},{"edgeType":"calls","source":1891,"target":342},{"edgeType":"contains","source":22,"target":1896},{"edgeType":"contains","source":72,"target":346},{"edgeType":"calls","source":1589,"target":719},{"edgeType":"calls","source":1969,"target":302},{"edgeType":"calls","source":1610,"target":332},{"edgeType":"contains","source":84,"target":238},{"edgeType":"contains","source":2134,"target":2488},{"edgeType":"contains","source":107,"target":2696},{"edgeType":"contains","source":2612,"target":2732},{"edgeType":"contains","source":7,"target":1833},{"edgeType":"calls","source":2506,"target":302},{"edgeType":"calls","source":1984,"target":365},{"edgeType":"calls","source":1359,"target":1506},{"edgeType":"contains","source":1856,"target":1857},{"edgeType":"contains","source":63,"target":2475},{"edgeType":"contains","source":354,"target":2442},{"edgeType":"calls","source":798,"target":394},{"edgeType":"contains","source":1595,"target":1496},{"edgeType":"calls","source":1669,"target":348},{"edgeType":"calls","source":1834,"target":1839},{"edgeType":"contains","source":84,"target":241},{"edgeType":"contains","source":708,"target":717},{"edgeType":"contains","source":107,"target":2700},{"edgeType":"calls","source":2492,"target":733},{"edgeType":"contains","source":1790,"target":1794},{"edgeType":"contains","source":2134,"target":2493},{"edgeType":"calls","source":1640,"target":718},{"edgeType":"contains","source":81,"target":599},{"edgeType":"contains","source":2612,"target":2737},{"edgeType":"calls","source":1719,"target":383},{"edgeType":"imports","source":133,"target":641},{"edgeType":"calls","source":798,"target":393},{"edgeType":"calls","source":2064,"target":2110},{"edgeType":"calls","source":1404,"target":1427},{"edgeType":"imports","source":1494,"target":1788},{"edgeType":"contains","source":84,"target":240},{"edgeType":"calls","source":2689,"target":176},{"edgeType":"contains","source":708,"target":716},{"edgeType":"contains","source":107,"target":2699},{"edgeType":"contains","source":107,"target":2698},{"edgeType":"contains","source":1790,"target":1795},{"edgeType":"contains","source":2446,"target":2599},{"edgeType":"contains","source":2612,"target":2738},{"edgeType":"calls","source":1719,"target":382},{"edgeType":"calls","source":230,"target":296},{"edgeType":"contains","source":1073,"target":1292},{"edgeType":"contains","source":1002,"target":1379},{"edgeType":"contains","source":72,"target":84},{"edgeType":"contains","source":72,"target":351},{"edgeType":"calls","source":798,"target":396},{"edgeType":"contains","source":107,"target":2702},{"edgeType":"calls","source":1610,"target":329},{"edgeType":"contains","source":84,"target":243},{"edgeType":"calls","source":1991,"target":1995},{"edgeType":"contains","source":84,"target":244},{"edgeType":"calls","source":2145,"target":389},{"edgeType":"contains","source":2612,"target":2735},{"edgeType":"calls","source":1953,"target":266},{"edgeType":"imports","source":1494,"target":1523},{"edgeType":"contains","source":64,"target":71},{"edgeType":"calls","source":315,"target":307},{"edgeType":"calls","source":918,"target":376},{"edgeType":"contains","source":109,"target":2111},{"edgeType":"contains","source":1245,"target":1246},{"edgeType":"imports","source":1281,"target":461},{"edgeType":"calls","source":798,"target":395},{"edgeType":"calls","source":1669,"target":349},{"edgeType":"contains","source":354,"target":2443},{"edgeType":"calls","source":1512,"target":1516},{"edgeType":"contains","source":107,"target":2701},{"edgeType":"calls","source":1610,"target":328},{"edgeType":"contains","source":84,"target":242},{"edgeType":"calls","source":2492,"target":732},{"edgeType":"calls","source":1953,"target":265},{"edgeType":"calls","source":1981,"target":454},{"edgeType":"contains","source":2612,"target":2736},{"edgeType":"calls","source":1719,"target":384},{"edgeType":"calls","source":1640,"target":719},{"edgeType":"contains","source":2079,"target":2083},{"edgeType":"imports","source":2426,"target":641},{"edgeType":"calls","source":257,"target":254},{"edgeType":"calls","source":2591,"target":302},{"edgeType":"calls","source":752,"target":759},{"edgeType":"contains","source":66,"target":2389},{"edgeType":"imports","source":50,"target":55},{"edgeType":"contains","source":357,"target":1296},{"edgeType":"contains","source":2616,"target":2618},{"edgeType":"contains","source":2612,"target":2742},{"edgeType":"contains","source":708,"target":721},{"edgeType":"calls","source":1719,"target":379},{"edgeType":"calls","source":372,"target":383},{"edgeType":"calls","source":1444,"target":1505},{"edgeType":"contains","source":327,"target":1962},{"edgeType":"contains","source":1759,"target":1702},{"edgeType":"calls","source":230,"target":293},{"edgeType":"contains","source":84,"target":246},{"edgeType":"calls","source":2145,"target":387},{"edgeType":"contains","source":1848,"target":1850},{"edgeType":"calls","source":2311,"target":1319},{"edgeType":"calls","source":1524,"target":1403},{"edgeType":"contains","source":647,"target":762},{"edgeType":"contains","source":49,"target":1595},{"edgeType":"contains","source":1790,"target":1798},{"edgeType":"calls","source":752,"target":758},{"edgeType":"contains","source":357,"target":1295},{"edgeType":"contains","source":2612,"target":2743},{"edgeType":"contains","source":708,"target":720},{"edgeType":"contains","source":107,"target":2703},{"edgeType":"calls","source":1710,"target":1714},{"edgeType":"calls","source":372,"target":382},{"edgeType":"calls","source":2021,"target":1322},{"edgeType":"contains","source":84,"target":245},{"edgeType":"calls","source":2145,"target":388},{"edgeType":"contains","source":1848,"target":1851},{"edgeType":"calls","source":2309,"target":2175},{"edgeType":"calls","source":1675,"target":156},{"edgeType":"contains","source":1790,"target":1799},{"edgeType":"contains","source":2134,"target":2498},{"edgeType":"contains","source":357,"target":1298},{"edgeType":"contains","source":1002,"target":1387},{"edgeType":"calls","source":2566,"target":282},{"edgeType":"contains","source":708,"target":723},{"edgeType":"contains","source":2612,"target":2740},{"edgeType":"calls","source":1915,"target":1440},{"edgeType":"calls","source":1249,"target":153},{"edgeType":"calls","source":230,"target":295},{"edgeType":"contains","source":1790,"target":1796},{"edgeType":"calls","source":2311,"target":1317},{"edgeType":"contains","source":84,"target":248},{"edgeType":"contains","source":2612,"target":2739},{"edgeType":"calls","source":1719,"target":381},{"edgeType":"imports","source":1075,"target":253},{"edgeType":"contains","source":2134,"target":2495},{"edgeType":"calls","source":656,"target":302},{"edgeType":"contains","source":255,"target":496},{"edgeType":"calls","source":2507,"target":1319},{"edgeType":"contains","source":14,"target":831},{"edgeType":"contains","source":357,"target":1297},{"edgeType":"contains","source":1002,"target":1386},{"edgeType":"contains","source":708,"target":722},{"edgeType":"calls","source":1719,"target":380},{"edgeType":"contains","source":2612,"target":2741},{"edgeType":"calls","source":372,"target":384},{"edgeType":"contains","source":2360,"target":2361},{"edgeType":"contains","source":896,"target":1236},{"edgeType":"contains","source":1790,"target":1797},{"edgeType":"calls","source":230,"target":294},{"edgeType":"contains","source":84,"target":247},{"edgeType":"calls","source":2311,"target":1318},{"edgeType":"calls","source":1372,"target":302},{"edgeType":"contains","source":1848,"target":1849},{"edgeType":"contains","source":81,"target":604},{"edgeType":"contains","source":2079,"target":2087},{"edgeType":"calls","source":2602,"target":2603},{"edgeType":"contains","source":1503,"target":1445},{"edgeType":"contains","source":1369,"target":1371},{"edgeType":"calls","source":1597,"target":986},{"edgeType":"contains","source":357,"target":1300},{"edgeType":"calls","source":2689,"target":167},{"edgeType":"calls","source":372,"target":379},{"edgeType":"calls","source":484,"target":342},{"edgeType":"contains","source":2446,"target":2607},{"edgeType":"contains","source":2612,"target":2746},{"edgeType":"calls","source":315,"target":296},{"edgeType":"calls","source":1404,"target":1419},{"edgeType":"contains","source":84,"target":250},{"edgeType":"contains","source":49,"target":2392},{"edgeType":"calls","source":2767,"target":2770},{"edgeType":"calls","source":1359,"target":1493},{"edgeType":"contains","source":1369,"target":1376},{"edgeType":"calls","source":2311,"target":1315},{"edgeType":"contains","source":1790,"target":1802},{"edgeType":"contains","source":2484,"target":1957},{"edgeType":"calls","source":1835,"target":1535},{"edgeType":"calls","source":2507,"target":1317},{"edgeType":"contains","source":81,"target":607},{"edgeType":"contains","source":357,"target":1299},{"edgeType":"contains","source":2134,"target":2502},{"edgeType":"calls","source":1710,"target":389},{"edgeType":"calls","source":2689,"target":168},{"edgeType":"calls","source":315,"target":295},{"edgeType":"contains","source":2612,"target":2747},{"edgeType":"contains","source":1067,"target":958},{"edgeType":"contains","source":84,"target":249},{"edgeType":"contains","source":708,"target":724},{"edgeType":"contains","source":1790,"target":1803},{"edgeType":"contains","source":451,"target":499},{"edgeType":"calls","source":2311,"target":1316},{"edgeType":"imports","source":70,"target":1282},{"edgeType":"calls","source":2507,"target":1318},{"edgeType":"contains","source":66,"target":2128},{"edgeType":"calls","source":2103,"target":365},{"edgeType":"calls","source":2411,"target":2176},{"edgeType":"calls","source":372,"target":381},{"edgeType":"contains","source":659,"target":661},{"edgeType":"calls","source":438,"target":449},{"edgeType":"calls","source":1597,"target":988},{"edgeType":"contains","source":2612,"target":2744},{"edgeType":"contains","source":1673,"target":1727},{"edgeType":"calls","source":1406,"target":302},{"edgeType":"contains","source":769,"target":950},{"edgeType":"contains","source":708,"target":727},{"edgeType":"calls","source":2311,"target":1313},{"edgeType":"contains","source":84,"target":252},{"edgeType":"calls","source":2610,"target":2614},{"edgeType":"contains","source":133,"target":847},{"edgeType":"contains","source":255,"target":500},{"edgeType":"calls","source":2524,"target":788},{"edgeType":"calls","source":2507,"target":1315},{"edgeType":"contains","source":1790,"target":1800},{"edgeType":"contains","source":357,"target":1302},{"edgeType":"calls","source":2767,"target":2768},{"edgeType":"calls","source":1292,"target":400},{"edgeType":"contains","source":1788,"target":2127},{"edgeType":"calls","source":372,"target":380},{"edgeType":"contains","source":2484,"target":2485},{"edgeType":"calls","source":1597,"target":987},{"edgeType":"contains","source":2612,"target":2745},{"edgeType":"calls","source":366,"target":302},{"edgeType":"contains","source":84,"target":251},{"edgeType":"calls","source":2689,"target":166},{"edgeType":"calls","source":2311,"target":1314},{"edgeType":"calls","source":2767,"target":2769},{"edgeType":"contains","source":327,"target":1438},{"edgeType":"contains","source":1917,"target":2092},{"edgeType":"calls","source":2507,"target":1316},{"edgeType":"contains","source":357,"target":1301},{"edgeType":"contains","source":1790,"target":1801},{"edgeType":"contains","source":1237,"target":1239},{"edgeType":"contains","source":81,"target":608},{"edgeType":"contains","source":2,"target":943},{"edgeType":"imports","source":133,"target":100},{"edgeType":"contains","source":1293,"target":1324},{"edgeType":"calls","source":2140,"target":302},{"edgeType":"contains","source":2612,"target":2717},{"edgeType":"calls","source":509,"target":389},{"edgeType":"contains","source":542,"target":557},{"edgeType":"contains","source":357,"target":1007},{"edgeType":"calls","source":438,"target":476},{"edgeType":"calls","source":782,"target":382},{"edgeType":"calls","source":1641,"target":972},{"edgeType":"contains","source":1507,"target":1561},{"edgeType":"contains","source":22,"target":821},{"edgeType":"calls","source":315,"target":325},{"edgeType":"imports","source":2426,"target":103},{"edgeType":"contains","source":112,"target":146},{"edgeType":"calls","source":1279,"target":302},{"edgeType":"contains","source":896,"target":946},{"edgeType":"calls","source":1900,"target":342},{"edgeType":"calls","source":1963,"target":1824},{"edgeType":"contains","source":357,"target":1271},{"edgeType":"contains","source":2612,"target":2718},{"edgeType":"calls","source":2692,"target":368},{"edgeType":"calls","source":2695,"target":275},{"edgeType":"contains","source":542,"target":556},{"edgeType":"contains","source":881,"target":882},{"edgeType":"contains","source":2392,"target":2403},{"edgeType":"calls","source":509,"target":388},{"edgeType":"calls","source":1641,"target":971},{"edgeType":"calls","source":782,"target":381},{"edgeType":"calls","source":2653,"target":784},{"edgeType":"contains","source":112,"target":145},{"edgeType":"calls","source":790,"target":398},{"edgeType":"calls","source":438,"target":475},{"edgeType":"calls","source":601,"target":443},{"edgeType":"contains","source":1293,"target":1326},{"edgeType":"imports","source":1494,"target":1512},{"edgeType":"contains","source":357,"target":1009},{"edgeType":"contains","source":63,"target":81},{"edgeType":"calls","source":1963,"target":1827},{"edgeType":"calls","source":1545,"target":779},{"edgeType":"imports","source":107,"target":111},{"edgeType":"contains","source":782,"target":783},{"edgeType":"calls","source":2481,"target":2149},{"edgeType":"calls","source":1641,"target":974},{"edgeType":"calls","source":1963,"target":2091},{"edgeType":"calls","source":1357,"target":265},{"edgeType":"contains","source":2612,"target":2715},{"edgeType":"calls","source":2566,"target":307},{"edgeType":"imports","source":1580,"target":1487},{"edgeType":"contains","source":1624,"target":1632},{"edgeType":"calls","source":886,"target":332},{"edgeType":"contains","source":14,"target":15},{"edgeType":"calls","source":2709,"target":367},{"edgeType":"contains","source":112,"target":148},{"edgeType":"contains","source":2061,"target":2355},{"edgeType":"calls","source":1965,"target":443},{"edgeType":"contains","source":542,"target":559},{"edgeType":"calls","source":1379,"target":111},{"edgeType":"calls","source":1963,"target":1826},{"edgeType":"contains","source":1293,"target":1323},{"edgeType":"calls","source":2566,"target":308},{"edgeType":"contains","source":2612,"target":2716},{"edgeType":"calls","source":1641,"target":973},{"edgeType":"imports","source":2426,"target":2479},{"edgeType":"contains","source":2640,"target":2641},{"edgeType":"contains","source":12,"target":75},{"edgeType":"imports","source":1075,"target":494},{"edgeType":"calls","source":315,"target":326},{"edgeType":"calls","source":2709,"target":368},{"edgeType":"contains","source":112,"target":147},{"edgeType":"contains","source":354,"target":2422},{"edgeType":"contains","source":542,"target":558},{"edgeType":"contains","source":270,"target":798},{"edgeType":"contains","source":2612,"target":2721},{"edgeType":"calls","source":2465,"target":265},{"edgeType":"calls","source":315,"target":321},{"edgeType":"contains","source":2475,"target":2476},{"edgeType":"calls","source":1975,"target":1977},{"edgeType":"calls","source":1523,"target":398},{"edgeType":"calls","source":790,"target":394},{"edgeType":"contains","source":107,"target":2155},{"edgeType":"imports","source":1002,"target":111},{"edgeType":"calls","source":894,"target":342},{"edgeType":"calls","source":1414,"target":1398},{"edgeType":"calls","source":803,"target":256},{"edgeType":"calls","source":438,"target":472},{"edgeType":"contains","source":112,"target":150},{"edgeType":"calls","source":1597,"target":1539},{"edgeType":"calls","source":2623,"target":388},{"edgeType":"contains","source":542,"target":561},{"edgeType":"calls","source":984,"target":987},{"edgeType":"contains","source":2612,"target":2722},{"edgeType":"calls","source":2623,"target":389},{"edgeType":"calls","source":2465,"target":266},{"edgeType":"calls","source":1264,"target":1291},{"edgeType":"imports","source":1002,"target":641},{"edgeType":"calls","source":1523,"target":397},{"edgeType":"contains","source":2640,"target":2647},{"edgeType":"calls","source":1094,"target":1276},{"edgeType":"calls","source":790,"target":393},{"edgeType":"contains","source":2484,"target":84},{"edgeType":"contains","source":2087,"target":2084},{"edgeType":"calls","source":1094,"target":1275},{"edgeType":"calls","source":1570,"target":1582},{"edgeType":"calls","source":438,"target":471},{"edgeType":"contains","source":112,"target":149},{"edgeType":"calls","source":315,"target":320},{"edgeType":"contains","source":1624,"target":1639},{"edgeType":"contains","source":354,"target":2424},{"edgeType":"calls","source":984,"target":986},{"edgeType":"calls","source":2515,"target":302},{"edgeType":"contains","source":2612,"target":2719},{"edgeType":"contains","source":1507,"target":1563},{"edgeType":"contains","source":1673,"target":1702},{"edgeType":"calls","source":2149,"target":2131},{"edgeType":"contains","source":81,"target":584},{"edgeType":"calls","source":509,"target":387},{"edgeType":"calls","source":315,"target":323},{"edgeType":"calls","source":2127,"target":699},{"edgeType":"calls","source":782,"target":380},{"edgeType":"contains","source":270,"target":275},{"edgeType":"calls","source":904,"target":826},{"edgeType":"contains","source":881,"target":889},{"edgeType":"contains","source":2640,"target":2644},{"edgeType":"imports","source":1673,"target":450},{"edgeType":"calls","source":2514,"target":1651},{"edgeType":"calls","source":790,"target":397},{"edgeType":"contains","source":327,"target":357},{"edgeType":"contains","source":357,"target":1277},{"edgeType":"contains","source":14,"target":2133},{"edgeType":"calls","source":438,"target":474},{"edgeType":"contains","source":1773,"target":1774},{"edgeType":"contains","source":112,"target":152},{"edgeType":"contains","source":769,"target":925},{"edgeType":"calls","source":1963,"target":1822},{"edgeType":"calls","source":1570,"target":1585},{"edgeType":"contains","source":542,"target":563},{"edgeType":"calls","source":715,"target":342},{"edgeType":"contains","source":1507,"target":1564},{"edgeType":"contains","source":881,"target":888},{"edgeType":"imports","source":107,"target":108},{"edgeType":"calls","source":782,"target":379},{"edgeType":"contains","source":2612,"target":2720},{"edgeType":"contains","source":81,"target":583},{"edgeType":"calls","source":2483,"target":1820},{"edgeType":"calls","source":315,"target":322},{"edgeType":"calls","source":793,"target":302},{"edgeType":"calls","source":790,"target":395},{"edgeType":"calls","source":1524,"target":368},{"edgeType":"calls","source":790,"target":396},{"edgeType":"calls","source":2503,"target":1993},{"edgeType":"calls","source":438,"target":473},{"edgeType":"contains","source":14,"target":18},{"edgeType":"calls","source":2623,"target":387},{"edgeType":"contains","source":112,"target":151},{"edgeType":"calls","source":1963,"target":1821},{"edgeType":"calls","source":984,"target":988},{"edgeType":"contains","source":542,"target":562},{"edgeType":"calls","source":2755,"target":784},{"edgeType":"calls","source":1523,"target":394},{"edgeType":"contains","source":1790,"target":988},{"edgeType":"contains","source":1066,"target":1234},{"edgeType":"calls","source":1604,"target":261},{"edgeType":"contains","source":327,"target":1417},{"edgeType":"calls","source":438,"target":468},{"edgeType":"calls","source":966,"target":220},{"edgeType":"contains","source":1773,"target":1780},{"edgeType":"calls","source":2752,"target":349},{"edgeType":"contains","source":2087,"target":2088},{"edgeType":"contains","source":357,"target":1279},{"edgeType":"calls","source":817,"target":875},{"edgeType":"imports","source":1002,"target":916},{"edgeType":"contains","source":112,"target":154},{"edgeType":"contains","source":70,"target":2513},{"edgeType":"contains","source":2612,"target":2725},{"edgeType":"calls","source":817,"target":345},{"edgeType":"calls","source":230,"target":308},{"edgeType":"calls","source":1743,"target":1765},{"edgeType":"calls","source":871,"target":785},{"edgeType":"calls","source":1523,"target":393},{"edgeType":"calls","source":2127,"target":698},{"edgeType":"calls","source":1264,"target":1287},{"edgeType":"calls","source":2755,"target":785},{"edgeType":"contains","source":2087,"target":2089},{"edgeType":"contains","source":105,"target":106},{"edgeType":"calls","source":604,"target":342},{"edgeType":"contains","source":357,"target":1278},{"edgeType":"calls","source":2364,"target":2336},{"edgeType":"contains","source":2612,"target":2726},{"edgeType":"contains","source":542,"target":564},{"edgeType":"calls","source":438,"target":467},{"edgeType":"imports","source":2079,"target":1089},{"edgeType":"contains","source":84,"target":231},{"edgeType":"contains","source":2612,"target":2723},{"edgeType":"contains","source":49,"target":1580},{"edgeType":"calls","source":1604,"target":263},{"edgeType":"contains","source":81,"target":588},{"edgeType":"calls","source":1524,"target":365},{"edgeType":"calls","source":1523,"target":396},{"edgeType":"contains","source":1790,"target":986},{"edgeType":"calls","source":1094,"target":1274},{"edgeType":"contains","source":354,"target":2431},{"edgeType":"calls","source":438,"target":470},{"edgeType":"contains","source":1002,"target":1370},{"edgeType":"calls","source":315,"target":319},{"edgeType":"calls","source":363,"target":417},{"edgeType":"calls","source":2343,"target":342},{"edgeType":"calls","source":1523,"target":395},{"edgeType":"contains","source":1790,"target":987},{"edgeType":"calls","source":1604,"target":262},{"edgeType":"contains","source":81,"target":587},{"edgeType":"calls","source":711,"target":726},{"edgeType":"calls","source":2752,"target":348},{"edgeType":"calls","source":438,"target":469},{"edgeType":"contains","source":541,"target":597},{"edgeType":"imports","source":1494,"target":461},{"edgeType":"imports","source":1494,"target":1518},{"edgeType":"calls","source":315,"target":318},{"edgeType":"calls","source":1438,"target":1444},{"edgeType":"contains","source":112,"target":155},{"edgeType":"calls","source":2137,"target":915},{"edgeType":"calls","source":1884,"target":302},{"edgeType":"contains","source":84,"target":233},{"edgeType":"contains","source":740,"target":774},{"edgeType":"contains","source":708,"target":709},{"edgeType":"contains","source":2723,"target":2724},{"edgeType":"contains","source":81,"target":590},{"edgeType":"contains","source":70,"target":1988},{"edgeType":"contains","source":647,"target":750},{"edgeType":"contains","source":1002,"target":1372},{"edgeType":"contains","source":2054,"target":2058},{"edgeType":"contains","source":1253,"target":1256},{"edgeType":"contains","source":2612,"target":2729},{"edgeType":"calls","source":430,"target":446},{"edgeType":"calls","source":808,"target":884},{"edgeType":"contains","source":84,"target":232},{"edgeType":"imports","source":2426,"target":1428},{"edgeType":"contains","source":2640,"target":2655},{"edgeType":"calls","source":273,"target":292},{"edgeType":"contains","source":647,"target":749},{"edgeType":"calls","source":1780,"target":349},{"edgeType":"calls","source":438,"target":463},{"edgeType":"contains","source":2612,"target":2730},{"edgeType":"contains","source":1443,"target":1445},{"edgeType":"contains","source":107,"target":315},{"edgeType":"calls","source":871,"target":784},{"edgeType":"contains","source":107,"target":2165},{"edgeType":"contains","source":84,"target":235},{"edgeType":"calls","source":1975,"target":1971},{"edgeType":"calls","source":1560,"target":302},{"edgeType":"calls","source":1564,"target":178},{"edgeType":"calls","source":1793,"target":1535},{"edgeType":"calls","source":230,"target":307},{"edgeType":"calls","source":1264,"target":1286},{"edgeType":"imports","source":1075,"target":497},{"edgeType":"calls","source":390,"target":368},{"edgeType":"contains","source":1790,"target":1783},{"edgeType":"contains","source":81,"target":592},{"edgeType":"contains","source":7,"target":772},{"edgeType":"contains","source":2087,"target":2090},{"edgeType":"contains","source":81,"target":593},{"edgeType":"calls","source":2566,"target":295},{"edgeType":"calls","source":1570,"target":1577},{"edgeType":"contains","source":541,"target":602},{"edgeType":"calls","source":1564,"target":177},{"edgeType":"contains","source":2612,"target":2727},{"edgeType":"calls","source":717,"target":273},{"edgeType":"contains","source":72,"target":343},{"edgeType":"calls","source":438,"target":466},{"edgeType":"contains","source":1253,"target":1254},{"edgeType":"contains","source":1673,"target":1711},{"edgeType":"imports","source":1494,"target":1249},{"edgeType":"contains","source":2392,"target":1092},{"edgeType":"contains","source":84,"target":234},{"edgeType":"contains","source":2161,"target":2439},{"edgeType":"calls","source":786,"target":775},{"edgeType":"contains","source":1790,"target":1784},{"edgeType":"contains","source":70,"target":1989},{"edgeType":"contains","source":81,"target":591},{"edgeType":"contains","source":2054,"target":2057},{"edgeType":"imports","source":1075,"target":498},{"edgeType":"calls","source":2566,"target":296},{"edgeType":"calls","source":1570,"target":1576},{"edgeType":"calls","source":2487,"target":367},{"edgeType":"calls","source":1756,"target":302},{"edgeType":"contains","source":1733,"target":1702},{"edgeType":"calls","source":438,"target":465},{"edgeType":"contains","source":1253,"target":1255},{"edgeType":"contains","source":14,"target":26},{"edgeType":"contains","source":2612,"target":2728},{"edgeType":"contains","source":112,"target":129},{"edgeType":"calls","source":790,"target":349},{"edgeType":"calls","source":1718,"target":914},{"edgeType":"calls","source":362,"target":668},{"edgeType":"calls","source":2064,"target":2080},{"edgeType":"calls","source":371,"target":389},{"edgeType":"calls","source":1372,"target":277},{"edgeType":"calls","source":1370,"target":339},{"edgeType":"imports","source":1494,"target":1562},{"edgeType":"contains","source":641,"target":643},{"edgeType":"calls","source":1721,"target":1085},{"edgeType":"calls","source":1570,"target":1538},{"edgeType":"contains","source":354,"target":2405},{"edgeType":"imports","source":70,"target":253},{"edgeType":"contains","source":1496,"target":1886},{"edgeType":"calls","source":1718,"target":913},{"edgeType":"contains","source":112,"target":128},{"edgeType":"calls","source":362,"target":667},{"edgeType":"calls","source":371,"target":388},{"edgeType":"calls","source":790,"target":348},{"edgeType":"calls","source":2064,"target":2081},{"edgeType":"calls","source":752,"target":733},{"edgeType":"contains","source":641,"target":642},{"edgeType":"calls","source":1710,"target":368},{"edgeType":"contains","source":2590,"target":2591},{"edgeType":"contains","source":105,"target":874},{"edgeType":"calls","source":254,"target":316},{"edgeType":"contains","source":1496,"target":1887},{"edgeType":"contains","source":1507,"target":1546},{"edgeType":"contains","source":112,"target":131},{"edgeType":"contains","source":2134,"target":2189},{"edgeType":"calls","source":1728,"target":342},{"edgeType":"calls","source":2064,"target":2078},{"edgeType":"imports","source":2612,"target":199},{"edgeType":"calls","source":1671,"target":523},{"edgeType":"contains","source":542,"target":543},{"edgeType":"contains","source":541,"target":574},{"edgeType":"imports","source":1494,"target":1560},{"edgeType":"calls","source":366,"target":282},{"edgeType":"calls","source":760,"target":753},{"edgeType":"calls","source":1605,"target":719},{"edgeType":"contains","source":7,"target":2065},{"edgeType":"contains","source":1073,"target":1258},{"edgeType":"contains","source":36,"target":1429},{"edgeType":"contains","source":112,"target":130},{"edgeType":"calls","source":362,"target":669},{"edgeType":"contains","source":354,"target":2406},{"edgeType":"calls","source":1497,"target":367},{"edgeType":"contains","source":541,"target":573},{"edgeType":"calls","source":1372,"target":278},{"edgeType":"calls","source":1370,"target":340},{"edgeType":"contains","source":63,"target":64},{"edgeType":"calls","source":2038,"target":508},{"edgeType":"calls","source":1605,"target":718},{"edgeType":"contains","source":2,"target":105},{"edgeType":"calls","source":1359,"target":1473},{"edgeType":"contains","source":272,"target":455},{"edgeType":"contains","source":1073,"target":1257},{"edgeType":"contains","source":327,"target":1657},{"edgeType":"contains","source":1496,"target":1885},{"edgeType":"calls","source":315,"target":277},{"edgeType":"contains","source":1507,"target":1544},{"edgeType":"calls","source":567,"target":387},{"edgeType":"calls","source":362,"target":664},{"edgeType":"calls","source":1947,"target":2003},{"edgeType":"calls","source":315,"target":271},{"edgeType":"contains","source":542,"target":545},{"edgeType":"contains","source":541,"target":576},{"edgeType":"contains","source":354,"target":2409},{"edgeType":"contains","source":769,"target":907},{"edgeType":"contains","source":1496,"target":1890},{"edgeType":"contains","source":357,"target":994},{"edgeType":"contains","source":81,"target":566},{"edgeType":"calls","source":1403,"target":368},{"edgeType":"contains","source":1979,"target":1980},{"edgeType":"contains","source":2612,"target":2704},{"edgeType":"calls","source":2137,"target":342},{"edgeType":"contains","source":327,"target":1660},{"edgeType":"imports","source":76,"target":327},{"edgeType":"calls","source":1326,"target":377},{"edgeType":"calls","source":1947,"target":2002},{"edgeType":"calls","source":908,"target":914},{"edgeType":"contains","source":896,"target":933},{"edgeType":"calls","source":1573,"target":1440},{"edgeType":"contains","source":112,"target":132},{"edgeType":"imports","source":1281,"target":1289},{"edgeType":"contains","source":542,"target":544},{"edgeType":"contains","source":541,"target":575},{"edgeType":"calls","source":2291,"target":2175},{"edgeType":"imports","source":1494,"target":1557},{"edgeType":"contains","source":2458,"target":2459},{"edgeType":"calls","source":362,"target":663},{"edgeType":"contains","source":2161,"target":2416},{"edgeType":"calls","source":1963,"target":977},{"edgeType":"contains","source":2161,"target":2417},{"edgeType":"calls","source":1816,"target":1570},{"edgeType":"calls","source":1372,"target":271},{"edgeType":"calls","source":1370,"target":333},{"edgeType":"contains","source":270,"target":519},{"edgeType":"contains","source":2612,"target":2705},{"edgeType":"contains","source":1073,"target":1259},{"edgeType":"contains","source":887,"target":947},{"edgeType":"calls","source":1359,"target":1467},{"edgeType":"calls","source":1931,"target":1440},{"edgeType":"calls","source":2692,"target":2693},{"edgeType":"contains","source":2507,"target":2525},{"edgeType":"calls","source":1326,"target":376},{"edgeType":"contains","source":641,"target":649},{"edgeType":"calls","source":1718,"target":912},{"edgeType":"contains","source":2129,"target":2084},{"edgeType":"calls","source":362,"target":666},{"edgeType":"calls","source":371,"target":387},{"edgeType":"calls","source":1984,"target":1915},{"edgeType":"calls","source":966,"target":176},{"edgeType":"contains","source":2,"target":1431},{"edgeType":"calls","source":752,"target":732},{"edgeType":"contains","source":112,"target":135},{"edgeType":"contains","source":107,"target":1347},{"edgeType":"calls","source":366,"target":278},{"edgeType":"contains","source":357,"target":997},{"edgeType":"calls","source":760,"target":748},{"edgeType":"contains","source":7,"target":483},{"edgeType":"calls","source":567,"target":389},{"edgeType":"contains","source":542,"target":547},{"edgeType":"contains","source":541,"target":578},{"edgeType":"contains","source":1496,"target":1888},{"edgeType":"calls","source":2191,"target":780},{"edgeType":"calls","source":315,"target":274},{"edgeType":"imports","source":70,"target":511},{"edgeType":"contains","source":1073,"target":1262},{"edgeType":"calls","source":362,"target":665},{"edgeType":"calls","source":567,"target":388},{"edgeType":"calls","source":908,"target":916},{"edgeType":"contains","source":112,"target":134},{"edgeType":"calls","source":366,"target":277},{"edgeType":"calls","source":1372,"target":274},{"edgeType":"contains","source":357,"target":1260},{"edgeType":"contains","source":542,"target":546},{"edgeType":"contains","source":541,"target":577},{"edgeType":"calls","source":760,"target":747},{"edgeType":"calls","source":1791,"target":233},{"edgeType":"contains","source":357,"target":995},{"edgeType":"contains","source":1283,"target":300},{"edgeType":"calls","source":345,"target":400},{"edgeType":"contains","source":2,"target":109},{"edgeType":"calls","source":1975,"target":1928},{"edgeType":"calls","source":1326,"target":378},{"edgeType":"contains","source":1073,"target":1261},{"edgeType":"contains","source":63,"target":2446},{"edgeType":"calls","source":936,"target":307},{"edgeType":"contains","source":513,"target":655},{"edgeType":"calls","source":1539,"target":377},{"edgeType":"contains","source":112,"target":137},{"edgeType":"calls","source":1249,"target":382},{"edgeType":"contains","source":2612,"target":2709},{"edgeType":"calls","source":1963,"target":974},{"edgeType":"contains","source":344,"target":345},{"edgeType":"contains","source":542,"target":549},{"edgeType":"contains","source":541,"target":580},{"edgeType":"contains","source":357,"target":999},{"edgeType":"imports","source":1882,"target":641},{"edgeType":"contains","source":88,"target":89},{"edgeType":"contains","source":1790,"target":1765},{"edgeType":"contains","source":272,"target":462},{"edgeType":"contains","source":270,"target":524},{"edgeType":"contains","source":1756,"target":1762},{"edgeType":"calls","source":1405,"target":302},{"edgeType":"contains","source":1252,"target":1266},{"edgeType":"contains","source":1496,"target":1894},{"edgeType":"calls","source":1539,"target":376},{"edgeType":"calls","source":1534,"target":531},{"edgeType":"contains","source":1788,"target":2091},{"edgeType":"calls","source":1884,"target":780},{"edgeType":"calls","source":2617,"target":785},{"edgeType":"calls","source":2138,"target":307},{"edgeType":"calls","source":355,"target":349},{"edgeType":"contains","source":1073,"target":1264},{"edgeType":"contains","source":2441,"target":2460},{"edgeType":"calls","source":1992,"target":1660},{"edgeType":"contains","source":112,"target":136},{"edgeType":"contains","source":2612,"target":2710},{"edgeType":"calls","source":1249,"target":381},{"edgeType":"calls","source":1965,"target":1968},{"edgeType":"contains","source":542,"target":548},{"edgeType":"contains","source":541,"target":579},{"edgeType":"calls","source":1963,"target":973},{"edgeType":"contains","source":327,"target":1928},{"edgeType":"calls","source":656,"target":266},{"edgeType":"calls","source":366,"target":271},{"edgeType":"calls","source":1534,"target":530},{"edgeType":"calls","source":2191,"target":779},{"edgeType":"calls","source":685,"target":688},{"edgeType":"calls","source":355,"target":348},{"edgeType":"calls","source":1884,"target":779},{"edgeType":"calls","source":808,"target":839},{"edgeType":"calls","source":2138,"target":308},{"edgeType":"contains","source":1073,"target":1263},{"edgeType":"calls","source":1094,"target":429},{"edgeType":"contains","source":354,"target":2415},{"edgeType":"calls","source":1947,"target":2001},{"edgeType":"contains","source":7,"target":2073},{"edgeType":"contains","source":542,"target":551},{"edgeType":"calls","source":1249,"target":384},{"edgeType":"contains","source":327,"target":1931},{"edgeType":"contains","source":112,"target":139},{"edgeType":"calls","source":611,"target":342},{"edgeType":"calls","source":726,"target":741},{"edgeType":"calls","source":1963,"target":976},{"edgeType":"calls","source":362,"target":662},{"edgeType":"contains","source":2036,"target":2064},{"edgeType":"contains","source":2161,"target":2418},{"edgeType":"contains","source":88,"target":91},{"edgeType":"contains","source":22,"target":23},{"edgeType":"contains","source":2612,"target":2706},{"edgeType":"calls","source":2149,"target":2342},{"edgeType":"calls","source":1370,"target":332},{"edgeType":"calls","source":366,"target":274},{"edgeType":"contains","source":1507,"target":1551},{"edgeType":"calls","source":908,"target":913},{"edgeType":"calls","source":817,"target":826},{"edgeType":"contains","source":542,"target":550},{"edgeType":"contains","source":541,"target":581},{"edgeType":"contains","source":641,"target":652},{"edgeType":"calls","source":1249,"target":383},{"edgeType":"calls","source":936,"target":308},{"edgeType":"calls","source":1539,"target":378},{"edgeType":"contains","source":112,"target":138},{"edgeType":"contains","source":2612,"target":2708},{"edgeType":"contains","source":272,"target":464},{"edgeType":"contains","source":357,"target":1000},{"edgeType":"calls","source":1963,"target":975},{"edgeType":"calls","source":405,"target":385},{"edgeType":"calls","source":1336,"target":1385},{"edgeType":"contains","source":1252,"target":1265},{"edgeType":"contains","source":88,"target":90},{"edgeType":"calls","source":1775,"target":1782},{"edgeType":"contains","source":2612,"target":2707},{"edgeType":"calls","source":1403,"target":365},{"edgeType":"contains","source":1624,"target":1625},{"edgeType":"calls","source":790,"target":342},{"edgeType":"calls","source":2617,"target":784},{"edgeType":"calls","source":908,"target":912},{"edgeType":"contains","source":542,"target":553},{"edgeType":"contains","source":7,"target":1018},{"edgeType":"contains","source":109,"target":1027},{"edgeType":"calls","source":2186,"target":1721},{"edgeType":"contains","source":112,"target":141},{"edgeType":"contains","source":2612,"target":2713},{"edgeType":"calls","source":919,"target":302},{"edgeType":"calls","source":1403,"target":1417},{"edgeType":"calls","source":1534,"target":527},{"edgeType":"contains","source":88,"target":93},{"edgeType":"contains","source":22,"target":2139},{"edgeType":"contains","source":740,"target":757},{"edgeType":"calls","source":792,"target":275},{"edgeType":"contains","source":66,"target":1832},{"edgeType":"calls","source":2131,"target":784},{"edgeType":"calls","source":2507,"target":227},{"edgeType":"calls","source":966,"target":166},{"edgeType":"contains","source":2441,"target":2464},{"edgeType":"contains","source":542,"target":552},{"edgeType":"contains","source":7,"target":2074},{"edgeType":"contains","source":7,"target":1017},{"edgeType":"calls","source":1563,"target":156},{"edgeType":"imports","source":1494,"target":1565},{"edgeType":"contains","source":270,"target":792},{"edgeType":"contains","source":1507,"target":1558},{"edgeType":"calls","source":1651,"target":1656},{"edgeType":"contains","source":2392,"target":2399},{"edgeType":"contains","source":2,"target":1436},{"edgeType":"contains","source":2612,"target":2714},{"edgeType":"calls","source":1534,"target":526},{"edgeType":"calls","source":2149,"target":2341},{"edgeType":"imports","source":1882,"target":108},{"edgeType":"calls","source":1915,"target":1928},{"edgeType":"contains","source":88,"target":92},{"edgeType":"calls","source":2131,"target":785},{"edgeType":"calls","source":685,"target":684},{"edgeType":"contains","source":2484,"target":1922},{"edgeType":"contains","source":357,"target":1005},{"edgeType":"calls","source":2507,"target":224},{"edgeType":"contains","source":542,"target":555},{"edgeType":"calls","source":1951,"target":287},{"edgeType":"calls","source":1249,"target":380},{"edgeType":"contains","source":2612,"target":2711},{"edgeType":"calls","source":1963,"target":972},{"edgeType":"calls","source":438,"target":416},{"edgeType":"contains","source":112,"target":143},{"edgeType":"contains","source":1252,"target":1268},{"edgeType":"contains","source":112,"target":144},{"edgeType":"calls","source":2707,"target":367},{"edgeType":"calls","source":1534,"target":529},{"edgeType":"contains","source":88,"target":95},{"edgeType":"calls","source":656,"target":265},{"edgeType":"calls","source":808,"target":838},{"edgeType":"calls","source":2507,"target":225},{"edgeType":"calls","source":2682,"target":349},{"edgeType":"contains","source":357,"target":1269},{"edgeType":"calls","source":966,"target":168},{"edgeType":"contains","source":354,"target":2419},{"edgeType":"calls","source":1094,"target":428},{"edgeType":"contains","source":542,"target":554},{"edgeType":"calls","source":1249,"target":379},{"edgeType":"calls","source":1951,"target":286},{"edgeType":"calls","source":1963,"target":971},{"edgeType":"contains","source":112,"target":142},{"edgeType":"contains","source":2612,"target":2712},{"edgeType":"imports","source":1075,"target":1076},{"edgeType":"calls","source":2707,"target":368},{"edgeType":"calls","source":1534,"target":528},{"edgeType":"calls","source":2418,"target":342},{"edgeType":"contains","source":88,"target":94},{"edgeType":"contains","source":517,"target":536},{"edgeType":"calls","source":2410,"target":2176},{"edgeType":"calls","source":2507,"target":226},{"edgeType":"calls","source":966,"target":167},{"edgeType":"calls","source":288,"target":336},{"edgeType":"contains","source":2161,"target":2659},{"edgeType":"contains","source":880,"target":881},{"edgeType":"calls","source":2507,"target":1312},{"edgeType":"calls","source":687,"target":387},{"edgeType":"contains","source":327,"target":1640},{"edgeType":"contains","source":112,"target":113},{"edgeType":"contains","source":673,"target":955},{"edgeType":"calls","source":2708,"target":367},{"edgeType":"contains","source":301,"target":331},{"edgeType":"contains","source":2,"target":616},{"edgeType":"calls","source":2507,"target":784},{"edgeType":"contains","source":14,"target":2358},{"edgeType":"calls","source":2507,"target":1313},{"edgeType":"contains","source":2,"target":880},{"edgeType":"calls","source":2311,"target":1311},{"edgeType":"calls","source":2566,"target":277},{"edgeType":"contains","source":2161,"target":2660},{"edgeType":"calls","source":742,"target":531},{"edgeType":"calls","source":1754,"target":342},{"edgeType":"contains","source":219,"target":230},{"edgeType":"calls","source":1947,"target":437},{"edgeType":"calls","source":2507,"target":785},{"edgeType":"contains","source":1507,"target":1529},{"edgeType":"calls","source":2188,"target":368},{"edgeType":"contains","source":673,"target":954},{"edgeType":"calls","source":2708,"target":368},{"edgeType":"contains","source":1871,"target":1873},{"edgeType":"contains","source":2,"target":1672},{"edgeType":"calls","source":2524,"target":787},{"edgeType":"calls","source":2507,"target":1314},{"edgeType":"contains","source":105,"target":1650},{"edgeType":"contains","source":354,"target":2387},{"edgeType":"calls","source":524,"target":683},{"edgeType":"calls","source":1991,"target":1979},{"edgeType":"calls","source":2311,"target":1312},{"edgeType":"contains","source":22,"target":2376},{"edgeType":"contains","source":1075,"target":916},{"edgeType":"calls","source":2311,"target":1308},{"edgeType":"contains","source":1072,"target":2066},{"edgeType":"calls","source":2507,"target":1310},{"edgeType":"calls","source":1710,"target":388},{"edgeType":"imports","source":2426,"target":2513},{"edgeType":"contains","source":63,"target":1369},{"edgeType":"contains","source":2612,"target":2682},{"edgeType":"calls","source":315,"target":294},{"edgeType":"contains","source":112,"target":115},{"edgeType":"contains","source":673,"target":957},{"edgeType":"calls","source":691,"target":266},{"edgeType":"calls","source":1710,"target":387},{"edgeType":"calls","source":2311,"target":1309},{"edgeType":"calls","source":1564,"target":156},{"edgeType":"contains","source":63,"target":2161},{"edgeType":"calls","source":2507,"target":1311},{"edgeType":"contains","source":1507,"target":1791},{"edgeType":"calls","source":1884,"target":278},{"edgeType":"contains","source":7,"target":2047},{"edgeType":"calls","source":1973,"target":1747},{"edgeType":"calls","source":687,"target":388},{"edgeType":"contains","source":327,"target":1641},{"edgeType":"calls","source":315,"target":293},{"edgeType":"contains","source":112,"target":114},{"edgeType":"contains","source":133,"target":520},{"edgeType":"calls","source":687,"target":389},{"edgeType":"calls","source":691,"target":265},{"edgeType":"contains","source":14,"target":2359},{"edgeType":"contains","source":105,"target":595},{"edgeType":"calls","source":2311,"target":1310},{"edgeType":"contains","source":29,"target":47},{"edgeType":"calls","source":742,"target":528},{"edgeType":"contains","source":357,"target":978},{"edgeType":"contains","source":1075,"target":918},{"edgeType":"calls","source":2311,"target":1306},{"edgeType":"calls","source":2507,"target":1308},{"edgeType":"contains","source":272,"target":442},{"edgeType":"contains","source":2612,"target":2688},{"edgeType":"calls","source":702,"target":711},{"edgeType":"contains","source":2573,"target":2576},{"edgeType":"calls","source":347,"target":353},{"edgeType":"imports","source":1580,"target":461},{"edgeType":"calls","source":1096,"target":389},{"edgeType":"calls","source":524,"target":680},{"edgeType":"contains","source":109,"target":2059},{"edgeType":"contains","source":112,"target":117},{"edgeType":"calls","source":819,"target":784},{"edgeType":"contains","source":673,"target":959},{"edgeType":"contains","source":2094,"target":2098},{"edgeType":"contains","source":21,"target":31},{"edgeType":"calls","source":1539,"target":397},{"edgeType":"calls","source":760,"target":763},{"edgeType":"calls","source":764,"target":639},{"edgeType":"contains","source":770,"target":859},{"edgeType":"calls","source":1749,"target":1286},{"edgeType":"calls","source":2311,"target":1307},{"edgeType":"contains","source":29,"target":46},{"edgeType":"calls","source":2507,"target":1309},{"edgeType":"calls","source":742,"target":527},{"edgeType":"contains","source":2612,"target":2689},{"edgeType":"calls","source":1096,"target":388},{"edgeType":"calls","source":355,"target":368},{"edgeType":"contains","source":301,"target":335},{"edgeType":"calls","source":1916,"target":1922},{"edgeType":"calls","source":524,"target":679},{"edgeType":"contains","source":112,"target":116},{"edgeType":"calls","source":2519,"target":2523},{"edgeType":"contains","source":2094,"target":2099},{"edgeType":"contains","source":354,"target":2391},{"edgeType":"contains","source":21,"target":30},{"edgeType":"calls","source":1539,"target":396},{"edgeType":"contains","source":270,"target":767},{"edgeType":"calls","source":764,"target":638},{"edgeType":"calls","source":2507,"target":1306},{"edgeType":"calls","source":1719,"target":369},{"edgeType":"calls","source":742,"target":530},{"edgeType":"contains","source":272,"target":444},{"edgeType":"calls","source":230,"target":282},{"edgeType":"contains","source":2161,"target":2661},{"edgeType":"calls","source":1718,"target":1721},{"edgeType":"contains","source":2573,"target":2574},{"edgeType":"contains","source":63,"target":1373},{"edgeType":"contains","source":2061,"target":2062},{"edgeType":"contains","source":354,"target":2394},{"edgeType":"contains","source":112,"target":119},{"edgeType":"calls","source":2132,"target":2097},{"edgeType":"contains","source":357,"target":1244},{"edgeType":"calls","source":2751,"target":349},{"edgeType":"contains","source":1293,"target":1294},{"edgeType":"calls","source":524,"target":682},{"edgeType":"calls","source":742,"target":529},{"edgeType":"calls","source":1756,"target":278},{"edgeType":"contains","source":1496,"target":1872},{"edgeType":"calls","source":390,"target":342},{"edgeType":"calls","source":2507,"target":1307},{"edgeType":"contains","source":1507,"target":1531},{"edgeType":"contains","source":2161,"target":2662},{"edgeType":"calls","source":1916,"target":1660},{"edgeType":"contains","source":301,"target":337},{"edgeType":"contains","source":1078,"target":1090},{"edgeType":"calls","source":524,"target":681},{"edgeType":"contains","source":112,"target":118},{"edgeType":"calls","source":1736,"target":369},{"edgeType":"contains","source":673,"target":960},{"edgeType":"calls","source":1749,"target":1287},{"edgeType":"calls","source":819,"target":785},{"edgeType":"contains","source":7,"target":2580},{"edgeType":"calls","source":1508,"target":302},{"edgeType":"calls","source":1539,"target":398},{"edgeType":"contains","source":49,"target":1281},{"edgeType":"contains","source":354,"target":811},{"edgeType":"calls","source":1370,"target":1404},{"edgeType":"calls","source":1401,"target":443},{"edgeType":"contains","source":616,"target":617},{"edgeType":"calls","source":1559,"target":302},{"edgeType":"contains","source":66,"target":2075},{"edgeType":"contains","source":673,"target":964},{"edgeType":"calls","source":392,"target":275},{"edgeType":"calls","source":2304,"target":2312},{"edgeType":"contains","source":2441,"target":2444},{"edgeType":"calls","source":1671,"target":529},{"edgeType":"calls","source":1573,"target":396},{"edgeType":"calls","source":1539,"target":393},{"edgeType":"contains","source":112,"target":121},{"edgeType":"contains","source":2612,"target":2692},{"edgeType":"contains","source":2094,"target":2102},{"edgeType":"contains","source":354,"target":2132},{"edgeType":"imports","source":513,"target":517},{"edgeType":"contains","source":1871,"target":1880},{"edgeType":"contains","source":272,"target":445},{"edgeType":"contains","source":2573,"target":2581},{"edgeType":"calls","source":1168,"target":266},{"edgeType":"calls","source":2751,"target":348},{"edgeType":"calls","source":1671,"target":528},{"edgeType":"calls","source":1573,"target":395},{"edgeType":"contains","source":112,"target":120},{"edgeType":"imports","source":1494,"target":1289},{"edgeType":"contains","source":70,"target":2479},{"edgeType":"calls","source":742,"target":523},{"edgeType":"contains","source":1871,"target":1881},{"edgeType":"calls","source":363,"target":645},{"edgeType":"calls","source":438,"target":434},{"edgeType":"contains","source":1496,"target":1875},{"edgeType":"calls","source":2330,"target":975},{"edgeType":"contains","source":109,"target":480},{"edgeType":"contains","source":2612,"target":2690},{"edgeType":"calls","source":742,"target":526},{"edgeType":"imports","source":1281,"target":1284},{"edgeType":"calls","source":1096,"target":387},{"edgeType":"contains","source":2573,"target":2578},{"edgeType":"calls","source":1671,"target":531},{"edgeType":"contains","source":1871,"target":1878},{"edgeType":"calls","source":524,"target":678},{"edgeType":"calls","source":1573,"target":398},{"edgeType":"contains","source":2094,"target":2100},{"edgeType":"contains","source":2028,"target":2032},{"edgeType":"calls","source":1539,"target":395},{"edgeType":"contains","source":112,"target":123},{"edgeType":"calls","source":2330,"target":976},{"edgeType":"contains","source":357,"target":984},{"edgeType":"contains","source":7,"target":2584},{"edgeType":"contains","source":1095,"target":1096},{"edgeType":"contains","source":272,"target":447},{"edgeType":"calls","source":230,"target":277},{"edgeType":"calls","source":677,"target":690},{"edgeType":"calls","source":742,"target":525},{"edgeType":"contains","source":301,"target":341},{"edgeType":"contains","source":1496,"target":1876},{"edgeType":"imports","source":133,"target":140},{"edgeType":"imports","source":107,"target":153},{"edgeType":"contains","source":327,"target":1385},{"edgeType":"contains","source":7,"target":2056},{"edgeType":"calls","source":1671,"target":530},{"edgeType":"calls","source":1573,"target":397},{"edgeType":"contains","source":2094,"target":2101},{"edgeType":"calls","source":1539,"target":394},{"edgeType":"contains","source":112,"target":122},{"edgeType":"calls","source":2330,"target":977},{"edgeType":"calls","source":1915,"target":365},{"edgeType":"contains","source":1871,"target":1879},{"edgeType":"calls","source":372,"target":368},{"edgeType":"calls","source":2330,"target":973},{"edgeType":"calls","source":1600,"target":348},{"edgeType":"calls","source":1000,"target":978},{"edgeType":"imports","source":1002,"target":153},{"edgeType":"calls","source":1381,"target":266},{"edgeType":"calls","source":661,"target":388},{"edgeType":"calls","source":1532,"target":342},{"edgeType":"imports","source":1281,"target":1282},{"edgeType":"contains","source":1788,"target":1814},{"edgeType":"imports","source":2079,"target":327},{"edgeType":"contains","source":101,"target":2051},{"edgeType":"contains","source":354,"target":2400},{"edgeType":"calls","source":1331,"target":1287},{"edgeType":"calls","source":1671,"target":525},{"edgeType":"contains","source":1507,"target":1541},{"edgeType":"contains","source":112,"target":125},{"edgeType":"contains","source":327,"target":1651},{"edgeType":"calls","source":2330,"target":974},{"edgeType":"imports","source":1494,"target":1284},{"edgeType":"calls","source":1381,"target":265},{"edgeType":"calls","source":371,"target":392},{"edgeType":"calls","source":230,"target":271},{"edgeType":"contains","source":2,"target":891},{"edgeType":"calls","source":661,"target":387},{"edgeType":"calls","source":361,"target":438},{"edgeType":"calls","source":2494,"target":2497},{"edgeType":"calls","source":1331,"target":1286},{"edgeType":"contains","source":327,"target":1915},{"edgeType":"contains","source":112,"target":124},{"edgeType":"calls","source":2555,"target":342},{"edgeType":"contains","source":107,"target":1339},{"edgeType":"contains","source":354,"target":817},{"edgeType":"calls","source":2064,"target":2082},{"edgeType":"calls","source":334,"target":221},{"edgeType":"contains","source":930,"target":931},{"edgeType":"calls","source":2330,"target":971},{"edgeType":"calls","source":1573,"target":394},{"edgeType":"contains","source":451,"target":453},{"edgeType":"calls","source":1867,"target":1322},{"edgeType":"calls","source":230,"target":274},{"edgeType":"calls","source":1168,"target":265},{"edgeType":"contains","source":105,"target":873},{"edgeType":"contains","source":2053,"target":2054},{"edgeType":"calls","source":315,"target":282},{"edgeType":"calls","source":1671,"target":527},{"edgeType":"calls","source":1957,"target":1967},{"edgeType":"contains","source":5,"target":9},{"edgeType":"calls","source":637,"target":342},{"edgeType":"contains","source":2612,"target":2694},{"edgeType":"contains","source":2094,"target":2104},{"edgeType":"contains","source":272,"target":452},{"edgeType":"contains","source":327,"target":1918},{"edgeType":"contains","source":2084,"target":300},{"edgeType":"contains","source":112,"target":127},{"edgeType":"calls","source":2330,"target":972},{"edgeType":"calls","source":1600,"target":349},{"edgeType":"contains","source":2573,"target":2583},{"edgeType":"calls","source":1372,"target":282},{"edgeType":"calls","source":1465,"target":570},{"edgeType":"contains","source":740,"target":742},{"edgeType":"calls","source":1573,"target":393},{"edgeType":"calls","source":1873,"target":342},{"edgeType":"calls","source":661,"target":389},{"edgeType":"contains","source":2,"target":101},{"edgeType":"calls","source":2402,"target":2176},{"edgeType":"contains","source":1073,"target":1253},{"edgeType":"calls","source":1671,"target":526},{"edgeType":"contains","source":2612,"target":2695},{"edgeType":"contains","source":2094,"target":2105},{"edgeType":"calls","source":1951,"target":302},{"edgeType":"contains","source":354,"target":2137},{"edgeType":"contains","source":112,"target":126},{"edgeType":"contains","source":49,"target":2079},{"edgeType":"calls","source":2137,"target":973},{"edgeType":"contains","source":673,"target":939},{"edgeType":"calls","source":969,"target":977},{"edgeType":"calls","source":1508,"target":388},{"edgeType":"contains","source":2305,"target":1614},{"edgeType":"calls","source":1504,"target":1569},{"edgeType":"contains","source":327,"target":1359},{"edgeType":"calls","source":1610,"target":397},{"edgeType":"calls","source":2530,"target":682},{"edgeType":"contains","source":2432,"target":2434},{"edgeType":"contains","source":1485,"target":1665},{"edgeType":"calls","source":1977,"target":1440},{"edgeType":"calls","source":1009,"target":266},{"edgeType":"calls","source":2137,"target":2295},{"edgeType":"contains","source":272,"target":421},{"edgeType":"contains","source":2612,"target":2667},{"edgeType":"calls","source":2137,"target":974},{"edgeType":"calls","source":969,"target":976},{"edgeType":"contains","source":673,"target":938},{"edgeType":"calls","source":1497,"target":728},{"edgeType":"calls","source":1508,"target":387},{"edgeType":"calls","source":1504,"target":1568},{"edgeType":"calls","source":685,"target":531},{"edgeType":"calls","source":490,"target":498},{"edgeType":"calls","source":2530,"target":683},{"edgeType":"calls","source":1610,"target":396},{"edgeType":"contains","source":354,"target":2371},{"edgeType":"contains","source":2432,"target":2435},{"edgeType":"calls","source":366,"target":378},{"edgeType":"calls","source":1009,"target":265},{"edgeType":"contains","source":2612,"target":2668},{"edgeType":"calls","source":1434,"target":302},{"edgeType":"contains","source":1854,"target":1855},{"edgeType":"calls","source":2137,"target":2296},{"edgeType":"contains","source":943,"target":2345},{"edgeType":"imports","source":107,"target":197},{"edgeType":"calls","source":1094,"target":1329},{"edgeType":"contains","source":1496,"target":1854},{"edgeType":"calls","source":2489,"target":2483},{"edgeType":"contains","source":1507,"target":1513},{"edgeType":"calls","source":817,"target":403},{"edgeType":"calls","source":2137,"target":975},{"edgeType":"calls","source":490,"target":501},{"edgeType":"calls","source":2137,"target":971},{"edgeType":"contains","source":1097,"target":746},{"edgeType":"contains","source":354,"target":2374},{"edgeType":"calls","source":2530,"target":680},{"edgeType":"contains","source":673,"target":677},{"edgeType":"calls","source":1504,"target":250},{"edgeType":"contains","source":2531,"target":2534},{"edgeType":"calls","source":1444,"target":788},{"edgeType":"calls","source":2506,"target":367},{"edgeType":"calls","source":2137,"target":2293},{"edgeType":"calls","source":343,"target":302},{"edgeType":"contains","source":2612,"target":2665},{"edgeType":"calls","source":2137,"target":972},{"edgeType":"contains","source":1097,"target":745},{"edgeType":"calls","source":1508,"target":389},{"edgeType":"contains","source":673,"target":940},{"edgeType":"calls","source":2530,"target":681},{"edgeType":"calls","source":1610,"target":398},{"edgeType":"contains","source":354,"target":2373},{"edgeType":"calls","source":1444,"target":787},{"edgeType":"contains","source":272,"target":422},{"edgeType":"contains","source":270,"target":484},{"edgeType":"calls","source":2137,"target":2294},{"edgeType":"contains","source":1280,"target":1413},{"edgeType":"contains","source":1075,"target":1426},{"edgeType":"contains","source":107,"target":255},{"edgeType":"calls","source":676,"target":278},{"edgeType":"calls","source":837,"target":308},{"edgeType":"contains","source":270,"target":752},{"edgeType":"imports","source":1673,"target":270},{"edgeType":"calls","source":1610,"target":393},{"edgeType":"contains","source":327,"target":1891},{"edgeType":"contains","source":2612,"target":2671},{"edgeType":"contains","source":1003,"target":1019},{"edgeType":"contains","source":1788,"target":1790},{"edgeType":"contains","source":81,"target":533},{"edgeType":"calls","source":2530,"target":678},{"edgeType":"calls","source":512,"target":342},{"edgeType":"contains","source":327,"target":1627},{"edgeType":"contains","source":354,"target":790},{"edgeType":"calls","source":685,"target":528},{"edgeType":"calls","source":969,"target":973},{"edgeType":"contains","source":673,"target":942},{"edgeType":"calls","source":1597,"target":531},{"edgeType":"contains","source":354,"target":2375},{"edgeType":"calls","source":837,"target":307},{"edgeType":"contains","source":541,"target":542},{"edgeType":"imports","source":1073,"target":108},{"edgeType":"calls","source":1597,"target":266},{"edgeType":"calls","source":1235,"target":389},{"edgeType":"contains","source":2,"target":867},{"edgeType":"calls","source":1858,"target":367},{"edgeType":"calls","source":2143,"target":256},{"edgeType":"calls","source":2530,"target":679},{"edgeType":"contains","source":272,"target":424},{"edgeType":"contains","source":2612,"target":2672},{"edgeType":"imports","source":76,"target":97},{"edgeType":"calls","source":1597,"target":530},{"edgeType":"calls","source":685,"target":527},{"edgeType":"calls","source":490,"target":494},{"edgeType":"calls","source":969,"target":972},{"edgeType":"contains","source":327,"target":1626},{"edgeType":"calls","source":969,"target":975},{"edgeType":"calls","source":1504,"target":1567},{"edgeType":"calls","source":2330,"target":269},{"edgeType":"contains","source":896,"target":903},{"edgeType":"calls","source":490,"target":497},{"edgeType":"calls","source":966,"target":275},{"edgeType":"contains","source":2432,"target":2436},{"edgeType":"contains","source":1580,"target":1629},{"edgeType":"calls","source":1610,"target":395},{"edgeType":"calls","source":366,"target":377},{"edgeType":"contains","source":219,"target":221},{"edgeType":"contains","source":1003,"target":1021},{"edgeType":"calls","source":2378,"target":367},{"edgeType":"contains","source":2612,"target":2669},{"edgeType":"imports","source":2426,"target":708},{"edgeType":"contains","source":81,"target":535},{"edgeType":"contains","source":1280,"target":1416},{"edgeType":"calls","source":685,"target":530},{"edgeType":"calls","source":1718,"target":746},{"edgeType":"calls","source":910,"target":1747},{"edgeType":"contains","source":19,"target":77},{"edgeType":"contains","source":1580,"target":1630},{"edgeType":"contains","source":2432,"target":2437},{"edgeType":"contains","source":2,"target":1661},{"edgeType":"contains","source":354,"target":2377},{"edgeType":"calls","source":1610,"target":394},{"edgeType":"calls","source":366,"target":376},{"edgeType":"contains","source":2612,"target":2670},{"edgeType":"contains","source":1003,"target":1020},{"edgeType":"contains","source":1496,"target":1856},{"edgeType":"calls","source":1718,"target":745},{"edgeType":"calls","source":685,"target":529},{"edgeType":"calls","source":969,"target":974},{"edgeType":"calls","source":1969,"target":359},{"edgeType":"calls","source":2130,"target":389},{"edgeType":"imports","source":1595,"target":1379},{"edgeType":"contains","source":354,"target":2380},{"edgeType":"calls","source":893,"target":682},{"edgeType":"calls","source":2330,"target":267},{"edgeType":"contains","source":2612,"target":2676},{"edgeType":"calls","source":2113,"target":387},{"edgeType":"contains","source":1673,"target":338},{"edgeType":"contains","source":1280,"target":1422},{"edgeType":"calls","source":817,"target":396},{"edgeType":"contains","source":1003,"target":1023},{"edgeType":"contains","source":2305,"target":1622},{"edgeType":"calls","source":1597,"target":527},{"edgeType":"contains","source":2161,"target":2651},{"edgeType":"contains","source":327,"target":1367},{"edgeType":"calls","source":2761,"target":2762},{"edgeType":"calls","source":257,"target":315},{"edgeType":"calls","source":2330,"target":268},{"edgeType":"imports","source":2569,"target":517},{"edgeType":"contains","source":1580,"target":1636},{"edgeType":"contains","source":12,"target":32},{"edgeType":"calls","source":893,"target":681},{"edgeType":"calls","source":2103,"target":963},{"edgeType":"calls","source":2480,"target":2489},{"edgeType":"contains","source":2612,"target":2677},{"edgeType":"contains","source":219,"target":222},{"edgeType":"contains","source":520,"target":140},{"edgeType":"contains","source":991,"target":2187},{"edgeType":"contains","source":1003,"target":1022},{"edgeType":"contains","source":1280,"target":1423},{"edgeType":"calls","source":817,"target":395},{"edgeType":"imports","source":70,"target":1088},{"edgeType":"imports","source":98,"target":220},{"edgeType":"contains","source":2161,"target":2652},{"edgeType":"calls","source":1597,"target":526},{"edgeType":"calls","source":685,"target":523},{"edgeType":"calls","source":490,"target":490},{"edgeType":"calls","source":2130,"target":387},{"edgeType":"contains","source":49,"target":1002},{"edgeType":"contains","source":14,"target":1030},{"edgeType":"calls","source":1379,"target":153},{"edgeType":"calls","source":2113,"target":389},{"edgeType":"contains","source":1580,"target":1633},{"edgeType":"contains","source":1496,"target":1859},{"edgeType":"contains","source":2,"target":1667},{"edgeType":"calls","source":1597,"target":265},{"edgeType":"contains","source":270,"target":493},{"edgeType":"calls","source":817,"target":398},{"edgeType":"contains","source":1003,"target":1025},{"edgeType":"calls","source":1235,"target":388},{"edgeType":"contains","source":2612,"target":2673},{"edgeType":"calls","source":1597,"target":529},{"edgeType":"calls","source":2140,"target":342},{"edgeType":"contains","source":673,"target":949},{"edgeType":"calls","source":969,"target":971},{"edgeType":"calls","source":1525,"target":1440},{"edgeType":"calls","source":685,"target":526},{"edgeType":"calls","source":1969,"target":360},{"edgeType":"calls","source":2130,"target":388},{"edgeType":"contains","source":2426,"target":2627},{"edgeType":"imports","source":2426,"target":1777},{"edgeType":"contains","source":354,"target":2381},{"edgeType":"calls","source":893,"target":683},{"edgeType":"contains","source":72,"target":288},{"edgeType":"contains","source":1580,"target":1634},{"edgeType":"calls","source":1713,"target":368},{"edgeType":"calls","source":2113,"target":388},{"edgeType":"contains","source":896,"target":906},{"edgeType":"imports","source":1494,"target":1336},{"edgeType":"contains","source":24,"target":2041},{"edgeType":"contains","source":1280,"target":1421},{"edgeType":"contains","source":2612,"target":2674},{"edgeType":"calls","source":817,"target":397},{"edgeType":"calls","source":1235,"target":387},{"edgeType":"imports","source":1580,"target":520},{"edgeType":"contains","source":1003,"target":1024},{"edgeType":"calls","source":1597,"target":528},{"edgeType":"calls","source":685,"target":525},{"edgeType":"calls","source":725,"target":342},{"edgeType":"calls","source":2624,"target":398},{"edgeType":"contains","source":354,"target":2384},{"edgeType":"calls","source":893,"target":678},{"edgeType":"calls","source":257,"target":310},{"edgeType":"contains","source":327,"target":1900},{"edgeType":"calls","source":614,"target":342},{"edgeType":"calls","source":1415,"target":1409},{"edgeType":"contains","source":2612,"target":2680},{"edgeType":"calls","source":1372,"target":1420},{"edgeType":"calls","source":1244,"target":367},{"edgeType":"contains","source":2036,"target":2038},{"edgeType":"contains","source":22,"target":2106},{"edgeType":"contains","source":14,"target":2354},{"edgeType":"calls","source":2091,"target":2123},{"edgeType":"calls","source":1540,"target":1497},{"edgeType":"calls","source":2336,"target":342},{"edgeType":"calls","source":390,"target":416},{"edgeType":"calls","source":1597,"target":523},{"edgeType":"calls","source":1393,"target":240},{"edgeType":"calls","source":1324,"target":1322},{"edgeType":"contains","source":357,"target":969},{"edgeType":"calls","source":1415,"target":1408},{"edgeType":"contains","source":1281,"target":1396},{"edgeType":"calls","source":2157,"target":342},{"edgeType":"contains","source":272,"target":433},{"edgeType":"contains","source":1003,"target":1026},{"edgeType":"calls","source":1570,"target":302},{"edgeType":"contains","source":2161,"target":2656},{"edgeType":"contains","source":979,"target":981},{"edgeType":"contains","source":887,"target":926},{"edgeType":"contains","source":1580,"target":1637},{"edgeType":"calls","source":893,"target":680},{"edgeType":"calls","source":2398,"target":531},{"edgeType":"contains","source":219,"target":229},{"edgeType":"calls","source":418,"target":342},{"edgeType":"calls","source":2620,"target":784},{"edgeType":"contains","source":2612,"target":2678},{"edgeType":"calls","source":1884,"target":349},{"edgeType":"contains","source":327,"target":1902},{"edgeType":"calls","source":1279,"target":342},{"edgeType":"calls","source":2624,"target":396},{"edgeType":"contains","source":673,"target":953},{"edgeType":"calls","source":817,"target":394},{"edgeType":"calls","source":1406,"target":368},{"edgeType":"calls","source":2010,"target":1992},{"edgeType":"contains","source":354,"target":2386},{"edgeType":"calls","source":1597,"target":525},{"edgeType":"calls","source":911,"target":915},{"edgeType":"contains","source":1580,"target":1638},{"edgeType":"contains","source":979,"target":980},{"edgeType":"calls","source":893,"target":679},{"edgeType":"contains","source":1073,"target":1237},{"edgeType":"calls","source":2620,"target":785},{"edgeType":"contains","source":2612,"target":2679},{"edgeType":"calls","source":1884,"target":348},{"edgeType":"contains","source":1280,"target":1425},{"edgeType":"calls","source":2624,"target":397},{"edgeType":"calls","source":1844,"target":1852},{"edgeType":"calls","source":817,"target":393},{"edgeType":"contains","source":1813,"target":1815},{"edgeType":"calls","source":655,"target":658},{"edgeType":"imports","source":2612,"target":2613},{"edgeType":"imports","source":76,"target":103},{"edgeType":"contains","source":673,"target":952},{"edgeType":"contains","source":2161,"target":2626},{"edgeType":"calls","source":2439,"target":348},{"edgeType":"calls","source":879,"target":348},{"edgeType":"contains","source":100,"target":187},{"edgeType":"calls","source":2507,"target":883},{"edgeType":"calls","source":1416,"target":1407},{"edgeType":"calls","source":852,"target":392},{"edgeType":"contains","source":1595,"target":1938},{"edgeType":"contains","source":887,"target":895},{"edgeType":"calls","source":2192,"target":342},{"edgeType":"calls","source":1292,"target":1287},{"edgeType":"calls","source":1440,"target":1455},{"edgeType":"calls","source":1984,"target":711},{"edgeType":"contains","source":140,"target":269},{"edgeType":"contains","source":673,"target":922},{"edgeType":"calls","source":366,"target":396},{"edgeType":"calls","source":2330,"target":1085},{"edgeType":"calls","source":1936,"target":349},{"edgeType":"imports","source":1443,"target":253},{"edgeType":"calls","source":2439,"target":349},{"edgeType":"imports","source":1075,"target":1089},{"edgeType":"contains","source":1595,"target":1939},{"edgeType":"calls","source":2507,"target":1148},{"edgeType":"imports","source":1075,"target":1091},{"edgeType":"contains","source":100,"target":186},{"edgeType":"calls","source":1660,"target":1505},{"edgeType":"contains","source":2513,"target":2550},{"edgeType":"calls","source":2507,"target":884},{"edgeType":"contains","source":1720,"target":2028},{"edgeType":"contains","source":140,"target":267},{"edgeType":"calls","source":1292,"target":1286},{"edgeType":"contains","source":140,"target":268},{"edgeType":"contains","source":673,"target":921},{"edgeType":"calls","source":1440,"target":1454},{"edgeType":"calls","source":990,"target":342},{"edgeType":"calls","source":1936,"target":348},{"edgeType":"calls","source":2481,"target":2483},{"edgeType":"imports","source":1494,"target":1578},{"edgeType":"calls","source":366,"target":395},{"edgeType":"calls","source":1372,"target":391},{"edgeType":"calls","source":2507,"target":1145},{"edgeType":"contains","source":100,"target":189},{"edgeType":"contains","source":66,"target":1243},{"edgeType":"calls","source":1416,"target":1409},{"edgeType":"contains","source":2446,"target":2510},{"edgeType":"contains","source":327,"target":1609},{"edgeType":"calls","source":1963,"target":307},{"edgeType":"contains","source":1496,"target":1570},{"edgeType":"calls","source":1440,"target":1457},{"edgeType":"calls","source":366,"target":398},{"edgeType":"contains","source":673,"target":924},{"edgeType":"contains","source":2134,"target":2140},{"edgeType":"contains","source":61,"target":870},{"edgeType":"contains","source":2161,"target":2625},{"edgeType":"contains","source":100,"target":188},{"edgeType":"contains","source":1496,"target":1835},{"edgeType":"contains","source":49,"target":1769},{"edgeType":"calls","source":879,"target":349},{"edgeType":"calls","source":1416,"target":1408},{"edgeType":"contains","source":1595,"target":1937},{"edgeType":"contains","source":2612,"target":2650},{"edgeType":"calls","source":366,"target":397},{"edgeType":"calls","source":566,"target":275},{"edgeType":"contains","source":673,"target":923},{"edgeType":"calls","source":1440,"target":1456},{"edgeType":"calls","source":565,"target":570},{"edgeType":"imports","source":1075,"target":1088},{"edgeType":"calls","source":1347,"target":111},{"edgeType":"contains","source":1067,"target":72},{"edgeType":"contains","source":354,"target":2095},{"edgeType":"calls","source":775,"target":397},{"edgeType":"imports","source":1494,"target":253},{"edgeType":"contains","source":70,"target":1914},{"edgeType":"contains","source":2161,"target":2630},{"edgeType":"imports","source":76,"target":79},{"edgeType":"imports","source":2426,"target":1487},{"edgeType":"calls","source":837,"target":853},{"edgeType":"contains","source":100,"target":191},{"edgeType":"calls","source":1622,"target":1623},{"edgeType":"contains","source":301,"target":303},{"edgeType":"calls","source":1902,"target":342},{"edgeType":"contains","source":12,"target":13},{"edgeType":"calls","source":2167,"target":2170},{"edgeType":"calls","source":403,"target":302},{"edgeType":"contains","source":2134,"target":2146},{"edgeType":"contains","source":1496,"target":1841},{"edgeType":"contains","source":2392,"target":1284},{"edgeType":"contains","source":1790,"target":1712},{"edgeType":"calls","source":2304,"target":302},{"edgeType":"contains","source":327,"target":1874},{"edgeType":"contains","source":2161,"target":2631},{"edgeType":"calls","source":1928,"target":1385},{"edgeType":"contains","source":100,"target":190},{"edgeType":"calls","source":2556,"target":2532},{"edgeType":"contains","source":301,"target":302},{"edgeType":"contains","source":327,"target":1610},{"edgeType":"calls","source":2397,"target":2176},{"edgeType":"calls","source":366,"target":391},{"edgeType":"calls","source":775,"target":396},{"edgeType":"contains","source":270,"target":734},{"edgeType":"contains","source":2161,"target":2628},{"edgeType":"contains","source":1595,"target":1940},{"edgeType":"contains","source":354,"target":2097},{"edgeType":"contains","source":2612,"target":2653},{"edgeType":"contains","source":66,"target":983},{"edgeType":"contains","source":70,"target":1916},{"edgeType":"calls","source":1385,"target":780},{"edgeType":"calls","source":865,"target":780},{"edgeType":"contains","source":673,"target":929},{"edgeType":"contains","source":301,"target":305},{"edgeType":"calls","source":995,"target":978},{"edgeType":"calls","source":661,"target":233},{"edgeType":"calls","source":2370,"target":367},{"edgeType":"contains","source":100,"target":193},{"edgeType":"calls","source":936,"target":958},{"edgeType":"calls","source":2330,"target":286},{"edgeType":"contains","source":673,"target":928},{"edgeType":"contains","source":1788,"target":2300},{"edgeType":"contains","source":2134,"target":2144},{"edgeType":"calls","source":366,"target":394},{"edgeType":"contains","source":1595,"target":1941},{"edgeType":"contains","source":2612,"target":2654},{"edgeType":"calls","source":1994,"target":1984},{"edgeType":"calls","source":775,"target":398},{"edgeType":"calls","source":1385,"target":779},{"edgeType":"calls","source":1489,"target":726},{"edgeType":"calls","source":865,"target":779},{"edgeType":"contains","source":327,"target":1612},{"edgeType":"calls","source":1560,"target":111},{"edgeType":"contains","source":100,"target":192},{"edgeType":"contains","source":301,"target":304},{"edgeType":"calls","source":2500,"target":302},{"edgeType":"imports","source":1281,"target":511},{"edgeType":"contains","source":27,"target":606},{"edgeType":"calls","source":2330,"target":287},{"edgeType":"contains","source":673,"target":927},{"edgeType":"calls","source":366,"target":393},{"edgeType":"calls","source":1475,"target":367},{"edgeType":"contains","source":49,"target":2305},{"edgeType":"calls","source":2541,"target":349},{"edgeType":"calls","source":1372,"target":384},{"edgeType":"calls","source":1372,"target":1441},{"edgeType":"contains","source":1595,"target":1946},{"edgeType":"contains","source":2161,"target":2634},{"edgeType":"calls","source":2713,"target":302},{"edgeType":"calls","source":1747,"target":1972},{"edgeType":"contains","source":100,"target":195},{"edgeType":"contains","source":100,"target":196},{"edgeType":"calls","source":1416,"target":1398},{"edgeType":"calls","source":689,"target":681},{"edgeType":"contains","source":109,"target":1238},{"edgeType":"calls","source":1506,"target":1515},{"edgeType":"calls","source":1713,"target":383},{"edgeType":"calls","source":2142,"target":1620},{"edgeType":"calls","source":775,"target":393},{"edgeType":"calls","source":2137,"target":718},{"edgeType":"contains","source":272,"target":412},{"edgeType":"calls","source":1963,"target":296},{"edgeType":"calls","source":1372,"target":383},{"edgeType":"contains","source":63,"target":2134},{"edgeType":"contains","source":301,"target":306},{"edgeType":"contains","source":2,"target":61},{"edgeType":"contains","source":2161,"target":2635},{"edgeType":"contains","source":1580,"target":1091},{"edgeType":"contains","source":100,"target":194},{"edgeType":"calls","source":2767,"target":1536},{"edgeType":"calls","source":2137,"target":2304},{"edgeType":"calls","source":1713,"target":382},{"edgeType":"calls","source":1604,"target":1647},{"edgeType":"calls","source":689,"target":680},{"edgeType":"calls","source":2101,"target":2099},{"edgeType":"contains","source":1595,"target":1948},{"edgeType":"contains","source":1882,"target":450},{"edgeType":"calls","source":2137,"target":719},{"edgeType":"contains","source":63,"target":816},{"edgeType":"calls","source":2689,"target":780},{"edgeType":"contains","source":1580,"target":1088},{"edgeType":"calls","source":689,"target":683},{"edgeType":"contains","source":100,"target":198},{"edgeType":"calls","source":1506,"target":1517},{"edgeType":"calls","source":775,"target":395},{"edgeType":"calls","source":2541,"target":348},{"edgeType":"imports","source":2426,"target":1496},{"edgeType":"calls","source":1992,"target":1249},{"edgeType":"calls","source":1168,"target":367},{"edgeType":"contains","source":1595,"target":1945},{"edgeType":"contains","source":673,"target":932},{"edgeType":"calls","source":490,"target":508},{"edgeType":"contains","source":1580,"target":1089},{"edgeType":"contains","source":2,"target":63},{"edgeType":"calls","source":1604,"target":1649},{"edgeType":"calls","source":2137,"target":2302},{"edgeType":"calls","source":538,"target":342},{"edgeType":"contains","source":354,"target":2364},{"edgeType":"calls","source":689,"target":682},{"edgeType":"contains","source":1672,"target":1673},{"edgeType":"calls","source":1438,"target":1510},{"edgeType":"calls","source":1713,"target":384},{"edgeType":"calls","source":775,"target":394},{"edgeType":"calls","source":1372,"target":380},{"edgeType":"contains","source":354,"target":782},{"edgeType":"contains","source":105,"target":2423},{"edgeType":"calls","source":1963,"target":293},{"edgeType":"contains","source":740,"target":708},{"edgeType":"contains","source":2531,"target":2532},{"edgeType":"calls","source":674,"target":349},{"edgeType":"calls","source":1713,"target":379},{"edgeType":"calls","source":2137,"target":2299},{"edgeType":"contains","source":37,"target":39},{"edgeType":"contains","source":354,"target":2103},{"edgeType":"calls","source":798,"target":733},{"edgeType":"contains","source":1251,"target":1252},{"edgeType":"calls","source":490,"target":502},{"edgeType":"calls","source":1372,"target":379},{"edgeType":"calls","source":2689,"target":779},{"edgeType":"calls","source":2149,"target":342},{"edgeType":"calls","source":1440,"target":1442},{"edgeType":"calls","source":1504,"target":1572},{"edgeType":"contains","source":769,"target":865},{"edgeType":"imports","source":98,"target":199},{"edgeType":"calls","source":2747,"target":302},{"edgeType":"imports","source":76,"target":88},{"edgeType":"contains","source":673,"target":934},{"edgeType":"contains","source":2531,"target":2533},{"edgeType":"contains","source":37,"target":38},{"edgeType":"calls","source":2522,"target":2521},{"edgeType":"calls","source":674,"target":348},{"edgeType":"contains","source":2,"target":66},{"edgeType":"calls","source":762,"target":791},{"edgeType":"calls","source":1781,"target":648},{"edgeType":"calls","source":798,"target":732},{"edgeType":"calls","source":412,"target":278},{"edgeType":"imports","source":1075,"target":1092},{"edgeType":"calls","source":1963,"target":295},{"edgeType":"calls","source":1372,"target":382},{"edgeType":"imports","source":1281,"target":520},{"edgeType":"imports","source":1580,"target":1293},{"edgeType":"contains","source":2161,"target":2636},{"edgeType":"calls","source":689,"target":678},{"edgeType":"calls","source":390,"target":434},{"edgeType":"calls","source":1604,"target":1646},{"edgeType":"contains","source":2085,"target":2086},{"edgeType":"contains","source":354,"target":2369},{"edgeType":"calls","source":1713,"target":381},{"edgeType":"calls","source":689,"target":679},{"edgeType":"contains","source":1075,"target":366},{"edgeType":"contains","source":270,"target":481},{"edgeType":"calls","source":2137,"target":976},{"edgeType":"contains","source":2441,"target":1884},{"edgeType":"contains","source":2392,"target":1289},{"edgeType":"calls","source":1372,"target":381},{"edgeType":"contains","source":2134,"target":2153},{"edgeType":"calls","source":1963,"target":294},{"edgeType":"calls","source":1528,"target":302},{"edgeType":"contains","source":2,"target":68},{"edgeType":"calls","source":1713,"target":380},{"edgeType":"calls","source":2461,"target":446},{"edgeType":"contains","source":37,"target":40},{"edgeType":"contains","source":344,"target":300},{"edgeType":"calls","source":895,"target":898},{"edgeType":"calls","source":2137,"target":977},{"edgeType":"contains","source":2444,"target":443},{"edgeType":"contains","source":1396,"target":1484},{"edgeType":"calls","source":1249,"target":1249},{"edgeType":"calls","source":1984,"target":1983},{"edgeType":"calls","source":2330,"target":1828},{"edgeType":"contains","source":2526,"target":2658},{"edgeType":"calls","source":1713,"target":342},{"edgeType":"contains","source":1919,"target":1920},{"edgeType":"contains","source":944,"target":961},{"edgeType":"calls","source":390,"target":395},{"edgeType":"contains","source":100,"target":171},{"edgeType":"calls","source":2636,"target":2649},{"edgeType":"contains","source":2538,"target":2551},{"edgeType":"calls","source":2682,"target":166},{"edgeType":"calls","source":893,"target":392},{"edgeType":"contains","source":770,"target":805},{"edgeType":"calls","source":2330,"target":1829},{"edgeType":"contains","source":1673,"target":1883},{"edgeType":"calls","source":685,"target":234},{"edgeType":"contains","source":1596,"target":1892},{"edgeType":"contains","source":69,"target":74},{"edgeType":"contains","source":100,"target":170},{"edgeType":"contains","source":1919,"target":1921},{"edgeType":"calls","source":390,"target":394},{"edgeType":"contains","source":327,"target":1853},{"edgeType":"calls","source":2489,"target":336},{"edgeType":"contains","source":2446,"target":2496},{"edgeType":"contains","source":2571,"target":2582},{"edgeType":"calls","source":273,"target":324},{"edgeType":"calls","source":1269,"target":367},{"edgeType":"calls","source":1792,"target":802},{"edgeType":"calls","source":390,"target":397},{"edgeType":"contains","source":1396,"target":1482},{"edgeType":"calls","source":2330,"target":1826},{"edgeType":"contains","source":1507,"target":1741},{"edgeType":"contains","source":338,"target":458},{"edgeType":"contains","source":100,"target":173},{"edgeType":"calls","source":1416,"target":302},{"edgeType":"contains","source":14,"target":989},{"edgeType":"contains","source":1596,"target":1889},{"edgeType":"calls","source":2510,"target":2589},{"edgeType":"contains","source":647,"target":656},{"edgeType":"contains","source":354,"target":1547},{"edgeType":"contains","source":2,"target":1624},{"edgeType":"calls","source":390,"target":396},{"edgeType":"contains","source":1396,"target":1483},{"edgeType":"calls","source":1500,"target":1397},{"edgeType":"calls","source":2611,"target":2629},{"edgeType":"calls","source":1370,"target":1463},{"edgeType":"calls","source":2330,"target":1827},{"edgeType":"contains","source":2526,"target":2657},{"edgeType":"calls","source":1359,"target":1539},{"edgeType":"contains","source":100,"target":172},{"edgeType":"calls","source":1444,"target":490},{"edgeType":"contains","source":1672,"target":2441},{"edgeType":"contains","source":338,"target":457},{"edgeType":"contains","source":2287,"target":2402},{"edgeType":"contains","source":1496,"target":1559},{"edgeType":"contains","source":2158,"target":2178},{"edgeType":"calls","source":1931,"target":715},{"edgeType":"calls","source":2330,"target":1824},{"edgeType":"calls","source":762,"target":750},{"edgeType":"calls","source":518,"target":387},{"edgeType":"calls","source":1379,"target":914},{"edgeType":"contains","source":2,"target":835},{"edgeType":"contains","source":338,"target":460},{"edgeType":"contains","source":327,"target":1858},{"edgeType":"contains","source":100,"target":175},{"edgeType":"calls","source":2558,"target":570},{"edgeType":"calls","source":372,"target":419},{"edgeType":"calls","source":2306,"target":1776},{"edgeType":"contains","source":2526,"target":2663},{"edgeType":"contains","source":1507,"target":1748},{"edgeType":"calls","source":1372,"target":1395},{"edgeType":"contains","source":991,"target":2414},{"edgeType":"calls","source":762,"target":749},{"edgeType":"contains","source":61,"target":62},{"edgeType":"calls","source":1379,"target":913},{"edgeType":"contains","source":1496,"target":1825},{"edgeType":"contains","source":338,"target":459},{"edgeType":"contains","source":2,"target":41},{"edgeType":"contains","source":100,"target":174},{"edgeType":"contains","source":2446,"target":2500},{"edgeType":"calls","source":2149,"target":830},{"edgeType":"calls","source":1729,"target":369},{"edgeType":"contains","source":140,"target":258},{"edgeType":"contains","source":1075,"target":1663},{"edgeType":"contains","source":2365,"target":2366},{"edgeType":"calls","source":1359,"target":1536},{"edgeType":"calls","source":2330,"target":1822},{"edgeType":"contains","source":461,"target":613},{"edgeType":"contains","source":49,"target":1494},{"edgeType":"calls","source":390,"target":393},{"edgeType":"calls","source":315,"target":340},{"edgeType":"contains","source":100,"target":177},{"edgeType":"calls","source":518,"target":389},{"edgeType":"imports","source":1494,"target":1092},{"edgeType":"contains","source":2190,"target":1449},{"edgeType":"contains","source":22,"target":1008},{"edgeType":"contains","source":2076,"target":2077},{"edgeType":"imports","source":1443,"target":1088},{"edgeType":"imports","source":2426,"target":740},{"edgeType":"contains","source":858,"target":461},{"edgeType":"calls","source":315,"target":339},{"edgeType":"contains","source":100,"target":176},{"edgeType":"calls","source":518,"target":388},{"edgeType":"calls","source":1984,"target":1975},{"edgeType":"contains","source":2526,"target":2666},{"edgeType":"contains","source":1790,"target":377},{"edgeType":"imports","source":70,"target":327},{"edgeType":"calls","source":315,"target":333},{"edgeType":"contains","source":140,"target":260},{"edgeType":"calls","source":1902,"target":1874},{"edgeType":"contains","source":461,"target":615},{"edgeType":"calls","source":586,"target":389},{"edgeType":"contains","source":2287,"target":2411},{"edgeType":"imports","source":70,"target":1913},{"edgeType":"calls","source":1660,"target":1712},{"edgeType":"contains","source":2134,"target":2398},{"edgeType":"contains","source":100,"target":179},{"edgeType":"calls","source":315,"target":332},{"edgeType":"contains","source":1790,"target":378},{"edgeType":"calls","source":852,"target":862},{"edgeType":"contains","source":140,"target":259},{"edgeType":"contains","source":2158,"target":2183},{"edgeType":"calls","source":1612,"target":1614},{"edgeType":"contains","source":1075,"target":1664},{"edgeType":"contains","source":133,"target":740},{"edgeType":"calls","source":2330,"target":1821},{"edgeType":"calls","source":586,"target":388},{"edgeType":"calls","source":1743,"target":988},{"edgeType":"imports","source":1002,"target":1033},{"edgeType":"calls","source":2492,"target":1820},{"edgeType":"contains","source":2134,"target":2135},{"edgeType":"calls","source":1405,"target":367},{"edgeType":"contains","source":2161,"target":2619},{"edgeType":"contains","source":100,"target":178},{"edgeType":"calls","source":1417,"target":788},{"edgeType":"contains","source":100,"target":181},{"edgeType":"imports","source":1494,"target":1634},{"edgeType":"contains","source":1882,"target":430},{"edgeType":"contains","source":2526,"target":2664},{"edgeType":"contains","source":2158,"target":2180},{"edgeType":"contains","source":1507,"target":1749},{"edgeType":"contains","source":140,"target":262},{"edgeType":"calls","source":1372,"target":1394},{"edgeType":"calls","source":1992,"target":1993},{"edgeType":"calls","source":829,"target":785},{"edgeType":"imports","source":2426,"target":490},{"edgeType":"contains","source":2161,"target":2616},{"edgeType":"imports","source":2426,"target":1282},{"edgeType":"contains","source":2444,"target":1506},{"edgeType":"calls","source":1379,"target":912},{"edgeType":"contains","source":22,"target":485},{"edgeType":"contains","source":991,"target":1628},{"edgeType":"contains","source":100,"target":180},{"edgeType":"imports","source":2066,"target":1078},{"edgeType":"calls","source":1931,"target":1505},{"edgeType":"contains","source":1790,"target":376},{"edgeType":"contains","source":2158,"target":2181},{"edgeType":"contains","source":140,"target":261},{"edgeType":"calls","source":2130,"target":1148},{"edgeType":"calls","source":829,"target":784},{"edgeType":"calls","source":2091,"target":2093},{"edgeType":"contains","source":1595,"target":1929},{"edgeType":"calls","source":1372,"target":1392},{"edgeType":"contains","source":2287,"target":2410},{"edgeType":"calls","source":1260,"target":367},{"edgeType":"contains","source":2588,"target":2598},{"edgeType":"calls","source":315,"target":329},{"edgeType":"contains","source":100,"target":183},{"edgeType":"calls","source":1849,"target":342},{"edgeType":"calls","source":1963,"target":1829},{"edgeType":"calls","source":1934,"target":1935},{"edgeType":"calls","source":1414,"target":1407},{"edgeType":"contains","source":140,"target":264},{"edgeType":"calls","source":2130,"target":1145},{"edgeType":"contains","source":2291,"target":2292},{"edgeType":"calls","source":1372,"target":1387},{"edgeType":"calls","source":1370,"target":1449},{"edgeType":"calls","source":1641,"target":976},{"edgeType":"contains","source":1919,"target":1932},{"edgeType":"imports","source":1494,"target":1897},{"edgeType":"calls","source":1578,"target":286},{"edgeType":"calls","source":910,"target":911},{"edgeType":"contains","source":2161,"target":2622},{"edgeType":"calls","source":2137,"target":400},{"edgeType":"contains","source":63,"target":272},{"edgeType":"contains","source":100,"target":182},{"edgeType":"calls","source":1963,"target":1828},{"edgeType":"calls","source":984,"target":994},{"edgeType":"contains","source":1288,"target":1410},{"edgeType":"calls","source":1545,"target":780},{"edgeType":"imports","source":2612,"target":270},{"edgeType":"contains","source":14,"target":998},{"edgeType":"contains","source":140,"target":263},{"edgeType":"calls","source":1357,"target":266},{"edgeType":"calls","source":2352,"target":342},{"edgeType":"calls","source":315,"target":328},{"edgeType":"contains","source":2612,"target":2648},{"edgeType":"contains","source":1773,"target":1702},{"edgeType":"contains","source":357,"target":936},{"edgeType":"contains","source":272,"target":399},{"edgeType":"calls","source":886,"target":333},{"edgeType":"calls","source":1641,"target":975},{"edgeType":"contains","source":1919,"target":1933},{"edgeType":"calls","source":2636,"target":2637},{"edgeType":"contains","source":2,"target":49},{"edgeType":"calls","source":852,"target":861},{"edgeType":"calls","source":2496,"target":367},{"edgeType":"contains","source":100,"target":185},{"edgeType":"calls","source":2653,"target":785},{"edgeType":"contains","source":2158,"target":2184},{"edgeType":"calls","source":1414,"target":1409},{"edgeType":"contains","source":140,"target":266},{"edgeType":"calls","source":438,"target":482},{"edgeType":"calls","source":1743,"target":987},{"edgeType":"calls","source":586,"target":387},{"edgeType":"calls","source":654,"target":657},{"edgeType":"calls","source":257,"target":280},{"edgeType":"calls","source":1417,"target":787},{"edgeType":"contains","source":673,"target":920},{"edgeType":"contains","source":1580,"target":1605},{"edgeType":"contains","source":100,"target":184},{"edgeType":"calls","source":1963,"target":1830},{"edgeType":"calls","source":1993,"target":1957},{"edgeType":"calls","source":521,"target":286},{"edgeType":"calls","source":1867,"target":1899},{"edgeType":"contains","source":272,"target":402},{"edgeType":"contains","source":140,"target":265},{"edgeType":"calls","source":1414,"target":1408},{"edgeType":"imports","source":70,"target":1907},{"edgeType":"calls","source":1372,"target":1388},{"edgeType":"calls","source":1743,"target":986},{"edgeType":"contains","source":2446,"target":2506},{"edgeType":"calls","source":1641,"target":977},{"edgeType":"contains","source":2444,"target":454},{"edgeType":"calls","source":521,"target":287},{"edgeType":"calls","source":1578,"target":287},{"edgeType":"contains","source":2161,"target":2621},{"edgeType":"calls","source":1564,"target":1514},{"edgeType":"calls","source":1961,"target":1920},{"edgeType":"contains","source":2438,"target":84},{"edgeType":"imports","source":133,"target":199},{"edgeType":"contains","source":944,"target":945},{"edgeType":"calls","source":2398,"target":529},{"edgeType":"calls","source":1266,"target":1267},{"edgeType":"calls","source":2142,"target":2123},{"edgeType":"calls","source":2654,"target":785},{"edgeType":"contains","source":357,"target":908},{"edgeType":"calls","source":2624,"target":394},{"edgeType":"calls","source":315,"target":358},{"edgeType":"contains","source":2190,"target":2223},{"edgeType":"calls","source":1597,"target":1576},{"edgeType":"contains","source":1720,"target":1730},{"edgeType":"calls","source":375,"target":348},{"edgeType":"contains","source":1487,"target":1554},{"edgeType":"calls","source":2103,"target":1747},{"edgeType":"calls","source":1094,"target":785},{"edgeType":"calls","source":1570,"target":1620},{"edgeType":"imports","source":2426,"target":1788},{"edgeType":"calls","source":837,"target":296},{"edgeType":"calls","source":2398,"target":530},{"edgeType":"calls","source":1884,"target":342},{"edgeType":"calls","source":2624,"target":395},{"edgeType":"contains","source":2158,"target":2159},{"edgeType":"contains","source":835,"target":887},{"edgeType":"contains","source":1811,"target":1817},{"edgeType":"calls","source":2480,"target":2481},{"edgeType":"calls","source":2481,"target":336},{"edgeType":"contains","source":2190,"target":2224},{"edgeType":"calls","source":757,"target":661},{"edgeType":"contains","source":1067,"target":1094},{"edgeType":"calls","source":1094,"target":784},{"edgeType":"calls","source":837,"target":295},{"edgeType":"contains","source":1487,"target":1555},{"edgeType":"calls","source":2398,"target":527},{"edgeType":"contains","source":98,"target":1011},{"edgeType":"contains","source":2426,"target":2568},{"edgeType":"contains","source":327,"target":1840},{"edgeType":"contains","source":100,"target":156},{"edgeType":"imports","source":133,"target":461},{"edgeType":"calls","source":1415,"target":1407},{"edgeType":"contains","source":2513,"target":2514},{"edgeType":"calls","source":315,"target":360},{"edgeType":"contains","source":2190,"target":2220},{"edgeType":"imports","source":1595,"target":1386},{"edgeType":"contains","source":98,"target":1010},{"edgeType":"calls","source":1931,"target":737},{"edgeType":"contains","source":327,"target":1839},{"edgeType":"contains","source":2,"target":22},{"edgeType":"imports","source":1595,"target":327},{"edgeType":"calls","source":2398,"target":528},{"edgeType":"calls","source":375,"target":349},{"edgeType":"calls","source":1902,"target":1900},{"edgeType":"calls","source":1448,"target":1440},{"edgeType":"calls","source":2624,"target":393},{"edgeType":"calls","source":2654,"target":784},{"edgeType":"calls","source":315,"target":359},{"edgeType":"contains","source":2479,"target":2512},{"edgeType":"contains","source":2190,"target":2221},{"edgeType":"contains","source":2612,"target":2617},{"edgeType":"calls","source":366,"target":364},{"edgeType":"calls","source":1597,"target":1577},{"edgeType":"contains","source":1496,"target":1538},{"edgeType":"contains","source":2190,"target":2222},{"edgeType":"calls","source":275,"target":278},{"edgeType":"contains","source":1487,"target":1553},{"edgeType":"contains","source":1917,"target":1964},{"edgeType":"contains","source":2526,"target":2640},{"edgeType":"calls","source":2398,"target":525},{"edgeType":"calls","source":2142,"target":269},{"edgeType":"contains","source":100,"target":158},{"edgeType":"contains","source":300,"target":301},{"edgeType":"calls","source":2097,"target":342},{"edgeType":"calls","source":685,"target":776},{"edgeType":"imports","source":1002,"target":1003},{"edgeType":"calls","source":1444,"target":501},{"edgeType":"contains","source":63,"target":513},{"edgeType":"calls","source":767,"target":348},{"edgeType":"contains","source":2190,"target":2227},{"edgeType":"calls","source":2710,"target":367},{"edgeType":"contains","source":354,"target":1533},{"edgeType":"calls","source":1547,"target":1536},{"edgeType":"calls","source":1340,"target":1347},{"edgeType":"calls","source":820,"target":819},{"edgeType":"calls","source":434,"target":365},{"edgeType":"calls","source":1096,"target":719},{"edgeType":"calls","source":2398,"target":526},{"edgeType":"contains","source":2,"target":24},{"edgeType":"calls","source":1497,"target":1500},{"edgeType":"calls","source":993,"target":1004},{"edgeType":"contains","source":2134,"target":2378},{"edgeType":"contains","source":100,"target":157},{"edgeType":"contains","source":272,"target":375},{"edgeType":"contains","source":2538,"target":2539},{"edgeType":"contains","source":354,"target":1532},{"edgeType":"contains","source":2426,"target":2575},{"edgeType":"contains","source":270,"target":965},{"edgeType":"calls","source":1096,"target":718},{"edgeType":"contains","source":1673,"target":1871},{"edgeType":"contains","source":327,"target":1844},{"edgeType":"contains","source":2612,"target":2620},{"edgeType":"calls","source":1854,"target":1535},{"edgeType":"calls","source":2142,"target":267},{"edgeType":"calls","source":2306,"target":2318},{"edgeType":"contains","source":2,"target":27},{"edgeType":"imports","source":2426,"target":461},{"edgeType":"contains","source":100,"target":160},{"edgeType":"calls","source":2398,"target":523},{"edgeType":"contains","source":1811,"target":1818},{"edgeType":"contains","source":2190,"target":2225},{"edgeType":"calls","source":1951,"target":1963},{"edgeType":"calls","source":2514,"target":363},{"edgeType":"calls","source":837,"target":294},{"edgeType":"contains","source":1487,"target":1556},{"edgeType":"contains","source":2426,"target":2572},{"edgeType":"contains","source":327,"target":1843},{"edgeType":"imports","source":1494,"target":1604},{"edgeType":"calls","source":2142,"target":268},{"edgeType":"contains","source":100,"target":159},{"edgeType":"contains","source":461,"target":596},{"edgeType":"contains","source":354,"target":1534},{"edgeType":"contains","source":77,"target":80},{"edgeType":"calls","source":1444,"target":502},{"edgeType":"contains","source":2190,"target":2226},{"edgeType":"calls","source":837,"target":293},{"edgeType":"calls","source":767,"target":349},{"edgeType":"calls","source":1497,"target":709},{"edgeType":"contains","source":1811,"target":1819},{"edgeType":"calls","source":1934,"target":1956},{"edgeType":"imports","source":1494,"target":1091},{"edgeType":"contains","source":338,"target":448},{"edgeType":"calls","source":1524,"target":396},{"edgeType":"calls","source":1525,"target":365},{"edgeType":"calls","source":1539,"target":988},{"edgeType":"contains","source":100,"target":162},{"edgeType":"calls","source":2131,"target":342},{"edgeType":"calls","source":2557,"target":349},{"edgeType":"calls","source":886,"target":883},{"edgeType":"calls","source":315,"target":350},{"edgeType":"calls","source":1992,"target":2007},{"edgeType":"contains","source":1580,"target":1586},{"edgeType":"contains","source":12,"target":2362},{"edgeType":"calls","source":1622,"target":1585},{"edgeType":"contains","source":87,"target":300},{"edgeType":"calls","source":1755,"target":369},{"edgeType":"calls","source":1524,"target":395},{"edgeType":"calls","source":792,"target":360},{"edgeType":"contains","source":2538,"target":2543},{"edgeType":"calls","source":1539,"target":987},{"edgeType":"calls","source":1559,"target":367},{"edgeType":"contains","source":1720,"target":1739},{"edgeType":"contains","source":1396,"target":1477},{"edgeType":"contains","source":100,"target":161},{"edgeType":"calls","source":2130,"target":374},{"edgeType":"contains","source":77,"target":82},{"edgeType":"contains","source":2426,"target":2579},{"edgeType":"calls","source":317,"target":287},{"edgeType":"contains","source":219,"target":436},{"edgeType":"calls","source":1508,"target":362},{"edgeType":"calls","source":1814,"target":389},{"edgeType":"calls","source":1934,"target":1954},{"edgeType":"contains","source":2612,"target":2624},{"edgeType":"calls","source":1605,"target":1322},{"edgeType":"calls","source":1524,"target":398},{"edgeType":"calls","source":1415,"target":1398},{"edgeType":"contains","source":100,"target":165},{"edgeType":"contains","source":219,"target":439},{"edgeType":"calls","source":2510,"target":2597},{"edgeType":"calls","source":1891,"target":1440},{"edgeType":"contains","source":2161,"target":2600},{"edgeType":"imports","source":1494,"target":1088},{"edgeType":"contains","source":647,"target":648},{"edgeType":"contains","source":1720,"target":1737},{"edgeType":"calls","source":1524,"target":397},{"edgeType":"contains","source":100,"target":163},{"edgeType":"contains","source":100,"target":164},{"edgeType":"calls","source":2557,"target":348},{"edgeType":"contains","source":616,"target":2401},{"edgeType":"calls","source":2689,"target":220},{"edgeType":"calls","source":2050,"target":2060},{"edgeType":"calls","source":886,"target":884},{"edgeType":"contains","source":2426,"target":2577},{"edgeType":"calls","source":1902,"target":1891},{"edgeType":"calls","source":1372,"target":1404},{"edgeType":"calls","source":2510,"target":2594},{"edgeType":"contains","source":2134,"target":2385},{"edgeType":"contains","source":2161,"target":2605},{"edgeType":"contains","source":1720,"target":1742},{"edgeType":"contains","source":36,"target":37},{"edgeType":"contains","source":219,"target":441},{"edgeType":"contains","source":100,"target":167},{"edgeType":"calls","source":1718,"target":1776},{"edgeType":"calls","source":1851,"target":1617},{"edgeType":"calls","source":2344,"target":342},{"edgeType":"calls","source":2510,"target":2595},{"edgeType":"contains","source":1396,"target":1481},{"edgeType":"calls","source":1538,"target":1542},{"edgeType":"calls","source":390,"target":398},{"edgeType":"contains","source":1720,"target":1743},{"edgeType":"contains","source":100,"target":166},{"edgeType":"contains","source":219,"target":440},{"edgeType":"calls","source":448,"target":450},{"edgeType":"contains","source":14,"target":2039},{"edgeType":"calls","source":2510,"target":2596},{"edgeType":"contains","source":2158,"target":2171},{"edgeType":"contains","source":1670,"target":1708},{"edgeType":"calls","source":1497,"target":1495},{"edgeType":"calls","source":2149,"target":570},{"edgeType":"contains","source":107,"target":2330},{"edgeType":"calls","source":2682,"target":167},{"edgeType":"contains","source":2287,"target":2397},{"edgeType":"calls","source":2510,"target":2592},{"edgeType":"contains","source":1496,"target":1813},{"edgeType":"calls","source":1524,"target":394},{"edgeType":"contains","source":7,"target":673},{"edgeType":"calls","source":2611,"target":2632},{"edgeType":"calls","source":1539,"target":986},{"edgeType":"calls","source":2330,"target":1830},{"edgeType":"calls","source":792,"target":359},{"edgeType":"contains","source":2134,"target":2383},{"edgeType":"contains","source":1720,"target":1740},{"edgeType":"contains","source":1396,"target":1478},{"edgeType":"contains","source":2,"target":36},{"edgeType":"calls","source":317,"target":286},{"edgeType":"contains","source":354,"target":2336},{"edgeType":"calls","source":1761,"target":1767},{"edgeType":"contains","source":100,"target":169},{"edgeType":"contains","source":69,"target":73},{"edgeType":"calls","source":1524,"target":393},{"edgeType":"contains","source":327,"target":1852},{"edgeType":"contains","source":461,"target":605},{"edgeType":"calls","source":1814,"target":388},{"edgeType":"calls","source":2510,"target":2593},{"edgeType":"contains","source":1373,"target":1399},{"edgeType":"contains","source":76,"target":647},{"edgeType":"contains","source":2,"target":827},{"edgeType":"calls","source":2682,"target":168},{"edgeType":"calls","source":1814,"target":387},{"edgeType":"contains","source":100,"target":168},{"edgeType":"contains","source":70,"target":1362},{"edgeType":"calls","source":1934,"target":1952},{"edgeType":"calls","source":2521,"target":2517}],"nodes":[{"groupName":"","id":2,"nodeType":"Repo","repoName":"pallets#flask#4c288bc97ea371817199908d0d9b12de9dae327e"},{"id":5,"name":"docs","nodeType":"Package"},{"id":7,"name":"docs","nodeType":"Package"},{"id":9,"name":"views.rst","nodeType":"TextFile","path":"docs","text":"Class-based Views\n=================\n\n.. currentmodule:: flask.views\n\nThis page introduces using the :class:`View` and :class:`MethodView`\nclasses to write class-based views.\n\nA class-based view is a class that acts as a view function. Because it\nis a class, different instances of the class can be created with\ndifferent arguments, to change the behavior of the view. This is also\nknown as generic, reusable, or pluggable views.\n\nAn example of where this is useful is defining a class that creates an\nAPI based on the database model it is initialized with.\n\nFor more complex API behavior and customization, look into the various\nAPI extensions for Flask.\n\n\nBasic Reusable View\n-------------------\n\nLet's walk through an example converting a view function to a view\nclass. We start with a view function that queries a list of users then\nrenders a template to show the list.\n\n.. code-block:: python\n\n @app.route(\"/users/\")\n def user_list():\n users = User.query.all()\n return render_template(\"users.html\", users=users)\n\nThis works for the user model, but let's say you also had more models\nthat needed list pages. You'd need to write another view function for\neach model, even though the only thing that would change is the model\nand template name.\n\nInstead, you can write a :class:`View` subclass that will query a model\nand render a template. As the first step, we'll convert the view to a\nclass without any customization.\n\n.. code-block:: python\n\n from flask.views import View\n\n class UserList(View):\n def dispatch_request(self):\n users = User.query.all()\n return render_template(\"users.html\", objects=users)\n\n app.add_url_rule(\"/users/\", view_func=UserList.as_view(\"user_list\"))\n\nThe :meth:`View.dispatch_request` method is the equivalent of the view\nfunction. Calling :meth:`View.as_view` method will create a view\nfunction that can be registered on the app with its\n:meth:`~flask.Flask.add_url_rule` method. The first argument to\n``as_view`` is the name to use to refer to the view with\n:func:`~flask.url_for`.\n\n.. note::\n\n You can't decorate the class with ``@app.route()`` the way you'd\n do with a basic view function.\n\nNext, we need to be able to register the same view class for different\nmodels and templates, to make it more useful than the original function.\nThe class will take two arguments, the model and template, and store\nthem on ``self``. Then ``dispatch_request`` can reference these instead\nof hard-coded values.\n\n.. code-block:: python\n\n class ListView(View):\n def __init__(self, model, template):\n self.model = model\n self.template = template\n\n def dispatch_request(self):\n items = self.model.query.all()\n return render_template(self.template, items=items)\n\nRemember, we create the view function with ``View.as_view()`` instead of\ncreating the class directly. Any extra arguments passed to ``as_view``\nare then passed when creating the class. Now we can register the same\nview to handle multiple models.\n\n.. code-block:: python\n\n app.add_url_rule(\n \"/users/\",\n view_func=ListView.as_view(\"user_list\", User, \"users.html\"),\n )\n app.add_url_rule(\n \"/stories/\",\n view_func=ListView.as_view(\"story_list\", Story, \"stories.html\"),\n )\n\n\nURL Variables\n-------------\n\nAny variables captured by the URL are passed as keyword arguments to the\n``dispatch_request`` method, as they would be for a regular view\nfunction.\n\n.. code-block:: python\n\n class DetailView(View):\n def __init__(self, model):\n self.model = model\n self.template = f\"{model.__name__.lower()}/detail.html\"\n\n def dispatch_request(self, id)\n item = self.model.query.get_or_404(id)\n return render_template(self.template, item=item)\n\n app.add_url_rule(\n \"/users/\",\n view_func=DetailView.as_view(\"user_detail\", User)\n )\n\n\nView Lifetime and ``self``\n--------------------------\n\nBy default, a new instance of the view class is created every time a\nrequest is handled. This means that it is safe to write other data to\n``self`` during the request, since the next request will not see it,\nunlike other forms of global state.\n\nHowever, if your view class needs to do a lot of complex initialization,\ndoing it for every request is unnecessary and can be inefficient. To\navoid this, set :attr:`View.init_every_request` to ``False``, which will\nonly create one instance of the class and use it for every request. In\nthis case, writing to ``self`` is not safe. If you need to store data\nduring the request, use :data:`~flask.g` instead.\n\nIn the ``ListView`` example, nothing writes to ``self`` during the\nrequest, so it is more efficient to create a single instance.\n\n.. code-block:: python\n\n class ListView(View):\n init_every_request = False\n\n def __init__(self, model, template):\n self.model = model\n self.template = template\n\n def dispatch_request(self):\n items = self.model.query.all()\n return render_template(self.template, items=items)\n\nDifferent instances will still be created each for each ``as_view``\ncall, but not for each request to those views.\n\n\nView Decorators\n---------------\n\nThe view class itself is not the view function. View decorators need to\nbe applied to the view function returned by ``as_view``, not the class\nitself. Set :attr:`View.decorators` to a list of decorators to apply.\n\n.. code-block:: python\n\n class UserList(View):\n decorators = [cache(minutes=2), login_required]\n\n app.add_url_rule('/users/', view_func=UserList.as_view())\n\nIf you didn't set ``decorators``, you could apply them manually instead.\nThis is equivalent to:\n\n.. code-block:: python\n\n view = UserList.as_view(\"users_list\")\n view = cache(minutes=2)(view)\n view = login_required(view)\n app.add_url_rule('/users/', view_func=view)\n\nKeep in mind that order matters. If you're used to ``@decorator`` style,\nthis is equivalent to:\n\n.. code-block:: python\n\n @app.route(\"/users/\")\n @login_required\n @cache(minutes=2)\n def user_list():\n ...\n\n\nMethod Hints\n------------\n\nA common pattern is to register a view with ``methods=[\"GET\", \"POST\"]``,\nthen check ``request.method == \"POST\"`` to decide what to do. Setting\n:attr:`View.methods` is equivalent to passing the list of methods to\n``add_url_rule`` or ``route``.\n\n.. code-block:: python\n\n class MyView(View):\n methods = [\"GET\", \"POST\"]\n\n def dispatch_request(self):\n if request.method == \"POST\":\n ...\n ...\n\n app.add_url_rule('/my-view', view_func=MyView.as_view('my-view'))\n\nThis is equivalent to the following, except further subclasses can\ninherit or change the methods.\n\n.. code-block:: python\n\n app.add_url_rule(\n \"/my-view\",\n view_func=MyView.as_view(\"my-view\"),\n methods=[\"GET\", \"POST\"],\n )\n\n\nMethod Dispatching and APIs\n---------------------------\n\nFor APIs it can be helpful to use a different function for each HTTP\nmethod. :class:`MethodView` extends the basic :class:`View` to dispatch\nto different methods of the class based on the request method. Each HTTP\nmethod maps to a method of the class with the same (lowercase) name.\n\n:class:`MethodView` automatically sets :attr:`View.methods` based on the\nmethods defined by the class. It even knows how to handle subclasses\nthat override or define other methods.\n\nWe can make a generic ``ItemAPI`` class that provides get (detail),\npatch (edit), and delete methods for a given model. A ``GroupAPI`` can\nprovide get (list) and post (create) methods.\n\n.. code-block:: python\n\n from flask.views import MethodView\n\n class ItemAPI(MethodView):\n init_every_request = False\n\n def __init__(self, model):\n self.model = model\n self.validator = generate_validator(model)\n\n def _get_item(self, id):\n return self.model.query.get_or_404(id)\n\n def get(self, id):\n item = self._get_item(id)\n return jsonify(item.to_json())\n\n def patch(self, id):\n item = self._get_item(id)\n errors = self.validator.validate(item, request.json)\n\n if errors:\n return jsonify(errors), 400\n\n item.update_from_json(request.json)\n db.session.commit()\n return jsonify(item.to_json())\n\n def delete(self, id):\n item = self._get_item(id)\n db.session.delete(item)\n db.session.commit()\n return \"\", 204\n\n class GroupAPI(MethodView):\n init_every_request = False\n\n def __init__(self, model):\n self.model = model\n self.validator = generate_validator(model, create=True)\n\n def get(self):\n items = self.model.query.all()\n return jsonify([item.to_json() for item in items])\n\n def post(self):\n errors = self.validator.validate(request.json)\n\n if errors:\n return jsonify(errors), 400\n\n db.session.add(self.model.from_json(request.json))\n db.session.commit()\n return jsonify(item.to_json())\n\n def register_api(app, model, name):\n item = ItemAPI.as_view(f\"{name}-item\", model)\n group = GroupAPI.as_view(f\"{name}-group\", model)\n app.add_url_rule(f\"/{name}/\", view_func=item)\n app.add_url_rule(f\"/{name}/\", view_func=group)\n\n register_api(app, User, \"users\")\n register_api(app, Story, \"stories\")\n\nThis produces the following views, a standard REST API!\n\n================= ========== ===================\nURL Method Description\n----------------- ---------- -------------------\n``/users/`` ``GET`` List all users\n``/users/`` ``POST`` Create a new user\n``/users/`` ``GET`` Show a single user\n``/users/`` ``PATCH`` Update a user\n``/users/`` ``DELETE`` Delete a user\n``/stories/`` ``GET`` List all stories\n``/stories/`` ``POST`` Create a new story\n``/stories/`` ``GET`` Show a single story\n``/stories/`` ``PATCH`` Update a story\n``/stories/`` ``DELETE`` Delete a story\n================= ========== ===================\n"},{"id":10,"name":"logging.rst","nodeType":"TextFile","path":"docs","text":"Logging\n=======\n\nFlask uses standard Python :mod:`logging`. Messages about your Flask\napplication are logged with :meth:`app.logger `,\nwhich takes the same name as :attr:`app.name `. This\nlogger can also be used to log your own messages.\n\n.. code-block:: python\n\n @app.route('/login', methods=['POST'])\n def login():\n user = get_user(request.form['username'])\n\n if user.check_password(request.form['password']):\n login_user(user)\n app.logger.info('%s logged in successfully', user.username)\n return redirect(url_for('index'))\n else:\n app.logger.info('%s failed to log in', user.username)\n abort(401)\n\nIf you don't configure logging, Python's default log level is usually\n'warning'. Nothing below the configured level will be visible.\n\n\nBasic Configuration\n-------------------\n\nWhen you want to configure logging for your project, you should do it as soon\nas possible when the program starts. If :meth:`app.logger `\nis accessed before logging is configured, it will add a default handler. If\npossible, configure logging before creating the application object.\n\nThis example uses :func:`~logging.config.dictConfig` to create a logging\nconfiguration similar to Flask's default, except for all logs::\n\n from logging.config import dictConfig\n\n dictConfig({\n 'version': 1,\n 'formatters': {'default': {\n 'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s',\n }},\n 'handlers': {'wsgi': {\n 'class': 'logging.StreamHandler',\n 'stream': 'ext://flask.logging.wsgi_errors_stream',\n 'formatter': 'default'\n }},\n 'root': {\n 'level': 'INFO',\n 'handlers': ['wsgi']\n }\n })\n\n app = Flask(__name__)\n\n\nDefault Configuration\n`````````````````````\n\nIf you do not configure logging yourself, Flask will add a\n:class:`~logging.StreamHandler` to :meth:`app.logger `\nautomatically. During requests, it will write to the stream specified by the\nWSGI server in ``environ['wsgi.errors']`` (which is usually\n:data:`sys.stderr`). Outside a request, it will log to :data:`sys.stderr`.\n\n\nRemoving the Default Handler\n````````````````````````````\n\nIf you configured logging after accessing\n:meth:`app.logger `, and need to remove the default\nhandler, you can import and remove it::\n\n from flask.logging import default_handler\n\n app.logger.removeHandler(default_handler)\n\n\nEmail Errors to Admins\n----------------------\n\nWhen running the application on a remote server for production, you probably\nwon't be looking at the log messages very often. The WSGI server will probably\nsend log messages to a file, and you'll only check that file if a user tells\nyou something went wrong.\n\nTo be proactive about discovering and fixing bugs, you can configure a\n:class:`logging.handlers.SMTPHandler` to send an email when errors and higher\nare logged. ::\n\n import logging\n from logging.handlers import SMTPHandler\n\n mail_handler = SMTPHandler(\n mailhost='127.0.0.1',\n fromaddr='server-error@example.com',\n toaddrs=['admin@example.com'],\n subject='Application Error'\n )\n mail_handler.setLevel(logging.ERROR)\n mail_handler.setFormatter(logging.Formatter(\n '[%(asctime)s] %(levelname)s in %(module)s: %(message)s'\n ))\n\n if not app.debug:\n app.logger.addHandler(mail_handler)\n\nThis requires that you have an SMTP server set up on the same server. See the\nPython docs for more information about configuring the handler.\n\n\nInjecting Request Information\n-----------------------------\n\nSeeing more information about the request, such as the IP address, may help\ndebugging some errors. You can subclass :class:`logging.Formatter` to inject\nyour own fields that can be used in messages. You can change the formatter for\nFlask's default handler, the mail handler defined above, or any other\nhandler. ::\n\n from flask import has_request_context, request\n from flask.logging import default_handler\n\n class RequestFormatter(logging.Formatter):\n def format(self, record):\n if has_request_context():\n record.url = request.url\n record.remote_addr = request.remote_addr\n else:\n record.url = None\n record.remote_addr = None\n\n return super().format(record)\n\n formatter = RequestFormatter(\n '[%(asctime)s] %(remote_addr)s requested %(url)s\\n'\n '%(levelname)s in %(module)s: %(message)s'\n )\n default_handler.setFormatter(formatter)\n mail_handler.setFormatter(formatter)\n\n\nOther Libraries\n---------------\n\nOther libraries may use logging extensively, and you want to see relevant\nmessages from those logs too. The simplest way to do this is to add handlers\nto the root logger instead of only the app logger. ::\n\n from flask.logging import default_handler\n\n root = logging.getLogger()\n root.addHandler(default_handler)\n root.addHandler(mail_handler)\n\nDepending on your project, it may be more useful to configure each logger you\ncare about separately, instead of configuring only the root logger. ::\n\n for logger in (\n app.logger,\n logging.getLogger('sqlalchemy'),\n logging.getLogger('other_package'),\n ):\n logger.addHandler(default_handler)\n logger.addHandler(mail_handler)\n\n\nWerkzeug\n````````\n\nWerkzeug logs basic request/response information to the ``'werkzeug'`` logger.\nIf the root logger has no handlers configured, Werkzeug adds a\n:class:`~logging.StreamHandler` to its logger.\n\n\nFlask Extensions\n````````````````\n\nDepending on the situation, an extension may choose to log to\n:meth:`app.logger ` or its own named logger. Consult each\nextension's documentation for details.\n"},{"id":12,"name":"tests/test_apps/cliapp","nodeType":"Package"},{"id":13,"name":"message.txt","nodeType":"TextFile","path":"tests/test_apps/cliapp","text":"So long, and thanks for all the fish.\n"},{"id":14,"name":"docs/patterns","nodeType":"Package"},{"id":15,"name":"packages.rst","nodeType":"TextFile","path":"docs/patterns","text":"Large Applications as Packages\n==============================\n\nImagine a simple flask application structure that looks like this::\n\n /yourapplication\n yourapplication.py\n /static\n style.css\n /templates\n layout.html\n index.html\n login.html\n ...\n\nWhile this is fine for small applications, for larger applications\nit's a good idea to use a package instead of a module.\nThe :doc:`/tutorial/index` is structured to use the package pattern,\nsee the :gh:`example code `.\n\nSimple Packages\n---------------\n\nTo convert that into a larger one, just create a new folder\n:file:`yourapplication` inside the existing one and move everything below it.\nThen rename :file:`yourapplication.py` to :file:`__init__.py`. (Make sure to delete\nall ``.pyc`` files first, otherwise things would most likely break)\n\nYou should then end up with something like that::\n\n /yourapplication\n /yourapplication\n __init__.py\n /static\n style.css\n /templates\n layout.html\n index.html\n login.html\n ...\n\nBut how do you run your application now? The naive ``python\nyourapplication/__init__.py`` will not work. Let's just say that Python\ndoes not want modules in packages to be the startup file. But that is not\na big problem, just add a new file called :file:`pyproject.toml` next to the inner\n:file:`yourapplication` folder with the following contents:\n\n.. code-block:: toml\n\n [project]\n name = \"yourapplication\"\n dependencies = [\n \"flask\",\n ]\n\n [build-system]\n requires = [\"setuptools\"]\n build-backend = \"setuptools.build_meta\"\n\nInstall your application so it is importable:\n\n.. code-block:: text\n\n $ pip install -e .\n\nTo use the ``flask`` command and run your application you need to set\nthe ``--app`` option that tells Flask where to find the application\ninstance:\n\n.. code-block:: text\n\n $ flask --app yourapplication run\n\nWhat did we gain from this? Now we can restructure the application a bit\ninto multiple modules. The only thing you have to remember is the\nfollowing quick checklist:\n\n1. the `Flask` application object creation has to be in the\n :file:`__init__.py` file. That way each module can import it safely and the\n `__name__` variable will resolve to the correct package.\n2. all the view functions (the ones with a :meth:`~flask.Flask.route`\n decorator on top) have to be imported in the :file:`__init__.py` file.\n Not the object itself, but the module it is in. Import the view module\n **after the application object is created**.\n\nHere's an example :file:`__init__.py`::\n\n from flask import Flask\n app = Flask(__name__)\n\n import yourapplication.views\n\nAnd this is what :file:`views.py` would look like::\n\n from yourapplication import app\n\n @app.route('/')\n def index():\n return 'Hello World!'\n\nYou should then end up with something like that::\n\n /yourapplication\n pyproject.toml\n /yourapplication\n __init__.py\n views.py\n /static\n style.css\n /templates\n layout.html\n index.html\n login.html\n ...\n\n.. admonition:: Circular Imports\n\n Every Python programmer hates them, and yet we just added some:\n circular imports (That's when two modules depend on each other. In this\n case :file:`views.py` depends on :file:`__init__.py`). Be advised that this is a\n bad idea in general but here it is actually fine. The reason for this is\n that we are not actually using the views in :file:`__init__.py` and just\n ensuring the module is imported and we are doing that at the bottom of\n the file.\n\n\nWorking with Blueprints\n-----------------------\n\nIf you have larger applications it's recommended to divide them into\nsmaller groups where each group is implemented with the help of a\nblueprint. For a gentle introduction into this topic refer to the\n:doc:`/blueprints` chapter of the documentation.\n"},{"id":16,"name":"examples/javascript/js_example/templates","nodeType":"Package"},{"id":17,"name":"xhr.html","nodeType":"TextFile","path":"examples/javascript/js_example/templates","text":"{% extends 'base.html' %}\n\n{% block intro %}\n XMLHttpRequest\n is the original JavaScript way to make requests. It's natively supported\n by all browsers, but has been superseded by\n fetch.\n{% endblock %}\n\n{% block script %}\n \n{% endblock %}\n"},{"id":18,"name":"methodoverrides.rst","nodeType":"TextFile","path":"docs/patterns","text":"Adding HTTP Method Overrides\n============================\n\nSome HTTP proxies do not support arbitrary HTTP methods or newer HTTP\nmethods (such as PATCH). In that case it's possible to \"proxy\" HTTP\nmethods through another HTTP method in total violation of the protocol.\n\nThe way this works is by letting the client do an HTTP POST request and\nset the ``X-HTTP-Method-Override`` header. Then the method is replaced\nwith the header value before being passed to Flask.\n\nThis can be accomplished with an HTTP middleware::\n\n class HTTPMethodOverrideMiddleware(object):\n allowed_methods = frozenset([\n 'GET',\n 'HEAD',\n 'POST',\n 'DELETE',\n 'PUT',\n 'PATCH',\n 'OPTIONS'\n ])\n bodyless_methods = frozenset(['GET', 'HEAD', 'OPTIONS', 'DELETE'])\n\n def __init__(self, app):\n self.app = app\n\n def __call__(self, environ, start_response):\n method = environ.get('HTTP_X_HTTP_METHOD_OVERRIDE', '').upper()\n if method in self.allowed_methods:\n environ['REQUEST_METHOD'] = method\n if method in self.bodyless_methods:\n environ['CONTENT_LENGTH'] = '0'\n return self.app(environ, start_response)\n\nTo use this with Flask, wrap the app object with the middleware::\n\n from flask import Flask\n\n app = Flask(__name__)\n app.wsgi_app = HTTPMethodOverrideMiddleware(app.wsgi_app)\n"},{"id":19,"name":"examples/javascript/js_example","nodeType":"Package"},{"id":20,"name":"base.html","nodeType":"TextFile","path":"examples/javascript/js_example/templates","text":"\nJavaScript Example\n\n\n\n\n
\n

{% block intro %}{% endblock %}

\n
\n
\n \n +\n \n \n
\n= \n{% block script %}{% endblock %}\n"},{"fileName":"__init__.py","filePath":"examples/javascript/js_example","id":21,"nodeType":"File","text":"from flask import Flask\n\napp = Flask(__name__)\n\nfrom js_example import views # noqa: E402, F401\n"},{"id":22,"name":"docs/tutorial","nodeType":"Package"},{"id":23,"name":"database.rst","nodeType":"TextFile","path":"docs/tutorial","text":".. currentmodule:: flask\n\nDefine and Access the Database\n==============================\n\nThe application will use a `SQLite`_ database to store users and posts.\nPython comes with built-in support for SQLite in the :mod:`sqlite3`\nmodule.\n\nSQLite is convenient because it doesn't require setting up a separate\ndatabase server and is built-in to Python. However, if concurrent\nrequests try to write to the database at the same time, they will slow\ndown as each write happens sequentially. Small applications won't notice\nthis. Once you become big, you may want to switch to a different\ndatabase.\n\nThe tutorial doesn't go into detail about SQL. If you are not familiar\nwith it, the SQLite docs describe the `language`_.\n\n.. _SQLite: https://sqlite.org/about.html\n.. _language: https://sqlite.org/lang.html\n\n\nConnect to the Database\n-----------------------\n\nThe first thing to do when working with a SQLite database (and most\nother Python database libraries) is to create a connection to it. Any\nqueries and operations are performed using the connection, which is\nclosed after the work is finished.\n\nIn web applications this connection is typically tied to the request. It\nis created at some point when handling a request, and closed before the\nresponse is sent.\n\n.. code-block:: python\n :caption: ``flaskr/db.py``\n\n import sqlite3\n\n import click\n from flask import current_app, g\n\n\n def get_db():\n if 'db' not in g:\n g.db = sqlite3.connect(\n current_app.config['DATABASE'],\n detect_types=sqlite3.PARSE_DECLTYPES\n )\n g.db.row_factory = sqlite3.Row\n\n return g.db\n\n\n def close_db(e=None):\n db = g.pop('db', None)\n\n if db is not None:\n db.close()\n\n:data:`g` is a special object that is unique for each request. It is\nused to store data that might be accessed by multiple functions during\nthe request. The connection is stored and reused instead of creating a\nnew connection if ``get_db`` is called a second time in the same\nrequest.\n\n:data:`current_app` is another special object that points to the Flask\napplication handling the request. Since you used an application factory,\nthere is no application object when writing the rest of your code.\n``get_db`` will be called when the application has been created and is\nhandling a request, so :data:`current_app` can be used.\n\n:func:`sqlite3.connect` establishes a connection to the file pointed at\nby the ``DATABASE`` configuration key. This file doesn't have to exist\nyet, and won't until you initialize the database later.\n\n:class:`sqlite3.Row` tells the connection to return rows that behave\nlike dicts. This allows accessing the columns by name.\n\n``close_db`` checks if a connection was created by checking if ``g.db``\nwas set. If the connection exists, it is closed. Further down you will\ntell your application about the ``close_db`` function in the application\nfactory so that it is called after each request.\n\n\nCreate the Tables\n-----------------\n\nIn SQLite, data is stored in *tables* and *columns*. These need to be\ncreated before you can store and retrieve data. Flaskr will store users\nin the ``user`` table, and posts in the ``post`` table. Create a file\nwith the SQL commands needed to create empty tables:\n\n.. code-block:: sql\n :caption: ``flaskr/schema.sql``\n\n DROP TABLE IF EXISTS user;\n DROP TABLE IF EXISTS post;\n\n CREATE TABLE user (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n username TEXT UNIQUE NOT NULL,\n password TEXT NOT NULL\n );\n\n CREATE TABLE post (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n author_id INTEGER NOT NULL,\n created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n title TEXT NOT NULL,\n body TEXT NOT NULL,\n FOREIGN KEY (author_id) REFERENCES user (id)\n );\n\nAdd the Python functions that will run these SQL commands to the\n``db.py`` file:\n\n.. code-block:: python\n :caption: ``flaskr/db.py``\n\n def init_db():\n db = get_db()\n\n with current_app.open_resource('schema.sql') as f:\n db.executescript(f.read().decode('utf8'))\n\n\n @click.command('init-db')\n def init_db_command():\n \"\"\"Clear the existing data and create new tables.\"\"\"\n init_db()\n click.echo('Initialized the database.')\n\n:meth:`open_resource() ` opens a file relative to\nthe ``flaskr`` package, which is useful since you won't necessarily know\nwhere that location is when deploying the application later. ``get_db``\nreturns a database connection, which is used to execute the commands\nread from the file.\n\n:func:`click.command` defines a command line command called ``init-db``\nthat calls the ``init_db`` function and shows a success message to the\nuser. You can read :doc:`/cli` to learn more about writing commands.\n\n\nRegister with the Application\n-----------------------------\n\nThe ``close_db`` and ``init_db_command`` functions need to be registered\nwith the application instance; otherwise, they won't be used by the\napplication. However, since you're using a factory function, that\ninstance isn't available when writing the functions. Instead, write a\nfunction that takes an application and does the registration.\n\n.. code-block:: python\n :caption: ``flaskr/db.py``\n\n def init_app(app):\n app.teardown_appcontext(close_db)\n app.cli.add_command(init_db_command)\n\n:meth:`app.teardown_appcontext() ` tells\nFlask to call that function when cleaning up after returning the\nresponse.\n\n:meth:`app.cli.add_command() ` adds a new\ncommand that can be called with the ``flask`` command.\n\nImport and call this function from the factory. Place the new code at\nthe end of the factory function before returning the app.\n\n.. code-block:: python\n :caption: ``flaskr/__init__.py``\n\n def create_app():\n app = ...\n # existing code omitted\n\n from . import db\n db.init_app(app)\n\n return app\n\n\nInitialize the Database File\n----------------------------\n\nNow that ``init-db`` has been registered with the app, it can be called\nusing the ``flask`` command, similar to the ``run`` command from the\nprevious page.\n\n.. note::\n\n If you're still running the server from the previous page, you can\n either stop the server, or run this command in a new terminal. If\n you use a new terminal, remember to change to your project directory\n and activate the env as described in :doc:`/installation`.\n\nRun the ``init-db`` command:\n\n.. code-block:: none\n\n $ flask --app flaskr init-db\n Initialized the database.\n\nThere will now be a ``flaskr.sqlite`` file in the ``instance`` folder in\nyour project.\n\nContinue to :doc:`views`.\n"},{"id":24,"name":"examples/tutorial/tests","nodeType":"Package"},{"id":25,"name":"data.sql","nodeType":"TextFile","path":"examples/tutorial/tests","text":"INSERT INTO user (username, password)\nVALUES\n ('test', 'pbkdf2:sha256:50000$TCI4GzcX$0de171a4f4dac32e3364c7ddc7c14f3e2fa61f2d17574483f7ffbb431b4acb2f'),\n ('other', 'pbkdf2:sha256:50000$kJPKsz6N$d2d4784f1b030a9761f5ccaeeaca413f27f2ecb76d6168407af962ddce849f79');\n\nINSERT INTO post (title, body, author_id, created)\nVALUES\n ('test title', 'test' || x'0a' || 'body', 1, '2018-01-01 00:00:00');\n"},{"id":26,"name":"sqlalchemy.rst","nodeType":"TextFile","path":"docs/patterns","text":"SQLAlchemy in Flask\n===================\n\nMany people prefer `SQLAlchemy`_ for database access. In this case it's\nencouraged to use a package instead of a module for your flask application\nand drop the models into a separate module (:doc:`packages`). While that\nis not necessary, it makes a lot of sense.\n\nThere are four very common ways to use SQLAlchemy. I will outline each\nof them here:\n\nFlask-SQLAlchemy Extension\n--------------------------\n\nBecause SQLAlchemy is a common database abstraction layer and object\nrelational mapper that requires a little bit of configuration effort,\nthere is a Flask extension that handles that for you. This is recommended\nif you want to get started quickly.\n\nYou can download `Flask-SQLAlchemy`_ from `PyPI\n`_.\n\n.. _Flask-SQLAlchemy: https://flask-sqlalchemy.palletsprojects.com/\n\n\nDeclarative\n-----------\n\nThe declarative extension in SQLAlchemy is the most recent method of using\nSQLAlchemy. It allows you to define tables and models in one go, similar\nto how Django works. In addition to the following text I recommend the\nofficial documentation on the `declarative`_ extension.\n\nHere's the example :file:`database.py` module for your application::\n\n from sqlalchemy import create_engine\n from sqlalchemy.orm import scoped_session, sessionmaker\n from sqlalchemy.ext.declarative import declarative_base\n\n engine = create_engine('sqlite:////tmp/test.db')\n db_session = scoped_session(sessionmaker(autocommit=False,\n autoflush=False,\n bind=engine))\n Base = declarative_base()\n Base.query = db_session.query_property()\n\n def init_db():\n # import all modules here that might define models so that\n # they will be registered properly on the metadata. Otherwise\n # you will have to import them first before calling init_db()\n import yourapplication.models\n Base.metadata.create_all(bind=engine)\n\nTo define your models, just subclass the `Base` class that was created by\nthe code above. If you are wondering why we don't have to care about\nthreads here (like we did in the SQLite3 example above with the\n:data:`~flask.g` object): that's because SQLAlchemy does that for us\nalready with the :class:`~sqlalchemy.orm.scoped_session`.\n\nTo use SQLAlchemy in a declarative way with your application, you just\nhave to put the following code into your application module. Flask will\nautomatically remove database sessions at the end of the request or\nwhen the application shuts down::\n\n from yourapplication.database import db_session\n\n @app.teardown_appcontext\n def shutdown_session(exception=None):\n db_session.remove()\n\nHere is an example model (put this into :file:`models.py`, e.g.)::\n\n from sqlalchemy import Column, Integer, String\n from yourapplication.database import Base\n\n class User(Base):\n __tablename__ = 'users'\n id = Column(Integer, primary_key=True)\n name = Column(String(50), unique=True)\n email = Column(String(120), unique=True)\n\n def __init__(self, name=None, email=None):\n self.name = name\n self.email = email\n\n def __repr__(self):\n return f''\n\nTo create the database you can use the `init_db` function:\n\n>>> from yourapplication.database import init_db\n>>> init_db()\n\nYou can insert entries into the database like this:\n\n>>> from yourapplication.database import db_session\n>>> from yourapplication.models import User\n>>> u = User('admin', 'admin@localhost')\n>>> db_session.add(u)\n>>> db_session.commit()\n\nQuerying is simple as well:\n\n>>> User.query.all()\n[]\n>>> User.query.filter(User.name == 'admin').first()\n\n\n.. _SQLAlchemy: https://www.sqlalchemy.org/\n.. _declarative: https://docs.sqlalchemy.org/en/latest/orm/extensions/declarative/\n\nManual Object Relational Mapping\n--------------------------------\n\nManual object relational mapping has a few upsides and a few downsides\nversus the declarative approach from above. The main difference is that\nyou define tables and classes separately and map them together. It's more\nflexible but a little more to type. In general it works like the\ndeclarative approach, so make sure to also split up your application into\nmultiple modules in a package.\n\nHere is an example :file:`database.py` module for your application::\n\n from sqlalchemy import create_engine, MetaData\n from sqlalchemy.orm import scoped_session, sessionmaker\n\n engine = create_engine('sqlite:////tmp/test.db')\n metadata = MetaData()\n db_session = scoped_session(sessionmaker(autocommit=False,\n autoflush=False,\n bind=engine))\n def init_db():\n metadata.create_all(bind=engine)\n\nAs in the declarative approach, you need to close the session after\neach request or application context shutdown. Put this into your\napplication module::\n\n from yourapplication.database import db_session\n\n @app.teardown_appcontext\n def shutdown_session(exception=None):\n db_session.remove()\n\nHere is an example table and model (put this into :file:`models.py`)::\n\n from sqlalchemy import Table, Column, Integer, String\n from sqlalchemy.orm import mapper\n from yourapplication.database import metadata, db_session\n\n class User(object):\n query = db_session.query_property()\n\n def __init__(self, name=None, email=None):\n self.name = name\n self.email = email\n\n def __repr__(self):\n return f''\n\n users = Table('users', metadata,\n Column('id', Integer, primary_key=True),\n Column('name', String(50), unique=True),\n Column('email', String(120), unique=True)\n )\n mapper(User, users)\n\nQuerying and inserting works exactly the same as in the example above.\n\n\nSQL Abstraction Layer\n---------------------\n\nIf you just want to use the database system (and SQL) abstraction layer\nyou basically only need the engine::\n\n from sqlalchemy import create_engine, MetaData, Table\n\n engine = create_engine('sqlite:////tmp/test.db')\n metadata = MetaData(bind=engine)\n\nThen you can either declare the tables in your code like in the examples\nabove, or automatically load them::\n\n from sqlalchemy import Table\n\n users = Table('users', metadata, autoload=True)\n\nTo insert data you can use the `insert` method. We have to get a\nconnection first so that we can use a transaction:\n\n>>> con = engine.connect()\n>>> con.execute(users.insert(), name='admin', email='admin@localhost')\n\nSQLAlchemy will automatically commit for us.\n\nTo query your database, you use the engine directly or use a connection:\n\n>>> users.select(users.c.id == 1).execute().first()\n(1, 'admin', 'admin@localhost')\n\nThese results are also dict-like tuples:\n\n>>> r = users.select(users.c.id == 1).execute().first()\n>>> r['name']\n'admin'\n\nYou can also pass strings of SQL statements to the\n:meth:`~sqlalchemy.engine.base.Connection.execute` method:\n\n>>> engine.execute('select * from users where id = :1', [1]).first()\n(1, 'admin', 'admin@localhost')\n\nFor more information about SQLAlchemy, head over to the\n`website `_.\n"},{"id":27,"name":".github/workflows","nodeType":"Package"},{"id":28,"name":"tests.yaml","nodeType":"TextFile","path":".github/workflows","text":"name: Tests\non:\n push:\n branches:\n - main\n - '*.x'\n paths-ignore:\n - 'docs/**'\n - '*.md'\n - '*.rst'\n pull_request:\n branches:\n - main\n - '*.x'\n paths-ignore:\n - 'docs/**'\n - '*.md'\n - '*.rst'\njobs:\n tests:\n name: ${{ matrix.name }}\n runs-on: ${{ matrix.os }}\n strategy:\n fail-fast: false\n matrix:\n include:\n - {name: Linux, python: '3.11', os: ubuntu-latest, tox: py311}\n - {name: Windows, python: '3.11', os: windows-latest, tox: py311}\n - {name: Mac, python: '3.11', os: macos-latest, tox: py311}\n - {name: '3.12-dev', python: '3.12-dev', os: ubuntu-latest, tox: py312}\n - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}\n - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}\n - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}\n - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}\n - {name: 'PyPy', python: 'pypy-3.9', os: ubuntu-latest, tox: pypy39}\n - {name: 'Pallets Minimum Versions', python: '3.11', os: ubuntu-latest, tox: py311-min}\n - {name: 'Pallets Development Versions', python: '3.7', os: ubuntu-latest, tox: py37-dev}\n - {name: Typing, python: '3.11', os: ubuntu-latest, tox: typing}\n steps:\n - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c\n - uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435\n with:\n python-version: ${{ matrix.python }}\n cache: 'pip'\n cache-dependency-path: 'requirements/*.txt'\n - name: update pip\n run: |\n pip install -U wheel\n pip install -U setuptools\n python -m pip install -U pip\n - name: cache mypy\n uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920\n with:\n path: ./.mypy_cache\n key: mypy|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}\n if: matrix.tox == 'typing'\n - run: pip install tox\n - run: tox run -e ${{ matrix.tox }}\n"},{"fileName":"test_factory.py","filePath":"examples/tutorial/tests","id":29,"nodeType":"File","text":"from flaskr import create_app\n\n\ndef test_config():\n \"\"\"Test create_app without passing test config.\"\"\"\n assert not create_app().testing\n assert create_app({\"TESTING\": True}).testing\n\n\ndef test_hello(client):\n response = client.get(\"/hello\")\n assert response.data == b\"Hello, World!\"\n"},{"attributeType":"null","col":0,"comment":"null","endLoc":3,"id":30,"name":"app","nodeType":"Attribute","startLoc":3,"text":"app"},{"col":0,"comment":"","endLoc":1,"header":"__init__.py#","id":31,"name":"","nodeType":"Function","startLoc":1,"text":"app = Flask(__name__)"},{"fileName":"multiapp.py","filePath":"tests/test_apps/cliapp","id":32,"nodeType":"File","text":"from flask import Flask\n\napp1 = Flask(\"app1\")\napp2 = Flask(\"app2\")\n"},{"attributeType":"null","col":0,"comment":"null","endLoc":3,"id":33,"name":"app1","nodeType":"Attribute","startLoc":3,"text":"app1"},{"attributeType":"null","col":0,"comment":"null","endLoc":4,"id":34,"name":"app2","nodeType":"Attribute","startLoc":4,"text":"app2"},{"col":0,"comment":"","endLoc":1,"header":"multiapp.py#","id":35,"name":"","nodeType":"Function","startLoc":1,"text":"app1 = Flask(\"app1\")\n\napp2 = Flask(\"app2\")"},{"id":36,"name":"examples/celery","nodeType":"Package"},{"fileName":"make_celery.py","filePath":"examples/celery","id":37,"nodeType":"File","text":"from task_app import create_app\n\nflask_app = create_app()\ncelery_app = flask_app.extensions[\"celery\"]\n"},{"attributeType":"null","col":0,"comment":"null","endLoc":3,"id":38,"name":"flask_app","nodeType":"Attribute","startLoc":3,"text":"flask_app"},{"attributeType":"null","col":0,"comment":"null","endLoc":4,"id":39,"name":"celery_app","nodeType":"Attribute","startLoc":4,"text":"celery_app"},{"col":0,"comment":"","endLoc":1,"header":"make_celery.py#","id":40,"name":"","nodeType":"Function","startLoc":1,"text":"flask_app = create_app()\n\ncelery_app = flask_app.extensions[\"celery\"]"},{"id":41,"name":"tests/test_apps/cliapp/inner1","nodeType":"Package"},{"fileName":"__init__.py","filePath":"tests/test_apps/cliapp/inner1","id":42,"nodeType":"File","text":"from flask import Flask\n\napplication = Flask(__name__)\n"},{"attributeType":"null","col":0,"comment":"null","endLoc":3,"id":43,"name":"application","nodeType":"Attribute","startLoc":3,"text":"application"},{"col":0,"comment":"","endLoc":1,"header":"__init__.py#","id":44,"name":"","nodeType":"Function","startLoc":1,"text":"application = Flask(__name__)"},{"id":45,"name":"fileuploads.rst","nodeType":"TextFile","path":"docs/patterns","text":"Uploading Files\n===============\n\nAh yes, the good old problem of file uploads. The basic idea of file\nuploads is actually quite simple. It basically works like this:\n\n1. A ``
`` tag is marked with ``enctype=multipart/form-data``\n and an ```` is placed in that form.\n2. The application accesses the file from the :attr:`~flask.request.files`\n dictionary on the request object.\n3. use the :meth:`~werkzeug.datastructures.FileStorage.save` method of the file to save\n the file permanently somewhere on the filesystem.\n\nA Gentle Introduction\n---------------------\n\nLet's start with a very basic application that uploads a file to a\nspecific upload folder and displays a file to the user. Let's look at the\nbootstrapping code for our application::\n\n import os\n from flask import Flask, flash, request, redirect, url_for\n from werkzeug.utils import secure_filename\n\n UPLOAD_FOLDER = '/path/to/the/uploads'\n ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}\n\n app = Flask(__name__)\n app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER\n\nSo first we need a couple of imports. Most should be straightforward, the\n:func:`werkzeug.secure_filename` is explained a little bit later. The\n``UPLOAD_FOLDER`` is where we will store the uploaded files and the\n``ALLOWED_EXTENSIONS`` is the set of allowed file extensions.\n\nWhy do we limit the extensions that are allowed? You probably don't want\nyour users to be able to upload everything there if the server is directly\nsending out the data to the client. That way you can make sure that users\nare not able to upload HTML files that would cause XSS problems (see\n:ref:`security-xss`). Also make sure to disallow ``.php`` files if the server\nexecutes them, but who has PHP installed on their server, right? :)\n\nNext the functions that check if an extension is valid and that uploads\nthe file and redirects the user to the URL for the uploaded file::\n\n def allowed_file(filename):\n return '.' in filename and \\\n filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS\n\n @app.route('/', methods=['GET', 'POST'])\n def upload_file():\n if request.method == 'POST':\n # check if the post request has the file part\n if 'file' not in request.files:\n flash('No file part')\n return redirect(request.url)\n file = request.files['file']\n # If the user does not select a file, the browser submits an\n # empty file without a filename.\n if file.filename == '':\n flash('No selected file')\n return redirect(request.url)\n if file and allowed_file(file.filename):\n filename = secure_filename(file.filename)\n file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))\n return redirect(url_for('download_file', name=filename))\n return '''\n \n Upload new File\n

Upload new File

\n \n \n \n
\n '''\n\nSo what does that :func:`~werkzeug.utils.secure_filename` function actually do?\nNow the problem is that there is that principle called \"never trust user\ninput\". This is also true for the filename of an uploaded file. All\nsubmitted form data can be forged, and filenames can be dangerous. For\nthe moment just remember: always use that function to secure a filename\nbefore storing it directly on the filesystem.\n\n.. admonition:: Information for the Pros\n\n So you're interested in what that :func:`~werkzeug.utils.secure_filename`\n function does and what the problem is if you're not using it? So just\n imagine someone would send the following information as `filename` to\n your application::\n\n filename = \"../../../../home/username/.bashrc\"\n\n Assuming the number of ``../`` is correct and you would join this with\n the ``UPLOAD_FOLDER`` the user might have the ability to modify a file on\n the server's filesystem he or she should not modify. This does require some\n knowledge about how the application looks like, but trust me, hackers\n are patient :)\n\n Now let's look how that function works:\n\n >>> secure_filename('../../../../home/username/.bashrc')\n 'home_username_.bashrc'\n\nWe want to be able to serve the uploaded files so they can be downloaded\nby users. We'll define a ``download_file`` view to serve files in the\nupload folder by name. ``url_for(\"download_file\", name=name)`` generates\ndownload URLs.\n\n.. code-block:: python\n\n from flask import send_from_directory\n\n @app.route('/uploads/')\n def download_file(name):\n return send_from_directory(app.config[\"UPLOAD_FOLDER\"], name)\n\nIf you're using middleware or the HTTP server to serve files, you can\nregister the ``download_file`` endpoint as ``build_only`` so ``url_for``\nwill work without a view function.\n\n.. code-block:: python\n\n app.add_url_rule(\n \"/uploads/\", endpoint=\"download_file\", build_only=True\n )\n\n\nImproving Uploads\n-----------------\n\n.. versionadded:: 0.6\n\nSo how exactly does Flask handle uploads? Well it will store them in the\nwebserver's memory if the files are reasonably small, otherwise in a\ntemporary location (as returned by :func:`tempfile.gettempdir`). But how\ndo you specify the maximum file size after which an upload is aborted? By\ndefault Flask will happily accept file uploads with an unlimited amount of\nmemory, but you can limit that by setting the ``MAX_CONTENT_LENGTH``\nconfig key::\n\n from flask import Flask, Request\n\n app = Flask(__name__)\n app.config['MAX_CONTENT_LENGTH'] = 16 * 1000 * 1000\n\nThe code above will limit the maximum allowed payload to 16 megabytes.\nIf a larger file is transmitted, Flask will raise a\n:exc:`~werkzeug.exceptions.RequestEntityTooLarge` exception.\n\n.. admonition:: Connection Reset Issue\n\n When using the local development server, you may get a connection\n reset error instead of a 413 response. You will get the correct\n status response when running the app with a production WSGI server.\n\nThis feature was added in Flask 0.6 but can be achieved in older versions\nas well by subclassing the request object. For more information on that\nconsult the Werkzeug documentation on file handling.\n\n\nUpload Progress Bars\n--------------------\n\nA while ago many developers had the idea to read the incoming file in\nsmall chunks and store the upload progress in the database to be able to\npoll the progress with JavaScript from the client. The client asks the\nserver every 5 seconds how much it has transmitted, but this is\nsomething it should already know.\n\nAn Easier Solution\n------------------\n\nNow there are better solutions that work faster and are more reliable. There\nare JavaScript libraries like jQuery_ that have form plugins to ease the\nconstruction of progress bar.\n\nBecause the common pattern for file uploads exists almost unchanged in all\napplications dealing with uploads, there are also some Flask extensions that\nimplement a full fledged upload mechanism that allows controlling which\nfile extensions are allowed to be uploaded.\n\n.. _jQuery: https://jquery.com/\n"},{"col":0,"comment":"Test create_app without passing test config.","endLoc":7,"header":"def test_config()","id":46,"name":"test_config","nodeType":"Function","startLoc":4,"text":"def test_config():\n \"\"\"Test create_app without passing test config.\"\"\"\n assert not create_app().testing\n assert create_app({\"TESTING\": True}).testing"},{"col":0,"comment":"null","endLoc":12,"header":"def test_hello(client)","id":47,"name":"test_hello","nodeType":"Function","startLoc":10,"text":"def test_hello(client):\n response = client.get(\"/hello\")\n assert response.data == b\"Hello, World!\""},{"id":48,"name":"config.rst","nodeType":"TextFile","path":"docs","text":"Configuration Handling\n======================\n\nApplications need some kind of configuration. There are different settings\nyou might want to change depending on the application environment like\ntoggling the debug mode, setting the secret key, and other such\nenvironment-specific things.\n\nThe way Flask is designed usually requires the configuration to be\navailable when the application starts up. You can hard code the\nconfiguration in the code, which for many small applications is not\nactually that bad, but there are better ways.\n\nIndependent of how you load your config, there is a config object\navailable which holds the loaded configuration values:\nThe :attr:`~flask.Flask.config` attribute of the :class:`~flask.Flask`\nobject. This is the place where Flask itself puts certain configuration\nvalues and also where extensions can put their configuration values. But\nthis is also where you can have your own configuration.\n\n\nConfiguration Basics\n--------------------\n\nThe :attr:`~flask.Flask.config` is actually a subclass of a dictionary and\ncan be modified just like any dictionary::\n\n app = Flask(__name__)\n app.config['TESTING'] = True\n\nCertain configuration values are also forwarded to the\n:attr:`~flask.Flask` object so you can read and write them from there::\n\n app.testing = True\n\nTo update multiple keys at once you can use the :meth:`dict.update`\nmethod::\n\n app.config.update(\n TESTING=True,\n SECRET_KEY='192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf'\n )\n\n\nDebug Mode\n----------\n\nThe :data:`DEBUG` config value is special because it may behave inconsistently if\nchanged after the app has begun setting up. In order to set debug mode reliably, use the\n``--debug`` option on the ``flask`` or ``flask run`` command. ``flask run`` will use the\ninteractive debugger and reloader by default in debug mode.\n\n.. code-block:: text\n\n $ flask --app hello run --debug\n\nUsing the option is recommended. While it is possible to set :data:`DEBUG` in your\nconfig or code, this is strongly discouraged. It can't be read early by the\n``flask run`` command, and some systems or extensions may have already configured\nthemselves based on a previous value.\n\n\nBuiltin Configuration Values\n----------------------------\n\nThe following configuration values are used internally by Flask:\n\n.. py:data:: DEBUG\n\n Whether debug mode is enabled. When using ``flask run`` to start the development\n server, an interactive debugger will be shown for unhandled exceptions, and the\n server will be reloaded when code changes. The :attr:`~flask.Flask.debug` attribute\n maps to this config key. This is set with the ``FLASK_DEBUG`` environment variable.\n It may not behave as expected if set in code.\n\n **Do not enable debug mode when deploying in production.**\n\n Default: ``False``\n\n.. py:data:: TESTING\n\n Enable testing mode. Exceptions are propagated rather than handled by the\n the app's error handlers. Extensions may also change their behavior to\n facilitate easier testing. You should enable this in your own tests.\n\n Default: ``False``\n\n.. py:data:: PROPAGATE_EXCEPTIONS\n\n Exceptions are re-raised rather than being handled by the app's error\n handlers. If not set, this is implicitly true if ``TESTING`` or ``DEBUG``\n is enabled.\n\n Default: ``None``\n\n.. py:data:: TRAP_HTTP_EXCEPTIONS\n\n If there is no handler for an ``HTTPException``-type exception, re-raise it\n to be handled by the interactive debugger instead of returning it as a\n simple error response.\n\n Default: ``False``\n\n.. py:data:: TRAP_BAD_REQUEST_ERRORS\n\n Trying to access a key that doesn't exist from request dicts like ``args``\n and ``form`` will return a 400 Bad Request error page. Enable this to treat\n the error as an unhandled exception instead so that you get the interactive\n debugger. This is a more specific version of ``TRAP_HTTP_EXCEPTIONS``. If\n unset, it is enabled in debug mode.\n\n Default: ``None``\n\n.. py:data:: SECRET_KEY\n\n A secret key that will be used for securely signing the session cookie\n and can be used for any other security related needs by extensions or your\n application. It should be a long random ``bytes`` or ``str``. For\n example, copy the output of this to your config::\n\n $ python -c 'import secrets; print(secrets.token_hex())'\n '192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf'\n\n **Do not reveal the secret key when posting questions or committing code.**\n\n Default: ``None``\n\n.. py:data:: SESSION_COOKIE_NAME\n\n The name of the session cookie. Can be changed in case you already have a\n cookie with the same name.\n\n Default: ``'session'``\n\n.. py:data:: SESSION_COOKIE_DOMAIN\n\n The domain match rule that the session cookie will be valid for. If not\n set, the cookie will be valid for all subdomains of :data:`SERVER_NAME`.\n If ``False``, the cookie's domain will not be set.\n\n Default: ``None``\n\n.. py:data:: SESSION_COOKIE_PATH\n\n The path that the session cookie will be valid for. If not set, the cookie\n will be valid underneath ``APPLICATION_ROOT`` or ``/`` if that is not set.\n\n Default: ``None``\n\n.. py:data:: SESSION_COOKIE_HTTPONLY\n\n Browsers will not allow JavaScript access to cookies marked as \"HTTP only\"\n for security.\n\n Default: ``True``\n\n.. py:data:: SESSION_COOKIE_SECURE\n\n Browsers will only send cookies with requests over HTTPS if the cookie is\n marked \"secure\". The application must be served over HTTPS for this to make\n sense.\n\n Default: ``False``\n\n.. py:data:: SESSION_COOKIE_SAMESITE\n\n Restrict how cookies are sent with requests from external sites. Can\n be set to ``'Lax'`` (recommended) or ``'Strict'``.\n See :ref:`security-cookie`.\n\n Default: ``None``\n\n .. versionadded:: 1.0\n\n.. py:data:: PERMANENT_SESSION_LIFETIME\n\n If ``session.permanent`` is true, the cookie's expiration will be set this\n number of seconds in the future. Can either be a\n :class:`datetime.timedelta` or an ``int``.\n\n Flask's default cookie implementation validates that the cryptographic\n signature is not older than this value.\n\n Default: ``timedelta(days=31)`` (``2678400`` seconds)\n\n.. py:data:: SESSION_REFRESH_EACH_REQUEST\n\n Control whether the cookie is sent with every response when\n ``session.permanent`` is true. Sending the cookie every time (the default)\n can more reliably keep the session from expiring, but uses more bandwidth.\n Non-permanent sessions are not affected.\n\n Default: ``True``\n\n.. py:data:: USE_X_SENDFILE\n\n When serving files, set the ``X-Sendfile`` header instead of serving the\n data with Flask. Some web servers, such as Apache, recognize this and serve\n the data more efficiently. This only makes sense when using such a server.\n\n Default: ``False``\n\n.. py:data:: SEND_FILE_MAX_AGE_DEFAULT\n\n When serving files, set the cache control max age to this number of\n seconds. Can be a :class:`datetime.timedelta` or an ``int``.\n Override this value on a per-file basis using\n :meth:`~flask.Flask.get_send_file_max_age` on the application or\n blueprint.\n\n If ``None``, ``send_file`` tells the browser to use conditional\n requests will be used instead of a timed cache, which is usually\n preferable.\n\n Default: ``None``\n\n.. py:data:: SERVER_NAME\n\n Inform the application what host and port it is bound to. Required\n for subdomain route matching support.\n\n If set, will be used for the session cookie domain if\n :data:`SESSION_COOKIE_DOMAIN` is not set. Modern web browsers will\n not allow setting cookies for domains without a dot. To use a domain\n locally, add any names that should route to the app to your\n ``hosts`` file. ::\n\n 127.0.0.1 localhost.dev\n\n If set, ``url_for`` can generate external URLs with only an application\n context instead of a request context.\n\n Default: ``None``\n\n.. py:data:: APPLICATION_ROOT\n\n Inform the application what path it is mounted under by the application /\n web server. This is used for generating URLs outside the context of a\n request (inside a request, the dispatcher is responsible for setting\n ``SCRIPT_NAME`` instead; see :doc:`/patterns/appdispatch`\n for examples of dispatch configuration).\n\n Will be used for the session cookie path if ``SESSION_COOKIE_PATH`` is not\n set.\n\n Default: ``'/'``\n\n.. py:data:: PREFERRED_URL_SCHEME\n\n Use this scheme for generating external URLs when not in a request context.\n\n Default: ``'http'``\n\n.. py:data:: MAX_CONTENT_LENGTH\n\n Don't read more than this many bytes from the incoming request data. If not\n set and the request does not specify a ``CONTENT_LENGTH``, no data will be\n read for security.\n\n Default: ``None``\n\n.. py:data:: TEMPLATES_AUTO_RELOAD\n\n Reload templates when they are changed. If not set, it will be enabled in\n debug mode.\n\n Default: ``None``\n\n.. py:data:: EXPLAIN_TEMPLATE_LOADING\n\n Log debugging information tracing how a template file was loaded. This can\n be useful to figure out why a template was not loaded or the wrong file\n appears to be loaded.\n\n Default: ``False``\n\n.. py:data:: MAX_COOKIE_SIZE\n\n Warn if cookie headers are larger than this many bytes. Defaults to\n ``4093``. Larger cookies may be silently ignored by browsers. Set to\n ``0`` to disable the warning.\n\n.. versionadded:: 0.4\n ``LOGGER_NAME``\n\n.. versionadded:: 0.5\n ``SERVER_NAME``\n\n.. versionadded:: 0.6\n ``MAX_CONTENT_LENGTH``\n\n.. versionadded:: 0.7\n ``PROPAGATE_EXCEPTIONS``, ``PRESERVE_CONTEXT_ON_EXCEPTION``\n\n.. versionadded:: 0.8\n ``TRAP_BAD_REQUEST_ERRORS``, ``TRAP_HTTP_EXCEPTIONS``,\n ``APPLICATION_ROOT``, ``SESSION_COOKIE_DOMAIN``,\n ``SESSION_COOKIE_PATH``, ``SESSION_COOKIE_HTTPONLY``,\n ``SESSION_COOKIE_SECURE``\n\n.. versionadded:: 0.9\n ``PREFERRED_URL_SCHEME``\n\n.. versionadded:: 0.10\n ``JSON_AS_ASCII``, ``JSON_SORT_KEYS``, ``JSONIFY_PRETTYPRINT_REGULAR``\n\n.. versionadded:: 0.11\n ``SESSION_REFRESH_EACH_REQUEST``, ``TEMPLATES_AUTO_RELOAD``,\n ``LOGGER_HANDLER_POLICY``, ``EXPLAIN_TEMPLATE_LOADING``\n\n.. versionchanged:: 1.0\n ``LOGGER_NAME`` and ``LOGGER_HANDLER_POLICY`` were removed. See\n :doc:`/logging` for information about configuration.\n\n Added :data:`ENV` to reflect the :envvar:`FLASK_ENV` environment\n variable.\n\n Added :data:`SESSION_COOKIE_SAMESITE` to control the session\n cookie's ``SameSite`` option.\n\n Added :data:`MAX_COOKIE_SIZE` to control a warning from Werkzeug.\n\n.. versionchanged:: 2.2\n Removed ``PRESERVE_CONTEXT_ON_EXCEPTION``.\n\n.. versionchanged:: 2.3\n ``JSON_AS_ASCII``, ``JSON_SORT_KEYS``, ``JSONIFY_MIMETYPE``, and\n ``JSONIFY_PRETTYPRINT_REGULAR`` were removed. The default ``app.json`` provider has\n equivalent attributes instead.\n\n.. versionchanged:: 2.3\n ``ENV`` was removed.\n\n\nConfiguring from Python Files\n-----------------------------\n\nConfiguration becomes more useful if you can store it in a separate file, ideally\nlocated outside the actual application package. You can deploy your application, then\nseparately configure it for the specific deployment.\n\nA common pattern is this::\n\n app = Flask(__name__)\n app.config.from_object('yourapplication.default_settings')\n app.config.from_envvar('YOURAPPLICATION_SETTINGS')\n\nThis first loads the configuration from the\n`yourapplication.default_settings` module and then overrides the values\nwith the contents of the file the :envvar:`YOURAPPLICATION_SETTINGS`\nenvironment variable points to. This environment variable can be set\nin the shell before starting the server:\n\n.. tabs::\n\n .. group-tab:: Bash\n\n .. code-block:: text\n\n $ export YOURAPPLICATION_SETTINGS=/path/to/settings.cfg\n $ flask run\n * Running on http://127.0.0.1:5000/\n\n .. group-tab:: Fish\n\n .. code-block:: text\n\n $ set -x YOURAPPLICATION_SETTINGS /path/to/settings.cfg\n $ flask run\n * Running on http://127.0.0.1:5000/\n\n .. group-tab:: CMD\n\n .. code-block:: text\n\n > set YOURAPPLICATION_SETTINGS=\\path\\to\\settings.cfg\n > flask run\n * Running on http://127.0.0.1:5000/\n\n .. group-tab:: Powershell\n\n .. code-block:: text\n\n > $env:YOURAPPLICATION_SETTINGS = \"\\path\\to\\settings.cfg\"\n > flask run\n * Running on http://127.0.0.1:5000/\n\nThe configuration files themselves are actual Python files. Only values\nin uppercase are actually stored in the config object later on. So make\nsure to use uppercase letters for your config keys.\n\nHere is an example of a configuration file::\n\n # Example configuration\n SECRET_KEY = '192b9bdd22ab9ed4d12e236c78afcb9a393ec15f71bbf5dc987d54727823bcbf'\n\nMake sure to load the configuration very early on, so that extensions have\nthe ability to access the configuration when starting up. There are other\nmethods on the config object as well to load from individual files. For a\ncomplete reference, read the :class:`~flask.Config` object's\ndocumentation.\n\n\nConfiguring from Data Files\n---------------------------\n\nIt is also possible to load configuration from a file in a format of\nyour choice using :meth:`~flask.Config.from_file`. For example to load\nfrom a TOML file:\n\n.. code-block:: python\n\n import toml\n app.config.from_file(\"config.toml\", load=toml.load)\n\nOr from a JSON file:\n\n.. code-block:: python\n\n import json\n app.config.from_file(\"config.json\", load=json.load)\n\n\nConfiguring from Environment Variables\n--------------------------------------\n\nIn addition to pointing to configuration files using environment\nvariables, you may find it useful (or necessary) to control your\nconfiguration values directly from the environment. Flask can be\ninstructed to load all environment variables starting with a specific\nprefix into the config using :meth:`~flask.Config.from_prefixed_env`.\n\nEnvironment variables can be set in the shell before starting the\nserver:\n\n.. tabs::\n\n .. group-tab:: Bash\n\n .. code-block:: text\n\n $ export FLASK_SECRET_KEY=\"5f352379324c22463451387a0aec5d2f\"\n $ export FLASK_MAIL_ENABLED=false\n $ flask run\n * Running on http://127.0.0.1:5000/\n\n .. group-tab:: Fish\n\n .. code-block:: text\n\n $ set -x FLASK_SECRET_KEY \"5f352379324c22463451387a0aec5d2f\"\n $ set -x FLASK_MAIL_ENABLED false\n $ flask run\n * Running on http://127.0.0.1:5000/\n\n .. group-tab:: CMD\n\n .. code-block:: text\n\n > set FLASK_SECRET_KEY=\"5f352379324c22463451387a0aec5d2f\"\n > set FLASK_MAIL_ENABLED=false\n > flask run\n * Running on http://127.0.0.1:5000/\n\n .. group-tab:: Powershell\n\n .. code-block:: text\n\n > $env:FLASK_SECRET_KEY = \"5f352379324c22463451387a0aec5d2f\"\n > $env:FLASK_MAIL_ENABLED = \"false\"\n > flask run\n * Running on http://127.0.0.1:5000/\n\nThe variables can then be loaded and accessed via the config with a key\nequal to the environment variable name without the prefix i.e.\n\n.. code-block:: python\n\n app.config.from_prefixed_env()\n app.config[\"SECRET_KEY\"] # Is \"5f352379324c22463451387a0aec5d2f\"\n\nThe prefix is ``FLASK_`` by default. This is configurable via the\n``prefix`` argument of :meth:`~flask.Config.from_prefixed_env`.\n\nValues will be parsed to attempt to convert them to a more specific type\nthan strings. By default :func:`json.loads` is used, so any valid JSON\nvalue is possible, including lists and dicts. This is configurable via\nthe ``loads`` argument of :meth:`~flask.Config.from_prefixed_env`.\n\nWhen adding a boolean value with the default JSON parsing, only \"true\"\nand \"false\", lowercase, are valid values. Keep in mind that any\nnon-empty string is considered ``True`` by Python.\n\nIt is possible to set keys in nested dictionaries by separating the\nkeys with double underscore (``__``). Any intermediate keys that don't\nexist on the parent dict will be initialized to an empty dict.\n\n.. code-block:: text\n\n $ export FLASK_MYAPI__credentials__username=user123\n\n.. code-block:: python\n\n app.config[\"MYAPI\"][\"credentials\"][\"username\"] # Is \"user123\"\n\nOn Windows, environment variable keys are always uppercase, therefore\nthe above example would end up as ``MYAPI__CREDENTIALS__USERNAME``.\n\nFor even more config loading features, including merging and\ncase-insensitive Windows support, try a dedicated library such as\nDynaconf_, which includes integration with Flask.\n\n.. _Dynaconf: https://www.dynaconf.com/\n\n\nConfiguration Best Practices\n----------------------------\n\nThe downside with the approach mentioned earlier is that it makes testing\na little harder. There is no single 100% solution for this problem in\ngeneral, but there are a couple of things you can keep in mind to improve\nthat experience:\n\n1. Create your application in a function and register blueprints on it.\n That way you can create multiple instances of your application with\n different configurations attached which makes unit testing a lot\n easier. You can use this to pass in configuration as needed.\n\n2. Do not write code that needs the configuration at import time. If you\n limit yourself to request-only accesses to the configuration you can\n reconfigure the object later on as needed.\n\n3. Make sure to load the configuration very early on, so that\n extensions can access the configuration when calling ``init_app``.\n\n\n.. _config-dev-prod:\n\nDevelopment / Production\n------------------------\n\nMost applications need more than one configuration. There should be at\nleast separate configurations for the production server and the one used\nduring development. The easiest way to handle this is to use a default\nconfiguration that is always loaded and part of the version control, and a\nseparate configuration that overrides the values as necessary as mentioned\nin the example above::\n\n app = Flask(__name__)\n app.config.from_object('yourapplication.default_settings')\n app.config.from_envvar('YOURAPPLICATION_SETTINGS')\n\nThen you just have to add a separate :file:`config.py` file and export\n``YOURAPPLICATION_SETTINGS=/path/to/config.py`` and you are done. However\nthere are alternative ways as well. For example you could use imports or\nsubclassing.\n\nWhat is very popular in the Django world is to make the import explicit in\nthe config file by adding ``from yourapplication.default_settings\nimport *`` to the top of the file and then overriding the changes by hand.\nYou could also inspect an environment variable like\n``YOURAPPLICATION_MODE`` and set that to `production`, `development` etc\nand import different hard-coded files based on that.\n\nAn interesting pattern is also to use classes and inheritance for\nconfiguration::\n\n class Config(object):\n TESTING = False\n\n class ProductionConfig(Config):\n DATABASE_URI = 'mysql://user@localhost/foo'\n\n class DevelopmentConfig(Config):\n DATABASE_URI = \"sqlite:////tmp/foo.db\"\n\n class TestingConfig(Config):\n DATABASE_URI = 'sqlite:///:memory:'\n TESTING = True\n\nTo enable such a config you just have to call into\n:meth:`~flask.Config.from_object`::\n\n app.config.from_object('configmodule.ProductionConfig')\n\nNote that :meth:`~flask.Config.from_object` does not instantiate the class\nobject. If you need to instantiate the class, such as to access a property,\nthen you must do so before calling :meth:`~flask.Config.from_object`::\n\n from configmodule import ProductionConfig\n app.config.from_object(ProductionConfig())\n\n # Alternatively, import via string:\n from werkzeug.utils import import_string\n cfg = import_string('configmodule.ProductionConfig')()\n app.config.from_object(cfg)\n\nInstantiating the configuration object allows you to use ``@property`` in\nyour configuration classes::\n\n class Config(object):\n \"\"\"Base config, uses staging database server.\"\"\"\n TESTING = False\n DB_SERVER = '192.168.1.56'\n\n @property\n def DATABASE_URI(self): # Note: all caps\n return f\"mysql://user@{self.DB_SERVER}/foo\"\n\n class ProductionConfig(Config):\n \"\"\"Uses production database server.\"\"\"\n DB_SERVER = '192.168.19.32'\n\n class DevelopmentConfig(Config):\n DB_SERVER = 'localhost'\n\n class TestingConfig(Config):\n DB_SERVER = 'localhost'\n DATABASE_URI = 'sqlite:///:memory:'\n\nThere are many different ways and it's up to you how you want to manage\nyour configuration files. However here a list of good recommendations:\n\n- Keep a default configuration in version control. Either populate the\n config with this default configuration or import it in your own\n configuration files before overriding values.\n- Use an environment variable to switch between the configurations.\n This can be done from outside the Python interpreter and makes\n development and deployment much easier because you can quickly and\n easily switch between different configs without having to touch the\n code at all. If you are working often on different projects you can\n even create your own script for sourcing that activates a virtualenv\n and exports the development configuration for you.\n- Use a tool like `fabric`_ to push code and configuration separately\n to the production server(s).\n\n.. _fabric: https://www.fabfile.org/\n\n\n.. _instance-folders:\n\nInstance Folders\n----------------\n\n.. versionadded:: 0.8\n\nFlask 0.8 introduces instance folders. Flask for a long time made it\npossible to refer to paths relative to the application's folder directly\n(via :attr:`Flask.root_path`). This was also how many developers loaded\nconfigurations stored next to the application. Unfortunately however this\nonly works well if applications are not packages in which case the root\npath refers to the contents of the package.\n\nWith Flask 0.8 a new attribute was introduced:\n:attr:`Flask.instance_path`. It refers to a new concept called the\n“instance folder”. The instance folder is designed to not be under\nversion control and be deployment specific. It's the perfect place to\ndrop things that either change at runtime or configuration files.\n\nYou can either explicitly provide the path of the instance folder when\ncreating the Flask application or you can let Flask autodetect the\ninstance folder. For explicit configuration use the `instance_path`\nparameter::\n\n app = Flask(__name__, instance_path='/path/to/instance/folder')\n\nPlease keep in mind that this path *must* be absolute when provided.\n\nIf the `instance_path` parameter is not provided the following default\nlocations are used:\n\n- Uninstalled module::\n\n /myapp.py\n /instance\n\n- Uninstalled package::\n\n /myapp\n /__init__.py\n /instance\n\n- Installed module or package::\n\n $PREFIX/lib/pythonX.Y/site-packages/myapp\n $PREFIX/var/myapp-instance\n\n ``$PREFIX`` is the prefix of your Python installation. This can be\n ``/usr`` or the path to your virtualenv. You can print the value of\n ``sys.prefix`` to see what the prefix is set to.\n\nSince the config object provided loading of configuration files from\nrelative filenames we made it possible to change the loading via filenames\nto be relative to the instance path if wanted. The behavior of relative\npaths in config files can be flipped between “relative to the application\nroot” (the default) to “relative to instance folder” via the\n`instance_relative_config` switch to the application constructor::\n\n app = Flask(__name__, instance_relative_config=True)\n\nHere is a full example of how to configure Flask to preload the config\nfrom a module and then override the config from a file in the instance\nfolder if it exists::\n\n app = Flask(__name__, instance_relative_config=True)\n app.config.from_object('yourapplication.default_settings')\n app.config.from_pyfile('application.cfg', silent=True)\n\nThe path to the instance folder can be found via the\n:attr:`Flask.instance_path`. Flask also provides a shortcut to open a\nfile from the instance folder with :meth:`Flask.open_instance_resource`.\n\nExample usage for both::\n\n filename = os.path.join(app.instance_path, 'application.cfg')\n with open(filename) as f:\n config = f.read()\n\n # or via open_instance_resource:\n with app.open_instance_resource('application.cfg') as f:\n config = f.read()\n"},{"id":49,"name":"src/flask","nodeType":"Package"},{"fileName":"__main__.py","filePath":"src/flask","id":50,"nodeType":"File","text":"from .cli import main\n\nmain()\n"},{"fileName":"test_blog.py","filePath":"examples/tutorial/tests","id":51,"nodeType":"File","text":"import pytest\n\nfrom flaskr.db import get_db\n\n\ndef test_index(client, auth):\n response = client.get(\"/\")\n assert b\"Log In\" in response.data\n assert b\"Register\" in response.data\n\n auth.login()\n response = client.get(\"/\")\n assert b\"test title\" in response.data\n assert b\"by test on 2018-01-01\" in response.data\n assert b\"test\\nbody\" in response.data\n assert b'href=\"/1/update\"' in response.data\n\n\n@pytest.mark.parametrize(\"path\", (\"/create\", \"/1/update\", \"/1/delete\"))\ndef test_login_required(client, path):\n response = client.post(path)\n assert response.headers[\"Location\"] == \"/auth/login\"\n\n\ndef test_author_required(app, client, auth):\n # change the post author to another user\n with app.app_context():\n db = get_db()\n db.execute(\"UPDATE post SET author_id = 2 WHERE id = 1\")\n db.commit()\n\n auth.login()\n # current user can't modify other user's post\n assert client.post(\"/1/update\").status_code == 403\n assert client.post(\"/1/delete\").status_code == 403\n # current user doesn't see edit link\n assert b'href=\"/1/update\"' not in client.get(\"/\").data\n\n\n@pytest.mark.parametrize(\"path\", (\"/2/update\", \"/2/delete\"))\ndef test_exists_required(client, auth, path):\n auth.login()\n assert client.post(path).status_code == 404\n\n\ndef test_create(client, auth, app):\n auth.login()\n assert client.get(\"/create\").status_code == 200\n client.post(\"/create\", data={\"title\": \"created\", \"body\": \"\"})\n\n with app.app_context():\n db = get_db()\n count = db.execute(\"SELECT COUNT(id) FROM post\").fetchone()[0]\n assert count == 2\n\n\ndef test_update(client, auth, app):\n auth.login()\n assert client.get(\"/1/update\").status_code == 200\n client.post(\"/1/update\", data={\"title\": \"updated\", \"body\": \"\"})\n\n with app.app_context():\n db = get_db()\n post = db.execute(\"SELECT * FROM post WHERE id = 1\").fetchone()\n assert post[\"title\"] == \"updated\"\n\n\n@pytest.mark.parametrize(\"path\", (\"/create\", \"/1/update\"))\ndef test_create_update_validate(client, auth, path):\n auth.login()\n response = client.post(path, data={\"title\": \"\", \"body\": \"\"})\n assert b\"Title is required.\" in response.data\n\n\ndef test_delete(client, auth, app):\n auth.login()\n response = client.post(\"/1/delete\")\n assert response.headers[\"Location\"] == \"/\"\n\n with app.app_context():\n db = get_db()\n post = db.execute(\"SELECT * FROM post WHERE id = 1\").fetchone()\n assert post is None\n"},{"col":0,"comment":"null","endLoc":16,"header":"def test_index(client, auth)","id":52,"name":"test_index","nodeType":"Function","startLoc":6,"text":"def test_index(client, auth):\n response = client.get(\"/\")\n assert b\"Log In\" in response.data\n assert b\"Register\" in response.data\n\n auth.login()\n response = client.get(\"/\")\n assert b\"test title\" in response.data\n assert b\"by test on 2018-01-01\" in response.data\n assert b\"test\\nbody\" in response.data\n assert b'href=\"/1/update\"' in response.data"},{"col":0,"comment":"null","endLoc":22,"header":"@pytest.mark.parametrize(\"path\", (\"/create\", \"/1/update\", \"/1/delete\"))\ndef test_login_required(client, path)","id":53,"name":"test_login_required","nodeType":"Function","startLoc":19,"text":"@pytest.mark.parametrize(\"path\", (\"/create\", \"/1/update\", \"/1/delete\"))\ndef test_login_required(client, path):\n response = client.post(path)\n assert response.headers[\"Location\"] == \"/auth/login\""},{"col":0,"comment":"null","endLoc":37,"header":"def test_author_required(app, client, auth)","id":54,"name":"test_author_required","nodeType":"Function","startLoc":25,"text":"def test_author_required(app, client, auth):\n # change the post author to another user\n with app.app_context():\n db = get_db()\n db.execute(\"UPDATE post SET author_id = 2 WHERE id = 1\")\n db.commit()\n\n auth.login()\n # current user can't modify other user's post\n assert client.post(\"/1/update\").status_code == 403\n assert client.post(\"/1/delete\").status_code == 403\n # current user doesn't see edit link\n assert b'href=\"/1/update\"' not in client.get(\"/\").data"},{"col":0,"comment":"null","endLoc":1050,"header":"def main() -> None","id":55,"name":"main","nodeType":"Function","startLoc":1049,"text":"def main() -> None:\n cli.main()"},{"col":0,"comment":"null","endLoc":43,"header":"@pytest.mark.parametrize(\"path\", (\"/2/update\", \"/2/delete\"))\ndef test_exists_required(client, auth, path)","id":56,"name":"test_exists_required","nodeType":"Function","startLoc":40,"text":"@pytest.mark.parametrize(\"path\", (\"/2/update\", \"/2/delete\"))\ndef test_exists_required(client, auth, path):\n auth.login()\n assert client.post(path).status_code == 404"},{"col":0,"comment":"null","endLoc":54,"header":"def test_create(client, auth, app)","id":57,"name":"test_create","nodeType":"Function","startLoc":46,"text":"def test_create(client, auth, app):\n auth.login()\n assert client.get(\"/create\").status_code == 200\n client.post(\"/create\", data={\"title\": \"created\", \"body\": \"\"})\n\n with app.app_context():\n db = get_db()\n count = db.execute(\"SELECT COUNT(id) FROM post\").fetchone()[0]\n assert count == 2"},{"col":0,"comment":"null","endLoc":65,"header":"def test_update(client, auth, app)","id":58,"name":"test_update","nodeType":"Function","startLoc":57,"text":"def test_update(client, auth, app):\n auth.login()\n assert client.get(\"/1/update\").status_code == 200\n client.post(\"/1/update\", data={\"title\": \"updated\", \"body\": \"\"})\n\n with app.app_context():\n db = get_db()\n post = db.execute(\"SELECT * FROM post WHERE id = 1\").fetchone()\n assert post[\"title\"] == \"updated\""},{"col":0,"comment":"null","endLoc":72,"header":"@pytest.mark.parametrize(\"path\", (\"/create\", \"/1/update\"))\ndef test_create_update_validate(client, auth, path)","id":59,"name":"test_create_update_validate","nodeType":"Function","startLoc":68,"text":"@pytest.mark.parametrize(\"path\", (\"/create\", \"/1/update\"))\ndef test_create_update_validate(client, auth, path):\n auth.login()\n response = client.post(path, data={\"title\": \"\", \"body\": \"\"})\n assert b\"Title is required.\" in response.data"},{"col":0,"comment":"null","endLoc":83,"header":"def test_delete(client, auth, app)","id":60,"name":"test_delete","nodeType":"Function","startLoc":75,"text":"def test_delete(client, auth, app):\n auth.login()\n response = client.post(\"/1/delete\")\n assert response.headers[\"Location\"] == \"/\"\n\n with app.app_context():\n db = get_db()\n post = db.execute(\"SELECT * FROM post WHERE id = 1\").fetchone()\n assert post is None"},{"id":61,"name":"examples/tutorial","nodeType":"Package"},{"id":62,"name":"MANIFEST.in","nodeType":"TextFile","path":"examples/tutorial","text":"include LICENSE.rst\ninclude flaskr/schema.sql\ngraft flaskr/static\ngraft flaskr/templates\ngraft tests\nglobal-exclude *.pyc\n"},{"id":63,"name":"tests","nodeType":"Package"},{"fileName":"test_session_interface.py","filePath":"tests","id":64,"nodeType":"File","text":"import flask\nfrom flask.globals import request_ctx\nfrom flask.sessions import SessionInterface\n\n\ndef test_open_session_with_endpoint():\n \"\"\"If request.endpoint (or other URL matching behavior) is needed\n while loading the session, RequestContext.match_request() can be\n called manually.\n \"\"\"\n\n class MySessionInterface(SessionInterface):\n def save_session(self, app, session, response):\n pass\n\n def open_session(self, app, request):\n request_ctx.match_request()\n assert request.endpoint is not None\n\n app = flask.Flask(__name__)\n app.session_interface = MySessionInterface()\n\n @app.get(\"/\")\n def index():\n return \"Hello, World!\"\n\n response = app.test_client().get(\"/\")\n assert response.status_code == 200\n"},{"col":0,"comment":"","endLoc":1,"header":"__main__.py#","id":65,"name":"","nodeType":"Function","startLoc":1,"text":"main()"},{"id":66,"name":"","nodeType":"Package"},{"id":67,"name":"tox.ini","nodeType":"TextFile","path":"","text":"[tox]\nenvlist =\n py3{12,11,10,9,8,7}\n pypy3{9,8,7}\n py311-min\n py37-dev\n style\n typing\n docs\nskip_missing_interpreters = true\n\n[testenv]\npackage = wheel\nwheel_build_env = .pkg\nenvtmpdir = {toxworkdir}/tmp/{envname}\ndeps =\n -r requirements/tests.txt\n min: -r requirements/tests-pallets-min.txt\n dev: https://github.com/pallets/werkzeug/archive/refs/heads/main.tar.gz\n dev: https://github.com/pallets/jinja/archive/refs/heads/main.tar.gz\n dev: https://github.com/pallets/markupsafe/archive/refs/heads/main.tar.gz\n dev: https://github.com/pallets/itsdangerous/archive/refs/heads/main.tar.gz\n dev: https://github.com/pallets/click/archive/refs/heads/main.tar.gz\n# examples/tutorial[test]\n# examples/javascript[test]\n# commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs:tests examples}\ncommands = pytest -v --tb=short --basetemp={envtmpdir} {posargs:tests}\n\n[testenv:style]\ndeps = pre-commit\nskip_install = true\ncommands = pre-commit run --all-files\n\n[testenv:typing]\npackage = wheel\nwheel_build_env = .pkg\ndeps = -r requirements/typing.txt\ncommands = mypy\n\n[testenv:docs]\npackage = wheel\nwheel_build_env = .pkg\ndeps = -r requirements/docs.txt\ncommands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html\n"},{"id":68,"name":"tests/test_apps/cliapp/inner1/inner2","nodeType":"Package"},{"fileName":"flask.py","filePath":"tests/test_apps/cliapp/inner1/inner2","id":69,"nodeType":"File","text":"from flask import Flask\n\napp = Flask(__name__)\n"},{"fileName":"templating.py","filePath":"src/flask","id":70,"nodeType":"File","text":"import typing as t\n\nfrom jinja2 import BaseLoader\nfrom jinja2 import Environment as BaseEnvironment\nfrom jinja2 import Template\nfrom jinja2 import TemplateNotFound\n\nfrom .globals import _cv_app\nfrom .globals import _cv_request\nfrom .globals import current_app\nfrom .globals import request\nfrom .helpers import stream_with_context\nfrom .signals import before_render_template\nfrom .signals import template_rendered\n\nif t.TYPE_CHECKING: # pragma: no cover\n from .app import Flask\n from .scaffold import Scaffold\n\n\ndef _default_template_ctx_processor() -> t.Dict[str, t.Any]:\n \"\"\"Default template context processor. Injects `request`,\n `session` and `g`.\n \"\"\"\n appctx = _cv_app.get(None)\n reqctx = _cv_request.get(None)\n rv: t.Dict[str, t.Any] = {}\n if appctx is not None:\n rv[\"g\"] = appctx.g\n if reqctx is not None:\n rv[\"request\"] = reqctx.request\n rv[\"session\"] = reqctx.session\n return rv\n\n\nclass Environment(BaseEnvironment):\n \"\"\"Works like a regular Jinja2 environment but has some additional\n knowledge of how Flask's blueprint works so that it can prepend the\n name of the blueprint to referenced templates if necessary.\n \"\"\"\n\n def __init__(self, app: \"Flask\", **options: t.Any) -> None:\n if \"loader\" not in options:\n options[\"loader\"] = app.create_global_jinja_loader()\n BaseEnvironment.__init__(self, **options)\n self.app = app\n\n\nclass DispatchingJinjaLoader(BaseLoader):\n \"\"\"A loader that looks for templates in the application and all\n the blueprint folders.\n \"\"\"\n\n def __init__(self, app: \"Flask\") -> None:\n self.app = app\n\n def get_source( # type: ignore\n self, environment: Environment, template: str\n ) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:\n if self.app.config[\"EXPLAIN_TEMPLATE_LOADING\"]:\n return self._get_source_explained(environment, template)\n return self._get_source_fast(environment, template)\n\n def _get_source_explained(\n self, environment: Environment, template: str\n ) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:\n attempts = []\n rv: t.Optional[t.Tuple[str, t.Optional[str], t.Optional[t.Callable[[], bool]]]]\n trv: t.Optional[\n t.Tuple[str, t.Optional[str], t.Optional[t.Callable[[], bool]]]\n ] = None\n\n for srcobj, loader in self._iter_loaders(template):\n try:\n rv = loader.get_source(environment, template)\n if trv is None:\n trv = rv\n except TemplateNotFound:\n rv = None\n attempts.append((loader, srcobj, rv))\n\n from .debughelpers import explain_template_loading_attempts\n\n explain_template_loading_attempts(self.app, template, attempts)\n\n if trv is not None:\n return trv\n raise TemplateNotFound(template)\n\n def _get_source_fast(\n self, environment: Environment, template: str\n ) -> t.Tuple[str, t.Optional[str], t.Optional[t.Callable]]:\n for _srcobj, loader in self._iter_loaders(template):\n try:\n return loader.get_source(environment, template)\n except TemplateNotFound:\n continue\n raise TemplateNotFound(template)\n\n def _iter_loaders(\n self, template: str\n ) -> t.Generator[t.Tuple[\"Scaffold\", BaseLoader], None, None]:\n loader = self.app.jinja_loader\n if loader is not None:\n yield self.app, loader\n\n for blueprint in self.app.iter_blueprints():\n loader = blueprint.jinja_loader\n if loader is not None:\n yield blueprint, loader\n\n def list_templates(self) -> t.List[str]:\n result = set()\n loader = self.app.jinja_loader\n if loader is not None:\n result.update(loader.list_templates())\n\n for blueprint in self.app.iter_blueprints():\n loader = blueprint.jinja_loader\n if loader is not None:\n for template in loader.list_templates():\n result.add(template)\n\n return list(result)\n\n\ndef _render(app: \"Flask\", template: Template, context: t.Dict[str, t.Any]) -> str:\n app.update_template_context(context)\n before_render_template.send(app, template=template, context=context)\n rv = template.render(context)\n template_rendered.send(app, template=template, context=context)\n return rv\n\n\ndef render_template(\n template_name_or_list: t.Union[str, Template, t.List[t.Union[str, Template]]],\n **context: t.Any,\n) -> str:\n \"\"\"Render a template by name with the given context.\n\n :param template_name_or_list: The name of the template to render. If\n a list is given, the first name to exist will be rendered.\n :param context: The variables to make available in the template.\n \"\"\"\n app = current_app._get_current_object() # type: ignore[attr-defined]\n template = app.jinja_env.get_or_select_template(template_name_or_list)\n return _render(app, template, context)\n\n\ndef render_template_string(source: str, **context: t.Any) -> str:\n \"\"\"Render a template from the given source string with the given\n context.\n\n :param source: The source code of the template to render.\n :param context: The variables to make available in the template.\n \"\"\"\n app = current_app._get_current_object() # type: ignore[attr-defined]\n template = app.jinja_env.from_string(source)\n return _render(app, template, context)\n\n\ndef _stream(\n app: \"Flask\", template: Template, context: t.Dict[str, t.Any]\n) -> t.Iterator[str]:\n app.update_template_context(context)\n before_render_template.send(app, template=template, context=context)\n\n def generate() -> t.Iterator[str]:\n yield from template.generate(context)\n template_rendered.send(app, template=template, context=context)\n\n rv = generate()\n\n # If a request context is active, keep it while generating.\n if request:\n rv = stream_with_context(rv)\n\n return rv\n\n\ndef stream_template(\n template_name_or_list: t.Union[str, Template, t.List[t.Union[str, Template]]],\n **context: t.Any,\n) -> t.Iterator[str]:\n \"\"\"Render a template by name with the given context as a stream.\n This returns an iterator of strings, which can be used as a\n streaming response from a view.\n\n :param template_name_or_list: The name of the template to render. If\n a list is given, the first name to exist will be rendered.\n :param context: The variables to make available in the template.\n\n .. versionadded:: 2.2\n \"\"\"\n app = current_app._get_current_object() # type: ignore[attr-defined]\n template = app.jinja_env.get_or_select_template(template_name_or_list)\n return _stream(app, template, context)\n\n\ndef stream_template_string(source: str, **context: t.Any) -> t.Iterator[str]:\n \"\"\"Render a template from the given source string with the given\n context as a stream. This returns an iterator of strings, which can\n be used as a streaming response from a view.\n\n :param source: The source code of the template to render.\n :param context: The variables to make available in the template.\n\n .. versionadded:: 2.2\n \"\"\"\n app = current_app._get_current_object() # type: ignore[attr-defined]\n template = app.jinja_env.from_string(source)\n return _stream(app, template, context)\n"},{"col":0,"comment":"If request.endpoint (or other URL matching behavior) is needed\n while loading the session, RequestContext.match_request() can be\n called manually.\n ","endLoc":28,"header":"def test_open_session_with_endpoint()","id":71,"name":"test_open_session_with_endpoint","nodeType":"Function","startLoc":6,"text":"def test_open_session_with_endpoint():\n \"\"\"If request.endpoint (or other URL matching behavior) is needed\n while loading the session, RequestContext.match_request() can be\n called manually.\n \"\"\"\n\n class MySessionInterface(SessionInterface):\n def save_session(self, app, session, response):\n pass\n\n def open_session(self, app, request):\n request_ctx.match_request()\n assert request.endpoint is not None\n\n app = flask.Flask(__name__)\n app.session_interface = MySessionInterface()\n\n @app.get(\"/\")\n def index():\n return \"Hello, World!\"\n\n response = app.test_client().get(\"/\")\n assert response.status_code == 200"},{"className":"BaseLoader","col":0,"comment":"Baseclass for all loaders. Subclass this and override `get_source` to\n implement a custom loading mechanism. The environment provides a\n `get_template` method that calls the loader's `load` method to get the\n :class:`Template` object.\n\n A very basic example for a loader that looks up templates on the file\n system could look like this::\n\n from jinja2 import BaseLoader, TemplateNotFound\n from os.path import join, exists, getmtime\n\n class MyLoader(BaseLoader):\n\n def __init__(self, path):\n self.path = path\n\n def get_source(self, environment, template):\n path = join(self.path, template)\n if not exists(path):\n raise TemplateNotFound(template)\n mtime = getmtime(path)\n with file(path) as f:\n source = f.read().decode('utf-8')\n return source, path, lambda: mtime == getmtime(path)\n ","endLoc":138,"id":72,"nodeType":"Class","startLoc":38,"text":"class BaseLoader(object):\n \"\"\"Baseclass for all loaders. Subclass this and override `get_source` to\n implement a custom loading mechanism. The environment provides a\n `get_template` method that calls the loader's `load` method to get the\n :class:`Template` object.\n\n A very basic example for a loader that looks up templates on the file\n system could look like this::\n\n from jinja2 import BaseLoader, TemplateNotFound\n from os.path import join, exists, getmtime\n\n class MyLoader(BaseLoader):\n\n def __init__(self, path):\n self.path = path\n\n def get_source(self, environment, template):\n path = join(self.path, template)\n if not exists(path):\n raise TemplateNotFound(template)\n mtime = getmtime(path)\n with file(path) as f:\n source = f.read().decode('utf-8')\n return source, path, lambda: mtime == getmtime(path)\n \"\"\"\n\n #: if set to `False` it indicates that the loader cannot provide access\n #: to the source of templates.\n #:\n #: .. versionadded:: 2.4\n has_source_access = True\n\n def get_source(self, environment, template):\n \"\"\"Get the template source, filename and reload helper for a template.\n It's passed the environment and template name and has to return a\n tuple in the form ``(source, filename, uptodate)`` or raise a\n `TemplateNotFound` error if it can't locate the template.\n\n The source part of the returned tuple must be the source of the\n template as unicode string or a ASCII bytestring. The filename should\n be the name of the file on the filesystem if it was loaded from there,\n otherwise `None`. The filename is used by python for the tracebacks\n if no loader extension is used.\n\n The last item in the tuple is the `uptodate` function. If auto\n reloading is enabled it's always called to check if the template\n changed. No arguments are passed so the function must store the\n old state somewhere (for example in a closure). If it returns `False`\n the template will be reloaded.\n \"\"\"\n if not self.has_source_access:\n raise RuntimeError(\n \"%s cannot provide access to the source\" % self.__class__.__name__\n )\n raise TemplateNotFound(template)\n\n def list_templates(self):\n \"\"\"Iterates over all templates. If the loader does not support that\n it should raise a :exc:`TypeError` which is the default behavior.\n \"\"\"\n raise TypeError(\"this loader cannot iterate over all templates\")\n\n @internalcode\n def load(self, environment, name, globals=None):\n \"\"\"Loads a template. This method looks up the template in the cache\n or loads one by calling :meth:`get_source`. Subclasses should not\n override this method as loaders working on collections of other\n loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)\n will not call this method but `get_source` directly.\n \"\"\"\n code = None\n if globals is None:\n globals = {}\n\n # first we try to get the source for this template together\n # with the filename and the uptodate function.\n source, filename, uptodate = self.get_source(environment, name)\n\n # try to load the code from the bytecode cache if there is a\n # bytecode cache configured.\n bcc = environment.bytecode_cache\n if bcc is not None:\n bucket = bcc.get_bucket(environment, name, filename, source)\n code = bucket.code\n\n # if we don't have code so far (not cached, no longer up to\n # date) etc. we compile the template\n if code is None:\n code = environment.compile(source, name, filename)\n\n # if the bytecode cache is available and the bucket doesn't\n # have a code so far, we give the bucket the new code and put\n # it back to the bytecode cache.\n if bcc is not None and bucket.code is None:\n bucket.code = code\n bcc.set_bucket(bucket)\n\n return environment.template_class.from_code(\n environment, code, globals, uptodate\n )"},{"attributeType":"null","col":0,"comment":"null","endLoc":3,"id":73,"name":"app","nodeType":"Attribute","startLoc":3,"text":"app"},{"col":0,"comment":"","endLoc":1,"header":"flask.py#","id":74,"name":"","nodeType":"Function","startLoc":1,"text":"app = Flask(__name__)"},{"fileName":"__init__.py","filePath":"tests/test_apps/cliapp","id":75,"nodeType":"File","text":""},{"fileName":"testing.py","filePath":"src/flask","id":76,"nodeType":"File","text":"import typing as t\nfrom contextlib import contextmanager\nfrom contextlib import ExitStack\nfrom copy import copy\nfrom types import TracebackType\n\nimport werkzeug.test\nfrom click.testing import CliRunner\nfrom werkzeug.test import Client\nfrom werkzeug.urls import url_parse\nfrom werkzeug.wrappers import Request as BaseRequest\n\nfrom .cli import ScriptInfo\nfrom .globals import _cv_request\nfrom .sessions import SessionMixin\n\nif t.TYPE_CHECKING: # pragma: no cover\n from werkzeug.test import TestResponse\n\n from .app import Flask\n\n\nclass EnvironBuilder(werkzeug.test.EnvironBuilder):\n \"\"\"An :class:`~werkzeug.test.EnvironBuilder`, that takes defaults from the\n application.\n\n :param app: The Flask application to configure the environment from.\n :param path: URL path being requested.\n :param base_url: Base URL where the app is being served, which\n ``path`` is relative to. If not given, built from\n :data:`PREFERRED_URL_SCHEME`, ``subdomain``,\n :data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`.\n :param subdomain: Subdomain name to append to :data:`SERVER_NAME`.\n :param url_scheme: Scheme to use instead of\n :data:`PREFERRED_URL_SCHEME`.\n :param json: If given, this is serialized as JSON and passed as\n ``data``. Also defaults ``content_type`` to\n ``application/json``.\n :param args: other positional arguments passed to\n :class:`~werkzeug.test.EnvironBuilder`.\n :param kwargs: other keyword arguments passed to\n :class:`~werkzeug.test.EnvironBuilder`.\n \"\"\"\n\n def __init__(\n self,\n app: \"Flask\",\n path: str = \"/\",\n base_url: t.Optional[str] = None,\n subdomain: t.Optional[str] = None,\n url_scheme: t.Optional[str] = None,\n *args: t.Any,\n **kwargs: t.Any,\n ) -> None:\n assert not (base_url or subdomain or url_scheme) or (\n base_url is not None\n ) != bool(\n subdomain or url_scheme\n ), 'Cannot pass \"subdomain\" or \"url_scheme\" with \"base_url\".'\n\n if base_url is None:\n http_host = app.config.get(\"SERVER_NAME\") or \"localhost\"\n app_root = app.config[\"APPLICATION_ROOT\"]\n\n if subdomain:\n http_host = f\"{subdomain}.{http_host}\"\n\n if url_scheme is None:\n url_scheme = app.config[\"PREFERRED_URL_SCHEME\"]\n\n url = url_parse(path)\n base_url = (\n f\"{url.scheme or url_scheme}://{url.netloc or http_host}\"\n f\"/{app_root.lstrip('/')}\"\n )\n path = url.path\n\n if url.query:\n sep = b\"?\" if isinstance(url.query, bytes) else \"?\"\n path += sep + url.query\n\n self.app = app\n super().__init__(path, base_url, *args, **kwargs)\n\n def json_dumps(self, obj: t.Any, **kwargs: t.Any) -> str: # type: ignore\n \"\"\"Serialize ``obj`` to a JSON-formatted string.\n\n The serialization will be configured according to the config associated\n with this EnvironBuilder's ``app``.\n \"\"\"\n return self.app.json.dumps(obj, **kwargs)\n\n\nclass FlaskClient(Client):\n \"\"\"Works like a regular Werkzeug test client but has knowledge about\n Flask's contexts to defer the cleanup of the request context until\n the end of a ``with`` block. For general information about how to\n use this class refer to :class:`werkzeug.test.Client`.\n\n .. versionchanged:: 0.12\n `app.test_client()` includes preset default environment, which can be\n set after instantiation of the `app.test_client()` object in\n `client.environ_base`.\n\n Basic usage is outlined in the :doc:`/testing` chapter.\n \"\"\"\n\n application: \"Flask\"\n\n def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:\n super().__init__(*args, **kwargs)\n self.preserve_context = False\n self._new_contexts: t.List[t.ContextManager[t.Any]] = []\n self._context_stack = ExitStack()\n self.environ_base = {\n \"REMOTE_ADDR\": \"127.0.0.1\",\n \"HTTP_USER_AGENT\": f\"werkzeug/{werkzeug.__version__}\",\n }\n\n @contextmanager\n def session_transaction(\n self, *args: t.Any, **kwargs: t.Any\n ) -> t.Generator[SessionMixin, None, None]:\n \"\"\"When used in combination with a ``with`` statement this opens a\n session transaction. This can be used to modify the session that\n the test client uses. Once the ``with`` block is left the session is\n stored back.\n\n ::\n\n with client.session_transaction() as session:\n session['value'] = 42\n\n Internally this is implemented by going through a temporary test\n request context and since session handling could depend on\n request variables this function accepts the same arguments as\n :meth:`~flask.Flask.test_request_context` which are directly\n passed through.\n \"\"\"\n if self.cookie_jar is None:\n raise RuntimeError(\n \"Session transactions only make sense with cookies enabled.\"\n )\n app = self.application\n environ_overrides = kwargs.setdefault(\"environ_overrides\", {})\n self.cookie_jar.inject_wsgi(environ_overrides)\n outer_reqctx = _cv_request.get(None)\n with app.test_request_context(*args, **kwargs) as c:\n session_interface = app.session_interface\n sess = session_interface.open_session(app, c.request)\n if sess is None:\n raise RuntimeError(\n \"Session backend did not open a session. Check the configuration\"\n )\n\n # Since we have to open a new request context for the session\n # handling we want to make sure that we hide out own context\n # from the caller. By pushing the original request context\n # (or None) on top of this and popping it we get exactly that\n # behavior. It's important to not use the push and pop\n # methods of the actual request context object since that would\n # mean that cleanup handlers are called\n token = _cv_request.set(outer_reqctx) # type: ignore[arg-type]\n try:\n yield sess\n finally:\n _cv_request.reset(token)\n\n resp = app.response_class()\n if not session_interface.is_null_session(sess):\n session_interface.save_session(app, sess, resp)\n headers = resp.get_wsgi_headers(c.request.environ)\n self.cookie_jar.extract_wsgi(c.request.environ, headers)\n\n def _copy_environ(self, other):\n out = {**self.environ_base, **other}\n\n if self.preserve_context:\n out[\"werkzeug.debug.preserve_context\"] = self._new_contexts.append\n\n return out\n\n def _request_from_builder_args(self, args, kwargs):\n kwargs[\"environ_base\"] = self._copy_environ(kwargs.get(\"environ_base\", {}))\n builder = EnvironBuilder(self.application, *args, **kwargs)\n\n try:\n return builder.get_request()\n finally:\n builder.close()\n\n def open(\n self,\n *args: t.Any,\n buffered: bool = False,\n follow_redirects: bool = False,\n **kwargs: t.Any,\n ) -> \"TestResponse\":\n if args and isinstance(\n args[0], (werkzeug.test.EnvironBuilder, dict, BaseRequest)\n ):\n if isinstance(args[0], werkzeug.test.EnvironBuilder):\n builder = copy(args[0])\n builder.environ_base = self._copy_environ(builder.environ_base or {})\n request = builder.get_request()\n elif isinstance(args[0], dict):\n request = EnvironBuilder.from_environ(\n args[0], app=self.application, environ_base=self._copy_environ({})\n ).get_request()\n else:\n # isinstance(args[0], BaseRequest)\n request = copy(args[0])\n request.environ = self._copy_environ(request.environ)\n else:\n # request is None\n request = self._request_from_builder_args(args, kwargs)\n\n # Pop any previously preserved contexts. This prevents contexts\n # from being preserved across redirects or multiple requests\n # within a single block.\n self._context_stack.close()\n\n response = super().open(\n request,\n buffered=buffered,\n follow_redirects=follow_redirects,\n )\n response.json_module = self.application.json # type: ignore[assignment]\n\n # Re-push contexts that were preserved during the request.\n while self._new_contexts:\n cm = self._new_contexts.pop()\n self._context_stack.enter_context(cm)\n\n return response\n\n def __enter__(self) -> \"FlaskClient\":\n if self.preserve_context:\n raise RuntimeError(\"Cannot nest client invocations\")\n self.preserve_context = True\n return self\n\n def __exit__(\n self,\n exc_type: t.Optional[type],\n exc_value: t.Optional[BaseException],\n tb: t.Optional[TracebackType],\n ) -> None:\n self.preserve_context = False\n self._context_stack.close()\n\n\nclass FlaskCliRunner(CliRunner):\n \"\"\"A :class:`~click.testing.CliRunner` for testing a Flask app's\n CLI commands. Typically created using\n :meth:`~flask.Flask.test_cli_runner`. See :ref:`testing-cli`.\n \"\"\"\n\n def __init__(self, app: \"Flask\", **kwargs: t.Any) -> None:\n self.app = app\n super().__init__(**kwargs)\n\n def invoke( # type: ignore\n self, cli: t.Any = None, args: t.Any = None, **kwargs: t.Any\n ) -> t.Any:\n \"\"\"Invokes a CLI command in an isolated environment. See\n :meth:`CliRunner.invoke ` for\n full method documentation. See :ref:`testing-cli` for examples.\n\n If the ``obj`` argument is not given, passes an instance of\n :class:`~flask.cli.ScriptInfo` that knows how to load the Flask\n app being tested.\n\n :param cli: Command object to invoke. Default is the app's\n :attr:`~flask.app.Flask.cli` group.\n :param args: List of strings to invoke the command with.\n\n :return: a :class:`~click.testing.Result` object.\n \"\"\"\n if cli is None:\n cli = self.app.cli # type: ignore\n\n if \"obj\" not in kwargs:\n kwargs[\"obj\"] = ScriptInfo(create_app=lambda: self.app)\n\n return super().invoke(cli, args, **kwargs)\n"},{"fileName":"views.py","filePath":"examples/javascript/js_example","id":77,"nodeType":"File","text":"from flask import jsonify\nfrom flask import render_template\nfrom flask import request\n\nfrom js_example import app\n\n\n@app.route(\"/\", defaults={\"js\": \"fetch\"})\n@app.route(\"/\")\ndef index(js):\n return render_template(f\"{js}.html\", js=js)\n\n\n@app.route(\"/add\", methods=[\"POST\"])\ndef add():\n a = request.form.get(\"a\", 0, type=float)\n b = request.form.get(\"b\", 0, type=float)\n return jsonify(result=a + b)\n"},{"id":78,"name":"urlprocessors.rst","nodeType":"TextFile","path":"docs/patterns","text":"Using URL Processors\n====================\n\n.. versionadded:: 0.7\n\nFlask 0.7 introduces the concept of URL processors. The idea is that you\nmight have a bunch of resources with common parts in the URL that you\ndon't always explicitly want to provide. For instance you might have a\nbunch of URLs that have the language code in it but you don't want to have\nto handle it in every single function yourself.\n\nURL processors are especially helpful when combined with blueprints. We\nwill handle both application specific URL processors here as well as\nblueprint specifics.\n\nInternationalized Application URLs\n----------------------------------\n\nConsider an application like this::\n\n from flask import Flask, g\n\n app = Flask(__name__)\n\n @app.route('//')\n def index(lang_code):\n g.lang_code = lang_code\n ...\n\n @app.route('//about')\n def about(lang_code):\n g.lang_code = lang_code\n ...\n\nThis is an awful lot of repetition as you have to handle the language code\nsetting on the :data:`~flask.g` object yourself in every single function.\nSure, a decorator could be used to simplify this, but if you want to\ngenerate URLs from one function to another you would have to still provide\nthe language code explicitly which can be annoying.\n\nFor the latter, this is where :func:`~flask.Flask.url_defaults` functions\ncome in. They can automatically inject values into a call to\n:func:`~flask.url_for`. The code below checks if the\nlanguage code is not yet in the dictionary of URL values and if the\nendpoint wants a value named ``'lang_code'``::\n\n @app.url_defaults\n def add_language_code(endpoint, values):\n if 'lang_code' in values or not g.lang_code:\n return\n if app.url_map.is_endpoint_expecting(endpoint, 'lang_code'):\n values['lang_code'] = g.lang_code\n\nThe method :meth:`~werkzeug.routing.Map.is_endpoint_expecting` of the URL\nmap can be used to figure out if it would make sense to provide a language\ncode for the given endpoint.\n\nThe reverse of that function are\n:meth:`~flask.Flask.url_value_preprocessor`\\s. They are executed right\nafter the request was matched and can execute code based on the URL\nvalues. The idea is that they pull information out of the values\ndictionary and put it somewhere else::\n\n @app.url_value_preprocessor\n def pull_lang_code(endpoint, values):\n g.lang_code = values.pop('lang_code', None)\n\nThat way you no longer have to do the `lang_code` assignment to\n:data:`~flask.g` in every function. You can further improve that by\nwriting your own decorator that prefixes URLs with the language code, but\nthe more beautiful solution is using a blueprint. Once the\n``'lang_code'`` is popped from the values dictionary and it will no longer\nbe forwarded to the view function reducing the code to this::\n\n from flask import Flask, g\n\n app = Flask(__name__)\n\n @app.url_defaults\n def add_language_code(endpoint, values):\n if 'lang_code' in values or not g.lang_code:\n return\n if app.url_map.is_endpoint_expecting(endpoint, 'lang_code'):\n values['lang_code'] = g.lang_code\n\n @app.url_value_preprocessor\n def pull_lang_code(endpoint, values):\n g.lang_code = values.pop('lang_code', None)\n\n @app.route('//')\n def index():\n ...\n\n @app.route('//about')\n def about():\n ...\n\nInternationalized Blueprint URLs\n--------------------------------\n\nBecause blueprints can automatically prefix all URLs with a common string\nit's easy to automatically do that for every function. Furthermore\nblueprints can have per-blueprint URL processors which removes a whole lot\nof logic from the :meth:`~flask.Flask.url_defaults` function because it no\nlonger has to check if the URL is really interested in a ``'lang_code'``\nparameter::\n\n from flask import Blueprint, g\n\n bp = Blueprint('frontend', __name__, url_prefix='/')\n\n @bp.url_defaults\n def add_language_code(endpoint, values):\n values.setdefault('lang_code', g.lang_code)\n\n @bp.url_value_preprocessor\n def pull_lang_code(endpoint, values):\n g.lang_code = values.pop('lang_code')\n\n @bp.route('/')\n def index():\n ...\n\n @bp.route('/about')\n def about():\n ...\n"},{"col":0,"comment":"null","endLoc":76,"header":"def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _GeneratorContextManager[_T_co]]","id":79,"name":"contextmanager","nodeType":"Function","startLoc":76,"text":"def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _GeneratorContextManager[_T_co]]: ..."},{"col":0,"comment":"null","endLoc":11,"header":"@app.route(\"/\", defaults={\"js\": \"fetch\"})\n@app.route(\"/\")\ndef index(js):\n return render_template(f\"{js}.html\", js=js)"},{"fileName":"test_templating.py","filePath":"tests","id":81,"nodeType":"File","text":"import logging\n\nimport pytest\nimport werkzeug.serving\nfrom jinja2 import TemplateNotFound\nfrom markupsafe import Markup\n\nimport flask\n\n\ndef test_context_processing(app, client):\n @app.context_processor\n def context_processor():\n return {\"injected_value\": 42}\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"context_template.html\", value=23)\n\n rv = client.get(\"/\")\n assert rv.data == b\"

23|42\"\n\n\ndef test_original_win(app, client):\n @app.route(\"/\")\n def index():\n return flask.render_template_string(\"{{ config }}\", config=42)\n\n rv = client.get(\"/\")\n assert rv.data == b\"42\"\n\n\ndef test_simple_stream(app, client):\n @app.route(\"/\")\n def index():\n return flask.stream_template_string(\"{{ config }}\", config=42)\n\n rv = client.get(\"/\")\n assert rv.data == b\"42\"\n\n\ndef test_request_less_rendering(app, app_ctx):\n app.config[\"WORLD_NAME\"] = \"Special World\"\n\n @app.context_processor\n def context_processor():\n return dict(foo=42)\n\n rv = flask.render_template_string(\"Hello {{ config.WORLD_NAME }} {{ foo }}\")\n assert rv == \"Hello Special World 42\"\n\n\ndef test_standard_context(app, client):\n @app.route(\"/\")\n def index():\n flask.g.foo = 23\n flask.session[\"test\"] = \"aha\"\n return flask.render_template_string(\n \"\"\"\n {{ request.args.foo }}\n {{ g.foo }}\n {{ config.DEBUG }}\n {{ session.test }}\n \"\"\"\n )\n\n rv = client.get(\"/?foo=42\")\n assert rv.data.split() == [b\"42\", b\"23\", b\"False\", b\"aha\"]\n\n\ndef test_escaping(app, client):\n text = \"

Hello World!\"\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\n \"escaping_template.html\", text=text, html=Markup(text)\n )\n\n lines = client.get(\"/\").data.splitlines()\n assert lines == [\n b\"<p>Hello World!\",\n b\"

Hello World!\",\n b\"

Hello World!\",\n b\"

Hello World!\",\n b\"<p>Hello World!\",\n b\"

Hello World!\",\n ]\n\n\ndef test_no_escaping(app, client):\n text = \"

Hello World!\"\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\n \"non_escaping_template.txt\", text=text, html=Markup(text)\n )\n\n lines = client.get(\"/\").data.splitlines()\n assert lines == [\n b\"

Hello World!\",\n b\"

Hello World!\",\n b\"

Hello World!\",\n b\"

Hello World!\",\n b\"<p>Hello World!\",\n b\"

Hello World!\",\n b\"

Hello World!\",\n b\"

Hello World!\",\n ]\n\n\ndef test_escaping_without_template_filename(app, client, req_ctx):\n assert flask.render_template_string(\"{{ foo }}\", foo=\"\") == \"<test>\"\n assert flask.render_template(\"mail.txt\", foo=\"\") == \" Mail\"\n\n\ndef test_macros(app, req_ctx):\n macro = flask.get_template_attribute(\"_macro.html\", \"hello\")\n assert macro(\"World\") == \"Hello World!\"\n\n\ndef test_template_filter(app):\n @app.template_filter()\n def my_reverse(s):\n return s[::-1]\n\n assert \"my_reverse\" in app.jinja_env.filters.keys()\n assert app.jinja_env.filters[\"my_reverse\"] == my_reverse\n assert app.jinja_env.filters[\"my_reverse\"](\"abcd\") == \"dcba\"\n\n\ndef test_add_template_filter(app):\n def my_reverse(s):\n return s[::-1]\n\n app.add_template_filter(my_reverse)\n assert \"my_reverse\" in app.jinja_env.filters.keys()\n assert app.jinja_env.filters[\"my_reverse\"] == my_reverse\n assert app.jinja_env.filters[\"my_reverse\"](\"abcd\") == \"dcba\"\n\n\ndef test_template_filter_with_name(app):\n @app.template_filter(\"strrev\")\n def my_reverse(s):\n return s[::-1]\n\n assert \"strrev\" in app.jinja_env.filters.keys()\n assert app.jinja_env.filters[\"strrev\"] == my_reverse\n assert app.jinja_env.filters[\"strrev\"](\"abcd\") == \"dcba\"\n\n\ndef test_add_template_filter_with_name(app):\n def my_reverse(s):\n return s[::-1]\n\n app.add_template_filter(my_reverse, \"strrev\")\n assert \"strrev\" in app.jinja_env.filters.keys()\n assert app.jinja_env.filters[\"strrev\"] == my_reverse\n assert app.jinja_env.filters[\"strrev\"](\"abcd\") == \"dcba\"\n\n\ndef test_template_filter_with_template(app, client):\n @app.template_filter()\n def super_reverse(s):\n return s[::-1]\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_filter.html\", value=\"abcd\")\n\n rv = client.get(\"/\")\n assert rv.data == b\"dcba\"\n\n\ndef test_add_template_filter_with_template(app, client):\n def super_reverse(s):\n return s[::-1]\n\n app.add_template_filter(super_reverse)\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_filter.html\", value=\"abcd\")\n\n rv = client.get(\"/\")\n assert rv.data == b\"dcba\"\n\n\ndef test_template_filter_with_name_and_template(app, client):\n @app.template_filter(\"super_reverse\")\n def my_reverse(s):\n return s[::-1]\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_filter.html\", value=\"abcd\")\n\n rv = client.get(\"/\")\n assert rv.data == b\"dcba\"\n\n\ndef test_add_template_filter_with_name_and_template(app, client):\n def my_reverse(s):\n return s[::-1]\n\n app.add_template_filter(my_reverse, \"super_reverse\")\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_filter.html\", value=\"abcd\")\n\n rv = client.get(\"/\")\n assert rv.data == b\"dcba\"\n\n\ndef test_template_test(app):\n @app.template_test()\n def boolean(value):\n return isinstance(value, bool)\n\n assert \"boolean\" in app.jinja_env.tests.keys()\n assert app.jinja_env.tests[\"boolean\"] == boolean\n assert app.jinja_env.tests[\"boolean\"](False)\n\n\ndef test_add_template_test(app):\n def boolean(value):\n return isinstance(value, bool)\n\n app.add_template_test(boolean)\n assert \"boolean\" in app.jinja_env.tests.keys()\n assert app.jinja_env.tests[\"boolean\"] == boolean\n assert app.jinja_env.tests[\"boolean\"](False)\n\n\ndef test_template_test_with_name(app):\n @app.template_test(\"boolean\")\n def is_boolean(value):\n return isinstance(value, bool)\n\n assert \"boolean\" in app.jinja_env.tests.keys()\n assert app.jinja_env.tests[\"boolean\"] == is_boolean\n assert app.jinja_env.tests[\"boolean\"](False)\n\n\ndef test_add_template_test_with_name(app):\n def is_boolean(value):\n return isinstance(value, bool)\n\n app.add_template_test(is_boolean, \"boolean\")\n assert \"boolean\" in app.jinja_env.tests.keys()\n assert app.jinja_env.tests[\"boolean\"] == is_boolean\n assert app.jinja_env.tests[\"boolean\"](False)\n\n\ndef test_template_test_with_template(app, client):\n @app.template_test()\n def boolean(value):\n return isinstance(value, bool)\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_test.html\", value=False)\n\n rv = client.get(\"/\")\n assert b\"Success!\" in rv.data\n\n\ndef test_add_template_test_with_template(app, client):\n def boolean(value):\n return isinstance(value, bool)\n\n app.add_template_test(boolean)\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_test.html\", value=False)\n\n rv = client.get(\"/\")\n assert b\"Success!\" in rv.data\n\n\ndef test_template_test_with_name_and_template(app, client):\n @app.template_test(\"boolean\")\n def is_boolean(value):\n return isinstance(value, bool)\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_test.html\", value=False)\n\n rv = client.get(\"/\")\n assert b\"Success!\" in rv.data\n\n\ndef test_add_template_test_with_name_and_template(app, client):\n def is_boolean(value):\n return isinstance(value, bool)\n\n app.add_template_test(is_boolean, \"boolean\")\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"template_test.html\", value=False)\n\n rv = client.get(\"/\")\n assert b\"Success!\" in rv.data\n\n\ndef test_add_template_global(app, app_ctx):\n @app.template_global()\n def get_stuff():\n return 42\n\n assert \"get_stuff\" in app.jinja_env.globals.keys()\n assert app.jinja_env.globals[\"get_stuff\"] == get_stuff\n assert app.jinja_env.globals[\"get_stuff\"](), 42\n\n rv = flask.render_template_string(\"{{ get_stuff() }}\")\n assert rv == \"42\"\n\n\ndef test_custom_template_loader(client):\n class MyFlask(flask.Flask):\n def create_global_jinja_loader(self):\n from jinja2 import DictLoader\n\n return DictLoader({\"index.html\": \"Hello Custom World!\"})\n\n app = MyFlask(__name__)\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\"index.html\")\n\n c = app.test_client()\n rv = c.get(\"/\")\n assert rv.data == b\"Hello Custom World!\"\n\n\ndef test_iterable_loader(app, client):\n @app.context_processor\n def context_processor():\n return {\"whiskey\": \"Jameson\"}\n\n @app.route(\"/\")\n def index():\n return flask.render_template(\n [\n \"no_template.xml\", # should skip this one\n \"simple_template.html\", # should render this\n \"context_template.html\",\n ],\n value=23,\n )\n\n rv = client.get(\"/\")\n assert rv.data == b\"

Jameson

\"\n\n\ndef test_templates_auto_reload(app):\n # debug is False, config option is None\n assert app.debug is False\n assert app.config[\"TEMPLATES_AUTO_RELOAD\"] is None\n assert app.jinja_env.auto_reload is False\n # debug is False, config option is False\n app = flask.Flask(__name__)\n app.config[\"TEMPLATES_AUTO_RELOAD\"] = False\n assert app.debug is False\n assert app.jinja_env.auto_reload is False\n # debug is False, config option is True\n app = flask.Flask(__name__)\n app.config[\"TEMPLATES_AUTO_RELOAD\"] = True\n assert app.debug is False\n assert app.jinja_env.auto_reload is True\n # debug is True, config option is None\n app = flask.Flask(__name__)\n app.config[\"DEBUG\"] = True\n assert app.config[\"TEMPLATES_AUTO_RELOAD\"] is None\n assert app.jinja_env.auto_reload is True\n # debug is True, config option is False\n app = flask.Flask(__name__)\n app.config[\"DEBUG\"] = True\n app.config[\"TEMPLATES_AUTO_RELOAD\"] = False\n assert app.jinja_env.auto_reload is False\n # debug is True, config option is True\n app = flask.Flask(__name__)\n app.config[\"DEBUG\"] = True\n app.config[\"TEMPLATES_AUTO_RELOAD\"] = True\n assert app.jinja_env.auto_reload is True\n\n\ndef test_templates_auto_reload_debug_run(app, monkeypatch):\n def run_simple_mock(*args, **kwargs):\n pass\n\n monkeypatch.setattr(werkzeug.serving, \"run_simple\", run_simple_mock)\n\n app.run()\n assert not app.jinja_env.auto_reload\n\n app.run(debug=True)\n assert app.jinja_env.auto_reload\n\n\ndef test_template_loader_debugging(test_apps, monkeypatch):\n from blueprintapp import app\n\n called = []\n\n class _TestHandler(logging.Handler):\n def handle(self, record):\n called.append(True)\n text = str(record.msg)\n assert \"1: trying loader of application 'blueprintapp'\" in text\n assert (\n \"2: trying loader of blueprint 'admin' (blueprintapp.apps.admin)\"\n ) in text\n assert (\n \"trying loader of blueprint 'frontend' (blueprintapp.apps.frontend)\"\n ) in text\n assert \"Error: the template could not be found\" in text\n assert (\n \"looked up from an endpoint that belongs to the blueprint 'frontend'\"\n ) in text\n assert \"See https://flask.palletsprojects.com/blueprints/#templates\" in text\n\n with app.test_client() as c:\n monkeypatch.setitem(app.config, \"EXPLAIN_TEMPLATE_LOADING\", True)\n monkeypatch.setattr(\n logging.getLogger(\"blueprintapp\"), \"handlers\", [_TestHandler()]\n )\n\n with pytest.raises(TemplateNotFound) as excinfo:\n c.get(\"/missing\")\n\n assert \"missing_template.html\" in str(excinfo.value)\n\n assert len(called) == 1\n\n\ndef test_custom_jinja_env():\n class CustomEnvironment(flask.templating.Environment):\n pass\n\n class CustomFlask(flask.Flask):\n jinja_environment = CustomEnvironment\n\n app = CustomFlask(__name__)\n assert isinstance(app.jinja_env, CustomEnvironment)\n"},{"col":0,"comment":"null","endLoc":18,"header":"@app.route(\"/add\", methods=[\"POST\"])\ndef add()","id":82,"name":"add","nodeType":"Function","startLoc":14,"text":"@app.route(\"/add\", methods=[\"POST\"])\ndef add():\n a = request.form.get(\"a\", 0, type=float)\n b = request.form.get(\"b\", 0, type=float)\n return jsonify(result=a + b)"},{"className":"TemplateNotFound","col":0,"comment":"Raised if a template does not exist.\n\n .. versionchanged:: 2.11\n If the given name is :class:`Undefined` and no message was\n provided, an :exc:`UndefinedError` is raised.\n ","endLoc":70,"id":83,"nodeType":"Class","startLoc":41,"text":"@implements_to_string\nclass TemplateNotFound(IOError, LookupError, TemplateError):\n \"\"\"Raised if a template does not exist.\n\n .. versionchanged:: 2.11\n If the given name is :class:`Undefined` and no message was\n provided, an :exc:`UndefinedError` is raised.\n \"\"\"\n\n # looks weird, but removes the warning descriptor that just\n # bogusly warns us about message being deprecated\n message = None\n\n def __init__(self, name, message=None):\n IOError.__init__(self, name)\n\n if message is None:\n from .runtime import Undefined\n\n if isinstance(name, Undefined):\n name._fail_with_undefined_error()\n\n message = name\n\n self.message = message\n self.name = name\n self.templates = [name]\n\n def __str__(self):\n return self.message"},{"className":"object","col":0,"comment":"null","endLoc":127,"id":84,"nodeType":"Class","startLoc":90,"text":"class object:\n __doc__: str | None\n __dict__: dict[str, Any]\n __module__: str\n __annotations__: dict[str, Any]\n @property\n def __class__(self) -> type[Self]: ...\n # Ignore errors about type mismatch between property getter and setter\n @__class__.setter\n def __class__(self, __type: type[object]) -> None: ... # noqa: F811\n def __init__(self) -> None: ...\n def __new__(cls) -> Self: ...\n # N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers.\n # Overriding them in subclasses has different semantics, even if the override has an identical signature.\n def __setattr__(self, __name: str, __value: Any) -> None: ...\n def __delattr__(self, __name: str) -> None: ...\n def __eq__(self, __value: object) -> bool: ...\n def __ne__(self, __value: object) -> bool: ...\n def __str__(self) -> str: ... # noqa: Y029\n def __repr__(self) -> str: ... # noqa: Y029\n def __hash__(self) -> int: ...\n def __format__(self, __format_spec: str) -> str: ...\n def __getattribute__(self, __name: str) -> Any: ...\n def __sizeof__(self) -> int: ...\n # return type of pickle methods is rather hard to express in the current type system\n # see #6661 and https://docs.python.org/3/library/pickle.html#object.__reduce__\n def __reduce__(self) -> str | tuple[Any, ...]: ...\n if sys.version_info >= (3, 8):\n def __reduce_ex__(self, __protocol: SupportsIndex) -> str | tuple[Any, ...]: ...\n else:\n def __reduce_ex__(self, __protocol: int) -> str | tuple[Any, ...]: ...\n if sys.version_info >= (3, 11):\n def __getstate__(self) -> object: ...\n\n def __dir__(self) -> Iterable[str]: ...\n def __init_subclass__(cls) -> None: ...\n @classmethod\n def __subclasshook__(cls, __subclass: type) -> bool: ..."},{"id":85,"name":"templating.rst","nodeType":"TextFile","path":"docs","text":"Templates\n=========\n\nFlask leverages Jinja2 as its template engine. You are obviously free to use\na different template engine, but you still have to install Jinja2 to run\nFlask itself. This requirement is necessary to enable rich extensions.\nAn extension can depend on Jinja2 being present.\n\nThis section only gives a very quick introduction into how Jinja2\nis integrated into Flask. If you want information on the template\nengine's syntax itself, head over to the official `Jinja2 Template\nDocumentation `_ for\nmore information.\n\nJinja Setup\n-----------\n\nUnless customized, Jinja2 is configured by Flask as follows:\n\n- autoescaping is enabled for all templates ending in ``.html``,\n ``.htm``, ``.xml``, ``.xhtml``, as well as ``.svg`` when using\n :func:`~flask.templating.render_template`.\n- autoescaping is enabled for all strings when using\n :func:`~flask.templating.render_template_string`.\n- a template has the ability to opt in/out autoescaping with the\n ``{% autoescape %}`` tag.\n- Flask inserts a couple of global functions and helpers into the\n Jinja2 context, additionally to the values that are present by\n default.\n\nStandard Context\n----------------\n\nThe following global variables are available within Jinja2 templates\nby default:\n\n.. data:: config\n :noindex:\n\n The current configuration object (:data:`flask.Flask.config`)\n\n .. versionadded:: 0.6\n\n .. versionchanged:: 0.10\n This is now always available, even in imported templates.\n\n.. data:: request\n :noindex:\n\n The current request object (:class:`flask.request`). This variable is\n unavailable if the template was rendered without an active request\n context.\n\n.. data:: session\n :noindex:\n\n The current session object (:class:`flask.session`). This variable\n is unavailable if the template was rendered without an active request\n context.\n\n.. data:: g\n :noindex:\n\n The request-bound object for global variables (:data:`flask.g`). This\n variable is unavailable if the template was rendered without an active\n request context.\n\n.. function:: url_for\n :noindex:\n\n The :func:`flask.url_for` function.\n\n.. function:: get_flashed_messages\n :noindex:\n\n The :func:`flask.get_flashed_messages` function.\n\n.. admonition:: The Jinja Context Behavior\n\n These variables are added to the context of variables, they are not\n global variables. The difference is that by default these will not\n show up in the context of imported templates. This is partially caused\n by performance considerations, partially to keep things explicit.\n\n What does this mean for you? If you have a macro you want to import,\n that needs to access the request object you have two possibilities:\n\n 1. you explicitly pass the request to the macro as parameter, or\n the attribute of the request object you are interested in.\n 2. you import the macro \"with context\".\n\n Importing with context looks like this:\n\n .. sourcecode:: jinja\n\n {% from '_helpers.html' import my_macro with context %}\n\n\nControlling Autoescaping\n------------------------\n\nAutoescaping is the concept of automatically escaping special characters\nfor you. Special characters in the sense of HTML (or XML, and thus XHTML)\nare ``&``, ``>``, ``<``, ``\"`` as well as ``'``. Because these characters\ncarry specific meanings in documents on their own you have to replace them\nby so called \"entities\" if you want to use them for text. Not doing so\nwould not only cause user frustration by the inability to use these\ncharacters in text, but can also lead to security problems. (see\n:ref:`security-xss`)\n\nSometimes however you will need to disable autoescaping in templates.\nThis can be the case if you want to explicitly inject HTML into pages, for\nexample if they come from a system that generates secure HTML like a\nmarkdown to HTML converter.\n\nThere are three ways to accomplish that:\n\n- In the Python code, wrap the HTML string in a :class:`~markupsafe.Markup`\n object before passing it to the template. This is in general the\n recommended way.\n- Inside the template, use the ``|safe`` filter to explicitly mark a\n string as safe HTML (``{{ myvariable|safe }}``)\n- Temporarily disable the autoescape system altogether.\n\nTo disable the autoescape system in templates, you can use the ``{%\nautoescape %}`` block:\n\n.. sourcecode:: html+jinja\n\n {% autoescape false %}\n

autoescaping is disabled here\n

{{ will_not_be_escaped }}\n {% endautoescape %}\n\nWhenever you do this, please be very cautious about the variables you are\nusing in this block.\n\n.. _registering-filters:\n\nRegistering Filters\n-------------------\n\nIf you want to register your own filters in Jinja2 you have two ways to do\nthat. You can either put them by hand into the\n:attr:`~flask.Flask.jinja_env` of the application or use the\n:meth:`~flask.Flask.template_filter` decorator.\n\nThe two following examples work the same and both reverse an object::\n\n @app.template_filter('reverse')\n def reverse_filter(s):\n return s[::-1]\n\n def reverse_filter(s):\n return s[::-1]\n app.jinja_env.filters['reverse'] = reverse_filter\n\nIn case of the decorator the argument is optional if you want to use the\nfunction name as name of the filter. Once registered, you can use the filter\nin your templates in the same way as Jinja2's builtin filters, for example if\nyou have a Python list in context called `mylist`::\n\n {% for x in mylist | reverse %}\n {% endfor %}\n\n\nContext Processors\n------------------\n\nTo inject new variables automatically into the context of a template,\ncontext processors exist in Flask. Context processors run before the\ntemplate is rendered and have the ability to inject new values into the\ntemplate context. A context processor is a function that returns a\ndictionary. The keys and values of this dictionary are then merged with\nthe template context, for all templates in the app::\n\n @app.context_processor\n def inject_user():\n return dict(user=g.user)\n\nThe context processor above makes a variable called `user` available in\nthe template with the value of `g.user`. This example is not very\ninteresting because `g` is available in templates anyways, but it gives an\nidea how this works.\n\nVariables are not limited to values; a context processor can also make\nfunctions available to templates (since Python allows passing around\nfunctions)::\n\n @app.context_processor\n def utility_processor():\n def format_price(amount, currency=\"€\"):\n return f\"{amount:.2f}{currency}\"\n return dict(format_price=format_price)\n\nThe context processor above makes the `format_price` function available to all\ntemplates::\n\n {{ format_price(0.33) }}\n\nYou could also build `format_price` as a template filter (see\n:ref:`registering-filters`), but this demonstrates how to pass functions in a\ncontext processor.\n\nStreaming\n---------\n\nIt can be useful to not render the whole template as one complete\nstring, instead render it as a stream, yielding smaller incremental\nstrings. This can be used for streaming HTML in chunks to speed up\ninitial page load, or to save memory when rendering a very large\ntemplate.\n\nThe Jinja2 template engine supports rendering a template piece\nby piece, returning an iterator of strings. Flask provides the\n:func:`~flask.stream_template` and :func:`~flask.stream_template_string`\nfunctions to make this easier to use.\n\n.. code-block:: python\n\n from flask import stream_template\n\n @app.get(\"/timeline\")\n def timeline():\n return stream_template(\"timeline.html\")\n\nThese functions automatically apply the\n:func:`~flask.stream_with_context` wrapper if a request is active, so\nthat it remains available in the template.\n"},{"id":86,"name":"static.rst","nodeType":"TextFile","path":"docs/tutorial","text":"Static Files\n============\n\nThe authentication views and templates work, but they look very plain\nright now. Some `CSS`_ can be added to add style to the HTML layout you\nconstructed. The style won't change, so it's a *static* file rather than\na template.\n\nFlask automatically adds a ``static`` view that takes a path relative\nto the ``flaskr/static`` directory and serves it. The ``base.html``\ntemplate already has a link to the ``style.css`` file:\n\n.. code-block:: html+jinja\n\n {{ url_for('static', filename='style.css') }}\n\nBesides CSS, other types of static files might be files with JavaScript\nfunctions, or a logo image. They are all placed under the\n``flaskr/static`` directory and referenced with\n``url_for('static', filename='...')``.\n\nThis tutorial isn't focused on how to write CSS, so you can just copy\nthe following into the ``flaskr/static/style.css`` file:\n\n.. code-block:: css\n :caption: ``flaskr/static/style.css``\n\n html { font-family: sans-serif; background: #eee; padding: 1rem; }\n body { max-width: 960px; margin: 0 auto; background: white; }\n h1 { font-family: serif; color: #377ba8; margin: 1rem 0; }\n a { color: #377ba8; }\n hr { border: none; border-top: 1px solid lightgray; }\n nav { background: lightgray; display: flex; align-items: center; padding: 0 0.5rem; }\n nav h1 { flex: auto; margin: 0; }\n nav h1 a { text-decoration: none; padding: 0.25rem 0.5rem; }\n nav ul { display: flex; list-style: none; margin: 0; padding: 0; }\n nav ul li a, nav ul li span, header .action { display: block; padding: 0.5rem; }\n .content { padding: 0 1rem 1rem; }\n .content > header { border-bottom: 1px solid lightgray; display: flex; align-items: flex-end; }\n .content > header h1 { flex: auto; margin: 1rem 0 0.25rem 0; }\n .flash { margin: 1em 0; padding: 1em; background: #cae6f6; border: 1px solid #377ba8; }\n .post > header { display: flex; align-items: flex-end; font-size: 0.85em; }\n .post > header > div:first-of-type { flex: auto; }\n .post > header h1 { font-size: 1.5em; margin-bottom: 0; }\n .post .about { color: slategray; font-style: italic; }\n .post .body { white-space: pre-line; }\n .content:last-child { margin-bottom: 0; }\n .content form { margin: 1em 0; display: flex; flex-direction: column; }\n .content label { font-weight: bold; margin-bottom: 0.5em; }\n .content input, .content textarea { margin-bottom: 1em; }\n .content textarea { min-height: 12em; resize: vertical; }\n input.danger { color: #cc2f2e; }\n input[type=submit] { align-self: start; min-width: 10em; }\n\nYou can find a less compact version of ``style.css`` in the\n:gh:`example code `.\n\nGo to http://127.0.0.1:5000/auth/login and the page should look like the\nscreenshot below.\n\n.. image:: flaskr_login.png\n :align: center\n :class: screenshot\n :alt: screenshot of login page\n\nYou can read more about CSS from `Mozilla's documentation `_. If\nyou change a static file, refresh the browser page. If the change\ndoesn't show up, try clearing your browser's cache.\n\n.. _CSS: https://developer.mozilla.org/docs/Web/CSS\n\nContinue to :doc:`blog`.\n"},{"className":"LookupError","col":0,"comment":"null","endLoc":1986,"id":87,"nodeType":"Class","startLoc":1986,"text":"class LookupError(Exception): ..."},{"className":"ExitStack","col":0,"comment":"null","endLoc":153,"id":88,"nodeType":"Class","startLoc":144,"text":"class ExitStack(metaclass=abc.ABCMeta):\n def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...\n def push(self, exit: _CM_EF) -> _CM_EF: ...\n def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...\n def pop_all(self) -> Self: ...\n def close(self) -> None: ...\n def __enter__(self) -> Self: ...\n def __exit__(\n self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None\n ) -> bool: ..."},{"col":4,"comment":"null","endLoc":145,"header":"def enter_context(self, cm: AbstractContextManager[_T]) -> _T","id":89,"name":"enter_context","nodeType":"Function","startLoc":145,"text":"def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ..."},{"col":4,"comment":"null","endLoc":146,"header":"def push(self, exit: _CM_EF) -> _CM_EF","id":90,"name":"push","nodeType":"Function","startLoc":146,"text":"def push(self, exit: _CM_EF) -> _CM_EF: ..."},{"col":4,"comment":"null","endLoc":147,"header":"def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]","id":91,"name":"callback","nodeType":"Function","startLoc":147,"text":"def callback(self, __callback: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ..."},{"col":4,"comment":"null","endLoc":148,"header":"def pop_all(self) -> Self","id":92,"name":"pop_all","nodeType":"Function","startLoc":148,"text":"def pop_all(self) -> Self: ..."},{"col":4,"comment":"null","endLoc":149,"header":"def close(self) -> None","id":93,"name":"close","nodeType":"Function","startLoc":149,"text":"def close(self) -> None: ..."},{"col":4,"comment":"null","endLoc":150,"header":"def __enter__(self) -> Self","id":94,"name":"__enter__","nodeType":"Function","startLoc":150,"text":"def __enter__(self) -> Self: ..."},{"col":4,"comment":"null","endLoc":153,"header":"def __exit__(\n self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None\n ) -> bool","id":95,"name":"__exit__","nodeType":"Function","startLoc":151,"text":"def __exit__(\n self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None\n ) -> bool: ..."},{"id":96,"name":"celery.rst","nodeType":"TextFile","path":"docs/patterns","text":"Background Tasks with Celery\n============================\n\nIf your application has a long running task, such as processing some uploaded data or\nsending email, you don't want to wait for it to finish during a request. Instead, use a\ntask queue to send the necessary data to another process that will run the task in the\nbackground while the request returns immediately.\n\n`Celery`_ is a powerful task queue that can be used for simple background tasks as well\nas complex multi-stage programs and schedules. This guide will show you how to configure\nCelery using Flask. Read Celery's `First Steps with Celery`_ guide to learn how to use\nCelery itself.\n\n.. _Celery: https://celery.readthedocs.io\n.. _First Steps with Celery: https://celery.readthedocs.io/en/latest/getting-started/first-steps-with-celery.html\n\nThe Flask repository contains `an example `_\nbased on the information on this page, which also shows how to use JavaScript to submit\ntasks and poll for progress and results.\n\n\nInstall\n-------\n\nInstall Celery from PyPI, for example using pip:\n\n.. code-block:: text\n\n $ pip install celery\n\n\nIntegrate Celery with Flask\n---------------------------\n\nYou can use Celery without any integration with Flask, but it's convenient to configure\nit through Flask's config, and to let tasks access the Flask application.\n\nCelery uses similar ideas to Flask, with a ``Celery`` app object that has configuration\nand registers tasks. While creating a Flask app, use the following code to create and\nconfigure a Celery app as well.\n\n.. code-block:: python\n\n from celery import Celery, Task\n\n def celery_init_app(app: Flask) -> Celery:\n class FlaskTask(Task):\n def __call__(self, *args: object, **kwargs: object) -> object:\n with app.app_context():\n return self.run(*args, **kwargs)\n\n celery_app = Celery(app.name, task_cls=FlaskTask)\n celery_app.config_from_object(app.config[\"CELERY\"])\n celery_app.set_default()\n app.extensions[\"celery\"] = celery_app\n return celery_app\n\nThis creates and returns a ``Celery`` app object. Celery `configuration`_ is taken from\nthe ``CELERY`` key in the Flask configuration. The Celery app is set as the default, so\nthat it is seen during each request. The ``Task`` subclass automatically runs task\nfunctions with a Flask app context active, so that services like your database\nconnections are available.\n\n.. _configuration: https://celery.readthedocs.io/en/stable/userguide/configuration.html\n\nHere's a basic ``example.py`` that configures Celery to use Redis for communication. We\nenable a result backend, but ignore results by default. This allows us to store results\nonly for tasks where we care about the result.\n\n.. code-block:: python\n\n from flask import Flask\n\n app = Flask(__name__)\n app.config.from_mapping(\n CELERY=dict(\n broker_url=\"redis://localhost\",\n result_backend=\"redis://localhost\",\n task_ignore_result=True,\n ),\n )\n celery_app = celery_init_app(app)\n\nPoint the ``celery worker`` command at this and it will find the ``celery_app`` object.\n\n.. code-block:: text\n\n $ celery -A example worker --loglevel INFO\n\nYou can also run the ``celery beat`` command to run tasks on a schedule. See Celery's\ndocs for more information about defining schedules.\n\n.. code-block:: text\n\n $ celery -A example beat --loglevel INFO\n\n\nApplication Factory\n-------------------\n\nWhen using the Flask application factory pattern, call the ``celery_init_app`` function\ninside the factory. It sets ``app.extensions[\"celery\"]`` to the Celery app object, which\ncan be used to get the Celery app from the Flask app returned by the factory.\n\n.. code-block:: python\n\n def create_app() -> Flask:\n app = Flask(__name__)\n app.config.from_mapping(\n CELERY=dict(\n broker_url=\"redis://localhost\",\n result_backend=\"redis://localhost\",\n task_ignore_result=True,\n ),\n )\n app.config.from_prefixed_env()\n celery_init_app(app)\n return app\n\nTo use ``celery`` commands, Celery needs an app object, but that's no longer directly\navailable. Create a ``make_celery.py`` file that calls the Flask app factory and gets\nthe Celery app from the returned Flask app.\n\n.. code-block:: python\n\n from example import create_app\n\n flask_app = create_app()\n celery_app = flask_app.extensions[\"celery\"]\n\nPoint the ``celery`` command to this file.\n\n.. code-block:: text\n\n $ celery -A make_celery worker --loglevel INFO\n $ celery -A make_celery beat --loglevel INFO\n\n\nDefining Tasks\n--------------\n\nUsing ``@celery_app.task`` to decorate task functions requires access to the\n``celery_app`` object, which won't be available when using the factory pattern. It also\nmeans that the decorated tasks are tied to the specific Flask and Celery app instances,\nwhich could be an issue during testing if you change configuration for a test.\n\nInstead, use Celery's ``@shared_task`` decorator. This creates task objects that will\naccess whatever the \"current app\" is, which is a similar concept to Flask's blueprints\nand app context. This is why we called ``celery_app.set_default()`` above.\n\nHere's an example task that adds two numbers together and returns the result.\n\n.. code-block:: python\n\n from celery import shared_task\n\n @shared_task(ignore_result=False)\n def add_together(a: int, b: int) -> int:\n return a + b\n\nEarlier, we configured Celery to ignore task results by default. Since we want to know\nthe return value of this task, we set ``ignore_result=False``. On the other hand, a task\nthat didn't need a result, such as sending an email, wouldn't set this.\n\n\nCalling Tasks\n-------------\n\nThe decorated function becomes a task object with methods to call it in the background.\nThe simplest way is to use the ``delay(*args, **kwargs)`` method. See Celery's docs for\nmore methods.\n\nA Celery worker must be running to run the task. Starting a worker is shown in the\nprevious sections.\n\n.. code-block:: python\n\n from flask import request\n\n @app.post(\"/add\")\n def start_add() -> dict[str, object]:\n a = request.form.get(\"a\", type=int)\n b = request.form.get(\"b\", type=int)\n result = add_together.delay(a, b)\n return {\"result_id\": result.id}\n\nThe route doesn't get the task's result immediately. That would defeat the purpose by\nblocking the response. Instead, we return the running task's result id, which we can use\nlater to get the result.\n\n\nGetting Results\n---------------\n\nTo fetch the result of the task we started above, we'll add another route that takes the\nresult id we returned before. We return whether the task is finished (ready), whether it\nfinished successfully, and what the return value (or error) was if it is finished.\n\n.. code-block:: python\n\n from celery.result import AsyncResult\n\n @app.get(\"/result/\")\n def task_result(id: str) -> dict[str, object]:\n result = AsyncResult(id)\n return {\n \"ready\": result.ready(),\n \"successful\": result.successful(),\n \"value\": result.result if result.ready() else None,\n }\n\nNow you can start the task using the first route, then poll for the result using the\nsecond route. This keeps the Flask request workers from being blocked waiting for tasks\nto finish.\n\nThe Flask repository contains `an example `_\nusing JavaScript to submit tasks and poll for progress and results.\n\n\nPassing Data to Tasks\n---------------------\n\nThe \"add\" task above took two integers as arguments. To pass arguments to tasks, Celery\nhas to serialize them to a format that it can pass to other processes. Therefore,\npassing complex objects is not recommended. For example, it would be impossible to pass\na SQLAlchemy model object, since that object is probably not serializable and is tied to\nthe session that queried it.\n\nPass the minimal amount of data necessary to fetch or recreate any complex data within\nthe task. Consider a task that will run when the logged in user asks for an archive of\ntheir data. The Flask request knows the logged in user, and has the user object queried\nfrom the database. It got that by querying the database for a given id, so the task can\ndo the same thing. Pass the user's id rather than the user object.\n\n.. code-block:: python\n\n @shared_task\n def generate_user_archive(user_id: str) -> None:\n user = db.session.get(User, user_id)\n ...\n\n generate_user_archive.delay(current_user.id)\n"},{"col":0,"comment":"null","endLoc":12,"header":"def copy(x: _T) -> _T","id":97,"name":"copy","nodeType":"Function","startLoc":12,"text":"def copy(x: _T) -> _T: ..."},{"fileName":"test_json_tag.py","filePath":"tests","id":98,"nodeType":"File","text":"from datetime import datetime\nfrom datetime import timezone\nfrom uuid import uuid4\n\nimport pytest\nfrom markupsafe import Markup\n\nfrom flask.json.tag import JSONTag\nfrom flask.json.tag import TaggedJSONSerializer\n\n\n@pytest.mark.parametrize(\n \"data\",\n (\n {\" t\": (1, 2, 3)},\n {\" t__\": b\"a\"},\n {\" di\": \" di\"},\n {\"x\": (1, 2, 3), \"y\": 4},\n (1, 2, 3),\n [(1, 2, 3)],\n b\"\\xff\",\n Markup(\"\"),\n uuid4(),\n datetime.now(tz=timezone.utc).replace(microsecond=0),\n ),\n)\ndef test_dump_load_unchanged(data):\n s = TaggedJSONSerializer()\n assert s.loads(s.dumps(data)) == data\n\n\ndef test_duplicate_tag():\n class TagDict(JSONTag):\n key = \" d\"\n\n s = TaggedJSONSerializer()\n pytest.raises(KeyError, s.register, TagDict)\n s.register(TagDict, force=True, index=0)\n assert isinstance(s.tags[\" d\"], TagDict)\n assert isinstance(s.order[0], TagDict)\n\n\ndef test_custom_tag():\n class Foo: # noqa: B903, for Python2 compatibility\n def __init__(self, data):\n self.data = data\n\n class TagFoo(JSONTag):\n __slots__ = ()\n key = \" f\"\n\n def check(self, value):\n return isinstance(value, Foo)\n\n def to_json(self, value):\n return self.serializer.tag(value.data)\n\n def to_python(self, value):\n return Foo(value)\n\n s = TaggedJSONSerializer()\n s.register(TagFoo)\n assert s.loads(s.dumps(Foo(\"bar\"))).data == \"bar\"\n\n\ndef test_tag_interface():\n t = JSONTag(None)\n pytest.raises(NotImplementedError, t.check, None)\n pytest.raises(NotImplementedError, t.to_json, None)\n pytest.raises(NotImplementedError, t.to_python, None)\n\n\ndef test_tag_order():\n class Tag1(JSONTag):\n key = \" 1\"\n\n class Tag2(JSONTag):\n key = \" 2\"\n\n s = TaggedJSONSerializer()\n\n s.register(Tag1, index=-1)\n assert isinstance(s.order[-2], Tag1)\n\n s.register(Tag2, index=None)\n assert isinstance(s.order[-1], Tag2)\n"},{"id":99,"name":"next.rst","nodeType":"TextFile","path":"docs/tutorial","text":"Keep Developing!\n================\n\nYou've learned about quite a few Flask and Python concepts throughout\nthe tutorial. Go back and review the tutorial and compare your code with\nthe steps you took to get there. Compare your project to the\n:gh:`example project `, which might look a bit\ndifferent due to the step-by-step nature of the tutorial.\n\nThere's a lot more to Flask than what you've seen so far. Even so,\nyou're now equipped to start developing your own web applications. Check\nout the :doc:`/quickstart` for an overview of what Flask can do, then\ndive into the docs to keep learning. Flask uses `Jinja`_, `Click`_,\n`Werkzeug`_, and `ItsDangerous`_ behind the scenes, and they all have\ntheir own documentation too. You'll also be interested in\n:doc:`/extensions` which make tasks like working with the database or\nvalidating form data easier and more powerful.\n\nIf you want to keep developing your Flaskr project, here are some ideas\nfor what to try next:\n\n* A detail view to show a single post. Click a post's title to go to\n its page.\n* Like / unlike a post.\n* Comments.\n* Tags. Clicking a tag shows all the posts with that tag.\n* A search box that filters the index page by name.\n* Paged display. Only show 5 posts per page.\n* Upload an image to go along with a post.\n* Format posts using Markdown.\n* An RSS feed of new posts.\n\nHave fun and make awesome applications!\n\n.. _Jinja: https://palletsprojects.com/p/jinja/\n.. _Click: https://palletsprojects.com/p/click/\n.. _Werkzeug: https://palletsprojects.com/p/werkzeug/\n.. _ItsDangerous: https://palletsprojects.com/p/itsdangerous/\n"},{"className":"datetime","col":0,"comment":"null","endLoc":331,"id":100,"nodeType":"Class","startLoc":229,"text":"class datetime(date):\n min: ClassVar[datetime]\n max: ClassVar[datetime]\n def __new__(\n cls,\n year: SupportsIndex,\n month: SupportsIndex,\n day: SupportsIndex,\n hour: SupportsIndex = ...,\n minute: SupportsIndex = ...,\n second: SupportsIndex = ...,\n microsecond: SupportsIndex = ...,\n tzinfo: _TzInfo | None = ...,\n *,\n fold: int = ...,\n ) -> Self: ...\n @property\n def hour(self) -> int: ...\n @property\n def minute(self) -> int: ...\n @property\n def second(self) -> int: ...\n @property\n def microsecond(self) -> int: ...\n @property\n def tzinfo(self) -> _TzInfo | None: ...\n @property\n def fold(self) -> int: ...\n # On <3.12, the name of the first parameter in the pure-Python implementation\n # didn't match the name in the C implementation,\n # meaning it is only *safe* to pass it as a keyword argument on 3.12+\n if sys.version_info >= (3, 12):\n @classmethod\n def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ...\n else:\n @classmethod\n def fromtimestamp(cls, __timestamp: float, tz: _TzInfo | None = ...) -> Self: ...\n\n @classmethod\n def utcfromtimestamp(cls, __t: float) -> Self: ...\n if sys.version_info >= (3, 8):\n @classmethod\n def now(cls, tz: _TzInfo | None = None) -> Self: ...\n else:\n @overload\n @classmethod\n def now(cls, tz: None = None) -> Self: ...\n @overload\n @classmethod\n def now(cls, tz: _TzInfo) -> datetime: ...\n\n @classmethod\n def utcnow(cls) -> Self: ...\n @classmethod\n def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> Self: ...\n def timestamp(self) -> float: ...\n def utctimetuple(self) -> struct_time: ...\n def date(self) -> _Date: ...\n def time(self) -> _Time: ...\n def timetz(self) -> _Time: ...\n def replace(\n self,\n year: SupportsIndex = ...,\n month: SupportsIndex = ...,\n day: SupportsIndex = ...,\n hour: SupportsIndex = ...,\n minute: SupportsIndex = ...,\n second: SupportsIndex = ...,\n microsecond: SupportsIndex = ...,\n tzinfo: _TzInfo | None = ...,\n *,\n fold: int = ...,\n ) -> Self: ...\n if sys.version_info >= (3, 8):\n def astimezone(self, tz: _TzInfo | None = ...) -> Self: ...\n else:\n def astimezone(self, tz: _TzInfo | None = ...) -> datetime: ...\n\n def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...\n @classmethod\n def strptime(cls, __date_string: str, __format: str) -> Self: ...\n def utcoffset(self) -> timedelta | None: ...\n def tzname(self) -> str | None: ...\n def dst(self) -> timedelta | None: ...\n def __le__(self, __value: datetime) -> bool: ... # type: ignore[override]\n def __lt__(self, __value: datetime) -> bool: ... # type: ignore[override]\n def __ge__(self, __value: datetime) -> bool: ... # type: ignore[override]\n def __gt__(self, __value: datetime) -> bool: ... # type: ignore[override]\n def __eq__(self, __value: object) -> bool: ...\n def __hash__(self) -> int: ...\n if sys.version_info >= (3, 8):\n @overload # type: ignore[override]\n def __sub__(self, __value: timedelta) -> Self: ...\n @overload\n def __sub__(self: _D, __value: _D) -> timedelta: ...\n else:\n # Prior to Python 3.8, arithmetic operations always returned `datetime`, even in subclasses\n def __add__(self, __value: timedelta) -> datetime: ...\n def __radd__(self, __value: timedelta) -> datetime: ...\n @overload # type: ignore[override]\n def __sub__(self, __value: datetime) -> timedelta: ...\n @overload\n def __sub__(self, __value: timedelta) -> datetime: ..."},{"id":101,"name":".github","nodeType":"Package"},{"id":102,"name":"dependabot.yml","nodeType":"TextFile","path":".github","text":"version: 2\nupdates:\n- package-ecosystem: \"github-actions\"\n directory: \"/\"\n schedule:\n interval: \"monthly\"\n day: \"monday\"\n time: \"16:00\"\n timezone: \"UTC\"\n"},{"className":"TracebackType","col":0,"comment":"null","endLoc":524,"id":103,"nodeType":"Class","startLoc":514,"text":"@final\nclass TracebackType:\n def __new__(cls, tb_next: TracebackType | None, tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> Self: ...\n tb_next: TracebackType | None\n # the rest are read-only even in 3.7\n @property\n def tb_frame(self) -> FrameType: ...\n @property\n def tb_lasti(self) -> int: ...\n @property\n def tb_lineno(self) -> int: ..."},{"id":104,"name":"requestchecksum.rst","nodeType":"TextFile","path":"docs/patterns","text":"Request Content Checksums\n=========================\n\nVarious pieces of code can consume the request data and preprocess it.\nFor instance JSON data ends up on the request object already read and\nprocessed, form data ends up there as well but goes through a different\ncode path. This seems inconvenient when you want to calculate the\nchecksum of the incoming request data. This is necessary sometimes for\nsome APIs.\n\nFortunately this is however very simple to change by wrapping the input\nstream.\n\nThe following example calculates the SHA1 checksum of the incoming data as\nit gets read and stores it in the WSGI environment::\n\n import hashlib\n\n class ChecksumCalcStream(object):\n\n def __init__(self, stream):\n self._stream = stream\n self._hash = hashlib.sha1()\n\n def read(self, bytes):\n rv = self._stream.read(bytes)\n self._hash.update(rv)\n return rv\n\n def readline(self, size_hint):\n rv = self._stream.readline(size_hint)\n self._hash.update(rv)\n return rv\n\n def generate_checksum(request):\n env = request.environ\n stream = ChecksumCalcStream(env['wsgi.input'])\n env['wsgi.input'] = stream\n return stream._hash\n\nTo use this, all you need to do is to hook the calculating stream in\nbefore the request starts consuming data. (Eg: be careful accessing\n``request.form`` or anything of that nature. ``before_request_handlers``\nfor instance should be careful not to access it).\n\nExample usage::\n\n @app.route('/special-api', methods=['POST'])\n def special_api():\n hash = generate_checksum(request)\n # Accessing this parses the input stream\n files = request.files\n # At this point the hash is fully constructed.\n checksum = hash.hexdigest()\n return f\"Hash was: {checksum}\"\n"},{"id":105,"name":"requirements","nodeType":"Package"},{"id":106,"name":"dev.in","nodeType":"TextFile","path":"requirements","text":"-r docs.in\n-r tests.in\n-r typing.in\npip-compile-multi\npre-commit\ntox\n"},{"fileName":"cli.py","filePath":"src/flask","id":107,"nodeType":"File","text":"from __future__ import annotations\n\nimport ast\nimport inspect\nimport os\nimport platform\nimport re\nimport sys\nimport traceback\nimport typing as t\nfrom functools import update_wrapper\nfrom operator import attrgetter\n\nimport click\nfrom click.core import ParameterSource\nfrom werkzeug import run_simple\nfrom werkzeug.serving import is_running_from_reloader\nfrom werkzeug.utils import import_string\n\nfrom .globals import current_app\nfrom .helpers import get_debug_flag\nfrom .helpers import get_load_dotenv\n\nif t.TYPE_CHECKING:\n from .app import Flask\n\n\nclass NoAppException(click.UsageError):\n \"\"\"Raised if an application cannot be found or loaded.\"\"\"\n\n\ndef find_best_app(module):\n \"\"\"Given a module instance this tries to find the best possible\n application in the module or raises an exception.\n \"\"\"\n from . import Flask\n\n # Search for the most common names first.\n for attr_name in (\"app\", \"application\"):\n app = getattr(module, attr_name, None)\n\n if isinstance(app, Flask):\n return app\n\n # Otherwise find the only object that is a Flask instance.\n matches = [v for v in module.__dict__.values() if isinstance(v, Flask)]\n\n if len(matches) == 1:\n return matches[0]\n elif len(matches) > 1:\n raise NoAppException(\n \"Detected multiple Flask applications in module\"\n f\" '{module.__name__}'. Use '{module.__name__}:name'\"\n \" to specify the correct one.\"\n )\n\n # Search for app factory functions.\n for attr_name in (\"create_app\", \"make_app\"):\n app_factory = getattr(module, attr_name, None)\n\n if inspect.isfunction(app_factory):\n try:\n app = app_factory()\n\n if isinstance(app, Flask):\n return app\n except TypeError as e:\n if not _called_with_wrong_args(app_factory):\n raise\n\n raise NoAppException(\n f\"Detected factory '{attr_name}' in module '{module.__name__}',\"\n \" but could not call it without arguments. Use\"\n f\" '{module.__name__}:{attr_name}(args)'\"\n \" to specify arguments.\"\n ) from e\n\n raise NoAppException(\n \"Failed to find Flask application or factory in module\"\n f\" '{module.__name__}'. Use '{module.__name__}:name'\"\n \" to specify one.\"\n )\n\n\ndef _called_with_wrong_args(f):\n \"\"\"Check whether calling a function raised a ``TypeError`` because\n the call failed or because something in the factory raised the\n error.\n\n :param f: The function that was called.\n :return: ``True`` if the call failed.\n \"\"\"\n tb = sys.exc_info()[2]\n\n try:\n while tb is not None:\n if tb.tb_frame.f_code is f.__code__:\n # In the function, it was called successfully.\n return False\n\n tb = tb.tb_next\n\n # Didn't reach the function.\n return True\n finally:\n # Delete tb to break a circular reference.\n # https://docs.python.org/2/library/sys.html#sys.exc_info\n del tb\n\n\ndef find_app_by_string(module, app_name):\n \"\"\"Check if the given string is a variable name or a function. Call\n a function to get the app instance, or return the variable directly.\n \"\"\"\n from . import Flask\n\n # Parse app_name as a single expression to determine if it's a valid\n # attribute name or function call.\n try:\n expr = ast.parse(app_name.strip(), mode=\"eval\").body\n except SyntaxError:\n raise NoAppException(\n f\"Failed to parse {app_name!r} as an attribute name or function call.\"\n ) from None\n\n if isinstance(expr, ast.Name):\n name = expr.id\n args = []\n kwargs = {}\n elif isinstance(expr, ast.Call):\n # Ensure the function name is an attribute name only.\n if not isinstance(expr.func, ast.Name):\n raise NoAppException(\n f\"Function reference must be a simple name: {app_name!r}.\"\n )\n\n name = expr.func.id\n\n # Parse the positional and keyword arguments as literals.\n try:\n args = [ast.literal_eval(arg) for arg in expr.args]\n kwargs = {kw.arg: ast.literal_eval(kw.value) for kw in expr.keywords}\n except ValueError:\n # literal_eval gives cryptic error messages, show a generic\n # message with the full expression instead.\n raise NoAppException(\n f\"Failed to parse arguments as literal values: {app_name!r}.\"\n ) from None\n else:\n raise NoAppException(\n f\"Failed to parse {app_name!r} as an attribute name or function call.\"\n )\n\n try:\n attr = getattr(module, name)\n except AttributeError as e:\n raise NoAppException(\n f\"Failed to find attribute {name!r} in {module.__name__!r}.\"\n ) from e\n\n # If the attribute is a function, call it with any args and kwargs\n # to get the real application.\n if inspect.isfunction(attr):\n try:\n app = attr(*args, **kwargs)\n except TypeError as e:\n if not _called_with_wrong_args(attr):\n raise\n\n raise NoAppException(\n f\"The factory {app_name!r} in module\"\n f\" {module.__name__!r} could not be called with the\"\n \" specified arguments.\"\n ) from e\n else:\n app = attr\n\n if isinstance(app, Flask):\n return app\n\n raise NoAppException(\n \"A valid Flask application was not obtained from\"\n f\" '{module.__name__}:{app_name}'.\"\n )\n\n\ndef prepare_import(path):\n \"\"\"Given a filename this will try to calculate the python path, add it\n to the search path and return the actual module name that is expected.\n \"\"\"\n path = os.path.realpath(path)\n\n fname, ext = os.path.splitext(path)\n if ext == \".py\":\n path = fname\n\n if os.path.basename(path) == \"__init__\":\n path = os.path.dirname(path)\n\n module_name = []\n\n # move up until outside package structure (no __init__.py)\n while True:\n path, name = os.path.split(path)\n module_name.append(name)\n\n if not os.path.exists(os.path.join(path, \"__init__.py\")):\n break\n\n if sys.path[0] != path:\n sys.path.insert(0, path)\n\n return \".\".join(module_name[::-1])\n\n\ndef locate_app(module_name, app_name, raise_if_not_found=True):\n try:\n __import__(module_name)\n except ImportError:\n # Reraise the ImportError if it occurred within the imported module.\n # Determine this by checking whether the trace has a depth > 1.\n if sys.exc_info()[2].tb_next:\n raise NoAppException(\n f\"While importing {module_name!r}, an ImportError was\"\n f\" raised:\\n\\n{traceback.format_exc()}\"\n ) from None\n elif raise_if_not_found:\n raise NoAppException(f\"Could not import {module_name!r}.\") from None\n else:\n return\n\n module = sys.modules[module_name]\n\n if app_name is None:\n return find_best_app(module)\n else:\n return find_app_by_string(module, app_name)\n\n\ndef get_version(ctx, param, value):\n if not value or ctx.resilient_parsing:\n return\n\n import werkzeug\n from . import __version__\n\n click.echo(\n f\"Python {platform.python_version()}\\n\"\n f\"Flask {__version__}\\n\"\n f\"Werkzeug {werkzeug.__version__}\",\n color=ctx.color,\n )\n ctx.exit()\n\n\nversion_option = click.Option(\n [\"--version\"],\n help=\"Show the Flask version.\",\n expose_value=False,\n callback=get_version,\n is_flag=True,\n is_eager=True,\n)\n\n\nclass ScriptInfo:\n \"\"\"Helper object to deal with Flask applications. This is usually not\n necessary to interface with as it's used internally in the dispatching\n to click. In future versions of Flask this object will most likely play\n a bigger role. Typically it's created automatically by the\n :class:`FlaskGroup` but you can also manually create it and pass it\n onwards as click object.\n \"\"\"\n\n def __init__(\n self,\n app_import_path: str | None = None,\n create_app: t.Callable[..., Flask] | None = None,\n set_debug_flag: bool = True,\n ) -> None:\n #: Optionally the import path for the Flask application.\n self.app_import_path = app_import_path\n #: Optionally a function that is passed the script info to create\n #: the instance of the application.\n self.create_app = create_app\n #: A dictionary with arbitrary data that can be associated with\n #: this script info.\n self.data: t.Dict[t.Any, t.Any] = {}\n self.set_debug_flag = set_debug_flag\n self._loaded_app: Flask | None = None\n\n def load_app(self) -> Flask:\n \"\"\"Loads the Flask app (if not yet loaded) and returns it. Calling\n this multiple times will just result in the already loaded app to\n be returned.\n \"\"\"\n if self._loaded_app is not None:\n return self._loaded_app\n\n if self.create_app is not None:\n app = self.create_app()\n else:\n if self.app_import_path:\n path, name = (\n re.split(r\":(?![\\\\/])\", self.app_import_path, 1) + [None]\n )[:2]\n import_name = prepare_import(path)\n app = locate_app(import_name, name)\n else:\n for path in (\"wsgi.py\", \"app.py\"):\n import_name = prepare_import(path)\n app = locate_app(import_name, None, raise_if_not_found=False)\n\n if app:\n break\n\n if not app:\n raise NoAppException(\n \"Could not locate a Flask application. Use the\"\n \" 'flask --app' option, 'FLASK_APP' environment\"\n \" variable, or a 'wsgi.py' or 'app.py' file in the\"\n \" current directory.\"\n )\n\n if self.set_debug_flag:\n # Update the app's debug flag through the descriptor so that\n # other values repopulate as well.\n app.debug = get_debug_flag()\n\n self._loaded_app = app\n return app\n\n\npass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True)\n\n\ndef with_appcontext(f):\n \"\"\"Wraps a callback so that it's guaranteed to be executed with the\n script's application context.\n\n Custom commands (and their options) registered under ``app.cli`` or\n ``blueprint.cli`` will always have an app context available, this\n decorator is not required in that case.\n\n .. versionchanged:: 2.2\n The app context is active for subcommands as well as the\n decorated callback. The app context is always available to\n ``app.cli`` command and parameter callbacks.\n \"\"\"\n\n @click.pass_context\n def decorator(__ctx, *args, **kwargs):\n if not current_app:\n app = __ctx.ensure_object(ScriptInfo).load_app()\n __ctx.with_resource(app.app_context())\n\n return __ctx.invoke(f, *args, **kwargs)\n\n return update_wrapper(decorator, f)\n\n\nclass AppGroup(click.Group):\n \"\"\"This works similar to a regular click :class:`~click.Group` but it\n changes the behavior of the :meth:`command` decorator so that it\n automatically wraps the functions in :func:`with_appcontext`.\n\n Not to be confused with :class:`FlaskGroup`.\n \"\"\"\n\n def command(self, *args, **kwargs):\n \"\"\"This works exactly like the method of the same name on a regular\n :class:`click.Group` but it wraps callbacks in :func:`with_appcontext`\n unless it's disabled by passing ``with_appcontext=False``.\n \"\"\"\n wrap_for_ctx = kwargs.pop(\"with_appcontext\", True)\n\n def decorator(f):\n if wrap_for_ctx:\n f = with_appcontext(f)\n return click.Group.command(self, *args, **kwargs)(f)\n\n return decorator\n\n def group(self, *args, **kwargs):\n \"\"\"This works exactly like the method of the same name on a regular\n :class:`click.Group` but it defaults the group class to\n :class:`AppGroup`.\n \"\"\"\n kwargs.setdefault(\"cls\", AppGroup)\n return click.Group.group(self, *args, **kwargs)\n\n\ndef _set_app(ctx: click.Context, param: click.Option, value: str | None) -> str | None:\n if value is None:\n return None\n\n info = ctx.ensure_object(ScriptInfo)\n info.app_import_path = value\n return value\n\n\n# This option is eager so the app will be available if --help is given.\n# --help is also eager, so --app must be before it in the param list.\n# no_args_is_help bypasses eager processing, so this option must be\n# processed manually in that case to ensure FLASK_APP gets picked up.\n_app_option = click.Option(\n [\"-A\", \"--app\"],\n metavar=\"IMPORT\",\n help=(\n \"The Flask application or factory function to load, in the form 'module:name'.\"\n \" Module can be a dotted import or file path. Name is not required if it is\"\n \" 'app', 'application', 'create_app', or 'make_app', and can be 'name(args)' to\"\n \" pass arguments.\"\n ),\n is_eager=True,\n expose_value=False,\n callback=_set_app,\n)\n\n\ndef _set_debug(ctx: click.Context, param: click.Option, value: bool) -> bool | None:\n # If the flag isn't provided, it will default to False. Don't use\n # that, let debug be set by env in that case.\n source = ctx.get_parameter_source(param.name) # type: ignore[arg-type]\n\n if source is not None and source in (\n ParameterSource.DEFAULT,\n ParameterSource.DEFAULT_MAP,\n ):\n return None\n\n # Set with env var instead of ScriptInfo.load so that it can be\n # accessed early during a factory function.\n os.environ[\"FLASK_DEBUG\"] = \"1\" if value else \"0\"\n return value\n\n\n_debug_option = click.Option(\n [\"--debug/--no-debug\"],\n help=\"Set debug mode.\",\n expose_value=False,\n callback=_set_debug,\n)\n\n\ndef _env_file_callback(\n ctx: click.Context, param: click.Option, value: str | None\n) -> str | None:\n if value is None:\n return None\n\n import importlib\n\n try:\n importlib.import_module(\"dotenv\")\n except ImportError:\n raise click.BadParameter(\n \"python-dotenv must be installed to load an env file.\",\n ctx=ctx,\n param=param,\n ) from None\n\n # Don't check FLASK_SKIP_DOTENV, that only disables automatically\n # loading .env and .flaskenv files.\n load_dotenv(value)\n return value\n\n\n# This option is eager so env vars are loaded as early as possible to be\n# used by other options.\n_env_file_option = click.Option(\n [\"-e\", \"--env-file\"],\n type=click.Path(exists=True, dir_okay=False),\n help=\"Load environment variables from this file. python-dotenv must be installed.\",\n is_eager=True,\n expose_value=False,\n callback=_env_file_callback,\n)\n\n\nclass FlaskGroup(AppGroup):\n \"\"\"Special subclass of the :class:`AppGroup` group that supports\n loading more commands from the configured Flask app. Normally a\n developer does not have to interface with this class but there are\n some very advanced use cases for which it makes sense to create an\n instance of this. see :ref:`custom-scripts`.\n\n :param add_default_commands: if this is True then the default run and\n shell commands will be added.\n :param add_version_option: adds the ``--version`` option.\n :param create_app: an optional callback that is passed the script info and\n returns the loaded app.\n :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`\n files to set environment variables. Will also change the working\n directory to the directory containing the first file found.\n :param set_debug_flag: Set the app's debug flag.\n\n .. versionchanged:: 2.2\n Added the ``-A/--app``, ``--debug/--no-debug``, ``-e/--env-file`` options.\n\n .. versionchanged:: 2.2\n An app context is pushed when running ``app.cli`` commands, so\n ``@with_appcontext`` is no longer required for those commands.\n\n .. versionchanged:: 1.0\n If installed, python-dotenv will be used to load environment variables\n from :file:`.env` and :file:`.flaskenv` files.\n \"\"\"\n\n def __init__(\n self,\n add_default_commands: bool = True,\n create_app: t.Callable[..., Flask] | None = None,\n add_version_option: bool = True,\n load_dotenv: bool = True,\n set_debug_flag: bool = True,\n **extra: t.Any,\n ) -> None:\n params = list(extra.pop(\"params\", None) or ())\n # Processing is done with option callbacks instead of a group\n # callback. This allows users to make a custom group callback\n # without losing the behavior. --env-file must come first so\n # that it is eagerly evaluated before --app.\n params.extend((_env_file_option, _app_option, _debug_option))\n\n if add_version_option:\n params.append(version_option)\n\n if \"context_settings\" not in extra:\n extra[\"context_settings\"] = {}\n\n extra[\"context_settings\"].setdefault(\"auto_envvar_prefix\", \"FLASK\")\n\n super().__init__(params=params, **extra)\n\n self.create_app = create_app\n self.load_dotenv = load_dotenv\n self.set_debug_flag = set_debug_flag\n\n if add_default_commands:\n self.add_command(run_command)\n self.add_command(shell_command)\n self.add_command(routes_command)\n\n self._loaded_plugin_commands = False\n\n def _load_plugin_commands(self):\n if self._loaded_plugin_commands:\n return\n\n if sys.version_info >= (3, 10):\n from importlib import metadata\n else:\n # Use a backport on Python < 3.10. We technically have\n # importlib.metadata on 3.8+, but the API changed in 3.10,\n # so use the backport for consistency.\n import importlib_metadata as metadata\n\n for ep in metadata.entry_points(group=\"flask.commands\"):\n self.add_command(ep.load(), ep.name)\n\n self._loaded_plugin_commands = True\n\n def get_command(self, ctx, name):\n self._load_plugin_commands()\n # Look up built-in and plugin commands, which should be\n # available even if the app fails to load.\n rv = super().get_command(ctx, name)\n\n if rv is not None:\n return rv\n\n info = ctx.ensure_object(ScriptInfo)\n\n # Look up commands provided by the app, showing an error and\n # continuing if the app couldn't be loaded.\n try:\n app = info.load_app()\n except NoAppException as e:\n click.secho(f\"Error: {e.format_message()}\\n\", err=True, fg=\"red\")\n return None\n\n # Push an app context for the loaded app unless it is already\n # active somehow. This makes the context available to parameter\n # and command callbacks without needing @with_appcontext.\n if not current_app or current_app._get_current_object() is not app:\n ctx.with_resource(app.app_context())\n\n return app.cli.get_command(ctx, name)\n\n def list_commands(self, ctx):\n self._load_plugin_commands()\n # Start with the built-in and plugin commands.\n rv = set(super().list_commands(ctx))\n info = ctx.ensure_object(ScriptInfo)\n\n # Add commands provided by the app, showing an error and\n # continuing if the app couldn't be loaded.\n try:\n rv.update(info.load_app().cli.list_commands(ctx))\n except NoAppException as e:\n # When an app couldn't be loaded, show the error message\n # without the traceback.\n click.secho(f\"Error: {e.format_message()}\\n\", err=True, fg=\"red\")\n except Exception:\n # When any other errors occurred during loading, show the\n # full traceback.\n click.secho(f\"{traceback.format_exc()}\\n\", err=True, fg=\"red\")\n\n return sorted(rv)\n\n def make_context(\n self,\n info_name: str | None,\n args: list[str],\n parent: click.Context | None = None,\n **extra: t.Any,\n ) -> click.Context:\n # Set a flag to tell app.run to become a no-op. If app.run was\n # not in a __name__ == __main__ guard, it would start the server\n # when importing, blocking whatever command is being called.\n os.environ[\"FLASK_RUN_FROM_CLI\"] = \"true\"\n\n # Attempt to load .env and .flask env files. The --env-file\n # option can cause another file to be loaded.\n if get_load_dotenv(self.load_dotenv):\n load_dotenv()\n\n if \"obj\" not in extra and \"obj\" not in self.context_settings:\n extra[\"obj\"] = ScriptInfo(\n create_app=self.create_app, set_debug_flag=self.set_debug_flag\n )\n\n return super().make_context(info_name, args, parent=parent, **extra)\n\n def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]:\n if not args and self.no_args_is_help:\n # Attempt to load --env-file and --app early in case they\n # were given as env vars. Otherwise no_args_is_help will not\n # see commands from app.cli.\n _env_file_option.handle_parse_result(ctx, {}, [])\n _app_option.handle_parse_result(ctx, {}, [])\n\n return super().parse_args(ctx, args)\n\n\ndef _path_is_ancestor(path, other):\n \"\"\"Take ``other`` and remove the length of ``path`` from it. Then join it\n to ``path``. If it is the original value, ``path`` is an ancestor of\n ``other``.\"\"\"\n return os.path.join(path, other[len(path) :].lstrip(os.sep)) == other\n\n\ndef load_dotenv(path: str | os.PathLike | None = None) -> bool:\n \"\"\"Load \"dotenv\" files in order of precedence to set environment variables.\n\n If an env var is already set it is not overwritten, so earlier files in the\n list are preferred over later files.\n\n This is a no-op if `python-dotenv`_ is not installed.\n\n .. _python-dotenv: https://github.com/theskumar/python-dotenv#readme\n\n :param path: Load the file at this location instead of searching.\n :return: ``True`` if a file was loaded.\n\n .. versionchanged:: 2.0\n The current directory is not changed to the location of the\n loaded file.\n\n .. versionchanged:: 2.0\n When loading the env files, set the default encoding to UTF-8.\n\n .. versionchanged:: 1.1.0\n Returns ``False`` when python-dotenv is not installed, or when\n the given path isn't a file.\n\n .. versionadded:: 1.0\n \"\"\"\n try:\n import dotenv\n except ImportError:\n if path or os.path.isfile(\".env\") or os.path.isfile(\".flaskenv\"):\n click.secho(\n \" * Tip: There are .env or .flaskenv files present.\"\n ' Do \"pip install python-dotenv\" to use them.',\n fg=\"yellow\",\n err=True,\n )\n\n return False\n\n # Always return after attempting to load a given path, don't load\n # the default files.\n if path is not None:\n if os.path.isfile(path):\n return dotenv.load_dotenv(path, encoding=\"utf-8\")\n\n return False\n\n loaded = False\n\n for name in (\".env\", \".flaskenv\"):\n path = dotenv.find_dotenv(name, usecwd=True)\n\n if not path:\n continue\n\n dotenv.load_dotenv(path, encoding=\"utf-8\")\n loaded = True\n\n return loaded # True if at least one file was located and loaded.\n\n\ndef show_server_banner(debug, app_import_path):\n \"\"\"Show extra startup messages the first time the server is run,\n ignoring the reloader.\n \"\"\"\n if is_running_from_reloader():\n return\n\n if app_import_path is not None:\n click.echo(f\" * Serving Flask app '{app_import_path}'\")\n\n if debug is not None:\n click.echo(f\" * Debug mode: {'on' if debug else 'off'}\")\n\n\nclass CertParamType(click.ParamType):\n \"\"\"Click option type for the ``--cert`` option. Allows either an\n existing file, the string ``'adhoc'``, or an import for a\n :class:`~ssl.SSLContext` object.\n \"\"\"\n\n name = \"path\"\n\n def __init__(self):\n self.path_type = click.Path(exists=True, dir_okay=False, resolve_path=True)\n\n def convert(self, value, param, ctx):\n try:\n import ssl\n except ImportError:\n raise click.BadParameter(\n 'Using \"--cert\" requires Python to be compiled with SSL support.',\n ctx,\n param,\n ) from None\n\n try:\n return self.path_type(value, param, ctx)\n except click.BadParameter:\n value = click.STRING(value, param, ctx).lower()\n\n if value == \"adhoc\":\n try:\n import cryptography # noqa: F401\n except ImportError:\n raise click.BadParameter(\n \"Using ad-hoc certificates requires the cryptography library.\",\n ctx,\n param,\n ) from None\n\n return value\n\n obj = import_string(value, silent=True)\n\n if isinstance(obj, ssl.SSLContext):\n return obj\n\n raise\n\n\ndef _validate_key(ctx, param, value):\n \"\"\"The ``--key`` option must be specified when ``--cert`` is a file.\n Modifies the ``cert`` param to be a ``(cert, key)`` pair if needed.\n \"\"\"\n cert = ctx.params.get(\"cert\")\n is_adhoc = cert == \"adhoc\"\n\n try:\n import ssl\n except ImportError:\n is_context = False\n else:\n is_context = isinstance(cert, ssl.SSLContext)\n\n if value is not None:\n if is_adhoc:\n raise click.BadParameter(\n 'When \"--cert\" is \"adhoc\", \"--key\" is not used.', ctx, param\n )\n\n if is_context:\n raise click.BadParameter(\n 'When \"--cert\" is an SSLContext object, \"--key is not used.', ctx, param\n )\n\n if not cert:\n raise click.BadParameter('\"--cert\" must also be specified.', ctx, param)\n\n ctx.params[\"cert\"] = cert, value\n\n else:\n if cert and not (is_adhoc or is_context):\n raise click.BadParameter('Required when using \"--cert\".', ctx, param)\n\n return value\n\n\nclass SeparatedPathType(click.Path):\n \"\"\"Click option type that accepts a list of values separated by the\n OS's path separator (``:``, ``;`` on Windows). Each value is\n validated as a :class:`click.Path` type.\n \"\"\"\n\n def convert(self, value, param, ctx):\n items = self.split_envvar_value(value)\n super_convert = super().convert\n return [super_convert(item, param, ctx) for item in items]\n\n\n@click.command(\"run\", short_help=\"Run a development server.\")\n@click.option(\"--host\", \"-h\", default=\"127.0.0.1\", help=\"The interface to bind to.\")\n@click.option(\"--port\", \"-p\", default=5000, help=\"The port to bind to.\")\n@click.option(\n \"--cert\",\n type=CertParamType(),\n help=\"Specify a certificate file to use HTTPS.\",\n is_eager=True,\n)\n@click.option(\n \"--key\",\n type=click.Path(exists=True, dir_okay=False, resolve_path=True),\n callback=_validate_key,\n expose_value=False,\n help=\"The key file to use when specifying a certificate.\",\n)\n@click.option(\n \"--reload/--no-reload\",\n default=None,\n help=\"Enable or disable the reloader. By default the reloader \"\n \"is active if debug is enabled.\",\n)\n@click.option(\n \"--debugger/--no-debugger\",\n default=None,\n help=\"Enable or disable the debugger. By default the debugger \"\n \"is active if debug is enabled.\",\n)\n@click.option(\n \"--with-threads/--without-threads\",\n default=True,\n help=\"Enable or disable multithreading.\",\n)\n@click.option(\n \"--extra-files\",\n default=None,\n type=SeparatedPathType(),\n help=(\n \"Extra files that trigger a reload on change. Multiple paths\"\n f\" are separated by {os.path.pathsep!r}.\"\n ),\n)\n@click.option(\n \"--exclude-patterns\",\n default=None,\n type=SeparatedPathType(),\n help=(\n \"Files matching these fnmatch patterns will not trigger a reload\"\n \" on change. Multiple patterns are separated by\"\n f\" {os.path.pathsep!r}.\"\n ),\n)\n@pass_script_info\ndef run_command(\n info,\n host,\n port,\n reload,\n debugger,\n with_threads,\n cert,\n extra_files,\n exclude_patterns,\n):\n \"\"\"Run a local development server.\n\n This server is for development purposes only. It does not provide\n the stability, security, or performance of production WSGI servers.\n\n The reloader and debugger are enabled by default with the '--debug'\n option.\n \"\"\"\n try:\n app = info.load_app()\n except Exception as e:\n if is_running_from_reloader():\n # When reloading, print out the error immediately, but raise\n # it later so the debugger or server can handle it.\n traceback.print_exc()\n err = e\n\n def app(environ, start_response):\n raise err from None\n\n else:\n # When not reloading, raise the error immediately so the\n # command fails.\n raise e from None\n\n debug = get_debug_flag()\n\n if reload is None:\n reload = debug\n\n if debugger is None:\n debugger = debug\n\n show_server_banner(debug, info.app_import_path)\n\n run_simple(\n host,\n port,\n app,\n use_reloader=reload,\n use_debugger=debugger,\n threaded=with_threads,\n ssl_context=cert,\n extra_files=extra_files,\n exclude_patterns=exclude_patterns,\n )\n\n\nrun_command.params.insert(0, _debug_option)\n\n\n@click.command(\"shell\", short_help=\"Run a shell in the app context.\")\n@with_appcontext\ndef shell_command() -> None:\n \"\"\"Run an interactive Python shell in the context of a given\n Flask application. The application will populate the default\n namespace of this shell according to its configuration.\n\n This is useful for executing small snippets of management code\n without having to manually configure the application.\n \"\"\"\n import code\n\n banner = (\n f\"Python {sys.version} on {sys.platform}\\n\"\n f\"App: {current_app.import_name}\\n\"\n f\"Instance: {current_app.instance_path}\"\n )\n ctx: dict = {}\n\n # Support the regular Python interpreter startup script if someone\n # is using it.\n startup = os.environ.get(\"PYTHONSTARTUP\")\n if startup and os.path.isfile(startup):\n with open(startup) as f:\n eval(compile(f.read(), startup, \"exec\"), ctx)\n\n ctx.update(current_app.make_shell_context())\n\n # Site, customize, or startup script can set a hook to call when\n # entering interactive mode. The default one sets up readline with\n # tab and history completion.\n interactive_hook = getattr(sys, \"__interactivehook__\", None)\n\n if interactive_hook is not None:\n try:\n import readline\n from rlcompleter import Completer\n except ImportError:\n pass\n else:\n # rlcompleter uses __main__.__dict__ by default, which is\n # flask.__main__. Use the shell context instead.\n readline.set_completer(Completer(ctx).complete)\n\n interactive_hook()\n\n code.interact(banner=banner, local=ctx)\n\n\n@click.command(\"routes\", short_help=\"Show the routes for the app.\")\n@click.option(\n \"--sort\",\n \"-s\",\n type=click.Choice((\"endpoint\", \"methods\", \"rule\", \"match\")),\n default=\"endpoint\",\n help=(\n 'Method to sort routes by. \"match\" is the order that Flask will match '\n \"routes when dispatching a request.\"\n ),\n)\n@click.option(\"--all-methods\", is_flag=True, help=\"Show HEAD and OPTIONS methods.\")\n@with_appcontext\ndef routes_command(sort: str, all_methods: bool) -> None:\n \"\"\"Show all registered routes with endpoints and methods.\"\"\"\n\n rules = list(current_app.url_map.iter_rules())\n if not rules:\n click.echo(\"No routes were registered.\")\n return\n\n ignored_methods = set(() if all_methods else (\"HEAD\", \"OPTIONS\"))\n\n if sort in (\"endpoint\", \"rule\"):\n rules = sorted(rules, key=attrgetter(sort))\n elif sort == \"methods\":\n rules = sorted(rules, key=lambda rule: sorted(rule.methods)) # type: ignore\n\n rule_methods = [\n \", \".join(sorted(rule.methods - ignored_methods)) # type: ignore\n for rule in rules\n ]\n\n headers = (\"Endpoint\", \"Methods\", \"Rule\")\n widths = (\n max(len(rule.endpoint) for rule in rules),\n max(len(methods) for methods in rule_methods),\n max(len(rule.rule) for rule in rules),\n )\n widths = [max(len(h), w) for h, w in zip(headers, widths)]\n row = \"{{0:<{0}}} {{1:<{1}}} {{2:<{2}}}\".format(*widths)\n\n click.echo(row.format(*headers).strip())\n click.echo(row.format(*(\"-\" * width for width in widths)))\n\n for rule, methods in zip(rules, rule_methods):\n click.echo(row.format(rule.endpoint, methods, rule.rule).rstrip())\n\n\ncli = FlaskGroup(\n name=\"flask\",\n help=\"\"\"\\\nA general utility script for Flask applications.\n\nAn application to load must be given with the '--app' option,\n'FLASK_APP' environment variable, or with a 'wsgi.py' or 'app.py' file\nin the current directory.\n\"\"\",\n)\n\n\ndef main() -> None:\n cli.main()\n\n\nif __name__ == \"__main__\":\n main()\n"},{"attributeType":"_Feature","col":0,"comment":"null","endLoc":20,"id":108,"name":"annotations","nodeType":"Attribute","startLoc":20,"text":"annotations"},{"id":109,"name":"docs/deploying","nodeType":"Package"},{"id":110,"name":"gunicorn.rst","nodeType":"TextFile","path":"docs/deploying","text":"Gunicorn\n========\n\n`Gunicorn`_ is a pure Python WSGI server with simple configuration and\nmultiple worker implementations for performance tuning.\n\n* It tends to integrate easily with hosting platforms.\n* It does not support Windows (but does run on WSL).\n* It is easy to install as it does not require additional dependencies\n or compilation.\n* It has built-in async worker support using gevent or eventlet.\n\nThis page outlines the basics of running Gunicorn. Be sure to read its\n`documentation`_ and use ``gunicorn --help`` to understand what features\nare available.\n\n.. _Gunicorn: https://gunicorn.org/\n.. _documentation: https://docs.gunicorn.org/\n\n\nInstalling\n----------\n\nGunicorn is easy to install, as it does not require external\ndependencies or compilation. It runs on Windows only under WSL.\n\nCreate a virtualenv, install your application, then install\n``gunicorn``.\n\n.. code-block:: text\n\n $ cd hello-app\n $ python -m venv .venv\n $ . .venv/bin/activate\n $ pip install . # install your application\n $ pip install gunicorn\n\n\nRunning\n-------\n\nThe only required argument to Gunicorn tells it how to load your Flask\napplication. The syntax is ``{module_import}:{app_variable}``.\n``module_import`` is the dotted import name to the module with your\napplication. ``app_variable`` is the variable with the application. It\ncan also be a function call (with any arguments) if you're using the\napp factory pattern.\n\n.. code-block:: text\n\n # equivalent to 'from hello import app'\n $ gunicorn -w 4 'hello:app'\n\n # equivalent to 'from hello import create_app; create_app()'\n $ gunicorn -w 4 'hello:create_app()'\n\n Starting gunicorn 20.1.0\n Listening at: http://127.0.0.1:8000 (x)\n Using worker: sync\n Booting worker with pid: x\n Booting worker with pid: x\n Booting worker with pid: x\n Booting worker with pid: x\n\nThe ``-w`` option specifies the number of processes to run; a starting\nvalue could be ``CPU * 2``. The default is only 1 worker, which is\nprobably not what you want for the default worker type.\n\nLogs for each request aren't shown by default, only worker info and\nerrors are shown. To show access logs on stdout, use the\n``--access-logfile=-`` option.\n\n\nBinding Externally\n------------------\n\nGunicorn should not be run as root because it would cause your\napplication code to run as root, which is not secure. However, this\nmeans it will not be possible to bind to port 80 or 443. Instead, a\nreverse proxy such as :doc:`nginx` or :doc:`apache-httpd` should be used\nin front of Gunicorn.\n\nYou can bind to all external IPs on a non-privileged port using the\n``-b 0.0.0.0`` option. Don't do this when using a reverse proxy setup,\notherwise it will be possible to bypass the proxy.\n\n.. code-block:: text\n\n $ gunicorn -w 4 -b 0.0.0.0 'hello:create_app()'\n Listening at: http://0.0.0.0:8000 (x)\n\n``0.0.0.0`` is not a valid address to navigate to, you'd use a specific\nIP address in your browser.\n\n\nAsync with gevent or eventlet\n-----------------------------\n\nThe default sync worker is appropriate for many use cases. If you need\nasynchronous support, Gunicorn provides workers using either `gevent`_\nor `eventlet`_. This is not the same as Python's ``async/await``, or the\nASGI server spec. You must actually use gevent/eventlet in your own code\nto see any benefit to using the workers.\n\nWhen using either gevent or eventlet, greenlet>=1.0 is required,\notherwise context locals such as ``request`` will not work as expected.\nWhen using PyPy, PyPy>=7.3.7 is required.\n\nTo use gevent:\n\n.. code-block:: text\n\n $ gunicorn -k gevent 'hello:create_app()'\n Starting gunicorn 20.1.0\n Listening at: http://127.0.0.1:8000 (x)\n Using worker: gevent\n Booting worker with pid: x\n\nTo use eventlet:\n\n.. code-block:: text\n\n $ gunicorn -k eventlet 'hello:create_app()'\n Starting gunicorn 20.1.0\n Listening at: http://127.0.0.1:8000 (x)\n Using worker: eventlet\n Booting worker with pid: x\n\n.. _gevent: https://www.gevent.org/\n.. _eventlet: https://eventlet.net/\n"},{"col":4,"comment":"null","endLoc":106,"header":"def update_wrapper(\n wrapper: Callable[_PWrapper, _RWrapper],\n wrapped: Callable[_PWrapped, _RWrapped],\n assigned: Sequence[str] = (\"__module__\", \"__name__\", \"__qualname__\", \"__doc__\", \"__annotations__\", \"__type_params__\"),\n updated","id":111,"name":"update_wrapper","nodeType":"Function","startLoc":101,"text":"def update_wrapper(\n wrapper: Callable[_PWrapper, _RWrapper],\n wrapped: Callable[_PWrapped, _RWrapped],\n assigned: Sequence[str] = (\"__module__\", \"__name__\", \"__qualname__\", \"__doc__\", \"__annotations__\", \"__type_params__\"),\n updated: Sequence[str] = (\"__dict__\",),\n ) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWrapper]: ..."},{"className":"date","col":0,"comment":"null","endLoc":118,"id":112,"nodeType":"Class","startLoc":50,"text":"class date:\n min: ClassVar[date]\n max: ClassVar[date]\n resolution: ClassVar[timedelta]\n def __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> Self: ...\n @classmethod\n def fromtimestamp(cls, __timestamp: float) -> Self: ...\n @classmethod\n def today(cls) -> Self: ...\n @classmethod\n def fromordinal(cls, __n: int) -> Self: ...\n @classmethod\n def fromisoformat(cls, __date_string: str) -> Self: ...\n if sys.version_info >= (3, 8):\n @classmethod\n def fromisocalendar(cls, year: int, week: int, day: int) -> Self: ...\n\n @property\n def year(self) -> int: ...\n @property\n def month(self) -> int: ...\n @property\n def day(self) -> int: ...\n def ctime(self) -> str: ...\n # On <3.12, the name of the parameter in the pure-Python implementation\n # didn't match the name in the C implementation,\n # meaning it is only *safe* to pass it as a keyword argument on 3.12+\n if sys.version_info >= (3, 12):\n def strftime(self, format: str) -> str: ...\n else:\n def strftime(self, __format: str) -> str: ...\n\n def __format__(self, __fmt: str) -> str: ...\n def isoformat(self) -> str: ...\n def timetuple(self) -> struct_time: ...\n def toordinal(self) -> int: ...\n def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ...\n def __le__(self, __value: date) -> bool: ...\n def __lt__(self, __value: date) -> bool: ...\n def __ge__(self, __value: date) -> bool: ...\n def __gt__(self, __value: date) -> bool: ...\n def __eq__(self, __value: object) -> bool: ...\n if sys.version_info >= (3, 8):\n def __add__(self, __value: timedelta) -> Self: ...\n def __radd__(self, __value: timedelta) -> Self: ...\n @overload\n def __sub__(self, __value: timedelta) -> Self: ...\n @overload\n def __sub__(self, __value: datetime) -> NoReturn: ...\n @overload\n def __sub__(self: _D, __value: _D) -> timedelta: ...\n else:\n # Prior to Python 3.8, arithmetic operations always returned `date`, even in subclasses\n def __add__(self, __value: timedelta) -> date: ...\n def __radd__(self, __value: timedelta) -> date: ...\n @overload\n def __sub__(self, __value: timedelta) -> date: ...\n @overload\n def __sub__(self, __value: datetime) -> NoReturn: ...\n @overload\n def __sub__(self, __value: date) -> timedelta: ...\n\n def __hash__(self) -> int: ...\n def weekday(self) -> int: ...\n def isoweekday(self) -> int: ...\n if sys.version_info >= (3, 9):\n def isocalendar(self) -> _IsoCalendarDate: ...\n else:\n def isocalendar(self) -> tuple[int, int, int]: ..."},{"col":4,"comment":"null","endLoc":54,"header":"def __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> Self","id":113,"name":"__new__","nodeType":"Function","startLoc":54,"text":"def __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> Self: ..."},{"col":4,"comment":"null","endLoc":56,"header":"@classmethod\n def fromtimestamp(cls, __timestamp: float) -> Self","id":114,"name":"fromtimestamp","nodeType":"Function","startLoc":55,"text":"@classmethod\n def fromtimestamp(cls, __timestamp: float) -> Self: ..."},{"col":4,"comment":"null","endLoc":58,"header":"@classmethod\n def today(cls) -> Self","id":115,"name":"today","nodeType":"Function","startLoc":57,"text":"@classmethod\n def today(cls) -> Self: ..."},{"col":4,"comment":"null","endLoc":60,"header":"@classmethod\n def fromordinal(cls, __n: int) -> Self","id":116,"name":"fromordinal","nodeType":"Function","startLoc":59,"text":"@classmethod\n def fromordinal(cls, __n: int) -> Self: ..."},{"col":4,"comment":"null","endLoc":62,"header":"@classmethod\n def fromisoformat(cls, __date_string: str) -> Self","id":117,"name":"fromisoformat","nodeType":"Function","startLoc":61,"text":"@classmethod\n def fromisoformat(cls, __date_string: str) -> Self: ..."},{"col":8,"comment":"null","endLoc":65,"header":"@classmethod\n def fromisocalendar(cls, year: int, week: int, day: int) -> Self","id":118,"name":"fromisocalendar","nodeType":"Function","startLoc":64,"text":"@classmethod\n def fromisocalendar(cls, year: int, week: int, day: int) -> Self: ..."},{"col":4,"comment":"null","endLoc":68,"header":"@property\n def year(self) -> int","id":119,"name":"year","nodeType":"Function","startLoc":67,"text":"@property\n def year(self) -> int: ..."},{"col":4,"comment":"null","endLoc":70,"header":"@property\n def month(self) -> int","id":120,"name":"month","nodeType":"Function","startLoc":69,"text":"@property\n def month(self) -> int: ..."},{"col":4,"comment":"null","endLoc":72,"header":"@property\n def day(self) -> int","id":121,"name":"day","nodeType":"Function","startLoc":71,"text":"@property\n def day(self) -> int: ..."},{"col":4,"comment":"null","endLoc":73,"header":"def ctime(self) -> str","id":122,"name":"ctime","nodeType":"Function","startLoc":73,"text":"def ctime(self) -> str: ..."},{"col":8,"comment":"null","endLoc":78,"header":"def strftime(self, format: str) -> str","id":123,"name":"strftime","nodeType":"Function","startLoc":78,"text":"def strftime(self, format: str) -> str: ..."},{"col":8,"comment":"null","endLoc":80,"header":"def strftime(self, __format: str) -> str","id":124,"name":"strftime","nodeType":"Function","startLoc":80,"text":"def strftime(self, __format: str) -> str: ..."},{"col":4,"comment":"null","endLoc":82,"header":"def __format__(self, __fmt: str) -> str","id":125,"name":"__format__","nodeType":"Function","startLoc":82,"text":"def __format__(self, __fmt: str) -> str: ..."},{"col":4,"comment":"null","endLoc":83,"header":"def isoformat(self) -> str","id":126,"name":"isoformat","nodeType":"Function","startLoc":83,"text":"def isoformat(self) -> str: ..."},{"col":4,"comment":"null","endLoc":84,"header":"def timetuple(self) -> struct_time","id":127,"name":"timetuple","nodeType":"Function","startLoc":84,"text":"def timetuple(self) -> struct_time: ..."},{"col":4,"comment":"null","endLoc":85,"header":"def toordinal(self) -> int","id":128,"name":"toordinal","nodeType":"Function","startLoc":85,"text":"def toordinal(self) -> int: ..."},{"col":4,"comment":"null","endLoc":86,"header":"def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self","id":129,"name":"replace","nodeType":"Function","startLoc":86,"text":"def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ..."},{"col":4,"comment":"null","endLoc":87,"header":"def __le__(self, __value: date) -> bool","id":130,"name":"__le__","nodeType":"Function","startLoc":87,"text":"def __le__(self, __value: date) -> bool: ..."},{"col":4,"comment":"null","endLoc":88,"header":"def __lt__(self, __value: date) -> bool","id":131,"name":"__lt__","nodeType":"Function","startLoc":88,"text":"def __lt__(self, __value: date) -> bool: ..."},{"col":4,"comment":"null","endLoc":89,"header":"def __ge__(self, __value: date) -> bool","id":132,"name":"__ge__","nodeType":"Function","startLoc":89,"text":"def __ge__(self, __value: date) -> bool: ..."},{"fileName":"sessions.py","filePath":"src/flask","id":133,"nodeType":"File","text":"import hashlib\nimport typing as t\nimport warnings\nfrom collections.abc import MutableMapping\nfrom datetime import datetime\nfrom datetime import timezone\n\nfrom itsdangerous import BadSignature\nfrom itsdangerous import URLSafeTimedSerializer\nfrom werkzeug.datastructures import CallbackDict\n\nfrom .helpers import is_ip\nfrom .json.tag import TaggedJSONSerializer\n\nif t.TYPE_CHECKING: # pragma: no cover\n import typing_extensions as te\n from .app import Flask\n from .wrappers import Request, Response\n\n\nclass SessionMixin(MutableMapping):\n \"\"\"Expands a basic dictionary with session attributes.\"\"\"\n\n @property\n def permanent(self) -> bool:\n \"\"\"This reflects the ``'_permanent'`` key in the dict.\"\"\"\n return self.get(\"_permanent\", False)\n\n @permanent.setter\n def permanent(self, value: bool) -> None:\n self[\"_permanent\"] = bool(value)\n\n #: Some implementations can detect whether a session is newly\n #: created, but that is not guaranteed. Use with caution. The mixin\n # default is hard-coded ``False``.\n new = False\n\n #: Some implementations can detect changes to the session and set\n #: this when that happens. The mixin default is hard coded to\n #: ``True``.\n modified = True\n\n #: Some implementations can detect when session data is read or\n #: written and set this when that happens. The mixin default is hard\n #: coded to ``True``.\n accessed = True\n\n\nclass SecureCookieSession(CallbackDict, SessionMixin):\n \"\"\"Base class for sessions based on signed cookies.\n\n This session backend will set the :attr:`modified` and\n :attr:`accessed` attributes. It cannot reliably track whether a\n session is new (vs. empty), so :attr:`new` remains hard coded to\n ``False``.\n \"\"\"\n\n #: When data is changed, this is set to ``True``. Only the session\n #: dictionary itself is tracked; if the session contains mutable\n #: data (for example a nested dict) then this must be set to\n #: ``True`` manually when modifying that data. The session cookie\n #: will only be written to the response if this is ``True``.\n modified = False\n\n #: When data is read or written, this is set to ``True``. Used by\n # :class:`.SecureCookieSessionInterface` to add a ``Vary: Cookie``\n #: header, which allows caching proxies to cache different pages for\n #: different users.\n accessed = False\n\n def __init__(self, initial: t.Any = None) -> None:\n def on_update(self) -> None:\n self.modified = True\n self.accessed = True\n\n super().__init__(initial, on_update)\n\n def __getitem__(self, key: str) -> t.Any:\n self.accessed = True\n return super().__getitem__(key)\n\n def get(self, key: str, default: t.Any = None) -> t.Any:\n self.accessed = True\n return super().get(key, default)\n\n def setdefault(self, key: str, default: t.Any = None) -> t.Any:\n self.accessed = True\n return super().setdefault(key, default)\n\n\nclass NullSession(SecureCookieSession):\n \"\"\"Class used to generate nicer error messages if sessions are not\n available. Will still allow read-only access to the empty session\n but fail on setting.\n \"\"\"\n\n def _fail(self, *args: t.Any, **kwargs: t.Any) -> \"te.NoReturn\":\n raise RuntimeError(\n \"The session is unavailable because no secret \"\n \"key was set. Set the secret_key on the \"\n \"application to something unique and secret.\"\n )\n\n __setitem__ = __delitem__ = clear = pop = popitem = update = setdefault = _fail # type: ignore # noqa: B950\n del _fail\n\n\nclass SessionInterface:\n \"\"\"The basic interface you have to implement in order to replace the\n default session interface which uses werkzeug's securecookie\n implementation. The only methods you have to implement are\n :meth:`open_session` and :meth:`save_session`, the others have\n useful defaults which you don't need to change.\n\n The session object returned by the :meth:`open_session` method has to\n provide a dictionary like interface plus the properties and methods\n from the :class:`SessionMixin`. We recommend just subclassing a dict\n and adding that mixin::\n\n class Session(dict, SessionMixin):\n pass\n\n If :meth:`open_session` returns ``None`` Flask will call into\n :meth:`make_null_session` to create a session that acts as replacement\n if the session support cannot work because some requirement is not\n fulfilled. The default :class:`NullSession` class that is created\n will complain that the secret key was not set.\n\n To replace the session interface on an application all you have to do\n is to assign :attr:`flask.Flask.session_interface`::\n\n app = Flask(__name__)\n app.session_interface = MySessionInterface()\n\n Multiple requests with the same session may be sent and handled\n concurrently. When implementing a new session interface, consider\n whether reads or writes to the backing store must be synchronized.\n There is no guarantee on the order in which the session for each\n request is opened or saved, it will occur in the order that requests\n begin and end processing.\n\n .. versionadded:: 0.8\n \"\"\"\n\n #: :meth:`make_null_session` will look here for the class that should\n #: be created when a null session is requested. Likewise the\n #: :meth:`is_null_session` method will perform a typecheck against\n #: this type.\n null_session_class = NullSession\n\n #: A flag that indicates if the session interface is pickle based.\n #: This can be used by Flask extensions to make a decision in regards\n #: to how to deal with the session object.\n #:\n #: .. versionadded:: 0.10\n pickle_based = False\n\n def make_null_session(self, app: \"Flask\") -> NullSession:\n \"\"\"Creates a null session which acts as a replacement object if the\n real session support could not be loaded due to a configuration\n error. This mainly aids the user experience because the job of the\n null session is to still support lookup without complaining but\n modifications are answered with a helpful error message of what\n failed.\n\n This creates an instance of :attr:`null_session_class` by default.\n \"\"\"\n return self.null_session_class()\n\n def is_null_session(self, obj: object) -> bool:\n \"\"\"Checks if a given object is a null session. Null sessions are\n not asked to be saved.\n\n This checks if the object is an instance of :attr:`null_session_class`\n by default.\n \"\"\"\n return isinstance(obj, self.null_session_class)\n\n def get_cookie_name(self, app: \"Flask\") -> str:\n \"\"\"The name of the session cookie. Uses``app.config[\"SESSION_COOKIE_NAME\"]``.\"\"\"\n return app.config[\"SESSION_COOKIE_NAME\"]\n\n def get_cookie_domain(self, app: \"Flask\") -> t.Optional[str]:\n \"\"\"Returns the domain that should be set for the session cookie.\n\n Uses ``SESSION_COOKIE_DOMAIN`` if it is configured, otherwise\n falls back to detecting the domain based on ``SERVER_NAME``.\n\n Once detected (or if not set at all), ``SESSION_COOKIE_DOMAIN`` is\n updated to avoid re-running the logic.\n \"\"\"\n\n rv = app.config[\"SESSION_COOKIE_DOMAIN\"]\n\n # set explicitly, or cached from SERVER_NAME detection\n # if False, return None\n if rv is not None:\n return rv if rv else None\n\n rv = app.config[\"SERVER_NAME\"]\n\n # server name not set, cache False to return none next time\n if not rv:\n app.config[\"SESSION_COOKIE_DOMAIN\"] = False\n return None\n\n # chop off the port which is usually not supported by browsers\n # remove any leading '.' since we'll add that later\n rv = rv.rsplit(\":\", 1)[0].lstrip(\".\")\n\n if \".\" not in rv:\n # Chrome doesn't allow names without a '.'. This should only\n # come up with localhost. Hack around this by not setting\n # the name, and show a warning.\n warnings.warn(\n f\"{rv!r} is not a valid cookie domain, it must contain\"\n \" a '.'. Add an entry to your hosts file, for example\"\n f\" '{rv}.localdomain', and use that instead.\"\n )\n app.config[\"SESSION_COOKIE_DOMAIN\"] = False\n return None\n\n ip = is_ip(rv)\n\n if ip:\n warnings.warn(\n \"The session cookie domain is an IP address. This may not work\"\n \" as intended in some browsers. Add an entry to your hosts\"\n ' file, for example \"localhost.localdomain\", and use that'\n \" instead.\"\n )\n\n # if this is not an ip and app is mounted at the root, allow subdomain\n # matching by adding a '.' prefix\n if self.get_cookie_path(app) == \"/\" and not ip:\n rv = f\".{rv}\"\n\n app.config[\"SESSION_COOKIE_DOMAIN\"] = rv\n return rv\n\n def get_cookie_path(self, app: \"Flask\") -> str:\n \"\"\"Returns the path for which the cookie should be valid. The\n default implementation uses the value from the ``SESSION_COOKIE_PATH``\n config var if it's set, and falls back to ``APPLICATION_ROOT`` or\n uses ``/`` if it's ``None``.\n \"\"\"\n return app.config[\"SESSION_COOKIE_PATH\"] or app.config[\"APPLICATION_ROOT\"]\n\n def get_cookie_httponly(self, app: \"Flask\") -> bool:\n \"\"\"Returns True if the session cookie should be httponly. This\n currently just returns the value of the ``SESSION_COOKIE_HTTPONLY``\n config var.\n \"\"\"\n return app.config[\"SESSION_COOKIE_HTTPONLY\"]\n\n def get_cookie_secure(self, app: \"Flask\") -> bool:\n \"\"\"Returns True if the cookie should be secure. This currently\n just returns the value of the ``SESSION_COOKIE_SECURE`` setting.\n \"\"\"\n return app.config[\"SESSION_COOKIE_SECURE\"]\n\n def get_cookie_samesite(self, app: \"Flask\") -> str:\n \"\"\"Return ``'Strict'`` or ``'Lax'`` if the cookie should use the\n ``SameSite`` attribute. This currently just returns the value of\n the :data:`SESSION_COOKIE_SAMESITE` setting.\n \"\"\"\n return app.config[\"SESSION_COOKIE_SAMESITE\"]\n\n def get_expiration_time(\n self, app: \"Flask\", session: SessionMixin\n ) -> t.Optional[datetime]:\n \"\"\"A helper method that returns an expiration date for the session\n or ``None`` if the session is linked to the browser session. The\n default implementation returns now + the permanent session\n lifetime configured on the application.\n \"\"\"\n if session.permanent:\n return datetime.now(timezone.utc) + app.permanent_session_lifetime\n return None\n\n def should_set_cookie(self, app: \"Flask\", session: SessionMixin) -> bool:\n \"\"\"Used by session backends to determine if a ``Set-Cookie`` header\n should be set for this session cookie for this response. If the session\n has been modified, the cookie is set. If the session is permanent and\n the ``SESSION_REFRESH_EACH_REQUEST`` config is true, the cookie is\n always set.\n\n This check is usually skipped if the session was deleted.\n\n .. versionadded:: 0.11\n \"\"\"\n\n return session.modified or (\n session.permanent and app.config[\"SESSION_REFRESH_EACH_REQUEST\"]\n )\n\n def open_session(\n self, app: \"Flask\", request: \"Request\"\n ) -> t.Optional[SessionMixin]:\n \"\"\"This is called at the beginning of each request, after\n pushing the request context, before matching the URL.\n\n This must return an object which implements a dictionary-like\n interface as well as the :class:`SessionMixin` interface.\n\n This will return ``None`` to indicate that loading failed in\n some way that is not immediately an error. The request\n context will fall back to using :meth:`make_null_session`\n in this case.\n \"\"\"\n raise NotImplementedError()\n\n def save_session(\n self, app: \"Flask\", session: SessionMixin, response: \"Response\"\n ) -> None:\n \"\"\"This is called at the end of each request, after generating\n a response, before removing the request context. It is skipped\n if :meth:`is_null_session` returns ``True``.\n \"\"\"\n raise NotImplementedError()\n\n\nsession_json_serializer = TaggedJSONSerializer()\n\n\nclass SecureCookieSessionInterface(SessionInterface):\n \"\"\"The default session interface that stores sessions in signed cookies\n through the :mod:`itsdangerous` module.\n \"\"\"\n\n #: the salt that should be applied on top of the secret key for the\n #: signing of cookie based sessions.\n salt = \"cookie-session\"\n #: the hash function to use for the signature. The default is sha1\n digest_method = staticmethod(hashlib.sha1)\n #: the name of the itsdangerous supported key derivation. The default\n #: is hmac.\n key_derivation = \"hmac\"\n #: A python serializer for the payload. The default is a compact\n #: JSON derived serializer with support for some extra Python types\n #: such as datetime objects or tuples.\n serializer = session_json_serializer\n session_class = SecureCookieSession\n\n def get_signing_serializer(\n self, app: \"Flask\"\n ) -> t.Optional[URLSafeTimedSerializer]:\n if not app.secret_key:\n return None\n signer_kwargs = dict(\n key_derivation=self.key_derivation, digest_method=self.digest_method\n )\n return URLSafeTimedSerializer(\n app.secret_key,\n salt=self.salt,\n serializer=self.serializer,\n signer_kwargs=signer_kwargs,\n )\n\n def open_session(\n self, app: \"Flask\", request: \"Request\"\n ) -> t.Optional[SecureCookieSession]:\n s = self.get_signing_serializer(app)\n if s is None:\n return None\n val = request.cookies.get(self.get_cookie_name(app))\n if not val:\n return self.session_class()\n max_age = int(app.permanent_session_lifetime.total_seconds())\n try:\n data = s.loads(val, max_age=max_age)\n return self.session_class(data)\n except BadSignature:\n return self.session_class()\n\n def save_session(\n self, app: \"Flask\", session: SessionMixin, response: \"Response\"\n ) -> None:\n name = self.get_cookie_name(app)\n domain = self.get_cookie_domain(app)\n path = self.get_cookie_path(app)\n secure = self.get_cookie_secure(app)\n samesite = self.get_cookie_samesite(app)\n httponly = self.get_cookie_httponly(app)\n\n # If the session is modified to be empty, remove the cookie.\n # If the session is empty, return without setting the cookie.\n if not session:\n if session.modified:\n response.delete_cookie(\n name,\n domain=domain,\n path=path,\n secure=secure,\n samesite=samesite,\n httponly=httponly,\n )\n\n return\n\n # Add a \"Vary: Cookie\" header if the session was accessed at all.\n if session.accessed:\n response.vary.add(\"Cookie\")\n\n if not self.should_set_cookie(app, session):\n return\n\n expires = self.get_expiration_time(app, session)\n val = self.get_signing_serializer(app).dumps(dict(session)) # type: ignore\n response.set_cookie(\n name,\n val, # type: ignore\n expires=expires,\n httponly=httponly,\n domain=domain,\n path=path,\n secure=secure,\n samesite=samesite,\n )\n"},{"col":4,"comment":"null","endLoc":90,"header":"def __gt__(self, __value: date) -> bool","id":134,"name":"__gt__","nodeType":"Function","startLoc":90,"text":"def __gt__(self, __value: date) -> bool: ..."},{"col":4,"comment":"null","endLoc":91,"header":"def __eq__(self, __value: object) -> bool","id":135,"name":"__eq__","nodeType":"Function","startLoc":91,"text":"def __eq__(self, __value: object) -> bool: ..."},{"col":8,"comment":"null","endLoc":93,"header":"def __add__(self, __value: timedelta) -> Self","id":136,"name":"__add__","nodeType":"Function","startLoc":93,"text":"def __add__(self, __value: timedelta) -> Self: ..."},{"col":8,"comment":"null","endLoc":103,"header":"def __add__(self, __value: timedelta) -> date","id":137,"name":"__add__","nodeType":"Function","startLoc":103,"text":"def __add__(self, __value: timedelta) -> date: ..."},{"col":8,"comment":"null","endLoc":94,"header":"def __radd__(self, __value: timedelta) -> Self","id":138,"name":"__radd__","nodeType":"Function","startLoc":94,"text":"def __radd__(self, __value: timedelta) -> Self: ..."},{"col":8,"comment":"null","endLoc":104,"header":"def __radd__(self, __value: timedelta) -> date","id":139,"name":"__radd__","nodeType":"Function","startLoc":104,"text":"def __radd__(self, __value: timedelta) -> date: ..."},{"className":"MutableMapping","col":0,"comment":"null","endLoc":691,"id":140,"nodeType":"Class","startLoc":643,"text":"class MutableMapping(Mapping[_KT, _VT], Generic[_KT, _VT]):\n @abstractmethod\n def __setitem__(self, __key: _KT, __value: _VT) -> None: ...\n @abstractmethod\n def __delitem__(self, __key: _KT) -> None: ...\n def clear(self) -> None: ...\n @overload\n def pop(self, __key: _KT) -> _VT: ...\n @overload\n def pop(self, __key: _KT, default: _VT) -> _VT: ...\n @overload\n def pop(self, __key: _KT, default: _T) -> _VT | _T: ...\n def popitem(self) -> tuple[_KT, _VT]: ...\n # This overload should be allowed only if the value type is compatible with None.\n #\n # Keep the following methods in line with MutableMapping.setdefault, modulo positional-only differences:\n # -- collections.OrderedDict.setdefault\n # -- collections.ChainMap.setdefault\n # -- weakref.WeakKeyDictionary.setdefault\n @overload\n def setdefault(self: MutableMapping[_KT, _T | None], __key: _KT, __default: None = None) -> _T | None: ...\n @overload\n def setdefault(self, __key: _KT, __default: _VT) -> _VT: ...\n # 'update' used to take a Union, but using overloading is better.\n # The second overloaded type here is a bit too general, because\n # Mapping[tuple[_KT, _VT], W] is a subclass of Iterable[tuple[_KT, _VT]],\n # but will always have the behavior of the first overloaded type\n # at runtime, leading to keys of a mix of types _KT and tuple[_KT, _VT].\n # We don't currently have any way of forcing all Mappings to use\n # the first overload, but by using overloading rather than a Union,\n # mypy will commit to using the first overload when the argument is\n # known to be a Mapping with unknown type parameters, which is closer\n # to the behavior we want. See mypy issue #1430.\n #\n # Various mapping classes have __ior__ methods that should be kept roughly in line with .update():\n # -- dict.__ior__\n # -- os._Environ.__ior__\n # -- collections.UserDict.__ior__\n # -- collections.ChainMap.__ior__\n # -- peewee.attrdict.__add__\n # -- peewee.attrdict.__iadd__\n # -- weakref.WeakValueDictionary.__ior__\n # -- weakref.WeakKeyDictionary.__ior__\n @overload\n def update(self, __m: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...\n @overload\n def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...\n @overload\n def update(self, **kwargs: _VT) -> None: ..."},{"col":8,"comment":"null","endLoc":96,"header":"@overload\n def __sub__(self, __value: timedelta) -> Self","id":141,"name":"__sub__","nodeType":"Function","startLoc":95,"text":"@overload\n def __sub__(self, __value: timedelta) -> Self: ..."},{"col":8,"comment":"null","endLoc":98,"header":"@overload\n def __sub__(self, __value: datetime) -> NoReturn","id":142,"name":"__sub__","nodeType":"Function","startLoc":97,"text":"@overload\n def __sub__(self, __value: datetime) -> NoReturn: ..."},{"col":8,"comment":"null","endLoc":100,"header":"@overload\n def __sub__(self: _D, __value: _D) -> timedelta","id":143,"name":"__sub__","nodeType":"Function","startLoc":99,"text":"@overload\n def __sub__(self: _D, __value: _D) -> timedelta: ..."},{"col":8,"comment":"null","endLoc":106,"header":"@overload\n def __sub__(self, __value: timedelta) -> date","id":144,"name":"__sub__","nodeType":"Function","startLoc":105,"text":"@overload\n def __sub__(self, __value: timedelta) -> date: ..."},{"col":8,"comment":"null","endLoc":108,"header":"@overload\n def __sub__(self, __value: datetime) -> NoReturn","id":145,"name":"__sub__","nodeType":"Function","startLoc":107,"text":"@overload\n def __sub__(self, __value: datetime) -> NoReturn: ..."},{"col":8,"comment":"null","endLoc":110,"header":"@overload\n def __sub__(self, __value: date) -> timedelta","id":146,"name":"__sub__","nodeType":"Function","startLoc":109,"text":"@overload\n def __sub__(self, __value: date) -> timedelta: ..."},{"col":4,"comment":"null","endLoc":112,"header":"def __hash__(self) -> int","id":147,"name":"__hash__","nodeType":"Function","startLoc":112,"text":"def __hash__(self) -> int: ..."},{"col":4,"comment":"null","endLoc":113,"header":"def weekday(self) -> int","id":148,"name":"weekday","nodeType":"Function","startLoc":113,"text":"def weekday(self) -> int: ..."},{"col":4,"comment":"null","endLoc":114,"header":"def isoweekday(self) -> int","id":149,"name":"isoweekday","nodeType":"Function","startLoc":114,"text":"def isoweekday(self) -> int: ..."},{"col":8,"comment":"null","endLoc":116,"header":"def isocalendar(self) -> _IsoCalendarDate","id":150,"name":"isocalendar","nodeType":"Function","startLoc":116,"text":"def isocalendar(self) -> _IsoCalendarDate: ..."},{"col":8,"comment":"null","endLoc":118,"header":"def isocalendar(self) -> tuple[int, int, int]","id":151,"name":"isocalendar","nodeType":"Function","startLoc":118,"text":"def isocalendar(self) -> tuple[int, int, int]: ..."},{"attributeType":"date","col":4,"comment":"null","endLoc":51,"id":152,"name":"min","nodeType":"Attribute","startLoc":51,"text":"min"},{"col":4,"comment":"null","endLoc":119,"header":"def update_wrapper(\n wrapper: Callable[_PWrapper, _RWrapper],\n wrapped: Callable[_PWrapped, _RWrapped],\n assigned: Sequence[str] = (\"__module__\", \"__name__\", \"__qualname__\", \"__doc__\", \"__annotations__\"),\n updated","id":153,"name":"update_wrapper","nodeType":"Function","startLoc":114,"text":"def update_wrapper(\n wrapper: Callable[_PWrapper, _RWrapper],\n wrapped: Callable[_PWrapped, _RWrapped],\n assigned: Sequence[str] = (\"__module__\", \"__name__\", \"__qualname__\", \"__doc__\", \"__annotations__\"),\n updated: Sequence[str] = (\"__dict__\",),\n ) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWrapper]: ..."},{"attributeType":"date","col":4,"comment":"null","endLoc":52,"id":154,"name":"max","nodeType":"Attribute","startLoc":52,"text":"max"},{"attributeType":"timedelta","col":4,"comment":"null","endLoc":53,"id":155,"name":"resolution","nodeType":"Attribute","startLoc":53,"text":"resolution"},{"col":4,"comment":"null","endLoc":244,"header":"def __new__(\n cls,\n year: SupportsIndex,\n month: SupportsIndex,\n day: SupportsIndex,\n hour: SupportsIndex = ...,\n minute: SupportsIndex = ...,\n second: SupportsIndex = ...,\n microsecond: SupportsIndex = ...,\n tzinfo: _TzInfo | None = ...,\n *,\n fold: int = ...,\n ) -> Self","id":156,"name":"__new__","nodeType":"Function","startLoc":232,"text":"def __new__(\n cls,\n year: SupportsIndex,\n month: SupportsIndex,\n day: SupportsIndex,\n hour: SupportsIndex = ...,\n minute: SupportsIndex = ...,\n second: SupportsIndex = ...,\n microsecond: SupportsIndex = ...,\n tzinfo: _TzInfo | None = ...,\n *,\n fold: int = ...,\n ) -> Self: ..."},{"col":4,"comment":"null","endLoc":246,"header":"@property\n def hour(self) -> int","id":157,"name":"hour","nodeType":"Function","startLoc":245,"text":"@property\n def hour(self) -> int: ..."},{"col":4,"comment":"null","endLoc":248,"header":"@property\n def minute(self) -> int","id":158,"name":"minute","nodeType":"Function","startLoc":247,"text":"@property\n def minute(self) -> int: ..."},{"col":4,"comment":"null","endLoc":250,"header":"@property\n def second(self) -> int","id":159,"name":"second","nodeType":"Function","startLoc":249,"text":"@property\n def second(self) -> int: ..."},{"col":4,"comment":"null","endLoc":252,"header":"@property\n def microsecond(self) -> int","id":160,"name":"microsecond","nodeType":"Function","startLoc":251,"text":"@property\n def microsecond(self) -> int: ..."},{"col":4,"comment":"null","endLoc":254,"header":"@property\n def tzinfo(self) -> _TzInfo | None","id":161,"name":"tzinfo","nodeType":"Function","startLoc":253,"text":"@property\n def tzinfo(self) -> _TzInfo | None: ..."},{"col":4,"comment":"null","endLoc":256,"header":"@property\n def fold(self) -> int","id":162,"name":"fold","nodeType":"Function","startLoc":255,"text":"@property\n def fold(self) -> int: ..."},{"col":8,"comment":"null","endLoc":262,"header":"@classmethod\n def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self","id":163,"name":"fromtimestamp","nodeType":"Function","startLoc":261,"text":"@classmethod\n def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ..."},{"col":8,"comment":"null","endLoc":265,"header":"@classmethod\n def fromtimestamp(cls, __timestamp: float, tz: _TzInfo | None = ...) -> Self","id":164,"name":"fromtimestamp","nodeType":"Function","startLoc":264,"text":"@classmethod\n def fromtimestamp(cls, __timestamp: float, tz: _TzInfo | None = ...) -> Self: ..."},{"col":4,"comment":"null","endLoc":268,"header":"@classmethod\n def utcfromtimestamp(cls, __t: float) -> Self","id":165,"name":"utcfromtimestamp","nodeType":"Function","startLoc":267,"text":"@classmethod\n def utcfromtimestamp(cls, __t: float) -> Self: ..."},{"col":8,"comment":"null","endLoc":271,"header":"@classmethod\n def now(cls, tz: _TzInfo | None = None) -> Self","id":166,"name":"now","nodeType":"Function","startLoc":270,"text":"@classmethod\n def now(cls, tz: _TzInfo | None = None) -> Self: ..."},{"col":8,"comment":"null","endLoc":275,"header":"@overload\n @classmethod\n def now(cls, tz: None = None) -> Self","id":167,"name":"now","nodeType":"Function","startLoc":273,"text":"@overload\n @classmethod\n def now(cls, tz: None = None) -> Self: ..."},{"col":8,"comment":"null","endLoc":278,"header":"@overload\n @classmethod\n def now(cls, tz: _TzInfo) -> datetime","id":168,"name":"now","nodeType":"Function","startLoc":276,"text":"@overload\n @classmethod\n def now(cls, tz: _TzInfo) -> datetime: ..."},{"col":4,"comment":"null","endLoc":281,"header":"@classmethod\n def utcnow(cls) -> Self","id":169,"name":"utcnow","nodeType":"Function","startLoc":280,"text":"@classmethod\n def utcnow(cls) -> Self: ..."},{"col":4,"comment":"null","endLoc":283,"header":"@classmethod\n def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> Self","id":170,"name":"combine","nodeType":"Function","startLoc":282,"text":"@classmethod\n def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> Self: ..."},{"col":4,"comment":"null","endLoc":284,"header":"def timestamp(self) -> float","id":171,"name":"timestamp","nodeType":"Function","startLoc":284,"text":"def timestamp(self) -> float: ..."},{"col":4,"comment":"null","endLoc":285,"header":"def utctimetuple(self) -> struct_time","id":172,"name":"utctimetuple","nodeType":"Function","startLoc":285,"text":"def utctimetuple(self) -> struct_time: ..."},{"col":4,"comment":"null","endLoc":286,"header":"def date(self) -> _Date","id":173,"name":"date","nodeType":"Function","startLoc":286,"text":"def date(self) -> _Date: ..."},{"col":4,"comment":"null","endLoc":287,"header":"def time(self) -> _Time","id":174,"name":"time","nodeType":"Function","startLoc":287,"text":"def time(self) -> _Time: ..."},{"col":4,"comment":"null","endLoc":288,"header":"def timetz(self) -> _Time","id":175,"name":"timetz","nodeType":"Function","startLoc":288,"text":"def timetz(self) -> _Time: ..."},{"col":4,"comment":"null","endLoc":301,"header":"def replace(\n self,\n year: SupportsIndex = ...,\n month: SupportsIndex = ...,\n day: SupportsIndex = ...,\n hour: SupportsIndex = ...,\n minute: SupportsIndex = ...,\n second: SupportsIndex = ...,\n microsecond: SupportsIndex = ...,\n tzinfo: _TzInfo | None = ...,\n *,\n fold: int = ...,\n ) -> Self","id":176,"name":"replace","nodeType":"Function","startLoc":289,"text":"def replace(\n self,\n year: SupportsIndex = ...,\n month: SupportsIndex = ...,\n day: SupportsIndex = ...,\n hour: SupportsIndex = ...,\n minute: SupportsIndex = ...,\n second: SupportsIndex = ...,\n microsecond: SupportsIndex = ...,\n tzinfo: _TzInfo | None = ...,\n *,\n fold: int = ...,\n ) -> Self: ..."},{"col":8,"comment":"null","endLoc":303,"header":"def astimezone(self, tz: _TzInfo | None = ...) -> Self","id":177,"name":"astimezone","nodeType":"Function","startLoc":303,"text":"def astimezone(self, tz: _TzInfo | None = ...) -> Self: ..."},{"col":8,"comment":"null","endLoc":305,"header":"def astimezone(self, tz: _TzInfo | None = ...) -> datetime","id":178,"name":"astimezone","nodeType":"Function","startLoc":305,"text":"def astimezone(self, tz: _TzInfo | None = ...) -> datetime: ..."},{"col":4,"comment":"null","endLoc":307,"header":"def isoformat(self, sep: str = ..., timespec: str = ...) -> str","id":179,"name":"isoformat","nodeType":"Function","startLoc":307,"text":"def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ..."},{"col":4,"comment":"null","endLoc":309,"header":"@classmethod\n def strptime(cls, __date_string: str, __format: str) -> Self","id":180,"name":"strptime","nodeType":"Function","startLoc":308,"text":"@classmethod\n def strptime(cls, __date_string: str, __format: str) -> Self: ..."},{"col":4,"comment":"null","endLoc":310,"header":"def utcoffset(self) -> timedelta | None","id":181,"name":"utcoffset","nodeType":"Function","startLoc":310,"text":"def utcoffset(self) -> timedelta | None: ..."},{"col":4,"comment":"null","endLoc":311,"header":"def tzname(self) -> str | None","id":182,"name":"tzname","nodeType":"Function","startLoc":311,"text":"def tzname(self) -> str | None: ..."},{"col":4,"comment":"null","endLoc":312,"header":"def dst(self) -> timedelta | None","id":183,"name":"dst","nodeType":"Function","startLoc":312,"text":"def dst(self) -> timedelta | None: ..."},{"col":4,"comment":"null","endLoc":313,"header":"def __le__(self, __value: datetime) -> bool","id":184,"name":"__le__","nodeType":"Function","startLoc":313,"text":"def __le__(self, __value: datetime) -> bool: ... # type: ignore[override]"},{"col":4,"comment":"null","endLoc":314,"header":"def __lt__(self, __value: datetime) -> bool","id":185,"name":"__lt__","nodeType":"Function","startLoc":314,"text":"def __lt__(self, __value: datetime) -> bool: ... # type: ignore[override]"},{"col":4,"comment":"null","endLoc":315,"header":"def __ge__(self, __value: datetime) -> bool","id":186,"name":"__ge__","nodeType":"Function","startLoc":315,"text":"def __ge__(self, __value: datetime) -> bool: ... # type: ignore[override]"},{"col":4,"comment":"null","endLoc":316,"header":"def __gt__(self, __value: datetime) -> bool","id":187,"name":"__gt__","nodeType":"Function","startLoc":316,"text":"def __gt__(self, __value: datetime) -> bool: ... # type: ignore[override]"},{"col":4,"comment":"null","endLoc":317,"header":"def __eq__(self, __value: object) -> bool","id":188,"name":"__eq__","nodeType":"Function","startLoc":317,"text":"def __eq__(self, __value: object) -> bool: ..."},{"col":4,"comment":"null","endLoc":318,"header":"def __hash__(self) -> int","id":189,"name":"__hash__","nodeType":"Function","startLoc":318,"text":"def __hash__(self) -> int: ..."},{"col":8,"comment":"null","endLoc":321,"header":"@overload # type: ignore[override]\n def __sub__(self, __value: timedelta) -> Self","id":190,"name":"__sub__","nodeType":"Function","startLoc":320,"text":"@overload # type: ignore[override]\n def __sub__(self, __value: timedelta) -> Self: ..."},{"col":8,"comment":"null","endLoc":323,"header":"@overload\n def __sub__(self: _D, __value: _D) -> timedelta","id":191,"name":"__sub__","nodeType":"Function","startLoc":322,"text":"@overload\n def __sub__(self: _D, __value: _D) -> timedelta: ..."},{"col":8,"comment":"null","endLoc":329,"header":"@overload # type: ignore[override]\n def __sub__(self, __value: datetime) -> timedelta","id":192,"name":"__sub__","nodeType":"Function","startLoc":328,"text":"@overload # type: ignore[override]\n def __sub__(self, __value: datetime) -> timedelta: ..."},{"col":8,"comment":"null","endLoc":331,"header":"@overload\n def __sub__(self, __value: timedelta) -> datetime","id":193,"name":"__sub__","nodeType":"Function","startLoc":330,"text":"@overload\n def __sub__(self, __value: timedelta) -> datetime: ..."},{"col":8,"comment":"null","endLoc":326,"header":"def __add__(self, __value: timedelta) -> datetime","id":194,"name":"__add__","nodeType":"Function","startLoc":326,"text":"def __add__(self, __value: timedelta) -> datetime: ..."},{"col":8,"comment":"null","endLoc":327,"header":"def __radd__(self, __value: timedelta) -> datetime","id":195,"name":"__radd__","nodeType":"Function","startLoc":327,"text":"def __radd__(self, __value: timedelta) -> datetime: ..."},{"attributeType":"datetime","col":4,"comment":"null","endLoc":230,"id":196,"name":"min","nodeType":"Attribute","startLoc":230,"text":"min"},{"className":"attrgetter","col":0,"comment":"null","endLoc":104,"id":197,"nodeType":"Class","startLoc":92,"text":"@final\nclass attrgetter(Generic[_T_co]):\n @overload\n def __new__(cls, attr: str) -> attrgetter[Any]: ...\n @overload\n def __new__(cls, attr: str, __attr2: str) -> attrgetter[tuple[Any, Any]]: ...\n @overload\n def __new__(cls, attr: str, __attr2: str, __attr3: str) -> attrgetter[tuple[Any, Any, Any]]: ...\n @overload\n def __new__(cls, attr: str, __attr2: str, __attr3: str, __attr4: str) -> attrgetter[tuple[Any, Any, Any, Any]]: ...\n @overload\n def __new__(cls, attr: str, *attrs: str) -> attrgetter[tuple[Any, ...]]: ...\n def __call__(self, obj: Any) -> _T_co: ..."},{"attributeType":"datetime","col":4,"comment":"null","endLoc":231,"id":198,"name":"max","nodeType":"Attribute","startLoc":231,"text":"max"},{"className":"timezone","col":0,"comment":"null","endLoc":39,"id":199,"nodeType":"Class","startLoc":29,"text":"@final\nclass timezone(tzinfo):\n utc: ClassVar[timezone]\n min: ClassVar[timezone]\n max: ClassVar[timezone]\n def __init__(self, offset: timedelta, name: str = ...) -> None: ...\n def tzname(self, __dt: datetime | None) -> str: ...\n def utcoffset(self, __dt: datetime | None) -> timedelta: ...\n def dst(self, __dt: datetime | None) -> None: ...\n def __hash__(self) -> int: ...\n def __eq__(self, __value: object) -> bool: ..."},{"className":"tzinfo","col":0,"comment":"null","endLoc":24,"id":200,"nodeType":"Class","startLoc":17,"text":"class tzinfo:\n @abstractmethod\n def tzname(self, __dt: datetime | None) -> str | None: ...\n @abstractmethod\n def utcoffset(self, __dt: datetime | None) -> timedelta | None: ...\n @abstractmethod\n def dst(self, __dt: datetime | None) -> timedelta | None: ...\n def fromutc(self, __dt: datetime) -> datetime: ..."},{"col":4,"comment":"null","endLoc":19,"header":"@abstractmethod\n def tzname(self, __dt: datetime | None) -> str | None","id":201,"name":"tzname","nodeType":"Function","startLoc":18,"text":"@abstractmethod\n def tzname(self, __dt: datetime | None) -> str | None: ..."},{"col":4,"comment":"null","endLoc":21,"header":"@abstractmethod\n def utcoffset(self, __dt: datetime | None) -> timedelta | None","id":202,"name":"utcoffset","nodeType":"Function","startLoc":20,"text":"@abstractmethod\n def utcoffset(self, __dt: datetime | None) -> timedelta | None: ..."},{"col":4,"comment":"null","endLoc":23,"header":"@abstractmethod\n def dst(self, __dt: datetime | None) -> timedelta | None","id":203,"name":"dst","nodeType":"Function","startLoc":22,"text":"@abstractmethod\n def dst(self, __dt: datetime | None) -> timedelta | None: ..."},{"col":4,"comment":"null","endLoc":24,"header":"def fromutc(self, __dt: datetime) -> datetime","id":204,"name":"fromutc","nodeType":"Function","startLoc":24,"text":"def fromutc(self, __dt: datetime) -> datetime: ..."},{"col":4,"comment":"null","endLoc":34,"header":"def __init__(self, offset: timedelta, name: str = ...) -> None","id":205,"name":"__init__","nodeType":"Function","startLoc":34,"text":"def __init__(self, offset: timedelta, name: str = ...) -> None: ..."},{"col":4,"comment":"null","endLoc":35,"header":"def tzname(self, __dt: datetime | None) -> str","id":206,"name":"tzname","nodeType":"Function","startLoc":35,"text":"def tzname(self, __dt: datetime | None) -> str: ..."},{"col":4,"comment":"null","endLoc":36,"header":"def utcoffset(self, __dt: datetime | None) -> timedelta","id":207,"name":"utcoffset","nodeType":"Function","startLoc":36,"text":"def utcoffset(self, __dt: datetime | None) -> timedelta: ..."},{"col":4,"comment":"null","endLoc":37,"header":"def dst(self, __dt: datetime | None) -> None","id":208,"name":"dst","nodeType":"Function","startLoc":37,"text":"def dst(self, __dt: datetime | None) -> None: ..."},{"col":4,"comment":"null","endLoc":38,"header":"def __hash__(self) -> int","id":209,"name":"__hash__","nodeType":"Function","startLoc":38,"text":"def __hash__(self) -> int: ..."},{"col":4,"comment":"null","endLoc":39,"header":"def __eq__(self, __value: object) -> bool","id":210,"name":"__eq__","nodeType":"Function","startLoc":39,"text":"def __eq__(self, __value: object) -> bool: ..."},{"attributeType":"timezone","col":4,"comment":"null","endLoc":31,"id":211,"name":"utc","nodeType":"Attribute","startLoc":31,"text":"utc"},{"col":4,"comment":"null","endLoc":516,"header":"def __new__(cls, tb_next: TracebackType | None, tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> Self","id":212,"name":"__new__","nodeType":"Function","startLoc":516,"text":"def __new__(cls, tb_next: TracebackType | None, tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> Self: ..."},{"col":4,"comment":"null","endLoc":520,"header":"@property\n def tb_frame(self) -> FrameType","id":213,"name":"tb_frame","nodeType":"Function","startLoc":519,"text":"@property\n def tb_frame(self) -> FrameType: ..."},{"col":4,"comment":"null","endLoc":522,"header":"@property\n def tb_lasti(self) -> int","id":214,"name":"tb_lasti","nodeType":"Function","startLoc":521,"text":"@property\n def tb_lasti(self) -> int: ..."},{"col":4,"comment":"null","endLoc":524,"header":"@property\n def tb_lineno(self) -> int","id":215,"name":"tb_lineno","nodeType":"Function","startLoc":523,"text":"@property\n def tb_lineno(self) -> int: ..."},{"attributeType":"TracebackType | None","col":4,"comment":"null","endLoc":517,"id":216,"name":"tb_next","nodeType":"Attribute","startLoc":517,"text":"tb_next"},{"attributeType":"timezone","col":4,"comment":"null","endLoc":32,"id":217,"name":"min","nodeType":"Attribute","startLoc":32,"text":"min"},{"attributeType":"timezone","col":4,"comment":"null","endLoc":33,"id":218,"name":"max","nodeType":"Attribute","startLoc":33,"text":"max"},{"fileName":"test_config.py","filePath":"tests","id":219,"nodeType":"File","text":"import json\nimport os\nimport textwrap\n\nimport pytest\n\nimport flask\n\n\n# config keys used for the TestConfig\nTEST_KEY = \"foo\"\nSECRET_KEY = \"config\"\n\n\ndef common_object_test(app):\n assert app.secret_key == \"config\"\n assert app.config[\"TEST_KEY\"] == \"foo\"\n assert \"TestConfig\" not in app.config\n\n\ndef test_config_from_pyfile():\n app = flask.Flask(__name__)\n app.config.from_pyfile(f\"{__file__.rsplit('.', 1)[0]}.py\")\n common_object_test(app)\n\n\ndef test_config_from_object():\n app = flask.Flask(__name__)\n app.config.from_object(__name__)\n common_object_test(app)\n\n\ndef test_config_from_file():\n app = flask.Flask(__name__)\n current_dir = os.path.dirname(os.path.abspath(__file__))\n app.config.from_file(os.path.join(current_dir, \"static\", \"config.json\"), json.load)\n common_object_test(app)\n\n\ndef test_from_prefixed_env(monkeypatch):\n monkeypatch.setenv(\"FLASK_STRING\", \"value\")\n monkeypatch.setenv(\"FLASK_BOOL\", \"true\")\n monkeypatch.setenv(\"FLASK_INT\", \"1\")\n monkeypatch.setenv(\"FLASK_FLOAT\", \"1.2\")\n monkeypatch.setenv(\"FLASK_LIST\", \"[1, 2]\")\n monkeypatch.setenv(\"FLASK_DICT\", '{\"k\": \"v\"}')\n monkeypatch.setenv(\"NOT_FLASK_OTHER\", \"other\")\n\n app = flask.Flask(__name__)\n app.config.from_prefixed_env()\n\n assert app.config[\"STRING\"] == \"value\"\n assert app.config[\"BOOL\"] is True\n assert app.config[\"INT\"] == 1\n assert app.config[\"FLOAT\"] == 1.2\n assert app.config[\"LIST\"] == [1, 2]\n assert app.config[\"DICT\"] == {\"k\": \"v\"}\n assert \"OTHER\" not in app.config\n\n\ndef test_from_prefixed_env_custom_prefix(monkeypatch):\n monkeypatch.setenv(\"FLASK_A\", \"a\")\n monkeypatch.setenv(\"NOT_FLASK_A\", \"b\")\n\n app = flask.Flask(__name__)\n app.config.from_prefixed_env(\"NOT_FLASK\")\n\n assert app.config[\"A\"] == \"b\"\n\n\ndef test_from_prefixed_env_nested(monkeypatch):\n monkeypatch.setenv(\"FLASK_EXIST__ok\", \"other\")\n monkeypatch.setenv(\"FLASK_EXIST__inner__ik\", \"2\")\n monkeypatch.setenv(\"FLASK_EXIST__new__more\", '{\"k\": false}')\n monkeypatch.setenv(\"FLASK_NEW__K\", \"v\")\n\n app = flask.Flask(__name__)\n app.config[\"EXIST\"] = {\"ok\": \"value\", \"flag\": True, \"inner\": {\"ik\": 1}}\n app.config.from_prefixed_env()\n\n if os.name != \"nt\":\n assert app.config[\"EXIST\"] == {\n \"ok\": \"other\",\n \"flag\": True,\n \"inner\": {\"ik\": 2},\n \"new\": {\"more\": {\"k\": False}},\n }\n else:\n # Windows env var keys are always uppercase.\n assert app.config[\"EXIST\"] == {\n \"ok\": \"value\",\n \"OK\": \"other\",\n \"flag\": True,\n \"inner\": {\"ik\": 1},\n \"INNER\": {\"IK\": 2},\n \"NEW\": {\"MORE\": {\"k\": False}},\n }\n\n assert app.config[\"NEW\"] == {\"K\": \"v\"}\n\n\ndef test_config_from_mapping():\n app = flask.Flask(__name__)\n app.config.from_mapping({\"SECRET_KEY\": \"config\", \"TEST_KEY\": \"foo\"})\n common_object_test(app)\n\n app = flask.Flask(__name__)\n app.config.from_mapping([(\"SECRET_KEY\", \"config\"), (\"TEST_KEY\", \"foo\")])\n common_object_test(app)\n\n app = flask.Flask(__name__)\n app.config.from_mapping(SECRET_KEY=\"config\", TEST_KEY=\"foo\")\n common_object_test(app)\n\n app = flask.Flask(__name__)\n app.config.from_mapping(SECRET_KEY=\"config\", TEST_KEY=\"foo\", skip_key=\"skip\")\n common_object_test(app)\n\n app = flask.Flask(__name__)\n with pytest.raises(TypeError):\n app.config.from_mapping({}, {})\n\n\ndef test_config_from_class():\n class Base:\n TEST_KEY = \"foo\"\n\n class Test(Base):\n SECRET_KEY = \"config\"\n\n app = flask.Flask(__name__)\n app.config.from_object(Test)\n common_object_test(app)\n\n\ndef test_config_from_envvar(monkeypatch):\n monkeypatch.setattr(\"os.environ\", {})\n app = flask.Flask(__name__)\n\n with pytest.raises(RuntimeError) as e:\n app.config.from_envvar(\"FOO_SETTINGS\")\n\n assert \"'FOO_SETTINGS' is not set\" in str(e.value)\n assert not app.config.from_envvar(\"FOO_SETTINGS\", silent=True)\n\n monkeypatch.setattr(\n \"os.environ\", {\"FOO_SETTINGS\": f\"{__file__.rsplit('.', 1)[0]}.py\"}\n )\n assert app.config.from_envvar(\"FOO_SETTINGS\")\n common_object_test(app)\n\n\ndef test_config_from_envvar_missing(monkeypatch):\n monkeypatch.setattr(\"os.environ\", {\"FOO_SETTINGS\": \"missing.cfg\"})\n app = flask.Flask(__name__)\n with pytest.raises(IOError) as e:\n app.config.from_envvar(\"FOO_SETTINGS\")\n msg = str(e.value)\n assert msg.startswith(\n \"[Errno 2] Unable to load configuration file (No such file or directory):\"\n )\n assert msg.endswith(\"missing.cfg'\")\n assert not app.config.from_envvar(\"FOO_SETTINGS\", silent=True)\n\n\ndef test_config_missing():\n app = flask.Flask(__name__)\n with pytest.raises(IOError) as e:\n app.config.from_pyfile(\"missing.cfg\")\n msg = str(e.value)\n assert msg.startswith(\n \"[Errno 2] Unable to load configuration file (No such file or directory):\"\n )\n assert msg.endswith(\"missing.cfg'\")\n assert not app.config.from_pyfile(\"missing.cfg\", silent=True)\n\n\ndef test_config_missing_file():\n app = flask.Flask(__name__)\n with pytest.raises(IOError) as e:\n app.config.from_file(\"missing.json\", load=json.load)\n msg = str(e.value)\n assert msg.startswith(\n \"[Errno 2] Unable to load configuration file (No such file or directory):\"\n )\n assert msg.endswith(\"missing.json'\")\n assert not app.config.from_file(\"missing.json\", load=json.load, silent=True)\n\n\ndef test_custom_config_class():\n class Config(flask.Config):\n pass\n\n class Flask(flask.Flask):\n config_class = Config\n\n app = Flask(__name__)\n assert isinstance(app.config, Config)\n app.config.from_object(__name__)\n common_object_test(app)\n\n\ndef test_session_lifetime():\n app = flask.Flask(__name__)\n app.config[\"PERMANENT_SESSION_LIFETIME\"] = 42\n assert app.permanent_session_lifetime.seconds == 42\n\n\ndef test_get_namespace():\n app = flask.Flask(__name__)\n app.config[\"FOO_OPTION_1\"] = \"foo option 1\"\n app.config[\"FOO_OPTION_2\"] = \"foo option 2\"\n app.config[\"BAR_STUFF_1\"] = \"bar stuff 1\"\n app.config[\"BAR_STUFF_2\"] = \"bar stuff 2\"\n foo_options = app.config.get_namespace(\"FOO_\")\n assert 2 == len(foo_options)\n assert \"foo option 1\" == foo_options[\"option_1\"]\n assert \"foo option 2\" == foo_options[\"option_2\"]\n bar_options = app.config.get_namespace(\"BAR_\", lowercase=False)\n assert 2 == len(bar_options)\n assert \"bar stuff 1\" == bar_options[\"STUFF_1\"]\n assert \"bar stuff 2\" == bar_options[\"STUFF_2\"]\n foo_options = app.config.get_namespace(\"FOO_\", trim_namespace=False)\n assert 2 == len(foo_options)\n assert \"foo option 1\" == foo_options[\"foo_option_1\"]\n assert \"foo option 2\" == foo_options[\"foo_option_2\"]\n bar_options = app.config.get_namespace(\n \"BAR_\", lowercase=False, trim_namespace=False\n )\n assert 2 == len(bar_options)\n assert \"bar stuff 1\" == bar_options[\"BAR_STUFF_1\"]\n assert \"bar stuff 2\" == bar_options[\"BAR_STUFF_2\"]\n\n\n@pytest.mark.parametrize(\"encoding\", [\"utf-8\", \"iso-8859-15\", \"latin-1\"])\ndef test_from_pyfile_weird_encoding(tmpdir, encoding):\n f = tmpdir.join(\"my_config.py\")\n f.write_binary(\n textwrap.dedent(\n f\"\"\"\n # -*- coding: {encoding} -*-\n TEST_VALUE = \"föö\"\n \"\"\"\n ).encode(encoding)\n )\n app = flask.Flask(__name__)\n app.config.from_pyfile(str(f))\n value = app.config[\"TEST_VALUE\"]\n assert value == \"föö\"\n"},{"col":0,"comment":"null","endLoc":82,"header":"def uuid4() -> UUID","id":220,"name":"uuid4","nodeType":"Function","startLoc":82,"text":"def uuid4() -> UUID: ..."},{"col":0,"comment":"null","endLoc":18,"header":"def common_object_test(app)","id":221,"name":"common_object_test","nodeType":"Function","startLoc":15,"text":"def common_object_test(app):\n assert app.secret_key == \"config\"\n assert app.config[\"TEST_KEY\"] == \"foo\"\n assert \"TestConfig\" not in app.config"},{"col":0,"comment":"null","endLoc":24,"header":"def test_config_from_pyfile()","id":222,"name":"test_config_from_pyfile","nodeType":"Function","startLoc":21,"text":"def test_config_from_pyfile():\n app = flask.Flask(__name__)\n app.config.from_pyfile(f\"{__file__.rsplit('.', 1)[0]}.py\")\n common_object_test(app)"},{"col":4,"comment":"null","endLoc":95,"header":"@overload\n def __new__(cls, attr: str) -> attrgetter[Any]","id":223,"name":"__new__","nodeType":"Function","startLoc":94,"text":"@overload\n def __new__(cls, attr: str) -> attrgetter[Any]: ..."},{"col":4,"comment":"null","endLoc":97,"header":"@overload\n def __new__(cls, attr: str, __attr2: str) -> attrgetter[tuple[Any, Any]]","id":224,"name":"__new__","nodeType":"Function","startLoc":96,"text":"@overload\n def __new__(cls, attr: str, __attr2: str) -> attrgetter[tuple[Any, Any]]: ..."},{"col":4,"comment":"null","endLoc":99,"header":"@overload\n def __new__(cls, attr: str, __attr2: str, __attr3: str) -> attrgetter[tuple[Any, Any, Any]]","id":225,"name":"__new__","nodeType":"Function","startLoc":98,"text":"@overload\n def __new__(cls, attr: str, __attr2: str, __attr3: str) -> attrgetter[tuple[Any, Any, Any]]: ..."},{"col":4,"comment":"null","endLoc":101,"header":"@overload\n def __new__(cls, attr: str, __attr2: str, __attr3: str, __attr4: str) -> attrgetter[tuple[Any, Any, Any, Any]]","id":226,"name":"__new__","nodeType":"Function","startLoc":100,"text":"@overload\n def __new__(cls, attr: str, __attr2: str, __attr3: str, __attr4: str) -> attrgetter[tuple[Any, Any, Any, Any]]: ..."},{"col":4,"comment":"null","endLoc":103,"header":"@overload\n def __new__(cls, attr: str, *attrs: str) -> attrgetter[tuple[Any, ...]]","id":227,"name":"__new__","nodeType":"Function","startLoc":102,"text":"@overload\n def __new__(cls, attr: str, *attrs: str) -> attrgetter[tuple[Any, ...]]: ..."},{"col":4,"comment":"null","endLoc":104,"header":"def __call__(self, obj: Any) -> _T_co","id":228,"name":"__call__","nodeType":"Function","startLoc":104,"text":"def __call__(self, obj: Any) -> _T_co: ..."},{"col":0,"comment":"null","endLoc":30,"header":"def test_config_from_object()","id":229,"name":"test_config_from_object","nodeType":"Function","startLoc":27,"text":"def test_config_from_object():\n app = flask.Flask(__name__)\n app.config.from_object(__name__)\n common_object_test(app)"},{"col":0,"comment":"null","endLoc":37,"header":"def test_config_from_file()","id":230,"name":"test_config_from_file","nodeType":"Function","startLoc":33,"text":"def test_config_from_file():\n app = flask.Flask(__name__)\n current_dir = os.path.dirname(os.path.abspath(__file__))\n app.config.from_file(os.path.join(current_dir, \"static\", \"config.json\"), json.load)\n common_object_test(app)"},{"col":4,"comment":"null","endLoc":96,"header":"@property\n def __class__(self) -> type[Self]","id":231,"name":"__class__","nodeType":"Function","startLoc":95,"text":"@property\n def __class__(self) -> type[Self]: ..."},{"col":4,"comment":"null","endLoc":99,"header":"@__class__.setter\n def __class__(self, __type: type[object]) -> None","id":232,"name":"__class__","nodeType":"Function","startLoc":98,"text":"@__class__.setter\n def __class__(self, __type: type[object]) -> None: ... # noqa: F811"},{"col":4,"comment":"null","endLoc":100,"header":"def __init__(self) -> None","id":233,"name":"__init__","nodeType":"Function","startLoc":100,"text":"def __init__(self) -> None: ..."},{"col":4,"comment":"null","endLoc":101,"header":"def __new__(cls) -> Self","id":234,"name":"__new__","nodeType":"Function","startLoc":101,"text":"def __new__(cls) -> Self: ..."},{"col":4,"comment":"null","endLoc":104,"header":"def __setattr__(self, __name: str, __value: Any) -> None","id":235,"name":"__setattr__","nodeType":"Function","startLoc":104,"text":"def __setattr__(self, __name: str, __value: Any) -> None: ..."},{"col":4,"comment":"null","endLoc":105,"header":"def __delattr__(self, __name: str) -> None","id":236,"name":"__delattr__","nodeType":"Function","startLoc":105,"text":"def __delattr__(self, __name: str) -> None: ..."},{"col":4,"comment":"null","endLoc":106,"header":"def __eq__(self, __value: object) -> bool","id":237,"name":"__eq__","nodeType":"Function","startLoc":106,"text":"def __eq__(self, __value: object) -> bool: ..."},{"col":4,"comment":"null","endLoc":107,"header":"def __ne__(self, __value: object) -> bool","id":238,"name":"__ne__","nodeType":"Function","startLoc":107,"text":"def __ne__(self, __value: object) -> bool: ..."},{"col":4,"comment":"null","endLoc":108,"header":"def __str__(self) -> str","id":239,"name":"__str__","nodeType":"Function","startLoc":108,"text":"def __str__(self) -> str: ... # noqa: Y029"},{"col":4,"comment":"null","endLoc":109,"header":"def __repr__(self) -> str","id":240,"name":"__repr__","nodeType":"Function","startLoc":109,"text":"def __repr__(self) -> str: ... # noqa: Y029"},{"col":4,"comment":"null","endLoc":110,"header":"def __hash__(self) -> int","id":241,"name":"__hash__","nodeType":"Function","startLoc":110,"text":"def __hash__(self) -> int: ..."},{"col":4,"comment":"null","endLoc":111,"header":"def __format__(self, __format_spec: str) -> str","id":242,"name":"__format__","nodeType":"Function","startLoc":111,"text":"def __format__(self, __format_spec: str) -> str: ..."},{"col":4,"comment":"null","endLoc":112,"header":"def __getattribute__(self, __name: str) -> Any","id":243,"name":"__getattribute__","nodeType":"Function","startLoc":112,"text":"def __getattribute__(self, __name: str) -> Any: ..."},{"col":4,"comment":"null","endLoc":113,"header":"def __sizeof__(self) -> int","id":244,"name":"__sizeof__","nodeType":"Function","startLoc":113,"text":"def __sizeof__(self) -> int: ..."},{"col":4,"comment":"null","endLoc":116,"header":"def __reduce__(self) -> str | tuple[Any, ...]","id":245,"name":"__reduce__","nodeType":"Function","startLoc":116,"text":"def __reduce__(self) -> str | tuple[Any, ...]: ..."},{"col":8,"comment":"null","endLoc":118,"header":"def __reduce_ex__(self, __protocol: SupportsIndex) -> str | tuple[Any, ...]","id":246,"name":"__reduce_ex__","nodeType":"Function","startLoc":118,"text":"def __reduce_ex__(self, __protocol: SupportsIndex) -> str | tuple[Any, ...]: ..."},{"col":8,"comment":"null","endLoc":120,"header":"def __reduce_ex__(self, __protocol: int) -> str | tuple[Any, ...]","id":247,"name":"__reduce_ex__","nodeType":"Function","startLoc":120,"text":"def __reduce_ex__(self, __protocol: int) -> str | tuple[Any, ...]: ..."},{"col":8,"comment":"null","endLoc":122,"header":"def __getstate__(self) -> object","id":248,"name":"__getstate__","nodeType":"Function","startLoc":122,"text":"def __getstate__(self) -> object: ..."},{"col":4,"comment":"null","endLoc":124,"header":"def __dir__(self) -> Iterable[str]","id":249,"name":"__dir__","nodeType":"Function","startLoc":124,"text":"def __dir__(self) -> Iterable[str]: ..."},{"col":4,"comment":"null","endLoc":125,"header":"def __init_subclass__(cls) -> None","id":250,"name":"__init_subclass__","nodeType":"Function","startLoc":125,"text":"def __init_subclass__(cls) -> None: ..."},{"col":4,"comment":"null","endLoc":127,"header":"@classmethod\n def __subclasshook__(cls, __subclass: type) -> bool","id":251,"name":"__subclasshook__","nodeType":"Function","startLoc":126,"text":"@classmethod\n def __subclasshook__(cls, __subclass: type) -> bool: ..."},{"attributeType":"str | None","col":4,"comment":"null","endLoc":91,"id":252,"name":"__doc__","nodeType":"Attribute","startLoc":91,"text":"__doc__"},{"attributeType":"Flask","col":0,"comment":"null","endLoc":46,"id":253,"name":"current_app","nodeType":"Attribute","startLoc":46,"text":"current_app"},{"col":0,"comment":"Get whether debug mode should be enabled for the app, indicated by the\n :envvar:`FLASK_DEBUG` environment variable. The default is ``False``.\n ","endLoc":33,"header":"def get_debug_flag() -> bool","id":254,"name":"get_debug_flag","nodeType":"Function","startLoc":28,"text":"def get_debug_flag() -> bool:\n \"\"\"Get whether debug mode should be enabled for the app, indicated by the\n :envvar:`FLASK_DEBUG` environment variable. The default is ``False``.\n \"\"\"\n val = os.environ.get(\"FLASK_DEBUG\")\n return bool(val and val.lower() not in {\"0\", \"false\", \"no\"})"},{"className":"ScriptInfo","col":0,"comment":"Helper object to deal with Flask applications. This is usually not\n necessary to interface with as it's used internally in the dispatching\n to click. In future versions of Flask this object will most likely play\n a bigger role. Typically it's created automatically by the\n :class:`FlaskGroup` but you can also manually create it and pass it\n onwards as click object.\n ","endLoc":331,"id":255,"nodeType":"Class","startLoc":266,"text":"class ScriptInfo:\n \"\"\"Helper object to deal with Flask applications. This is usually not\n necessary to interface with as it's used internally in the dispatching\n to click. In future versions of Flask this object will most likely play\n a bigger role. Typically it's created automatically by the\n :class:`FlaskGroup` but you can also manually create it and pass it\n onwards as click object.\n \"\"\"\n\n def __init__(\n self,\n app_import_path: str | None = None,\n create_app: t.Callable[..., Flask] | None = None,\n set_debug_flag: bool = True,\n ) -> None:\n #: Optionally the import path for the Flask application.\n self.app_import_path = app_import_path\n #: Optionally a function that is passed the script info to create\n #: the instance of the application.\n self.create_app = create_app\n #: A dictionary with arbitrary data that can be associated with\n #: this script info.\n self.data: t.Dict[t.Any, t.Any] = {}\n self.set_debug_flag = set_debug_flag\n self._loaded_app: Flask | None = None\n\n def load_app(self) -> Flask:\n \"\"\"Loads the Flask app (if not yet loaded) and returns it. Calling\n this multiple times will just result in the already loaded app to\n be returned.\n \"\"\"\n if self._loaded_app is not None:\n return self._loaded_app\n\n if self.create_app is not None:\n app = self.create_app()\n else:\n if self.app_import_path:\n path, name = (\n re.split(r\":(?![\\\\/])\", self.app_import_path, 1) + [None]\n )[:2]\n import_name = prepare_import(path)\n app = locate_app(import_name, name)\n else:\n for path in (\"wsgi.py\", \"app.py\"):\n import_name = prepare_import(path)\n app = locate_app(import_name, None, raise_if_not_found=False)\n\n if app:\n break\n\n if not app:\n raise NoAppException(\n \"Could not locate a Flask application. Use the\"\n \" 'flask --app' option, 'FLASK_APP' environment\"\n \" variable, or a 'wsgi.py' or 'app.py' file in the\"\n \" current directory.\"\n )\n\n if self.set_debug_flag:\n # Update the app's debug flag through the descriptor so that\n # other values repopulate as well.\n app.debug = get_debug_flag()\n\n self._loaded_app = app\n return app"},{"col":4,"comment":"null","endLoc":290,"header":"def __init__(\n self,\n app_import_path: str | None = None,\n create_app: t.Callable[..., Flask] | None = None,\n set_debug_flag: bool = True,\n ) -> None","id":256,"name":"__init__","nodeType":"Function","startLoc":275,"text":"def __init__(\n self,\n app_import_path: str | None = None,\n create_app: t.Callable[..., Flask] | None = None,\n set_debug_flag: bool = True,\n ) -> None:\n #: Optionally the import path for the Flask application.\n self.app_import_path = app_import_path\n #: Optionally a function that is passed the script info to create\n #: the instance of the application.\n self.create_app = create_app\n #: A dictionary with arbitrary data that can be associated with\n #: this script info.\n self.data: t.Dict[t.Any, t.Any] = {}\n self.set_debug_flag = set_debug_flag\n self._loaded_app: Flask | None = None"},{"col":4,"comment":"Loads the Flask app (if not yet loaded) and returns it. Calling\n this multiple times will just result in the already loaded app to\n be returned.\n ","endLoc":331,"header":"def load_app(self) -> Flask","id":257,"name":"load_app","nodeType":"Function","startLoc":292,"text":"def load_app(self) -> Flask:\n \"\"\"Loads the Flask app (if not yet loaded) and returns it. Calling\n this multiple times will just result in the already loaded app to\n be returned.\n \"\"\"\n if self._loaded_app is not None:\n return self._loaded_app\n\n if self.create_app is not None:\n app = self.create_app()\n else:\n if self.app_import_path:\n path, name = (\n re.split(r\":(?![\\\\/])\", self.app_import_path, 1) + [None]\n )[:2]\n import_name = prepare_import(path)\n app = locate_app(import_name, name)\n else:\n for path in (\"wsgi.py\", \"app.py\"):\n import_name = prepare_import(path)\n app = locate_app(import_name, None, raise_if_not_found=False)\n\n if app:\n break\n\n if not app:\n raise NoAppException(\n \"Could not locate a Flask application. Use the\"\n \" 'flask --app' option, 'FLASK_APP' environment\"\n \" variable, or a 'wsgi.py' or 'app.py' file in the\"\n \" current directory.\"\n )\n\n if self.set_debug_flag:\n # Update the app's debug flag through the descriptor so that\n # other values repopulate as well.\n app.debug = get_debug_flag()\n\n self._loaded_app = app\n return app"},{"col":4,"comment":"null","endLoc":645,"header":"@abstractmethod\n def __setitem__(self, __key: _KT, __value: _VT) -> None","id":258,"name":"__setitem__","nodeType":"Function","startLoc":644,"text":"@abstractmethod\n def __setitem__(self, __key: _KT, __value: _VT) -> None: ..."},{"col":4,"comment":"null","endLoc":647,"header":"@abstractmethod\n def __delitem__(self, __key: _KT) -> None","id":259,"name":"__delitem__","nodeType":"Function","startLoc":646,"text":"@abstractmethod\n def __delitem__(self, __key: _KT) -> None: ..."},{"col":4,"comment":"null","endLoc":648,"header":"def clear(self) -> None","id":260,"name":"clear","nodeType":"Function","startLoc":648,"text":"def clear(self) -> None: ..."},{"col":4,"comment":"null","endLoc":650,"header":"@overload\n def pop(self, __key: _KT) -> _VT","id":261,"name":"pop","nodeType":"Function","startLoc":649,"text":"@overload\n def pop(self, __key: _KT) -> _VT: ..."},{"col":4,"comment":"null","endLoc":652,"header":"@overload\n def pop(self, __key: _KT, default: _VT) -> _VT","id":262,"name":"pop","nodeType":"Function","startLoc":651,"text":"@overload\n def pop(self, __key: _KT, default: _VT) -> _VT: ..."},{"col":4,"comment":"null","endLoc":654,"header":"@overload\n def pop(self, __key: _KT, default: _T) -> _VT | _T","id":263,"name":"pop","nodeType":"Function","startLoc":653,"text":"@overload\n def pop(self, __key: _KT, default: _T) -> _VT | _T: ..."},{"col":4,"comment":"null","endLoc":655,"header":"def popitem(self) -> tuple[_KT, _VT]","id":264,"name":"popitem","nodeType":"Function","startLoc":655,"text":"def popitem(self) -> tuple[_KT, _VT]: ..."},{"col":4,"comment":"null","endLoc":663,"header":"@overload\n def setdefault(self: MutableMapping[_KT, _T | None], __key: _KT, __default: None = None) -> _T | None","id":265,"name":"setdefault","nodeType":"Function","startLoc":662,"text":"@overload\n def setdefault(self: MutableMapping[_KT, _T | None], __key: _KT, __default: None = None) -> _T | None: ..."},{"col":4,"comment":"null","endLoc":665,"header":"@overload\n def setdefault(self, __key: _KT, __default: _VT) -> _VT","id":266,"name":"setdefault","nodeType":"Function","startLoc":664,"text":"@overload\n def setdefault(self, __key: _KT, __default: _VT) -> _VT: ..."},{"col":4,"comment":"null","endLoc":687,"header":"@overload\n def update(self, __m: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None","id":267,"name":"update","nodeType":"Function","startLoc":686,"text":"@overload\n def update(self, __m: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ..."},{"col":4,"comment":"null","endLoc":689,"header":"@overload\n def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None","id":268,"name":"update","nodeType":"Function","startLoc":688,"text":"@overload\n def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ..."},{"col":4,"comment":"null","endLoc":691,"header":"@overload\n def update(self, **kwargs: _VT) -> None","id":269,"name":"update","nodeType":"Function","startLoc":690,"text":"@overload\n def update(self, **kwargs: _VT) -> None: ..."},{"className":"Markup","col":0,"comment":"A string that is ready to be safely inserted into an HTML or XML\n document, either because it was escaped or because it was marked\n safe.\n\n Passing an object to the constructor converts it to text and wraps\n it to mark it safe without escaping. To escape the text, use the\n :meth:`escape` class method instead.\n\n >>> Markup('Hello, World!')\n Markup('Hello, World!')\n >>> Markup(42)\n Markup('42')\n >>> Markup.escape('Hello, World!')\n Markup('Hello <em>World</em>!')\n\n This implements the ``__html__()`` interface that some frameworks\n use. Passing an object that implements ``__html__()`` will wrap the\n output of that method, marking it safe.\n\n >>> class Foo:\n ... def __html__(self):\n ... return 'foo'\n ...\n >>> Markup(Foo())\n Markup('foo')\n\n This is a subclass of the text type (``str`` in Python 3,\n ``unicode`` in Python 2). It has the same methods as that type, but\n all methods escape their arguments and return a ``Markup`` instance.\n\n >>> Markup('%s') % 'foo & bar'\n Markup('foo & bar')\n >>> Markup('Hello ') + ''\n Markup('Hello <foo>')\n ","endLoc":224,"id":270,"nodeType":"Class","startLoc":31,"text":"class Markup(text_type):\n \"\"\"A string that is ready to be safely inserted into an HTML or XML\n document, either because it was escaped or because it was marked\n safe.\n\n Passing an object to the constructor converts it to text and wraps\n it to mark it safe without escaping. To escape the text, use the\n :meth:`escape` class method instead.\n\n >>> Markup('Hello, World!')\n Markup('Hello, World!')\n >>> Markup(42)\n Markup('42')\n >>> Markup.escape('Hello, World!')\n Markup('Hello <em>World</em>!')\n\n This implements the ``__html__()`` interface that some frameworks\n use. Passing an object that implements ``__html__()`` will wrap the\n output of that method, marking it safe.\n\n >>> class Foo:\n ... def __html__(self):\n ... return 'foo'\n ...\n >>> Markup(Foo())\n Markup('foo')\n\n This is a subclass of the text type (``str`` in Python 3,\n ``unicode`` in Python 2). It has the same methods as that type, but\n all methods escape their arguments and return a ``Markup`` instance.\n\n >>> Markup('%s') % 'foo & bar'\n Markup('foo & bar')\n >>> Markup('Hello ') + ''\n Markup('Hello <foo>')\n \"\"\"\n\n __slots__ = ()\n\n def __new__(cls, base=u\"\", encoding=None, errors=\"strict\"):\n if hasattr(base, \"__html__\"):\n base = base.__html__()\n if encoding is None:\n return text_type.__new__(cls, base)\n return text_type.__new__(cls, base, encoding, errors)\n\n def __html__(self):\n return self\n\n def __add__(self, other):\n if isinstance(other, string_types) or hasattr(other, \"__html__\"):\n return self.__class__(super(Markup, self).__add__(self.escape(other)))\n return NotImplemented\n\n def __radd__(self, other):\n if hasattr(other, \"__html__\") or isinstance(other, string_types):\n return self.escape(other).__add__(self)\n return NotImplemented\n\n def __mul__(self, num):\n if isinstance(num, int_types):\n return self.__class__(text_type.__mul__(self, num))\n return NotImplemented\n\n __rmul__ = __mul__\n\n def __mod__(self, arg):\n if isinstance(arg, tuple):\n arg = tuple(_MarkupEscapeHelper(x, self.escape) for x in arg)\n else:\n arg = _MarkupEscapeHelper(arg, self.escape)\n return self.__class__(text_type.__mod__(self, arg))\n\n def __repr__(self):\n return \"%s(%s)\" % (self.__class__.__name__, text_type.__repr__(self))\n\n def join(self, seq):\n return self.__class__(text_type.join(self, map(self.escape, seq)))\n\n join.__doc__ = text_type.join.__doc__\n\n def split(self, *args, **kwargs):\n return list(map(self.__class__, text_type.split(self, *args, **kwargs)))\n\n split.__doc__ = text_type.split.__doc__\n\n def rsplit(self, *args, **kwargs):\n return list(map(self.__class__, text_type.rsplit(self, *args, **kwargs)))\n\n rsplit.__doc__ = text_type.rsplit.__doc__\n\n def splitlines(self, *args, **kwargs):\n return list(map(self.__class__, text_type.splitlines(self, *args, **kwargs)))\n\n splitlines.__doc__ = text_type.splitlines.__doc__\n\n def unescape(self):\n \"\"\"Convert escaped markup back into a text string. This replaces\n HTML entities with the characters they represent.\n\n >>> Markup('Main » About').unescape()\n 'Main » About'\n \"\"\"\n from ._constants import HTML_ENTITIES\n\n def handle_match(m):\n name = m.group(1)\n if name in HTML_ENTITIES:\n return unichr(HTML_ENTITIES[name])\n try:\n if name[:2] in (\"#x\", \"#X\"):\n return unichr(int(name[2:], 16))\n elif name.startswith(\"#\"):\n return unichr(int(name[1:]))\n except ValueError:\n pass\n # Don't modify unexpected input.\n return m.group()\n\n return _entity_re.sub(handle_match, text_type(self))\n\n def striptags(self):\n \"\"\":meth:`unescape` the markup, remove tags, and normalize\n whitespace to single spaces.\n\n >>> Markup('Main »\\tAbout').striptags()\n 'Main » About'\n \"\"\"\n stripped = u\" \".join(_striptags_re.sub(\"\", self).split())\n return Markup(stripped).unescape()\n\n @classmethod\n def escape(cls, s):\n \"\"\"Escape a string. Calls :func:`escape` and ensures that for\n subclasses the correct type is returned.\n \"\"\"\n rv = escape(s)\n if rv.__class__ is not cls:\n return cls(rv)\n return rv\n\n def make_simple_escaping_wrapper(name): # noqa: B902\n orig = getattr(text_type, name)\n\n def func(self, *args, **kwargs):\n args = _escape_argspec(list(args), enumerate(args), self.escape)\n _escape_argspec(kwargs, iteritems(kwargs), self.escape)\n return self.__class__(orig(self, *args, **kwargs))\n\n func.__name__ = orig.__name__\n func.__doc__ = orig.__doc__\n return func\n\n for method in (\n \"__getitem__\",\n \"capitalize\",\n \"title\",\n \"lower\",\n \"upper\",\n \"replace\",\n \"ljust\",\n \"rjust\",\n \"lstrip\",\n \"rstrip\",\n \"center\",\n \"strip\",\n \"translate\",\n \"expandtabs\",\n \"swapcase\",\n \"zfill\",\n ):\n locals()[method] = make_simple_escaping_wrapper(method)\n\n def partition(self, sep):\n return tuple(map(self.__class__, text_type.partition(self, self.escape(sep))))\n\n def rpartition(self, sep):\n return tuple(map(self.__class__, text_type.rpartition(self, self.escape(sep))))\n\n def format(self, *args, **kwargs):\n formatter = EscapeFormatter(self.escape)\n kwargs = _MagicFormatMapping(args, kwargs)\n return self.__class__(formatter.vformat(self, args, kwargs))\n\n def __html_format__(self, format_spec):\n if format_spec:\n raise ValueError(\"Unsupported format specification \" \"for Markup.\")\n return self\n\n # not in python 3\n if hasattr(text_type, \"__getslice__\"):\n __getslice__ = make_simple_escaping_wrapper(\"__getslice__\")\n\n del method, make_simple_escaping_wrapper"},{"fileName":"test_testing.py","filePath":"tests","id":272,"nodeType":"File","text":"import click\nimport pytest\nimport werkzeug\n\nimport flask\nfrom flask import appcontext_popped\nfrom flask.cli import ScriptInfo\nfrom flask.globals import _cv_request\nfrom flask.json import jsonify\nfrom flask.testing import EnvironBuilder\nfrom flask.testing import FlaskCliRunner\n\ntry:\n import blinker\nexcept ImportError:\n blinker = None\n\n\ndef test_environ_defaults_from_config(app, client):\n app.config[\"SERVER_NAME\"] = \"example.com:1234\"\n app.config[\"APPLICATION_ROOT\"] = \"/foo\"\n\n @app.route(\"/\")\n def index():\n return flask.request.url\n\n ctx = app.test_request_context()\n assert ctx.request.url == \"http://example.com:1234/foo/\"\n\n rv = client.get(\"/\")\n assert rv.data == b\"http://example.com:1234/foo/\"\n\n\ndef test_environ_defaults(app, client, app_ctx, req_ctx):\n @app.route(\"/\")\n def index():\n return flask.request.url\n\n ctx = app.test_request_context()\n assert ctx.request.url == \"http://localhost/\"\n with client:\n rv = client.get(\"/\")\n assert rv.data == b\"http://localhost/\"\n\n\ndef test_environ_base_default(app, client, app_ctx):\n @app.route(\"/\")\n def index():\n flask.g.user_agent = flask.request.headers[\"User-Agent\"]\n return flask.request.remote_addr\n\n rv = client.get(\"/\")\n assert rv.data == b\"127.0.0.1\"\n assert flask.g.user_agent == f\"werkzeug/{werkzeug.__version__}\"\n\n\ndef test_environ_base_modified(app, client, app_ctx):\n @app.route(\"/\")\n def index():\n flask.g.user_agent = flask.request.headers[\"User-Agent\"]\n return flask.request.remote_addr\n\n client.environ_base[\"REMOTE_ADDR\"] = \"0.0.0.0\"\n client.environ_base[\"HTTP_USER_AGENT\"] = \"Foo\"\n rv = client.get(\"/\")\n assert rv.data == b\"0.0.0.0\"\n assert flask.g.user_agent == \"Foo\"\n\n client.environ_base[\"REMOTE_ADDR\"] = \"0.0.0.1\"\n client.environ_base[\"HTTP_USER_AGENT\"] = \"Bar\"\n rv = client.get(\"/\")\n assert rv.data == b\"0.0.0.1\"\n assert flask.g.user_agent == \"Bar\"\n\n\ndef test_client_open_environ(app, client, request):\n @app.route(\"/index\")\n def index():\n return flask.request.remote_addr\n\n builder = EnvironBuilder(app, path=\"/index\", method=\"GET\")\n request.addfinalizer(builder.close)\n\n rv = client.open(builder)\n assert rv.data == b\"127.0.0.1\"\n\n environ = builder.get_environ()\n client.environ_base[\"REMOTE_ADDR\"] = \"127.0.0.2\"\n rv = client.open(environ)\n assert rv.data == b\"127.0.0.2\"\n\n\ndef test_specify_url_scheme(app, client):\n @app.route(\"/\")\n def index():\n return flask.request.url\n\n ctx = app.test_request_context(url_scheme=\"https\")\n assert ctx.request.url == \"https://localhost/\"\n\n rv = client.get(\"/\", url_scheme=\"https\")\n assert rv.data == b\"https://localhost/\"\n\n\ndef test_path_is_url(app):\n eb = EnvironBuilder(app, \"https://example.com/\")\n assert eb.url_scheme == \"https\"\n assert eb.host == \"example.com\"\n assert eb.script_root == \"\"\n assert eb.path == \"/\"\n\n\ndef test_environbuilder_json_dumps(app):\n \"\"\"EnvironBuilder.json_dumps() takes settings from the app.\"\"\"\n app.json.ensure_ascii = False\n eb = EnvironBuilder(app, json=\"\\u20ac\")\n assert eb.input_stream.read().decode(\"utf8\") == '\"\\u20ac\"'\n\n\ndef test_blueprint_with_subdomain():\n app = flask.Flask(__name__, subdomain_matching=True)\n app.config[\"SERVER_NAME\"] = \"example.com:1234\"\n app.config[\"APPLICATION_ROOT\"] = \"/foo\"\n client = app.test_client()\n\n bp = flask.Blueprint(\"company\", __name__, subdomain=\"xxx\")\n\n @bp.route(\"/\")\n def index():\n return flask.request.url\n\n app.register_blueprint(bp)\n\n ctx = app.test_request_context(\"/\", subdomain=\"xxx\")\n assert ctx.request.url == \"http://xxx.example.com:1234/foo/\"\n\n with ctx:\n assert ctx.request.blueprint == bp.name\n\n rv = client.get(\"/\", subdomain=\"xxx\")\n assert rv.data == b\"http://xxx.example.com:1234/foo/\"\n\n\ndef test_redirect_keep_session(app, client, app_ctx):\n @app.route(\"/\", methods=[\"GET\", \"POST\"])\n def index():\n if flask.request.method == \"POST\":\n return flask.redirect(\"/getsession\")\n flask.session[\"data\"] = \"foo\"\n return \"index\"\n\n @app.route(\"/getsession\")\n def get_session():\n return flask.session.get(\"data\", \"\")\n\n with client:\n rv = client.get(\"/getsession\")\n assert rv.data == b\"\"\n\n rv = client.get(\"/\")\n assert rv.data == b\"index\"\n assert flask.session.get(\"data\") == \"foo\"\n\n rv = client.post(\"/\", data={}, follow_redirects=True)\n assert rv.data == b\"foo\"\n assert flask.session.get(\"data\") == \"foo\"\n\n rv = client.get(\"/getsession\")\n assert rv.data == b\"foo\"\n\n\ndef test_session_transactions(app, client):\n @app.route(\"/\")\n def index():\n return str(flask.session[\"foo\"])\n\n with client:\n with client.session_transaction() as sess:\n assert len(sess) == 0\n sess[\"foo\"] = [42]\n assert len(sess) == 1\n rv = client.get(\"/\")\n assert rv.data == b\"[42]\"\n with client.session_transaction() as sess:\n assert len(sess) == 1\n assert sess[\"foo\"] == [42]\n\n\ndef test_session_transactions_no_null_sessions():\n app = flask.Flask(__name__)\n\n with app.test_client() as c:\n with pytest.raises(RuntimeError) as e:\n with c.session_transaction():\n pass\n assert \"Session backend did not open a session\" in str(e.value)\n\n\ndef test_session_transactions_keep_context(app, client, req_ctx):\n client.get(\"/\")\n req = flask.request._get_current_object()\n assert req is not None\n with client.session_transaction():\n assert req is flask.request._get_current_object()\n\n\ndef test_session_transaction_needs_cookies(app):\n c = app.test_client(use_cookies=False)\n with pytest.raises(RuntimeError) as e:\n with c.session_transaction():\n pass\n assert \"cookies\" in str(e.value)\n\n\ndef test_test_client_context_binding(app, client):\n app.testing = False\n\n @app.route(\"/\")\n def index():\n flask.g.value = 42\n return \"Hello World!\"\n\n @app.route(\"/other\")\n def other():\n 1 // 0\n\n with client:\n resp = client.get(\"/\")\n assert flask.g.value == 42\n assert resp.data == b\"Hello World!\"\n assert resp.status_code == 200\n\n resp = client.get(\"/other\")\n assert not hasattr(flask.g, \"value\")\n assert b\"Internal Server Error\" in resp.data\n assert resp.status_code == 500\n flask.g.value = 23\n\n try:\n flask.g.value\n except (AttributeError, RuntimeError):\n pass\n else:\n raise AssertionError(\"some kind of exception expected\")\n\n\ndef test_reuse_client(client):\n c = client\n\n with c:\n assert client.get(\"/\").status_code == 404\n\n with c:\n assert client.get(\"/\").status_code == 404\n\n\ndef test_full_url_request(app, client):\n @app.route(\"/action\", methods=[\"POST\"])\n def action():\n return \"x\"\n\n with client:\n rv = client.post(\"http://domain.com/action?vodka=42\", data={\"gin\": 43})\n assert rv.status_code == 200\n assert \"gin\" in flask.request.form\n assert \"vodka\" in flask.request.args\n\n\ndef test_json_request_and_response(app, client):\n @app.route(\"/echo\", methods=[\"POST\"])\n def echo():\n return jsonify(flask.request.get_json())\n\n with client:\n json_data = {\"drink\": {\"gin\": 1, \"tonic\": True}, \"price\": 10}\n rv = client.post(\"/echo\", json=json_data)\n\n # Request should be in JSON\n assert flask.request.is_json\n assert flask.request.get_json() == json_data\n\n # Response should be in JSON\n assert rv.status_code == 200\n assert rv.is_json\n assert rv.get_json() == json_data\n\n\n@pytest.mark.skipif(blinker is None, reason=\"blinker is not installed\")\ndef test_client_json_no_app_context(app, client):\n @app.route(\"/hello\", methods=[\"POST\"])\n def hello():\n return f\"Hello, {flask.request.json['name']}!\"\n\n class Namespace:\n count = 0\n\n def add(self, app):\n self.count += 1\n\n ns = Namespace()\n\n with appcontext_popped.connected_to(ns.add, app):\n rv = client.post(\"/hello\", json={\"name\": \"Flask\"})\n\n assert rv.get_data(as_text=True) == \"Hello, Flask!\"\n assert ns.count == 1\n\n\ndef test_subdomain():\n app = flask.Flask(__name__, subdomain_matching=True)\n app.config[\"SERVER_NAME\"] = \"example.com\"\n client = app.test_client()\n\n @app.route(\"/\", subdomain=\"\")\n def view(company_id):\n return company_id\n\n with app.test_request_context():\n url = flask.url_for(\"view\", company_id=\"xxx\")\n\n with client:\n response = client.get(url)\n\n assert 200 == response.status_code\n assert b\"xxx\" == response.data\n\n\ndef test_nosubdomain(app, client):\n app.config[\"SERVER_NAME\"] = \"example.com\"\n\n @app.route(\"/\")\n def view(company_id):\n return company_id\n\n with app.test_request_context():\n url = flask.url_for(\"view\", company_id=\"xxx\")\n\n with client:\n response = client.get(url)\n\n assert 200 == response.status_code\n assert b\"xxx\" == response.data\n\n\ndef test_cli_runner_class(app):\n runner = app.test_cli_runner()\n assert isinstance(runner, FlaskCliRunner)\n\n class SubRunner(FlaskCliRunner):\n pass\n\n app.test_cli_runner_class = SubRunner\n runner = app.test_cli_runner()\n assert isinstance(runner, SubRunner)\n\n\ndef test_cli_invoke(app):\n @app.cli.command(\"hello\")\n def hello_command():\n click.echo(\"Hello, World!\")\n\n runner = app.test_cli_runner()\n # invoke with command name\n result = runner.invoke(args=[\"hello\"])\n assert \"Hello\" in result.output\n # invoke with command object\n result = runner.invoke(hello_command)\n assert \"Hello\" in result.output\n\n\ndef test_cli_custom_obj(app):\n class NS:\n called = False\n\n def create_app():\n NS.called = True\n return app\n\n @app.cli.command(\"hello\")\n def hello_command():\n click.echo(\"Hello, World!\")\n\n script_info = ScriptInfo(create_app=create_app)\n runner = app.test_cli_runner()\n runner.invoke(hello_command, obj=script_info)\n assert NS.called\n\n\ndef test_client_pop_all_preserved(app, req_ctx, client):\n @app.route(\"/\")\n def index():\n # stream_with_context pushes a third context, preserved by response\n return flask.stream_with_context(\"hello\")\n\n # req_ctx fixture pushed an initial context\n with client:\n # request pushes a second request context, preserved by client\n rv = client.get(\"/\")\n\n # close the response, releasing the context held by stream_with_context\n rv.close()\n # only req_ctx fixture should still be pushed\n assert _cv_request.get(None) is req_ctx\n"},{"col":0,"comment":"Determine if the given string is an IP address.\n\n :param value: value to check\n :type value: str\n\n :return: True if string is an IP address\n :rtype: bool\n ","endLoc":674,"header":"def is_ip(value: str) -> bool","id":273,"name":"is_ip","nodeType":"Function","startLoc":657,"text":"def is_ip(value: str) -> bool:\n \"\"\"Determine if the given string is an IP address.\n\n :param value: value to check\n :type value: str\n\n :return: True if string is an IP address\n :rtype: bool\n \"\"\"\n for family in (socket.AF_INET, socket.AF_INET6):\n try:\n socket.inet_pton(family, value)\n except OSError:\n pass\n else:\n return True\n\n return False"},{"col":4,"comment":"null","endLoc":75,"header":"def __new__(cls, base=u\"\", encoding=None, errors=\"strict\")","id":275,"name":"__new__","nodeType":"Function","startLoc":70,"text":"def __new__(cls, base=u\"\", encoding=None, errors=\"strict\"):\n if hasattr(base, \"__html__\"):\n base = base.__html__()\n if encoding is None:\n return text_type.__new__(cls, base)\n return text_type.__new__(cls, base, encoding, errors)"},{"attributeType":"dict","col":4,"comment":"null","endLoc":92,"id":276,"name":"__dict__","nodeType":"Attribute","startLoc":92,"text":"__dict__"},{"col":0,"comment":"null","endLoc":31,"header":"def test_environ_defaults_from_config(app, client)","id":279,"name":"test_environ_defaults_from_config","nodeType":"Function","startLoc":19,"text":"def test_environ_defaults_from_config(app, client):\n app.config[\"SERVER_NAME\"] = \"example.com:1234\"\n app.config[\"APPLICATION_ROOT\"] = \"/foo\"\n\n @app.route(\"/\")\n def index():\n return flask.request.url\n\n ctx = app.test_request_context()\n assert ctx.request.url == \"http://example.com:1234/foo/\"\n\n rv = client.get(\"/\")\n assert rv.data == b\"http://example.com:1234/foo/\""},{"col":0,"comment":"null","endLoc":43,"header":"def test_environ_defaults(app, client, app_ctx, req_ctx)","id":281,"name":"test_environ_defaults","nodeType":"Function","startLoc":34,"text":"def test_environ_defaults(app, client, app_ctx, req_ctx):\n @app.route(\"/\")\n def index():\n return flask.request.url\n\n ctx = app.test_request_context()\n assert ctx.request.url == \"http://localhost/\"\n with client:\n rv = client.get(\"/\")\n assert rv.data == b\"http://localhost/\""},{"col":0,"comment":"null","endLoc":54,"header":"def test_environ_base_default(app, client, app_ctx)","id":283,"name":"test_environ_base_default","nodeType":"Function","startLoc":46,"text":"def test_environ_base_default(app, client, app_ctx):\n @app.route(\"/\")\n def index():\n flask.g.user_agent = flask.request.headers[\"User-Agent\"]\n return flask.request.remote_addr\n\n rv = client.get(\"/\")\n assert rv.data == b\"127.0.0.1\"\n assert flask.g.user_agent == f\"werkzeug/{werkzeug.__version__}\""},{"attributeType":"str","col":4,"comment":"null","endLoc":93,"id":284,"name":"__module__","nodeType":"Attribute","startLoc":93,"text":"__module__"},{"attributeType":"dict","col":4,"comment":"null","endLoc":94,"id":285,"name":"__annotations__","nodeType":"Attribute","startLoc":94,"text":"__annotations__"},{"col":4,"comment":"Get the template source, filename and reload helper for a template.\n It's passed the environment and template name and has to return a\n tuple in the form ``(source, filename, uptodate)`` or raise a\n `TemplateNotFound` error if it can't locate the template.\n\n The source part of the returned tuple must be the source of the\n template as unicode string or a ASCII bytestring. The filename should\n be the name of the file on the filesystem if it was loaded from there,\n otherwise `None`. The filename is used by python for the tracebacks\n if no loader extension is used.\n\n The last item in the tuple is the `uptodate` function. If auto\n reloading is enabled it's always called to check if the template\n changed. No arguments are passed so the function must store the\n old state somewhere (for example in a closure). If it returns `False`\n the template will be reloaded.\n ","endLoc":93,"header":"def get_source(self, environment, template)","id":288,"name":"get_source","nodeType":"Function","startLoc":71,"text":"def get_source(self, environment, template):\n \"\"\"Get the template source, filename and reload helper for a template.\n It's passed the environment and template name and has to return a\n tuple in the form ``(source, filename, uptodate)`` or raise a\n `TemplateNotFound` error if it can't locate the template.\n\n The source part of the returned tuple must be the source of the\n template as unicode string or a ASCII bytestring. The filename should\n be the name of the file on the filesystem if it was loaded from there,\n otherwise `None`. The filename is used by python for the tracebacks\n if no loader extension is used.\n\n The last item in the tuple is the `uptodate` function. If auto\n reloading is enabled it's always called to check if the template\n changed. No arguments are passed so the function must store the\n old state somewhere (for example in a closure). If it returns `False`\n the template will be reloaded.\n \"\"\"\n if not self.has_source_access:\n raise RuntimeError(\n \"%s cannot provide access to the source\" % self.__class__.__name__\n )\n raise TemplateNotFound(template)"},{"col":0,"comment":"null","endLoc":73,"header":"def test_environ_base_modified(app, client, app_ctx)","id":289,"name":"test_environ_base_modified","nodeType":"Function","startLoc":57,"text":"def test_environ_base_modified(app, client, app_ctx):\n @app.route(\"/\")\n def index():\n flask.g.user_agent = flask.request.headers[\"User-Agent\"]\n return flask.request.remote_addr\n\n client.environ_base[\"REMOTE_ADDR\"] = \"0.0.0.0\"\n client.environ_base[\"HTTP_USER_AGENT\"] = \"Foo\"\n rv = client.get(\"/\")\n assert rv.data == b\"0.0.0.0\"\n assert flask.g.user_agent == \"Foo\"\n\n client.environ_base[\"REMOTE_ADDR\"] = \"0.0.0.1\"\n client.environ_base[\"HTTP_USER_AGENT\"] = \"Bar\"\n rv = client.get(\"/\")\n assert rv.data == b\"0.0.0.1\"\n assert flask.g.user_agent == \"Bar\""},{"col":0,"comment":"null","endLoc":90,"header":"def test_client_open_environ(app, client, request)","id":290,"name":"test_client_open_environ","nodeType":"Function","startLoc":76,"text":"def test_client_open_environ(app, client, request):\n @app.route(\"/index\")\n def index():\n return flask.request.remote_addr\n\n builder = EnvironBuilder(app, path=\"/index\", method=\"GET\")\n request.addfinalizer(builder.close)\n\n rv = client.open(builder)\n assert rv.data == b\"127.0.0.1\"\n\n environ = builder.get_environ()\n client.environ_base[\"REMOTE_ADDR\"] = \"127.0.0.2\"\n rv = client.open(environ)\n assert rv.data == b\"127.0.0.2\""},{"col":0,"comment":"null","endLoc":102,"header":"def test_specify_url_scheme(app, client)","id":291,"name":"test_specify_url_scheme","nodeType":"Function","startLoc":93,"text":"def test_specify_url_scheme(app, client):\n @app.route(\"/\")\n def index():\n return flask.request.url\n\n ctx = app.test_request_context(url_scheme=\"https\")\n assert ctx.request.url == \"https://localhost/\"\n\n rv = client.get(\"/\", url_scheme=\"https\")\n assert rv.data == b\"https://localhost/\""},{"col":0,"comment":"null","endLoc":110,"header":"def test_path_is_url(app)","id":297,"name":"test_path_is_url","nodeType":"Function","startLoc":105,"text":"def test_path_is_url(app):\n eb = EnvironBuilder(app, \"https://example.com/\")\n assert eb.url_scheme == \"https\"\n assert eb.host == \"example.com\"\n assert eb.script_root == \"\"\n assert eb.path == \"/\""},{"col":0,"comment":"EnvironBuilder.json_dumps() takes settings from the app.","endLoc":117,"header":"def test_environbuilder_json_dumps(app)","id":298,"name":"test_environbuilder_json_dumps","nodeType":"Function","startLoc":113,"text":"def test_environbuilder_json_dumps(app):\n \"\"\"EnvironBuilder.json_dumps() takes settings from the app.\"\"\"\n app.json.ensure_ascii = False\n eb = EnvironBuilder(app, json=\"\\u20ac\")\n assert eb.input_stream.read().decode(\"utf8\") == '\"\\u20ac\"'"},{"col":0,"comment":"null","endLoc":141,"header":"def test_blueprint_with_subdomain()","id":299,"name":"test_blueprint_with_subdomain","nodeType":"Function","startLoc":120,"text":"def test_blueprint_with_subdomain():\n app = flask.Flask(__name__, subdomain_matching=True)\n app.config[\"SERVER_NAME\"] = \"example.com:1234\"\n app.config[\"APPLICATION_ROOT\"] = \"/foo\"\n client = app.test_client()\n\n bp = flask.Blueprint(\"company\", __name__, subdomain=\"xxx\")\n\n @bp.route(\"/\")\n def index():\n return flask.request.url\n\n app.register_blueprint(bp)\n\n ctx = app.test_request_context(\"/\", subdomain=\"xxx\")\n assert ctx.request.url == \"http://xxx.example.com:1234/foo/\"\n\n with ctx:\n assert ctx.request.blueprint == bp.name\n\n rv = client.get(\"/\", subdomain=\"xxx\")\n assert rv.data == b\"http://xxx.example.com:1234/foo/\""},{"className":"Exception","col":0,"comment":"null","endLoc":1947,"id":300,"nodeType":"Class","startLoc":1947,"text":"class Exception(BaseException): ..."},{"className":"BaseException","col":0,"comment":"null","endLoc":1939,"id":301,"nodeType":"Class","startLoc":1927,"text":"class BaseException:\n args: tuple[Any, ...]\n __cause__: BaseException | None\n __context__: BaseException | None\n __suppress_context__: bool\n __traceback__: TracebackType | None\n def __init__(self, *args: object) -> None: ...\n def __setstate__(self, __state: dict[str, Any] | None) -> None: ...\n def with_traceback(self, __tb: TracebackType | None) -> Self: ...\n if sys.version_info >= (3, 11):\n # only present after add_note() is called\n __notes__: list[str]\n def add_note(self, __note: str) -> None: ..."},{"col":4,"comment":"null","endLoc":1933,"header":"def __init__(self, *args: object) -> None","id":302,"name":"__init__","nodeType":"Function","startLoc":1933,"text":"def __init__(self, *args: object) -> None: ..."},{"col":4,"comment":"null","endLoc":1934,"header":"def __setstate__(self, __state: dict[str, Any] | None) -> None","id":303,"name":"__setstate__","nodeType":"Function","startLoc":1934,"text":"def __setstate__(self, __state: dict[str, Any] | None) -> None: ..."},{"col":4,"comment":"null","endLoc":1935,"header":"def with_traceback(self, __tb: TracebackType | None) -> Self","id":304,"name":"with_traceback","nodeType":"Function","startLoc":1935,"text":"def with_traceback(self, __tb: TracebackType | None) -> Self: ..."},{"col":8,"comment":"null","endLoc":1939,"header":"def add_note(self, __note: str) -> None","id":305,"name":"add_note","nodeType":"Function","startLoc":1939,"text":"def add_note(self, __note: str) -> None: ..."},{"attributeType":"(Any, ...)","col":4,"comment":"null","endLoc":1928,"id":306,"name":"args","nodeType":"Attribute","startLoc":1928,"text":"args"},{"col":0,"comment":"null","endLoc":169,"header":"def test_redirect_keep_session(app, client, app_ctx)","id":309,"name":"test_redirect_keep_session","nodeType":"Function","startLoc":144,"text":"def test_redirect_keep_session(app, client, app_ctx):\n @app.route(\"/\", methods=[\"GET\", \"POST\"])\n def index():\n if flask.request.method == \"POST\":\n return flask.redirect(\"/getsession\")\n flask.session[\"data\"] = \"foo\"\n return \"index\"\n\n @app.route(\"/getsession\")\n def get_session():\n return flask.session.get(\"data\", \"\")\n\n with client:\n rv = client.get(\"/getsession\")\n assert rv.data == b\"\"\n\n rv = client.get(\"/\")\n assert rv.data == b\"index\"\n assert flask.session.get(\"data\") == \"foo\"\n\n rv = client.post(\"/\", data={}, follow_redirects=True)\n assert rv.data == b\"foo\"\n assert flask.session.get(\"data\") == \"foo\"\n\n rv = client.get(\"/getsession\")\n assert rv.data == b\"foo\""},{"col":0,"comment":"null","endLoc":58,"header":"def test_from_prefixed_env(monkeypatch)","id":311,"name":"test_from_prefixed_env","nodeType":"Function","startLoc":40,"text":"def test_from_prefixed_env(monkeypatch):\n monkeypatch.setenv(\"FLASK_STRING\", \"value\")\n monkeypatch.setenv(\"FLASK_BOOL\", \"true\")\n monkeypatch.setenv(\"FLASK_INT\", \"1\")\n monkeypatch.setenv(\"FLASK_FLOAT\", \"1.2\")\n monkeypatch.setenv(\"FLASK_LIST\", \"[1, 2]\")\n monkeypatch.setenv(\"FLASK_DICT\", '{\"k\": \"v\"}')\n monkeypatch.setenv(\"NOT_FLASK_OTHER\", \"other\")\n\n app = flask.Flask(__name__)\n app.config.from_prefixed_env()\n\n assert app.config[\"STRING\"] == \"value\"\n assert app.config[\"BOOL\"] is True\n assert app.config[\"INT\"] == 1\n assert app.config[\"FLOAT\"] == 1.2\n assert app.config[\"LIST\"] == [1, 2]\n assert app.config[\"DICT\"] == {\"k\": \"v\"}\n assert \"OTHER\" not in app.config"},{"col":0,"comment":"null","endLoc":68,"header":"def test_from_prefixed_env_custom_prefix(monkeypatch)","id":312,"name":"test_from_prefixed_env_custom_prefix","nodeType":"Function","startLoc":61,"text":"def test_from_prefixed_env_custom_prefix(monkeypatch):\n monkeypatch.setenv(\"FLASK_A\", \"a\")\n monkeypatch.setenv(\"NOT_FLASK_A\", \"b\")\n\n app = flask.Flask(__name__)\n app.config.from_prefixed_env(\"NOT_FLASK\")\n\n assert app.config[\"A\"] == \"b\""},{"col":0,"comment":"null","endLoc":99,"header":"def test_from_prefixed_env_nested(monkeypatch)","id":313,"name":"test_from_prefixed_env_nested","nodeType":"Function","startLoc":71,"text":"def test_from_prefixed_env_nested(monkeypatch):\n monkeypatch.setenv(\"FLASK_EXIST__ok\", \"other\")\n monkeypatch.setenv(\"FLASK_EXIST__inner__ik\", \"2\")\n monkeypatch.setenv(\"FLASK_EXIST__new__more\", '{\"k\": false}')\n monkeypatch.setenv(\"FLASK_NEW__K\", \"v\")\n\n app = flask.Flask(__name__)\n app.config[\"EXIST\"] = {\"ok\": \"value\", \"flag\": True, \"inner\": {\"ik\": 1}}\n app.config.from_prefixed_env()\n\n if os.name != \"nt\":\n assert app.config[\"EXIST\"] == {\n \"ok\": \"other\",\n \"flag\": True,\n \"inner\": {\"ik\": 2},\n \"new\": {\"more\": {\"k\": False}},\n }\n else:\n # Windows env var keys are always uppercase.\n assert app.config[\"EXIST\"] == {\n \"ok\": \"value\",\n \"OK\": \"other\",\n \"flag\": True,\n \"inner\": {\"ik\": 1},\n \"INNER\": {\"IK\": 2},\n \"NEW\": {\"MORE\": {\"k\": False}},\n }\n\n assert app.config[\"NEW\"] == {\"K\": \"v\"}"},{"col":0,"comment":"null","endLoc":121,"header":"def test_config_from_mapping()","id":314,"name":"test_config_from_mapping","nodeType":"Function","startLoc":102,"text":"def test_config_from_mapping():\n app = flask.Flask(__name__)\n app.config.from_mapping({\"SECRET_KEY\": \"config\", \"TEST_KEY\": \"foo\"})\n common_object_test(app)\n\n app = flask.Flask(__name__)\n app.config.from_mapping([(\"SECRET_KEY\", \"config\"), (\"TEST_KEY\", \"foo\")])\n common_object_test(app)\n\n app = flask.Flask(__name__)\n app.config.from_mapping(SECRET_KEY=\"config\", TEST_KEY=\"foo\")\n common_object_test(app)\n\n app = flask.Flask(__name__)\n app.config.from_mapping(SECRET_KEY=\"config\", TEST_KEY=\"foo\", skip_key=\"skip\")\n common_object_test(app)\n\n app = flask.Flask(__name__)\n with pytest.raises(TypeError):\n app.config.from_mapping({}, {})"},{"col":0,"comment":"Given a filename this will try to calculate the python path, add it\n to the search path and return the actual module name that is expected.\n ","endLoc":213,"header":"def prepare_import(path)","id":315,"name":"prepare_import","nodeType":"Function","startLoc":187,"text":"def prepare_import(path):\n \"\"\"Given a filename this will try to calculate the python path, add it\n to the search path and return the actual module name that is expected.\n \"\"\"\n path = os.path.realpath(path)\n\n fname, ext = os.path.splitext(path)\n if ext == \".py\":\n path = fname\n\n if os.path.basename(path) == \"__init__\":\n path = os.path.dirname(path)\n\n module_name = []\n\n # move up until outside package structure (no __init__.py)\n while True:\n path, name = os.path.split(path)\n module_name.append(name)\n\n if not os.path.exists(os.path.join(path, \"__init__.py\")):\n break\n\n if sys.path[0] != path:\n sys.path.insert(0, path)\n\n return \".\".join(module_name[::-1])"},{"col":0,"comment":"Get whether the user has disabled loading default dotenv files by\n setting :envvar:`FLASK_SKIP_DOTENV`. The default is ``True``, load\n the files.\n\n :param default: What to return if the env var isn't set.\n ","endLoc":48,"header":"def get_load_dotenv(default: bool = True) -> bool","id":317,"name":"get_load_dotenv","nodeType":"Function","startLoc":36,"text":"def get_load_dotenv(default: bool = True) -> bool:\n \"\"\"Get whether the user has disabled loading default dotenv files by\n setting :envvar:`FLASK_SKIP_DOTENV`. The default is ``True``, load\n the files.\n\n :param default: What to return if the env var isn't set.\n \"\"\"\n val = os.environ.get(\"FLASK_SKIP_DOTENV\")\n\n if not val:\n return default\n\n return val.lower() in (\"0\", \"false\", \"no\")"},{"className":"Flask","col":0,"comment":"The flask object implements a WSGI application and acts as the central\n object. It is passed the name of the module or package of the\n application. Once it is created it will act as a central registry for\n the view functions, the URL rules, template configuration and much more.\n\n The name of the package is used to resolve resources from inside the\n package or the folder the module is contained in depending on if the\n package parameter resolves to an actual python package (a folder with\n an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).\n\n For more information about resource loading, see :func:`open_resource`.\n\n Usually you create a :class:`Flask` instance in your main module or\n in the :file:`__init__.py` file of your package like this::\n\n from flask import Flask\n app = Flask(__name__)\n\n .. admonition:: About the First Parameter\n\n The idea of the first parameter is to give Flask an idea of what\n belongs to your application. This name is used to find resources\n on the filesystem, can be used by extensions to improve debugging\n information and a lot more.\n\n So it's important what you provide there. If you are using a single\n module, `__name__` is always the correct value. If you however are\n using a package, it's usually recommended to hardcode the name of\n your package there.\n\n For example if your application is defined in :file:`yourapplication/app.py`\n you should create it with one of the two versions below::\n\n app = Flask('yourapplication')\n app = Flask(__name__.split('.')[0])\n\n Why is that? The application will work even with `__name__`, thanks\n to how resources are looked up. However it will make debugging more\n painful. Certain extensions can make assumptions based on the\n import name of your application. For example the Flask-SQLAlchemy\n extension will look for the code in your application that triggered\n an SQL query in debug mode. If the import name is not properly set\n up, that debugging information is lost. (For example it would only\n pick up SQL queries in `yourapplication.app` and not\n `yourapplication.views.frontend`)\n\n .. versionadded:: 0.7\n The `static_url_path`, `static_folder`, and `template_folder`\n parameters were added.\n\n .. versionadded:: 0.8\n The `instance_path` and `instance_relative_config` parameters were\n added.\n\n .. versionadded:: 0.11\n The `root_path` parameter was added.\n\n .. versionadded:: 1.0\n The ``host_matching`` and ``static_host`` parameters were added.\n\n .. versionadded:: 1.0\n The ``subdomain_matching`` parameter was added. Subdomain\n matching needs to be enabled manually now. Setting\n :data:`SERVER_NAME` does not implicitly enable it.\n\n :param import_name: the name of the application package\n :param static_url_path: can be used to specify a different path for the\n static files on the web. Defaults to the name\n of the `static_folder` folder.\n :param static_folder: The folder with static files that is served at\n ``static_url_path``. Relative to the application ``root_path``\n or an absolute path. Defaults to ``'static'``.\n :param static_host: the host to use when adding the static route.\n Defaults to None. Required when using ``host_matching=True``\n with a ``static_folder`` configured.\n :param host_matching: set ``url_map.host_matching`` attribute.\n Defaults to False.\n :param subdomain_matching: consider the subdomain relative to\n :data:`SERVER_NAME` when matching routes. Defaults to False.\n :param template_folder: the folder that contains the templates that should\n be used by the application. Defaults to\n ``'templates'`` folder in the root path of the\n application.\n :param instance_path: An alternative instance path for the application.\n By default the folder ``'instance'`` next to the\n package or module is assumed to be the instance\n path.\n :param instance_relative_config: if set to ``True`` relative filenames\n for loading the config are assumed to\n be relative to the instance path instead\n of the application root.\n :param root_path: The path to the root of the application files.\n This should only be set manually when it can't be detected\n automatically, such as for namespace packages.\n ","endLoc":2227,"id":327,"nodeType":"Class","startLoc":105,"text":"class Flask(Scaffold):\n \"\"\"The flask object implements a WSGI application and acts as the central\n object. It is passed the name of the module or package of the\n application. Once it is created it will act as a central registry for\n the view functions, the URL rules, template configuration and much more.\n\n The name of the package is used to resolve resources from inside the\n package or the folder the module is contained in depending on if the\n package parameter resolves to an actual python package (a folder with\n an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).\n\n For more information about resource loading, see :func:`open_resource`.\n\n Usually you create a :class:`Flask` instance in your main module or\n in the :file:`__init__.py` file of your package like this::\n\n from flask import Flask\n app = Flask(__name__)\n\n .. admonition:: About the First Parameter\n\n The idea of the first parameter is to give Flask an idea of what\n belongs to your application. This name is used to find resources\n on the filesystem, can be used by extensions to improve debugging\n information and a lot more.\n\n So it's important what you provide there. If you are using a single\n module, `__name__` is always the correct value. If you however are\n using a package, it's usually recommended to hardcode the name of\n your package there.\n\n For example if your application is defined in :file:`yourapplication/app.py`\n you should create it with one of the two versions below::\n\n app = Flask('yourapplication')\n app = Flask(__name__.split('.')[0])\n\n Why is that? The application will work even with `__name__`, thanks\n to how resources are looked up. However it will make debugging more\n painful. Certain extensions can make assumptions based on the\n import name of your application. For example the Flask-SQLAlchemy\n extension will look for the code in your application that triggered\n an SQL query in debug mode. If the import name is not properly set\n up, that debugging information is lost. (For example it would only\n pick up SQL queries in `yourapplication.app` and not\n `yourapplication.views.frontend`)\n\n .. versionadded:: 0.7\n The `static_url_path`, `static_folder`, and `template_folder`\n parameters were added.\n\n .. versionadded:: 0.8\n The `instance_path` and `instance_relative_config` parameters were\n added.\n\n .. versionadded:: 0.11\n The `root_path` parameter was added.\n\n .. versionadded:: 1.0\n The ``host_matching`` and ``static_host`` parameters were added.\n\n .. versionadded:: 1.0\n The ``subdomain_matching`` parameter was added. Subdomain\n matching needs to be enabled manually now. Setting\n :data:`SERVER_NAME` does not implicitly enable it.\n\n :param import_name: the name of the application package\n :param static_url_path: can be used to specify a different path for the\n static files on the web. Defaults to the name\n of the `static_folder` folder.\n :param static_folder: The folder with static files that is served at\n ``static_url_path``. Relative to the application ``root_path``\n or an absolute path. Defaults to ``'static'``.\n :param static_host: the host to use when adding the static route.\n Defaults to None. Required when using ``host_matching=True``\n with a ``static_folder`` configured.\n :param host_matching: set ``url_map.host_matching`` attribute.\n Defaults to False.\n :param subdomain_matching: consider the subdomain relative to\n :data:`SERVER_NAME` when matching routes. Defaults to False.\n :param template_folder: the folder that contains the templates that should\n be used by the application. Defaults to\n ``'templates'`` folder in the root path of the\n application.\n :param instance_path: An alternative instance path for the application.\n By default the folder ``'instance'`` next to the\n package or module is assumed to be the instance\n path.\n :param instance_relative_config: if set to ``True`` relative filenames\n for loading the config are assumed to\n be relative to the instance path instead\n of the application root.\n :param root_path: The path to the root of the application files.\n This should only be set manually when it can't be detected\n automatically, such as for namespace packages.\n \"\"\"\n\n #: The class that is used for request objects. See :class:`~flask.Request`\n #: for more information.\n request_class = Request\n\n #: The class that is used for response objects. See\n #: :class:`~flask.Response` for more information.\n response_class = Response\n\n #: The class of the object assigned to :attr:`aborter`, created by\n #: :meth:`create_aborter`. That object is called by\n #: :func:`flask.abort` to raise HTTP errors, and can be\n #: called directly as well.\n #:\n #: Defaults to :class:`werkzeug.exceptions.Aborter`.\n #:\n #: .. versionadded:: 2.2\n aborter_class = Aborter\n\n #: The class that is used for the Jinja environment.\n #:\n #: .. versionadded:: 0.11\n jinja_environment = Environment\n\n #: The class that is used for the :data:`~flask.g` instance.\n #:\n #: Example use cases for a custom class:\n #:\n #: 1. Store arbitrary attributes on flask.g.\n #: 2. Add a property for lazy per-request database connectors.\n #: 3. Return None instead of AttributeError on unexpected attributes.\n #: 4. Raise exception if an unexpected attr is set, a \"controlled\" flask.g.\n #:\n #: In Flask 0.9 this property was called `request_globals_class` but it\n #: was changed in 0.10 to :attr:`app_ctx_globals_class` because the\n #: flask.g object is now application context scoped.\n #:\n #: .. versionadded:: 0.10\n app_ctx_globals_class = _AppCtxGlobals\n\n #: The class that is used for the ``config`` attribute of this app.\n #: Defaults to :class:`~flask.Config`.\n #:\n #: Example use cases for a custom class:\n #:\n #: 1. Default values for certain config options.\n #: 2. Access to config values through attributes in addition to keys.\n #:\n #: .. versionadded:: 0.11\n config_class = Config\n\n #: The testing flag. Set this to ``True`` to enable the test mode of\n #: Flask extensions (and in the future probably also Flask itself).\n #: For example this might activate test helpers that have an\n #: additional runtime cost which should not be enabled by default.\n #:\n #: If this is enabled and PROPAGATE_EXCEPTIONS is not changed from the\n #: default it's implicitly enabled.\n #:\n #: This attribute can also be configured from the config with the\n #: ``TESTING`` configuration key. Defaults to ``False``.\n testing = ConfigAttribute(\"TESTING\")\n\n #: If a secret key is set, cryptographic components can use this to\n #: sign cookies and other things. Set this to a complex random value\n #: when you want to use the secure cookie for instance.\n #:\n #: This attribute can also be configured from the config with the\n #: :data:`SECRET_KEY` configuration key. Defaults to ``None``.\n secret_key = ConfigAttribute(\"SECRET_KEY\")\n\n #: A :class:`~datetime.timedelta` which is used to set the expiration\n #: date of a permanent session. The default is 31 days which makes a\n #: permanent session survive for roughly one month.\n #:\n #: This attribute can also be configured from the config with the\n #: ``PERMANENT_SESSION_LIFETIME`` configuration key. Defaults to\n #: ``timedelta(days=31)``\n permanent_session_lifetime = ConfigAttribute(\n \"PERMANENT_SESSION_LIFETIME\", get_converter=_make_timedelta\n )\n\n json_provider_class: t.Type[JSONProvider] = DefaultJSONProvider\n \"\"\"A subclass of :class:`~flask.json.provider.JSONProvider`. An\n instance is created and assigned to :attr:`app.json` when creating\n the app.\n\n The default, :class:`~flask.json.provider.DefaultJSONProvider`, uses\n Python's built-in :mod:`json` library. A different provider can use\n a different JSON library.\n\n .. versionadded:: 2.2\n \"\"\"\n\n #: Options that are passed to the Jinja environment in\n #: :meth:`create_jinja_environment`. Changing these options after\n #: the environment is created (accessing :attr:`jinja_env`) will\n #: have no effect.\n #:\n #: .. versionchanged:: 1.1.0\n #: This is a ``dict`` instead of an ``ImmutableDict`` to allow\n #: easier configuration.\n #:\n jinja_options: dict = {}\n\n #: Default configuration parameters.\n default_config = ImmutableDict(\n {\n \"DEBUG\": None,\n \"TESTING\": False,\n \"PROPAGATE_EXCEPTIONS\": None,\n \"SECRET_KEY\": None,\n \"PERMANENT_SESSION_LIFETIME\": timedelta(days=31),\n \"USE_X_SENDFILE\": False,\n \"SERVER_NAME\": None,\n \"APPLICATION_ROOT\": \"/\",\n \"SESSION_COOKIE_NAME\": \"session\",\n \"SESSION_COOKIE_DOMAIN\": None,\n \"SESSION_COOKIE_PATH\": None,\n \"SESSION_COOKIE_HTTPONLY\": True,\n \"SESSION_COOKIE_SECURE\": False,\n \"SESSION_COOKIE_SAMESITE\": None,\n \"SESSION_REFRESH_EACH_REQUEST\": True,\n \"MAX_CONTENT_LENGTH\": None,\n \"SEND_FILE_MAX_AGE_DEFAULT\": None,\n \"TRAP_BAD_REQUEST_ERRORS\": None,\n \"TRAP_HTTP_EXCEPTIONS\": False,\n \"EXPLAIN_TEMPLATE_LOADING\": False,\n \"PREFERRED_URL_SCHEME\": \"http\",\n \"TEMPLATES_AUTO_RELOAD\": None,\n \"MAX_COOKIE_SIZE\": 4093,\n }\n )\n\n #: The rule object to use for URL rules created. This is used by\n #: :meth:`add_url_rule`. Defaults to :class:`werkzeug.routing.Rule`.\n #:\n #: .. versionadded:: 0.7\n url_rule_class = Rule\n\n #: The map object to use for storing the URL rules and routing\n #: configuration parameters. Defaults to :class:`werkzeug.routing.Map`.\n #:\n #: .. versionadded:: 1.1.0\n url_map_class = Map\n\n #: The :meth:`test_client` method creates an instance of this test\n #: client class. Defaults to :class:`~flask.testing.FlaskClient`.\n #:\n #: .. versionadded:: 0.7\n test_client_class: t.Optional[t.Type[\"FlaskClient\"]] = None\n\n #: The :class:`~click.testing.CliRunner` subclass, by default\n #: :class:`~flask.testing.FlaskCliRunner` that is used by\n #: :meth:`test_cli_runner`. Its ``__init__`` method should take a\n #: Flask app object as the first argument.\n #:\n #: .. versionadded:: 1.0\n test_cli_runner_class: t.Optional[t.Type[\"FlaskCliRunner\"]] = None\n\n #: the session interface to use. By default an instance of\n #: :class:`~flask.sessions.SecureCookieSessionInterface` is used here.\n #:\n #: .. versionadded:: 0.8\n session_interface: SessionInterface = SecureCookieSessionInterface()\n\n def __init__(\n self,\n import_name: str,\n static_url_path: t.Optional[str] = None,\n static_folder: t.Optional[t.Union[str, os.PathLike]] = \"static\",\n static_host: t.Optional[str] = None,\n host_matching: bool = False,\n subdomain_matching: bool = False,\n template_folder: t.Optional[t.Union[str, os.PathLike]] = \"templates\",\n instance_path: t.Optional[str] = None,\n instance_relative_config: bool = False,\n root_path: t.Optional[str] = None,\n ):\n super().__init__(\n import_name=import_name,\n static_folder=static_folder,\n static_url_path=static_url_path,\n template_folder=template_folder,\n root_path=root_path,\n )\n\n if instance_path is None:\n instance_path = self.auto_find_instance_path()\n elif not os.path.isabs(instance_path):\n raise ValueError(\n \"If an instance path is provided it must be absolute.\"\n \" A relative path was given instead.\"\n )\n\n #: Holds the path to the instance folder.\n #:\n #: .. versionadded:: 0.8\n self.instance_path = instance_path\n\n #: The configuration dictionary as :class:`Config`. This behaves\n #: exactly like a regular dictionary but supports additional methods\n #: to load a config from files.\n self.config = self.make_config(instance_relative_config)\n\n #: An instance of :attr:`aborter_class` created by\n #: :meth:`make_aborter`. This is called by :func:`flask.abort`\n #: to raise HTTP errors, and can be called directly as well.\n #:\n #: .. versionadded:: 2.2\n #: Moved from ``flask.abort``, which calls this object.\n self.aborter = self.make_aborter()\n\n self.json: JSONProvider = self.json_provider_class(self)\n \"\"\"Provides access to JSON methods. Functions in ``flask.json``\n will call methods on this provider when the application context\n is active. Used for handling JSON requests and responses.\n\n An instance of :attr:`json_provider_class`. Can be customized by\n changing that attribute on a subclass, or by assigning to this\n attribute afterwards.\n\n The default, :class:`~flask.json.provider.DefaultJSONProvider`,\n uses Python's built-in :mod:`json` library. A different provider\n can use a different JSON library.\n\n .. versionadded:: 2.2\n \"\"\"\n\n #: A list of functions that are called by\n #: :meth:`handle_url_build_error` when :meth:`.url_for` raises a\n #: :exc:`~werkzeug.routing.BuildError`. Each function is called\n #: with ``error``, ``endpoint`` and ``values``. If a function\n #: returns ``None`` or raises a ``BuildError``, it is skipped.\n #: Otherwise, its return value is returned by ``url_for``.\n #:\n #: .. versionadded:: 0.9\n self.url_build_error_handlers: t.List[\n t.Callable[[Exception, str, t.Dict[str, t.Any]], str]\n ] = []\n\n #: A list of functions that are called when the application context\n #: is destroyed. Since the application context is also torn down\n #: if the request ends this is the place to store code that disconnects\n #: from databases.\n #:\n #: .. versionadded:: 0.9\n self.teardown_appcontext_funcs: t.List[ft.TeardownCallable] = []\n\n #: A list of shell context processor functions that should be run\n #: when a shell context is created.\n #:\n #: .. versionadded:: 0.11\n self.shell_context_processors: t.List[ft.ShellContextProcessorCallable] = []\n\n #: Maps registered blueprint names to blueprint objects. The\n #: dict retains the order the blueprints were registered in.\n #: Blueprints can be registered multiple times, this dict does\n #: not track how often they were attached.\n #:\n #: .. versionadded:: 0.7\n self.blueprints: t.Dict[str, \"Blueprint\"] = {}\n\n #: a place where extensions can store application specific state. For\n #: example this is where an extension could store database engines and\n #: similar things.\n #:\n #: The key must match the name of the extension module. For example in\n #: case of a \"Flask-Foo\" extension in `flask_foo`, the key would be\n #: ``'foo'``.\n #:\n #: .. versionadded:: 0.7\n self.extensions: dict = {}\n\n #: The :class:`~werkzeug.routing.Map` for this instance. You can use\n #: this to change the routing converters after the class was created\n #: but before any routes are connected. Example::\n #:\n #: from werkzeug.routing import BaseConverter\n #:\n #: class ListConverter(BaseConverter):\n #: def to_python(self, value):\n #: return value.split(',')\n #: def to_url(self, values):\n #: return ','.join(super(ListConverter, self).to_url(value)\n #: for value in values)\n #:\n #: app = Flask(__name__)\n #: app.url_map.converters['list'] = ListConverter\n self.url_map = self.url_map_class()\n\n self.url_map.host_matching = host_matching\n self.subdomain_matching = subdomain_matching\n\n # tracks internally if the application already handled at least one\n # request.\n self._got_first_request = False\n\n # Add a static route using the provided static_url_path, static_host,\n # and static_folder if there is a configured static_folder.\n # Note we do this without checking if static_folder exists.\n # For one, it might be created while the server is running (e.g. during\n # development). Also, Google App Engine stores static files somewhere\n if self.has_static_folder:\n assert (\n bool(static_host) == host_matching\n ), \"Invalid static_host/host_matching combination\"\n # Use a weakref to avoid creating a reference cycle between the app\n # and the view function (see #3761).\n self_ref = weakref.ref(self)\n self.add_url_rule(\n f\"{self.static_url_path}/\",\n endpoint=\"static\",\n host=static_host,\n view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950\n )\n\n # Set the name of the Click group in case someone wants to add\n # the app's commands to another CLI tool.\n self.cli.name = self.name\n\n def _check_setup_finished(self, f_name: str) -> None:\n if self._got_first_request:\n raise AssertionError(\n f\"The setup method '{f_name}' can no longer be called\"\n \" on the application. It has already handled its first\"\n \" request, any changes will not be applied\"\n \" consistently.\\n\"\n \"Make sure all imports, decorators, functions, etc.\"\n \" needed to set up the application are done before\"\n \" running it.\"\n )\n\n @cached_property\n def name(self) -> str: # type: ignore\n \"\"\"The name of the application. This is usually the import name\n with the difference that it's guessed from the run file if the\n import name is main. This name is used as a display name when\n Flask needs the name of the application. It can be set and overridden\n to change the value.\n\n .. versionadded:: 0.8\n \"\"\"\n if self.import_name == \"__main__\":\n fn = getattr(sys.modules[\"__main__\"], \"__file__\", None)\n if fn is None:\n return \"__main__\"\n return os.path.splitext(os.path.basename(fn))[0]\n return self.import_name\n\n @cached_property\n def logger(self) -> logging.Logger:\n \"\"\"A standard Python :class:`~logging.Logger` for the app, with\n the same name as :attr:`name`.\n\n In debug mode, the logger's :attr:`~logging.Logger.level` will\n be set to :data:`~logging.DEBUG`.\n\n If there are no handlers configured, a default handler will be\n added. See :doc:`/logging` for more information.\n\n .. versionchanged:: 1.1.0\n The logger takes the same name as :attr:`name` rather than\n hard-coding ``\"flask.app\"``.\n\n .. versionchanged:: 1.0.0\n Behavior was simplified. The logger is always named\n ``\"flask.app\"``. The level is only set during configuration,\n it doesn't check ``app.debug`` each time. Only one format is\n used, not different ones depending on ``app.debug``. No\n handlers are removed, and a handler is only added if no\n handlers are already configured.\n\n .. versionadded:: 0.3\n \"\"\"\n return create_logger(self)\n\n @cached_property\n def jinja_env(self) -> Environment:\n \"\"\"The Jinja environment used to load templates.\n\n The environment is created the first time this property is\n accessed. Changing :attr:`jinja_options` after that will have no\n effect.\n \"\"\"\n return self.create_jinja_environment()\n\n @property\n def got_first_request(self) -> bool:\n \"\"\"This attribute is set to ``True`` if the application started\n handling the first request.\n\n .. deprecated:: 2.3\n Will be removed in Flask 2.4.\n\n .. versionadded:: 0.8\n \"\"\"\n import warnings\n\n warnings.warn(\n \"'got_first_request' is deprecated and will be removed in Flask 2.4.\",\n DeprecationWarning,\n stacklevel=2,\n )\n return self._got_first_request\n\n def make_config(self, instance_relative: bool = False) -> Config:\n \"\"\"Used to create the config attribute by the Flask constructor.\n The `instance_relative` parameter is passed in from the constructor\n of Flask (there named `instance_relative_config`) and indicates if\n the config should be relative to the instance path or the root path\n of the application.\n\n .. versionadded:: 0.8\n \"\"\"\n root_path = self.root_path\n if instance_relative:\n root_path = self.instance_path\n defaults = dict(self.default_config)\n defaults[\"DEBUG\"] = get_debug_flag()\n return self.config_class(root_path, defaults)\n\n def make_aborter(self) -> Aborter:\n \"\"\"Create the object to assign to :attr:`aborter`. That object\n is called by :func:`flask.abort` to raise HTTP errors, and can\n be called directly as well.\n\n By default, this creates an instance of :attr:`aborter_class`,\n which defaults to :class:`werkzeug.exceptions.Aborter`.\n\n .. versionadded:: 2.2\n \"\"\"\n return self.aborter_class()\n\n def auto_find_instance_path(self) -> str:\n \"\"\"Tries to locate the instance path if it was not provided to the\n constructor of the application class. It will basically calculate\n the path to a folder named ``instance`` next to your main file or\n the package.\n\n .. versionadded:: 0.8\n \"\"\"\n prefix, package_path = find_package(self.import_name)\n if prefix is None:\n return os.path.join(package_path, \"instance\")\n return os.path.join(prefix, \"var\", f\"{self.name}-instance\")\n\n def open_instance_resource(self, resource: str, mode: str = \"rb\") -> t.IO[t.AnyStr]:\n \"\"\"Opens a resource from the application's instance folder\n (:attr:`instance_path`). Otherwise works like\n :meth:`open_resource`. Instance resources can also be opened for\n writing.\n\n :param resource: the name of the resource. To access resources within\n subfolders use forward slashes as separator.\n :param mode: resource file opening mode, default is 'rb'.\n \"\"\"\n return open(os.path.join(self.instance_path, resource), mode)\n\n def create_jinja_environment(self) -> Environment:\n \"\"\"Create the Jinja environment based on :attr:`jinja_options`\n and the various Jinja-related methods of the app. Changing\n :attr:`jinja_options` after this will have no effect. Also adds\n Flask-related globals and filters to the environment.\n\n .. versionchanged:: 0.11\n ``Environment.auto_reload`` set in accordance with\n ``TEMPLATES_AUTO_RELOAD`` configuration option.\n\n .. versionadded:: 0.5\n \"\"\"\n options = dict(self.jinja_options)\n\n if \"autoescape\" not in options:\n options[\"autoescape\"] = self.select_jinja_autoescape\n\n if \"auto_reload\" not in options:\n auto_reload = self.config[\"TEMPLATES_AUTO_RELOAD\"]\n\n if auto_reload is None:\n auto_reload = self.debug\n\n options[\"auto_reload\"] = auto_reload\n\n rv = self.jinja_environment(self, **options)\n rv.globals.update(\n url_for=self.url_for,\n get_flashed_messages=get_flashed_messages,\n config=self.config,\n # request, session and g are normally added with the\n # context processor for efficiency reasons but for imported\n # templates we also want the proxies in there.\n request=request,\n session=session,\n g=g,\n )\n rv.policies[\"json.dumps_function\"] = self.json.dumps\n return rv\n\n def create_global_jinja_loader(self) -> DispatchingJinjaLoader:\n \"\"\"Creates the loader for the Jinja2 environment. Can be used to\n override just the loader and keeping the rest unchanged. It's\n discouraged to override this function. Instead one should override\n the :meth:`jinja_loader` function instead.\n\n The global loader dispatches between the loaders of the application\n and the individual blueprints.\n\n .. versionadded:: 0.7\n \"\"\"\n return DispatchingJinjaLoader(self)\n\n def select_jinja_autoescape(self, filename: str) -> bool:\n \"\"\"Returns ``True`` if autoescaping should be active for the given\n template name. If no template name is given, returns `True`.\n\n .. versionchanged:: 2.2\n Autoescaping is now enabled by default for ``.svg`` files.\n\n .. versionadded:: 0.5\n \"\"\"\n if filename is None:\n return True\n return filename.endswith((\".html\", \".htm\", \".xml\", \".xhtml\", \".svg\"))\n\n def update_template_context(self, context: dict) -> None:\n \"\"\"Update the template context with some commonly used variables.\n This injects request, session, config and g into the template\n context as well as everything template context processors want\n to inject. Note that the as of Flask 0.6, the original values\n in the context will not be overridden if a context processor\n decides to return a value with the same key.\n\n :param context: the context as a dictionary that is updated in place\n to add extra variables.\n \"\"\"\n names: t.Iterable[t.Optional[str]] = (None,)\n\n # A template may be rendered outside a request context.\n if request:\n names = chain(names, reversed(request.blueprints))\n\n # The values passed to render_template take precedence. Keep a\n # copy to re-apply after all context functions.\n orig_ctx = context.copy()\n\n for name in names:\n if name in self.template_context_processors:\n for func in self.template_context_processors[name]:\n context.update(func())\n\n context.update(orig_ctx)\n\n def make_shell_context(self) -> dict:\n \"\"\"Returns the shell context for an interactive shell for this\n application. This runs all the registered shell context\n processors.\n\n .. versionadded:: 0.11\n \"\"\"\n rv = {\"app\": self, \"g\": g}\n for processor in self.shell_context_processors:\n rv.update(processor())\n return rv\n\n @property\n def debug(self) -> bool:\n \"\"\"Whether debug mode is enabled. When using ``flask run`` to start the\n development server, an interactive debugger will be shown for unhandled\n exceptions, and the server will be reloaded when code changes. This maps to the\n :data:`DEBUG` config key. It may not behave as expected if set late.\n\n **Do not enable debug mode when deploying in production.**\n\n Default: ``False``\n \"\"\"\n return self.config[\"DEBUG\"]\n\n @debug.setter\n def debug(self, value: bool) -> None:\n self.config[\"DEBUG\"] = value\n\n if self.config[\"TEMPLATES_AUTO_RELOAD\"] is None:\n self.jinja_env.auto_reload = value\n\n def run(\n self,\n host: t.Optional[str] = None,\n port: t.Optional[int] = None,\n debug: t.Optional[bool] = None,\n load_dotenv: bool = True,\n **options: t.Any,\n ) -> None:\n \"\"\"Runs the application on a local development server.\n\n Do not use ``run()`` in a production setting. It is not intended to\n meet security and performance requirements for a production server.\n Instead, see :doc:`/deploying/index` for WSGI server recommendations.\n\n If the :attr:`debug` flag is set the server will automatically reload\n for code changes and show a debugger in case an exception happened.\n\n If you want to run the application in debug mode, but disable the\n code execution on the interactive debugger, you can pass\n ``use_evalex=False`` as parameter. This will keep the debugger's\n traceback screen active, but disable code execution.\n\n It is not recommended to use this function for development with\n automatic reloading as this is badly supported. Instead you should\n be using the :command:`flask` command line script's ``run`` support.\n\n .. admonition:: Keep in Mind\n\n Flask will suppress any server error with a generic error page\n unless it is in debug mode. As such to enable just the\n interactive debugger without the code reloading, you have to\n invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``.\n Setting ``use_debugger`` to ``True`` without being in debug mode\n won't catch any exceptions because there won't be any to\n catch.\n\n :param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to\n have the server available externally as well. Defaults to\n ``'127.0.0.1'`` or the host in the ``SERVER_NAME`` config variable\n if present.\n :param port: the port of the webserver. Defaults to ``5000`` or the\n port defined in the ``SERVER_NAME`` config variable if present.\n :param debug: if given, enable or disable debug mode. See\n :attr:`debug`.\n :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`\n files to set environment variables. Will also change the working\n directory to the directory containing the first file found.\n :param options: the options to be forwarded to the underlying Werkzeug\n server. See :func:`werkzeug.serving.run_simple` for more\n information.\n\n .. versionchanged:: 1.0\n If installed, python-dotenv will be used to load environment\n variables from :file:`.env` and :file:`.flaskenv` files.\n\n The :envvar:`FLASK_DEBUG` environment variable will override :attr:`debug`.\n\n Threaded mode is enabled by default.\n\n .. versionchanged:: 0.10\n The default port is now picked from the ``SERVER_NAME``\n variable.\n \"\"\"\n # Ignore this call so that it doesn't start another server if\n # the 'flask run' command is used.\n if os.environ.get(\"FLASK_RUN_FROM_CLI\") == \"true\":\n if not is_running_from_reloader():\n click.secho(\n \" * Ignoring a call to 'app.run()' that would block\"\n \" the current 'flask' CLI command.\\n\"\n \" Only call 'app.run()' in an 'if __name__ ==\"\n ' \"__main__\"\\' guard.',\n fg=\"red\",\n )\n\n return\n\n if get_load_dotenv(load_dotenv):\n cli.load_dotenv()\n\n # if set, env var overrides existing value\n if \"FLASK_DEBUG\" in os.environ:\n self.debug = get_debug_flag()\n\n # debug passed to method overrides all other sources\n if debug is not None:\n self.debug = bool(debug)\n\n server_name = self.config.get(\"SERVER_NAME\")\n sn_host = sn_port = None\n\n if server_name:\n sn_host, _, sn_port = server_name.partition(\":\")\n\n if not host:\n if sn_host:\n host = sn_host\n else:\n host = \"127.0.0.1\"\n\n if port or port == 0:\n port = int(port)\n elif sn_port:\n port = int(sn_port)\n else:\n port = 5000\n\n options.setdefault(\"use_reloader\", self.debug)\n options.setdefault(\"use_debugger\", self.debug)\n options.setdefault(\"threaded\", True)\n\n cli.show_server_banner(self.debug, self.name)\n\n from werkzeug.serving import run_simple\n\n try:\n run_simple(t.cast(str, host), port, self, **options)\n finally:\n # reset the first request information if the development server\n # reset normally. This makes it possible to restart the server\n # without reloader and that stuff from an interactive shell.\n self._got_first_request = False\n\n def test_client(self, use_cookies: bool = True, **kwargs: t.Any) -> \"FlaskClient\":\n \"\"\"Creates a test client for this application. For information\n about unit testing head over to :doc:`/testing`.\n\n Note that if you are testing for assertions or exceptions in your\n application code, you must set ``app.testing = True`` in order for the\n exceptions to propagate to the test client. Otherwise, the exception\n will be handled by the application (not visible to the test client) and\n the only indication of an AssertionError or other exception will be a\n 500 status code response to the test client. See the :attr:`testing`\n attribute. For example::\n\n app.testing = True\n client = app.test_client()\n\n The test client can be used in a ``with`` block to defer the closing down\n of the context until the end of the ``with`` block. This is useful if\n you want to access the context locals for testing::\n\n with app.test_client() as c:\n rv = c.get('/?vodka=42')\n assert request.args['vodka'] == '42'\n\n Additionally, you may pass optional keyword arguments that will then\n be passed to the application's :attr:`test_client_class` constructor.\n For example::\n\n from flask.testing import FlaskClient\n\n class CustomClient(FlaskClient):\n def __init__(self, *args, **kwargs):\n self._authentication = kwargs.pop(\"authentication\")\n super(CustomClient,self).__init__( *args, **kwargs)\n\n app.test_client_class = CustomClient\n client = app.test_client(authentication='Basic ....')\n\n See :class:`~flask.testing.FlaskClient` for more information.\n\n .. versionchanged:: 0.4\n added support for ``with`` block usage for the client.\n\n .. versionadded:: 0.7\n The `use_cookies` parameter was added as well as the ability\n to override the client to be used by setting the\n :attr:`test_client_class` attribute.\n\n .. versionchanged:: 0.11\n Added `**kwargs` to support passing additional keyword arguments to\n the constructor of :attr:`test_client_class`.\n \"\"\"\n cls = self.test_client_class\n if cls is None:\n from .testing import FlaskClient as cls\n return cls( # type: ignore\n self, self.response_class, use_cookies=use_cookies, **kwargs\n )\n\n def test_cli_runner(self, **kwargs: t.Any) -> \"FlaskCliRunner\":\n \"\"\"Create a CLI runner for testing CLI commands.\n See :ref:`testing-cli`.\n\n Returns an instance of :attr:`test_cli_runner_class`, by default\n :class:`~flask.testing.FlaskCliRunner`. The Flask app object is\n passed as the first argument.\n\n .. versionadded:: 1.0\n \"\"\"\n cls = self.test_cli_runner_class\n\n if cls is None:\n from .testing import FlaskCliRunner as cls\n\n return cls(self, **kwargs) # type: ignore\n\n @setupmethod\n def register_blueprint(self, blueprint: \"Blueprint\", **options: t.Any) -> None:\n \"\"\"Register a :class:`~flask.Blueprint` on the application. Keyword\n arguments passed to this method will override the defaults set on the\n blueprint.\n\n Calls the blueprint's :meth:`~flask.Blueprint.register` method after\n recording the blueprint in the application's :attr:`blueprints`.\n\n :param blueprint: The blueprint to register.\n :param url_prefix: Blueprint routes will be prefixed with this.\n :param subdomain: Blueprint routes will match on this subdomain.\n :param url_defaults: Blueprint routes will use these default values for\n view arguments.\n :param options: Additional keyword arguments are passed to\n :class:`~flask.blueprints.BlueprintSetupState`. They can be\n accessed in :meth:`~flask.Blueprint.record` callbacks.\n\n .. versionchanged:: 2.0.1\n The ``name`` option can be used to change the (pre-dotted)\n name the blueprint is registered with. This allows the same\n blueprint to be registered multiple times with unique names\n for ``url_for``.\n\n .. versionadded:: 0.7\n \"\"\"\n blueprint.register(self, options)\n\n def iter_blueprints(self) -> t.ValuesView[\"Blueprint\"]:\n \"\"\"Iterates over all blueprints by the order they were registered.\n\n .. versionadded:: 0.11\n \"\"\"\n return self.blueprints.values()\n\n @setupmethod\n def add_url_rule(\n self,\n rule: str,\n endpoint: t.Optional[str] = None,\n view_func: t.Optional[ft.RouteCallable] = None,\n provide_automatic_options: t.Optional[bool] = None,\n **options: t.Any,\n ) -> None:\n if endpoint is None:\n endpoint = _endpoint_from_view_func(view_func) # type: ignore\n options[\"endpoint\"] = endpoint\n methods = options.pop(\"methods\", None)\n\n # if the methods are not given and the view_func object knows its\n # methods we can use that instead. If neither exists, we go with\n # a tuple of only ``GET`` as default.\n if methods is None:\n methods = getattr(view_func, \"methods\", None) or (\"GET\",)\n if isinstance(methods, str):\n raise TypeError(\n \"Allowed methods must be a list of strings, for\"\n ' example: @app.route(..., methods=[\"POST\"])'\n )\n methods = {item.upper() for item in methods}\n\n # Methods that should always be added\n required_methods = set(getattr(view_func, \"required_methods\", ()))\n\n # starting with Flask 0.8 the view_func object can disable and\n # force-enable the automatic options handling.\n if provide_automatic_options is None:\n provide_automatic_options = getattr(\n view_func, \"provide_automatic_options\", None\n )\n\n if provide_automatic_options is None:\n if \"OPTIONS\" not in methods:\n provide_automatic_options = True\n required_methods.add(\"OPTIONS\")\n else:\n provide_automatic_options = False\n\n # Add the required methods now.\n methods |= required_methods\n\n rule = self.url_rule_class(rule, methods=methods, **options)\n rule.provide_automatic_options = provide_automatic_options # type: ignore\n\n self.url_map.add(rule)\n if view_func is not None:\n old_func = self.view_functions.get(endpoint)\n if old_func is not None and old_func != view_func:\n raise AssertionError(\n \"View function mapping is overwriting an existing\"\n f\" endpoint function: {endpoint}\"\n )\n self.view_functions[endpoint] = view_func\n\n @setupmethod\n def template_filter(\n self, name: t.Optional[str] = None\n ) -> t.Callable[[T_template_filter], T_template_filter]:\n \"\"\"A decorator that is used to register custom template filter.\n You can specify a name for the filter, otherwise the function\n name will be used. Example::\n\n @app.template_filter()\n def reverse(s):\n return s[::-1]\n\n :param name: the optional name of the filter, otherwise the\n function name will be used.\n \"\"\"\n\n def decorator(f: T_template_filter) -> T_template_filter:\n self.add_template_filter(f, name=name)\n return f\n\n return decorator\n\n @setupmethod\n def add_template_filter(\n self, f: ft.TemplateFilterCallable, name: t.Optional[str] = None\n ) -> None:\n \"\"\"Register a custom template filter. Works exactly like the\n :meth:`template_filter` decorator.\n\n :param name: the optional name of the filter, otherwise the\n function name will be used.\n \"\"\"\n self.jinja_env.filters[name or f.__name__] = f\n\n @setupmethod\n def template_test(\n self, name: t.Optional[str] = None\n ) -> t.Callable[[T_template_test], T_template_test]:\n \"\"\"A decorator that is used to register custom template test.\n You can specify a name for the test, otherwise the function\n name will be used. Example::\n\n @app.template_test()\n def is_prime(n):\n if n == 2:\n return True\n for i in range(2, int(math.ceil(math.sqrt(n))) + 1):\n if n % i == 0:\n return False\n return True\n\n .. versionadded:: 0.10\n\n :param name: the optional name of the test, otherwise the\n function name will be used.\n \"\"\"\n\n def decorator(f: T_template_test) -> T_template_test:\n self.add_template_test(f, name=name)\n return f\n\n return decorator\n\n @setupmethod\n def add_template_test(\n self, f: ft.TemplateTestCallable, name: t.Optional[str] = None\n ) -> None:\n \"\"\"Register a custom template test. Works exactly like the\n :meth:`template_test` decorator.\n\n .. versionadded:: 0.10\n\n :param name: the optional name of the test, otherwise the\n function name will be used.\n \"\"\"\n self.jinja_env.tests[name or f.__name__] = f\n\n @setupmethod\n def template_global(\n self, name: t.Optional[str] = None\n ) -> t.Callable[[T_template_global], T_template_global]:\n \"\"\"A decorator that is used to register a custom template global function.\n You can specify a name for the global function, otherwise the function\n name will be used. Example::\n\n @app.template_global()\n def double(n):\n return 2 * n\n\n .. versionadded:: 0.10\n\n :param name: the optional name of the global function, otherwise the\n function name will be used.\n \"\"\"\n\n def decorator(f: T_template_global) -> T_template_global:\n self.add_template_global(f, name=name)\n return f\n\n return decorator\n\n @setupmethod\n def add_template_global(\n self, f: ft.TemplateGlobalCallable, name: t.Optional[str] = None\n ) -> None:\n \"\"\"Register a custom template global function. Works exactly like the\n :meth:`template_global` decorator.\n\n .. versionadded:: 0.10\n\n :param name: the optional name of the global function, otherwise the\n function name will be used.\n \"\"\"\n self.jinja_env.globals[name or f.__name__] = f\n\n @setupmethod\n def teardown_appcontext(self, f: T_teardown) -> T_teardown:\n \"\"\"Registers a function to be called when the application\n context is popped. The application context is typically popped\n after the request context for each request, at the end of CLI\n commands, or after a manually pushed context ends.\n\n .. code-block:: python\n\n with app.app_context():\n ...\n\n When the ``with`` block exits (or ``ctx.pop()`` is called), the\n teardown functions are called just before the app context is\n made inactive. Since a request context typically also manages an\n application context it would also be called when you pop a\n request context.\n\n When a teardown function was called because of an unhandled\n exception it will be passed an error object. If an\n :meth:`errorhandler` is registered, it will handle the exception\n and the teardown will not receive it.\n\n Teardown functions must avoid raising exceptions. If they\n execute code that might fail they must surround that code with a\n ``try``/``except`` block and log any errors.\n\n The return values of teardown functions are ignored.\n\n .. versionadded:: 0.9\n \"\"\"\n self.teardown_appcontext_funcs.append(f)\n return f\n\n @setupmethod\n def shell_context_processor(\n self, f: T_shell_context_processor\n ) -> T_shell_context_processor:\n \"\"\"Registers a shell context processor function.\n\n .. versionadded:: 0.11\n \"\"\"\n self.shell_context_processors.append(f)\n return f\n\n def _find_error_handler(self, e: Exception) -> t.Optional[ft.ErrorHandlerCallable]:\n \"\"\"Return a registered error handler for an exception in this order:\n blueprint handler for a specific code, app handler for a specific code,\n blueprint handler for an exception class, app handler for an exception\n class, or ``None`` if a suitable handler is not found.\n \"\"\"\n exc_class, code = self._get_exc_class_and_code(type(e))\n names = (*request.blueprints, None)\n\n for c in (code, None) if code is not None else (None,):\n for name in names:\n handler_map = self.error_handler_spec[name][c]\n\n if not handler_map:\n continue\n\n for cls in exc_class.__mro__:\n handler = handler_map.get(cls)\n\n if handler is not None:\n return handler\n return None\n\n def handle_http_exception(\n self, e: HTTPException\n ) -> t.Union[HTTPException, ft.ResponseReturnValue]:\n \"\"\"Handles an HTTP exception. By default this will invoke the\n registered error handlers and fall back to returning the\n exception as response.\n\n .. versionchanged:: 1.0.3\n ``RoutingException``, used internally for actions such as\n slash redirects during routing, is not passed to error\n handlers.\n\n .. versionchanged:: 1.0\n Exceptions are looked up by code *and* by MRO, so\n ``HTTPException`` subclasses can be handled with a catch-all\n handler for the base ``HTTPException``.\n\n .. versionadded:: 0.3\n \"\"\"\n # Proxy exceptions don't have error codes. We want to always return\n # those unchanged as errors\n if e.code is None:\n return e\n\n # RoutingExceptions are used internally to trigger routing\n # actions, such as slash redirects raising RequestRedirect. They\n # are not raised or handled in user code.\n if isinstance(e, RoutingException):\n return e\n\n handler = self._find_error_handler(e)\n if handler is None:\n return e\n return self.ensure_sync(handler)(e)\n\n def trap_http_exception(self, e: Exception) -> bool:\n \"\"\"Checks if an HTTP exception should be trapped or not. By default\n this will return ``False`` for all exceptions except for a bad request\n key error if ``TRAP_BAD_REQUEST_ERRORS`` is set to ``True``. It\n also returns ``True`` if ``TRAP_HTTP_EXCEPTIONS`` is set to ``True``.\n\n This is called for all HTTP exceptions raised by a view function.\n If it returns ``True`` for any exception the error handler for this\n exception is not called and it shows up as regular exception in the\n traceback. This is helpful for debugging implicitly raised HTTP\n exceptions.\n\n .. versionchanged:: 1.0\n Bad request errors are not trapped by default in debug mode.\n\n .. versionadded:: 0.8\n \"\"\"\n if self.config[\"TRAP_HTTP_EXCEPTIONS\"]:\n return True\n\n trap_bad_request = self.config[\"TRAP_BAD_REQUEST_ERRORS\"]\n\n # if unset, trap key errors in debug mode\n if (\n trap_bad_request is None\n and self.debug\n and isinstance(e, BadRequestKeyError)\n ):\n return True\n\n if trap_bad_request:\n return isinstance(e, BadRequest)\n\n return False\n\n def handle_user_exception(\n self, e: Exception\n ) -> t.Union[HTTPException, ft.ResponseReturnValue]:\n \"\"\"This method is called whenever an exception occurs that\n should be handled. A special case is :class:`~werkzeug\n .exceptions.HTTPException` which is forwarded to the\n :meth:`handle_http_exception` method. This function will either\n return a response value or reraise the exception with the same\n traceback.\n\n .. versionchanged:: 1.0\n Key errors raised from request data like ``form`` show the\n bad key in debug mode rather than a generic bad request\n message.\n\n .. versionadded:: 0.7\n \"\"\"\n if isinstance(e, BadRequestKeyError) and (\n self.debug or self.config[\"TRAP_BAD_REQUEST_ERRORS\"]\n ):\n e.show_exception = True\n\n if isinstance(e, HTTPException) and not self.trap_http_exception(e):\n return self.handle_http_exception(e)\n\n handler = self._find_error_handler(e)\n\n if handler is None:\n raise\n\n return self.ensure_sync(handler)(e)\n\n def handle_exception(self, e: Exception) -> Response:\n \"\"\"Handle an exception that did not have an error handler\n associated with it, or that was raised from an error handler.\n This always causes a 500 ``InternalServerError``.\n\n Always sends the :data:`got_request_exception` signal.\n\n If :data:`PROPAGATE_EXCEPTIONS` is ``True``, such as in debug\n mode, the error will be re-raised so that the debugger can\n display it. Otherwise, the original exception is logged, and\n an :exc:`~werkzeug.exceptions.InternalServerError` is returned.\n\n If an error handler is registered for ``InternalServerError`` or\n ``500``, it will be used. For consistency, the handler will\n always receive the ``InternalServerError``. The original\n unhandled exception is available as ``e.original_exception``.\n\n .. versionchanged:: 1.1.0\n Always passes the ``InternalServerError`` instance to the\n handler, setting ``original_exception`` to the unhandled\n error.\n\n .. versionchanged:: 1.1.0\n ``after_request`` functions and other finalization is done\n even for the default 500 response when there is no handler.\n\n .. versionadded:: 0.3\n \"\"\"\n exc_info = sys.exc_info()\n got_request_exception.send(self, exception=e)\n propagate = self.config[\"PROPAGATE_EXCEPTIONS\"]\n\n if propagate is None:\n propagate = self.testing or self.debug\n\n if propagate:\n # Re-raise if called with an active exception, otherwise\n # raise the passed in exception.\n if exc_info[1] is e:\n raise\n\n raise e\n\n self.log_exception(exc_info)\n server_error: t.Union[InternalServerError, ft.ResponseReturnValue]\n server_error = InternalServerError(original_exception=e)\n handler = self._find_error_handler(server_error)\n\n if handler is not None:\n server_error = self.ensure_sync(handler)(server_error)\n\n return self.finalize_request(server_error, from_error_handler=True)\n\n def log_exception(\n self,\n exc_info: t.Union[\n t.Tuple[type, BaseException, TracebackType], t.Tuple[None, None, None]\n ],\n ) -> None:\n \"\"\"Logs an exception. This is called by :meth:`handle_exception`\n if debugging is disabled and right before the handler is called.\n The default implementation logs the exception as error on the\n :attr:`logger`.\n\n .. versionadded:: 0.8\n \"\"\"\n self.logger.error(\n f\"Exception on {request.path} [{request.method}]\", exc_info=exc_info\n )\n\n def raise_routing_exception(self, request: Request) -> \"te.NoReturn\":\n \"\"\"Intercept routing exceptions and possibly do something else.\n\n In debug mode, intercept a routing redirect and replace it with\n an error if the body will be discarded.\n\n With modern Werkzeug this shouldn't occur, since it now uses a\n 308 status which tells the browser to resend the method and\n body.\n\n .. versionchanged:: 2.1\n Don't intercept 307 and 308 redirects.\n\n :meta private:\n :internal:\n \"\"\"\n if (\n not self.debug\n or not isinstance(request.routing_exception, RequestRedirect)\n or request.routing_exception.code in {307, 308}\n or request.method in {\"GET\", \"HEAD\", \"OPTIONS\"}\n ):\n raise request.routing_exception # type: ignore\n\n from .debughelpers import FormDataRoutingRedirect\n\n raise FormDataRoutingRedirect(request)\n\n def dispatch_request(self) -> ft.ResponseReturnValue:\n \"\"\"Does the request dispatching. Matches the URL and returns the\n return value of the view or error handler. This does not have to\n be a response object. In order to convert the return value to a\n proper response object, call :func:`make_response`.\n\n .. versionchanged:: 0.7\n This no longer does the exception handling, this code was\n moved to the new :meth:`full_dispatch_request`.\n \"\"\"\n req = request_ctx.request\n if req.routing_exception is not None:\n self.raise_routing_exception(req)\n rule: Rule = req.url_rule # type: ignore[assignment]\n # if we provide automatic options for this URL and the\n # request came with the OPTIONS method, reply automatically\n if (\n getattr(rule, \"provide_automatic_options\", False)\n and req.method == \"OPTIONS\"\n ):\n return self.make_default_options_response()\n # otherwise dispatch to the handler for that endpoint\n view_args: t.Dict[str, t.Any] = req.view_args # type: ignore[assignment]\n return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)\n\n def full_dispatch_request(self) -> Response:\n \"\"\"Dispatches the request and on top of that performs request\n pre and postprocessing as well as HTTP exception catching and\n error handling.\n\n .. versionadded:: 0.7\n \"\"\"\n self._got_first_request = True\n\n try:\n request_started.send(self)\n rv = self.preprocess_request()\n if rv is None:\n rv = self.dispatch_request()\n except Exception as e:\n rv = self.handle_user_exception(e)\n return self.finalize_request(rv)\n\n def finalize_request(\n self,\n rv: t.Union[ft.ResponseReturnValue, HTTPException],\n from_error_handler: bool = False,\n ) -> Response:\n \"\"\"Given the return value from a view function this finalizes\n the request by converting it into a response and invoking the\n postprocessing functions. This is invoked for both normal\n request dispatching as well as error handlers.\n\n Because this means that it might be called as a result of a\n failure a special safe mode is available which can be enabled\n with the `from_error_handler` flag. If enabled, failures in\n response processing will be logged and otherwise ignored.\n\n :internal:\n \"\"\"\n response = self.make_response(rv)\n try:\n response = self.process_response(response)\n request_finished.send(self, response=response)\n except Exception:\n if not from_error_handler:\n raise\n self.logger.exception(\n \"Request finalizing failed with an error while handling an error\"\n )\n return response\n\n def make_default_options_response(self) -> Response:\n \"\"\"This method is called to create the default ``OPTIONS`` response.\n This can be changed through subclassing to change the default\n behavior of ``OPTIONS`` responses.\n\n .. versionadded:: 0.7\n \"\"\"\n adapter = request_ctx.url_adapter\n methods = adapter.allowed_methods() # type: ignore[union-attr]\n rv = self.response_class()\n rv.allow.update(methods)\n return rv\n\n def should_ignore_error(self, error: t.Optional[BaseException]) -> bool:\n \"\"\"This is called to figure out if an error should be ignored\n or not as far as the teardown system is concerned. If this\n function returns ``True`` then the teardown handlers will not be\n passed the error.\n\n .. versionadded:: 0.10\n \"\"\"\n return False\n\n def ensure_sync(self, func: t.Callable) -> t.Callable:\n \"\"\"Ensure that the function is synchronous for WSGI workers.\n Plain ``def`` functions are returned as-is. ``async def``\n functions are wrapped to run and wait for the response.\n\n Override this method to change how the app runs async views.\n\n .. versionadded:: 2.0\n \"\"\"\n if iscoroutinefunction(func):\n return self.async_to_sync(func)\n\n return func\n\n def async_to_sync(\n self, func: t.Callable[..., t.Coroutine]\n ) -> t.Callable[..., t.Any]:\n \"\"\"Return a sync function that will run the coroutine function.\n\n .. code-block:: python\n\n result = app.async_to_sync(func)(*args, **kwargs)\n\n Override this method to change how the app converts async code\n to be synchronously callable.\n\n .. versionadded:: 2.0\n \"\"\"\n try:\n from asgiref.sync import async_to_sync as asgiref_async_to_sync\n except ImportError:\n raise RuntimeError(\n \"Install Flask with the 'async' extra in order to use async views.\"\n ) from None\n\n return asgiref_async_to_sync(func)\n\n def url_for(\n self,\n endpoint: str,\n *,\n _anchor: t.Optional[str] = None,\n _method: t.Optional[str] = None,\n _scheme: t.Optional[str] = None,\n _external: t.Optional[bool] = None,\n **values: t.Any,\n ) -> str:\n \"\"\"Generate a URL to the given endpoint with the given values.\n\n This is called by :func:`flask.url_for`, and can be called\n directly as well.\n\n An *endpoint* is the name of a URL rule, usually added with\n :meth:`@app.route() `, and usually the same name as the\n view function. A route defined in a :class:`~flask.Blueprint`\n will prepend the blueprint's name separated by a ``.`` to the\n endpoint.\n\n In some cases, such as email messages, you want URLs to include\n the scheme and domain, like ``https://example.com/hello``. When\n not in an active request, URLs will be external by default, but\n this requires setting :data:`SERVER_NAME` so Flask knows what\n domain to use. :data:`APPLICATION_ROOT` and\n :data:`PREFERRED_URL_SCHEME` should also be configured as\n needed. This config is only used when not in an active request.\n\n Functions can be decorated with :meth:`url_defaults` to modify\n keyword arguments before the URL is built.\n\n If building fails for some reason, such as an unknown endpoint\n or incorrect values, the app's :meth:`handle_url_build_error`\n method is called. If that returns a string, that is returned,\n otherwise a :exc:`~werkzeug.routing.BuildError` is raised.\n\n :param endpoint: The endpoint name associated with the URL to\n generate. If this starts with a ``.``, the current blueprint\n name (if any) will be used.\n :param _anchor: If given, append this as ``#anchor`` to the URL.\n :param _method: If given, generate the URL associated with this\n method for the endpoint.\n :param _scheme: If given, the URL will have this scheme if it\n is external.\n :param _external: If given, prefer the URL to be internal\n (False) or require it to be external (True). External URLs\n include the scheme and domain. When not in an active\n request, URLs are external by default.\n :param values: Values to use for the variable parts of the URL\n rule. Unknown keys are appended as query string arguments,\n like ``?a=b&c=d``.\n\n .. versionadded:: 2.2\n Moved from ``flask.url_for``, which calls this method.\n \"\"\"\n req_ctx = _cv_request.get(None)\n\n if req_ctx is not None:\n url_adapter = req_ctx.url_adapter\n blueprint_name = req_ctx.request.blueprint\n\n # If the endpoint starts with \".\" and the request matches a\n # blueprint, the endpoint is relative to the blueprint.\n if endpoint[:1] == \".\":\n if blueprint_name is not None:\n endpoint = f\"{blueprint_name}{endpoint}\"\n else:\n endpoint = endpoint[1:]\n\n # When in a request, generate a URL without scheme and\n # domain by default, unless a scheme is given.\n if _external is None:\n _external = _scheme is not None\n else:\n app_ctx = _cv_app.get(None)\n\n # If called by helpers.url_for, an app context is active,\n # use its url_adapter. Otherwise, app.url_for was called\n # directly, build an adapter.\n if app_ctx is not None:\n url_adapter = app_ctx.url_adapter\n else:\n url_adapter = self.create_url_adapter(None)\n\n if url_adapter is None:\n raise RuntimeError(\n \"Unable to build URLs outside an active request\"\n \" without 'SERVER_NAME' configured. Also configure\"\n \" 'APPLICATION_ROOT' and 'PREFERRED_URL_SCHEME' as\"\n \" needed.\"\n )\n\n # When outside a request, generate a URL with scheme and\n # domain by default.\n if _external is None:\n _external = True\n\n # It is an error to set _scheme when _external=False, in order\n # to avoid accidental insecure URLs.\n if _scheme is not None and not _external:\n raise ValueError(\"When specifying '_scheme', '_external' must be True.\")\n\n self.inject_url_defaults(endpoint, values)\n\n try:\n rv = url_adapter.build( # type: ignore[union-attr]\n endpoint,\n values,\n method=_method,\n url_scheme=_scheme,\n force_external=_external,\n )\n except BuildError as error:\n values.update(\n _anchor=_anchor, _method=_method, _scheme=_scheme, _external=_external\n )\n return self.handle_url_build_error(error, endpoint, values)\n\n if _anchor is not None:\n rv = f\"{rv}#{url_quote(_anchor)}\"\n\n return rv\n\n def redirect(self, location: str, code: int = 302) -> BaseResponse:\n \"\"\"Create a redirect response object.\n\n This is called by :func:`flask.redirect`, and can be called\n directly as well.\n\n :param location: The URL to redirect to.\n :param code: The status code for the redirect.\n\n .. versionadded:: 2.2\n Moved from ``flask.redirect``, which calls this method.\n \"\"\"\n return _wz_redirect(location, code=code, Response=self.response_class)\n\n def make_response(self, rv: ft.ResponseReturnValue) -> Response:\n \"\"\"Convert the return value from a view function to an instance of\n :attr:`response_class`.\n\n :param rv: the return value from the view function. The view function\n must return a response. Returning ``None``, or the view ending\n without returning, is not allowed. The following types are allowed\n for ``view_rv``:\n\n ``str``\n A response object is created with the string encoded to UTF-8\n as the body.\n\n ``bytes``\n A response object is created with the bytes as the body.\n\n ``dict``\n A dictionary that will be jsonify'd before being returned.\n\n ``list``\n A list that will be jsonify'd before being returned.\n\n ``generator`` or ``iterator``\n A generator that returns ``str`` or ``bytes`` to be\n streamed as the response.\n\n ``tuple``\n Either ``(body, status, headers)``, ``(body, status)``, or\n ``(body, headers)``, where ``body`` is any of the other types\n allowed here, ``status`` is a string or an integer, and\n ``headers`` is a dictionary or a list of ``(key, value)``\n tuples. If ``body`` is a :attr:`response_class` instance,\n ``status`` overwrites the exiting value and ``headers`` are\n extended.\n\n :attr:`response_class`\n The object is returned unchanged.\n\n other :class:`~werkzeug.wrappers.Response` class\n The object is coerced to :attr:`response_class`.\n\n :func:`callable`\n The function is called as a WSGI application. The result is\n used to create a response object.\n\n .. versionchanged:: 2.2\n A generator will be converted to a streaming response.\n A list will be converted to a JSON response.\n\n .. versionchanged:: 1.1\n A dict will be converted to a JSON response.\n\n .. versionchanged:: 0.9\n Previously a tuple was interpreted as the arguments for the\n response object.\n \"\"\"\n\n status = headers = None\n\n # unpack tuple returns\n if isinstance(rv, tuple):\n len_rv = len(rv)\n\n # a 3-tuple is unpacked directly\n if len_rv == 3:\n rv, status, headers = rv # type: ignore[misc]\n # decide if a 2-tuple has status or headers\n elif len_rv == 2:\n if isinstance(rv[1], (Headers, dict, tuple, list)):\n rv, headers = rv\n else:\n rv, status = rv # type: ignore[assignment,misc]\n # other sized tuples are not allowed\n else:\n raise TypeError(\n \"The view function did not return a valid response tuple.\"\n \" The tuple must have the form (body, status, headers),\"\n \" (body, status), or (body, headers).\"\n )\n\n # the body must not be None\n if rv is None:\n raise TypeError(\n f\"The view function for {request.endpoint!r} did not\"\n \" return a valid response. The function either returned\"\n \" None or ended without a return statement.\"\n )\n\n # make sure the body is an instance of the response class\n if not isinstance(rv, self.response_class):\n if isinstance(rv, (str, bytes, bytearray)) or isinstance(rv, _abc_Iterator):\n # let the response class set the status and headers instead of\n # waiting to do it manually, so that the class can handle any\n # special logic\n rv = self.response_class(\n rv,\n status=status,\n headers=headers, # type: ignore[arg-type]\n )\n status = headers = None\n elif isinstance(rv, (dict, list)):\n rv = self.json.response(rv)\n elif isinstance(rv, BaseResponse) or callable(rv):\n # evaluate a WSGI callable, or coerce a different response\n # class to the correct type\n try:\n rv = self.response_class.force_type(\n rv, request.environ # type: ignore[arg-type]\n )\n except TypeError as e:\n raise TypeError(\n f\"{e}\\nThe view function did not return a valid\"\n \" response. The return type must be a string,\"\n \" dict, list, tuple with headers or status,\"\n \" Response instance, or WSGI callable, but it\"\n f\" was a {type(rv).__name__}.\"\n ).with_traceback(sys.exc_info()[2]) from None\n else:\n raise TypeError(\n \"The view function did not return a valid\"\n \" response. The return type must be a string,\"\n \" dict, list, tuple with headers or status,\"\n \" Response instance, or WSGI callable, but it was a\"\n f\" {type(rv).__name__}.\"\n )\n\n rv = t.cast(Response, rv)\n # prefer the status if it was provided\n if status is not None:\n if isinstance(status, (str, bytes, bytearray)):\n rv.status = status\n else:\n rv.status_code = status\n\n # extend existing headers with provided headers\n if headers:\n rv.headers.update(headers) # type: ignore[arg-type]\n\n return rv\n\n def create_url_adapter(\n self, request: t.Optional[Request]\n ) -> t.Optional[MapAdapter]:\n \"\"\"Creates a URL adapter for the given request. The URL adapter\n is created at a point where the request context is not yet set\n up so the request is passed explicitly.\n\n .. versionadded:: 0.6\n\n .. versionchanged:: 0.9\n This can now also be called without a request object when the\n URL adapter is created for the application context.\n\n .. versionchanged:: 1.0\n :data:`SERVER_NAME` no longer implicitly enables subdomain\n matching. Use :attr:`subdomain_matching` instead.\n \"\"\"\n if request is not None:\n # If subdomain matching is disabled (the default), use the\n # default subdomain in all cases. This should be the default\n # in Werkzeug but it currently does not have that feature.\n if not self.subdomain_matching:\n subdomain = self.url_map.default_subdomain or None\n else:\n subdomain = None\n\n return self.url_map.bind_to_environ(\n request.environ,\n server_name=self.config[\"SERVER_NAME\"],\n subdomain=subdomain,\n )\n # We need at the very least the server name to be set for this\n # to work.\n if self.config[\"SERVER_NAME\"] is not None:\n return self.url_map.bind(\n self.config[\"SERVER_NAME\"],\n script_name=self.config[\"APPLICATION_ROOT\"],\n url_scheme=self.config[\"PREFERRED_URL_SCHEME\"],\n )\n\n return None\n\n def inject_url_defaults(self, endpoint: str, values: dict) -> None:\n \"\"\"Injects the URL defaults for the given endpoint directly into\n the values dictionary passed. This is used internally and\n automatically called on URL building.\n\n .. versionadded:: 0.7\n \"\"\"\n names: t.Iterable[t.Optional[str]] = (None,)\n\n # url_for may be called outside a request context, parse the\n # passed endpoint instead of using request.blueprints.\n if \".\" in endpoint:\n names = chain(\n names, reversed(_split_blueprint_path(endpoint.rpartition(\".\")[0]))\n )\n\n for name in names:\n if name in self.url_default_functions:\n for func in self.url_default_functions[name]:\n func(endpoint, values)\n\n def handle_url_build_error(\n self, error: BuildError, endpoint: str, values: t.Dict[str, t.Any]\n ) -> str:\n \"\"\"Called by :meth:`.url_for` if a\n :exc:`~werkzeug.routing.BuildError` was raised. If this returns\n a value, it will be returned by ``url_for``, otherwise the error\n will be re-raised.\n\n Each function in :attr:`url_build_error_handlers` is called with\n ``error``, ``endpoint`` and ``values``. If a function returns\n ``None`` or raises a ``BuildError``, it is skipped. Otherwise,\n its return value is returned by ``url_for``.\n\n :param error: The active ``BuildError`` being handled.\n :param endpoint: The endpoint being built.\n :param values: The keyword arguments passed to ``url_for``.\n \"\"\"\n for handler in self.url_build_error_handlers:\n try:\n rv = handler(error, endpoint, values)\n except BuildError as e:\n # make error available outside except block\n error = e\n else:\n if rv is not None:\n return rv\n\n # Re-raise if called with an active exception, otherwise raise\n # the passed in exception.\n if error is sys.exc_info()[1]:\n raise\n\n raise error\n\n def preprocess_request(self) -> t.Optional[ft.ResponseReturnValue]:\n \"\"\"Called before the request is dispatched. Calls\n :attr:`url_value_preprocessors` registered with the app and the\n current blueprint (if any). Then calls :attr:`before_request_funcs`\n registered with the app and the blueprint.\n\n If any :meth:`before_request` handler returns a non-None value, the\n value is handled as if it was the return value from the view, and\n further request handling is stopped.\n \"\"\"\n names = (None, *reversed(request.blueprints))\n\n for name in names:\n if name in self.url_value_preprocessors:\n for url_func in self.url_value_preprocessors[name]:\n url_func(request.endpoint, request.view_args)\n\n for name in names:\n if name in self.before_request_funcs:\n for before_func in self.before_request_funcs[name]:\n rv = self.ensure_sync(before_func)()\n\n if rv is not None:\n return rv\n\n return None\n\n def process_response(self, response: Response) -> Response:\n \"\"\"Can be overridden in order to modify the response object\n before it's sent to the WSGI server. By default this will\n call all the :meth:`after_request` decorated functions.\n\n .. versionchanged:: 0.5\n As of Flask 0.5 the functions registered for after request\n execution are called in reverse order of registration.\n\n :param response: a :attr:`response_class` object.\n :return: a new response object or the same, has to be an\n instance of :attr:`response_class`.\n \"\"\"\n ctx = request_ctx._get_current_object() # type: ignore[attr-defined]\n\n for func in ctx._after_request_functions:\n response = self.ensure_sync(func)(response)\n\n for name in chain(request.blueprints, (None,)):\n if name in self.after_request_funcs:\n for func in reversed(self.after_request_funcs[name]):\n response = self.ensure_sync(func)(response)\n\n if not self.session_interface.is_null_session(ctx.session):\n self.session_interface.save_session(self, ctx.session, response)\n\n return response\n\n def do_teardown_request(\n self, exc: t.Optional[BaseException] = _sentinel # type: ignore\n ) -> None:\n \"\"\"Called after the request is dispatched and the response is\n returned, right before the request context is popped.\n\n This calls all functions decorated with\n :meth:`teardown_request`, and :meth:`Blueprint.teardown_request`\n if a blueprint handled the request. Finally, the\n :data:`request_tearing_down` signal is sent.\n\n This is called by\n :meth:`RequestContext.pop() `,\n which may be delayed during testing to maintain access to\n resources.\n\n :param exc: An unhandled exception raised while dispatching the\n request. Detected from the current exception information if\n not passed. Passed to each teardown function.\n\n .. versionchanged:: 0.9\n Added the ``exc`` argument.\n \"\"\"\n if exc is _sentinel:\n exc = sys.exc_info()[1]\n\n for name in chain(request.blueprints, (None,)):\n if name in self.teardown_request_funcs:\n for func in reversed(self.teardown_request_funcs[name]):\n self.ensure_sync(func)(exc)\n\n request_tearing_down.send(self, exc=exc)\n\n def do_teardown_appcontext(\n self, exc: t.Optional[BaseException] = _sentinel # type: ignore\n ) -> None:\n \"\"\"Called right before the application context is popped.\n\n When handling a request, the application context is popped\n after the request context. See :meth:`do_teardown_request`.\n\n This calls all functions decorated with\n :meth:`teardown_appcontext`. Then the\n :data:`appcontext_tearing_down` signal is sent.\n\n This is called by\n :meth:`AppContext.pop() `.\n\n .. versionadded:: 0.9\n \"\"\"\n if exc is _sentinel:\n exc = sys.exc_info()[1]\n\n for func in reversed(self.teardown_appcontext_funcs):\n self.ensure_sync(func)(exc)\n\n appcontext_tearing_down.send(self, exc=exc)\n\n def app_context(self) -> AppContext:\n \"\"\"Create an :class:`~flask.ctx.AppContext`. Use as a ``with``\n block to push the context, which will make :data:`current_app`\n point at this application.\n\n An application context is automatically pushed by\n :meth:`RequestContext.push() `\n when handling a request, and when running a CLI command. Use\n this to manually create a context outside of these situations.\n\n ::\n\n with app.app_context():\n init_db()\n\n See :doc:`/appcontext`.\n\n .. versionadded:: 0.9\n \"\"\"\n return AppContext(self)\n\n def request_context(self, environ: dict) -> RequestContext:\n \"\"\"Create a :class:`~flask.ctx.RequestContext` representing a\n WSGI environment. Use a ``with`` block to push the context,\n which will make :data:`request` point at this request.\n\n See :doc:`/reqcontext`.\n\n Typically you should not call this from your own code. A request\n context is automatically pushed by the :meth:`wsgi_app` when\n handling a request. Use :meth:`test_request_context` to create\n an environment and context instead of this method.\n\n :param environ: a WSGI environment\n \"\"\"\n return RequestContext(self, environ)\n\n def test_request_context(self, *args: t.Any, **kwargs: t.Any) -> RequestContext:\n \"\"\"Create a :class:`~flask.ctx.RequestContext` for a WSGI\n environment created from the given values. This is mostly useful\n during testing, where you may want to run a function that uses\n request data without dispatching a full request.\n\n See :doc:`/reqcontext`.\n\n Use a ``with`` block to push the context, which will make\n :data:`request` point at the request for the created\n environment. ::\n\n with app.test_request_context(...):\n generate_report()\n\n When using the shell, it may be easier to push and pop the\n context manually to avoid indentation. ::\n\n ctx = app.test_request_context(...)\n ctx.push()\n ...\n ctx.pop()\n\n Takes the same arguments as Werkzeug's\n :class:`~werkzeug.test.EnvironBuilder`, with some defaults from\n the application. See the linked Werkzeug docs for most of the\n available arguments. Flask-specific behavior is listed here.\n\n :param path: URL path being requested.\n :param base_url: Base URL where the app is being served, which\n ``path`` is relative to. If not given, built from\n :data:`PREFERRED_URL_SCHEME`, ``subdomain``,\n :data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`.\n :param subdomain: Subdomain name to append to\n :data:`SERVER_NAME`.\n :param url_scheme: Scheme to use instead of\n :data:`PREFERRED_URL_SCHEME`.\n :param data: The request body, either as a string or a dict of\n form keys and values.\n :param json: If given, this is serialized as JSON and passed as\n ``data``. Also defaults ``content_type`` to\n ``application/json``.\n :param args: other positional arguments passed to\n :class:`~werkzeug.test.EnvironBuilder`.\n :param kwargs: other keyword arguments passed to\n :class:`~werkzeug.test.EnvironBuilder`.\n \"\"\"\n from .testing import EnvironBuilder\n\n builder = EnvironBuilder(self, *args, **kwargs)\n\n try:\n return self.request_context(builder.get_environ())\n finally:\n builder.close()\n\n def wsgi_app(self, environ: dict, start_response: t.Callable) -> t.Any:\n \"\"\"The actual WSGI application. This is not implemented in\n :meth:`__call__` so that middlewares can be applied without\n losing a reference to the app object. Instead of doing this::\n\n app = MyMiddleware(app)\n\n It's a better idea to do this instead::\n\n app.wsgi_app = MyMiddleware(app.wsgi_app)\n\n Then you still have the original application object around and\n can continue to call methods on it.\n\n .. versionchanged:: 0.7\n Teardown events for the request and app contexts are called\n even if an unhandled error occurs. Other events may not be\n called depending on when an error occurs during dispatch.\n See :ref:`callbacks-and-errors`.\n\n :param environ: A WSGI environment.\n :param start_response: A callable accepting a status code,\n a list of headers, and an optional exception context to\n start the response.\n \"\"\"\n ctx = self.request_context(environ)\n error: t.Optional[BaseException] = None\n try:\n try:\n ctx.push()\n response = self.full_dispatch_request()\n except Exception as e:\n error = e\n response = self.handle_exception(e)\n except: # noqa: B001\n error = sys.exc_info()[1]\n raise\n return response(environ, start_response)\n finally:\n if \"werkzeug.debug.preserve_context\" in environ:\n environ[\"werkzeug.debug.preserve_context\"](_cv_app.get())\n environ[\"werkzeug.debug.preserve_context\"](_cv_request.get())\n\n if error is not None and self.should_ignore_error(error):\n error = None\n\n ctx.pop(error)\n\n def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:\n \"\"\"The WSGI server calls the Flask application object as the\n WSGI application. This calls :meth:`wsgi_app`, which can be\n wrapped to apply middleware.\n \"\"\"\n return self.wsgi_app(environ, start_response)"},{"col":0,"comment":"null","endLoc":133,"header":"def test_config_from_class()","id":330,"name":"test_config_from_class","nodeType":"Function","startLoc":124,"text":"def test_config_from_class():\n class Base:\n TEST_KEY = \"foo\"\n\n class Test(Base):\n SECRET_KEY = \"config\"\n\n app = flask.Flask(__name__)\n app.config.from_object(Test)\n common_object_test(app)"},{"attributeType":"BaseException | None","col":4,"comment":"null","endLoc":1929,"id":331,"name":"__cause__","nodeType":"Attribute","startLoc":1929,"text":"__cause__"},{"col":0,"comment":"null","endLoc":150,"header":"def test_config_from_envvar(monkeypatch)","id":334,"name":"test_config_from_envvar","nodeType":"Function","startLoc":136,"text":"def test_config_from_envvar(monkeypatch):\n monkeypatch.setattr(\"os.environ\", {})\n app = flask.Flask(__name__)\n\n with pytest.raises(RuntimeError) as e:\n app.config.from_envvar(\"FOO_SETTINGS\")\n\n assert \"'FOO_SETTINGS' is not set\" in str(e.value)\n assert not app.config.from_envvar(\"FOO_SETTINGS\", silent=True)\n\n monkeypatch.setattr(\n \"os.environ\", {\"FOO_SETTINGS\": f\"{__file__.rsplit('.', 1)[0]}.py\"}\n )\n assert app.config.from_envvar(\"FOO_SETTINGS\")\n common_object_test(app)"},{"attributeType":"BaseException | None","col":4,"comment":"null","endLoc":1930,"id":335,"name":"__context__","nodeType":"Attribute","startLoc":1930,"text":"__context__"},{"col":4,"comment":"null","endLoc":67,"header":"def __init__(self, name, message=None)","id":336,"name":"__init__","nodeType":"Function","startLoc":54,"text":"def __init__(self, name, message=None):\n IOError.__init__(self, name)\n\n if message is None:\n from .runtime import Undefined\n\n if isinstance(name, Undefined):\n name._fail_with_undefined_error()\n\n message = name\n\n self.message = message\n self.name = name\n self.templates = [name]"},{"attributeType":"bool","col":4,"comment":"null","endLoc":1931,"id":337,"name":"__suppress_context__","nodeType":"Attribute","startLoc":1931,"text":"__suppress_context__"},{"className":"TaggedJSONSerializer","col":0,"comment":"Serializer that uses a tag system to compactly represent objects that\n are not JSON types. Passed as the intermediate serializer to\n :class:`itsdangerous.Serializer`.\n\n The following extra types are supported:\n\n * :class:`dict`\n * :class:`tuple`\n * :class:`bytes`\n * :class:`~markupsafe.Markup`\n * :class:`~uuid.UUID`\n * :class:`~datetime.datetime`\n ","endLoc":312,"id":338,"nodeType":"Class","startLoc":216,"text":"class TaggedJSONSerializer:\n \"\"\"Serializer that uses a tag system to compactly represent objects that\n are not JSON types. Passed as the intermediate serializer to\n :class:`itsdangerous.Serializer`.\n\n The following extra types are supported:\n\n * :class:`dict`\n * :class:`tuple`\n * :class:`bytes`\n * :class:`~markupsafe.Markup`\n * :class:`~uuid.UUID`\n * :class:`~datetime.datetime`\n \"\"\"\n\n __slots__ = (\"tags\", \"order\")\n\n #: Tag classes to bind when creating the serializer. Other tags can be\n #: added later using :meth:`~register`.\n default_tags = [\n TagDict,\n PassDict,\n TagTuple,\n PassList,\n TagBytes,\n TagMarkup,\n TagUUID,\n TagDateTime,\n ]\n\n def __init__(self) -> None:\n self.tags: t.Dict[str, JSONTag] = {}\n self.order: t.List[JSONTag] = []\n\n for cls in self.default_tags:\n self.register(cls)\n\n def register(\n self,\n tag_class: t.Type[JSONTag],\n force: bool = False,\n index: t.Optional[int] = None,\n ) -> None:\n \"\"\"Register a new tag with this serializer.\n\n :param tag_class: tag class to register. Will be instantiated with this\n serializer instance.\n :param force: overwrite an existing tag. If false (default), a\n :exc:`KeyError` is raised.\n :param index: index to insert the new tag in the tag order. Useful when\n the new tag is a special case of an existing tag. If ``None``\n (default), the tag is appended to the end of the order.\n\n :raise KeyError: if the tag key is already registered and ``force`` is\n not true.\n \"\"\"\n tag = tag_class(self)\n key = tag.key\n\n if key is not None:\n if not force and key in self.tags:\n raise KeyError(f\"Tag '{key}' is already registered.\")\n\n self.tags[key] = tag\n\n if index is None:\n self.order.append(tag)\n else:\n self.order.insert(index, tag)\n\n def tag(self, value: t.Any) -> t.Dict[str, t.Any]:\n \"\"\"Convert a value to a tagged representation if necessary.\"\"\"\n for tag in self.order:\n if tag.check(value):\n return tag.tag(value)\n\n return value\n\n def untag(self, value: t.Dict[str, t.Any]) -> t.Any:\n \"\"\"Convert a tagged representation back to the original type.\"\"\"\n if len(value) != 1:\n return value\n\n key = next(iter(value))\n\n if key not in self.tags:\n return value\n\n return self.tags[key].to_python(value[key])\n\n def dumps(self, value: t.Any) -> str:\n \"\"\"Tag the value and dump it to a compact JSON string.\"\"\"\n return dumps(self.tag(value), separators=(\",\", \":\"))\n\n def loads(self, value: str) -> t.Any:\n \"\"\"Load data from a JSON string and deserialized any tagged objects.\"\"\"\n return loads(value, object_hook=self.untag)"},{"attributeType":"TracebackType | None","col":4,"comment":"null","endLoc":1932,"id":341,"name":"__traceback__","nodeType":"Attribute","startLoc":1932,"text":"__traceback__"},{"col":4,"comment":"Iterates over all templates. If the loader does not support that\n it should raise a :exc:`TypeError` which is the default behavior.\n ","endLoc":99,"header":"def list_templates(self)","id":343,"name":"list_templates","nodeType":"Function","startLoc":95,"text":"def list_templates(self):\n \"\"\"Iterates over all templates. If the loader does not support that\n it should raise a :exc:`TypeError` which is the default behavior.\n \"\"\"\n raise TypeError(\"this loader cannot iterate over all templates\")"},{"className":"TemplateError","col":0,"comment":"Baseclass for all template errors.","endLoc":38,"id":344,"nodeType":"Class","startLoc":8,"text":"class TemplateError(Exception):\n \"\"\"Baseclass for all template errors.\"\"\"\n\n if PY2:\n\n def __init__(self, message=None):\n if message is not None:\n message = text_type(message).encode(\"utf-8\")\n Exception.__init__(self, message)\n\n @property\n def message(self):\n if self.args:\n message = self.args[0]\n if message is not None:\n return message.decode(\"utf-8\", \"replace\")\n\n def __unicode__(self):\n return self.message or u\"\"\n\n else:\n\n def __init__(self, message=None):\n Exception.__init__(self, message)\n\n @property\n def message(self):\n if self.args:\n message = self.args[0]\n if message is not None:\n return message"},{"col":8,"comment":"null","endLoc":16,"header":"def __init__(self, message=None)","id":345,"name":"__init__","nodeType":"Function","startLoc":13,"text":"def __init__(self, message=None):\n if message is not None:\n message = text_type(message).encode(\"utf-8\")\n Exception.__init__(self, message)"},{"col":4,"comment":"Loads a template. This method looks up the template in the cache\n or loads one by calling :meth:`get_source`. Subclasses should not\n override this method as loaders working on collections of other\n loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)\n will not call this method but `get_source` directly.\n ","endLoc":138,"header":"@internalcode\n def load(self, environment, name, globals=None)","id":346,"name":"load","nodeType":"Function","startLoc":101,"text":"@internalcode\n def load(self, environment, name, globals=None):\n \"\"\"Loads a template. This method looks up the template in the cache\n or loads one by calling :meth:`get_source`. Subclasses should not\n override this method as loaders working on collections of other\n loaders (such as :class:`PrefixLoader` or :class:`ChoiceLoader`)\n will not call this method but `get_source` directly.\n \"\"\"\n code = None\n if globals is None:\n globals = {}\n\n # first we try to get the source for this template together\n # with the filename and the uptodate function.\n source, filename, uptodate = self.get_source(environment, name)\n\n # try to load the code from the bytecode cache if there is a\n # bytecode cache configured.\n bcc = environment.bytecode_cache\n if bcc is not None:\n bucket = bcc.get_bucket(environment, name, filename, source)\n code = bucket.code\n\n # if we don't have code so far (not cached, no longer up to\n # date) etc. we compile the template\n if code is None:\n code = environment.compile(source, name, filename)\n\n # if the bytecode cache is available and the bucket doesn't\n # have a code so far, we give the bucket the new code and put\n # it back to the bytecode cache.\n if bcc is not None and bucket.code is None:\n bucket.code = code\n bcc.set_bucket(bucket)\n\n return environment.template_class.from_code(\n environment, code, globals, uptodate\n )"},{"col":4,"comment":"null","endLoc":251,"header":"def __init__(self) -> None","id":347,"name":"__init__","nodeType":"Function","startLoc":246,"text":"def __init__(self) -> None:\n self.tags: t.Dict[str, JSONTag] = {}\n self.order: t.List[JSONTag] = []\n\n for cls in self.default_tags:\n self.register(cls)"},{"attributeType":"null","col":4,"comment":"null","endLoc":69,"id":351,"name":"has_source_access","nodeType":"Attribute","startLoc":69,"text":"has_source_access"},{"col":0,"comment":"null","endLoc":163,"header":"def test_config_from_envvar_missing(monkeypatch)","id":352,"name":"test_config_from_envvar_missing","nodeType":"Function","startLoc":153,"text":"def test_config_from_envvar_missing(monkeypatch):\n monkeypatch.setattr(\"os.environ\", {\"FOO_SETTINGS\": \"missing.cfg\"})\n app = flask.Flask(__name__)\n with pytest.raises(IOError) as e:\n app.config.from_envvar(\"FOO_SETTINGS\")\n msg = str(e.value)\n assert msg.startswith(\n \"[Errno 2] Unable to load configuration file (No such file or directory):\"\n )\n assert msg.endswith(\"missing.cfg'\")\n assert not app.config.from_envvar(\"FOO_SETTINGS\", silent=True)"},{"col":4,"comment":"Register a new tag with this serializer.\n\n :param tag_class: tag class to register. Will be instantiated with this\n serializer instance.\n :param force: overwrite an existing tag. If false (default), a\n :exc:`KeyError` is raised.\n :param index: index to insert the new tag in the tag order. Useful when\n the new tag is a special case of an existing tag. If ``None``\n (default), the tag is appended to the end of the order.\n\n :raise KeyError: if the tag key is already registered and ``force`` is\n not true.\n ","endLoc":284,"header":"def register(\n self,\n tag_class: t.Type[JSONTag],\n force: bool = False,\n index: t.Optional[int] = None,\n ) -> None","id":353,"name":"register","nodeType":"Function","startLoc":253,"text":"def register(\n self,\n tag_class: t.Type[JSONTag],\n force: bool = False,\n index: t.Optional[int] = None,\n ) -> None:\n \"\"\"Register a new tag with this serializer.\n\n :param tag_class: tag class to register. Will be instantiated with this\n serializer instance.\n :param force: overwrite an existing tag. If false (default), a\n :exc:`KeyError` is raised.\n :param index: index to insert the new tag in the tag order. Useful when\n the new tag is a special case of an existing tag. If ``None``\n (default), the tag is appended to the end of the order.\n\n :raise KeyError: if the tag key is already registered and ``force`` is\n not true.\n \"\"\"\n tag = tag_class(self)\n key = tag.key\n\n if key is not None:\n if not force and key in self.tags:\n raise KeyError(f\"Tag '{key}' is already registered.\")\n\n self.tags[key] = tag\n\n if index is None:\n self.order.append(tag)\n else:\n self.order.insert(index, tag)"},{"className":"Environment","col":0,"comment":"The core component of Jinja is the `Environment`. It contains\n important shared variables like configuration, filters, tests,\n globals and others. Instances of this class may be modified if\n they are not shared and if no template was loaded so far.\n Modifications on environments after the first template was loaded\n will lead to surprising effects and undefined behavior.\n\n Here are the possible initialization parameters:\n\n `block_start_string`\n The string marking the beginning of a block. Defaults to ``'{%'``.\n\n `block_end_string`\n The string marking the end of a block. Defaults to ``'%}'``.\n\n `variable_start_string`\n The string marking the beginning of a print statement.\n Defaults to ``'{{'``.\n\n `variable_end_string`\n The string marking the end of a print statement. Defaults to\n ``'}}'``.\n\n `comment_start_string`\n The string marking the beginning of a comment. Defaults to ``'{#'``.\n\n `comment_end_string`\n The string marking the end of a comment. Defaults to ``'#}'``.\n\n `line_statement_prefix`\n If given and a string, this will be used as prefix for line based\n statements. See also :ref:`line-statements`.\n\n `line_comment_prefix`\n If given and a string, this will be used as prefix for line based\n comments. See also :ref:`line-statements`.\n\n .. versionadded:: 2.2\n\n `trim_blocks`\n If this is set to ``True`` the first newline after a block is\n removed (block, not variable tag!). Defaults to `False`.\n\n `lstrip_blocks`\n If this is set to ``True`` leading spaces and tabs are stripped\n from the start of a line to a block. Defaults to `False`.\n\n `newline_sequence`\n The sequence that starts a newline. Must be one of ``'\\r'``,\n ``'\\n'`` or ``'\\r\\n'``. The default is ``'\\n'`` which is a\n useful default for Linux and OS X systems as well as web\n applications.\n\n `keep_trailing_newline`\n Preserve the trailing newline when rendering templates.\n The default is ``False``, which causes a single newline,\n if present, to be stripped from the end of the template.\n\n .. versionadded:: 2.7\n\n `extensions`\n List of Jinja extensions to use. This can either be import paths\n as strings or extension classes. For more information have a\n look at :ref:`the extensions documentation `.\n\n `optimized`\n should the optimizer be enabled? Default is ``True``.\n\n `undefined`\n :class:`Undefined` or a subclass of it that is used to represent\n undefined values in the template.\n\n `finalize`\n A callable that can be used to process the result of a variable\n expression before it is output. For example one can convert\n ``None`` implicitly into an empty string here.\n\n `autoescape`\n If set to ``True`` the XML/HTML autoescaping feature is enabled by\n default. For more details about autoescaping see\n :class:`~markupsafe.Markup`. As of Jinja 2.4 this can also\n be a callable that is passed the template name and has to\n return ``True`` or ``False`` depending on autoescape should be\n enabled by default.\n\n .. versionchanged:: 2.4\n `autoescape` can now be a function\n\n `loader`\n The template loader for this environment.\n\n `cache_size`\n The size of the cache. Per default this is ``400`` which means\n that if more than 400 templates are loaded the loader will clean\n out the least recently used template. If the cache size is set to\n ``0`` templates are recompiled all the time, if the cache size is\n ``-1`` the cache will not be cleaned.\n\n .. versionchanged:: 2.8\n The cache size was increased to 400 from a low 50.\n\n `auto_reload`\n Some loaders load templates from locations where the template\n sources may change (ie: file system or database). If\n ``auto_reload`` is set to ``True`` (default) every time a template is\n requested the loader checks if the source changed and if yes, it\n will reload the template. For higher performance it's possible to\n disable that.\n\n `bytecode_cache`\n If set to a bytecode cache object, this object will provide a\n cache for the internal Jinja bytecode so that templates don't\n have to be parsed if they were not changed.\n\n See :ref:`bytecode-cache` for more information.\n\n `enable_async`\n If set to true this enables async template execution which allows\n you to take advantage of newer Python features. This requires\n Python 3.6 or later.\n ","endLoc":947,"id":354,"nodeType":"Class","startLoc":141,"text":"class Environment(object):\n r\"\"\"The core component of Jinja is the `Environment`. It contains\n important shared variables like configuration, filters, tests,\n globals and others. Instances of this class may be modified if\n they are not shared and if no template was loaded so far.\n Modifications on environments after the first template was loaded\n will lead to surprising effects and undefined behavior.\n\n Here are the possible initialization parameters:\n\n `block_start_string`\n The string marking the beginning of a block. Defaults to ``'{%'``.\n\n `block_end_string`\n The string marking the end of a block. Defaults to ``'%}'``.\n\n `variable_start_string`\n The string marking the beginning of a print statement.\n Defaults to ``'{{'``.\n\n `variable_end_string`\n The string marking the end of a print statement. Defaults to\n ``'}}'``.\n\n `comment_start_string`\n The string marking the beginning of a comment. Defaults to ``'{#'``.\n\n `comment_end_string`\n The string marking the end of a comment. Defaults to ``'#}'``.\n\n `line_statement_prefix`\n If given and a string, this will be used as prefix for line based\n statements. See also :ref:`line-statements`.\n\n `line_comment_prefix`\n If given and a string, this will be used as prefix for line based\n comments. See also :ref:`line-statements`.\n\n .. versionadded:: 2.2\n\n `trim_blocks`\n If this is set to ``True`` the first newline after a block is\n removed (block, not variable tag!). Defaults to `False`.\n\n `lstrip_blocks`\n If this is set to ``True`` leading spaces and tabs are stripped\n from the start of a line to a block. Defaults to `False`.\n\n `newline_sequence`\n The sequence that starts a newline. Must be one of ``'\\r'``,\n ``'\\n'`` or ``'\\r\\n'``. The default is ``'\\n'`` which is a\n useful default for Linux and OS X systems as well as web\n applications.\n\n `keep_trailing_newline`\n Preserve the trailing newline when rendering templates.\n The default is ``False``, which causes a single newline,\n if present, to be stripped from the end of the template.\n\n .. versionadded:: 2.7\n\n `extensions`\n List of Jinja extensions to use. This can either be import paths\n as strings or extension classes. For more information have a\n look at :ref:`the extensions documentation `.\n\n `optimized`\n should the optimizer be enabled? Default is ``True``.\n\n `undefined`\n :class:`Undefined` or a subclass of it that is used to represent\n undefined values in the template.\n\n `finalize`\n A callable that can be used to process the result of a variable\n expression before it is output. For example one can convert\n ``None`` implicitly into an empty string here.\n\n `autoescape`\n If set to ``True`` the XML/HTML autoescaping feature is enabled by\n default. For more details about autoescaping see\n :class:`~markupsafe.Markup`. As of Jinja 2.4 this can also\n be a callable that is passed the template name and has to\n return ``True`` or ``False`` depending on autoescape should be\n enabled by default.\n\n .. versionchanged:: 2.4\n `autoescape` can now be a function\n\n `loader`\n The template loader for this environment.\n\n `cache_size`\n The size of the cache. Per default this is ``400`` which means\n that if more than 400 templates are loaded the loader will clean\n out the least recently used template. If the cache size is set to\n ``0`` templates are recompiled all the time, if the cache size is\n ``-1`` the cache will not be cleaned.\n\n .. versionchanged:: 2.8\n The cache size was increased to 400 from a low 50.\n\n `auto_reload`\n Some loaders load templates from locations where the template\n sources may change (ie: file system or database). If\n ``auto_reload`` is set to ``True`` (default) every time a template is\n requested the loader checks if the source changed and if yes, it\n will reload the template. For higher performance it's possible to\n disable that.\n\n `bytecode_cache`\n If set to a bytecode cache object, this object will provide a\n cache for the internal Jinja bytecode so that templates don't\n have to be parsed if they were not changed.\n\n See :ref:`bytecode-cache` for more information.\n\n `enable_async`\n If set to true this enables async template execution which allows\n you to take advantage of newer Python features. This requires\n Python 3.6 or later.\n \"\"\"\n\n #: if this environment is sandboxed. Modifying this variable won't make\n #: the environment sandboxed though. For a real sandboxed environment\n #: have a look at jinja2.sandbox. This flag alone controls the code\n #: generation by the compiler.\n sandboxed = False\n\n #: True if the environment is just an overlay\n overlayed = False\n\n #: the environment this environment is linked to if it is an overlay\n linked_to = None\n\n #: shared environments have this set to `True`. A shared environment\n #: must not be modified\n shared = False\n\n #: the class that is used for code generation. See\n #: :class:`~jinja2.compiler.CodeGenerator` for more information.\n code_generator_class = CodeGenerator\n\n #: the context class thatis used for templates. See\n #: :class:`~jinja2.runtime.Context` for more information.\n context_class = Context\n\n def __init__(\n self,\n block_start_string=BLOCK_START_STRING,\n block_end_string=BLOCK_END_STRING,\n variable_start_string=VARIABLE_START_STRING,\n variable_end_string=VARIABLE_END_STRING,\n comment_start_string=COMMENT_START_STRING,\n comment_end_string=COMMENT_END_STRING,\n line_statement_prefix=LINE_STATEMENT_PREFIX,\n line_comment_prefix=LINE_COMMENT_PREFIX,\n trim_blocks=TRIM_BLOCKS,\n lstrip_blocks=LSTRIP_BLOCKS,\n newline_sequence=NEWLINE_SEQUENCE,\n keep_trailing_newline=KEEP_TRAILING_NEWLINE,\n extensions=(),\n optimized=True,\n undefined=Undefined,\n finalize=None,\n autoescape=False,\n loader=None,\n cache_size=400,\n auto_reload=True,\n bytecode_cache=None,\n enable_async=False,\n ):\n # !!Important notice!!\n # The constructor accepts quite a few arguments that should be\n # passed by keyword rather than position. However it's important to\n # not change the order of arguments because it's used at least\n # internally in those cases:\n # - spontaneous environments (i18n extension and Template)\n # - unittests\n # If parameter changes are required only add parameters at the end\n # and don't change the arguments (or the defaults!) of the arguments\n # existing already.\n\n # lexer / parser information\n self.block_start_string = block_start_string\n self.block_end_string = block_end_string\n self.variable_start_string = variable_start_string\n self.variable_end_string = variable_end_string\n self.comment_start_string = comment_start_string\n self.comment_end_string = comment_end_string\n self.line_statement_prefix = line_statement_prefix\n self.line_comment_prefix = line_comment_prefix\n self.trim_blocks = trim_blocks\n self.lstrip_blocks = lstrip_blocks\n self.newline_sequence = newline_sequence\n self.keep_trailing_newline = keep_trailing_newline\n\n # runtime information\n self.undefined = undefined\n self.optimized = optimized\n self.finalize = finalize\n self.autoescape = autoescape\n\n # defaults\n self.filters = DEFAULT_FILTERS.copy()\n self.tests = DEFAULT_TESTS.copy()\n self.globals = DEFAULT_NAMESPACE.copy()\n\n # set the loader provided\n self.loader = loader\n self.cache = create_cache(cache_size)\n self.bytecode_cache = bytecode_cache\n self.auto_reload = auto_reload\n\n # configurable policies\n self.policies = DEFAULT_POLICIES.copy()\n\n # load extensions\n self.extensions = load_extensions(self, extensions)\n\n self.enable_async = enable_async\n self.is_async = self.enable_async and have_async_gen\n if self.is_async:\n # runs patch_all() to enable async support\n from . import asyncsupport # noqa: F401\n\n _environment_sanity_check(self)\n\n def add_extension(self, extension):\n \"\"\"Adds an extension after the environment was created.\n\n .. versionadded:: 2.5\n \"\"\"\n self.extensions.update(load_extensions(self, [extension]))\n\n def extend(self, **attributes):\n \"\"\"Add the items to the instance of the environment if they do not exist\n yet. This is used by :ref:`extensions ` to register\n callbacks and configuration values without breaking inheritance.\n \"\"\"\n for key, value in iteritems(attributes):\n if not hasattr(self, key):\n setattr(self, key, value)\n\n def overlay(\n self,\n block_start_string=missing,\n block_end_string=missing,\n variable_start_string=missing,\n variable_end_string=missing,\n comment_start_string=missing,\n comment_end_string=missing,\n line_statement_prefix=missing,\n line_comment_prefix=missing,\n trim_blocks=missing,\n lstrip_blocks=missing,\n extensions=missing,\n optimized=missing,\n undefined=missing,\n finalize=missing,\n autoescape=missing,\n loader=missing,\n cache_size=missing,\n auto_reload=missing,\n bytecode_cache=missing,\n ):\n \"\"\"Create a new overlay environment that shares all the data with the\n current environment except for cache and the overridden attributes.\n Extensions cannot be removed for an overlayed environment. An overlayed\n environment automatically gets all the extensions of the environment it\n is linked to plus optional extra extensions.\n\n Creating overlays should happen after the initial environment was set\n up completely. Not all attributes are truly linked, some are just\n copied over so modifications on the original environment may not shine\n through.\n \"\"\"\n args = dict(locals())\n del args[\"self\"], args[\"cache_size\"], args[\"extensions\"]\n\n rv = object.__new__(self.__class__)\n rv.__dict__.update(self.__dict__)\n rv.overlayed = True\n rv.linked_to = self\n\n for key, value in iteritems(args):\n if value is not missing:\n setattr(rv, key, value)\n\n if cache_size is not missing:\n rv.cache = create_cache(cache_size)\n else:\n rv.cache = copy_cache(self.cache)\n\n rv.extensions = {}\n for key, value in iteritems(self.extensions):\n rv.extensions[key] = value.bind(rv)\n if extensions is not missing:\n rv.extensions.update(load_extensions(rv, extensions))\n\n return _environment_sanity_check(rv)\n\n lexer = property(get_lexer, doc=\"The lexer for this environment.\")\n\n def iter_extensions(self):\n \"\"\"Iterates over the extensions by priority.\"\"\"\n return iter(sorted(self.extensions.values(), key=lambda x: x.priority))\n\n def getitem(self, obj, argument):\n \"\"\"Get an item or attribute of an object but prefer the item.\"\"\"\n try:\n return obj[argument]\n except (AttributeError, TypeError, LookupError):\n if isinstance(argument, string_types):\n try:\n attr = str(argument)\n except Exception:\n pass\n else:\n try:\n return getattr(obj, attr)\n except AttributeError:\n pass\n return self.undefined(obj=obj, name=argument)\n\n def getattr(self, obj, attribute):\n \"\"\"Get an item or attribute of an object but prefer the attribute.\n Unlike :meth:`getitem` the attribute *must* be a bytestring.\n \"\"\"\n try:\n return getattr(obj, attribute)\n except AttributeError:\n pass\n try:\n return obj[attribute]\n except (TypeError, LookupError, AttributeError):\n return self.undefined(obj=obj, name=attribute)\n\n def call_filter(\n self, name, value, args=None, kwargs=None, context=None, eval_ctx=None\n ):\n \"\"\"Invokes a filter on a value the same way the compiler does it.\n\n Note that on Python 3 this might return a coroutine in case the\n filter is running from an environment in async mode and the filter\n supports async execution. It's your responsibility to await this\n if needed.\n\n .. versionadded:: 2.7\n \"\"\"\n func = self.filters.get(name)\n if func is None:\n fail_for_missing_callable(\"no filter named %r\", name)\n args = [value] + list(args or ())\n if getattr(func, \"contextfilter\", False) is True:\n if context is None:\n raise TemplateRuntimeError(\n \"Attempted to invoke context filter without context\"\n )\n args.insert(0, context)\n elif getattr(func, \"evalcontextfilter\", False) is True:\n if eval_ctx is None:\n if context is not None:\n eval_ctx = context.eval_ctx\n else:\n eval_ctx = EvalContext(self)\n args.insert(0, eval_ctx)\n elif getattr(func, \"environmentfilter\", False) is True:\n args.insert(0, self)\n return func(*args, **(kwargs or {}))\n\n def call_test(self, name, value, args=None, kwargs=None):\n \"\"\"Invokes a test on a value the same way the compiler does it.\n\n .. versionadded:: 2.7\n \"\"\"\n func = self.tests.get(name)\n if func is None:\n fail_for_missing_callable(\"no test named %r\", name)\n return func(value, *(args or ()), **(kwargs or {}))\n\n @internalcode\n def parse(self, source, name=None, filename=None):\n \"\"\"Parse the sourcecode and return the abstract syntax tree. This\n tree of nodes is used by the compiler to convert the template into\n executable source- or bytecode. This is useful for debugging or to\n extract information from templates.\n\n If you are :ref:`developing Jinja extensions `\n this gives you a good overview of the node tree generated.\n \"\"\"\n try:\n return self._parse(source, name, filename)\n except TemplateSyntaxError:\n self.handle_exception(source=source)\n\n def _parse(self, source, name, filename):\n \"\"\"Internal parsing function used by `parse` and `compile`.\"\"\"\n return Parser(self, source, name, encode_filename(filename)).parse()\n\n def lex(self, source, name=None, filename=None):\n \"\"\"Lex the given sourcecode and return a generator that yields\n tokens as tuples in the form ``(lineno, token_type, value)``.\n This can be useful for :ref:`extension development `\n and debugging templates.\n\n This does not perform preprocessing. If you want the preprocessing\n of the extensions to be applied you have to filter source through\n the :meth:`preprocess` method.\n \"\"\"\n source = text_type(source)\n try:\n return self.lexer.tokeniter(source, name, filename)\n except TemplateSyntaxError:\n self.handle_exception(source=source)\n\n def preprocess(self, source, name=None, filename=None):\n \"\"\"Preprocesses the source with all extensions. This is automatically\n called for all parsing and compiling methods but *not* for :meth:`lex`\n because there you usually only want the actual source tokenized.\n \"\"\"\n return reduce(\n lambda s, e: e.preprocess(s, name, filename),\n self.iter_extensions(),\n text_type(source),\n )\n\n def _tokenize(self, source, name, filename=None, state=None):\n \"\"\"Called by the parser to do the preprocessing and filtering\n for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`.\n \"\"\"\n source = self.preprocess(source, name, filename)\n stream = self.lexer.tokenize(source, name, filename, state)\n for ext in self.iter_extensions():\n stream = ext.filter_stream(stream)\n if not isinstance(stream, TokenStream):\n stream = TokenStream(stream, name, filename)\n return stream\n\n def _generate(self, source, name, filename, defer_init=False):\n \"\"\"Internal hook that can be overridden to hook a different generate\n method in.\n\n .. versionadded:: 2.5\n \"\"\"\n return generate(\n source,\n self,\n name,\n filename,\n defer_init=defer_init,\n optimized=self.optimized,\n )\n\n def _compile(self, source, filename):\n \"\"\"Internal hook that can be overridden to hook a different compile\n method in.\n\n .. versionadded:: 2.5\n \"\"\"\n return compile(source, filename, \"exec\")\n\n @internalcode\n def compile(self, source, name=None, filename=None, raw=False, defer_init=False):\n \"\"\"Compile a node or template source code. The `name` parameter is\n the load name of the template after it was joined using\n :meth:`join_path` if necessary, not the filename on the file system.\n the `filename` parameter is the estimated filename of the template on\n the file system. If the template came from a database or memory this\n can be omitted.\n\n The return value of this method is a python code object. If the `raw`\n parameter is `True` the return value will be a string with python\n code equivalent to the bytecode returned otherwise. This method is\n mainly used internally.\n\n `defer_init` is use internally to aid the module code generator. This\n causes the generated code to be able to import without the global\n environment variable to be set.\n\n .. versionadded:: 2.4\n `defer_init` parameter added.\n \"\"\"\n source_hint = None\n try:\n if isinstance(source, string_types):\n source_hint = source\n source = self._parse(source, name, filename)\n source = self._generate(source, name, filename, defer_init=defer_init)\n if raw:\n return source\n if filename is None:\n filename = \"