content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Python script to configure off-band a project advanced search
import sys, os, ConfigParser
sys.path.append( os.path.abspath(os.path.dirname('.')) )
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from cog.config.search import read_config
#from django.conf import settings
print 'Upgrading COG'
# read search conf... | [
2,
11361,
4226,
284,
17425,
572,
12,
3903,
257,
1628,
6190,
2989,
198,
11748,
25064,
11,
28686,
11,
17056,
46677,
198,
198,
17597,
13,
6978,
13,
33295,
7,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
10786... | 2.637168 | 226 |
#class Solution:
# def findingUsersActiveMinutes(self, logs: List[List[int]], k: int) -> List[int]:
# pass
if __name__ == "__main__":
logs = [[0,5],[1,2],[0,2],[0,5],[1,3]]
k = 5
expected = [0,2,0,0,0]
test(logs,k,expected)
logs = [[1,1],[2,2],[2,3]]
k = 4
expected = [1,1,0,0... | [
2,
4871,
28186,
25,
198,
2,
220,
220,
220,
825,
4917,
14490,
13739,
9452,
1769,
7,
944,
11,
17259,
25,
7343,
58,
8053,
58,
600,
60,
4357,
479,
25,
493,
8,
4613,
7343,
58,
600,
5974,
198,
2,
220,
220,
220,
220,
220,
220,
220,
1... | 1.912088 | 182 |
import logging
from utils import setup_logging
from pipe_engine import Move, GROW
from point import Point, LEFT, UP, RIGHT, DOWN
from path_checker_engine import PathCheckerEngine
if __name__ == "__main__":
setup_logging()
size = 4
pipes = [
(Point(0, 0), Point(3, 1)),
(Point(1, 1), Point(3... | [
11748,
18931,
198,
198,
6738,
3384,
4487,
1330,
9058,
62,
6404,
2667,
198,
6738,
12656,
62,
18392,
1330,
10028,
11,
10863,
3913,
198,
6738,
966,
1330,
6252,
11,
12509,
9792,
11,
15958,
11,
33621,
11,
30320,
198,
6738,
3108,
62,
9122,
... | 2.449782 | 229 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014-17 Richard Hull and contributors
# See LICENSE.rst for details.
"""
Collection of datasets to prevent regression bugs from creeping in.
"""
demo_ssd1306 = [
255, 1, 1, 1, 1, 1, 129, 97, 25, 9, 5, 5, 5, 5, 5, 9, 25, 97, 129, 1, 1, 1,
1, 1, 2... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
1946,
12,
1558,
6219,
28238,
290,
20420,
198,
2,
4091,
38559,
24290,
13,
81,
301,
329,
3307,
... | 1.567765 | 84,653 |
"""
Script to pull the latest changes from the SerGIS Client git repository and
put them in the web directory.
"""
import sys, os.path, subprocess, shutil
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "send2trash"))
from send2trash import send2trash
GIT_REPO = "C:\\sergis_files\\git\\s... | [
37811,
198,
7391,
284,
2834,
262,
3452,
2458,
422,
262,
2930,
38,
1797,
20985,
17606,
16099,
290,
198,
1996,
606,
287,
262,
3992,
8619,
13,
198,
37811,
198,
198,
11748,
25064,
11,
28686,
13,
6978,
11,
850,
14681,
11,
4423,
346,
198,
... | 2.585799 | 338 |
"""
Macro command to convert to interactive shell operation.
This is a special command to use in run command groups/macros to start interactive
command mode for the terminal. Useful when in scenarios where you wish to prefix an
interactive session with commonly executed commands. For example, if you want to select
cer... | [
37811,
198,
14155,
305,
3141,
284,
10385,
284,
14333,
7582,
4905,
13,
198,
198,
1212,
318,
257,
2041,
3141,
284,
779,
287,
1057,
3141,
2628,
14,
20285,
4951,
284,
923,
14333,
198,
21812,
4235,
329,
262,
12094,
13,
49511,
618,
287,
138... | 3.685637 | 369 |
#!/usr/bin/env python
"""Parse Nginx logs."""
import sys
import json
if len(sys.argv) != 3:
print('parse_log.py SRC_PATH DST_PATH')
exit(-1)
input_file = sys.argv[1]
output_file = sys.argv[2]
LOG_FORMAT = '$remote_addr - $remote_user [$time_local] "$request" ' + \
'$status $body_bytes_sent "$htt... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
10044,
325,
399,
42822,
17259,
526,
15931,
198,
11748,
25064,
198,
11748,
33918,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
14512,
513,
25,
198,
220,
220,
220,
3601,
10786,... | 1.70418 | 1,244 |
import pyrofiler
@pyrofiler.cpu_util(description='Cpu usage')
@pyrofiler.timed('Time elapsed')
sum_series(.3, 1000_000)
| [
11748,
12972,
305,
69,
5329,
198,
198,
31,
9078,
305,
69,
5329,
13,
36166,
62,
22602,
7,
11213,
11639,
34,
19944,
8748,
11537,
198,
31,
9078,
305,
69,
5329,
13,
16514,
276,
10786,
7575,
42118,
11537,
198,
198,
16345,
62,
25076,
7,
1... | 2.44 | 50 |
quedex_public_key = """-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFlPvjsBCACr/UfHzXAezskLqcq9NiiaNFDDT5A+biC8VrOglB0ZSQOYRira
NgQ2Cp8Jd+XU77F+J1012BjB5y87Z+hdnwBDsqF7CjkjeQzsE3PSvm9I+E3cneqx
UcinRaUD1wfwVytbg9Q9rpqQ7CTjVWY1UPYjs6dAo1WAp/ux/VTeOFbpO0R3D7if
ZGY1QeISRpLWiMpcG2YCOALnuazABVCNXLhVqa8Y7tt2I... | [
198,
421,
276,
1069,
62,
11377,
62,
2539,
796,
37227,
30934,
33,
43312,
350,
16960,
44731,
35374,
9878,
11290,
30934,
198,
14815,
25,
18509,
84,
6968,
410,
16,
198,
198,
76,
48,
1677,
33,
7414,
47,
85,
8457,
2749,
2246,
81,
14,
52,
... | 1.362629 | 1,263 |
# mean median mode
'''
what can we learn from looking at a group of numbers?
In Machine Learning (and in mathematics) there are often three values that interests us:
Mean - The average value
Median - The mid point value
Mode - The most common value
Example: We have registered the speed of 13 ca... | [
2,
1612,
14288,
4235,
201,
198,
7061,
6,
201,
198,
10919,
460,
356,
2193,
422,
2045,
379,
257,
1448,
286,
3146,
30,
201,
198,
201,
198,
818,
10850,
18252,
357,
392,
287,
19473,
8,
612,
389,
1690,
1115,
3815,
326,
5353,
514,
25,
20... | 2.671429 | 210 |
from .useragent import UserAgent
from .network import Network
| [
6738,
764,
7220,
25781,
1330,
11787,
36772,
198,
6738,
764,
27349,
1330,
7311,
198
] | 4.428571 | 14 |
from django.test import TestCase
from django.contrib.auth import get_user_model
from inbox.models import Inbox
from posts.models import Post
from posts.serializers import PostSerializer
# TODO: test cases for Like and Follow
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
198,
6738,
13734,
13,
27530,
1330,
554,
3524,
198,
6738,
6851,
13,
27530,
1330,
2947,
198,
6738,
... | 3.704918 | 61 |
from argparse import ArgumentParser
import os
from ontonotes5.utils import load_ontonotes5_from_json
from ontonotes5.utils import get_language_frequencies, get_entity_frequencies
if __name__ == '__main__':
main()
| [
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
28686,
198,
198,
6738,
319,
1122,
6421,
20,
13,
26791,
1330,
3440,
62,
756,
261,
6421,
20,
62,
6738,
62,
17752,
198,
6738,
319,
1122,
6421,
20,
13,
26791,
1330,
651,
62,
16129,
62,
... | 3.027397 | 73 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from abc import ABC, abstractmethod
import os
import warnings
import shutil
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.models import load_model,... | [
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,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
11748,
28686,
198,
11748,
14601,
1... | 3.238693 | 398 |
from tkinter import *
from Controller import controleTelas, controleBanco
| [
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
22741,
1330,
1246,
293,
33317,
292,
11,
1246,
293,
30457,
1073,
198
] | 3.7 | 20 |
#!/usr/bin/env python
"""Tests for `contextualized_topic_models` package."""
from contextualized_topic_models.models.ctm import CTM, ZeroShotTM, CombinedTM
from contextualized_topic_models.utils.data_preparation import bert_embeddings_from_file, bert_embeddings_from_list
import numpy as np
import pickle
from contextu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
51,
3558,
329,
4600,
22866,
723,
1143,
62,
26652,
62,
27530,
63,
5301,
526,
15931,
198,
198,
6738,
38356,
1143,
62,
26652,
62,
27530,
13,
27530,
13,
310,
76,
1330,
327,
1... | 3.304348 | 230 |
import csv
import sqlite3
from transaction_record import TransactionRecord
DB_HASH_COLUMN_NAME = 'hash'
DB_TABLE_NAME = 'debit1'
HASH_COLLISION_EXCEPTION_TEXT = f'UNIQUE constraint failed: {DB_TABLE_NAME}.{DB_HASH_COLUMN_NAME}'
| [
11748,
269,
21370,
198,
11748,
44161,
578,
18,
198,
198,
6738,
8611,
62,
22105,
1330,
45389,
23739,
198,
198,
11012,
62,
39,
11211,
62,
25154,
5883,
45,
62,
20608,
796,
705,
17831,
6,
198,
11012,
62,
38148,
62,
20608,
796,
705,
11275,... | 2.625 | 88 |
import argparse
import os
from glob import glob
from subprocess import run
parser = argparse.ArgumentParser(description='Run demo on a folder of examples')
parser.add_argument('--input_dir',
help='path to the input dir',
type=str,
default='samples/')
parse... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
198,
6738,
15095,
1330,
15095,
198,
6738,
850,
14681,
1330,
1057,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
10987,
13605,
319,
257,
9483,
286,
6096,
11537,
198,... | 2.09621 | 343 |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | [
2,
15069,
1946,
12,
7908,
383,
9485,
6173,
37,
34152,
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... | 2.028037 | 856 |
#!/usr/bin/python
# This is statement is required by the build system to query build info
if __name__ == '__build__':
raise Exception
import string
__version__ = string.split('$Revision: 1.1.1.1 $')[1]
__date__ = string.join(string.split('$Date: 2007/02/15 19:25:38 $')[1:3], ' ')
__author__ = 'Tarn Weisner Burto... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
770,
318,
2643,
318,
2672,
416,
262,
1382,
1080,
284,
12405,
1382,
7508,
198,
361,
11593,
3672,
834,
6624,
705,
834,
11249,
834,
10354,
198,
220,
220,
220,
5298,
35528,
628,
198,
11... | 2.651515 | 198 |
import unittest
from macro.util import get_capitalized_key_combo_pattern, get_script_name
| [
11748,
555,
715,
395,
198,
6738,
15021,
13,
22602,
1330,
651,
62,
27544,
1143,
62,
2539,
62,
785,
2127,
62,
33279,
11,
651,
62,
12048,
62,
3672,
198
] | 3.214286 | 28 |
"""
The model is adapted from the tensorflow tutorial:
https://www.tensorflow.org/get_started/mnist/pros
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import keras
from keras import backend as K
from keras.models import Sequential
from keras.layers impo... | [
37811,
198,
464,
2746,
318,
16573,
422,
262,
11192,
273,
11125,
11808,
25,
198,
5450,
1378,
2503,
13,
83,
22854,
11125,
13,
2398,
14,
1136,
62,
46981,
14,
10295,
396,
14,
1676,
82,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,... | 3.256881 | 218 |
import oh as fd
import contraseñas as cn
import hashlib
# Usuario y contraseñas
# ciframos la contraseña
cifrado = cn.pedir_con()
# Comprobamos el usuario y la contraseña
continuar = 1
# mostramos el directorio y podemos seleccionar un dentista
while continuar == 1:
fd.directorio()
seleccion = int(in... | [
11748,
11752,
355,
277,
67,
198,
11748,
3445,
589,
12654,
292,
355,
269,
77,
198,
11748,
12234,
8019,
628,
198,
2,
471,
2385,
4982,
331,
3445,
589,
12654,
292,
198,
198,
2,
269,
361,
859,
418,
8591,
3445,
589,
30644,
198,
66,
361,
... | 2.363248 | 234 |
from pm4py.statistics.traces.log import case_statistics
def get_statistics(log, parameters=None):
"""
Gets the variants from the dataframe
Parameters
------------
log
Log
parameters
Possible parameters of the algorithm
Returns
------------
variants
Variant... | [
6738,
9114,
19,
9078,
13,
14269,
3969,
13,
2213,
2114,
13,
6404,
1330,
1339,
62,
14269,
3969,
628,
198,
4299,
651,
62,
14269,
3969,
7,
6404,
11,
10007,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
29620,
262,
1767... | 2.847826 | 184 |
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from typing import List, Union
from .. import database
# from ..auth import oauth2_scheme
from ..models import node as models
from ..schemas.node import *
router = APIRouter()
Nodes = Union[
SurfaceNode,
OrbitalNode,
... | [
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
2129,
2412,
11,
14626,
16922,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
23575,
198,
6738,
19720,
1330,
7343,
11,
4479,
198,
198,
6738,
11485,
1330,
6831,
198,
2,
422,
11485,
18439,
1330... | 2.718631 | 263 |
from django.db import models
class Options(models.Model):
"""
Options controlling feedreader behavior
:Fields:
number_initially_displayed : integer
Number of entries, from all feeds, initially displayed on webpage.
number_additionally_displayed : integer
Number o... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198,
198,
4871,
18634,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
18634,
12755,
3745,
46862,
4069,
628,
220,
220,
220,
1058,
15878,
82,
25,
628,
220,
220,
... | 2.44619 | 1,273 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
628
] | 2.041667 | 24 |
# Given a string which contains only lowercase letters,
# remove duplicate letters so that every letter appears once and only once.
# You must make sure your result is the smallest in lexicographical order among all possible results.
# Example 1:
# Input: "bcabc"
# Output: "abc"
# Example 2:
# Input: "cbacdcbc"
# O... | [
2,
11259,
257,
4731,
543,
4909,
691,
2793,
7442,
7475,
11,
220,
198,
2,
4781,
23418,
7475,
523,
326,
790,
3850,
3568,
1752,
290,
691,
1752,
13,
220,
198,
2,
921,
1276,
787,
1654,
534,
1255,
318,
262,
18197,
287,
31191,
291,
17046,
... | 3.489209 | 139 |
#!/usr/bin/env python
from optparse import OptionParser
from plistlib import readPlist
from json import dumps
apple_catalog_version_map = {
'index-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog': '10.15',
'index-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
6738,
458,
396,
8019,
1330,
1100,
3646,
396,
198,
6738,
33918,
1330,
45514,
198,
198,
18040,
62,
9246,
11794,
62,
9641,
62,
8899,
796,
... | 2.027586 | 580 |
# -*-coding:utf8-*-
import re
import string
import sys
import os
import urllib
import urllib2
from bs4 import BeautifulSoup
import requests
from lxml import etree
reload(sys)
sys.setdefaultencoding('utf-8')
if len(sys.argv) == 2:
user_id = (int)(sys.argv[1])
else:
user_id = (int)(raw_input(u"请输入user_id: "))
... | [
2,
532,
9,
12,
66,
7656,
25,
40477,
23,
12,
9,
12,
198,
198,
11748,
302,
198,
11748,
4731,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
2956,
297,
571,
198,
11748,
2956,
297,
571,
17,
198,
6738,
275,
82,
19,
1330,
23762,
50,
... | 1.697588 | 1,617 |
import sdl2
import sdl2.ext
import numpy as np
from typing import Callable
| [
11748,
264,
25404,
17,
198,
11748,
264,
25404,
17,
13,
2302,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19720,
1330,
4889,
540,
628,
198
] | 3.08 | 25 |
import discord
from discord.ext import commands
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
628,
198
] | 4.545455 | 11 |
import discord
from discord.ext import commands
from asyncio import sleep
import json
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
30351,
952,
1330,
3993,
198,
11748,
33918,
198
] | 4.526316 | 19 |
from json import loads
from requests import get
| [
6738,
33918,
1330,
15989,
198,
198,
6738,
7007,
1330,
651,
628
] | 4.545455 | 11 |
from tensordata.nlp import chinese
| [
6738,
11192,
585,
1045,
13,
21283,
79,
1330,
442,
3762,
198
] | 3.181818 | 11 |
#!/usr/bin/env python3
import collections, operator
class IteratorPeeker:
'''
This class stores the next value from an iterator. You can call peek() to
peek at this value as many times as you want. When you want the next value
to be available, just call next().
'''
def merge_selection(iterators, key... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
17268,
11,
10088,
198,
4871,
40806,
1352,
6435,
28233,
25,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
770,
1398,
7000,
262,
1306,
1988,
422,
281,
41313,
13,
921,
4... | 2.552585 | 1,122 |
from screws.freeze.base import FrozenOnly
class _3dCSCG_TraceElement_IS(FrozenOnly):
""""""
@property
def on_periodic_boundary(self):
"""As this property name says."""
return self._element_._onpb_
@property
def shared_by_cores(self):
"""True or False, as this property... | [
198,
198,
6738,
23742,
13,
5787,
2736,
13,
8692,
1330,
23673,
10049,
628,
198,
198,
4871,
4808,
18,
67,
34,
6173,
38,
62,
2898,
558,
20180,
62,
1797,
7,
37,
42005,
10049,
2599,
198,
220,
220,
220,
13538,
15931,
15931,
628,
198,
220,... | 2.006667 | 450 |
import os
import sys
import argparse
import subprocess
import fileinput
from .Crawler.Fs.FsCrawler import FsCrawler
from .Crawler.Fs.DirectoryCrawler import DirectoryCrawler
from .Crawler import Crawler
from .TaskHolder.Loader import Loader
from .TaskHolder.Dispatcher import Dispatcher
class CliError(Exception):
"... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
11748,
2393,
15414,
198,
6738,
764,
34,
39464,
13,
42388,
13,
42388,
34,
39464,
1330,
376,
82,
34,
39464,
198,
6738,
764,
34,
39464,
13,
42388,
13,
... | 2.151844 | 1,844 |
#fazer um algoritmo que leia um preco de produto e mostre seu novo preco com 5% de desconto
n = float(input('Qual o preço do produto? '))
d = (n*5)/100
print('O produto com valor de {} reais, com 5% de desconto fica por: {} reais.'.format(n, n-d))
| [
2,
69,
19178,
23781,
435,
7053,
270,
5908,
8358,
443,
544,
23781,
662,
1073,
390,
40426,
9390,
304,
749,
260,
220,
384,
84,
645,
13038,
662,
1073,
401,
642,
4,
390,
1715,
5957,
198,
77,
796,
12178,
7,
15414,
10786,
46181,
267,
662,
... | 2.55102 | 98 |
import argparse
import os.path
import requests
import typing as tp
# Python-ADB may require additional packages described in requirements.txt.
from adb.sign_m2crypto import M2CryptoSigner as Signer
# from gplaycli import gplaycli
from gplaydl import gplaydl
SCRIPT_FOLDER = os.path.dirname(os.path.abspath(__file__))
A... | [
11748,
1822,
29572,
198,
11748,
28686,
13,
6978,
198,
11748,
7007,
198,
11748,
19720,
355,
256,
79,
198,
198,
2,
11361,
12,
2885,
33,
743,
2421,
3224,
10392,
3417,
287,
5359,
13,
14116,
13,
198,
6738,
512,
65,
13,
12683,
62,
76,
17,... | 2.74269 | 171 |
import pytest
import sys
from decouple import config
import json
import argparse
from elastos_adenine.stubs import health_check_pb2
from elastos_adenine.health_check import HealthCheck
from elastos_adenine.common import Common
from elastos_adenine.hive import Hive
from elastos_adenine.sidechain_eth import SidechainEth... | [
11748,
12972,
9288,
198,
11748,
25064,
198,
6738,
875,
43846,
1330,
4566,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
198,
6738,
1288,
459,
418,
62,
40780,
500,
13,
301,
23161,
1330,
1535,
62,
9122,
62,
40842,
17,
198,
6738,
1288,
... | 2.710801 | 287 |
import traci
import os, sys
import environment_state
if 'SUMO_HOME' not in os.environ:
print "SUMO setup incomplete. Exiting."
exit()
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
sumoBinary = "C:/Program Files (x86)/DLR/Sumo/bin/sumo-gui"
sumoCmd = [sumoBinary, "-c", "C:/Users/sree... | [
11748,
491,
32009,
198,
11748,
28686,
11,
25064,
198,
11748,
2858,
62,
5219,
198,
198,
361,
705,
50,
5883,
46,
62,
39069,
6,
407,
287,
28686,
13,
268,
2268,
25,
198,
197,
4798,
366,
50,
5883,
46,
9058,
17503,
13,
1475,
1780,
526,
... | 2.611702 | 188 |
import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
R, C = na()
RC = []
for i in range(R):
RC.append(na())
ans = 0... | [
11748,
25064,
198,
11748,
10688,
198,
6738,
17268,
1330,
4277,
11600,
11,
390,
4188,
198,
198,
17597,
13,
2617,
8344,
24197,
32374,
7,
940,
12429,
718,
8,
198,
19282,
259,
796,
25064,
13,
19282,
259,
198,
198,
1268,
37,
796,
12178,
10... | 1.977564 | 312 |
x = [5, 8, 2, 6, 9, 1, 0, 7]
selSort(x)
print(x)
y = [1, 9, 0, 4, 2, 5]
mergeSort(y)
print(y)
import random | [
198,
87,
796,
685,
20,
11,
807,
11,
362,
11,
718,
11,
860,
11,
352,
11,
657,
11,
767,
60,
198,
741,
42758,
7,
87,
8,
198,
4798,
7,
87,
8,
198,
198,
88,
796,
685,
16,
11,
860,
11,
657,
11,
604,
11,
362,
11,
642,
60,
198,
... | 1.71875 | 64 |
"""Web socket handler with Publish/Subscribe capabilities
Pub/Sub requires a message broker object in the "broker" app key
"""
from .channel import Channel, Event
from .channels import Channels
from .errors import CannotPublish, CannotSubscribe, ChannelCallbackError
from .manager import SocketsManager, Websocket, WsHa... | [
37811,
13908,
17802,
21360,
351,
8525,
1836,
14,
27125,
9889,
198,
198,
14876,
14,
7004,
4433,
257,
3275,
20426,
2134,
287,
262,
366,
7957,
6122,
1,
598,
1994,
198,
37811,
198,
6738,
764,
17620,
1330,
11102,
11,
8558,
198,
6738,
764,
... | 2.965854 | 205 |
from __future__ import division
from __future__ import absolute_import
from returns.io import IOFailure, IOResult, IOResultE, IOSuccess
from returns.pipeline import is_successful
def test_ioresulte():
u"""Ensures that IOResultE correctly typecast."""
container: IOResult[float, Exception] = _function(1)
a... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
5860,
13,
952,
1330,
314,
19238,
603,
495,
11,
314,
1581,
274,
586,
11,
314,
1581,
274,
586,
36,
11,
314,
2640,
84,
1591,
198,
6738... | 2.965517 | 145 |
import logging.config
log = logging.getLogger(__name__)
def input_type_checker(board_arg, hand_arg):
"""
Checks if the input type provided is valid
:param board_arg: list of string with len > 2
:param hand_arg: list of string with len = 2
:return:
"""
is_valid = False
if isinstance(b... | [
11748,
18931,
13,
11250,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
4299,
5128,
62,
4906,
62,
9122,
263,
7,
3526,
62,
853,
11,
1021,
62,
853,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
... | 2.252665 | 938 |
from django.urls import path
from . import views
urlpatterns = [
path('output/', views.summariser, name='summariser'),
path('', views.index, name='index'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
22915,
14,
3256,
5009,
13,
16345,
3876,
5847,
11,
1438,
11639,
16345,
3876,
5847,
33809,
1... | 2.847458 | 59 |
from aqt.utils import showInfo
from aqt.qt import (
QWidget,
QLineEdit,
QVBoxLayout,
QPushButton
)
| [
6738,
257,
39568,
13,
26791,
1330,
905,
12360,
198,
6738,
257,
39568,
13,
39568,
1330,
357,
198,
220,
220,
220,
1195,
38300,
11,
198,
220,
220,
220,
1195,
13949,
18378,
11,
198,
220,
220,
220,
1195,
53,
14253,
32517,
11,
198,
220,
2... | 2.32 | 50 |
#/usr/bin/python
#
# Schedule repeated chores to Google tasks based on Quiver notebook
#
# We look for @repeat(...) tags to find tasks to be scheduled regularly.
# Examples:
# - Schedule something every Monday @repeat(weekday=1)
# - Do something urgent every Tuesday @repeat(weekday=1, due=+1)
# - Do something eve... | [
2,
14,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
19281,
5100,
46173,
284,
3012,
8861,
1912,
319,
2264,
1428,
20922,
198,
2,
198,
2,
775,
804,
329,
2488,
44754,
7,
23029,
15940,
284,
1064,
8861,
284,
307,
7530,
7987,
13,
198,
2,
... | 2.143678 | 1,740 |
import tensorflow as tf
from compy.models.graphs.tf import utils
from compy.models.graphs.tf.layer.propagation_model_layer import PropagationModelLayer
class EmbeddingLayerState(object):
"""Holds the state / weights of a Embedding Layer."""
class EmbeddingLayer(PropagationModelLayer):
"""Implementation of ... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
552,
88,
13,
27530,
13,
34960,
82,
13,
27110,
1330,
3384,
4487,
198,
6738,
552,
88,
13,
27530,
13,
34960,
82,
13,
27110,
13,
29289,
13,
22930,
363,
341,
62,
19849,
62,
29289,
133... | 2.606811 | 323 |
# Copyright 2013 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 a... | [
198,
2,
15069,
2211,
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,
13... | 3.01292 | 774 |
# -*- coding: utf-8 -*-
"""A simple assembler that doesn't do any interpreting in the middle."""
import networkx as nx
from pybel import BELGraph
__all__ = [
'reify_bel_graph_simple',
]
def reify_bel_graph_simple(graph: BELGraph) -> nx.DiGraph:
"""Convert a BEL graph to a simple reified graph.
In thi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
32,
2829,
11156,
1754,
326,
1595,
470,
466,
597,
35391,
287,
262,
3504,
526,
15931,
198,
198,
11748,
3127,
87,
355,
299,
87,
198,
198,
6738,
12972,
6667,
1... | 2.571006 | 338 |
import pytest
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
@pytest.fixture
| [
11748,
12972,
9288,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
2673,
62,
38861,
1330,
7561,
1925,
1299,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628
] | 3.394737 | 38 |
# ------------------------------------------------------------------
#
# Module for generation of travel times and transit modes
#
# ------------------------------------------------------------------
import math
from random import choices, choice
class Transit(object):
''' Class for generation of transit times and ... | [
2,
16529,
438,
198,
2,
198,
2,
197,
26796,
329,
5270,
286,
3067,
1661,
290,
11168,
12881,
220,
198,
2,
198,
2,
16529,
438,
198,
198,
11748,
10688,
198,
6738,
4738,
1330,
7747,
11,
3572,
198,
198,
4871,
22325,
7,
15252,
2599,
198,
... | 2.593563 | 2,672 |
from setuptools import setup, find_packages
setup(
name = "pymeetups",
version = "1.1.2",
author = "Wasim Thabraze",
author_email = "wasim@thabraze.me",
description = "Find information about future Pycon conferences and meetups through your terminal",
license = "MIT",
keywords = "pymeetups... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
796,
366,
9078,
47745,
4739,
1600,
198,
220,
220,
220,
2196,
796,
366,
16,
13,
16,
13,
17,
1600,
198,
220,
220,
220,
1772,
796... | 2.319565 | 460 |
"""
ret = 5 + 2 + 2 * (7 - 1) + 3 + 2 * (6 + 3 * (-13 + 8) + 4)
"""
testcases = [
{
'input': [5, 2, [7, -1], 3, [6, [-13, 8], 4]],
'output': 12,
},
{
'input': [1, 2, [3], 4, 5],
'output': 18,
},
]
"""
def productSum(array):
def rec(obj, layer):
if isinstanc... | [
37811,
198,
198,
1186,
796,
642,
1343,
362,
1343,
362,
1635,
357,
22,
532,
352,
8,
1343,
513,
1343,
362,
1635,
357,
21,
1343,
513,
1635,
13841,
1485,
1343,
807,
8,
1343,
604,
8,
198,
198,
37811,
198,
9288,
33964,
796,
685,
198,
22... | 1.868715 | 358 |
from django.contrib import admin
from .models import Registrado
from .forms import RegModelForm
# Register your models here.
admin.site.register(Registrado, AdminRegistrado) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
13811,
81,
4533,
198,
6738,
764,
23914,
1330,
3310,
17633,
8479,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
28482,
13,
15654,
13,
30238,
7,
8081,
396,... | 3.431373 | 51 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ykdl.extractor import VideoExtractor
from ykdl.videoinfo import VideoInfo
from ykdl.util.html import get_content
from ykdl.util.match import match1, matchall
from xml.dom.minidom import parseString
from ykdl.compact import compact_unquote
site = Xiami()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
331,
74,
25404,
13,
2302,
40450,
1330,
7623,
11627,
40450,
198,
6738,
331,
74,
25404,
13,
15588,
10951,
1330... | 2.861111 | 108 |
from decimal import Decimal, getcontext
from typing import Union
def qDecimal(decimal: Union[str, Decimal], q: Decimal) -> Decimal:
"""Ensure that the given decimal is created as Decimal and is quantized to the correct precision.
Args:
decimal (Union[str, Decimal]): decimal to quantize
q (Dec... | [
6738,
32465,
1330,
4280,
4402,
11,
651,
22866,
198,
6738,
19720,
1330,
4479,
628,
198,
4299,
10662,
10707,
4402,
7,
12501,
4402,
25,
4479,
58,
2536,
11,
4280,
4402,
4357,
10662,
25,
4280,
4402,
8,
4613,
4280,
4402,
25,
198,
220,
220,
... | 2.852459 | 488 |
# def byteWrite(spi,csPin,register: int,subject: int,printRes: bool=True):
# """
# Method to write new byte to spi register.
# Parameters
# -----
# spi : spi object from busio.SPI
# csPin : control slave pin from board.D##
# register : address of register to be written to
# subject ... | [
2,
825,
18022,
16594,
7,
2777,
72,
11,
6359,
28348,
11,
30238,
25,
493,
11,
32796,
25,
493,
11,
4798,
4965,
25,
20512,
28,
17821,
2599,
198,
2,
220,
220,
220,
220,
37227,
198,
2,
220,
220,
220,
220,
11789,
284,
3551,
649,
18022,
... | 2.449213 | 1,398 |
import json
import os
import pkg_resources
import six
from base64 import b64encode
from binascii import unhexlify
from exporters.default_retries import retry_long
from exporters.writers.filebase_base_writer import FilebaseBaseWriter
from exporters.utils import TemporaryDirectory
from exporters.writers.base_writer imp... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
279,
10025,
62,
37540,
198,
11748,
2237,
198,
198,
6738,
2779,
2414,
1330,
275,
2414,
268,
8189,
198,
6738,
9874,
292,
979,
72,
1330,
555,
33095,
75,
1958,
198,
198,
6738,
1033,
3816,
13,
1... | 2.645418 | 502 |
# Time: O(31)
# Space: O(1)
# Time: O(31)
# Space: O(1)
| [
2,
3862,
25,
220,
440,
7,
3132,
8,
198,
2,
4687,
25,
440,
7,
16,
8,
628,
198,
2,
3862,
25,
220,
440,
7,
3132,
8,
198,
2,
4687,
25,
440,
7,
16,
8,
198
] | 1.714286 | 35 |
from rollout_storage.intefaces.replay_fill_queue_strategy import ReplayFillQueueStrategy
| [
198,
6738,
38180,
62,
35350,
13,
600,
891,
2114,
13,
260,
1759,
62,
20797,
62,
36560,
62,
2536,
4338,
1330,
23635,
33762,
34991,
13290,
4338,
628,
198
] | 3.407407 | 27 |
# import dependencies
import datetime as dt
import numpy as np
import pandas as pd
import datetime as dt
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
from flask import Flask, jsonify
from sqlalchemy import create_engine,... | [
2,
1330,
20086,
220,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
44161,
282,
26599,
198,
6738,
44161,
282,
26599,
13... | 3.144828 | 1,740 |
from django.shortcuts import render
from django.http import HttpResponse
import json
import os
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
11748,
33918,
198,
11748,
28686,
628,
198
] | 3.730769 | 26 |
from inspect import isclass
from typing import List, Tuple
from .base import GenericModelCodeGenerator, KWAGRS_TEMPLATE, METADATA_FIELD_NAME, sort_kwargs, template
from ..dynamic_typing import (DDict, DList, DOptional, ImportPathList, MetaData, ModelMeta, StringSerializable)
DEFAULT_ORDER = (
("default", "default... | [
6738,
10104,
1330,
318,
4871,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
6738,
764,
8692,
1330,
42044,
17633,
10669,
8645,
1352,
11,
509,
54,
4760,
6998,
62,
51,
3620,
6489,
6158,
11,
31243,
2885,
13563,
62,
44603,
62,
20... | 2.943089 | 123 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
2864,
383,
309,
22854,
37535,
46665,
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,
... | 3.597305 | 1,336 |
from spyne import Application,rpc,ServerBase,Iterable,Integer,Unicode
from spyne.server.wsgi import WsgiApplication
from spyne.protocol.soap import Soap11
application=Application([HelloWorldService],
tns='spyne.examples.hello',
in_protocol=Soap11(validator='lxml'),
... | [
6738,
13997,
710,
1330,
15678,
11,
81,
14751,
11,
10697,
14881,
11,
29993,
540,
11,
46541,
11,
3118,
291,
1098,
198,
6738,
13997,
710,
13,
15388,
13,
18504,
12397,
1330,
370,
82,
12397,
23416,
198,
6738,
13997,
710,
13,
11235,
4668,
1... | 2.165441 | 272 |
print('Bem vindo ao Cálculo de Média')
n1 = float(input('Digite a sua primeira nota '))
n2 = float(input('Digite sua segunda nota '))
ma = (n1 + n2) / 2
print('O resultado é {:.1f} '.format(ma))
| [
4798,
10786,
33,
368,
29178,
78,
257,
78,
327,
6557,
75,
3129,
78,
390,
43579,
67,
544,
11537,
201,
198,
77,
16,
796,
12178,
7,
15414,
10786,
19511,
578,
257,
424,
64,
6994,
8704,
407,
64,
705,
4008,
201,
198,
77,
17,
796,
12178,
... | 2.197802 | 91 |
"""Simplex Algorithm
Given: AX <=B
Objective: Maximize CX
Sample Input:
m = 5
n = 2
A = np.array([
[2, 1],
[2, 3],
[3, 1],
[-1, 0],
[0, -1],
])
B = np.array([[18, 42, 24, 1, 0]]).T
C = np.array([[3, 2]]).T
Output:
Optimal vertex is: [ 3. 12.]
"""
import numpy as np
from numpy import linalg as la
... | [
37811,
8890,
11141,
978,
42289,
198,
15056,
25,
43051,
19841,
33,
198,
10267,
425,
25,
38962,
1096,
327,
55,
198,
36674,
23412,
25,
198,
76,
796,
642,
198,
77,
796,
362,
198,
32,
796,
45941,
13,
18747,
26933,
198,
220,
220,
220,
685... | 1.948294 | 1,934 |
# A Dynamic Programming based Python Program that uses table C[][]
# to calculate the Binomial Coefficient
# Returns value of Binomial Coefficient C(n, k)
# Driver program to test above function
n = 5
k = 2
print("Value of C[" + str(n) + "][" + str(k) + "] is "
+ str(binomialCoef(n,k)))
# Time Compl... | [
2,
317,
26977,
30297,
1912,
11361,
6118,
326,
3544,
3084,
327,
58,
7131,
60,
201,
198,
2,
284,
15284,
262,
20828,
49070,
1766,
16814,
201,
198,
220,
201,
198,
2,
16409,
1988,
286,
20828,
49070,
1766,
16814,
327,
7,
77,
11,
479,
8,
... | 2.627737 | 137 |
import json
try:
from .Helpers.create_logger import create_logger
except ImportError:
from Helpers.create_logger import create_logger
try:
from .emhmeter import *
except ModuleNotFoundError:
from emhmeter import *
from time import sleep
import datetime
if __name__ == "__main__":
for _ in range(5... | [
11748,
33918,
198,
28311,
25,
198,
220,
220,
220,
422,
764,
12621,
19276,
13,
17953,
62,
6404,
1362,
1330,
2251,
62,
6404,
1362,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
10478,
364,
13,
17953,
62,
6404,
1362,
1330,
2251,... | 2.25 | 300 |
#!/bin/env python
import sys
import base64
import urllib2
import xml.etree.ElementTree as ET
if len(sys.argv) != 3:
print >> sys.stderr, '\nUsage: %s <username> <password> \n\n<username> and <password> should be credentials of a administrator.\n' % sys.argv[0]
exit(1)
endpoint = 'http://127.0.0.1:8182'
auth ... | [
2,
48443,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
11748,
2779,
2414,
198,
11748,
2956,
297,
571,
17,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
14512,
... | 2.679293 | 792 |
# fonction 2 permettant l'envoie et la réception de message à l'utilisateur via telegram
| [
2,
277,
261,
596,
362,
9943,
3087,
415,
300,
6,
268,
13038,
494,
2123,
8591,
40560,
4516,
390,
3275,
28141,
300,
6,
22602,
271,
15093,
2884,
573,
30536,
198
] | 3.068966 | 29 |
# -*- coding: utf-8 -*_
from .cluster import Cluster
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
62,
198,
6738,
764,
565,
5819,
1330,
38279,
628
] | 2.571429 | 21 |
# coding=utf-8
version = "1.0.4.0"
PP_APPID = {
"Raw": 0,
"Auth": 1,
"Beat": 7,
"Ack": 8,
"PathReq": 2,
"PathRes": 3,
"Text": 4,
"FileCommand": 20,
"File": 21,
"Shell": 22,
"Storage": 30,
"NetManage": 161,
"Sock5": 17,
"Proxy": 18,
"Data": 19,
"VPN": 15... | [
2,
19617,
28,
40477,
12,
23,
628,
198,
9641,
796,
366,
16,
13,
15,
13,
19,
13,
15,
1,
198,
198,
10246,
62,
24805,
2389,
796,
1391,
198,
220,
220,
220,
366,
27369,
1298,
657,
11,
198,
220,
220,
220,
366,
30515,
1298,
352,
11,
1... | 1.787013 | 385 |
# Generated by Django 2.2.13 on 2020-08-04 12:25
import directory_validators.string
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1485,
319,
12131,
12,
2919,
12,
3023,
1105,
25,
1495,
198,
198,
11748,
8619,
62,
12102,
2024,
13,
8841,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.095238 | 63 |
#
# Code from : https://github.com/ndo04343/crypto-post-module/blob/main/encoder.py
#
###############################################################################
####### THIS SCRIPT WILL BE UESD AUTOMATICALLY, DO NOT MODIFY OR MOVE #########
#####################################################################... | [
2,
198,
2,
220,
220,
6127,
422,
1058,
3740,
1378,
12567,
13,
785,
14,
358,
78,
3023,
32118,
14,
29609,
78,
12,
7353,
12,
21412,
14,
2436,
672,
14,
12417,
14,
12685,
12342,
13,
9078,
198,
2,
220,
220,
220,
198,
29113,
29113,
7804,
... | 2.636559 | 465 |
import numpy as np
from abc import ABCMeta, abstractmethod
class Layer(metaclass=ABCMeta):
""" The parent class for all layers """
@abstractmethod
def forward(self, inputs):
""" Feedforward pass """
raise NotImplementedError()
@abstractmethod
@abstractmethod
@abstractmethod
... | [
11748,
299,
32152,
355,
45941,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
628,
198,
4871,
34398,
7,
4164,
330,
31172,
28,
24694,
48526,
2599,
198,
220,
220,
220,
37227,
383,
2560,
1398,
329,
477,
11685,
37227,
198,
220,
... | 2.859649 | 114 |
# closehead.py - Close arbitrary heads without checking them out first
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''close arbitrary heads without checking them out first'''
from __future__ import absolute_import
from mercu... | [
2,
1969,
2256,
13,
9078,
532,
13872,
14977,
6665,
1231,
10627,
606,
503,
717,
198,
2,
198,
2,
770,
3788,
743,
307,
973,
290,
9387,
1864,
284,
262,
2846,
286,
262,
198,
2,
22961,
3611,
5094,
13789,
2196,
362,
393,
597,
1568,
2196,
... | 2.613532 | 872 |
import sys
import numpy as np
sys.path.append("./")
from vedo import screenshot
from vedo.shapes import Tube
from myterial import salmon
from manifold import embeddings, Plane
from manifold.visualize import Visualizer
from manifold import visualize
from manifold.rnn import RNN
"""
3D viisualization of an RNN's... | [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
198,
17597,
13,
6978,
13,
33295,
7,
1911,
14,
4943,
198,
6738,
410,
24757,
1330,
22032,
198,
6738,
410,
24757,
13,
1477,
7916,
1330,
34510,
198,
198,
6738,
616,
353,
498,
1330,
24... | 2.451724 | 580 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
from application_tests.tests import HTML5TestCaseBase
from testtools.matchers import NotEquals, Equals
| [
2,
532,
9,
12,
10363,
25,
11361,
26,
19617,
25,
3384,
69,
12,
23,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
26,
7400,
12,
10394,
25,
604,
532,
9,
12,
198,
198,
6738,
3586,
62,
41989,
13,
41989,
1330,
11532,
20,
14402,
20448... | 2.888889 | 63 |
from werkzeug.datastructures import FileStorage
from image_server.util import restore_orientation
from PIL import Image
from flask import Blueprint, request, jsonify, render_template, current_app
from image_server.meta import store_file_metadata, delete_file_metadata
from flask_jwt_extended import jwt_required, get_jwt... | [
6738,
266,
9587,
2736,
1018,
13,
19608,
459,
1356,
942,
1330,
9220,
31425,
198,
6738,
2939,
62,
15388,
13,
22602,
1330,
11169,
62,
13989,
341,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
42903,
1330,
39932,
11,
2581,
11,
33918,
1958,
... | 3.017544 | 171 |
# -*- coding: utf-8 -*-
from collections import OrderedDict
palette = [
0x788084, 0x0000fc, 0x0000c4, 0x4028c4,
0x94008c, 0xac0028, 0xac1000, 0x8c1800,
0x503000, 0x007800, 0x006800, 0x005800,
0x004058, 0x000000, 0x000000, 0x000008,
0xbcc0c4, 0x0078fc, 0x0088fc, 0x6848fc,
0xdc00d4, 0xe40060, 0... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
18596,
5857,
796,
685,
198,
220,
220,
220,
657,
87,
3695,
1795,
5705,
11,
657,
87,
2388,
16072,
11,
657,
87,
... | 1.630928 | 485 |
from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.defaultfilters import truncatechars
from account.models import MyUser
from video.models import Video
# Create your models here.
# def recent(self, user):
# return self.filter(acti... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
28243,
13,
12286,
10379,
1010,
1330,
40122,
4... | 3.375 | 112 |
numbers = [ int(input()) for _ in range(9) ]
max = 0
index = 0
for idx, number in enumerate(numbers):
if max < number:
max = number
index = idx
print(max, index + 1) | [
77,
17024,
796,
685,
493,
7,
15414,
28955,
329,
4808,
287,
2837,
7,
24,
8,
2361,
198,
198,
9806,
796,
657,
198,
9630,
796,
657,
198,
198,
1640,
4686,
87,
11,
1271,
287,
27056,
378,
7,
77,
17024,
2599,
198,
220,
611,
3509,
1279,
... | 2.507042 | 71 |
#!/usr/bin/env python3
"""
Quick script to compare clear-sky irradiance computations
from three different libraries.
"""
from typing import List, Dict
from datetime import datetime, timedelta
import solarpy
import pvlib
import pysolar
import matplotlib.dates as mpl_dates
import matplotlib.pyplot as plt
import pytz
fr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
21063,
4226,
284,
8996,
1598,
12,
15688,
47537,
3610,
2653,
602,
198,
6738,
1115,
1180,
12782,
13,
198,
37811,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
198,
673... | 2.372236 | 1,628 |
from social.backends.dropbox import DropboxOAuth as DropboxBackend
| [
6738,
1919,
13,
1891,
2412,
13,
14781,
3524,
1330,
38930,
23621,
1071,
355,
38930,
7282,
437,
198
] | 3.941176 | 17 |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.utils.encoding import force_unicode
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^grappelli/',... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
198,
6738,
42625,
14208,
13,
26791,
... | 2.771739 | 184 |
__author__ = 'ptesser'
| [
834,
9800,
834,
796,
705,
457,
408,
263,
6,
198
] | 2.3 | 10 |
import networkx as nx
from bokeh.io import output_file, show, curdoc
from bokeh.models import (BoxZoomTool, Circle, HoverTool,
MultiLine, Plot, Range1d, ResetTool,
EdgesAndLinkedNodes,NodesAndLinkedEdges, TapTool,
BoxSelectTool, Column... | [
11748,
3127,
87,
355,
299,
87,
201,
198,
201,
198,
6738,
1489,
365,
71,
13,
952,
1330,
5072,
62,
7753,
11,
905,
11,
1090,
15390,
201,
198,
6738,
1489,
365,
71,
13,
27530,
1330,
357,
14253,
57,
4207,
25391,
11,
16291,
11,
38452,
25... | 2.310427 | 2,110 |
from typing import Union
from pydantic import BaseModel
from erica.erica_legacy.request_processing.erica_input.v1.erica_input import EstData, UnlockCodeRequestData, \
UnlockCodeActivationData, UnlockCodeRevocationData
from enum import Enum
| [
6738,
19720,
1330,
220,
4479,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
198,
6738,
1931,
3970,
13,
263,
3970,
62,
1455,
1590,
13,
25927,
62,
36948,
13,
263,
3970,
62,
15414,
13,
85,
16,
13,
263,
3970,
62,
15414,
1330,
10062,
66... | 3.275 | 80 |
"""
QuPathBaseImporter class
Import binary masks form QuPath - via export script
!highly experimental - pre-alpha state
@author: Sebastian Krossa / MR Cancer / MH / ISB / NTNU Trondheim Norway
sebastian.krossa@ntnu.no
"""
import os
from enum import Enum, unique
# local imports
from .coregistration import CoRegistrati... | [
37811,
198,
4507,
15235,
14881,
3546,
26634,
1398,
198,
20939,
13934,
20680,
1296,
2264,
15235,
532,
2884,
10784,
4226,
198,
0,
47444,
11992,
532,
662,
12,
26591,
1181,
198,
31,
9800,
25,
26190,
509,
1214,
64,
1220,
17242,
15523,
1220,
... | 3.37 | 100 |
from __future__ import absolute_import
import uuid as _uuid
import six as _six
from six.moves import queue as _queue
from flytekit.common import interface as _interface, nodes as _nodes, sdk_bases as _sdk_bases, \
launch_plan as _launch_plan, promise as _promise
from flytekit.common.core import identifier as _id... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
334,
27112,
355,
4808,
12303,
312,
198,
198,
11748,
2237,
355,
4808,
19412,
198,
6738,
2237,
13,
76,
5241,
1330,
16834,
355,
4808,
36560,
198,
198,
6738,
6129,
660,
15813,... | 2.536175 | 1,783 |
#!/usr/bin/python
#
# python Environment Sensor Observer for Linux
#
# target device : OMRON Environment Sensor (2JCIE-BL01 & BU01) in Broadcaster mode
#
# require : python-bluez
# : fluent-logger-python (when FLUENTD_FORWARD = True in configuration)
# $ sudo pip install fluent-logger
# : ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
21015,
9344,
35367,
27058,
329,
7020,
198,
2,
198,
2,
2496,
3335,
1058,
440,
13599,
1340,
9344,
35367,
357,
17,
34382,
10008,
12,
9148,
486,
1222,
20571,
486,
8,
287,
9765,
17970... | 1.993584 | 3,585 |
from ppo_data import ppo
from env_functions import *
from utils.run_utils import ExperimentGrid
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--ss", default=0, type=int)
parser.add_argument("--se", default=5, type=int)
args = parser.parse_args()
... | [
6738,
279,
7501,
62,
7890,
1330,
279,
7501,
198,
6738,
17365,
62,
12543,
2733,
1330,
1635,
198,
6738,
3384,
4487,
13,
5143,
62,
26791,
1330,
29544,
41339,
198,
198,
11748,
1822,
29572,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
... | 2.410569 | 246 |
from threading import Thread
from PIL import Image
import os
from pathlib import Path
from os.path import expanduser
from datetime import datetime
import statistics
from .config import config
from .utils import detect
import tflite_runtime.interpreter as tflite
| [
6738,
4704,
278,
1330,
14122,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
28686,
13,
6978,
1330,
4292,
7220,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
7869,
198,
198,
67... | 3.712329 | 73 |
# encoding:utf-8
import urllib2
"""
使用Request对象的方法add_header,在请求头中增加信息
还有方法 add_data(data) add_header(key,value) add_unredirected_header(key,value)
get_data() get_full_url() get_header() get_host() get_method() get_origin_req_host()
"""
url = "https://www.lagou.com/jobs/list_python/p-city_2"
print(do... | [
2,
21004,
25,
40477,
12,
23,
198,
198,
11748,
2956,
297,
571,
17,
198,
37811,
198,
45635,
18796,
101,
18453,
43380,
117,
164,
109,
94,
21410,
43095,
37345,
243,
2860,
62,
25677,
171,
120,
234,
28839,
101,
46237,
115,
162,
109,
224,
... | 1.930233 | 172 |
from .base import *
DEBUG = False
SECRET_KEY = os.getenv('SECRET_KEY')
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '').split(',')
SECRET_KEY = os.environ.get('SECRET_KEY')
| [
6738,
764,
8692,
1330,
1635,
198,
198,
30531,
796,
10352,
198,
23683,
26087,
62,
20373,
796,
28686,
13,
1136,
24330,
10786,
23683,
26087,
62,
20373,
11537,
198,
7036,
3913,
1961,
62,
39,
10892,
50,
796,
28686,
13,
1136,
24330,
10786,
70... | 2.356164 | 73 |