content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
6127,
7560,
416,
5413,
357,
49,
8,
11160,
19452,
6127,
35986,
13,
198,
2,
19179,
743,
2728,
11491,
4069,
290,
481,
307,
2626,
611,
262,
2438,
318,
198,
2,
16935,
515,
13,
... | 3.127753 | 454 |
from __main__ import vtk, qt, ctk, slicer
from vtk.util import numpy_support
import numpy as np
def convolution3D(inputData, filter_name):
'''
Function Declaration
- Function Name: convolution3D
- Function Input:
- inputData: the 3D input tensor to be convolved
- filter_name: the... | [
6738,
11593,
12417,
834,
1330,
410,
30488,
11,
10662,
83,
11,
269,
30488,
11,
14369,
263,
198,
6738,
410,
30488,
13,
22602,
1330,
299,
32152,
62,
11284,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4299,
3063,
2122,
18,
35,
7,
15414,... | 2.444668 | 1,491 |
#!/usr/bin/env python2.7
#
# Copyright (C) 2013-2014 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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 Licens... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
22,
198,
2,
198,
2,
15069,
357,
34,
8,
2211,
12,
4967,
7446,
44520,
11,
3457,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
44332,
12,
25981,
15813,
357,
28886,
44520,
3859,
5... | 2.722795 | 6,598 |
import socket,usrv,io,re
if __name__ == "__main__":
print("run")
srv=uhttp()
for i in range(25):
srv.check()
pass
print("Ok")
| [
11748,
17802,
11,
14629,
85,
11,
952,
11,
260,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
5143,
4943,
198,
220,
220,
220,
19677,
85,
28,
84,
4023,
3419,
198,
220,
220,
2... | 1.97561 | 82 |
# --------------
# Importing header files
import numpy as np
# Path of the file has been stored in variable called 'path'
data = np.genfromtxt(path, delimiter=",", skip_header = 1)
print(data)
print(type(data))
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Code starts here
census = np.concatenate(... | [
2,
220,
26171,
198,
2,
17267,
278,
13639,
3696,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
2,
10644,
286,
262,
2393,
468,
587,
8574,
287,
7885,
1444,
705,
6978,
6,
201,
198,
7890,
796,
45941,
13,
5235,
6738,
14116,
7,
6978,
... | 2.355978 | 736 |
import os
from pathlib import Path
from typing import Optional
from basis.cli.services.output import prompt_path
def resolve_graph_path(
path: Path, exists: bool, create_parents_if_necessary: bool = True
) -> Path:
"""Resolve an explicitly given graph location to a yaml"""
if path.is_dir():
f = p... | [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
4308,
13,
44506,
13,
30416,
13,
22915,
1330,
6152,
62,
6978,
628,
198,
4299,
10568,
62,
34960,
62,
6978,
7,
198,
220,
220,
220,
3108,
25,... | 2.368812 | 808 |
import logging
import sys
from cert_schema import Chain
from cert_issuer import helpers
from cert_issuer import signer as signer_helper
from cert_issuer.certificate_handler import CertificateBatchHandler, CertificateV2Handler
from cert_issuer.connectors import ServiceProviderConnector
from cert_issuer.issuer import Is... | [
11748,
18931,
198,
11748,
25064,
198,
198,
6738,
5051,
62,
15952,
2611,
1330,
21853,
198,
6738,
5051,
62,
747,
15573,
1330,
49385,
198,
6738,
5051,
62,
747,
15573,
1330,
1051,
263,
355,
1051,
263,
62,
2978,
525,
198,
6738,
5051,
62,
7... | 2.776042 | 384 |
#!/usr/bin/env python3
import json
import argparse
import os
import sys
import subprocess
from check_if_done import check_state_comet
import time
import shutil
from shutil import copy2
from write_submit_script_comet import write_submit_comet
import re
'''
Submit particle picking job.
Inputs: 1. Path to the directory o... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
6738,
2198,
62,
361,
62,
28060,
1330,
2198,
62,
5219,
62,
785,
316,
198,
1... | 2.804878 | 410 |
#-*- coding: utf-8 -*-
"""
what : Single Encoder Model for audio
"""
import tensorflow as tf
from tensorflow.contrib import rnn
from tensorflow.contrib.rnn import DropoutWrapper
from tensorflow.core.framework import summary_pb2
from random import shuffle
from project_config import *
# cell instance
... | [
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
10919,
220,
220,
220,
1058,
14206,
14711,
12342,
9104,
329,
6597,
198,
37811,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
... | 2.215686 | 204 |
import datetime
import logging
import multiprocessing
import random
import time
import uuid
from concurrent.futures import Future, ProcessPoolExecutor
from logging import Logger
from multiprocessing import Manager
from multiprocessing.managers import SyncManager
from pathlib import Path
from queue import Queue, Empty
f... | [
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
18540,
305,
919,
278,
198,
11748,
4738,
198,
11748,
640,
198,
11748,
334,
27112,
198,
6738,
24580,
13,
69,
315,
942,
1330,
10898,
11,
10854,
27201,
23002,
38409,
198,
6738,
18931,
1330,
... | 4.142857 | 84 |
from builtins import *
import numpy as np
def split_str_into_fixed_width_lines(mstr, linewidth=80, tostr=False):
''' Split provided string across lines nicely.
Examples
--------
>>> s = ' abc def ghi jkl mno pqr'
>>> split_across_lines(s, linewidth=5)
>>> split_across_lines(s, linewidth=7)... | [
6738,
3170,
1040,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
198,
4299,
6626,
62,
2536,
62,
20424,
62,
34021,
62,
10394,
62,
6615,
7,
76,
2536,
11,
9493,
413,
5649,
28,
1795,
11,
284,
2536,
28,
25101,
2599,
198,
... | 1.990489 | 736 |
import pytest
from unittest import mock
from datetime import datetime, timedelta
from freezegun import freeze_time
from target_snowflake.target_snowflake import Expires
now = datetime.utcnow()
| [
11748,
12972,
9288,
198,
6738,
555,
715,
395,
1330,
15290,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
6738,
1479,
89,
1533,
403,
1330,
16611,
62,
2435,
198,
6738,
2496,
62,
82,
2197,
47597,
13,
16793,
62,
82,... | 3.338983 | 59 |
"""Tasks for fetching untappd metadata"""
import os
import logging
import datetime
from json import JSONDecodeError
import requests
from requests.exceptions import RequestException
from django.db.models import F
from django.utils.timezone import now
from celery import shared_task
from celery.exceptions import MaxRetri... | [
37811,
51,
6791,
329,
21207,
278,
1418,
1324,
67,
20150,
37811,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
4818,
8079,
198,
6738,
33918,
1330,
19449,
10707,
1098,
12331,
198,
198,
11748,
7007,
198,
6738,
7007,
13,
1069,
11755,
1330... | 3.341991 | 231 |
__author__ = 'Hyeonsoo Youn'
from bs4 import BeautifulSoup
from selenium import webdriver
from kafka import KafkaProducer
import psycopg2
import time
import json
import datetime
conn_string = "host='localhost' dbname ='collectData' user='postgres' password='secy'"
if __name__ == "__main__":
main()
| [
834,
9800,
834,
796,
705,
39,
5948,
26666,
78,
921,
77,
6,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
479,
1878,
4914,
1330,
46906,
11547,
2189,
198,
198,
11748,
1... | 2.971429 | 105 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Generated by Django 4.0 on 2022-02-04 06:20
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
319,
33160,
12,
2999,
12,
3023,
9130,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.892857 | 28 |
# replace or remove text and formatting that is not wanted in website
import os, sys
dr = '/Users/nknapp/Desktop/LaGriT/docs/pages/'
no =
yes =
replace_in_dr(no, yes, dr)
| [
2,
6330,
393,
4781,
2420,
290,
33313,
220,
326,
318,
407,
2227,
287,
3052,
198,
198,
11748,
28686,
11,
25064,
198,
198,
7109,
796,
31051,
14490,
14,
77,
15418,
1324,
14,
36881,
14,
14772,
38,
380,
51,
14,
31628,
14,
31126,
14,
6,
... | 2.623188 | 69 |
from django.views.generic.base import TemplateView
from .models import BlogPost
| [
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
8692,
1330,
37350,
7680,
198,
6738,
764,
27530,
1330,
14001,
6307,
628
] | 4.05 | 20 |
#!/usr/bin/env python
import rospy
import numpy as np
from sensor_msgs.msg import CompressedImage,Image # @UnresolvedImport
from duckietown_msgs.msg import AntiInstagramHealth, BoolStamped, AntiInstagramTransform # @UnresolvedImport
from anti_instagram.AntiInstagram import *
from duckietown_utils.jpg import image_cv_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
686,
2777,
88,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12694,
62,
907,
14542,
13,
19662,
1330,
3082,
2790,
5159,
11,
5159,
220,
1303,
2488,
3118,
411,
5634,
20939,
198,
6... | 2.916667 | 264 |
#!/usr/bin/env python
'''parser for block-structured data using the pyparsing module'''
from pyparsing import (alphas, alphanums, restOfLine,
Literal, Keyword, Word, CharsNotIn, Group, Combine,
Optional, ZeroOrMore, OneOrMore,
LineStart, LineEnd, Not... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
48610,
329,
2512,
12,
7249,
1522,
1366,
1262,
262,
279,
4464,
945,
278,
8265,
7061,
6,
198,
198,
6738,
279,
4464,
945,
278,
1330,
357,
282,
5902,
11,
435,
19080,
5700,
11,
... | 2.525285 | 613 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
EXPOsan: Exposition of sanitation and resource recovery systems
This module is developed by:
Yalin Li <zoe.yalin.li@gmail.com>
This module is under the University of Illinois/NCSA Open Source License.
Please refer to https://github.com/QSD-Group/EXPOsan/blob/mai... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
6369,
16402,
12807,
25,
1475,
9150,
286,
39958,
290,
8271,
7628,
3341,
198,
198,
1212,
8265,
3... | 2.104532 | 10,437 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2009 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
220,
27156,
27156,
27156,
27156,
15116,
8728,
4907,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.528037 | 214 |
import json
import numpy as np
import os
from argparse import Namespace
from pathlib import Path
from tqdm import tqdm
from tpp.processes.multi_class_dataset import generate_points
from tpp.utils.cli import parse_args
from tpp.utils.run import make_deterministic
from tpp.utils.record import hawkes_seq_to_record
if... | [
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
198,
6738,
1822,
29572,
1330,
28531,
10223,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
6738,
256,
381,
13,
146... | 2.793478 | 184 |
"""Runs the program.
How the game works:
Each turn, a player repeatedly rolls a die until
the player decides to hold or until he rolls a 1.
If the player decides to hold he/she will add the total sum of all the
dice numbers he/she has rolled during that turn to his/her total points.
If the dice shows a 1 the player w... | [
37811,
10987,
82,
262,
1430,
13,
198,
198,
2437,
262,
983,
2499,
25,
198,
198,
10871,
1210,
11,
257,
2137,
7830,
14088,
257,
4656,
1566,
198,
1169,
2137,
13267,
284,
1745,
393,
1566,
339,
14088,
257,
352,
13,
198,
1532,
262,
2137,
1... | 3.376682 | 223 |
# Import complete functionality from package
from .logger import *
from .visualization import * | [
2,
17267,
1844,
11244,
422,
5301,
198,
198,
6738,
764,
6404,
1362,
1330,
1635,
198,
6738,
764,
41464,
1634,
1330,
1635
] | 4.571429 | 21 |
import time
import pytest
from milvus import BaseError
| [
11748,
640,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
1465,
85,
385,
1330,
7308,
12331,
628,
628,
198
] | 3.210526 | 19 |
import cv2 as cv
img = cv.imread('Resources/Photos/group 1.jpg')
# cv.imshow('Image to detect faces', img)
#Face detection dose not include face toner color, taking in only the gray scale image will do the work
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
# cv.imshow('Image to detect faces gray', gray)
haar_cascade = ... | [
11748,
269,
85,
17,
355,
269,
85,
198,
198,
9600,
796,
269,
85,
13,
320,
961,
10786,
33236,
14,
21197,
14,
8094,
352,
13,
9479,
11537,
198,
2,
269,
85,
13,
320,
12860,
10786,
5159,
284,
4886,
6698,
3256,
33705,
8,
198,
198,
2,
3... | 2.529183 | 257 |
from sqlalchemy import Column, DateTime, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
| [
6738,
44161,
282,
26599,
1330,
29201,
11,
7536,
7575,
11,
34142,
11,
10903,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
628,
198,
14881,
796,
2377,
283,
876,
62,
8692,
3419,
628
] | 3.463415 | 41 |
"""
This is the settings subpackage.
It imports default settings from _default.py as well as _local.py, if it exists, which contains site-specific settings.
The defaults are imported first, so the local settings will override the defaults. The local settings module is listed
in .gitignore and is thus not under versio... | [
37811,
198,
1212,
318,
262,
6460,
850,
26495,
13,
198,
198,
1026,
17944,
4277,
6460,
422,
4808,
12286,
13,
9078,
355,
880,
355,
4808,
12001,
13,
9078,
11,
611,
340,
7160,
11,
543,
4909,
2524,
12,
11423,
6460,
13,
198,
198,
464,
2623... | 3.496795 | 624 |
'''1. Peça para o usuário digitar uma velocidade inicial (em m/s), uma
posição inicial (em m) e um instante de tempo (em s) e imprima a
posição de um projétil nesse instante de tempo.'''
print('DESAFIO 01 - FISICA')
print('-'*30)
#Informando valores
vel_ini = int(input('Qual a velocidade em m/s? '))
pos_ini = int(in... | [
7061,
6,
16,
13,
2631,
50041,
31215,
267,
514,
84,
6557,
27250,
3100,
7940,
334,
2611,
11555,
420,
312,
671,
287,
6652,
357,
368,
285,
14,
82,
828,
334,
2611,
198,
1930,
72,
16175,
28749,
287,
6652,
357,
368,
285,
8,
304,
23781,
9... | 2.250847 | 295 |
#!/usr/bin/python3
import sys
syskey_data_file = sys.argv[1]
tmp_syskey = ""
syskey = ""
with open(syskey_data_file, 'rb') as syskeyfile:
file_contents = syskeyfile.read()
i = 4220
while i < 28811:
j = i + 15
while i < j:
tmp_syskey += file_contents[i:i+1].decode()
i += 2
i += 8176
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
25064,
198,
198,
17597,
2539,
62,
7890,
62,
7753,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
198,
22065,
62,
17597,
2539,
796,
13538,
198,
17597,
2539,
796,
13538,
198,
4480,... | 2.093385 | 257 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..initializer import create_initializer
from ..functions.shake_shake_function import get_alpha_beta, shake_function
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
11485,
36733,
7509,
1330,
2251,
62,
36733,
7509,
198,
6738,
11485,
12543,
2733,
13,
32431,
62,
32431,
62,
8818,... | 3.574074 | 54 |
class Redraw:
""" Invalidate bitmasks. """
Nothing = 0
Cursor = 1
Borders = 2
Panes = 4
StatusBar = 16
ClearFirst = 32
All = Cursor | Borders | Panes | StatusBar | ClearFirst
| [
198,
198,
4871,
2297,
1831,
25,
198,
220,
220,
220,
37227,
17665,
378,
1643,
5356,
591,
13,
37227,
198,
220,
220,
220,
10528,
796,
657,
198,
220,
220,
220,
327,
21471,
796,
352,
198,
220,
220,
220,
40934,
796,
362,
198,
220,
220,
... | 2.5 | 84 |
# Generated from /home/mtdsousa/workspace/antlr4-verilog-python/extra/grammars-v4-2/verilog/systemverilog/SystemVerilogPreParser.g4 by ANTLR 4.9
from antlr4 import *
if __name__ is not None and "." in __name__:
from .SystemVerilogPreParser import SystemVerilogPreParser
else:
from SystemVerilogPreParser import S... | [
2,
2980,
515,
422,
1220,
11195,
14,
76,
8671,
82,
516,
64,
14,
5225,
10223,
14,
415,
14050,
19,
12,
332,
346,
519,
12,
29412,
14,
26086,
14,
4546,
76,
945,
12,
85,
19,
12,
17,
14,
332,
346,
519,
14,
10057,
332,
346,
519,
14,
... | 3.20337 | 1,721 |
class BrepTrimType(Enum,IComparable,IFormattable,IConvertible):
"""
Each brep trim has a defined type.
enum BrepTrimType,values: Boundary (1),CurveOnSurface (5),Mated (2),PointOnSurface (6),Seam (3),Singular (4),Slit (7),Unknown (0)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <=... | [
4871,
3719,
79,
2898,
320,
6030,
7,
4834,
388,
11,
2149,
296,
37064,
11,
5064,
579,
1078,
540,
11,
2149,
261,
1851,
856,
2599,
201,
198,
37227,
201,
198,
5501,
1449,
79,
15797,
468,
257,
5447,
2099,
13,
201,
198,
201,
198,
220,
20... | 2.43662 | 355 |
from django.contrib.auth.models import User
from rest_framework import serializers
from login.models import UserProfile
from login.serializers import UserProfileSerializer
from discussion.serializers import TagSerializer
from result.models import Result
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
17594,
13,
27530,
1330,
11787,
37046,
198,
6738,
17594,
13,
46911,
11341,
1330,
11787,
37046,
32634... | 3.329412 | 85 |
#
# 2d clipped Gaussian distribution
#
# L(x, y) = 1/(2pi) exp( - (x^2+y^2)/2) ) for x^2+y^2 >= 4
# L(x, y) = 1/(2pi) exp( - 2 ) for x^2+y^2 < 4
#
# for uniform prior of x, y in (-5, 5)
# the evidence is Z = 3*exp(-2)/100
# log(Z) = -2 + log(3/100) = -5.5
#
from mpi4py import MPI
impor... | [
2,
198,
2,
362,
67,
49305,
12822,
31562,
6082,
198,
2,
220,
198,
2,
406,
7,
87,
11,
331,
8,
796,
352,
29006,
17,
14415,
8,
1033,
7,
532,
357,
87,
61,
17,
10,
88,
61,
17,
20679,
17,
8,
1267,
220,
329,
2124,
61,
17,
10,
88,
... | 2.191105 | 1,439 |
# Generated by Django 2.2.14 on 2020-08-07 18:19
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1415,
319,
12131,
12,
2919,
12,
2998,
1248,
25,
1129,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
import re
import datetime
import inspect as ins
from sys import stdout,stdin
from time import sleep
from rig.ipython import embed
try:
from sqlalchemy.orm import object_session #FIXME vs database.imports?
from database.decorators import Get_newest_id, datafile_maker, new_abf_DataFile, hardware_interface, is_m... | [
11748,
302,
198,
11748,
4818,
8079,
198,
11748,
10104,
355,
1035,
198,
6738,
25064,
1330,
14367,
448,
11,
19282,
259,
198,
6738,
640,
1330,
3993,
198,
6738,
7805,
13,
541,
7535,
1330,
11525,
198,
198,
28311,
25,
220,
198,
220,
220,
22... | 2.513884 | 2,629 |
from cmlkit.representation import Representation
from dscribe.descriptors import SOAP as dsSOAP
from .conversion import to_local
class SOAP(Representation):
"""SOAP Representation (implemented in DScribe).
For details, see https://singroup.github.io/dscribe/tutorials/soap.html
or the dscribe source.
... | [
6738,
269,
4029,
15813,
13,
15603,
341,
1330,
10858,
341,
198,
6738,
288,
12522,
13,
20147,
1968,
669,
1330,
12809,
2969,
355,
288,
82,
15821,
2969,
198,
198,
6738,
764,
1102,
9641,
1330,
284,
62,
12001,
628,
198,
4871,
12809,
2969,
7... | 2.717718 | 333 |
"""HyperText Formatter"""
def format(string: str, **kwargs) -> str:
"""A string formatter
example:
> n = '$[val]'
> val = "Hello, World!"
> print(format(n, val=val))
Hello, World!
"""
for key,val in kwargs.copy().items():
string.replace(f"$[{ke... | [
37811,
38197,
8206,
5178,
1436,
37811,
198,
198,
4299,
5794,
7,
8841,
25,
965,
11,
12429,
46265,
22046,
8,
4613,
965,
25,
198,
220,
220,
220,
37227,
32,
4731,
1296,
1436,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1672,
25,
198,
... | 2.040936 | 171 |
from dragonfly import (Grammar, CompoundRule, MappingRule, IntegerRef, Function)
sleep = 15
# The main DynamicConfiguration grammar rules are activated here
dynamic_configuration_bootstrap = Grammar("dynamic_configuration bootstrap")
dynamic_configuration_bootstrap.add_rule(DynamicConfigurationEnabler())
dyna... | [
6738,
10441,
12254,
1330,
357,
38,
859,
3876,
11,
3082,
633,
31929,
11,
337,
5912,
31929,
11,
34142,
8134,
11,
15553,
8,
628,
628,
198,
42832,
796,
1315,
628,
628,
628,
198,
2,
383,
1388,
26977,
38149,
23491,
3173,
389,
13906,
994,
... | 3.605556 | 180 |
try:
say_nick("천사")
say_nick("바보")
except MyError as e:
print(e)
| [
198,
198,
28311,
25,
198,
197,
16706,
62,
17172,
7203,
168,
110,
250,
168,
8955,
4943,
198,
197,
16706,
62,
17172,
7203,
167,
108,
242,
167,
111,
112,
4943,
198,
16341,
2011,
12331,
355,
304,
25,
198,
197,
4798,
7,
68,
8,
198
] | 1.627907 | 43 |
import re
from Error import Error4,Error6,Error9
from DataBase import BaseDatos,BdRow
from .precompilada import precompilada
from typing import Pattern
| [
11748,
302,
198,
6738,
13047,
1330,
13047,
19,
11,
12331,
21,
11,
12331,
24,
198,
6738,
6060,
14881,
1330,
7308,
27354,
418,
11,
33,
67,
25166,
198,
6738,
764,
3866,
5589,
346,
4763,
1330,
662,
5589,
346,
4763,
198,
6738,
19720,
1330,... | 3.422222 | 45 |
import boto3
import sys
import os
mylist = []
region='us-east-2'
#Checking with the default list to test list operation
#mylist = ['t2.small', 't2.small','t2.medium','t2.medium','t2.large']
#check if more than 2 arguments passed
if len(sys.argv) > 2:
print ("usage only with one argument: python list_instances.py '... | [
11748,
275,
2069,
18,
198,
11748,
25064,
198,
11748,
28686,
198,
1820,
4868,
796,
17635,
198,
36996,
11639,
385,
12,
23316,
12,
17,
6,
198,
2,
9787,
278,
351,
262,
4277,
1351,
284,
1332,
1351,
4905,
198,
2,
1820,
4868,
796,
37250,
8... | 2.580822 | 365 |
from util import *
mmioClasses = []
@register(0x70000000, 0x1000)
@register(0x7000f800, 0x400)
@register(0x700e3000, 0x100)
@register(0x70019000, 0x1000)
@register(0x50000000, 0x24000)
@register(0x54200000, 0x400000)
@register(0x57000000, 0x1000000)
@register(0x58000000, 0x100000)
| [
6738,
7736,
1330,
1635,
201,
198,
201,
198,
3020,
952,
9487,
274,
796,
17635,
201,
198,
201,
198,
31,
30238,
7,
15,
87,
22,
24598,
11,
657,
87,
12825,
8,
201,
198,
201,
198,
31,
30238,
7,
15,
87,
22,
830,
69,
7410,
11,
657,
87... | 2.039474 | 152 |
import os.path
from pathlib import Path
from urllib.parse import urlparse
from urllib.request import urlopen
_BLOCK_SIZE = 16384
def download(url):
"""Download file from a URL
Parameters
----------
url : str
URL from which to download
Returns
-------
basename : str
Name ... | [
11748,
28686,
13,
6978,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
198,
62,
9148,
11290,
62,
33489,
796,
1467,
22842,
628,
... | 2.298311 | 533 |
from setuptools import setup
setup(name='regression',
version='0.0.1',
description='Regression',
author='Hany Abdulsamad',
author_email='hany@robot-learning.de',
install_requires=['numpy', 'scipy', 'matplotlib',
'torch', 'sklearn', 'autograd',
... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
2301,
2234,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
15,
13,
16,
3256,
198,
220,
220,
220,
220,
220,
6764,
11639,
8081,
2234,
3256,
198,
220,
220,... | 2.010101 | 198 |
from django.contrib import admin
from Account import models
admin.site.register(models.UserProfile)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
10781,
1330,
4981,
198,
198,
28482,
13,
15654,
13,
30238,
7,
27530,
13,
12982,
37046,
8,
198
] | 3.740741 | 27 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2021:
# This file is part of LeveilFlorian Enterprise, all rights reserved.
import csv
from flask import Flask
from flask_mongoengine import MongoEngine
app = Flask(__name__)
app.config['MONGODB_SETTINGS'] = {
'db' : 'scheduler',
'host': '127.0.0.1',
'port':... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
2211,
12,
1238,
2481,
25,
198,
2,
770,
2393,
318,
636,
286,
1004,
303,
346,
26953,
666,
14973,
11,
477,
2489,
10395,
13,
198,
11748,
... | 2.155882 | 1,020 |
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0.0,100,50)
y = np.random.uniform(low=0,high=10,size=50)
24
plt.scatter(x,y)
plt.show()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
87,
796,
45941,
13,
21602,
10223,
7,
15,
13,
15,
11,
3064,
11,
1120,
... | 2.034091 | 88 |
for x in range(12):
for y in range(12):
print(x+1 , "x" , y+1 , "=", (x+1)*(y+1))
break
for val in "hello":
if val == "l":
continue
print(val)
print("The End") | [
1640,
2124,
287,
2837,
7,
1065,
2599,
628,
220,
220,
220,
329,
331,
287,
2837,
7,
1065,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
87,
10,
16,
837,
366,
87,
1,
837,
331,
10,
16,
837,
366,
28,
1600,
357,
87,
10,
1... | 1.95 | 100 |
"""
小兔的棋盘
https://blog.csdn.net/wyxeainn/article/details/61926253
难点:
- 数组模拟棋盘
- 到当前点f(x,y)的路径数 = f(x-1,y) + f(x, y-1)
"""
if __name__ == '__main__':
print(solution(5)) | [
37811,
198,
22887,
237,
17739,
242,
21410,
162,
96,
233,
33566,
246,
198,
5450,
1378,
14036,
13,
6359,
32656,
13,
3262,
14,
21768,
27705,
391,
77,
14,
20205,
14,
36604,
14,
21,
1129,
2075,
28592,
198,
49694,
122,
163,
224,
117,
171,
... | 1.310606 | 132 |
import pytest
import transcriptor.tools as tools
from datetime import timedelta
@pytest.mark.parametrize('second_val, result', [
(61.1, "01.100"), # tests leading zeroes
(130.1000001, "10.100"), # tests that milliseconds returned, not micro
(36001.123567, "01.123"), # It does not round
... | [
11748,
12972,
9288,
198,
11748,
14687,
273,
13,
31391,
355,
4899,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
10786,
12227,
62,
2100,
11,
1255,
3256,
685,
198,
220,
220,
22... | 2.719844 | 257 |
from tests.responses.scan import scan_requests_response
from vuakhter.kibana.requests_log import ElasticRequestsLog
| [
6738,
5254,
13,
16733,
274,
13,
35836,
1330,
9367,
62,
8897,
3558,
62,
26209,
198,
6738,
410,
84,
11322,
353,
13,
74,
571,
2271,
13,
8897,
3558,
62,
6404,
1330,
48567,
16844,
3558,
11187,
628
] | 3.342857 | 35 |
from rest_framework import pagination
from rest_framework.response import Response
#class PostPagination(pagination.PageNumberPagination):
# page_size = 1
# page_size_query_param = 'page_size'
# max_page_size = 200
# last_page_strings = ('the_end',)
"""
class TimelinePagination(object):
@property
... | [
198,
6738,
1334,
62,
30604,
1330,
42208,
1883,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
198,
2,
4871,
2947,
47,
363,
1883,
7,
79,
363,
1883,
13,
9876,
15057,
47,
363,
1883,
2599,
198,
2,
220,
220,
220,
2443,
62,
78... | 2.276699 | 412 |
from wiutils._dwc import constants, mapping, optional, order, utils
| [
6738,
45967,
26791,
13557,
67,
86,
66,
1330,
38491,
11,
16855,
11,
11902,
11,
1502,
11,
3384,
4487,
198
] | 3.578947 | 19 |
"""
Django settings for homealbum project.
See README.md at root of project for instructions on how this settings file
should be augmented.
"""
import os
HOMEALBUM_VERSION = '0.9.0'
HOMEALBUM_BUILDNO = int(open('HOMEALBUM_BUILDNO', 'r').read()) if os.path.isfile('HOMEALBUM_BUILDNO') else 0
# Build paths inside the... | [
37811,
198,
35,
73,
14208,
6460,
329,
1363,
40916,
1628,
13,
198,
198,
6214,
20832,
11682,
13,
9132,
379,
6808,
286,
1628,
329,
7729,
319,
703,
428,
6460,
2393,
198,
21754,
307,
30259,
13,
198,
37811,
198,
198,
11748,
28686,
198,
198,... | 2.386821 | 1,639 |
import torch
from torch_scatter import scatter_add
def to_dense_batch(x, batch=None, fill_value=0, max_num_nodes=None):
r"""Given a sparse batch of node features
:math:`\mathbf{X} \in \mathbb{R}^{(N_1 + \ldots + N_B) \times F}` (with
:math:`N_i` indicating the number of nodes in graph :math:`i`), creates ... | [
11748,
28034,
198,
6738,
28034,
62,
1416,
1436,
1330,
41058,
62,
2860,
628,
198,
4299,
284,
62,
67,
1072,
62,
43501,
7,
87,
11,
15458,
28,
14202,
11,
6070,
62,
8367,
28,
15,
11,
3509,
62,
22510,
62,
77,
4147,
28,
14202,
2599,
198,... | 2.182576 | 1,079 |
# Generated by Django 3.1.1 on 2021-12-21 19:37
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
16,
319,
33448,
12,
1065,
12,
2481,
678,
25,
2718,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
""" Base service classes and methods for services. """
from numbers import Number
import time
from types import FunctionType
from typing import Any, Iterable, Tuple
from stopit import ThreadingTimeout as Timeout
class Executor:
"""Runs the function with time limit.
Args:
f: Function to call.
... | [
37811,
7308,
2139,
6097,
290,
5050,
329,
2594,
13,
37227,
198,
6738,
3146,
1330,
7913,
198,
11748,
640,
198,
6738,
3858,
1330,
15553,
6030,
198,
6738,
19720,
1330,
4377,
11,
40806,
540,
11,
309,
29291,
198,
6738,
2245,
270,
1330,
14122,... | 2.700713 | 842 |
from dataclasses import (dataclass, fields)
from math import sqrt
def from_dict(cls: dataclass, dictionary: dict):
"""Make dataclass object from a dictionary.
:param cls: The dataclass to make a object of.
:param dictionary: The dictionary.
:return: The dataclass object.
"""
init_kwargs = {}
... | [
6738,
4818,
330,
28958,
1330,
357,
19608,
330,
31172,
11,
7032,
8,
198,
6738,
10688,
1330,
19862,
17034,
628,
198,
4299,
422,
62,
11600,
7,
565,
82,
25,
4818,
330,
31172,
11,
22155,
25,
8633,
2599,
198,
220,
220,
220,
37227,
12050,
... | 2.248391 | 777 |
from oemof.tools import logger
from oemof.tools import economics
from oemof.tools import helpers
| [
6738,
267,
368,
1659,
13,
31391,
1330,
49706,
198,
6738,
267,
368,
1659,
13,
31391,
1330,
12446,
198,
6738,
267,
368,
1659,
13,
31391,
1330,
49385,
198
] | 3.592593 | 27 |
# coding: utf-8
"""
Sematext Cloud API
API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`. # noqa: E501
OpenAPI spec version: v3
... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
12449,
378,
742,
10130,
7824,
628,
220,
220,
220,
7824,
19142,
3769,
1895,
290,
10314,
329,
12449,
378,
742,
30617,
7824,
13,
383,
30617,
7824,
4433,
262,
7824,
73... | 2.5125 | 480 |
import argparse
import os
if __name__ == '__main__':
main()
| [
11748,
1822,
29572,
198,
11748,
28686,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.555556 | 27 |
A = [8, 1, 3, 7, 5, 2, 12]
print(min1(A))
| [
198,
32,
796,
685,
23,
11,
352,
11,
513,
11,
767,
11,
642,
11,
362,
11,
1105,
60,
198,
4798,
7,
1084,
16,
7,
32,
4008,
198
] | 1.592593 | 27 |
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
import json
import logging
from typing import List
from ecs_logging import StdlibFormatter
from vdk.api.plugin.hook_markers import hookimpl
from vdk.api.plugin.plugin_registry import IPluginRegistry
from vdk.internal.builtin_plugins.run.job_context im... | [
2,
15069,
33448,
37754,
11,
3457,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
304,
6359,
62,
6404,
2667,
1330,
520... | 3.170213 | 141 |
"""Regular expressions to be used as filters for message handlers."""
import re
START_ONLY_RE = re.compile(r"^([01]?\d|2[0-3])$")
START_AND_END_RE = re.compile(r"^([01]?\d|2[0-3])-([01]?\d|2[0-3])$")
DAY_AND_START_RE = re.compile(
r"^(mon|tue(s)?|wed(nes)?|thu(r(s)?)?|fri|sat(ur)?)(day)?\s+([01]?\d|2[0-3])$",
... | [
37811,
40164,
14700,
284,
307,
973,
355,
16628,
329,
3275,
32847,
526,
15931,
198,
198,
11748,
302,
198,
198,
2257,
7227,
62,
1340,
11319,
62,
2200,
796,
302,
13,
5589,
576,
7,
81,
1,
61,
26933,
486,
60,
30,
59,
67,
91,
17,
58,
... | 1.751445 | 346 |
r"""
A module for parsing a subset of the TeX math syntax and rendering it to a
Matplotlib backend.
For a tutorial of its usage, see :doc:`/tutorials/text/mathtext`. This
document is primarily concerned with implementation details.
The module uses pyparsing_ to parse the TeX expression.
.. _pyparsing: https://pypi.... | [
81,
37811,
198,
32,
8265,
329,
32096,
257,
24637,
286,
262,
1665,
55,
10688,
15582,
290,
14837,
340,
284,
257,
198,
19044,
29487,
8019,
30203,
13,
198,
198,
1890,
257,
11808,
286,
663,
8748,
11,
766,
1058,
15390,
25,
63,
14,
83,
449... | 2.718363 | 2,102 |
### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
from .GXIPJ import GXIPJ
from .GXLTB import GXLTB
from .GXVV import GXVV
### endblock ClassImports
### block Header
# N... | [
21017,
14582,
705,
4871,
62,
28920,
13,
9078,
6,
198,
21017,
2512,
5016,
3546,
3742,
198,
2,
28536,
25,
2141,
407,
4370,
1997,
994,
11,
340,
318,
7560,
2438,
198,
6738,
764,
1330,
308,
87,
15042,
62,
948,
198,
6738,
4903,
418,
11205... | 2.211698 | 21,337 |
from setuptools import setup
setup(name='ite',
version='0.1.0',
packages=['ite'],
entry_points={
'console_scripts': [
'ite = ite.__main__:main',
'server = ite.server:main'
]
},
)
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
578,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
15,
3256,
198,
220,
220,
220,
220,
220,
10392,
28,
17816,
578,
6,
4357,
198,
220,
220,
220... | 1.816901 | 142 |
# coding=utf-8
# Copyright (c) 2017,2018, F5 Networks, 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 applicabl... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
357,
66,
8,
2177,
11,
7908,
11,
376,
20,
27862,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
4... | 2.526056 | 2,629 |
#! encoding=utf8
from sklearn.ensemble import RandomForestClassifier
from model.base_model import Model
| [
2,
0,
21004,
28,
40477,
23,
198,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
198,
6738,
2746,
13,
8692,
62,
19849,
1330,
9104,
628,
198
] | 3.566667 | 30 |
from .dataframe_visualizer import NicaAccessor
from .python_utils import timer
from .pandas_reduce_memory import reduce_mem_usage
| [
6738,
764,
7890,
14535,
62,
41464,
7509,
1330,
399,
3970,
15457,
273,
198,
6738,
764,
29412,
62,
26791,
1330,
19781,
198,
6738,
764,
79,
392,
292,
62,
445,
7234,
62,
31673,
1330,
4646,
62,
11883,
62,
26060,
198
] | 3.421053 | 38 |
#!/usr/bin/env python
# -*- encoding: latin-1 -*-
"""This module contains some abilities to work with the random
written by Marek Kubica"""
import random
class Probability(object):
"""With this class you can create values with a probability
For now values lover than 1% are not supported"""
remaining = 100
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3042,
259,
12,
16,
532,
9,
12,
198,
37811,
1212,
8265,
4909,
617,
7883,
284,
670,
351,
262,
4738,
198,
15266,
416,
36989,
74,
24921,
3970,
37811,
198,
117... | 3.224299 | 107 |
#coding=utf-8
from django.http import HttpResponse
import docker
from socket import *
# def pull(request): #镜像下载
# getdisk=request.GET.get
# name = request.GET.get('name')
# client = docker.from_env()
# name = request.GET.get('name')
# if repository:
# client.images.pull('127.0.0.1:5000/nginx')
# el... | [
2,
66,
7656,
28,
40477,
12,
23,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
11748,
36253,
198,
6738,
17802,
1330,
1635,
628,
198,
2,
825,
2834,
7,
25927,
2599,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
165,
... | 2.416667 | 156 |
import pytest
import numpy as np
from htvlearn.grid import Grid
@pytest.fixture(scope='module', params=[True, False])
| [
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
289,
14981,
35720,
13,
25928,
1330,
24846,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
11639,
21412,
3256,
42287,
41888,
17821,
11,
10352,
12962,
628
] | 3.184211 | 38 |
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.required_version('>=2.16')
@rfm.parameterized_test(['small'], ['large'])
| [
11748,
1006,
28073,
355,
374,
38353,
198,
11748,
1006,
28073,
13,
315,
879,
13,
12807,
414,
355,
3013,
628,
198,
31,
81,
38353,
13,
35827,
62,
9641,
10786,
29,
28,
17,
13,
1433,
11537,
198,
31,
81,
38353,
13,
17143,
2357,
1143,
62,
... | 2.555556 | 54 |
#!/usr/bin/python
import argparse
import fileinput
import geomag
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
import os
import re
from scipy import interpolate
import sys
import navpy
from aurauas.flightdata import flight_loader, flight_interp, imucal
import transformat... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
1822,
29572,
198,
11748,
2393,
15414,
198,
11748,
4903,
296,
363,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
29487,
18,
67,
1330,
12176,
274,
18,
35,
198,
11748,
2603,
294... | 2.270163 | 3,794 |
from room import Room
| [
6738,
2119,
1330,
10096,
628
] | 4.6 | 5 |
import docker
import luigi
import pkg_resources
from jinja2 import Template
from exasol_integration_test_docker_environment.lib.base.docker_base_task import DockerBaseTask
from exasol_integration_test_docker_environment.lib.data.docker_volume_info import DockerVolumeInfo
from exasol_integration_test_docker_environment... | [
11748,
36253,
198,
11748,
300,
84,
25754,
198,
11748,
279,
10025,
62,
37540,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
198,
198,
6738,
409,
292,
349,
62,
18908,
1358,
62,
9288,
62,
45986,
62,
38986,
13,
8019,
13,
8692,
13,
45986,
... | 3.348837 | 172 |
import time
from typing import Dict, Any, List
from pathlib import Path
from datetime import date
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch.utils import data
from torch.optim.lr_scheduler import ReduceLROnPlateau
from baselines.models_factory import ModelsFactory
from baseli... | [
11748,
640,
198,
6738,
19720,
1330,
360,
713,
11,
4377,
11,
7343,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
4818,
8079,
1330,
3128,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
... | 3.458333 | 144 |
from flask import render_template
| [
6738,
42903,
1330,
8543,
62,
28243,
198
] | 4.857143 | 7 |
########################################################################
import numpy
import vtk
from pyquaternion import Quaternion
########################################################################
| [
29113,
29113,
7804,
198,
198,
11748,
299,
32152,
198,
11748,
410,
30488,
198,
6738,
12972,
421,
9205,
295,
1330,
2264,
9205,
295,
198,
198,
29113,
29113,
7804,
198,
220,
198
] | 7 | 30 |
# Author : Rajanikant Tenguria
#!/bin/python
import sys
q = int(raw_input().strip())
for a0 in xrange(q):
s = raw_input().strip()
result = palindromeIndex(s)
print(result)
| [
2,
6434,
1058,
13308,
272,
1134,
415,
309,
1516,
34484,
198,
198,
2,
48443,
8800,
14,
29412,
198,
198,
11748,
25064,
198,
198,
80,
796,
493,
7,
1831,
62,
15414,
22446,
36311,
28955,
198,
1640,
257,
15,
287,
2124,
9521,
7,
80,
2599,
... | 2.428571 | 77 |
import logging
from org.openbaton.v2.cmd import BaseObCmd
from org.openbaton.v2.utils import get_result_to_list, get_result_to_show, parse_path_or_json, result_to_str
class Events(BaseObCmd):
"""Command to manage event endpoints: it is possible to:
* show details of a specific event endpoint passing an ... | [
11748,
18931,
198,
198,
6738,
8745,
13,
9654,
8664,
261,
13,
85,
17,
13,
28758,
1330,
7308,
5944,
40109,
198,
6738,
8745,
13,
9654,
8664,
261,
13,
85,
17,
13,
26791,
1330,
651,
62,
20274,
62,
1462,
62,
4868,
11,
651,
62,
20274,
62... | 2.958333 | 216 |
from django.conf import settings
from rest_framework import serializers
from ...models import UploadedFile
from .uploaded_file_version import UploadedFileVersionSerializer
from .uploaded_file_reverse import UploadedFileRelatedGenericSerializer
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
2644,
27530,
1330,
36803,
276,
8979,
198,
6738,
764,
25850,
276,
62,
7753,
62,
9641,
1330,
36803,
276,
8979,
14815,
32634,
7... | 4.114754 | 61 |
import unittest
from recursivity.p7 import get_permutations
| [
11748,
555,
715,
395,
198,
6738,
664,
1834,
3458,
13,
79,
22,
1330,
651,
62,
16321,
32855,
628
] | 3.388889 | 18 |
# __init__.py
#from .wgm_db import config
from .wgm_db import connect
from .wgm_db import get_unique_id
| [
2,
11593,
15003,
834,
13,
9078,
198,
198,
2,
6738,
764,
86,
39870,
62,
9945,
1330,
4566,
198,
6738,
764,
86,
39870,
62,
9945,
1330,
2018,
198,
6738,
764,
86,
39870,
62,
9945,
1330,
651,
62,
34642,
62,
312,
198
] | 2.625 | 40 |
import os
import vim
from glob import glob
from itertools import chain
from subprocess import check_output
bib_extensions = ["bib",
"bibtex",
"ris",
"json",
"enl",
"wos",
"medline",
... | [
11748,
28686,
198,
11748,
43907,
198,
6738,
15095,
1330,
15095,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
6738,
850,
14681,
1330,
2198,
62,
22915,
198,
198,
65,
571,
62,
2302,
5736,
796,
14631,
65,
571,
1600,
198,
220,
220,
220,
22... | 1.576419 | 229 |
# This script reads all of the files in ./train
# and resizes all .png files to be 480 x 360
#
### Input: .png files in ./images
### Output: creates .png files 480 x 360 in ./resized_images
### Warning: don't have `images` be a part of the name of your path except the last directory, or rework the pathing!
impor... | [
2,
770,
4226,
9743,
477,
286,
262,
3696,
287,
24457,
27432,
198,
2,
290,
581,
4340,
477,
764,
11134,
3696,
284,
307,
23487,
2124,
11470,
198,
2,
198,
21017,
220,
23412,
25,
220,
764,
11134,
3696,
287,
24457,
17566,
198,
21017,
220,
... | 3.363636 | 121 |
try:
from .tools import load_pkl,integrate_init,add_smoke
except:
from tools import load_pkl,integrate_init,add_smoke
import os.path as osp
import logging
import sys
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
if len(sys.argv) != 2:
print('ERROR: {} pkl_path'... | [
28311,
25,
198,
220,
220,
220,
422,
764,
31391,
1330,
3440,
62,
79,
41582,
11,
18908,
4873,
62,
15003,
11,
2860,
62,
5796,
2088,
198,
16341,
25,
198,
220,
220,
220,
422,
4899,
1330,
3440,
62,
79,
41582,
11,
18908,
4873,
62,
15003,
... | 2.40184 | 326 |
'''
Old alignment methods from SyncTreeGrammar.
This approach allowed more fuzzy matching, suitable for learning substitution rules.
Created on 19 Sep 2013
@author: kristian
'''
from parse import PhraseDependencyTree
from nlputils import NltkUtils
from QGCore import nodeText, commonAncestor, nodeDistance, nodeTextN... | [
7061,
6,
198,
19620,
19114,
5050,
422,
35908,
27660,
38,
859,
3876,
13,
198,
1212,
3164,
3142,
517,
34669,
12336,
11,
11080,
329,
4673,
32097,
3173,
13,
198,
198,
41972,
319,
678,
8621,
2211,
198,
198,
31,
9800,
25,
479,
1585,
666,
... | 2.286395 | 9,026 |
from selenium import webdriver
from cv.data import DATA
from cv import __file__ as cv_file
from slugify import slugify
import os
from PIL import Image
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
269,
85,
13,
7890,
1330,
42865,
198,
6738,
269,
85,
1330,
11593,
7753,
834,
355,
269,
85,
62,
7753,
198,
6738,
31065,
1958,
1330,
31065,
1958,
198,
11748,
28686,
198,
6738,
350,
41... | 3.377778 | 45 |
import pathlib
from setuptools import setup, find_packages
HERE = pathlib.Path(__file__).parent
VERSION = '0.1.0'
PACKAGE_NAME = 'halfsat'
AUTHOR = 'Jonathan Preall and Brian He'
AUTHOR_EMAIL = 'jpreall@cshl.edu; bhe@cshl.edu'
URL = 'https://github.com/jpreall/halfsat'
LICENSE = 'BSD 3-Clause License'
DE... | [
11748,
3108,
8019,
201,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
201,
198,
201,
198,
39,
9338,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
201,
198,
201,
198,
43717,
796,
705,
15,
13,
16,
13,
15... | 2.169772 | 483 |
# Edgar Barrera / Github: https://github.com/EdgarCastillo101/EdgarCastillo101
# Copyright (c) 2021 Edgar Barrera
#This program counts the vowels present in the user input
def countVowels(sentence):
'''This function counts the vowels'''
count = 0
sentence = sentence.lower()
for c in sentence:
... | [
2,
29166,
2409,
24420,
1220,
38994,
25,
3740,
1378,
12567,
13,
785,
14,
7407,
4563,
19248,
16111,
8784,
14,
7407,
4563,
19248,
16111,
8784,
198,
2,
15069,
357,
66,
8,
33448,
29166,
2409,
24420,
198,
198,
2,
1212,
1430,
9853,
262,
2326... | 2.671429 | 210 |
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import sys
import benchmark_decorator as dectimer
#-----------------------------
# Function: evaluate_functions
#-----------------------------
@dectimer.bench_time(3)
def evaluate_functions(n):
"""
Evaluate the trigononmetric ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
11748,
18335,
62,
12501,
273,
1352,
355,
390,
310,
22723,
198,
198,
... | 2.518519 | 324 |
import os
import numpy as np
import json
if __name__=='__main__':
result_dir='/home/nana/Documents/pycharmforlinux/opennre-pytorch/mnre_data/thesis_data/test_result'
find_rel(result_dir,0.477,0.626) | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
198,
220,
220,
220,
1255,
62,
15908,
11639,
14,
11195,
14,
77,
2271,
14,
38354,
14,
9078,
354,
1670,
1640... | 2.395349 | 86 |
from flask import Flask, render_template, request, url_for, redirect, session
import pymongo
import bcrypt
#set app as a Flask instance
app = Flask(__name__)
app.secret_key = "testing"
#connoct to your Mongo DB database
client = pymongo.MongoClient('mongodb://127.0.0.1:27017/')
# #Create Database
# mydb = client['tota... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
19016,
62,
1640,
11,
18941,
11,
6246,
198,
11748,
279,
4948,
25162,
198,
11748,
275,
29609,
198,
2,
2617,
598,
355,
257,
46947,
4554,
220,
198,
1324,
796,
46947,
7,
834,
3... | 2.73445 | 418 |
import pytz
from django.conf import settings
from django.shortcuts import render, redirect
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.views.generic import (CreateView, DeleteView, DetailView, FormView,
TemplateView, UpdateView, ... | [
11748,
12972,
22877,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
19816,
1040,
1330,
23093,
37374,
35608,
259,
198... | 2.37037 | 324 |