content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from fastapi import HTTPException, status, Depends
from fastapi.security import SecurityScopes
from jose import jwt, JWTError
from .context import oauth2_scheme, TokenData
from ..crud.user_crud import UserCRUD, UserInDB
from pydantic import ValidationError
from ..crud.deps import get_crud_obj
from ..configuration impor... | [
6738,
3049,
15042,
1330,
14626,
16922,
11,
3722,
11,
2129,
2412,
198,
6738,
3049,
15042,
13,
12961,
1330,
4765,
3351,
13920,
198,
6738,
474,
577,
1330,
474,
46569,
11,
449,
39386,
12331,
198,
6738,
764,
22866,
1330,
267,
18439,
17,
62,
... | 3.452632 | 95 |
# Copyright (c) 2001-2022 Aspose Pty Ltd. All Rights Reserved.
#
# This file is part of Aspose.Words. The source code in this file
# is only intended as a supplement to the documentation, and is provided
# "as is", without warranty of any kind, either expressed or implied.
import aspose.words as aw
from api_example_b... | [
2,
15069,
357,
66,
8,
5878,
12,
1238,
1828,
1081,
3455,
350,
774,
12052,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
1081,
3455,
13,
37117,
13,
383,
2723,
2438,
287,
428,
2393,
198,
2,
318,
691,
5292,
35... | 3.612245 | 98 |
# coding: utf-8
"""
tweak-api
Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak.
OpenAPI spec version: 1.0.8-beta.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
25393,
12,
15042,
628,
220,
220,
220,
24205,
461,
7824,
284,
19386,
351,
477,
262,
24205,
461,
2594,
13,
220,
921,
460,
1064,
503,
517,
546,
24205,
461,
220,
220... | 3.736765 | 1,360 |
from cloudinary.models import CloudinaryField
from django.db import models
| [
6738,
6279,
3219,
13,
27530,
1330,
10130,
3219,
15878,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
628,
198
] | 3.95 | 20 |
from .settings import *
DYNAMICFORMS.update({
'template': 'dynamicforms/jquery_ui/',
})
| [
6738,
764,
33692,
1330,
1635,
198,
198,
35,
40760,
2390,
2149,
13775,
5653,
13,
19119,
15090,
198,
220,
220,
220,
705,
28243,
10354,
705,
67,
28995,
23914,
14,
73,
22766,
62,
9019,
14,
3256,
198,
30072,
198
] | 2.513514 | 37 |
import sys
from django.core.management.base import BaseCommand
try:
input = raw_input
except NameError:
pass
from stormpath.error import Error as StormpathError
from stormpath.resources.provider import Provider
from django_stormpath import social
| [
11748,
25064,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
198,
28311,
25,
198,
220,
220,
220,
5128,
796,
8246,
62,
15414,
198,
16341,
6530,
12331,
25,
198,
220,
220,
220,
1208,
198,
198,
6738,
... | 3.48 | 75 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime as dt
from autoslug import AutoSlugField
from autoslug.utils import slugify
from django.core.exceptions import ValidationError
from django.db import models
from django.template.defaultfilters import trunca... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
4818,
8079,
355,
288,
83,
198,
198,
6738,
44619,
... | 2.881222 | 884 |
import subprocess
import os
from makecfg.config import Config | [
11748,
850,
14681,
198,
11748,
28686,
198,
6738,
787,
37581,
13,
11250,
1330,
17056
] | 4.357143 | 14 |
#!/usr/bin/env python
# encoding: utf-8
from .models import Comment
from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
764,
27530,
1330,
18957,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
198,
6738,
42625,
14... | 3.283582 | 67 |
import io
import os
import re
from setuptools import find_packages, setup
VERSION_RE = re.compile(r"__version__\s*=\s*\"(.*?)\"")
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*args):
"""Reads complete file contents."""
return io.open(os.path.join(HERE, *args), encoding="utf-8").read()
def g... | [
11748,
33245,
198,
11748,
28686,
198,
11748,
302,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
628,
198,
43717,
62,
2200,
796,
302,
13,
5589,
576,
7,
81,
1,
834,
9641,
834,
59,
82,
9,
28,
59,
82,
9,
7879,
... | 2.701258 | 636 |
from abc import ABC, abstractmethod
from typing import List
from domain.Contest.contest import Contest
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
7386,
13,
4264,
395,
13,
3642,
395,
1330,
27297,
628
] | 4.038462 | 26 |
# -*- coding: utf-8 -*-
import pandas as pd
from sklearn.base import BaseEstimator, TransformerMixin
# here you define the operation it should perform
# just return self
class SelectColumnsTransfomer(BaseEstimator, TransformerMixin):
""" Select dataframe columns
"""
class DataframeFunctionTransform... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
8692,
1330,
7308,
22362,
320,
1352,
11,
3602,
16354,
35608,
259,
198,
220,
220,
220,
1303,
994,
345,
... | 2.86911 | 382 |
import multiprocessing
import qrcode
import random
import string
import numpy as np
IMAGE_SIZE = 21
STRING_LENGTH = 10
CHARACTER_SET = string.ascii_lowercase + string.ascii_uppercase + \
string.digits
def randomString():
"""
Return a random string where characters are drawn from a fixed
set of chara... | [
11748,
18540,
305,
919,
278,
198,
11748,
10662,
6015,
1098,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
299,
32152,
355,
45941,
628,
198,
3955,
11879,
62,
33489,
796,
2310,
198,
18601,
2751,
62,
43,
49494,
796,
838,
198,
38019,
2246... | 2.591252 | 663 |
#!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure overwriting read-only files works as expected (via win-tool).
"""
import TestGyp
import filecmp
import os
impo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
201,
198,
2,
15069,
357,
66,
8,
1946,
3012,
3457,
13,
1439,
2489,
10395,
13,
201,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
46... | 2.512894 | 698 |
#!/usr/bin/env python
import psutil
import netifaces
import sys
import logging
import subprocess
# Add various metrics from this code - https://gitlab.ncl.ac.uk/cs-support-group/lcd-monitor-panel/blob/master/data.py
# logging
logging.basicConfig(stream=sys.stdout, level=logging.ERROR)
logger = logging.getLogger(__nam... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
26692,
22602,
198,
11748,
2010,
361,
2114,
198,
11748,
25064,
198,
11748,
18931,
198,
11748,
850,
14681,
198,
198,
2,
3060,
2972,
20731,
422,
428,
2438,
532,
3740,
1378,
18300,
23... | 2.898305 | 413 |
#!/usr/bin/env python
import boto.ec2
import urllib2
import sys
import os
# Get dev
try:
dev = str(sys.argv[1])
except IndexError:
print "Provide block device i.e. xvdf"
sys.exit(1)
# Convert dev to mapping format
if 'nvme' in dev:
# For newer instances which expose EBS volumes as NVMe devices, translate the... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
275,
2069,
13,
721,
17,
198,
11748,
2956,
297,
571,
17,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
2,
3497,
1614,
198,
28311,
25,
198,
220,
1614,
796,
965,
7,
17597,... | 2.694581 | 406 |
from invoke import task
@task
@task
| [
6738,
26342,
1330,
4876,
628,
198,
31,
35943,
628,
198,
31,
35943,
198
] | 3.076923 | 13 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import rospy
from flexbe_core import EventState, Logger
from sonia_common.msg import AddPose
from geometry_msgs.msg import Point, Vector3
from nav_msgs.msg import Odometry
class create_absolute_depth(EventState):
'''
(!!!! DEPRECATED !!!!!) Move the submarine... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
198,
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
686,
2777,
88,
198,
198,
6738,
7059,
1350,
62,
7295,
1330,
8558,
9012,
11,
5972,
1362,
198,
6738,
336... | 2.637755 | 196 |
n = int(input())
matrix = []
for i in range(n):
a = input().strip()
matrix.append(a)
if 'm' in a:
m_r = i
m_c = a.index('m')
if 'p' in a:
p_r = i
p_c = a.index('p')
r_diff = m_r - p_r
c_diff = m_c - p_c
while True:
if r_diff != 0:
if r_diff<0:
... | [
77,
796,
493,
7,
15414,
28955,
198,
6759,
8609,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
77,
2599,
198,
220,
220,
220,
257,
796,
5128,
22446,
36311,
3419,
198,
220,
220,
220,
17593,
13,
33295,
7,
64,
8,
628,
220,
220,
220,
611,
... | 1.587234 | 470 |
# Copyright 2014-2017 Canonical Limited.
#
# This file is part of charms.reactive.
#
# charms.reactive is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distributed in the h... | [
2,
15069,
1946,
12,
5539,
19507,
605,
15302,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
41700,
13,
260,
5275,
13,
198,
2,
198,
2,
41700,
13,
260,
5275,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198... | 3.72973 | 222 |
"""
Utilities for managing chunked file uploads.
See https://jupyter-notebook.readthedocs.io/en/stable/extending/contents.html#chunked-saving
"""
import base64
import contextvars
import time
# Used as a "registry" for uploads.
content_chunks = contextvars.ContextVar("jupyterlab_content_chunks", default={})
def sto... | [
37811,
198,
18274,
2410,
329,
11149,
16058,
276,
2393,
9516,
82,
13,
198,
6214,
3740,
1378,
73,
929,
88,
353,
12,
11295,
2070,
13,
961,
83,
704,
420,
82,
13,
952,
14,
268,
14,
31284,
14,
2302,
1571,
14,
3642,
658,
13,
6494,
2,
3... | 2.750859 | 582 |
# coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class EmailCommseqWebhookSendT... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
14563,
43476,
8324,
7824,
569,
17,
628,
220,
220,
220,
14563,
43476,
30617,
7824,
10628,
362,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
4946,
1761... | 2.195929 | 3,685 |
import RLAgents
import numpy
import matplotlib.pyplot as plt
raw_score_col = 3
norm_score_col = 4
result_path = "./results/"
files = []
files.append("./models/ppo_baseline/run_0/result/result.log")
files.append("./models/ppo_baseline/run_1/result/result.log")
files.append("./models/ppo_baseline/run_2/result/resul... | [
11748,
45715,
10262,
658,
198,
11748,
299,
32152,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
1831,
62,
26675,
62,
4033,
796,
513,
198,
27237,
62,
26675,
62,
4033,
796,
604,
198,
198,
20274,
62,
6978,
... | 2.580645 | 2,139 |
import types
from .node import Node # noqa: F401
from ..base import TributaryException
class LazyGraph(object):
"""Wrapper class around a collection of lazy nodes."""
def node(self, name, readonly=False, nullable=True, value=None): # noqa: F811
"""method to create a lazy node attached to a graph.
... | [
11748,
3858,
198,
6738,
764,
17440,
1330,
19081,
220,
1303,
645,
20402,
25,
376,
21844,
198,
6738,
11485,
8692,
1330,
309,
2455,
560,
16922,
628,
198,
4871,
406,
12582,
37065,
7,
15252,
2599,
198,
220,
220,
220,
37227,
36918,
2848,
1398... | 2.101818 | 550 |
#!/usr/bin/env python3
import player
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
2137,
628
] | 2.923077 | 13 |
# -*- coding: utf-8 -*-
import hashlib
import json
from ..base.simple_downloader import SimpleDownloader
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12234,
8019,
198,
11748,
33918,
198,
198,
6738,
11485,
8692,
13,
36439,
62,
15002,
263,
1330,
17427,
10002,
263,
628
] | 3 | 36 |
from typing import List
from ee.clickhouse.queries.funnels.base import ClickhouseFunnelBase
| [
6738,
19720,
1330,
7343,
198,
198,
6738,
304,
68,
13,
12976,
4803,
13,
421,
10640,
13,
12543,
19423,
13,
8692,
1330,
6914,
4803,
24629,
4954,
14881,
628
] | 3.481481 | 27 |
import time
from src.dao.music_dao import MusicDao
from src.dao.music_list_dao import MusicListDao
from src.entity.music import Music
from src.entity.music_list import MusicList
from src.service.play_list import PlayList
if __name__ == "__main__":
pass
| [
11748,
640,
198,
198,
6738,
12351,
13,
67,
5488,
13,
28965,
62,
67,
5488,
1330,
7849,
35,
5488,
198,
6738,
12351,
13,
67,
5488,
13,
28965,
62,
4868,
62,
67,
5488,
1330,
7849,
8053,
35,
5488,
198,
6738,
12351,
13,
26858,
13,
28965,
... | 2.965909 | 88 |
from typing import Generic, TypeVar, List
from data_structures.doubly_linked_list import DoublyLinkedList
T = TypeVar('T')
class QueueList(Generic[T]):
"""
Basic queue backed with a list. Not optimal since list has O(N) complexity for
inserting and removing elements at the beginning
"""
class Queue... | [
6738,
19720,
1330,
42044,
11,
5994,
19852,
11,
7343,
198,
6738,
1366,
62,
7249,
942,
13,
67,
12944,
306,
62,
25614,
62,
4868,
1330,
5728,
36874,
11280,
276,
8053,
198,
198,
51,
796,
5994,
19852,
10786,
51,
11537,
628,
198,
4871,
4670,... | 2.85906 | 149 |
from models.networks.nestedT import Nest
from models.networks.swin_unet import SwinTransformerSys
from models.networks.swin_transformer import SwinTransformer
from models.networks.axialnet import axialunet, logo,MedT,gated
from models.networks.vit_seg_modeling_gate import VisionTransformer_AG
from .unet_2D import *
fro... | [
6738,
4981,
13,
3262,
5225,
13,
77,
7287,
51,
1330,
21420,
198,
6738,
4981,
13,
3262,
5225,
13,
2032,
259,
62,
403,
316,
1330,
2451,
259,
8291,
16354,
44387,
198,
6738,
4981,
13,
3262,
5225,
13,
2032,
259,
62,
7645,
16354,
1330,
245... | 2.670068 | 294 |
"""
-*- test-case-name: PyHouse.src.Modules.web.test.test_web_rooms -*-
@name: PyHouse/src/Modules/web/web_rooms.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2016 by D. Brian Kimmel
@license: MIT License
@note: Created on Jun 3, 2013
@summary: Web interface to r... | [
37811,
198,
12,
9,
12,
1332,
12,
7442,
12,
3672,
25,
9485,
18102,
13,
10677,
13,
5841,
5028,
13,
12384,
13,
9288,
13,
9288,
62,
12384,
62,
9649,
532,
9,
12,
198,
198,
31,
3672,
25,
220,
220,
220,
220,
220,
9485,
18102,
14,
10677... | 2.761006 | 318 |
import argparse
import random
import re
import socket
import sys
from urllib2 import HTTPError
# Libraries
from lib.core.dork_check import DorkScanner
from lib.core.errors import GoogleBlockException
from lib.core.hash_cracking import HashCracker
from lib.core.hash_cracking.hash_checker import HashChecker
from lib.cor... | [
11748,
1822,
29572,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
17802,
198,
11748,
25064,
198,
6738,
2956,
297,
571,
17,
1330,
14626,
12331,
198,
198,
2,
46267,
198,
6738,
9195,
13,
7295,
13,
67,
967,
62,
9122,
1330,
360,
967,
3335... | 2.264179 | 4,073 |
import tensorflow as tf
from nalp.datasets import ImageDataset
from nalp.models import GAN
# Loading the MNIST dataset
(x, y), (_, _) = tf.keras.datasets.mnist.load_data()
# Creating an Image Dataset
dataset = ImageDataset(x, batch_size=256, shape=(x.shape[0], 784), normalize=True)
# Creating the GAN
gan = GAN(inpu... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
299,
282,
79,
13,
19608,
292,
1039,
1330,
7412,
27354,
292,
316,
198,
6738,
299,
282,
79,
13,
27530,
1330,
402,
1565,
198,
198,
2,
12320,
262,
29060,
8808,
27039,
198,
7,
87,
11,... | 2.51145 | 262 |
# Generated by Django 2.2.2 on 2019-06-24 17:22
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
17,
319,
13130,
12,
3312,
12,
1731,
1596,
25,
1828,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.communication_not_done_reason import (
CommunicationNotDoneReason as CommunicationNotDoneReason_,
)
__all__ = ["CommunicationNotDoneReason"]
_resource = _Value... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
277,
71,
343,
13,
37540,
13,
27160,
316,
1330,
11052,
7248,
355,
4808,
11395,
7248,
198,
198,
6738,
267,
2840,
62,
69,
71,
343,
13,
26791,
1330,
11052,
7248,
628,
198,
6738,
267,
2840,
... | 3.090909 | 209 |
from argparse import Namespace
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .query import QueryBuilder
# this class is what is used to generate the output for the each query in the execution block
| [
6738,
1822,
29572,
1330,
28531,
10223,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
32233,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
198,
198,
361,
41876,
62,
... | 4.144737 | 76 |
import regex
from botbase import *
args = sys.argv
query = p.data.api.ListGenerator("abuselog", aflprop = "details", aflfilter = args[1], site = site)
query.set_maximum_items(args[2])
query.set_query_increment(50)
extra = r".{,100}"
pattern = regex.compile (r"(?V1)"+extra+r"(?:"+input("Regex: ")+r")"+extra, flags = ... | [
11748,
40364,
198,
6738,
10214,
8692,
1330,
1635,
198,
198,
22046,
796,
25064,
13,
853,
85,
198,
198,
22766,
796,
279,
13,
7890,
13,
15042,
13,
8053,
8645,
1352,
7203,
397,
84,
741,
519,
1600,
257,
2704,
22930,
796,
366,
36604,
1600,
... | 2.581633 | 196 |
import warnings
import numpy as np
import pylab as plt
from matplotlib.gridspec import GridSpec
from matplotlib.cbook import mplDeprecation
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
# always reload gridspec_helper.py
from importlib import reload
import gridspec_helper; reload(gridspec_helper... | [
11748,
14601,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
279,
2645,
397,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
2164,
2340,
43106,
1330,
24846,
22882,
198,
6738,
2603,
29487,
8019,
13,
66,
2070,
1330,
285,
489,
12156,
8344... | 2.081061 | 3,960 |
from PyQt5.QtWidgets import *
from PyQt5.QtCore import Qt, QObject, QEvent
from .datatable_view import DataTableView
from .datatable_header import HeaderView
import pandas as pd
from typing import Dict, List, Union, Iterable, Any
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
33734,
11,
1195,
10267,
11,
1195,
9237,
198,
6738,
764,
19608,
21156,
62,
1177,
1330,
6060,
10962,
7680,
198,
67... | 3.052632 | 76 |
from random import randint
# 0: draw 1:lost 2:won
matrix = [[0,1,2],
[2,0,1],
[1,2,0]]
choices = ["rock", "paper", "scissors"]
choice_map = {"rock": 0, "paper":1, "scissors":2}
comp_choice = randint(0,2)
user_choice = input("Please choose rock, paper or scissors:\n").lower().strip()
user_choice = ch... | [
6738,
4738,
1330,
43720,
600,
198,
2,
657,
25,
3197,
352,
25,
33224,
362,
25,
26502,
198,
6759,
8609,
796,
16410,
15,
11,
16,
11,
17,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
17,
11,
15,
11,
16,
4357,
198,
... | 2.495098 | 204 |
import mxnet as mx
import numpy as np
import Queue
import threading
import time
from rcnn.io.rpn import get_rpn_testbatch
| [
11748,
285,
87,
3262,
355,
285,
87,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4670,
518,
198,
11748,
4704,
278,
198,
11748,
640,
198,
198,
6738,
48321,
20471,
13,
952,
13,
81,
21999,
1330,
651,
62,
81,
21999,
62,
9288,
43501,
... | 2.840909 | 44 |
cat = Cat('Harry', 2)
cat.speak() | [
198,
9246,
796,
5181,
10786,
18308,
3256,
362,
8,
198,
9246,
13,
47350,
3419
] | 2.428571 | 14 |
import json
from app import db
class Note(db.Model):
"""A note about an information item"""
__tablename__ = 'notes'
id = db.Column(db.Integer, primary_key=True)
location = db.Column(db.String, nullable=None)
description = db.Column(db.String)
tags = db.Column(db.String)
def to_dict(self... | [
11748,
33918,
198,
198,
6738,
598,
1330,
20613,
628,
198,
4871,
5740,
7,
9945,
13,
17633,
2599,
198,
220,
220,
220,
37227,
32,
3465,
546,
281,
1321,
2378,
37811,
628,
220,
220,
220,
11593,
8658,
11925,
480,
834,
796,
705,
17815,
6,
... | 2.497703 | 653 |
import pandas as pd
import numpy as np
from joblib import Parallel, delayed
import vrp.io as io
import vrp.constructive as c
import vrp.sim as sim
from vrp.constructive import SequentialClarkeWright
from vrp.sim import ILSWithConstructive
def multiple_replications(scenario, n_reps=10, n_jobs=1):
'''
Multiple... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1693,
8019,
1330,
42945,
11,
11038,
198,
198,
11748,
410,
81,
79,
13,
952,
355,
33245,
198,
11748,
410,
81,
79,
13,
41571,
425,
355,
269,
198,
1174... | 1.928634 | 2,284 |
INPUT_FIELD_NAME = "input_data"
| [
1268,
30076,
62,
44603,
62,
20608,
796,
366,
15414,
62,
7890,
1,
198
] | 2.461538 | 13 |
N, A = int(input()), int(input())
if N % 500 <= A:
print('Yes')
else:
print('No') | [
45,
11,
317,
796,
493,
7,
15414,
3419,
828,
493,
7,
15414,
28955,
198,
198,
361,
399,
4064,
5323,
19841,
317,
25,
198,
220,
220,
220,
3601,
10786,
5297,
11537,
198,
17772,
25,
198,
220,
220,
220,
3601,
10786,
2949,
11537
] | 2.195122 | 41 |
from zope.interface import providedBy
from pyramid.interfaces import (
IAuthenticationPolicy,
IAuthorizationPolicy,
ISecuredView,
IView,
IViewClassifier,
)
from pyramid.compat import map_
from pyramid.threadlocal import get_current_registry
Everyone = 'system.Everyone'
Authenticated = 'system... | [
6738,
1976,
3008,
13,
39994,
1330,
2810,
3886,
198,
198,
6738,
27944,
13,
3849,
32186,
1330,
357,
198,
220,
220,
220,
314,
47649,
3299,
36727,
11,
198,
220,
220,
220,
314,
13838,
1634,
36727,
11,
198,
220,
220,
220,
3180,
721,
1522,
... | 3.063132 | 3,263 |
import os, time, sys, random, string, subprocess, pprint
from server import DEFAULT_CONFIG
from util import Logger, getTime, full_path, randString, updateConfig
from queue import FIFOQueue, TaskObject, ShortestTaskQueue
if __name__ == "__main__":
if len(sys.argv) < 2:
c = CompletionServiceClient()
elif len(sy... | [
11748,
28686,
11,
640,
11,
25064,
11,
4738,
11,
4731,
11,
850,
14681,
11,
279,
4798,
198,
198,
6738,
4382,
1330,
5550,
38865,
62,
10943,
16254,
198,
6738,
7736,
1330,
5972,
1362,
11,
651,
7575,
11,
1336,
62,
6978,
11,
43720,
10100,
... | 2.8 | 170 |
import hashlib
import hmac
import json
import uuid
import os
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from Crypto.Protocol.KDF import scrypt
from eth_keys import keys
from eth_utils import (
big_endian_to_int,
decode_... | [
11748,
12234,
8019,
198,
11748,
289,
20285,
198,
11748,
33918,
198,
11748,
334,
27112,
198,
11748,
28686,
198,
6738,
45898,
13,
71,
1031,
6759,
13,
19795,
20288,
13,
66,
541,
7084,
1330,
44334,
11,
16113,
11,
12881,
198,
6738,
45898,
13... | 2.456693 | 254 |
import os
import random
import cv2
import numpy as np
import PIL.Image
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from nets.nets_utility import *
import torchvision.transforms.functional as F
if __name__ == "__main__":
batch_si... | [
11748,
28686,
198,
11748,
4738,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
350,
4146,
13,
5159,
198,
6738,
28034,
13,
26791,
13,
7890,
13,
19608,
292,
316,
1330,
16092,
292,
316,
198,
6738,
28034,
13,
267... | 2.416532 | 617 |
"""A cache for thumbnailed images."""
from __future__ import unicode_literals
import collections
import sys
import os.path
try:
from io import BytesIO as StringIO
except Exception as e:
from cStringIO import StringIO
from PIL import Image
from django.core.files.base import File
from optimizations.assetcach... | [
37811,
32,
12940,
329,
294,
10269,
6255,
4263,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
17268,
198,
11748,
25064,
198,
11748,
28686,
13,
6978,
198,
198,
28311,
25,
198,
220,
220,
220,... | 2.395887 | 4,620 |
import numpy as np
from models import Vector, Bounds
from data_info import TILE_TYPES, DUNGEON_DIMENSION
| [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
4981,
1330,
20650,
11,
347,
3733,
201,
198,
201,
198,
6738,
1366,
62,
10951,
1330,
31598,
2538,
62,
9936,
47,
1546,
11,
360,
4944,
8264,
1340,
62,
35,
3955,
16938,
2849,
201,
198,
201,
... | 2.604651 | 43 |
#!/usr/bin/env python3
# ## ###############################################
#
# pwm.py
# Controls a 7-segments display using Raspberry Pi
# and a 74LS47 driver
#
# Autor: Mauricio Matamoros
# License: MIT
#
# ## ###############################################
# Future imports (Python 2.7 compatibility)
from __future__... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
22492,
1303,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
279,
26377,
13,
9078,
198,
2,
36357,
257,
767,
12,
325,
11726,
3359,
1262,
24244,
13993,
198,
2,
290,
257,
8915,
6561,
... | 2.811321 | 424 |
# -*- 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 tensorflow as tf
import cv2
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
#Utility for image loading and prepeocessing\
#Load the image
low_res_image = load_img('./cartoonized_image.jpg', None, './cartoonized_image.jpg')
#Load the model
interpreter = tf.lite.Interpreter(model_path=f... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
18274,
879,
329,
2939,
110... | 2.664975 | 394 |
# We iterate hexagonal numbers and check whether they are pentagonal.
# By definition, every hexagonal number is a triangle number.
import math
n_h = 144
n_p = 0.5
while not n_p.is_integer():
h = n_h*(2*n_h - 1)
n_p = (1 + math.sqrt(1 + 24*h))/6
n_h += 1
print(h)
# Copyright Junipyr. All r... | [
2,
775,
11629,
378,
17910,
27923,
3146,
290,
2198,
1771,
484,
389,
28145,
27923,
13,
201,
198,
2,
2750,
6770,
11,
790,
17910,
27923,
1271,
318,
257,
22950,
1271,
13,
201,
198,
201,
198,
11748,
10688,
201,
198,
201,
198,
201,
198,
77... | 2.354839 | 155 |
from django.conf import settings
from django.shortcuts import render
def handle_sphinx_doc_index(
request,
data=None):
"""handle_sphinx_doc_index
Generic handler for sending the browser to the
sphinx documentation index:
<repo>/webapp/drf_network_pipeline/docs/build/html/index.html
... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
628,
198,
4299,
5412,
62,
82,
746,
28413,
62,
15390,
62,
9630,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2581,
11,
198,
220,
220,
220... | 2.580311 | 193 |
"""
Test Object locations going down
"""
import logging
import time
from teuthology import misc as teuthology
from tasks import ceph_manager
from tasks.util.rados import rados
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Test handling of object location going down
"""
if config is None... | [
37811,
198,
14402,
9515,
7064,
1016,
866,
198,
37811,
198,
11748,
18931,
198,
11748,
640,
198,
6738,
573,
1071,
1435,
1330,
12747,
355,
573,
1071,
1435,
198,
6738,
8861,
1330,
269,
27446,
62,
37153,
198,
6738,
8861,
13,
22602,
13,
6335,... | 2.258567 | 1,284 |
"""Schema v7
Revision ID: b76eab0a059
Revises: a695de64338
Create Date: 2016-12-07
"""
# revision identifiers, used by Alembic.
revision = 'b76eab0a059'
down_revision = 'a695de64338'
import os
import sys
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), *['..'] * 5)))
from alembic import o... | [
37811,
27054,
2611,
410,
22,
198,
198,
18009,
1166,
4522,
25,
275,
4304,
68,
397,
15,
64,
46712,
198,
18009,
2696,
25,
257,
37381,
2934,
2414,
28460,
198,
16447,
7536,
25,
1584,
12,
1065,
12,
2998,
198,
198,
37811,
198,
198,
2,
1844... | 2.606452 | 155 |
import os
from glob import glob
from setuptools import setup
package_name = 'openpose_ros2'
setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_nam... | [
11748,
28686,
198,
6738,
15095,
1330,
15095,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
26495,
62,
3672,
796,
705,
9654,
3455,
62,
4951,
17,
6,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
28,
26495,
62,
3672,
11,
198... | 2.355491 | 346 |
#
# "Cascading CLI" pattern "time" CLI
#
# This CLI provides a "time" command for the main CLI.
import time
from abstrys.cli.common import CliCommand
class TimeCommand(CliCommand):
"""
A CLI command that returns the current time.
"""
def set_up_parser(self, parser):
"""
Set up the ti... | [
2,
220,
198,
2,
366,
34,
3372,
4980,
43749,
1,
3912,
366,
2435,
1,
43749,
198,
2,
198,
2,
770,
43749,
3769,
257,
366,
2435,
1,
3141,
329,
262,
1388,
43749,
13,
198,
198,
11748,
640,
198,
6738,
16552,
19753,
13,
44506,
13,
11321,
... | 2.240793 | 353 |
from .base import BaseModel
| [
6738,
764,
8692,
1330,
7308,
17633,
628
] | 4.142857 | 7 |
import os
import ssl
import cv2 as cv
import numpy as np
from distutils.util import strtobool
import aiohttp
from aiohttp import web
import jinja2
import aiohttp_jinja2
from camera import VideoCamera
# settings
DEBUG = strtobool(os.environ.get('DEBUG', 'True'))
PORT = int(os.environ.get('PORT', 8088))
SSL = strtobo... | [
11748,
28686,
198,
11748,
264,
6649,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1233,
26791,
13,
22602,
1330,
965,
83,
672,
970,
198,
198,
11748,
257,
952,
4023,
198,
6738,
257,
952,
4023,
... | 2.264045 | 534 |
# Copyright (c) 2018-2019, Krzysztof Rusek
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions an... | [
2,
15069,
357,
66,
8,
2864,
12,
23344,
11,
13685,
89,
893,
89,
1462,
69,
371,
1904,
74,
198,
2,
1439,
2489,
10395,
13,
198,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
... | 2.344914 | 1,986 |
"""Code to calculate the mean and standard deviation of dataset.
Author: Srinivasan G
"""
import os
from PIL import Image
import numpy as np
import time
def find_mean_standard_deviation(image_dir):
"""Return the mean and standard deviation of dataset.
Mean and Standard Deviation required for image normaliza... | [
37811,
10669,
284,
15284,
262,
1612,
290,
3210,
28833,
286,
27039,
13,
198,
198,
13838,
25,
311,
12769,
38630,
272,
402,
198,
37811,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
64... | 2.217742 | 620 |
import cv2
import os
import keras_ocr
import numpy as np
import pytesseract
import easyocr
import matplotlib.pyplot as plt
| [
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
41927,
292,
62,
1696,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
83,
408,
263,
529,
198,
11748,
2562,
1696,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
1... | 2.396552 | 58 |
"""
https://portswigger.net/web-security/information-disclosure/exploiting/lab-infoleak-via-backup-files
""" | [
37811,
198,
5450,
1378,
634,
2032,
15249,
13,
3262,
14,
12384,
12,
12961,
14,
17018,
12,
6381,
17966,
14,
20676,
78,
1780,
14,
23912,
12,
10745,
2305,
461,
12,
8869,
12,
1891,
929,
12,
16624,
198,
37811
] | 2.918919 | 37 |
# trafcapEthernetPacket.py
#
# Copyright (c) 2013 Protectus,LLC. All Rights Reserved.
#
# Classes to help pull data off the wire and update mongo
import subprocess
import time
from trafcap import trafcap
from datetime import datetime
import traceback
import sys
class EthernetPacket(object):
"""
Parent class f... | [
2,
1291,
69,
11128,
36,
490,
3262,
47,
8317,
13,
9078,
198,
2,
198,
2,
15069,
357,
66,
8,
2211,
21916,
385,
11,
3069,
34,
13,
220,
1439,
6923,
33876,
13,
198,
2,
198,
2,
38884,
284,
1037,
2834,
1366,
572,
262,
6503,
290,
4296,
... | 1.674988 | 2,083 |
'''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... | [
7061,
6,
198,
15269,
357,
34,
8,
33448,
29925,
39606,
198,
4023,
1378,
66,
36484,
18055,
13,
785,
198,
31373,
31,
66,
36484,
18055,
13,
785,
198,
198,
41972,
416,
11232,
5601,
768,
11,
11232,
34974,
628,
220,
220,
220,
770,
1430,
31... | 3.026882 | 372 |
# 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,
... | 3.546729 | 428 |
# works 100%
Size = [4,3,2,1,5]
Dir = [0,1,0,0,0]
print(solution(Size, Dir)) | [
2,
2499,
1802,
4,
198,
198,
10699,
796,
685,
19,
11,
18,
11,
17,
11,
16,
11,
20,
60,
198,
35277,
796,
685,
15,
11,
16,
11,
15,
11,
15,
11,
15,
60,
198,
197,
628,
198,
4798,
7,
82,
2122,
7,
10699,
11,
36202,
4008
] | 1.76087 | 46 |
#!/usr/bin/env python
# Copyrights. All rights reserved.
# ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland,
# Space Center (eSpace), 2018
# See the LICENSE.TXT file for more details.
"""Script performs benchmarking on flyingthings3D.
Benchmarking in performed with maximum disparity of 191 on
960 x 540 full-size ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
6955,
49158,
13,
1439,
2489,
10395,
13,
198,
2,
39031,
2538,
20634,
56,
51,
25994,
22125,
48,
8924,
376,
1961,
1137,
21358,
5550,
9131,
2937,
1565,
12161,
11,
14679,
11,
198,
2,
4... | 3.08091 | 791 |
from datasets.dataset import Dataset
from torchvision import datasets, transforms
import torch
import random
| [
198,
6738,
40522,
13,
19608,
292,
316,
1330,
16092,
292,
316,
198,
6738,
28034,
10178,
1330,
40522,
11,
31408,
198,
11748,
28034,
198,
11748,
4738,
628,
628,
198
] | 4.071429 | 28 |
from __future__ import print_function
from types import SimpleNamespace
from unittest import mock
import collections
import functools
import io
import lasagne
import numpy as np
import pytest
from .. import drivers
from .. import execution
from .. import recorders
from ..execution import DataTables, DataStore
from .... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
3858,
1330,
17427,
36690,
10223,
198,
6738,
555,
715,
395,
1330,
15290,
198,
11748,
17268,
198,
11748,
1257,
310,
10141,
198,
11748,
33245,
198,
198,
11748,
39990,
21080,
198,... | 2.586103 | 331 |
# Copyright (c) 2019 Intel Corporation
# 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 w... | [
2,
15069,
357,
66,
8,
13130,
8180,
10501,
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,... | 3.541985 | 262 |
# -*- coding: utf-8 -*-
{
'name': 'Product Email Template',
'depends': ['account'],
'author': 'OpenERP SA',
'category': 'Accounting & Finance',
'description': """
Add email templates to products to be send on invoice confirmation
==================================================================
W... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
90,
198,
220,
220,
220,
705,
3672,
10354,
705,
15667,
9570,
37350,
3256,
198,
220,
220,
220,
705,
10378,
2412,
10354,
37250,
23317,
6,
4357,
198,
220,
220,
220,
7... | 3.041825 | 263 |
import numpy as np
WALL_LEN = 20.0
NUM_PATHS = 8.0
WALL_FROM_CENTER = 8.0
TARGET_DIST = 25.0
xml_block = '<body mocap=\"true\" pos=\"{x} {y} 1\" euler="0 0 {z_rot}\">\n\
\t<geom type=\"box\" size=\"{wall_len} 0.5 2\" group=\"1\" condim=\"3\" conaffinity=\"1\"/>\n\
</body>'
increments = 2*np.pi / NUM_PATHS
half_incre... | [
11748,
299,
32152,
355,
45941,
198,
198,
54,
7036,
62,
43,
1677,
796,
1160,
13,
15,
198,
41359,
62,
47,
1404,
7998,
796,
807,
13,
15,
198,
54,
7036,
62,
10913,
2662,
62,
43960,
1137,
796,
807,
13,
15,
198,
51,
46095,
62,
35,
880... | 1.687736 | 1,060 |
from abc import ABC, abstractmethod
from typing import List
from mpmath import eye, mpc, matrix
from mpmath import expm as mp_expm
from numpy import ndarray, identity
from numpy.linalg import matrix_power
from scipy.linalg import expm as scipy_expm
from .matrices import Matrix
class TrotterFirstOrder(ProductFormul... | [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
285,
4426,
776,
1330,
4151,
11,
285,
14751,
11,
17593,
198,
6738,
285,
4426,
776,
1330,
1033,
76,
355,
29034,
62,
1069,
4426,
198,
6738,
299,
... | 2.155334 | 1,603 |
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class SQLServerInstanceVersion(object):
"""Implementation of the 'SQLServerInstanceVersion' model.
Specifies the Server Instance Version.
Attributes:
build (int): Specfies the build.
major_version (int): Specfies the major version.
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
13130,
1766,
956,
414,
3457,
13,
628,
198,
4871,
49747,
6561,
18497,
33384,
14815,
7,
15252,
2599,
628,
220,
220,
220,
37227,
3546,
32851,
286,
262,
705,
50,
... | 2.385254 | 963 |
print("Entre com o numero: ")
num=int(input())
print("Fatorial de ", num, " igual a:", fat(num))
| [
198,
4798,
7203,
14539,
260,
401,
267,
997,
3529,
25,
366,
8,
198,
22510,
28,
600,
7,
15414,
28955,
198,
197,
198,
4798,
7203,
37,
21592,
390,
33172,
997,
11,
366,
45329,
723,
257,
25,
1600,
3735,
7,
22510,
4008,
198
] | 2.439024 | 41 |
from AutoPoem.Model import *
from config import Config
if __name__ == '__main__':
model = PoetryModel(Config)
for i in range(3):
# 给出第一句话进行预测
sen = model.predict_sen('山为斜好几,')
print(sen)
| [
6738,
11160,
18833,
368,
13,
17633,
1330,
1635,
198,
6738,
4566,
1330,
17056,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2746,
796,
7695,
11973,
17633,
7,
16934,
8,
198,
220,
220,
220,
329,... | 1.774194 | 124 |
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
import unittest
from simpa.core.device_digital_twins import RSOMExplorerP50
from simpa.core.device_digital_twins import InVision256TF
from simpa.core.device_digital_tw... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33448,
7458,
286,
49452,
8366,
11998,
11,
32975,
37,
57,
198,
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33448,
2365,
988,
10299,
17231,
75,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
... | 3.228188 | 149 |
import numpy as np
import tensorflow as tf
from ammf.core import format_checker
from ammf.core import box_3d_encoder
def np_box_3d_to_box_8co(box_3d):
"""Computes the 3D bounding box corner positions from Box3D format.
The order of corners are preserved during this conversion.
Args:
box_3d: 1 x... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
716,
76,
69,
13,
7295,
1330,
5794,
62,
9122,
263,
198,
6738,
716,
76,
69,
13,
7295,
1330,
3091,
62,
18,
67,
62,
12685,
12342,
628,
198,
4299,
... | 2.072832 | 9,515 |
"""Table Model."""
from config.database import Model
from orator.orm import belongs_to
class Table(Model):
"""Table Model."""
__fillable__ = ['user_id', 'oppo_id', 'token', 'move', 'completed',
'last_move_timestamp', 'next_id', 'owner', 'winner', 'msg']
__table__ = 'chesses'
@bel... | [
37811,
10962,
9104,
526,
15931,
198,
198,
6738,
4566,
13,
48806,
1330,
9104,
198,
6738,
393,
1352,
13,
579,
1330,
14448,
62,
1462,
628,
198,
4871,
8655,
7,
17633,
2599,
198,
220,
220,
220,
37227,
10962,
9104,
526,
15931,
198,
220,
220... | 2.450704 | 142 |
'''
Plot functions to graphically present simulation results
'''
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
def setup_plots(suptitle):
'''
Basic setup of plots so ... | [
7061,
6,
198,
43328,
5499,
284,
4823,
1146,
1944,
18640,
2482,
198,
7061,
6,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
... | 2.54982 | 3,894 |
import requests
from .base_wrapper import ApiWrapperBase, ApiUrls, RequestParms
| [
11748,
7007,
198,
6738,
764,
8692,
62,
48553,
1330,
5949,
72,
36918,
2848,
14881,
11,
5949,
72,
16692,
7278,
11,
19390,
47,
8357,
628,
198
] | 3.28 | 25 |
from comments.serializers import CommentSerializer
from django.http import Http404
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from classifier.classification import Classification
from classifier.classification_json import JSONClassificationRes... | [
6738,
3651,
13,
46911,
11341,
1330,
18957,
32634,
7509,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6... | 2.702096 | 668 |
import os
import sys
from os.path import join as pjoin
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import logging
from PIL import Image
import numpy as np
import torch
import torch.nn.functional as F
from torch.utils import data
from torchvision import transforms
logger = logging.getLogger("Logg... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
28686,
13,
6978,
1330,
4654,
355,
279,
22179,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
492,
48774,... | 3.26 | 100 |
'''
Created on Feb 27, 2011
@author: Blodstone
'''
from nltk.corpus import wordnet, stopwords
from nltk.tokenize import word_tokenize
import string
import time
from operator import itemgetter
from IOPreprocessing.DataPreparation import DataRetrieval
#definitely false but for testing sake
... | [
7061,
6,
201,
198,
41972,
319,
3158,
2681,
11,
2813,
201,
198,
201,
198,
31,
9800,
25,
1086,
375,
6440,
201,
198,
7061,
6,
201,
198,
201,
198,
6738,
299,
2528,
74,
13,
10215,
79,
385,
1330,
1573,
3262,
11,
2245,
10879,
201,
198,
... | 2.676399 | 411 |
from __future__ import absolute_import
from PyQt4.QtGui import QToolBar, QLabel, QPixmap, QApplication, QCursor
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import pyqtSlot, Qt
from views.core import centraltabwidget
from gui.wellplot.subplots.wellplotwidget import WellPlotWidget
from globalvalues.appsetting... | [
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
9485,
48,
83,
19,
13,
48,
83,
8205,
72,
1330,
1195,
25391,
10374,
11,
1195,
33986,
11,
1195,
47,
844,
8899,
11,
1195,
23416,
11,
36070,
21471,
198,
6738,
9485,
48,... | 3.049793 | 241 |
from flask import Flask, jsonify, request
from flask_cors import CORS
from pymongo import MongoClient
from db_access import WorkshopDb
from config_manager import ConfigManager
from task01_connect import Task01_Connect
from task02_static import Task02_StaticIp
from task03_webserver import Task03_WebServer
from task04_ap... | [
6738,
42903,
1330,
46947,
11,
33918,
1958,
11,
2581,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
6738,
20613,
62,
15526,
1330,
26701,
43832,
198,
6738,
4566,
62,
37153,
1330,
17... | 2.722936 | 545 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""Clone of Nmap's first generation OS fingerprinting.
This code works with the first-generation OS detection and
nmap-o... | [
2235,
770,
2393,
318,
636,
286,
1446,
12826,
198,
2235,
4091,
2638,
1378,
2503,
13,
2363,
7959,
13,
2398,
14,
42068,
14,
1416,
12826,
329,
517,
4175,
602,
198,
2235,
15069,
357,
34,
8,
39393,
347,
295,
10989,
1279,
28864,
31,
2363,
... | 2.970636 | 613 |
from eval import load_model
import torch
import matplotlib.pyplot as plt
from torchvision import transforms
from torch.utils.data import DataLoader
from PIL import Image
import cv2
import argparse
import os
if __name__ == "__main__":
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print... | [
6738,
5418,
1330,
3440,
62,
19849,
198,
11748,
28034,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
28034,
10178,
1330,
31408,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
350,
4146,
13... | 2.715556 | 225 |
import copy
if __name__ == '__main__':
print(parse_and_execute([x.strip() for x in open('input/08').readlines()]))
print(parse_modify_and_execute([x.strip() for x in open('input/08').readlines()])) | [
11748,
4866,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
7,
29572,
62,
392,
62,
41049,
26933,
87,
13,
36311,
3419,
329,
2124,
287,
1280,
10786,
15414,
14,
2919,
27691,
... | 2.65 | 80 |
import os
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from app import app, db
env_name = os.getenv('FLASK_ENV')
app = app(env_name)
migrate = Migrate(app=app, db=db)
manager = Manager(app=app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
manager.run(... | [
11748,
28686,
198,
6738,
42903,
62,
12048,
1330,
9142,
198,
6738,
42903,
62,
76,
42175,
1330,
337,
42175,
11,
337,
42175,
21575,
198,
6738,
598,
1330,
598,
11,
20613,
198,
198,
24330,
62,
3672,
796,
28686,
13,
1136,
24330,
10786,
3697,
... | 2.824561 | 114 |
#!/usr/bin/python
# coding=utf-8
#__author__ = 'CY'
from flask import render_template, request, flash,abort,redirect,url_for
from flask.ext.login import login_required, current_user
from . import main
from .. import db
from sqlalchemy import and_,desc,or_
from app.models import users,backhosts,customers,backar... | [
2,
48443,
14629,
14,
8800,
14,
29412,
201,
198,
2,
19617,
28,
40477,
12,
23,
201,
198,
2,
834,
9800,
834,
796,
705,
34,
56,
6,
201,
198,
6738,
42903,
1330,
220,
8543,
62,
28243,
11,
2581,
11,
7644,
11,
397,
419,
11,
445,
1060,
... | 2.548246 | 456 |
import tensorflow as tf
def down_sampling_module(input_tensor):
"""Downsampling Module"""
channels = list(input_tensor.shape)[-1]
main_branch = tf.keras.layers.Conv2D(
channels, kernel_size=(1, 1))(input_tensor)
main_branch = tf.nn.relu(main_branch)
# main_branch = tf.keras.layers.Conv2D(
... | [
11748,
11192,
273,
11125,
355,
48700,
628,
198,
4299,
866,
62,
37687,
11347,
62,
21412,
7,
15414,
62,
83,
22854,
2599,
198,
220,
220,
220,
37227,
8048,
37687,
11347,
19937,
37811,
198,
220,
220,
220,
9619,
796,
1351,
7,
15414,
62,
83,... | 2.177458 | 834 |
from functools import lru_cache
from sqlsite.database import install_function
import re
PATH_MATCH_FUNCTION_NAME = "PATH_MATCH"
PATTERN_COMPONENT_RE = re.compile(r"<(?P<param_type>[a-z]+):(?P<param_name>[a-z_]+)>")
PATTERN_PARAM_TYPES = {
"str": "[^/]+",
"int": "[0-9]+",
"slug": "[-a-zA-Z0-9_]+",
"u... | [
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,
6738,
19862,
7278,
578,
13,
48806,
1330,
2721,
62,
8818,
198,
198,
11748,
302,
198,
198,
34219,
62,
44,
11417,
62,
42296,
4177,
2849,
62,
20608,
796,
366,
34219,
62,
44,
11417,
... | 2.391499 | 894 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
import boto3
import os
import traceback
from string import ascii_lowercase
from random import choice
import json
import logging
import time
from typing import Optional, Union
from pathlib import Path
from cloudformation_cli_python_lib import SessionProxy, exceptions
LOG = logging.getLogger(__name__)
LOG.setLevel(logg... | [
11748,
275,
2069,
18,
198,
11748,
28686,
198,
11748,
12854,
1891,
198,
6738,
4731,
1330,
355,
979,
72,
62,
21037,
7442,
198,
6738,
4738,
1330,
3572,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
640,
198,
6738,
19720,
1330,
32233,
1... | 3.645161 | 93 |