content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import sys
a,b,c = list(map(int,sys.stdin.readline().rstrip("\n").split(" ")))
print(round(0.229*0.324*a*2+0.297*0.42*2*b+0.21*0.297*c,6))
| [
11748,
25064,
198,
198,
64,
11,
65,
11,
66,
796,
1351,
7,
8899,
7,
600,
11,
17597,
13,
19282,
259,
13,
961,
1370,
22446,
81,
36311,
7203,
59,
77,
11074,
35312,
7203,
366,
22305,
198,
198,
4798,
7,
744,
7,
15,
13,
23539,
9,
15,
... | 1.844156 | 77 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import time
import json
import datetime
import requests
from urllib import parse
from bs4 import BeautifulSoup
BASE_URL = 'http://www7a.biglobe.ne.jp/~soramimiupdate/'
if __name__ == '__main__':
sys.exit(main())
| [
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,
11748,
25064,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
4818,
8079,
198,
198,
11748,
7007,
198,
6738,
29... | 2.527273 | 110 |
from Z_WH.api.middlewares import schema, authentification, response
from Z_WH.services import userManager
@response.json
@authentification.checkUserKey
@schema.schemaValidator({
'type': 'object',
'properties': {
'email': {
'type': 'string'
},
'password': {
'typ... | [
6738,
1168,
62,
12418,
13,
15042,
13,
27171,
86,
3565,
1330,
32815,
11,
8323,
2649,
11,
2882,
198,
198,
6738,
1168,
62,
12418,
13,
30416,
1330,
2836,
13511,
628,
198,
31,
26209,
13,
17752,
198,
31,
41299,
2649,
13,
9122,
12982,
9218,
... | 2.25641 | 156 |
# github.com/spokenlore
# Advent of Code Day 1
# December 20, 2015
data_set = "()()(()()()(()()((()((()))((()((((()()((((()))()((((())(((((((()(((((((((()(((())(()()(()((()()(()(())(()((((()((()()()((((())((((((()(()(((()())(()((((()))())(())(()(()()))))))))((((((((((((()())()())())(())))(((()()()((((()(((()(()(()()((... | [
2,
33084,
13,
785,
14,
19842,
31131,
198,
2,
33732,
286,
6127,
3596,
352,
198,
2,
3426,
1160,
11,
1853,
198,
198,
7890,
62,
2617,
796,
366,
3419,
3419,
7,
3419,
3419,
3419,
7,
3419,
3419,
19510,
3419,
19510,
3419,
4008,
19510,
3419,... | 2.03552 | 3,491 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Files download/upload REST API similar to S3 for Invenio."""
import os
from setu... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
554,
574,
952,
13,
198,
2,
15069,
357,
34,
8,
1853,
12,
23344,
327,
28778,
13,
198,
2,
198,
2,
554,
574,
952,
318,
1479,
378... | 2.080764 | 2,724 |
# -*- coding: utf-8 -*-
from .base import * # noqa: F401
SENTRY_DSN = os.getenv('SENTRY_DSN')
if SENTRY_DSN:
import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.redis import RedisInteg... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
764,
8692,
1330,
1635,
220,
1303,
645,
20402,
25,
376,
21844,
628,
198,
50,
3525,
18276,
62,
5258,
45,
796,
28686,
13,
1136,
24330,
10786,
50,
3525,
18276,
62,
5... | 2.440154 | 259 |
from .generate_feature_list import ExtractFeatureListEnsemble
| [
6738,
764,
8612,
378,
62,
30053,
62,
4868,
1330,
29677,
38816,
8053,
4834,
15140,
198
] | 4.133333 | 15 |
#!/usr/bin/env python
import click
from _init import init
@click.group()
main.command()(init)
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
3904,
198,
198,
6738,
4808,
15003,
1330,
2315,
198,
198,
31,
12976,
13,
8094,
3419,
198,
198,
12417,
13,
21812,
3419,
7,
15003,
8,
198,
198,
361,
11593,
3672,
834,
6624,
... | 2.537037 | 54 |
#!/usr/bin/env python
"""
Demo: feeding the same steps through CLSim
"""
from __future__ import print_function
from icecube import icetray, ppc, clsim, phys_services, dataclasses, simclasses
from os.path import expandvars, join, isfile
from os import environ
import tempfile, shutil
import argparse
import numpy
""... | [
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
11522,
78,
25,
13017,
262,
976,
4831,
832,
39241,
320,
220,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
4771,
40296,
1330... | 2.821968 | 1,921 |
# Quick tests for the markup templatetags (django.contrib.markup)
import re
import unittest
from django.template import Template, Context, add_to_builtins
from django.utils.html import escape
add_to_builtins('django.contrib.markup.templatetags.markup')
if __name__ == '__main__':
unittest.main()
| [
2,
12029,
5254,
329,
262,
41485,
2169,
489,
265,
316,
3775,
357,
28241,
14208,
13,
3642,
822,
13,
4102,
929,
8,
198,
198,
11748,
302,
198,
11748,
555,
715,
395,
198,
198,
6738,
42625,
14208,
13,
28243,
1330,
37350,
11,
30532,
11,
75... | 2.824074 | 108 |
import pytest
import numpy as np
from pygeoid.integrals.truncation import molodensky_truncation_coefficients as Qn
from pygeoid.integrals.truncation import paul_coefficients
n = 60
def test_qn():
"""Test Molodensky truncation coefficients.
"""
psi = np.linspace(0, 180, 19, endpoint=True)
for ps... | [
198,
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
12972,
469,
1868,
13,
18908,
30691,
13,
2213,
19524,
341,
1330,
18605,
375,
641,
2584,
62,
2213,
19524,
341,
62,
1073,
41945,
355,
1195,
77,
198,
6738,
12972,
... | 2.081028 | 506 |
import tensorflow as tf
import collections
class _ImageColumn(tf.contrib.layers.feature_column._FeatureColumn,
collections.namedtuple("_ImageColumn",
['column_name',
'height',
... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
17268,
628,
198,
4871,
4808,
5159,
39470,
7,
27110,
13,
3642,
822,
13,
75,
6962,
13,
30053,
62,
28665,
13557,
38816,
39470,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.161507 | 743 |
'''
Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.
Example 1:
Input: s = "Let's take LeetCode contest"
Output: "s'teL ekat edoCteeL tsetnoc"
Example 2:
Input: s = "God Ding"
Output: "doG gniD"
'''
# O(N) time and O(1) space
... | [
7061,
6,
198,
15056,
257,
4731,
264,
11,
9575,
262,
1502,
286,
3435,
287,
1123,
1573,
1626,
257,
6827,
981,
991,
23934,
13216,
10223,
290,
4238,
1573,
1502,
13,
198,
198,
16281,
352,
25,
198,
20560,
25,
264,
796,
366,
5756,
338,
101... | 2.733333 | 120 |
from os import environ, path
import torch.nn as nn
import torch
import torchvision
import numpy as np
from torch.utils.tensorboard import SummaryWriter
# from data.mnist import train_loader,test_loader
# from data.cifar import train_loader, test_loader
from data.custom_cat_dog import train_loader
j = 0
while True:
... | [
6738,
28686,
1330,
551,
2268,
11,
3108,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
198,
11748,
28034,
10178,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
34379,
1... | 2.271451 | 641 |
import bcrypt
from models.DAO import DAO
from utils.exception import ValidationError
import utils.validation as validator
from decimal import Decimal
def add_user(username, email, password, first_name = '', last_name = '', gender = '', phone = ''):
"""The function creates a user based on the information provided
... | [
11748,
275,
29609,
198,
6738,
4981,
13,
5631,
46,
1330,
17051,
46,
198,
6738,
3384,
4487,
13,
1069,
4516,
1330,
3254,
24765,
12331,
198,
11748,
3384,
4487,
13,
12102,
341,
355,
4938,
1352,
198,
6738,
32465,
1330,
4280,
4402,
198,
198,
... | 2.455425 | 1,963 |
from django.core.wsgi import get_wsgi_application
import dotenv
import os
from pathlib import Path
d = Path(__file__).resolve().parents[1]
dot_env = os.path.join(str(d), '.env')
if os.path.exists(dot_env):
dotenv.read_dotenv(dot_env)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "waherb.settings")
from dj_stati... | [
6738,
42625,
14208,
13,
7295,
13,
18504,
12397,
1330,
651,
62,
18504,
12397,
62,
31438,
198,
11748,
16605,
24330,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
67,
796,
10644,
7,
834,
7753,
834,
737,
411,
6442,
22446,... | 2.668874 | 151 |
#!/usr/bin/python3
# http://www.java2s.com/Code/Python/GUI-Tk/2dtableofinputfields.htm
from __future__ import print_function
from cli_tables import print_table
from Tkinter import *
import sys
rows = []
root = Tk()
root.title("cli_tables")
l1 = Label(root, text="Rows")
l2 = Label(root, text="Columns")
e1 = Entry(roo... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
2638,
1378,
2503,
13,
12355,
17,
82,
13,
785,
14,
10669,
14,
37906,
14,
40156,
12,
51,
74,
14,
17,
67,
11487,
1659,
15414,
25747,
13,
19211,
198,
198,
6738,
11593,
37443,
834,
1330... | 2.356863 | 255 |
"""
File: my_drawing.py
Name: Hank周柏翰
----------------------
TODO:
"""
from campy.graphics.gobjects import GOval, GRect, GLabel, GArc, GPolygon,GLine
from campy.graphics.gwindow import GWindow
SIZE = 300 # Controls the size of the pokemon ball and the talking room
WIDTH = (SIZE*8)/3 # Controls the width of... | [
37811,
198,
8979,
25,
616,
62,
19334,
278,
13,
9078,
198,
5376,
25,
24386,
37772,
101,
162,
253,
237,
163,
123,
108,
198,
19351,
438,
198,
51,
3727,
46,
25,
198,
37811,
198,
198,
6738,
1413,
88,
13,
70,
11549,
13,
70,
48205,
1330,... | 2.374012 | 1,139 |
# standard library imports
import os
import sys
# package imports
import numpy as np
import pandas as pd
from scipy.stats import multivariate_normal, norm
import matplotlib.pyplot as plt
import GPy
import seaborn as sns
## --------------- plotting ---------------
## --------------- RFF ---------------
def mi... | [
2,
3210,
5888,
17944,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
2,
5301,
17944,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
629,
541,
88,
13,
34242,
1330,
1963,
42524,
62,
11265,
11,
2593... | 2.127486 | 1,961 |
import pytest
from hippy.lexer import Lexer, LexerError
| [
11748,
12972,
9288,
198,
198,
6738,
18568,
88,
13,
2588,
263,
1330,
17210,
263,
11,
17210,
263,
12331,
628,
628,
198
] | 2.904762 | 21 |
import psycopg2
from microsetta_private_api.repo.base_repo import BaseRepo
from microsetta_private_api.model.campaign import Campaign
from microsetta_private_api.exceptions import RepoException
| [
11748,
17331,
22163,
70,
17,
198,
198,
6738,
4580,
2617,
8326,
62,
19734,
62,
15042,
13,
260,
7501,
13,
8692,
62,
260,
7501,
1330,
7308,
6207,
78,
198,
6738,
4580,
2617,
8326,
62,
19734,
62,
15042,
13,
19849,
13,
35012,
1330,
13718,
... | 3.322034 | 59 |
from transformers import *
import torch
import pandas as pd
from utils import *
from utils_ivp import *
import torch.nn.functional as F
from torch.nn import CrossEntropyLoss
from examples.run_generation import *
import sys
from torch import nn
import numpy as np
random_seed = 7
numepoch = 10
softmax = nn.Softmax(dim=0... | [
6738,
6121,
364,
1330,
1635,
198,
11748,
28034,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
3384,
4487,
1330,
1635,
198,
6738,
3384,
4487,
62,
452,
79,
1330,
1635,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
280... | 2.288575 | 849 |
import importlib.metadata
#__VERSION__ = importlib.metadata.version('MooCoderPy-rjmatthews62')
__VERSION__ = '0.5.7' | [
11748,
1330,
8019,
13,
38993,
198,
2,
834,
43717,
834,
796,
1330,
8019,
13,
38993,
13,
9641,
10786,
44,
2238,
34,
12342,
20519,
12,
81,
73,
76,
1078,
40645,
5237,
11537,
198,
834,
43717,
834,
796,
705,
15,
13,
20,
13,
22,
6
] | 2.697674 | 43 |
import pkg_resources
from gi.repository import Gtk
| [
11748,
279,
10025,
62,
37540,
198,
6738,
308,
72,
13,
260,
1930,
37765,
1330,
402,
30488,
628
] | 3.058824 | 17 |
"""
StateMachine for CloudWedge
Provides implementation details for statemachine service. It follows contract
outlined in cloudwedge.models.AWSService
"""
from os import environ
from typing import Any, Dict, List, Optional
import boto3
import jmespath
from cloudwedge.models import AWSResource, AWSService
from cloud... | [
37811,
198,
9012,
37573,
329,
10130,
54,
14907,
198,
198,
15946,
1460,
7822,
3307,
329,
1185,
368,
20480,
2139,
13,
632,
5679,
2775,
198,
448,
10837,
287,
6279,
86,
14907,
13,
27530,
13,
12298,
5432,
712,
501,
198,
37811,
198,
198,
67... | 3.385093 | 161 |
"""Automated bead catching of 1 bead"""
from bluelake import stage, fluidics, pause, trap1, timeline
match_score = timeline["Tracking Match Score"]["Bead 1"]
trap1.clear() # to get rid of any existing bead
stage.move_to("beads") # must match the label in the UI
fluidics.open(1, 2, 3, 6) # list of valves to open ma... | [
37811,
38062,
515,
49773,
16508,
286,
352,
49773,
37811,
198,
6738,
698,
2731,
539,
1330,
3800,
11,
11711,
873,
11,
14985,
11,
12840,
16,
11,
15264,
198,
198,
15699,
62,
26675,
796,
15264,
14692,
2898,
5430,
13225,
15178,
1,
7131,
1,
... | 2.875 | 264 |
# Copyright (c) 2014 Mirantis, Inc.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
2,
220,
220,
220,
15069,
357,
66,
8,
1946,
7381,
20836,
11,
3457,
13,
198,
2,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
... | 2.245581 | 3,734 |
from __future__ import annotations
from typing import Dict
from flask_sqlalchemy import SQLAlchemy
from jsonrpcserver import method
from labster.di import injector
from labster.domain2.model.profile import ProfileRepository
from labster.domain2.model.structure import StructureRepository
from labster.domain2.services... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
360,
713,
198,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
33918,
81,
14751,
15388,
1330,
2446,
198,
198,
6738,
2248,
1706,
13,
10989,
... | 3.508772 | 171 |
import enum
import random
from typing import Dict, Iterable, List, Tuple, Optional, NamedTuple
from emoji import descriptions, spec_parser
from emoji.core import Emoji, Gender, Modifier
from syllables import count_syllables
def _load_resources() -> Tuple[Dict[Emoji, str], List[Modifier]]:
"""Loads emojis and des... | [
11748,
33829,
198,
11748,
4738,
198,
6738,
19720,
1330,
360,
713,
11,
40806,
540,
11,
7343,
11,
309,
29291,
11,
32233,
11,
34441,
51,
29291,
198,
198,
6738,
44805,
1330,
16969,
11,
1020,
62,
48610,
198,
6738,
44805,
13,
7295,
1330,
22... | 2.74026 | 1,694 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# -*- coding: utf-8 -*-
__all__ = ("percentage",)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
439,
834,
796,
5855,
25067,
496,
1600,
8,
628
] | 2.08 | 25 |
#!/usr/bin/env python
from __future__ import division, with_statement
import warnings
import numpy
from contextlib import contextmanager
from .setting import Var, ConstVal
from .calculation import Calculator
from cogent.util import parallel
from cogent.maths.stats.distribution import chdtri
from cogent.maths.optimisers... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
351,
62,
26090,
198,
11748,
14601,
198,
11748,
299,
32152,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
764,
33990,
1330,
12372,
11,
4757... | 2.531078 | 2,542 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'LCDNumberExample.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtC... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
5639,
35,
15057,
16281,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17301,
... | 3.135593 | 118 |
__author__ = 'paulo.rodenas'
| [
834,
9800,
834,
796,
705,
79,
2518,
78,
13,
305,
6559,
292,
6,
198
] | 2.071429 | 14 |
# run.py
from load import *
| [
2,
1057,
13,
9078,
198,
6738,
3440,
1330,
1635,
628,
198
] | 2.727273 | 11 |
import sys
from PyQt5 import QtWidgets
from mainwindow import MyPyqtForm
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
my_pyqt_form = MyPyqtForm()
my_pyqt_form.show()
# help_win = HelpPyqtForm()
# my_pyqt_form.Help.clicked.connect(help_win.showGui)
sys.exit(app.exec_())
| [
11748,
25064,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
54,
312,
11407,
198,
6738,
1388,
17497,
1330,
2011,
20519,
39568,
8479,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
796,
337... | 2.311594 | 138 |
__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\x4f\x52\x00\x00\x03\x07\x00\x42\x0d\x0d\x0a\x02\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x40\x00\x00\x00\xaf\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\x50\x8c\x64\x26\x42\xd6\x... | [
834,
9078,
40456,
834,
7,
834,
3672,
834,
11,
11593,
7753,
834,
11,
275,
6,
59,
87,
1120,
59,
87,
3270,
59,
87,
3901,
59,
87,
4309,
59,
87,
19,
67,
59,
87,
19,
69,
59,
87,
4309,
59,
87,
405,
59,
87,
405,
59,
87,
3070,
59,
... | 1.290532 | 771 |
import requests
from MysqlClient import MysqlClient
if __name__ == '__main__':
VerifyProxy().verify_all() | [
11748,
7007,
201,
198,
6738,
337,
893,
13976,
11792,
1330,
337,
893,
13976,
11792,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
49899,
44148,
22446,
332,
1958,
62,
439,
3419
] | 2.780488 | 41 |
import pytest
from tqdm import tqdm
import numpy as np
from surfaces.test_functions import SphereFunction, RastriginFunction
from gradient_free_optimizers import (
BayesianOptimizer,
TreeStructuredParzenEstimators,
ForestOptimizer,
RandomSearchOptimizer,
)
opt_smbo_l = (
"Optimizer",
[
... | [
11748,
12972,
9288,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
16649,
13,
9288,
62,
12543,
2733,
1330,
31798,
22203,
11,
371,
459,
4359,
259,
22203,
198,
198,
6738,
31312,
62,
... | 2.285223 | 291 |
import argparse
import sys
import re
from danerfile_utils_lib.tbl import Tbl, Cnds
from danerfile_utils_lib.daner import Marker
from danerfile_utils_lib.misc import ref_fh_is_withchr
from danerfile_utils_lib.poprefalt import PopRefAlt, a1_a2_direction
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
302,
198,
6738,
46078,
263,
7753,
62,
26791,
62,
8019,
13,
83,
2436,
1330,
309,
2436,
11,
327,
358,
82,
198,
6738,
46078,
263,
7753,
62,
26791,
62,
8019,
13,
25604,
263,
1330,
2940,
... | 2.678899 | 109 |
from scapy.all import *
# Instantiate the blocks
clf = CLIFeeder()
ijs = InjectSink("enx3495db043a28")
# Plug blocks together
clf > ijs
# Create and start the engine
pe = PipeEngine(clf)
pe.start() | [
6738,
629,
12826,
13,
439,
1330,
1635,
198,
2,
24470,
9386,
262,
7021,
198,
565,
69,
796,
7852,
5064,
2308,
263,
3419,
198,
2926,
82,
796,
554,
752,
50,
676,
7203,
268,
87,
2682,
3865,
9945,
48768,
64,
2078,
4943,
198,
198,
2,
226... | 2.689189 | 74 |
import argparse
import sys
import os
from cage.container import ContainerHandler
from cage.env import EnvHandler
| [
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
17186,
13,
34924,
1330,
43101,
25060,
198,
6738,
17186,
13,
24330,
1330,
2039,
85,
25060,
628,
198
] | 4.107143 | 28 |
#-*-coding:utf8-*-
import pandas as pd
import steam.webauth as wa
import re
from decimal import Decimal
import time
from random import randint as randt
COMMUNITY_URL = 'https://steamcommunity.com'
CREATE_BUY_ORDER = '/market/createbuyorder/'
GAME_DIC = {'STEAM':'753','CS':'730','DOTA':'570'}
# Currency price code ref... | [
2,
12,
9,
12,
66,
7656,
25,
40477,
23,
12,
9,
12,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
13324,
13,
732,
7012,
1071,
355,
2082,
198,
11748,
302,
198,
6738,
32465,
1330,
4280,
4402,
198,
11748,
640,
198,
6738,
4738,... | 1.3487 | 2,039 |
from common.base import GenericTestBase
from fabric.api import local, settings
import time
import re
import test
import ipaddress
import vnc_api_test
import uuid
from tcutils.util import get_random_name, retry
from tcutils.gevent_lib import exec_in_parallel
from tcutils.verification_util import *
from lxml import etree... | [
6738,
2219,
13,
8692,
1330,
42044,
14402,
14881,
198,
6738,
9664,
13,
15042,
1330,
1957,
11,
6460,
198,
11748,
640,
198,
11748,
302,
198,
11748,
1332,
198,
11748,
20966,
21975,
198,
11748,
410,
10782,
62,
15042,
62,
9288,
198,
11748,
33... | 3.321429 | 252 |
####################################
# File name: script.py #
# Version: 1 #
# Author: Rui Oliveira #
# Email: ruipedrooliveira@ua.pt #
# Date create: 29-03-2017 #
# Date last modified: 01-08-2017 #
# Python Version: 3 #
########################... | [
29113,
4242,
198,
2,
9220,
1438,
25,
4226,
13,
9078,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
198,
2,
10628,
25,
352,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.76372 | 656 |
""" Calculate the bounds of each SLR GeoTIFF and save for spatial index later """
from pathlib import Path
import rasterio
import geopandas as gp
import pygeos as pg
from pyogrio import write_dataframe
from analysis.constants import DATA_CRS
from analysis.lib.raster import add_overviews
data_dir = Path("data/inputs"... | [
37811,
27131,
378,
262,
22303,
286,
1123,
12419,
49,
32960,
51,
29267,
290,
3613,
329,
21739,
6376,
1568,
37227,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
374,
1603,
952,
198,
11748,
30324,
392,
292,
355,
27809,
198,
11748,
1... | 2.902017 | 347 |
# -*- coding: utf-8 -*-
from PIL import Image
from PIL.ExifTags import TAGS
import os
import glob
CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
WORK_DIR = 'work'
RESULT_DIR = 'result'
# Get all of the image files that exist under the "work" directoly.
fileList = [r.split('/')[-1] for r in glob.glob(os.pat... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
350,
4146,
13,
3109,
361,
36142,
1330,
37801,
50,
198,
11748,
28686,
198,
11748,
15095,
198,
198,
34,
39237,
62,
34219,
796,
2868... | 2.033537 | 1,312 |
import nltk
| [
11748,
299,
2528,
74,
628
] | 2.6 | 5 |
__author__ = 'Yifu Huang'
import sys
import os
sys.path.append(os.path.dirname(__file__) + "/../../")
sys.path.append("..")
from hackathon.database import *
from hackathon.database.models import *
from hackathon.log import *
import time
import os
import json
# resource name in table UserResource
STORAGE_ACCOUNT = 'st... | [
834,
9800,
834,
796,
705,
56,
361,
84,
31663,
6,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
8,
1343,
12813,
40720,
40720,
4943,
198,
17597,
13,
... | 2.095716 | 2,988 |
from collections import defaultdict
import numpy as np
import random | [
6738,
17268,
1330,
4277,
11600,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738
] | 4.857143 | 14 |
import os
import sys
import errno
import subprocess
import glob
import shutil
from contextlib import contextmanager
def normpath(path):
"""Normalize UNIX path to a native path."""
normalized = os.path.join(*path.split("/"))
if os.path.isabs(path):
return os.path.abspath("/") + normalized
else:
... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
11454,
3919,
198,
11748,
850,
14681,
198,
11748,
15095,
198,
11748,
4423,
346,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
4299,
2593,
6978,
7,
6978,
2599,
198,
220,
220,
220,
37227,
... | 2.791667 | 144 |
#Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software; you can redistribute it and/or modify it under the terms of the BSD 0-Clause License.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ... | [
2,
15269,
357,
34,
8,
12131,
13,
43208,
21852,
1766,
1539,
12052,
13,
1439,
2489,
10395,
13,
198,
198,
2,
1212,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
739,
262,
2846,
286,
262,
347,
10305,
... | 3.82963 | 135 |
# Copyright (C) 2012-2013, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT (see COPYING file)
from __future__ import division
import numpy as np
from .internal import _check_3
def rgb2grey(array, dtype=np.float):
'''
grey = rgb2grey(rgb_image, dtype=... | [
2,
15069,
357,
34,
8,
2321,
12,
6390,
11,
20894,
28855,
1766,
417,
8873,
1279,
2290,
271,
31,
2290,
8802,
276,
305,
13,
2398,
29,
198,
2,
43907,
25,
900,
40379,
28,
19,
39747,
28,
19,
1509,
28,
19,
4292,
8658,
4451,
521,
298,
25... | 2.183645 | 2,140 |
from datetime import datetime, timedelta, timezone
from functools import partial
from django.conf import settings
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
640,
11340,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
628,
628
] | 4.034483 | 29 |
from setuptools import setup
setup(
name='nmap_topology_scanner',
version='0.6',
description='CRUSOE tool for scanning the network topology using nmap',
author='CSIRT-MU',
keywords='scan nmap topology services crusoe',
package_data={'nmap_topology_scanner':['data/*']},
python_requires='>=3.... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
77,
8899,
62,
4852,
1435,
62,
35836,
1008,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
21,
3256,
198,
220,
220,
220,
6764,
11639,
9419,
293... | 2.641509 | 159 |
# encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Identities module: views
"""
from treeio.identities.identicon import render_identicon
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.http import Htt... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
2,
15069,
2813,
12200,
13,
952,
15302,
198,
2,
770,
2393,
318,
636,
286,
12200,
952,
13,
198,
2,
13789,
7324,
13,
21048,
13,
952,
14,
43085,
198,
198,
37811,
198,
33234,
871,
8265,
25,
5009,
... | 2.328832 | 13,773 |
import json
import logging
from flask import request, Blueprint, abort, redirect, url_for, flash
from flask.ext.user import login_required
from flask.ext.login import current_user
from common.decorators import render_to
from app import app, csrf
from app.accounts.models import Project, FreeEmailProvider
from app.acco... | [
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
42903,
1330,
2581,
11,
39932,
11,
15614,
11,
18941,
11,
19016,
62,
1640,
11,
7644,
198,
6738,
42903,
13,
2302,
13,
7220,
1330,
17594,
62,
35827,
198,
6738,
42903,
13,
2302,
13,
38235,
1... | 2.757028 | 498 |
from temboo.Library.EnviroFacts.UVForecast.DailyUVByCity import DailyUVByCity, DailyUVByCityInputSet, DailyUVByCityResultSet, DailyUVByCityChoreographyExecution
from temboo.Library.EnviroFacts.UVForecast.DailyUVByZipCode import DailyUVByZipCode, DailyUVByZipCodeInputSet, DailyUVByZipCodeResultSet, DailyUVByZipCodeChore... | [
6738,
2169,
2127,
78,
13,
23377,
13,
4834,
85,
7058,
37,
8656,
13,
31667,
16351,
2701,
13,
28545,
31667,
3886,
14941,
1330,
6714,
31667,
3886,
14941,
11,
6714,
31667,
3886,
14941,
20560,
7248,
11,
6714,
31667,
3886,
14941,
23004,
7248,
... | 3.053571 | 224 |
"""
This module is an extension for xarray to provide rasterio capabilities
to xarray dataarrays.
Credits: The `reproject` functionality was adopted from https://github.com/opendatacube/datacube-core # noqa: E501
Source file:
- https://github.com/opendatacube/datacube-core/blob/084c84d78cb6e1326c7fbbe79c5b5d0bef37c078... | [
37811,
198,
1212,
8265,
318,
281,
7552,
329,
2124,
18747,
284,
2148,
374,
1603,
952,
9889,
198,
1462,
2124,
18747,
1366,
3258,
592,
13,
198,
198,
42855,
25,
383,
4600,
260,
16302,
63,
11244,
373,
8197,
422,
3740,
1378,
12567,
13,
785,... | 2.038417 | 17,440 |
'''
Created by auto_sdk on 2020.02.05
'''
from dingtalk.api.base import RestApi
| [
7061,
6,
198,
41972,
416,
8295,
62,
21282,
74,
319,
12131,
13,
2999,
13,
2713,
198,
7061,
6,
198,
6738,
44852,
16620,
13,
15042,
13,
8692,
1330,
8324,
32,
14415,
198
] | 2.580645 | 31 |
"""
征集接口信息,可积极反馈,附上开发文档地址即可
""" | [
37811,
198,
36181,
223,
37239,
228,
162,
236,
98,
20998,
96,
46479,
94,
162,
223,
107,
171,
120,
234,
20998,
107,
163,
100,
107,
162,
252,
223,
20998,
235,
165,
99,
230,
171,
120,
234,
165,
247,
226,
41468,
28156,
222,
20998,
239,
... | 0.525424 | 59 |
from data_collection.management.commands import BaseHalaroseCsvImporter
| [
6738,
1366,
62,
43681,
13,
27604,
13,
9503,
1746,
1330,
7308,
40202,
283,
577,
34,
21370,
3546,
26634,
628
] | 3.842105 | 19 |
#!/usr/bin/python3
# Create the TTS army defintions.
import json
import os
import sys
import subprocess
import re
def write_deployment_dismounting_as(file, base_definition, dismount_type, battle_card) :
"""
@return list of base defintions for mounted and dismounted.
"""
assert dismount_type is not None
mou... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
13610,
262,
309,
4694,
5428,
825,
600,
507,
13,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
11748,
302,
628,
198,
4299,
3551,
62,
2934,
... | 2.764486 | 4,004 |
# -*- coding: utf-8 -*-
import sys
import ctypes
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
25064,
198,
11748,
269,
19199,
198
] | 2.333333 | 21 |
# Copyright (c) 2020-2021 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
# This file is covered by the license agreement found in the file “license.txt” in the root of this project.
#
# convert the output of coco format to OpenImages format
#
import numpy as np
import pandas as pd
import os, jso... | [
2,
15069,
357,
66,
8,
12131,
12,
1238,
2481,
26182,
10501,
290,
14,
273,
663,
22347,
32590,
444,
737,
1439,
2489,
10395,
13,
198,
2,
770,
2393,
318,
5017,
416,
262,
5964,
4381,
1043,
287,
262,
2393,
564,
250,
43085,
13,
14116,
447,
... | 3.186851 | 289 |
from .bookmark_setter import BookmarkSetter
from .cfg_error import CfgError
from .deleter import Deleter
from .first_run import FirstRun
from .launch_tf2 import LaunchTF2
from .settings import Settings
from ._diagresult import DIAGSIG
| [
6738,
764,
2070,
4102,
62,
2617,
353,
1330,
4897,
4102,
7248,
353,
198,
6738,
764,
37581,
62,
18224,
1330,
327,
40616,
12331,
198,
6738,
764,
2934,
293,
353,
1330,
42226,
353,
198,
6738,
764,
11085,
62,
5143,
1330,
3274,
10987,
198,
6... | 3.405797 | 69 |
import sys
from csv import DictWriter
from cyvcf2 import VCF
from itertools import product, chain
import re
from vcflat.HeaderExtraction import VcfHeader
def nestlists(ll):
"""
adds FORMAT labels with format values in sample columns
:param ll:
:return:
"""
for nr, i in enumerate(ll[9:]):
... | [
11748,
25064,
198,
6738,
269,
21370,
1330,
360,
713,
34379,
198,
6738,
3075,
85,
12993,
17,
1330,
569,
22495,
198,
6738,
340,
861,
10141,
1330,
1720,
11,
6333,
198,
11748,
302,
198,
198,
6738,
410,
66,
38568,
13,
39681,
11627,
7861,
1... | 2.217988 | 656 |
"""Implements the Crc64Result class.
"""
from __future__ import unicode_literals
class Crc64Result(object):
"""Implements a class that represents the result of a 64-bit Cyclic Redundancy Check checksum.
"""
@property
def high_bytes(self):
"""Returns the topmost 4 bytes of the checksum form... | [
37811,
3546,
1154,
902,
262,
3864,
66,
2414,
23004,
1398,
13,
198,
37811,
628,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
628,
198,
4871,
3864,
66,
2414,
23004,
7,
15252,
2599,
198,
220,
220,
220,
37227,
3546,
11... | 2.735683 | 227 |
from enum import Enum
import mistune
from flask import Markup
Plugin = Enum(
'Plugin',
[
name.upper()
for name in [
'strikethrough',
'footnotes',
'table',
'url',
'task_lists',
'def_list',
'abbr',
]
... | [
6738,
33829,
1330,
2039,
388,
198,
198,
11748,
4020,
1726,
198,
6738,
42903,
1330,
2940,
929,
198,
198,
37233,
796,
2039,
388,
7,
198,
220,
220,
220,
705,
37233,
3256,
198,
220,
220,
220,
685,
198,
220,
220,
220,
220,
220,
220,
220,... | 2.03321 | 271 |
#!/usr/bin/env python3
import os
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
628,
198
] | 2.5 | 14 |
from numbers import Number
from typing import *
import nuke
from . import *
class LiveGroup(Precomp):
"""
"""
def __repr__(self, ):
"""
Return repr(self).
"""
return None
def __str__(self, ):
"""
Return str(self).
"""
return None
d... | [
6738,
3146,
1330,
7913,
198,
6738,
19720,
1330,
1635,
198,
198,
11748,
299,
4649,
198,
6738,
764,
1330,
1635,
198,
198,
4871,
7547,
13247,
7,
6719,
5589,
2599,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
... | 2.437342 | 1,189 |
import pytest
from main import Solution
| [
11748,
12972,
9288,
198,
6738,
1388,
1330,
28186,
628,
628
] | 4.3 | 10 |
import tempfile
from distutils.file_util import copy_file
from pathlib import Path
from conan_app_launcher.core import ConanInfoCache
from conans.model.ref import ConanFileReference as CFR
def test_new_cache():
"""
Test, if a new cache file is generated, if it does not exist.
"""
temp_dir = Path(tem... | [
198,
11748,
20218,
7753,
198,
6738,
1233,
26791,
13,
7753,
62,
22602,
1330,
4866,
62,
7753,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
369,
272,
62,
1324,
62,
38722,
2044,
13,
7295,
1330,
31634,
12360,
30562,
198,
6738,
369,
... | 2.334793 | 1,598 |
from leiaquilt.main import main
| [
6738,
443,
544,
421,
2326,
13,
12417,
1330,
1388,
198
] | 3.2 | 10 |
import json
import csv
import shutil
import os
import sys
from skimage import io
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from bokeh.io import output_file
from bokeh.plotting import figure
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.palettes import Set2_5
from bokeh.plotting im... | [
11748,
33918,
198,
11748,
269,
21370,
198,
11748,
4423,
346,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
1341,
9060,
1330,
33245,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
11,
7412,
23252,... | 2.088855 | 1,992 |
import json
import logging
from functools import wraps
from os import mkdir
from os.path import abspath, dirname, isdir
from time import strftime, localtime, time, sleep
import pymongo
import requests
from bson import ObjectId
from retrying import retry
from config import config
ABSPATH = dirname(abspath(__file__))
... | [
11748,
33918,
198,
11748,
18931,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
28686,
1330,
33480,
15908,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
26672,
3672,
11,
318,
15908,
198,
6738,
640,
1330,
965,
31387,
11,
1957,
... | 2.511194 | 268 |
# -*- coding: utf-8 -*-
from dataclasses import dataclass
from typing import Optional
from .image import Images
from .media import Media
from .translaction import Translation
@dataclass
@dataclass
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
764,
9060,
1330,
5382,
198,
6738,
764,
11431,
1330,
6343,
198,
6738,
764,
... | 3.311475 | 61 |
#!/usr/bin/python3
#
# Copyright (c) 2015-2020 Pablo Cases,
# Distributed under the MIT License.
# (See accompanying file LICENSE file or
# copy at http://opensource.org/licenses/MIT)
#
import sys
import os
from dbus.mainloop.glib import DBusGMainLoop
import dbus
from gi.repository import GLib
import datetime
import ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
198,
2,
15069,
357,
66,
8,
1853,
12,
42334,
33185,
35536,
11,
198,
2,
4307,
6169,
739,
262,
17168,
13789,
13,
198,
2,
357,
6214,
19249,
2393,
38559,
24290,
2393,
393,
198,
2,
... | 2.690162 | 681 |
import time
import datetime
import cv2
import face_recognition
from skimage import io
from firebase_admin import credentials, firestore, storage, initialize_app
picture_of_me = cv2.imread("../hosam.jpg")
picture_of_me = cv2.cvtColor(picture_of_me, cv2.COLOR_BGR2RGB)
my_face_encoding = face_recognition.face_encodings(p... | [
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
269,
85,
17,
198,
11748,
1986,
62,
26243,
653,
198,
6738,
1341,
9060,
1330,
33245,
198,
6738,
2046,
8692,
62,
28482,
1330,
18031,
11,
2046,
8095,
11,
6143,
11,
41216,
62,
1324,
198,
198,... | 2.659436 | 461 |
import csv
import logging
import pandas as pd
import shared
# time pipenv run python count_names.py
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s')
if __name__ == '__main__':
analyze_names()
| [
11748,
269,
21370,
198,
11748,
18931,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4888,
198,
2,
640,
7347,
24330,
1057,
21015,
954,
62,
14933,
13,
9078,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
... | 2.802469 | 81 |
# Code adapted from https://stackoverflow.com/questions/30831731/create-a-generic-serializer-with-a-dynamic-model-in-meta
from rest_framework import serializers | [
2,
6127,
16573,
422,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
1270,
5999,
1558,
3132,
14,
17953,
12,
64,
12,
41357,
12,
46911,
7509,
12,
4480,
12,
64,
12,
67,
28995,
12,
19849,
12,
259,
12,
28961,
198,
198,
6738... | 3.22 | 50 |
from .python.gizmo_server import (
#gizmo_task_server,
#gizmo_standalone_server,
GzServer,
#run_gizmo_standalone,
#standalone_gizmo,
#gizmo_jupyter_tab,
#gizmo_jupyter_iframe,
#start,
#new_gizmo,
#in_tab,
#embed,
run,
serve,
get_gizmo,
)
from .python.H5Gizmos im... | [
198,
6738,
764,
29412,
13,
70,
528,
5908,
62,
15388,
1330,
357,
198,
220,
220,
220,
1303,
70,
528,
5908,
62,
35943,
62,
15388,
11,
198,
220,
220,
220,
1303,
70,
528,
5908,
62,
1481,
17749,
62,
15388,
11,
198,
220,
220,
220,
402,
... | 1.889241 | 316 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from adminsortable.models import SortableMixin
from imagekit.models import ImageSpecField, ProcessedImageField
from imagekit.processors import ResizeToFit
from core.models import BaseModel, LikedModel
from core.utils import ru_date_f... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
44563,
419,
540,
13,
27530,
1330,
33947,
540,
35608,
259,
198,
6738,
2939,
15813,
... | 2.183231 | 2,445 |
# -*- coding: utf-8 -*-
# Copyright 2010-2016, Google Inc.
# 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... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
3050,
12,
5304,
11,
3012,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
... | 2.542022 | 2,463 |
import time
import sys
import av
start_time = last_time = time.monotonic()
for path in sys.argv[1:]:
lap(f'starting {path}')
v1(path)
lap('done')
| [
198,
11748,
640,
198,
11748,
25064,
198,
198,
11748,
1196,
628,
198,
9688,
62,
2435,
796,
938,
62,
2435,
796,
640,
13,
2144,
313,
9229,
3419,
628,
628,
628,
198,
1640,
3108,
287,
25064,
13,
853,
85,
58,
16,
25,
5974,
198,
220,
220... | 2.291667 | 72 |
#
import unittest
import torch
import gym
import biz.drlt.rll as rll
from biz.drlt.app_config import AppConfig
from biz.drlt.ds.bar_data import BarData
from biz.drlt.envs.minute_bar_env import MinuteBarEnv
from biz.drlt.nns.simple_ff_dqn import SimpleFFDQN
from biz.drlt.rll.agent import DQNAgent
from biz.drlt.rll.exper... | [
2,
198,
11748,
555,
715,
395,
198,
11748,
28034,
198,
11748,
11550,
198,
11748,
275,
528,
13,
7109,
2528,
13,
81,
297,
355,
374,
297,
198,
6738,
275,
528,
13,
7109,
2528,
13,
1324,
62,
11250,
1330,
2034,
16934,
198,
6738,
275,
528,
... | 2.743421 | 152 |
from tkinter import *
import tkinter as tk # 使用Tkinter前需要先导入
from tkinter import filedialog, ttk
import tkinter.messagebox # 这个是消息框,对话框的关键
from PIL import ImageTk
from PIL import Image
import numpy as np
import math
import cv2
from easydict import EasyDict
import threading
import random
from xfield_test import XField... | [
6738,
256,
74,
3849,
1330,
1635,
198,
11748,
256,
74,
3849,
355,
256,
74,
220,
1303,
220,
45635,
18796,
101,
51,
74,
3849,
30298,
235,
165,
250,
222,
17358,
223,
17739,
230,
43380,
120,
17739,
98,
198,
6738,
256,
74,
3849,
1330,
571... | 1.924681 | 1,726 |
"""
an utility function to run PROSA-II with os.system()
author: Jens Linge
"""
import os, shutil, string, time, sys, traceback
## from Parameters import *
def RunProsa(pdbList, tmpDir, reportFN,\
trashDirectory,\
prosaExe,\
slowNetworks):
"""
runs the PROSA-II program o... | [
37811,
198,
272,
10361,
2163,
284,
1057,
4810,
2640,
32,
12,
3978,
351,
28686,
13,
10057,
3419,
198,
198,
9800,
25,
449,
641,
406,
11912,
198,
37811,
198,
11748,
28686,
11,
4423,
346,
11,
4731,
11,
640,
11,
25064,
11,
12854,
1891,
1... | 2.217962 | 991 |
##
## pytorch-neural-doodle/src/loss/__init__.py
##
## Created by Bastian Boll <mail@bbboll.com> on 29/08/2018.
## Updated by Paul Warkentin <paul@warkentin.email> on 06/10/2018.
##
from .content import ContentLoss
from .style import StyleLoss
| [
2235,
198,
2235,
12972,
13165,
354,
12,
710,
1523,
12,
67,
27106,
14,
10677,
14,
22462,
14,
834,
15003,
834,
13,
9078,
198,
2235,
198,
2235,
15622,
416,
17520,
666,
43479,
1279,
4529,
31,
11848,
65,
692,
13,
785,
29,
319,
2808,
14,
... | 2.692308 | 91 |
#!/usr/bin/env python3
if __name__ == "__main__": # pragma: no cover
results = benchmark_system()
print(results)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
220,
1303,
23864,
2611,
25,
645,
3002,
628,
220,
220,
220,
2482,
796,
18335,
62,
10057,
3419,
198,
220,
220,
22... | 2.625 | 48 |
from flask import Blueprint, render_template
bp = Blueprint('dashboard', __name__, url_prefix='/dashboard')
@bp.route('/')
@bp.route('/edit/<id>') | [
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
198,
198,
46583,
796,
39932,
10786,
42460,
3526,
3256,
11593,
3672,
834,
11,
19016,
62,
40290,
11639,
14,
42460,
3526,
11537,
198,
198,
31,
46583,
13,
38629,
10786,
14,
11537,
198,
198,
31,... | 2.865385 | 52 |
from datetime import datetime
import json
import os
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from jose import jwt
import subprocess
from app import create_app
from app.models import Contact, Instrument, Error
from pprint import pprint
import pytest
from app import *
@pytest.fixtu... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
76,
42175,
1330,
337,
42175,
198,
6738,
474,
577,
1330,
474,
46569,
198,
... | 3.276119 | 134 |
[
[0.6333005, 0.75793673, 0.6333005, 0.59619648, 0.0],
[-0.48038446, 0.0, -0.52223297, -0.48038446, float("NaN")],
[-0.2, 1.4, -0.09090909, 1.4, 0.0],
[0.48454371, 0.25131234, 0.48454371, 0.24723409, 0.0],
]
| [
58,
198,
220,
220,
220,
685,
15,
13,
21,
2091,
6200,
20,
11,
657,
13,
2425,
3720,
2623,
4790,
11,
657,
13,
21,
2091,
6200,
20,
11,
657,
13,
45734,
1129,
34287,
11,
657,
13,
15,
4357,
198,
220,
220,
220,
25915,
15,
13,
22148,
2... | 1.623188 | 138 |
import os
import shutil
import json
import logging
from pychemia.code.vasp import VaspJob, VaspOutput, VaspInput
from pychemia.crystal import KPoints
from pychemia.code.vasp import read_poscar
from pychemia.utils.mathematics import round_small
__author__ = 'Guillermo Avendano-Franco'
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
12972,
15245,
544,
13,
8189,
13,
85,
5126,
1330,
569,
5126,
33308,
11,
569,
5126,
26410,
11,
569,
5126,
20560,
198,
6738,
12972,
15245,
544,
13,
20470... | 3.086022 | 93 |
import numpy as np
import sys
import os
num1 = 0
num0 = 0
data_path = sys.argv[1]
output_path = sys.argv[2]
all_data = np.loadtxt(data_path, delimiter=',')
row, col = all_data.shape
X = np.array(all_data[:, : col - 2])
no_push_Y = np.array(Timeout(all_data[:, -1], 1))
#no_push_Y = np.array(Timeout(all_data[:, 33], 1... | [
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
22510,
16,
796,
657,
198,
22510,
15,
796,
657,
198,
198,
7890,
62,
6978,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
22915,
62,
6978,
796,
25064,
13,
853,
... | 2.03244 | 709 |
from typing import List
import re
from ..label_transducer import get_most_common, get_most_common_except_not_entity
from ..tokens import INT_TOKEN
from .base import PatternRecognizer, PatternRecognizerAligner
class IntToken(PatternRecognizer):
"""
Recognize integer (ex: 12, 10000) in the input string
a... | [
6738,
19720,
1330,
7343,
198,
198,
11748,
302,
198,
198,
6738,
11485,
18242,
62,
7645,
646,
2189,
1330,
651,
62,
1712,
62,
11321,
11,
651,
62,
1712,
62,
11321,
62,
16341,
62,
1662,
62,
26858,
198,
6738,
11485,
83,
482,
641,
1330,
17... | 2.414365 | 362 |
#!/usr/bin/python
# vim:fileencoding=utf-8
# (c) 2012-2020 Michał Górny <mgorny@gentoo.org>
# Released under the terms of the 2-clause BSD license.
from distutils.core import setup, Extension
import os
import shlex
import subprocess
import sys
PKG_CONFIG = os.environ.get('PKG_CONFIG', 'pkg-config')
cflags, lib... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
220,
220,
43907,
25,
7753,
12685,
7656,
28,
40477,
12,
23,
198,
2,
357,
66,
8,
2321,
12,
42334,
38844,
41615,
402,
10205,
81,
3281,
1279,
11296,
1211,
88,
31,
6783,
2238,
13,
2398,
29,... | 1.977124 | 612 |
from icrawler.builtin import GoogleImageCrawler
for keyword in ['red signs', 'blue signs']:
google_image_crawl(directory='images', keyword=keyword, max_num=1000)
| [
6738,
14158,
39464,
13,
18780,
259,
1330,
3012,
5159,
34,
39464,
198,
198,
1640,
21179,
287,
37250,
445,
5895,
3256,
705,
17585,
5895,
6,
5974,
198,
220,
220,
220,
23645,
62,
9060,
62,
66,
13132,
7,
34945,
11639,
17566,
3256,
21179,
2... | 3.211538 | 52 |
import threading
import multiprocessing
import traceback
import logging
from timeit import default_timer
_threadlogger = logging.getLogger("ThreadPoolExceptions")
| [
11748,
4704,
278,
198,
11748,
18540,
305,
919,
278,
198,
11748,
12854,
1891,
198,
11748,
18931,
198,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
198,
198,
62,
16663,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7203,
16818,
27201,
310... | 3.75 | 44 |
import os
import time
import serial
import pynmea2
import string
#loop for the gps
while True:
port = "/dev/ttyAMA0"
ser = serial.Serial(port, baudrate=9600, timeout=0.5)
dataout = pynmea2.NMEAStreanReader()
newdata = ser.readline()
print ("Obtendo latitude e longetude")
if newdata[0:6] == '$GPGGA':
newmsg =... | [
11748,
28686,
198,
11748,
640,
198,
11748,
11389,
198,
11748,
279,
2047,
1326,
64,
17,
198,
11748,
4731,
198,
2,
26268,
329,
262,
308,
862,
198,
198,
4514,
6407,
25,
198,
197,
634,
796,
12813,
7959,
14,
42852,
25087,
15,
1,
198,
197... | 2.41989 | 181 |