code
stringlengths
10
805k
def_use_chains
listlengths
0
667
"""Platform for sensor integration.""" from __future__ import annotations import homeassistant.helpers.config_validation as cv import requests import voluptuous as vol from homeassistant.components.sensor import SensorEntity, PLATFORM_SCHEMA, SensorStateClass, SensorDeviceClass from homeassistant.const import CONF_USE...
[ [ [ 62, 73 ] ], [ [ 82, 127 ], [ 660, 662 ], [ 704, 706 ], [ 749, 751 ] ], [ [ 135, 143 ], [ 1227, 1235 ], [ 2795, 2803 ] ], [ [ 151, ...
import torch import numpy as np def get_sigmas(config): if config.model.sigma_dist == 'geometric': sigmas = torch.tensor( np.exp(np.linspace(np.log(config.model.sigma_begin), np.log(config.model.sigma_end), config.model.num_classes))).float().to(config.device) ...
[ [ [ 7, 12 ], [ 633, 638 ], [ 3049, 3054 ], [ 7977, 7982 ], [ 12160, 12165 ], [ 13732, 13737 ], [ 121, 126 ], [ 381, 386 ], [ 858, 863 ],...
""" User Animation Card =================== Copyright (c) 2019 Ivanov Yuri For suggestions and questions: <kivydevelopment@gmail.com> This file is distributed under the terms of the same license, as the Kivy framework. Example ------- from kivymd.app import MDApp from kivy.lang import Builder from kivy.factory imp...
[ [ [ 2454, 2459 ], [ 9846, 9851 ] ], [ [ 2487, 2496 ], [ 7891, 7900 ], [ 7998, 8007 ], [ 8121, 8130 ], [ 8231, 8240 ], [ 8357, 8366 ], [ 8730, ...
# Moduł definiujący walidatory API from marshmallow import Schema, fields, validate fields.Email.default_error_messages['required'] = 'Email jest wymagany' fields.Email.default_error_messages['invalid'] = 'Niepoprawny adres email' class VUser(Schema): # Walidator rejestracji nick = fields.String( r...
[ [ [ 60, 66 ], [ 248, 254 ], [ 606, 612 ], [ 819, 825 ], [ 916, 922 ], [ 1120, 1126 ], [ 1253, 1259 ], [ 1543, 1549 ], [ 1649, 1655 ] ]...
class Option: def __init__(self, option_info): self.option_info = option_info self.flag = option_info['flag'] def mkdir(self): if self.flag == False: return False return self.option_info['mkdir'] def dir_name(self, problem): if self.flag == False: ...
[ [ [ 6, 12 ] ] ]
import copy import torch.nn as nn from torch.quantization.fuser_method_mappings import get_fuser_method # for backward compatiblity from torch.quantization.fuser_method_mappings import fuse_conv_bn # noqa: F401 from torch.quantization.fuser_method_mappings import fuse_conv_bn_relu # noqa: F401 from typing import ...
[ [ [ 8, 12 ], [ 5310, 5314 ] ], [ [ 21, 35 ], [ 1525, 1527 ], [ 2273, 2275 ] ], [ [ 90, 106 ], [ 1336, 1352 ] ], [ [ 188, 200 ] ], [ [ ...
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
[ [ [ 1405, 1412 ] ], [ [ 1962, 1971 ] ], [ [ 1973, 1982 ] ], [ [ 1984, 1997 ] ], [ [ 2032, 2038 ] ], [ [ 2040, 2049 ] ], [ [ 2051, 2056 ] ], [ [ ...
"""Test component helpers.""" # pylint: disable=protected-access from collections import OrderedDict import unittest from homeassistant import helpers from tests.common import get_test_home_assistant class TestHelpers(unittest.TestCase): """Tests homeassistant.helpers module.""" # pylint: disable=invalid-n...
[ [ [ 89, 100 ], [ 1083, 1094 ] ], [ [ 108, 116 ], [ 222, 230 ] ], [ [ 144, 151 ], [ 929, 936 ], [ 1420, 1427 ] ], [ [ 178, 201 ], [ 400...
import pandas as pd import numpy as np def top_time(ind=None, gs=None): """ Selects the location (by coordinates) which was visited for the longest period during given time interval :param ind: user id :param gs: GeoDataFrame from groupby execution containing all the data in the given time interval :return: user...
[ [ [ 7, 19 ], [ 1371, 1373 ], [ 1414, 1416 ], [ 1798, 1800 ], [ 2133, 2135 ], [ 3678, 3680 ] ], [ [ 27, 38 ] ], [ [ 45, 53 ] ], [ [ 144...
import numpy as np np.show_config()
[ [ [ 7, 18 ], [ 20, 22 ] ] ]
from PIL import Image as im import numpy as np from io import BytesIO import csv class outputResponse(): def __init__(self,reponse): self.response = reponse def retrieveResult(response, returntype): if (returntype == "image/png" or returntype == "image/jpeg"): img_arr = np.array(i...
[ [ [ 16, 27 ], [ 319, 321 ], [ 374, 376 ] ], [ [ 36, 47 ], [ 310, 312 ] ], [ [ 63, 70 ], [ 327, 334 ] ], [ [ 78, 81 ], [ 634, 637...
import pytest import os from machaon.types.file import TextFile from machaon.types.shell import Path from machaon.core.invocation import instant_return_test, instant_context def test_construct(tmp_path): FILEPATH = Path(__file__) context = instant_context() context.define_type(TextFile) f = instant_re...
[ [ [ 7, 13 ] ], [ [ 21, 23 ] ], [ [ 56, 64 ], [ 292, 300 ], [ 392, 400 ] ], [ [ 97, 101 ], [ 221, 225 ], [ 434, 438 ], [ 488, 492...
import re # match whole string data1 = "aaab" data2 = "aaaba" pattern = r"\Aa+b\Z" match1 = re.match(pattern, data1) print(match1) match2 = re.match(pattern, data2) print(match2) # regular expression options data = "AaaA\n\raaaA" pattern = r"^(a+)$" match = re.match(pattern, data, re.I | re.M) print(match) print(m...
[ [ [ 7, 9 ], [ 95, 97 ], [ 143, 145 ], [ 263, 265 ], [ 287, 289 ], [ 294, 296 ], [ 427, 429 ], [ 522, 524 ], [ 600, 602 ] ], [ [ ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Rate', fields=[ ('id', models.AutoField(verbose...
[ [ [ 47, 63 ] ], [ [ 87, 93 ], [ 296, 302 ], [ 413, 419 ], [ 546, 552 ], [ 609, 615 ], [ 877, 883 ] ], [ [ 95, 105 ], [ 124, 134 ...
DEBUG = True ALLOWED_HOSTS = ['*', ]
[ [ [ 0, 5 ] ], [ [ 14, 27 ] ] ]
import logging import logging.handlers import sys import os import json import sqlite3 import signal import threading import time import difflib import vk_api from vk_api.longpoll import VkLongPoll, VkEventType import requests.exceptions cwd = os.path.dirname(os.path.abspath(__file__)) logging.basicConfig( format=...
[ [ [ 7, 14 ] ], [ [ 22, 38 ], [ 288, 295 ], [ 398, 405 ], [ 425, 432 ], [ 469, 476 ], [ 493, 500 ], [ 608, 615 ] ], [ [ 46, 49 ],...
""" Definition of events. """ from abc import ABC EVENT_LOG = 'eLog' #Log Event EVENT_MARKETDATA = 'eMarketData' #Pushing MarketData Event EVENT_TRADE = 'eTrade' #Trade Event EVENT_BUY = 'eBuy' #Buy Event EVENT_SELL = 'eSell' ...
[ [ [ 48, 51 ], [ 931, 934 ] ], [ [ 54, 63 ] ], [ [ 109, 125 ] ], [ [ 178, 189 ] ], [ [ 235, 244 ] ], [ [ 290, 300 ] ], [ [ 346, 358 ]...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
[ [ [ 995, 1002 ], [ 4414, 4421 ] ], [ [ 1023, 1035 ], [ 4306, 4318 ], [ 4709, 4721 ] ], [ [ 1060, 1066 ], [ 1246, 1252 ], [ 1525, 1531 ], [ ...
import pytest import io from cite_seq_count import preprocessing @pytest.fixture def data(): from collections import OrderedDict from itertools import islice # Test file paths pytest.correct_whitelist_path = 'tests/test_data/whitelists/correct.csv' pytest.correct_tags_path = 'tests/test_data/...
[ [ [ 7, 13 ], [ 68, 74 ], [ 1911, 1917 ], [ 2089, 2095 ], [ 2236, 2242 ], [ 2412, 2418 ], [ 2611, 2617 ], [ 2851, 2857 ], [ 2978, 2984 ],...
from game_data import * from hosting import ServerHandler, ClientHandler import json board = [ ["R", "K", "B", "Q", "E", "B", "K", "R"], ["P", "P", "P", "P", "P", "P", "P", "P"], [" ", " ", " ", " ", " ", " ", " ", " "], [" ", " ", " ", " ", " ", " ", " ", " "], [" ", " ", " ", " ", " ", " ", " ", "...
[ [ [ 22, 23 ], [ 476, 485 ], [ 502, 517 ], [ 544, 550 ], [ 576, 582 ], [ 620, 633 ], [ 885, 897 ], [ 1257, 1271 ], [ 1287, 1301 ], [ ...
# Pydifact - a python edifact library # # Copyright (c) 2019 Christian González # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights ...
[ [ [ 1156, 1161 ], [ 2097, 2102 ], [ 4017, 4022 ], [ 4423, 4428 ] ], [ [ 1163, 1167 ], [ 2108, 2112 ], [ 4028, 4032 ], [ 4434, 4438 ] ], [ [ ...
"""Utilities for reading real time clocks and keeping soft real time constraints.""" import gc import os import time import multiprocessing from common.clock import sec_since_boot # pylint: disable=no-name-in-module, import-error from selfdrive.hardware import PC, TICI # time step for each process DT_CTRL = 0.01 #...
[ [ [ 92, 94 ], [ 856, 858 ] ], [ [ 102, 104 ], [ 663, 665 ], [ 688, 690 ], [ 703, 705 ], [ 774, 776 ] ], [ [ 112, 116 ], [ 1615, 1619...
import os, json import shutil, logging import click from pyspark.sql.functions import lit, udf, explode, array, to_json from pyspark.sql.types import ArrayType, StringType, IntegerType, MapType, StructType, StructField from luna.common.CodeTimer import CodeTimer from luna.common.config import ConfigSet from luna.com...
[ [ [ 8, 10 ], [ 562, 564 ], [ 4163, 4165 ], [ 4245, 4247 ], [ 4333, 4335 ] ], [ [ 12, 16 ] ], [ [ 24, 30 ], [ 4216, 4222 ], [ 4303, 4...
# Copyright 2021 Supun Nakandala. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ [ [ 690, 692 ], [ 5338, 5340 ], [ 6046, 6048 ], [ 8749, 8751 ], [ 8762, 8764 ], [ 8778, 8780 ], [ 10581, 10583 ], [ 10637, 10639 ], [ 10719, ...
# labplus mPython-box library # MIT license; Copyright (c) 2018 labplus # mpython-box buildin periphers drivers # history: # V1.0 zhaohuijiang from machine import Pin, UART import time import ujson from time import sleep_ms, sleep_us, sleep # touchpad class BS8112A(object): """ """ def __init__(self, i2c)...
[ [ [ 166, 169 ], [ 8650, 8653 ], [ 8661, 8664 ] ], [ [ 171, 175 ], [ 8621, 8625 ] ], [ [ 183, 187 ], [ 1419, 1423 ], [ 1508, 1512 ], [ 9561...
import fodmc # output_mode: PyFLOSIC, NRLMOL # output_name: NameOfMolecule.xyz (for PyFLOSIC only) output_mode = ['NRLMOL','PyFLOSIC'][1] output_name = ['', 'test.xyz'][1] fodmc.fodmc_mod.get_guess(output_mode,output_name)
[ [ [ 7, 12 ], [ 178, 183 ] ], [ [ 100, 111 ], [ 204, 215 ] ], [ [ 139, 150 ], [ 216, 227 ] ] ]
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
[ [ [ 818, 826 ], [ 1134, 1142 ] ], [ [ 835, 839 ], [ 1159, 1163 ], [ 2283, 2287 ], [ 3015, 3019 ], [ 4858, 4862 ], [ 1808, 1812 ], [ 2715, ...
# Generated by Django 3.1.1 on 2020-10-19 16:09 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('maps', '0011_auto_20201019_1839'), ] operations = [ migrations.AlterField( model_name='trafficsignal', ...
[ [ [ 56, 64 ], [ 384, 392 ] ], [ [ 87, 97 ], [ 124, 134 ], [ 248, 258 ] ], [ [ 99, 105 ], [ 355, 361 ] ], [ [ 114, 123 ] ] ]
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-07-25 13:13 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('band', '0002_auto_20160725_1313'), ] operations = [...
[ [ [ 95, 111 ] ], [ [ 135, 145 ], [ 205, 215 ], [ 329, 339 ], [ 430, 440 ] ], [ [ 147, 153 ], [ 535, 541 ] ], [ [ 161, 186 ], [ 563, ...
""" Augmenters that somehow change the size of the images. List of augmenters: * :class:`Resize` * :class:`CropAndPad` * :class:`Crop` * :class:`Pad` * :class:`PadToFixedSize` * :class:`CenterPadToFixedSize` * :class:`CropToFixedSize` * :class:`CenterCropToFixedSize` * :class:`Crop...
[ [ [ 898, 912 ] ], [ [ 914, 922 ] ], [ [ 924, 939 ] ], [ [ 948, 950 ], [ 10470, 10472 ] ], [ [ 958, 967 ], [ 52435, 52444 ], [ 77863, 77872 ]...
from .common import * __all__ = ["TestReadWriteMemory"] class TestReadWriteMemory(MCPTestCase): def test_read_flash_ok(self): self.mcp.dev.read.return_value = self.xb0_00 self.assertEqual(self.mcp._read_flash(FlashDataSubcode.ChipSettings), self.xb0_00[4:14]) def test_read_sram_ok(self): ...
[ [ [ 20, 21 ], [ 84, 95 ], [ 231, 247 ], [ 415, 430 ], [ 507, 522 ], [ 726, 742 ], [ 1070, 1085 ], [ 1438, 1443 ], [ 1772, 1788 ], [ ...
#!/usr/bin/env python from decimal import Decimal, getcontext from fractions import Fraction digits = 500 getcontext().prec = digits def leibnitz(n): """ Parameters ---------- n : int Returns ------- Fraction Approximation of pi. """ pi = Fraction(0) sign = 1 for...
[ [ [ 43, 50 ], [ 1758, 1765 ], [ 1786, 1793 ] ], [ [ 52, 62 ], [ 108, 118 ] ], [ [ 85, 93 ], [ 288, 296 ], [ 365, 373 ], [ 613, 621 ...
import os.path from app.data.database import init_db, db_path, get_expected_pathname, set_path def db_exists(): return os.path.isfile(db_path) def check_db(): global db_path if (db_path != get_expected_pathname()): print('DB Check: Running backup') backup_database_to(get_expected_pathname...
[ [ [ 7, 14 ], [ 124, 126 ] ], [ [ 45, 52 ], [ 332, 339 ], [ 444, 451 ] ], [ [ 54, 61 ], [ 139, 146 ], [ 193, 200 ] ], [ [ 63, 84 ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
[ [ [ 176, 184 ] ], [ [ 192, 198 ] ], [ [ 206, 220 ], [ 471, 477 ], [ 1762, 1768 ], [ 1927, 1933 ], [ 2095, 2101 ], [ 2290, 2296 ], [ 2468, ...
import numpy as np def partition(arr, low, high): i = (low-1) # index of smaller element pivot = arr[high] # pivot for j in range(low, high): # If current element is smaller than the pivot if arr[j] < pivot: # increment index of smaller element i = i+...
[ [ [ 7, 18 ], [ 817, 819 ] ], [ [ 25, 34 ], [ 573, 582 ] ], [ [ 438, 447 ], [ 868, 877 ], [ 690, 699 ], [ 724, 733 ] ], [ [ 811, ...
#!/bin/env python3 # Steps requried to use # install requried libraries # (root)# dnf install python3-ldap3 # # Create python virtual environment directory # (user)$ python3 -m venv ./venv3 # # Enable virtual environment # (user)$ source ./venv3/bin/activate # # Update pip and then install needed libary # (user-venv3)...
[ [ [ 588, 591 ] ], [ [ 599, 603 ], [ 1261, 1265 ], [ 19224, 19228 ], [ 19662, 19666 ], [ 20024, 20028 ], [ 2340, 2344 ], [ 2648, 2652 ], [ 2669...
"""Test UPnP/IGD config flow.""" from datetime import timedelta from unittest.mock import AsyncMock, patch from homeassistant import config_entries, data_entry_flow from homeassistant.components import ssdp from homeassistant.components.upnp.const import ( CONFIG_ENTRY_SCAN_INTERVAL, CONFIG_ENTRY_ST, CONF...
[ [ [ 55, 64 ], [ 9401, 9410 ], [ 10164, 10173 ] ], [ [ 91, 100 ], [ 1376, 1385 ], [ 1467, 1476 ], [ 1570, 1579 ], [ 3912, 3921 ], [ 4003, ...
from .BSD500 import BSD500 __all__ = ('BSD500')
[ [ [ 20, 26 ] ], [ [ 27, 34 ] ] ]
week = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] print(7-week.index(input()))
[ [ [ 0, 4 ], [ 65, 69 ] ] ]
""" priorityqueue.py Priority Queue Implementation with a O(log n) Remove Method This file implements min- amd max-oriented priority queues based on binary heaps. I found the need for a priority queue with a O(log n) remove method. This can't be achieved with any of Python's built in collections including the heapq m...
[ [ [ 2287, 2307 ], [ 7009, 7029 ] ], [ [ 6988, 7008 ] ], [ [ 11454, 11461 ], [ 11466, 11473 ] ] ]
from selenium import webdriver from fixture.session import SessionHelper from fixture.group import GroupHelper from fixture.contact import ContactHelper class Application: def __init__(self, browser, base_url): if browser == "firefox": self.wd = webdriver.Firefox() elif browser == "ch...
[ [ [ 21, 30 ], [ 273, 282 ], [ 349, 358 ], [ 420, 429 ] ], [ [ 59, 72 ], [ 573, 586 ] ], [ [ 99, 110 ], [ 614, 625 ] ], [ [ 139, ...
import matplotlib.pyplot as plt from shapely.geometry import MultiLineString from .route_iterator import RouteIterator from .graphconverter import GraphConverter class TramLine(object): """Class represents single tram line for example '33: from Pilczyce to Sępolno' """ def __init__(self, number, direction_to...
[ [ [ 7, 31 ] ], [ [ 61, 76 ] ], [ [ 105, 118 ] ], [ [ 147, 161 ], [ 894, 908 ] ], [ [ 170, 178 ] ] ]
"""Hermes MQTT service for Rhasspy wakeword with snowboy""" import argparse import asyncio import dataclasses import itertools import json import logging import os import sys import typing from pathlib import Path import paho.mqtt.client as mqtt import rhasspyhermes.cli as hermes_cli from . import SnowboyModel, Wake...
[ [ [ 67, 75 ], [ 550, 558 ] ], [ [ 83, 90 ], [ 4078, 4085 ] ], [ [ 98, 109 ], [ 3308, 3319 ] ], [ [ 117, 126 ], [ 2693, 2702 ] ], [ [ ...
#!/usr/bin/env python3 import sys import yaml def main(): args = sys.argv[1:] file = args[0] if args else sys.stdin data = yaml.safe_load(file) join_args = data['Fn::Join'] contents = join_args[0].join(join_args[1]) print(contents, end='') if __name__ == '__main__': sys.exit(main())
[ [ [ 31, 34 ], [ 301, 304 ], [ 72, 75 ], [ 117, 120 ] ], [ [ 42, 46 ], [ 139, 143 ] ], [ [ 53, 57 ], [ 310, 314 ] ] ]
#!/usr/bin/env python # -*- coding: utf-8 -*- # class for windows getch class _GetchWindows: def __init__(self): import msvcrt def __call__(self): import msvcrt return msvcrt.getch() getch = _GetchWindows() # print instruction print ("Please enter something: ") # read user input an...
[ [ [ 81, 94 ], [ 228, 241 ] ], [ [ 220, 225 ], [ 341, 346 ] ], [ [ 337, 338 ], [ 385, 386 ] ] ]
import os from django.conf import settings from main.tests.test_base import MainTestCase from odk_viewer.models import ParsedInstance from odk_viewer.management.commands.remongo import Command from django.core.management import call_command from common_tags import USERFORM_ID class TestRemongo(MainTestCase): def...
[ [ [ 7, 9 ], [ 929, 931 ], [ 1281, 1283 ] ], [ [ 35, 43 ], [ 536, 544 ], [ 676, 684 ], [ 1494, 1502 ], [ 1715, 1723 ], [ 2121, 2129 ]...
from selenium import webdriver link = "http://selenium1py.pythonanywhere.com/" class TestMainPage1(): @classmethod def setup_class(self): print("\nstart browser for test suite..") self.browser = webdriver.Chrome() @classmethod def teardown_class(self): print("quit browser fo...
[ [ [ 21, 30 ], [ 223, 232 ], [ 821, 830 ] ], [ [ 32, 36 ], [ 439, 443 ], [ 602, 606 ], [ 1015, 1019 ], [ 1178, 1182 ] ], [ [ 88, 101 ...
import pytest import numpy as np import sklearn.linear_model import sklearn.model_selection import scipy.linalg from himalaya.backend import set_backend from himalaya.backend import ALL_BACKENDS from himalaya.utils import assert_array_almost_equal from himalaya.scoring import r2_score from himalaya.kernel_ridge impo...
[ [ [ 7, 13 ], [ 1048, 1054 ], [ 1103, 1109 ], [ 1397, 1403 ], [ 1452, 1458 ], [ 1718, 1724 ], [ 1772, 1778 ], [ 2034, 2040 ], [ 2097, 2103 ...
# -*- coding: utf-8 -*- """Helper functions for getting resources.""" import logging import os from dataclasses import dataclass from typing import List, Optional from urllib.request import urlretrieve logger = logging.getLogger(__name__) HERE = os.path.abspath(os.path.dirname(__file__)) DEFAULT_DIRECTORY = os.pat...
[ [ [ 79, 86 ], [ 214, 221 ] ], [ [ 94, 96 ], [ 250, 252 ], [ 266, 268 ], [ 314, 316 ], [ 330, 332 ], [ 349, 351 ], [ 360, 362 ], ...
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
[ [ [ 735, 737 ], [ 1838, 1840 ], [ 2152, 2154 ], [ 7941, 7943 ], [ 2667, 2669 ] ], [ [ 745, 747 ], [ 1051, 1053 ], [ 1119, 1121 ], [ 7086, ...
import pytest from django.conf import settings from django.contrib import messages from proposals.models import TalkProposal, TutorialProposal pytestmark = pytest.mark.skipif( not settings.PROPOSALS_WITHDRAWABLE, reason='proposal withdrawal disabled', ) def test_talk_proposal_cancel_login(client): res...
[ [ [ 7, 13 ], [ 160, 166 ], [ 784, 790 ], [ 1041, 1047 ] ], [ [ 39, 47 ], [ 188, 196 ] ], [ [ 75, 83 ], [ 2755, 2763 ], [ 3404, 3412 ...
"""Deals with making images (np arrays). It provides drawing methods that are difficult to do with the existing Python libraries. """ import numpy as np def blit(im1, im2, pos=None, mask=None): """Blit an image over another. Blits ``im1`` on ``im2`` as position ``pos=(x,y)``, using the ``mask`` if provi...
[ [ [ 142, 153 ], [ 4183, 4185 ], [ 4229, 4231 ], [ 4442, 4444 ], [ 4457, 4459 ], [ 4798, 4800 ], [ 4864, 4866 ], [ 4946, 4948 ], [ 4988, 4990...
# -*- coding: utf-8 -*- import h5py import pyre from ..Base import Base from .Identification import Identification class SLC(Base, family='nisar.productreader.slc'): ''' Class for parsing NISAR SLC products into isce structures. ''' productValidationType = pyre.properties.str(default='SLC') pr...
[ [ [ 32, 36 ], [ 750, 754 ] ], [ [ 44, 48 ], [ 279, 283 ] ], [ [ 68, 72 ], [ 127, 131 ] ], [ [ 101, 115 ], [ 895, 909 ] ], [ [ 123,...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
[ [ [ 553, 555 ], [ 587, 589 ] ], [ [ 563, 566 ], [ 568, 571 ] ], [ [ 840, 850 ] ], [ [ 1149, 1162 ] ], [ [ 1204, 1214 ] ], [ [ 1267, 1274 ...
from __future__ import print_function from __future__ import division import os import sys import time import datetime import os.path as osp import numpy as np import warnings import torch import torch.nn as nn import torch.backends.cudnn as cudnn from args import argument_parser, image_dataset_kwargs, optimizer_kwa...
[ [ [ 23, 37 ] ], [ [ 61, 69 ] ], [ [ 78, 80 ], [ 1115, 1117 ], [ 1131, 1133 ], [ 1144, 1146 ], [ 1088, 1090 ], [ 2647, 2649 ], [ 11393, ...
# Copyright (c) 2018, DjaoDjin inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
[ [ [ 2044, 2051 ], [ 2361, 2368 ] ], [ [ 2053, 2057 ], [ 4233, 4237 ] ], [ [ 2099, 2110 ], [ 2405, 2416 ] ], [ [ 2134, 2144 ], [ 4061, 4071 ] ]...
from __future__ import print_function import datetime import pickle import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request # If modifying these scopes, delete the file token.pickle. SCOPES = ['https://www.goog...
[ [ [ 23, 37 ] ], [ [ 45, 53 ] ], [ [ 61, 67 ], [ 795, 801 ], [ 1326, 1332 ] ], [ [ 75, 82 ], [ 693, 695 ] ], [ [ 121, 126 ], [ 1367...
import database def load_shard_from_db(conf): #TODO: load shard from cache if exists shards = database.load_shard(conf) return shards def get_shard(shards, url): """ Hash function for shading scheme returns a dict with hostname and table name Eg: s = { 'hostname': 'node1', 'table_name'...
[ [ [ 7, 15 ], [ 105, 113 ] ], [ [ 22, 40 ] ], [ [ 156, 165 ] ] ]
from nonebot import on_command, CommandSession @on_command('help', aliases=('h', '帮助'), only_to_me=False) async def manual(session: CommandSession): await session.send(f'[CQ:image,file=/admin/manual.png]') @manual.args_parser async def _(session: CommandSession): # do nothing return
[ [ [ 20, 30 ], [ 49, 59 ] ], [ [ 32, 46 ], [ 133, 147 ], [ 254, 268 ] ], [ [ 107, 211 ], [ 214, 220 ] ], [ [ 233, 298 ] ] ]
# Generated by Django 2.2.13 on 2020-06-30 06:51 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('pipeline', '0004_hospital'), ] operations = [ migrations.RemoveField( model_name='hospital', name='sv_name', ), ...
[ [ [ 72, 82 ], [ 101, 111 ], [ 219, 229 ] ], [ [ 91, 100 ] ] ]
""" Definition of urls for polls viewing and voting. """ from django.conf.urls import url from app.models import Poll import app.views urlpatterns = [ url(r'^$', app.views.PollListView.as_view( queryset=Poll.objects.order_by('-pub_date')[:5], context_object_name='late...
[ [ [ 91, 94 ], [ 168, 171 ], [ 410, 413 ], [ 554, 557 ], [ 708, 711 ] ], [ [ 119, 123 ], [ 242, 246 ] ], [ [ 134, 143 ], [ 188, 191 ...
# Copyright (C) 2019 NTT DATA # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ [ [ 681, 690 ], [ 1095, 1104 ], [ 1943, 1952 ] ], [ [ 698, 703 ], [ 1378, 1383 ] ], [ [ 739, 749 ], [ 1186, 1196 ], [ 2562, 2572 ] ], [ [ ...
#!/usr/bin/env python3 # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
[ [ [ 1612, 1620 ], [ 9149, 9157 ] ], [ [ 1629, 1635 ] ], [ [ 1643, 1654 ], [ 2350, 2361 ] ], [ [ 1684, 1701 ], [ 4488, 4505 ], [ 4660, 4677 ], ...
#!/usr/bin/env python3 # # Araboly 2000 Advanced Server SP4 -- everyone's favourite board game... with IRC support and fancy colours! # Copyright (c) 2018 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> # This project is licensed under the terms of the MIT licence. # from ArabolyGenerals import ArabolyGenerals f...
[ [ [ 303, 318 ], [ 1158, 1173 ], [ 1444, 1459 ], [ 2143, 2158 ], [ 3217, 3232 ], [ 3829, 3844 ], [ 3951, 3966 ], [ 4107, 4122 ], [ 4496, 4511...
import setuptools setuptools.setup( name="video_to_ascii", version="1.0.6", author="Joel Ibaceta", author_email="mail@joelibaceta.com", description="A simple tool to play a video using ascii characters", url="https://github.com/joelibaceta/video-to-ascii", packages=setuptools.find_packages(...
[ [ [ 7, 17 ], [ 19, 29 ], [ 295, 305 ] ] ]
import unittest from SDWLE.agents.trade.possible_play import PossiblePlays from SDWLE.cards import Wisp, WarGolem, BloodfenRaptor, RiverCrocolisk, AbusiveSergeant, ArgentSquire from testsSDW.agents.trade.test_helpers import TestHelpers from testsSDW.agents.trade.test_case_mixin import TestCaseMixin class TestTradeAge...
[ [ [ 7, 15 ], [ 338, 346 ] ], [ [ 61, 74 ], [ 1506, 1519 ] ], [ [ 99, 103 ], [ 466, 470 ], [ 764, 768 ] ], [ [ 105, 113 ], [ 474, ...
import numpy as np from numpy.linalg import norm from ._jit import jit @jit def J2_perturbation(t0, state, k, J2, R): r"""Calculates J2_perturbation acceleration (km/s2) .. math:: \vec{p} = \frac{3}{2}\frac{J_{2}\mu R^{2}}{r^{4}}\left [\frac{x}{r}\left ( 5\frac{z^{2}}{r^{2}}-1 \right )\vec{i} + \fr...
[ [ [ 7, 18 ], [ 1148, 1150 ], [ 2186, 2188 ], [ 3350, 3352 ], [ 3875, 3877 ], [ 3883, 3885 ], [ 3920, 3922 ], [ 3928, 3930 ], [ 3961, 3963 ...
# coding: utf-8 # # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file # except in compliance with the License. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "lice...
[ [ [ 586, 592 ], [ 1547, 1553 ] ], [ [ 600, 602 ] ], [ [ 624, 627 ] ], [ [ 635, 641 ], [ 669, 675 ] ], [ [ 659, 663 ], [ 806, 810 ] ], [ ...
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. import cohesity_management_sdk.models.exchange_database_copy_info import cohesity_management_sdk.models.exchange_database_info class ApplicationServerInfo(object): """Implementation of the 'ApplicationServerInfo' model. Specifies the Information about t...
[ [ [ 63, 121 ] ], [ [ 129, 182 ], [ 3010, 3033 ], [ 3358, 3381 ] ], [ [ 190, 211 ] ] ]
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'main_page_behavior', 'dependencies': [ '../animation/compiled_resources2.gyp:animation', '....
[]
# # coding=utf-8 import unittest import sys import os from io import open import openpyxl as xl from pptx_template.xlsx_model import _build_tsv, _format_cell_value, generate_whole_model class Cell: def __init__(self, value, number_format): self.value = value self.number_format = number_format de...
[ [ [ 24, 32 ], [ 435, 443 ], [ 2748, 2756 ] ], [ [ 40, 43 ] ], [ [ 51, 53 ], [ 1883, 1885 ], [ 1896, 1898 ], [ 1666, 1668 ], [ 1679, ...
import base64 import copy import hashlib import json from botocore.exceptions import ClientError import pytest from ..test_utils import import_lambda sdk_analysis = import_lambda( "sdk_analysis", mock_imports=[ "pulse3D.plate_recording", "pulse3D.constants", "pulse3D.excel_writer", ...
[ [ [ 7, 13 ], [ 11862, 11868 ], [ 13203, 13209 ], [ 14809, 14815 ], [ 16528, 16534 ], [ 18029, 18035 ], [ 18943, 18949 ] ], [ [ 21, 25 ], [ 663...
from typing import TypeVar, AsyncIterator, Sequence from chris.common.types import PluginUrl from chris.common.client import AuthenticatedClient from chris.common.search import get_paginated, to_sequence import chris.common.decorator as http from chris.cube.types import ComputeResourceName, PfconUrl from chris.cube.des...
[ [ [ 19, 26 ], [ 395, 402 ] ], [ [ 28, 41 ], [ 1057, 1070 ], [ 1300, 1313 ] ], [ [ 43, 51 ], [ 1583, 1591 ] ], [ [ 83, 92 ], [ 599, ...
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2020-04-07 17:42 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('crawl', '0015_remove_article_news_source'), ] operations = [ migrations.RenameField( ...
[ [ [ 94, 110 ] ], [ [ 134, 144 ], [ 163, 173 ], [ 296, 306 ] ], [ [ 153, 162 ] ] ]
# Copyright 2017 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
[ [ [ 679, 683 ], [ 1515, 1519 ] ], [ [ 1489, 1494 ] ] ]
""" artificial measure ------------------ Creation of artificial measure """ import numpy as np ############################### Create measure ################################ ############################################################################### def create_artificial_measure_array(n_k, n_vals_i, n_feats):...
[ [ [ 86, 97 ], [ 732, 734 ], [ 1261, 1263 ], [ 1388, 1390 ], [ 2303, 2305 ], [ 2435, 2437 ], [ 2501, 2503 ], [ 2516, 2518 ], [ 3456, 3458 ...
from .prettifier import prettify from .prettifier.common import assert_prettifier_works import pytoml def test_prettifying_against_humanly_verified_sample(): toml_source = open('sample.toml').read() expected = open('sample-prettified.toml').read() assert_prettifier_works(toml_source, expected, prettify)...
[ [ [ 25, 33 ], [ 311, 319 ] ], [ [ 65, 88 ], [ 264, 287 ] ], [ [ 96, 102 ], [ 332, 338 ], [ 361, 367 ] ], [ [ 109, 157 ] ] ]
# coding: utf-8 """ Mux API Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. # noqa: E501 The version of the OpenAPI document: v1 Generated by: https://openapi-g...
[ [ [ 347, 354 ], [ 2230, 2237 ] ], [ [ 362, 368 ], [ 3180, 3186 ] ], [ [ 376, 378 ] ], [ [ 400, 403 ], [ 2476, 2479 ] ], [ [ 442, 455 ], ...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
[ [ [ 522, 527 ], [ 2775, 2780 ] ], [ [ 535, 537 ], [ 3813, 3815 ], [ 4180, 4182 ], [ 17284, 17286 ], [ 17580, 17582 ] ], [ [ 545, 547 ], [ ...
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary for...
[ [ [ 1902, 1906 ], [ 2737, 2741 ] ], [ [ 1908, 1916 ], [ 2850, 2858 ] ], [ [ 1952, 1960 ], [ 3132, 3140 ] ], [ [ 1962, 1975 ], [ 2743, 2756 ], ...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import collections import os import pickle import re...
[ [ [ 275, 286 ], [ 3526, 3537 ], [ 4037, 4048 ], [ 4508, 4519 ] ], [ [ 294, 296 ], [ 1384, 1386 ], [ 2872, 2874 ], [ 2920, 2922 ], [ 5100, ...
# Copyright 2015 Hewlett-Packard # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
[ [ [ 638, 645 ], [ 7841, 7848 ] ], [ [ 668, 671 ], [ 963, 966 ] ], [ [ 699, 703 ], [ 3481, 3485 ] ], [ [ 732, 744 ], [ 1015, 1027 ] ], [ ...
# coding=utf-8 from common.BNFParser import * from common.Grammar import Grammar # 求文法G的可空变量集 # 该算法只跟G的P有关系 def algo_6_3(P): """ 测试数据来源于第6章习题12(2) >>> from common.production import Production >>> p1 = Production(['S'], [['A', 'B', 'D', 'C']]) >>> p2 = Production(['A'], [['B', 'D'], ['\\"a\\"', '\...
[ [ [ 44, 45 ], [ 703, 713 ], [ 812, 822 ] ], [ [ 73, 80 ] ], [ [ 113, 121 ] ] ]
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def HostFileSystemVolume(vim, *args, **kwargs): '''Detailed information about a file syst...
[ [ [ 8, 15 ], [ 198, 205 ] ], [ [ 47, 67 ], [ 1147, 1167 ] ], [ [ 192, 195 ] ], [ [ 231, 251 ] ] ]
#!../bin/python3 # -*- coding:utf-8 -*- """ Copyright 2021 Jerome DE LUCCHI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless ...
[ [ [ 643, 645 ], [ 767, 769 ], [ 780, 782 ], [ 845, 847 ], [ 1313, 1315 ], [ 1705, 1707 ] ], [ [ 653, 656 ], [ 697, 700 ], [ 1942, 1945 ...
# ext/declarative/__init__.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .api import declarative_base, synonym_for, comparable_using, \ ...
[ [ [ 265, 281 ] ], [ [ 283, 294 ] ], [ [ 296, 312 ] ], [ [ 320, 342 ] ], [ [ 344, 356 ] ], [ [ 358, 378 ] ], [ [ 386, 401 ] ], [ [ 403, ...
# Author: Christian Brodbeck <christianbrodbeck@nyu.edu> import pickle from nose.tools import eq_ import numpy as np from numpy.testing import assert_array_equal from eelbrain import datasets from eelbrain._stats.spm import LM, LMGroup def test_lm(): ds = datasets.get_uts() model = ds.eval("A*B*Y") coeff...
[ [ [ 64, 70 ], [ 1507, 1513 ], [ 1520, 1526 ], [ 1538, 1544 ] ], [ [ 94, 97 ], [ 392, 395 ], [ 825, 828 ], [ 985, 988 ], [ 1115, 1118 ...
# Copyright 2017 The Armada Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
[ [ [ 614, 628 ], [ 651, 665 ] ], [ [ 637, 650 ], [ 829, 842 ], [ 1015, 1028 ], [ 1190, 1203 ], [ 1379, 1392 ], [ 1538, 1551 ] ], [ [ 804, ...
import numpy as np import tensorflow as tf from common.shared_functions import dot_or_lookup, glorot_variance, make_tf_variable, make_tf_bias from encoders.message_gcns.message_gcn import MessageGcn class BasisGcn(MessageGcn): def parse_settings(self): self.dropout_keep_probability = float(self.settings...
[ [ [ 7, 18 ] ], [ [ 26, 42 ], [ 1845, 1847 ], [ 1887, 1889 ], [ 1964, 1966 ], [ 2008, 2010 ], [ 2239, 2241 ], [ 2336, 2338 ], [ 2820, 282...
import hashlib import datetime import json import uuid from hashlib import sha256 from sys import version_info as pyVersion from binascii import hexlify, unhexlify from wallet import * from func.send_message import send_message from func.send_coin import send_coin from func.node_connection import * from lib...
[ [ [ 7, 14 ] ], [ [ 22, 30 ] ], [ [ 38, 42 ] ], [ [ 51, 55 ] ], [ [ 77, 83 ] ], [ [ 102, 127 ] ], [ [ 149, 156 ] ], [ [ 158, 167 ...
import numpy as np import cv2 def make_colorwheel(): ''' Generates a color wheel for optical flow visualization as presented in: Baker et al. "A Database and Evaluation Methodology for Optical Flow" (ICCV, 2007) URL: http://vision.middlebury.edu/flow/flowEval-iccv07.pdf According to the C...
[ [ [ 7, 18 ], [ 546, 548 ], [ 645, 647 ], [ 660, 662 ], [ 751, 753 ], [ 766, 768 ], [ 927, 929 ], [ 942, 944 ], [ 1033, 1035 ], [ ...
r""" `torch.distributed.launch` is a module that spawns up multiple distributed training processes on each of the training nodes. The utility can be used for single-node distributed training, in which one or more processes per node will be spawned. The utility can be used for either CPU training or GPU training. If th...
[ [ [ 5261, 5264 ], [ 8711, 8714 ], [ 8835, 8838 ] ], [ [ 5272, 5282 ], [ 9021, 9031 ], [ 9202, 9212 ] ], [ [ 5290, 5292 ], [ 8189, 8191 ] ], [ ...
# -*- coding: utf-8 -*- from bamboo_engine.builder import * # noqa from bamboo_engine.engine import Engine from pipeline.eri.runtime import BambooDjangoRuntime from ..utils import * # noqa def test_retry_subprocess(): subproc_start = EmptyStartEvent() subproc_act = ServiceActivity(component_code="debug_no...
[ [ [ 59, 60 ] ], [ [ 102, 108 ], [ 721, 727 ] ], [ [ 142, 161 ], [ 728, 747 ] ], [ [ 183, 184 ], [ 244, 259 ], [ 280, 295 ], [ 343, ...
""" Cross-validation with blocks. """ __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "3-clause BSD" __maintainer__ = "Steven Kearnes" from theano.compat.six.moves import xrange from pylearn2.blocks import StackedBlocks class StackedBlocksCV(object): """ Mul...
[ [ [ 39, 49 ] ], [ [ 69, 82 ] ], [ [ 123, 134 ] ], [ [ 152, 166 ] ], [ [ 223, 229 ], [ 855, 861 ] ], [ [ 258, 271 ], [ 1027, 1040 ] ], ...
# Generated by Django 2.2.1 on 2019-05-12 08:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('leads', '0004_lead_documentstagecode'), ] operations = [ migrations.AlterField( model_name='lead', name='email', ...
[ [ [ 71, 81 ], [ 108, 118 ], [ 237, 247 ], [ 400, 410 ] ], [ [ 83, 89 ], [ 335, 341 ], [ 497, 503 ] ], [ [ 98, 107 ] ] ]
import asyncio import json import logging import socket import time import traceback from pathlib import Path from typing import Callable, Dict, List, Optional, Set, Tuple, Union from blspy import PrivateKey from chia.consensus.block_record import BlockRecord from chia.consensus.blockchain_interface import BlockchainI...
[ [ [ 7, 14 ], [ 3560, 3567 ], [ 4850, 4857 ], [ 7026, 7033 ], [ 7490, 7497 ], [ 9003, 9010 ], [ 9856, 9863 ], [ 9940, 9947 ], [ 9981, 9988 ...
from phiqnet.train.train import train_main if __name__ == '__main__': args = {} args['multi_gpu'] = 0 args['gpu'] = 0 args['result_folder'] = r'..\databases\experiments\koniq_small' args['n_quality_levels'] = 1 args['train_folders'] = [#r'..\databases\train\koniq_normal', ...
[ [ [ 32, 42 ], [ 1158, 1168 ] ], [ [ 75, 79 ], [ 89, 93 ], [ 115, 119 ], [ 136, 140 ], [ 204, 208 ], [ 238, 242 ], [ 428, 432 ], ...
import anchor name = 'anchor'
[ [ [ 7, 13 ] ], [ [ 15, 19 ] ] ]
# web_app/__init__.py from flask import Flask from web_app.models import db, migrate from web_app.routes.home_routes import home_routes from web_app.routes.book_routes import book_routes DATABASE_URI = "sqlite:///twitoff_class.db" # using relative filepath #DATABASE_URI = "sqlite:////Users/Username/Desktop/your-repo...
[ [ [ 41, 46 ], [ 605, 610 ] ], [ [ 75, 77 ], [ 740, 742 ], [ 783, 785 ] ], [ [ 79, 86 ], [ 761, 768 ] ], [ [ 126, 137 ], [ 815, 8...
from flask import jsonify, request, url_for, abort from app import db from app.api import bp from app.api.auth import token_auth from app.api.errors import bad_request from app.models import User @bp.route('/users/<int:id>', methods=['GET']) @token_auth.login_required def get_user(id): return jsonify(User.query.ge...
[ [ [ 18, 25 ], [ 299, 306 ], [ 634, 641 ], [ 1051, 1058 ], [ 1464, 1471 ], [ 2097, 2104 ], [ 2933, 2940 ] ], [ [ 27, 34 ], [ 437, 444 ...