content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Copyright (c) 2020 PaddlePaddle Authors. 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 app... | [
2,
220,
220,
15069,
357,
66,
8,
12131,
350,
37382,
47,
37382,
46665,
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,
... | 3.099145 | 585 |
"""
MyMemory Translated
@website https://mymemory.translated.net/
@provide-api yes (https://mymemory.translated.net/doc/spec.php)
@using-api yes
@results JSON
@stable yes
@parse url, title, content
"""
import re
from sys import version_info
from searx.utils import is_valid_lang
if version_... | [
37811,
198,
2011,
30871,
3602,
17249,
628,
2488,
732,
12485,
220,
220,
220,
220,
3740,
1378,
1820,
31673,
13,
7645,
17249,
13,
3262,
14,
198,
2488,
15234,
485,
12,
15042,
3763,
357,
5450,
1378,
1820,
31673,
13,
7645,
17249,
13,
3262,
... | 2.42803 | 264 |
import numpy as np
np.set_printoptions(formatter={'float': lambda x: "{0:0.3f}".format(x)})
import matplotlib.pyplot as plt
import tensorflow as tf
import logging
import os
from scipy.io import savemat
from scipy.stats import norm
logger = logging.getLogger("logger")
###################################
####... | [
11748,
299,
32152,
355,
45941,
198,
198,
37659,
13,
2617,
62,
4798,
25811,
7,
687,
1436,
34758,
6,
22468,
10354,
37456,
2124,
25,
45144,
15,
25,
15,
13,
18,
69,
92,
1911,
18982,
7,
87,
8,
30072,
198,
11748,
2603,
29487,
8019,
13,
... | 3.268908 | 119 |
import pytest
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 2.428571 | 28 |
import uuid
from thundra import constants, utils
from thundra.application.application_info_provider import ApplicationInfoProvider
| [
11748,
334,
27112,
198,
198,
6738,
294,
917,
430,
1330,
38491,
11,
3384,
4487,
198,
6738,
294,
917,
430,
13,
31438,
13,
31438,
62,
10951,
62,
15234,
1304,
1330,
15678,
12360,
29495,
628
] | 4.030303 | 33 |
import functools
import logging
from spaceone.api.inventory.v1 import resource_group_pb2
from spaceone.core.pygrpc.message_type import *
from spaceone.core import utils
from spaceone.inventory.model.resource_group_model import ResourceGroup, Resource
__all__ = ['ResourceGroupInfo', 'ResourceGroupsInfo']
_LOGGER = log... | [
11748,
1257,
310,
10141,
198,
11748,
18931,
198,
6738,
2272,
505,
13,
15042,
13,
24807,
13,
85,
16,
1330,
8271,
62,
8094,
62,
40842,
17,
198,
6738,
2272,
505,
13,
7295,
13,
9078,
2164,
14751,
13,
20500,
62,
4906,
1330,
1635,
198,
67... | 3.346154 | 104 |
"""
Train the NN model.
"""
import sys
import _thread
import keras
import warnings
import argparse
import numpy as np
import pandas as pd
from data.data import process_data
from model import model
from keras.models import Model
from keras.callbacks import EarlyStopping
from tkinter import ttk, filedialog, dialog
import... | [
37811,
198,
44077,
262,
399,
45,
2746,
13,
198,
37811,
198,
11748,
25064,
198,
11748,
4808,
16663,
198,
11748,
41927,
292,
198,
11748,
14601,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
... | 2.330321 | 996 |
# stdlib
import random
# third party
import numpy as np
import torch
| [
2,
14367,
8019,
198,
11748,
4738,
198,
198,
2,
2368,
2151,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
628
] | 3.380952 | 21 |
from fcrepo_verify.utils import get_data_dir, replace_strings_in_file
from fcrepo_verify.constants import BAG_DATA_DIR
import os
import tempfile
config = MockConfig({})
config.dir = "/tmp"
| [
6738,
277,
7513,
7501,
62,
332,
1958,
13,
26791,
1330,
651,
62,
7890,
62,
15908,
11,
6330,
62,
37336,
62,
259,
62,
7753,
198,
6738,
277,
7513,
7501,
62,
332,
1958,
13,
9979,
1187,
1330,
347,
4760,
62,
26947,
62,
34720,
198,
11748,
... | 2.910448 | 67 |
import logging
import os
import traceback
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, Input
from dash.exceptions import PreventUpdate
from plotly import graph_objects
from .dash_app import DashApp
from ._plotly_plots import plot_scalars
from .player_con... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
12854,
1891,
198,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
198,
11748,
14470,
62,
6494,
62,
5589,
3906,
355,
27711,
198,
6738,
14470,
13,
45841,
3976,
1330,
25235,
11,
2341... | 3.055777 | 251 |
from flask import Flask
from filesbuilder import FilesBuilder
from inputoutput import IO
#writeExcelFile
if __name__ == '__main__':
App = Bootstrap()
App.run() | [
6738,
42903,
1330,
46947,
198,
6738,
3696,
38272,
1330,
13283,
32875,
198,
6738,
5128,
22915,
1330,
24418,
628,
198,
2,
13564,
3109,
5276,
8979,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
203... | 3.226415 | 53 |
"""
Ax_Metrics - Test io.emfetch package
------------------------------------------------------------------------------
Author: Dan Kamins <dos at axonchisel dot net>
Copyright (c) 2014 Dan Kamins, AxonChisel.net
"""
# ----------------------------------------------------------------------------
import pytest
impo... | [
37811,
198,
31554,
62,
9171,
10466,
532,
6208,
33245,
13,
368,
69,
7569,
5301,
198,
198,
10097,
26171,
198,
13838,
25,
6035,
12670,
1040,
1279,
37427,
379,
7877,
261,
354,
36811,
16605,
2010,
29,
198,
15269,
357,
66,
8,
1946,
6035,
12... | 3.344828 | 261 |
# Importando apenas uma funcionalidade da biblioteca - peça a raiz quadrada de um número e arredonde ele para cima.
from math import sqrt, ceil
n = float(input('Digite um número para ver a sua raiz quadrada: '))
print('A raiz quadrada de {} é {}' .format(n, sqrt(n)))
| [
2,
17267,
25440,
2471,
268,
292,
334,
2611,
25439,
1538,
312,
671,
12379,
275,
29142,
313,
31047,
532,
613,
50041,
257,
2179,
528,
15094,
81,
4763,
390,
23781,
299,
21356,
647,
78,
304,
610,
445,
14378,
9766,
31215,
269,
8083,
13,
198... | 2.61165 | 103 |
import pytest
from hamcrest import assert_that, contains_inanyorder
from tests.testing_utils import param_wrapper, run_flake8, run_pylint
strip_params = [
# code, flake8 rules, pylint rules
param_wrapper("s.strip('abca')", {'B005'}, set(), id='strip_string'),
param_wrapper(r"s.strip(r'\n\t ')", {'B005'}, ... | [
11748,
12972,
9288,
198,
6738,
8891,
66,
2118,
1330,
6818,
62,
5562,
11,
4909,
62,
259,
1092,
2875,
198,
198,
6738,
5254,
13,
33407,
62,
26791,
1330,
5772,
62,
48553,
11,
1057,
62,
47597,
23,
11,
1057,
62,
79,
2645,
600,
198,
198,
... | 2.430421 | 309 |
from tapis_cli.display import Verbosity
from tapis_cli.clients.services.mixins import Username
from . import API_NAME, SERVICE_VERSION
from .models import Profile
from .formatters import ProfilesFormatOne
__all__ = ['ProfilesShow']
| [
6738,
9814,
271,
62,
44506,
13,
13812,
1330,
49973,
16579,
198,
6738,
9814,
271,
62,
44506,
13,
565,
2334,
13,
30416,
13,
19816,
1040,
1330,
50069,
198,
198,
6738,
764,
1330,
7824,
62,
20608,
11,
47453,
62,
43717,
198,
6738,
764,
2753... | 3.560606 | 66 |
from dazzler import Dazzler
from dazzler.components import core
from dazzler.system import Page, BindingContext, Trigger
from tests.components import spec_components as spec
app = Dazzler(__name__)
aspect_types = {
'array': {
'value': [1, 2, 3],
'json': True,
},
'bool': {
'value':... | [
6738,
32282,
1754,
1330,
360,
8101,
1754,
198,
6738,
32282,
1754,
13,
5589,
3906,
1330,
4755,
198,
6738,
32282,
1754,
13,
10057,
1330,
7873,
11,
38904,
21947,
11,
24593,
198,
198,
6738,
5254,
13,
5589,
3906,
1330,
1020,
62,
5589,
3906,
... | 2.178631 | 599 |
import graphene
from ..types import ErrorType # noqa Import ErrorType for backwards compatability
| [
11748,
42463,
198,
198,
6738,
11485,
19199,
1330,
13047,
6030,
220,
1303,
645,
20402,
17267,
13047,
6030,
329,
16196,
8330,
1799,
198
] | 4.545455 | 22 |
#MenuTitle: Access to segments
# -*- coding: utf-8 -*-
from GlyphsApp.plugins import *
g = Glyphs.font.selectedLayers[0].parent
paths = Glyphs.font.selectedLayers[0].paths
for path in paths:
segments = path.segments
for segment in segments:
print type(segment.points[0]), dir(segment.points[0])
| [
2,
23381,
19160,
25,
8798,
284,
17894,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
27949,
746,
82,
4677,
13,
37390,
1330,
1635,
198,
198,
70,
796,
27949,
746,
82,
13,
10331,
13,
34213,
43,
6962,
... | 2.608333 | 120 |
import sys
sys.path.append('/opt')
import os
import boto3
import json
import dill
import ast
import base64
import shutil
import time
import pandas as pd
from boto3 import resource
from boto3.dynamodb.conditions import Key, Attr
# Dynamo Config
dynamo_resource = resource('dynamodb')
dynamo = boto3.client('dynamodb')... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
14,
8738,
11537,
198,
11748,
28686,
198,
11748,
275,
2069,
18,
198,
11748,
33918,
198,
11748,
288,
359,
198,
11748,
6468,
198,
11748,
2779,
2414,
198,
11748,
4423,
346,
198,
11748,
6... | 2.489627 | 241 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
13130,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 2.619792 | 1,536 |
import csv
import os
import shutil
from random import randint
from uuid import uuid4
import cherrypy
import numpy as np
from cherrypy.lib.static import serve_file
from ics.classifier.classifier import NO_LABEL, YES_LABEL
from ics.db.sqlalchemydb import SQLAlchemyDB, Job, ClassificationMode, LabelSource
from ics.util.... | [
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
4738,
1330,
43720,
600,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
198,
11748,
23612,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
23612,
9078,
13,
8... | 2.947674 | 172 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from datetime import datetime,timedelta
from dateutil.relativedelta import relativedelta
from frappe.utils ... | [
2,
15069,
357,
66,
8,
1853,
11,
39313,
27768,
21852,
18367,
83,
13,
12052,
13,
290,
25767,
669,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
8... | 3.731183 | 93 |
import ctypes # used for accessing the dynamic library
import graph_partitioning.partitioners.utils as putils # used for some of the utilities functions
| [
11748,
269,
19199,
1303,
973,
329,
22534,
262,
8925,
5888,
198,
198,
11748,
4823,
62,
3911,
653,
278,
13,
3911,
653,
364,
13,
26791,
355,
1234,
4487,
1303,
973,
329,
617,
286,
262,
20081,
5499,
628
] | 4.305556 | 36 |
# coding: UTF-8
import sys
import os
import numpy as np
# unit is [us].
if __name__ == "__main__":
argc = len(sys.argv)
# 単位はus
dirname = sys.argv[1]
mu = int(sys.argv[2])
M = int(sys.argv[3])
N = int(sys.argv[4])
for trial in range(N):
print(run(dirname, mu, M, trial))
p... | [
2,
19617,
25,
41002,
12,
23,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
4326,
318,
685,
385,
4083,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
22... | 1.923977 | 171 |
#Django
from django.apps import AppConfig
class EncuestasAppConfig(AppConfig):
"""Encuestas app config"""
name = 'encuestas.encuesta'
verbose_name = 'Encuestas' | [
2,
35,
73,
14208,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
198,
4871,
14711,
84,
395,
292,
4677,
16934,
7,
4677,
16934,
2599,
198,
220,
220,
220,
37227,
27195,
84,
395,
292,
598,
4566,
37811,
628,
220,
220,
220,
1... | 2.521739 | 69 |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Manipulating the order of items in a deque.
"""
#end_pymotw_header
import collections
d = collections.deque(range(10))
print('Normal :', d)
d = collections.deque(range(10))
d.rotate(2)
print('Right rotation... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
357,
66,
8,
3648,
15115,
5783,
9038,
1439,
2489,
10395,
13,
198,
2,
198,
37811,
5124,
541,
8306,
262,
1502,
286,
3709,
... | 2.61039 | 154 |
import numpy as np
import scipy
import scipy.optimize
import argparse
import sklearn.metrics
import matplotlib.pyplot as plt
import autograd.scipy
import autograd.numpy as ag_np
import autograd
import pandas as pd
## TODO:
# - Need a mapping from timesteps to dates
################## Functions for fitting data ####... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
198,
11748,
629,
541,
88,
13,
40085,
1096,
198,
11748,
1822,
29572,
198,
11748,
1341,
35720,
13,
4164,
10466,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
... | 2.199675 | 1,232 |
import numpy as np
from numba.core import types
from numba.extending import overload
@overload(np.where)
def where(cond, x, y):
"""
Implement np.where().
"""
# Choose implementation based on argument types.
if isinstance(cond, types.Array):
# Array where() => return an array of the same sh... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
997,
7012,
13,
7295,
1330,
3858,
198,
6738,
997,
7012,
13,
2302,
1571,
1330,
31754,
198,
198,
31,
2502,
2220,
7,
37659,
13,
3003,
8,
198,
4299,
810,
7,
17561,
11,
2124,
11,
331,
2599,
... | 1.868943 | 908 |
import os
import cv2
import itertools
import numpy as np
def dump_images(
names, pil_images, annotations, detections, stats,
labelmap, dir):
"""
Dumps images with bbox overlays to disk.
:param names: batch of sample names
:param pil_images: batch of original PIL images
:param anno... | [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
340,
861,
10141,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
10285,
62,
17566,
7,
198,
220,
220,
220,
220,
220,
220,
220,
3891,
11,
5560,
62,
17566,
11,
37647,
11,
4886,
507... | 1.681693 | 1,819 |
from peewee import *
from playhouse.gfk import *
from playhouse.tests.base import database_initializer
from playhouse.tests.base import ModelTestCase
db = database_initializer.get_in_memory_database()
| [
6738,
613,
413,
1453,
1330,
1635,
198,
6738,
711,
4803,
13,
70,
69,
74,
1330,
1635,
198,
6738,
711,
4803,
13,
41989,
13,
8692,
1330,
6831,
62,
36733,
7509,
198,
6738,
711,
4803,
13,
41989,
13,
8692,
1330,
9104,
14402,
20448,
628,
19... | 3.433333 | 60 |
from discord.ext import commands
import requests
from discord import Embed
from disputils import BotEmbedPaginator
| [
6738,
36446,
13,
2302,
1330,
9729,
198,
11748,
7007,
198,
6738,
36446,
1330,
13302,
276,
198,
6738,
595,
1996,
4487,
1330,
18579,
31567,
276,
47,
363,
20900,
628
] | 4.142857 | 28 |
import typer
app = typer.Typer()
@app.callback('example_plugin')
def check_cmd_group():
"""Example plugin."""
@app.command("first_command")
def _first_command():
"""Example command."""
| [
11748,
1259,
525,
198,
198,
1324,
796,
1259,
525,
13,
25492,
525,
3419,
198,
198,
31,
1324,
13,
47423,
10786,
20688,
62,
33803,
11537,
198,
4299,
2198,
62,
28758,
62,
8094,
33529,
198,
220,
220,
220,
37227,
16281,
13877,
526,
15931,
1... | 2.84058 | 69 |
#!/usr/bin/env python3
# coding: utf-8
import pytest # type: ignore
from state import Board, Piece, GameState, GameMove
import dataclasses, json
def test_2_players_board_init(monkeypatch):
"""Make sure if we have just two players in a 4 corner board for them
to be at the opposite corners instead of next to... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
12972,
9288,
220,
1303,
2099,
25,
8856,
198,
6738,
1181,
1330,
5926,
11,
27053,
11,
3776,
9012,
11,
3776,
21774,
198,
11748,
4818... | 2.41218 | 1,133 |
__all__ = [
'MultiLayerAtmosphere',
'AtmosphericLayer',
'phase_covariance_von_karman',
'phase_structure_function_von_karman',
'power_spectral_density_von_karman',
'Cn_squared_from_fried_parameter',
'fried_parameter_from_Cn_squared',
'seeing_to_fried_parameter',
'fried_parameter_to_se... | [
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
29800,
49925,
2953,
6384,
1456,
3256,
198,
220,
220,
220,
705,
2953,
6384,
15011,
49925,
3256,
198,
220,
220,
220,
705,
40715,
62,
66,
709,
2743,
590,
62,
26982,
62,
21070,
805,
3256... | 2.525362 | 276 |
# ---------------------------------------------------------------------------
#
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in /LICENSE.txt and may be redistributed only
# under the conditions described in... | [
2,
16529,
32284,
198,
2,
198,
2,
220,
15069,
357,
66,
8,
1946,
11,
2039,
28895,
11,
3457,
13,
198,
2,
220,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
770,
3788,
318,
2810,
1231,
18215,
739,
262,
2846,
286,
262,
347,
10305,
198,... | 2.708159 | 956 |
from django.shortcuts import render
from django.http import HttpResponse
from .models import Image
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
764,
27530,
1330,
7412,
198,
198,
2,
13610,
534,
5009,
994,
13,
198
] | 3.818182 | 33 |
#! /usr/bin/env python
from wordfreq import word_frequency, iter_wordlist
import regex
iter = iter_wordlist('en', 'large')
re_nonlatin = regex.compile('[^-_\p{Latin}\d\.\']')
re_alphabet = regex.compile('[a-z]', regex.IGNORECASE)
re_underscore = regex.compile('_')
last_freq = -1
position = 0
current_line = 0
for wo... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
1573,
19503,
80,
1330,
1573,
62,
35324,
11,
11629,
62,
4775,
4868,
198,
11748,
40364,
198,
198,
2676,
796,
11629,
62,
4775,
4868,
10786,
268,
3256,
705,
11664,
11537,
198,... | 2.258333 | 360 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ast
import codecs
import os.path
import re
import subprocess
import sys
from codecs import open
from distutils import log
from distutils.errors import DistutilsError
from setuptools import find_packages, setup
from setuptools.command.install import install
from setu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
6468,
198,
11748,
40481,
82,
198,
11748,
28686,
13,
6978,
198,
11748,
302,
198,
11748,
850,
14681,
198,
11748,
2... | 2.500688 | 727 |
# Rotate Sprite
# Demonstrates rotating a sprite
from livewires import games
games.init(screen_width = 640, screen_height = 480, fps = 50)
class Ship(games.Sprite):
""" A rotating ship. """
def update(self):
""" Rotate based on keys pressed. """
if games.keyboard.is_pressed(games.K_RIGHT):
... | [
2,
18481,
378,
33132,
198,
2,
7814,
2536,
689,
24012,
257,
33810,
198,
198,
6738,
2107,
86,
2387,
1330,
1830,
198,
198,
19966,
13,
15003,
7,
9612,
62,
10394,
796,
33759,
11,
3159,
62,
17015,
796,
23487,
11,
32977,
796,
2026,
8,
198,... | 2.151429 | 350 |
__all__ = ['get_bond_yields','get_company','get_fund','get_manager','get_stock_holders','return_rate_dao'] | [
834,
439,
834,
796,
37250,
1136,
62,
65,
623,
62,
88,
1164,
82,
41707,
1136,
62,
39722,
41707,
1136,
62,
10990,
41707,
1136,
62,
37153,
41707,
1136,
62,
13578,
62,
10476,
41707,
7783,
62,
4873,
62,
67,
5488,
20520
] | 2.717949 | 39 |
# -*- coding: utf-8 -*-
import numpy as np
from matplotlib import pyplot as plt
from anaflow import ext_thiem_3d, ext_grf_steady
from anaflow.tools.coarse_graining import K_CG
rad = np.geomspace(0.05, 4) # radius from the pumping well in [0, 4]
r_ref = 2.0 # reference radius
var = 0.5 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
281,
1878,
9319,
1330,
1070,
62,
400,
26597,
62,
18,
67,
11,
... | 2.08658 | 462 |
from os.path import join, isdir
from os import makedirs
from matplotlib.backends.backend_pdf import PdfPages
from source.model.structure_model import StraightBeam
from source.auxiliary.validate_and_assign_defaults import validate_and_assign_defaults
from source.auxiliary.other_utilities import get_adjusted_path_string... | [
6738,
28686,
13,
6978,
1330,
4654,
11,
318,
15908,
198,
6738,
28686,
1330,
285,
4335,
17062,
198,
6738,
2603,
29487,
8019,
13,
1891,
2412,
13,
1891,
437,
62,
12315,
1330,
350,
7568,
47798,
198,
198,
6738,
2723,
13,
19849,
13,
301,
562... | 2.615385 | 338 |
import trodesnetwork.socket as socket
import trodesnetwork.trodes as trodes
import threading
'''
Use this class to subscribe to analog sources
Requires input of a channel map object. The channel map is just
a JSON-like dictionary of the XML HardwareConfiguration node
in the `.trodesconfig` file.
Requires a server_a... | [
11748,
4161,
8906,
27349,
13,
44971,
355,
17802,
198,
11748,
4161,
8906,
27349,
13,
23528,
8906,
355,
4161,
8906,
198,
198,
11748,
4704,
278,
198,
198,
7061,
6,
198,
11041,
428,
1398,
284,
12383,
284,
15075,
4237,
198,
198,
39618,
5128,... | 3.28934 | 197 |
class MockRequest(object):
'''
This is a mocked Request object containing only an url,
as this is the only attribute accessed during the tests.
There is a default value for it, but it can also be passed.
'''
class MockSolrResponse(object):
'''
This is a mocked Response object (can be used ... | [
198,
4871,
44123,
18453,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
770,
318,
257,
29180,
19390,
2134,
7268,
691,
281,
19016,
11,
198,
220,
220,
220,
355,
428,
318,
262,
691,
11688,
17535,
1141,
262,
5254,
13... | 3.273128 | 227 |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
2177,
11,
13130,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
... | 1.985046 | 8,760 |
"""
Module:
unicon.plugins.ironware.settings
Author:
James Di Trapani <james@ditrapani.com.au> - https://github.com/jamesditrapani
Description:
Define/Override Generic Settings specific to the Ironware NOS
"""
from unicon.plugins.generic.settings import GenericSettings
__author__ = "James Di Trapani <ja... | [
37811,
198,
26796,
25,
198,
220,
220,
220,
555,
4749,
13,
37390,
13,
1934,
1574,
13,
33692,
198,
198,
13838,
25,
198,
220,
220,
220,
3700,
6031,
21914,
3216,
1279,
73,
1047,
31,
5266,
2416,
3216,
13,
785,
13,
559,
29,
532,
3740,
1... | 3.017544 | 114 |
#!/usr/bin/python
#import sys
# sys.path.append('/home/ruben/leaf/pycarwings2/pycarwings2')
import pycarwings2
import time
from ConfigParser import SafeConfigParser
import logging
import sys
import pprint
logging.basicConfig(stream=sys.stdout, level=logging.ERROR)
parser = SafeConfigParser()
candidates = ['config.... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
11748,
25064,
198,
2,
25064,
13,
6978,
13,
33295,
10786,
14,
11195,
14,
25089,
268,
14,
33201,
14,
9078,
7718,
48819,
17,
14,
9078,
7718,
48819,
17,
11537,
198,
198,
11748,
12972,
7... | 2.797521 | 484 |
from pypy.translator.oosupport.constant import is_primitive
from pypy.rpython.ootypesystem import ootype
| [
6738,
279,
4464,
88,
13,
7645,
41880,
13,
16426,
84,
4926,
13,
9979,
415,
1330,
318,
62,
19795,
1800,
198,
6738,
279,
4464,
88,
13,
81,
29412,
13,
1025,
9497,
6781,
1330,
267,
8690,
628
] | 3.028571 | 35 |
from ml100k import recommenderMl100k
import time as tm
from distances import recommender
s = recommender(0)
s.readMovies()
'''
s = recommender(0,k=3,metric='manhattan')
s.readBooks()
#print(s.jaccard(s.data['Stephen'],s.data['Amy']))
print(s.ProjectedRanting('Patrick C','Scarface'))
'''
'''
r = recommenderMl100k(0,me... | [
6738,
25962,
3064,
74,
1330,
3045,
2194,
44,
75,
3064,
74,
198,
11748,
640,
355,
256,
76,
198,
6738,
18868,
1330,
3045,
2194,
198,
198,
82,
796,
3045,
2194,
7,
15,
8,
198,
82,
13,
961,
44,
20526,
3419,
198,
198,
7061,
6,
198,
82... | 2.368182 | 220 |
import os
import seaborn as sns
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from textwrap import wrap
### NOTE: `conda install basemap`
import conda
conda_file_dir = conda.__file__
conda_dir = conda_file_dir.split('lib')[0]
proj_lib = os.path.join(os.path.join(co... | [
11748,
28686,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
4818,
8079,
1330,
4818,
8079,
... | 2.139079 | 6,428 |
"""
Вывести в порядке возрастания все простые числа, расположенные между n и m (включая сами числа n и m),
а также количество x этих чисел.
"""
start_number = int(input("Enter start number:"))
end_number = int(input("Enter end number:"))
# Generate elements from start_number to end_number (including)
my_count = 0
fo... | [
37811,
198,
140,
240,
45035,
38857,
16843,
21727,
20375,
18849,
12466,
110,
12466,
123,
15166,
21169,
40623,
43666,
31583,
16843,
12466,
110,
25443,
115,
21169,
16142,
21727,
20375,
16142,
22177,
18849,
40623,
12466,
110,
21727,
16843,
12466,
... | 2.13217 | 401 |
import pandas as pd
import smtplib
import imghdr
from email.message import EmailMessage
SenderAddress = "XYZ@gmail.com"
password = "ndXX@XX3$#XXX"
e = pd.read_excel("email.xlsx")
emails = e['Emails'].values
names = e["Names"].values
file = "banner.jpg"
msg = EmailMessage()
msg['Subject'] = "Hello world - dynamic"
msg... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
895,
83,
489,
571,
198,
11748,
545,
456,
7109,
198,
6738,
3053,
13,
20500,
1330,
9570,
12837,
198,
198,
50,
2194,
20231,
796,
366,
34278,
57,
31,
14816,
13,
785,
1,
198,
28712,
796,
366,
... | 2.524554 | 448 |
def set_points(self, points):
"""
Set coordinate polygon by given string.
Moreover, invalidate the parent's ``pc:AlternativeImage``s
(because they will have been cropped with a bbox
of the previous polygon).
"""
if hasattr(self, 'parent_object_'):
parent = self.parent_object_
... | [
4299,
900,
62,
13033,
7,
944,
11,
2173,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5345,
20435,
7514,
14520,
416,
1813,
4731,
13,
198,
220,
220,
220,
10968,
11,
12515,
378,
262,
2560,
338,
7559,
14751,
25,
49788,
5159,
155... | 2.651079 | 278 |
"""This module provides functions that make sure environment to be compatible with RLlib. If Rllib is not used, please
directly use the wrapper in comm_channel.py."""
import numpy as np
from pettingzoo.utils.conversions import to_parallel_wrapper
from pettingzoo.utils.wrappers import AssertOutOfBoundsWrapper, OrderEnf... | [
37811,
1212,
8265,
3769,
5499,
326,
787,
1654,
2858,
284,
307,
11670,
351,
45715,
8019,
13,
1002,
371,
297,
571,
318,
407,
973,
11,
3387,
198,
12942,
306,
779,
262,
29908,
287,
725,
62,
17620,
13,
9078,
526,
15931,
198,
198,
11748,
... | 3.283537 | 328 |
import abc
import random
import string
from typing import Generator, Iterable, Mapping, Optional, Tuple
| [
11748,
450,
66,
198,
11748,
4738,
198,
11748,
4731,
198,
6738,
19720,
1330,
35986,
11,
40806,
540,
11,
337,
5912,
11,
32233,
11,
309,
29291,
628,
628,
628
] | 3.892857 | 28 |
# 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
# distributed under the ... | [
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,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
19... | 3.594005 | 367 |
import brownie
YEAR = 86400 * 365
| [
11748,
7586,
494,
198,
198,
56,
17133,
796,
807,
2414,
405,
1635,
21268,
628,
628
] | 2.533333 | 15 |
from ta.momentum import rsi
if __name__ == "__main__":
_rsi14 = rsi(Closes, 14)
| [
6738,
20486,
13,
32542,
298,
388,
1330,
374,
13396,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
4808,
3808,
72,
1415,
796,
374,
13396,
7,
2601,
4629,
11,
1478,
8,
198
] | 2.179487 | 39 |
import lib1 as iks
| [
11748,
9195,
16,
355,
1312,
591,
198
] | 2.714286 | 7 |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | [
2,
10097,
26171,
198,
2,
15069,
357,
66,
8,
2211,
11,
399,
14913,
291,
7712,
4816,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
287,
262,
2393,
279... | 2.224138 | 1,044 |
__author__='administrator'
# -*- coding:utf-8 -*-
import unittest
import time
# if __name__=="__main__":
# unittest.main()
# tester=Test()
# tester.setUp()
# tester.test01()
# tester.test02()
# tester.test03()
# tester.tearDown() | [
834,
9800,
834,
11639,
39081,
12392,
6,
201,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
201,
198,
11748,
555,
715,
395,
201,
198,
11748,
640,
201,
198,
201,
198,
2,
611,
11593,
3672,
834,
855,
1,
834,
12417,
834,
... | 1.970803 | 137 |
from scipy import fftpack, ndimage, signal
import numpy as np
import threading
#from scipy._lib._version import NumpyVersion
_rfft_mt_safe = True # (NumpyVersion(np.__version__) >= '1.9.0.dev-e24486e')
_rfft_lock = threading.Lock()
import lenstronomy.Util.kernel_util as kernel_util
import lenstronomy.Util.util as uti... | [
6738,
629,
541,
88,
1330,
277,
701,
8002,
11,
299,
67,
9060,
11,
6737,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4704,
278,
198,
2,
6738,
629,
541,
88,
13557,
8019,
13557,
9641,
1330,
399,
32152,
14815,
198,
62,
81,
487,
83,
... | 2.278181 | 6,618 |
import plistlib
filename = "/Applications/Safari.app/Contents/Info.plist"
info = plistlib.readPlist(filename)
info["CFBundleGetInfoString"]
version = info["CFBundleShortVersionString"]
print version
print info["CFBundleURLTypes"]
print info["CFBundleURLTypes"][0]
print info["CFBundleURLTypes"][0]["CFBundleURLSchem... | [
11748,
458,
396,
8019,
198,
34345,
796,
12813,
41995,
14,
50,
1878,
2743,
13,
1324,
14,
15842,
14,
12360,
13,
489,
396,
1,
198,
10951,
796,
458,
396,
8019,
13,
961,
3646,
396,
7,
34345,
8,
198,
10951,
14692,
22495,
33,
31249,
3855,
... | 2.83237 | 173 |
# Generated by Django 4.0 on 2022-03-28 09:59
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
319,
33160,
12,
3070,
12,
2078,
7769,
25,
3270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import Q
from django.http import Http404
from django.shortcuts impo... | [
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,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
17594,
62,
35827,
198,
6738,
4... | 3.322581 | 186 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
HTTP Protocol Binding implementation.
.. autosummary::
:toctree: _http
wotpy.protocols.http.handlers
wotpy.protocols.http.client
wotpy.protocols.http.enums
wotpy.protocols.http.server
"""
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
40717,
20497,
38904,
7822,
13,
198,
198,
492,
44619,
388,
6874,
3712,
198,
220,
220,
220,
1058,
1462,
... | 2.289474 | 114 |
from dwave_networkx.utils import binary_quadratic_model_sampler
__all__ = ["maximum_independent_set", "is_independent_set"]
@binary_quadratic_model_sampler(1)
def maximum_independent_set(G, sampler=None, **sampler_args):
"""Returns an approximate maximum independent set.
Defines a QUBO with ground states co... | [
6738,
288,
19204,
62,
27349,
87,
13,
26791,
1330,
13934,
62,
421,
41909,
1512,
62,
19849,
62,
37687,
20053,
198,
198,
834,
439,
834,
796,
14631,
47033,
62,
34750,
62,
2617,
1600,
366,
271,
62,
34750,
62,
2617,
8973,
628,
198,
31,
39... | 3.020202 | 1,188 |
#!/usr/bin/env python3
"""
Launcher for AoC 2016 puzzles.
Handles puzzle selection and puzzle input.
"""
import day_1_no_time_for_a_taxicab as d1
import day_2_bathroom_security as d2
if __name__ == '__main__':
AVAILABLE_PUZZLES = {1: run_taxicab, 2:run_keypad}
print('Welcome to inifinity! Try an available so... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
46182,
2044,
329,
27378,
34,
1584,
24367,
13,
198,
12885,
829,
15027,
6356,
290,
15027,
5128,
13,
198,
37811,
198,
198,
11748,
1110,
62,
16,
62,
3919,
62,
2435,
... | 2.143478 | 460 |
from django import forms
from models import Student
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
4981,
1330,
13613,
198,
197,
197,
197
] | 3.928571 | 14 |
from django.db import models
from django.contrib.auth.models import User
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
201,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
201,
198,
201,
198,
201,
198
] | 2.925926 | 27 |
from _thread import *
import threading
import socket
import json
# team: PWA
# member: 0870508 Tyas van de Spree
# member: 0966770 Maarten de Goede
# class: DINF2
BYTE_SIZE = 1024
TEAMNAME = "PWA" # programmers with attitude
CLASSNAME = "DINF2"
TEAMMATESTUDENTNR = ''
STUDENTNR = input("Please provide your student... | [
6738,
4808,
16663,
1330,
1635,
198,
11748,
4704,
278,
198,
11748,
17802,
198,
11748,
33918,
198,
198,
2,
1074,
25,
350,
15543,
198,
2,
2888,
25,
8487,
2154,
33042,
7039,
292,
5719,
390,
1338,
631,
198,
2,
2888,
25,
7769,
28933,
2154,
... | 2.75 | 384 |
from typing import Callable, Optional
from airflow.decorators.base import task_decorator_factory
from astro.sql.operators.sql_dataframe import SqlDataframeOperator
def dataframe(
python_callable: Optional[Callable] = None,
multiple_outputs: Optional[bool] = None,
conn_id: str = "",
database: Optiona... | [
6738,
19720,
1330,
4889,
540,
11,
32233,
198,
198,
6738,
45771,
13,
12501,
273,
2024,
13,
8692,
1330,
4876,
62,
12501,
273,
1352,
62,
69,
9548,
198,
198,
6738,
6468,
305,
13,
25410,
13,
3575,
2024,
13,
25410,
62,
7890,
14535,
1330,
... | 2.685268 | 448 |
from django.urls import path
from . import views
urlpatterns = [
path(r'classroom/', views.classroom, name='classroom'),
path(r'synopsis/', views.UnitGroupListView.as_view(), name='synopsis'),
path(r'unit/problems/<int:pk>/', views.unit_problems, name='view-problems'),
path(r'unit/tex/<int:pk>/', views.unit_tex, ... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
197,
6978,
7,
81,
6,
4871,
3823,
14,
3256,
5009,
13,
4871,
3823,
11,
1438,
11639,
4871,
3823,
33809,
198,
197,
... | 2.536145 | 166 |
import numpy as np
from annoy import AnnoyIndex
import yaml
import os
import threading
import queue
import time
model_location = '/data/model_ha' | [
11748,
299,
32152,
355,
45941,
198,
6738,
10072,
1330,
5506,
726,
15732,
198,
11748,
331,
43695,
198,
11748,
28686,
198,
198,
11748,
4704,
278,
198,
11748,
16834,
198,
11748,
640,
198,
198,
19849,
62,
24886,
796,
31051,
7890,
14,
19849,
... | 3.418605 | 43 |
# -*- coding: utf-8 -*-
'''
Returners Directory
'''
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
13615,
364,
27387,
198,
7061,
6,
198
] | 2.166667 | 24 |
#----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
from flask import Flask, render_template, request, jsonify, redirect, url_for
import random
from datetime import datetime
from flask_cors import CORS
f... | [
2,
10097,
10541,
2,
198,
2,
1846,
3742,
198,
2,
10097,
10541,
2,
198,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
33918,
1958,
11,
18941,
11,
19016,
62,
1640,
198,
11748,
4738,
198,
6738,
4818,
8079,
1330,
4818... | 3.134426 | 915 |
from typing import List, Dict, Optional
from pyspark.sql import DataFrame, Column
from spark_auto_mapper.automappers.check_schema_result import CheckSchemaResult
class AutoMapperBase:
"""
Abstract Base class for AutoMappers
"""
def transform_with_data_frame(
self, df: DataFrame, source_df: ... | [
6738,
19720,
1330,
7343,
11,
360,
713,
11,
32233,
198,
198,
6738,
279,
893,
20928,
13,
25410,
1330,
6060,
19778,
11,
29201,
198,
198,
6738,
9009,
62,
23736,
62,
76,
11463,
13,
2306,
296,
46629,
13,
9122,
62,
15952,
2611,
62,
20274,
... | 2.65748 | 508 |
from bokeh.models import Panel, Tabs
from bokeh.io import output_file, show
from bokeh.plotting import figure
output_file("slider.html")
p1 = figure(plot_width=300, plot_height=300)
p1.circle([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], size=20, color="navy", alpha=0.5)
tab1 = Panel(child=p1, title="circle")
p2 = figure(plot_w... | [
6738,
1489,
365,
71,
13,
27530,
1330,
18810,
11,
309,
8937,
198,
6738,
1489,
365,
71,
13,
952,
1330,
5072,
62,
7753,
11,
905,
198,
6738,
1489,
365,
71,
13,
29487,
889,
1330,
3785,
198,
198,
22915,
62,
7753,
7203,
6649,
1304,
13,
6... | 2.28125 | 224 |
# @return a list of strings, [s1, s2]
# test
digits = "23"
print(Solution().letterCombinations(digits)) | [
220,
220,
220,
1303,
2488,
7783,
257,
1351,
286,
13042,
11,
685,
82,
16,
11,
264,
17,
60,
198,
198,
2,
1332,
198,
12894,
896,
796,
366,
1954,
1,
198,
4798,
7,
46344,
22446,
9291,
20575,
7352,
7,
12894,
896,
4008
] | 2.634146 | 41 |
from typing import *
import velocyto as vcy
| [
6738,
19720,
1330,
1635,
198,
11748,
11555,
13733,
1462,
355,
410,
948,
628
] | 3.461538 | 13 |
from plastron import ldp, ore, rdf
from plastron.namespaces import dcterms, dcmitype, ebucore, fabio, pcdm, pcdmuse, premis
from plastron.files import LocalFileSource, RepositoryFileSource
from PIL import Image
# alias the rdflib Namespace
ns = pcdm
@rdf.object_property('members', pcdm.hasMember)
@rdf.object_proper... | [
6738,
458,
459,
1313,
1330,
300,
26059,
11,
23751,
11,
374,
7568,
198,
6738,
458,
459,
1313,
13,
14933,
43076,
1330,
288,
310,
263,
907,
11,
288,
11215,
414,
431,
11,
36649,
1229,
382,
11,
7843,
952,
11,
279,
10210,
76,
11,
279,
1... | 2.521036 | 618 |
from os import path
import json
| [
6738,
28686,
1330,
3108,
198,
11748,
33918,
198
] | 4 | 8 |
import numpy as np
import gpustats.kernels as kernels
import gpustats.codegen as codegen
import gpustats.util as util
import pycuda.driver as drv
from pycuda.gpuarray import GPUArray, to_gpu
from pycuda.gpuarray import empty as gpu_empty
from pycuda.curandom import rand as curand
# reload(kernels)
# reload(codegen)
... | [
11748,
299,
32152,
355,
45941,
198,
198,
11748,
27809,
436,
1381,
13,
74,
44930,
355,
50207,
198,
11748,
27809,
436,
1381,
13,
8189,
5235,
355,
2438,
5235,
198,
11748,
27809,
436,
1381,
13,
22602,
355,
7736,
198,
11748,
12972,
66,
15339... | 2.216172 | 2,424 |
import os
from typing import Any, Dict, Optional, Sequence, Type, TYPE_CHECKING, Union
from .. import _dtypes
from ..base_types.media import Media
if TYPE_CHECKING: # pragma: no cover
from wandb.apis.public import Artifact as PublicArtifact
from ...wandb_artifacts import Artifact as LocalArtifact
from .... | [
11748,
28686,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
32233,
11,
45835,
11,
5994,
11,
41876,
62,
50084,
2751,
11,
4479,
198,
198,
6738,
11485,
1330,
4808,
67,
19199,
198,
6738,
11485,
8692,
62,
19199,
13,
11431,
1330,
6343,
19... | 3.174603 | 126 |
import unittest, json
from comodit_client.rest.client import HttpClient
from comodit_client.rest.exceptions import ApiException
from test.mock.urllib_mocks import RequestWithMethodMock, RequestResult
# Create tests
# Delete tests
# Read tests
# Update tests
# Helpers
if __name__ == '__m... | [
11748,
555,
715,
395,
11,
33918,
198,
198,
6738,
401,
375,
270,
62,
16366,
13,
2118,
13,
16366,
1330,
367,
29281,
11792,
198,
6738,
401,
375,
270,
62,
16366,
13,
2118,
13,
1069,
11755,
1330,
5949,
72,
16922,
198,
6738,
1332,
13,
76,... | 2.829268 | 123 |
# terrascript/chef/__init__.py
import terrascript
| [
2,
8812,
15961,
14,
2395,
69,
14,
834,
15003,
834,
13,
9078,
198,
11748,
8812,
15961,
628
] | 3 | 17 |
from .environment import EnvironmentConf
from ..tools import secret_hash
class SecurityConf(EnvironmentConf):
"""
Security options.
"""
def get_secret_key(self):
"""
WARNING: keep the secret key used in production secret! We generate a
secret from a hash of the current setting... | [
6738,
764,
38986,
1330,
9344,
18546,
198,
6738,
11485,
31391,
1330,
3200,
62,
17831,
628,
198,
4871,
4765,
18546,
7,
31441,
18546,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4765,
3689,
13,
198,
220,
220,
220,
37227,
628,
22... | 2.370518 | 502 |
# # !/usr/bin/python3
# # -*- coding: utf-8 -*-
import logging, os
SETTINGS_PRIORITY = 100
# THESE SETTINGS ARE NEEDED FOR PYSETTINGS
APP_LOG_FILENAME = 'app.log'
APP_LOG_HANDLER_CONSOLE_LEVEL = logging.WARNING
APP_LOG_HANDLER_FILE_LEVEL = logging.WARNING
CONTROL_EVENTS_GRAPH_DEFAULT_SCALE = 100
BOARD_LOG_WIN... | [
2,
1303,
5145,
14,
14629,
14,
8800,
14,
29412,
18,
198,
2,
1303,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
18931,
11,
28686,
198,
198,
28480,
51,
20754,
62,
4805,
41254,
9050,
796,
1802,
628,
198,
198... | 2.197368 | 760 |
from io import BytesIO
from pdfmajor.execptions import FontError, UnicodeNotDefined, CMapNotFound
from pdfmajor.parser.PSStackParser import literal_name
from pdfmajor.parser.PDFStream import int_value
from pdfmajor.parser.PDFStream import num_value
from pdfmajor.parser.PDFStream import list_value
from pdfmajor.parser.... | [
6738,
33245,
1330,
2750,
4879,
9399,
198,
198,
6738,
37124,
22478,
13,
18558,
8544,
1330,
24060,
12331,
11,
34371,
3673,
7469,
1389,
11,
327,
13912,
3673,
21077,
198,
6738,
37124,
22478,
13,
48610,
13,
3705,
25896,
46677,
1330,
18875,
62,... | 3.400778 | 257 |
import mixer
import pygame
soun_obj=pygame.mixer.Sound("Star Wars Main Theme (Full).mp3")
soun_obj.play()
soun_obj.stop() | [
11748,
33938,
201,
198,
11748,
12972,
6057,
201,
198,
82,
977,
62,
26801,
28,
9078,
6057,
13,
19816,
263,
13,
21369,
7203,
8248,
6176,
8774,
26729,
357,
13295,
737,
3149,
18,
4943,
201,
198,
82,
977,
62,
26801,
13,
1759,
3419,
201,
... | 2.5 | 50 |
from functools import wraps
from importlib.util import find_spec
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
from rdkit import Chem
import pandas as pd
env = Environment(loader=FileSystemLoader(Path(__file__).parent / 'templates'),
autoescape=False)
def tooltip_formatt... | [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
1330,
8019,
13,
22602,
1330,
1064,
62,
16684,
198,
6738,
474,
259,
6592,
17,
1330,
9344,
11,
9220,
11964,
17401,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
374,
67,
15813,
1330,
12870,... | 2.555764 | 1,067 |
"""The builtin str implementation"""
from rpython.rlib import jit
from rpython.rlib.jit import we_are_jitted
from rpython.rlib.objectmodel import (
compute_hash, compute_unique_id, import_from_mixin)
from rpython.rlib.buffer import StringBuffer
from rpython.rlib.rstring import StringBuilder, replace
from pypy.int... | [
37811,
464,
3170,
259,
965,
7822,
37811,
198,
198,
6738,
374,
29412,
13,
81,
8019,
1330,
474,
270,
198,
6738,
374,
29412,
13,
81,
8019,
13,
45051,
1330,
356,
62,
533,
62,
73,
2175,
198,
6738,
374,
29412,
13,
81,
8019,
13,
15252,
1... | 2.650153 | 3,593 |
from sqlalchemy import Column, Integer, String, Date
from sqlalchemy.orm import relationship
from sqlalchemy.sql.schema import ForeignKey
from configuration import Base
from datetime import * | [
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
10903,
11,
7536,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
2776,
198,
6738,
44161,
282,
26599,
13,
25410,
13,
15952,
2611,
1330,
8708,
9218,
198,
6738,
8398,
1330,
7308,
220,
198,
... | 4.173913 | 46 |
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from rest_framework.permissions import IsAdminUser
from common.views import ResponseInfo, MyPageNumber
from .models import File
from .serializers import FileSerializer
| [
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1148,
46787,
12982,
198,
198,
6738,
... | 4.279412 | 68 |
#!/usr/bin/env python
"""
recursive search and deinit (disconnection) for drive-google directories
"""
from pathlib import Path
from gdrivepublic import isgdrive
from subprocess import call
from argparse import ArgumentParser
p = ArgumentParser()
p.add_argument('rdir',help='root directory to search for active drive-g... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
8344,
30753,
2989,
290,
390,
15003,
357,
6381,
38659,
8,
329,
3708,
12,
13297,
29196,
198,
37811,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
308,
19472,
11377,
1330,
318,... | 2.762136 | 206 |
import json
import os
from argparse import Namespace, _SubParsersAction
from cloudfoundry_client.client import CloudFoundryClient
from cloudfoundry_client.json_object import JsonObject
from cloudfoundry_client.main.command_domain import CommandDomain, Command
| [
11748,
33918,
198,
11748,
28686,
198,
6738,
1822,
29572,
1330,
28531,
10223,
11,
4808,
7004,
47,
945,
364,
12502,
198,
198,
6738,
6279,
9275,
563,
62,
16366,
13,
16366,
1330,
10130,
21077,
563,
11792,
198,
6738,
6279,
9275,
563,
62,
163... | 3.852941 | 68 |
from numpy import random
import gc
import numpy as np
import pdb
import cv2
import os
import sys
import matplotlib.pyplot as plt
dataset_name = sys.argv[1]
data_dir = './quickdraw/' + dataset_name + '/r128/'
save_dir = './quickdraw/' + dataset_name + '/obj-in-image/'
os.makedirs(save_dir + 'test/' , exist_ok=True)
os... | [
6738,
299,
32152,
1330,
4738,
198,
11748,
308,
66,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
279,
9945,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
... | 2.205418 | 443 |
# Use true division operator always even in old python 2.x (used in `_get_case_getter_s`)
from __future__ import division
from distutils.version import LooseVersion
from enum import Enum
from inspect import isgeneratorfunction, getmodule, currentframe
from itertools import product
from warnings import warn
from decop... | [
2,
5765,
2081,
7297,
10088,
1464,
772,
287,
1468,
21015,
362,
13,
87,
357,
1484,
287,
4600,
62,
1136,
62,
7442,
62,
1136,
353,
62,
82,
63,
8,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
6738,
1233,
26791,
13,
9641,
1330,
6... | 2.52071 | 16,514 |
from pydpi.pypro import PyPro
import logging
AA_MODIFICATIONS = {
"Benzoylphenylalanine": "F",
"C-term amidation": "",
"Sulfotyrosine": "Y",
"4-Hydroxyproline": "P",
"Pyroglutamic acid": "E",
"Gamma carboxylic glutamic acid": "E",
"Any": "G",
"D-leucine": "L",
"D-phenylalanine": "F"... | [
6738,
279,
5173,
14415,
13,
9078,
1676,
1330,
9485,
2964,
198,
11748,
18931,
198,
198,
3838,
62,
33365,
30643,
18421,
796,
1391,
198,
220,
220,
220,
366,
42484,
726,
75,
31024,
2645,
25786,
500,
1298,
366,
37,
1600,
198,
220,
220,
220... | 1.906977 | 903 |
v = int(input('Digite a velocidade do carro: '))
if v<=80:
print('Dirija com segurança. Boa viagem.')
else:
print('Você foi multado por exeder o limite de 80km/h.')
m = (v - 80) * 7
print('A multa vai custar {:.2f} reais'.format(m)) | [
85,
796,
493,
7,
15414,
10786,
19511,
578,
257,
11555,
420,
312,
671,
466,
1097,
305,
25,
705,
4008,
198,
361,
410,
27,
28,
1795,
25,
198,
220,
220,
3601,
10786,
35277,
34655,
401,
384,
70,
42211,
50041,
13,
3248,
64,
25357,
363,
... | 2.185841 | 113 |