content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from bs4 import BeautifulSoup
import requests
import nltk
from nltk import sent_tokenize
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.probability import FreqDist
from collections import Counter
from nltk import Tree
import re
'''
url = 'https://www.lifewire.com/how-to-edit-videos-... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
11748,
299,
2528,
74,
198,
6738,
299,
2528,
74,
1330,
1908,
62,
30001,
1096,
198,
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
1573,
62,
30001,
1096,
198,
6738,
299,
2... | 2.078086 | 1,191 |
import pytest
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 2.5 | 20 |
# Getting all the elements in a list — a better way, using a "for" loop
shopping_list = ["Tomatoes", "Bananas", "Crackers",
"Sugar", "Icecream", "Bread", "Bananas", "Chocolate"]
print("Shopping list:")
for item in shopping_list:
print(item)
| [
198,
2,
18067,
477,
262,
4847,
287,
257,
1351,
851,
257,
1365,
835,
11,
1262,
257,
366,
1640,
1,
9052,
198,
198,
1477,
33307,
62,
4868,
796,
14631,
13787,
15048,
1600,
366,
30457,
15991,
1600,
366,
13916,
28874,
1600,
198,
220,
220,
... | 2.582524 | 103 |
#
# PySNMP MIB module A3COM-SWITCHING-SYSTEMS-POLL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-SWITCHING-SYSTEMS-POLL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:08:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Pyt... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
317,
18,
9858,
12,
17887,
31949,
2751,
12,
23060,
25361,
50,
12,
16402,
3069,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
... | 3.317594 | 6,883 |
# -- coding: utf-8 --
import argparse
if __name__=='__main__':
para=parameter(argparse.ArgumentParser())
print(para.get_para().batch_size) | [
2,
1377,
19617,
25,
3384,
69,
12,
23,
1377,
198,
11748,
1822,
29572,
198,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
198,
220,
220,
220,
31215,
28,
17143,
2357,
7,
853,
29572,
13,
28100,
1713,
46677,
28955,
628,
220... | 2.508475 | 59 |
from typing import List, Literal, Union
from botoy import FriendMsg, GroupMsg
from pydantic import BaseModel, Field
| [
6738,
19720,
1330,
7343,
11,
25659,
1691,
11,
4479,
198,
198,
6738,
10214,
726,
1330,
9182,
50108,
11,
4912,
50108,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
7663,
628
] | 3.806452 | 31 |
import numpy as np
from tensorflow.keras.utils import Sequence, to_categorical
import random
from tqdm import tqdm
from transforms import jitter, time_warp, rotation, rand_sampling
from transforms import get_ENMO, get_angle_z, get_LIDS
from collections import Counter
| [
11748,
299,
32152,
355,
45941,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
26791,
1330,
45835,
11,
284,
62,
66,
2397,
12409,
198,
11748,
4738,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
31408,
1330,
474,
1967,
11... | 3.435897 | 78 |
# -*- coding: utf-8 -*-
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Send swarming-proxy latency monitoring data to ts_mon."""
from __future__ import absolute_import
from __future__ import print_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2177,
383,
18255,
1505,
7294,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
46... | 3.371041 | 221 |
import logging
logger = logging.getLogger(__name__)
NAME = 'Common Components'
INSTALL = ('AccountsSite',)
__version__ = '3.5.5'
logger.debug('"%s"/"%s"' % (NAME, __version__))
| [
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
20608,
796,
705,
17227,
36109,
6,
198,
38604,
7036,
796,
19203,
30116,
82,
29123,
3256,
8,
198,
198,
834,
9641,
834,
796,
705,
18... | 2.513889 | 72 |
import numpy as np
import matplotlib.pyplot as plt
INTERVAL = 30
WINDOW = 5
data_gamma = read_avg_speed('statistics.gamma.log')
data_simple = read_avg_speed('statistics.ttc.log')
fig, axs = plt.subplots(figsize=(17.5, 8))
axs.set_xlabel('Simulation Time (s)', fontsize=34)
axs.set_ylabel('Average Speed (m/s)', fontsi... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
41358,
23428,
796,
1542,
198,
28929,
3913,
796,
642,
198,
198,
7890,
62,
28483,
2611,
796,
1100,
62,
615,
70,
62,
12287,
10786,
142... | 1.89451 | 929 |
"""joblib parallel backend for IPython Parallel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import
import ipyparallel as ipp
from joblib.parallel import ParallelBackendBase, AutoBatchingMixin
| [
37811,
21858,
8019,
10730,
30203,
329,
6101,
7535,
42945,
37811,
198,
2,
15069,
357,
66,
8,
6101,
7535,
7712,
4816,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
198,
6738,
11593,
37443,
834,
133... | 3.84 | 75 |
from celery import Task
from video_streaming.core.tasks import BaseTask
from video_streaming.ffmpeg.tasks.base import BaseStreamingTask
from .check import BaseCheckMixin
| [
6738,
18725,
1924,
1330,
15941,
198,
6738,
2008,
62,
5532,
278,
13,
7295,
13,
83,
6791,
1330,
7308,
25714,
198,
6738,
2008,
62,
5532,
278,
13,
487,
43913,
13,
83,
6791,
13,
8692,
1330,
7308,
12124,
278,
25714,
198,
6738,
764,
9122,
... | 3.5625 | 48 |
keyboard.send_keys("<shift>+<alt>+<left>") | [
2539,
3526,
13,
21280,
62,
13083,
7203,
27,
30846,
29,
10,
27,
2501,
29,
10,
27,
9464,
29,
4943
] | 2.210526 | 19 |
from ggplot import *
import pandas as pd
df = pd.DataFrame({'a': range(0,3), 'b': range(1,4)})
df['x'] = df.index
df = pd.melt(df, id_vars='x')
print df
print ggplot(aes(x='x', y='value', color='variable'), df) + geom_line() + geom_point()
| [
6738,
308,
70,
29487,
1330,
1635,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
7568,
796,
279,
67,
13,
6601,
19778,
15090,
6,
64,
10354,
2837,
7,
15,
11,
18,
828,
705,
65,
10354,
2837,
7,
16,
11,
19,
8,
30072,
198,
7568,
1781... | 2.220183 | 109 |
import requests
from templates.text import TextTemplate
from random import choice
import json
import config
| [
11748,
7007,
198,
6738,
24019,
13,
5239,
1330,
8255,
30800,
198,
6738,
4738,
1330,
3572,
198,
11748,
33918,
198,
11748,
4566,
198
] | 4.909091 | 22 |
import pandas as pd
import numpy as np
import xarray as xr
import sys
import os
from glob import glob
import re
from datetime import datetime
import tempfile
import shutil
from .gw import set_gw_depth
HP1_DIR=os.path.join(os.getcwd(),'HP1')
HP1_EXE=os.path.join(HP1_DIR,'hp1.exe')
DEFAULT_OUTPUTS={
... | [
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2124,
18747,
355,
2124,
81,
201,
198,
11748,
25064,
201,
198,
11748,
28686,
201,
198,
6738,
15095,
1330,
15095,
201,
198,
11748,
302,
201,
198,
... | 1.579368 | 2,501 |
# Copyright 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
2,
15069,
1853,
4946,
25896,
5693,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
26... | 2.410742 | 633 |
import os
import shutil
import git
import copy
import sys
import subprocess
import glob
import json
from ismo.ensemble import ChangeFolder
from ismo.submit import get_current_repository
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
17606,
198,
11748,
4866,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
11748,
15095,
198,
11748,
33918,
198,
6738,
318,
5908,
13,
1072,
11306,
1330,
9794,
41092,
198,
6738,
318,
5908,
13,... | 3.622642 | 53 |
# @title Modint
from typing import Union
class modint:
"""Modint
Not so fast.
"""
__slots__ = ("v",)
mod: int = 0
def using_modint(modulo: int):
"""using modint
set modulo to modint class
Parameters
----------
modulo
Returns
-------
modint class mod = modu... | [
2,
2488,
7839,
3401,
600,
198,
6738,
19720,
1330,
4479,
628,
198,
4871,
953,
600,
25,
198,
220,
220,
220,
37227,
5841,
600,
198,
220,
220,
220,
1892,
523,
3049,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
11593,
6649,
1747,
... | 2.463277 | 177 |
from validate_version_code import validate_version_code
from random_dict.__version__ import __version__ | [
6738,
26571,
62,
9641,
62,
8189,
1330,
26571,
62,
9641,
62,
8189,
198,
6738,
4738,
62,
11600,
13,
834,
9641,
834,
1330,
11593,
9641,
834
] | 4.12 | 25 |
import numpy as np
import time
#
# OK, thats simple
#
#
# Kind of goal seek:
# Find x where interpolator(x) first meets (and firstly equals)
# the given density y.
#
# Find the in-fact zone for the given density
# and return the numeric difference to given zone
# as *ne... | [
11748,
299,
32152,
355,
45941,
198,
11748,
640,
628,
198,
220,
220,
220,
1303,
198,
220,
220,
220,
1303,
7477,
11,
29294,
2829,
198,
220,
220,
220,
1303,
628,
198,
220,
220,
220,
1303,
198,
220,
220,
220,
1303,
14927,
286,
3061,
538... | 2.787671 | 146 |
from django.test import TestCase, Client
from binder.json import jsonloads
from django.contrib.auth.models import User
from ..testapp.models import Zoo, Caretaker, Gate
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
11,
20985,
198,
198,
6738,
275,
5540,
13,
17752,
1330,
33918,
46030,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
198,
6738,
11485,
9288,
1324,
13,
2753... | 3.46 | 50 |
'Hint: Page Source'
#https://github.com/Vinay26k/pythonchallenge
import requests
url = r'http://www.pythonchallenge.com/pc/def/equality.html'
r = requests.get(url).text
import re
print(''.join((re.findall("[^A-Z]+[A-Z]{3}([a-z])[A-Z]{3}[^A-Z]+",r))))
| [
201,
198,
6,
39,
600,
25,
7873,
8090,
6,
201,
198,
2,
5450,
1378,
12567,
13,
785,
14,
53,
259,
323,
2075,
74,
14,
29412,
36747,
3540,
201,
198,
11748,
7007,
201,
198,
201,
198,
6371,
796,
374,
6,
4023,
1378,
2503,
13,
29412,
367... | 2.129032 | 124 |
from .QiskitEducation import *
from .__version__ import *
| [
6738,
764,
48,
1984,
270,
41183,
1330,
1635,
198,
6738,
764,
834,
9641,
834,
1330,
1635,
198
] | 3.411765 | 17 |
import os
import re
import setuptools
from pkg_resources import parse_requirements
from setuptools import find_packages
base_path = os.path.dirname(__file__)
with open(os.path.join(base_path, 'README.md')) as readme:
README = readme.read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.par... | [
11748,
28686,
198,
11748,
302,
198,
198,
11748,
900,
37623,
10141,
198,
6738,
279,
10025,
62,
37540,
1330,
21136,
62,
8897,
18883,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
198,
198,
8692,
62,
6978,
796,
28686,
13,
6978,
13,
... | 2.653012 | 415 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
if __name__ == "__main__":
mac = os.getenv('TIVIBG_MAC', False)
if not mac:
sys.exit('TIVIBG_MAC is not set\nTIVIBG_MAC=aa:bb:cc:dd:ee:ff %s' % (sys.argv[0]))
import server
server.log_cb = __log
server.my_serv = server.serv(host=os.uname()[1... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
8352,
796,
... | 2.177914 | 163 |
#!/usr/bin/env python
import requests, json, random, string, time, sys
try:
response_time_threshold = int(sys.argv[1])
except IndexError:
response_time_threshold = 500 #default value of response_time_threshold
url = "http://tvpapi.as.tvinci.com/v3_4/gateways/jsonpostgw.aspx"
querystring = {"m":"SearchAsset... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
7007,
11,
33918,
11,
4738,
11,
4731,
11,
640,
11,
25064,
198,
198,
28311,
25,
198,
220,
220,
220,
2882,
62,
2435,
62,
400,
10126,
796,
493,
7,
17597,
13,
853,
85,
58,
... | 2.438 | 1,000 |
__________________________________________________________________________________________________
sample 28 ms submission
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
_______________________________________________________________... | [
27193,
10221,
834,
198,
39873,
2579,
13845,
14498,
198,
2,
30396,
329,
1702,
306,
12,
25614,
1351,
13,
198,
2,
1398,
7343,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
22... | 4.248276 | 145 |
# pyright: reportOptionalMemberAccess=none
from store.constants import discordClientID, isUnix, processID
from typing import Any, Optional
from utils.logging import logger
import asyncio
import json
import models.discord
import os
import struct
import time
| [
2,
279,
4766,
25,
989,
30719,
27608,
15457,
28,
23108,
198,
198,
6738,
3650,
13,
9979,
1187,
1330,
36446,
11792,
2389,
11,
318,
47000,
11,
1429,
2389,
198,
6738,
19720,
1330,
4377,
11,
32233,
198,
6738,
3384,
4487,
13,
6404,
2667,
133... | 3.909091 | 66 |
import pytest
import floto.decisions
import floto.api
import json
| [
11748,
12972,
9288,
198,
11748,
781,
2069,
13,
12501,
3279,
198,
11748,
781,
2069,
13,
15042,
198,
198,
11748,
33918,
628,
198
] | 3.136364 | 22 |
#!/usr/bin/python
import urllib.request
import json
import os
import itertools
import re
API_KEY="" # TODO: get from console.google.com
VIDSBASE='{}/Videos/YouTubes/'.format(os.path.expanduser("~")) # TODO: set where all vids will be saved
channels=[
"UC7SeFWZYFmsm1tqWxfuOTPQ", # dankula
"UCwW_vaMPlq8J4weKDs... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
340,
861,
10141,
198,
11748,
302,
198,
198,
17614,
62,
20373,
33151,
1303,
16926,
46,
25,
651,
422,
86... | 2.723368 | 582 |
import numpy as np
import pytest
import warnings
from numpy.testing import assert_array_equal
from xeofs.models._array_transformer import _ArrayTransformer
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
@pytest.mark.parametr... | [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
14601,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
18747,
62,
40496,
198,
6738,
2124,
68,
1659,
82,
13,
27530,
13557,
18747,
62,
7645,
16354,
1330,
4808,
19182,
8... | 2.279133 | 369 |
from deepend.layers import * | [
6738,
390,
2690,
13,
75,
6962,
1330,
1635
] | 3.5 | 8 |
total_checker_all([0, 1, 2, 2, 3, 4], 4)
| [
198,
23350,
62,
9122,
263,
62,
439,
26933,
15,
11,
352,
11,
362,
11,
362,
11,
513,
11,
604,
4357,
604,
8,
628,
628
] | 1.875 | 24 |
# Copyright 2019 Catalyst Cloud Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
15069,
13130,
48238,
10130,
12052,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.349794 | 243 |
import numpy as np
import os
import torch
import torch.nn as nn
import torchvision
import torch.utils.data as Data
import torchvision.datasets as dates
from torch.autograd import Variable
from torch.nn import functional as F
import utils.transforms as trans
import utils.utils as util
import layer.loss as ls
import util... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
10178,
198,
11748,
28034,
13,
26791,
13,
7890,
355,
6060,
198,
11748,
28034,
10178,
13,
19608,
292,
1039,
... | 2.924138 | 290 |
import asyncio
import logging
from slack_sdk.web.async_client import AsyncSlackResponse, AsyncWebClient
from slack_bolt.async_app import AsyncApp, AsyncAck
from slack_bolt.workflows.step.async_step import (
AsyncConfigure,
AsyncUpdate,
AsyncComplete,
AsyncFail,
AsyncWorkflowStep,
)
logging.basicCo... | [
11748,
30351,
952,
198,
11748,
18931,
198,
198,
6738,
30740,
62,
21282,
74,
13,
12384,
13,
292,
13361,
62,
16366,
1330,
1081,
13361,
11122,
441,
31077,
11,
1081,
13361,
13908,
11792,
198,
6738,
30740,
62,
25593,
13,
292,
13361,
62,
1324... | 2.602374 | 337 |
import re
import io
import base64
# import numpy as np
import tokenize
# from PIL import Image
# Code manipulation
magic_var_name = "__run_py__"
'''
Reference:
https://stackoverflow.com/questions/1769332/script-to-remove-python-comments-docstrings
'''
#Getting test comment lines
# Image Processing
# Convert PIL.... | [
11748,
302,
198,
11748,
33245,
198,
11748,
2779,
2414,
198,
2,
1330,
299,
32152,
355,
45941,
198,
11748,
11241,
1096,
198,
2,
422,
350,
4146,
1330,
7412,
198,
198,
2,
6127,
17512,
198,
198,
32707,
62,
7785,
62,
3672,
796,
366,
834,
... | 3.068702 | 131 |
#!/usr/bin/env python
# coding=utf-8
"""
# pyORM : Implementation of DummyEngine
Summary :
<summary of module/class being implemented>
Use Case :
As a <actor> I want <outcome> So that <justification>
Testable Statements :
Can I <Boolean statement>
....
"""
from unittest.mock import MagicMock
from p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
2,
12972,
1581,
44,
1058,
46333,
286,
360,
13513,
13798,
198,
198,
22093,
1058,
220,
198,
220,
220,
220,
1279,
49736,
286,
8265,
14,
487... | 3.003584 | 279 |
from axes.models import AccessAttempt
from wagtail.contrib.modeladmin.options import (ModelAdmin, modeladmin_register)
from wagtail.core import hooks
from wagtail.admin import widgets as wagtailadmin_widgets
from .models.nav import Menu, Footer
from contentPages.models import HomePage, CreateNewResourceType
from .mod... | [
6738,
34197,
13,
27530,
1330,
8798,
37177,
198,
198,
6738,
266,
363,
13199,
13,
3642,
822,
13,
19849,
28482,
13,
25811,
1330,
357,
17633,
46787,
11,
2746,
28482,
62,
30238,
8,
198,
6738,
266,
363,
13199,
13,
7295,
1330,
26569,
198,
67... | 3.319149 | 282 |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import concurrent.futures
import json
import os
import subprocess
from t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
30277,
19193,
82,
11,
3457,
13,
290,
29116,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
347,
10305,
12,
76... | 3.337931 | 145 |
#!/usr/bin/python3
from ReadData import read_train, read_test
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.pipeline import FeatureUnion
from sklearn.compose import ColumnTransformer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.preprocessing import FunctionTransform... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
4149,
6601,
1330,
1100,
62,
27432,
11,
1100,
62,
9288,
198,
198,
6738,
1341,
35720,
13,
8692,
1330,
7308,
22362,
320,
1352,
11,
3602,
16354,
35608,
259,
198,
6738,
1341,
35720,... | 3.007553 | 662 |
import json
import os
import fcntl
import sys
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
277,
66,
429,
75,
198,
11748,
25064,
628
] | 3.133333 | 15 |
import random
if __name__ == "__main__":
arr = []
for i in range(10):
arr.append(random.randint(-20, 20))
print(arr)
MergeSort.mergeSort(arr)
print(arr)
| [
11748,
4738,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
5240,... | 1.883929 | 112 |
import os
from downloadutil.util import BUFFER_SIZE_BYTES
from typing import Any
import re
import hashlib
SHA256_CHECKSUM_RE = re.compile(r'^[0-9a-f]{64}$')
SHA256_CHECKSUM_FILE_SUFFIX = '.sha256'
def validate_sha256sum(checksum_str: str) -> None:
"""
Validtes the given SHA256 checksum. Raises an exception... | [
11748,
28686,
198,
6738,
4321,
22602,
13,
22602,
1330,
20571,
45746,
62,
33489,
62,
17513,
51,
1546,
198,
6738,
19720,
1330,
4377,
198,
198,
11748,
302,
198,
11748,
12234,
8019,
628,
198,
37596,
11645,
62,
50084,
50,
5883,
62,
2200,
796... | 2.577465 | 355 |
from collections import defaultdict
from queue import Queue, Empty
from threading import Thread
test_input = [line.split() for line in """
set a 1
add a 2
mul a a
mod a 5
snd a
set a 0
rcv a
jgz a -1
set a 1
jgz a -2
""".strip().splitlines()]
test_input2 = [line.split() for line in """
snd 1
snd 2
snd p
rcv a
rcv b
r... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
16834,
1330,
4670,
518,
11,
33523,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
9288,
62,
15414,
796,
685,
1370,
13,
35312,
3419,
329,
1627,
287,
37227,
198,
2617,
257,
352,
198,
2860,
257,
3... | 2.559322 | 236 |
#TODO
#def addPhysObjBox(id, x, y, w, h, d, r, f): pass
#def addCirc(id, x, y, r, d, r, f): pass
#def addTri(id, x1, y1, x2, y2, x3, y3): pass
#def addDJoint(id, b1_id, b2_id, x1, y1, x2, y2, dist, freq): pass
# DEATH/REMOVAL
# TODO
# def rm_Object(id): pass
# def rm_Joint(id): pass
# world shit
"""
all of the ... | [
198,
198,
2,
51,
3727,
46,
198,
2,
4299,
751,
43215,
49201,
14253,
7,
312,
11,
2124,
11,
331,
11,
266,
11,
289,
11,
288,
11,
374,
11,
277,
2599,
1208,
198,
2,
4299,
751,
31560,
7,
312,
11,
2124,
11,
331,
11,
374,
11,
288,
11... | 2.898917 | 277 |
import json
import logging
import asyncio
import random
import socket
from hbmqtt.client import MQTTClient, ClientException
from hbmqtt.mqtt.constants import QOS_1
logging.basicConfig(format='%(asctime)s - %(name)14s - '
'%(levelname)5s - %(message)s')
logger = logging.getLogger("mqtt_test_... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
30351,
952,
198,
11748,
4738,
198,
11748,
17802,
198,
198,
6738,
289,
20475,
80,
926,
13,
16366,
1330,
337,
48,
15751,
11792,
11,
20985,
16922,
198,
6738,
289,
20475,
80,
926,
13,
76,
80,
9... | 1.828448 | 2,320 |
import pyarrow.parquet as pq
import pandas as pd
import json
from typing import List, Callable, Iterator, Union, Optional
from sportsdataverse.config import MBB_BASE_URL, MBB_TEAM_BOX_URL, MBB_PLAYER_BOX_URL, MBB_TEAM_SCHEDULE_URL
from sportsdataverse.errors import SeasonNotFoundError
from sportsdataverse.dl_utils impo... | [
11748,
12972,
6018,
13,
1845,
21108,
355,
279,
80,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
33918,
198,
6738,
19720,
1330,
7343,
11,
4889,
540,
11,
40806,
1352,
11,
4479,
11,
32233,
198,
6738,
5701,
7890,
4399,
13,
11250,
133... | 2.55107 | 1,635 |
import json
import socket
# UDP IP address and port
UDP_IP = "127.0.0.1"
UDP_PORT = 5005
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
# Import functions
from mycode import abc, double_int, say_hello, rpc_test, doggo_test, favorite_number, half_float, bye_professor
... | [
11748,
33918,
198,
11748,
17802,
198,
198,
2,
36428,
6101,
2209,
290,
2493,
198,
52,
6322,
62,
4061,
796,
366,
16799,
13,
15,
13,
15,
13,
16,
1,
198,
52,
6322,
62,
15490,
796,
5323,
20,
628,
198,
198,
2,
4332,
262,
4077,
4936,
2... | 2.626238 | 404 |
import pytest
from prisma import Client
from prisma.errors import DataError
@pytest.mark.asyncio
async def test_filtering(client: Client) -> None:
"""Finding records by a a float value"""
async with client.batch_() as batcher:
for i in range(10):
batcher.types.create({'float_': i + 1})
... | [
11748,
12972,
9288,
198,
6738,
778,
38017,
1330,
20985,
198,
6738,
778,
38017,
13,
48277,
1330,
6060,
12331,
628,
198,
31,
9078,
9288,
13,
4102,
13,
292,
13361,
952,
198,
292,
13361,
825,
1332,
62,
10379,
20212,
7,
16366,
25,
20985,
8... | 1.896354 | 2,441 |
import os
import logging
import logging.config
import logger_formatter
import yaml
| [
11748,
28686,
198,
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
49706,
62,
687,
1436,
198,
11748,
331,
43695,
628,
198
] | 3.863636 | 22 |
#!/usr/bin/env python
import rospy
from turtlesim.msg import Pose
if __name__ == '__main__':
rospy.init_node('subscriber', anonymous=True)
rospy.Subscriber("pose", Pose, detekcija)
rospy.spin()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
686,
2777,
88,
198,
6738,
36288,
320,
13,
19662,
1330,
37557,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
686,
2777,
88,
13,
15003,
... | 2.447059 | 85 |
import json
import unittest
from nanoservice import *
from nanoservice import config
if __name__ == '__main__':
unittest.main()
| [
11748,
33918,
198,
11748,
555,
715,
395,
198,
198,
6738,
15709,
418,
712,
501,
1330,
1635,
198,
6738,
15709,
418,
712,
501,
1330,
4566,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
... | 2.833333 | 48 |
# Note this requires an internet connection
import os
import urllib.request
import sys
thepipelines = set()
theplugins = set()
thepipelines.add(sys.argv[1]+"/config.txt")
while (len(thepipelines) != 0):
configfile = open(thepipelines.pop(), 'r')
for line in configfile:
contents = line.strip().split(" ")
... | [
2,
5740,
428,
4433,
281,
5230,
4637,
198,
11748,
28686,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
25064,
198,
198,
1169,
79,
541,
20655,
796,
900,
3419,
198,
1169,
37390,
796,
900,
3419,
198,
1169,
79,
541,
20655,
13,
2860,
... | 2.460784 | 612 |
from authz.controller import apiv1 | [
6738,
6284,
89,
13,
36500,
1330,
2471,
452,
16
] | 3.777778 | 9 |
import shelve
blt = ["bacon", "lettuce", "tomato", "bread"]
beans_on_toast = ["beans", "bread"]
scrambled_eggs = ["eggs", "butter", "milk"]
soup = ["tin of soup"]
pasta = ["pasta", "cheese"]
with shelve.open("recipes") as recipes:
recipes["blt"] = blt
recipes["beans on toast"] = beans_on_toast
recipes["sc... | [
11748,
7497,
303,
198,
198,
2436,
83,
796,
14631,
65,
7807,
1600,
366,
15503,
7234,
1600,
366,
39532,
5549,
1600,
366,
29573,
8973,
198,
44749,
62,
261,
62,
1462,
459,
796,
14631,
44749,
1600,
366,
29573,
8973,
198,
1416,
859,
9342,
6... | 2.203125 | 384 |
import unittest
from user import User
from info import Info
if __name__ == '__main__':
unittest.main() | [
11748,
555,
715,
395,
198,
6738,
2836,
1330,
11787,
198,
6738,
7508,
1330,
14151,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
124... | 2.613636 | 44 |
import platform
from includes import *
from common import waitForIndex, arch_int_bits
| [
11748,
3859,
198,
6738,
3407,
1330,
1635,
198,
6738,
2219,
1330,
4043,
1890,
15732,
11,
3934,
62,
600,
62,
9895,
628
] | 4.142857 | 21 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Main entry. Setup the command line interface then run the main function."""
from logging import INFO, DEBUG
from sys import argv
import argparse
import botocore.exceptions
from . import __version__
import ez_repo.command as command
import ez_repo.error as error
imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
8774,
5726,
13,
31122,
262,
3141,
1627,
7071,
788,
1057,
262,
1388,
2163,
526,
15931,
198,
198,
6738,
18931... | 2.4139 | 1,295 |
__author__ = "Qianli Wang and Nazar Sopiha"
__copyright__ = "Copyright (c) 2019 qiaw99"
# https://github.com/qiaw99/WS2019-20/blob/master/LICENSE
from matplotlib import pyplot as plt
if __name__ == '__main__':
main()
| [
834,
9800,
834,
796,
366,
48,
666,
4528,
15233,
290,
12819,
283,
35643,
72,
3099,
1,
198,
834,
22163,
4766,
834,
796,
366,
15269,
357,
66,
8,
13130,
10662,
544,
86,
2079,
1,
198,
2,
3740,
1378,
12567,
13,
785,
14,
80,
544,
86,
2... | 2.5 | 88 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 Tomaz Muraus
#
# 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 requ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
12131,
4186,
1031,
337,
5330,
385,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
... | 2.969163 | 454 |
import unittest
import numpy as np
from keras.optimizers import Adam
from keras.utils import plot_model
from rl.policy import EpsGreedyQPolicy, LinearAnnealedPolicy, GreedyQPolicy
from rl.memory import SequentialMemory
import sys
sys.path.append('../src')
from iqn import IQNAgent
from network_architecture_distribution... | [
11748,
555,
715,
395,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
40085,
11341,
1330,
7244,
198,
6738,
41927,
292,
13,
26791,
1330,
7110,
62,
19849,
198,
6738,
374,
75,
13,
30586,
1330,
43427,
43887,
4716,
48,
36727,
... | 3.356643 | 143 |
import base64
import unittest
import pytest
from tag_bot.main import UpdateImageTags, assert_images_info_input, split_str_to_list
from tag_bot.yaml_parser import YamlParser
yaml = YamlParser()
if __name__ == "__main__":
unittest.main()
| [
11748,
2779,
2414,
198,
11748,
555,
715,
395,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
7621,
62,
13645,
13,
12417,
1330,
10133,
5159,
36142,
11,
6818,
62,
17566,
62,
10951,
62,
15414,
11,
6626,
62,
2536,
62,
1462,
62,
4868,
198,
... | 2.78022 | 91 |
TestFile = "hello.py"
import logging
from logging import debug, info, warning, basicConfig, INFO, DEBUG, WARNING
basicConfig(level = WARNING)
main(TestFile)
print("")
print("")
print("----------------")
print("Process complete")
print("----------------") | [
14402,
8979,
796,
366,
31373,
13,
9078,
1,
198,
11748,
18931,
198,
6738,
18931,
1330,
14257,
11,
7508,
11,
6509,
11,
4096,
16934,
11,
24890,
11,
16959,
11,
39410,
198,
35487,
16934,
7,
5715,
796,
39410,
8,
628,
628,
198,
12417,
7,
1... | 3.73913 | 69 |
# -*- coding: utf-8 -*-
import os.path
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.directives.code import container_wrapper
from .loader import JsonSchemaLoader
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
11748,
28686,
13,
6978,
198,
198,
6738,
2205,
26791,
1330,
13760,
198,
6738,
2205,
26791,
13,
79,
945,
364,
13,
81,
301,
1330,
34736,
198,
6738,
599,
20079,
87,
1... | 3.138462 | 65 |
import numpy as np
import torch
import random
import os
from pathlib import Path
from sklearn.model_selection import KFold
import sys
sys.path.append('..')
from dataset import get_segmentation, random_crop, SegItemListCustom
from config import *
trainFolders = [
'ARMS',
'AisazuNihaIrarenai',
'Akkera... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
220,
198,
11748,
4738,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
509,
37,
727,
198,
198,
11748,
25064,
220,
198,
17597,
1... | 2.264741 | 831 |
from django.shortcuts import render, redirect, get_object_or_404, Http404
from django.utils.translation import gettext_lazy as _
from django.contrib import messages
from django.conf import settings
from django.contrib.sitemaps import Sitemap
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.ge... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
11,
651,
62,
15252,
62,
273,
62,
26429,
11,
367,
29281,
26429,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
42625,
14... | 3.198251 | 343 |
from flask import Flask, jsonify, request, send_from_directory
from tinydb import TinyDB, Query
from werkzeug.utils import secure_filename
import socketio
import eventlet
import os
UPLOADED_IMAGES = 'uploaded_images'
app = Flask(__name__)
sio = socketio.Server()
db = TinyDB('db.json')
items = db.table('items')
@... | [
6738,
42903,
1330,
46947,
11,
33918,
1958,
11,
2581,
11,
3758,
62,
6738,
62,
34945,
198,
6738,
7009,
9945,
1330,
20443,
11012,
11,
43301,
198,
6738,
266,
9587,
2736,
1018,
13,
26791,
1330,
5713,
62,
34345,
198,
11748,
17802,
952,
198,
... | 2.467914 | 374 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This app provides a basic stress test suite for the birdie app with locust.io library.
"""
__version__ = "0.1"
#from birdie-stress import xxx | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
220,
198,
37811,
198,
220,
220,
220,
770,
598,
3769,
257,
4096,
5503,
1332,
18389,
329,
262,
6512,
494,
598,
351,
117... | 2.54321 | 81 |
from io import StringIO
import ZConfig
import logging
import logging.handlers
import pkg_resources
import pytest
@pytest.fixture(autouse=True)
def logger(request):
"""Logger for tests."""
request.addfinalizer(reset_handler)
def load_config(config):
"""Help to load config."""
schema = ZConfig.loadSch... | [
6738,
33245,
1330,
10903,
9399,
198,
11748,
1168,
16934,
198,
11748,
18931,
198,
11748,
18931,
13,
4993,
8116,
198,
11748,
279,
10025,
62,
37540,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
2306,
1076,
28,
17821,... | 2.72 | 500 |
#!/usr/bin/python
# ~/dev/py/xlreg_py/makeTestData
""" Make data for test scripts. """
import os
import subprocess
import sys
import time
from Crypto.Cipher import AES
from xlutil import DecimalVersion as dv
from xlReg import reg_cred
import rnglib
OPENSSL = '/usr/bin/openssl'
SSH_KEYGEN = '/usr/bin/ssh-keygen'
KEY_... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
47795,
7959,
14,
9078,
14,
87,
75,
2301,
62,
9078,
14,
15883,
14402,
6601,
198,
198,
37811,
6889,
1366,
329,
1332,
14750,
13,
37227,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
... | 2.38695 | 3,295 |
# stdlib
import webbrowser
from typing import Tuple
# 3rd party
import pytest
from coincidence.regressions import AdvancedFileRegressionFixture
from consolekit.testing import CliRunner, Result
from domdf_python_tools.iterative import permutations
from domdf_python_tools.paths import PathPlus
# this package
from footb... | [
2,
14367,
8019,
198,
11748,
3992,
40259,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
2,
513,
4372,
2151,
198,
11748,
12972,
9288,
198,
6738,
21083,
13,
2301,
601,
507,
1330,
13435,
8979,
8081,
2234,
37,
9602,
198,
6738,
8624,
15813,
... | 2.114674 | 1,029 |
import unittest
from mock import MagicMock
from hazelcast.proxy.cp.atomic_long import AtomicLong
| [
11748,
555,
715,
395,
198,
198,
6738,
15290,
1330,
6139,
44,
735,
198,
198,
6738,
11595,
417,
2701,
13,
36436,
13,
13155,
13,
47116,
62,
6511,
1330,
28976,
14617,
628
] | 3.333333 | 30 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader as web
import datetime as dt
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, LSTM
#loading data
compa... | [
11748,
299,
32152,
355,
45941,
220,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
220,
201,
198,
11748,
19798,
292,
355,
279,
67,
220,
201,
198,
11748,
19798,
292,
62,
19608,
533,
5067,
355,
3992,
220,
201,
198,
... | 2.417369 | 1,186 |
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from utils.util import ensure_dir
from base import BaseDataLoader
import pandas as pd
import numpy as np
import torch
import time
import os
| [
6738,
1341,
35720,
13,
3866,
36948,
1330,
36052,
27195,
12342,
11,
1855,
11518,
3351,
36213,
198,
6738,
3384,
4487,
13,
22602,
1330,
4155,
62,
15908,
198,
6738,
2779,
1330,
7308,
6601,
17401,
198,
198,
11748,
19798,
292,
355,
279,
67,
1... | 3.625 | 56 |
#OVERVIEW OF ALL QUESTION IDS
"id": "Xa2T0bcZ5VnY",
"title": "Do you identify as a:",
"id": "QUtA6k0gcrZf",
"title": "How old are you? ",
"id": "ZNZyNVwMtwID",
"title": "How would you identify your ethnicity"
"id": "azlKRkvdcc7O",
"title": "Who are you in lockdown with"
"id": "Vrzj2uv0i29C",
"title": "Where are y... | [
2,
41983,
28206,
3963,
11096,
43658,
2849,
4522,
50,
220,
198,
198,
1,
312,
1298,
366,
55,
64,
17,
51,
15,
15630,
57,
20,
53,
77,
56,
1600,
198,
1,
7839,
1298,
366,
5211,
345,
5911,
355,
257,
25,
1600,
198,
198,
1,
312,
1298,
... | 2.353484 | 976 |
"""Create the input data pipeline using `tf.data`"""
import tensorflow as tf
import tensorflow.contrib as tc
import os
from collections import namedtuple
BatchInput = namedtuple('BatchInput',
['iterator', 'word_ids', 'label_ids', 'sentence_lengths'])
| [
37811,
16447,
262,
5128,
1366,
11523,
1262,
4600,
27110,
13,
7890,
63,
37811,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
13,
3642,
822,
355,
37096,
198,
11748,
28686,
198,
6738,
17268,
1330,
3706,
83,
... | 2.745098 | 102 |
from rest_framework import status
from rest_framework.response import Response
def success_response(data=None, status=status.HTTP_200_OK):
"""Returns a response with `status` (200 default) and `data` if provided."""
if data is None:
return Response(status=status)
return Response(data, status=statu... | [
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
628,
198,
4299,
1943,
62,
26209,
7,
7890,
28,
14202,
11,
3722,
28,
13376,
13,
40717,
62,
2167,
62,
11380,
2599,
198,
220,
220,
220,
37227,
35561,
... | 2.873457 | 324 |
times = 10
with open('src-train-aug-err-old.txt') as f:
srcs = f.readlines()
with open('tgt-train-aug-err-old.txt') as f:
tgts = f.readlines()
with open('src-train-aug-err.txt', 'w') as f:
for t in range(times):
f.writelines(srcs)
with open('tgt-train-aug-err.txt', 'w') as f:
for t in range(times):
f.writ... | [
198,
22355,
796,
838,
198,
198,
4480,
1280,
10786,
10677,
12,
27432,
12,
7493,
12,
8056,
12,
727,
13,
14116,
11537,
355,
277,
25,
198,
197,
10677,
82,
796,
277,
13,
961,
6615,
3419,
198,
198,
4480,
1280,
10786,
83,
13655,
12,
27432,... | 2.234899 | 149 |
# 9.2.2 多次元ガウス分布のEMアルゴリズム
#%%
# 9.2.2項で利用するライブラリ
import numpy as np
from scipy.stats import multivariate_normal # 多次元ガウス分布
import matplotlib.pyplot as plt
#%%
## 真の分布の設定
# 次元数を設定:(固定)
D = 2
# クラスタ数を指定
K = 3
# K個の真の平均を指定
mu_truth_kd = np.array(
[[5.0, 35.0],
[-20.0, -10.0],
[30.0, -20.0]]
)
# K個の... | [
2,
860,
13,
17,
13,
17,
36469,
248,
162,
105,
94,
17739,
225,
23728,
34103,
26344,
228,
30585,
225,
5641,
3620,
47794,
17933,
12675,
37426,
25795,
198,
198,
2,
16626,
198,
198,
2,
860,
13,
17,
13,
17,
165,
254,
227,
30640,
26344,
... | 1.523403 | 5,854 |
import requests
TAG_LIST_ENDPOINT = 'http://127.0.0.1:8000/api/recipe/tags/'
TOKEN_ENDPOINT = 'http://127.0.0.1:8000/api/user/token/'
def authenticate_user(payload):
"""First authenticate user"""
res = requests.post(TOKEN_ENDPOINT, payload)
return res.json()['token']
def create_tag(data, headers):
... | [
11748,
7007,
198,
198,
42197,
62,
45849,
62,
1677,
6322,
46,
12394,
796,
705,
4023,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
33942,
14,
15042,
14,
29102,
431,
14,
31499,
14,
6,
198,
10468,
43959,
62,
1677,
6322,
46,
12394,
796,
70... | 2.516224 | 339 |
from data.base import DataLoaderExt
from data.chen_example import ChenDataset
from data.silverbox import create_silverbox_datasets
from data.f16gvt import create_f16gvt_datasets
| [
6738,
1366,
13,
8692,
1330,
6060,
17401,
11627,
198,
6738,
1366,
13,
6607,
62,
20688,
1330,
12555,
27354,
292,
316,
198,
6738,
1366,
13,
40503,
3524,
1330,
2251,
62,
40503,
3524,
62,
19608,
292,
1039,
198,
6738,
1366,
13,
69,
1433,
70... | 3.254545 | 55 |
########################################################
# Copyright (c) 2015-2017 by European Commission. #
# All Rights Reserved. #
########################################################
"""
This view shows, for each energy, a pie chart of the different supply types in the con... | [
29113,
14468,
7804,
198,
2,
15069,
357,
66,
8,
1853,
12,
5539,
416,
3427,
4513,
13,
220,
220,
220,
220,
220,
1303,
198,
2,
1439,
6923,
33876,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 3.34322 | 236 |
from flask import render_template, url_for, redirect, flash, request, abort, Blueprint
from flask_login import current_user, login_required
from blogapp import db
from blogapp.models import Post
from blogapp.posts.forms import PostForm
posts = Blueprint ('posts', __name__)
@posts.route ("/post/new", methods = ['GET',... | [
6738,
42903,
1330,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
18941,
11,
7644,
11,
2581,
11,
15614,
11,
39932,
198,
6738,
42903,
62,
38235,
1330,
1459,
62,
7220,
11,
17594,
62,
35827,
198,
6738,
4130,
1324,
1330,
20613,
198,
6738,
4130... | 3.083799 | 179 |
import torch
from .abstract import TargetNetwork
| [
11748,
28034,
198,
6738,
764,
397,
8709,
1330,
12744,
26245,
198
] | 4.454545 | 11 |
import os, sys
parentPath = os.path.abspath("..")
if parentPath not in sys.path:
sys.path.insert(0, parentPath)
import string
from collections import Counter, defaultdict
from itertools import chain, groupby, product
from config.dictionary import supportWords
import nltk
from enum import Enum
from nltk.tokenize impor... | [
11748,
28686,
11,
25064,
198,
8000,
15235,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7203,
492,
4943,
198,
361,
2560,
15235,
407,
287,
25064,
13,
6978,
25,
198,
197,
17597,
13,
6978,
13,
28463,
7,
15,
11,
2560,
15235,
8,
198,
198,
... | 2.939341 | 577 |
#!/usr/bin/env python
# encoding: utf-8
from .serializers import UserSerializer
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
764,
46911,
11341,
1330,
11787,
32634,
7509,
628
] | 3.037037 | 27 |
import tkinter as tk
import tkinter.ttk as ttk
from .util import * | [
11748,
256,
74,
3849,
355,
256,
74,
198,
11748,
256,
74,
3849,
13,
926,
74,
355,
256,
30488,
198,
198,
6738,
764,
22602,
1330,
1635
] | 2.68 | 25 |
from dotenv import load_dotenv
load_dotenv()
if __name__ == "__main__":
pass | [
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1208
] | 2.612903 | 31 |
import sys
def retrieve_file(filename):
"""
Opens a file and returns its contents as a string after
encoding to UTF-8
:param filename:
:return:
"""
with open(filename, 'rb') as f:
original_contents = f.read()
decoded_contents = original_contents.decode('utf-8-sig').encode('utf... | [
11748,
25064,
628,
198,
4299,
19818,
62,
7753,
7,
34345,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8670,
641,
257,
2393,
290,
5860,
663,
10154,
355,
257,
4731,
706,
198,
220,
220,
220,
21004,
284,
41002,
12,
23,
198,
220,... | 2.703057 | 229 |
import numpy as np
import torch
import torch.nn as nn
__all__ = [ 'Linear' ]
class Linear(nn.Linear):
'''
Fully connected linear layer class::
line0 = Linear([n], num_neurons, init, bias)
creates a fully connected linear layer with 'n' input neurons and
'num_neurons' output neurons... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
628,
198,
834,
439,
834,
796,
685,
705,
14993,
451,
6,
2361,
628,
198,
4871,
44800,
7,
20471,
13,
14993,
451,
2599,
198,
220,
220,
220,
70... | 2.596726 | 672 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/mnt/c/Documents and Settings/icheberiak/Sources/Python/lan-map/viewgui/gui_windows/gui_form_new_device.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run ag... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
31051,
76,
429,
14,
66,
14,
38354,
290,
16163,
14,
14234,
527,
32994,
14,
21188,
14,
37906,
14,
9620,
12,
8899,
1... | 2.674699 | 249 |
# AWS IoT EduKit Pre-Provisioned MCU Device Registration Helper
# v1.1.0
#
# Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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
#... | [
2,
30865,
38488,
40766,
20827,
3771,
12,
2964,
10178,
276,
13122,
52,
16232,
24610,
5053,
525,
198,
2,
410,
16,
13,
16,
13,
15,
198,
2,
198,
2,
15069,
357,
34,
8,
12131,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
220,
143... | 2.779564 | 3,484 |
# -*- coding: utf-8 -*-
"""
bouncerapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
from bouncerapi.decorators import lazy_property
from bouncerapi.configuration import Configuration
from bouncerapi.controllers.blacklist_controller import BlacklistController
from bounce... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
220,
220,
220,
31283,
2189,
15042,
628,
220,
220,
220,
770,
2393,
373,
6338,
7560,
416,
3486,
3955,
1404,
2149,
410,
17,
13,
15,
357,
3740,
1378,
499,... | 3.742424 | 264 |
import numpy as np
from .. import units
| [
11748,
299,
32152,
355,
45941,
198,
6738,
11485,
1330,
4991,
628
] | 3.727273 | 11 |
# ********************************************************************************
#
# Convert 18016.def to compileable code
#
# ********************************************************************************
import os,re
target = "../emulator/generated/".replace("/",os.sep) # output directory.
#
# ... | [
2,
41906,
17174,
8412,
198,
2,
198,
2,
197,
197,
197,
197,
197,
197,
3103,
1851,
1248,
27037,
13,
4299,
284,
17632,
540,
2438,
198,
2,
198,
2,
41906,
17174,
8412,
198,
198,
11748,
28686,
11,
260,
198,
198,
16793,
796,
366,
40720,
... | 2.281343 | 1,013 |
from .JSONConfiguration import JSONConfiguration
from .ConfigurationSchemeV1 import ConfigurationSchemeV1
| [
6738,
764,
40386,
38149,
1330,
19449,
38149,
198,
6738,
764,
38149,
27054,
1326,
53,
16,
1330,
28373,
27054,
1326,
53,
16,
198
] | 4.818182 | 22 |
from flask import Blueprint
bp = Blueprint("scoring", __name__)
from app.scoring import routes
| [
6738,
42903,
1330,
39932,
198,
198,
46583,
796,
39932,
7203,
46536,
1600,
11593,
3672,
834,
8,
198,
198,
6738,
598,
13,
46536,
1330,
11926,
198
] | 3.88 | 25 |
from petisco import use_case_handler, UseCase, Petisco
from meiga import Result, Error, Success
from petisco.event.bus.domain.interface_event_bus import IEventBus
from taskmanager.src.modules.tasks.domain.description import Description
from taskmanager.src.modules.tasks.domain.title import Title
from taskmanager.src... | [
6738,
4273,
4861,
1330,
779,
62,
7442,
62,
30281,
11,
5765,
20448,
11,
4767,
4861,
198,
198,
6738,
502,
13827,
1330,
25414,
11,
13047,
11,
16282,
198,
6738,
4273,
4861,
13,
15596,
13,
10885,
13,
27830,
13,
39994,
62,
15596,
62,
10885,... | 3.291892 | 185 |