content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import pytest
from django.contrib.contenttypes.models import ContentType
from constants import user_system
from event_manager.event import Attribute, Event
from event_manager.events import (
bookmark,
build_job,
chart_view,
cluster,
experiment,
experiment_group,
experiment_job,
job,
... | [
11748,
12972,
9288,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
198,
6738,
38491,
1330,
2836,
62,
10057,
198,
6738,
1785,
62,
37153,
13,
15596,
1330,
3460,
4163,
11,
8558,
198,
6738,... | 3.018605 | 215 |
from ldp import DirectContainer
from pycdm import Collection as PcdmCollection
from pycdm import Object as PcdmObject
from pycdm import PcdmReader as PcdmReaderBase
| [
198,
6738,
300,
26059,
1330,
4128,
29869,
198,
6738,
12972,
10210,
76,
1330,
12251,
355,
350,
10210,
76,
36307,
198,
6738,
12972,
10210,
76,
1330,
9515,
355,
350,
10210,
76,
10267,
198,
6738,
12972,
10210,
76,
1330,
350,
10210,
76,
3363... | 3.458333 | 48 |
#!/usr/bin/env python
from miflora_server.srv import *
from miflora_msgs.msg import *
import rospkg
import rospy
import sys
import subprocess
import json
sensor_pub = rospy.Publisher('/miflora', miflora, queue_size=10)
sensor_msg = miflora()
def callback_msg(msg):
''' Read sensor and return measurements '''
#... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
285,
361,
4685,
64,
62,
15388,
13,
27891,
85,
1330,
1635,
198,
6738,
285,
361,
4685,
64,
62,
907,
14542,
13,
19662,
1330,
1635,
220,
198,
11748,
686,
2777,
10025,
198,
117... | 2.548252 | 715 |
from django.test import SimpleTestCase
from django.urls import reverse, resolve
from django.contrib.auth import views as auth_views
from hospital.views import *
#########
#########
######
######
######
######
########
#######
#######
####### | [
6738,
42625,
14208,
13,
9288,
1330,
17427,
14402,
20448,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
11,
10568,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
5009,
355,
6284,
62,
33571,
198,
6738,
4436,
13,
33571,
1330... | 2.484127 | 126 |
from .models import User, Vaccine, User_Vaccine, Agendamento, Estabelecimento, EstabelecimentoAtendimento, Uf, Municipio
from rest_framework import serializers
from rest_framework.validators import UniqueValidator
| [
6738,
764,
27530,
1330,
11787,
11,
31749,
500,
11,
11787,
62,
53,
4134,
500,
11,
2449,
437,
3263,
78,
11,
10062,
397,
11129,
66,
3681,
78,
11,
10062,
397,
11129,
66,
3681,
78,
2953,
437,
3681,
78,
11,
471,
69,
11,
27338,
952,
198,... | 3.323077 | 65 |
__version__ = VERSION = '0.6.0'
| [
834,
9641,
834,
796,
44156,
2849,
796,
705,
15,
13,
21,
13,
15,
6,
198
] | 2.133333 | 15 |
"""retrieve dns addresses from router and write to local csv file"""
import os.path
import csv;
from paramiko import SSHClient
from scp import SCPClient
router_ip = 'router.mvanvuren.local'
ip_range = '192.168.0.'
remote_hosts_file = '/tmp/etc/hosts.dnsmasq'
local_hosts_file = './hosts.dnsmasq'
remote_dnsmasq_file = '... | [
37811,
1186,
30227,
288,
5907,
9405,
422,
20264,
290,
3551,
284,
1957,
269,
21370,
2393,
37811,
198,
11748,
28686,
13,
6978,
198,
11748,
269,
21370,
26,
198,
6738,
5772,
12125,
1330,
33825,
11792,
198,
6738,
629,
79,
1330,
17527,
11792,
... | 2.460733 | 191 |
from mWindowsSDK import *;
from .fThrowLastError import fThrowLastError;
from mRegistry import cRegistryValue;
oSystemInfo = cSystemInfo(); | [
6738,
285,
11209,
10305,
42,
1330,
1635,
26,
198,
6738,
764,
69,
39431,
5956,
12331,
1330,
277,
39431,
5956,
12331,
26,
198,
6738,
285,
8081,
4592,
1330,
269,
8081,
4592,
11395,
26,
198,
198,
78,
11964,
12360,
796,
269,
11964,
12360,
... | 3.333333 | 42 |
from typing import List, Union
from pystratis.api import APIRequest, EndpointRegister, endpoint
from pystratis.api.federationgateway.responsemodels import *
from pystratis.api.federationgateway.requestmodels import *
from pystratis.core import DestinationChain
from pystratis.core.types import Address, Money, uint256
fr... | [
6738,
19720,
1330,
7343,
11,
4479,
198,
6738,
12972,
2536,
37749,
13,
15042,
1330,
7824,
18453,
11,
5268,
4122,
38804,
11,
36123,
198,
6738,
12972,
2536,
37749,
13,
15042,
13,
69,
9748,
10494,
1014,
13,
26209,
27530,
1330,
1635,
198,
67... | 2.344903 | 4,552 |
from json import loads
from pathlib import PosixPath as Path
from galaxy_swift.exceptions import InvalidPlugin
from galaxy_swift.types import Manifest
| [
6738,
33918,
1330,
15989,
198,
6738,
3108,
8019,
1330,
18574,
844,
15235,
355,
10644,
198,
198,
6738,
16161,
62,
2032,
2135,
13,
1069,
11755,
1330,
17665,
37233,
198,
6738,
16161,
62,
2032,
2135,
13,
19199,
1330,
36757,
628
] | 4.026316 | 38 |
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal
from seaborn._core.groupby import GroupBy
from seaborn._stats.aggregation import Agg
| [
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
11748,
12972,
9288,
198,
6738,
19798,
292,
13,
33407,
1330,
6818,
62,
14535,
62,
40496,
198,
198,
6738,
384,
397,
1211,
13557,
7295,
13,
8094,
1525,
1330,
4912,
3886,
198,
6738,
384,
397... | 3.313725 | 51 |
from django.db.models.signals import post_delete
from django.dispatch import Signal, receiver
from baserow.contrib.database.table.cache import (
invalidate_table_model_cache_and_related_models,
)
from baserow.contrib.database.table.models import Table
table_created = Signal()
table_updated = Signal()
table_delete... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
33678,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
26484,
11,
9733,
198,
198,
6738,
1615,
263,
322,
13,
3642,
822,
13,
48806,
13,
11487,
13,
23870,
1330,
357... | 3.174603 | 126 |
import subprocess
import sys
member_list = [
"ZbT8sM1VLUA",
"ZbT8sM1VLUA"
]
#この辺りでvideokeyやタイトルをごにょごにょする。
def main():
"""
main関数
"""
for video_id in member_list:
cmd = 'chat_downloader https://www.youtube.com/watch?v=' + video_id + ' --cookies ../cookie.txt --output "result_member/' +... | [
11748,
850,
14681,
198,
11748,
25064,
198,
198,
19522,
62,
4868,
796,
685,
198,
220,
220,
220,
366,
57,
65,
51,
23,
82,
44,
16,
47468,
34970,
1600,
198,
220,
220,
220,
366,
57,
65,
51,
23,
82,
44,
16,
47468,
34970,
1,
198,
60,
... | 1.98062 | 258 |
from django.db.models.signals import post_save
from django.dispatch import receiver
import short_url
import logging
from .models import Publication
_log = logging.getLogger(__name__)
@receiver(post_save, sender=Publication)
| [
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
198,
11748,
1790,
62,
6371,
198,
11748,
18931,
198,
198,
6738,
764,
27530,
1330,
45065,
198,
198,
62,
... | 3.304348 | 69 |
from ruamel import yaml
from jinja2 import Environment, FileSystemLoader, Template
import datetime
import os
# Edit ls output
now = datetime.datetime.now()
file = open('./config.yaml', 'r')
config_data = yaml.load(file, Loader=yaml.Loader)
# # List main server
os.system('lftp -c "source conf/original.conf && find ... | [
6738,
7422,
17983,
1330,
331,
43695,
198,
6738,
474,
259,
6592,
17,
1330,
9344,
11,
9220,
11964,
17401,
11,
37350,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
198,
2,
5312,
43979,
5072,
628,
198,
2197,
796,
4818,
8079,
13,
19608,
... | 2.789969 | 638 |
#
# Copyright 2020 Jaroslav Chmurny
#
# This file is part of Library of Graph Algorithms for Python.
#
# Library of Graph Algorithms for Python is free software developed for
# educational # and experimental purposes. It is licensed under the Apache
# License, Version 2.0 # (the "License"); you may not use this ... | [
2,
201,
198,
2,
15069,
12131,
15374,
26388,
609,
76,
700,
88,
201,
198,
2,
201,
198,
2,
770,
2393,
318,
636,
286,
10074,
286,
29681,
978,
7727,
907,
329,
11361,
13,
201,
198,
2,
201,
198,
2,
10074,
286,
29681,
978,
7727,
907,
32... | 3.186475 | 488 |
import locale
class NumberUtil:
""" Number Utility
"""
def toCurrency(n):
""" Convert given number into currency format.
Args:
n (float): Number to convert.
Returns:
string
"""
if not isinstance(n, float):
n =... | [
11748,
36693,
198,
198,
4871,
7913,
18274,
346,
25,
198,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
7913,
34030,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
825,
284,
34,
13382,
7,
77,
2599,
198,
22... | 1.977778 | 225 |
# Copyright 2019 Splunk, Inc.
#
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
import random
from jinja2 import Environment
from .sendmessage import *
from .splunkutils import *
from .timeutils imp... | [
2,
15069,
13130,
13341,
2954,
11,
3457,
13,
198,
2,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
17,
12,
565,
682,
12,
7635,
198,
2,
5964,
326,
460,
307,
1043,
287,
262,
38559,
24290,
12,
21800,
17,
... | 2.962264 | 265 |
from django.contrib.gis.measure import D
from django.contrib.gis.db.models.functions import Distance
from froide.publicbody.models import PublicBody
from .amenity import AmenityProvider
class AmenityLocalProvider(AmenityProvider):
'''
Like Amenity provider but tries to find the public body
for the amen... | [
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
1326,
5015,
1330,
360,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
9945,
13,
27530,
13,
12543,
2733,
1330,
34600,
198,
198,
6738,
8400,
485,
13,
11377,
2618,
13,
27530... | 3.04918 | 122 |
#!/usr/bin/python
import argparse
import os
import subprocess
import tempfile
from itertools import chain
from scipy.sparse import csc_matrix, save_npz
from CMash import MinHash as MH
## TODO: adjust for very large files by only loading portions of hdf5 database file at a time
if __name__ == '__main__':
parser = ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
6738,
629,
541,
88,
13,
82,
29572,
1330,
269,
1416,
62,
67... | 2.466739 | 1,849 |
#!/usr/bin/env python3
# Fabio Zanarello, Sanger Institute, 2019
# this script reads a table of precomputed score (space delimited, no header):
# 2 103060300 intronic IL18RAP 0.03276616 0.3697275149820258
# and a results table from NCBoost and produce an output in which the NCBoost results
# have four new columns to c... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
14236,
952,
47022,
533,
18798,
11,
311,
2564,
5136,
11,
13130,
198,
198,
2,
428,
4226,
9743,
257,
3084,
286,
662,
785,
17128,
4776,
357,
13200,
46728,
863,
11,
645,
13639,
259... | 3.115789 | 190 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ...testing import assert_equal
from ..utility import Select
| [
2,
47044,
46,
12,
35353,
1137,
11617,
416,
4899,
14,
42116,
431,
6359,
13,
9078,
532,
8410,
5626,
48483,
198,
6738,
2644,
33407,
1330,
6818,
62,
40496,
198,
6738,
11485,
315,
879,
1330,
9683,
628,
198
] | 3.361111 | 36 |
import streamlit as st
import pandas as pd
import numpy as np | [
11748,
4269,
18250,
355,
336,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941
] | 3.263158 | 19 |
import pytest
from s2v_similarity import S2vSimilarity
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
6738,
264,
17,
85,
62,
38610,
414,
1330,
311,
17,
85,
18925,
414,
198,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
628,
198,
220,
220,
220,
220
] | 2.45 | 40 |
# https://leetcode.com/problems/unique-paths/
from math import comb
| [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
34642,
12,
6978,
82,
14,
198,
198,
6738,
10688,
1330,
1974,
628
] | 2.916667 | 24 |
# Copyright (c) 2018, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for details.
import pytest
... | [
2,
15069,
357,
66,
8,
2864,
11,
18650,
290,
14,
273,
663,
29116,
13,
198,
2,
770,
3788,
318,
925,
1695,
284,
345,
739,
262,
2846,
286,
262,
38644,
513,
13,
15,
5964,
393,
262,
24843,
362,
13,
15,
5964,
13,
198,
2,
22961,
3611,
... | 2.918149 | 281 |
import sys
import pandas as pd
import numpy as np
import re
import nltk
from sqlalchemy import create_engine
nltk.download(['punkt', 'wordnet'])
from sklearn.ensemble import GradientBoostingClassifier
from nltk.stem import WordNetLemmatizer
from sklearn.linear_model import LogisticRegression
from sqlalchemy import crea... | [
11748,
25064,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
302,
198,
11748,
299,
2528,
74,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
77,
2528,
74,
13,
15002,
7,
17816,
30354,
83... | 3.414141 | 297 |
import jax
import jax.numpy as jnp
import snow
from collections import namedtuple
import numpy as np
Exploration = namedtuple("Exploration", ['type', 'param'])
if __name__ == '__main__':
import numpy as np
k = 1.15
l = 2
dmin = 0.8
dmax = dmin * l ** 0.6
hierarchization_config = (
... | [
11748,
474,
897,
198,
11748,
474,
897,
13,
77,
32152,
355,
474,
37659,
198,
11748,
6729,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
299,
32152,
355,
45941,
628,
198,
18438,
6944,
796,
3706,
83,
29291,
7203,
18438,
6944,
1600,
... | 2.241449 | 497 |
#_ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2018 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
import argparse
import collections
import logging
import re
import fnmatch
import shutil
import functools
... | [
2,
62,
220,
11593,
198,
2,
930,
930,
14,
1220,
17569,
46444,
4808,
11593,
220,
46444,
4808,
4808,
38852,
198,
2,
930,
705,
7359,
532,
62,
8,
532,
62,
8,
705,
62,
3467,
14,
532,
62,
8,
705,
62,
91,
198,
2,
930,
62,
91,
59,
62... | 2.847922 | 2,262 |
import datetime
import numpy as np
from pyproj import CRS
from RAiDER.models.ecmwf import ECMWF
| [
11748,
4818,
8079,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12972,
1676,
73,
1330,
327,
6998,
198,
198,
6738,
17926,
72,
14418,
13,
27530,
13,
721,
76,
86,
69,
1330,
13182,
14326,
37,
628
] | 2.75 | 36 |
# Copyright 2019 The TensorTrade Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
13130,
383,
309,
22854,
35965,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
... | 3.340741 | 270 |
from django import forms
from django.contrib.auth.forms import AuthenticationForm
from .models import Group,Profile,Question,Choice
class GroupForm(forms.ModelForm):
'''
Class to create a form for an authenticated user to create Group
'''
#****************************************************************... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
48191,
8479,
198,
6738,
764,
27530,
1330,
4912,
11,
37046,
11,
24361,
11,
46770,
628,
198,
198,
4871,
4912,
8479,
7,
23914,
13,
17633,
... | 4.310469 | 277 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2... | 2.419124 | 2,374 |
# Generated by Django 2.2.10 on 2020-03-08 20:00
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
940,
319,
12131,
12,
3070,
12,
2919,
1160,
25,
405,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
import unittest
from Statistics.Statistics import Statistics
import pprint
# def test_instantiate_calculator(self):
# self.assertIsInstance(self.statistics, Statistics)
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
14370,
13,
48346,
1330,
14370,
198,
11748,
279,
4798,
628,
198,
2,
220,
220,
220,
825,
1332,
62,
8625,
415,
9386,
62,
9948,
3129,
1352,
7,
944,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,... | 2.8875 | 80 |
import torch
import torch.nn as nn
if __name__ == '__main__':
net = sphere(64)
print(net) | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2010,
796,
16558,
7,
2414,
8,
198,
220,
220,
220,
3601,
7,
3262,
8
] | 2.439024 | 41 |
from __future__ import unicode_literals
from contextlib import closing
import io
import os.path
from shutil import rmtree
import sqlite3
from tempfile import mkdtemp
import unittest
from wsgiref.headers import Headers
from wsgiref.util import FileWrapper, setup_testing_defaults
from wsgiref.validate import validator
... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
4732,
8019,
1330,
9605,
198,
11748,
33245,
198,
11748,
28686,
13,
6978,
198,
6738,
4423,
346,
1330,
374,
16762,
631,
198,
11748,
44161,
578,
18,
198,
6738,
2021... | 3.121951 | 123 |
from django.conf.urls import patterns, include, url
from store_search import views
urlpatterns = (
url(r'^search$', views.search_page, name='store_search'),
)
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
198,
6738,
3650,
62,
12947,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
357,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
12947,
3,
3256,
5009,
13,
12947,
6... | 3 | 55 |
from __future__ import absolute_import # NOQA
from .celery import app as celery_app # NOQA
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
220,
1303,
8005,
48,
32,
198,
6738,
764,
7015,
88,
1330,
598,
355,
18725,
1924,
62,
1324,
220,
1303,
8005,
48,
32,
198
] | 3 | 31 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RXml(RPackage):
"""Tools for Parsing and Generating XML Within R and S-Plus
Many appr... | [
2,
15069,
2211,
12,
1238,
2481,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.177877 | 669 |
#!/usr/bin/python3 -u
## Copyright (C) 2012 - 2022 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.
# Since it will be useful to know something about the script,
# for the later tests, the terms are defined here:
# (A discussion of Python language structure is beyond
# the s... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
532,
84,
198,
198,
2235,
15069,
357,
34,
8,
2321,
532,
33160,
412,
7792,
18276,
11571,
1961,
43333,
18470,
1279,
324,
2411,
40015,
31,
1929,
261,
844,
13,
2398,
29,
198,
2235,
4091,
262,
239... | 3.150068 | 733 |
# -*- coding: utf-8 -*-
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import pandas as pd
def make_dataset(input_csv_filepath, output_dirpath):
""" Runs data processing scripts to transform raw data from (../raw) into
cleaned and data-defacto view ready t... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
3904,
198,
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
16605,
24330,
1330,
1064,
62,
26518,
24330,
11,
3440,
62,
26518,
24330,
198,
11748,
19798,
2... | 2.238545 | 2,750 |
#!/usr/bin/python
# coding: utf8
import geocoder
import requests_mock
location = 'New York City'
coordinates = [45.3, -75.4]
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
19617,
25,
3384,
69,
23,
198,
198,
11748,
4903,
420,
12342,
198,
11748,
7007,
62,
76,
735,
198,
198,
24886,
796,
705,
3791,
1971,
2254,
6,
198,
37652,
17540,
796,
685,
2231,
13,
18,
11... | 2.529412 | 51 |
def print_bst_level(root):
"""Prints the tree in level order."""
if root is None:
return
print_bst_level(root.left)
print(root.data, end=' ')
print_bst_level(root.right)
def print_levels_bst(root):
"""Prints the tree in level order."""
if root is None:
return
q = []
... | [
198,
198,
4299,
3601,
62,
65,
301,
62,
5715,
7,
15763,
2599,
198,
220,
220,
220,
37227,
18557,
82,
262,
5509,
287,
1241,
1502,
526,
15931,
198,
220,
220,
220,
611,
6808,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,... | 2.017857 | 280 |
#!/usr/bin/env python
"""Scikit-learn trainer package setup."""
import setuptools
REQUIRED_PACKAGES = [
"scikit-learn==0.20.4",
"pandas==0.24.2",
"pandas-gbq==0.13.2",
"cloudml-hypertune",
"gensim==3.8.3",
]
setuptools.setup(
name="hashy",
version="0.1.0",
install_requires=REQUIRED_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
50,
979,
15813,
12,
35720,
21997,
5301,
9058,
526,
15931,
198,
198,
11748,
900,
37623,
10141,
628,
198,
2200,
10917,
37819,
62,
47,
8120,
25552,
796,
685,
198,
220,
220,
22... | 2.20398 | 201 |
import collections
import json
import logging
import sys
import regex as re
import requests
import discord
log = logging.getLogger(__name__)
| [
11748,
17268,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
11748,
40364,
355,
302,
198,
11748,
7007,
198,
11748,
36446,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628,
628,
628,
... | 3.581395 | 43 |
from time import time
# Implementation using a decorator
# to store least recently used cache
from functools import lru_cache
@lru_cache(maxsize=1000)
start = time()
(fibonacci_with_decorator(500))
end = time()
runtime = end - start
# runtime=0.0009982585906982422
# explicit implementation of fibonacci function... | [
6738,
640,
1330,
640,
198,
2,
46333,
1262,
257,
11705,
1352,
198,
2,
284,
3650,
1551,
2904,
973,
12940,
198,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
628,
198,
31,
75,
622,
62,
23870,
7,
9806,
7857,
28,
12825,
8,
62... | 3.10084 | 238 |
import json
import os
import uuid
import pytest
from prefect.storage import Local
from viadot.flows import SupermetricsToAzureSQLv3
CWD = os.getcwd()
STORAGE = Local(path=CWD)
@pytest.fixture(scope="session")
uuid_4 = uuid.uuid4()
file_name = f"test_file_{uuid_4}.csv"
adls_path = f"raw/supermetrics/{file_name}"
... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
334,
27112,
198,
198,
11748,
12972,
9288,
198,
6738,
662,
2309,
13,
35350,
1330,
10714,
198,
198,
6738,
25357,
324,
313,
13,
44041,
1330,
3115,
4164,
10466,
2514,
26903,
495,
17861,
85,
18,
1... | 2.507813 | 128 |
__author__ = "Stephen W. O'Neill Jr. soneill5045@gmail.com"
from .calculate_smoothness import calculate_smoothness | [
198,
198,
834,
9800,
834,
796,
366,
24920,
370,
13,
440,
6,
26538,
7504,
13,
264,
505,
359,
1120,
2231,
31,
14816,
13,
785,
1,
198,
198,
6738,
764,
9948,
3129,
378,
62,
5796,
5226,
1108,
1330,
15284,
62,
5796,
5226,
1108
] | 2.785714 | 42 |
#import json
import numpy as np
import os
try:
import ujson as json
except ImportError:
try:
import simplejson as json
except ImportError:
import json
class NumpyEncoder(json.JSONEncoder):
"""
Special json encoder for numpy types
Original code from: https://github.com/mpld3/... | [
2,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
628,
198,
28311,
25,
198,
220,
220,
220,
1330,
334,
17752,
355,
33918,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
... | 2.454787 | 376 |
from sqlalchemy.ext.automap import automap_base
from sqlalchemy import create_engine, MetaData
from ..databuddy import SqlaQueryBuilder
from flask import current_app
from toolspy import merge, fetch_nested_key_from_dict
| [
6738,
44161,
282,
26599,
13,
2302,
13,
2306,
296,
499,
1330,
3557,
499,
62,
8692,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
11,
30277,
6601,
198,
6738,
11485,
19608,
397,
21584,
1330,
311,
80,
5031,
20746,
32875,
198,
6738,
... | 3.358209 | 67 |
from django.conf import settings
# define the minimal weight of a tag in the tagcloud
TAGCLOUD_MIN = getattr(settings, 'TAGGIT_TAGCLOUD_MIN', 1.0)
# define the maximum weight of a tag in the tagcloud
TAGCLOUD_MAX = getattr(settings, 'TAGGIT_TAGCLOUD_MAX', 6.0) | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
2,
8160,
262,
10926,
3463,
286,
257,
7621,
287,
262,
7621,
17721,
198,
42197,
5097,
2606,
35,
62,
23678,
796,
651,
35226,
7,
33692,
11,
705,
42197,
38,
2043,
62,
42197,
5097,
2606,
... | 2.778947 | 95 |
#!/usr/bin/env python
__author__ = 'Stephen P. Henrie'
from interface.services.coi.iobject_management_service import BaseObjectManagementService
from pyon.util.containers import is_basic_identifier
from pyon.core.exception import BadRequest, NotFound
from pyon.core.interfaces.interface_util import is_yaml_string_va... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
834,
9800,
834,
796,
705,
24920,
350,
13,
6752,
5034,
6,
628,
198,
6738,
7071,
13,
30416,
13,
1073,
72,
13,
72,
15252,
62,
27604,
62,
15271,
1330,
7308,
10267,
48032,
16177,
198... | 2.491435 | 934 |
# -*- 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 |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Brpc(CMakePackage):
"""An industrial-grade RPC framework used throughout Baidu, with
1... | [
2,
15069,
2211,
12,
1238,
1828,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.344969 | 487 |
# Copyright 2017 AT&T Intellectual Property. All other 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... | [
2,
15069,
2177,
5161,
5,
51,
42443,
14161,
13,
220,
1439,
584,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,... | 3.267857 | 1,008 |
#
# Pyserini: Reproducible IR research with sparse and dense representations
#
# 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... | [
2,
198,
2,
350,
893,
263,
5362,
25,
36551,
37369,
14826,
2267,
351,
29877,
290,
15715,
24612,
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,
23... | 3.062099 | 467 |
"""Code snippets vol-45-snippet-223
Subprocess return code.
stevepython.wordpress.com
Download all snippets so far:
https://wp.me/Pa5TU8-1yg
"""
import subprocess
# Change 'notepade.exe' to some other executable if you are no using Windows.
result = subprocess.run(['notepad.exe'], stdout=subprocess.DEVNULL)
print(re... | [
37811,
10669,
45114,
2322,
12,
2231,
12,
16184,
3974,
316,
12,
22047,
198,
7004,
14681,
1441,
2438,
13,
198,
198,
4169,
303,
29412,
13,
40346,
13,
785,
198,
10002,
477,
45114,
523,
1290,
25,
198,
5450,
1378,
24142,
13,
1326,
14,
28875... | 3.14094 | 149 |
import winograd.o6x6k3x3
import block8x8
from common import _MM_SHUFFLE
for post_operation in ["store", "stream"]:
arg_d_pointer = Argument(ptr(const_float_), name="d_pointer")
arg_wd_pointer = Argument(ptr(float_), name="wd_pointer")
arg_d_stride = Argument(size_t, name="d_stride")
arg_wd_stride = Ar... | [
11748,
1592,
519,
6335,
13,
78,
21,
87,
21,
74,
18,
87,
18,
198,
11748,
2512,
23,
87,
23,
198,
6738,
2219,
1330,
4808,
12038,
62,
9693,
47588,
2538,
628,
198,
1640,
1281,
62,
27184,
287,
14631,
8095,
1600,
366,
5532,
1,
5974,
198,... | 1.867928 | 5,179 |
#!/usr/bin/env python
# instance_editor_selection.py -- Example of an instance editor
# with instance selection
from traits.api \
import HasStrictTraits, Int, Instance, List, Regex, Str
from traitsui.api \
import View, Item, InstanceEditor
people = [
Person( name = 'Dave... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
198,
198,
2,
4554,
62,
35352,
62,
49283,
13,
9078,
1377,
17934,
286,
281,
4554,
5464,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.407407 | 378 |
""" Basic mixin for MongoEngine backed data models """
import logging
from typing import Dict, List, Union, no_type_check
import mongoengine as me
from util.deco import classproperty
logger = logging.getLogger(__name__)
| [
37811,
14392,
5022,
259,
329,
42591,
13798,
9763,
1366,
4981,
37227,
198,
198,
11748,
18931,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
11,
645,
62,
4906,
62,
9122,
198,
198,
11748,
285,
25162,
18392,
355,
502,
198,
198,
67... | 3.461538 | 65 |
#!/usr/bin/env python
import logging
import flask
import RPi.GPIO as GPIO
PIN_GREEN = 16
PIN_BLUE = 20
PIN_RED = 21
pwms = None
if __name__ == '__main__':
import IPython
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('color', help='Color in RGB (0-1) or (0-255). E.g. 2... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
18931,
198,
198,
11748,
42903,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
628,
198,
44032,
62,
43016,
796,
1467,
198,
44032,
62,
9148,
8924,
796,
1160,
198,
44032,
62,
... | 2.438424 | 203 |
import torch
from torch.nn import functional as fn
def fixed_padding(inputs: torch.Tensor, kernel_size: int, dilation: int) -> torch.Tensor:
"""Computes the effective kernel size given the dilation (3x3 with dilation 2 is in fact a 5x5),
then computes the start and end padding (e.g. for a 5x5: |xx|c|xx| => pa... | [
11748,
28034,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
24714,
628,
198,
4299,
5969,
62,
39231,
7,
15414,
82,
25,
28034,
13,
51,
22854,
11,
9720,
62,
7857,
25,
493,
11,
288,
10520,
25,
493,
8,
4613,
28034,
13,
51,
22854,
25,
... | 2.903581 | 363 |
# Copyright 2019 The TensorNetwork Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
2,
15069,
13130,
383,
309,
22854,
26245,
46665,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
... | 2.795262 | 591 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import click
from pyparallel import Downloader
@click.command()
@click.option('--url', required=True, help='Download URL')
@click.option('--conns', required=True, help='Number of parts')
@click.option('--filename', required=True, help='Output filename')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
3904,
198,
198,
6738,
12972,
1845,
29363,
1330,
10472,
263,
628,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976... | 3.091837 | 98 |
# Python3
# Definition for singly-linked list:
# class ListNode(object):
# def __init__(self, x):
# self.value = x
# self.next = None
#
| [
2,
11361,
18,
198,
198,
2,
30396,
329,
1702,
306,
12,
25614,
1351,
25,
198,
2,
1398,
7343,
19667,
7,
15252,
2599,
198,
2,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
220,
220,
2116,
13,
8367,
796,... | 2.45 | 60 |
import yaml
with open("analysis_config.yml", mode="r") as fptr:
analysis_config = yaml.safe_load(fptr)
# Read in the variable dictionary
variable_dict = analysis_config["timeseries"]
# Grab a list of variables
variable_list = list(variable_dict.keys())
# Add the vertical transformations to the list of variables... | [
11748,
331,
43695,
198,
198,
4480,
1280,
7203,
20930,
62,
11250,
13,
88,
4029,
1600,
4235,
2625,
81,
4943,
355,
277,
20692,
25,
198,
220,
220,
220,
3781,
62,
11250,
796,
331,
43695,
13,
21230,
62,
2220,
7,
69,
20692,
8,
198,
198,
... | 3.293578 | 218 |
import logging
_DEBUG = True
if _DEBUG:
logging.basicConfig(level=logging.DEBUG,
format='%(levelname)s > %(asctime)s > %(message)s [in %(filename)s at %(lineno)d]',
datefmt='%Y-%m-%d %H:%M:%S')
else:
logging.basicConfig(level=logging.INFO,
... | [
11748,
18931,
198,
198,
62,
30531,
796,
6407,
198,
198,
361,
4808,
30531,
25,
198,
220,
220,
220,
18931,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 1.714859 | 249 |
"""
———————————————————————
Python3
LC20_validParentheses.py
———————————————————————
个人备注
2020-10-10
需要再次尝试
思路完全理解,利用进出栈及字典思路解题,代码还需熟悉
———————————————————————
题目出处
LC#20 有效的括号
简单
https://leetcode-cn.com/problems/valid-parentheses/
NC#52 括号序列
简单 栈 字符串
https://www.nowcoder.com/practice/37548e94a270412c8b9fb85643c8ccc2
... | [
37811,
198,
30542,
8184,
4500,
960,
198,
37906,
18,
220,
198,
5639,
1238,
62,
12102,
24546,
39815,
13,
9078,
198,
30542,
8184,
4500,
960,
198,
10310,
103,
21689,
13783,
229,
37345,
101,
198,
42334,
12,
940,
12,
940,
198,
165,
250,
222... | 1.192982 | 570 |
import json
from schema import And, Schema, Use
# This is what you would see if you uses boto3 client.receive_messages()
# This is what you would see as the input event for a lambda triggered by sqs
# This is what you would see as the input event for a lambda triggered by sqs
# via eventbridge
| [
11748,
33918,
198,
198,
6738,
32815,
1330,
843,
11,
10011,
2611,
11,
5765,
628,
198,
2,
770,
318,
644,
345,
561,
766,
611,
345,
3544,
275,
2069,
18,
5456,
13,
260,
15164,
62,
37348,
1095,
3419,
628,
198,
2,
770,
318,
644,
345,
561... | 3.682927 | 82 |
import os
import numpy as np
import torch
from torch.utils.data import Dataset
| [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
628
] | 3.375 | 24 |
import json
from decimal import Decimal
from django.conf import settings
from django.core.urlresolvers import reverse
import commonware.log
from rest_framework import response, serializers
from tower import ungettext as ngettext
import mkt
from drf_compound_fields.fields import ListField
from mkt.api.fields import (... | [
11748,
33918,
198,
6738,
32465,
1330,
4280,
4402,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
198,
11748,
2219,
1574,
13,
6404,
198,
6738,
1334,
62,
... | 3.033939 | 825 |
from drf_yasg.utils import swagger_auto_schema
from core.docs import dict_response_schema, param, list_response_schema
shipping_items_response = {
"uuid": "45563485-ca00-43e7-b573-7890fd4c3822",
"tracking_number": "20220309-0003066198",
"sku": "1234",
"status": "CREATED",
"shipping_batches_history": [
... | [
6738,
1553,
69,
62,
88,
292,
70,
13,
26791,
1330,
1509,
7928,
62,
23736,
62,
15952,
2611,
198,
6738,
4755,
13,
31628,
1330,
8633,
62,
26209,
62,
15952,
2611,
11,
5772,
11,
1351,
62,
26209,
62,
15952,
2611,
628,
198,
1477,
4501,
62,
... | 2.156511 | 1,559 |
# Import the relevant libraries
# Data manipulation
import pandas as pd
import numpy as np
# Save files
import pickle
# Machine Learning models
from xgboost import XGBClassifier
from sklearn.experimental import enable_halving_search_cv
from sklearn.model_selection import HalvingGridSearchCV
# import
x_train = pd.re... | [
2,
17267,
262,
5981,
12782,
198,
2,
6060,
17512,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
12793,
3696,
198,
11748,
2298,
293,
198,
198,
2,
10850,
18252,
4981,
198,
6738,
2124,
70,
39521,
... | 1.904011 | 698 |
# Push an element to stack
# Pop an element from stack 1 and push it to stack two.
if __name__ == '__main':
stack = Stack()
stack.push(3)
stack.push(1)
stack.push(6)
stack.push(10)
stack.pop()
print(stack.display())
| [
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
23691,
281,
5002,
284,
8931,
628,
220,
220,
220,
1303,
8099,
281,
5002,
422,
8931,
352,
290,
4574,
340,
284,
8931,
734,
13,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 2.304348 | 115 |
# Copyright 2017 Rodrigo Pinheiro Marques de Araujo <fenrrir@gmail.com>
#
# 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... | [
2,
15069,
2177,
46198,
13727,
258,
7058,
1526,
13281,
390,
30574,
84,
7639,
1279,
41037,
21062,
343,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
198,
2,
... | 3.638235 | 340 |
#!/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.372477 | 545 |
# -*- coding: utf-8 -*-
import os
os_env = os.environ
class ProdConfig(Config):
"""Production configuration. - aligned to openshift """
ENV = 'prod'
DEBUG = False
DEBUG_TB_ENABLED = False # Disable Debug toolbar
class DevConfig(Config):
"""Development configuration."""
ENV = 'dev'
DE... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
198,
418,
62,
24330,
796,
28686,
13,
268,
2268,
628,
198,
4871,
1041,
67,
16934,
7,
16934,
2599,
198,
220,
220,
220,
37227,
35027,
8398,
13,
532,
22... | 2.492537 | 268 |
import aspose.slides as slides | [
11748,
355,
3455,
13,
6649,
1460,
355,
19392
] | 3.75 | 8 |
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2016-2020 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from collections import namedtuple
from sphinxcontrib.confluencebuilder.translator import ConfluenceBaseTranslator
from tests.lib import prepareConfiguration
from tests.lib ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
25,
22163,
4766,
25,
15069,
1584,
12,
42334,
45368,
28413,
7326,
23079,
35869,
25767,
669,
357,
32,
24318,
20673,
8,
198,
25,
43085,
25,
347,
10305,
12,
17,
... | 3.413534 | 133 |
#pragma out
import dylink_portability
dylink_portability.run_unrestricted_repy_code("testchunklib_bigchunk_multisockets.py")
| [
2,
1050,
363,
2611,
503,
198,
11748,
288,
2645,
676,
62,
634,
1799,
198,
30360,
676,
62,
634,
1799,
13,
5143,
62,
403,
49343,
62,
7856,
88,
62,
8189,
7203,
9288,
354,
2954,
8019,
62,
14261,
354,
2954,
62,
16680,
271,
11603,
13,
90... | 2.717391 | 46 |
# -*- coding: utf-8 -*-
# Copyright (c) 2021 The Project GNOME Pomodoro Tracking Authors
import os
import argparse
import configparser
import sys
from datetime import datetime, timedelta
import logging
import gnome_pomodoro_tracking.utils as utils
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
33448,
383,
4935,
40339,
25505,
375,
16522,
37169,
46665,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
4566,
48610,
198,
11748,
25064,
198... | 3.444444 | 72 |
import datetime
import pytest
import aiomysql.cursors
BOB = {'name': 'bob', 'age': 21,
'DOB': datetime.datetime(1990, 2, 6, 23, 4, 56)}
JIM = {'name': 'jim', 'age': 56,
'DOB': datetime.datetime(1955, 5, 9, 13, 12, 45)}
FRED = {'name': 'fred', 'age': 100,
'DOB': datetime.datetime(1911, 9, 12, 1... | [
11748,
4818,
8079,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
257,
29005,
893,
13976,
13,
66,
1834,
669,
628,
198,
8202,
33,
796,
1391,
6,
3672,
10354,
705,
65,
672,
3256,
705,
496,
10354,
2310,
11,
198,
220,
220,
220,
220,
220,... | 2.050691 | 217 |
import pytest
import sqlalchemy as sa
from sqlalchemy_utils.observer import observes
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.mark.usefixtures('postgresql_dsn')
| [
11748,
12972,
9288,
198,
11748,
44161,
282,
26599,
355,
473,
198,
198,
6738,
44161,
282,
26599,
62,
26791,
13,
672,
15388,
1330,
34526,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
90... | 2.626374 | 91 |
#!c:\users\patrick\documents\github\ojomebeta\ojomebeta\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| [
2,
0,
66,
7479,
18417,
59,
29615,
59,
15390,
2886,
59,
12567,
59,
13210,
462,
31361,
59,
13210,
462,
31361,
59,
46521,
59,
29412,
13,
13499,
198,
6738,
42625,
14208,
13,
7295,
1330,
4542,
198,
198,
361,
11593,
3672,
834,
6624,
366,
... | 2.967213 | 61 |
# [LICENSE]
# Copyright (c) 2020, Alliance for Sustainable Energy.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright no... | [
2,
685,
43,
2149,
24290,
60,
198,
2,
15069,
357,
66,
8,
12131,
11,
10302,
329,
45276,
6682,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
220,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
220,
198,
2,
351,
... | 3.366 | 500 |
import numpy as np
import argparse
from utils import data_utils
from utils import ml_utils
import pickle
if __name__ == "__main__":
main()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
198,
6738,
3384,
4487,
1330,
1366,
62,
26791,
198,
6738,
3384,
4487,
1330,
25962,
62,
26791,
198,
11748,
2298,
293,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
... | 2.921569 | 51 |
# Generated by Django 3.0.7 on 2020-06-18 18:57
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
3312,
12,
1507,
1248,
25,
3553,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from pymol import cmd
from pymol import util
from luna.wrappers.cgo_arrow import cgo_arrow
from luna.util.exceptions import PymolSessionNotInitialized, IllegalArgumentError
from luna.util.default_values import PYMOL_INTERACTION_COLOR, INTERACTION_SHORT_NAMES
from luna.util.file import get_filename, get_file_format
f... | [
6738,
279,
4948,
349,
1330,
23991,
198,
6738,
279,
4948,
349,
1330,
7736,
628,
198,
6738,
300,
9613,
13,
29988,
11799,
13,
66,
2188,
62,
6018,
1330,
269,
2188,
62,
6018,
198,
6738,
300,
9613,
13,
22602,
13,
1069,
11755,
1330,
350,
4... | 2.274031 | 15,137 |
import os
import sib_api_v3_sdk
from sib_api_v3_sdk.rest import ApiException
from uuid import UUID
from app.api.models.namespaces import NamespacePrimaryKeyTransferEmailInfo, NamespacePrimaryKeyEmailInfo, NamespaceSchemaProjectNameEmailInfo
from app.api.models.projects import ProjectPrimaryKeyName
configuration = sib... | [
11748,
28686,
198,
11748,
264,
571,
62,
15042,
62,
85,
18,
62,
21282,
74,
198,
6738,
264,
571,
62,
15042,
62,
85,
18,
62,
21282,
74,
13,
2118,
1330,
5949,
72,
16922,
198,
6738,
334,
27112,
1330,
471,
27586,
198,
198,
6738,
598,
13... | 2.870787 | 178 |
"""Control local mopidy."""
import requests
import json
class MopidyError(Exception):
"""Mopidy control error."""
def mopidy_is_playing():
"""Check if currently playing."""
json_data = {
"method": "core.playback.get_state",
"jsonrpc": "2.0",
"prams": {},
"id": 1,
}
... | [
37811,
15988,
1957,
285,
404,
19325,
526,
15931,
198,
198,
11748,
7007,
198,
11748,
33918,
628,
198,
4871,
337,
404,
19325,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
44,
404,
19325,
1630,
4049,
526,
15931,
628,
198,
4299,
285,
... | 2.166667 | 960 |
import unittest
from redblacktree.redblacktree import Node, RedBlackTree, RED, BLACK
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
2266,
13424,
21048,
13,
445,
13424,
21048,
1330,
19081,
11,
2297,
9915,
27660,
11,
23848,
11,
31963,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
71... | 2.87234 | 47 |
import os, sys, platform
__SUPPORT_ANSI__ = False
| [
11748,
28686,
11,
25064,
11,
3859,
198,
198,
834,
40331,
15490,
62,
1565,
11584,
834,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 2.222222 | 27 |
# (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: context_demo
type... | [
2,
357,
34,
8,
2321,
11,
3899,
1024,
23303,
272,
11,
1279,
76,
40302,
13,
2934,
3099,
272,
31,
14816,
13,
785,
29,
198,
2,
357,
66,
8,
2177,
28038,
856,
4935,
198,
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
357,
3826,
2... | 2.979827 | 347 |
from django.conf.urls import url
from rest_framework import routers
from talentmap_api.common.urls import get_retrieve, post_create
from talentmap_api.feature_flags.views import featureflags as views
router = routers.SimpleRouter()
urlpatterns = [
url(r'^$', views.FeatureFlagsView.as_view({**get_retrieve, 'post': ... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
1334,
62,
30604,
1330,
41144,
198,
6738,
7401,
8899,
62,
15042,
13,
11321,
13,
6371,
82,
1330,
651,
62,
1186,
30227,
11,
1281,
62,
17953,
198,
198,
6738,
7401,
8899,... | 3.086614 | 127 |
# Generated from JSON.g4 by ANTLR 4.7.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
| [
2,
2980,
515,
422,
19449,
13,
70,
19,
416,
3537,
14990,
49,
604,
13,
22,
13,
17,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
6738,
1885,
14050,
19,
1330,
1635,
198,
6738,
33245,
1330,
10903,
9399,
198,
6738,
19720,
13,
952,
1330,
... | 2.830189 | 53 |
#new home for the weaponry lists, they shouldn't be in the core file
#hopefully in 1.4 the entire purpose of this file dissolves and these lists go away.
#
| [
2,
3605,
1363,
329,
262,
28479,
8341,
11,
484,
6584,
470,
307,
287,
262,
4755,
2393,
198,
2,
8548,
7549,
287,
352,
13,
19,
262,
2104,
4007,
286,
428,
2393,
6249,
9010,
290,
777,
8341,
467,
1497,
13,
198,
198,
2,
628
] | 3.761905 | 42 |
profile1 = {
"name": "testing",
"codeforces": "aaradhya0707",
"codechef": "aaradhya0707",
"atcoder": "aaradhya0707",
"uva_handle": "aaradhya0707",
"spoj": "aaradhya777",
"uva_id": "1143870"
}
profile2 = {
"name": "testinguser",
"codeforces": "shivamsinghal1012",
"codechef": "shi... | [
13317,
16,
796,
1391,
198,
220,
220,
220,
366,
3672,
1298,
366,
33407,
1600,
198,
220,
220,
220,
366,
19815,
891,
273,
728,
1298,
366,
64,
283,
24411,
3972,
15,
24038,
1600,
198,
220,
220,
220,
366,
19815,
721,
258,
69,
1298,
366,
... | 1.913295 | 173 |
[n,m] = list(map(int,input().split()))
ai = list(map(int,input().split()))
aux = [[]for i in range(m)]
dp = [aux for i in range(n)]
#def grundy():
for i in range(n):
for j in range(m):
| [
58,
77,
11,
76,
60,
796,
1351,
7,
8899,
7,
600,
11,
15414,
22446,
35312,
3419,
4008,
198,
198,
1872,
796,
1351,
7,
8899,
7,
600,
11,
15414,
22446,
35312,
3419,
4008,
198,
198,
14644,
796,
16410,
60,
1640,
1312,
287,
2837,
7,
76,
... | 2.136842 | 95 |
# Importing the Kratos Library
import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication as KratosFluid
## Import base class file
from KratosMultiphysics.FluidDynamicsApplication.fluid_solver import FluidSolver
from KratosMultiphysics.FluidDynamicsApplication import check_and_prepare_model_process_... | [
2,
17267,
278,
262,
509,
10366,
418,
10074,
198,
11748,
509,
10366,
418,
15205,
13323,
23154,
198,
11748,
509,
10366,
418,
15205,
13323,
23154,
13,
37,
2290,
312,
35,
4989,
873,
23416,
355,
509,
10366,
418,
37,
2290,
312,
198,
198,
22... | 3.125 | 104 |