content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
import uuid
... | [
2,
16529,
982,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321,
13,
198,
2,
16529,
45537,
198,
117... | 3.512821 | 195 |
from django.urls import path, re_path
from django.views.generic import ListView, DetailView
from blog.models import Post
urlpatterns = [
path('', ListView.as_view(
queryset=Post.objects.all().order_by("-date")[:25],
template_name="... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,
42585,
7680,
198,
6738,
4130,
13,
27530,
1330,
2947,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
... | 1.757679 | 293 |
'''
Based on the csv_collect plugin
Possible arguments:
train, acquire
Flow : train -> threshold
acquire -> check threshold value -> event_processor
'''
import csv
import timeit
import datetime
import time
import json
from pprint import pprint
# import numpy as np
import plugin_interface as plugintypes
import re... | [
7061,
6,
198,
15001,
319,
262,
269,
21370,
62,
33327,
13877,
198,
198,
47,
4733,
7159,
25,
220,
198,
27432,
11,
12831,
198,
198,
37535,
1058,
4512,
4613,
11387,
220,
198,
198,
330,
29782,
4613,
2198,
11387,
1988,
4613,
1785,
62,
41341... | 2.460366 | 328 |
from django.db import models
# Create your models here.
from django.db import models
# 电影模型类
class Movie(models.Model):
"""电影"""
name = models.CharField(max_length=80, verbose_name='电影名称')
score = models.CharField(max_length=10, verbose_name='电影评分')
desc = models.CharField(max_length=50,null=True,v... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13328,
242,
113,
37605,
109,
162,
101,
94,
161,
252,
233,
163,
109,
119,
198,
4871,
... | 2.087719 | 627 |
class InclusionMap(object):
"""The mapping used to organize and initialize TreeNodes in relation
to each other.
Args:
size (int): The size of the number list used in the Numbers Round.
"""
def _generate_map(self, numbers, s=(), idx=0):
"""Generates the main map used to explore t... | [
198,
198,
4871,
554,
4717,
13912,
7,
15252,
2599,
198,
220,
220,
220,
37227,
464,
16855,
973,
284,
16481,
290,
41216,
12200,
45,
4147,
287,
8695,
198,
220,
220,
220,
284,
1123,
584,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
... | 2.321885 | 1,252 |
import boto3
client = boto3.client('ec2', region_name='us-west-2')
response = client.run_instances(
BlockDeviceMappings=[
{
'DeviceName': '/dev/xvda',
'Ebs': {
'DeleteOnTermination': True,
'VolumeSize': 8,
'VolumeType': 'gp2'
... | [
11748,
275,
2069,
18,
198,
198,
16366,
796,
275,
2069,
18,
13,
16366,
10786,
721,
17,
3256,
3814,
62,
3672,
11639,
385,
12,
7038,
12,
17,
11537,
198,
198,
26209,
796,
5456,
13,
5143,
62,
8625,
1817,
7,
198,
220,
220,
220,
9726,
24... | 1.820946 | 296 |
# parv/req.py
#
# Parser and visitor requests.
# PEP 585 (Consistent with original program style)
from __future__ import annotations
from types import coroutine
# Only way to "yield" to the parser / visitor.
@coroutine
# --- Parser / visitor requests ---
async def pop():
"""
Return the next item, advancin... | [
2,
1582,
85,
14,
42180,
13,
9078,
198,
2,
198,
2,
23042,
263,
290,
21493,
7007,
13,
198,
198,
2,
350,
8905,
642,
5332,
357,
9444,
7609,
351,
2656,
1430,
3918,
8,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
3858,
133... | 2.746102 | 449 |
# Copyright (c) 2005 - 2007 OGG, LLC
# See LICENSE.txt for details
import sys
import re
from datetime import datetime
from time import strptime
from twisted.words.xish import domish
STANZA_RE = re.compile("^(<iq[^>]*/>|<iq.*?</iq>|<message[^>]*/>|<message.*?</message>|<presence[^>]*/>|<presence.*?</presence>)+$")
# ... | [
2,
15069,
357,
66,
8,
5075,
532,
4343,
220,
440,
11190,
11,
11419,
220,
198,
2,
4091,
38559,
24290,
13,
14116,
329,
3307,
198,
11748,
25064,
198,
11748,
302,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
640,
1330,
965,
457,
5... | 2.266667 | 255 |
import PAC_1
import PAC_2
| [
11748,
16741,
62,
16,
201,
198,
11748,
16741,
62,
17,
201
] | 2.454545 | 11 |
# Copyright 2021 Tianmian Tech. 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 la... | [
2,
15069,
33448,
20834,
76,
666,
9634,
13,
1439,
6923,
33876,
13,
198,
2,
220,
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... | 3.831429 | 350 |
import numpy as np
from keras.models import Sequential
import matplotlib.pyplot as plt
from time import sleep
| [
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
640,
1330,
3993,
198
] | 3.46875 | 32 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
220,
220,
220,
198
] | 3.083333 | 12 |
import WebMirror.OutputFilters.FilterBase
import WebMirror.OutputFilters.util.MessageConstructors as msgpackers
from WebMirror.OutputFilters.util.TitleParsers import extractTitle
import bs4
import re
import calendar
import datetime
import WebRequest
import time
import urllib.parse
import json
import traceback
MI... | [
628,
198,
11748,
5313,
27453,
1472,
13,
26410,
11928,
1010,
13,
22417,
14881,
198,
198,
11748,
5313,
27453,
1472,
13,
26410,
11928,
1010,
13,
22602,
13,
12837,
42316,
669,
220,
355,
31456,
8002,
364,
198,
6738,
5313,
27453,
1472,
13,
26... | 3.806818 | 528 |
#!/usr/bin/env python3
import os.path
import requests
# A list of words used for counters
COUNTER_WORDS = ('counter', 'counters')
# A list of prepositions and what not that cannot be counter types
FORBIDDEN_COUNTERS = ('a', 'additional', 'all', 'and', 'another', 'does', 'each', 'get', 'had', 'have',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
13,
6978,
198,
11748,
7007,
198,
198,
2,
317,
1351,
286,
2456,
973,
329,
21154,
198,
34,
19385,
5781,
62,
45359,
5258,
796,
19203,
24588,
3256,
705,
66,
15044,
... | 2.698565 | 1,254 |
#!/usr/bin/python
# odi-multiselect.py - continuously read cards and post numbers to defined REST endpoint
#
# Adapted from multiselect.py, pacakaged as part of the RFIDiot library. (c) Adam Laurie
#
# This code is copyright (c) David Tarrant, 2013, All rights reserved.
# The following terms apply:
#
# This c... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
220,
267,
10989,
12,
16680,
786,
801,
13,
9078,
532,
17282,
1100,
4116,
290,
1281,
3146,
284,
5447,
30617,
36123,
198,
2,
220,
198,
2,
220,
30019,
276,
422,
1963,
786,
801,
13,
90... | 2.837386 | 658 |
from pdf4me.helper.pdf4me_exceptions import Pdf4meClientException
from pdf4me.model import Extract, ExtractResources
| [
6738,
37124,
19,
1326,
13,
2978,
525,
13,
12315,
19,
1326,
62,
1069,
11755,
1330,
350,
7568,
19,
1326,
11792,
16922,
198,
6738,
37124,
19,
1326,
13,
19849,
1330,
29677,
11,
29677,
33236,
628
] | 3.470588 | 34 |
import math
import os
from collections import Counter
import numpy as np
import torch
from torch.utils.data import DataLoader
from utils import get_batch
| [
11748,
10688,
198,
11748,
28686,
198,
6738,
17268,
1330,
15034,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
198,
6738,
3384,
4487,
1330,
651,
62,
43501,
628,
... | 3.878049 | 41 |
import io
def image_to_bytesio(img):
"""Converts PIL.Image to io.BytesIO of a PNG."""
bytes_output = io.BytesIO()
img.save(bytes_output, format='PNG')
bytes_output = bytes_output.getvalue()
return bytes_output
| [
11748,
33245,
628,
198,
4299,
2939,
62,
1462,
62,
33661,
952,
7,
9600,
2599,
198,
220,
220,
220,
37227,
3103,
24040,
350,
4146,
13,
5159,
284,
33245,
13,
45992,
9399,
286,
257,
36182,
526,
15931,
198,
220,
220,
220,
9881,
62,
22915,
... | 2.617978 | 89 |
from pathlib import PosixPath
from difflib import get_close_matches
def get_matching_files(directory: PosixPath, filter_str: str) -> list:
"""Get all file names in "directory" and (case insensitive) match the ones
that exactly match "filter_str"
In case there is no exact match, return closely match... | [
6738,
3108,
8019,
1330,
18574,
844,
15235,
198,
6738,
814,
8019,
1330,
651,
62,
19836,
62,
6759,
2052,
628,
198,
4299,
651,
62,
15699,
278,
62,
16624,
7,
34945,
25,
18574,
844,
15235,
11,
8106,
62,
2536,
25,
965,
8,
4613,
1351,
25,
... | 2.57177 | 418 |
import gkedata
import gkedgbasis
from pylab import *
import pylab
import tables
import math
import numpy
import pylab
import numpy
from matplotlib import rcParams
import matplotlib.pyplot as plt
# customization for figure
rcParams['lines.linewidth'] = 2
rcParams['font.size'] = 18
rcParams[... | [
11748,
308,
9091,
1045,
198,
11748,
308,
9091,
70,
12093,
271,
198,
6738,
279,
2645,
397,
1330,
1635,
198,
198,
11748,
279,
2645,
397,
198,
11748,
8893,
198,
11748,
10688,
198,
11748,
299,
32152,
198,
11748,
279,
2645,
397,
198,
11748,
... | 1.941662 | 1,937 |
import pytest
from accel.utils.string_parsing import hhmmss_from_str | [
11748,
12972,
9288,
198,
6738,
936,
5276,
13,
26791,
13,
8841,
62,
79,
945,
278,
1330,
289,
71,
3020,
824,
62,
6738,
62,
2536
] | 2.833333 | 24 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | [
2,
28373,
2393,
329,
262,
45368,
28413,
10314,
27098,
13,
198,
2,
198,
2,
770,
2393,
691,
4909,
257,
6356,
286,
262,
749,
2219,
3689,
13,
1114,
257,
1336,
198,
2,
1351,
766,
262,
10314,
25,
198,
2,
3740,
1378,
2503,
13,
82,
746,
... | 2.832985 | 1,437 |
import numpy as np
# cn{sn}
CN1 = [
[17, 'query rate: 14/1743=0.008032128514056224', 'max seen acy: 0.5540631296171927', 'max cover acy: 0.5266781411359724', 'max share acy: 0.8871359223300971', 'max unkown acy: 0.11425462459194777', 'max unkown cover acy: 0.22633297062023938', 'max all acy: 0.47332185886402756', [1... | [
11748,
299,
32152,
355,
45941,
628,
198,
198,
2,
269,
77,
90,
16184,
92,
198,
44175,
16,
796,
685,
198,
58,
1558,
11,
705,
22766,
2494,
25,
1478,
14,
1558,
3559,
28,
15,
13,
405,
1795,
2624,
1065,
5332,
1415,
2713,
5237,
1731,
325... | 2.121994 | 11,517 |
#!/usr/bin/env python
# coding: utf-8
from collections import OrderedDict
import torch
import torchvision.models as models
from torchvision.models.detection.rpn import AnchorGenerator
from head_detection.models.fast_rcnn import FasterRCNN
from head_detection.models.net import BackBoneWithFPN
from head_detection.mode... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
11748,
28034,
198,
11748,
28034,
10178,
13,
27530,
355,
4981,
198,
6738,
28034,
10178,
13,
... | 1.878891 | 2,056 |
#!/usr/bin/env python3
#
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from cros.factory.umpire.server import webapp_utils
if __name__ == '__main__':
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
15069,
2864,
383,
18255,
1505,
7294,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
... | 3.132653 | 98 |
"""
Main module - set of functions that simulate or correct colorblindness for images
as described in
https://www.researchgate.net/publication/326626897_Smartphone_Based_Image_Color_Correction_for_Color_Blindness
"""
import numpy as np
import cv2
## LMS Daltonization
def rgb_to_lms(img):
"""
lms_matrix = np.ar... | [
37811,
198,
13383,
8265,
532,
900,
286,
5499,
326,
29308,
393,
3376,
3124,
27461,
1108,
329,
4263,
198,
292,
3417,
287,
198,
5450,
1378,
2503,
13,
34033,
10494,
13,
3262,
14,
11377,
341,
14,
18,
25540,
2075,
4531,
22,
62,
25610,
4862,... | 2.058524 | 786 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
49962,
284,
1012,
280,
1082,
64,
11,
3457,
13,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198... | 3.214442 | 914 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
import logging
from django import forms
from gc_apps.worldmap_layers.models import WorldMapLayerInfo
from gc_apps.layer_types.static_vals import is_valid_dv_type
from gc_apps.classification.utils import get_worldmap_info_object
LOGGER = logging.getLogger(__name__)
"""
from gc_apps.gis_tabular.models import WorldMap... | [
11748,
18931,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
308,
66,
62,
18211,
13,
6894,
8899,
62,
75,
6962,
13,
27530,
1330,
2159,
13912,
49925,
12360,
198,
6738,
308,
66,
62,
18211,
13,
29289,
62,
19199,
13,
12708,
62,
12786... | 2.953488 | 172 |
#!/usr/bin/python
from collections import defaultdict
from optparse import OptionParser
import time
import logging
import datetime
import ConfigParser
import pprint
import boto3
import fifemon
logger = logging.getLogger(__name__)
if __name__ == '__main__':
opts = get_options()
if opts['test']:
log... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
11748,
640,
198,
11748,
18931,
198,
11748,
4818,
8079,
198,
11748,
17056,
46677,
198,
11748,
279,
4798,
198,
198,
... | 2.506173 | 243 |
import socket
import time
from datetime import datetime
from multiprocessing import Process
import cv2
import imutils
from imagezmq import imagezmq
from imutils.video import VideoStream
| [
11748,
17802,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
198,
198,
11748,
269,
85,
17,
198,
11748,
545,
26791,
198,
6738,
2939,
89,
76,
80,
1330,
2939,
89,
76,
80,
198,
67... | 3.686275 | 51 |
colors = ['r','g','b']
class _TFColor(object):
"""Enum of colors used in TF docs."""
red = '#F15854'
blue = '#5DA5DA'
orange = '#FAA43A'
green = '#60BD68'
pink = '#F17CB0'
brown = '#B2912F'
purple = '#B276B2'
yellow = '#DECF3F'
gray = '#4D4D4D' | [
4033,
669,
796,
37250,
81,
41707,
70,
41707,
65,
20520,
628,
198,
4871,
4808,
51,
4851,
45621,
7,
15252,
2599,
198,
220,
220,
220,
37227,
4834,
388,
286,
7577,
973,
287,
24958,
34165,
526,
15931,
198,
220,
220,
220,
2266,
796,
705,
... | 1.881579 | 152 |
#! /bin/bash/env python
# -*- coding : UTF-8 -*-
domain1 = Domain('yiifaa', 32)
domain2 = Domain('yiifee', 30)
domain1.version = 2.0
print domain2.version
test = Test('yiifee', 32)
test.sayHello = 'YES'
test.username = 'yii'
print test.sayHello
print test.username
print Test.username
Test.sayHello(1) | [
2,
0,
1220,
8800,
14,
41757,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
1058,
41002,
12,
23,
532,
9,
12,
628,
198,
27830,
16,
796,
20021,
10786,
48111,
361,
7252,
3256,
3933,
8,
198,
27830,
17,
796,
20021,
10786,
48111,
901,
68,... | 2.59322 | 118 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198
] | 2.954545 | 44 |
#!usr/bin/env python
#-*- coding:utf-8 -*-
"""
@author: nico
@file: filters.py
@time: 2018/08/16
"""
from dry_rest_permissions.generics import DRYPermissionFiltersBase
| [
2,
0,
14629,
14,
8800,
14,
24330,
21015,
220,
220,
198,
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
37811,
220,
198,
31,
9800,
25,
220,
220,
220,
299,
3713,
220,
198,
31,
7753,
25,
220,
220,
220,
220,
220,
... | 2.133333 | 90 |
"""
Non-Platform specific extensions to the base Petronia system.
Some of these are classified as "extensions" because the base system does not
need them to run. However, they are so integral to many other extensions that
they may well be considered essential.
"""
| [
198,
37811,
198,
15419,
12,
37148,
2176,
18366,
284,
262,
2779,
4767,
1313,
544,
1080,
13,
198,
198,
4366,
286,
777,
389,
10090,
355,
366,
2302,
5736,
1,
780,
262,
2779,
1080,
857,
407,
198,
31227,
606,
284,
1057,
13,
220,
2102,
11,... | 4.253968 | 63 |
import graphene
from flask_jwt_extended import (
create_access_token,
create_refresh_token,
decode_token,
get_current_user,
get_raw_jwt,
jwt_refresh_token_required,
)
from cyhy_api.model import UserModel
from ..unions.mutation import AuthUnion, RefreshUnion
from ..fields import AuthField, Refre... | [
11748,
42463,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
357,
198,
220,
220,
220,
2251,
62,
15526,
62,
30001,
11,
198,
220,
220,
220,
2251,
62,
5420,
3447,
62,
30001,
11,
198,
220,
220,
220,
36899,
62,
30001,
11,
198,
... | 2.917355 | 121 |
import selenium,time,traceback
from selenium import webdriver
from core.config.InitConfig import *
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
if __name__ == '__main__':
pass | [
11748,
384,
11925,
1505,
11,
2435,
11,
40546,
1891,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
4755,
13,
11250,
13,
31768,
16934,
1330,
1635,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750... | 3.268817 | 93 |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
21017,
198,
2,
15069,
357,
66,
828,
383,
317,
4178,
5631,
1074,
13,
1439,
2489,
10395,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.056295 | 14,282 |
from . import packet
from terrabot.util.streamer import Streamer
from terrabot.events.events import Events
| [
6738,
764,
1330,
19638,
198,
6738,
8812,
397,
313,
13,
22602,
13,
5532,
263,
1330,
13860,
263,
198,
6738,
8812,
397,
313,
13,
31534,
13,
31534,
1330,
18715,
628,
198
] | 3.633333 | 30 |
# Sets up a simple grid to test that agent can move, log, etc.
import argparse
import sys
import time
sys.path.append('.')
from OccupancyGrid.OccupancyGridAgent import OccupancyGridAgent, SimpleGridAgent, SimpleGridAgentWithSources
from Utils.UE4Grid import UE4Grid
#from AirSimInterface.types import Vector3r
from Uti... | [
2,
21394,
510,
257,
2829,
10706,
284,
1332,
326,
5797,
460,
1445,
11,
2604,
11,
3503,
13,
198,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
640,
198,
17597,
13,
6978,
13,
33295,
10786,
2637,
8,
198,
198,
6738,
15227,
3883,
... | 2.686963 | 2,562 |
import discord
from Kiraro import bot
from discord.ext import commands
@bot.command(aliases=['info', 'whois']) | [
11748,
36446,
198,
6738,
7385,
12022,
1330,
10214,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
31,
13645,
13,
21812,
7,
7344,
1386,
28,
17816,
10951,
3256,
705,
8727,
271,
6,
12962
] | 3.363636 | 33 |
"""This file defines several utility functions used by software.
Attributes:
MINIMUM_BICUBIC_RES (int): minimum image resolution that doesn't need to be processed by bicubic operation.
MINIMUM_GAN_RES (int): minimum image resolution that doesn't need to be processed by super resolution.
"""
import cv2
from PIL... | [
37811,
1212,
2393,
15738,
1811,
10361,
5499,
973,
416,
3788,
13,
198,
198,
29021,
25,
198,
220,
220,
220,
20625,
3955,
5883,
62,
33,
2149,
10526,
2149,
62,
19535,
357,
600,
2599,
5288,
2939,
6323,
326,
1595,
470,
761,
284,
307,
13686,... | 2.622616 | 734 |
from importlib import import_module
from logging import getLogger
from os import listdir
from os.path import dirname, isfile, join as joinpath, splitext
from typing import List
from ... import classproperty
class Devices:
"""
"""
_DEVMODS = []
@classproperty
| [
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
318,
7753,
11,
4654,
355,
4654,
6978,
11,
4328,
578,
742,
198,
... | 3.282353 | 85 |
#encoding:utf-8
import datetime
import csv
import logging
from multiprocessing import Process
import time
import yaml
from croniter import croniter
from supplier import supply
logger = logging.getLogger(__name__)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.a... | [
2,
12685,
7656,
25,
40477,
12,
23,
198,
198,
11748,
4818,
8079,
198,
11748,
269,
21370,
198,
11748,
18931,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
198,
11748,
640,
198,
198,
11748,
331,
43695,
198,
6738,
1067,
261,
2676,
1330,
1... | 2.931034 | 145 |
"""
Trial
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: torchbearer.trial
:members:
:undoc-members:
Model (Deprecated)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: torchbearer.torchbearer
:members:
:undoc-members:
State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autom... | [
37811,
198,
51,
4454,
198,
39397,
39397,
39397,
39397,
39397,
39397,
39397,
39397,
39397,
198,
198,
492,
220,
3557,
375,
2261,
3712,
28034,
1350,
11258,
13,
45994,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
30814,
25,
198,
220,
220,
... | 2.641577 | 279 |
from odoo import models, fields, api, SUPERUSER_ID, _ # noqa: F401
from odoo.exceptions import UserError, ValidationError # noqa: F401
#from odoo.tools import float_is_zero
import logging
_logger = logging.getLogger(__name__)
class {{pascalCase name}}(models.Model):
_name = '{{lowerDotCase name}}'
_descri... | [
198,
6738,
16298,
2238,
1330,
4981,
11,
7032,
11,
40391,
11,
33088,
29904,
62,
2389,
11,
4808,
1303,
645,
20402,
25,
376,
21844,
198,
6738,
16298,
2238,
13,
1069,
11755,
1330,
11787,
12331,
11,
3254,
24765,
12331,
220,
220,
1303,
645,
... | 2.846154 | 117 |
from unittest import TestCase, main
from numpy import array, allclose
from os.path import abspath as os_abspath, join as os_join
lib_path = os_abspath(os_join(__file__, '..', '..', 'PowerIteration_EigenvalueAlgorithm'))
from sys import path as sys_path
sys_path.append(lib_path)
from powiter import power_iteration_m
f... | [
6738,
555,
715,
395,
1330,
6208,
20448,
11,
1388,
198,
6738,
299,
32152,
1330,
7177,
11,
477,
19836,
198,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
355,
28686,
62,
397,
2777,
776,
11,
4654,
355,
28686,
62,
22179,
198,
8019,
62,
... | 2.917241 | 145 |
from gitlab import Gitlab
from gitlab_tests.base_test import BaseTest
| [
6738,
17606,
23912,
1330,
15151,
23912,
198,
6738,
17606,
23912,
62,
41989,
13,
8692,
62,
9288,
1330,
7308,
14402,
198
] | 3.5 | 20 |
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
from accounts.views import my_logout
urlpatterns = [
# Examples:
url(r'^$', 'shell.views.landing', name='landing'),
url(r'^login/', 'accounts.views.login', name='login'),
url(r'^log... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
198,
6738,
5504,
13,
33571,
1330,
616,
62,
6404,
... | 2.45283 | 424 |
#!/usr/bin/env pypy
import argparse
import subprocess
import tempfile
import os
import gzip
def parse_args():
"""Parse command line arguments"""
parser = argparse.ArgumentParser(description='Process input files')
parser.add_argument('-s', '--sequences', type=str, default=None,
help=... | [
2,
48443,
14629,
14,
8800,
14,
24330,
279,
4464,
88,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
11748,
28686,
198,
11748,
308,
13344,
198,
198,
4299,
21136,
62,
22046,
33529,
198,
220,
220,
220,
37227... | 2.321645 | 1,483 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019~2999 - Cologler <skyoflw@gmail.com>
# ----------
#
# ----------
from threading import Thread, Lock, Condition
from subprocess import Popen
from queue import Queue
def yield_from_proc(proc: Popen):
'''
yield each `bytes` line from `stdout` and `stderr`.
``` p... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
13130,
93,
1959,
2079,
532,
327,
928,
1754,
1279,
15688,
1659,
75,
86,
31,
14816,
13,
785,
29,
198,
2,
24200,
438,
198,
2,
198,
2,
... | 2.270677 | 399 |
# encoding=utf-8
# Generated by cpy
# 2013-01-26 21:04:47.984000
import os, sys
from sys import stdin, stdout
from SSDB import SSDB
try:
pass
ssdb = SSDB('127.0.0.1', 8888)
except Exception , e:
pass
print e
sys.exit(0)
print ssdb.request('set', ['test', '123'])
print ssdb.request('get', ['test'])
print ssdb.requ... | [
2,
21004,
28,
40477,
12,
23,
198,
2,
2980,
515,
416,
269,
9078,
198,
2,
2211,
12,
486,
12,
2075,
2310,
25,
3023,
25,
2857,
13,
4089,
27559,
198,
11748,
28686,
11,
25064,
198,
6738,
25064,
1330,
14367,
259,
11,
14367,
448,
198,
198... | 2.477387 | 597 |
import os
os.system('mkdir -p LOG')
os.system('./main_zk lanczos2_112_N=16_circuit.txt lanczos2_112_N=16_meta.txt LOG/lanczos2_112_N=16.txt')
os.system('./main_zk lanczos2_176_N=64_circuit.txt lanczos2_176_N=64_meta.txt LOG/lanczos2_176_N=64.txt')
os.system('./main_zk lanczos2_304_N=256_circuit.txt lanczos2_304_N=256_m... | [
11748,
28686,
198,
418,
13,
10057,
10786,
28015,
15908,
532,
79,
41605,
11537,
198,
418,
13,
10057,
7,
4458,
14,
12417,
62,
89,
74,
300,
1192,
37925,
17,
62,
14686,
62,
45,
28,
1433,
62,
21170,
5013,
13,
14116,
300,
1192,
37925,
17,... | 1.979661 | 295 |
f = open(0)
c = int(f.readline())
for _ in range(c):
n = int(f.readline())
solution(n)
f.close()
| [
198,
69,
796,
1280,
7,
15,
8,
198,
66,
796,
493,
7,
69,
13,
961,
1370,
28955,
198,
1640,
4808,
287,
2837,
7,
66,
2599,
198,
220,
220,
220,
299,
796,
493,
7,
69,
13,
961,
1370,
28955,
198,
220,
220,
220,
4610,
7,
77,
8,
198,
... | 1.947368 | 57 |
""" Tests for arcus client """
from base64 import b64encode
from unittest.mock import patch
from click.testing import CliRunner
import voithos.cli.service.arcus.client
import voithos.lib.config
def test_arcus_client_group():
""" test the arcus client group cli call """
runner = CliRunner()
result = runn... | [
37811,
30307,
329,
610,
9042,
5456,
37227,
198,
198,
6738,
2779,
2414,
1330,
275,
2414,
268,
8189,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
6738,
3904,
13,
33407,
1330,
1012,
72,
49493,
198,
198,
11748,
7608,
342,
418,
... | 2.250511 | 978 |
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#
#* Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
#* Redistributions in binary form must r... | [
2,
7738,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
4666,
2649,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
1138,
25,
198,
2,
198,
2,
9,
2297,
396,
2455,
507,
286,
2723,
2438,
1276,
12377,
... | 3.504931 | 507 |
# -*- coding: utf-8 -*-
"""
Script to test by comparing output from python with that from octave.
Usage (run from this test directory):
python test_octave.py [gsw_matlab_dir]
At present, this assumes by default that the matlab code resides
in a "gsw_matlab_v3_04" directory which has been symlinked into
the test d... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
7391,
284,
1332,
416,
14176,
5072,
422,
21015,
351,
326,
422,
19318,
1015,
13,
198,
198,
28350,
357,
5143,
422,
428,
1332,
8619,
2599,
198,
220,
220,
220,
... | 1.947511 | 4,439 |
import os, os.path
import shutil
import urllib, urllib2
import simplejson as json
from play.utils import *
COMMANDS = ['check']
HELP = {
'check': 'Check for a release newer than the current one'
}
TAGS_URL = "http://github.com/api/v2/json/repos/show/playframework/play/tags"
# TODO: Be smarter at analysin... | [
11748,
28686,
11,
28686,
13,
6978,
198,
11748,
4423,
346,
198,
11748,
2956,
297,
571,
11,
2956,
297,
571,
17,
198,
11748,
2829,
17752,
355,
33918,
198,
198,
6738,
711,
13,
26791,
1330,
1635,
198,
198,
9858,
10725,
5258,
796,
37250,
91... | 2.697674 | 129 |
from src import create_app
from src.database import db
# create the database and tables
app = create_app()
db.init_app(app)
with app.app_context():
db.create_all()
| [
6738,
12351,
1330,
2251,
62,
1324,
198,
6738,
12351,
13,
48806,
1330,
20613,
198,
198,
2,
2251,
262,
6831,
290,
8893,
198,
1324,
796,
2251,
62,
1324,
3419,
198,
9945,
13,
15003,
62,
1324,
7,
1324,
8,
198,
198,
4480,
598,
13,
1324,
... | 2.982456 | 57 |
# Copyright 2018 BlueCat Networks (USA) Inc. and its affiliates
#
# 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 appli... | [
2,
15069,
2864,
4518,
21979,
27862,
357,
14053,
8,
3457,
13,
290,
663,
29116,
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,
1... | 2.835113 | 2,341 |
# Απόσταση = Ταχύτητα * Χρόνος
taxitita = float(input('Δώσε την ταχύτητα του οχήματος (σε km/h): '))
print()
ora = int(input('Δώσε τον αριθμό των ωρών που έχει ταξιδέψει: '))
print()
print('Ώρα\t| Διανυθείσα Απόσταση')
print('-----------------------------')
for x in range(1, ora+1):
apostasi = float(taxit... | [
2,
7377,
239,
46582,
139,
234,
38392,
32830,
17394,
38392,
138,
115,
796,
7377,
97,
17394,
139,
229,
139,
235,
32830,
138,
115,
32830,
17394,
1635,
7377,
100,
33643,
139,
234,
26180,
26517,
35558,
201,
198,
19290,
270,
5350,
796,
12178,... | 1.466418 | 268 |
class Queue():
"""
Queue Class.
ATTRIBUTES
==========
que: list
the queue
METHODS
=======
push(D):
parameters
==========
D: any type
returns
=======
pushes the data
pop():
parameters
... | [
4871,
4670,
518,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4670,
518,
5016,
13,
628,
220,
220,
220,
5161,
5446,
9865,
3843,
1546,
198,
220,
220,
220,
796,
2559,
28,
628,
220,
220,
220,
8358,
25,
1351,
198,
220,
220,
22... | 1.789474 | 361 |
import numpy as np
if __name__ =='__main__':
lst = [0, 1, 2, 3, 4, 5, 6, 7, 8]
arr = create_array(lst)
print(arr)
| [
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
6624,
6,
834,
12417,
834,
10354,
198,
220,
300,
301,
796,
685,
15,
11,
352,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
11,
767,
11,
807,
60,
198,
220,
5240,
796,
... | 2.050847 | 59 |
"""Contains the AlaskaProject class.
Alaska is organized into "projects." These project hold all information about
a specific experiment. The ultimate goal of a project is to perform
differential expression analysis and identify differentially expressed genes
among samples.
"""
__author__ = 'Kyung Hoi (Joseph) Min'
_... | [
37811,
4264,
1299,
262,
12926,
16775,
1398,
13,
198,
198,
2348,
8480,
318,
8389,
656,
366,
42068,
526,
2312,
1628,
1745,
477,
1321,
546,
198,
64,
2176,
6306,
13,
383,
8713,
3061,
286,
257,
1628,
318,
284,
1620,
198,
39799,
498,
5408,
... | 1.959558 | 13,946 |
import numpy as np
from numpy.testing import assert_allclose, run_module_suite
from pytest import main
from pytest import raises as assert_raises
from scipy.interpolate import (Akima1DInterpolator,
BarycentricInterpolator,
CubicSpline,
... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
11,
1057,
62,
21412,
62,
2385,
578,
198,
198,
6738,
12972,
9288,
1330,
1388,
198,
6738,
12972,
9288,
1330,
12073,
355,
6818,
62,
430,
26... | 2.110048 | 209 |
"""
Author: RedFantom
License: GNU GPLv3
Copyright (c) 2017-2018 RedFantom
"""
from unittest import TestCase
from ttkthemes import _imgops as imgops
from PIL import Image
| [
37811,
198,
13838,
25,
2297,
37,
11456,
198,
34156,
25,
22961,
38644,
85,
18,
198,
15269,
357,
66,
8,
2177,
12,
7908,
2297,
37,
11456,
198,
37811,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
256,
30488,
1169,
6880,
1330,
... | 3.127273 | 55 |
#
# File: scripts/lipsync_test.nut
# Author: Astrofra
#
import gs
import os
from globals import *
from compat import *
# Include(g_viseme_set + "phoneme_to_viseme.nut")
# !
# @short lipsync_test
# @author Astrofra
#
# !
# @short OnUpdate
# Called each frame.
#
# !
# @short OnSetup
# Called when the s... | [
2,
220,
198,
2,
197,
8979,
25,
14750,
14,
40712,
27261,
62,
9288,
13,
14930,
198,
2,
197,
13838,
25,
35167,
69,
430,
198,
2,
198,
198,
11748,
308,
82,
198,
11748,
28686,
198,
6738,
15095,
874,
1330,
1635,
198,
6738,
8330,
1330,
16... | 2.258065 | 155 |
from goopylib.objects.GraphicsObject import GraphicsObject
from goopylib.styles import *
from goopylib.math.Triangulation import triangulate_modified_earclip
from math import radians, sin, cos
| [
6738,
467,
404,
2645,
571,
13,
48205,
13,
18172,
10267,
1330,
19840,
10267,
198,
6738,
467,
404,
2645,
571,
13,
47720,
1330,
1635,
198,
198,
6738,
467,
404,
2645,
571,
13,
11018,
13,
14824,
648,
1741,
1330,
1333,
648,
5039,
62,
41771,... | 3.464286 | 56 |
squares = []
for i in range(1,11):
squares.append(i**2)
squ = [i**2 for i in range(1,11)]
print(squ)
negative = []
for i in range(1,11):
negative.append(-i)
neg = [-i for i in range(1,11)] #imp
print(neg)
l = ['abc','tuv','xyz']
rev = [st[::-1] for st in l]
print(rev)
even = [i for i in range(1,11) if i%... | [
16485,
3565,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
16,
11,
1157,
2599,
198,
220,
220,
220,
24438,
13,
33295,
7,
72,
1174,
17,
8,
198,
198,
16485,
796,
685,
72,
1174,
17,
329,
1312,
287,
2837,
7,
16,
11,
1157,
15437,
198,
47... | 2.198413 | 378 |
class Algorithm(object):
""" Algorithm """ | [
4871,
978,
42289,
7,
15252,
2599,
198,
220,
220,
220,
37227,
978,
42289,
37227
] | 3.285714 | 14 |
#Imports Here
import argparse
import os
import torch
import json
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from collections import OrderedDict
#Import Transforms
import functions_and_classes
from functions_and_classes import data_tr... | [
2,
3546,
3742,
3423,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
33918,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
1330,
6436,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
1... | 2.360262 | 3,206 |
from math import log
class Day32:
'''
Time Complexity: O(N^3)
Space Comlpexity: O(N)
Bellman Ford
'''
@staticmethod
if __name__ == '__main__':
day_32 = Day32()
mat = [[1, 0.23, 0.25, 16.43, 18.21, 4.94],\
[4.34, 1, 1.11, 71.40, 79.09, 21.44],\
[3.93, 0... | [
6738,
10688,
1330,
2604,
198,
198,
4871,
3596,
2624,
25,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
3862,
19157,
414,
25,
440,
7,
45,
61,
18,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4687,
955,
75,
... | 1.704735 | 359 |
from typing import Dict, List, Optional
from xmarievm import api
from xmarievm.api import get_line_array
from xmarievm.breakpoints import BreakpointHit
from xmarievm.runtime import snapshot_maker
from xmarievm.runtime.snapshot_maker import Snapshot
from xmarievm.runtime.vm import MarieVm
| [
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
198,
198,
6738,
2124,
3876,
11203,
76,
1330,
40391,
198,
6738,
2124,
3876,
11203,
76,
13,
15042,
1330,
651,
62,
1370,
62,
18747,
198,
6738,
2124,
3876,
11203,
76,
13,
9032,
13033,
1330... | 3.306818 | 88 |
# Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
__all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser',
'FeedParser', 'BytesFeedParser']
import w... | [
2,
15069,
357,
34,
8,
5878,
12,
12726,
11361,
10442,
5693,
198,
2,
6434,
25,
14488,
32955,
11,
5658,
370,
280,
1010,
11,
9953,
46277,
198,
2,
14039,
25,
3053,
12,
82,
328,
31,
29412,
13,
2398,
198,
198,
37811,
32,
30751,
286,
3097... | 3.452055 | 146 |
# Here, we are using index to traverse the array, But we are doing it in the reverse order
# Returns: an int denoting the maximum profit, that can be achieved
from Utils.Array import input_array
if __name__ == "__main__":
wt = input_array()
val = input_array()
c = int(input("capacity : "))
print(sol... | [
2,
3423,
11,
356,
389,
1262,
6376,
284,
38138,
262,
7177,
11,
887,
356,
389,
1804,
340,
287,
262,
9575,
1502,
198,
2,
16409,
25,
281,
493,
2853,
10720,
262,
5415,
7630,
11,
326,
460,
307,
8793,
198,
6738,
7273,
4487,
13,
19182,
13... | 2.516484 | 182 |
from typing import Optional, Tuple, Union
from ray.data import Dataset
from ray.util.annotations import PublicAPI
@PublicAPI(stability="alpha")
def train_test_split(
dataset: Dataset,
test_size: Union[int, float],
*,
shuffle: bool = False,
seed: Optional[int] = None,
) -> Tuple[Dataset, Dataset]:
... | [
6738,
19720,
1330,
32233,
11,
309,
29291,
11,
4479,
198,
6738,
26842,
13,
7890,
1330,
16092,
292,
316,
198,
6738,
26842,
13,
22602,
13,
34574,
602,
1330,
5094,
17614,
628,
198,
31,
15202,
17614,
7,
301,
1799,
2625,
26591,
4943,
198,
4... | 2.393846 | 975 |
from rest_framework import serializers
from .models import InstagramCarousel, InstagramCarouselPage, Story, Tweet, TwitterThread, VideoContent
| [
201,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
201,
198,
6738,
764,
27530,
1330,
10767,
9914,
48355,
11,
10767,
9914,
48355,
9876,
11,
8362,
11,
18752,
11,
3009,
16818,
11,
7623,
19746,
201
] | 4.294118 | 34 |
celsius = float(input("Enter temperature in celsius: "))
fahrenheit = (celsius * 9/5)+32
print("The tempeature is", fahrenheit, "degrees fahrenheit") | [
5276,
82,
3754,
796,
12178,
7,
15414,
7203,
17469,
5951,
287,
269,
32495,
25,
366,
4008,
198,
69,
993,
34032,
796,
357,
5276,
82,
3754,
1635,
860,
14,
20,
47762,
2624,
198,
4798,
7203,
464,
2169,
431,
1300,
318,
1600,
277,
993,
3403... | 2.921569 | 51 |
#
# @lc app=leetcode id=1207 lang=python3
#
# [1207] Unique Number of Occurrences
#
# https://leetcode.com/problems/unique-number-of-occurrences/description/
#
# algorithms
# Easy (71.08%)
# Likes: 300
# Dislikes: 18
# Total Accepted: 45.3K
# Total Submissions: 63.8K
# Testcase Example: '[1,2,2,1,1,3]'
#
# Given... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
1065,
2998,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
1065,
2998,
60,
30015,
7913,
286,
10775,
333,
34303,
198,
2,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676... | 2.364341 | 387 |
#coding:utf-8
#
# id: bugs.core_0881
# title: Singleton isn't respected in COMPUTED BY expressions
# decription:
# tracker_id: CORE-881
# min_versions: []
# versions: 2.5.0
# qmid: bugs.core_881-250
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5.0
#... | [
2,
66,
7656,
25,
40477,
12,
23,
198,
2,
198,
2,
4686,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11316,
13,
7295,
62,
2919,
6659,
198,
2,
3670,
25,
220,
220,
220,
220,
220,
220,
220,
5573,
10565,
2125,
470,
14462,
2... | 2.451444 | 381 |
import logging
from entities_def import User
from entities_def import CredentialsM
import jinja2
import webapp2
from oauth2client.client import flow_from_clientsecrets
from apiclient import discovery
import google_auth_oauthlib.flow
import httplib2
import os
import datetime
from google.appengine.api import users
JIN... | [
11748,
18931,
198,
198,
6738,
12066,
62,
4299,
1330,
11787,
198,
6738,
12066,
62,
4299,
1330,
327,
445,
14817,
44,
198,
11748,
474,
259,
6592,
17,
198,
11748,
3992,
1324,
17,
198,
6738,
267,
18439,
17,
16366,
13,
16366,
1330,
5202,
62... | 2.83945 | 218 |
#!/usr/bin/env python
# coding=utf-8
from deepdive import *
import ddlib
@tsv_extractor
@returns(lambda
p1_id = "text",
p2_id = "text",
feature = "text",
:[])
def extract(
p1_id = "text",
p2_id = "text",
p1_begin_index = "int",
p1_end_i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
6738,
2769,
67,
425,
1330,
1635,
198,
11748,
49427,
8019,
198,
198,
31,
912,
85,
62,
2302,
40450,
198,
31,
7783,
82,
7,
50033,
198,
220,
220,... | 1.927823 | 859 |
#!/usr/bin/env python
"""
Advent of Code 2017: Day 14 Part 1
https://adventofcode.com/2017/day/14
"""
import sys
# Calcualte the knot-hash for a string, using a given formatter
input = sys.argv[1]
# Count all binary digits in all hashes
total = 0
for row in xrange(128):
hash = knot_hash('%s-%d' % (input, row))... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
2782,
1151,
286,
6127,
2177,
25,
3596,
1478,
2142,
352,
198,
5450,
1378,
324,
1151,
1659,
8189,
13,
785,
14,
5539,
14,
820,
14,
1415,
198,
37811,
198,
198,
11748,
25... | 2.590604 | 149 |
from .soil_moisture_dynamics import SoilMoisture
from .infiltrate_soil_green_ampt import SoilInfiltrationGreenAmpt
__all__ = ['SoilMoisture',
'SoilInfiltrationGreenAmpt', ]
| [
6738,
764,
568,
346,
62,
5908,
396,
495,
62,
67,
4989,
873,
1330,
1406,
346,
16632,
396,
495,
198,
6738,
764,
259,
10379,
2213,
378,
62,
568,
346,
62,
14809,
62,
321,
457,
1330,
1406,
346,
18943,
36055,
13719,
5840,
457,
628,
198,
... | 2.447368 | 76 |
# Copyright (C) 2013-2016 Martin Vejmelka, UC Denver
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... | [
2,
15069,
357,
34,
8,
2211,
12,
5304,
5780,
8016,
73,
17694,
4914,
11,
14417,
10656,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314... | 2.337246 | 10,989 |
'''
Usage: main [options] [COUNTER] ...
Arguments:
COUNTER Optional counters
Options:
-d,--debug Enable debug mode [default: False]
-l,--list=<clist> List of counters (dhkmwM) to retrieve from config.json
-r,--resume Resume file instead of generating from star... | [
7061,
6,
201,
198,
28350,
25,
1388,
685,
25811,
60,
685,
34,
19385,
5781,
60,
2644,
201,
198,
201,
198,
28100,
2886,
25,
201,
198,
220,
220,
220,
31404,
5781,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32233,
21154,
201,
19... | 1.810824 | 6,005 |
from .euler_helper import *
| [
6738,
764,
68,
18173,
62,
2978,
525,
1330,
1635,
201,
198
] | 2.636364 | 11 |
from output.models.ibm_data.mixed.assertions.whitespace.test5_xsd.test5 import X
__all__ = [
"X",
]
| [
6738,
5072,
13,
27530,
13,
571,
76,
62,
7890,
13,
76,
2966,
13,
30493,
507,
13,
1929,
2737,
10223,
13,
9288,
20,
62,
87,
21282,
13,
9288,
20,
1330,
1395,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
55,
1600,
198,... | 2.234043 | 47 |
# Copyright (c) 2022, Weslati Baha Eddine and Contributors
# See license.txt
# import frappe
import unittest
| [
2,
15069,
357,
66,
8,
33160,
11,
18622,
75,
7246,
347,
12236,
1717,
67,
500,
290,
25767,
669,
198,
2,
4091,
5964,
13,
14116,
198,
198,
2,
1330,
5306,
27768,
198,
11748,
555,
715,
395,
198
] | 3.055556 | 36 |
"""
Get images from India DataSet
"""
import os.path
from .reader import ReaderBase
class Reader(ReaderBase):
"""
Get images from image data set
"""
suffix = "*/*"
def __init__(self, **kwargs):
"""
Initial method
"""
dataset = kwargs.get("dataset", "DatasetA")
... | [
37811,
198,
3855,
4263,
422,
3794,
6060,
7248,
198,
37811,
198,
198,
11748,
28686,
13,
6978,
198,
6738,
764,
46862,
1330,
25342,
14881,
628,
198,
4871,
25342,
7,
33634,
14881,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3497,
... | 2.247573 | 206 |
from kafka import KafkaConsumer
| [
6738,
479,
1878,
4914,
1330,
46906,
49106,
628
] | 4.125 | 8 |
#! /usr/bin/python3
# with open("input.txt") as reader:
# lst = []
# for line in reader:
# data = line.split("\n")[0]
# lst.append(list(map(int, data)))
# BFS (Breadth first search)a
part2_bfs()
# DFS
# print(dfs_part2(data))
| [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
351,
1280,
7203,
15414,
13,
14116,
4943,
355,
9173,
25,
198,
2,
220,
220,
220,
220,
300,
301,
796,
17635,
198,
2,
220,
220,
220,
220,
329,
1627,
287,
9173,
25,
198,
2,
2... | 2.015504 | 129 |
# Copyright (c) 2020
# Kajetan Brzuszczak
import numpy as np
from MLPApproximator.MlpActivationFunction import SigmoidActivationFunction
from MLPApproximator.MlpApproximator import MlpApproximator
class MlpApproximatorBuilder:
"""Builder"""
| [
2,
220,
15069,
357,
66,
8,
12131,
198,
2,
220,
509,
1228,
316,
272,
1709,
89,
385,
89,
26691,
461,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
10373,
4537,
381,
13907,
320,
1352,
13,
44,
34431,
25526,
341,
22203,
1330,
311,
... | 2.808989 | 89 |
# -*- coding: UTF-8 -*-
"""
Title: Dumpscript management command
Project: Hardytools (queryset-refactor version)
Author: Will Hardy (http://willhardy.com.au)
Date: June 2008
Usage: python manage.py dumpscript appname > scripts/scriptname.py
$Revision: 217 $
Description:
Generates a Py... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
220,
220,
11851,
25,
360,
8142,
6519,
4542,
3141,
198,
220,
220,
220,
4935,
25,
6912,
20760,
10141,
357,
10819,
893,
316,
12,
5420,
11218,
2196,
... | 2.442221 | 11,146 |
import itertools
import logging
import networkx as nx
from postman_problems.graph import read_edgelist, create_networkx_graph_from_edgelist, create_required_graph, \
assert_graph_is_connected, get_odd_nodes, get_shortest_paths_distances, create_complete_graph, dedupe_matching, \
add_augmenting_path_to_graph, c... | [
11748,
340,
861,
10141,
198,
11748,
18931,
198,
11748,
3127,
87,
355,
299,
87,
198,
198,
6738,
1281,
805,
62,
1676,
22143,
13,
34960,
1330,
1100,
62,
276,
25280,
396,
11,
2251,
62,
27349,
87,
62,
34960,
62,
6738,
62,
276,
25280,
396... | 2.798155 | 2,601 |
# Copyright 2019, Red Hat
# Copyright 2019, Fabien Boucher
#
# 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 appli... | [
2,
15069,
13130,
11,
2297,
10983,
198,
2,
15069,
13130,
11,
14236,
2013,
14551,
2044,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
... | 2.104053 | 913 |
"""
@brief test log(time=16s)
"""
import unittest
from logging import getLogger
from pandas import DataFrame
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import ExtTestCase
from sklearn.exceptions import ConvergenceWarning
try:
from sklearn.utils._testing import ignore_warnings
except Imp... | [
37811,
198,
31,
65,
3796,
220,
220,
220,
220,
220,
1332,
2604,
7,
2435,
28,
1433,
82,
8,
198,
37811,
198,
11748,
555,
715,
395,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
6738,
12972,
24... | 2.984694 | 196 |
#!/usr/bin/env python
# vim: tabstop=4:shiftwidth=4:expandtab:
from __future__ import with_statement
import argparse
import ConfigParser
import logging
import os
import sys
import urllib3
__author__ = "Travis Goldie"
__email__ = "tgoldie@gmail.com"
__copyright__ = "(c) Beeryard Tech 2016"
__log__ = logging.getLogger... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
43907,
25,
7400,
11338,
28,
19,
25,
30846,
10394,
28,
19,
25,
11201,
392,
8658,
25,
198,
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
198,
11748,
1822,
29572,
198,
11748,
1... | 2.558849 | 1,147 |
import os
import numpy as np
from scipy.io import loadmat
from .datasetloader import DatasetLoader
class ChaLearn2013(DatasetLoader):
"""
ChaLearn Looking at People - Gesture Challenge
https://gesture.chalearn.org/2013-multi-modal-challenge/data-2013-challenge
"""
landmarks = [
"pelvis", ... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
952,
1330,
3440,
6759,
198,
198,
6738,
764,
19608,
292,
316,
29356,
1330,
16092,
292,
316,
17401,
628,
198,
4871,
20703,
20238,
6390,
7,
27354,
292,
316,
1... | 2.14718 | 2,908 |