content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from olympics_engine.core import OlympicsBase
from olympics_engine.viewer import Viewer, debug
from olympics_engine.objects import Ball, Agent
from pathlib import Path
CURRENT_PATH = str(Path(__file__).resolve().parent.parent)
import numpy as np
import math
import pygame
import sys
import os
import random
import copy
... | [
6738,
267,
6760,
873,
62,
18392,
13,
7295,
1330,
14935,
14881,
198,
6738,
267,
6760,
873,
62,
18392,
13,
1177,
263,
1330,
3582,
263,
11,
14257,
198,
6738,
267,
6760,
873,
62,
18392,
13,
48205,
1330,
6932,
11,
15906,
198,
6738,
3108,
... | 2.055128 | 780 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
try:
from itertools import izip as zip
except ImportError: # will be 3.x series
pass
from struct import pack
import copy
from onnx import defs
from onnx import ... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
28311,
25,
198,
220... | 2.24715 | 4,649 |
import xml.etree.ElementTree as ET
# Point this to the output of exportpicasa
XML_FILE_PATH = '/home/user/3/index.xml'
tree = ET.parse(XML_FILE_PATH)
root = tree.getroot()
for folder in root:
folderName = folder.get('name')
for file in folder:
fileName = file.get('name')
for face in file:
personName = face.... | [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
2,
6252,
428,
284,
262,
5072,
286,
10784,
16564,
15462,
198,
55,
5805,
62,
25664,
62,
34219,
796,
31051,
11195,
14,
7220,
14,
18,
14,
9630,
13,
19875,
6,
198,
198,
... | 2.657692 | 260 |
import numpy as np
from torch.utils.data import Dataset
# Custom collate for dataset | [
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
198,
198,
2,
8562,
2927,
378,
329,
27039
] | 3.541667 | 24 |
# lexer.py
import string
| [
198,
198,
2,
220,
31191,
263,
13,
9078,
220,
628,
628,
198,
11748,
4731,
220,
198,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
628,
628,
198
] | 1.512821 | 39 |
from typing import List
nums = [1,-2,-3,4]
res = Solution().getMaxLen(nums)
print(res) | [
6738,
19720,
1330,
7343,
628,
198,
77,
5700,
796,
685,
16,
12095,
17,
12095,
18,
11,
19,
60,
198,
411,
796,
28186,
22446,
1136,
11518,
30659,
7,
77,
5700,
8,
198,
4798,
7,
411,
8
] | 2.514286 | 35 |
from chroma_core.lib.cache import ObjectCache
from chroma_core.models import Nid
from chroma_core.services.job_scheduler.job_scheduler_client import JobSchedulerClient
from chroma_core.models import ManagedTarget, ManagedMgs, ManagedHost
from tests.unit.chroma_core.helpers import freshen
from tests.unit.chroma_core.he... | [
6738,
15358,
64,
62,
7295,
13,
8019,
13,
23870,
1330,
9515,
30562,
198,
6738,
15358,
64,
62,
7295,
13,
27530,
1330,
46798,
198,
6738,
15358,
64,
62,
7295,
13,
30416,
13,
21858,
62,
1416,
704,
18173,
13,
21858,
62,
1416,
704,
18173,
... | 3.210526 | 152 |
"""
Created on Feb 24, 2017
@author: Siyuan Huang
Process the skeleton, get the input for LSTM.
Input: Aligned human skeleton feature.
"""
import config
import json
import scipy.io
import os
import numpy as np
if __name__ == '__main__':
main()
| [
37811,
198,
41972,
319,
3158,
1987,
11,
2177,
198,
198,
31,
9800,
25,
311,
7745,
7258,
31663,
198,
198,
18709,
262,
18328,
11,
651,
262,
5128,
329,
406,
2257,
44,
13,
198,
198,
20560,
25,
978,
3916,
1692,
18328,
3895,
13,
198,
198,
... | 2.943182 | 88 |
#!/usr/bin/python
#
# Copyright (c) 2012 Mikkel Schubert <MikkelSch@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
#... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
357,
66,
8,
2321,
17722,
7750,
3059,
84,
4835,
1279,
44,
1134,
7750,
14874,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
... | 3.667553 | 376 |
import pytest
from skvalidate.commands.execute import print_metrics
@pytest.mark.parametrize('metrics,command', [
(
{'sleep 2':
{
'cpu_time': {
'value': 23,
'unit': 's',
},
'max_rss': {
'value': 200,
... | [
11748,
12972,
9288,
198,
6738,
1341,
12102,
378,
13,
9503,
1746,
13,
41049,
1330,
3601,
62,
4164,
10466,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
10786,
4164,
10466,
11,
21812,
3256,
685,
198,
220,
220,
220,
357,... | 1.570881 | 261 |
# -*- coding: utf-8 -*-
''' For mischief module, all the helper methods are
added in this file, for user to use in core. '''
from datetime import datetime
import tweepy
from .config import PARDON_LIST
def generate_summary_report(api):
""" Generate Summary Report of Authenticated User """
# Get the User o... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
1114,
38625,
8265,
11,
477,
262,
31904,
5050,
389,
198,
220,
220,
220,
2087,
287,
428,
2393,
11,
329,
2836,
284,
779,
287,
4755,
13,
705,
7061,
198,
19... | 2.72674 | 1,365 |
from data_for_tests import Kermany_DataSet
import timm
import wandb
import os
from timm.models.swin_transformer import SwinTransformer
from utils import *
from res_models import *
from model_running import *
from convnext import convnext_base, convnext_large, convnext_xlarge
import numpy as np
import random
from pytorc... | [
6738,
1366,
62,
1640,
62,
41989,
1330,
509,
2224,
88,
62,
6601,
7248,
198,
11748,
4628,
76,
198,
11748,
11569,
65,
198,
11748,
28686,
198,
6738,
4628,
76,
13,
27530,
13,
2032,
259,
62,
7645,
16354,
1330,
2451,
259,
8291,
16354,
198,
... | 2.241361 | 1,910 |
# -*- coding: utf-8 -*-
'''
Escribe un programa troceador.py que pedirá un fichero de una imagen o una canción y la troceará en archivos más pequeños de 521 bytes.
El programa irá numerandolos archivos (trozo1, trozo2, etc) Un segundo programa tomará los archivos troceados y recompondrá el archivo original
'''
i... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
36,
12522,
555,
1430,
64,
4161,
344,
7079,
13,
9078,
8358,
7190,
343,
6557,
555,
277,
291,
11718,
390,
555,
64,
3590,
268,
267,
555,
64,
460,
979,... | 2.404 | 250 |
# -*- coding: utf-8 -*-
import pytest
from crawlib.cache import create_cache_here
from crawlib.cached_request import CachedRequest
from crawlib.tests.dummy_site.music.view import (
max_n_artist, max_n_genre,
)
from crawlib.tests.dummy_site_crawler.mongo_backend.s2_music import MusicPage
cache = create_cache_here... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
27784,
8019,
13,
23870,
1330,
2251,
62,
23870,
62,
1456,
198,
6738,
27784,
8019,
13,
66,
2317,
62,
25927,
1330,
327,
2317,
18453... | 2.587156 | 218 |
#!/usr/bin/python3
__author__ = "yang.dd"
"""
example 087
python是按值传递参数
"""
if __name__ == "__main__":
a = student()
a.x = 3
a.c = 'a'
f(a)
print(a.x, a.c)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
834,
9800,
834,
796,
366,
17859,
13,
1860,
1,
198,
198,
37811,
198,
220,
220,
220,
1672,
657,
5774,
198,
220,
220,
220,
21015,
42468,
162,
234,
231,
161,
222,
120,
27670,
254,
34... | 1.652174 | 115 |
import random
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from src.model import QNetwork
from utils.replay_buffer import ReplayBuffer
BUFFER_SIZE = int(1e5)
BATCH_SIZE = 64
GAMMA = 0.99
TAU = 1e-3
LR = 5e-4
UPDATE_EVERY = 5 # UPDATE FREQUENCY: how often to update the ... | [
11748,
4738,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
198,
6738,
12351,
13,
19849,
1330,
1195,
26245,
198,
6738,
3384,
4... | 2.477183 | 1,775 |
import pyaudio
import os
import struct
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.fftpack import fft
import time
from tkinter import TclError
# # to display in separate Tk window
# %matplotlib tk
from keras.models import Sequential, Model, model_from_json
from keras import losse... | [
11748,
12972,
24051,
198,
11748,
28686,
198,
11748,
2878,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
487,
83,
80... | 3.032468 | 308 |
import unittest
import stringToLong
| [
11748,
555,
715,
395,
198,
198,
11748,
4731,
2514,
14617,
198
] | 3.363636 | 11 |
from sklearn.ensemble import GradientBoostingClassifier
import argparse
import numpy as np
import pickle
parser = argparse.ArgumentParser()
parser.add_argument("training", help="File path to the training set")
parser.add_argument("validation", help="File path to the validation set")
parser.add_argument("-n", "--name",... | [
6738,
1341,
35720,
13,
1072,
11306,
1330,
17701,
1153,
45686,
278,
9487,
7483,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610... | 2.780255 | 314 |
from django.contrib import admin
from learning.models import CurrentReadingBook, Course
admin.site.register(CurrentReadingBook)
admin.site.register(Course)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
4673,
13,
27530,
1330,
9236,
36120,
10482,
11,
20537,
198,
198,
28482,
13,
15654,
13,
30238,
7,
11297,
36120,
10482,
8,
198,
28482,
13,
15654,
13,
30238,
7,
49046,
8,
198... | 3.761905 | 42 |
# [rights] Copyright 2020 brianddk at github https://github.com/brianddk
# [license] Apache 2.0 License https://www.apache.org/licenses/LICENSE-2.0
# [repo] https://github.com/brianddk/pypaperwallet
# [btc] BTC-b32: bc1qwc2203uym96u0nmq04pcgqfs9ldqz9l3mz8fpj
# [tipjar] https://gist.github.com/brianddk/3ec16fbf... | [
2,
685,
28046,
60,
220,
15069,
12131,
31013,
392,
34388,
379,
33084,
3740,
1378,
12567,
13,
785,
14,
65,
380,
392,
34388,
198,
2,
685,
43085,
60,
24843,
362,
13,
15,
13789,
3740,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
... | 2.298103 | 369 |
from ompc import
@mfunction("out, filter")
| [
6738,
267,
3149,
66,
1330,
201,
198,
201,
198,
31,
76,
8818,
7203,
448,
11,
8106,
4943,
201,
198
] | 2.473684 | 19 |
from django.urls import path, re_path
from registers import views
urlpatterns = [
path('itsystem/export/', views.ITSystemExport.as_view(), name='itsystem_export'),
path('itsystem/discrepancy-report/', views.ITSystemDiscrepancyReport.as_view(), name='itsystem_discrepancy_report'),
path('incident/', views.In... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
198,
6738,
28441,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
896,
6781,
14,
39344,
14,
3256,
5009,
13,
2043,
11964,
43834,
13,
2... | 2.944516 | 775 |
import json, re
dataFileName = 'courses.json'
slotFileName = 'slots.1.txt'
if __name__ == '__main__':
print( searchData( input('Search for: ') ) ) | [
11748,
33918,
11,
302,
198,
198,
7890,
8979,
5376,
796,
705,
66,
39975,
13,
17752,
6,
198,
43384,
8979,
5376,
796,
705,
6649,
1747,
13,
16,
13,
14116,
6,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
... | 2.614035 | 57 |
from construct import (
Struct, Sequence,
PrefixedArray, If, Computed,
this,
)
from distance.bytes import Magic, Section
from distance.construct import (
BaseConstructFragment,
Int, UInt, Bytes, Byte, Float,
DstString, Remainder,
)
from distance.classes import CollectorGroup
from distance._co... | [
198,
198,
6738,
5678,
1330,
357,
198,
220,
220,
220,
32112,
11,
45835,
11,
198,
220,
220,
220,
3771,
34021,
19182,
11,
1002,
11,
955,
17128,
11,
198,
220,
220,
220,
428,
11,
198,
8,
198,
198,
6738,
5253,
13,
33661,
1330,
6139,
11,... | 3.066667 | 195 |
# Generated by Django 3.0.8 on 2020-11-10 10:01
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
23,
319,
12131,
12,
1157,
12,
940,
838,
25,
486,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import random
import re
RE_PROVERKA = re.compile(r'[а-яА-Я]+')
f = open('text', 'r', encoding='utf-8')
text = f.read()
print(text)
bad_chars = [';', ':', '?', '.', ',', '!', '~', '\n', '…', '-']
for i in bad_chars:
text = text.replace(i, ' ')
text = text.split(" ")
slova = [w for w in filter(RE_PROVERKA.match... | [
11748,
4738,
198,
11748,
302,
628,
198,
198,
2200,
62,
31190,
5959,
25123,
796,
302,
13,
5589,
576,
7,
81,
6,
58,
16142,
12,
40623,
140,
238,
12,
140,
107,
48688,
11537,
198,
69,
796,
1280,
10786,
5239,
3256,
705,
81,
3256,
21004,
... | 2.118227 | 203 |
#!/usr/bin/env python
# encoding: utf-8
"""
initconftest.py
Created by 黄 冬 on 2007-11-19.
Copyright (c) 2007 __MyCompanyName__. All rights reserved.
"""
import basetest
import logging.config
import os
import pwd
import shutil
import tempfile
import time
import unittest
log = logging.getLogger('xbaydns.tests.initconf... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
15003,
1102,
701,
395,
13,
9078,
198,
198,
41972,
416,
16268,
119,
226,
10263,
228,
105,
319,
4343,
12,
1157,
12,
1129,
13,
198,
15... | 2.416949 | 295 |
__version__ = "1.0.0.dev1"
default_app_config = "djangocms_url_manager.apps.UrlManagerConfig"
| [
834,
9641,
834,
796,
366,
16,
13,
15,
13,
15,
13,
7959,
16,
1,
198,
198,
12286,
62,
1324,
62,
11250,
796,
366,
28241,
648,
420,
907,
62,
6371,
62,
37153,
13,
18211,
13,
28165,
13511,
16934,
1,
198
] | 2.435897 | 39 |
# Generated by Django 2.0.5 on 2018-05-07 17:37
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
20,
319,
2864,
12,
2713,
12,
2998,
1596,
25,
2718,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import reframe as rfm
from hpctestlib.python.numpy.numpy_ops import numpy_ops_check
@rfm.simple_test
| [
2,
15069,
1584,
12,
1238,
2481,
14780,
2351,
3115,
785,
48074,
9072,
357,
34,
6173,
50,
14,
20702,
43412,
8,
198,
2,
797,
19778,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
38559,
24290,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
... | 3.010101 | 99 |
import os
import ndjson
import pandas as pd
"""
Makes daily language specific files in correct format
"""
# define languages to extract
langs = ["da", "no", "sv"]
# make a function that transforms a pandas DF to ndjson format (found on stackoverflow)
# List file paths from folders with raw data
raw1 = ["/data/001_... | [
11748,
28686,
198,
11748,
299,
67,
17752,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
198,
37811,
198,
44,
1124,
4445,
3303,
2176,
3696,
287,
3376,
5794,
198,
37811,
198,
198,
2,
8160,
8950,
284,
7925,
198,
17204,
82,
796,
14631,
... | 2.527936 | 877 |
import random
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.widgets import Slider, RadioButtons
from DSprites_VAE.src.model import VAE
from DSprites_VAE.src.utils import load_data, get_batch, create_categories_map
if __name__ == '__main__':
show()
| [
11748,
4738,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
13,
28029,
11407,
1330,
3454,
1304,
11,
8829,
153... | 2.877358 | 106 |
import datetime
from django.template import engines
from django.test import TestCase
from regulations3k.jinja2tags import ap_date, regs_hide_on_mobile
| [
11748,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
28243,
1330,
11874,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
6647,
18,
74,
13,
18594,
6592,
17,
31499,
1330,
2471,
62,
4475,
11,
842,
82,
62,
24717,
62,... | 3.347826 | 46 |
from typing import Generic, TypeVar, Optional, List
from pydantic import Field
from pydantic.generics import GenericModel
T = TypeVar("T")
| [
6738,
19720,
1330,
42044,
11,
5994,
19852,
11,
32233,
11,
7343,
198,
198,
6738,
279,
5173,
5109,
1330,
7663,
198,
6738,
279,
5173,
5109,
13,
8612,
873,
1330,
42044,
17633,
628,
198,
51,
796,
5994,
19852,
7203,
51,
4943,
628,
198
] | 3.512195 | 41 |
import matplotlib.pyplot as plt
import numpy as np
tray = np.genfromtxt("poblaciones.dat",delimiter=",")
a = tray[:,0]
b = tray[:,1]
c = tray[:,2]
d = tray[:,3]
fig = plt.figure(figsize = (20,20))
plt.subplot(2,3,1)
plt.scatter(a,b)
plt.xlabel(r'$\alpha$' )
plt.ylabel(r'$\beta$' )
plt.subplot(2,3,2)
plt.scatter... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2213,
323,
796,
45941,
13,
5235,
6738,
14116,
7203,
79,
45292,
49443,
274,
13,
19608,
1600,
12381,
320,
2676,
28,
2430,
8,
198,
198... | 1.704698 | 447 |
from django.test import TestCase
from model_mommy import mommy
from ..models import Human, Child, Parent, Sibling, Avatar, User
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
2746,
62,
32542,
1820,
1330,
1995,
1820,
198,
6738,
11485,
27530,
1330,
5524,
11,
5932,
11,
16774,
11,
311,
27448,
11,
26703,
11,
11787,
628
] | 3.685714 | 35 |
"""Common color snippets."""
import re
from spacy import registry
from traiter import actions
from traiter import const as t_const
from traiter.patterns import matcher_patterns
from . import common_patterns
from . import term_patterns
from .. import consts
MULTIPLE_DASHES = ["\\" + c for c in t_const.DASH_CHAR]
MULT... | [
37811,
17227,
3124,
45114,
526,
15931,
198,
11748,
302,
198,
198,
6738,
599,
1590,
1330,
20478,
198,
6738,
1291,
2676,
1330,
4028,
198,
6738,
1291,
2676,
1330,
1500,
355,
256,
62,
9979,
198,
6738,
1291,
2676,
13,
33279,
82,
1330,
2603,
... | 2.394737 | 380 |
# Be name khoda
from .node import Node as Node
from . import tools as tools
| [
2,
1355,
1438,
479,
2065,
64,
198,
6738,
764,
17440,
1330,
19081,
355,
19081,
198,
6738,
764,
1330,
4899,
355,
4899,
628
] | 3.5 | 22 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Board, Reply
admin.site.register(Board)
admin.site.register(Reply)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
5926,
11,
14883,
... | 2.968254 | 63 |
# Generated by Django 2.2.2 on 2020-03-22 05:15
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
17,
319,
12131,
12,
3070,
12,
1828,
8870,
25,
1314,
201,
198,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
201,
198,
201,
198
] | 2.567568 | 37 |
import FWCore.ParameterSet.Config as cms
process = cms.Process("SurveyToTransforms")
#process.load("FWCore.MessageLogger.MessageLogger_cfi")
#process.MessageLogger.cout.enable = cms.untracked.bool(True)
#process.MessageLogger.cout.threshold = cms.untracked.string('INFO')
#process.MessageLogger.debugModules = cms.un... | [
198,
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
628,
198,
14681,
796,
269,
907,
13,
18709,
7203,
14214,
3304,
2514,
8291,
23914,
4943,
198,
198,
2,
14681,
13,
2220,
7203,
24160,
14055,
13,
12837,
11187,
1362,
13,
... | 2.408497 | 612 |
class PlainText:
"""A wrapper class for representing plaintext.
Typical format of plaintext data would be [x0, x1, x2...] where xi represents
coefficients of the polynomial.
Attributes:
data: A 1-dim list representing plaintext coefficient values.
"""
| [
4871,
28847,
8206,
25,
198,
220,
220,
220,
37227,
32,
29908,
1398,
329,
10200,
8631,
5239,
13,
628,
220,
220,
220,
48752,
5794,
286,
8631,
5239,
1366,
561,
307,
685,
87,
15,
11,
2124,
16,
11,
2124,
17,
22345,
810,
2124,
72,
6870,
... | 3.241379 | 87 |
import numpy as np
import math as mt
| [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
10688,
355,
45079,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
201,
198,
201... | 1.346667 | 75 |
import pkg_resources
from .parser import Parser
from .generate import generate | [
11748,
279,
10025,
62,
37540,
198,
198,
6738,
764,
48610,
1330,
23042,
263,
198,
6738,
764,
8612,
378,
1330,
7716
] | 3.95 | 20 |
#!/usr/bin/env python
# encoding: utf-8
"""
tl_tweets.py
Copyright (c) 2015 Rob Mason
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 ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
28781,
62,
83,
732,
1039,
13,
9078,
198,
198,
15269,
357,
66,
8,
1853,
3851,
14737,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
147... | 3.094595 | 740 |
# Module: Anomaly Detection
# Author: Moez Ali <moez.ali@queensu.ca>
# License: MIT
# Release: PyCaret 2.2.0
# Last modified : 25/10/2020
import logging
import pandas as pd
import numpy as np
from pycaret.internal.pycaret_experiment import AnomalyExperiment, ClusteringExperiment
from pycaret.internal.utils import che... | [
2,
19937,
25,
1052,
24335,
46254,
198,
2,
6434,
25,
46488,
89,
12104,
1279,
76,
2577,
89,
13,
7344,
31,
4188,
641,
84,
13,
6888,
29,
198,
2,
13789,
25,
17168,
198,
2,
13868,
25,
9485,
34,
8984,
362,
13,
17,
13,
15,
198,
2,
458... | 2.550115 | 18,687 |
from django.urls import path
from . import views
urlpatterns = [
path('evaluate-architecture', views.EvaluateArchitecture.as_view()),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
49786,
12,
998,
5712,
495,
3256,
5009,
13,
36,
2100,
4985,
19895,
5712,
495,
13,
29... | 2.84 | 50 |
# Generated by Django 3.1.4 on 2021-09-10 15:43
from django.db import migrations
import markdownx.models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
19,
319,
33448,
12,
2931,
12,
940,
1315,
25,
3559,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
11748,
1317,
2902,
87,
13,
27530,
628
] | 2.891892 | 37 |
__all__ = ['CollectorManager']
import concurrent.futures
from spaceone.core.manager import BaseManager
from datetime import datetime, timedelta
from spaceone.inventory.error.custom import *
from spaceone.inventory.model.server import *
from spaceone.inventory.libs.schema.base import ReferenceModel
from pprint import p... | [
834,
439,
834,
796,
37250,
31337,
273,
13511,
20520,
198,
198,
11748,
24580,
13,
69,
315,
942,
198,
6738,
2272,
505,
13,
7295,
13,
37153,
1330,
7308,
13511,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
2272,
5... | 3.206897 | 145 |
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn import CrossEntropyLoss
from transformers.modeling_bert import BertPreTrainedModel, BertModel
from ..esim.layers import Seq2SeqEncoder
from ..esim.utils import replace_masked
class BERTBaseline(BertPreTrainedModel):
"""
ab、ac... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
28034,
13,
20471,
1330,
6372,
14539,
28338,
43,
793,
198,
6738,
6121,
364,
13,
4666,
10809,
62,
4835,
1330,
22108,
6719,
2898,... | 2.779528 | 127 |
valor_total = int(input('Qual valor ira sacar? R$'))
cedula50 = cedula20 = cedula10 = cedula5 = moeda1 = 0
while True:
if valor_total >= 50:
cedula50 += 1
valor_total -= 50
elif valor_total >= 20:
cedula20 += 1
valor_total -= 20
elif valor_total >= 10:
cedula10 += 1
... | [
2100,
273,
62,
23350,
796,
493,
7,
15414,
10786,
46181,
1188,
273,
4173,
64,
5360,
283,
30,
371,
3,
6,
4008,
198,
771,
4712,
1120,
796,
269,
276,
4712,
1238,
796,
269,
276,
4712,
940,
796,
269,
276,
4712,
20,
796,
6941,
18082,
16,... | 1.87799 | 418 |
#!/usr/bin/env python3
import PyKDL as kdl
test = kdl.Vector(0, 0, -0.2)
print(test)
# | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
9485,
42,
19260,
355,
479,
25404,
628,
198,
9288,
796,
479,
25404,
13,
38469,
7,
15,
11,
657,
11,
532,
15,
13,
17,
8,
198,
4798,
7,
9288,
8,
198,
2,
220,
220,
2... | 1.978723 | 47 |
import pytest
pytest.register_assert_rewrite('tests.testing_dataframe')
| [
11748,
12972,
9288,
628,
198,
9078,
9288,
13,
30238,
62,
30493,
62,
1809,
6525,
10786,
41989,
13,
33407,
62,
7890,
14535,
11537,
198
] | 3.217391 | 23 |
# Author: Betterman
# -*- coding = utf-8 -*-
# @Time : 2020/8/27 14:56
# @File : acc_topK.py
# @Software : PyCharm
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
tf.random.set_seed(2467)
#计算accuracy
#正态分布10个样本,6个类
output = tf.random.normal([10, 6])
#softmax使得6类总和概率为1
output ... | [
2,
6434,
25,
11625,
805,
201,
198,
2,
532,
9,
12,
19617,
796,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
2488,
7575,
1058,
12131,
14,
23,
14,
1983,
1478,
25,
3980,
201,
198,
2,
2488,
8979,
1058,
697,
62,
4852,
42,
13,
9078,
... | 1.897959 | 343 |
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | [
2,
198,
2,
19643,
2265,
12,
18392,
12,
40406,
1377,
19643,
2265,
3113,
9058,
198,
2,
15069,
357,
34,
8,
2211,
12,
4626,
2297,
10983,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
... | 3.12963 | 486 |
# Generated by Django 2.0.3 on 2018-07-25 05:57
from django.db import migrations
import django.db.models.manager
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
18,
319,
2864,
12,
2998,
12,
1495,
8870,
25,
3553,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
37153,
628
] | 2.875 | 40 |
#!/usr/bin/env python3
import base64
import getpass
import os
import pprint
import sys
import time
from contextlib import suppress
from pathlib import Path
from time import sleep
from typing import Dict, List
from broker import cfg
from broker._utils._log import br, log, ok
from broker._utils.tools import _remove, ex... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
2779,
2414,
198,
11748,
651,
6603,
198,
11748,
28686,
198,
11748,
279,
4798,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
4732,
8019,
1330,
18175,
198,
6738,
3108,
8019... | 2.437398 | 615 |
from typing import Optional, Protocol
import pytest
EXPECTED_URLS = [
"https://habr.com/kek/v2/articles/?hub=python&sort=all&fl=ru&hl=ru&page=1",
None,
]
@pytest.mark.parametrize(
"page_number, expected_url", ([1, EXPECTED_URLS[0]], [100, EXPECTED_URLS[1]])
)
| [
6738,
19720,
1330,
32233,
11,
20497,
198,
198,
11748,
12972,
9288,
628,
198,
49864,
9782,
1961,
62,
4261,
6561,
796,
685,
198,
220,
220,
220,
366,
5450,
1378,
5976,
81,
13,
785,
14,
365,
74,
14,
85,
17,
14,
26845,
20924,
40140,
28,
... | 2.224 | 125 |
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
import RegressionProblems as RP
import time
from multiprocessing import Lock
| [
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
5972,
2569,
8081,
2234,
198,
6738,
1341,
35720,
13,
82,
14761,
1330,
311,
15922,
198,
11748,
3310,
2234,
2964,
22143,
355,
25812,
198,
11748,
640,
198,
6... | 3.666667 | 48 |
import gzip
import os
import json
from .model import Sitting, Action, Teacher, IPupil, APupil, Storyline, StorylineItem, Course, Challenge
class RoboDAO:
"""Gives access to the Robo model objects as defined in the model module. Objects
are preloaded from the ano-directory which contains the Robomind Academy
... | [
11748,
308,
13344,
198,
11748,
28686,
198,
11748,
33918,
198,
6738,
764,
19849,
1330,
46547,
11,
7561,
11,
32019,
11,
6101,
929,
346,
11,
3486,
929,
346,
11,
8362,
1370,
11,
8362,
1370,
7449,
11,
20537,
11,
13879,
628,
198,
4871,
3970... | 2.067259 | 788 |
import datetime
import json
import time
import pytz
from sphinxsearch.lookups import sphinx_lookups
from django.core import exceptions
from django.db import models
class SphinxField(models.TextField):
""" Non-selectable indexed string field
In sphinxsearch config terms, sql_field_string or rt_field.
""... | [
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
640,
198,
198,
11748,
12972,
22877,
198,
198,
6738,
599,
20079,
87,
12947,
13,
5460,
4739,
1330,
599,
20079,
87,
62,
5460,
4739,
198,
6738,
42625,
14208,
13,
7295,
1330,
13269,
198,
6738... | 3.037657 | 239 |
from gym.envs.registration import register
from d4rl.gym_mujoco import gym_envs
HOPPER_RANDOM_SCORE = -20.272305
HALFCHEETAH_RANDOM_SCORE = -280.178953
WALKER_RANDOM_SCORE = 1.629008
ANT_RANDOM_SCORE = -325.6
HOPPER_EXPERT_SCORE = 3234.3
HALFCHEETAH_EXPERT_SCORE = 12135.0
WALKER_EXPERT_SCORE = 4592.3
ANT_EXPERT_SCORE... | [
6738,
11550,
13,
268,
14259,
13,
2301,
33397,
1330,
7881,
198,
6738,
288,
19,
45895,
13,
1360,
76,
62,
76,
23577,
25634,
1330,
11550,
62,
268,
14259,
198,
198,
39,
3185,
18973,
62,
49,
6981,
2662,
62,
6173,
6965,
796,
532,
1238,
13,... | 1.890629 | 4,087 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Draw boxes on images processed using gigadetector pipeline.
click n to keep going, escape to stop.
If you press q I'm not sure what will happen
"""
# Import stuff
import sys
import os
import joblib
import cv2
base_path = os.path.expanduser("~") + r"/gigadetector/"
s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
25302,
10559,
319,
4263,
13686,
1262,
12526,
324,
316,
9250,
11523,
13,
198,
198,
12976,
299,
284,
1394... | 2.425941 | 1,195 |
import pydiffvg_tensorflow as pydiffvg
import tensorflow as tf
import skimage
import numpy as np
canvas_width, canvas_height = 256, 256
num_control_points = tf.constant([2, 2, 2])
points = tf.constant([[120.0, 30.0], # base
[150.0, 60.0], # control point
[ 90.0, 198.0],... | [
11748,
279,
5173,
733,
45119,
62,
83,
22854,
11125,
355,
279,
5173,
733,
45119,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
1341,
9060,
198,
11748,
299,
32152,
355,
45941,
198,
198,
5171,
11017,
62,
10394,
11,
21978,
62,
1701... | 1.996465 | 2,263 |
#!/usr/tce/bin/python
import sys
import random
if len(sys.argv) < 2 :
usage = '''
usage: add_overlap.py list_base_name number_of_lists overlap_percent
example: if your lists are t0_list.txt, t1_list.txt and t2_list.txt
you want 30 percent overlap you would run as:
add_overlap.py list.... | [
2,
48443,
14629,
14,
83,
344,
14,
8800,
14,
29412,
198,
198,
11748,
25064,
198,
11748,
4738,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
1279,
362,
1058,
198,
220,
8748,
796,
705,
7061,
198,
220,
8748,
25,
751,
62,
2502,
37796... | 2.847025 | 706 |
from psiopic2.app.setupwiki import SetupWiki
from psiopic2.app.createcorpus import CreateCorpus
import sys
import logging
from psiopic2.app.ui.logutils import getLogger
from appdirs import AppDirs
from docopt import docopt
import traceback
DOC="""Psiopic2 CLI Tool
Usage:
psiopic2 <command> [options]
Available Co... | [
6738,
46231,
16603,
17,
13,
1324,
13,
40406,
15466,
1330,
31122,
32603,
198,
6738,
46231,
16603,
17,
13,
1324,
13,
17953,
10215,
79,
385,
1330,
13610,
45680,
385,
198,
11748,
25064,
198,
11748,
18931,
198,
6738,
46231,
16603,
17,
13,
13... | 2.955975 | 159 |
from asip.services.asip_service import AsipService
import sys | [
6738,
355,
541,
13,
30416,
13,
292,
541,
62,
15271,
1330,
1081,
541,
16177,
198,
11748,
25064
] | 3.588235 | 17 |
"""
* Knight 1.0.0
* https://github.com/RobertoPrevato/Knight
*
* Copyright 2015, Roberto Prevato
* http://ugrose.com
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
"""
import argparse
separator = "******************************************************\n"
parser = argparse.Argume... | [
37811,
198,
1635,
6700,
352,
13,
15,
13,
15,
198,
1635,
3740,
1378,
12567,
13,
785,
14,
15924,
1462,
36854,
5549,
14,
44242,
198,
1635,
198,
1635,
15069,
1853,
11,
32076,
43280,
5549,
198,
1635,
2638,
1378,
1018,
13698,
13,
785,
198,
... | 2.937294 | 606 |
"""cli_core.py: basic metaclass for handling generic tool layout
Acts as global namespace + parent-framework for CLI apps
"""
from os import path
import platform
from datetime import datetime
import warnings
import uuid
from plumbum import cli
import prosper.common.prosper_logging as p_logger
import prosper.common.... | [
37811,
44506,
62,
7295,
13,
9078,
25,
4096,
1138,
330,
31172,
329,
9041,
14276,
2891,
12461,
198,
198,
6398,
82,
355,
3298,
25745,
1343,
2560,
12,
30604,
329,
43749,
6725,
198,
198,
37811,
198,
6738,
28686,
1330,
3108,
198,
11748,
3859,... | 2.412429 | 1,416 |
import RPi.GPIO as GPIO
import time
import settings
PistonTravelTime = settings.Piston_Reistijd
PinUp = settings.Pin_Omhoog
PinDown = settings.Pin_Omlaag
if __name__ == '__main__':
try:
setup()
except KeyboardInterrupt:
close()
| [
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198,
11748,
6460,
198,
198,
47,
36363,
33074,
7575,
796,
6460,
13,
47,
36363,
62,
3041,
396,
2926,
67,
198,
28348,
4933,
796,
6460,
13,
28348,
62,
46,
76,
8873,
51... | 2.19685 | 127 |
import socket
import time
import random
TCP_IP1 = '127.0.0.1'
TCP_PORT1 = 5007
transmit = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
transmit.connect((TCP_IP1, TCP_PORT1))
TCP_PORT2 = 5006
transmit2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
transmit2.connect((TCP_IP1, TCP_PORT2))
while True:
transmit... | [
11748,
17802,
198,
11748,
640,
198,
11748,
4738,
198,
4825,
47,
62,
4061,
16,
220,
796,
705,
16799,
13,
15,
13,
15,
13,
16,
6,
198,
4825,
47,
62,
15490,
16,
796,
5323,
22,
198,
7645,
2781,
796,
17802,
13,
44971,
7,
44971,
13,
85... | 2.383333 | 180 |
from unittest import TestCase
import os
import shutil
from foster.build import Build
from foster.test import Test
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
198,
6738,
17016,
13,
11249,
1330,
10934,
198,
6738,
17016,
13,
9288,
1330,
6208,
628
] | 3.866667 | 30 |
fname = input('Please enter a valid file name: ')
try:
fhand = open(fname)
except:
print('Please enter an existing file name')
exit()
counts = dict()
for line in fhand:
line = line.rstrip()
words = line.split()
if not line.startswith('From ') or len(words) < 1: continue
for word in words:
... | [
69,
3672,
796,
5128,
10786,
5492,
3802,
257,
4938,
2393,
1438,
25,
705,
8,
198,
28311,
25,
198,
220,
220,
220,
277,
4993,
796,
1280,
7,
69,
3672,
8,
198,
16341,
25,
198,
220,
220,
220,
3601,
10786,
5492,
3802,
281,
4683,
2393,
143... | 2.508651 | 289 |
[
{
'date': '2011-01-01',
'description': 'Año Nuevo',
'locale': 'es-ES',
'notes': '',
'region': '',
'type': 'NF'
},
{
'date': '2011-01-06',
'description': 'Epifanía del Señor',
'locale': 'es-ES',
'notes': '',
'region': '... | [
58,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
4475,
10354,
705,
9804,
12,
486,
12,
486,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
11213,
10354,
705,
32,
31329,
399,
518,
13038,
3256,
198,
220,... | 1.705638 | 9,135 |
""" Plotting tools for the simulation framework
Styling tools:
* :py:class:`set_plot_style`: Plot style context manager
* :py:class:`colorwheel`: Custom color palettes
Plotting Functions:
* :py:func:`plot_3d_sphere_cloud`: Plot a sphere cloud in 3D
Axis element functions:
* :py:func:`add_lineplot`: Add lineplots ... | [
37811,
28114,
889,
4899,
329,
262,
18640,
9355,
198,
198,
18716,
1359,
4899,
25,
198,
198,
9,
1058,
9078,
25,
4871,
25,
63,
2617,
62,
29487,
62,
7635,
63,
25,
28114,
3918,
4732,
4706,
198,
9,
1058,
9078,
25,
4871,
25,
63,
8043,
22... | 2.069295 | 12,454 |
import sys
import logging
if sys.version_info < (3, 0):
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append("../xmpp_bot")
logging.basicConfig(level=logging.DEBUG)
server = 'localhost'
port = 5222
from xmpp_bot.controllers.copernicus import DashboardController
if __name__ == '__main__':
if len(... | [
11748,
25064,
198,
11748,
18931,
198,
198,
361,
25064,
13,
9641,
62,
10951,
1279,
357,
18,
11,
657,
2599,
198,
220,
220,
220,
18126,
7,
17597,
8,
198,
220,
220,
220,
25064,
13,
2617,
12286,
12685,
7656,
10786,
40477,
23,
11537,
198,
... | 2.090129 | 466 |
import logging
from amitools.vamos.profiler import MainProfiler, Profiler
from amitools.vamos.cfgcore import ConfigDict
| [
11748,
18931,
198,
6738,
716,
270,
10141,
13,
85,
321,
418,
13,
5577,
5329,
1330,
8774,
15404,
5329,
11,
4415,
5329,
198,
6738,
716,
270,
10141,
13,
85,
321,
418,
13,
37581,
7295,
1330,
17056,
35,
713,
628,
628,
628,
628,
198
] | 3.047619 | 42 |
N = int(input())
i = 1
distance = 1
road = 1
while road < N:
road += i * 6
i += 1
print(i) | [
45,
796,
493,
7,
15414,
28955,
198,
72,
796,
352,
198,
30246,
796,
352,
198,
6344,
796,
352,
198,
4514,
2975,
1279,
399,
25,
198,
220,
220,
220,
2975,
15853,
1312,
1635,
718,
198,
220,
220,
220,
1312,
15853,
352,
198,
4798,
7,
72,... | 2.177778 | 45 |
#!/bin/bash/env python3
import os, sys
# sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
from .. import *
from ..model.minimal_model import pbc
# test cases of periodic boundary conditions on a random matrix
test = np.random.rand(111,111,3)
# trivial tests, do nothing/ slots agree
(pbc(test,1,2)==test... | [
2,
48443,
8800,
14,
41757,
14,
24330,
21015,
18,
198,
11748,
28686,
11,
25064,
198,
2,
25064,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
8019,
48774,
198,
6738... | 2.687956 | 548 |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Operations for working with string Tensors.
"""
from __future__ import print_function as _print_function
from tensorflow.python import as_string
from tensorflow.python import reduce_joi... | [
2,
770,
2393,
318,
337,
16219,
8881,
24700,
1137,
11617,
0,
2141,
407,
4370,
13,
198,
2,
2980,
515,
416,
25,
11192,
273,
11125,
14,
29412,
14,
31391,
14,
15042,
14,
8612,
1352,
14,
17953,
62,
29412,
62,
15042,
13,
9078,
4226,
13,
... | 3.309125 | 537 |
from .. import db
from .modelHelpers import (
findAll, findById, deleteById, findByName, formatId, assignId, updateDocument, formatDocuments,
)
from bson import ObjectId
| [
6738,
11485,
1330,
20613,
198,
6738,
764,
19849,
12621,
19276,
1330,
357,
198,
220,
220,
220,
1064,
3237,
11,
1064,
48364,
11,
12233,
48364,
11,
1064,
3886,
5376,
11,
5794,
7390,
11,
8333,
7390,
11,
4296,
24941,
11,
5794,
38354,
11,
1... | 3.296296 | 54 |
import pytest
from test_helper import get_test_data
from texthandler import CommentClassifier
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
6738,
1332,
62,
2978,
525,
1330,
651,
62,
9288,
62,
7890,
198,
198,
6738,
48659,
400,
392,
1754,
1330,
18957,
9487,
7483,
198,
198,
31,
9078,
9288,
13,
69,
9602,
198,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 3 | 43 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.11.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x04\x3a\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x20\x... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
20857,
2134,
2438,
198,
2,
198,
2,
15622,
416,
25,
383,
20857,
3082,
5329,
329,
9485,
48,
83,
20,
357,
48,
83,
410,
20,
13,
1157,
13,
17,
8,
198,
2,
198,... | 1.23592 | 58,787 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals, division, print_function
import os
import tempfile
from pymatgen.util.testing import PymatgenTest
from pymatgen.io.abinit.abiinspect import *
_test_dir = os.path.join(... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
350,
4948,
265,
5235,
7712,
4816,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
17168,
13789,
13,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
... | 2.616949 | 295 |
# -*- coding: utf-8 -*-
#Provide function logic for UI
from UI import Ui_MainWindow
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import configparser
import os
from nlp import *
#初始化options.ini(如果不存在就创建)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
2,
15946,
485,
2163,
9156,
329,
12454,
201,
198,
201,
198,
6738,
12454,
1330,
471,
72,
62,
13383,
27703,
201,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,... | 1.912409 | 137 |
import torch.utils.data as data
import cv2
import numpy as np
import math
from lib.utils import data_utils
from pycocotools.coco import COCO
import os
from lib.utils.tless import tless_utils, visualize_utils, tless_config
from PIL import Image
import glob
| [
11748,
28034,
13,
26791,
13,
7890,
355,
1366,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
9195,
13,
26791,
1330,
1366,
62,
26791,
198,
6738,
12972,
66,
420,
313,
10141,
13,
66,
25634,
133... | 3.185185 | 81 |
import numpy as np
class BinaryHigherOrderModel:
"""Higher order model.
"""
def adj_dict(self):
"""adjacency list of each variables
Returns:
dict: key (variables key), value (list of tuple represents connected indices)
"""
adj_dict = {i: [] for i in self.indic... | [
11748,
299,
32152,
355,
45941,
628,
198,
4871,
45755,
48708,
18743,
17633,
25,
198,
220,
220,
220,
37227,
48708,
1502,
2746,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
9224,
62,
11600,
7,
944,
2599,
198,
220,
220,
220,
... | 2.031165 | 738 |
import logging
from django.core.mail import send_mail
from django.core.management.base import BaseCommand, CommandError
from metashare.edelivery.wsdl_services import download_messages
from metashare.settings import LOG_HANDLER, CONTRIBUTIONS_ALERT_EMAILS
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(LOG_HAND... | [
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
1330,
3758,
62,
4529,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
6738,
1138,
1077,
533,
13,
276,
417,
6315,
13,
1850... | 3.165049 | 103 |
#!/usr/bin/env python
import sys
import argparse
import subprocess
from collections import defaultdict as dd
size_multipliers = {'M':1, 'G':1024, 'T':1024**2}
core_node_keys = {'c':'ReqCPUS', 'n':'ReqNodes'}
avail_sort = ['Jobs', 'Nodes', 'CPUs', 'GPUs', 'RAM']
avail_levels = ['User', 'Account', 'State', 'Partition']
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
6738,
17268,
1330,
4277,
11600,
355,
49427,
198,
198,
7857,
62,
47945,
3183,
796,
1391,
6,
44,
10354,
16,
11,
705,
3... | 2.526749 | 243 |
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, fields, models
from odoo.exceptions import ValidationError
from odoo.tools import float_compare
| [
2,
15069,
12131,
48257,
32353,
12151,
532,
34705,
78,
1665,
73,
18082,
198,
2,
13789,
13077,
6489,
12,
18,
13,
15,
393,
1568,
357,
5450,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
363,
489,
737,
198,
198,
6738,
16298,
2238,... | 3.123288 | 73 |
import json
from office365.graph.directory.directoryObject import DirectoryObject
from office365.graph.directory.directoryObjectCollection import DirectoryObjectCollection
from office365.graph.onedrive.driveCollection import DriveCollection
from office365.graph.onedrive.siteCollection import SiteCollection
from office... | [
11748,
33918,
198,
198,
6738,
2607,
24760,
13,
34960,
13,
34945,
13,
34945,
10267,
1330,
27387,
10267,
198,
6738,
2607,
24760,
13,
34960,
13,
34945,
13,
34945,
10267,
36307,
1330,
27387,
10267,
36307,
198,
6738,
2607,
24760,
13,
34960,
13... | 2.669033 | 1,127 |
import sys
import yacc
from cool_lexer import CoolLexer, tokens
from ast import *
#precedence of terminals listed in ascending order
#first string of each tuple shows left, right, or non associativity
precedence = (
('right', 'larrow'),
('nonassoc', 'not'),
('nonassoc', 'lt', 'le', 'equals'),
('left', ... | [
11748,
25064,
198,
11748,
331,
4134,
198,
6738,
3608,
62,
2588,
263,
1330,
15226,
45117,
263,
11,
16326,
198,
6738,
6468,
1330,
1635,
198,
198,
2,
3866,
771,
594,
286,
30237,
5610,
287,
41988,
1502,
198,
2,
11085,
4731,
286,
1123,
465... | 1.964924 | 4,590 |
#!/home/ubuntu/anaconda3/bin//python
'''
MIT License
Copyright (c) 2018 Riya Dulepet <riyadulepet123@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 with... | [
2,
48443,
11195,
14,
32230,
14,
272,
330,
13533,
18,
14,
8800,
1003,
29412,
198,
7061,
6,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
2864,
371,
21008,
360,
2261,
6449,
1279,
380,
88,
324,
2261,
6449,
10163,
31,
14816,
13,
785,
... | 2.55384 | 2,591 |
from unittest import TestCase
from ..functions import permutationtest
import numpy as np
import pandas as pd
import permutation_test.csv_parser as csv_parser
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
11485,
12543,
2733,
1330,
9943,
7094,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
9943,
7094,
62,
9288,
13,
40664,
62,
48610,
355,
269,
... | 2.661765 | 68 |
import os
import datetime
import numpy as np
import pandas as pd
class RelionMetaData:
"""RELION metadata handling class.
Parameters
----------
df_particles : pandas.DataFrame
DataFrame containing particle data block contents.
df_optics : pandas.DataFrame, optional
DataFrame con... | [
11748,
28686,
198,
11748,
4818,
8079,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
4871,
4718,
295,
48526,
6601,
25,
198,
220,
220,
220,
37227,
16448,
2849,
20150,
9041,
1398,
13,
628,
220,
... | 2.001307 | 3,060 |
import logging
from collections import UserDict
from pajbot.managers.redis import RedisManager
from pajbot.streamhelper import StreamHelper
log = logging.getLogger(__name__)
| [
11748,
18931,
198,
6738,
17268,
1330,
11787,
35,
713,
198,
198,
6738,
279,
1228,
13645,
13,
805,
10321,
13,
445,
271,
1330,
2297,
271,
13511,
198,
6738,
279,
1228,
13645,
13,
5532,
2978,
525,
1330,
13860,
47429,
198,
198,
6404,
796,
1... | 3.358491 | 53 |
#!/usr/bin/python3
from google.cloud import bigquery
from google.cloud import storage
import flask
from flask import request, jsonify, abort
import json
#for ML
import tensorflow as tf
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import PyPDF... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
6738,
23645,
13,
17721,
1330,
1263,
22766,
198,
6738,
23645,
13,
17721,
1330,
6143,
198,
11748,
42903,
198,
6738,
42903,
1330,
2581,
11,
33918,
1958,
11,
15614,
198,
11748,
33918,
628,
198,... | 2.848866 | 397 |
# -*- coding: utf-8 -*-
"""
合并区间问题:
输入:
3
1,10;32,45
78,94;5,16
80,100;200,220;16,32
输出:
1,45;78,100;200,220
Created on Sun Aug 12 09:58:08 2018
"""
from __future__ import absolute_import
from __future__ import print_function
class Solution(object):
'''
def merge(self, parts):
n = len(parts)
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
28938,
230,
33176,
114,
44293,
118,
29785,
112,
29785,
106,
165,
95,
246,
171,
120,
248,
198,
164,
122,
241,
17739,
98,
171,
120,
248,
198,
18,
198,
16,
... | 1.46164 | 756 |
import crashstatsutils
import jydoop
import json
from org.python.core.util import StringUtil
setupjob = crashstatsutils.dosetupjob([])
output = jydoop.outputWithKey
| [
11748,
7014,
34242,
26791,
198,
11748,
474,
88,
4598,
404,
198,
11748,
33918,
198,
6738,
8745,
13,
29412,
13,
7295,
13,
22602,
1330,
10903,
18274,
346,
198,
198,
40406,
21858,
796,
7014,
34242,
26791,
13,
37427,
316,
929,
21858,
26933,
... | 3.092593 | 54 |