content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import json
import sqlite3
import pandas as pd
# For PostgreSQL
import psycopg2 as psycho
from psycopg2.extras import execute_values
# .env for security -- load_dotenv necessary for python to actually go into
# .env folder and load the information
from dotenv import load_dotenv
load_dotenv()
# os filepa... | [
11748,
28686,
220,
198,
11748,
33918,
198,
11748,
44161,
578,
18,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
1114,
2947,
47701,
198,
11748,
17331,
22163,
70,
17,
355,
30731,
198,
6738,
17331,
22163,
70,
17,
13,
2302,
8847,
133... | 2.577045 | 3,459 |
rows = int(input())
x = [list(map(int, input().split())) for i in range(rows)]
print(x)
| [
8516,
796,
493,
7,
15414,
28955,
198,
87,
796,
685,
4868,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008,
329,
1312,
287,
2837,
7,
8516,
15437,
198,
4798,
7,
87,
8,
198
] | 2.588235 | 34 |
import sys
from termcolor import cprint
from colorama import init
from pyfiglet import figlet_format
import pyperclip
cprint(figlet_format('Geometry', font='small'), 'blue', attrs=['bold', 'blink'])
cprint('==============================================', 'white', attrs=['blink'])
cprint('Scientific Calculator... | [
11748,
25064,
201,
198,
6738,
3381,
8043,
1330,
269,
4798,
201,
198,
6738,
3124,
1689,
1330,
2315,
201,
198,
6738,
12972,
5647,
1616,
1330,
2336,
1616,
62,
18982,
201,
198,
11748,
12972,
525,
15036,
201,
198,
201,
198,
66,
4798,
7,
56... | 3.262774 | 137 |
from abc import ABC, abstractmethod
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
628
] | 4.111111 | 9 |
import argparse
import mmcv
from mmcv import Config
from gwd.datasets.wheat_detection import WheatDataset
from mmdet.datasets import build_dataset
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
198,
198,
11748,
8085,
33967,
198,
6738,
8085,
33967,
1330,
17056,
198,
198,
6738,
308,
16993,
13,
19608,
292,
1039,
13,
12491,
265,
62,
15255,
3213,
1330,
34744,
27354,
292,
316,
198,
6738,
8085,
15255,
13,
19608,
2... | 2.808824 | 68 |
# pylint: disable=unused-argument, pointless-string-statement
import sqlite3
from pantam import JSONResponse, PlainTextResponse
class Index:
"""
TRY THIS: curl --request GET 'http://localhost:5000'
"""
def fetch_all(self, request):
"""Fetch all items"""
database = sqlite3.connect("d... | [
2,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
11,
27158,
12,
8841,
12,
26090,
198,
198,
11748,
44161,
578,
18,
198,
6738,
15857,
321,
1330,
19449,
31077,
11,
28847,
8206,
31077,
628,
198,
4871,
12901,
25,
628,
220,
220,
22... | 2.288222 | 1,367 |
from Google import Create_Service
from googleapiclient.http import MediaFileUpload
CLIENT_SECRET_FILE = 'client_secrets.json' #API File Add Here(client Secret File)
API_NAME = 'youtube'
API_VERSION = 'v3'
SCOPES = ['https://www.googleapis.com/auth/youtube.upload']
if __name__ == "__main__":
uploadOnYoutube() | [
6738,
3012,
1330,
13610,
62,
16177,
198,
6738,
23645,
499,
291,
75,
1153,
13,
4023,
1330,
6343,
8979,
41592,
198,
198,
5097,
28495,
62,
23683,
26087,
62,
25664,
796,
705,
16366,
62,
2363,
8004,
13,
17752,
6,
220,
1303,
17614,
9220,
30... | 2.925926 | 108 |
from silkyy.service import *
from silkyy.config import Config
from tornado.testing import AsyncHTTPTestCase
from silkyy.idworker import IdWorker
import os.path
import urllib
import logging
from six.moves.urllib.parse import urlencode
logger = logging.getLogger(__name__)
| [
6738,
3313,
2584,
88,
13,
15271,
1330,
1635,
201,
198,
6738,
3313,
2584,
88,
13,
11250,
1330,
17056,
201,
198,
6738,
33718,
13,
33407,
1330,
1081,
13361,
40717,
14402,
20448,
201,
198,
6738,
3313,
2584,
88,
13,
312,
28816,
1330,
5121,
... | 2.888889 | 99 |
from django.views import generic
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from .forms import RegistrationForm
| [
6738,
42625,
14208,
13,
33571,
1330,
14276,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
11,
17594,
198,
198,
6738,
764,
23914,
1330,
24610,
8479,
... | 4.047619 | 42 |
import pandas as pd
import sklearn
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import scale
import numpy as np
from sklearn.feature_extraction import DictVectorizer as DV
from sklearn.svm import SVC, LinearSVC
import csv
# Training data
... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
1341,
35720,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
5972,
2569,
8081,
2234,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
1881,
21352,
27195,
12342,
198,
6738,
1341,
35720,
13,
... | 2.419251 | 935 |
# encoding: utf-8
try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url # Django < 1.6
from blog.models import Post, Blog
from blog import settings
urlpatterns = patterns('blog.views',
url(r'^$', 'post_list', name='blog_post_lis... | [
2,
21004,
25,
3384,
69,
12,
23,
201,
198,
28311,
25,
201,
198,
220,
220,
220,
422,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
201,
198,
16341,
17267,
12331,
25,
201,
198,
220,
220,
220,
422,
42625,
14208,
13,
10... | 2.127809 | 712 |
from Game import Piece, Position
P_gen = Position.Position
| [
6738,
3776,
1330,
27053,
11,
23158,
198,
198,
47,
62,
5235,
796,
23158,
13,
26545,
628,
628,
198
] | 3.555556 | 18 |
from hashlib import blake2s
| [
6738,
12234,
8019,
1330,
698,
539,
17,
82,
198
] | 3.111111 | 9 |
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
DOMAIN_CUSTOM_OPS_NAME = 'org.openvinotoolkit'
| [
2,
15069,
357,
34,
8,
12131,
12,
1238,
2481,
8180,
10501,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
198,
39170,
29833,
62,
34,
7759,
2662,
62,
30737,
62,
20608,
796,
705,
2398,
13,
9654,
7... | 2.62 | 50 |
from typing import Any, Dict, List, Optional, Type
import torch
from torch import nn
from torch.utils.data import DataLoader
from tqdm import tqdm
from probnmn.config import Config
class _Evaluator(object):
r"""
A base class for generic evaluation of models. This class can have multiple models interacting
... | [
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
32233,
11,
5994,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
... | 2.625276 | 1,812 |
#!/usr/bin/env python
#Author: James Nuttall (james@cromulence.co)
#Copyright (c) 2015 Cromulence LLC
#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 li... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
13838,
25,
3700,
11959,
35429,
357,
73,
1047,
31,
66,
398,
32401,
13,
1073,
8,
198,
198,
2,
15269,
357,
66,
8,
1853,
39131,
32401,
11419,
198,
198,
2,
5990,
3411,
318,
2937... | 2.805777 | 3,012 |
#!/usr/bin/env python3
import asyncio
import websockets
import heroku
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
30351,
952,
198,
11748,
2639,
11603,
198,
198,
11748,
4293,
23063,
628,
198
] | 2.96 | 25 |
class RabbitMQConfig:
"""
rabbitMQ配置对象
"""
host: str = "127.0.0.1"
port: int = 5672
username: str = "guest"
password: str = "guest",
virtual_host: str = "/"
| [
4871,
25498,
49215,
16934,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
22746,
49215,
165,
227,
235,
163,
121,
106,
43380,
117,
164,
109,
94,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2583,
25,
965,
796,
366,
16799,
13,
... | 1.96875 | 96 |
from . import ImageModels
from . import BytesModels
| [
6738,
764,
1330,
7412,
5841,
1424,
198,
6738,
764,
1330,
2750,
4879,
5841,
1424,
628
] | 3.533333 | 15 |
from pathlib import Path
ENDPOINT_BASE = 'https://api.binance.com/api/v3/'
DATA_DIRECTORY = Path(__file__).resolve().parents[1] / 'data'
DATABASE_NAME = 'binance.sqlite3'
WEIGHT_DECAY = 15.0
NUM_WORKERS = 16
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
1677,
6322,
46,
12394,
62,
33,
11159,
796,
705,
5450,
1378,
15042,
13,
8800,
590,
13,
785,
14,
15042,
14,
85,
18,
14,
6,
198,
26947,
62,
17931,
23988,
15513,
796,
10644,
7,
834,
7753,
834,
... | 2.333333 | 90 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""Example code for manipulating libreoffice Calc."""
# standard imports
import numpy as np
from pathlib import Path
import sys
sys.path.append('/home/galdino/github/py-backpack')
import backpack.libremanip
import importlib
importlib.reload(backpack.libremanip)
from bac... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
16281,
2438,
329,
29349,
9195,
260,
31810,
2199,
66,
526,
15931,
198,
198,
2,
3210,
17944,
198,
11748,
2... | 2.671997 | 2,689 |
def test_udp_service(self):
"""
Comprobacion de que el servicio asociado al protocolo coincide
Returns:
"""
port = Ports.objects.get(Tag="ssh")
udp = Udp.objects.get(id=port)
self.assertEqual(udp.get_service(), "ssh")
| [
4299,
1332,
62,
463,
79,
62,
15271,
7,
944,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
955,
1676,
65,
49443,
390,
8358,
1288,
37756,
952,
355,
1733,
4533,
435,
8435,
78,
37319,
198,
220,
220,
220,
16409,
25,
628,
220,
22... | 2.445545 | 101 |
# Generated by Django 3.2.5 on 2021-07-11 17:00
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
20,
319,
33448,
12,
2998,
12,
1157,
1596,
25,
405,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
"""
Reconstruction of image data from raw data.
"""
# TODO: define reconstruction algorithm independent device
# configurations, some reconstruction algorithms may choose to ignore
# some of that information, this way the number of electrodes and
# so on can be set as a free parameter!
# TODO: define an abstract inte... | [
37811,
198,
6690,
261,
15019,
286,
2939,
1366,
422,
8246,
1366,
13,
198,
37811,
198,
198,
2,
16926,
46,
25,
8160,
25056,
11862,
4795,
3335,
198,
2,
25412,
11,
617,
25056,
16113,
743,
3853,
284,
8856,
198,
2,
617,
286,
326,
1321,
11,... | 3.778378 | 185 |
from functools import reduce
| [
6738,
1257,
310,
10141,
1330,
4646,
628
] | 4.285714 | 7 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
# *****************************************************************************
# * | File : epd5in65f.py
# * | Author : Waveshare team
# * | Function : Electronic paper driver
# * | Info :
# *----------------
# * | This version: V1.0
# * | Date ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
41906,
17174,
4557,
35625,
198,
2,
1635,
930,
9220,
220,
220,
220,
220,
220,
220,
220,
1058,
197,
220,
2462,
67,
20,
259,
... | 3.295635 | 504 |
# Generated by Django 2.2.12 on 2020-05-01 21:46
from django.db import migrations
CREATE_POSTGIS_FTW_SCHEMA = """
CREATE SCHEMA IF NOT EXISTS postgis_ftw
"""
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1065,
319,
12131,
12,
2713,
12,
486,
2310,
25,
3510,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628,
198,
43387,
6158,
62,
32782,
38,
1797,
62,
9792,
54,
62,
50,
3398,
2763... | 2.441176 | 68 |
# encoding=utf8
import os
import random
import numpy as np
import JediML.Utility as utility
import JediML.MLBase as ml
random.seed(1)
| [
2,
21004,
28,
40477,
23,
198,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
16147,
5805,
13,
18274,
879,
355,
10361,
198,
11748,
16147,
5805,
13,
5805,
14881,
355,
25962,
198,
198,
25120,
13,
28826... | 3 | 46 |
import cv2
import numpy as np
from fer import FER
if __name__ == '__main__':
main()
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11354,
1330,
376,
1137,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
12417,
3419,
198
] | 2.606061 | 33 |
# -*- coding:utf8 -*-
import json
import tkinter as tk
from tkinter import Toplevel, ttk
from tkinter.constants import BOTH, CENTER, E, LEFT, NE, NW, RIGHT, W, X, Y
import apikeysetting as aks
import frame_one
import frame_two
import frame_three
import frame_qr
import os
#初始化配置文件
aks.initializejson()
#用于存放表格的文件夹
if no... | [
2,
532,
9,
12,
19617,
25,
40477,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
309,
643,
626,
11,
256,
30488,
198,
6738,
256,
74,
3849,
13,
9979,
1187,
1330,
347,
269... | 2.083333 | 1,284 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Database abstraction layer. Simplyfies database
handling a bit.
An example of common usecase could be as such:
# Import the module
from databaselayer import database
# Create the database
myDB = database.Database('SQLite', 'database.sql')
# Create a table
myDB.execut... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
38105,
34651,
7679,
13,
17973,
69,
444,
6831,
198,
4993,
1359,
257,
1643,
13,
198,
198,
2025,
1672,
286,
... | 1.982207 | 6,632 |
import os, shutil, shlex
from walt.common.tools import read_json
from walt.server.threads.main.network.tools import get_server_ip
from walt.server.tools import update_template
from walt.server.spec import get_server_features, SERVER_SPEC_PATH
from walt.common.tools import failsafe_makedirs
from plumbum.cmd import chroo... | [
11748,
28686,
11,
4423,
346,
11,
427,
2588,
198,
6738,
266,
2501,
13,
11321,
13,
31391,
1330,
1100,
62,
17752,
198,
6738,
266,
2501,
13,
15388,
13,
16663,
82,
13,
12417,
13,
27349,
13,
31391,
1330,
651,
62,
15388,
62,
541,
198,
6738... | 3.058824 | 119 |
from __future__ import print_function
"""
Classes for methods that do analysis of miniature synaptic potentials
Current implementations are ClementsBekkers, AndradeJonas and zero=crossing
Test run timing:
cb: 0.175 s (with cython version of algorithm); misses overlapping events
aj: 0.028 s, plus gets overlapping eve... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
37811,
198,
9487,
274,
329,
5050,
326,
466,
3781,
286,
28685,
46679,
2785,
82,
198,
198,
11297,
25504,
389,
327,
3639,
33,
988,
15949,
11,
843,
27585,
18219,
292,
290,
6632,
28,... | 2.221425 | 6,133 |
from scipy.integrate import solve_ivp
import numpy as np
import matplotlib.pyplot as plt
from Orbit import Orbit
from Orbit_solver import *
###############################################################
# Begin problem
###############################################################
# initial conditions
a = 7571
inc... | [
6738,
629,
541,
88,
13,
18908,
4873,
1330,
8494,
62,
452,
79,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
38161,
1330,
38161,
198,
198,
6738,
38161,
62,
82,
14375,
1330,... | 2.08971 | 1,895 |
# file to load the data, tokenize and update labels accordingly
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from transformers import AutoModel, AutoTokenizer, DataCollatorForTokenClassification, AutoModelForTokenClassification, TrainingArguments, Trainer
import pickle
import argparse
import r... | [
2,
2393,
284,
3440,
262,
1366,
11,
11241,
1096,
290,
4296,
14722,
16062,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
6121,
364,
133... | 2.705479 | 584 |
import numpy as np
import torch
from maskers.base_masker import BaseMasker
class PhaseMasker(BaseMasker):
"""Object for masking and demasking"""
@staticmethod
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
9335,
364,
13,
8692,
62,
27932,
263,
1330,
7308,
45195,
263,
628,
198,
4871,
18983,
45195,
263,
7,
14881,
45195,
263,
2599,
198,
220,
220,
220,
37227,
10267,
329,
9335,
278,
... | 3.207547 | 53 |
########## TOP LEVEL SIM SETUP ##########
meshfile: 'mesh/' + 'boeing_plane_final' # No file extension!
stepfile: 'mesh/boeing_plane_no_landing_gear.STEP'
case_select: 'Ex'
# umin: None # Fill these in with the max and min values of the potential when computing the external E field solutions
# umax: None
pord... | [
7804,
2235,
28662,
49277,
23749,
25823,
8577,
1303,
7804,
2,
198,
76,
5069,
7753,
25,
705,
76,
5069,
14,
6,
1343,
705,
2127,
68,
278,
62,
14382,
62,
20311,
6,
220,
220,
220,
220,
1303,
1400,
2393,
7552,
0,
198,
9662,
7753,
25,
705... | 2.419118 | 680 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
unicode_literals, annotations)
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
357,
21426,
11,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
198,
220,
220,
220,
220,... | 2.293478 | 92 |
# ipop-project
# Copyright 2016, University of Florida
#
# 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, m... | [
2,
20966,
404,
12,
16302,
198,
2,
15069,
1584,
11,
2059,
286,
4744,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169... | 3.847826 | 322 |
__author__ = 'dmorina'
from rest_framework import permissions
| [
834,
9800,
834,
796,
705,
67,
4491,
1437,
6,
198,
6738,
1334,
62,
30604,
1330,
21627,
628,
198
] | 3.555556 | 18 |
# coding: utf8
{
'Ability to customize the list of details tracked at a Shelter': 'Ability to customise the list of details tracked at a Shelter',
'Ability to customize the list of human resource tracked at a Shelter': 'Ability to customise the list of human resource tracked at a Shelter',
'Ability to customize the lis... | [
2,
19617,
25,
3384,
69,
23,
198,
90,
198,
6,
22453,
284,
24184,
262,
1351,
286,
3307,
18283,
379,
257,
36507,
10354,
705,
22453,
284,
2183,
786,
262,
1351,
286,
3307,
18283,
379,
257,
36507,
3256,
198,
6,
22453,
284,
24184,
262,
135... | 4.489869 | 3,060 |
import tempfile
from contextlib import contextmanager
from dagster import check, job, op
from dagster.core.instance import DagsterInstance, InstanceRef, InstanceType
from dagster.core.launcher import DefaultRunLauncher
from dagster.core.run_coordinator import DefaultRunCoordinator
from dagster.core.storage.compute_log... | [
11748,
20218,
7753,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
6738,
48924,
1706,
1330,
2198,
11,
1693,
11,
1034,
198,
6738,
48924,
1706,
13,
7295,
13,
39098,
1330,
32167,
1706,
33384,
11,
2262,
590,
8134,
11,
2262,
590,
6030,
... | 3.375 | 200 |
from nose.tools import eq_, ok_
from . import setup_postgres
from .test_basic import CustomModelView
from sqlalchemy.dialects.postgresql import HSTORE, JSON
| [
6738,
9686,
13,
31391,
1330,
37430,
62,
11,
12876,
62,
198,
198,
6738,
764,
1330,
9058,
62,
7353,
34239,
198,
6738,
764,
9288,
62,
35487,
1330,
8562,
17633,
7680,
198,
198,
6738,
44161,
282,
26599,
13,
38969,
478,
82,
13,
7353,
34239,... | 3.156863 | 51 |
from yowsup.structs import ProtocolEntity, ProtocolTreeNode
class IqProtocolEntity(ProtocolEntity):
'''
<iq type="{{get | set}}" id="{{id}}" xmlns="{{xmlns}}" to="{{TO}}" from="{{FROM}}">
</iq>
'''
TYPE_SET = "set"
TYPE_GET = "get"
TYPE_ERROR = "error"
TYPE_RESULT = "result"
TYPE_D... | [
6738,
331,
1666,
929,
13,
7249,
82,
1330,
20497,
32398,
11,
20497,
27660,
19667,
198,
4871,
314,
80,
19703,
4668,
32398,
7,
19703,
4668,
32398,
2599,
628,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1279,
25011,
2099,
2625,
27007,
1... | 2.320652 | 184 |
#!/usr/bin/env python3
import argparse
import psycopg2
import calendar
DBNAME = "news"
# Parse command line arguments
parser = argparse.ArgumentParser(
description='Get information from news database'
)
parser.add_argument(
"querytype",
choices=[
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
11845,
198,
11012,
20608,
796,
366,
10827,
1,
628,
628,
198,
198,
2,
2547,
325,
3141,
1627,
7159,
198,
48610,... | 1.921446 | 802 |
# Copyright 2019 The TensorFlow 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... | [
2,
15069,
13130,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
201,
198,
2,
201,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
201,
198,
2,
345,
743,
407,
779,
428,
2393,
... | 3.306763 | 414 |
from .device import (ORTDeviceInfo, get_available_devices_info,
get_cpu_device_info)
from .InferenceSession import InferenceSession_with_device
| [
6738,
764,
25202,
1330,
357,
9863,
24728,
12360,
11,
651,
62,
15182,
62,
42034,
62,
10951,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
651,
62,
36166,
62,
25202,
62,... | 2.704918 | 61 |
import pandas as pd
import numpy as np
from ultimate_data_wrangling import data_cleaning
import xgboost as xgb
from joblib import dump
from sklearn.preprocessing import MinMaxScaler
from sklearn.feature_selection import RFE
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
8713,
62,
7890,
62,
18351,
27499,
1330,
1366,
62,
2375,
7574,
198,
11748,
2124,
70,
39521,
355,
2124,
22296,
198,
6738,
1693,
8019,
1330,
10285,
198,
6738,
... | 2.830861 | 674 |
from radionets.simulations.mnist import mnist_fft
from radionets.simulations.gaussians import simulate_gaussian_sources
from radionets.simulations.sampling import sample_frequencies
from radionets.simulations.point_sources import create_point_source_img
import click
from pathlib import Path
def create_fft_images(sim_... | [
6738,
2511,
295,
1039,
13,
14323,
5768,
13,
10295,
396,
1330,
285,
77,
396,
62,
487,
83,
198,
6738,
2511,
295,
1039,
13,
14323,
5768,
13,
4908,
1046,
1547,
1330,
29308,
62,
4908,
31562,
62,
82,
2203,
198,
6738,
2511,
295,
1039,
13,
... | 2.008511 | 1,410 |
import os
from typing import Optional
import pytest
import torch
from pytest import approx
from torch.nn import Linear
from torch.nn.functional import mse_loss
from torch.optim import SGD
import ignite.distributed as idist
from ignite.engine import create_supervised_evaluator, create_supervised_trainer
from ignite.me... | [
11748,
28686,
198,
6738,
19720,
1330,
32233,
198,
198,
11748,
12972,
9288,
198,
11748,
28034,
198,
6738,
12972,
9288,
1330,
5561,
198,
6738,
28034,
13,
20471,
1330,
44800,
198,
6738,
28034,
13,
20471,
13,
45124,
1330,
285,
325,
62,
22462,... | 2.966258 | 326 |
i_am_a_variable = 9
| [
198,
72,
62,
321,
62,
64,
62,
45286,
796,
860,
198
] | 1.909091 | 11 |
import subprocess
from datetime import datetime
from inspect import isclass
from typing import Union, Any, Type, Iterable, Optional
import typing
from dateutil import tz
from cattleman.constants import UNDEFINED
from cattleman.exceptions import TypeMismatchException
from cpk.constants import CANONICAL_ARCH
... | [
11748,
850,
14681,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
10104,
1330,
318,
4871,
198,
6738,
19720,
1330,
4479,
11,
4377,
11,
5994,
11,
40806,
540,
11,
32233,
198,
198,
11748,
19720,
198,
6738,
3128,
22602,
1330,
256,
89,
... | 3.732558 | 86 |
#
# Several devices for PC are being considered or implemented.
# ==========================================================
# // port
# https://forum.micropython.org/viewtopic.php?f=2&t=3053
# I2C, https://github.com/pmp-p/I2C-Tiny-USB
# arduino + TinyPacks
# aruduino sim https://github.com/netpipe/IrrlichtDemos/... | [
2,
198,
2,
12168,
4410,
329,
4217,
389,
852,
3177,
393,
9177,
13,
198,
2,
46111,
4770,
2559,
28,
198,
198,
2,
220,
3373,
2493,
198,
2,
220,
3740,
1378,
27302,
13,
9383,
1773,
7535,
13,
2398,
14,
1177,
26652,
13,
10121,
30,
69,
2... | 2.93662 | 142 |
#!/usr/bin/python
from keras.layers import Activation,Dropout,Flatten,Dense,Conv2D,MaxPooling2D
from keras.callbacks import EarlyStopping, TensorBoard, ModelCheckpoint
from keras.models import Sequential
from datetime import datetime
import numpy as np
PATIENCE = 10
LOG_DIR_ROOT = "."
N_LAYERS = 4
MIN_NEURONS = 20
MAX... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
13144,
341,
11,
26932,
448,
11,
7414,
41769,
11,
35,
1072,
11,
3103,
85,
17,
35,
11,
11518,
27201,
278,
17,
35,
198,
6738,
41927,
292,
13,
13345,
101... | 2.627586 | 145 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from django.dispatch import receiver
from django.db.models.signals import post_save
from .models import Book
@receiver(post_save, sender=Book)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330... | 2.838235 | 68 |
# Generated by Django 3.0.4 on 2020-06-10 14:12
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
19,
319,
12131,
12,
3312,
12,
940,
1478,
25,
1065,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from PIL import Image
from tools import box_generator, BLOCK_WIDTH, BLOCK_HEIGHT, ParameterException
| [
6738,
350,
4146,
1330,
7412,
198,
198,
6738,
4899,
1330,
3091,
62,
8612,
1352,
11,
9878,
11290,
62,
54,
2389,
4221,
11,
9878,
11290,
62,
13909,
9947,
11,
25139,
2357,
16922,
628
] | 3.21875 | 32 |
from django.contrib import admin
from .models import Images, Location, Category
# Register your models here.
admin.site.register(Location)
admin.site.register(Images,admin_class=ImageAdmin)
admin.site.register(Category) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
5382,
11,
13397,
11,
21743,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
14749,
8,
198,
28482,
13,
15654,
13,
30238,
7,
293... | 3.666667 | 60 |
'''
identifica_objetos_ em escala de cinza
identifica oobetos brancos em fundo preto e desenha um círculo ao redor
'''
import cv2 as cv
import numpy as np
video_cap = cv.VideoCapture(0)
video_cap.set(3, 360)
video_cap.set(4, 640)
video_fps = int(video_cap.get(cv.CAP_PROP_FPS))
cv.namedWindow("Reguladores")
cv.resizeW... | [
7061,
6,
198,
738,
811,
64,
62,
26801,
316,
418,
62,
795,
3671,
6081,
390,
269,
259,
4496,
198,
738,
811,
64,
267,
672,
316,
418,
865,
1192,
418,
795,
1814,
78,
662,
1462,
304,
748,
268,
3099,
23781,
269,
8836,
81,
3129,
78,
257... | 2.184211 | 912 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-03 10:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.fields
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
24,
319,
1584,
12,
2931,
12,
3070,
838,
25,
3559,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
19... | 2.829545 | 88 |
# -*- coding: utf-8 -*-
'''
The cp module is used to execute the logic used by the salt-cp command
line application, salt-cp is NOT intended to broadcast large files, it is
intended to handle text files.
Salt-cp can be used to distribute configuration files
'''
# Import python libs
from __future__ import print_functio... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
464,
31396,
8265,
318,
973,
284,
12260,
262,
9156,
973,
416,
262,
8268,
12,
13155,
3141,
198,
1370,
3586,
11,
8268,
12,
13155,
318,
5626,
5292,
284,
7025... | 1.903186 | 3,202 |
from keras import models
import cairocffi as cairo
import numpy as np
import matplotlib.pyplot as plt
# load model
model = models.load_model('model_20_include_weight.h5')
# load model
# load class_name
class_names = []
with open('new_class_name.txt') as f:
class_names = f.read().splitlines()
# print(cl... | [
6738,
41927,
292,
1330,
4981,
201,
198,
11748,
1275,
7058,
66,
487,
72,
355,
1275,
7058,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
201,
198,
2,
3440,
2746,
... | 2.161651 | 3,223 |
# Generated by Django 2.2.12 on 2020-06-03 21:06
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1065,
319,
12131,
12,
3312,
12,
3070,
2310,
25,
3312,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
import gc
import sys
import weakref
# Выводит количество ссылок для объекта. Количество ссылок будет зависеть и от использования
# в стандартной библиотеке Python. Именно поэтому у `1` больше ссылок, чем у `102332`.
# Минимальное значение равно `3`, потому что сам `sys.getrefcount` создаёт временные ссылки,
# когда в... | [
11748,
308,
66,
198,
11748,
25064,
198,
11748,
4939,
5420,
628,
198,
2,
12466,
240,
45035,
38857,
25443,
112,
18849,
20375,
12466,
118,
25443,
119,
18849,
141,
229,
16843,
21727,
20375,
38857,
15166,
220,
21727,
21727,
45035,
30143,
25443,
... | 1.462583 | 2,726 |
"""Calibration routine for DSA-110 calibration with CASA.
Author: Dana Simard, dana.simard@astro.caltech.edu, 2020/06
"""
import shutil
import os
import glob
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from astropy.coordinates import Angle
import pandas
import scipy # pylint... | [
37811,
9771,
571,
1358,
8027,
329,
360,
4090,
12,
11442,
36537,
351,
35106,
32,
13,
198,
198,
13838,
25,
22937,
3184,
446,
11,
288,
2271,
13,
14323,
446,
31,
459,
305,
13,
9948,
13670,
13,
15532,
11,
12131,
14,
3312,
198,
37811,
198... | 1.981748 | 26,024 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from trackpy.static import *
import pandas as pd
import numpy as np
from numpy.testing import assert_equal, assert_almost_equal, assert_array_less
from trackpy.static import cluster
from trackpy.test... | [
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28000,
1098,
62,
17201... | 2.473795 | 477 |
""" Provide a container for building code segments. """
__author__ = "Brian Allen Vanderburg II"
__copyright__ = "Copyright 2016"
__license__ = "Apache License 2.0"
class CodeBuilder(object):
""" A code builder class. """
INDENT = 4
def __init__(self, indent=0):
""" Initialize the bu... | [
37811,
44290,
257,
9290,
329,
2615,
2438,
17894,
13,
37227,
198,
198,
834,
9800,
834,
220,
220,
220,
220,
220,
796,
366,
24761,
9659,
26669,
7423,
2873,
1,
198,
834,
22163,
4766,
834,
220,
220,
796,
366,
15269,
1584,
1,
198,
834,
43... | 2.523232 | 495 |
import os
import urllib
import urllib2
import urlparse
import cookielib
import time
from bs4 import BeautifulSoup | [
11748,
28686,
198,
11748,
2956,
297,
571,
198,
11748,
2956,
297,
571,
17,
198,
11748,
19016,
29572,
198,
11748,
4255,
8207,
571,
198,
11748,
640,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486
] | 3.323529 | 34 |
from xml.etree import ElementTree as ET
from explorecourses import *
| [
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
355,
12152,
198,
198,
6738,
7301,
66,
39975,
1330,
1635,
198
] | 3.684211 | 19 |
import numpy as np
"""
Stochastic bisection algorithm,
as described in
"Probabilistic bisection converges almost
as quickly as stochastic approximation,
Peter I. Frazier, Shane G. Henderson, Rolf Waeber"
"""
TEST_VARIABLE = "TESTVARIABLE"
def stochastic_bisection(measure,gamma=0.9,maxiter=100,ma... | [
11748,
299,
32152,
355,
45941,
198,
37811,
198,
220,
220,
220,
520,
5374,
3477,
47457,
3213,
11862,
11,
220,
198,
220,
220,
220,
355,
3417,
287,
198,
220,
220,
220,
366,
2964,
65,
14991,
2569,
47457,
3213,
6718,
3212,
2048,
220,
198,
... | 2.003686 | 814 |
# -*- coding: utf-8 -*-
"""Setup module."""
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_requires():
"""Read requirements.txt."""
requirements = open("requirements.txt", "r").read()
return list(filter(lambda x: x != "", requirements.split()))
def... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
40786,
8265,
526,
15931,
198,
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1233,
2679... | 2.526642 | 807 |
# -*- coding: utf-8 -*-
import random, time
from collections import Counter
with open('dicionario_reduzido.txt') as arquivo:
dicionario = arquivo.read().splitlines()
tp_result = open('tp_v02.txt', 'w+')
p = 0
for palavra in dicionario:
num_caracteres = len(palavra)
t1 = time.perf_counter()
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
11748,
4738,
11,
640,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
201,
198,
4480,
1280,
10786,
67,
47430,
4982,
62,
445,
10277,
17305,
13,
14116,
11537,... | 2.070845 | 367 |
from Model.Layer import Layer
| [
6738,
9104,
13,
49925,
1330,
34398,
201,
198,
201,
198
] | 3.3 | 10 |
import os
from os import path
import tempfile
from hashlib import sha1
from contextlib import contextmanager
from checksum import CHUNK_SIZE
| [
11748,
28686,
198,
6738,
28686,
1330,
3108,
198,
11748,
20218,
7753,
198,
6738,
12234,
8019,
1330,
427,
64,
16,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
6738,
8794,
388,
1330,
5870,
4944,
42,
62,
33489,
198
] | 3.736842 | 38 |
import paho.mqtt.client as mqtt
import threading
import json
import uuid
import time
import sys
import logging
from runtimemngr.runtime import RuntimeView
from runtimemngr.msgdefs import Action, Result, ARTSResponse
DEBUG=False
# TODO: do not start a new thread for each timeout
| [
198,
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
11748,
4704,
278,
198,
11748,
33918,
198,
11748,
334,
27112,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
18931,
198,
198,
6738,
1057,
16514,
368,
782,
81,... | 3.224719 | 89 |
#!/usr/bin/env python
from ibidem.advent_of_code.util import get_input_name
if __name__ == "__main__":
part1()
part2()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
24283,
28913,
13,
324,
1151,
62,
1659,
62,
8189,
13,
22602,
1330,
651,
62,
15414,
62,
3672,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
19... | 2.350877 | 57 |
import forms_builder.forms.urls # add this import
import dimension.urls
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
# Examples:
# url(r'^$'... | [
11748,
5107,
62,
38272,
13,
23914,
13,
6371,
82,
220,
1303,
751,
428,
1330,
198,
11748,
15793,
13,
6371,
82,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
... | 2.582888 | 374 |
import click
from strava.utils import input_tuple_to_secs
from strava.commands.activity_default import get_activity_from_ids
from strava.decorators import output_option, login_required
_ACTIVITY_COLUMNS = ('key', 'value')
@click.command(name='constrain',
help='Constrain the time of the activity on bo... | [
11748,
3904,
198,
6738,
3534,
6862,
13,
26791,
1330,
5128,
62,
83,
29291,
62,
1462,
62,
2363,
82,
198,
198,
6738,
3534,
6862,
13,
9503,
1746,
13,
21797,
62,
12286,
1330,
651,
62,
21797,
62,
6738,
62,
2340,
198,
6738,
3534,
6862,
13,... | 3.007317 | 410 |
import torch
import unittest
import numpy as np
from time import time
try:
import apex.amp as amp
from apex.amp import half_function
except (ModuleNotFoundError, ImportError) as e:
amp = None
from .compat import half_function
try:
from torch.cuda.amp import custom_fwd, custom_bwd
except (ModuleNot... | [
11748,
28034,
198,
11748,
555,
715,
395,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
640,
1330,
640,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
40167,
13,
696,
355,
20766,
198,
220,
220,
220,
422,
40167,
13,
696,
1330,
2063,
... | 2.653846 | 260 |
import sys
import io
sys.stdin = open("ALDS1_9_C_in4.txt", 'r')
#tmp = input()
# copy the below part and paste to the submission form.
# ---------function------------
import sys
import heapq
nodes = []
outputs = [None] * 2000000
_num_outputs = 0
calc_time = True
if calc_time:import time
main(... | [
11748,
25064,
201,
198,
11748,
33245,
201,
198,
201,
198,
201,
198,
17597,
13,
19282,
259,
796,
1280,
7203,
1847,
5258,
16,
62,
24,
62,
34,
62,
259,
19,
13,
14116,
1600,
705,
81,
11537,
201,
198,
2,
22065,
796,
5128,
3419,
201,
19... | 2.587838 | 148 |
import pathlib
| [
11748,
3108,
8019,
628
] | 4 | 4 |
import pytest
from sitri.providers.contrib.ini import IniConfigProvider
| [
11748,
12972,
9288,
198,
198,
6738,
1650,
380,
13,
15234,
4157,
13,
3642,
822,
13,
5362,
1330,
554,
72,
16934,
29495,
628,
628,
628
] | 3.25 | 24 |
import numpy as np
import matplotlib.pyplot as plt
import pickle
from handyTools import stats
from sklearn.ensemble import RandomForestClassifier
from sklearn.decomposition import PCA
# import load_xmm_data as xmm
with open('features.pkl', 'rb') as f:
feature_names, features, labels = pickle.load(f)
# features ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2298,
293,
198,
198,
6738,
15728,
33637,
1330,
9756,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
198,
... | 2.501294 | 1,159 |
import torch
import copy
from tqdm import tqdm
import torch.nn.functional as F
from ogb.nodeproppred import PygNodePropPredDataset, Evaluator
from typing import Optional, List, Union
from torch_geometric.typing import OptPairTensor, Adj, Size, OptTensor
from torch.utils.checkpoint import checkpoint
from torch import Te... | [
11748,
28034,
198,
11748,
4866,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
267,
22296,
13,
77,
375,
538,
305,
381,
445,
1330,
9485,
70,
19667,
24331,
39156,
27354,
29... | 3.410811 | 185 |
# -*- coding: utf-8 -*-
import logging
import pytz
from datetime import datetime, timedelta
from dateutil import tz
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.auth import authenticate
from django.db.models import Q, Prefetch, Sum
from django.utils.translation impor... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
11748,
12972,
22877,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
3128,
22602,
1330,
256,
89,
198,
6738,
42625,
14208,
13,
1041... | 3.742718 | 206 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# import [library]
# from [local_library] import [local_library_var]
if __name__ == '__main__':
pass
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
2,
1330,
685,
32016,
60,
198,
2,
422,
685,
12001,
62,
32016,
60,
1330,
685,
12001,
62,
32016,
62,
7785,
60,
198,
361,
11... | 2.466667 | 60 |
#!/usr/bin/env python
i = 0
while True:
i += 1
d1 = digits(i)
d2 = digits(2 * i)
if d1 == d2:
d3 = digits(3 * i)
if d1 == d3:
d4 = digits(4 * i)
if d1 == d4:
d5 = digits(5 * i)
if d1 == d5:
d6 = digits(6 * i)
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
72,
796,
657,
198,
4514,
6407,
25,
198,
220,
220,
220,
1312,
15853,
352,
198,
220,
220,
220,
288,
16,
796,
19561,
7,
72,
8,
198,
220,
220,
220,
288,
17,
796,
19561,
7,
17,
... | 1.432526 | 289 |
from fbprophet import Prophet
### Data Cleaning
| [
6738,
277,
65,
22930,
3202,
1330,
13583,
628,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
21017,
6060,
5985,
278,
198
] | 2.5 | 24 |
import onnx
from onnx import helper
from onnx import TensorProto
# This is to test the operators without "Qlinear" support but still support uint8 input
# These operators need to be internal to a graph/partition
# def GenerateModel(model_name):
if __name__ == "__main__":
GenerateModel('nnapi_internal_uint8_supp... | [
11748,
319,
77,
87,
198,
6738,
319,
77,
87,
1330,
31904,
198,
6738,
319,
77,
87,
1330,
309,
22854,
2964,
1462,
628,
198,
2,
770,
318,
284,
1332,
262,
12879,
1231,
366,
48,
29127,
1,
1104,
475,
991,
1104,
20398,
23,
5128,
198,
2,
... | 3.245098 | 102 |
#!/home/abcd/anaconda2/bin/python2.7
_description='''
This tool is used to generate pre-loadable(SW defined prototxt format <schema/DlaInterface.proto>) from caffe prototxt (<schema/caffe.proto>)
'''
import os
import inspect
import re
import sys
import argparse
import commands
import math
import logging
import copy
f... | [
2,
48443,
11195,
14,
397,
10210,
14,
272,
330,
13533,
17,
14,
8800,
14,
29412,
17,
13,
22,
198,
198,
62,
11213,
28,
7061,
6,
198,
1212,
2891,
318,
973,
284,
7716,
662,
12,
2220,
540,
7,
17887,
5447,
1237,
313,
742,
5794,
1279,
1... | 2.846914 | 405 |
from swap_user.to_email_otp.base_managers import BaseEmailOTPUserManager
class EmailOTPUserManager(BaseEmailOTPUserManager):
"""
Concrete implementation of manager for EmailOTPUser.
"""
pass
| [
6738,
16075,
62,
7220,
13,
1462,
62,
12888,
62,
313,
79,
13,
8692,
62,
805,
10321,
1330,
7308,
15333,
2394,
5105,
2655,
13511,
628,
198,
4871,
9570,
2394,
5105,
2655,
13511,
7,
14881,
15333,
2394,
5105,
2655,
13511,
2599,
198,
220,
22... | 3 | 70 |
''' A tool for generating a runnable script, which runs a python file and deletes itself after it is ran. '''
__author__ = 'David Ma'
__version__ = '1.0.0' | [
7061,
6,
317,
2891,
329,
15453,
257,
1057,
77,
540,
4226,
11,
543,
4539,
257,
21015,
2393,
290,
28128,
274,
2346,
706,
340,
318,
4966,
13,
705,
7061,
628,
198,
834,
9800,
834,
796,
705,
11006,
6669,
6,
198,
834,
9641,
834,
796,
70... | 3.14 | 50 |
## ---------------------------------------------------------------- ##
## SYNTACTIC PRIMING MODEL MANAGEMENT AND INTERFACE
## ---------------------------------------------------------------- ##
## Usage:
##
## import sp
## s = sp.Simulation(n=25)
## s.simulate()
## s.data
## ------------------------------------... | [
2235,
16529,
22492,
198,
2235,
19704,
11251,
10659,
2149,
4810,
3955,
2751,
19164,
3698,
17254,
4760,
12529,
5357,
23255,
49836,
198,
2235,
16529,
22492,
198,
2235,
29566,
25,
198,
2235,
198,
2235,
220,
220,
1330,
599,
198,
2235,
220,
220... | 1.963736 | 2,013 |
import os
import sys
import tensorflow as tf
import numpy as np
from nltk.translate.bleu_score import sentence_bleu
from nltk.translate.bleu_score import SmoothingFunction
from rouge import Rouge
import model as ml
import data
from configs import DEFINES
DATA_OUT_PATH = './data_out/'
# Req. 1-5-1. bleu score 계산 함수... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
2528,
74,
13,
7645,
17660,
13,
903,
84,
62,
26675,
1330,
6827,
62,
903,
84,
198,
6738,
299,
2528,
74,
13,
... | 2.037453 | 267 |
#------------------------------------------------------------------------------------------
# PLOT_FARGO
# A PYTHON PLOTTING CLASS TO VISUALIZE THE OUTPUT OF FARGO3D
# A. D. SCHNEIDER
# 20... | [
220,
220,
220,
1303,
10097,
22369,
438,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.453608 | 2,522 |
# Copyright (c) 2020, Zhouxing shi <zhouxingshichn@gmail.com>
# Licenced under the BSD 2-Clause License.
import os
if not "CUDA_VISIBLE_DEVICES" in os.environ:
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import torch
import numpy as np
import sys, random, time, shutil, copy, nltk, json
from multiprocessing import Po... | [
2,
15069,
357,
66,
8,
12131,
11,
10511,
22193,
278,
427,
72,
1279,
38536,
87,
654,
71,
488,
77,
31,
14816,
13,
785,
29,
198,
2,
10483,
5864,
739,
262,
347,
10305,
362,
12,
2601,
682,
13789,
13,
198,
198,
11748,
28686,
198,
361,
... | 2.332593 | 1,350 |
from jose import jwk, jwt
from jose.jwt import JWTError, JWTClaimsError, ExpiredSignatureError
from jose.utils import base64url_decode
from jose.constants import ALGORITHMS
from social_core.backends.open_id_connect import OpenIdConnectAuth
from social_core.exceptions import AuthTokenError
from tethys_services.backends... | [
6738,
474,
577,
1330,
474,
43021,
11,
474,
46569,
198,
6738,
474,
577,
13,
73,
46569,
1330,
449,
39386,
12331,
11,
449,
39386,
44819,
82,
12331,
11,
5518,
1202,
11712,
1300,
12331,
198,
6738,
474,
577,
13,
26791,
1330,
2779,
2414,
637... | 2.266578 | 754 |
x = ["p", "y", "t", "h", "o", "n"]
print(x[0:5])
import pandas as pd
marketing = pd.read_csv("https://goo.gl/6A6Qe2")
print(marketing.loc[["a", "b"], ["Views", "Clicks"]])
import numpy as np
x = np.array([1, 2, False, True, 3])
print(x)
import numpy as np
x = np.array([1, 2, False, True, "3"])
print(x)
print(t... | [
87,
796,
14631,
79,
1600,
366,
88,
1600,
366,
83,
1600,
366,
71,
1600,
366,
78,
1600,
366,
77,
8973,
198,
4798,
7,
87,
58,
15,
25,
20,
12962,
628,
198,
11748,
19798,
292,
355,
279,
67,
198,
10728,
278,
796,
279,
67,
13,
961,
6... | 1.998762 | 1,615 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 L... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
6244,
12,
7908,
366,
8199,
78,
19,
73,
553,
198,
2,
21227,
19,
73,
10710,
9564,
685,
4... | 2.34792 | 8,798 |
from PuppeteerLibrary.ikeywords.ipdf_async import iPDFAsync, DEFAULT_FILENAME_PAGE
from PuppeteerLibrary.base.librarycomponent import LibraryComponent
from PuppeteerLibrary.base.robotlibcore import keyword
| [
6738,
20926,
14471,
263,
23377,
13,
522,
88,
10879,
13,
541,
7568,
62,
292,
13361,
1330,
1312,
20456,
42367,
11,
5550,
38865,
62,
46700,
1677,
10067,
62,
4537,
8264,
198,
6738,
20926,
14471,
263,
23377,
13,
8692,
13,
32016,
42895,
1330,... | 3.491525 | 59 |