content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from odoo import api, SUPERUSER_ID
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2142,
286,
10529,
2238,
13,
4091,
38559,
24290,
2393,
329,
1336,
6634,
290,
15665,
3307,
13,
198,
198,
6738,
764,
1330,
4981,
198,
6738,
16298,
2238,
1330,
40391,
11,... | 3.204082 | 49 |
"""
Tests referring to the method transform_column of the module functions.
"""
import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_frame_equal, assert_series_equal
@pytest.mark.functions
@pytest.mark.parametrize("elementwise", [True, False])
def test_transform_column(dataframe, ele... | [
37811,
198,
51,
3558,
9759,
284,
262,
2446,
6121,
62,
28665,
286,
262,
8265,
5499,
13,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
9288,
198,
6738,
19798,
292,
13,
33407,
13... | 2.857741 | 478 |
from flask import Flask, jsonify
from flask_cors import CORS
from flask import request
import os
from dotenv import load_dotenv
from time import strftime
import logging
from peewee import *
import gfiletools
import nslookup_realtime
import db
import nslookup_db_update
import nslookup_db_get
# Accessing variables... | [
6738,
42903,
1330,
46947,
11,
33918,
1958,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
198,
6738,
42903,
1330,
2581,
198,
198,
11748,
28686,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
6738,
640,
1330,
965... | 2.480447 | 716 |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, ValidationError, BooleanField
from wtforms.validators import Email, Required, EqualTo
from ..models import User | [
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
83,
23914,
1330,
10903,
15878,
11,
30275,
15878,
11,
39900,
15878,
11,
3254,
24765,
12331,
11,
41146,
15878,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
9570,
11,
2090... | 4.08 | 50 |
from typing import List, Tuple
from aidboxpy import AsyncAidboxResource
from fhirpy.base.resource import AbstractResource
from aidbox_python_sdk.sdk import SDK
from resources.resource import Resource
class ServiceRequest(Resource):
"""Класс для работы с заявками"""
async def create(self, fields: dict) -> s... | [
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
6738,
6133,
3524,
9078,
1330,
1081,
13361,
44245,
3524,
26198,
198,
6738,
277,
71,
343,
9078,
13,
8692,
13,
31092,
1330,
27741,
26198,
198,
198,
6738,
6133,
3524,
62,
29412,
62,
21282,
... | 1.993009 | 2,861 |
#!/usr/bin/python3
if __name__ == "__main__": main() | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
1388,
3419
] | 2.033333 | 30 |
"""Default configurations for Ralph"""
import io
from enum import Enum
from os import environ
from pathlib import Path
import yaml
from click import get_app_dir
from ralph.exceptions import ConfigurationException
class DatabaseBackends(Enum):
"""Enumerate active database backend modules.
Adding an entry t... | [
37811,
19463,
25412,
329,
20993,
37811,
198,
198,
11748,
33245,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
331,
43695,
198,
6738,
3904,
1330,
651,
62,
1324,
... | 2.467731 | 1,503 |
from .recount import recount
from .admin import admin
from .default import default
from .migration import migration
from .route import route
from .translations import translations
from .user import user
commands = [migration, recount, route, admin, default, translations, user]
| [
6738,
764,
8344,
608,
1330,
16369,
198,
6738,
764,
28482,
1330,
13169,
198,
6738,
764,
12286,
1330,
4277,
198,
6738,
764,
76,
4254,
1330,
13472,
198,
6738,
764,
38629,
1330,
6339,
198,
6738,
764,
7645,
49905,
1330,
25231,
198,
6738,
764... | 4.227273 | 66 |
from __future__ import division
#this module tests that sympy works with true division turned on
from sympy import Rational, Symbol, Float
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
2,
5661,
8265,
5254,
326,
10558,
88,
2499,
351,
2081,
7297,
2900,
319,
198,
198,
6738,
10558,
88,
1330,
46863,
11,
38357,
11,
48436,
198
] | 4.272727 | 33 |
from . import web
from flask import render_template, request
from libs.get_data import *
from libs.format_time import format_time
from web.cache import cache
@web.route('/vizdata', methods=['POST', 'GET'])
@web.route('/viz/line')
@cache.cached(timeout=60*30)
@web.route('/viz/bar')
@cache.cached(timeout=60*30)
@web.... | [
6738,
764,
1330,
3992,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
198,
6738,
9195,
82,
13,
1136,
62,
7890,
1330,
1635,
198,
6738,
9195,
82,
13,
18982,
62,
2435,
1330,
5794,
62,
2435,
198,
6738,
3992,
13,
23870,
1330,
12940,
... | 2.365462 | 249 |
# Lint as: python3
# Copyright 2018, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | [
2,
406,
600,
355,
25,
21015,
18,
198,
2,
15069,
2864,
11,
383,
309,
22854,
37535,
35089,
515,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
... | 3.362007 | 279 |
from collections import defaultdict
from twisted.internet import reactor, defer
from twisted.internet.base import ThreadedResolver
from scrapy.xlib.pydispatch import dispatcher
from scrapy.utils.httpobj import urlparse_cached
from scrapy import signals
class CachingResolver(object):
"""Scrapy extension to use a... | [
6738,
17268,
1330,
4277,
11600,
198,
198,
6738,
19074,
13,
37675,
1330,
21905,
11,
29135,
198,
6738,
19074,
13,
37675,
13,
8692,
1330,
14122,
276,
4965,
14375,
198,
198,
6738,
15881,
88,
13,
87,
8019,
13,
79,
5173,
8802,
963,
1330,
49... | 3.852632 | 95 |
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
15069,
2864,
3012,
3457,
13,
220,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13... | 2.492638 | 2,513 |
from . import sparc_dec_func
from . import sparc_beam_search
from . import sparc_enc_modules
from . import sparc_enc
from . import sparc_match_utils | [
6738,
764,
1330,
599,
5605,
62,
12501,
62,
20786,
198,
6738,
764,
1330,
599,
5605,
62,
40045,
62,
12947,
198,
6738,
764,
1330,
599,
5605,
62,
12685,
62,
18170,
198,
6738,
764,
1330,
599,
5605,
62,
12685,
198,
6738,
764,
1330,
599,
5... | 3.148936 | 47 |
from grm import preprocessing, GRM
from grm.util import get_activities
from pm4py.algo.filtering.log.attributes import attributes_filter
from pm4py.util import constants
from pm4py.objects.log.util import sampling
model_path = '../logged_models/sp2020/2020-05-06-05-40_best_model.pickle'
logfile = "sp2020.csv"
name_of_... | [
6738,
1036,
76,
1330,
662,
36948,
11,
10863,
44,
198,
6738,
1036,
76,
13,
22602,
1330,
651,
62,
15791,
871,
198,
6738,
9114,
19,
9078,
13,
282,
2188,
13,
10379,
20212,
13,
6404,
13,
1078,
7657,
1330,
12608,
62,
24455,
198,
6738,
911... | 2.329646 | 452 |
# -*- coding: UTF-8 -*-
from appium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from appium.webdriver.common.touch_action import TouchAction
import time
import sys
print str(sys.arg... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
6738,
598,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
9019,
1330,
5313,
32103,
21321,
198,
6738,
384,
11925,
1505,
13,
12384,
2623... | 2.538732 | 284 |
#! /usr/bin/env python
# -*- coding: utf-8 -*_
# Author: Yunlong Feng <ylfeng@ir.hit.edu.cn>
from functools import partial
from torch import nn
from torch.nn.modules import activation
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
62,
198,
2,
6434,
25,
20757,
6511,
18164,
1279,
88,
1652,
1516,
31,
343,
13,
17945,
13,
15532,
13,
31522,
29,
198,
198,
67... | 2.776119 | 67 |
"""
Profile.py
------
Handles user profiles and dashboard
List of functions:
* init
"""
# Flask blueprinting services
from flask import (
Blueprint, flash, g, redirect, render_template, url_for, abort
)
# Fetches database from our app
from birdcraft.auth import login_required
from birdcraft.db import get_db
bp = Bl... | [
37811,
198,
37046,
13,
9078,
198,
23031,
198,
12885,
829,
2836,
16545,
290,
30415,
198,
8053,
286,
5499,
25,
198,
9,
2315,
198,
37811,
198,
198,
2,
46947,
30881,
278,
2594,
198,
6738,
42903,
1330,
357,
198,
197,
14573,
4798,
11,
7644,... | 3.110429 | 163 |
import argparse
import json
import logging
import os
import shutil
from collections import defaultdict
from pathlib import Path
import numpy as np
from PIL import Image, ImageFile
from data_utils import (
_resize_thumbnail,
create_annotations,
create_image_info,
crop_single_bbox,
)
ImageFile.LOAD_TRU... | [
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
13... | 2.25257 | 2,043 |
import eth_tester.exceptions
import pytest
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
| [
11748,
4555,
62,
4879,
353,
13,
1069,
11755,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
29891,
4943,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
29891,
4943,
628,
198,
31,
9078,
9288... | 2.777778 | 81 |
from .linalg import *
from .base import *
from .utils import _svdCond, _float, _XTX, _XXT, fastDot
from .numba import lstsq as _lstsq
from .big_data import LSMR
from numpy import newaxis, cumsum, sqrt, hstack
from .big_data.randomized import randomizedSVD
from .big_data.truncated import truncatedEig
__all__ = ['solv... | [
198,
6738,
764,
75,
1292,
70,
1330,
1635,
198,
6738,
764,
8692,
1330,
1635,
198,
6738,
764,
26791,
1330,
4808,
82,
20306,
25559,
11,
4808,
22468,
11,
4808,
25010,
55,
11,
4808,
8051,
51,
11,
3049,
35,
313,
198,
6738,
764,
77,
2178,
... | 2.671966 | 3,963 |
from django.contrib import admin
# Register your models here.
# import models
from .models import Todo
# register apps to appear in admin
admin.site.register(Todo)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
2,
1330,
4981,
198,
6738,
764,
27530,
1330,
309,
24313,
198,
198,
2,
7881,
6725,
284,
1656,
287,
13169,
198,
28482,
13,
15654,
13,
30238,
7... | 3.531915 | 47 |
x = 5
y = 6
z = 7
myfnc(x, y, z)
| [
198,
198,
87,
796,
642,
198,
88,
796,
718,
198,
89,
796,
767,
198,
1820,
69,
10782,
7,
87,
11,
331,
11,
1976,
8,
198
] | 1.4 | 25 |
# -*- coding: utf-8 -*-
# @Brief: FCN的实现
from tensorflow.keras import layers, models
from nets.ResNet import ResNet50_backbone
from nets.VGG import VGG16_backbone
from nets.BilinearUpSampling import BilinearUpSampling2D
import core.config as cfg
def FCN_32(encoder, input_shape, num_classes=21):
"""
FCN32通用结构
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
33,
3796,
25,
10029,
45,
21410,
22522,
252,
163,
236,
108,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
11685,
11,
4981,
198,
6738,
31720,
13,
4965,
793... | 1.944156 | 2,507 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Author: Bryan .
@Bryan .
Made with love by Bryan .
==================================
DESC:
Will return the parsed CSV file given as
a python dict or JSON. This is meant to be
read and has functions that you may use in
other projects.
============================... | [
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,
13838,
25,
17857,
764,
198,
31,
33,
29038,
764,
198,
198,
24616,
351,
1842,
416,
17857,
764,
198,
198... | 2.545568 | 801 |
import websockets
import core.api
import core.xmcp
import SimpleWebSocketServer
import queue
import threading
import json
import os
server=ChatroomServer(11450)
server.run()
| [
11748,
2639,
11603,
198,
11748,
4755,
13,
15042,
198,
11748,
4755,
13,
87,
76,
13155,
198,
11748,
17427,
13908,
39105,
10697,
198,
11748,
16834,
198,
11748,
4704,
278,
198,
11748,
33918,
198,
11748,
28686,
198,
198,
15388,
28,
30820,
3823... | 3.384615 | 52 |
"""empty message
Revision ID: b472cb98fffd
Revises: 7e206db94cf6
Create Date: 2018-01-04 20:57:19.845298
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b472cb98fffd'
down_revision = '7e206db94cf6'
branch_labels = None
depends_on = None
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
275,
37856,
21101,
4089,
487,
16344,
198,
18009,
2696,
25,
767,
68,
22136,
9945,
5824,
12993,
21,
198,
16447,
7536,
25,
2864,
12,
486,
12,
3023,
1160,
25,
3553,
25,
1129,
13,
23,
... | 2.555556 | 117 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
198
] | 3.166667 | 6 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import setuptools
except ImportError:
import distutils.core as setuptools
setuptools.setup(
name = "openshift-docker-registry-extensions",
version = "0.1",
description = "OpenShift Docker Registry Extensions",
long_description = open('./READM... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
900,
37623,
10141,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1330,
... | 2.559271 | 329 |
"""
Copyright 2015 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | [
37811,
198,
15269,
1853,
37927,
13200,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
743,
7... | 3.857143 | 210 |
# -*- coding: utf-8 -*-
import pytest
from client.output import Slack
from chatterbot.conversation import Statement
from slackclient import SlackClient
@pytest.fixture()
def slack_adapter(mocker):
"""
Create and patches for an output slack adapter.
"""
# Patch methods in the slackclient library so tha... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
6738,
5456,
13,
22915,
1330,
36256,
198,
6738,
37303,
13645,
13,
1102,
690,
341,
1330,
21983,
198,
6738,
30740,
16366,
1330,
36256,
11792,
628,
19... | 2.672662 | 278 |
import matplotlib.pyplot as plt
from sklearn.model_selection import KFold
from pyanom.density_ratio_estimation import KLDensityRatioEstimation
import numpy as np
normal_data = np.loadtxt("../input/normal_data.csv", delimiter=",")
error_data = np.loadtxt("../input/error_data.csv", delimiter=",")
kf_iter = KFold(n_spli... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
509,
37,
727,
198,
6738,
279,
4121,
296,
13,
43337,
62,
10366,
952,
62,
395,
18991,
1330,
509,
11163,
6377,
29665,
952,
22362... | 2.38526 | 597 |
# Jack O'Connor
# Pygame Chess Project
# ChessServer.py
import argparse
import os
import pickle
import socket
import threading
import numpy as np
from ChessBoard import ChessBoard
if __name__ == "__main__":
args = parseArgs()
server = ChessServer(host=args.host, port=args.port, max_conns=args.c)
| [
2,
3619,
440,
6,
27136,
198,
2,
9485,
6057,
25774,
4935,
198,
2,
25774,
10697,
13,
9078,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
17802,
198,
11748,
4704,
278,
198,
198,
11748,
299,
32152,
35... | 2.962617 | 107 |
import matplotlib.pyplot as plt
import numpy as np
import os
import time
train_plt_path = '../out/graphs/training.pdf'
class Logger:
"""
Class Logger gives a nice way to highlight important messages on runtime.
"""
Header = '\033[95m'
Success = '\033[92m'
Info = '\033[94m'
Warning =... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
198,
11748,
640,
198,
198,
27432,
62,
489,
83,
62,
6978,
796,
705,
40720,
448,
14,
34960,
82,
14,
34409,
13,
12315,
... | 2.281347 | 1,603 |
from django.db import models
from django.db.models.signals import post_migrate
import pandas as pd
import logging | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
76,
42175,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
18931
] | 3.424242 | 33 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from pathlib import Path
import pytest
from ...utils.testing import run_cli
from ..main import cli
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.mark.remote_data
@pytest.mark.remote_data
@pytest.mark.remote_data
@py... | [
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
532,
766,
38559,
24290,
13,
81,
301,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
12972,
9288,
198,
6738,
2644,
26791,
13,
33407,
1330,
1057,
62,
44506,
198,
6738,
1148... | 2.898305 | 118 |
# -*- coding: utf-8 -*-
"""
Flask-Static-Compress
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2016 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
from jac.contrib.flask import JAC as FlaskStaticCompress
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
46947,
12,
45442,
12,
7293,
601,
198,
220,
220,
220,
220,
27156,
8728,
93,
198,
220,
220,
220,
1058,
22163,
4766,
25,
357,
66,
8,
1584,
12... | 2.625 | 88 |
#!/usr/bin/env python
import argparse
import pandas as pd
import json
import sys
import numpy as np
import requests
import os
import uuid
import csv
from scipy import stats
from itertools import islice
#requires 2.7.9 or greater to deal with https comodo intermediate certs
if sys.version_info < (2, 7):
raise ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7007,
198,
11748,
28686,
198,
11748,
... | 2.622006 | 1,545 |
from os.path import abspath, dirname, join
_cwd = dirname(abspath(__file__))
class BaseConfiguration(object):
"""
Setting up some constant variables
"""
DEBUG = False
TESTING = False
HOST = 'tni.link'
PORT = "5000"
class DebugConfiguration(BaseConfiguration):
"""
This object inher... | [
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
26672,
3672,
11,
4654,
198,
198,
62,
66,
16993,
796,
26672,
3672,
7,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
198,
4871,
7308,
38149,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
... | 2.842105 | 133 |
#a script to run several replicates of several treatments locally
directory = "resets2/"
seeds = range(10, 21)
periods_resets = [[25,26400,0.0141,0.0081],[50,13200,0.0136,0.0068],[100,6600,0.0128,0.0059],[110,6000,0.0382,0.0331],[120,5500,0.1298,0.0222],[132,5000,0.1718,0.0234],[150,4400,0.2012,0.0293],[176,3750,0.227... | [
2,
64,
4226,
284,
1057,
1811,
2186,
16856,
286,
1811,
13820,
15726,
198,
198,
34945,
796,
366,
411,
1039,
17,
30487,
198,
325,
5379,
796,
2837,
7,
940,
11,
2310,
8,
198,
41007,
82,
62,
411,
1039,
796,
16410,
1495,
11,
2075,
7029,
... | 2.148098 | 736 |
from youwol.environment.forward_declaration import YouwolEnvironment
from youwol.environment.models import IPipelineFactory
from youwol.environment.models_project import BrowserApp, Execution, BrowserAppGraphics
from youwol.pipelines.pipeline_typescript_weback_npm import pipeline, PipelineConfig
from youwol_utils.conte... | [
6738,
345,
86,
349,
13,
38986,
13,
11813,
62,
32446,
10186,
1330,
921,
86,
349,
31441,
198,
6738,
345,
86,
349,
13,
38986,
13,
27530,
1330,
6101,
541,
4470,
22810,
198,
6738,
345,
86,
349,
13,
38986,
13,
27530,
62,
16302,
1330,
3427... | 3.766667 | 90 |
#!/usr/bin/env python
# encoding: utf-8
"""CLI for ASR project."""
import sys
import argparse
import warnings
# don"t show warnings in CLI app
warnings.simplefilter("ignore")
from asr import __version__ # noqa
from asr.review import review_oracle, review_simulate # noqa
from asr.config import MODUS
MODES = ["int... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
37811,
5097,
40,
329,
7054,
49,
1628,
526,
15931,
198,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
14601,
198,
198,
2,
836,
1,
... | 2.570946 | 296 |
import os
__all__ = ["get_all"]
Current = "PyUniversalKit/AnswerSearchkit/API" | [
11748,
28686,
628,
198,
834,
439,
834,
796,
14631,
1136,
62,
439,
8973,
198,
198,
11297,
796,
366,
20519,
38747,
20827,
14,
33706,
18243,
15813,
14,
17614,
1
] | 2.892857 | 28 |
from django.shortcuts import render
from django.http import JsonResponse
from rest_framework.response import Response
from rest_framework.renderers import JSONRenderer
from rest_framework import viewsets, permissions
from rest_framework import filters
from rest_framework.decorators import api_view, renderer_classes
fro... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
449,
1559,
31077,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
13,
10920,
19288,
1330,
19449,
49,
437,
11882,
... | 4.048387 | 124 |
#! /usr/bin/env python
# print last N seconds of CloudWatch log messages for our lambda
import os
from os import environ
import time
from datetime import datetime
from datetime import timedelta
import json
import boto3
log_group_name="/aws/lambda/ask-custom-baker-house-jim-dev"
# ZZZ: need to fetch or construct this... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
3601,
938,
399,
4201,
286,
10130,
10723,
2604,
6218,
329,
674,
37456,
198,
198,
11748,
28686,
198,
6738,
28686,
1330,
551,
2268,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,... | 2.938511 | 309 |
# Generated by Django 3.0.8 on 2020-07-29 01:02
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
23,
319,
12131,
12,
2998,
12,
1959,
5534,
25,
2999,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: UTF-8 -*-
#
# Copyright 2016 Opsview 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 la... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
1584,
26123,
1177,
12052,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
4... | 2.428997 | 2,683 |
import torch as th
import argparse
from sklearn.metrics.pairwise import cosine_similarity
import pandas as pd
import numpy as np
import sys
sys.path.append("..")
from hype.poincare import PoincareManifold
from sklearn.metrics import auc, roc_curve
if __name__ == '__main__':
main()
| [
11748,
28034,
355,
294,
198,
11748,
1822,
29572,
198,
6738,
1341,
35720,
13,
4164,
10466,
13,
24874,
3083,
1330,
8615,
500,
62,
38610,
414,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198... | 2.785047 | 107 |
"""
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2017 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved,
Brett G. Olivier (bgoli@users.sourceforge.net)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to us... | [
37811,
198,
20519,
6173,
68,
50,
532,
11361,
13942,
329,
50072,
11998,
357,
4023,
1378,
79,
893,
728,
13,
10459,
30293,
13,
3262,
8,
198,
198,
15269,
357,
34,
8,
5472,
12,
5539,
347,
13,
38,
13,
45674,
11,
449,
13,
44,
13,
32694,
... | 2.049302 | 2,434 |
# -*- coding:utf8 -*-
'''
The LMDI calculator
'''
from __future__ import unicode_literals
from __future__ import division
import logging
import operator
from math import log, sqrt, exp
from Algorithm import phi_min, eta_max
from Cef_Read import CEF_DIC
class Lmdi(object):
'''
The class of Lmdi
'''
def ... | [
2,
532,
9,
12,
19617,
25,
40477,
23,
532,
9,
12,
198,
7061,
6,
198,
464,
406,
12740,
40,
28260,
198,
7061,
6,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
1... | 1.732785 | 12,039 |
import logging
import geckoboard
from django.conf import settings
from reports.geckoboard.datasets import get_dataset, DATASETS
from reports.queries import REPORT_REGISTRY
logger = logging.getLogger(__name__)
def update_geckoboard_datasets():
"""
Update (or replace) all geckboard datasets
"""
logg... | [
11748,
18931,
198,
11748,
4903,
694,
672,
11953,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
3136,
13,
469,
694,
672,
11953,
13,
19608,
292,
1039,
1330,
651,
62,
19608,
292,
316,
11,
360,
1404,
1921,
32716,
198,
6738,
3... | 2.115207 | 434 |
#%%
from julia import Main
import numpy as np
%load_ext julia.magic
#%%
Main.eval('A = rand(3, 3)')
Main.b = Main.eval('A * ones(3)')
%julia x = A \ b
#%%
np.linalg.norm(np.matmul(Main.A, Main.x) - Main.b)
# %%
Main.eval('A = rand(1000, 1000)')
Main.eval('b = A * ones(1000)')
#%%
%%timeit
Main.eval('x = A \ b')
# %%
... | [
2,
16626,
198,
6738,
474,
43640,
1330,
8774,
198,
11748,
299,
32152,
355,
45941,
198,
4,
2220,
62,
2302,
474,
43640,
13,
32707,
198,
198,
2,
16626,
198,
13383,
13,
18206,
10786,
32,
796,
43720,
7,
18,
11,
513,
8,
11537,
198,
13383,
... | 2.093023 | 172 |
def _moduleFinderHint():
"""Dummy function to let modulefinder know what tables may be
dynamically imported. Generated by MetaTools/buildTableList.py.
"""
## import B_A_S_E_
## import C_F_F_
## import D_S_I_G_
## import G_D_E_F_
## import G_P_O_S_
## import G_S_U_B_... | [
4299,
4808,
21412,
37,
5540,
39,
600,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35,
13513,
2163,
284,
1309,
8265,
22805,
760,
644,
8893,
743,
307,
198,
220,
220,
220,
220,
220,
220,
220,
32366,
17392,
13,
2980,
515,
416,... | 1.645511 | 646 |
from pathlib import Path
import math
import streamlit as st
import numpy as np
import pandas as pd
from src.pages import var_calculation
from src.pages import event_volatility
PAGES = {
"VaR Calculation": var_calculation,
"Event Volatility": event_volatility
}
if __name__ == "__main__":
main() | [
6738,
3108,
8019,
1330,
10644,
198,
11748,
10688,
198,
198,
11748,
4269,
18250,
355,
336,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
12351,
13,
31126,
1330,
1401,
62,
9948,
14902,
198,
6738,
123... | 3.039216 | 102 |
from django.urls import path, include
from . import views
app_name = 'dashboard'
urlpatterns = [
#URL: .TLD/dashboard/
path('', views.login_user, name='dashboard'),
#URL: .TLD/dashboard/user Requires authentication in session
path('user/', views.user, name='userpage'),
#URL: .TLD/dashboard/user/1... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
198,
6738,
764,
1330,
5009,
198,
1324,
62,
3672,
796,
705,
42460,
3526,
6,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
1303,
21886,
25,
764,
51,
11163,
14,
42460,
... | 2.758483 | 501 |
import pytest
from brew_tools import brew_maths as bm
| [
11748,
12972,
9288,
198,
198,
6738,
9059,
62,
31391,
1330,
9059,
62,
11018,
82,
355,
275,
76,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628
] | 2.625 | 32 |
import xlrd
import six
from six.moves import xrange
from .utils import BaseParser
class Parser(BaseParser):
"""Extract text from Excel files (.xls/xlsx).
"""
| [
11748,
2124,
75,
4372,
198,
11748,
2237,
198,
198,
6738,
2237,
13,
76,
5241,
1330,
2124,
9521,
198,
198,
6738,
764,
26791,
1330,
7308,
46677,
628,
198,
4871,
23042,
263,
7,
14881,
46677,
2599,
198,
220,
220,
220,
37227,
11627,
974,
24... | 2.881356 | 59 |
import datetime
emp1 = Empleado('Jane', 'Willis', 'jwillis@test.com', 2500)
emp2 = Empleado('Jack', 'Ryan', 'jryan@test.com', 5500)
Empleado.asignar_incremento(1.2)
print(emp1.tasa_incremento)
print(emp2.tasa_incremento)
print(Empleado.tasa_incremento)
nuevo_empleado = Empleado.convertir_desde_string("Luis-Campos... | [
11748,
4818,
8079,
628,
198,
198,
45787,
16,
796,
2295,
1154,
4533,
10786,
41083,
3256,
705,
8743,
271,
3256,
705,
73,
10594,
271,
31,
9288,
13,
785,
3256,
33507,
8,
198,
45787,
17,
796,
2295,
1154,
4533,
10786,
14295,
3256,
705,
2186... | 2.23 | 200 |
# -*- coding: utf-8 -*-
__version__ = '$Id: 3e2e33c074032b956003e2bcc03c1b9529a12ed9 $'
# The wikis of Chapters of the Wikimedia Foundation living at a xy.wikimedia.org url
from pywikibot import family
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9641,
834,
796,
705,
3,
7390,
25,
513,
68,
17,
68,
2091,
66,
2998,
1821,
2624,
65,
3865,
8054,
18,
68,
17,
65,
535,
3070,
66,
16,
65,
3865,
1959,
64,
1... | 2.423529 | 85 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
class InvokeResponse:
"""
Tuple class containing an HTTP Status Code and a JSON serializable
object. The HTTP Status code is, in the invoke activity scenario, what will
be set in the resulting POST. The Body ... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
628,
198,
4871,
10001,
2088,
31077,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
309,
29291,
1398,
7268,
281,
14626,
1267... | 3.187919 | 447 |
# Desafio 067 -> Faça um programa que mostre a tabuada de vários números, um de cada vez,
# para cada valor digitado pelo usuário.
# O programa será interrompido quando o número solicitado for negativo
mult = resul = num = 1
while True:
num = int(input('Digite o número que deseja visua... | [
2,
2935,
1878,
952,
657,
3134,
4613,
18350,
50041,
23781,
1430,
64,
8358,
749,
260,
257,
7400,
84,
4763,
390,
410,
6557,
380,
418,
299,
21356,
647,
418,
11,
23781,
390,
269,
4763,
1569,
89,
11,
198,
2,
220,
220,
220,
220,
220,
220... | 2.048148 | 270 |
from __future__ import absolute_import
from multiprocessing.pool import ThreadPool
import psutil
import numpy as np
class BaseProduct(BaseAlgorithm):
"""Base class for kernel matrix products and attention layers."""
task = "product"
def prepare_data(
self,
*,
source_points,
... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
18540,
305,
919,
278,
13,
7742,
1330,
14122,
27201,
198,
11748,
26692,
22602,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
4871,
7308,
15667,
7,
14881,
2348,
42289,
2599,
... | 2.551854 | 1,591 |
import os, sys
module_path = os.path.abspath(os.path.join('..'))
sys.path.append(module_path)
import numpy as np
from tqdm import tqdm
from src.metrics import Metrics, avg_dicts
from src.loader import *
class HearstTextTiler:
""" Source code adapted from Stanford nltk.tokenize.
Edited slightly for efficienc... | [
11748,
28686,
11,
25064,
198,
21412,
62,
6978,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
22179,
10786,
492,
6,
4008,
198,
17597,
13,
6978,
13,
33295,
7,
21412,
62,
6978,
8,
198,
198,
11748,
299,
32152,
355,
4... | 1.948568 | 6,494 |
from collections import Counter
from src.data import DATA_DIR
from src.parse_subtitle import Subtitle | [
6738,
17268,
1330,
15034,
198,
198,
6738,
12351,
13,
7890,
1330,
42865,
62,
34720,
198,
6738,
12351,
13,
29572,
62,
7266,
7839,
1330,
3834,
7839
] | 4.08 | 25 |
#!/usr/bin/env python
#coding=utf-8
import sys
print sys.argv
print sys.argv[0]
print sys.argv[1]
print 'hello';print 'world'
if True:
print "True"
else:
print "False"
#this is a comment
'''
this is
a
multiline
comment
'''
"""
multiline
comment
"""
a = "hello"
b = "world"
c = a + \
b
print c
print 'a',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
66,
7656,
28,
40477,
12,
23,
198,
11748,
25064,
198,
198,
4798,
25064,
13,
853,
85,
198,
4798,
25064,
13,
853,
85,
58,
15,
60,
198,
4798,
25064,
13,
853,
85,
58,
16,
60,
198,
... | 2.214765 | 149 |
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from smallrl import buffers
from smallrl import distributions
from smallrl import environments
from smallrl import utils
from .agent import Agent
| [
6738,
4866,
1330,
2769,
30073,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1402,
45895,
1330,
39334,
198,
673... | 3.940299 | 67 |
import random
from model.group import Group
from model.group_address import Address_data
| [
11748,
4738,
198,
6738,
2746,
13,
8094,
1330,
4912,
198,
6738,
2746,
13,
8094,
62,
21975,
1330,
17917,
62,
7890,
628,
198
] | 4.136364 | 22 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
setup(
name="striptls",
version="0.5",
packages=["striptls"],
author="tintinweb",
author_email="tintinweb@oststrom.com",
description=(
"poc implementation of STARTTLS stripping attacks"),
license="... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
301,
... | 2.300292 | 343 |
import os
__filer_default_charset = 'utf-8'
def formatPath(path: str):
"""
格式化路径,统一转换成 "/"
:param path: 路径
:return: 格式化路径
"""
if path:
import re
return re.sub("/+", "/", path.replace("\\", "/"))
def fpath(path: str):
"""
格式化路径,统一转换成 "/"
:param path: 路径
:retur... | [
11748,
28686,
198,
198,
834,
69,
5329,
62,
12286,
62,
354,
945,
316,
796,
705,
40477,
12,
23,
6,
628,
198,
4299,
5794,
15235,
7,
6978,
25,
965,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
10545,
254,
120,
28156,
237,
4429... | 1.469053 | 9,807 |
import pytest
from asitiger.errors import Errors
| [
11748,
12972,
9288,
198,
198,
6738,
355,
270,
8254,
13,
48277,
1330,
44225,
628,
628
] | 3.533333 | 15 |
#!/usr/bin/python
# Run this command as:
#
# jira.sh -s https://issues.apache.org/jira -u $user -p $pw \
# -a getIssueList --search \
# "project in (HADOOP,HDFS,MAPREDUCE) and fixVersion = '$vers' and resolution = Fixed" \
# | ./relnotes.py > $vers.html
import csv
import re
import subprocess
import sys
namePat... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
5660,
428,
3141,
355,
25,
198,
2,
198,
2,
474,
8704,
13,
1477,
532,
82,
3740,
1378,
37165,
13,
43073,
13,
2398,
14,
73,
8704,
532,
84,
720,
7220,
532,
79,
720,
79,
86,
3467,
1... | 2.387468 | 782 |
import numpy as np
import collections
import os
import pickle
from rlcard.utils.utils import *
class ChanceSampling_CFR:
"""Implementation of CFR algorithm"""
def __init__(self, env, model_path="./ChanceSampling_cfr_model"):
"""Initialize Model
Args:
env : Env Clas
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
17268,
198,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
198,
6738,
374,
75,
9517,
13,
26791,
13,
26791,
1330,
1635,
628,
198,
4871,
11809,
16305,
11347,
62,
34,
10913,
25,
198,
220,
220,
2... | 1.992293 | 14,273 |
from .validator import JSON, FORM, PATH, GET
from .exceptions import *
def demo_error_formatter(error: Union[InvalidRequestError, InvalidHeadersError]) -> list:
"""
Just demo. !!! not supported !!!
"""
if isinstance(error, InvalidHeadersError):
return [str(error)]
result = []
errors_b... | [
6738,
764,
12102,
1352,
1330,
19449,
11,
49144,
11,
46490,
11,
17151,
198,
6738,
764,
1069,
11755,
1330,
1635,
628,
198,
4299,
13605,
62,
18224,
62,
687,
1436,
7,
18224,
25,
4479,
58,
44651,
18453,
12331,
11,
17665,
13847,
364,
12331,
... | 1.973684 | 950 |
"""Models used exclusively for testing"""
from django.db import models
from djstripe.fields import StripePercentField
from djstripe.models import StripeModel
| [
37811,
5841,
1424,
973,
11541,
329,
4856,
37811,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
42625,
33565,
431,
13,
25747,
1330,
26137,
431,
31905,
15878,
198,
6738,
42625,
33565,
431,
13,
27530,
1330,
26137,
431,
... | 3.767442 | 43 |
# -*- coding: utf-8 -*-
# Import Python Libraries
from __future__ import print_function, unicode_literals, absolute_import
import imp
import os
import shutil
import setuptools_scm
# Import Pepper Libraries
import pepper
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
17267,
11361,
46267,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
11,
4112,
62,
11748,
198,
11748,
848,
198,
11748,
28686,
198... | 3.378788 | 66 |
# err.py
main()
| [
2,
11454,
13,
9078,
628,
628,
198,
12417,
3419,
198
] | 2 | 10 |
# (C) Datadog, Inc. 2015-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from collections import defaultdict
import logging
import os
from urlparse import urljoin
# project
from util import check_yaml
from utils.checkfiles import get_conf_path
from utils.http import retrieve_... | [
2,
357,
34,
8,
16092,
324,
519,
11,
3457,
13,
1853,
12,
5304,
198,
2,
1439,
2489,
10395,
198,
2,
49962,
739,
45157,
1431,
347,
10305,
13789,
357,
3826,
38559,
24290,
8,
198,
198,
2,
14367,
8019,
198,
6738,
17268,
1330,
4277,
11600,
... | 3.358108 | 148 |
"""
Module: summarize_assimilated_proxies.py
This code reads the "assimilated_proxies.npy" files found in the
directories containing data for each Monte-Carlo iterations for a
specified reconstruction experiment and plots maps of the locations
of the assimilated proxy sites and plots the temporal distribution... | [
37811,
198,
198,
26796,
25,
35743,
62,
562,
26641,
515,
62,
1676,
87,
444,
13,
9078,
628,
770,
2438,
9743,
262,
366,
562,
26641,
515,
62,
1676,
87,
444,
13,
77,
9078,
1,
3696,
1043,
287,
262,
220,
220,
198,
29196,
7268,
1366,
329,... | 2.251613 | 5,115 |
# -*- coding: utf-8 -*-
from openprocurement.archivarius.core.utils import Root
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
1280,
36942,
495,
434,
13,
998,
452,
19897,
13,
7295,
13,
26791,
1330,
20410,
628
] | 2.645161 | 31 |
import clamp_ephys
import os
import pandas as pd
paths = clamp_ephys.workflows.file_structure('server', 'Injected_GC_data/VC_pairs')
p2 = pd.DataFrame()
p14 = pd.DataFrame()
for root, dirs, files in os.walk(os.path.join(paths.tables, 'p2')):
for name in files:
if "mean_subtracted_timeseries" in name:
... | [
11748,
29405,
62,
27446,
893,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6978,
82,
796,
29405,
62,
27446,
893,
13,
1818,
44041,
13,
7753,
62,
301,
5620,
10786,
15388,
3256,
705,
818,
35408,
62,
15916,
62,
7890,... | 2.043088 | 557 |
from task_scheduler.tasks.abstract_task import AbstractTask
from task_scheduler.tasks.config_objects import ConfigDbTask
from task_scheduler.utils.exceptions import ConfigurationError
from task_scheduler.utils.logger import CustomLogger
class DbTask(AbstractTask):
"""This class defines the operations to be perfor... | [
6738,
4876,
62,
1416,
704,
18173,
13,
83,
6791,
13,
397,
8709,
62,
35943,
1330,
27741,
25714,
198,
6738,
4876,
62,
1416,
704,
18173,
13,
83,
6791,
13,
11250,
62,
48205,
1330,
17056,
43832,
25714,
198,
6738,
4876,
62,
1416,
704,
18173,... | 2.818882 | 519 |
from typing import List, Dict, Callable, Union
from gbvision.constants.types import Frame, Shape
from gbvision.utils.continuity import ContinuesCircle
from gbvision.utils.continuity.continues_rect import ContinuesRect
from gbvision.utils.continuity import ContinuesRotatedRect
from gbvision.utils.continuity import Cont... | [
6738,
19720,
1330,
7343,
11,
360,
713,
11,
4889,
540,
11,
4479,
198,
198,
6738,
308,
65,
10178,
13,
9979,
1187,
13,
19199,
1330,
25184,
11,
25959,
198,
6738,
308,
65,
10178,
13,
26791,
13,
18487,
14834,
1330,
6389,
947,
31560,
293,
... | 2.608317 | 1,491 |
import discord
from utils.config import Config
from utils.discord import DiscordInteractive
interact = DiscordInteractive.interact
| [
11748,
36446,
198,
198,
6738,
3384,
4487,
13,
11250,
1330,
17056,
198,
6738,
3384,
4487,
13,
15410,
585,
1330,
39462,
9492,
5275,
198,
198,
3849,
529,
796,
39462,
9492,
5275,
13,
3849,
529,
628
] | 3.941176 | 34 |
import random
from operator import attrgetter
| [
11748,
4738,
198,
6738,
10088,
1330,
708,
81,
1136,
353,
628,
198
] | 4 | 12 |
from floodsystem.stationdata import build_station_list
from floodsystem.station import inconsistent_typical_range_stations
if __name__ == "__main__":
print("*** Task 1F: CUED Part IA Flood Warning System ***")
run() | [
6738,
6947,
10057,
13,
17529,
7890,
1330,
1382,
62,
17529,
62,
4868,
198,
198,
6738,
6947,
10057,
13,
17529,
1330,
18326,
62,
28004,
605,
62,
9521,
62,
301,
602,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
... | 3.358209 | 67 |
import json
import os
results = [['language', 'schema', 'time']]
for filename in os.listdir('./result'):
with open(f"./result/{filename}", "r") as f:
data = json.load(f)
times = data['results'][0]['times']
language, schema = data['results'][0]['command'].split('_')
for time in times:
... | [
11748,
33918,
198,
11748,
28686,
198,
198,
43420,
796,
16410,
6,
16129,
3256,
705,
15952,
2611,
3256,
705,
2435,
6,
11907,
198,
198,
1640,
29472,
287,
28686,
13,
4868,
15908,
7,
4458,
14,
20274,
6,
2599,
198,
220,
220,
220,
351,
1280,... | 2.40367 | 218 |
import io
import logging
import pytest
from ..core.logger import (
fritzlogger,
activate_local_debug_mode,
reset,
)
stream = io.StringIO()
stream_handler = logging.StreamHandler(stream=stream)
formatter = logging.Formatter("%(levelname)s:%(message)s")
stream_handler.setFormatter(formatter)
@pytest.mar... | [
11748,
33245,
198,
11748,
18931,
198,
11748,
12972,
9288,
198,
6738,
11485,
7295,
13,
6404,
1362,
1330,
357,
198,
220,
220,
220,
277,
29574,
6404,
1362,
11,
198,
220,
220,
220,
15155,
62,
12001,
62,
24442,
62,
14171,
11,
198,
220,
220... | 2.526749 | 243 |
"""
Utilities for calling linux processes
Uses subprocess.run to execute the subcommands
"""
from subprocess import run, PIPE, CalledProcessError, list2cmdline
from logging import getLogger
logger = getLogger(__name__)
FAILED_CMD_MSG = """Command returned a non-zero code.
STDOUT:
{}
==========================
STDE... | [
37811,
198,
18274,
2410,
329,
4585,
32639,
7767,
198,
198,
5842,
274,
850,
14681,
13,
5143,
284,
12260,
262,
850,
9503,
1746,
198,
37811,
198,
198,
6738,
850,
14681,
1330,
1057,
11,
350,
4061,
36,
11,
34099,
18709,
12331,
11,
1351,
17... | 3.305556 | 108 |
from ..utils import Object
class Seconds(Object):
"""
Contains a value representing a number of seconds
Attributes:
ID (:obj:`str`): ``Seconds``
Args:
seconds (:obj:`float`):
Number of seconds
Returns:
Seconds
Raises:
:class:`telegram.Error`
... | [
198,
198,
6738,
11485,
26791,
1330,
9515,
628,
198,
4871,
40876,
7,
10267,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
49850,
257,
1988,
10200,
257,
1271,
286,
4201,
220,
628,
220,
220,
220,
49213,
25,
198,
220,
220,
220,
2... | 2.295597 | 159 |
from apps.client_details.models import ClientDetailsBase
| [
6738,
6725,
13,
16366,
62,
36604,
13,
27530,
1330,
20985,
24259,
14881,
628,
628
] | 4.285714 | 14 |
from os import path, environ
basedir = path.abspath(path.dirname(__file__))
| [
6738,
28686,
1330,
3108,
11,
551,
2268,
198,
3106,
343,
796,
3108,
13,
397,
2777,
776,
7,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198
] | 2.814815 | 27 |
#!/usr/bin/python
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel, info
from mininet.node import RemoteController, OVSSwitch, Node
from sdnip import BgpRouter, SdnipHost
ROUTE_SERVER_IP = '172.0.255.254'
ROUTE_SERVER_ASN = 65000
if __name... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
949,
42504,
13,
4852,
78,
1330,
5849,
78,
198,
6738,
949,
42504,
13,
3262,
1330,
1855,
42504,
198,
6738,
949,
42504,
13,
44506,
1330,
43749,
198,
6738,
949,
42504,
13,
6404,
1330,
... | 2.558252 | 206 |
# def add_button(self, name, text, value, style = 'default'):
# self.actions.append({
# "name" : name ,
# "text" : text ,
# "type" : "button" ,
# "value" : value ... | [
198,
220,
220,
220,
1303,
825,
751,
62,
16539,
7,
944,
11,
1438,
11,
2420,
11,
1988,
11,
3918,
796,
705,
12286,
6,
2599,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
4658,
13,
33295,
15090,
198,
220,
220,
220,
1303,
2... | 1.644986 | 369 |
import config_my
import requests
from bs4 import BeautifulSoup
import pandas as pd
# from tabulate import tabulate
import telebot
print(config_my.token)
bot = telebot.TeleBot(config_my.token)
pict = [
'https://avatars.mds.yandex.net/get-pdb/2864819/2091b635-1a05-4a81-9f4f-9cdd46cb9be0/s1200',
'https://avatars.... | [
11748,
4566,
62,
1820,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
19798,
292,
355,
279,
67,
198,
2,
422,
7400,
5039,
1330,
7400,
5039,
198,
11748,
5735,
13645,
198,
4798,
7,
11250,
62,
1820,
13,
30... | 2.163708 | 507 |
#!/usr/bin/env python
import logging
import sys
from optparse import OptionParser
from html.parser import HTMLParser
stdlogger = logging.getLogger(__name__)
if __name__ == "__main__":
usage = "usage: %prog http://www.server.com/page.html"
parser = OptionParser(usage=usage,
descri... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
18931,
198,
11748,
25064,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
6738,
27711,
13,
48610,
1330,
11532,
46677,
198,
198,
19282,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362... | 2.264078 | 515 |
import re
import shlex
from enum import Enum
from typing import Dict, List
from ipytv.exceptions import MalformedExtinfException
| [
11748,
302,
198,
11748,
427,
2588,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
6738,
20966,
88,
14981,
13,
1069,
11755,
1330,
4434,
12214,
11627,
10745,
16922,
628,
628
] | 3.594595 | 37 |
import unittest
import pandas as pd
import logging
from src.datasets.preprocess import Preprocessor
from src.models.fashion_classifier import *
from src.train import *
from .util import *
logging.basicConfig(level=logging.WARN)
class TestTrainer(unittest.TestCase):
"""
Tests various parts of the training pipe... | [
11748,
555,
715,
395,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
18931,
198,
6738,
12351,
13,
19608,
292,
1039,
13,
3866,
14681,
1330,
3771,
41341,
198,
6738,
12351,
13,
27530,
13,
25265,
62,
4871,
7483,
1330,
1635,
198,
6738,
... | 2.107424 | 1,778 |
# standard libraries
import logging
import random
import os
import time
# related third party
import dill
import numpy as np
import tabulate
import torch
import torch.optim as optim
from sklearn.metrics import accuracy_score, precision_recall_fscore_support
from torch import nn
from torchtext.data import Dataset, Exam... | [
2,
3210,
12782,
198,
11748,
18931,
198,
11748,
4738,
198,
11748,
28686,
198,
11748,
640,
198,
198,
2,
3519,
2368,
2151,
198,
11748,
288,
359,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7400,
5039,
198,
11748,
28034,
198,
11748,
280... | 3.595142 | 247 |
#
#
# Copyright 2015 Marco Bartolini, bartolini@ira.inaf.it
#
# 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... | [
198,
2,
198,
2,
198,
2,
220,
220,
15069,
1853,
16556,
13167,
43232,
11,
30539,
43232,
31,
8704,
13,
1437,
69,
13,
270,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
... | 2.923902 | 1,025 |
import os
import sys
import threading
import queue
import numpy as np
import pickle
from util import text_processing
| [
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
4704,
278,
198,
11748,
16834,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,
7736,
1330,
2420,
62,
36948,
198
] | 3.71875 | 32 |