content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import insightconnect_plugin_runtime
from .schema import IsolateEndpointInput, IsolateEndpointOutput, Input, Output, Component
# Custom imports below
from insightconnect_plugin_runtime.exceptions import PluginException
from time import sleep
| [
11748,
11281,
8443,
62,
33803,
62,
43282,
198,
6738,
764,
15952,
2611,
1330,
1148,
27976,
12915,
4122,
20560,
11,
1148,
27976,
12915,
4122,
26410,
11,
23412,
11,
25235,
11,
35100,
198,
198,
2,
8562,
17944,
2174,
198,
6738,
11281,
8443,
... | 4.357143 | 56 |
#!/usr/bin/env python
try:
import Tkinter as tk # Python 2
except:
import tkinter as tk # Python 3
root = tk.Tk()
# all functions put here
root.mainloop()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
309,
74,
3849,
355,
256,
74,
1303,
11361,
362,
198,
16341,
25,
198,
220,
220,
220,
1330,
256,
74,
3849,
355,
256,
74,
1303,
11361,
513,
19... | 2.356164 | 73 |
from google.appengine.ext import ndb
from google.appengine.ext import vendor
context = ndb.get_context()
context.set_cache_policy(lambda key: False)
context.set_memcache_policy(lambda key: False)
vendor.add('backend/lib') | [
6738,
23645,
13,
1324,
18392,
13,
2302,
1330,
299,
9945,
198,
6738,
23645,
13,
1324,
18392,
13,
2302,
1330,
18371,
628,
198,
22866,
796,
299,
9945,
13,
1136,
62,
22866,
3419,
198,
22866,
13,
2617,
62,
23870,
62,
30586,
7,
50033,
1994,... | 3.140845 | 71 |
import os
import sys
from pathlib import Path
from janus import Queue
import aiofiles
from loguru import logger
from .decorator import producer
if getattr("sys", "frozen", False):
app_path = sys._MEIPASS
else:
app_path = Path(os.path.dirname(os.path.abspath(__file__))).parent
@producer
| [
11748,
28686,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
474,
41141,
1330,
4670,
518,
198,
11748,
257,
952,
16624,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
6738,
764,
12501,
273,
1352,
1330,
9920,
628,
198,
... | 2.857143 | 105 |
import random
def find_shortest(array: list[int]) -> int:
""" Find the shortest element in an array.
find_shortest
=============
The `find_shortest` function takes an array and finds the shortest element
in it.
Parameters
----------
array: list[int]
An array/list of integers
Retu... | [
11748,
4738,
628,
198,
4299,
1064,
62,
19509,
395,
7,
18747,
25,
1351,
58,
600,
12962,
4613,
493,
25,
198,
220,
220,
37227,
9938,
262,
35581,
5002,
287,
281,
7177,
13,
628,
220,
220,
1064,
62,
19509,
395,
198,
220,
220,
796,
25609,
... | 2.300761 | 788 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Christian Heider Nielsen'
__doc__ = r'''
Created on 17-12-2020
'''
import os
import numpy
import soundfile
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
705,
20298,
679,
1304,
31154,
6,
198,
834,
15390,
834,
796,
374,
7061,
6,
628,
220,
2... | 2.202247 | 89 |
from django.core.files.storage import FileSystemStorage
from less.settings import LESS_ROOT
class LessFileStorage(FileSystemStorage):
"""
Standard file system storage for files handled by django-less.
The default for ``location`` is ``LESS_ROOT``
"""
| [
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
35350,
1330,
9220,
11964,
31425,
198,
6738,
1342,
13,
33692,
1330,
406,
7597,
62,
13252,
2394,
628,
198,
4871,
12892,
8979,
31425,
7,
8979,
11964,
31425,
2599,
198,
220,
220,
220,
37227,
198,... | 3.375 | 80 |
# The MIT License (MIT)
# Copyright (c) 2014 Halit Alptekin
#
# 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... | [
2,
383,
17168,
13789,
357,
36393,
8,
201,
198,
2,
15069,
357,
66,
8,
1946,
11023,
270,
978,
457,
988,
259,
201,
198,
2,
201,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
201,
1... | 2.177461 | 2,316 |
import unittest
from ansiblelint import Runner, RulesCollection
from ansiblelint.rules.UsingBareVariablesIsDeprecatedRule import UsingBareVariablesIsDeprecatedRule
| [
11748,
555,
715,
395,
198,
6738,
9093,
856,
75,
600,
1330,
21529,
11,
14252,
36307,
198,
6738,
9093,
856,
75,
600,
13,
38785,
13,
12814,
33,
533,
23907,
2977,
3792,
12156,
31023,
31929,
1330,
8554,
33,
533,
23907,
2977,
3792,
12156,
3... | 3.75 | 44 |
from logger import LOGGER
import re
import calendar
from datetime import datetime
from contextlib import suppress
import pytz
from config import Config
from youtube_search import YoutubeSearch
from youtube_dl import YoutubeDL
from pyrogram import(
Client,
filters
)
from pyrogram.types import (
InlineK... | [
198,
6738,
49706,
1330,
41605,
30373,
198,
11748,
302,
198,
11748,
11845,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4732,
8019,
1330,
18175,
198,
11748,
12972,
22877,
198,
6738,
4566,
1330,
17056,
198,
6738,
35116,
62,
12947,
13... | 2.762911 | 426 |
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://localhost:5000")
print("Client started")
i = 0
while True:
socket.send_string(f"Current iteration is: {i}")
msg = socket.recv_string()
print("Received message %s" % msg)
time.sleep(1)
i += 1
| [
11748,
640,
198,
198,
11748,
1976,
76,
80,
198,
198,
22866,
796,
1976,
76,
80,
13,
21947,
3419,
198,
44971,
796,
4732,
13,
44971,
7,
89,
76,
80,
13,
2200,
48,
8,
198,
44971,
13,
8443,
7203,
83,
13155,
1378,
36750,
25,
27641,
4943,... | 2.528 | 125 |
import json
import os
import re
import shutil
from string import Template
from ..base import Downloader, Recipe, Configure, Make, MakeInstall
from ..base import TarballRecipe, GnuRecipe, GetVersionMixin
from hardhat.util import run, read_url, Object
from hardhat.urls import Urls
from hardhat.version import Versions, ex... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
4423,
346,
198,
6738,
4731,
1330,
37350,
198,
6738,
11485,
8692,
1330,
10472,
263,
11,
26694,
11,
17056,
495,
11,
6889,
11,
6889,
15798,
198,
6738,
11485,
8692,
1330,
14110,
... | 3.62 | 100 |
from .state_aggregation import *
from .box_discretization import *
| [
6738,
764,
5219,
62,
9460,
43068,
1330,
1635,
198,
6738,
764,
3524,
62,
15410,
1186,
1634,
1330,
1635,
198
] | 3.526316 | 19 |
import torch
from torch import nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from overrides import overrides
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
20471,
13,
26791,
13,
81,
20471,
1330,
2353,
62,
79,
29373,
62,
43167,
11,
14841,
62,
34860,
62,
43167,
198,
6738,
23170,
1460,
1330,
23170,
1460,
628,
198
] | 3.525 | 40 |
from typing import Generator, Dict, Iterable, List
import time
from openpyxl.styles.cell_style import StyleArray
from openpyxl.worksheet.worksheet import Worksheet, Cell
| [
6738,
19720,
1330,
35986,
11,
360,
713,
11,
40806,
540,
11,
7343,
198,
11748,
640,
198,
198,
6738,
1280,
9078,
87,
75,
13,
47720,
13,
3846,
62,
7635,
1330,
17738,
19182,
198,
6738,
1280,
9078,
87,
75,
13,
5225,
25473,
13,
5225,
2547... | 3.431373 | 51 |
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
import pytest
import utils.process
ORIGINAL_SUBPROC_OUTPUT = utils.process.get_sub... | [
2,
17486,
11777,
5081,
4306,
477,
3696,
287,
428,
16099,
389,
11971,
198,
2,
739,
262,
24843,
13789,
10628,
362,
13,
15,
13,
198,
2,
770,
1720,
3407,
3788,
4166,
379,
16092,
324,
519,
357,
5450,
1378,
2503,
13,
19608,
4533,
456,
80,... | 1.384072 | 6,793 |
# -*- encoding: utf-8 -*-
import errno
import os
import shlex
import subprocess
# Root of the Git repository
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
# Hash of the current commit
CURRENT_COMMIT = subprocess.check_output([
'git', 'rev-parse', 'HEAD']).d... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
11454,
3919,
198,
11748,
28686,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
628,
198,
2,
20410,
286,
262,
15151,
16099,
198,
13252,
2394,
796,
850,
14681,
... | 2.56621 | 438 |
import warnings
from typing import Any
import numpy as np
from ..utils import message_to_binary, binary_to_message, rgb_to_gray, conv2d
__all__ = ["SobelLSB"]
class SobelLSB():
"""Edge-based LSB embedding using Sobel kernel, idea described in:
`"Edge-based image steganography", Saiful Islam, Mangat R Mo... | [
11748,
14601,
198,
6738,
19720,
1330,
4377,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
11485,
26791,
1330,
3275,
62,
1462,
62,
39491,
11,
13934,
62,
1462,
62,
20500,
11,
46140,
62,
1462,
62,
44605,
11,
3063,
17,
67,
628,... | 2.941176 | 119 |
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 |
import os
import random
import re
import requests
import discord
from discord.ext import commands
from cogs.arkhamdb import Arkhamdb
from cogs.dice import Dice
from cogs.bag import Bag
from cogs.blob import Blob
from cogs.funko import Funko
from cogs.marvelcdb import Marvelcdb
from dotenv import load_dotenv
load_do... | [
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
7007,
198,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
6738,
269,
18463,
13,
668,
2763,
9945,
1330,
29486,
9945,
198,
6738,
269,
18463,
13,
67,
501,
... | 2.576923 | 234 |
from torch.distributions import Categorical
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
gamma = 0.99
if __name__ == '__main__':
main()
| [
6738,
28034,
13,
17080,
2455,
507,
1330,
327,
2397,
12409,
198,
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
198,
28483,
2... | 2.852941 | 68 |
gen = silly_generator()
for item in gen:
print(item)
# #Python
# #Rocks
# #So do you! | [
5235,
796,
14397,
62,
8612,
1352,
3419,
201,
198,
201,
198,
201,
198,
1640,
2378,
287,
2429,
25,
201,
198,
220,
220,
220,
3601,
7,
9186,
8,
201,
198,
201,
198,
2,
1303,
37906,
201,
198,
2,
1303,
49,
3320,
201,
198,
2,
1303,
2396... | 2.083333 | 48 |
# -*- coding: utf-8 -*-
import os,sys,shutil
import zipfile,glob,subprocess
import traceback
try:
option = {
"stdout":subprocess.PIPE,
"stderr":subprocess.PIPE
}
cwd = os.path.abspath(os.path.dirname(__file__))
print "c",cwd,__file__
if len(cwd) == 0:
cwd = "."
sys.path.append(myjoin(cwd,"..","Engine"))
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
11,
17597,
11,
1477,
22602,
198,
11748,
19974,
7753,
11,
4743,
672,
11,
7266,
14681,
198,
11748,
12854,
1891,
198,
198,
28311,
25,
198,
197,
18076,
796,
13... | 2.365188 | 2,344 |
from rollout import connect
from .util import get_service_name
import os
from collections import defaultdict
import subprocess as sub
from slackclient import SlackClient
| [
6738,
38180,
1330,
2018,
198,
6738,
764,
22602,
1330,
651,
62,
15271,
62,
3672,
198,
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
850,
14681,
355,
850,
198,
6738,
30740,
16366,
1330,
36256,
11792,
628,
628,
198
] | 4.461538 | 39 |
from .app import app
# production specific config
app.config['DEBUG'] = False
| [
6738,
764,
1324,
1330,
598,
198,
198,
2,
3227,
2176,
4566,
198,
1324,
13,
11250,
17816,
30531,
20520,
796,
10352,
198
] | 3.761905 | 21 |
"""The project's utilities.
This module provides utility functions that don't fit any other module.
"""
from typing import List
def load_board_state(path_to_file: str) -> List[List[int]]:
"""Loads the initial board state from file.
Args:
path_to_file: A path to the file, preferably constructed with... | [
37811,
464,
1628,
338,
20081,
13,
198,
198,
1212,
8265,
3769,
10361,
5499,
326,
836,
470,
4197,
597,
584,
8265,
13,
198,
37811,
198,
198,
6738,
19720,
1330,
7343,
628,
198,
4299,
3440,
62,
3526,
62,
5219,
7,
6978,
62,
1462,
62,
7753... | 2.623482 | 247 |
import unknownpasta
import numpy as np
import matplotlib.pyplot as plt
# call lucs_tools.formatting.joyful.joy_text to plot the string
# lucs_tools.formatting.joyful.text(
# input_string,
# 90,
# fontsize=5.5,
# weight='light',
# factor=3.,
# write_lines=True,
# )
# text = """it ... | [
11748,
6439,
30119,
64,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
201,
198,
2,
869,
17115,
82,
62,
31391,
13,
18982,
889,
13,
2633,
913,
13,
2633,
62,
5239,... | 3.153766 | 956 |
# -*- coding: utf-8 -*-
import os
from setuptools import find_packages, setup
from allauth_cas import __version__
BASE_DIR = os.path.dirname(__file__)
with open(os.path.join(BASE_DIR, 'README.rst')) as readme:
README = readme.read()
setup(
name='django-allauth-cas',
version=__version__,
description... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
6738,
477,
18439,
62,
34004,
1330,
11593,
9641,
834,
198,
198,
33,
11159,
62,... | 2.407692 | 780 |
from pwnypack.shellcode.arm import ARM
from pwnypack.target import Target
__all__ = ['ARMThumb']
class ARMThumb(ARM):
"""
Environment that targets a generic, unrestricted ARM architecture using
the Thumb instruction set.
"""
| [
6738,
279,
675,
4464,
441,
13,
29149,
8189,
13,
1670,
1330,
20359,
198,
6738,
279,
675,
4464,
441,
13,
16793,
1330,
12744,
628,
198,
834,
439,
834,
796,
37250,
33456,
817,
2178,
20520,
628,
198,
4871,
20359,
817,
2178,
7,
33456,
2599,... | 3.181818 | 77 |
#!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a c... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
41906,
17174,
46068,
1174,
198,
2,
15069,
357,
66,
8,
43208,
21852,
1766,
1539,
12052,
13,
33448,
12,
1238,
2481,
13,
1439,
2489,
10395,
13,
198,
2,
11971,
739,
262,
17996,
272,
6599... | 2.977208 | 351 |
'''
* Copyright 2018 Canaan Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | [
7061,
6,
198,
1635,
15069,
2864,
47047,
3457,
13,
198,
1635,
198,
1635,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
1635,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.677596 | 183 |
#! /usr/bin/env python3
import sys
from time import sleep
import csv
import numpy as np
import subprocess
from pprint import pprint
#PATH = os.environ['HOME'] + '/Dropbox/big.Little_optimal_frequencies/data/'
main()
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
6738,
640,
1330,
3993,
198,
198,
11748,
269,
21370,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
850,
14681,
198,
6738,
279,
4798,
1330,
279,
4798,
628,
198... | 2.884615 | 78 |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from mutis.correlation import Correlation
from mutis.signal import Signal
@pytest.fixture
| [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
198,
198,
6738,
4517,
271,
13,
10215,
49501,
1330,
2744,
49501,
198,
6738,
4517,
271,
13,
12683,
282,
1330,
26484,
628... | 3.365385 | 52 |
from flexget import plugin
from flexget.event import event
from flexget.utils import qualities
from flexget.utils.qualities import QualityComponent
from loguru import logger
from typing import List
logger = logger.bind(name="traits")
class Traits:
"""
Override FlexGet's built-in quality requirement types wi... | [
6738,
7059,
1136,
1330,
13877,
198,
6738,
7059,
1136,
13,
15596,
1330,
1785,
198,
6738,
7059,
1136,
13,
26791,
1330,
14482,
198,
6738,
7059,
1136,
13,
26791,
13,
13255,
871,
1330,
14156,
21950,
198,
6738,
2604,
14717,
1330,
49706,
198,
... | 1.94702 | 755 |
"""
Demonstrating how to undistort images.
Reads in the given calibration file, parses it, and uses it to undistort the given
image. Then display both the original and undistorted images.
To use:
python undistort.py image calibration_file
"""
import numpy as np
import cv2
import matplotlib.pyplot as plt
import ... | [
37811,
198,
35477,
2536,
803,
703,
284,
3318,
396,
419,
4263,
13,
198,
198,
5569,
82,
287,
262,
1813,
36537,
2393,
11,
13544,
274,
340,
11,
290,
3544,
340,
284,
3318,
396,
419,
262,
1813,
198,
9060,
13,
3244,
3359,
1111,
262,
2656,
... | 3.152174 | 138 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pandoc_docx_utils import ExtractBulletList
import panflute as pf
if __name__ == "__main__":
main()
| [
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,
19798,
420,
62,
15390,
87,
62,
26791,
1330,
29677,
33481,
1616,
8053,
198,
11748,
3425,
2704,
1133,
355,
279,... | 2.430769 | 65 |
import os, sys
import os.path as osp
import subprocess
import shutil
from pprint import pprint
# import git
# from git import Repo
frameworks = (
"torch",
"tensorflow",
"mxnet",
"theano",
"keras",
"matlab",
"torch_c"
)
root = "test"
proj = "3D-ResNets-PyTorch"
for (dirpath, dirnames, ... | [
11748,
28686,
11,
25064,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
198,
11748,
850,
14681,
198,
11748,
4423,
346,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
2,
1330,
17606,
198,
2,
422,
17606,
1330,
1432,
78,
198,
198,
19298,... | 2.232143 | 336 |
import threading
import pika
import time
import json
import sys
from pprint import pformat
from Queue import Empty
from ssl import CERT_REQUIRED
from pika import PlainCredentials
from pika import SelectConnection
from pika.adapters.select_connection import SelectPoller
from syncli.config import config
from syncli.lo... | [
11748,
4704,
278,
198,
11748,
279,
9232,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
25064,
198,
198,
6738,
279,
4798,
1330,
279,
18982,
198,
6738,
4670,
518,
1330,
33523,
198,
6738,
264,
6649,
1330,
327,
17395,
62,
2200,
10917,
378... | 2.515686 | 510 |
# Generated by Django 3.1.6 on 2021-02-27 11:58
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
21,
319,
33448,
12,
2999,
12,
1983,
1367,
25,
3365,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: utf-8 -*-
import json
import time
import os
from pretty import get_pretty_json
import webbrowser
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
28686,
198,
6738,
2495,
1330,
651,
62,
37784,
62,
17752,
198,
11748,
3992,
40259,
628
] | 3.054054 | 37 |
from datetime import datetime
# current date and time
now = datetime.now()
timestamp = datetime.timestamp(now)
print(type(timestamp))
print("timestamp =", timestamp)
print(datetime.fromtimestamp(timestamp)) | [
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
2,
1459,
3128,
290,
640,
198,
2197,
796,
4818,
8079,
13,
2197,
3419,
198,
198,
16514,
27823,
796,
4818,
8079,
13,
16514,
27823,
7,
2197,
8,
198,
4798,
7,
4906,
7,
16514,
27823,
4008... | 3.149254 | 67 |
# https://leetcode.com/problems/reverse-nodes-in-k-group/
# Given a linked list, reverse the nodes of a linked list k at a time and return
# its modified list.
# k is a positive integer and is less than or equal to the length of the linked
# list. If the number of nodes is not a multiple of k then left-out nodes, in ... | [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
50188,
12,
77,
4147,
12,
259,
12,
74,
12,
8094,
14,
198,
198,
2,
11259,
257,
6692,
1351,
11,
9575,
262,
13760,
286,
257,
6692,
1351,
479,
379,
257,
640,
290,
1441,
198... | 3.357143 | 266 |
import unittest
import os
from copy import deepcopy
from subprocess import CalledProcessError
from shutil import rmtree
from openpaisdk.command_line import Engine
from openpaisdk.utils import run_command
from openpaisdk.utils import OrganizedList as ol
from openpaisdk.job import Job, Namespace, from_file
from typing im... | [
11748,
555,
715,
395,
198,
11748,
28686,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
850,
14681,
1330,
34099,
18709,
12331,
198,
6738,
4423,
346,
1330,
374,
16762,
631,
198,
6738,
1280,
8957,
9409,
74,
13,
21812,
62,
1370,
1330,
7117... | 3.67033 | 91 |
# 1. Import Flask
from flask import Flask,jsonify
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import datetime as dt
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
Base = automap_base()
Base.prepare(engine,r... | [
2,
352,
13,
17267,
46947,
198,
6738,
42903,
1330,
46947,
11,
17752,
1958,
198,
11748,
44161,
282,
26599,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
2306,
296,
499,
1330,
3557,
499,
62,
8692,
198,
6738,
44161,
282,
26599,
13,
579,
133... | 2.594982 | 279 |
import itertools
from enum import Enum
from graph.GraphLoader import DatasetLoader
from graph.GridSearch import GridSearch
| [
11748,
340,
861,
10141,
198,
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
4823,
13,
37065,
17401,
1330,
16092,
292,
316,
17401,
198,
6738,
4823,
13,
41339,
18243,
1330,
24846,
18243,
628
] | 3.90625 | 32 |
# Shifter, Copyright (c) 2015, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are per... | [
2,
911,
18171,
11,
15069,
357,
66,
8,
1853,
11,
383,
3310,
658,
286,
262,
2059,
286,
3442,
11,
198,
2,
832,
13914,
14727,
2351,
18643,
357,
32796,
284,
14507,
286,
597,
198,
2,
2672,
45818,
422,
262,
471,
13,
50,
13,
28786,
13,
... | 4.051471 | 272 |
import jax.numpy as jnp
from jax import jit
from onnx_jax.handlers.backend_handler import BackendHandler
from onnx_jax.handlers.handler import onnx_op
from onnx_jax.pb_wrapper import OnnxNode
@onnx_op("MatMul")
| [
11748,
474,
897,
13,
77,
32152,
355,
474,
37659,
198,
6738,
474,
897,
1330,
474,
270,
198,
198,
6738,
319,
77,
87,
62,
73,
897,
13,
4993,
8116,
13,
1891,
437,
62,
30281,
1330,
5157,
437,
25060,
198,
6738,
319,
77,
87,
62,
73,
89... | 2.45977 | 87 |
import os
config = {"dev": DevelopmentConfig, "prod": ProductionConfig, "docker": DockerDevConfig}
| [
11748,
28686,
628,
628,
628,
198,
11250,
796,
19779,
7959,
1298,
7712,
16934,
11,
366,
1676,
67,
1298,
19174,
16934,
11,
366,
45986,
1298,
25716,
13603,
16934,
92,
198
] | 3.62069 | 29 |
import asyncio
import random
import time
from typing import Any, AsyncIterator
import pytest
from aioredis import Redis
from fakeredis.aioredis import FakeRedis
from pytest_mock import MockerFixture
from src.room_store.memory_room_archive import MemoryRoomArchive
from src.room_store.memory_room_store import MemoryRoo... | [
11748,
30351,
952,
198,
11748,
4738,
198,
11748,
640,
198,
6738,
19720,
1330,
4377,
11,
1081,
13361,
37787,
198,
198,
11748,
12972,
9288,
198,
6738,
257,
72,
1850,
271,
1330,
2297,
271,
198,
6738,
8390,
445,
271,
13,
1872,
1850,
271,
... | 3.050926 | 432 |
# K-Arm Optimization
########################################################################################################################################
### K_Arm_Opt functions load data based on different trigger types, then create an instance of K-Arm scanner and run optimization ###
### It returns the target... | [
2,
509,
12,
26560,
30011,
1634,
198,
29113,
29113,
29113,
29113,
7804,
198,
21017,
509,
62,
26560,
62,
27871,
5499,
3440,
1366,
1912,
319,
1180,
7616,
3858,
11,
788,
2251,
281,
4554,
286,
509,
12,
26560,
27474,
290,
1057,
23989,
220,
... | 4.630952 | 168 |
from gmssl import sm3, func
from binascii import a2b_hex, b2a_hex
sm2p256v1_ecc_table = {
'n': 'FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123',
'p': 'FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF',
'g': '32c4ae2c1f1981195f9904466a39c9948fe30bbff2660be1715a4589334c74c7'... | [
6738,
308,
76,
45163,
1330,
895,
18,
11,
25439,
198,
6738,
9874,
292,
979,
72,
1330,
257,
17,
65,
62,
33095,
11,
275,
17,
64,
62,
33095,
198,
198,
5796,
17,
79,
11645,
85,
16,
62,
68,
535,
62,
11487,
796,
1391,
198,
220,
220,
... | 2.097561 | 615 |
#_*_ coding: utf-8 _*_
my_func(input("이름을 입력하세요 : ")) | [
2,
62,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
198,
1820,
62,
20786,
7,
15414,
7203,
35975,
112,
167,
99,
226,
35975,
226,
23821,
252,
227,
167,
254,
98,
47991,
246,
168,
226,
116,
168,
248,
242,
1058,
366,
4008
] | 1.2 | 45 |
from django import forms
from .models import Procurement
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
764,
27530,
1330,
31345,
495,
434,
198
] | 4.071429 | 14 |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# VulnerableCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/vulnerablecode for support or download.
# See https://aboutcode.org for mor... | [
2,
198,
2,
15069,
357,
66,
8,
497,
87,
33,
3457,
13,
290,
1854,
13,
1439,
2489,
10395,
13,
198,
2,
569,
38828,
10669,
318,
257,
16028,
286,
497,
87,
33,
3457,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
1... | 3.218638 | 279 |
from tensorflow.keras.models import load_model
import numpy as np
import cv2
model = load_model('handwriting.model')
#imprimir una imagen con muestra
images = []
# seleccionar muestras aleatorias de los datos
for i in np.random.choice(np.arange(0, len(testY)), size=(64,)):
# hacer las predicciones
probs = model.pre... | [
6738,
11192,
273,
11125,
13,
6122,
292,
13,
27530,
1330,
3440,
62,
19849,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
19849,
796,
3440,
62,
19849,
10786,
4993,
16502,
13,
19849,
11537,
198,
198,
2,
320,
1050,
130... | 2.519101 | 445 |
# -*- coding: utf-8 -*-
from django.apps import AppConfig
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 2.565217 | 23 |
"""Flask configuration."""
import os
VERSION = '0.2'
SECRET_KEY = os.environ.get('SECRET_KEY', 'asdf1234')
SERVER_NAME = os.environ.get('ACCOUNTS_SERVER_NAME')
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', 'nope')
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', 'nope')
AWS_REGION = os.envi... | [
37811,
7414,
2093,
8398,
526,
15931,
198,
198,
11748,
28686,
198,
198,
43717,
796,
705,
15,
13,
17,
6,
198,
198,
23683,
26087,
62,
20373,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
23683,
26087,
62,
20373,
3256,
705,
292,
7568,
1065,... | 2.293396 | 1,060 |
from .alternatives import Alternative
from .tools import (
str_to_timedelta,
timedelta_from_str,
)
from .helpers import text_in_range
from .speakers import Speaker
from .markers import Marker
from .segments import Segment
from .speakers import Speaker
from pathlib import Path
from datetime import timedelta
imp... | [
6738,
764,
33645,
2929,
1330,
27182,
198,
6738,
764,
31391,
1330,
357,
198,
220,
220,
220,
965,
62,
1462,
62,
16514,
276,
12514,
11,
198,
220,
220,
220,
28805,
12514,
62,
6738,
62,
2536,
11,
198,
8,
198,
6738,
764,
16794,
364,
1330,... | 2.432161 | 597 |
from urllib import request
from PyQt5.QtCore import QThread | [
6738,
2956,
297,
571,
1330,
2581,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1195,
16818
] | 3 | 20 |
#!/usr/bin/env @PYTHON_EXECUTABLE@
"""
Description: Run a pre-generated Siconos mechanics-IO HDF5 simulation file.
"""
# Lighter imports before command line parsing
from __future__ import print_function
import argparse
parser = argparse.ArgumentParser(
description = __doc__,
epilog = """This script only provi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
2488,
47,
56,
4221,
1340,
62,
6369,
2943,
3843,
17534,
31,
198,
37811,
198,
11828,
25,
5660,
257,
662,
12,
27568,
311,
4749,
418,
12933,
12,
9399,
5572,
37,
20,
18640,
2393,
13,
198,
37811,
198,... | 2.825677 | 849 |
# Original Version: Taehoon Kim (http://carpedm20.github.io)
# + Source: https://github.com/carpedm20/DCGAN-tensorflow/blob/e30539fb5e20d5a0fed40935853da97e9e55eee8/model.py
# + License: MIT
from __future__ import division
import os
import time
from glob import glob
import tensorflow as tf
import pickle
from six.m... | [
2,
13745,
10628,
25,
309,
3609,
71,
2049,
6502,
357,
4023,
1378,
66,
5117,
276,
76,
1238,
13,
12567,
13,
952,
8,
198,
2,
220,
220,
1343,
8090,
25,
3740,
1378,
12567,
13,
785,
14,
66,
5117,
276,
76,
1238,
14,
9697,
45028,
12,
83,... | 2.77027 | 148 |
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
import math
from absl import app
import numpy as np
import lib.helper as helper
import lib.ops as ops
import lib.state as state
def make_f(d: int = 3, r: int = 1):
"""Construct function that will return 1 for 'solutions' bits."""... | [
11748,
25064,
198,
11748,
14601,
198,
361,
407,
25064,
13,
40539,
25811,
25,
198,
220,
220,
220,
14601,
13,
36439,
24455,
7203,
46430,
4943,
198,
11748,
10688,
198,
6738,
2352,
75,
1330,
598,
198,
11748,
299,
32152,
355,
45941,
198,
198... | 2.72365 | 778 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
'''Crie um programa que leia o nome e o preco de varios produtos. O programa devera perguntar se o usuario vai continuar.
No final mostre:
a) Qual é o total gasto na compra
b) Quantos produtos custam mais de R$1000.
c) Qual é o nome do produto mais barato. '''
sair = 'N'
compras = 0
prdcaro = 0
nomepr... | [
7061,
6,
34,
5034,
23781,
1430,
64,
8358,
443,
544,
267,
299,
462,
304,
267,
662,
1073,
390,
1401,
4267,
40426,
315,
418,
13,
440,
1430,
64,
390,
332,
64,
583,
70,
2797,
283,
384,
267,
514,
84,
4982,
410,
1872,
11143,
283,
13,
1... | 2.167347 | 490 |
from . import views
from django.conf.urls import url
urlpatterns = [
url(r'', views.HomeView.as_view(), name='home'),
]
| [
6738,
764,
1330,
5009,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
7,
81,
6,
3256,
5009,
13,
16060,
7680,
13,
292,
62,
1177,
22... | 2.37931 | 58 |
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.db.models.deletion import CASCADE
from django.core.validators import MinValueValidator
from django.core.exceptions import ValidationError
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
1330,
35106,
34,
19266,
198,
6738,
42625,
142... | 3.470588 | 68 |
import os
import numpy as np
import csv
import pandas as pd
import sys
try:
import cPickle as pickle
except:
import pickle
import matplotlib.pyplot as plt
import progressbar as pb
import interpolate as ip
| [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
21370,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
25064,
198,
28311,
25,
198,
220,
220,
1330,
269,
31686,
293,
355,
2298,
293,
198,
16341,
25,
198,
220,
220,
13... | 2.958904 | 73 |
try:
f = open("fruit.txt", "r")
a = int(f.readline())
o = int(f.readline())
g = int(f.readline())
f.close()
except:
a,o,g = 0,0,0
while True:
print("현재 재고는 사과",a,"개, 오렌지",o,"개, 포도",g,"개 입니다.")
S,t = input("변동할 재고와 갯수를 입력해주세요(저장하고 나갈때는 q 0 입력) : ").split()
t = int(t)
if S == ... | [
28311,
25,
198,
220,
220,
220,
277,
796,
1280,
7203,
34711,
13,
14116,
1600,
366,
81,
4943,
198,
220,
220,
220,
257,
796,
493,
7,
69,
13,
961,
1370,
28955,
198,
220,
220,
220,
267,
796,
493,
7,
69,
13,
961,
1370,
28955,
198,
220... | 1.333333 | 480 |
"""
Created on Sun Feb 2 13:28:48 2020
@author: matias
"""
import numpy as np
from matplotlib import pyplot as plt
from scipy.interpolate import interp1d
from scipy.constants import c as c_luz #metros/segundos
c_luz_norm = c_luz/1000
import sys
import os
from os.path import join as osjoin
from pc_path import defini... | [
37811,
198,
41972,
319,
3825,
3158,
220,
362,
1511,
25,
2078,
25,
2780,
12131,
198,
198,
31,
9800,
25,
2603,
4448,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
19... | 2.064698 | 711 |
import os
diccionario = []
crearArchivo()
cargarArchivo()
menu = True
while menu == True:
os.system("clear")
print "\t\t\t [DICCIONARIO]"
print "\t\t\t -------------\n"
print " 1. AGREGAR AL DICCIONARIO"
print " 2. MOSTRAR DICCIONARIO"
print " 3. BUSCAR EN EL DICCIO... | [
11748,
28686,
198,
198,
67,
44240,
295,
4982,
796,
17635,
628,
628,
628,
628,
628,
198,
7513,
283,
19895,
23593,
3419,
198,
66,
853,
283,
19895,
23593,
3419,
198,
198,
26272,
796,
6407,
198,
198,
4514,
6859,
6624,
6407,
25,
198,
220,
... | 1.72927 | 1,821 |
from unittest.mock import Mock
import paramiko
from blocksync.sync import (
_connect_ssh,
_do_create,
_get_block_size,
_get_blocks,
_get_range,
_get_remotedev_size,
_get_size,
_log,
)
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
198,
198,
11748,
5772,
12125,
198,
198,
6738,
7021,
13361,
13,
27261,
1330,
357,
198,
220,
220,
220,
4808,
8443,
62,
45824,
11,
198,
220,
220,
220,
4808,
4598,
62,
17953,
11,
198,
220,
... | 2.132075 | 106 |
from argparse import ArgumentParser
import numpy as np
from calculator import computeSurfaceDistance
DefaultPreFilePath = 'data/pre.data'
DefaultPostFilePath = 'data/post.data'
MetersPerPixel = 30
MetersPerHeightValue = 11
if __name__ == '__main__':
exit(main())
| [
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28260,
1330,
24061,
14214,
2550,
45767,
198,
198,
19463,
6719,
8979,
15235,
796,
705,
7890,
14,
3866,
13,
7890,
6,
198,
19463,
6307,
8979,
15235,
796,
... | 3.240964 | 83 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198
] | 2.954545 | 44 |
#! /usr/bin/env python
import sys,os
import time
from Bio import Fasta
DEFAULT_DICT_FILE = '/project1/structure/mliang/pdb/derived_data/pdb_seqres.idx'
DEFAULT_OUTFH = sys.stdout
dict_file = DEFAULT_DICT_FILE
outfh = DEFAULT_OUTFH
start_time = time.time()
fdict = Fasta.Dictionary(dict_file)
elapse_time = time.time(... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
11,
418,
198,
11748,
640,
198,
6738,
16024,
1330,
12549,
64,
198,
198,
7206,
38865,
62,
35,
18379,
62,
25664,
796,
31051,
16302,
16,
14,
301,
5620,
14,
4029,
154... | 2.293501 | 477 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
http://www.zillow.com/browse/homes/
Zillow有一个页面按照层级列出了所有房产的具体地址信息:
State -> County -> Zipcode -> Street -> Address
"""
__version__ = "0.0.1"
__author__ = "Sanhe Hu"
__license__ = "MIT"
__short_description__ = "Zillow Database Crawler" | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
4023,
1378,
2503,
13,
89,
359,
322,
13,
785,
14,
25367,
325,
14,
71,
2586,
14,
198,
198,
57,
359,
... | 1.8 | 160 |
# Generated by Django 2.2 on 2019-04-27 16:33
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
319,
13130,
12,
3023,
12,
1983,
1467,
25,
2091,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.904762 | 42 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
2177,
12,
7908,
2320,
43,
317,
1959,
15302,
11,
257,
9368,
1087,
1664,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11... | 3.6375 | 240 |
"""
Sequence to Sequence models with attention-based copying of input
and/or schema.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from pydoc import locate
import tensorflow as tf
from tensorflow.python.ops imp... | [
37811,
198,
44015,
594,
284,
45835,
4981,
351,
3241,
12,
3106,
23345,
286,
5128,
198,
392,
14,
273,
32815,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
... | 2.431576 | 3,566 |
import os
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils.models import TimeStampedModel
| [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
2746,
62,
26791... | 3.632653 | 49 |
# Generated by Django 2.2.7 on 2019-12-04 20:58
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
22,
319,
13130,
12,
1065,
12,
3023,
1160,
25,
3365,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'leftpuntobipuntoleftcomarightigualleftcor1cor2leftmasmenosleftasteriscodivporcentajeleftpotrightumenosumasleftpar1par2leftt_orleftt_andleftdiferenteleftmayormenormayori... | [
198,
2,
13544,
316,
397,
13,
9078,
198,
2,
770,
2393,
318,
6338,
7560,
13,
2141,
407,
4370,
13,
198,
2,
279,
2645,
600,
25,
15560,
28,
54,
11,
34,
11,
49,
198,
62,
8658,
9641,
796,
705,
18,
13,
940,
6,
198,
198,
62,
14050,
6... | 1.958013 | 59,566 |
import pkg_resources
import pyglet
import pyperclip
from pyglet.window import Window
from pyglet import gl
from . import draw, initialCode, menu
from .process import Process
from .node import Node
from .field import Field
from .sub import Sub
from .codeEditor import CodeEditor
from .element import color_inverse
from .... | [
11748,
279,
10025,
62,
37540,
198,
11748,
12972,
70,
1616,
198,
11748,
12972,
525,
15036,
198,
6738,
12972,
70,
1616,
13,
17497,
1330,
26580,
198,
6738,
12972,
70,
1616,
1330,
1278,
198,
198,
6738,
764,
1330,
3197,
11,
4238,
10669,
11,
... | 3.356643 | 143 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 yinhm
import datetime
import os
import sys
import numpy as np
ROOT_PATH = os.path.join(os.path.realpath(os.path.dirname(__file__)), '..')
sys.path[0:0] = [ROOT_PATH]
from cStringIO import StringIO
from datafeed.client import Client
from datafeed.datast... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
2813,
331,
259,
23940,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,... | 2.388031 | 518 |
from jd.api.base import RestApi
| [
6738,
474,
67,
13,
15042,
13,
8692,
1330,
8324,
32,
14415,
628,
628,
628,
198
] | 2.533333 | 15 |
from marshmallow import fields
from qikfiller.schemas.lists import (
BaseCollectionObject, BaseCollectionSchema, BaseSchema, register_class,
)
@register_class
| [
6738,
22397,
42725,
1330,
7032,
198,
198,
6738,
10662,
1134,
69,
4665,
13,
1416,
4411,
292,
13,
20713,
1330,
357,
198,
220,
220,
220,
7308,
36307,
10267,
11,
7308,
36307,
27054,
2611,
11,
7308,
27054,
2611,
11,
7881,
62,
4871,
11,
198... | 3.294118 | 51 |
from django.test import TestCase
from django.core.exceptions import ValidationError
from incomewealth.app.serializers import (serialize_get_request,
serialize_saving_capacity_request)
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
198,
6738,
15501,
413,
68,
1094,
13,
1324,
13,
46911,
11341,
1330,
357,
46911,
1096,
62,
1136,
62,
25927... | 2.425532 | 94 |
#!/usr/bin/env python3
from unittest import main, TestCase
from tracerface.parse_stack import parse_stack
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
555,
715,
395,
1330,
1388,
11,
6208,
20448,
198,
198,
6738,
491,
11736,
2550,
13,
29572,
62,
25558,
1330,
21136,
62,
25558,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
... | 2.792453 | 53 |
import onmt.io
import onmt.translate
import onmt.Models
import onmt.ViModels
import onmt.Loss
from onmt.Trainer import Trainer, Statistics
from onmt.Optim import Optim
# For flake8 compatibility
__all__ = [onmt.Loss, onmt.Models, onmt.ViModels,
Trainer, Optim, Statistics, onmt.io, onmt.translate]
| [
11748,
319,
16762,
13,
952,
198,
11748,
319,
16762,
13,
7645,
17660,
198,
11748,
319,
16762,
13,
5841,
1424,
198,
11748,
319,
16762,
13,
38432,
5841,
1424,
198,
11748,
319,
16762,
13,
43,
793,
198,
6738,
319,
16762,
13,
2898,
10613,
1... | 2.672414 | 116 |
class Trigger:
"""
A trigger is simply a scene/action pair that can be passed in to actions
(along with other triggers if required).
Attributes:
scene (botticelli.Scene): A scene that will trigger the accompanying
action.
action (botticelli.Action): An action that will be performed if the
accom... | [
4871,
24593,
25,
198,
220,
37227,
198,
220,
317,
7616,
318,
2391,
257,
3715,
14,
2673,
5166,
326,
460,
307,
3804,
287,
284,
4028,
198,
220,
357,
24176,
351,
584,
20022,
611,
2672,
737,
628,
220,
49213,
25,
198,
220,
220,
220,
3715,
... | 3.705263 | 95 |
# https://stackoverflow.com/questions/57964626/permissions-denied-when-trying-to-invoke-go-aws-lambda-function
import zipfile
import time
| [
2,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
41734,
27720,
2075,
14,
525,
8481,
12,
6559,
798,
12,
12518,
12,
83,
14992,
12,
1462,
12,
37669,
12,
2188,
12,
8356,
12,
50033,
12,
8818,
201,
198,
11748,
19974,
7753,
... | 2.916667 | 48 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
import sys
import gzip
import numpy as np
import scipy as sc
import pickle
from optparse import OptionParser
from sklearn.decomposition import PCA
from sklearn import preprocessing
from sklearn import linear_model
from scipy.stats import rankdata
from scipy.stats import norm
if __name__ == "__main__":
pars... | [
11748,
25064,
198,
11748,
308,
13344,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
629,
198,
11748,
2298,
293,
198,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
220,
220,
220,
220,
198,
6738,
1341,
35720,
13,
... | 2.690391 | 281 |
"""CODEX preprocessing pipeline core logic
This is not intended to be run directly but rather used by mutliple external
interfaces to implement the core process that comprises CODEX processing.
"""
import os, logging, itertools, queue
import numpy as np
from os import path as osp
from threading import Thread
from time... | [
37811,
34,
3727,
6369,
662,
36948,
11523,
4755,
9156,
198,
198,
1212,
318,
407,
5292,
284,
307,
1057,
3264,
475,
2138,
973,
416,
4517,
75,
2480,
7097,
198,
3849,
32186,
284,
3494,
262,
4755,
1429,
326,
28800,
327,
3727,
6369,
7587,
13... | 3.636771 | 223 |
# Copyright 2016-2021 Doug Latornell, 43ravens
# 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 t... | [
2,
15069,
1584,
12,
1238,
2481,
15115,
5476,
1211,
695,
11,
5946,
430,
574,
82,
198,
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,
11... | 2.908284 | 676 |
import datetime
import logging
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.ticker import FuncFormatter
from matplotlib.ticker import FormatStrFormatter
import numpy as np
import math
logger = logging.getLogger(__name__)
| [
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
19581,
355,
285,
19581,
198,
6738,
2603,
29487,
8019,
13,
83,
15799,
1... | 3.349398 | 83 |
##
# @file slider.py
#
# @brief A wx.Slider connected to a pex.RangeInterface node.
#
# @author Jive Helix (jivehelix@gmail.com)
# @date 06 Jun 2020
# @copyright Jive Helix
# Licensed under the MIT license. See LICENSE file.
from __future__ import annotations
from typing import Generic, Any, TypeVar
import wx
from ..... | [
2235,
198,
2,
2488,
7753,
28982,
13,
9078,
198,
2,
198,
2,
2488,
65,
3796,
317,
266,
87,
13,
11122,
1304,
5884,
284,
257,
613,
87,
13,
17257,
39317,
10139,
13,
198,
2,
198,
2,
2488,
9800,
449,
425,
5053,
844,
357,
73,
425,
2978,... | 3.368056 | 144 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'alberto'
# Delete rules
DO_NOTHING = 0
NULLIFY = 1
CASCADE = 2
DENY = 3
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
705,
282,
32371,
6,
198,
2,
23520,
3173,
198,
18227,
62,
11929,
39,
2751,
796,
657,
198,
... | 2.15625 | 64 |
# -*- coding: utf-8 -*-
# @Time : 2017/7/13 下午7:17
# @Author : play4fun
# @File : 1-kNN.py
# @Software: PyCharm
"""
1-kNN.py:
k 的取值最好为奇数
根据 k 个 最近邻居进行分类的方法 称为 kNN
权重
距离近的具有更高的权重, 距离远的权重更低
"""
import cv2
import numpy as np
import matplotlib.pyplot as plt
# Feature set containing (x,y) values of 25 known/tra... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
2177,
14,
22,
14,
1485,
220,
10310,
233,
39355,
230,
22,
25,
1558,
198,
2,
2488,
13838,
220,
1058,
711,
19,
12543,
198,
2,
2488,
... | 1.644708 | 926 |
from config.celery import app
from django.core.mail import send_mail
@app.task
| [
6738,
4566,
13,
7015,
88,
1330,
598,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
1330,
3758,
62,
4529,
628,
198,
31,
1324,
13,
35943,
198
] | 3.115385 | 26 |
# coding=utf-8
import time
from poco.drivers.unity3d.test.tutorial.case import TutorialCase
if __name__ == '__main__':
from airtest.core.api import connect_device
connect_device('Android:///')
import pocounit
pocounit.main()
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
640,
198,
6738,
279,
25634,
13,
36702,
13,
9531,
18,
67,
13,
9288,
13,
83,
44917,
13,
7442,
1330,
36361,
20448,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
... | 2.692308 | 91 |