content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import numpy as np
import pytest
from numpy.testing import assert_allclose
from scipy import special
from poliastro._math.special import hyp2f1b as hyp2f1
@pytest.mark.parametrize("x", np.linspace(0, 1, num=11))
| [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
198,
6738,
629,
541,
88,
1330,
2041,
198,
198,
6738,
755,
72,
459,
305,
13557,
11018,
13,
20887,
1330,
5328,
17,
69,... | 2.75641 | 78 |
# encoding=utf-8
import tornado.web
from terroroftinytown.tracker.model import User
ACCOUNT_COOKIE_NAME = 'tottu'
ACCOUNT_TOKEN_COOKIE_NAME = 'tottt'
| [
2,
21004,
28,
40477,
12,
23,
198,
11748,
33718,
13,
12384,
198,
198,
6738,
3246,
11205,
3541,
12735,
13,
2213,
10735,
13,
19849,
1330,
11787,
628,
198,
26861,
28270,
62,
34,
15308,
10008,
62,
20608,
796,
705,
83,
1252,
84,
6,
198,
2... | 2.566667 | 60 |
from amuse.units import nbody_system
from amuse.units import units
import amuse.datamodel as core
from amuse.community.fi.interface import Fi
from amuse.ext.gasplummer import MakePlummerGasModel
if __name__=="__main__":
Ngas=1000
conv = nbody_system.nbody_to_si(100 | units.MSun, 1 | units.parsec)
dt=c... | [
198,
6738,
26072,
13,
41667,
1330,
299,
2618,
62,
10057,
198,
6738,
26072,
13,
41667,
1330,
4991,
198,
198,
11748,
26072,
13,
19608,
321,
375,
417,
355,
4755,
198,
6738,
26072,
13,
28158,
13,
12463,
13,
39994,
1330,
23238,
198,
6738,
... | 2.369369 | 444 |
# Copyright 2014 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,
1946,
3012,
3457,
13,
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,
13789,
... | 3.725806 | 372 |
from website import Website
from poll import Poll
import threading
from pprint import pprint
import time
import sys
import os
import config
from utils import logutils, urlutils
import gc
import codecs
import json
from utils import queueconnection
poll = Poll([])
# TEST WEBSITES
websites = [
'{"domain":"h... | [
6738,
3052,
1330,
15887,
198,
6738,
3278,
1330,
12868,
198,
11748,
4704,
278,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
4566,
198,
6738,
3384,
4487,
1330,
2604,
26791,
11,
... | 2.231899 | 953 |
from Mistakes import mistakes
from utils import get_game_id, get_player_color, get_position_score
from tqdm import tqdm
from abc import abstractmethod
| [
6738,
15078,
1124,
1330,
10135,
198,
6738,
3384,
4487,
1330,
651,
62,
6057,
62,
312,
11,
651,
62,
7829,
62,
8043,
11,
651,
62,
9150,
62,
26675,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
450,
66,
1330,
12531,
24396,... | 3.454545 | 44 |
from fastapi import APIRouter
from apis.login.controller import login_router
from apis.users.controller import user_router
api_router = APIRouter()
# router注册
api_router.include_router(login_router, tags=["login"])
api_router.include_router(user_router, prefix="/users", tags=["users"])
| [
6738,
3049,
15042,
1330,
3486,
4663,
39605,
198,
6738,
2471,
271,
13,
38235,
13,
36500,
1330,
17594,
62,
472,
353,
198,
6738,
2471,
271,
13,
18417,
13,
36500,
1330,
2836,
62,
472,
353,
198,
198,
15042,
62,
472,
353,
796,
3486,
4663,
... | 2.88 | 100 |
#!/usr/bin/env python
from __future__ import print_function
import warnings
warnings.simplefilter("ignore", UserWarning)
warnings.filterwarnings("ignore", category=UserWarning)
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
font = {'family' : 'normal',
#'weight' : 'bold',
'size' : 16}
p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
14601,
198,
40539,
654,
13,
36439,
24455,
7203,
46430,
1600,
11787,
20361,
8,
198,
40539,
654,
13,
24455,
40539,
654,
7203... | 1.988413 | 2,848 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-16 17:17
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
19,
319,
2177,
12,
2713,
12,
1433,
1596,
25,
1558,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.690909 | 55 |
from __future__ import annotations
from typing import Optional
from pydantic.fields import Field
from pydantic.types import StrictBool
from ..api import BodyParams, EndpointData
from ..types_.endpoint import BaseEndpoint
from ..types_.inputs import WorkflowCustomField
from ..types_.scalar import WorkflowId
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
279,
5173,
5109,
13,
25747,
1330,
7663,
198,
6738,
279,
5173,
5109,
13,
19199,
1330,
520,
2012,
33,
970,
198,
198,
6738,
11485,
15042,
1330,
12290... | 3.738095 | 84 |
#!/usr/bin/env python2
"""
@author: Christian Forster
"""
import os
import yaml
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.lines as mlines
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import rc
rc('font', **{'family': 'serif', 'serif': ['Cardo']})
rc('text'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
37811,
198,
31,
9800,
25,
4302,
1114,
1706,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
... | 2.671642 | 134 |
import sys, os
sys.path.insert(0, os.path.abspath('.'))
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]
# basic options
html_theme = 'bootstrap'
html_title = "MTUQ Documentation"
master_doc = 'index'
source_suffix = '.rst'
templat... | [
11748,
25064,
11,
28686,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13,
397,
2777,
776,
10786,
2637,
4008,
628,
198,
2302,
5736,
796,
685,
198,
220,
220,
220,
705,
82,
746,
28413,
13,
2302,
13,
20193,
746,
28413,
... | 2.553517 | 327 |
from __future__ import unicode_literals
import uuid
import time
import traceback
# Django
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils import timezone
# 3rd Party
import html2text
# Local Ap... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
334,
27112,
198,
11748,
640,
198,
11748,
12854,
1891,
198,
198,
2,
37770,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
25747,
1330,
42044,
336... | 2.484627 | 2,049 |
# -*- coding: utf-8 -*-
import hashlib
import json
import os
import sys
import urllib
import requests
from slugify import slugify
from google.cloud import translate_v3 # TODO: pip install google-cloud-translate
GOOGLE_CLIENT = translate_v3.TranslationServiceClient()
SOURCE_FILE, SOURCE_LANGUAGE, TARGET_FILE, TARGET... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12234,
8019,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
2956,
297,
571,
198,
198,
11748,
7007,
198,
6738,
31065,
1958,
1330,
31065,
1958,
... | 2.245283 | 1,060 |
"""Tests for the alert component."""
| [
37811,
51,
3558,
329,
262,
7995,
7515,
526,
15931,
198
] | 3.7 | 10 |
# -*- coding: utf-8 -*-
"""
pytests for output collection
"""
import h5py
import numpy as np
import os
import pytest
import tempfile
from reV.handlers.collection import Collector
from reV import TESTDATADIR
from rex.utilities.loggers import init_logger
TEMP_DIR = os.path.join(TESTDATADIR, 'ri_gen_collect')
H5_DIR = ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
9078,
41989,
329,
5072,
4947,
198,
37811,
198,
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
11748... | 2.040091 | 2,644 |
import os
import sys
import time
import datetime
import asyncio
import logging #.log
#in module
#main functions
if __name__ == '__main__':
main()
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
30351,
952,
198,
11748,
18931,
220,
1303,
13,
6404,
198,
198,
2,
259,
8265,
198,
220,
220,
220,
220,
198,
198,
2,
12417,
5499,
220,
220,
628,
198,
... | 2.721311 | 61 |
from setuptools import setup, find_packages
setup(
name="pdf_hunter",
version="0.1.6",
author="Simon Garisch",
author_email="gatman946@gmail.com",
description="Download PDF links from a webpage",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
12315,
62,
37488,
1600,
198,
220,
220,
220,
2196,
2625,
15,
13,
16,
13,
21,
1600,
198,
220,
220,
220,
1772,
2625,
35475,
... | 2.64433 | 194 |
import sys, psycopg2, psycopg2.extras
| [
11748,
25064,
11,
17331,
22163,
70,
17,
11,
17331,
22163,
70,
17,
13,
2302,
8847,
198
] | 2.375 | 16 |
import os
import numpy as np
from itertools import chain
from sklearn.cluster import MeanShift
import PELEpharmacophore.helpers as hl
import PELEpharmacophore.analysis.simulation_analyzer as sa
import PELEpharmacophore.output.pharmacophore_writer as pw
class MeanshiftAnalyzer(sa.SimulationAnalyzer):
"""
Class ... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
6738,
1341,
35720,
13,
565,
5819,
1330,
22728,
33377,
198,
11748,
18468,
2538,
746,
32813,
2522,
382,
13,
16794,
364,
355,
289,
75,
198,
1174... | 2.235683 | 1,816 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import inspect
import threading
from yowsup.layers.interface import YowInterfaceLayer
from yowsup.layers.network import YowNetworkLayer
from yowsup.layers import YowLayerEvent, EventCallback
from tests.utils import success_protocol_entity, failure_protocol_... | [
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,
555,
715,
395,
198,
11748,
10104,
198,
11748,
4704,
278,
198,
6738,
331,
1666,
929,
13,
75,
6962,
13,
399... | 2.888041 | 393 |
import os
import sys
import argparse
import re
#import logging
from fuzzywuzzy import process, fuzz
#from nltk.tokenize.treebank import TreebankWordTokenizer
from util import www2fb, processed_text
#tokenizer = TreebankWordTokenizer()
#logger = logging.getLogger()
#logger.disabled = True
if __name__ == '__main__':
... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
302,
198,
2,
11748,
18931,
198,
198,
6738,
34669,
86,
4715,
88,
1330,
1429,
11,
26080,
198,
2,
6738,
299,
2528,
74,
13,
30001,
1096,
13,
21048,
17796,
1330,
12200,
... | 2.927711 | 332 |
"""general options to pass when initializing
all the options you would pass to the command line are here
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
| [
37811,
24622,
3689,
284,
1208,
618,
4238,
2890,
198,
439,
262,
3689,
345,
561,
1208,
284,
262,
3141,
1627,
389,
994,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
... | 4.315789 | 57 |
'''
Storage
=======
.. versionadded:: 1.7.0
.. warning::
This module is still experimental, and the API is subject to change in a
future version.
Usage
-----
The idea behind the Storage module is to be able to load/store any number of
key/value pairs via an indexed key. The default model is abstract so you... | [
7061,
6,
198,
31425,
198,
1421,
18604,
198,
198,
492,
2196,
29373,
3712,
352,
13,
22,
13,
15,
198,
198,
492,
6509,
3712,
628,
220,
220,
220,
770,
8265,
318,
991,
11992,
11,
290,
262,
7824,
318,
2426,
284,
1487,
287,
257,
198,
220,... | 2.443331 | 3,591 |
# Copyright 2022 The GPflow Contributors. 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... | [
2,
15069,
33160,
383,
14714,
11125,
25767,
669,
13,
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,... | 3.349462 | 372 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
First, Import all variables
"""
import detectron2
from detectron2.data import DatasetCatalog, MetadataCatalog
import matplotlib.pyplot as plt
import random
import os
import cv2
#from detectron2.engine import DefaultTrainer
from detectron2.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
4561,
88,
1082,
12058,
198,
198,
1212,
318,
257,
8584,
4226,
2393,
13,
628,
3274,
11,
17267,
477,
9633,
198,
37811,
198,
11748,
4886,
1313,
17,
198,
6738,
... | 2.309524 | 1,512 |
# Generated by Django 2.1.7 on 2019-04-12 12:51
import django.core.validators
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
22,
319,
13130,
12,
3023,
12,
1065,
1105,
25,
4349,
198,
198,
11748,
42625,
14208,
13,
7295,
13,
12102,
2024,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.95122 | 41 |
import logging
import typing as t
from importlib import import_module
from time import perf_counter
from fastapi import Request, Response
from fastapi.dependencies.utils import is_gen_callable, solve_dependencies
from fastapi.routing import APIRoute
from sqlalchemy import event
from sqlalchemy.engine import Connection... | [
11748,
18931,
198,
11748,
19720,
355,
256,
198,
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
6738,
640,
1330,
23035,
62,
24588,
198,
198,
6738,
3049,
15042,
1330,
19390,
11,
18261,
198,
6738,
3049,
15042,
13,
45841,
3976,
13,
26791,
13... | 3.939394 | 132 |
"""A minimal sample script for illustration of basic usage of NCE module"""
import torch
from nce import IndexLinear
class_freq = [0, 2, 2, 3, 4, 5, 6] # an unigram class probability
freq_count = torch.FloatTensor(class_freq)
print("total counts for all tokens:", freq_count.sum())
noise = freq_count / freq_count.sum... | [
37811,
32,
10926,
6291,
4226,
329,
20936,
286,
4096,
8748,
286,
399,
5222,
8265,
37811,
198,
198,
11748,
28034,
198,
6738,
299,
344,
1330,
12901,
14993,
451,
198,
198,
4871,
62,
19503,
80,
796,
685,
15,
11,
362,
11,
362,
11,
513,
11... | 2.416431 | 353 |
"""Dummy Config class that does not inherit from AbstractDetectorConfig."""
from viseron.detector import AbstractObjectDetection
class ObjectDetection(AbstractObjectDetection):
"""Dummy Config class that does not inherit from AbstractDetectorConfig."""
| [
37811,
35,
13513,
17056,
1398,
326,
857,
407,
16955,
422,
27741,
11242,
9250,
16934,
526,
15931,
198,
6738,
1490,
263,
261,
13,
15255,
9250,
1330,
27741,
10267,
11242,
3213,
628,
198,
4871,
9515,
11242,
3213,
7,
23839,
10267,
11242,
3213,... | 4.177419 | 62 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 13:49:04 2020
@author: adonay
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import csv
import seaborn as sns
from sklearn import linear_model, preprocessing
from sklearn.model_selection import cross_val_score, cros... | [
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,
41972,
319,
26223,
2556,
1315,
1511,
25,
2920,
25,
3023,
12131,
198,
198,
31,
9800,
25,
512,
261,
323... | 1.920635 | 5,922 |
import os
import logging
import json
from dotenv import load_dotenv
from anvil.gen3.entities import Entities
from anvil.terra.reconciler import Reconciler
from anvil.terra.workspace import Workspace
from anvil.terra.sample import Sample
from anvil.transformers.fhir.transformer import FhirTransformer
from anvil.util.r... | [
11748,
28686,
198,
11748,
18931,
198,
11748,
33918,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
6738,
281,
2991,
13,
5235,
18,
13,
298,
871,
1330,
7232,
871,
198,
6738,
281,
2991,
13,
353,
430,
13,
260,
1102,... | 2.197927 | 2,895 |
# Copyright 2020 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
from __future__ import annotations
import itertools
from .pointing import Point
from .. import int_crowding
| [
2,
15069,
12131,
7431,
371,
620,
388,
290,
37886,
13,
198,
2,
770,
1430,
318,
9387,
739,
262,
17168,
5964,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
340,
861,
10141,
198,
198,
6738,
764,
4122,
278,
1330,
6... | 3.962963 | 54 |
#!/usr/bin/python3
"""This module contains a function that returns the dictionary
description with simple data structure (list, dictionary, string,
integer and boolean) for JSON serialization of an object.
"""
def class_to_json(obj):
"""Returns the dictionary description with simple data
structure (li... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
1212,
8265,
4909,
257,
2163,
326,
5860,
262,
22155,
198,
220,
220,
220,
6764,
351,
2829,
1366,
4645,
357,
4868,
11,
22155,
11,
4731,
11,
198,
220,
220,
220,
18253,
290,
25131,
8,... | 3.360759 | 158 |
from collections import defaultdict
from collections import deque
import os
with open(os.path.join(os.path.dirname(__file__), "input.txt"), "r") as file:
rows = [l.strip() for l in file.readlines()]
grid = defaultdict(lambda: 9)
for y, row in enumerate(rows):
for x, col in enumerate(row):
... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
17268,
1330,
390,
4188,
198,
11748,
28686,
628,
198,
4480,
1280,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
15414,
13,
14116,
12340,
366,
8... | 2.38009 | 221 |
#!/usr/bin/env python
"""
:Author: Akshay Paropkari
:Date Created: 10/15/2014
:Abstract: Automated Tests for BIOM calculation.
"""
import math
import unittest
from phylotoast import biom_calc as bc
from biom import load_table
if __name__ == "__main__":
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
25,
13838,
25,
317,
50133,
323,
2547,
404,
74,
2743,
198,
25,
10430,
15622,
25,
838,
14,
1314,
14,
4967,
198,
25,
23839,
25,
17406,
515,
30307,
329,
20068,
2662,
17952,
1... | 2.894737 | 95 |
from unittest import TestCase, main
from expects import expect, be_empty, have_length
from questions_three.event_broker import EventBroker
from twin_sister.expects_matchers import contain_all_items_in
if "__main__" == __name__:
main()
| [
6738,
555,
715,
395,
1330,
6208,
20448,
11,
1388,
198,
198,
6738,
13423,
1330,
1607,
11,
307,
62,
28920,
11,
423,
62,
13664,
198,
198,
6738,
2683,
62,
15542,
13,
15596,
62,
7957,
6122,
1330,
8558,
15783,
6122,
198,
6738,
15203,
62,
... | 3.101266 | 79 |
from django.shortcuts import render
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
628
] | 4.111111 | 9 |
from django.db import models
from django.contrib.auth.models import User
from rules.contrib.models import RulesModel
import rules
@rules.predicate
rules.add_rule('can_edit_alarm',is_alarm_creator)
rules.add_perm('alarm.edit_alarm', is_alarm_creator)
# Create your models here.
class Alarm(RulesModel):
"""Model repr... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
3173,
13,
3642,
822,
13,
27530,
1330,
14252,
17633,
198,
11748,
3173,
198,
198,
31,
38785,
13,
28764,
5344,
... | 3.076125 | 289 |
# -*- coding: utf-8 -*-
"""
* Created by PyCharm.
* Project: catalog
* Author name: Iraquitan Cordeiro Filho
* Author login: pma007
* File: __init__.py
* Date: 2/23/16
* Time: 14:39
* To change this templates use File | Settings | File Templates.
"""
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1635,
15622,
416,
9485,
1925,
1670,
13,
198,
1635,
4935,
25,
18388,
198,
1635,
6434,
1438,
25,
314,
430,
421,
18642,
327,
17531,
7058,
7066,
8873,
198,
1635,... | 2.784946 | 93 |
import src.UC_Common as UC_Common
import src.UC_Unit as UC_Unit | [
11748,
12351,
13,
9598,
62,
17227,
355,
14417,
62,
17227,
198,
11748,
12351,
13,
9598,
62,
26453,
355,
14417,
62,
26453
] | 3 | 21 |
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
509,
3565,
504,
9019,
7231,
13,
198,
2,
198,
2,
15069,
357,
34,
8,
3717,
12,
6999,
5572,
36,
11,
3457,
13,
198,
2,
198,
2,
... | 2.292399 | 3,526 |
# encoding: utf-8
# module apt_pkg
# from /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-x86_64-linux-gnu.so
# by generator 1.145
"""
Classes and functions wrapping the apt-pkg library.
The apt_pkg module provides several classes and functions for accessing
the functionality provided by the apt-pkg library. Typica... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
2,
8265,
15409,
62,
35339,
198,
2,
422,
1220,
14629,
14,
8019,
14,
29412,
18,
14,
17080,
12,
43789,
14,
2373,
62,
35339,
13,
13155,
7535,
12,
2327,
76,
12,
87,
4521,
62,
2414,
12,
23289,
12,
... | 3.210291 | 447 |
#! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... | [
2,
0,
514,
81,
14,
8800,
14,
29412,
18,
13,
21,
198,
37811,
198,
220,
220,
220,
19937,
7317,
8295,
7560,
1262,
569,
20,
38062,
341,
3696,
422,
38348,
3539,
569,
20,
371,
2078,
319,
12131,
12,
3312,
12,
1157,
1105,
25,
1821,
25,
... | 1.740474 | 9,448 |
from .DaliaDataLoader import *
| [
6738,
764,
35,
9752,
6601,
17401,
1330,
1635,
198
] | 3.444444 | 9 |
#!/usr/bin/env python
# Sample usage:
# python env-setup.py --version 1.5 --apt-packages libomp5
import argparse
import collections
from datetime import datetime
import os
import platform
import re
import requests
import subprocess
import threading
import sys
VersionConfig = collections.namedtuple('VersionConfig',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
27565,
8748,
25,
198,
2,
220,
220,
21015,
17365,
12,
40406,
13,
9078,
1377,
9641,
352,
13,
20,
1377,
2373,
12,
43789,
9195,
3361,
20,
198,
11748,
1822,
29572,
198,
11748,
17268,
1... | 2.327419 | 620 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erf
from scipy import optimize
# ---------------------------- Preprocessing ----------------------------------
def _normalize_profiles(profiles, c_mean):
"""
Rescale concentration profiles to fluctuations around the average value.
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
20887,
1330,
1931,
69,
198,
6738,
629,
541,
88,
1330,
27183,
198,
198,
2,
34400,
10541,
3771,
36948,
20368,
438,... | 2.184528 | 5,636 |
import socket
import threading
import docker
import time
import iptc
from enum import Enum
from src.logger import logger
from src.OneWayThread import OneWayThread
class ContainerThread(threading.Thread):
'''
Need to make a different one for macos as docker desktop for macos
doesn't allow connecting to a ... | [
11748,
17802,
198,
11748,
4704,
278,
198,
11748,
36253,
198,
11748,
640,
198,
11748,
1312,
457,
66,
198,
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
12351,
13,
6404,
1362,
1330,
49706,
198,
6738,
12351,
13,
3198,
25309,
16818,
1330,
1... | 3.290503 | 179 |
import pytest
from plenum.common.startable import Mode
# ToDO: uncomment this test, if pre_view_change_in_progress will be used
# def test_can_send_3pc_batch_pre_view_change(orderer, mode):
# orderer.replica.node.pre_view_change_in_progress = True
# primary_validator.replica.node.mode = mode
# assert n... | [
11748,
12972,
9288,
198,
198,
6738,
458,
44709,
13,
11321,
13,
9688,
540,
1330,
10363,
628,
628,
198,
2,
1675,
18227,
25,
8820,
434,
428,
1332,
11,
611,
662,
62,
1177,
62,
3803,
62,
259,
62,
33723,
481,
307,
973,
198,
2,
825,
1332... | 2.361446 | 332 |
import boto3
import csv
import datetime
import gzip
import httpretty
import json
import logging
import os
import src.lambda_function as worker
import src.shipper as shipper
import unittest
import yaml
from . import utils
from csv import DictReader
from logging.config import fileConfig
from src.shipper import BadLogsEx... | [
11748,
275,
2069,
18,
198,
11748,
269,
21370,
198,
11748,
4818,
8079,
198,
11748,
308,
13344,
198,
11748,
2638,
16100,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
12351,
13,
50033,
62,
8818,
355,
8383,
198,
11748,... | 2.948655 | 409 |
# This file is a part of ninfs.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
from configparser import ConfigParser
from os import environ, makedirs
from os.path import expanduser, isdir, join... | [
2,
770,
2393,
318,
257,
636,
286,
13462,
9501,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
2177,
12,
1238,
2481,
12930,
21435,
5404,
198,
2,
770,
2393,
318,
11971,
739,
383,
17168,
13789,
357,
36393,
737,
198,
2,
921,
460,
1064,
262,
... | 2.648889 | 675 |
# -*- coding: utf-8 -*-
"""Top-level package for eyelab."""
__author__ = """Olivier Morelle"""
__email__ = "oli4morelle@gmail.com"
__version__ = "0.3.2"
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
9126,
12,
5715,
5301,
329,
29708,
397,
526,
15931,
198,
198,
834,
9800,
834,
796,
37227,
46,
16017,
959,
3125,
75,
293,
37811,
198,
834,
12888,
834,
796,
366,
1... | 2.298507 | 67 |
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
Tests for generic page elements not covered by other tests
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2018, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
37811,
198,
51,
3558,
329,
14276,
2443,
4847,
407,
5017,
416,
584,
5254,
198,
378... | 3.066116 | 484 |
from __future__ import unicode_literals
from django.apps import AppConfig
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.619048 | 21 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
try:
from unittest import mock
except ImportError:
import mock
from ..client import NextCallerClient, NextCallerPlatformClient
from .. import transport
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
555,
715,
395,
198,
28311,
25,
198,
220,
220,
220,
422,
555,
715,
395,
1330,
15290,
198,
16341,
... | 3.226667 | 75 |
import json
import multiprocessing as mp
import re
from argparse import ArgumentParser
from enum import Enum, auto
import javalang
from functools import partial
PRED_TOKEN = 'PRED'
modifiers = ['public', 'private', 'protected', 'static']
target_type = TargetType.seq
RE_WORDS = re.compile(r'''
# Find words in a ... | [
11748,
33918,
198,
11748,
18540,
305,
919,
278,
355,
29034,
198,
11748,
302,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
33829,
1330,
2039,
388,
11,
8295,
198,
11748,
474,
9226,
648,
198,
6738,
1257,
310,
10141,
1330,
13027,
... | 2.458239 | 886 |
from setuptools import setup, find_packages
setup(
name='CLI',
version='1.0.4',
packages=find_packages(exclude=['test']),
url='https://github.com/ankit98verma/CLI',
author='Ankit Verma',
license='MIT',
author_email='ankitvermajnp@gmail.com',
description='CLI interface',
e... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
201,
198,
201,
198,
40406,
7,
201,
198,
220,
220,
220,
1438,
11639,
5097,
40,
3256,
201,
198,
220,
220,
220,
2196,
11639,
16,
13,
15,
13,
19,
3256,
201,
198,
220,
220,
220,... | 2.008197 | 244 |
import re
from pysqli import Context
from pysqli.dbms import Mysql5
from pysqli.core.injector import PostInjector
from pysqli.core.triggers import RegexpTrigger, Trigger
from urllib2 import Request,urlopen
from threading import Lock
class CSRFPostInjector(PostInjector):
'''
This is a sample of an injector abl... | [
11748,
302,
198,
6738,
279,
893,
80,
4528,
1330,
30532,
198,
6738,
279,
893,
80,
4528,
13,
9945,
907,
1330,
337,
893,
13976,
20,
198,
6738,
279,
893,
80,
4528,
13,
7295,
13,
259,
752,
273,
1330,
2947,
818,
752,
273,
198,
6738,
279... | 2.351703 | 998 |
# flake8: noqa
import threading
import asyncio
import aiohttp_jinja2
from urllib import request
from nose.tools import eq_
from aiohttp.test_utils import unittest_run_loop
from ddtrace.pin import Pin
from ddtrace.constants import EVENT_SAMPLE_RATE_KEY
from ddtrace.contrib.aiohttp.patch import patch, unpatch
from ddtr... | [
2,
781,
539,
23,
25,
645,
20402,
198,
11748,
4704,
278,
198,
11748,
30351,
952,
198,
11748,
257,
952,
4023,
62,
18594,
6592,
17,
198,
198,
6738,
2956,
297,
571,
1330,
2581,
198,
6738,
9686,
13,
31391,
1330,
37430,
62,
198,
6738,
257... | 2.805085 | 236 |
from selenium import webdriver
from fixture.base_fixture import BaseHelper
from fixture.group import GroupHelper
from fixture.number import NumberHelper
from fixture.session import SessionHelper
from model.group import Group
# открытие страницы адрессной книги
# закрытие
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
628,
198,
6738,
29220,
13,
8692,
62,
69,
9602,
1330,
7308,
47429,
198,
6738,
29220,
13,
8094,
1330,
4912,
47429,
198,
6738,
29220,
13,
17618,
1330,
7913,
47429,
198,
6738,
29220,
13,
29891,
133... | 2.663551 | 107 |
# Generated by Django 2.2.6 on 2019-10-23 00:11
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
21,
319,
13130,
12,
940,
12,
1954,
3571,
25,
1157,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import argparse
import sys
import os
from pong_testbench import PongTestbench
from multiprocessing import Process, Queue
from matplotlib import font_manager
from time import sleep
import importlib
import traceback
import numpy as np
import pickle
parser = argparse.ArgumentParser()
parser.add_argument("dir", type=str, ... | [
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
279,
506,
62,
9288,
26968,
1330,
350,
506,
14402,
26968,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
11,
4670,
518,
198,
6738,
2603,
29487,
8019,
1330,
10369,
62,
37... | 3.190114 | 263 |
from modpy.stats._metropolis import metropolis_hastings
from modpy.stats._hamiltonian import hamiltonian_mc
from modpy.stats._posterior import posterior_ensemble | [
6738,
953,
9078,
13,
34242,
13557,
4164,
25986,
1330,
1138,
25986,
62,
71,
459,
654,
201,
198,
6738,
953,
9078,
13,
34242,
13557,
2763,
9044,
666,
1330,
8891,
9044,
666,
62,
23209,
201,
198,
6738,
953,
9078,
13,
34242,
13557,
79,
6197... | 3.395833 | 48 |
# Generated by Django 3.2 on 2022-03-30 08:12
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
319,
33160,
12,
3070,
12,
1270,
8487,
25,
1065,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.904762 | 42 |
# Generated by Django 3.2.5 on 2021-07-24 13:44
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
20,
319,
33448,
12,
2998,
12,
1731,
1511,
25,
2598,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import random
possible_inputs = ["fire", "rock", "gun", "lightning", "devil", "dragon", "water", "air", "paper",
"sponge", "wolf", "tree", "human", "snake", "scissors"]
name = input("Enter your name: > ")
print(f"Hello, {name}")
ratings = open('rating.txt', 'r')
ratings_list = ratings.read().spli... | [
11748,
4738,
628,
198,
79,
4733,
62,
15414,
82,
796,
14631,
6495,
1600,
366,
10823,
1600,
366,
7145,
1600,
366,
2971,
768,
1600,
366,
7959,
346,
1600,
366,
14844,
1600,
366,
7050,
1600,
366,
958,
1600,
366,
20189,
1600,
198,
220,
220,... | 2.432161 | 597 |
from sklearn.cluster import DBSCAN
from sklearn import datasets
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
rawdata = pd.read_csv('total.txt', sep = "\t", names=['timestamp', 'date', 'id', 'y', 'x'])
feature = rawdata[['timestamp', 'date', 'id', 'x', 'y']]
d... | [
6738,
1341,
35720,
13,
565,
5819,
1330,
360,
4462,
44565,
201,
198,
6738,
1341,
35720,
1330,
40522,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,... | 1.789596 | 1,288 |
# importing the Kratos Library
import KratosMultiphysics as KM
from KratosMultiphysics import Parameters, Logger
from KratosMultiphysics.response_functions.response_function_interface import ResponseFunctionInterface
import KratosMultiphysics.ShapeOptimizationApplication as KSO
import time as timer
# ===============... | [
2,
33332,
262,
509,
10366,
418,
10074,
198,
11748,
509,
10366,
418,
15205,
13323,
23154,
355,
46646,
198,
6738,
509,
10366,
418,
15205,
13323,
23154,
1330,
40117,
11,
5972,
1362,
198,
6738,
509,
10366,
418,
15205,
13323,
23154,
13,
26209,... | 4.177165 | 254 |
import os
import sys
sys.path.append(os.path.abspath('../user_client'))
from locust import Locust, TaskSet, task
from user_client import UserClient
from utils import ClientWrapper
| [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
10786,
40720,
7220,
62,
16366,
6,
4008,
198,
198,
6738,
1179,
436,
1330,
15181,
436,
11,
15941,
7248,
11,
4876,
198,
6738,
2836,
... | 3.232143 | 56 |
import tkinter
import random
#vytvorenie hernej plochy
# vytvorenie hada
# pohyb hada
# aktualizacia hry
#start programu
canvas = tkinter.Canvas(width=300,height=200)
canvas.pack()
#nastavenie globalnych premennych
had_x=[3,3,3,2,1]
had_y=[4,3,2,2,2]
had_r=[] #tu budete ukladat vykreslene stvorce
smer_x = ... | [
11748,
256,
74,
3849,
198,
11748,
4738,
198,
198,
2,
7670,
14981,
382,
11952,
607,
710,
73,
458,
5374,
88,
198,
198,
2,
410,
88,
14981,
382,
11952,
550,
64,
198,
198,
2,
745,
12114,
65,
550,
64,
220,
220,
220,
220,
220,
220,
220... | 2.101961 | 255 |
from scipy.special import binom
from scipy.stats import norm as normal, poisson
import numpy as np
from numba import jit
SQRT2PI = np.sqrt(2.0 * np.pi)
K = np.arange(1, 250)
KN = K[:, None]
JN = K[None, :]
@jit(fastmath=True, parallel=True)
# @jit
| [
6738,
629,
541,
88,
13,
20887,
1330,
9874,
296,
198,
6738,
629,
541,
88,
13,
34242,
1330,
2593,
355,
3487,
11,
745,
30927,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
997,
7012,
1330,
474,
270,
628,
198,
50,
48,
14181,
17,
11901,... | 2.37037 | 108 |
from rest_framework import serializers
from experiment_django3.insurances.models import Premium
class PremiumSerializer(serializers.ModelSerializer):
"""
For common `lookup` case
"""
class CalculatedPremiumSerializer(serializers.ModelSerializer):
"""
For `calculated premium` lookup case
"""... | [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
6306,
62,
28241,
14208,
18,
13,
1040,
31741,
13,
27530,
1330,
17315,
628,
198,
4871,
17315,
32634,
7509,
7,
46911,
11341,
13,
17633,
32634,
7509,
2599,
198,
220,
220,
220,
37227... | 3.195313 | 128 |
import sys
def merge(array, first, middle, last):
"""
Function for merging array.
:param array: array with items <list>
:param first: first index in array <int>
:param middle: middle index in array <int>
:param last: last index in array <int>
"""
left = array[first:middle]
right = ... | [
11748,
25064,
628,
198,
4299,
20121,
7,
18747,
11,
717,
11,
3504,
11,
938,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15553,
329,
35981,
7177,
13,
198,
220,
220,
220,
1058,
17143,
7177,
25,
7177,
351,
3709,
1279,
4868,
29,... | 2.317073 | 656 |
from sqlalchemy import Column, String, Integer, BigInteger
from sqlalchemy.orm import relationship
from base.models.base import BaseDBModel
| [
6738,
44161,
282,
26599,
1330,
29201,
11,
10903,
11,
34142,
11,
4403,
46541,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
2776,
198,
198,
6738,
2779,
13,
27530,
13,
8692,
1330,
7308,
11012,
17633,
198
] | 4.028571 | 35 |
# 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 ... | [
2,
15069,
1853,
37927,
13200,
13,
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,
262... | 2.962649 | 589 |
from localflavor.stub import _
#: ISO codes
REGION_CHOICES = (
('BRU', _('Brussels Capital Region')),
('VLG', _('Flemish Region')),
('WAL', _('Wallonia'))
)
| [
6738,
1179,
1604,
75,
5570,
13,
301,
549,
1330,
4808,
198,
198,
2,
25,
19694,
12416,
198,
31553,
2849,
62,
44899,
34444,
796,
357,
198,
220,
220,
220,
19203,
11473,
52,
3256,
4808,
10786,
9414,
385,
14002,
9747,
17718,
11537,
828,
198... | 2.297297 | 74 |
import logging
from better.lib import Forecaster
from .summaries import for_date_range
logger = logging.getLogger('dashboard.services.pedictions')
def throughput_history(summaries):
"""Calculates the change in completion for a list of summaries.
Args:
summaries (List[ProjectSummary]): List of proje... | [
11748,
18931,
198,
198,
6738,
1365,
13,
8019,
1330,
4558,
17970,
198,
198,
6738,
764,
82,
13929,
3166,
1330,
329,
62,
4475,
62,
9521,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
42460,
3526,
13,
30416,
13,
9124,
92... | 2.990874 | 767 |
"""This file contains the providers ids strings.
"""
# Providers
DROPBOX = 'dropbox'
ONEDRIVE = 'one_drive'
| [
37811,
1212,
2393,
4909,
262,
9549,
220,
2340,
13042,
13,
198,
37811,
198,
198,
2,
7518,
4157,
198,
7707,
3185,
39758,
796,
705,
14781,
3524,
6,
198,
1340,
1961,
49,
9306,
796,
705,
505,
62,
19472,
6,
198
] | 2.868421 | 38 |
"""
Author: Darren
Date: 11/12/2020
Solving: https://adventofcode.com/2020/day/10
The initial output from the console is 0 jolts.
We have a bag of joltage adapters.
Any adapter can take input of 1, 2 or 3 jolts lower than its rated joltage.
Our device is rated 3 jolts higher than any adapter in the bag.
Part 1: cre... | [
37811,
198,
13838,
25,
26203,
198,
10430,
25,
1367,
14,
1065,
14,
42334,
198,
198,
50,
10890,
25,
3740,
1378,
324,
1151,
1659,
8189,
13,
785,
14,
42334,
14,
820,
14,
940,
198,
198,
464,
4238,
5072,
422,
262,
8624,
318,
657,
474,
3... | 2.79064 | 406 |
from django.contrib import admin
from import_export import resources
from django.contrib.auth.decorators import permission_required
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse, path
from .models import *
import project... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
1330,
62,
39344,
1330,
4133,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
7170,
62,
35827,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
... | 2.969942 | 865 |
#!/usr/bin/env python
"""
@package ion.services.mi.test.test_data_decorator
@file ion/services/mi/test/test_data_decorator.py
@author Steve Foley
@brief Some unit tests for R2 instrument agent data decorators
"""
__author__ = 'Steve Foley'
__license__ = 'Apache 2.0'
import logging
import unittest
from mi.core.unit_t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
31,
26495,
22088,
13,
30416,
13,
11632,
13,
9288,
13,
9288,
62,
7890,
62,
12501,
273,
1352,
198,
31,
7753,
22088,
14,
30416,
14,
11632,
14,
9288,
14,
9288,
62,
7890,... | 2.910798 | 213 |
from hanoi_solver import HanoiSolver
from random import randint
import copy
class RandomHanoiSolver(HanoiSolver):
"""Solves The Hanoi Towers Problem using Random Choices (Optimized)
:param n: The number of towers.
:param m: The number of disks.
"""
def do_transition(self, tower_i, tower_j):
... | [
6738,
289,
5733,
72,
62,
82,
14375,
1330,
367,
5733,
72,
50,
14375,
198,
6738,
4738,
1330,
43720,
600,
198,
11748,
4866,
628,
198,
4871,
14534,
39,
5733,
72,
50,
14375,
7,
39,
5733,
72,
50,
14375,
2599,
198,
220,
220,
220,
37227,
... | 2.428385 | 768 |
from .custom_ner import NER
from .utils import NerDataset, Split, get_labels
from .arguments import ModelArguments, DataTrainingArguments
__version__ = "0.0.1" | [
6738,
764,
23144,
62,
1008,
1330,
399,
1137,
198,
6738,
764,
26791,
1330,
21783,
27354,
292,
316,
11,
27758,
11,
651,
62,
23912,
1424,
198,
6738,
764,
853,
2886,
1330,
9104,
28100,
2886,
11,
6060,
44357,
28100,
2886,
198,
198,
834,
96... | 3.137255 | 51 |
import pytest
from svl.compiler.errors import (
SvlSyntaxError,
SvlMissingValue,
SvlMissingParen,
SvlTypeError,
SvlUnsupportedDeclaration,
)
from svl.compiler.ast import parse_svl
def test_missing_dataset_definition():
""" Tests that the parse_svl function raises a SvlMissingValue
exc... | [
11748,
12972,
9288,
198,
198,
6738,
264,
19279,
13,
5589,
5329,
13,
48277,
1330,
357,
198,
220,
220,
220,
311,
19279,
13940,
41641,
12331,
11,
198,
220,
220,
220,
311,
19279,
43730,
11395,
11,
198,
220,
220,
220,
311,
19279,
43730,
47... | 2.593217 | 5,691 |
import numpy as np
import pytest
import tensorflow as tf
import tensorflow_probability as tfp
import gpflow
from gpflow.config import Config, as_context
from gpflow.models.util import data_input_to_tensor
from gpflow.utilities import positive, triangular
from gpflow.utilities.ops import difference_matrix
@pytest.mar... | [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
1676,
65,
1799,
355,
256,
46428,
198,
198,
11748,
27809,
11125,
198,
6738,
27809,
11125,
13,
11250,
1330... | 2.491176 | 340 |
# Starter code for Kaggle - Titanic Survivor dataset.
#
# Objective: classify Titanic passengers as surviving or perishing.
#
# Uses a SVM with Gaussian (RBF) kernel.
#
#
# By Blake French
import os
import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn... | [
2,
37460,
2438,
329,
509,
9460,
293,
532,
41184,
23740,
27039,
13,
198,
2,
220,
198,
2,
37092,
25,
36509,
41184,
10405,
355,
16997,
393,
583,
3929,
13,
198,
2,
220,
198,
2,
36965,
257,
311,
15996,
351,
12822,
31562,
357,
27912,
37,
... | 2.489894 | 1,880 |
# Copyright 2021 Cortex Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
2,
15069,
33448,
44420,
23500,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2... | 3.828125 | 192 |
import tensorrt as trt
import pycuda.driver as cuda
import pycuda.autoinit
import torch
from timeit import default_timer as timer
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
with trt.Builder(TRT_LOGGER) as builder, \
builder.create_network() as network, \
trt.OnnxParser(network, TRT_LOGGER) as parser:
... | [
11748,
11192,
273,
17034,
355,
491,
83,
198,
11748,
12972,
66,
15339,
13,
26230,
355,
269,
15339,
198,
11748,
12972,
66,
15339,
13,
23736,
15003,
198,
11748,
28034,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,
198,
5446,
51,
... | 2.16066 | 1,637 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 3 15:55:18 2014
@author: leo
"""
import numpy as np
import matplotlib.pyplot as plt
# Macros
pi = np.pi; exp = np.exp; arange = np.arange; zeros = np.zeros
indexed = lambda l, offset=0: zip(np.arange(len(l))+offset,l)
# Constantes
w = 2.0*pi*0.25
a0 = 6.0/4.0
# Funções
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
7653,
220,
513,
1315,
25,
2816,
25,
1507,
1946,
198,
31,
9800,
25,
443,
78,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
... | 1.789063 | 512 |
import requests
from time import sleep
from db import redis_connect_string, db
from utils import get_url_from_redis
import redis
import datetime
from simpyder import Spider, FAKE_UA, SimpyderConfig
from bson import ObjectId
import logging
if __name__ == "__main__":
s = BiliobAuthorSpider("biliob-author-spider")
... | [
198,
11748,
7007,
198,
6738,
640,
1330,
3993,
198,
6738,
20613,
1330,
2266,
271,
62,
8443,
62,
8841,
11,
20613,
198,
6738,
3384,
4487,
1330,
651,
62,
6371,
62,
6738,
62,
445,
271,
198,
11748,
2266,
271,
198,
11748,
4818,
8079,
198,
... | 2.733333 | 165 |
from unittest import TestCase
from flask import g
from unittest.mock import MagicMock
from maintain_frontend import main
from unit_tests.utilities import Utilities
from maintain_frontend.dependencies.session_api.user import User
from maintain_frontend.dependencies.storage_api.storage_api_service import StorageAPIServic... | [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
42903,
1330,
308,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
6738,
5529,
62,
8534,
437,
1330,
1388,
198,
6738,
4326,
62,
41989,
13,
315,
2410,
1330,
41086,
198... | 3.646154 | 130 |
height = 50
base = 60
area = lambda height, base: (height*base)/2
print(f"A triangle with height {height} and base {base} has an area of {area(height,base)}") | [
17015,
796,
2026,
201,
198,
8692,
796,
3126,
201,
198,
201,
198,
20337,
796,
37456,
6001,
11,
2779,
25,
357,
17015,
9,
8692,
20679,
17,
201,
198,
201,
198,
4798,
7,
69,
1,
32,
22950,
351,
6001,
1391,
17015,
92,
290,
2779,
1391,
86... | 2.894737 | 57 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: BSD
# https://raw.githubusercontent.com/splintered-reality/py_trees_ros/devel/LICENSE
#
##############################################################################
# Description
#############################################################################... | [
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,
198,
2,
13789,
25,
347,
10305,
198,
2,
220,
220,
3740,
1378,
1831,
13,
12567,
43667,
13,
785,
14,
22018,
600... | 2.543854 | 5,906 |
import socket
| [
11748,
17802,
628
] | 5 | 3 |
#! /usr/bin/env python
'''
Description : A simple video recorder, support Windows and Linux.
Requirments : opencv-python>=4.2.0.34, numpy
FilePath : /qxtoolkit/qxtoolkit/cam_record.py
Author : qxsoftware@163.com
Date : 2020-10-14 08:29:17
LastEditTime: 2021-08-25 15:26:53
Refer to : https://github.com... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
11828,
1058,
317,
2829,
2008,
38156,
11,
1104,
3964,
290,
7020,
13,
198,
16844,
343,
902,
1058,
1280,
33967,
12,
29412,
29,
28,
19,
13,
17,
13,
15,
13,
2682,
11,
... | 2.128673 | 1,974 |
load("@bazel_gazelle//:deps.bzl", "go_repository")
| [
2220,
7203,
31,
65,
41319,
62,
70,
1031,
13485,
1003,
25,
10378,
82,
13,
65,
48274,
1600,
366,
2188,
62,
260,
1930,
37765,
4943,
198
] | 2.04 | 25 |
"""
Cool Functions
Cool functions for my every day work!
Functions:
"""
import graficos as graficos
import swift_A as swift_A
| [
37811,
198,
34530,
40480,
198,
198,
34530,
5499,
329,
616,
790,
1110,
670,
0,
198,
198,
24629,
2733,
25,
198,
198,
37811,
198,
198,
11748,
7933,
69,
291,
418,
355,
7933,
69,
291,
418,
198,
11748,
14622,
62,
32,
355,
14622,
62,
32,
... | 2.954545 | 44 |
# -*- coding: utf-8 -*-
import unittest
from functools import partial
try:
import torch
except ImportError:
TORCH_AVAILABLE = False
else:
TORCH_AVAILABLE = True
from dival.util.torch_utility import (
RandomAccessTorchDataset, GeneratorTorchDataset,
load_state_dict_convert_data_parallel, ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
555,
715,
395,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
28311,
25,
198,
220,
220,
220,
1330,
28034,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
40691,... | 2.419103 | 513 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
command_executor = 'http://localhost:4445/... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
17077,
1330,
5313,
32103,
21321,
198,
6738,
384,
11... | 2.496674 | 451 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from re import sub, finditer
import subprocess
from odoo.addons.hw_drivers.interface import Interface
| [
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,
302,
1330,
850,
11,
1064,
2676,
198,
11748,
850,
14681,
... | 3.4 | 60 |