content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import logging
from datetime import datetime, timedelta
from robit.core.health import Health
| [
11748,
18931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
6738,
686,
2545,
13,
7295,
13,
13948,
1330,
3893,
628
] | 3.958333 | 24 |
import datetime
import pytz
from utils.timezones import time_zones
from utils.CalculateHours import calc_hours
| [
11748,
4818,
8079,
198,
11748,
12972,
22877,
198,
6738,
3384,
4487,
13,
2435,
89,
1952,
1330,
640,
62,
89,
1952,
198,
6738,
3384,
4487,
13,
9771,
3129,
378,
39792,
1330,
42302,
62,
24425,
628
] | 3.294118 | 34 |
from django.contrib import admin
from .models import PreQuestionnaire
admin.site.register(PreQuestionnaire)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
3771,
24361,
24042,
198,
198,
28482,
13,
15654,
13,
30238,
7,
6719,
24361,
24042,
8,
198
] | 3.666667 | 30 |
import numpy as np
from collections import defaultdict
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union
def _voc_ap(
rec,
prec,
use_07_metric=False,
):
"""Compute VOC AP given precision and recall. If use_07_metric is true, uses
the VOC 07 11-point method (default:False).
... | [
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
360,
713,
11,
7343,
11,
32233,
11,
5345,
11,
309,
29291,
11,
4479,
628,
198,
4299,
4808,
18893,
62,
499,
7,
198,
22... | 1.875093 | 2,674 |
import asyncio
from callable import Callable
from signature import signature
import pytest
| [
198,
11748,
30351,
952,
198,
6738,
869,
540,
1330,
4889,
540,
198,
6738,
9877,
1330,
9877,
198,
198,
11748,
12972,
9288,
628,
628,
628
] | 4.083333 | 24 |
import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
| [
11748,
25064,
26,
3601,
10786,
4,
82,
4064,
82,
6,
4064,
357,
17597,
13,
18558,
18187,
393,
25064,
13,
24254,
11,
25064,
13,
9641,
4008,
198
] | 2.884615 | 26 |
# coding: utf-8
##########################################################################
# NSAp - Copyright (C) CEA, 2020
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for det... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
29113,
29113,
7804,
2235,
198,
2,
10551,
79,
532,
15069,
357,
34,
8,
327,
16412,
11,
12131,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
20101,
34,
8267,
12,
33,
5964,
11,
355,
3199,
416,
19... | 3.739726 | 146 |
from src.auth.adapter import *
from src.auth.domain import *
from src.auth.service import *
| [
6738,
12351,
13,
18439,
13,
324,
3429,
1330,
1635,
198,
6738,
12351,
13,
18439,
13,
27830,
1330,
1635,
198,
6738,
12351,
13,
18439,
13,
15271,
1330,
1635,
198
] | 3.285714 | 28 |
import json
import random
import re
import subprocess
import tempfile
from datetime import timedelta
import cv2
import numpy as np
import requests
from vidaug import augmentors as va
# this is a static build from https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.4.1-i686-static.tar.xz
# requires new ffmpeg v... | [
11748,
33918,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7007,
198,
6738,
... | 2.419231 | 780 |
from bingraphvis.base import Content
| [
6738,
275,
278,
1470,
4703,
13,
8692,
1330,
14041,
198
] | 3.7 | 10 |
from __future__ import absolute_import
from __future__ import unicode_literals
from corehq.dbaccessors.couchapps.all_docs import \
get_all_doc_ids_for_domain_grouped_by_db, get_doc_count_by_type, \
delete_all_docs_by_doc_type, get_doc_count_by_domain_type
from dimagi.utils.couch.database import get_db
from djan... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
4755,
71,
80,
13,
9945,
15526,
669,
13,
66,
7673,
18211,
13,
439,
62,
31628,
1330,
3467,
198,
220,
220,
220,
... | 2.782258 | 124 |
#=======================================================================
# instruction.py
#=======================================================================
from pydgin.utils import r_uint
| [
2,
23926,
1421,
18604,
198,
2,
12064,
13,
9078,
198,
2,
23926,
1421,
18604,
198,
198,
6738,
279,
5173,
1655,
13,
26791,
1330,
374,
62,
28611,
628
] | 7.296296 | 27 |
from autogoal.contrib import find_classes
from autogoal.kb import *
from autogoal.kb import build_pipelines, build_pipeline_graph
from autogoal.contrib.spacy import SpacyNLP
from autogoal.contrib._wrappers import FlagsMerger
import logging
logging.basicConfig(level=logging.INFO)
pipeline_space = build_pipeline_gra... | [
6738,
1960,
24076,
282,
13,
3642,
822,
1330,
1064,
62,
37724,
198,
6738,
1960,
24076,
282,
13,
32812,
1330,
1635,
198,
6738,
1960,
24076,
282,
13,
32812,
1330,
1382,
62,
79,
541,
20655,
11,
1382,
62,
79,
541,
4470,
62,
34960,
198,
1... | 2.75122 | 205 |
"""Customizable space module that provides different search spaces
implementations.
"""
from opytimizer.spaces.boolean import BooleanSpace
from opytimizer.spaces.grid import GridSpace
from opytimizer.spaces.hyper_complex import HyperComplexSpace
from opytimizer.spaces.search import SearchSpace
from opytimizer.spaces.t... | [
37811,
15022,
13821,
2272,
8265,
326,
3769,
1180,
2989,
9029,
198,
320,
26908,
602,
13,
198,
37811,
198,
198,
6738,
1034,
88,
16514,
7509,
13,
2777,
2114,
13,
2127,
21052,
1330,
41146,
14106,
198,
6738,
1034,
88,
16514,
7509,
13,
2777,
... | 3.62766 | 94 |
# coding: utf-8
#
# This code is part of lattpy.
#
# Copyright (c) 2021, Dylan Jones
#
# This code is licensed under the MIT License. The copyright notice in the
# LICENSE file in the root directory and this permission notice shall
# be included in all copies or substantial portions of the Software.
"""Spatial algorit... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
770,
2438,
318,
636,
286,
47240,
9078,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
33448,
11,
21371,
5437,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
17168,
13789,
13,
383,
6634... | 2.272049 | 5,091 |
# SPDX-License-Identifier: BSD
#
# This file is part of Pyosmium.
#
# Copyright (C) 2022 Sarah Hoffmann.
import pytest
import osmium as o
| [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
9485,
418,
76,
1505,
13,
198,
2,
198,
2,
15069,
357,
34,
8,
33160,
10490,
21890,
9038,
13,
198,
11748,
12972,
9288,
198,
198,
11... | 2.703704 | 54 |
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from displayio import Shape, Group, TileGrid, Palette, Bitmap, OnDiskBitmap
NativeElement = Group | Shape | TileGrid | Palette | Bitmap | OnDiskBitmap
NativeContainer = Group
else:
NativeElement = object
NativeContainer = object
| [
6738,
19720,
1330,
41876,
62,
50084,
2751,
198,
198,
361,
41876,
62,
50084,
2751,
25,
198,
220,
220,
220,
422,
3359,
952,
1330,
25959,
11,
4912,
11,
47870,
41339,
11,
3175,
5857,
11,
4722,
8899,
11,
1550,
40961,
13128,
8899,
628,
220,... | 3.282609 | 92 |
##############################################################################
#copyright 2013, Hamid MEDJAHED (hmedjahed@prologue.fr) Prologue #
#Licensed under the Apache License, Version 2.0 (the "License"); #
#you may not use this file except in compliance with the License. #
#You... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
22163,
4766,
2211,
11,
4345,
312,
26112,
41,
18429,
1961,
220,
357,
71,
1150,
6592,
704,
31,
1676,
75,
5119,
13,
8310,
8,
44157,
5119,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.0123 | 6,423 |
from django.contrib import admin
from django.http import HttpResponseRedirect
from django.urls import path
from faker import Faker
from .models import ProjectRequest
from .utils import create_project_request
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
7738,
1060,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
277,
3110,
1330,
376,
3110,
198,
198,
6738,
764,
27530... | 3.818182 | 55 |
import numpy as np
from gym import wrappers
from reinforcement_learning.utils.utils import decrement_eps, EPS_DEC_LINEAR, pickle_save
from reinforcement_learning.tabular_RL.utils import init_v, init_q, init_q1_q2, \
max_action_q, max_action_q1_q2, eps_greedy_q, eps_greedy_q1_q2, print_v
| [
11748,
299,
32152,
355,
45941,
198,
6738,
11550,
1330,
7917,
11799,
198,
198,
6738,
37414,
62,
40684,
13,
26791,
13,
26791,
1330,
5255,
434,
62,
25386,
11,
47013,
62,
41374,
62,
24027,
1503,
11,
2298,
293,
62,
21928,
198,
6738,
37414,
... | 2.610619 | 113 |
#Author: Rahil Gandotra
#This file consists of the custom Mininet topology used for GPF.
from mininet.topo import Topo
topos = { 'mytopo': ( lambda: MyTopo() ) }
| [
2,
13838,
25,
18655,
346,
17727,
313,
430,
198,
2,
1212,
2393,
10874,
286,
262,
2183,
1855,
42504,
1353,
1435,
973,
329,
14714,
37,
13,
198,
198,
6738,
949,
42504,
13,
4852,
78,
1330,
5849,
78,
198,
198,
4852,
418,
796,
1391,
705,
... | 2.877193 | 57 |
# coding=utf-8
import logging
import rarfile
import os
from subliminal.exceptions import ConfigurationError
from subliminal.providers.legendastv import LegendasTVSubtitle as _LegendasTVSubtitle, \
LegendasTVProvider as _LegendasTVProvider, Episode, Movie, guess_matches, guessit, sanitize, region, type_map, \
r... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
18931,
198,
11748,
374,
283,
7753,
198,
11748,
28686,
198,
6738,
850,
2475,
1292,
13,
1069,
11755,
1330,
28373,
12331,
198,
198,
6738,
850,
2475,
1292,
13,
15234,
4157,
13,
1455,
437,
459,
85,
... | 2.442573 | 653 |
import re | [
11748,
302
] | 4.5 | 2 |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://plankton-toolbox.org
# Copyright (c) 2010-2018 SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import time
import codecs
from PyQt5 import QtWidgets
from PyQt5 i... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
201,
198,
2,
4935,
25,
2638,
1378,
489,
962,
1122,
12,
25981,
3524,
13,
2398,
201,
198,
2,
15069,
357,
66,
8,
3050,
12,
... | 2.858065 | 155 |
#!/usr/bin/env python
# this.py --- Example of This predefined trait
from traits.api import HasTraits, This
#---------------------------------------
# Extrat
fred = Employee()
mary = Executive()
# The following is OK, because fred's manager can be an
# instance of Employee or any subclass.
fred.manager = mary
# T... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
428,
13,
9078,
11420,
17934,
286,
770,
2747,
18156,
16708,
198,
198,
6738,
12796,
13,
15042,
1330,
7875,
15721,
896,
11,
770,
198,
198,
2,
3880,
26866,
198,
2,
5683,
10366,
1... | 3.618182 | 110 |
import boto3
import json
import logging
import os
bucket = os.environ['UPLOAD_BUCKET']
role_arn = os.environ['ASSUMED_ROLE_ARN']
sts_client = boto3.client('sts')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
| [
11748,
275,
2069,
18,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
27041,
316,
796,
28686,
13,
268,
2268,
17816,
52,
6489,
41048,
62,
33,
16696,
2767,
20520,
198,
18090,
62,
1501,
796,
28686,
13,
268,
2268,
17816,
... | 2.044776 | 134 |
"""2017 - Day 5 Part 2: A Maze of Twisty Trampolines, All Alike tests."""
from src.year2017.day05b import solve
| [
37811,
5539,
532,
3596,
642,
2142,
362,
25,
317,
33412,
286,
44088,
88,
833,
696,
349,
1127,
11,
1439,
978,
522,
5254,
526,
15931,
198,
6738,
12351,
13,
1941,
5539,
13,
820,
2713,
65,
1330,
8494,
628
] | 3.054054 | 37 |
import unittest
from manticore.utils.event import Signal
| [
198,
11748,
555,
715,
395,
198,
198,
6738,
285,
5109,
382,
13,
26791,
13,
15596,
1330,
26484,
628
] | 3.333333 | 18 |
# Generated by Django 3.1.4 on 2020-12-27 17:34
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
19,
319,
12131,
12,
1065,
12,
1983,
1596,
25,
2682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from distutils.core import setup
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="dbprime",
version="0.1dev",
author="Dalton Dirkson",
author_email="sodakdoubled@gmail.com",
packages=["dbprime",],
)
| [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
40406,
7,
198,
220,
220... | 2.386792 | 106 |
# Largest product in a series
'''
The four adjacent digits in the 1000-digit number that have the greatest product are 9 9 8 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
1254069874715852386305071569... | [
2,
406,
853,
395,
1720,
287,
257,
2168,
198,
7061,
6,
198,
464,
1440,
15909,
19561,
287,
262,
8576,
12,
27003,
1271,
326,
423,
262,
6000,
1720,
389,
860,
220,
860,
220,
807,
220,
860,
796,
7618,
2624,
13,
198,
198,
4790,
21940,
15... | 2.385427 | 1,043 |
import os
import re
from contextlib import contextmanager
import numpy as np
import six
__all__ = ['humanize_duration', 'camel_to_underscore', 'NOT_SET',
'cached_property', 'clear_cached_property', 'maybe_close',
'iter_files']
def humanize_duration(seconds):
"""
Format specified time d... | [
11748,
28686,
198,
11748,
302,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2237,
198,
198,
834,
439,
834,
796,
37250,
10734,
1096,
62,
32257,
3256,
705,
66,
17983,
62,
1462,
62,
41116,
... | 2.191095 | 1,078 |
# -*- coding: utf-8 -*-
"""
Created on 2020/8/6
@project: SPAIC
@filename: Backend
@author: Hong Chaofei
@contact: hongchf@gmail.com
@description:
backend Pytorch, Tensorflow, CUDA, Euler, 2 Runge-Kutta
"""
from abc import abstractmethod, ABC
from collections import OrderedDict
from ..Network.BaseModule import BaseMod... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
12131,
14,
23,
14,
21,
198,
31,
16302,
25,
311,
4537,
2149,
198,
31,
34345,
25,
5157,
437,
198,
31,
9800,
25,
9764,
20703,
1659,
20295,
198,
... | 1.810991 | 1,947 |
import cv2
import numpy as np
from PIL import Image
import os
#Verilerin yolu
path = "veriseti"
recognizer = cv2.face.LBPHFaceRecognizer_create()
detector = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
#imajlarn alnmas ve etiketlenmesi iin fonksiyon
print("\n [INFO] yzler eitil... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
28686,
198,
198,
2,
13414,
5329,
259,
331,
349,
84,
198,
6978,
796,
366,
332,
271,
316,
72,
1,
198,
26243,
7509,
796,
269,
85,
1... | 2.363014 | 292 |
import kivy
from kivy.app import App
from kivy.uix.button import Label
from kivy.uix.colorpicker import ColorPicker
from kivy.graphics import Color, Ellipse, Triangle
from kivy.properties import StringProperty, ObjectProperty
if __name__ in ["__main__", "__android__"]:
SaludoApp().run()
| [
11748,
479,
452,
88,
198,
6738,
479,
452,
88,
13,
1324,
1330,
2034,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
16539,
1330,
36052,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
8043,
79,
15799,
1330,
5315,
47,
15799,
198,
6738,
479,
... | 3 | 97 |
from datetime import date
maior = menor = 0
atual = date.today().year
for c in range(1, 8):
nascimento = int(input(f'Em que ano a {c} pessoa nasceu? '))
if atual - nascimento > 20:
maior += 1
else:
menor += 1
print(f'Ao todo, temos {maior} pessoas maiores de idade!')
print(f'Ao todo, temos {... | [
6738,
4818,
8079,
1330,
3128,
198,
2611,
1504,
796,
1450,
273,
796,
657,
198,
265,
723,
796,
3128,
13,
40838,
22446,
1941,
198,
1640,
269,
287,
2837,
7,
16,
11,
807,
2599,
198,
220,
220,
220,
299,
3372,
3681,
78,
796,
493,
7,
1541... | 2.151515 | 165 |
# -*- coding: utf-8 -*-
# zdfneo.py - Aufruf durch __init__.py/ZDF_get_content
#
# Die Funktionen dienen zur Auswertung der ZDF-Neo-Seiten
#
Neo_Base = 'https://www.neo-magazin-royale.de'
PREFIX = '/video/ardmediathek2016/zdfneo'
##################################################################################... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
1976,
7568,
710,
78,
13,
9078,
197,
12,
317,
3046,
622,
69,
288,
2575,
11593,
15003,
834,
13,
9078,
14,
57,
8068,
62,
1136,
62,
11299,
198,
2,
198,
2,
6733,
372... | 2.827476 | 313 |
import numpy as np
from openbabel import openbabel as ob
import logging
logger = logging.getLogger()
def __eq__(self, other):
"""Overrides the default implementation"""
if isinstance(self, other.__class__):
return (self.atomic_num == other.atomic_num
and np.all(sel... | [
11748,
299,
32152,
355,
45941,
198,
6738,
1280,
65,
9608,
1330,
1280,
65,
9608,
355,
909,
198,
198,
11748,
18931,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
3419,
628,
198,
220,
220,
220,
825,
11593,
27363,
834,
7,
944,
11,
... | 2.298677 | 1,587 |
import discord, itertools
from discord.ext import commands, tasks
# Lava is not allowed to change the first text
PRESENCE_TEXT = itertools.cycle(["lava is cute", "*pushes you against wall* wanna play fortnite amongus?", "with ur mum", "owo.exe", "dangit jelly", "gewrhgkhewghkhfuckoiyo5uo", "MiEWcWAFT?? OWOWO"])
| [
11748,
36446,
11,
340,
861,
10141,
198,
6738,
36446,
13,
2302,
1330,
9729,
11,
8861,
198,
198,
2,
406,
4170,
318,
407,
3142,
284,
1487,
262,
717,
2420,
198,
48296,
18310,
62,
32541,
796,
340,
861,
10141,
13,
13696,
7,
14692,
75,
417... | 2.907407 | 108 |
# Aim is to apply a multiplier to the natural capital scores to reflect the degree of public access
# Challenge is that it is difficult to clip or intersect the complex public access layer with the large and
# detailed OSMM-based base map - it takes days to run and then fails.
# So here we extract a subset of the base ... | [
2,
36223,
318,
284,
4174,
257,
33090,
284,
262,
3288,
3139,
8198,
284,
4079,
262,
4922,
286,
1171,
1895,
198,
2,
13879,
318,
326,
340,
318,
2408,
284,
10651,
393,
36177,
262,
3716,
1171,
1895,
7679,
351,
262,
1588,
290,
198,
2,
6496... | 2.471164 | 13,681 |
"""
this script parses the pds-rings press release gallery tree at
base_url = "http://pds-rings.seti.org/saturn/cassini/"
if an image already exists in the database it is updated
to get only the most recent month set latest_month_only to True
"""
latest_month_only = True # like I was really going to do this monthly
... | [
37811,
198,
5661,
4226,
13544,
274,
262,
279,
9310,
12,
33173,
1803,
2650,
15604,
5509,
379,
220,
198,
8692,
62,
6371,
796,
366,
4023,
1378,
79,
9310,
12,
33173,
13,
2617,
72,
13,
2398,
14,
49720,
700,
14,
66,
562,
5362,
30487,
198,... | 2.431114 | 1,517 |
from flask import Blueprint, jsonify, request
from packit_dashboard.utils import return_json
from packit_dashboard.config import API_URL
api = Blueprint("api", __name__)
# The react frontend will request information here instead of fetching directly
# from the main API.
# This is because it will be easier to implemen... | [
6738,
42903,
1330,
39932,
11,
33918,
1958,
11,
2581,
198,
6738,
2353,
270,
62,
42460,
3526,
13,
26791,
1330,
1441,
62,
17752,
198,
6738,
2353,
270,
62,
42460,
3526,
13,
11250,
1330,
7824,
62,
21886,
198,
198,
15042,
796,
39932,
7203,
... | 3.806122 | 98 |
"""
Authentication Utility Functions
"""
from flask import session
from models import Patient, Doctor, Degree, database
import hashlib, binascii
from config import SECRET_KEY | [
37811,
198,
47649,
3299,
34030,
40480,
198,
198,
37811,
198,
198,
6738,
42903,
1330,
6246,
198,
6738,
4981,
1330,
35550,
11,
9356,
11,
34486,
11,
6831,
198,
11748,
12234,
8019,
11,
9874,
292,
979,
72,
198,
6738,
4566,
1330,
10729,
26087... | 4.093023 | 43 |
from __future__ import absolute_import, division, print_function
import boost.python
ext = boost.python.import_ext("cctbx_eltbx_covalent_radii_ext")
from cctbx_eltbx_covalent_radii_ext import *
boost.python.inject(ext.table_iterator, boost.python.py3_make_iterator)
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
11748,
5750,
13,
29412,
198,
2302,
796,
5750,
13,
29412,
13,
11748,
62,
2302,
7203,
66,
310,
65,
87,
62,
2120,
65,
87,
62,
66,
8325,
298,
62,
6335,... | 2.78125 | 96 |
from nba_py import player
from numpy import mean
import league
from consts import all_time_stats
import consts
name_to_index = {'season': 1, consts.rebounds: 20, consts.assists: 21, consts.steals: 22, consts.blocks: 23, consts.points: 26}
if __name__ == '__main__':
# player = Player('michael', 'jordan')
... | [
6738,
299,
7012,
62,
9078,
1330,
2137,
198,
6738,
299,
32152,
1330,
1612,
198,
198,
11748,
4652,
198,
6738,
1500,
82,
1330,
477,
62,
2435,
62,
34242,
198,
11748,
1500,
82,
198,
198,
3672,
62,
1462,
62,
9630,
796,
1391,
6,
6230,
1035... | 2.843243 | 185 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 10 18:34:07 2019
WMM2015WMM.cofpy
@author: chens
"""
import numpy as np
from pathlib import Path
import xarray
import ctypes as ct
import sys
import datetime
from matplotlib.pyplot import figure
#libwmm = ct.cdll.LoadLibrary(str('D:\\MyWorks\\WMM2015-master\\wmm15.dll'))... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
2365,
838,
1248,
25,
2682,
25,
2998,
13130,
198,
54,
12038,
4626,
54,
12038,
13,
1073,
69,
9078,
198,
31,
9800,
25,
269,
5135,
198,
3781... | 2.377604 | 384 |
# Copyright 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 "license" file accompanyin... | [
2,
15069,
6186,
13,
785,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
... | 3.379822 | 337 |
""" Contains all the functions related to the search of enitities in the Database """
from tabulate import tabulate
def SearchPlayerByName(cur, con):
""" Searches for the provided name's similar occurences in the Player's first and last name """
# Take in the input for the search query
search = {}
s... | [
37811,
49850,
477,
262,
5499,
3519,
284,
262,
2989,
286,
551,
270,
871,
287,
262,
24047,
37227,
628,
198,
6738,
7400,
5039,
1330,
7400,
5039,
628,
198,
4299,
11140,
14140,
3886,
5376,
7,
22019,
11,
369,
2599,
198,
220,
220,
220,
37227... | 2.476888 | 887 |
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2019, Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
#
# Work based on:
# - test_net.py
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
# - test_fit.py
# Copyright (c) 2013, Google Inc.
#
# Test launching UEFI binaries from FIT images.
"""
Note: This... | [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
38644,
12,
17,
13,
15,
198,
2,
15069,
357,
66,
8,
13130,
11,
24568,
666,
37685,
4374,
660,
64,
1279,
66,
1585,
666,
13,
979,
4374,
660,
64,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
... | 2.472917 | 1,440 |
#!/usr/bin/env python
import report, sys
import psycopg2.extras
parser = report.get_parser(sys.argv[0])
parser.add_argument('--title', '-t', required=False, dest='title', default="Data Dictionary", help='Report Title')
args = parser.parse_args()
conn = report.get_connection(args)
curs = conn.cursor(cursor_factory=p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
989,
11,
25064,
198,
198,
11748,
17331,
22163,
70,
17,
13,
2302,
8847,
198,
198,
48610,
796,
989,
13,
1136,
62,
48610,
7,
17597,
13,
853,
85,
58,
15,
12962,
198,
48610,
... | 2.649215 | 191 |
head = takeinputLL()
printLL(insertionLL(head)) | [
628,
628,
198,
2256,
796,
1011,
15414,
3069,
3419,
198,
4798,
3069,
7,
28463,
295,
3069,
7,
2256,
4008
] | 2.736842 | 19 |
"""empty message
Revision ID: 458a7da0c9da
Revises:
Create Date: 2018-05-01 21:15:27.029811
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '458a7da0c9da'
down_revision = None
branch_labels = None
depends_on = None
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
50154,
64,
22,
6814,
15,
66,
24,
6814,
198,
18009,
2696,
25,
220,
198,
16447,
7536,
25,
2864,
12,
2713,
12,
486,
2310,
25,
1314,
25,
1983,
13,
15,
27728,
1157,
198,
198,
37811,
... | 2.588785 | 107 |
import torch
import mimic.modalities.utils
from mimic.modalities.Modality import ModalityIMG
| [
11748,
28034,
198,
198,
11748,
26332,
13,
4666,
27969,
13,
26791,
198,
6738,
26332,
13,
4666,
27969,
13,
5841,
1483,
1330,
3401,
1483,
3955,
38,
628
] | 3.653846 | 26 |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
12131,
3469,
6916,
15664,
23973,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
... | 2.722005 | 2,813 |
import os, sys, shutil
from cx_Freeze import setup, Executable
from pathlib import Path
# Dependencies are automatically detected, but it might need fine tuning.
additional_modules = []
build_exe_options = {
"includes": additional_modules,
"packages": [
"moderngl",
"moderngl_window",
... | [
11748,
28686,
11,
25064,
11,
4423,
346,
198,
6738,
43213,
62,
11146,
2736,
1330,
9058,
11,
8393,
18187,
198,
6738,
3108,
8019,
1330,
10644,
628,
198,
198,
2,
37947,
3976,
389,
6338,
12326,
11,
475,
340,
1244,
761,
3734,
24549,
13,
198... | 2.445087 | 346 |
import os
import time
import jwt
import ldap
from eve.auth import TokenAuth
from flask import Blueprint, abort, jsonify, request
blueprint = Blueprint("login", __name__)
ADMIN_USERS = os.environ.get("ADMIN_USERS", "papanowel@gmail.com")
JWT_ALGORITHM = os.environ.get("JWT_ALGORITHM", "HS256")
JWT_EXPIRE_OFFSET = os.... | [
11748,
28686,
198,
11748,
640,
198,
198,
11748,
474,
46569,
198,
11748,
300,
67,
499,
198,
6738,
28001,
13,
18439,
1330,
29130,
30515,
198,
6738,
42903,
1330,
39932,
11,
15614,
11,
33918,
1958,
11,
2581,
198,
198,
17585,
4798,
796,
3993... | 2.195876 | 388 |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from distutils.core import setup
setup( name="pinyin-comp",
version="0.1",
description="complete path containing Chinese by pinyin acronym",
author="Jekyll Wu",
author_email="adaptee@gmail.com",
url="http://www.github.com/a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
43907,
25,
900,
2393,
12685,
7656,
28,
40477,
12,
23,
1058,
198,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
220,
1438,
2625,
79,
3541,
259,
12,
5589,
1600,
... | 2.296089 | 179 |
"""
Good morning! Here's your coding interview problem for today.
This problem was asked by Google.
Implement an LRU (Least Recently Used) cache.
It should be able to be initialized with a cache size n, and contain the following methods:
set(key, value): sets key to value. If there are already n items in
... | [
37811,
198,
10248,
3329,
0,
3423,
338,
534,
19617,
2720,
1917,
329,
1909,
13,
198,
198,
1212,
1917,
373,
1965,
416,
3012,
13,
198,
198,
3546,
26908,
281,
37491,
52,
357,
3123,
459,
23413,
16718,
8,
12940,
13,
198,
1026,
815,
307,
14... | 2.581461 | 356 |
# -*- coding: utf-8 -*-
from setuptools import setup
# Metadata goes in setup.cfg. These are here for GitHub's dependency graph.
setup(
name="Teeb",
install_requires=["chardet==4.0.0", "send2trash==1.5.0", "wand==0.6.5"],
)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
2,
3395,
14706,
2925,
287,
9058,
13,
37581,
13,
2312,
389,
994,
329,
21722,
338,
20203,
4823,
13,
198,
40406,
7,
198,
22... | 2.427083 | 96 |
#!/usr/bin/env python3
"""Constructs article graph."""
from database import clear_db
from database.constants import engine
from .database_builder import populate_db
if __name__ == "__main__":
clear_db(engine)
populate_db()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
42316,
82,
2708,
4823,
526,
15931,
198,
6738,
6831,
1330,
1598,
62,
9945,
198,
6738,
6831,
13,
9979,
1187,
1330,
3113,
198,
6738,
764,
48806,
62,
38272,
1330,
48040,
62,
994... | 3.191781 | 73 |
from pydantic import BaseSettings
| [
6738,
279,
5173,
5109,
1330,
7308,
26232,
628
] | 4.375 | 8 |
# -*- coding: utf-8 -*-
from flask import Blueprint, jsonify, request
from functools import wraps
from sqlalchemy import desc
from project.common import app, db, fb_api
from project.config import ApiConfig
from project.models import Client, Message
api = Blueprint('api', __name__)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42903,
1330,
39932,
11,
33918,
1958,
11,
2581,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
44161,
282,
26599,
1330,
1715,
198,
198,
6738,
1628,
13,
11321,
... | 3.395349 | 86 |
import unittest
import numpy as np
from c4.board import Board, PLAYER1
| [
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
269,
19,
13,
3526,
1330,
5926,
11,
28180,
1137,
16,
628
] | 2.96 | 25 |
import numpy as np
from sklearn.metrics import accuracy_score
from keras.datasets import cifar10
from keras.utils import to_categorical
from keras.models import Sequential, Model
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, LSTM, Input, Activation, Reshape, concatenate
from keras import optimizers
(... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
9922,
62,
26675,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
269,
361,
283,
940,
198,
6738,
41927,
292,
13,
26791,
1330,
284,
62,
66,
2397,
1240... | 2.643357 | 429 |
# Copyright 2021 PyAge2, Oleksii Kachaiev <kachayev@gmail.com>. 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
#
# Un... | [
2,
15069,
33448,
9485,
23396,
17,
11,
30093,
591,
4178,
509,
34518,
11203,
1279,
74,
620,
323,
1990,
31,
14816,
13,
785,
28401,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,... | 3.609865 | 223 |
from libavg import avg
from events.event_dispatcher import EventDispatcher
from multi_view_ctrl.grid_element import GridElement
from multi_view_ctrl.configurations.grid_element_div_configuration import GridElementDivConfigurations
def is_pos_in(self, pos):
"""
Checks if a given pos lies inside in ... | [
6738,
9195,
615,
70,
1330,
42781,
198,
6738,
2995,
13,
15596,
62,
6381,
8071,
2044,
1330,
8558,
7279,
8071,
2044,
198,
6738,
5021,
62,
1177,
62,
44755,
13,
25928,
62,
30854,
1330,
24846,
20180,
198,
6738,
5021,
62,
1177,
62,
44755,
13... | 2.620632 | 601 |
import en_core_web_sm
from spacy import displacy
| [
11748,
551,
62,
7295,
62,
12384,
62,
5796,
198,
6738,
599,
1590,
1330,
7845,
1590,
628
] | 3.125 | 16 |
from flask import jsonify, request, Blueprint, current_app, send_file, make_response
import tensorflow as tf
import numpy as np
from app.users import utils
import cv2
from app.models import User, Data, Predictions, Coordinates
from app import db
from werkzeug.security import generate_password_hash, check_password_hash
... | [
6738,
42903,
1330,
33918,
1958,
11,
2581,
11,
39932,
11,
1459,
62,
1324,
11,
3758,
62,
7753,
11,
787,
62,
26209,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
598,
13,
18417,
1330,
3384,
448... | 3.454545 | 110 |
"""
EXERCCIO 006: Dobro, Triplo, Raiz Quadrada
Crie um algoritmo que leia um nmero e mostre o seu dobro, triplo e raiz quadrada.
"""
n = int(input('Digite um nmero: '))
print('O dobro de {} vale {}.'.format(n, (n * 2)))
print('O triplo de {} vale {}.'.format(n, (n * 3)))
print('A raiz quadrada de {} igual a {:.2f}.'.... | [
37811,
198,
6369,
1137,
4093,
9399,
3571,
21,
25,
30947,
305,
11,
7563,
489,
78,
11,
7567,
528,
20648,
81,
4763,
198,
198,
34,
5034,
23781,
435,
7053,
270,
5908,
8358,
443,
544,
23781,
299,
647,
78,
304,
749,
260,
267,
384,
84,
46... | 2.245161 | 155 |
"""
Utilities for working with Google Cloud Storage.
"""
import logging
import warnings
from .deps.optdep import import_optional_dependency
logger = logging.getLogger(__name__)
_cached_gcs_fs = None
# TODO: Consider using persistence.GcsFilesystem instead of exposing this function.
def upload_to_gcs(path, url):... | [
37811,
198,
18274,
2410,
329,
1762,
351,
3012,
10130,
20514,
13,
198,
37811,
198,
198,
11748,
18931,
198,
11748,
14601,
198,
198,
6738,
764,
10378,
82,
13,
404,
8671,
538,
1330,
1330,
62,
25968,
62,
45841,
1387,
198,
198,
6404,
1362,
... | 2.531828 | 487 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: yizhong
# created_at: 17-5-2 5:00
PAD_WORD = '<blank>'
UNK_WORD = '<unk>'
BOS_WORD = '<s>'
EOS_WORD = '</s>'
NUM_WORD = '<num>'
PUNC_TAG = '<punc>'
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
1772,
25,
331,
528,
71,
506,
198,
2,
2727,
62,
265,
25,
1596,
12,
20,
12,
17,
642,
25,
405,
198,
198,
47,
28... | 1.731092 | 119 |
#coding: utf-8
a = zeros((10,10), double)
for i in range(0,10):
a[i,i] = 2.0
for i in range(0,9):
a[i,i+1] = -1.0
for i in range(0,9):
a[i,i+1] = -1.0
n = 5
for i in range(0, n):
x = 1
| [
2,
66,
7656,
25,
3384,
69,
12,
23,
628,
198,
64,
796,
1976,
27498,
19510,
940,
11,
940,
828,
4274,
8,
198,
198,
1640,
1312,
287,
2837,
7,
15,
11,
940,
2599,
198,
220,
220,
220,
257,
58,
72,
11,
72,
60,
796,
362,
13,
15,
628,... | 1.664 | 125 |
from django.shortcuts import render
from .forms import LanguageForm
from learning_django import settings
from django.utils import translation
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
764,
23914,
1330,
15417,
8479,
198,
6738,
4673,
62,
28241,
14208,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
1330,
11059,
628
] | 4.46875 | 32 |
#create cinet and functions like COMError that simulate Gamry
#dtaq.Cook is defined to return dummy data when called
#import config here and check if a simulation is being run and if so load that simulation .py that overrides functions like dtaq.Cook | [
2,
17953,
269,
42504,
290,
5499,
588,
9440,
12331,
326,
29308,
14014,
563,
198,
198,
2,
67,
8326,
80,
13,
28937,
318,
5447,
284,
1441,
31548,
1366,
618,
1444,
198,
198,
2,
11748,
4566,
994,
290,
2198,
611,
257,
18640,
318,
852,
1057... | 4.131148 | 61 |
if __name__ == '__main__':
main()
| [
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.157895 | 19 |
from dataclasses import dataclass, field
from .point import Point
NONE: Direction = Direction(0, 0)
NORTH: Direction = Direction(0, -1)
SOUTH: Direction = Direction(0, 1)
EAST: Direction = Direction(1, 0)
WEST: Direction = Direction(-1, 0)
NORTH_EAST: Direction = NORTH + EAST
NORTH_WEST: Direction = NORTH + WEST
... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
198,
6738,
764,
4122,
1330,
6252,
628,
198,
198,
45,
11651,
25,
41837,
796,
41837,
7,
15,
11,
657,
8,
198,
198,
35510,
4221,
25,
41837,
796,
41837,
7,
15,
11,
532,
16,... | 2.822785 | 237 |
#coding:utf-8
#
# id: bugs.core_4158
# title: Regression: LIKE with escape does not work
# decription:
# tracker_id: CORE-4158
# min_versions: ['2.0.7']
# versions: 2.0.7
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.0.7
# resources: Non... | [
2,
66,
7656,
25,
40477,
12,
23,
198,
2,
198,
2,
4686,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11316,
13,
7295,
62,
19,
21273,
198,
2,
3670,
25,
220,
220,
220,
220,
220,
220,
220,
3310,
2234,
25,
34178,
351,
6654,... | 2.022654 | 618 |
"""
arpd_update focuses on easily editing the assume role policy document of a role.
"""
import os
import json
import logging
import argparse
from datetime import datetime
from typing import List, Dict, Optional
import boto3 # type: ignore
from botocore.exceptions import ClientError # type: ignore
LOGGER = logging.... | [
37811,
198,
5117,
67,
62,
19119,
13692,
319,
3538,
12857,
262,
7048,
2597,
2450,
3188,
286,
257,
2597,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
6738,
4818,
8079,
1330,
4818,
... | 2.040062 | 8,412 |
import pygame
import time
import math
import sys
from kartingpros import track, mainmenu, car, settings, loadimage
from kartingpros.loadimage import _load_image, _load_sound, _load_font
import numpy as np
from numpy import save
from kartingpros.car import Car
from pygame.locals import *
from pygame import mix... | [
11748,
12972,
6057,
201,
198,
11748,
640,
201,
198,
11748,
10688,
201,
198,
11748,
25064,
201,
198,
6738,
479,
433,
278,
1676,
82,
1330,
2610,
11,
1388,
26272,
11,
1097,
11,
6460,
11,
3440,
9060,
201,
198,
6738,
479,
433,
278,
1676,
... | 2.90678 | 118 |
# -*- coding: utf-8 -*-
# vim: set noai syntax=python ts=4 sw=4:
#
# Copyright (c) 2018-2021 Linh Pham
# wwdtm is released under the terms of the Apache License 2.0
"""Testing for object: :py:class:`wwdtm.location.LocationUtility`
"""
import json
from typing import Any, Dict
import pytest
from wwdtm.location import Lo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43907,
25,
900,
645,
1872,
15582,
28,
29412,
40379,
28,
19,
1509,
28,
19,
25,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
12,
1238,
2481,
5164,
71,
1380,
321,
198,... | 2.860656 | 122 |
# -*- coding: utf-8 -*-
"""
Create a cert with pyOpenSSL for tests.
Heavily based on python-opsi's OPSI.Util.Task.Certificate.
Source: https://github.com/opsi-org/python-opsi/blob/stable/OPSI/Util/Task/Certificate.py
"""
import argparse
import os
import random
import socket
from tempfile import NamedTemporaryFile
fro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
16447,
257,
5051,
351,
12972,
11505,
31127,
329,
5254,
13,
198,
198,
1544,
615,
813,
1912,
319,
21015,
12,
2840,
72,
338,
40490,
40,
13,
18274,
346,
13,
25... | 2.649038 | 832 |
def log(message, *values):
""" * operator instructs python to pass items from the sequence as
positional arguments
Remember:
- using the * operator with a generator may cause your program
to run out of memory and crash.
- adding new positional parameters to functions that accept
... | [
4299,
2604,
7,
20500,
11,
1635,
27160,
2599,
198,
220,
220,
220,
37227,
1635,
10088,
5048,
82,
21015,
284,
1208,
3709,
422,
262,
8379,
355,
198,
220,
220,
220,
45203,
7159,
198,
220,
220,
220,
11436,
25,
198,
220,
220,
220,
220,
220... | 2.645914 | 257 |
from .unet import UnetComplex
from .cross_domain import CrossDomainNet
from ..utils.fourier import FFT, IFFT
| [
6738,
764,
403,
316,
1330,
220,
791,
316,
5377,
11141,
198,
6738,
764,
19692,
62,
27830,
1330,
6372,
43961,
7934,
198,
6738,
11485,
26791,
13,
69,
280,
5277,
1330,
376,
9792,
11,
314,
5777,
51,
628
] | 3.083333 | 36 |
# Authors: Zhaoshuo Li, Xingtong Liu, Francis X. Creighton, Russell H. Taylor, and Mathias Unberath
#
# Copyright (c) 2020. Johns Hopkins University - All rights reserved.
import copy
import numpy as np
import torch
import torch.nn as nn
def torch_1d_sample(source, sample_points, mode='linear'):
"""
li... | [
2,
220,
46665,
25,
1168,
3099,
3768,
20895,
7455,
11,
1395,
278,
83,
506,
18258,
11,
12155,
1395,
13,
5844,
42993,
11,
11563,
367,
13,
8121,
11,
290,
16320,
4448,
791,
527,
776,
198,
2,
198,
2,
220,
15069,
357,
66,
8,
12131,
13,
... | 2.403577 | 1,286 |
from .base import BaseResource
class LaunchTemplate(BaseResource):
""" launch template resource to generate from current region
"""
def list_all(self):
"""list all such kind of resources from AWS
:return: list of tupe for a resource (type, name, id)
"""
ec2 = self.sessio... | [
6738,
764,
8692,
1330,
7308,
26198,
628,
198,
198,
4871,
21225,
30800,
7,
14881,
26198,
2599,
198,
220,
220,
220,
37227,
4219,
11055,
8271,
284,
7716,
422,
1459,
3814,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1351,
62,
439,... | 2.6 | 205 |
import numpy as np
import scipy.io
from sklearn.metrics import confusion_matrix
from random import randint, shuffle
from argparse import ArgumentParser
from helper import getValidDataset
import tensorflow as tf
parser = ArgumentParser()
parser.add_argument('--data', type=str, default='Indian_pines')
parser.add_argumen... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
952,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
10802,
62,
6759,
8609,
198,
6738,
4738,
1330,
43720,
600,
11,
36273,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,... | 2.558733 | 1,294 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import math
def PolarP(dist, ang):
""" polar to rectangular coordinates returning Point """
return Point(dist * math.cos(ang), dist * math.sin(ang))
if __name__ == "__main__":
# tests
v = 0.1
A = Point(-100.4627, 52.5957)
B = Point(11.0532, 52.595... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
10688,
198,
198,
4299,
32909,
47,
7,
17080,
11,
3550,
2599,
198,
220,
220,
220,
37227,
13559,
284,
36954,
2271... | 2.064748 | 278 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import time
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import tensorflow as tf
from scipy.misc import imresize
from sklearn.cross_validation import train_test_split
import _pickle as cPickle
from train import train
# In[2]:
def unpic... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
11748,
640,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355... | 2.389365 | 583 |
import random
import string
import unittest
from typing import List, Union, Dict
from config import config
from p2_assembly.mac2_data_macro import DataMacro
from p3_db.test_data import TestData
from p3_db.test_data_elements import Pnr
from p4_execution.debug import get_debug_loc, add_debug_loc, get_missed_loc
from p4_... | [
11748,
4738,
198,
11748,
4731,
198,
11748,
555,
715,
395,
198,
6738,
19720,
1330,
7343,
11,
4479,
11,
360,
713,
198,
198,
6738,
4566,
1330,
4566,
198,
6738,
279,
17,
62,
41873,
13,
20285,
17,
62,
7890,
62,
20285,
305,
1330,
6060,
14... | 3.008333 | 120 |
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
32233,
628,
628,
628,
628,
628
] | 4.04 | 25 |
from app import db
| [
6738,
598,
1330,
20613,
628
] | 4 | 5 |
# Define imports
import pygame
from pygame import *
import sys
import time
| [
2,
2896,
500,
17944,
198,
11748,
12972,
6057,
198,
6738,
12972,
6057,
1330,
1635,
198,
11748,
25064,
198,
11748,
640,
628
] | 3.619048 | 21 |
# Copyright 2012 Rackspace Hosting, Inc.
#
# 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 ... | [
2,
15069,
2321,
37927,
13200,
14504,
278,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 2.756048 | 496 |
import re
from exceptions import WordPlacementConflict
from constants import ACROSS, DOWN
| [
11748,
302,
198,
6738,
13269,
1330,
9678,
3646,
5592,
18546,
13758,
198,
198,
6738,
38491,
1330,
7125,
49,
18420,
11,
30320,
628
] | 4.181818 | 22 |
import numpy as np
import shapely
import geopandas as gpd
import xarray as xr
import matplotlib.pyplot as plt
import seaborn as sns
EPSG_3035_PROJ4 = "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +units=m +no_defs "
GREY = "#C0C0C0"
BLUE = "#4F6DB8"
YELLOW = "#FABC3C"
SUPPLY_TECHS = [
"hy... | [
11748,
299,
32152,
355,
45941,
198,
11748,
5485,
306,
198,
11748,
30324,
392,
292,
355,
27809,
67,
198,
11748,
2124,
18747,
355,
2124,
81,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
... | 2.136364 | 484 |
import os
import confuse
config = confuse.LazyConfig('ytbdl', None)
def get_loaded_config_sources():
''' Get existing configuration files
Returns:
(list): A list of (string) paths to configuration files that exist on
the file system. Returns an empty list if no configuration files
... | [
11748,
28686,
198,
198,
11748,
27531,
198,
198,
11250,
796,
27531,
13,
43,
12582,
16934,
10786,
20760,
17457,
75,
3256,
6045,
8,
198,
198,
4299,
651,
62,
14578,
62,
11250,
62,
82,
2203,
33529,
198,
220,
220,
220,
705,
7061,
3497,
4683... | 2.854839 | 310 |
from . import machine as m
from . import machine_calculator as mc
from . import my_time as mt
| [
6738,
764,
1330,
4572,
355,
285,
198,
6738,
764,
1330,
4572,
62,
9948,
3129,
1352,
355,
36650,
198,
6738,
764,
1330,
616,
62,
2435,
355,
45079,
198
] | 3.481481 | 27 |
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.models import TimeStampedModel
from stdimage import StdImageField
from stdimage.utils import UploadToUUID
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
48... | 3.620253 | 79 |
import tensorflow as tf
def shuffle_and_batch_dataset(dataset, batch_size, shuffle_buffer=None):
"""
This function is used to shuffle and batch the dataset, using shuffle_buffer
and batch_size.
"""
if shuffle_buffer is not None:
dataset = dataset.shuffle(shuffle_buffer)
dataset = datas... | [
11748,
11192,
273,
11125,
355,
48700,
628,
198,
4299,
36273,
62,
392,
62,
43501,
62,
19608,
292,
316,
7,
19608,
292,
316,
11,
15458,
62,
7857,
11,
36273,
62,
22252,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770... | 2.694413 | 877 |
#
# This file is part of Brazil Data Cube Collection Builder.
# Copyright (C) 2019-2020 INPE.
#
# Brazil Data Cube Collection Builder is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Defines a structure component to run celery work... | [
2,
198,
2,
770,
2393,
318,
636,
286,
7595,
6060,
23315,
12251,
35869,
13,
198,
2,
15069,
357,
34,
8,
13130,
12,
42334,
3268,
11401,
13,
198,
2,
198,
2,
7595,
6060,
23315,
12251,
35869,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
3... | 3.531429 | 175 |