content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Generated by Django 3.1.7 on 2021-03-21 15:54
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
3070,
12,
2481,
1315,
25,
4051,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from .project import load_project, new_project, use_project # noqa: F401
| [
6738,
764,
16302,
1330,
3440,
62,
16302,
11,
649,
62,
16302,
11,
779,
62,
16302,
220,
1303,
645,
20402,
25,
376,
21844,
198
] | 3.217391 | 23 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkCommonCore import (
vtkPoints,
vtkUnsigne... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
645,
1040,
14978,
9485,
3118,
411,
5634,
19927,
198,
11748,
410,
30488,
18170,
13,
85,
30488,
9492,
2673,
21466... | 2.556017 | 241 |
from django.utils import timezone
from django.views.generic import ListView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import path
from .urls import urlpatterns
from ..models import File
urlpatterns.append(
path('files/', FileListView.as_view(), name='file-list')
)
| [
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
19816,
1040,
1330,
23093,
37374,
35608,
259,
198,
6738,
42625,
14208,... | 3.210526 | 95 |
from chatbot import app
from flask import render_template,flash, request
from chatbot.forms import chatbotform
from chatbot.__init__ import model,words,classes,intents
import nltk
import pickle
import json
import numpy as np
from keras.models import Sequential,load_model
import random
from datetime import datetime
imp... | [
6738,
8537,
13645,
1330,
598,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
34167,
11,
2581,
198,
6738,
8537,
13645,
13,
23914,
1330,
8537,
13645,
687,
198,
6738,
8537,
13645,
13,
834,
15003,
834,
1330,
2746,
11,
10879,
11,
37724,
11,
... | 3.017167 | 233 |
import os
import etcd
ETCD_HOST = os.getenv("ETCD_HOST", "localhost")
etcd_client = EtcdClient(host=ETCD_HOST, port=2379)
| [
11748,
28686,
198,
11748,
3503,
67,
628,
198,
198,
2767,
8610,
62,
39,
10892,
796,
28686,
13,
1136,
24330,
7203,
2767,
8610,
62,
39,
10892,
1600,
366,
36750,
4943,
198,
316,
10210,
62,
16366,
796,
17906,
10210,
11792,
7,
4774,
28,
276... | 2.358491 | 53 |
#!/usr/bin/env python
# Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute.
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2022-02-24 14:51
@author: johannes
"""
import flask
from flask import (
Flask,
render_template,
flash,
reque... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
66,
8,
33160,
9447,
25374,
11,
14023,
25582,
2770,
290,
15084,
3225,
30766,
5136,
13,
198,
2,
13789,
25,
17168,
13789,
357,
3826,
38559,
24290,
13,
14116,
393,
2638,
137... | 2.145355 | 3,660 |
from flask import Flask, render_template, request
import requests
import json
from datetime import datetime
import csv
from activate import process_activation
app = Flask(__name__)
global_token = ""
@app.route('/activate', methods=['GET', 'POST'])
@app.route('/', methods=['GET', 'POST'])
if __name__ == '__main... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
11748,
7007,
198,
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
269,
21370,
198,
6738,
15155,
1330,
1429,
62,
48545,
198,
198,
1324,
796,
46947,
7,
834,
... | 3.110092 | 109 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from django.contrib.... | [
2,
770,
6276,
1366,
373,
4635,
329,
262,
471,
13,
311,
13,
5070,
739,
17453,
1400,
13,
370,
1314,
47,
22,
51,
12,
1485,
12,
34,
12,
37,
8054,
11,
290,
198,
2,
318,
2426,
284,
262,
6923,
287,
20671,
6060,
12,
15419,
36313,
17230,... | 1.632443 | 8,532 |
# ===STEP 2=== #
from selenium import webdriver
from time import sleep # Sleep will pause the program
import os # for getting the local path
dirpath = os.getcwd() # gets local path
driver = webdriver.Chrome(dirpath + "/chromedriver")
driver.get("http://www.dominos.com.cn/menu/menu.html?menuIndex=0&RNDSEED=c429056... | [
2,
24844,
42135,
362,
18604,
1303,
198,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
640,
1330,
3993,
220,
1303,
17376,
481,
14985,
262,
1430,
198,
11748,
28686,
220,
1303,
329,
1972,
262,
1957,
3108,
198,
198,
15908,
6978... | 3.308861 | 395 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-07 15:40
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
16,
319,
1584,
12,
2931,
12,
2998,
1315,
25,
1821,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import io
from . import vis
from . import transform
from . import light
from . import render
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
764,
1330,
33245,
198,
6738,
764,
1330,
1490,
198,
6738,
764,
1330,
6121,
198,... | 4.137255 | 51 |
# Driver method
if __name__ == '__main__':
mat = [[1, 2, 3],
[4, 5, 6],
[7, 18, 14]];
n = 3;
if (findSaddlePoint(mat, n) ==
False):
print("No Saddle Po"); | [
201,
198,
201,
198,
2,
12434,
2446,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
201,
198,
220,
220,
220,
2603,
796,
16410,
16,
11,
362,
11,
513,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
... | 1.684211 | 133 |
import sys
import os
import time, traceback
import json
PACKAGE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0,PACKAGE_ROOT)
from commons.logger import Logger
from config.initializers import KAFKA_BROKER, KAFKA_TOPIC,KAFKA_CONSUMER_GROUP_ID
from kafka import KafkaC... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
640,
11,
12854,
1891,
198,
11748,
33918,
198,
47,
8120,
11879,
62,
13252,
2394,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
... | 2.362069 | 464 |
# Copyright 2018 Open Source Robotics Foundation, 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... | [
2,
15069,
2864,
4946,
8090,
47061,
5693,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.023452 | 1,066 |
from vbr.tableclasses import Status
__all__ = ["StatusApi"]
| [
6738,
410,
1671,
13,
11487,
37724,
1330,
12678,
198,
198,
834,
439,
834,
796,
14631,
19580,
32,
14415,
8973,
628
] | 3.1 | 20 |
# Copyright 2018 Brad Jascob
#
# 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, s... | [
2,
15069,
2864,
8114,
449,
3372,
672,
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,
... | 2.558464 | 573 |
from .__Fundamental_44 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class NetLongTermDebtIssuanceCashFlowStatement(QuantCon... | [
6738,
764,
834,
24553,
6860,
62,
2598,
1330,
1635,
198,
11748,
19720,
198,
11748,
4482,
13,
9399,
198,
11748,
4482,
13,
5216,
26448,
13,
46189,
198,
11748,
4482,
198,
11748,
16972,
13313,
13,
6601,
13,
24553,
6860,
13,
29800,
5990,
2101... | 3.121058 | 2,156 |
import argparse
import logging
import sys
import os
import traceback
import time
import subprocess
import getpass
import datetime
from inspect import getfullargspec
from argparse import RawTextHelpFormatter
from du.denv.Denv import Denv
from du.denv.Denv import ErrCodes
# Host platform string for Windows
PLATFORM_OS_... | [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
12854,
1891,
198,
11748,
640,
198,
11748,
850,
14681,
198,
11748,
651,
6603,
198,
11748,
4818,
8079,
198,
198,
6738,
10104,
1330,
651,
12853,
853,
16... | 2.613248 | 936 |
# For tokens
ONE_OR_MORE = "+"
OR = "|"
# Reserved is a generic keyword type.
# Meant to be a builtin for the TCL syntax.
RESERVED = "RESERVED"
# Ignore is a flag for characters that don't have functional impact on the TCL source.
# We are using it quite liberally to ignore all whitespace and newline characters.
IGNO... | [
2,
1114,
16326,
198,
11651,
62,
1581,
62,
23346,
796,
43825,
1,
198,
1581,
796,
366,
91,
1,
198,
198,
2,
33876,
318,
257,
14276,
21179,
2099,
13,
198,
2,
2185,
415,
284,
307,
257,
3170,
259,
329,
262,
309,
5097,
15582,
13,
198,
... | 2.920188 | 213 |
import os
print(os.path.abspath(__file__))
| [
11748,
28686,
198,
4798,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198
] | 2.388889 | 18 |
# Copyright (c) 2020 Club Raiders Project
# https://github.com/HausReport/ClubRaiders
#
# SPDX-License-Identifier: BSD-3-Clause
#
# SPDX-License-Identifier: BSD-3-Clause
from typing import Dict
from craid.eddb.base.NamedItem import NamedItem
| [
2,
220,
220,
15069,
357,
66,
8,
12131,
6289,
16120,
4935,
198,
2,
220,
220,
3740,
1378,
12567,
13,
785,
14,
39,
8717,
19100,
14,
42350,
49043,
364,
198,
2,
198,
2,
220,
220,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
... | 2.663158 | 95 |
from .version import __version__
from .genre import main, process
| [
6738,
764,
9641,
1330,
11593,
9641,
834,
198,
6738,
764,
35850,
1330,
1388,
11,
1429,
198
] | 4.125 | 16 |
# -*- coding: utf-8 -*-
try:
from django.urls import reverse
except ImportError: # Will be removed in Django 2.0
from django.core.urlresolvers import reverse
from social_core.backends.oauth import BaseOAuth2
from .settings import DRFSO2_PROPRIETARY_BACKEND_NAME, DRFSO2_URL_NAMESPACE
from oauth2_provider.mod... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
16341,
17267,
12331,
25,
220,
1303,
2561,
307,
4615,
287,
37770,
362,
13,
15,
198... | 2.337861 | 589 |
import json
from copy import copy, deepcopy
from io import StringIO
import pandas
from pandas import DataFrame # Required for eval
FORCE_INCLUDE_DATAFRAME_IN_PYCHARM = DataFrame() # Prevents clean=up removal
import pytest
from deepdiff import DeepDiff
from hypothesis import given
from hypothesis.extra.pandas impor... | [
11748,
33918,
198,
6738,
4866,
1330,
4866,
11,
2769,
30073,
198,
6738,
33245,
1330,
10903,
9399,
198,
198,
11748,
19798,
292,
198,
6738,
19798,
292,
1330,
6060,
19778,
220,
1303,
20906,
329,
5418,
198,
198,
13775,
5222,
62,
1268,
5097,
... | 2.773913 | 345 |
import os
from gradetools.py.execute2.insert import InsertConfig
PYTHON_EXTENSIONS = ('ipynb', 'py')
EXCEL_EXTENSIONS = ('xlsx', 'xls', 'xlsm')
PYTHON_FOLDER = os.path.sep.join(['Grading', 'Python'])
PYTHON_PLAGIARISM_FOLDER = os.path.sep.join([PYTHON_FOLDER, 'Plagiarism'])
EXCEL_FOLDER = os.path.sep.join(['Grading',... | [
11748,
28686,
198,
198,
6738,
3915,
316,
10141,
13,
9078,
13,
41049,
17,
13,
28463,
1330,
35835,
16934,
198,
198,
47,
56,
4221,
1340,
62,
13918,
16938,
11053,
796,
19203,
541,
2047,
65,
3256,
705,
9078,
11537,
198,
6369,
34,
3698,
62,... | 1.929134 | 254 |
# time O(n^2)
# space O(1)
| [
2,
640,
440,
7,
77,
61,
17,
8,
201,
198,
2,
2272,
440,
7,
16,
8,
201,
198
] | 1.611111 | 18 |
'''pessoas = {'nome': 'Lorran', 'sexo': 'M', 'idade': 22}
#pessoas['peso'] = '100.0' #Esse comando adiciona uma linha
for k, v in pessoas.items():
print(f'{k} = {v}')'''
#print(pessoas.items())
#print(pessoas.values())
#print(pessoas.keys())
#print(f'O {pessoas["nome"]} tem {pessoas["idade"]} anos')
'... | [
7061,
6,
79,
408,
78,
292,
796,
1391,
6,
77,
462,
10354,
705,
43,
273,
2596,
3256,
705,
8044,
78,
10354,
705,
44,
3256,
705,
312,
671,
10354,
2534,
92,
201,
198,
2,
79,
408,
78,
292,
17816,
12272,
78,
20520,
796,
705,
3064,
13,
... | 2.011416 | 438 |
import hashlib
str = "String_senha" #Senha em texto aberto
hash_sha3_512 = hashlib.new("sha3_512", str.encode()) #Algoritimo de Hash selecionado e executado
print(hash_sha3_512)
print(hash_sha3_512.hexdigest())#Hash gerada
| [
198,
11748,
12234,
8019,
628,
198,
2536,
796,
366,
10100,
62,
6248,
3099,
1,
1303,
10445,
3099,
795,
2420,
78,
450,
13806,
198,
198,
17831,
62,
26270,
18,
62,
25836,
796,
12234,
8019,
13,
3605,
7203,
26270,
18,
62,
25836,
1600,
965,
... | 2.505495 | 91 |
"""Wrapper for Xinerama
Generated with:
tools/genwrappers.py xinerama
Do not modify this file.
"""
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xinerama')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):
# Some builds of ctypes apparently do not have c_int... | [
37811,
36918,
2848,
329,
1395,
7274,
1689,
198,
198,
8645,
515,
351,
25,
198,
31391,
14,
5235,
29988,
11799,
13,
9078,
2124,
7274,
1689,
198,
198,
5211,
407,
13096,
428,
2393,
13,
198,
37811,
198,
198,
11748,
269,
19199,
198,
6738,
26... | 2.497245 | 726 |
#%%
from localsearch.local_search import NeighborhoodRelation
from localsearch.simulated_annealing import SimulatedAnnealing
from typing import Callable
import networkx as nx
| [
2,
16626,
198,
6738,
1957,
12947,
13,
12001,
62,
12947,
1330,
37914,
6892,
341,
198,
6738,
1957,
12947,
13,
14323,
4817,
62,
21952,
4272,
1330,
3184,
4817,
43227,
4272,
198,
6738,
19720,
1330,
4889,
540,
198,
11748,
3127,
87,
355,
299,
... | 4.069767 | 43 |
from django.shortcuts import render
from hdcp_app.models import test_table
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
289,
67,
13155,
62,
1324,
13,
27530,
1330,
1332,
62,
11487,
198,
2,
13610,
534,
5009,
994,
13,
198
] | 3.482759 | 29 |
import numpy as np
import sn_plotter_metrics.nsnPlot as nsn_plot
import matplotlib.pylab as plt
import argparse
from optparse import OptionParser
import glob
# from sn_tools.sn_obs import dataInside
import healpy as hp
import numpy.lib.recfunctions as rf
import pandas as pd
import os
import multiprocessing
def proces... | [
11748,
299,
32152,
355,
45941,
198,
11748,
3013,
62,
29487,
353,
62,
4164,
10466,
13,
5907,
77,
43328,
355,
299,
16184,
62,
29487,
198,
11748,
2603,
29487,
8019,
13,
79,
2645,
397,
355,
458,
83,
198,
11748,
1822,
29572,
198,
6738,
217... | 2.295232 | 4,383 |
import re
from collections import Counter
INPUT_FILE = "../../input/06.txt"
# pre-written code starts here
with open(INPUT_FILE) as f:
input_ = f.read()
blocks = [block.split("\n") for block in input_.split("\n\n")]
lines = [line.strip() for line in input_.split("\n")]
wordlines = [line.split() for line in lin... | [
11748,
302,
198,
6738,
17268,
1330,
15034,
198,
198,
1268,
30076,
62,
25664,
796,
366,
40720,
40720,
15414,
14,
3312,
13,
14116,
1,
198,
198,
2,
662,
12,
15266,
2438,
4940,
994,
628,
198,
4480,
1280,
7,
1268,
30076,
62,
25664,
8,
35... | 2.372709 | 491 |
from google.appengine.ext import ndb
from rest_gae.users import User as RESTUser
class User(RESTUser):
"""Our own user class"""
organization = ndb.KeyProperty(kind='Organization')
role = ndb.KeyProperty(kind='Role', repeated=True)
# # This is optional, but if we use a RESTMeta - we must inherit it (... | [
6738,
23645,
13,
1324,
18392,
13,
2302,
1330,
299,
9945,
198,
6738,
1334,
62,
25002,
13,
18417,
1330,
11787,
355,
30617,
12982,
628,
198,
4871,
11787,
7,
49,
6465,
12982,
2599,
628,
220,
220,
220,
37227,
5122,
898,
2836,
1398,
37811,
... | 3.097983 | 347 |
"""
Copyright (c) 2020 LG Electronics Inc.
SPDX-License-Identifier: MIT
"""
import bb
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
from devtool import setup_tinfoil, DevtoolError
logger = logging.getLogger("devtool")
logger.setLevel(logging.WARNING)
cla... | [
37811,
198,
15269,
357,
66,
8,
12131,
17370,
27828,
3457,
13,
198,
4303,
36227,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
37811,
198,
198,
11748,
275,
65,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
... | 2.284173 | 1,390 |
'''
This module provides the ``Entity`` base class, as well as its metaclass
``EntityMeta``.
'''
from py23compat import sorted
import sys
import types
import warnings
from copy import deepcopy
import sqlalchemy
from sqlalchemy import Table, Column, Integer, desc, ForeignKey, and_, \
ForeignKe... | [
7061,
6,
198,
1212,
8265,
3769,
262,
7559,
32398,
15506,
2779,
1398,
11,
355,
880,
355,
663,
1138,
330,
31172,
198,
15506,
32398,
48526,
15506,
13,
198,
7061,
6,
198,
198,
6738,
12972,
1954,
5589,
265,
1330,
23243,
198,
198,
11748,
25... | 2.153912 | 12,884 |
from .lstm import LSTMTransformer
from .resnet1d import Resnet1dTransformer
from .resnet2d import Resnet2dTransformer
from .gated_resnet1d import GatedResnet1dTransformer
from .gated_resnet2d import GatedResnet2dTransformer
| [
6738,
764,
75,
301,
76,
1330,
406,
2257,
44,
8291,
16354,
198,
6738,
764,
411,
3262,
16,
67,
1330,
1874,
3262,
16,
67,
8291,
16354,
198,
6738,
764,
411,
3262,
17,
67,
1330,
1874,
3262,
17,
67,
8291,
16354,
198,
6738,
764,
70,
515,... | 2.871795 | 78 |
#!/usr/bin/env python3
"""
Example file showing the tuning of an Izhikevich neuron using pyNeuroML.
File: source/Userdocs/NML2_examples/tune-izhikevich.py
Copyright 2021 NeuroML contributors
"""
from pyneuroml.tune.NeuroMLTuner import run_optimisation
import pynwb # type: ignore
import numpy as np
from pyelectro.u... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
16281,
2393,
4478,
262,
24549,
286,
281,
314,
23548,
522,
49547,
43164,
1262,
12972,
8199,
1434,
5805,
13,
198,
198,
8979,
25,
2723,
14,
12982,
31628,
14,
45,
5805,
17,... | 2.263486 | 6,729 |
import robot
import robot2
import numpy as np
policy = Policy()
policy.collect_training_data()
| [
11748,
9379,
198,
11748,
9379,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
30586,
796,
7820,
3419,
198,
30586,
13,
33327,
62,
34409,
62,
7890,
3419,
198
] | 3.428571 | 28 |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
if __name__ == '__main__':
rospy.init_node('keyboard_cmd_vel')
keyboard_cmd_vel = KeyTwist()
keyboard_cmd_vel.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
686,
2777,
88,
198,
6738,
22939,
62,
907,
14542,
13,
19662,
1330,
44088,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
686,
2777,
... | 2.47561 | 82 |
from torch.distributions import Distribution
import torch
from typing import Type, Callable, Sequence, Union
HyperParameters = Union[torch.Tensor, float, int]
DistributionOrBuilder = Union[Type[Distribution], Callable[[Sequence[HyperParameters]], Distribution]]
| [
6738,
28034,
13,
17080,
2455,
507,
1330,
27484,
198,
11748,
28034,
198,
6738,
19720,
1330,
5994,
11,
4889,
540,
11,
45835,
11,
4479,
198,
198,
38197,
48944,
796,
4479,
58,
13165,
354,
13,
51,
22854,
11,
12178,
11,
493,
60,
198,
20344,... | 3.984848 | 66 |
"""
This creates an index.html file for the find-links directory on the openmdao.org site.
"""
import sys
import os.path
import hashlib
import fnmatch
def find_files(startdir, pats):
"""Return a list of files (using a generator) that match
the given list of glob patterns. Walks an entire directory structure... | [
37811,
198,
1212,
8075,
281,
6376,
13,
6494,
2393,
329,
262,
1064,
12,
28751,
8619,
319,
262,
1280,
9132,
5488,
13,
2398,
2524,
13,
198,
37811,
628,
198,
11748,
25064,
198,
11748,
28686,
13,
6978,
198,
11748,
12234,
8019,
198,
11748,
... | 2.201856 | 431 |
# -*- coding: utf-8 -*-
"""
Script Name: Process.py
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
import os
from PySide2.QtCore import QProcess
# ---------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
198,
7391,
6530,
25,
10854,
13,
9078,
198,
13838,
25,
2141,
33822,
71,
14,
40335,
532,
513,
35,
6802,
13,
198,
198,
11828,
25,
198,
198,
37811,
198,
2,
1... | 4.189655 | 116 |
import PyPDF2
import sys
#inputs from command
inputs = sys.argv[1:]
#merging PDF
#call the function
pdf_merger(inputs)
#ROTATE PDFs
# with open('dummy.pdf', 'rb') as file:
# reader = PyPDF2.PdfFileReader(file)
# page = reader.getPage(0)
# page.rotateClockwise(90)
# writer = PyPDF2.PdfFileWri... | [
198,
11748,
9485,
20456,
17,
198,
11748,
25064,
198,
198,
2,
15414,
82,
422,
3141,
198,
15414,
82,
796,
25064,
13,
853,
85,
58,
16,
47715,
198,
198,
2,
647,
2667,
12960,
628,
198,
198,
2,
13345,
262,
2163,
198,
12315,
62,
647,
136... | 2.19 | 200 |
from time import sleep
from LEDStrip import LEDStrip
from Wheels import Wheels
from Servos import Servos
from Joystick import Joystick
if __name__ == "__main__":
print("> Testing Robot <")
print(" > Testing LEDs...")
led = LEDStrip(0.5)
led.led_test()
print(" > LED Testing Complete!")
... | [
6738,
640,
1330,
3993,
198,
198,
6738,
12365,
1273,
5528,
1330,
12365,
1273,
5528,
198,
6738,
37416,
1330,
37416,
198,
6738,
3116,
418,
1330,
3116,
418,
198,
6738,
14087,
13915,
1330,
14087,
13915,
628,
628,
198,
198,
361,
11593,
3672,
... | 2.473054 | 334 |
# Script to Take a JSON object, convert it into a Python structure, and convert the Python structure into Flora-2 code.
# Jason Morris
import sys, json, types
# Get the data from the command line
filename = sys.argv[1]
file = open(filename, "r")
# Convert from JSON to Python structure
dictionary = json.load(file)
#p... | [
2,
12327,
284,
7214,
257,
19449,
2134,
11,
10385,
340,
656,
257,
11361,
4645,
11,
290,
10385,
262,
11361,
4645,
656,
4432,
64,
12,
17,
2438,
13,
198,
2,
8982,
14433,
198,
198,
11748,
25064,
11,
33918,
11,
3858,
198,
198,
2,
3497,
... | 3.169154 | 201 |
import importlib.machinery
import importlib.util
import inspect
import sys
from pathlib import Path
from types import ModuleType
from typing import Callable, Iterator, List, Optional, Tuple, TypedDict
MemberDefinitions = Iterator[_MemberDef]
Members = List[Tuple[str, object]]
| [
11748,
1330,
8019,
13,
76,
620,
15451,
198,
11748,
1330,
8019,
13,
22602,
198,
11748,
10104,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
3858,
1330,
19937,
6030,
198,
6738,
19720,
1330,
4889,
540,
11,
40806,
1352,
... | 3.54321 | 81 |
# To run all test in a Python environment:
import sys; sys.path.insert(0, "C:\Work\python\mikecore"); import tests.test_run_all
| [
2,
1675,
1057,
477,
1332,
287,
257,
11361,
2858,
25,
198,
11748,
25064,
26,
25064,
13,
6978,
13,
28463,
7,
15,
11,
366,
34,
7479,
12468,
59,
29412,
59,
76,
522,
7295,
15341,
1330,
5254,
13,
9288,
62,
5143,
62,
439,
628,
198
] | 3.023256 | 43 |
import numpy as np
import tensorflow as tf
import sys
from emotion_inferring.model.GCALSTM import GCALSTMCell
from emotion_inferring.model.MALSTM import MALSTMCell
from emotion_inferring.model.GCM import GCAttention
from emotion_inferring.model.SelfAttention import *
| [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
25064,
198,
198,
6738,
9942,
62,
259,
2232,
1806,
13,
19849,
13,
15916,
1847,
2257,
44,
1330,
20145,
1847,
2257,
9655,
695,
198,
6738,
9942,
62,
259,
... | 3.032609 | 92 |
# -*- coding: utf-8 -*-
from collections import namedtuple
from typing import Dict, List, Union
LDCreatorResult = namedtuple("LDCreatorResult", ["success", "json_ld_object", "keys", "messages"])
DATALAD_SCHEMA_BASE = "https://schema.datalad.org"
# Automatically translated study-element properties
STUDY_TRAN... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
628,
198,
43,
9697,
630,
273,
23004,
796,
3706,
83,
29291,
7203,
43,
969... | 2.600829 | 724 |
import os
import pickle
import re
from datetime import datetime as dt
import cv2
import numpy as np
from functools import wraps
from time import time
@timing
| [
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
302,
198,
6738,
4818,
8079,
1330,
4818,
8079,
355,
288,
83,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
6... | 3.192308 | 52 |
# -*- coding: utf-8 -*-
import Queue
# 先序遍历
# 递归实现先序遍历
# 递归实现中序遍历
if __name__ == '__main__':
b = BinaryTree()
b.add(1)
b.add(2)
b.add(3)
b.add(4)
b.add(5)
b.add(6)
b.add(7)
# b.p_traversal()
b.recursion_p(b.root)
print '========================='
b.rec... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4670,
518,
628,
628,
220,
220,
220,
1303,
10263,
227,
230,
41753,
237,
34402,
235,
43889,
228,
628,
220,
220,
220,
1303,
16268,
222,
240,
37605,
240,
22522,
... | 1.522523 | 222 |
import numpy as np
import tensorflow as tf
if __name__ == '__main__':
np.random.seed(0)
img = np.random.randn(1, 10, 10, 1)
tf_img = tf.convert_to_tensor(img)
print(img[0, :, :, 0])
rois = np.array([[0, 0, 6, 6],
[2, 2, 8, 8]], dtype=np.float32)
tf_rois = tf.convert_to_... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
45941,
13,
25120,
13,
28826,
7,
15,
8,
628,
220,
220,
220,
33705,
... | 1.909589 | 365 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-11-09 10:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import lib.fields
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
22,
319,
2864,
12,
1157,
12,
2931,
838,
25,
1415,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.926829 | 82 |
import random
import string
from shutit_module import ShutItModule
| [
11748,
4738,
198,
11748,
4731,
198,
198,
6738,
4423,
270,
62,
21412,
1330,
18736,
1026,
26796,
628,
198
] | 3.888889 | 18 |
"""Time taken when baking lasagna
"""
EXPECTED_BAKE_TIME = 40
PREPARATION_TIME = 2
def bake_time_remaining(elapsed_bake_time):
"""Calculate the bake time remaining.
:param elapsed_bake_time: int baking time already elapsed.
:return: int remaining bake time derived from 'EXPECTED_BAKE_TIME'.
Function... | [
37811,
7575,
2077,
618,
16871,
39990,
48669,
198,
37811,
198,
49864,
9782,
1961,
62,
4339,
7336,
62,
34694,
796,
2319,
198,
198,
46437,
27082,
6234,
62,
34694,
796,
362,
198,
198,
4299,
28450,
62,
2435,
62,
2787,
1397,
7,
417,
28361,
... | 3.206349 | 378 |
import socket as s
try:
server_soc = s.socket(family=s.AF_INET,type=s.SOCK_STREAM)
server_soc.bind(('localhost',9999))
server_soc.listen(1)
print("<---- Server side ---->")
while True:
(clien_soc,(c_addr)) = server_soc.accept()
print("Connection Established from {0} with {1} port".... | [
11748,
17802,
355,
264,
198,
198,
28311,
25,
628,
220,
220,
220,
4382,
62,
35634,
796,
264,
13,
44971,
7,
17989,
28,
82,
13,
8579,
62,
1268,
2767,
11,
4906,
28,
82,
13,
50,
11290,
62,
2257,
32235,
8,
198,
220,
220,
220,
4382,
62... | 2.368539 | 445 |
"""
79. Word Search
------------------
https://leetcode.com/problems/word-search/
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may ... | [
37811,
198,
3720,
13,
9678,
11140,
198,
1783,
438,
198,
5450,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
4775,
12,
12947,
14,
198,
198,
15056,
257,
362,
35,
3096,
290,
257,
1573,
11,
1064,
611,
262,
1573,
7160,
287,
262,
... | 2.741641 | 329 |
"""
The purpose of this mini project for ES 8.01/8.012 is to show the orbit of
two objects in a bynary system using Newton's Gravitational Law, Conservation
of Momentum and Newton's 2nd Law. The visualization will be produced using the
different features of vpython.
Before running the code, in the command pro... | [
37811,
201,
198,
464,
4007,
286,
428,
9927,
1628,
329,
13380,
807,
13,
486,
14,
23,
13,
30206,
318,
284,
905,
262,
13066,
286,
220,
201,
198,
11545,
5563,
287,
257,
416,
77,
560,
1080,
1262,
17321,
338,
32599,
22181,
3854,
11,
23702... | 2.715224 | 2,588 |
# Generated by Django 3.2 on 2021-04-12 10:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_fsm
import uuid
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
319,
33448,
12,
3023,
12,
1065,
838,
25,
940,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9... | 3.032787 | 61 |
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as interp
import scipy.constants as constants
import scipy.signal as signal
import sys, time, os
import bead_util as bu
fac = 425 * constants.elementary_charge
base_path = '/processed_data/comsol_data/patch_potentials/'
fnames = bu.find... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11748,
629,
541,
88,
13,
3849,
16104,
378,
355,
987,
79,
198,
11748,
629,
541,
88,
13,
9979,
1187,
355,
38491,
198,
11748,
629,
5... | 1.914406 | 4,054 |
import numpy as np
import copy
from datetime import datetime, timedelta
import pandas as pd
from sklearn.neural_network import MLPClassifier
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import StratifiedShuffleS... | [
11748,
299,
32152,
355,
45941,
198,
11748,
4866,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
1341,
35720,
13,
710,
1523,
62,
27349,
1330,
10373,
47,
9487,
7483,
198,
... | 2.580968 | 1,797 |
# coding=utf-8
try:
from src.testcase.GN_Y201H.case.GN_Y201H_SMART_LINK.GN_Y201H_SMART_LINK_001 import *
except ImportError as e:
print(e)
| [
2,
19617,
28,
40477,
12,
23,
198,
28311,
25,
198,
220,
220,
220,
422,
12351,
13,
9288,
7442,
13,
16630,
62,
56,
1264,
39,
13,
7442,
13,
16630,
62,
56,
1264,
39,
62,
12310,
7227,
62,
43,
17248,
13,
16630,
62,
56,
1264,
39,
62,
... | 2.1 | 70 |
#!/usr/bin/env python
import argparse
import complib
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
198,
11748,
2299,
571,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.526316 | 38 |
from concurrent import futures
import logging
import csv
import grpc
import meter_usage_pb2
import meter_usage_pb2_grpc
if __name__ == '__main__':
logging.basicConfig()
serve()
| [
6738,
24580,
1330,
25650,
198,
11748,
18931,
198,
11748,
269,
21370,
198,
198,
11748,
1036,
14751,
198,
11748,
16430,
62,
26060,
62,
40842,
17,
198,
11748,
16430,
62,
26060,
62,
40842,
17,
62,
2164,
14751,
628,
628,
198,
361,
11593,
367... | 2.96875 | 64 |
from aoc2015.day17 import packings, minimal_packings
| [
6738,
257,
420,
4626,
13,
820,
1558,
1330,
2353,
654,
11,
10926,
62,
8002,
654,
628,
198
] | 3.235294 | 17 |
"""Indicator model."""
class Indicator(object):
"""Indicator for FDC report.
Indicator for FDC reports have values for Q1, Q2, Q3, Q4 or/and a value.
it allows to follow the evolution of an indicator during the quarters and have its final value
or to follow an indicator with only a single value.
... | [
37811,
5497,
26407,
2746,
526,
15931,
628,
198,
4871,
1423,
26407,
7,
15252,
2599,
628,
220,
220,
220,
37227,
5497,
26407,
329,
376,
9697,
989,
13,
628,
220,
220,
220,
1423,
26407,
329,
376,
9697,
3136,
423,
3815,
329,
1195,
16,
11,
... | 2.386194 | 536 |
"""
Functions shared by easypypi.py and licenses.py
Check: Separate file required to avoid circular import?
"""
import os
def create_file(filepath, content, **kwargs):
"""
Create a new file using writelines, and backup if filepath==setup.py.
Returns "file exists" if filepath already exists and overwrite ... | [
37811,
198,
24629,
2733,
4888,
416,
2562,
79,
4464,
72,
13,
9078,
290,
16625,
13,
9078,
198,
9787,
25,
8621,
30748,
2393,
2672,
284,
3368,
18620,
1330,
30,
198,
37811,
198,
198,
11748,
28686,
628,
198,
4299,
2251,
62,
7753,
7,
7753,
... | 2.155319 | 940 |
'''ToDo List GUI'''
import tkinter
from tkinter import END,ANCHOR
count=0
'''Defining root window'''
root=tkinter.Tk()
root.title('ToDo-GUI')
root.iconbitmap('todo.ico')
root.geometry('400x400')
root.resizable(0,0)
'''Define fonts and colors'''
my_font=('Times New Roman',12)
root_color='green'
button_color='#e2cff4... | [
7061,
6,
2514,
5211,
7343,
25757,
7061,
6,
198,
11748,
256,
74,
3849,
198,
6738,
256,
74,
3849,
1330,
23578,
11,
1565,
3398,
1581,
198,
9127,
28,
15,
628,
198,
7061,
6,
7469,
3191,
6808,
4324,
7061,
6,
198,
15763,
28,
30488,
3849,
... | 2.483796 | 864 |
from sanic import Sanic
from sanic.response import json, text
from throttle import AsyncThrottle
from throttle.storage import RedisStorage
app = Sanic()
@app.route("/")
@AsyncThrottle("5/m", "request.remote_addr",
callback=lambda *args, **kwargs:
text('tirgger the throttle', status... | [
6738,
5336,
291,
1330,
2986,
291,
198,
6738,
5336,
291,
13,
26209,
1330,
33918,
11,
2420,
198,
6738,
29976,
1330,
1081,
13361,
817,
305,
23296,
198,
6738,
29976,
13,
35350,
1330,
2297,
271,
31425,
628,
198,
1324,
796,
2986,
291,
3419,
... | 2.22467 | 227 |
import os, pickle, time, sys, traceback
import DataSetPrepare as DSP
datalist=[]
#dfile='./Datasets/D10_CKplus_10groups_groupedbythe_CKplus-group-details_preprocessdata_with_calibRotation_rescaleimg_geometricfeatures_facepatches_weberface_skip-contempV2.pkl'
#datalist.append(dfile)
#dfile='./Datasets/D33_KDEF_10... | [
11748,
28686,
11,
2298,
293,
11,
640,
11,
25064,
11,
12854,
1891,
201,
198,
11748,
6060,
7248,
37534,
533,
355,
360,
4303,
201,
198,
201,
198,
67,
10254,
396,
28,
21737,
201,
198,
2,
7568,
576,
28,
4458,
14,
27354,
292,
1039,
14,
... | 2.097333 | 750 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The tests."""
from unittest import TestCase
from fzbz import FizzBuzz
class FzBzTest(TestCase):
"""Fizz Buzz Test."""
def setUp(self):
"""Setup."""
self.obj = FizzBuzz()
def test_num(self):
"""The return value should be based of F... | [
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,
464,
5254,
526,
15931,
198,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
277,
14969,
89,
1330,
... | 1.91989 | 362 |
import inspect
from inspect import signature, getfullargspec
from functools import wraps
from typing import Union
from celery.canvas import chain, Signature
from celery.local import PromiseProxy
from celery.result import AsyncResult
from celery.utils.log import get_task_logger
from firexkit.result import wait_on_asyn... | [
11748,
10104,
198,
6738,
10104,
1330,
9877,
11,
651,
12853,
853,
16684,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
19720,
1330,
4479,
198,
198,
6738,
18725,
1924,
13,
5171,
11017,
1330,
6333,
11,
34894,
198,
6738,
18725,
1924,
... | 2.497249 | 1,999 |
import datetime
import time
from google.appengine.api import urlfetch
from google.appengine.api.labs import taskqueue
from google.appengine.ext import db
from google.appengine.ext.db import polymodel
from tweetengine import oauth
from tweetengine.i18n import _
ROLE_ANYONE = 0
ROLE_USER = 1
ROLE_ADMINISTRATOR = 2
R... | [
11748,
4818,
8079,
198,
11748,
640,
198,
6738,
23645,
13,
1324,
18392,
13,
15042,
1330,
2956,
1652,
7569,
198,
6738,
23645,
13,
1324,
18392,
13,
15042,
13,
75,
8937,
1330,
4876,
36560,
198,
6738,
23645,
13,
1324,
18392,
13,
2302,
1330,
... | 2.579787 | 188 |
#!/usr/bin/env python3
###################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: make_training_list.py
# Authors: Chris Lovett
#
# Requires: Python 3.x
#
#############################################################... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
29113,
29113,
29113,
21017,
198,
2,
198,
2,
220,
4935,
25,
220,
13302,
47238,
18252,
10074,
357,
23304,
8,
198,
2,
220,
9220,
25,
220,
220,
220,
220,
787,
62,
34409,
62,
4868,
... | 2.446981 | 1,971 |
import numpy as np
from matplotlib import pyplot as plt
import scipy.stats
from microsim.opencl.ramp.params import Params
from microsim.opencl.ramp.simulator import Simulator
from microsim.opencl.ramp.snapshot import Snapshot
from microsim.opencl.ramp.disease_statuses import DiseaseStatus
nplaces = 8
npeople = 50000
n... | [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
629,
541,
88,
13,
34242,
198,
6738,
4580,
14323,
13,
9654,
565,
13,
81,
696,
13,
37266,
1330,
2547,
4105,
198,
6738,
4580,
1432... | 2.991304 | 115 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
... | 2.598355 | 1,337 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import re
import socket
import sys
# Colors
from argparse import Namespace
green = '\033[32m'
red = '\033[31m'
reset = '\033[0m'
yellow = '\033[33m'
banner = """
██████ ▓█████ ▓█████ ██ ▄█▀ ██▓ ▓█████ ▄▄▄ ██ ▄█▀
▒██ ▒ ▓█ ▀ ▓█ ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
17802,
198,
11748,
25064,
198,
198,
2,
29792,
198,
6738,
1822,
29572,
1330,
285... | 1.634221 | 976 |
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
2,
15069,
2864,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 1.595133 | 11,752 |
# -*- coding: utf-8 -*-
!pip uninstall tensorflow
!pip install tensorflow-gpu==2.0.0
!pip install keras-tuner==1.0.0 --no-dependencies
!pip install terminaltables colorama
import tensorflow as tf
import kerastuner as kt
import matplotlib.pyplot as plt
(train_images, train_labels), (test_images, test_labels) =\
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
0,
79,
541,
43194,
11192,
273,
11125,
198,
198,
0,
79,
541,
2721,
11192,
273,
11125,
12,
46999,
855,
17,
13,
15,
13,
15,
198,
198,
0,
79,
541,
2721,
41927,
29... | 2.304239 | 802 |
LOCAL_DATA_ROOT = '/Users/varunn/Documents/projects/Sentence_Embeddings/'
INP_PATH = LOCAL_DATA_ROOT + 'raw_data/'
INT_PATH = LOCAL_DATA_ROOT + 'inter_data/'
PRE_PATH = LOCAL_DATA_ROOT + 'preprocessed_data/'
MODEL_PATH = LOCAL_DATA_ROOT + 'modelling/'
RESULTS_PATH = LOCAL_DATA_ROOT + 'results/'
INP_TICKETS_FN = INP_PAT... | [
29701,
1847,
62,
26947,
62,
13252,
2394,
796,
31051,
14490,
14,
7785,
20935,
14,
38354,
14,
42068,
14,
31837,
594,
62,
31567,
6048,
654,
14,
6,
198,
1268,
47,
62,
34219,
796,
37347,
1847,
62,
26947,
62,
13252,
2394,
1343,
705,
1831,
... | 2.06841 | 994 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33160,
383,
3012,
4992,
46665,
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,
... | 2.732381 | 5,179 |
#
# Copyright 2019 Google LLC
#
# 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 ... | [
2,
198,
2,
15069,
13130,
3012,
11419,
198,
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
... | 4.013699 | 219 |
import pytest
from elpis.wrappers.objects.interface import KaldiInterface
@pytest.fixture
def pipeline_upto_step_1(tmpdir):
"""
PyTest Fixture: returns a pipeline that executes once per session up to step 1.
"""
# Step 0
# ======
# Create a Kaldi interface directory (where all the associated ... | [
11748,
12972,
9288,
198,
198,
6738,
1288,
79,
271,
13,
29988,
11799,
13,
48205,
13,
39994,
1330,
509,
37566,
39317,
198,
198,
31,
9078,
9288,
13,
69,
9602,
198,
4299,
11523,
62,
37623,
78,
62,
9662,
62,
16,
7,
22065,
15908,
2599,
19... | 2.489496 | 476 |
from .datathief import * | [
6738,
764,
19608,
776,
2086,
1330,
1635
] | 3.428571 | 7 |
"""AvailabilityTest class"""
from django.contrib.auth.models import User
from django.test import TestCase
from member_manager.models import Availability
from member_manager.models import Profile
class AvailabilityTest(TestCase):
"""Test Availability model"""
@classmethod
def test_str(self):
""... | [
37811,
29841,
14402,
1398,
37811,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
2888,
62,
37153,
13,
27530,
1330,
43138,
198,
6738,
... | 2.01432 | 419 |
# /* BitCompression
# This sample is provided as-is, without any warranty.
#
# (c) 2007 ViALUX GmbH. All rights reserved.
# */
#
# // BlackWhiteSample.cpp : Defines the entry point for the console application.
# //
#
# #include <TCHAR.h>
# #include <windows.h>
# #include <conio.h>
# #include <stdio.h>
# #include <stdli... | [
2,
11900,
4722,
7293,
2234,
198,
2,
770,
6291,
318,
2810,
355,
12,
271,
11,
1231,
597,
18215,
13,
198,
2,
198,
2,
357,
66,
8,
4343,
16049,
1847,
31235,
402,
2022,
39,
13,
1439,
2489,
10395,
13,
198,
2,
9466,
198,
2,
198,
2,
33... | 2.159749 | 7,637 |
# KartAI https://github.com/eritzyg/KartAI/
# Copyright (c) 2017 Eritz Yerga Gutierrez and Iker García Ferrero
# MIT License https://github.com/eritzyg/KartAI/blob/master/LICENSE
import Global as glv
import Player as player
import TrackManager as tm
import Timer as timer
import Points as points | [
2,
32872,
20185,
3740,
1378,
12567,
13,
785,
14,
263,
4224,
35641,
14,
42,
433,
20185,
14,
198,
2,
15069,
357,
66,
8,
2177,
412,
29574,
575,
263,
4908,
48283,
290,
314,
6122,
16364,
29690,
12880,
34785,
198,
2,
17168,
13789,
3740,
1... | 3.182796 | 93 |
# -*- coding: utf-8 -*-
import argparse
import tqdm
import torch
from torch.utils.data import DataLoader
from torch.autograd import Variable
import numpy as np
import yaml
from terminaltables import AsciiTable
from models.Yolo3Body import YOLOV3
from utils.util import xywh2xyxy, non_max_suppression, get_batch_stat... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
1822,
29572,
198,
198,
11748,
256,
80,
36020,
198,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
13,
2306,
519,
6... | 2.545898 | 1,024 |
import datetime as dt
import random
import functions.models as models
#import sys
def create_task(from_user, from_user_id,
owner, content, priority=3):
'''
Create a task with given params.
'''
models.database.connect()
db_task = models.Task.create(from_user = from_user,
... | [
11748,
4818,
8079,
355,
288,
83,
198,
11748,
4738,
198,
11748,
5499,
13,
27530,
355,
4981,
198,
198,
2,
11748,
25064,
198,
198,
4299,
2251,
62,
35943,
7,
6738,
62,
7220,
11,
422,
62,
7220,
62,
312,
11,
220,
198,
220,
220,
220,
220... | 2.053131 | 2,108 |
"""
Code illustration: 9.02
Lock Demo
Tkinter GUI Application Development Blueprints
"""
import threading
if __name__ == "__main__":
for i in range(100):
LockDemo()
| [
37811,
198,
10669,
20936,
25,
860,
13,
2999,
198,
220,
220,
220,
13656,
34588,
198,
51,
74,
3849,
25757,
15678,
7712,
4518,
17190,
198,
37811,
198,
198,
11748,
4704,
278,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
12... | 2.787879 | 66 |
shiftLeftTable = [
1, 1, 2, 2, 2, 2, 2, 2,
1, 2, 2, 2, 2, 2, 2, 1
] | [
30846,
18819,
10962,
796,
685,
198,
220,
220,
220,
352,
11,
352,
11,
362,
11,
362,
11,
362,
11,
362,
11,
362,
11,
362,
11,
198,
220,
220,
220,
352,
11,
362,
11,
362,
11,
362,
11,
362,
11,
362,
11,
362,
11,
352,
198,
60
] | 1.630435 | 46 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import io
from xlwt import *
class BaseExcelOutput:
"""
基础单表数据导出
"""
def run(self, data: [dict, dict], format_data: dict) -> bytes:
"""
:param data: example——[
{'number': '123', 'status': 1, 'is_pay': False},
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
33245,
198,
6738,
2124,
75,
46569,
1330,
1635,
628,
198,
4871,
7308,
3109,
5276,
26410,
25,
198,
220,
220,
220,
372... | 1.348919 | 2,267 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import torch
import torch.utils.data
from opts import opts
from models.model import create_model, load_model, save_model
from logger import Logger
from datasets.dataset_factory im... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
4808,
15003,
62,
6978,
82,
198,
198,
11748,
28686,
198,
198,
11748,
28034,
19... | 3.368421 | 152 |
# -*- coding:utf-8 -*-#
import gradient_descend_optimization as gd
import eval.eval_by_effort as ebe
import eval.layout as lyt
import time as timestamp
import process_layout as pl
#import genetic_optimization as gen
import simulated_annealing_optimization as sa
#import neural_network_optimization as nn
import sys
# p... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
2,
198,
11748,
31312,
62,
20147,
437,
62,
40085,
1634,
355,
308,
67,
198,
11748,
5418,
13,
18206,
62,
1525,
62,
14822,
419,
355,
304,
1350,
198,
11748,
5418,
13,
39786,
355,
3... | 3.034483 | 203 |
URL_COMPANY_FILING_SEARCH = 'https://www.sec.gov/cgi-bin/browse-edgar?CIK=[cik]&action=getcompany'
URL_13F_QR_XML = 'https://www.sec.gov/Archives/edgar/data/[cik]/[acc_no]/form13fInfoTable.xml'
| [
21886,
62,
9858,
47,
31827,
62,
46700,
2751,
62,
5188,
31315,
796,
705,
5450,
1378,
2503,
13,
2363,
13,
9567,
14,
37157,
12,
8800,
14,
25367,
325,
12,
276,
4563,
30,
34,
18694,
41888,
979,
74,
60,
5,
2673,
28,
1136,
39722,
6,
198,... | 2.119565 | 92 |
# Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
""" Build an rpm from oci-utils.
"""
import os
import subprocess
import sys
from distutils.core import Command
from distutils.errors import DistutilsExecError
from distutils import log
sys.path.insert(0, os.path.abspath('lib'))
try:
f... | [
2,
15069,
357,
66,
8,
2177,
11,
13130,
18650,
290,
14,
273,
663,
29116,
13,
1439,
2489,
10395,
13,
198,
198,
37811,
10934,
281,
37542,
422,
267,
979,
12,
26791,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
... | 1.988249 | 3,489 |
import nengo
import numpy as np
| [
11748,
299,
1516,
78,
198,
11748,
299,
32152,
355,
45941,
628,
198
] | 2.833333 | 12 |