content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import numpy as np
def getPerspectiveTransform(view1_4_pts, view2_4_pts):
'''
source https://math.stackexchange.com/questions/494238/how-to-compute-homography-matrix-h-from-corresponding-points-2d-2d-planar-homog
'''
# loop through the 4 correspondences and create assemble matrix
a_list = []
fo... | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
651,
30946,
806,
425,
41762,
7,
1177,
16,
62,
19,
62,
457,
82,
11,
1570,
17,
62,
19,
62,
457,
82,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
2723,
3740,
1378,
11018,
1... | 1.830696 | 632 |
# -*- coding: utf-8 -*-
"""Setup functions
Functions used to set up the eMoL instance from a YAML file.
"""
# standard library imports
import contextlib
import json
# third-party imports
from flask import current_app
from slugify import slugify
# application imports
from emol.models import Authorization, Config, Di... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
40786,
5499,
198,
198,
24629,
2733,
973,
284,
900,
510,
262,
304,
16632,
43,
4554,
422,
257,
575,
2390,
43,
2393,
13,
198,
37811,
198,
198,
2,
3210,
5888,
17944... | 2.069401 | 2,853 |
# one city: (city name, population, federal state)
cities = [('Osnabrück',165000,'Lower Saxony'),('Münster',311000,'North Rhine-Westphalia'),('Bielefeld',333000,'North Rhine-Westphalia')]
total_population = 0
# get summed up population of all cities in list 'cities'
for city in cities:
total_population += city[2... | [
2,
530,
1748,
25,
357,
19205,
1438,
11,
3265,
11,
2717,
1181,
8,
198,
66,
871,
796,
685,
10786,
46,
16184,
397,
81,
9116,
694,
3256,
20986,
830,
4032,
31426,
29242,
1647,
33809,
10786,
44,
9116,
77,
1706,
3256,
36244,
830,
4032,
141... | 2.927273 | 110 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import asyncio
from datetime import datetime, timezone, timedelta
def split_by_char_limit(s, limit):
"""Given a string, return it split it on newlines into chunks under the given char limit.
Raise an exception if a single line exceeds the char limit.
max_ch... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
30351,
952,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
640,
11340,
11,
28805,
12514,
628,
198,
4299,
6626... | 2.689781 | 1,370 |
# Adapted from Gongfan Fang's implementation of DeepLab v3+ found at:
# https://github.com/VainF/DeepLabV3Plus-Pytorch
# Also used Yude Wang's implementation as a reference:
# https://github.com/YudeWang/deeplabv3plus-pytorch
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
imp... | [
2,
30019,
276,
422,
47142,
24408,
24468,
338,
7822,
286,
10766,
17822,
410,
18,
10,
1043,
379,
25,
198,
2,
3740,
1378,
12567,
13,
785,
14,
53,
391,
37,
14,
29744,
17822,
53,
18,
17860,
12,
20519,
13165,
354,
198,
2,
4418,
973,
575... | 3.037975 | 237 |
"""Showcases overall *Colour* examples."""
import numpy as np
import warnings
import colour
from colour.utilities import (
filter_warnings,
message_box,
warning,
runtime_warning,
usage_warning,
)
message_box("Automatic Colour Conversion Graph")
message_box(
'Starting with version "0.3.14", "... | [
37811,
15307,
33964,
4045,
1635,
5216,
454,
9,
6096,
526,
15931,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
14601,
198,
198,
11748,
9568,
198,
6738,
9568,
13,
315,
2410,
1330,
357,
198,
220,
220,
220,
8106,
62,
40539,
654,
1... | 2.079568 | 3,054 |
from django.contrib.auth.mixins import PermissionRequiredMixin, PermissionDenied
class TransactionPermissionMixin(PermissionRequiredMixin):
"""
Mixin has to come last in MRO because logic is based on transaction type
""" | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
19816,
1040,
1330,
2448,
3411,
37374,
35608,
259,
11,
2448,
3411,
21306,
798,
198,
198,
4871,
45389,
5990,
3411,
35608,
259,
7,
5990,
3411,
37374,
35608,
259,
2599,
198,
220,
220,
220,
... | 3.477612 | 67 |
import numpy as np
import pandas as pd
from datetime import datetime
from sqlalchemy import create_engine
data = {
'X': [78, 85, 96, 80, 86],
'Y': [84, 94, 89, 83, 86],
'Z': [86, 97, 96, 72, 83]
}
data2 = {
'A': [44, 54, 56, 9, 77],
'B': [55, 94, 56, 75, 74],
'C': [66, 700, 90, 44, 23]
}
data... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
198,
7890,
796,
1391,
198,
220,
220,
220,
705,
55,
10354,
685,
369... | 2.184697 | 379 |
# Copyright 2022 The HuggingFace Team. 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 applicabl... | [
2,
15069,
33160,
383,
12905,
2667,
32388,
4816,
13,
1439,
2489,
10395,
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,... | 3.089041 | 584 |
from .lyft import LyftDataset
from .eval import get_lyft_eval_result
__all__ = ["LyftDataset", "get_lyft_eval_result"]
| [
6738,
764,
306,
701,
1330,
38928,
27354,
292,
316,
198,
6738,
764,
18206,
1330,
651,
62,
306,
701,
62,
18206,
62,
20274,
198,
198,
834,
439,
834,
796,
14631,
31633,
701,
27354,
292,
316,
1600,
366,
1136,
62,
306,
701,
62,
18206,
62,... | 2.608696 | 46 |
import time
import pygame as pg
from pygame.surface import Surface
from bomber_monkey.features.display.image import Image
from bomber_monkey.features.player.players_config import PlayersConfig
from bomber_monkey.game_config import GameConfig, BLUE_MONKEY_COLOR, BLACK_COLOR, GAME_FONT
from bomber_monkey.game_scores im... | [
11748,
640,
198,
198,
11748,
12972,
6057,
355,
23241,
198,
6738,
12972,
6057,
13,
42029,
1330,
20321,
198,
198,
6738,
24065,
62,
49572,
13,
40890,
13,
13812,
13,
9060,
1330,
7412,
198,
6738,
24065,
62,
49572,
13,
40890,
13,
7829,
13,
... | 2.594512 | 328 |
#! /usr/bin/env python
"""
Module with functions related to image coordinates and coordinate conversions.
"""
__author__ = 'Carlos Alberto Gomez Gonzalez, Valentin Christiaens'
__all__ = ['dist',
'dist_matrix',
'frame_center',
'cart_to_pol',
'pol_to_cart',
'pol_t... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
26796,
351,
5499,
3519,
284,
2939,
22715,
290,
20435,
32626,
13,
198,
37811,
198,
198,
834,
9800,
834,
796,
705,
26886,
418,
40649,
33231,
24416,
11,
17284,
259,
195... | 2.18039 | 4,202 |
from enum import Enum
from pytorch_pretrained_bert import BertTokenizer, BertModel, BertAdam
from pytorch_pretrained_bert.modeling import BertLayerNorm
from data_utils.readers.span_pred_reader import BertSpanPredReader
import flint.span_util as span_util
import flint.torch_util as torch_util
import torch.nn as nn
fro... | [
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
12972,
13165,
354,
62,
5310,
13363,
62,
4835,
1330,
22108,
30642,
7509,
11,
22108,
17633,
11,
22108,
23159,
198,
6738,
12972,
13165,
354,
62,
5310,
13363,
62,
4835,
13,
4666,
10809,
1330,
22... | 2.794038 | 369 |
# Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... | [
2,
15069,
357,
66,
8,
2211,
34198,
10442,
3457,
13,
198,
2,
220,
198,
2,
7102,
37,
25256,
12576,
5357,
4810,
3185,
7112,
2767,
13153,
198,
2,
220,
198,
2,
770,
670,
318,
2810,
366,
1921,
3180,
1,
290,
2426,
284,
262,
34198,
37709,... | 2.758232 | 1,154 |
import tables
import tempfile
import shutil
from ctapipe.core import run_tool
from pathlib import Path
from ctapipe.tools.process import ProcessorTool
try:
from importlib.resources import files
except ImportError:
from importlib_resources import files
| [
11748,
8893,
198,
11748,
20218,
7753,
198,
11748,
4423,
346,
198,
198,
6738,
269,
44335,
3757,
13,
7295,
1330,
1057,
62,
25981,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
269,
44335,
3757,
13,
31391,
13,
14681,
1330,
32893,
253... | 3.573333 | 75 |
#!/usr/bin/python
#
# Copyright 2016 Pinterest, 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... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
1584,
17334,
11,
3457,
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,
... | 2.34122 | 4,311 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import pexpect
# (current) UNIX password:
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
613,
87,
806,
198,
198,
2,
357,
14421,
8,
4725,
10426,
9206,
25,
198,
198,
361,
11593,
3672,
8... | 2.220339 | 59 |
from abcpy.discretemodels import *
from tests.probabilisticmodels_tests import AbstractAPIImplementationTests
import unittest
"""Tests whether the methods defined for discrete probabilistic models are working as intended."""
class CheckParametersAtInitializationTests(unittest.TestCase):
"""Tests that no probabi... | [
6738,
450,
66,
9078,
13,
15410,
1186,
368,
375,
1424,
1330,
1635,
198,
6738,
5254,
13,
1676,
65,
14991,
2569,
27530,
62,
41989,
1330,
27741,
17614,
3546,
32851,
51,
3558,
198,
198,
11748,
555,
715,
395,
198,
198,
37811,
51,
3558,
1771... | 3.701439 | 278 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.core.testing_utils as testing_utils
SKIP_TESTS = False
try:
import fairseq # noqa: F... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,... | 2.759259 | 270 |
import click
from clients.services import ClientServices
from clients.models import Client
@click.group()
def clients():
""" Manages the clients lifecycle"""
pass
@clients.command()
@click.option('-n', '--name',
type=str,
prompt=True,
help='The client name')
... | [
11748,
3904,
198,
6738,
7534,
13,
30416,
1330,
20985,
31007,
198,
6738,
7534,
13,
27530,
1330,
20985,
628,
198,
31,
12976,
13,
8094,
3419,
198,
4299,
7534,
33529,
198,
220,
220,
220,
37227,
1869,
1095,
262,
7534,
3868,
47510,
37811,
198... | 2.351178 | 1,401 |
# -*- coding: utf-8 -*-
"""Module containing the logic for updating DNS records using the duckdns protocol.
From the duckdns.org website:
https://{DOMAIN}/update?domains={DOMAINLIST}&token={TOKEN}&ip={IP}
where:
DOMAIN the service domain
DOMAINLIST is either a single domain or a comma separated list of doma... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
26796,
7268,
262,
9156,
329,
19698,
18538,
4406,
1262,
262,
22045,
67,
5907,
8435,
13,
198,
198,
4863,
262,
22045,
67,
5907,
13,
2398,
3052,
25,
198,
198,
... | 2.519065 | 813 |
import time
import os
# As you can see, its not very optimal
| [
11748,
640,
198,
11748,
28686,
198,
198,
2,
1081,
345,
460,
766,
11,
663,
407,
845,
16586,
220,
628
] | 3.368421 | 19 |
#!usr/bin/env python
# -*- coding:utf-8 -*-
# Create on 2017.2.24
import json
import time
import click
import datetime
import schedule
import threading
from collector import tasks
from collector.handler import CollectHandler
from libs.database.mongodb.projectdb import Project
from django.conf import settings
clas... | [
2,
0,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
13610,
319,
2177,
13,
17,
13,
1731,
628,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
3904,
198,
11748,
4818,
8079,
19... | 2.157118 | 2,915 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 12 15:27:06 2019
@author: weiji
"""
import random
from keras.models import Sequential
from keras.layers import LSTM
from keras.layers import Dense
from keras.layers import TimeDistributed
from keras.layers import Bidirectional
import tensorflow as... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
4280,
1105,
1315,
25,
1983,
25,
3312,
13130,
198,
198,
31,
9800,
25,
356,
20770,
1... | 2.315762 | 3,813 |
# -*- encoding: utf-8 -*-
'''
Current module: pyrunner.ext.idleshell.diyrpc
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: lkf20031988@163.com
RCS: rock4.common.dev.i... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
7061,
6,
201,
198,
11297,
8265,
25,
279,
2417,
403,
1008,
13,
2302,
13,
312,
829,
12758,
13,
10989,
2417,
14751,
201,
198,
201,
198,
49,
619,
2196,
2106,
25,
20... | 1.942021 | 1,811 |
import json
config = json.load(open('config/config.json'))
config['all_lexicons'] = json.load(open('config/lexicons.json'))
config['lexiconpath'] = {}
for lex in config['all_lexicons']:
config['lexiconpath'][lex['name']] = 'config/%s.json' % lex['name']
| [
11748,
33918,
198,
198,
11250,
796,
33918,
13,
2220,
7,
9654,
10786,
11250,
14,
11250,
13,
17752,
6,
4008,
198,
11250,
17816,
439,
62,
2588,
34280,
20520,
796,
33918,
13,
2220,
7,
9654,
10786,
11250,
14,
2588,
34280,
13,
17752,
6,
400... | 2.755319 | 94 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: openedge_function_runtime.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import re... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
4721,
469,
62,
8818,
62,
43282,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
17597,
13,
9641,
62,
10951,
58,
15,
60,
27,
18... | 2.460635 | 1,702 |
from gan_training.decoder import models
decoder_dict = {
'default': models.ReluNetworkDisentangle,
}
| [
6738,
308,
272,
62,
34409,
13,
12501,
12342,
1330,
4981,
198,
198,
12501,
12342,
62,
11600,
796,
1391,
198,
220,
220,
220,
705,
12286,
10354,
4981,
13,
6892,
84,
26245,
7279,
298,
9248,
11,
198,
92,
198
] | 2.864865 | 37 |
"""
Provides useful stuff, generally!
"""
from typing import Optional
class PossiblyIncompleteDict:
"""
A dict kind of thing (only supporting item getting) that, if an item isn't
available, gets fresh data from a refresh function.
"""
@staticmethod
def _del_nul(elem):
"""
eleg... | [
37811,
198,
15946,
1460,
4465,
3404,
11,
4143,
0,
198,
37811,
198,
6738,
19720,
1330,
32233,
628,
198,
4871,
43046,
818,
20751,
35,
713,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
8633,
1611,
286,
1517,
357,
8807,
6493,
... | 2.302174 | 1,380 |
import spotipy.util as util
from progress.bar import Bar
import numpy as np
from bs4 import BeautifulSoup
import pandas as pd
from wordcloud import WordCloud, STOPWORDS
import json, requests, urllib.parse, re, time, sys, click, spotipy, os
if __name__ == "__main__":
main()
# command = 'blender -b --pytho... | [
11748,
4136,
541,
88,
13,
22602,
355,
7736,
198,
6738,
4371,
13,
5657,
1330,
2409,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1573,
17721,
1330,... | 2.881356 | 118 |
# Author: Nikolaos Perrakis <nikos@nannyml.com>
#
# License: Apache Software License 2.0
"""Utility module offering curated datasets for quick experimentation."""
from importlib import resources
from pandas import DataFrame, read_csv
DATA_MODULE = "nannyml.datasets.data"
def load_csv_file_to_df(local_file: st... | [
2,
220,
6434,
25,
220,
47817,
418,
2448,
17716,
271,
220,
1279,
17187,
418,
31,
77,
7737,
4029,
13,
785,
29,
198,
2,
198,
2,
220,
13789,
25,
24843,
10442,
13789,
362,
13,
15,
198,
198,
37811,
18274,
879,
8265,
6011,
36768,
40522,
... | 3.156693 | 1,270 |
# 312. Burst Balloons
# ttungl@gmail.com
| [
2,
34465,
13,
30635,
6932,
13022,
198,
2,
256,
83,
2150,
75,
31,
14816,
13,
785,
198
] | 2.411765 | 17 |
import os.path
import subprocess
import sys
import tkinter as tk
from logging import getLogger
from tkinter import messagebox, ttk
from typing import Any, Dict
import thonny
from thonny import get_runner, get_workbench, running, ui_utils
from thonny.common import (
InlineCommand,
InlineResponse,
ToplevelCo... | [
11748,
28686,
13,
6978,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
11,
256,
30488,
198,
6738,
19720,
1330,
... | 2.948454 | 291 |
"""State Model"""
from django.db import models
from reservas.utils.models import BookingAudit
| [
37811,
9012,
9104,
37811,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
5463,
292,
13,
26791,
13,
27530,
1330,
4897,
278,
16353,
270,
628
] | 3.653846 | 26 |
from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
# Tell distutils to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme i... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
6738,
1233,
26791,
13,
21812,
13,
17350,
1330,
40589,
7036,
62,
50,
3398,
3620,
1546,
198,
198,
2,
14026,
1233,
26791,
284,
1234,
262,
1366,
62,
16624,
287,
3859,
12,
11423,
9988,
198,
2,
... | 2.554717 | 530 |
"""
DNS Plugin driver
Overrides the default evaluator plugin handling so we can check for legit IPs for UDP tests.
"""
import argparse
import calendar
import copy
import logging
import os
import random
import socket
import sys
import tempfile
import time
import traceback
import urllib.request
import requests
socket... | [
37811,
198,
35,
8035,
42636,
4639,
198,
198,
5886,
81,
1460,
262,
4277,
5418,
84,
1352,
13877,
9041,
523,
356,
460,
2198,
329,
6984,
6101,
82,
329,
36428,
5254,
13,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
11845,
198,
117... | 2.408371 | 2,461 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is the main file of btn4ws.
#
# Copyright (c) 1999-2009 Jan Dittberner <jan@dittberner.info>
#
# This file is part of btn4ws.
#
# btn4ws is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
770,
318,
262,
1388,
2393,
286,
275,
34106,
19,
18504,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
7358,
12,
10531,
... | 2.246753 | 3,927 |
import os
import uuid
import random
import unittest
import pprint
from langcodes import Language
from spaceone.core import config
from spaceone.core import pygrpc
from spaceone.core import utils
from spaceone.core.unittest.runner import RichTestRunner
from google.protobuf.json_format import MessageToDict
if __name_... | [
11748,
28686,
198,
11748,
334,
27112,
198,
11748,
4738,
198,
11748,
555,
715,
395,
198,
11748,
279,
4798,
198,
6738,
42392,
40148,
1330,
15417,
198,
6738,
2272,
505,
13,
7295,
1330,
4566,
198,
6738,
2272,
505,
13,
7295,
1330,
12972,
216... | 3.359649 | 114 |
from typing import Dict
import requests
from seki.conf import DRONE_SERVER, DRONE_TOKEN, SEKI_PROJECT_OWNER, SEKI_PROJECT_REPO
| [
6738,
19720,
1330,
360,
713,
198,
198,
11748,
7007,
198,
198,
6738,
384,
4106,
13,
10414,
1330,
10560,
11651,
62,
35009,
5959,
11,
10560,
11651,
62,
10468,
43959,
11,
7946,
37845,
62,
31190,
23680,
62,
14165,
1137,
11,
7946,
37845,
62,
... | 2.765957 | 47 |
from __future__ import absolute_import, division, print_function
import os
from appr.commands.command_base import CommandBase
from appr.pack import ApprPackage
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
198,
6738,
598,
81,
13,
9503,
1746,
13,
21812,
62,
8692,
1330,
9455,
14881,
198,
6738,
598,
81,
13,
8002,
1330,
2034,
81,
278... | 3.704545 | 44 |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2018 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
from pandapower.auxiliary import _sum_by_group
from pandapower.idx_bus import VM, VA, PD, QD, LAM_P, LAM_Q, BAS... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
1584,
12,
7908,
416,
2059,
286,
15035,
741,
290,
39313,
403,
71,
30288,
5136,
329,
6682,
18963,
198,
2,
290,
6682,
4482,
8987,
357,
40,
65... | 2.452153 | 836 |
"""
The MIT License (MIT)
Copyright (c) 2014 Trustly Group AB
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, me... | [
37811,
198,
464,
17168,
13789,
357,
36393,
8,
198,
198,
15269,
357,
66,
8,
1946,
9870,
306,
4912,
9564,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
39... | 3.71517 | 323 |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .models import *
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
764,
27530,
1330,
1635,
198,
198,
2,
13610,
534,
5009,
994,
13,
198
] | 3.771429 | 35 |
import unittest
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.357143 | 28 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
3012,
11419,
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,
13,
198,
2,
921,
743,
733... | 3.104499 | 689 |
# coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.PutRelatie import PutRelatie
from OTLMOW.OTLModel.Datatypes.DtcDocument import DtcDocument
from OTLMOW.OTLModel.Datatypes.KlKamerKlasse import KlKamerKlasse
from OTLMOW.OTLModel.Datatypes.KlPutMateriaal import ... | [
2,
19617,
28,
40477,
12,
23,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,
13,
14881,
9487,
274,
13,
2394,
43,
8086,
822,
84,
315,
1330,
440,
14990,
8086,
822,
84,
315,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,... | 2.348148 | 945 |
#
# This file is part Protein Engineering Analysis Tool (PEAT)
# (C) Copyright Jens Erik Nielsen, University College Dublin 2003-
# All rights reserved
#
#
# Written by D Farrell, April 2008
#
from Tkinter import *
import csv
class TableImporter:
"""Provides import utility methods for the Table and Table Model ... | [
2,
198,
2,
770,
2393,
318,
636,
31702,
14044,
14691,
16984,
357,
11401,
1404,
8,
198,
2,
357,
34,
8,
15069,
449,
641,
22722,
31154,
11,
2059,
5535,
18220,
5816,
12,
198,
2,
1439,
2489,
10395,
198,
2,
220,
220,
198,
2,
198,
2,
22... | 2.026886 | 2,306 |
import sys
N = int(sys.stdin.readline())
numList = list(map(int, sys.stdin.readline().split()))
operator = list(map(int, sys.stdin.readline().split()))
minimum = 1e9
maximum = -1e9
now = numList[0]
result(now, 1)
print(maximum)
print(minimum)
| [
11748,
25064,
198,
198,
45,
796,
493,
7,
17597,
13,
19282,
259,
13,
961,
1370,
28955,
198,
22510,
8053,
796,
1351,
7,
8899,
7,
600,
11,
25064,
13,
19282,
259,
13,
961,
1370,
22446,
35312,
3419,
4008,
198,
46616,
796,
1351,
7,
8899,
... | 2.510204 | 98 |
from summarize_contig_identities_and_alignments import parse_reads, export_chromosome_summary_to_csv, export_genome_summary_to_csv
from handlers.FastaHandler import FastaHandler
from handlers.FileManager import FileManager
from handlers.BamHandler import BamHandler
from multiprocessing import Manager, Pool, cpu_count
i... | [
6738,
35743,
62,
3642,
328,
62,
738,
871,
62,
392,
62,
31494,
902,
1330,
21136,
62,
40779,
11,
10784,
62,
28663,
418,
462,
62,
49736,
62,
1462,
62,
40664,
11,
10784,
62,
5235,
462,
62,
49736,
62,
1462,
62,
40664,
198,
6738,
32847,
... | 2.652214 | 1,084 |
#!/usr/bin/env python3
# coding:utf-8
# 只是引入“泡菜”而已,并不是新的思路
import os, pickle
def save_text(pf, text):
'''保存文件'''
with open(pf, 'wb') as f:
pickle.dump(text, f)
def load_text(pf):
'''载入文件'''
with open(pf, 'rb') as f:
text = pickle.load(f)
print(text)
if __name__ == "__main__":... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
19617,
25,
40477,
12,
23,
198,
198,
2,
10263,
237,
103,
42468,
28156,
243,
17739,
98,
447,
250,
37345,
94,
164,
237,
250,
447,
251,
32003,
234,
32432,
110,
171,
120,
234,
33... | 1.558685 | 213 |
from app.models import db, Recipe
# Adds a demo location, you can add other locations here if you want
# Uses a raw SQL query to TRUNCATE the locations table.
# SQLAlchemy doesn't have a built in function to do this
# TRUNCATE Removes all the data from the table, and resets
# the auto incrementing primary key
| [
6738,
598,
13,
27530,
1330,
20613,
11,
26694,
628,
198,
2,
34333,
257,
13605,
4067,
11,
345,
460,
751,
584,
7064,
994,
611,
345,
765,
198,
198,
2,
36965,
257,
8246,
16363,
12405,
284,
7579,
4944,
34,
6158,
262,
7064,
3084,
13,
198,
... | 3.75 | 84 |
import json
import logging
import os
from arm_prosthesis.external_communication.models.dto.get_settings_dto import GetSettingsDto
from arm_prosthesis.external_communication.models.dto.set_settings_dto import SetSettingsDto
| [
11748,
33918,
201,
198,
11748,
18931,
201,
198,
11748,
28686,
201,
198,
201,
198,
6738,
3211,
62,
1676,
301,
8497,
13,
22615,
62,
32560,
13,
27530,
13,
67,
1462,
13,
1136,
62,
33692,
62,
67,
1462,
1330,
3497,
26232,
35,
1462,
201,
1... | 3.135135 | 74 |
import os
import re
import json
from . import tasks
from falcon import HTTPInternalServerError, HTTP_201
from bson.objectid import ObjectId
from .tools import TODOException
from .models import *
from pprint import pprint
from urllib.parse import quote
movie_name_and_year = re.compile("(.*)\((.*)\)")
| [
11748,
28686,
198,
11748,
302,
198,
11748,
33918,
198,
6738,
764,
1330,
8861,
198,
6738,
24215,
1102,
1330,
14626,
37693,
10697,
12331,
11,
14626,
62,
1264,
198,
6738,
275,
1559,
13,
15252,
312,
1330,
9515,
7390,
198,
6738,
764,
31391,
... | 3.377778 | 90 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 8 03:04:49 2021
@author: ike
"""
import os
import shutil
import string
import os.path as op
from glob import glob as gg
ALLOWED = "".join((string.ascii_letters, string.digits, " ", "_", "-"))
def getPath(*args, ext=None):
"""
Convert ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
2758,
220,
807,
7643,
25,
3023,
25,
2920,
33448,
198,
198,
31,
9800,
25,
220,
522,... | 2.693354 | 1,911 |
# _____ ______ _____
# / ____/ /\ | ____ | __ \
# | | / \ | |__ | |__) | Caer - Modern Computer Vision
# | | / /\ \ | __| | _ / Languages: Python, C, C++
# | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer
# \_____\/_/ \_ \______ |_| \_\
# Licensed ... | [
2,
220,
220,
220,
220,
29343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44435,
220,
220,
29343,
220,
198,
2,
220,
1220,
220,
1427,
14,
220,
220,
220,
1220,
59,
220,
220,
220,
930,
220,
220,
1427,
930,
220,
11593,
3467,
1... | 1.835317 | 1,008 |
from django.test import TestCase
from django.urls import reverse
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import test, status
from authors.apps.authentication.models import User
from authors.apps.articles.models import Article, FavoriteModel
from authors.apps.notify.models import Notifi... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
6738,
1334,
62,
30604,
1330,
1332,
11,
3722... | 4.125 | 96 |
from datetime import timedelta
from unittest.mock import create_autospec, patch
import pytest
import garden.utils as utils
from garden import models
@pytest.mark.unit
| [
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
2251,
62,
2306,
418,
43106,
11,
8529,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
11376,
13,
26791,
355,
3384,
4487,
198,
6738,
11376,
1330,
4981,
6... | 3.352941 | 51 |
OUT_FOLDER = 'out/'
BUCKET_CONFIG_PATH = OUT_FOLDER + 'categoryBuckets.json'
SELECTION_CACHE_PATH = OUT_FOLDER + "selection.json"
| [
198,
12425,
62,
37,
3535,
14418,
796,
705,
448,
14,
6,
198,
33,
16696,
2767,
62,
10943,
16254,
62,
34219,
796,
16289,
62,
37,
3535,
14418,
1343,
705,
22872,
33,
1347,
1039,
13,
17752,
6,
198,
198,
46506,
2849,
62,
34,
2246,
13909,
... | 2.275862 | 58 |
from rest_framework import serializers
from .models import Posts, Url
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
764,
27530,
1330,
12043,
11,
8799,
75,
628,
198
] | 4 | 18 |
import torch, sys, argparse, ipdb, joblib
import numpy as np
from tqdm import tqdm
if __name__ == "__main__":
args = parser_args()
args = vars(args)
paths = [f'rest/{args["dataset"]}/{args["model"]}/rest_{i}.pt' for i in range(args['num_nodes'])]
dataset_matrix, dataset_text = [], []
for ... | [
11748,
28034,
11,
25064,
11,
1822,
29572,
11,
20966,
9945,
11,
1693,
8019,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
22... | 2.280285 | 421 |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
2,
15069,
7358,
12,
1238,
2481,
41992,
4912,
31703,
12052,
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,
... | 3.835616 | 219 |
"""
test_utils
----------
"""
import numpy as np
from ..utils.sampling_utils import create_times_randompoints,\
create_times_randomregimes, create_times_randombursts
from ..utils.util_operations import join_regimes, format_as_regular_ts,\
apply_gaussianconvolved_ts
from ..utils.sliding_utils import sliding_... | [
198,
37811,
198,
9288,
62,
26791,
198,
35937,
198,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
11485,
26791,
13,
37687,
11347,
62,
26791,
1330,
2251,
62,
22355,
62,
25192,
3361,
1563,
82,
11,
59,
198,
220,
220... | 2.923077 | 143 |
from rdkit import DataStructs
allchems = read()
print(len(allchems))
for i in range(100):
sims = get_similar(allchems[i],allchems,0.90)
print(allchems[i])
print('---')
for s in sims:
print(s)
print('+++++++++++++++++\n')
| [
6738,
374,
67,
15813,
1330,
6060,
44909,
82,
628,
198,
439,
2395,
907,
796,
1100,
3419,
198,
4798,
7,
11925,
7,
439,
2395,
907,
4008,
198,
198,
1640,
1312,
287,
2837,
7,
3064,
2599,
198,
220,
220,
220,
985,
82,
796,
651,
62,
38610... | 2.230088 | 113 |
# -*- coding: utf-8 -*-
'''
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
'''
from __future__ import unicode_literals
from ..model.workbook_filte... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
220,
198,
7061,
6,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
220,
1439,
6923,
33876,
13,
220,
49962,
739,
262,
17168,
13789,
13,
220,
4091,
13789,
287,
262,
1628,
6808,
... | 3.57265 | 117 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 3.688073 | 109 |
import mxnet as mx
import numpy as np
class Loss(mx.metric.EvalMetric):
"""Calculate loss"""
class Accuracy(mx.metric.EvalMetric):
"""Calculate accuracy"""
| [
11748,
285,
87,
3262,
355,
285,
87,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4871,
22014,
7,
36802,
13,
4164,
1173,
13,
36,
2100,
9171,
1173,
2599,
198,
220,
220,
220,
37227,
9771,
3129,
378,
2994,
37811,
628,
198,
4871,
33222,
... | 2.625 | 64 |
#!/usr/bin/python3
#Copyright 2017 Michael Kirsch
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
#to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
15269,
2177,
3899,
7385,
20601,
198,
198,
2,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
116... | 3.546713 | 289 |
import argparse
import inspect
import random
import pickle
import turtle
if __name__ == '__main__':
fns = {"line": draw_line,
"squares": draw_squares_until_escaped,
"triangles": draw_triangles,
"spirangles" : draw_random_spirangles}
parser = argparse.ArgumentParser()
parser.add_argumen... | [
11748,
1822,
29572,
198,
11748,
10104,
198,
11748,
4738,
198,
11748,
2298,
293,
198,
11748,
28699,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
277,
5907,
796,
19779,
1370,
1298,
3197,
62,
1370,
11,... | 2.466454 | 313 |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2010 California Institute of Technology. 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 th... | [
2,
27156,
27156,
27156,
27156,
15116,
8728,
4907,
93,
198,
2,
15069,
3050,
3442,
5136,
286,
8987,
13,
11096,
371,
34874,
15731,
1137,
53,
1961,
13,
198,
2,
220,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
116... | 3.438762 | 743 |
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-07-06 14:02:20.222384
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... | [
2,
0,
514,
81,
14,
8800,
14,
29412,
18,
13,
21,
198,
37811,
198,
220,
220,
220,
19937,
7317,
8295,
7560,
1262,
569,
20,
38062,
341,
3696,
422,
38348,
3539,
569,
20,
371,
2078,
319,
12131,
12,
2998,
12,
3312,
1478,
25,
2999,
25,
... | 1.820658 | 1,946 |
#
# Copyright (c) 2013-2015 Christopher L. Felton
#
import traceback
import pytest
import argparse
from myhdl import *
from rhea.cores.spi import spi_controller
from rhea.cores.spi import SPIBus
from rhea.models.spi import SPIEEPROM
from rhea.system import Global, Clock, Reset
from rhea.system import Wishbone
from... | [
2,
198,
2,
15069,
357,
66,
8,
2211,
12,
4626,
12803,
406,
13,
13937,
1122,
198,
2,
198,
198,
11748,
12854,
1891,
198,
11748,
12972,
9288,
198,
11748,
1822,
29572,
198,
198,
6738,
616,
71,
25404,
1330,
1635,
198,
198,
6738,
374,
2163... | 2.734807 | 181 |
# -*- coding: utf-8 -*-
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
628
] | 1.8 | 15 |
# extracts features of 1d array like data.
import numpy as np
import scipy
from scipy.stats import norm, rankdata
class Trends(Features):
"""
Arguments:
x array/list/series: 1d array or array like whose features are to be calculated.
"""
def sen_slope(self, alpha=None):
# https://github.... | [
2,
32139,
3033,
286,
352,
67,
7177,
588,
1366,
13,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
198,
6738,
629,
541,
88,
13,
34242,
1330,
2593,
11,
4279,
7890,
198,
198,
4871,
34308,
7,
23595,
2599,
628,
220,
... | 2.081317 | 3,431 |
default_app_config = 'vacancies.apps.VacanciesConfig'
| [
12286,
62,
1324,
62,
11250,
796,
705,
85,
330,
16183,
13,
18211,
13,
53,
330,
16183,
16934,
6,
198
] | 2.842105 | 19 |
import os
import os.path
import scipy.io as sio
import numpy as np
import struct
dataset_dir = "D:/Cache/Git/HandPointNet/data/cvpr15_MSRAHandGestureDB/"
save_dir = "./"
sub_names = ['P0', 'P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7', 'P8']
ges_names = ['1', '2', '3', '4', '5', '6', '7', '8',
'9', 'I', 'IP',... | [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
629,
541,
88,
13,
952,
355,
264,
952,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2878,
198,
198,
19608,
292,
316,
62,
15908,
796,
366,
35,
14079,
30562,
14,
38,
270,
14,
12... | 1.853659 | 205 |
import factory
from intake import models
from user_accounts.tests.factories import UserFactory
from .tag_factory import TagFactory
from .form_submission_factory import FormSubmissionFactory
| [
11748,
8860,
198,
6738,
10337,
1330,
4981,
198,
6738,
2836,
62,
23317,
82,
13,
41989,
13,
22584,
1749,
1330,
11787,
22810,
198,
6738,
764,
12985,
62,
69,
9548,
1330,
17467,
22810,
198,
6738,
764,
687,
62,
7266,
3411,
62,
69,
9548,
133... | 4.06383 | 47 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import numpy as np
import pandas as pd
import urltools
# Loading individual tweets and manipulate them
def load_json(x):
'''
Load Tweet JSON
'''
try:
return json.loads(x, strict=False)
except:
print("Problematic tweet foun... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2956,
252... | 2.144256 | 1,532 |
import matplotlib.pyplot as plt
import os
import numpy as np
from numpy.testing._private.utils import print_assert_equal
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.keras.utils import to_categorical, plot_model
from tensorflow import keras
from tensorflow.keras import callbacks, layers
from ... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
33407,
13557,
19734,
13,
26791,
1330,
3601,
62,
30493,
62,
40496,
198,
11748,
11192,
273,
11125,
... | 2.631395 | 2,287 |
import collections
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
| [
11748,
17268,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
7645,
23914,
355,
31408,
628,
220,
220,
220,
220,
198,
220,
220,
220,
220
] | 3.153846 | 39 |
# -*- coding: utf-8 -*-
#
# Copyright 2016 Continuum Analytics, Inc.
# May be copied and distributed freely only as part of an Anaconda or
# Miniconda installation.
#
"""
Preferences dialog.
"""
# Third party imports
from qtpy.QtCore import Qt, QRegExp, Signal
from qtpy.QtGui import QRegExpValidator, QPixmap
from qtp... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
1584,
6389,
13814,
30437,
11,
3457,
13,
198,
2,
1737,
307,
18984,
290,
9387,
12748,
691,
355,
636,
286,
281,
1052,
330,
13533,
393,
198,
2,
1855,
2... | 2.627329 | 322 |
import numpy as np
import pickle,os
from Common.Module import Module
import pycuda.autoinit
import pycuda.driver as drv
from pycuda.compiler import SourceModule
mod = SourceModule("""
#include <stdio.h>
__global__ void calculate(float *dest, float *xs_weight, float *selection_weight, float* dataMCWeight, float* pil... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
11,
418,
198,
198,
6738,
8070,
13,
26796,
1330,
19937,
198,
198,
11748,
12972,
66,
15339,
13,
23736,
15003,
198,
11748,
12972,
66,
15339,
13,
26230,
355,
1553,
85,
198,
6738,
12972,
... | 2.555556 | 234 |
import numpy as np
import sys, os
from game import tiles
class tilemap():
"""
A map consists of a Numpy Array of integers. This array contains the ID's of tiles to be displayed.
Tiles are loaded from file into a dictionary of id's to names, ascii symbol and colours.
A tilemap is used as reference t... | [
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
11,
28686,
198,
198,
6738,
983,
1330,
19867,
628,
198,
4871,
17763,
8899,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
3975,
10874,
286,
257,
399,
32152,
15690,
286,
37014,... | 1.896062 | 1,549 |
if __name__=="__main__":
x = [10,20,-1,19,40]
insertion_sort(x)
print(x) | [
628,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
2124,
796,
685,
940,
11,
1238,
12095,
16,
11,
1129,
11,
1821,
60,
198,
220,
220,
220,
36075,
62,
30619,
7,
87,
8,
198,
220,
220,
220,
3601,
7,
... | 1.851064 | 47 |
import os
import sys
from redisgraph import Graph, Node, Edge
from base import FlowTestsBase
redis_graph = None
# Create a single node without any labels or properties.
# Retry to create an existing entity.
# Create a single node with two properties and no labels.
# Retry to create an exist... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
2266,
271,
34960,
1330,
29681,
11,
19081,
11,
13113,
198,
6738,
2779,
1330,
27782,
51,
3558,
14881,
198,
198,
445,
271,
62,
34960,
796,
6045,
628,
220,
220,
220,
1303,
13610,
257,
2060,
10139,... | 3.28839 | 267 |
""" One of the widgets that main window composes of.
See :class:`.MainWindow`
Similar modules: class:`.AddCluster`, :class:`.RemoveCluster`,
:class:`.IdactNotebook`, :class:`.ManageJobs`
"""
from PyQt5.QtWidgets import QWidget
from idact.core.retry import Retry
from idact.detail.environment.environment_p... | [
37811,
1881,
286,
262,
40803,
326,
1388,
4324,
552,
4629,
286,
13,
628,
220,
220,
220,
4091,
1058,
4871,
25,
44646,
13383,
27703,
63,
198,
220,
220,
220,
11014,
13103,
25,
220,
1398,
25,
44646,
4550,
2601,
5819,
47671,
1058,
4871,
25,... | 2.321407 | 3,382 |
# エラトステネスの篩, 素因数分解
N = int(input())
m = 1000000007
prime_table = make_prime_table(N)
t = [0] * (N + 1)
for i in range(2, N + 1):
for p, e in prime_factorize(i):
t[p] += e
result = 1
for i in range(2, N + 1):
if t[i] == 0:
continue
result = result * (t[i] + 1) % m
print(result)
| [
2,
17433,
101,
9263,
13298,
8943,
24336,
44916,
8943,
17683,
107,
102,
11,
13328,
112,
254,
32368,
254,
46763,
108,
26344,
228,
164,
100,
96,
628,
198,
198,
45,
796,
493,
7,
15414,
28955,
198,
198,
76,
796,
1802,
10535,
22,
198,
198... | 1.819767 | 172 |
from django.db import models
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.5625 | 16 |
#!/usr/bin/env python3
import pandas as pd
import common.data_management as dm
import common.describe_data as dd
if __name__ == '__main__':
pd.set_option('display.max_columns', None)
whr_df = pd.read_csv('data/data.csv')
whr_df = dm.preprocess_data(whr_df)
columns = ['Score', 'GDP per capita', 'Healt... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
11748,
2219,
13,
7890,
62,
27604,
355,
288,
76,
198,
11748,
2219,
13,
20147,
4892,
62,
7890,
355,
49427,
198,
198,
361,
11593,
367... | 2.519337 | 181 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from gilded_rose import *
import csv
if __name__ == "__main__":
print ("OMGHAI!")
items = []
with open("items.csv") as f:
reader = csv.DictReader(f)
for row in reader:
items.append(Item(row['Name'], int(row['sellIn']... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
308,
46158,
62,
13698,
1330,
1635,
198,
11748,
269,
21370,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834... | 2.17377 | 305 |
import argparse
from annotations import *
import config
import pash_runtime
from util import *
##
## A Daemon responding to requests for compilation
##
## Note: Not an actual daemon with the strict Unix sense
##
## TODO: Rename the pash_runtime to pash_compiler and this to pash_daemon
## TODO: Should we maybe use s... | [
11748,
1822,
29572,
198,
198,
6738,
37647,
1330,
1635,
198,
11748,
4566,
198,
11748,
279,
1077,
62,
43282,
198,
6738,
7736,
1330,
1635,
198,
198,
2235,
198,
2235,
317,
9637,
7966,
14409,
284,
7007,
329,
23340,
198,
2235,
198,
2235,
5740... | 3.408805 | 159 |
import cv2
import numpy as np
import math
from model_init import face_model, landmark_model
import face_detect
import face_landmark_detection
def get_2d_points(rotation_vector, translation_vector, camera_matrix, val):
"""Return the 3D points present as 2D for making annotation box"""
point_3d = []
dist_co... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
2746,
62,
15003,
1330,
1986,
62,
19849,
11,
20533,
62,
19849,
198,
11748,
1986,
62,
15255,
478,
198,
11748,
1986,
62,
1044,
4102,
62,
15255,
3213,
6... | 2.225166 | 1,057 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from enum import Enum
from typing import Optional, List
from fastapi import APIRouter, WebSocket, WebSocketDisconnect
from pydantic import BaseModel
from epicteller.core.controller import character as character_ctl
from epicteller.core.controller import combat as combat_c... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
32233,
11,
7343,
198,
198,
6738,
3049,
15042,
1330,
3486,
4663,
3... | 3.049261 | 406 |
"""
.. _plot_events_inverse:
============================
03. Compute inverse solution
============================
This workflow mainly call the
:ref:`inverse solution pipeline <source_reconstruction>`
performing source reconstruction starting from raw data specified by the user.
The first node of the workflow (:ref:... | [
37811,
198,
492,
4808,
29487,
62,
31534,
62,
259,
4399,
25,
198,
198,
4770,
25609,
198,
3070,
13,
3082,
1133,
34062,
4610,
198,
4770,
25609,
198,
1212,
30798,
8384,
869,
262,
198,
25,
5420,
25,
63,
259,
4399,
4610,
11523,
1279,
10459,... | 2.984708 | 3,989 |
import os
import numpy as np
import torch
import yaml
class YAMLParser:
""" YAML parser for optical flow and image reconstruction config files """
@property
@config.setter
@property
@property
@staticmethod
| [
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
331,
43695,
628,
198,
4871,
575,
2390,
19930,
28198,
25,
198,
220,
220,
220,
37227,
575,
2390,
43,
30751,
329,
18480,
5202,
290,
2939,
25056,
4566,
36... | 3.090909 | 77 |
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
9387,
351,
198,
2,
428,
67... | 3.989655 | 290 |
#!/usr/bin/env python
import argparse
import concurrent.futures
import json
import logging
import math
import os
import pathlib
import subprocess
import time
from typing import TextIO, Dict
import cv2
import vidstab
import decord
import natsort
import numpy as np
import pandas as pd
import tqdm
def extract_frames(d... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
1822,
29572,
198,
11748,
24580,
13,
69,
315,
942,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
850,
14681,
198,
... | 2.295995 | 1,473 |
import asyncio
from decimal import Decimal
from typing import Awaitable, Optional
from unittest import TestCase
from hummingbot.connector.exchange.bitfinex.bitfinex_exchange import BitfinexExchange
from hummingbot.core.data_type.common import OrderType, TradeType
from hummingbot.core.data_type.trade_fee import TokenAm... | [
11748,
30351,
952,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
19720,
1330,
5851,
4548,
540,
11,
32233,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
41465,
13645,
13,
8443,
273,
13,
1069,
3803,
13,
2545,
38125,
87,
... | 3.692308 | 130 |
import time
import file
from adb import By
# 找到需要打开的微信
| [
11748,
640,
198,
11748,
2393,
198,
6738,
512,
65,
1330,
2750,
628,
198,
220,
220,
220,
1303,
10545,
231,
122,
26344,
108,
165,
250,
222,
17358,
223,
33699,
241,
28156,
222,
21410,
36181,
106,
46479,
94,
198
] | 1.648649 | 37 |
# Copyright (c) 2016, Kate Fox
# All rights reserved.
#
# This file is covered by the 3-clause BSD license.
# See the LICENSE file in this program's distribution for details.
import zipfile, os.path
from os import walk
from sys import argv
if __name__ == "__main__":
main (argv[1], argv[2])
| [
2,
15069,
357,
66,
8,
1584,
11,
16693,
5426,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2393,
318,
5017,
416,
262,
513,
12,
565,
682,
347,
10305,
5964,
13,
198,
2,
4091,
262,
38559,
24290,
2393,
287,
428,
1430,
338,
608... | 3.061856 | 97 |
from scapy.layers.bluetooth import *
| [
6738,
629,
12826,
13,
75,
6962,
13,
65,
2290,
16271,
1330,
1635,
198
] | 2.846154 | 13 |