content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import io
import json
import requests
from django.shortcuts import render
from django.http import (
HttpResponse,
HttpResponseRedirect,
JsonResponse,
HttpResponseBadRequest,
HttpResponseNotFound,
Http404
)
from django.urls import reverse
# Create your views here.
| [
11748,
28686,
198,
11748,
33245,
198,
11748,
33918,
198,
11748,
7007,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
357,
198,
220,
220,
220,
367,
29281,
31077,
11,
198,
220,
220,
22... | 2.95098 | 102 |
import numpy as np
def get_strongest(weights, topn):
""" Get the top n strongest (max absolute value) weights of each row """
nstrongest_idx = np.argpartition(np.abs(weights), -topn, axis=0)[-topn:]
nstrongest = np.array([[weights[nstrongest_idx[i, j], j] for j in range(nstrongest_idx.shape[1])]
... | [
11748,
299,
32152,
355,
45941,
628,
198,
4299,
651,
62,
11576,
395,
7,
43775,
11,
1353,
77,
2599,
198,
220,
220,
220,
37227,
3497,
262,
1353,
299,
12841,
357,
9806,
4112,
1988,
8,
19590,
286,
1123,
5752,
37227,
198,
220,
220,
220,
2... | 2.352941 | 170 |
# Reproduction module
from modules import classes
from modules import names
from random import seed
from random import randint
seed(1)
# Don't try for a baby if one of your existing children is starving
# Baby making | [
2,
36551,
596,
8265,
198,
6738,
13103,
1330,
6097,
198,
6738,
13103,
1330,
3891,
198,
6738,
4738,
1330,
9403,
198,
6738,
4738,
1330,
43720,
600,
198,
28826,
7,
16,
8,
198,
198,
2,
2094,
470,
1949,
329,
257,
5156,
611,
530,
286,
534,... | 4.192308 | 52 |
# Copyright (C) 2014, Hitachi, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
15069,
357,
34,
8,
1946,
11,
7286,
14299,
11,
12052,
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... | 1.92695 | 12,156 |
from pyecharts import options as opts
from pyecharts.charts import Gauge
c = (
Gauge()
.add("", [("完成率", 66.6)])
.set_global_opts(title_opts=opts.TitleOpts(title="Gauge-基本示例"))
.render("gauge_base.html")
)
| [
6738,
12972,
3055,
5889,
1330,
3689,
355,
2172,
82,
198,
6738,
12972,
3055,
5889,
13,
354,
5889,
1330,
35094,
469,
198,
198,
66,
796,
357,
198,
220,
220,
220,
35094,
469,
3419,
198,
220,
220,
220,
764,
2860,
7203,
1600,
685,
7203,
2... | 1.93913 | 115 |
from django.urls import path
from apps.Docs import views
urlpatterns = [
path('officer/dashboard/documents', views.OfficerDocs, name="OfficerDocs"),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
6725,
13,
23579,
82,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
14406,
263,
14,
42460,
3526,
14,
15390,
2886,
3256,
5009,
13,
12710,
263,
... | 2.836364 | 55 |
# coding: utf-8
import sys
sys.path.append('..')
from common.np import * # import numpy as np
from common.layers import Embedding, SigmoidWithLoss
import collections
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
492,
11537,
198,
6738,
2219,
13,
37659,
1330,
1635,
220,
1303,
1330,
299,
32152,
355,
45941,
198,
6738,
2219,
13,
75,
6962,
1330,
13302,
6048,
... | 3.090909 | 55 |
from django.utils.translation import gettext as _
| [
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
355,
4808,
628,
198
] | 3.714286 | 14 |
# Simulation configuration parameters
# DAYS_PER_TIMESTEP = 1
# SIMULATION_TIME_YEARS = 10
# SIMULATION_TIME_STEPS = int(SIMULATION_TIME_YEARS * 365 / DAYS_PER_TIMESTEP)
SIMULATION_TIME_STEPS = 1000
| [
2,
41798,
8398,
10007,
198,
2,
24644,
50,
62,
18973,
62,
51,
3955,
6465,
8905,
796,
352,
198,
2,
23749,
6239,
6234,
62,
34694,
62,
56,
17133,
50,
796,
838,
198,
2,
23749,
6239,
6234,
62,
34694,
62,
30516,
3705,
796,
493,
7,
48913,... | 2.564103 | 78 |
e = input("\nEnter Key:")
e = [int(i) for i in e]
#---------------sender side-----------------
sdata = input("\nMessage String: ")
d=sdata+("0"*(len(e)-1));c=0
d = [int(i) for i in d]
print("".join([str(i) for i in d]))
for i in range(0,len(sdata)):
print("-"*len(d))
print(" "*c+"".join([str(x) for x i... | [
201,
198,
68,
796,
5128,
7203,
59,
77,
17469,
7383,
25,
4943,
201,
198,
68,
796,
685,
600,
7,
72,
8,
329,
1312,
287,
304,
60,
201,
198,
2,
24305,
82,
2194,
1735,
1783,
12,
201,
198,
82,
7890,
796,
5128,
7203,
59,
77,
12837,
10... | 1.878834 | 652 |
# ---------------------------------------------------------------------------------------
#
# Title: Dungeon Game
#
# Link: https://leetcode.com/problems/dungeon-game/
#
# Difficulty: Hard
#
# Language: Python
#
# -------------------------------------------------------------------------------------... | [
2,
16529,
19351,
6329,
198,
2,
198,
2,
220,
11851,
25,
220,
220,
220,
220,
220,
220,
11995,
3776,
198,
2,
198,
2,
220,
7502,
25,
220,
220,
220,
220,
220,
220,
220,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
67,
... | 3.314516 | 124 |
# Copyright (c) 2021 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 appli... | [
2,
15069,
357,
66,
8,
33448,
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,
2393,
2845... | 3.678756 | 193 |
r'''
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 agreed to i... | [
81,
7061,
6,
198,
15269,
1946,
3012,
3457,
13,
1439,
2489,
10395,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
... | 2.482679 | 433 |
import numpy as np
def lp_distance(x, adv_x, norm):
"""
Compute average l0/l2/linf distance between clean and adversarial images.
"""
num_imgs = x.shape[0]
ss, lp = [], []
if norm == 0:
for i in range(num_imgs):
lp.append(sum(np.abs(x[i:i + 1] - adv_x[i:i + 1]).f... | [
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
201,
198,
4299,
300,
79,
62,
30246,
7,
87,
11,
1354,
62,
87,
11,
2593,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
3082,
1133,
2811,
300,
15,
14,
75,
17,
14,
... | 2 | 887 |
from random import randint
import random
import string
from django.shortcuts import render, reverse
from django.contrib.auth import login, authenticate, logout
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.contrib.auth.decorators import login_required, user_passes_test
from .mod... | [
6738,
4738,
1330,
43720,
600,
198,
11748,
4738,
198,
11748,
4731,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
9575,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
17594,
11,
8323,
5344,
11,
2604,
448,
198,
... | 3.801527 | 131 |
"""Essential Script Snippets
In this section, we will cover developing essential code snippets.
These code blocks are commonly used in DFIR scripting to allow
for users to provide parameters to the tool, logging of progress
and errors, and generation of reports.
"""
| [
37811,
29508,
1843,
12327,
5489,
3974,
1039,
198,
198,
818,
428,
2665,
11,
356,
481,
3002,
5922,
6393,
2438,
45114,
13,
198,
4711,
2438,
7021,
389,
8811,
973,
287,
36323,
4663,
36883,
284,
1249,
198,
1640,
2985,
284,
2148,
10007,
284,
... | 4.542373 | 59 |
# TileCutter User Interface Module
# Preferences Dialog
import logging
import wx
import config, tcui, translator
config = config.Config()
gt = translator.Translator()
class DialogPreferences(wx.Dialog):
"""Dialog for setting program preferences"""
def __init__(self, parent, app):
"""Initialise... | [
2,
47870,
34,
10381,
11787,
26491,
19937,
198,
2,
220,
220,
220,
220,
220,
220,
220,
49780,
21269,
519,
198,
198,
11748,
18931,
198,
11748,
266,
87,
198,
11748,
4566,
11,
37096,
9019,
11,
33417,
198,
11250,
796,
4566,
13,
16934,
3419,... | 2.152428 | 4,284 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
import itertools
from typing import Dict, List, Tuple
from weaverbird.backends.mongo_translator.steps.types import MongoStep
from weaverbird.pipeline.steps import TotalsStep
def combinations(iterable: list) -> list:
"""combinations([1,2,3]) --> (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"""
return list(
... | [
11748,
340,
861,
10141,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
309,
29291,
198,
198,
6738,
356,
8770,
16944,
13,
1891,
2412,
13,
76,
25162,
62,
7645,
41880,
13,
20214,
13,
19199,
1330,
42591,
8600,
198,
6738,
356,
8770,
16944... | 2.357513 | 193 |
from datetime import datetime
import re
import sys
import time
from django import VERSION
from django.contrib import admin, messages
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views import debug
from celery import current_app
from .tasks import celery_health_task
d... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
640,
198,
198,
6738,
42625,
14208,
1330,
44156,
2849,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
11,
6218,
198,
6738,
42625,
14208,
13,
4023,
... | 2.57058 | 1,516 |
from html.parser import HTMLParser
import re
import requests
| [
6738,
27711,
13,
48610,
1330,
11532,
46677,
198,
11748,
302,
198,
198,
11748,
7007,
198
] | 4.133333 | 15 |
from django.contrib import admin
from bootcamp.communities.models import Community ,User
admin.site.register(User)
# Register your models here.
admin.site.register(Community , CommunityAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
6297,
16544,
13,
10709,
871,
13,
27530,
1330,
220,
8108,
837,
12982,
628,
198,
28482,
13,
15654,
13,
30238,
7,
12982,
8,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
28482,
... | 3.698113 | 53 |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from kanban.forms import TitleForm
from kanban.models import Title
from datetime import datetime
# def done(request, id):
# if request.user.is_authenticated():
# title = Title.objects.filter(user=request.user,id=id)
# ... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
43998,
3820,
13,
23914,
1330,
11851,
8479,
198,
6738,
43998,
3820,
13,
27530,
1330,
11851,
198,
6738,
4818... | 2.345515 | 301 |
import collections
import logging
import random
from datetime import datetime
from typing import Iterable, Text, Dict, Any
import attr
import faust
from replay_output_experiment.app import app
from replay_output_experiment.page_views.models import BalanceUpdate, RequestTransfer, DATETIME_BASIC_FORMAT, \
balances... | [
11748,
17268,
198,
11748,
18931,
198,
11748,
4738,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
40806,
540,
11,
8255,
11,
360,
713,
11,
4377,
198,
198,
11748,
708,
81,
198,
11748,
24685,
436,
198,
198,
6738,
24788,
... | 2.657746 | 710 |
print Solution().spiralOrder([
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]) | [
198,
198,
4798,
28186,
22446,
2777,
21093,
18743,
26933,
198,
685,
352,
11,
362,
11,
513,
16589,
198,
685,
604,
11,
642,
11,
718,
16589,
198,
685,
767,
11,
807,
11,
860,
2361,
198,
12962
] | 2.171429 | 35 |
import os
import datetime as dt
from loguru import logger
| [
11748,
28686,
198,
11748,
4818,
8079,
355,
288,
83,
198,
6738,
2604,
14717,
1330,
49706,
198
] | 3.625 | 16 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_oauthlib.client import OAuth
from .util.config import config
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///auth.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.secret_key = config.crypto.key
app.config['... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
12162,
1071,
8019,
13,
16366,
1330,
440,
30515,
198,
6738,
764,
22602,
13,
11250,
1330,
4566,
198,
198,
1324,
796,
46947,
... | 2.814286 | 210 |
#!/usr/bin/python
import math
import time
import random
from roberta import Hal
h = Hal()
___item = [0, 0, 0]
___item2 = 0
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
10688,
198,
11748,
640,
198,
11748,
4738,
198,
6738,
686,
4835,
64,
1330,
11023,
198,
71,
796,
11023,
3419,
628,
198,
17569,
9186,
796,
685,
15,
11,
657,
11,
657,
60,
198,
17569... | 2.5 | 66 |
"""
Module containing functions used to load and write data
"""
from typing import *
import zarr
import sys
import time
import numpy as np
import pandas as pd
from pathlib import Path
from dask import dataframe as dd
from dask.distributed import Client
from pysmFISH.utils import convert_from_uint16_to_float64
from py... | [
37811,
198,
26796,
7268,
5499,
973,
284,
3440,
290,
3551,
1366,
198,
37811,
198,
198,
6738,
19720,
1330,
1635,
198,
11748,
1976,
3258,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
... | 2.590135 | 2,818 |
from typing import List, Tuple, Optional
from ray import workflow
# Mock method to make requests to an external service.
# Generate an idempotency token (this is an extension to the cadence example).
@workflow.step
@workflow.step
@workflow.step
@workflow.step
@workflow.step
@workflow.step
@workflow.ste... | [
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
32233,
198,
198,
6738,
26842,
1330,
30798,
628,
198,
2,
44123,
2446,
284,
787,
7007,
284,
281,
7097,
2139,
13,
628,
198,
2,
2980,
378,
281,
4686,
368,
13059,
1387,
11241,
357,
5661,
318,
... | 2.752351 | 319 |
# coding=utf-8
import numpy as np
import torch
import scipy.sparse as sp
from utils import data_loader, sparse_mx_to_torch_sparse_tensor
from normalization import fetch_normalization
class Sampler:
"""Sampling the input graph data."""
def stub_sampler(self, normalization, cuda):
"""
... | [
2,
19617,
28,
40477,
12,
23,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
28034,
201,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
599,
201,
198,
6738,
3384,
4487,
1330,
1366,
62,
29356,
11,
29877,
62,
36802,
62,
1462,... | 1.965971 | 2,586 |
#!/usr/bin/env python
'''
We import the Token class, which we will use to bundle up our lexemes, and the TokenType which will be used as part of the Token class to identify one Token from another.
The process boils down to going through our "source" and matching lexemes with Token cases. This is reflected in the m... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
198,
198,
7061,
6,
198,
198,
1135,
1330,
262,
29130,
1398,
11,
543,
356,
481,
779,
284,
18537,
510,
674,
31191,
368,
274,
11,
290,
262,
29130,
6030,
543,
481,
307,
973,
355,
636,
2... | 3.580796 | 427 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
# In[2]:
# Load the training, additional, confidence, and test data
train_data = pd.read_csv('training.csv')
test_data = pd.read_csv('testing.csv')
additional_data = pd.read_csv('additional_training.csv')
confidence = pd.read_c... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
2,
554,
58,
17,
5974,
628... | 2.597292 | 1,994 |
import unittest
from programy.config.file.yaml_file import YamlConfigurationFile
from programy.clients.restful.config import RestConfiguration
from programy.clients.events.console.config import ConsoleConfiguration
| [
11748,
555,
715,
395,
198,
198,
6738,
1430,
88,
13,
11250,
13,
7753,
13,
88,
43695,
62,
7753,
1330,
14063,
75,
38149,
8979,
198,
6738,
1430,
88,
13,
565,
2334,
13,
2118,
913,
13,
11250,
1330,
8324,
38149,
198,
6738,
1430,
88,
13,
... | 3.927273 | 55 |
# Databricks notebook source
# MAGIC %run /Repos/michael.henzl@datasentics.com/daipe_mlops/bootstrap/bootstrap_base
# COMMAND ----------
from mlops_test import test_api
import pandas as pd
# COMMAND ----------
test = test_api.TestAPI()
# COMMAND ----------
test.deploy_code()
# COMMAND ----------
'''
When your AP... | [
2,
16092,
397,
23706,
20922,
2723,
198,
2,
28263,
2149,
4064,
5143,
1220,
6207,
418,
14,
76,
40302,
13,
831,
48274,
31,
19608,
292,
298,
873,
13,
785,
14,
67,
1872,
431,
62,
4029,
2840,
14,
18769,
26418,
14,
18769,
26418,
62,
8692,
... | 2.874251 | 167 |
import pytest
from Interview.ReverseNodeKGroup.reverse_node_k_group import ListNode, Solution
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
19371,
13,
49,
964,
325,
19667,
42,
13247,
13,
50188,
62,
17440,
62,
74,
62,
8094,
1330,
7343,
19667,
11,
28186,
628,
198,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198
] | 3.052632 | 38 |
from contextvars import ContextVar
from typing import Type
import pycord
event = ContextVar("event")
COMMAND_PARSER: "Type[pycord.client.parser.PycordParser]" = None
DISPATCHER: "Type[pycord.gateway.dispatcher.AsyncDispatcher]" = None
GATEWAY: "Type[pycord.gateway.gate.TrioGateway]" = None
COMMAND: "Type[pycord.cli... | [
6738,
4732,
85,
945,
1330,
30532,
19852,
198,
6738,
19720,
1330,
5994,
198,
198,
11748,
12972,
66,
585,
198,
198,
15596,
796,
30532,
19852,
7203,
15596,
4943,
628,
198,
9858,
44,
6981,
62,
27082,
35009,
25,
366,
6030,
58,
9078,
66,
58... | 2.585168 | 863 |
import snap
G = snap.TNGraph.New()
for i in range(4):
xxx = G.AddNode(i)
xxx = G.AddEdge(0,1); xxx = G.AddEdge(0,2)
xxx = G.AddEdge(1,3); xxx = G.AddEdge(2,3)
T = snap.GetBfsTree(G, 0, True, True)
#T = snap.GetBfsTree(G, 0, True, False) # same result
#T = snap.GetBfsTree(G, 0, False, True) # node 0 only, no e... | [
11748,
11495,
198,
198,
38,
796,
11495,
13,
51,
10503,
1470,
13,
3791,
3419,
198,
1640,
1312,
287,
2837,
7,
19,
2599,
198,
220,
220,
220,
2124,
5324,
796,
402,
13,
4550,
19667,
7,
72,
8,
198,
198,
31811,
796,
402,
13,
4550,
37021,... | 2.116822 | 214 |
import ast
from typing import List, Optional
from flake8_plugin_utils import Visitor, is_none
from flake8_pytest_style.config import Config
from flake8_pytest_style.errors import (
AssertInExcept,
RaisesTooBroad,
RaisesWithMultipleStatements,
RaisesWithoutException,
)
from flake8_pytest_style.utils im... | [
11748,
6468,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
6738,
781,
539,
23,
62,
33803,
62,
26791,
1330,
6911,
2072,
11,
318,
62,
23108,
198,
198,
6738,
781,
539,
23,
62,
9078,
9288,
62,
7635,
13,
11250,
1330,
17056,
198,
673... | 2.605556 | 180 |
num = -1
total = 0
cont = 0
while num != 999:
num = int(input('Digite um número. [999 para parar]: '))
if num != 999:
total += num
cont +=1
print('Você digitou {} números e a soma entre eles foi {}.'.format(cont, total))
| [
22510,
796,
532,
16,
198,
23350,
796,
657,
198,
3642,
796,
657,
198,
4514,
997,
14512,
36006,
25,
198,
220,
220,
220,
997,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
299,
21356,
647,
78,
13,
685,
17032,
31215,
1582,
283,
5974,
70... | 2.268519 | 108 |
import torch
import numpy as np
from noge.data_types import GoalPartialObservation, NeuralGraphObservation, InferenceSample
| [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
645,
469,
13,
7890,
62,
19199,
1330,
25376,
7841,
498,
31310,
13208,
11,
47986,
37065,
31310,
13208,
11,
554,
4288,
36674,
628
] | 3.818182 | 33 |
import pyautogui
import time
import keyboard
import random
import win32api, win32con
snow_link_loc = pyautogui.locateOnScreen(r'C:\Users\mathew.roberts\Desktop\Incidents Icon.PNG', region = (670, 60, 300, 50))
no_records_loc = pyautogui.locateOnScreen(r'C:\Users\mathew.roberts\Desktop\No Records Icon.PNG', re... | [
11748,
12972,
2306,
519,
9019,
201,
198,
11748,
640,
201,
198,
11748,
10586,
201,
198,
11748,
4738,
201,
198,
11748,
1592,
2624,
15042,
11,
1592,
2624,
1102,
201,
198,
201,
198,
201,
198,
82,
2197,
62,
8726,
62,
17946,
796,
12972,
230... | 2.390845 | 284 |
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
from common.DataProcess.excel_loads import load_cust_info
from information.models import CustomerInfo
# 批量导入客户信息 | [
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
2,
13610,
534,
5009,
994,
13,
198,
6738,
2219,
13,
6601,
18709,
13,
1069,
5276,
62,
46030,
1330,
3440,
62,
66,
436... | 2.905405 | 74 |
# Generated by Django 3.2.5 on 2021-09-08 14:41
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
20,
319,
33448,
12,
2931,
12,
2919,
1478,
25,
3901,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14... | 3.019231 | 52 |
import os
import sys
from typing import List, Tuple
import numpy as np
import tensorflow as tf
from dataloader_iam import Batch
# Disable eager mode
tf.compat.v1.disable_eager_execution()
class DecoderType:
"""CTC decoder types."""
BestPath = 0
BeamSearch = 1
WordBeamSearch = 2
class Model:
"... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
4818,
282,
1170,
263,
62,
1789,
1330,
347,
963,
198,
198,... | 2.063574 | 6,402 |
# Copyright 2018 Google 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 writing,... | [
2,
15069,
2864,
3012,
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,
921,
743,
... | 2.94586 | 314 |
import numpy as np
import torch as to
import pyrado
class RunningNormalizer:
""" Normalizes given data based on the history of observed data, such that all outputs are in range [-1, 1] """
def __init__(self):
""" Constructor """
self._bound_lo = None
self._bound_up = None
sel... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
355,
284,
198,
198,
11748,
279,
2417,
4533,
628,
198,
4871,
18162,
26447,
7509,
25,
198,
220,
220,
220,
37227,
14435,
4340,
1813,
1366,
1912,
319,
262,
2106,
286,
6515,
1366,
11,
884,
... | 2.143004 | 1,944 |
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
9009,
62,
23736,
62,
76,
11463,
62,
69,
71,
343,
13,
69,
71,
343,
62,
19199,
13,
9900,
1330,
376,
71,
343,
52,
380,
198,
198,
6738,
9009,
62,
23736,
62,
76,
11463,
62,
69,
71... | 3.084101 | 868 |
#!/usr/bin/env python3
import json
import os.path
with open(os.environ['CONFIGURATION_FILE']) as c:
config = json.load(c)
output_file = f'{config["output_directory"]}/foo/bar'
os.makedirs(os.path.dirname(output_file))
with open(output_file, 'w') as f:
f.write('baz\n')
with open(output_file) as f:
print(f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
33918,
198,
11748,
28686,
13,
6978,
198,
198,
4480,
1280,
7,
418,
13,
268,
2268,
17816,
10943,
16254,
4261,
6234,
62,
25664,
6,
12962,
355,
269,
25,
198,
220,
220,
22... | 2.356643 | 143 |
# -*- coding: utf-8 -*-
"""
Created on April 23, 2019
@author: neerbek
"""
# uses trees generated by reorderTreesToOriginal.py
import os
import random
import projectSetup # noqa: F401
from similarity import load_trees
dataDir = os.path.join(os.getenv("HOME"), "jan/ProjectsData/phd/DLP/Monsanto/data/trees/2018041... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
198,
41972,
319,
3035,
2242,
11,
13130,
198,
198,
31,
9800,
25,
220,
497,
23552,
988,
198,
37811,
198,
198,
2,
3544,
7150,
7560,
416,
302,
2875,
51,
6037,
... | 2.295285 | 1,209 |
from __future__ import annotations
import contextlib
import curses
from unittest import mock
import pytest
from babi.buf import Buf
from babi.color_manager import ColorManager
from babi.hl.interface import HL
from babi.hl.syntax import Syntax
from babi.theme import Color
from babi.theme import Theme
@pytest.fixt... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
4732,
8019,
198,
11748,
43878,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
9289,
72,
13,
29325,
1330,
347,
3046,
198,
6738,
9289,
72,
13,
... | 2.602941 | 272 |
import openpyxl
| [
11748,
1280,
9078,
87,
75,
628
] | 2.833333 | 6 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import mysql.connector
mydb = mysql.connector.connect(
host = "localhost",
user = "root",
passwd = "schleichkatze",
database = "helmstedt"
)
mycursor = mydb.cursor()
mycursor.execute("SELECT id, gnd FROM helmstedt.temp_prof_kat")
myresult = mycursor.fetchall()
gnds ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
48761,
13,
8443,
273,
198,
198,
1820,
9945,
796,
48761,
13,
8443,
273,
13,
8443,
7,
198,
220,
2583,
796,
3... | 2.343545 | 1,371 |
import torch
from abc import ABCMeta, abstractmethod
from torch import nn
| [
11748,
28034,
198,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
6738,
28034,
1330,
299,
77,
198
] | 3.75 | 20 |
import http.client
import json
import requests
| [
11748,
2638,
13,
16366,
198,
11748,
33918,
198,
11748,
7007,
628
] | 4.363636 | 11 |
import numpy as np
import sys
try:
from simtk.openmm.app.internal import amber_file_parser
from simtk.openmm.app import *
from simtk.openmm.vec3 import Vec3
from simtk.openmm import *
import simtk.unit as unit
except:
from openmm.app.internal import amber_file_parser
from openmm.app import *... | [
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
28311,
25,
198,
220,
220,
220,
422,
985,
30488,
13,
9654,
3020,
13,
1324,
13,
32538,
1330,
36505,
62,
7753,
62,
48610,
198,
220,
220,
220,
422,
985,
30488,
13,
9654,
3020,
13,
1... | 1.713224 | 3,902 |
"""
269 / 269 test cases passed.
Runtime: 40 ms
Memory Usage: 14.9 MB
"""
| [
37811,
198,
26276,
1220,
38249,
1332,
2663,
3804,
13,
198,
41006,
25,
2319,
13845,
198,
30871,
29566,
25,
1478,
13,
24,
10771,
198,
37811,
198
] | 2.96 | 25 |
from flask import Flask
from dapp.config import Config
| [
6738,
42903,
1330,
46947,
198,
6738,
288,
1324,
13,
11250,
1330,
17056,
198
] | 4.230769 | 13 |
""" Lazy loading modules """
import sys
import importlib.util
class DeferredModuleError:
""" Class to throw an error if you try to use a modules that wasn't loaded """
@property
def moduleName(self):
""" Return the name of the module this is associated to """
return self._moduleName
d... | [
37811,
406,
12582,
11046,
13103,
37227,
198,
198,
11748,
25064,
198,
11748,
1330,
8019,
13,
22602,
628,
198,
4871,
2896,
17436,
26796,
12331,
25,
198,
220,
220,
220,
37227,
5016,
284,
3714,
281,
4049,
611,
345,
1949,
284,
779,
257,
1310... | 2.57377 | 610 |
#Power Throw: Complete Adventurer, p. 111
from templeplus.pymod import PythonModifier
from toee import *
import tpdp
print "Registering Power Throw"
powerThrow = PythonModifier("Power Throw", 2) # args are just-in-case placeholders
powerThrow.MapToFeat("Power Throw")
powerThrow.AddHook(ET_OnDealingDamage, EK_NONE, ... | [
2,
13434,
22481,
25,
220,
13248,
9553,
81,
11,
279,
13,
13374,
198,
198,
6738,
12505,
9541,
13,
9078,
4666,
1330,
11361,
5841,
7483,
198,
6738,
284,
1453,
1330,
1635,
198,
11748,
256,
79,
26059,
198,
198,
4798,
366,
38804,
278,
4333,
... | 3.103704 | 135 |
from importlib import import_module
from flask import Blueprint, jsonify, request
from sqlalchemy import func, distinct
from inflection import singularize
from app import cache, flask
from app.helpers.cache_helper import api_cache_key
blueprint = Blueprint('api', __name__, url_prefix='/')
@blueprint.route(... | [
6738,
1330,
8019,
1330,
1330,
62,
21412,
201,
198,
6738,
42903,
1330,
39932,
11,
33918,
1958,
11,
2581,
201,
198,
6738,
44161,
282,
26599,
1330,
25439,
11,
7310,
201,
198,
6738,
1167,
1564,
1330,
18032,
1096,
201,
198,
6738,
598,
1330,
... | 2.675393 | 191 |
#!/usr/bin/env python3
'test that rumur-run can check a basic model'
import os
import platform
import subprocess as sp
import sys
if platform.system() == 'Linux' and 'TRAVIS' in os.environ:
release = sp.check_output(['lsb_release', '--release', '--short'],
universal_newlines=True).strip()
if release == '14.0... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
470,
395,
326,
7440,
333,
12,
5143,
460,
2198,
257,
4096,
2746,
6,
198,
198,
11748,
28686,
198,
11748,
3859,
198,
11748,
850,
14681,
355,
599,
198,
11748,
25064,
198,
198,
3... | 2.673759 | 423 |
#
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2022 PyMeasure Developers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... | [
2,
198,
2,
770,
2393,
318,
636,
286,
262,
9485,
47384,
5301,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
2211,
12,
1238,
1828,
9485,
47384,
34152,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,... | 3.046936 | 767 |
"""Implementation of subdimensional expansion using operator
decomposition instead of vanilla A*, with better graph abstraction.
All coordinates are to be tuples and all collision sets are to be lists
of immutable sets (frozenset). This partial rewrite will focus on
converting everything that can be immutable into an i... | [
37811,
3546,
32851,
286,
850,
19577,
7118,
1262,
10088,
198,
12501,
296,
9150,
2427,
286,
16858,
317,
25666,
351,
1365,
4823,
34651,
13,
198,
3237,
22715,
389,
284,
307,
12777,
2374,
290,
477,
17661,
5621,
389,
284,
307,
8341,
198,
1659... | 2.16089 | 23,544 |
"""
This example demonstrates most basic operations with single model
"""
from tortoise import Tortoise, fields, run_async
from tortoise.models import Model
if __name__ == "__main__":
run_async(run())
| [
37811,
198,
1212,
1672,
15687,
749,
4096,
4560,
351,
2060,
2746,
198,
37811,
198,
6738,
7619,
25678,
1330,
28467,
25678,
11,
7032,
11,
1057,
62,
292,
13361,
198,
6738,
7619,
25678,
13,
27530,
1330,
9104,
628,
628,
198,
361,
11593,
3672,... | 3.483333 | 60 |
import configparser
import json
import colorama
import pymysql.cursors
import telebot
from tabulate import tabulate
import init
colorama.init()
config = configparser.ConfigParser()
config.read("conf.ini")
bot = telebot.TeleBot(config["DATA"]["token"].strip())
connection = pymysql.connect(host=config["DB"]["host"... | [
11748,
4566,
48610,
198,
11748,
33918,
198,
198,
11748,
3124,
1689,
198,
11748,
279,
4948,
893,
13976,
13,
66,
1834,
669,
198,
11748,
5735,
13645,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
198,
11748,
2315,
198,
198,
8043,
1689,
13,... | 2.272517 | 433 |
from .fabricauthenticator import *
__VERSION__=1.0 | [
6738,
764,
36434,
1173,
41299,
26407,
1330,
1635,
198,
198,
834,
43717,
834,
28,
16,
13,
15
] | 3 | 17 |
import json
from operator import attrgetter
from pathlib import Path
import pytest
from pyrepo.readme import Readme
from test_helpers import DATA_DIR
@pytest.mark.parametrize(
"filepath",
(DATA_DIR / "readme").glob("*.rst"),
ids=attrgetter("name"),
)
| [
11748,
33918,
198,
6738,
10088,
1330,
708,
81,
1136,
353,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
12972,
9288,
198,
6738,
12972,
260,
7501,
13,
961,
1326,
1330,
4149,
1326,
198,
6738,
1332,
62,
16794,
364,
1330,
42865,
62,
34720... | 2.704082 | 98 |
## a script to filter out non-somatic (germ-line)
## mutations from a VCF file, based on the SOMATIC
## flag appearing in the INFO column.
############################################################
import argparse
from itertools import ifilter
import re
import sys
## call main method if this file is run as a scr... | [
2235,
257,
4226,
284,
8106,
503,
1729,
12,
82,
13730,
357,
1362,
76,
12,
1370,
8,
198,
2235,
23005,
422,
257,
569,
22495,
2393,
11,
1912,
319,
262,
42121,
1404,
2149,
198,
2235,
6056,
12655,
287,
262,
24890,
5721,
13,
198,
29113,
14... | 3.693878 | 98 |
# -*- test-case-name: Cowrie Test Cases -*-
# Copyright (c) 2020 Peter Sufliarsky
# See LICENSE for details.
"""
Tests for uniq command
"""
from __future__ import absolute_import, division
import os
from twisted.trial import unittest
from cowrie.shell import protocol
from cowrie.test import fake_server, fake_tran... | [
2,
532,
9,
12,
1332,
12,
7442,
12,
3672,
25,
10417,
5034,
6208,
35536,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
12131,
5613,
1778,
2704,
72,
945,
2584,
198,
2,
4091,
38559,
24290,
329,
3307,
13,
198,
198,
37811,
198,
51,
3558... | 2.646766 | 201 |
from trabant import *
floor = create_box(pos=(0,0,-15),side=27,static=True)
gravity((0,0,0))
body = create_capsule(orientation=rotx(pi/2), radius=0.7, mass=5)
legs = []
for p in [(1,1,0),(1,-1,0),(-1,1,0),(-1,-1,0)]:
legs += [create_leg(body, vec3(*p))]
gravity((0,0,-9.8))
while loop():
for leg in legs:
... | [
6738,
491,
397,
415,
1330,
1635,
198,
198,
28300,
796,
2251,
62,
3524,
7,
1930,
16193,
15,
11,
15,
12095,
1314,
828,
1589,
28,
1983,
11,
12708,
28,
17821,
8,
198,
198,
46453,
19510,
15,
11,
15,
11,
15,
4008,
198,
198,
2618,
796,
... | 1.946309 | 298 |
from _gauge import (
GaugeError,
InvalidLoggingLevel,
LoggingHasAlreadyBeenSetup,
CollectorError,
AggregatorError,
ExporterError,
Frame,
TraceSample,
Span,
setup_logging,
)
from .collectors import CollectorInterface, SamplingCollector
from .aggregators import SpanAggregator
from ... | [
6738,
4808,
70,
559,
469,
1330,
357,
198,
220,
220,
220,
35094,
469,
12331,
11,
198,
220,
220,
220,
17665,
11187,
2667,
4971,
11,
198,
220,
220,
220,
5972,
2667,
19242,
37447,
3856,
268,
40786,
11,
198,
220,
220,
220,
17573,
12331,
... | 2.511029 | 272 |
#
# This file is part of BDC-DB.
# Copyright (C) 2020 INPE.
#
# BDC-DB is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Database management extension configuration."""
import os
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATA... | [
2,
198,
2,
770,
2393,
318,
636,
286,
347,
9697,
12,
11012,
13,
198,
2,
15069,
357,
34,
8,
12131,
3268,
11401,
13,
198,
2,
198,
2,
347,
9697,
12,
11012,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
... | 2.45614 | 228 |
"""
Ввести текстовую строку. Сформировать новую строку, в которой сначала идут символы исходной строки с четными индексами
(0, 2, 4,…), а затем – с нечетными индексами (1, 3, 5, …).
"""
string = input("Введите строку: ")
print(f"Результат: {string[::2] + string[1::2]}")
| [
37811,
198,
140,
240,
38857,
16843,
21727,
20375,
18849,
220,
20375,
16843,
31583,
21727,
20375,
25443,
110,
35072,
141,
236,
220,
21727,
20375,
21169,
25443,
118,
35072,
13,
12466,
94,
141,
226,
15166,
21169,
43108,
18849,
21169,
25443,
11... | 1.15678 | 236 |
"""
Tests the DQM compute dispatch module
"""
import pytest
import qcengine as qcng
from qcengine import testing
@pytest.mark.parametrize(
"program",
[
pytest.param("psi4", marks=testing.using_psi4),
pytest.param("torchani", marks=testing.using_torchani),
pytest.param("rdkit", marks... | [
37811,
198,
51,
3558,
262,
360,
48,
44,
24061,
27965,
8265,
198,
37811,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
10662,
66,
18392,
355,
10662,
66,
782,
198,
6738,
10662,
66,
18392,
1330,
4856,
628,
198,
198,
31,
9078,
9288,
13,
... | 2.459459 | 185 |
# Copyright (C) 2019 Cancer Care Associates
# 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 ... | [
2,
15069,
357,
34,
8,
13130,
15523,
7276,
29306,
198,
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,
... | 3.562249 | 249 |
import glob
import numpy as np
from PIL import Image
width = 128#64#32
height = 128#64#32
num_images = 0
background = Image.new('RGB', (width, height), color = "black")
bg_pixels = background.load()
#images = glob.glob("../data/32p/up/*.jpg")
#images = glob.glob("../data/64p/up/*.jpg")
#images = glob.glob("../data/64... | [
11748,
15095,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
198,
10394,
796,
13108,
2,
2414,
2,
2624,
198,
17015,
796,
13108,
2,
2414,
2,
2624,
198,
22510,
62,
17566,
796,
657,
198,
198,
25249,
796,
7412,
... | 2.284722 | 576 |
###############################################################
# Autogenerated module. Please don't modify. #
# Edit according file in protocol_generator/templates instead #
###############################################################
from typing import Dict
from ...structs.api.sasl_handshake_req... | [
29113,
14468,
7804,
4242,
21017,
198,
2,
5231,
519,
877,
515,
8265,
13,
4222,
836,
470,
13096,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
198,
2,
5312,
1864,
2393,
287,
8435,
62,... | 3.303371 | 267 |
from copy_move_detection import detect
detect.detect('assets/cattle_copy.png', 'output/')
detect.detect('assets/clean_walls_copy.png', 'output/')
detect.detect('assets/giraffe_copy.png', 'output/')
detect.detect('assets/horse_fake.png', 'output/')
detect.detect('assets/test_copy.png', 'output/')
| [
6738,
4866,
62,
21084,
62,
15255,
3213,
1330,
4886,
198,
198,
15255,
478,
13,
15255,
478,
10786,
19668,
14,
66,
1999,
62,
30073,
13,
11134,
3256,
705,
22915,
14,
11537,
198,
15255,
478,
13,
15255,
478,
10786,
19668,
14,
27773,
62,
86,... | 2.660714 | 112 |
#!/usr/bin/env python
"""
Created on 26/01/21
Author: Davide Rigoni
Emails: davide.rigoni.2@phd.unipd.it - drigoni@fbk.eu
Description: this file contains some useful functions.
"""
import numpy as np
import argparse
import os
import json
import matplotlib as pl
import matplotlib.pyplot as plt
import matplotlib.patches... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
41972,
319,
2608,
14,
486,
14,
2481,
198,
13838,
25,
2544,
485,
24666,
14651,
198,
10161,
1768,
25,
288,
615,
485,
13,
4359,
14651,
13,
17,
31,
746,
67,
13,
403,
541,
6... | 2.645808 | 4,986 |
try:
from pathlib import Path
except ImportError:
from pathlib2 import Path
from sphinx_testing import with_app
@with_app(buildername='html', srcdir='doc_test/filter_doc') # , warningiserror=True)
| [
28311,
25,
198,
220,
220,
220,
422,
3108,
8019,
1330,
10644,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
3108,
8019,
17,
1330,
10644,
198,
198,
6738,
599,
20079,
87,
62,
33407,
1330,
351,
62,
1324,
628,
198,
31,
4480,
62,... | 2.943662 | 71 |
import numpy
import string
import copy
import math
import os
| [
11748,
299,
32152,
198,
11748,
4731,
198,
11748,
4866,
198,
11748,
10688,
198,
11748,
28686,
628
] | 3.875 | 16 |
# Copyright 2015 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,
1853,
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,
... | 2.963591 | 1,593 |
'''
AUTHOR :li peng cheng
DATE :2021/08/11 22:34
'''
import torch
import numpy as np
import torch.nn as nn
| [
7061,
6,
198,
32,
24318,
1581,
1058,
4528,
279,
1516,
1125,
782,
198,
198,
35,
6158,
1058,
1238,
2481,
14,
2919,
14,
1157,
2534,
25,
2682,
198,
7061,
6,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
13,
2... | 2.291667 | 48 |
"""Constants for the casambi integration."""
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_EMAIL, CONF_API_KEY, CONF_SCAN_INTERVAL
DOMAIN = "casambi"
WIRE_ID = 9
DEFAULT_NETWORK_TIMEOUT = 300
DEFAULT_POLLING_TIME = 60
CONF_USER_PASSWORD = "user_p... | [
37811,
34184,
1187,
329,
262,
6124,
4131,
72,
11812,
526,
15931,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
11748,
1363,
562,
10167,
13,
16794,
364,
13,
11250,
62,
12102,
341,
355,
269,
85,
198,
198,
6738,
1363,
562,
10167,
13,
99... | 2.022059 | 680 |
from synonymes.SynonymFile import Synfile
| [
6738,
6171,
5177,
274,
13,
29934,
5177,
8979,
1330,
16065,
7753,
628
] | 3.583333 | 12 |
# pylint: disable=missing-function-docstring, invalid-name, too-many-arguments
"""Plotting utilities."""
from statistics import mean, median, stdev
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# We show histogram for max reward per game rules (number of fireworks cards)
MAX_REWARD=12
| [
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
8818,
12,
15390,
8841,
11,
12515,
12,
3672,
11,
1165,
12,
21834,
12,
853,
2886,
198,
37811,
43328,
889,
20081,
526,
15931,
198,
198,
6738,
7869,
1330,
1612,
11,
14288,
11,
336,
7959,
198,... | 3.417582 | 91 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import pandas as pd
import statsmodels.api as sm
if __name__ == "__main__":
pyunit_utils.standalone_test(prostate)
else:
prostate()
| [
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
16,
553,
40720,
40720,
40720,
4943,
198,
11748,
289,
17,
78,
198,
6738,
5254,
1330,
12972,
20850,
62,
26791,
628,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
9756,
27530,
13... | 2.717647 | 85 |
"""Web Scrap Agência lupa
Este script percorre a página de listagem de notícia, entrando em notícia por notícia,
extrai o conteúdo da notícia, a imagem e a classe da notícia.
O Script para no momento que não encontrar mais links de notícias para clicar
O endereço do site em que as notícias foram coletadas foi:
* ht... | [
37811,
13908,
1446,
2416,
2449,
25792,
10782,
544,
300,
929,
64,
198,
198,
36,
4169,
4226,
583,
10215,
260,
257,
279,
6557,
70,
1437,
390,
1351,
363,
368,
390,
407,
8836,
33743,
11,
24481,
25440,
795,
407,
8836,
33743,
16964,
407,
883... | 1.912468 | 3,096 |
# Licensed under Apache License Version 2.0 - see LICENSE
import pytest
from iteration_utilities import all_equal
import helper_funcs as _hf
from helper_cls import T
@_hf.skip_on_pypy_because_cache_next_works_differently
| [
2,
49962,
739,
24843,
13789,
10628,
362,
13,
15,
532,
766,
38559,
24290,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
24415,
62,
315,
2410,
1330,
477,
62,
40496,
198,
198,
11748,
31904,
62,
12543,
6359,
355,
4808,
71,
69,
198,
6738,
... | 2.987179 | 78 |
from contextlib import nullcontext as does_not_raise
from typing import Any
import pytest
from browserist import Browser, helper
from browserist.constant import timeout
from browserist.exception.retry import RetryTimeoutException
TRUE = "true"
FALSE = "false"
@pytest.mark.parametrize("input, expectation", [
... | [
6738,
4732,
8019,
1330,
9242,
22866,
355,
857,
62,
1662,
62,
40225,
198,
6738,
19720,
1330,
4377,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
6444,
396,
1330,
34270,
11,
31904,
198,
6738,
6444,
396,
13,
9979,
415,
1330,
26827,
198,
... | 2.955801 | 181 |
import os
from pymongo import MongoClient
mongodb_client = MongoClient(os.environ['MONGODB_URL'])
db = mongodb_client.tvrain
articles = db.articles
users = set()
for article in articles.find():
for user in article['views']:
users.add(user)
print(len(users))
| [
11748,
28686,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
198,
31059,
375,
65,
62,
16366,
796,
42591,
11792,
7,
418,
13,
268,
2268,
17816,
44,
18494,
3727,
33,
62,
21886,
6,
12962,
198,
9945,
796,
285,
506,
375,
65,
62,
16... | 2.686275 | 102 |
"""
Purpose: to recreate the values from Harte 2007 in Fig 6.7 and 6.8 to enable
checking of the chi_heap recursion equations
"""
import mete
import numpy as np
import csv
## Fig 6.7 example
def chi_heap_approx(i, j, n0):
""" CHI approximation formula, Harte 2007, Eq. 6.12"""
return mete.get_lambda_heap(i, n0... | [
37811,
198,
30026,
3455,
25,
284,
32049,
262,
3815,
422,
11345,
68,
4343,
287,
12138,
718,
13,
22,
290,
718,
13,
23,
284,
7139,
198,
41004,
286,
262,
33166,
62,
258,
499,
664,
24197,
27490,
198,
37811,
198,
198,
11748,
47091,
198,
1... | 2.295492 | 599 |
from pytest_bdd import scenario
from tests.steps.register import *
from tests.steps.common import *
@scenario(
"features/register.feature",
"User sign up"
)
| [
6738,
12972,
9288,
62,
65,
1860,
1330,
8883,
198,
6738,
5254,
13,
20214,
13,
30238,
1330,
1635,
198,
6738,
5254,
13,
20214,
13,
11321,
1330,
1635,
628,
198,
31,
1416,
39055,
7,
198,
220,
220,
220,
366,
40890,
14,
30238,
13,
30053,
1... | 3.036364 | 55 |
#!/usr/bin/env python
# encoding:utf-8
# ##############################################################################
# The MIT License (MIT)
#
# Copyright (c) [2015] [baidu.com]
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
40477,
12,
23,
198,
198,
2,
1303,
29113,
29113,
7804,
4242,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
685,
4626,
60,
685,
65,
... | 1.907272 | 2,049 |
# PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# src/utils/load_checkpoint.py
import os
import torch
| [
2,
9485,
15884,
354,
11733,
45028,
25,
3740,
1378,
12567,
13,
785,
14,
32782,
25994,
12,
33538,
17822,
14,
20519,
15884,
354,
12,
41501,
45028,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
4091,
5964,
2393,
393,
3187,
3740,
1378,... | 2.975904 | 83 |
from django.conf import settings
from ralph.apps import RalphAppConfig
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
374,
17307,
13,
18211,
1330,
20993,
4677,
16934,
628
] | 4 | 18 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
201,
198,
201,
198,
201,
198
] | 2.615385 | 13 |
import pymc3 as pm
import numpy as np
import theano
| [
11748,
279,
4948,
66,
18,
355,
9114,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
262,
5733,
628
] | 2.842105 | 19 |
__title__ = 'wagtailgmaps'
__version__ = '1.0.1'
__author__ = 'Springload'
__license__ = 'MIT'
__copyright__ = 'Copyright 2017 Springload'
| [
834,
7839,
834,
796,
705,
86,
363,
13199,
70,
31803,
6,
198,
834,
9641,
834,
796,
705,
16,
13,
15,
13,
16,
6,
198,
834,
9800,
834,
796,
705,
30387,
2220,
6,
198,
834,
43085,
834,
796,
705,
36393,
6,
198,
834,
22163,
4766,
834,
... | 2.622642 | 53 |