code stringlengths 10 805k | def_use_chains listlengths 0 667 |
|---|---|
""" parquet compat """
from __future__ import annotations
import io
import os
from typing import Any
from warnings import catch_warnings
from pandas._typing import (
FilePath,
ReadBuffer,
StorageOptions,
WriteBuffer,
)
from pandas.compat._optional import import_optional_dependency
from pandas.errors i... | [
[
[
46,
57
]
],
[
[
66,
68
],
[
14464,
14466
],
[
14772,
14774
]
],
[
[
76,
78
],
[
2674,
2676
],
[
11128,
11130
]
],
[
[
98,
101
],
[
... |
from builtins import zip
from builtins import range
from builtins import object
import re
import csv
import unicodecsv
from bs4 import BeautifulSoup
from openelex.base.load import BaseLoader
from openelex.models import RawResult
from openelex.lib.text import ocd_type_id, slugify
from .datasource import Datasource
cl... | [
[
[
21,
24
],
[
16391,
16394
]
],
[
[
46,
51
],
[
21021,
21026
]
],
[
[
73,
79
],
[
336,
342
],
[
916,
922
]
],
[
[
87,
89
],
[
15594,... |
""" If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.
The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
"""
def mul_sum(a: int=3, b: int=5):
max_num = 1000
all_nums = [x for x in range(1, max_num) if (x % 3 == 0) | (x % 5 ==... | [
[
[
199,
206
],
[
392,
399
]
],
[
[
383,
389
],
[
412,
418
]
]
] |
from ..adapter import CustomSocialAccountAdapter
def test_authentication_error_logs(mocker):
mocker.patch(
"allauth.socialaccount.adapter.DefaultSocialAccountAdapter.authentication_error"
) # noqa
error = mocker.patch("{{cookiecutter.project_slug}}.multisalesforce.adapter.logger.error")
adapt... | [
[
[
22,
48
],
[
325,
351
]
],
[
[
55,
85
]
]
] |
from pydantic import BaseSettings
class Settings(BaseSettings):
APP_ENDPOINT: str = 'localhost:8080'
CONFIG_PATH: str = None
DATACENTER_ID: int = 0
WORKER_ID: int = 0
| [
[
[
21,
33
],
[
51,
63
]
],
[
[
42,
50
]
]
] |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'offline.settings')
try:
from django.core.management import execute_from_command_line
except Impo... | [
[
[
91,
93
],
[
159,
161
]
],
[
[
101,
104
],
[
613,
616
]
],
[
[
111,
115
],
[
656,
660
]
]
] |
import os
from PIL import Image
#Vérification
rep_cour=os.getcwd()
if rep_cour!="C:\Documents and Settings\Administrateur\Bureau\ISN/trait_img":
os.chdir("C:\Documents and Settings\Administrateur\Bureau\ISN/trait_img")
print(os.getcwd())
print("Tout est en ordre!")
#Paramètres de l'image + son affichage... | [
[
[
7,
9
],
[
56,
58
],
[
155,
157
],
[
239,
241
]
],
[
[
26,
31
],
[
355,
360
],
[
633,
638
],
[
972,
977
],
[
1058,
1063
],
[
... |
# -*- coding: utf-8 -*-
"""Test sequences for graphiness.
"""
# Copyright (C) 2004-2018 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import heapq
import networkx as nx
__author__ = "\n".join(['Aric Hagberg... | [
[
[
255,
260
],
[
11648,
11653
],
[
11676,
11681
],
[
11935,
11940
],
[
12272,
12277
],
[
12377,
12382
],
[
12823,
12828
],
[
12888,
12893
],
[
12... |
import logging
import operator
import time
import traceback
from pathlib import Path
from typing import List, Type, Set, Tuple, Optional
from PyQt5.QtCore import QEvent, Qt, pyqtSignal
from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QCursor
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QCheckBox, QHeaderVi... | [
[
[
7,
14
],
[
3403,
3410
]
],
[
[
22,
30
],
[
61728,
61736
],
[
62010,
62018
]
],
[
[
38,
42
],
[
60259,
60263
]
],
[
[
50,
59
],
[
5... |
from fastapi import FastAPI
from fastapi.testclient import TestClient
app = FastAPI()
@app.get("/api/v1/healthcheck")
async def read_main():
return "OK"
@app.post("/api/v1/query")
async def query():
return [{"event_date": "20210105"}]
client = TestClient(app)
def test_read_main():
response = client.g... | [
[
[
20,
27
],
[
77,
84
]
],
[
[
59,
69
],
[
257,
267
]
],
[
[
71,
74
],
[
89,
92
],
[
161,
164
],
[
268,
271
]
],
[
[
120,
158
... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from yandex.cloud.datasphere.v1 import app_token_service_pb2 as yandex_dot_cloud_dot_... | [
[
[
153,
157
],
[
1165,
1169
],
[
1427,
1431
],
[
1791,
1795
],
[
2422,
2426
]
],
[
[
187,
234
],
[
884,
918
],
[
1688,
1722
],
[
2660,
... |
import pytest
@pytest.mark.usefixtures("smart_setup")
class TestObjectValue:
def test_get_sheet_object_value(self, smart_setup):
smart = smart_setup['smart']
sheet = smart.Sheets.get_sheet(smart_setup['sheet'].id, include='objectValue')
assert isinstance(sheet.rows[0].cells[0].object_valu... | [
[
[
7,
13
],
[
17,
23
]
],
[
[
62,
77
]
]
] |
import random
import time
class Athlete():
name = ""
health = 100
def __init__(self, newName):
self.name = newName
print("На ринге появляется новый боец, его имя - ", self.name )
print()
def punch(self, other):
time.sleep(1)
print(self.name, "наносит удар бойцу ", other.name)
other.health -= 20
... | [
[
[
7,
13
],
[
580,
586
]
],
[
[
21,
25
],
[
231,
235
]
],
[
[
34,
41
],
[
424,
431
],
[
455,
462
]
],
[
[
413,
421
],
[
482,
49... |
import bagel
import numpy as np
from sklearn.metrics import precision_recall_curve
from typing import Sequence, Tuple, Dict, Optional
def _adjust_scores(labels: np.ndarray,
scores: np.ndarray,
delay: Optional[int] = None,
inplace: bool = False) -> np.ndarray:
... | [
[
[
7,
12
],
[
2699,
2704
],
[
3033,
3038
]
],
[
[
20,
31
],
[
308,
310
],
[
164,
166
],
[
203,
205
],
[
327,
329
],
[
347,
349
],
... |
"""
This is a library for defining and using particle filters.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with... | [
[
[
423,
427
],
[
2393,
2397
]
],
[
[
451,
465
],
[
985,
999
]
],
[
[
516,
524
],
[
2491,
2499
]
],
[
[
526,
541
],
[
2532,
2547
]
],
[
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Mayo Clinic
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list... | [
[
[
1581,
1592
],
[
1748,
1759
]
],
[
[
1599,
1607
],
[
1859,
1867
]
],
[
[
1730,
1734
],
[
1959,
1963
]
]
] |
from .connection import Connection
| [
[
[
24,
34
]
]
] |
#Split one picture
import cv2
import numpy.random as random
import numpy as np
import os
import time
#borders
#mitochondria
#mitochondria borders
#PSD
#vesicles
def is_Img(name):
img_type = ('.png', '.jpg', '.jpeg')
if name.endswith((img_type)):
return True
else:
return False
file_dir_arr = ["axon", "mitocho... | [
[
[
27,
30
],
[
866,
869
],
[
1341,
1344
],
[
1602,
1605
],
[
2537,
2540
]
],
[
[
38,
60
]
],
[
[
68,
79
],
[
1805,
1807
],
[
1847,
... |
"""payu.cli
========
Command line interface tools
:copyright: Copyright 2011 Marshall Ward, see AUTHORS for details.
:license: Apache License, Version 2.0, see LICENSE for details
"""
import argparse
from distutils import sysconfig
import importlib
import os
import pkgutil
import shlex
import subprocess
... | [
[
[
206,
214
],
[
972,
980
]
],
[
[
237,
246
],
[
2537,
2546
]
],
[
[
254,
263
],
[
870,
879
]
],
[
[
271,
273
],
[
1969,
1971
],
[
19... |
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def create_user(self, email, name, password=None):
""" Create a new user p... | [
[
[
22,
28
],
[
993,
999
],
[
1051,
1057
],
[
1100,
1106
],
[
1149,
1155
],
[
1602,
1608
],
[
1670,
1676
],
[
1735,
1741
],
[
1776,
1782
... |
import dash
import dash_bootstrap_components as dbc
# bootstrap theme
# https://bootswatch.com/lux/
external_stylesheets = [dbc.themes.YETI]
app = dash.Dash(__name__, external_stylesheets=external_stylesheets,
suppress_callback_exceptions=True)
server = app.server | [
[
[
7,
11
],
[
149,
153
]
],
[
[
19,
51
],
[
125,
128
]
],
[
[
101,
121
],
[
190,
210
]
],
[
[
143,
146
],
[
272,
275
]
],
[
[
263... |
# coding: utf-8
__author__ = 'cleardusk'
import os.path as osp
import time
import numpy as np
import cv2
import torch
from torchvision.transforms import Compose
import torch.backends.cudnn as cudnn
import _3DDFA_V2.models as models
from _3DDFA_V2.bfm import BFMModel
from _3DDFA_V2.utils.io import _load
from _3DDFA_V... | [
[
[
17,
27
]
],
[
[
50,
64
],
[
567,
570
],
[
576,
579
],
[
588,
591
]
],
[
[
72,
76
],
[
3683,
3687
],
[
3775,
3779
]
],
[
[
84,
... |
import sys
def sol():
input = sys.stdin.readline
N = int(input())
node = [[] for i in range(N)]
for i in range(N):
vector = list(map(int, input().split(" ")))
for j in range(N):
if vector[j] == 1:
node[i].append(j)
for i in range(N):
visited = ["... | [
[
[
7,
10
],
[
36,
39
]
],
[
[
17,
20
],
[
980,
983
]
],
[
[
397,
400
]
],
[
[
809,
812
],
[
336,
339
],
[
925,
928
]
]
] |
from .._sign.sphincs_sha256_128f_robust import ffi as __ffi, lib as __lib
from .common import _sign_generate_keypair_factory, _sign_sign_factory, _sign_verify_factory
PUBLIC_KEY_SIZE = __lib.CRYPTO_PUBLICKEYBYTES
SECRET_KEY_SIZE = __lib.CRYPTO_SECRETKEYBYTES
SIGNATURE_SIZE = __lib.CRYPTO_BYTES
generate_keypair = _sig... | [
[
[
47,
59
],
[
347,
352
],
[
387,
392
],
[
431,
436
]
],
[
[
61,
73
],
[
186,
191
],
[
232,
237
],
[
277,
282
],
[
354,
359
],
... |
from n0s3p4ss.domain_list import SubdomainList
from n0s3p4ss.attack_surface_discoverer import discover
from n0s3p4ss.sniffer_switcher_http_status_based import apply_flow_for
def sniff(target_domains):
subdomains = SubdomainList().list_each_domain_subdomains(target_domains)
attack_surfaces = [discover(subdomai... | [
[
[
33,
46
],
[
220,
233
]
],
[
[
94,
102
],
[
303,
311
]
],
[
[
159,
173
],
[
373,
387
]
],
[
[
180,
185
]
]
] |
import DBinterface as DB
import random
import datetime as dt
def print_ranking(my_ranking,ranking_size,top_or_bottom):
Tweet=""
if top_or_bottom == True:
Tweet += ("The first " + ranking_size + " cities with more CO2 emissions due to traffic are: \r\n ")
else:
Tweet += ("The first " ... | [
[
[
7,
24
],
[
666,
668
]
],
[
[
32,
38
],
[
706,
712
],
[
748,
754
]
],
[
[
47,
61
]
],
[
[
67,
80
],
[
855,
868
]
],
[
[
638,
... |
from experiments.experiments.PubIntegBackground import PubIntegBackground
import numpy as np
if __name__ == "__main__":
for i in np.arange(0.0, 10.0, 0.1):
PubIntegBackground(correlation=False, listing=True, pub='None', intensity=i)
| [
[
[
55,
73
],
[
169,
187
]
],
[
[
81,
92
],
[
134,
136
]
],
[
[
129,
130
],
[
243,
244
]
]
] |
import logging
from typing import Any, Dict, List, Union
import bleach
import cssutils
import markdown
from django.conf import settings
from django.core.mail import EmailMultiAlternatives, get_connection
from django.template.loader import get_template
from django.utils.translation import ugettext as _
from i18nfield.s... | [
[
[
7,
14
],
[
595,
602
],
[
703,
710
]
],
[
[
34,
37
],
[
951,
954
]
],
[
[
39,
43
],
[
941,
945
]
],
[
[
45,
49
],
[
5644,
564... |
# Time: O(n)
# Space: O(1)
class Solution(object):
# @param {integer[]} nums
# @return {integer[]}
def productExceptSelf(self, nums):
if not nums:
return []
left_product = [1 for _ in xrange(len(nums))]
for i in xrange(1, len(nums)):
left_product[i] = left_... | [
[
[
35,
43
]
]
] |
# 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 or agreed to in... | [
[
[
605,
616
],
[
8187,
8198
],
[
9073,
9084
]
],
[
[
646,
656
],
[
12238,
12248
]
],
[
[
697,
709
],
[
4722,
4734
],
[
5056,
5068
],
[
51... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.apps.settings.app import Settings
class TestChangeLanguage(GaiaTestCas... | [
[
[
221,
233
],
[
309,
321
]
],
[
[
273,
281
],
[
824,
832
]
],
[
[
290,
308
]
]
] |
# esle stmt
# using else block after for loop
s = 0
for i in range(1, 6):
s += i
else:
print("end of for loop!")
print("sum =",s)
# using else blokc after while loop
r = n = 1
while n <= 5:
r *= n
n += 1
else:
print("end of while loop!")
print("5! = " + str(r))
if r==3:
... | [
[
[
48,
49
],
[
82,
83
]
],
[
[
59,
60
],
[
87,
88
]
],
[
[
189,
190
],
[
303,
304
],
[
219,
220
],
[
313,
314
]
],
[
[
193,
194... |
# Generated by Django 3.0.3 on 2020-04-22 13:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0018_auto_20200422_1314'),
]
operations = [
migrations.AlterField(
model_name='user_movie',
name='insert_dat... | [
[
[
71,
81
],
[
108,
118
],
[
232,
242
]
],
[
[
83,
89
],
[
342,
348
]
],
[
[
98,
107
]
]
] |
import os
import re
import subprocess
import logging
"""
Uses command line pdfinfo utility (from poppler pakage) for various
small operations (e.g. get pdf page count).
"""
logger = logging.getLogger(__name__)
def get_pagecount(filepath):
"""
Returns the number of pages in a PDF document as integer.
fi... | [
[
[
7,
9
],
[
385,
387
],
[
484,
486
],
[
593,
595
]
],
[
[
17,
19
],
[
1702,
1704
]
],
[
[
27,
37
],
[
1105,
1115
],
[
1149,
1159
... |
from .models import Restriction
from django.db.models.signals import post_save
from django.dispatch import receiver
@receiver(post_save, sender=Restriction)
def post_save_restriction(sender, **kwargs):
msg = "worked"
pass
| [
[
[
20,
31
],
[
146,
157
]
],
[
[
69,
78
],
[
128,
137
]
],
[
[
107,
115
],
[
119,
127
]
],
[
[
163,
184
]
]
] |
#!/usr/bin/python
from flask import Flask, request, flash, redirect, render_template, jsonify
from flaskext.mysql import MySQL
from flask_wtf import Form
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired
import twilio.twiml
import random
import requests
import json
import omdb
... | [
[
[
37,
42
],
[
1460,
1465
]
],
[
[
44,
51
],
[
6471,
6478
],
[
20789,
20796
],
[
23016,
23023
],
[
23169,
23176
],
[
23268,
23275
]
],
[
[
... |
AMOUNTS = [
99999999999999999999999999999,
0x0,
0x1,
0x1000000000000000000000000,
0x30000000000000,
1000000000000000000,
0x180000000000000,
100000000000000000,
10000000000000000,
1000000000000000,
0x2,
5000000000000000,
0x20,
0x700000000000000,
0x8,
0x3c00... | [
[
[
0,
7
]
]
] |
"""
Collection of functions to assist PyDoof modules.
"""
from collections import Iterable
from datetime import date
from enum import Enum
def parse_query_params(params):
"""
Parses a query-parameters dictionary into their proper parameters schema.
Each key value of the dictionary represents a parameter ... | [
[
[
82,
90
],
[
1337,
1345
]
],
[
[
112,
116
],
[
976,
980
]
],
[
[
134,
138
],
[
1230,
1234
]
],
[
[
145,
163
]
],
[
[
900,
912
],
[
... |
# coding=utf-8
# flake8: noqa E302
"""
Test plugin infrastructure and hooks.
"""
import sys
import pytest
# Python 3.5 had some regressions in the unitest.mock module, so use 3rd party mock if available
try:
import mock
except ImportError:
from unittest import mock
import cmd2
from cmd2 import plugin
class... | [
[
[
88,
91
],
[
10017,
10020
],
[
10438,
10441
],
[
11308,
11311
],
[
11731,
11734
]
],
[
[
100,
106
],
[
9511,
9517
],
[
9699,
9705
],
[
1079... |
import json
import os
from FastAutoAugment.common.common import get_logger, common_init, expdir_abspath
from FastAutoAugment.data_aug.train import train_and_eval
if __name__ == '__main__':
conf = common_init(config_filepath='confs/aug_train_cifar.yaml',
param_args=["--autoaug.loader.aug", "... | [
[
[
7,
11
],
[
1226,
1230
]
],
[
[
19,
21
]
],
[
[
64,
74
],
[
435,
445
]
],
[
[
76,
87
],
[
202,
213
]
],
[
[
89,
103
],
[
501,
... |
# coding: utf-8
"""
ESPER API REFERENCE
OpenAPI spec version: 1.0.0
Contact: developer@esper.io
---------------------------------------------------------
Copyright 2019 Shoonya Enterprises Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... | [
[
[
736,
742
],
[
5062,
5068
]
],
[
[
750,
752
]
],
[
[
761,
764
],
[
4129,
4132
]
],
[
[
809,
819
]
],
[
[
828,
846
],
[
4833,
4851
],
... |
from . import Link
def iterate_words(lines):
for line in lines:
words = line.split()
if len(words) == 0:
continue
for word in words[:-1]:
yield word, is_stop_word(word)
yield words[-1], True # EOL is considered a stop word
def is_stop_word(word):
return... | [
[
[
14,
18
],
[
684,
688
]
],
[
[
24,
37
],
[
473,
486
],
[
647,
660
]
],
[
[
290,
302
],
[
204,
216
]
],
[
[
378,
386
]
]
] |
from django.shortcuts import render
from catalog.models import Book, Author, BookInstance, Genre
from django.contrib.auth.mixins import LoginRequiredMixin
def index(request):
"""View function for home page of site."""
# Generate counts of some of the main objects
num_books = Book.objects.all().count()
... | [
[
[
29,
35
],
[
1077,
1083
],
[
1485,
1491
],
[
4182,
4188
]
],
[
[
63,
67
],
[
1209,
1213
],
[
1290,
1294
],
[
4842,
4846
],
[
292,
296... |
import enum
@enum.unique
class Flag(enum.IntEnum):
NOT_NULL = 1
PRI_KEY = 2
UNIQUE_KEY = 4
MULTIPLE_KEY = 8
BLOB = 16
UNSIGNED = 32
ZEROFILL = 64
BINARY = 128
ENUM = 256
AUTO_INCREMENT = 512
TIMESTAMP = 1024
SET = 2048
PART_KEY = 16384
GROUP = 32767
UNIQUE =... | [
[
[
7,
11
],
[
38,
42
],
[
15,
19
]
],
[
[
33,
37
]
]
] |
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
from distutils.version import StrictVersion
import logging as log
import os
import re
import shlex
import subprocess
import sys
# Di... | [
[
[
178,
186
],
[
13498,
13506
]
],
[
[
217,
230
],
[
5517,
5530
],
[
6144,
6157
]
],
[
[
238,
252
],
[
352,
355
],
[
374,
377
],
[
13723,... |
# -*- coding: utf-8 -*-
# @Time : 2020/10/11 上午10:58
# @Author : TaoWang
# @Description : 参数配置
import argparse
def ArgumentParser():
parser = argparse.ArgumentParser()
parser.add_argument('--embed_size', type=int, default=300, help="embedding size of word embedding")
parser.add_argument("--epoch",type=i... | [
[
[
104,
112
],
[
150,
158
]
],
[
[
119,
133
]
]
] |
"""
The ``mlflow.pytorch`` module provides an API for logging and loading PyTorch models. This module
exports PyTorch models with the following flavors:
PyTorch (native) format
This is the main flavor that can be loaded back into PyTorch.
:py:mod:`mlflow.pyfunc`
Produced for use by generic pyfunc-based deploym... | [
[
[
362,
371
],
[
24519,
24528
]
],
[
[
379,
386
],
[
1651,
1658
]
],
[
[
394,
396
],
[
19511,
19513
],
[
19540,
19542
],
[
19696,
19698
],
[
... |
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Placeholder Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee R... | [
[
[
830,
845
],
[
4776,
4791
]
],
[
[
888,
907
],
[
1220,
1239
]
],
[
[
935,
945
],
[
13204,
13214
],
[
13242,
13252
]
],
[
[
982,
994
],
[
... |
"""The Amazon Redshift dialect.
This is based on postgres dialect, since it was initially based off of Postgres 8.
We should monitor in future and see if it should be rebased off of ANSI
"""
from sqlfluff.core.parser import (
OneOf,
AnyNumberOf,
AnySetOf,
Anything,
Ref,
Sequence,
Bracketed,... | [
[
[
231,
236
],
[
3653,
3658
],
[
3751,
3756
],
[
3837,
3842
],
[
4931,
4936
],
[
5046,
5051
],
[
5733,
5738
],
[
7389,
7394
],
[
7462,
7467... |
import os
import cv2
import imutils
import numpy as np
from imutils import contours
from imutils import perspective
from scipy.spatial import distance as dist
def detect_shape(filepath, min_width=15, debug=False):
image = cv2.imread(filepath, 0)
resized = imutils.resize(image, width=300)
ratio = image.sh... | [
[
[
7,
9
]
],
[
[
17,
20
],
[
228,
231
],
[
498,
501
],
[
553,
556
],
[
593,
596
],
[
619,
622
],
[
656,
659
],
[
681,
684
],
[
... |
import numpy as np
def euclidean_distance(p1,p2):
"""
returns euclidean distance between matrices
@params:
p1, p2: np.ndarray
matrices to perform operation to.
"""
return np.sqrt(np.sum((p1-p2)**2, axis=1))
def entropy(p):
"""
Will be our measurement for uncertainty in our construction
of descisio... | [
[
[
7,
18
],
[
184,
186
],
[
192,
194
],
[
433,
435
],
[
456,
458
]
],
[
[
25,
43
]
],
[
[
226,
233
]
],
[
[
478,
494
]
]
] |
from django.contrib import admin
from friends.models import FriendRequest
# Register your models here.
admin.site.register(FriendRequest) | [
[
[
27,
32
],
[
104,
109
]
],
[
[
60,
73
],
[
124,
137
]
]
] |
import _plotly_utils.basevalidators
class ConnectgapsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="connectgaps", parent_name="scattermapbox", **kwargs
):
super(ConnectgapsValidator, self).__init__(
plotly_name=plotly_name,
pa... | [
[
[
7,
35
],
[
65,
78
]
],
[
[
44,
64
],
[
231,
251
]
]
] |
#!/bin/python3
__author__ = "Adam Karl"
"""Find the sum of all primes less than or equal to N"""
#https://projecteuler.net/problem=10
from math import sqrt
isPrime = []
def sieve(n):
"""fills isPrime array with booleans for whether the number at isPrime[i] is prime or not"""
"""uses a process known as the s... | [
[
[
16,
26
]
],
[
[
153,
157
]
],
[
[
159,
166
],
[
992,
999
]
],
[
[
177,
182
],
[
1156,
1161
]
],
[
[
809,
818
],
[
1206,
1215
]
],
[
... |
import torch
from syft.generic import object_storage
def test_clear_objects():
obj_storage = object_storage.ObjectStorage()
x = torch.tensor(1)
obj_storage.set_obj(x)
objs = obj_storage.current_objects()
assert len(objs) == 1
assert objs[x.id] == x
ret_val = obj_storage.clear_objects(... | [
[
[
7,
12
],
[
140,
145
],
[
522,
527
]
],
[
[
39,
53
],
[
100,
114
],
[
482,
496
]
],
[
[
60,
78
]
],
[
[
430,
460
]
]
] |
from ApiManager.utils.operation import add_project_data, add_module_data, add_case_data, add_config_data, \
add_register_data, bulk_import_data
from ApiManager.models import ModuleInfo
import yaml
'''前端test信息转字典'''
def key_value_dict(mode=3, **kwargs):
if not kwargs:
return None
sorted_kwargs = s... | [
[
[
39,
55
],
[
4816,
4832
]
],
[
[
57,
72
],
[
4377,
4392
]
],
[
[
74,
87
],
[
6838,
6851
]
],
[
[
89,
104
],
[
8282,
8297
]
],
[
[
... |
import tensorflow as tf
#from tensorflow.python.ops.rnn_cell import *
#from tensorflow.python.ops.rnn_cell_impl import _Linear
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import *
#from tensorflow import keras
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import init_ops
from tensorflo... | [
[
[
7,
23
],
[
710,
712
],
[
784,
786
],
[
919,
921
],
[
1115,
1117
],
[
1134,
1136
],
[
1169,
1171
],
[
1189,
1191
],
[
1220,
1222
],
... |
import sys
# Alternatively just load env variables via your env/bin/activate script
if sys.platform.startswith('darwin') or sys.platform.startswith('win'):
import json
path = "Gigger/utilities/env_local.json"
with open(path) as json_file:
global CONFIG
CONFIG = json.load(json_file)
else:
... | [
[
[
7,
10
],
[
88,
91
],
[
125,
128
]
],
[
[
168,
172
],
[
291,
295
]
],
[
[
177,
181
],
[
232,
236
]
],
[
[
241,
250
],
[
301,
... |
import logging
import six
import ddtrace
from ddtrace.compat import StringIO
from ddtrace.constants import ENV_KEY
from ddtrace.constants import VERSION_KEY
from ddtrace.contrib.logging import patch
from ddtrace.contrib.logging import unpatch
from ddtrace.contrib.logging.patch import RECORD_ATTR_SPAN_ID
from ddtrace.... | [
[
[
7,
14
],
[
453,
460
],
[
488,
495
],
[
812,
819
],
[
1375,
1382
],
[
1432,
1439
],
[
2118,
2125
],
[
2251,
2258
]
],
[
[
23,
26
... |
# -*- coding: utf-8 -*-
'''
Helpful decorators for module writing
'''
# Import python libs
from __future__ import absolute_import
import inspect
import logging
import time
from functools import wraps
from collections import defaultdict
# Import salt libs
import salt.utils
import salt.utils.args
from salt.exceptions i... | [
[
[
115,
130
]
],
[
[
138,
145
],
[
2099,
2106
],
[
7571,
7578
],
[
7758,
7765
]
],
[
[
153,
160
],
[
550,
557
]
],
[
[
168,
172
],
[
... |
#!/usr/bin/env python3
import argparse
import boutvecma
import easyvvuq as uq
import chaospy
import os
import numpy as np
import time
import matplotlib.pyplot as plt
CAMPAIGN_NAME = "Conduction."
def refine_sampling_plan(campaign, analysis, number_of_refinements):
"""
Refine the sampling plan.
Paramet... | [
[
[
31,
39
],
[
7317,
7325
]
],
[
[
47,
56
],
[
2460,
2469
],
[
2628,
2637
]
],
[
[
64,
78
],
[
3107,
3109
],
[
3330,
3332
],
[
3649,
... |
import machine, time
from machine import Pin
__version__ = '0.2.0'
__author__ = 'Roberto Sánchez'
__license__ = "Apache License 2.0. https://www.apache.org/licenses/LICENSE-2.0"
class HCSR04:
"""
Driver to use the untrasonic sensor HC-SR04.
The sensor range is between 2cm and 4m.
The timeou... | [
[
[
7,
14
],
[
1581,
1588
]
],
[
[
16,
20
],
[
1405,
1409
],
[
1492,
1496
]
],
[
[
42,
45
],
[
949,
952
],
[
971,
974
],
[
1075,
107... |
#!/usr/bin/env python
# Copyright 2021-2022 NVIDIA Corporation
#
# 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 appli... | [
[
[
620,
628
],
[
1136,
1144
],
[
25462,
25470
]
],
[
[
636,
640
],
[
4959,
4963
],
[
5103,
5107
],
[
24991,
24995
],
[
25048,
25052
],
[
2519... |
import pytest
import os
import RaveEngine.projectManager as projectManager
import RaveEngine.botManager as botManager
import RaveEngine.configManager as configManager
import Utils.commandManager as commandManager
from flaky import flaky
import Utils.sad as sad
import Utils.utils as utils
@pytest.fixture(autouse=True)
... | [
[
[
7,
13
],
[
291,
297
],
[
918,
924
],
[
1796,
1802
],
[
1143,
1149
]
],
[
[
21,
23
],
[
1506,
1508
],
[
1554,
1556
]
],
[
[
31,
7... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from conftest import Mock
import responses
class TestIP(object):
@responses.activate
def test_get_ip(self, manager):
data = Mock.mock_get('ip_address/10.... | [
[
[
23,
39
]
],
[
[
63,
77
]
],
[
[
101,
109
]
],
[
[
133,
148
]
],
[
[
171,
175
],
[
291,
295
],
[
607,
611
],
[
863,
867
],
[
98... |
import tvm
import tvm._ffi
import numpy as np
from functools import reduce
from tvm.tensor_graph.core.utils import to_int, to_tuple, flatten_tir_graph, op_feature
def make_tir_graph(fwd_graph, loss=None, optimizer=None, inference=True, need_output=True, need_grad=True):
if inference:
finputs, foutputs, fw... | [
[
[
7,
10
]
],
[
[
18,
26
],
[
1423,
1426
],
[
616,
619
],
[
1303,
1306
],
[
2595,
2598
],
[
2803,
2806
],
[
3099,
3102
],
[
3433,
3436
... |
# Copyright (c) 2012 OpenStack Foundation
#
# 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 ... | [
[
[
670,
673
],
[
29338,
29341
]
],
[
[
681,
690
],
[
28358,
28367
]
],
[
[
698,
702
],
[
16450,
16454
]
],
[
[
710,
718
],
[
27614,
27622
]
]... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Persistent identifier fetchers.
A proper fetcher is defined as a function that re... | [
[
[
723,
738
]
],
[
[
740,
754
]
],
[
[
794,
804
],
[
1264,
1274
]
],
[
[
847,
864
],
[
1418,
1435
]
],
[
[
904,
930
],
[
1482,
1508
]
],
... |
import logging,os
from rest import Restclient
LOCAL_DATA_FOLDER = '/DATA'
GENOTYPE_FOLDER = '/GENOTYPE'
REST_HOST = os.environ['REST_HOST']
REST_USERNAME = os.environ['REST_USERNAME']
REST_PASSWORD = os.environ['REST_PASSWORD']
restclient = Restclient(REST_HOST,REST_USERNAME,REST_PASSWORD)
class CeleryProgressLogHa... | [
[
[
7,
14
],
[
326,
333
],
[
388,
395
]
],
[
[
15,
17
],
[
118,
120
],
[
158,
160
],
[
202,
204
]
],
[
[
35,
45
],
[
244,
254
]
... |
import os
from collections import OrderedDict
import matplotlib.pyplot as plt
import pandas
_ramachandran_densities = pandas.read_csv(
'data/rama500-general.data',
skiprows=6,
delimiter=' ',
names=['phi', 'psi', 'value']
)
"""
DSSP output:
H = α-helix
B = residue in isolated β-bridge
E =... | [
[
[
7,
9
],
[
2735,
2737
]
],
[
[
34,
45
],
[
856,
867
],
[
924,
935
]
],
[
[
54,
78
],
[
829,
832
],
[
1144,
1147
],
[
1188,
1191
... |
""" This is a dummy file used only to avoid errors in ReadTheDocs. The real BF.py is created during the setup once swig is run. """
def CP():
pass
def LeP():
pass
def LaP():
pass
def HoPpro():
pass
def HoPphy():
pass
def FS():
pass
def ELMReLU():
pass
def ELMSigmoid():
pa... | [
[
[
138,
140
]
],
[
[
159,
162
]
],
[
[
181,
184
]
],
[
[
203,
209
]
],
[
[
228,
234
]
],
[
[
253,
255
]
],
[
[
274,
281
]
],
[
[
300,
... |
seq = 'CTTCTCACGTACAACAAAATC'
symbol2number = {"A":0,"C":1,"G":2,"T":3}
def PatternToNumber(Pattern):
if not Pattern:
return 0
symbol = Pattern[-1]
prefix = Pattern[:-1]
return ((4*PatternToNumber(prefix))+symbol2number[symbol])
def NumberToPattern(index, k):
bases = ['A', ... | [
[
[
0,
3
]
],
[
[
33,
46
],
[
247,
260
]
],
[
[
88,
103
],
[
222,
237
],
[
659,
674
]
],
[
[
277,
292
],
[
1007,
1022
]
],
[
[
454... |
import os
from dotenv import load_dotenv, find_dotenv
#this will load all the envars from a .env file located in the project root (api)
load_dotenv(find_dotenv())
CONFIGURATION = {
"development": "config.DevConfig",
"testing": "config.TestConfig",
"production": "config.Config",
"default": "config.Conf... | [
[
[
7,
9
],
[
369,
371
],
[
385,
387
],
[
512,
514
],
[
589,
591
],
[
650,
652
],
[
715,
717
],
[
826,
828
],
[
879,
881
],
[
... |
# Execution time : 0.003847 seconds
# Solution Explanation
# A simple brute-froce approach is enough
import time
width = 40
from functools import reduce
def solution():
v = list()
v.append([0]*23)
v.append([0]*23)
v.append([0]*23)
for line in open('input_p011.in','r'):
v.append(list(map... | [
[
[
112,
116
],
[
902,
906
],
[
1024,
1028
]
],
[
[
117,
122
],
[
948,
953
],
[
1009,
1014
]
],
[
[
150,
156
],
[
530,
536
],
[
615,
... |
import sys
config = {
"Database": {
"Address": "localhost",
"Username": "root",
"Password": "",
"Name": "Houdini",
"Driver": "PyMySQL" if sys.platform == "win32" else "MySQLdb"
},
"Redis": {
"Address": "127.0.0.1",
"Port": 6379
},
"Servers": {
"Login": {
"Address": "127.0.0.1",
"Port": 6112,
... | [
[
[
7,
10
],
[
149,
152
]
],
[
[
11,
17
]
]
] |
# GENERATED BY KOMAND SDK - DO NOT EDIT
from setuptools import setup, find_packages
setup(name='haveibeenpwned-rapid7-plugin',
version='4.0.2',
description='Determine if a user, domain, or password has been leaked via data available in the Have I Been Pwned database',
author='rapid7',
author_e... | [
[
[
63,
68
],
[
86,
91
]
],
[
[
70,
83
],
[
358,
371
]
]
] |
#-----------------------------------------------------------------------------
# Copyright (c) 2015, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | [
[
[
441,
459
],
[
1454,
1472
]
],
[
[
491,
497
],
[
1790,
1796
],
[
2376,
2382
]
],
[
[
499,
508
],
[
2449,
2458
]
],
[
[
517,
519
],
[
... |
import matplotlib.pyplot as plt
import pandas as pd
from numpy import arange, array
import os
import logging
logging.basicConfig()
logger = logging.getLogger('PlotTimeCost')
logger.setLevel('INFO')
class PlotTimeCostBar:
def __init__(self, data, path, show=False):
self.data = data
self.path = pa... | [
[
[
7,
31
],
[
699,
702
],
[
989,
992
],
[
1313,
1316
]
],
[
[
39,
51
]
],
[
[
70,
76
],
[
854,
860
]
],
[
[
78,
83
],
[
618,
62... |
"""
Copyright 2017 Arm Ltd.
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
distribut... | [
[
[
591,
609
]
]
] |
apiKey = 'yours'
apiSecret = 'yours'
callbackUrl = 'http://fledna.duapp.com/query'
openid = 'yours'
accessToken = 'yours'
| [
[
[
0,
6
]
],
[
[
18,
27
]
],
[
[
39,
50
]
],
[
[
86,
92
]
],
[
[
104,
115
]
]
] |
# https://stockmarketmba.com/globalstockexchanges.php
exchanges = {
'USA': None,
'Germany': 'XETR',
'Hong Kong': 'XHKG',
'Japan': 'XTKS',
'France': 'XPAR',
'Canada': 'XTSE',
'United Kingdom': 'XLON',
'Switzerland': 'XSWX',
'Australia': 'XASX',
'South Korea': 'XKRX',
'The Net... | [
[
[
55,
64
]
],
[
[
563,
581
]
],
[
[
3157,
3167
]
]
] |
"""About and help services.
(help browser anyone?)
"""
import importlib
import importlib_metadata
from gi.repository import Gtk
from gaphor.abc import ActionProvider, Service
from gaphor.core import action
class HelpService(Service, ActionProvider):
def __init__(self, session):
self.session = session... | [
[
[
65,
74
],
[
555,
564
],
[
1043,
1052
]
],
[
[
83,
101
],
[
803,
821
]
],
[
[
128,
131
],
[
528,
531
],
[
1016,
1019
]
],
[
[
156,
... |
import os
import cv2
import time
import argparse
import numpy as np
from mtcnn import detect_face
import tensorflow as tf
from PIL import Image, ImageDraw
## MTCNN face localizer
def mtcnn_localize_faces(image, pnet, rnet, onet, minsize=20, threshold=[0.7, 0.8, 0.85], factor=0.75):
"""
Localize faces & its lan... | [
[
[
7,
9
],
[
1983,
1985
],
[
2078,
2080
],
[
2392,
2394
],
[
5181,
5183
],
[
5240,
5242
],
[
5386,
5388
]
],
[
[
17,
20
],
[
2067,
2070... |
"""Encoder
Description:
This module encodes Planning Problem to Propositional Formulas in CNF
(Conjunctive Normal Form)
License:
Copyright 2021 Debby Nirwan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may... | [
[
[
761,
776
],
[
2248,
2263
]
],
[
[
794,
798
],
[
851,
855
]
],
[
[
821,
833
],
[
5911,
5923
]
],
[
[
842,
850
],
[
1688,
1696
],
[
... |
from src.main.config import config
import requests
import json
def validate_email(email):
try:
api_response = requests.post(
config.EMAIL_VERIFICATION_URL.format(config.NEVERBOUNCE_API_KEY, email)
).content
api_response = json.loads(api_response)
if api_response['resul... | [
[
[
28,
34
],
[
151,
157
],
[
188,
194
]
],
[
[
42,
50
],
[
124,
132
]
],
[
[
58,
62
],
[
264,
268
]
],
[
[
69,
83
]
]
] |
#!/usr/bin/env python
"""
This is the unittest for gridcellarea module.
python -m unittest -v tests/test_gridcellarea.py
python -m pytest --cov=pyjams --cov-report term-missing -v tests/test_gridcellarea.py
"""
import unittest
def _flatten(itr):
import numpy as np
fitr = np.array(itr).flatten()
if len(f... | [
[
[
220,
228
],
[
585,
593
],
[
3940,
3948
]
],
[
[
235,
243
],
[
1617,
1625
],
[
1648,
1656
],
[
1803,
1811
],
[
1834,
1842
],
[
1992,
... |
from .agent import A2CAgent
| [
[
[
19,
27
]
]
] |
# This file is to get a rough estimation of how much you need to pay or how many months you need to pay for a loan
import pandas as pd
import numpy as np
from IPython.display import display
def group(number):
"""show money in laks and crores (indian way of presenting money)"""
s = '%d' % number
groups = [... | [
[
[
123,
135
],
[
4827,
4829
],
[
4868,
4870
]
],
[
[
143,
154
],
[
2041,
2043
],
[
2099,
2101
],
[
2828,
2830
]
],
[
[
183,
190
],
[
5377... |
import numpy as np
import matplotlib.pyplot as plt
from tqdm import trange
import seaborn as sns
import random
# ========================== CFG =======================
class CFG:
HIT = 1
STOP = 0
actions = [STOP, HIT]
WIN = 1
DRAW = 0
LOSE = -1
# ======================== function ==========... | [
[
[
7,
18
],
[
6118,
6120
],
[
6237,
6239
],
[
364,
366
],
[
4231,
4233
],
[
4334,
4336
],
[
4544,
4546
],
[
4579,
4581
],
[
5526,
5528
... |
# Copyright (c) 2021 ICHIRO ITS
#
# 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
# to use, copy, modify, merge, publish, distribu... | [
[
[
1112,
1130
]
],
[
[
1179,
1190
]
],
[
[
1192,
1203
]
],
[
[
1252,
1263
]
],
[
[
1265,
1276
]
]
] |
# Import the necessary modules
from sklearn.naive_bayes import MultinomialNB
from sklearn import metrics
# Instantiate a Multinomial Naive Bayes classifier: nb_classifier
nb_classifier = MultinomialNB()
# Fit the classifier to the training data
nb_classifier.fit(count_train, y_train)
# Create the predicted tags: pre... | [
[
[
63,
76
],
[
188,
201
]
],
[
[
97,
104
],
[
410,
417
],
[
503,
510
]
],
[
[
172,
185
],
[
247,
260
],
[
329,
342
]
],
[
[
322,
... |
import torch
from torch.nn.modules.pooling import MaxPool2d
from .activation import ReLU6, Hardswish, ELU, LeakyReLU, Sigmoid
from .batchnorm import BatchNorm2d, BatchNorm3d
from .normalization import LayerNorm, GroupNorm, InstanceNorm1d, \
InstanceNorm2d, InstanceNorm3d
from .conv import _ConvNd, Conv1d, Conv2d, ... | [
[
[
7,
12
],
[
571,
576
],
[
1209,
1214
],
[
1238,
1243
],
[
2112,
2117
],
[
1381,
1386
],
[
1447,
1452
],
[
1480,
1485
],
[
1562,
1567
... |
# Copyright 2017 The Forseti Security 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 ap... | [
[
[
684,
697
],
[
1058,
1071
],
[
2349,
2362
],
[
2672,
2685
]
],
[
[
731,
746
],
[
826,
841
]
],
[
[
796,
804
],
[
1016,
1024
],
[
2307,
... |
'''Tests for bdpy.preprocessor'''
from unittest import TestCase, TestLoader, TextTestRunner
import numpy as np
from scipy.signal import detrend
from bdpy import preproc
class TestPreprocessor(TestCase):
'''Tests of 'preprocessor' module'''
@classmethod
def test_average_sample(cls):
'''Test fo... | [
[
[
57,
65
],
[
198,
206
]
],
[
[
67,
77
],
[
6949,
6959
]
],
[
[
79,
93
],
[
7006,
7020
]
],
[
[
102,
113
],
[
353,
355
],
[
393,
... |
"""
This file offers the methods to automatically retrieve the graph Streptomyces flavidovirens.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: ... | [
[
[
2872,
2876
],
[
3177,
3181
]
],
[
[
2918,
2945
],
[
6618,
6645
]
],
[
[
2977,
2991
],
[
3187,
3201
]
],
[
[
3030,
3055
]
]
] |
# -*- coding: utf-8 -*-
# --------------------------
# Copyright © 2014 - Qentinel Group.
#
# 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/LIC... | [
[
[
685,
687
],
[
877,
879
],
[
1142,
1144
],
[
1183,
1185
]
],
[
[
694,
701
]
],
[
[
1077,
1086
]
]
] |
# Generated by Django 2.2.10 on 2020-02-24 11:38
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('finance', '0002_auto_20200224_1125'),
]
operations = [
... | [
[
[
74,
82
],
[
219,
227
]
],
[
[
105,
115
],
[
134,
144
],
[
187,
197
],
[
328,
338
]
],
[
[
124,
133
]
]
] |
"""empty message
Revision ID: 156b555e16b7
Revises: fc1cedce5988
Create Date: 2020-05-04 10:39:56.803842
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '156b555e16b7'
down_revision = 'fc1cedce5988'
branch_labels = None
depends_on = None
def upgrade():
# ... | [
[
[
131,
133
],
[
384,
386
],
[
507,
509
],
[
635,
637
],
[
757,
759
],
[
937,
939
],
[
1017,
1019
],
[
1138,
1140
],
[
1265,
1267
]
]... |
import sys
def error():
quit(f'Error on Line {line_num}:\n{line}')
__author__ = 'Aarav Dave'
if len(sys.argv) > 1:
__file__ = sys.argv[1]
else:
__file__ = 'code.qps'
vars = {}
nest = []
with open(__file__) as file:
for line_num, line in enumerate(file.readlines()):
line = line.rstrip()
... | [
[
[
7,
10
],
[
108,
111
],
[
138,
141
]
],
[
[
17,
22
],
[
1101,
1106
]
],
[
[
75,
85
]
],
[
[
127,
135
],
[
214,
222
]
],
[
[
160... |
from stanza.pipeline.core import Pipeline
from stanza.models.common.doc import Document
from stanza.utils.resources import download
from stanza._version import __version__, __resources_version__
import logging.config
logging.config.dictConfig(
{
"version": 1,
"disable_existing_loggers": False,
... | [
[
[
33,
41
]
],
[
[
79,
87
]
],
[
[
123,
131
]
],
[
[
160,
171
]
],
[
[
173,
194
]
],
[
[
203,
217
],
[
218,
225
]
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.