content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django.db import models
from swingtime.models import Occurrence
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
9628,
2435,
13,
27530,
1330,
10775,
33928,
198,
198,
2,
13610,
534,
4981,
994,
13
] | 4 | 24 |
from flask import render_template
from . import auth
from flask import redirect, request, url_for, flash
from flask.ext.login import login_user
from flask.ext.login import logout_user, login_required
from .. import db
from ..models import User
from .forms import LoginForm, \
RegistrationForm, ChangePasswordForm, \... | [
628,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
198,
6738,
764,
1330,
6284,
198,
6738,
42903,
1330,
18941,
11,
2581,
11,
19016,
62,
1640,
11,
7644,
198,
6738,
42903,
13,
2302,
13,
38235,
1330,
17594,
62,
7220,
198,
6738,
42903,
13,... | 3.034985 | 343 |
#!/usr/bin/env python3.7
"""This script modifies the zlib-ng source directory for cgo.
- Move files under arch/x86 to the toplevel directory, since cgo doesn't support subdirectories.
- Add "zng_" prefix to non-static, hidden functions and variables. This is
needed to allow mixing libz and zlibng in a single bina... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
22,
198,
198,
37811,
1212,
4226,
953,
6945,
262,
1976,
8019,
12,
782,
2723,
8619,
329,
269,
2188,
13,
628,
198,
12,
10028,
3696,
739,
3934,
14,
87,
4521,
284,
262,
284,
1154,
62... | 2.083957 | 1,870 |
import pickle
import luigi
from luigi.util import inherits
from recon.amass import ParseAmassOutput
from recon.masscan import ParseMasscanOutput
from recon.config import web_ports
@inherits(ParseMasscanOutput, ParseAmassOutput)
class GatherWebTargets(luigi.Task):
""" Gather all subdomains as well as any ip addr... | [
11748,
2298,
293,
198,
198,
11748,
300,
84,
25754,
198,
6738,
300,
84,
25754,
13,
22602,
1330,
10639,
896,
198,
198,
6738,
8195,
13,
321,
562,
1330,
2547,
325,
5840,
562,
26410,
198,
6738,
8195,
13,
22208,
5171,
1330,
2547,
325,
20273... | 2.28345 | 1,577 |
import importlib.util
import subprocess
import sys
import re
###########################################################################
#
# If the WMI module isn't available, we can simulate it through running
# Get-CimInstance through Powershell. It's slower, but it means the end
# user doesn't need to install pack... | [
11748,
1330,
8019,
13,
22602,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
302,
198,
198,
29113,
29113,
7804,
21017,
198,
2,
198,
2,
1002,
262,
370,
8895,
8265,
2125,
470,
1695,
11,
356,
460,
29308,
340,
832,
2491,
198,
2,
... | 4.117089 | 316 |
# TODO: add unit tests for grid.py
from rasterio import Affine
import flopy
import pytest
import sfrmaker
fm = flopy.modflow
from ..gis import get_authority_crs
from ..grid import StructuredGrid
from ..units import convert_length_units
@pytest.fixture(scope='function')
@pytest.fixture(scope='function', params=[... | [
2,
16926,
46,
25,
751,
4326,
5254,
329,
10706,
13,
9078,
198,
6738,
374,
1603,
952,
1330,
6708,
500,
198,
198,
11748,
781,
11081,
198,
11748,
12972,
9288,
198,
11748,
264,
8310,
10297,
198,
198,
38353,
796,
781,
11081,
13,
4666,
11125... | 3.098361 | 122 |
import os
import sys
import numpy as np
from tqdm import tqdm
from datetime import datetime
if __name__ == '__main__':
main()
| [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 2.76 | 50 |
# coding: utf-8
from django.contrib.auth.backends import ModelBackend # 继承这个为了使用admin的权限控制
from forum.models import ForumUser
#验证用户登录,注册到setting中的AUTHENTICATION_BACKENDS | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
1891,
2412,
1330,
9104,
7282,
437,
1303,
13328,
119,
100,
33699,
123,
32573,
247,
10310,
103,
10310,
118,
12859,
228,
45635,
18796,
101,
28482... | 1.727273 | 99 |
import unittest
import geojson
| [
11748,
555,
715,
395,
198,
198,
11748,
4903,
13210,
1559,
628
] | 3 | 11 |
#!/usr/bin/python
import getopt, os, fnmatch, re, sys, datetime
# function defs
# NOTE: Not self-contained/effect-free. It uses and mutates the sets in which ids are stored (storySet,noUSTracingSet,reqIDSet,duplicateIDSet)
def processRequirementsLine(line):
"This process a single line in a requirements file, extract... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
651,
8738,
11,
28686,
11,
24714,
15699,
11,
302,
11,
25064,
11,
4818,
8079,
628,
198,
2,
2163,
825,
82,
198,
2,
24550,
25,
1892,
2116,
12,
45964,
14,
10760,
12,
5787,
13,
632,
3544... | 2.703067 | 1,337 |
from flask import Flask,jsonify,request
from flask_cors import CORS
app = Flask(__name__)
# Allow CORS (Cross Origin Resource Sharing) in order to for swagger doc to work
CORS(app)
from . import endpoints
if __name__ == '__main__':
app.run(host='0.0.0.0',debug=True) | [
6738,
42903,
1330,
46947,
11,
17752,
1958,
11,
25927,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
2,
22507,
327,
20673,
357,
21544,
19349,
20857,
36644,
8,
287,
1502,
... | 2.882979 | 94 |
import logging
log = logging.getLogger(__name__)
| [
11748,
18931,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628,
198
] | 2.944444 | 18 |
__all__ = [
"DirectoryWatcher",
"FileChanges",
]
import os
import time
from dataclasses import dataclass, field
from pathlib import Path
from typing import Dict, Iterator, Literal, Optional, Sequence, Tuple, cast
from pathspec import PathSpec
from .utils import FileSystemPath, extra_field
FileChanges = Dic... | [
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
43055,
54,
34734,
1600,
198,
220,
220,
220,
366,
8979,
29238,
1600,
198,
60,
628,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
1... | 2.43686 | 879 |
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
BASE_PATH = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(BASE_PATH, 'README.rst')) as f:
README = f.read()
setup(
name='djangohttpbench',
version='0.1.0',
pa... | [
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
900,
37623,
10141,
13,
21812,
13,
9288,
1330,
1332,
355,
6208,
21575,
198,
198,
33,
11159,
62,
34219,
796,
28686,
13,
6978,
... | 2.545279 | 519 |
#!/usr/bin/env python3
"""player module."""
class Player:
"""Player for Checkers."""
def __init__(self, token):
"""Initialize object."""
self._token = token.lower()
self._unpromoted = 12
self._promoted = 0
self._total = self._unpromoted + self._promoted
def get_to... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
7829,
8265,
526,
15931,
628,
198,
4871,
7853,
25,
198,
220,
220,
220,
37227,
14140,
329,
6822,
364,
526,
15931,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
112... | 2.582979 | 470 |
"""Metrics file"""
import argparse
import glob
import yaml
import nibabel as nib
import numpy as np
def dice_coef_metric(
predictions: np.ndarray, truth: np.ndarray, treshold: float = 0.5, eps: float = 0
) -> np.ndarray:
"""
Calculate Dice score for data batch.
Params:
predictions: model outpu... | [
37811,
9171,
10466,
2393,
37811,
198,
11748,
1822,
29572,
198,
11748,
15095,
198,
11748,
331,
43695,
198,
11748,
33272,
9608,
355,
33272,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
17963,
62,
1073,
891,
62,
4164,
1173,
7,
198,
... | 2.413857 | 2,165 |
from html.parser import HTMLParser
import json
if __name__ == "__main__":
with open('scifi_stackexchange_grams.json', 'w') as f:
munged = []
f.write('[') # evil manual json formatting to save RAM
for idx, post in enumerate(mungePosts()):
if idx > 0:
f.write('... | [
6738,
27711,
13,
48610,
1330,
11532,
46677,
628,
198,
198,
11748,
33918,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
351,
1280,
10786,
1416,
22238,
62,
301,
330,
365,
87,
3803,
62,
4546,
82,
... | 2.063415 | 205 |
"""
Tests module cleft
# Author: Vladan Lucic
# $Id$
"""
from __future__ import unicode_literals
from __future__ import division
#from past.utils import old_div
__version__ = "$Revision$"
from copy import copy, deepcopy
import unittest
#import sys
import numpy
import numpy.testing as np_test
import scipy
from py... | [
37811,
198,
198,
51,
3558,
8265,
1190,
701,
198,
198,
2,
6434,
25,
13080,
272,
7598,
291,
198,
2,
720,
7390,
3,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
7297,
1... | 1.66436 | 31,063 |
"""Creation of dynamic container based on the configuration example."""
from dependency_injector import containers, providers
if __name__ == "__main__":
services_config = {
"user": {
"class": "UserService",
"provider_class": "Factory",
},
"auth": {
"... | [
37811,
12443,
341,
286,
8925,
9290,
1912,
319,
262,
8398,
1672,
526,
15931,
198,
198,
6738,
20203,
62,
259,
752,
273,
1330,
16472,
11,
9549,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
... | 2.615686 | 255 |
from .labelbox_v1 import LBV1Converter
from .ndjson import NDJsonConverter
| [
6738,
764,
18242,
3524,
62,
85,
16,
1330,
22199,
53,
16,
3103,
332,
353,
198,
6738,
764,
358,
17752,
1330,
25524,
41,
1559,
3103,
332,
353,
198
] | 2.777778 | 27 |
from tensorflow.keras import Model
from tensorflow.keras.losses import Loss
from tensorflow import GradientTape
from tensorflow.keras.losses import MeanAbsoluteError
from tensorflow.python.keras.optimizer_v2 import optimizer_v2 | [
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
9104,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
22462,
274,
1330,
22014,
198,
6738,
11192,
273,
11125,
1330,
17701,
1153,
51,
1758,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
... | 3.242857 | 70 |
# =========================================================================
# (c) Copyright 2020
# All rights reserved
# Programs written by Haodi Jiang
# Department of Computer Science
# New Jersey Institute of Technology
# University Heights, Newark, NJ 07102, USA
#
# Permission to use, copy, modify, an... | [
2,
38093,
2559,
198,
2,
220,
220,
357,
66,
8,
15069,
12131,
198,
2,
220,
220,
1439,
2489,
10395,
198,
2,
220,
220,
26179,
3194,
416,
9398,
23130,
32294,
198,
2,
220,
220,
2732,
286,
13851,
5800,
198,
2,
220,
220,
968,
8221,
5136,
... | 2.128529 | 9,173 |
# Copyright 2020 The TensorFlow Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
2,
15069,
12131,
383,
309,
22854,
37535,
46665,
201,
198,
2,
201,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
201,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
... | 2.459163 | 2,008 |
#!/usr/bin/env python3
"""
Entry-point for more power-user options and configuration facades of the
Envprobe tool. This module handles the parsing of command-line arguments
and dispatching the user's request to the submodules.
"""
import argparse
import sys
from commands import get_common_epilogue_or_die
from comman... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
30150,
12,
4122,
329,
517,
1176,
12,
7220,
3689,
290,
8398,
1777,
2367,
286,
262,
198,
4834,
85,
1676,
1350,
2891,
13,
770,
8265,
17105,
262,
32096,
286,
3141,
1... | 2.760263 | 609 |
# Generated by Django 3.2.5 on 2021-07-31 09:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
20,
319,
33448,
12,
2998,
12,
3132,
7769,
25,
2091,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14... | 3.019231 | 52 |
class thingsTelemetry:
"""Declare a thingsboard poster object to interact with ThingsBoard platform"""
querystring = {
"relHumidity" : self.relHumidity,
"envTemperature": self.envTemperature,
"soilMoisture" : self.soilMoisture,
"soilWeight" : self.soilWeight,
"env... | [
4871,
1243,
31709,
41935,
25,
198,
220,
220,
220,
37227,
37835,
533,
257,
1243,
3526,
11968,
2134,
284,
9427,
351,
11597,
29828,
3859,
37811,
628,
220,
220,
220,
12405,
8841,
796,
1391,
220,
198,
220,
220,
220,
220,
220,
220,
220,
366... | 2.441696 | 283 |
"""create
Revision ID: 6741e75df428
Revises: 61632731b77a
Create Date: 2021-06-23 19:19:40.445041
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '6741e75df428'
down_revision = '61632731b77a'
branch_labels = None
depends_on ... | [
37811,
17953,
198,
198,
18009,
1166,
4522,
25,
8275,
3901,
68,
2425,
7568,
40173,
198,
18009,
2696,
25,
718,
24136,
1983,
3132,
65,
3324,
64,
198,
16447,
7536,
25,
33448,
12,
3312,
12,
1954,
678,
25,
1129,
25,
1821,
13,
2598,
1120,
... | 2.590551 | 127 |
#!/usr/bin/env python3
import redis
try:
r = redis.Redis(host='localhost', port=6379, db=0, socket_timeout=3)
if r.set('foo', 'bar') != True:
exit(-1)
if r.get('foo') != b"bar":
exit(-1)
r.close()
except Exception as err:
exit(-1)
else:
exit(0)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
2266,
271,
198,
198,
28311,
25,
198,
220,
220,
220,
374,
796,
2266,
271,
13,
7738,
271,
7,
4774,
11639,
36750,
3256,
2493,
28,
21,
29088,
11,
20613,
28,
15,
11,
17802,
6... | 2.057554 | 139 |
import arrus.ops.us4r
import numpy as np
import arrus.ops
import dataclasses
from collections.abc import Collection
@dataclasses.dataclass(frozen=True)
class SimpleTxRxSequence:
"""
A base class for Lin, PWI and STA sequences.
At most one of the following needs to be specified:
- tx_aperture_center... | [
11748,
5240,
385,
13,
2840,
13,
385,
19,
81,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
5240,
385,
13,
2840,
198,
11748,
4818,
330,
28958,
198,
6738,
17268,
13,
39305,
1330,
12251,
628,
198,
198,
31,
19608,
330,
28958,
13,
19608,... | 2.863023 | 1,409 |
import pandas as pd
import logging
from sklearn.preprocessing import RobustScaler
logger = logging.getLogger('PREPROCESS')
def normalize_data(data: pd.DataFrame, method: str = 'robust'):
"""
Normalize features
:param data: data to be normalized
:param method: method for scaling
:return: normal... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
18931,
198,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
3851,
436,
3351,
36213,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
46437,
4805,
4503,
7597,
11537,
628,
198,
42... | 2.76652 | 227 |
from PyQt4 import QtCore, QtGui
from windowbase import WindowBase
| [
6738,
9485,
48,
83,
19,
1330,
33734,
14055,
11,
33734,
8205,
72,
198,
6738,
4324,
8692,
1330,
26580,
14881,
198
] | 3.3 | 20 |
import logging.config
import os
from AppConfig import broker_config
# configure the logger first
logging.config.fileConfig("logging.conf")
logger = logging.getLogger(__name__)
logger.info("Logger configured successfully")
if __name__ == "__main__":
from WebApp import create_app
app = create_app()
app.ru... | [
11748,
18931,
13,
11250,
198,
11748,
28686,
198,
198,
6738,
2034,
16934,
1330,
20426,
62,
11250,
198,
198,
2,
17425,
262,
49706,
717,
198,
6404,
2667,
13,
11250,
13,
7753,
16934,
7203,
6404,
2667,
13,
10414,
4943,
198,
6404,
1362,
796,
... | 3.071429 | 112 |
import sys
s, n, m = map(int, input().split())
li = []
for line in sys.stdin.readlines():
li += list(map(int, line.split()))
p = v = 0
for i in range(n-1, s-n+1):
if is_peak(i, n):
p += 1
for i in range(m - 1, s - m + 1):
if is_valley(i, m):
v += 1
print(p, v)
| [
11748,
25064,
628,
628,
198,
82,
11,
299,
11,
285,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
4528,
796,
17635,
198,
1640,
1627,
287,
25064,
13,
19282,
259,
13,
961,
6615,
33529,
198,
220,
220,
220,
7649,
15853,
1351,
7,... | 1.993197 | 147 |
# TODO
# show vti all
# show vti sector
# show all sector
# show [vti,ac,qqc.f] sector
# the first word determines the action
# the second word the stocks or list of stocks
# the third word the property in question.
# also important to have is:
# info ac percentage fraction of my portfolio
# info ac shares
#... | [
2,
16926,
46,
198,
198,
2,
905,
410,
20259,
477,
198,
2,
905,
410,
20259,
6567,
198,
2,
905,
477,
6567,
198,
2,
905,
685,
85,
20259,
11,
330,
11,
38227,
66,
13,
69,
60,
6567,
198,
198,
2,
262,
717,
1573,
15947,
262,
2223,
198,... | 3.003953 | 253 |
# -*- coding: utf-8 -*-
#The MIT License (MIT)
#Copyright (c) 2016 Stephen Goveia
##################################
##############################
#
# rules_service
#
##############################
##############################
#
# imports
#
##############################
from data_structures import *
#####... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
464,
17168,
13789,
357,
36393,
8,
198,
2,
15269,
357,
66,
8,
1584,
7970,
402,
659,
544,
198,
29113,
2235,
198,
14468,
7804,
4242,
2235,
198,
2,
198,
2,
220,
220,
... | 3.636364 | 264 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""DualPathNetworks (version 2).
Ported by pretrainedmodels
Based on original MXNet implementation https://github.com/cypw/DPNs with
many ideas from another PyTorch implementation https://github.com/oyam/pytorch-DPNs.
This implementation is compatible with the pretrained... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
36248,
15235,
7934,
5225,
357,
9641,
362,
737,
198,
47,
9741,
416,
2181,
13363,
27530,
198,
198,
15001,
319... | 2.161643 | 2,289 |
# Copyright (c) 2020 - present Vitor Oriel <https://github.com/VitorOriel>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to ... | [
2,
15069,
357,
66,
8,
12131,
532,
1944,
569,
2072,
440,
11719,
1279,
5450,
1378,
12567,
13,
785,
14,
53,
2072,
46,
11719,
29,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,... | 2.212598 | 8,509 |
# A (fast) script that selects the replays for training.
# Also automatically discovers all map hashes and names those maps
# have in the replays. (Useful if you want to train on a different subset of maps)
import sc2reader
from replay_roller import get_names
import shutil
from tqdm import tqdm
from os import path
im... | [
2,
317,
357,
7217,
8,
4226,
326,
40573,
262,
2186,
592,
329,
3047,
13,
220,
198,
2,
4418,
6338,
27472,
477,
3975,
46621,
290,
3891,
883,
8739,
198,
2,
423,
287,
262,
2186,
592,
13,
357,
11041,
913,
611,
345,
765,
284,
4512,
319,
... | 2.639896 | 386 |
'''
Bindings for the 'core' HPI configuration
'''
import re
from typing import Sequence, Optional
from . import warnings, PathIsh, Path
try:
from my.config import core as user_config # type: ignore[attr-defined]
except Exception as e:
try:
from my.config import common as user_config # type: ignore[att... | [
7061,
6,
198,
36180,
654,
329,
262,
705,
7295,
6,
6574,
40,
8398,
198,
7061,
6,
198,
11748,
302,
198,
6738,
19720,
1330,
45835,
11,
32233,
198,
198,
6738,
764,
1330,
14601,
11,
10644,
40,
1477,
11,
10644,
198,
198,
28311,
25,
198,
... | 2.979532 | 684 |
from gurobipy import GRB
from graphilp.network import gen_path_atsp
def create_model(G, direction=GRB.MAXIMIZE, weight='weight', warmstart=[]):
""" Create an ILP for the min/max asymmetric TSP
Uses :py:func:`graphilp.network.gen_path_atsp.create_model` to set up the problem.
:param G: a weighted :py:cla... | [
6738,
915,
22609,
541,
88,
1330,
10863,
33,
198,
6738,
4823,
346,
79,
13,
27349,
1330,
2429,
62,
6978,
62,
1381,
79,
628,
198,
4299,
2251,
62,
19849,
7,
38,
11,
4571,
28,
10761,
33,
13,
22921,
3955,
35400,
11,
3463,
11639,
6551,
3... | 2.757143 | 420 |
from __future__ import division # this changes / to floating division and // to integer division
import struct, os, math, time
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
#######################CONST########################################
BpMB=1048576 #bytes/MB
sizeOfFiles=100 * ... | [
6738,
11593,
37443,
834,
1330,
7297,
1303,
428,
2458,
1220,
284,
12462,
7297,
290,
3373,
284,
18253,
7297,
198,
11748,
2878,
11,
28686,
11,
10688,
11,
640,
198,
28311,
25,
198,
220,
220,
220,
422,
269,
10100,
9399,
1330,
10903,
9399,
... | 2.364882 | 1,606 |
# pylint: disable=R,C
#!/usr/bin/env python3
"""
Author : Nasir Khan (r0ot h3x49)
Github : https://github.com/r0oth3x49
License : MIT
Copyright (c) 2018-2025 Nasir Khan (r0ot h3x49)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t... | [
2,
279,
2645,
600,
25,
15560,
28,
49,
11,
34,
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
198,
13838,
220,
1058,
22767,
343,
11356,
357,
81,
15,
313,
289,
18,
87,
2920,
8,
198,
38,
10060,
220,
105... | 3.274194 | 496 |
# !/usr/bin/env python
# encoding:UTF-8
import re
import os
from setuptools import setup, find_packages
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
def get_version(*file_paths):
"""Retrieves the version from django_fine_uploader/__init_... | [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
48504,
12,
23,
198,
198,
11748,
302,
198,
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
2,
1249,
9058,
13,
9078,
284,
307,
... | 2.499346 | 765 |
from scidb.core import Bucket, DataSet
from typing import Callable, Union
| [
6738,
629,
312,
65,
13,
7295,
1330,
48353,
11,
6060,
7248,
198,
6738,
19720,
1330,
4889,
540,
11,
4479,
628,
198
] | 3.619048 | 21 |
# https://mlfromscratch.com/neural-network-tutorial/#/
# https://github.com/casperbh96/Neural-Network-From-Scratch/blob/master/NN_From_Scratch.ipynb
# https://mlfromscratch.com/neural-networks-explained/#/
#%% load packages and data
from sklearn.datasets import fetch_openml
import numpy as np
from sklearn.model_selec... | [
2,
3740,
1378,
76,
1652,
398,
1416,
36722,
13,
785,
14,
710,
1523,
12,
27349,
12,
83,
44917,
31113,
14,
198,
2,
3740,
1378,
12567,
13,
785,
14,
66,
32981,
34369,
4846,
14,
8199,
1523,
12,
26245,
12,
4863,
12,
3351,
36722,
14,
2436... | 2.416838 | 487 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="startup-generator-api",
version="0.0.1",
author="Mark Miller",
author_email="mark@markmiller.space",
description="A simple api to generate startup company names.",
include_package_data... | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
... | 2.285714 | 350 |
# -*- coding: utf-8 -*-
__author__ = "Paul Schifferer <dm@sweetrpg.com>"
"""
"""
# from flask_rest_jsonapi import Api
from .manager import StudioList, StudioDetail
from ...blueprints import api
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
366,
12041,
41665,
11882,
1279,
36020,
31,
34751,
81,
6024,
13,
785,
24618,
198,
37811,
198,
37811,
198,
198,
2,
422,
42903,
62,
2118,
62,
17752,
... | 2.925373 | 67 |
from PIL import Image
import os
try:
os.mkdir("Result")
except:
print("create Result Error")
ld = os.listdir()
ld = [x for x in ld if x[-4:] in (".png",".PNG")]
for i in ld:
f = Image.open(i)
f.save("./Result/"+i,compress_level = 0)
f.close() | [
6738,
350,
4146,
1330,
7412,
198,
11748,
28686,
198,
28311,
25,
198,
197,
418,
13,
28015,
15908,
7203,
23004,
4943,
198,
16341,
25,
198,
197,
4798,
7203,
17953,
25414,
13047,
4943,
198,
335,
796,
28686,
13,
4868,
15908,
3419,
198,
335,
... | 2.287037 | 108 |
from manimlib.imports import * | [
6738,
582,
320,
8019,
13,
320,
3742,
1330,
1635
] | 3.333333 | 9 |
"""Routing algorithms."""
from .astar import *
from .mospp import *
| [
37811,
49,
13660,
16113,
526,
15931,
198,
6738,
764,
459,
283,
1330,
1635,
198,
6738,
764,
16785,
381,
1330,
1635,
198
] | 3.238095 | 21 |
################################################################################
# breakpoint pair detection and filtering
################################################################################
#------------------------------------------------------------------------------#
import pysam
import re
import numpy... | [
29113,
29113,
14468,
198,
2,
2270,
4122,
5166,
13326,
290,
25431,
198,
29113,
29113,
14468,
198,
2,
10097,
26171,
2,
198,
11748,
279,
893,
321,
198,
11748,
302,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
... | 2.317364 | 3,611 |
# -*- coding: utf-8 -*-
__version__ = '1.0.0'
default_app_config = 'layouter.apps.LayouterConfig'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9641,
834,
796,
705,
16,
13,
15,
13,
15,
6,
198,
12286,
62,
1324,
62,
11250,
796,
705,
10724,
39605,
13,
18211,
13,
23763,
39605,
16934,
6,
198
] | 2.27907 | 43 |
import shlex
from .subcommand import SubcommandBaseWithWorkspaceReadLock, register_subcommand
from ..models.reference import Reference
TARGET_TEMPLATE = """\
{reference}
ENVIRONMENT: {environment}
COMMANDLINE: {command}\
"""
register_subcommand(TargetSubcommand())
| [
11748,
427,
2588,
198,
198,
6738,
764,
7266,
21812,
1330,
3834,
21812,
14881,
3152,
23044,
10223,
5569,
25392,
11,
7881,
62,
7266,
21812,
198,
6738,
11485,
27530,
13,
35790,
1330,
20984,
198,
198,
51,
46095,
62,
51,
3620,
6489,
6158,
79... | 3.229885 | 87 |
# rarfile.py
#
# Copyright (c) 2005-2010 Marko Kreen <markokr@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | [
2,
374,
283,
7753,
13,
9078,
198,
2,
198,
2,
15069,
357,
66,
8,
5075,
12,
10333,
220,
2940,
78,
509,
1361,
1279,
4102,
482,
81,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
2448,
3411,
284,
779,
11,
4866,
11,
13096,
11,
290,
14,
... | 2.217295 | 8,141 |
from sanic import Sanic
from sanic.response import html
app = Sanic()
@app.route('/')
@app.route('/<i:number>')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000)
| [
6738,
5336,
291,
1330,
2986,
291,
198,
6738,
5336,
291,
13,
26209,
1330,
27711,
198,
198,
1324,
796,
2986,
291,
3419,
198,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
198,
198,
31,
1324,
13,
38629,
10786,
14,
27,
72,
25,
17618,
29,
... | 2.316456 | 79 |
"""Map Filter Zip List Comprehensions
Higher order
""" | [
37811,
13912,
25853,
38636,
7343,
3082,
7345,
507,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16038,
1502,
198,
37811
] | 2.75 | 24 |
# -*- coding: utf-8 -*-
'''
Integration tests for timezone module
Only Linux is supported for the mement
'''
# Import python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
i... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
34500,
1358,
5254,
329,
640,
11340,
8265,
198,
198,
10049,
7020,
318,
4855,
329,
262,
285,
972,
198,
7061,
6,
198,
198,
2,
17267,
21015,
9195,
82,
198,
... | 3.096296 | 135 |
import os
import tempfile
import unittest
from tensorflow import keras
from tfaip.util.tfaipargparse import post_init
from calamari_ocr.ocr.dataset.datareader.file import FileDataParams
from calamari_ocr.ocr.scenario import CalamariEnsembleScenario
from calamari_ocr.scripts.train import main
from calamari_ocr.test.ca... | [
11748,
28686,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
198,
198,
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
6738,
256,
13331,
541,
13,
22602,
13,
83,
13331,
541,
853,
29572,
1330,
1281,
62,
15003,
198,
198,
6738,
35765,
... | 2.94382 | 178 |
a = 1
b =2
| [
64,
796,
352,
198,
65,
796,
17,
198
] | 1.375 | 8 |
# -*- coding: utf-8 -*-
#
# title: Odds of Event Conversion to Probability
# description: This function provides the implied probability for a given event
# parameters:
# odds: odds of event
# category: type of odds
# 'us', American Odds
# 'dec', Decimal Odds
# 'frac', Fractional Odds
# return... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
220,
198,
2,
3670,
25,
20664,
82,
286,
8558,
44101,
284,
30873,
1799,
198,
2,
6764,
25,
770,
2163,
3769,
262,
17142,
12867,
329,
257,
1813,
1785,
198,
2,
10007,
2... | 2.739362 | 188 |
import os
import sys
import csv
import glob
import nltk
import string
import pandas as pd
import numpy as np
nltk.download('punkt')
nltk.download('stopwords')
from many_stop_words import get_stop_words
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem.snowball import SnowballSt... | [
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
269,
21370,
198,
11748,
15095,
198,
11748,
299,
2528,
74,
198,
11748,
4731,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
77,
2528,
74,
13,
15002,
... | 2.555963 | 1,090 |
num = int(input("Digite um numero: "))
if num < 15:
print("Menor que 15")
elif num < 20:
print("Menor que 20")
else:
print("Ola")
| [
22510,
796,
493,
7,
15414,
7203,
19511,
578,
23781,
997,
3529,
25,
366,
4008,
198,
198,
361,
997,
1279,
1315,
25,
198,
220,
220,
220,
3601,
7203,
10418,
273,
8358,
1315,
4943,
198,
417,
361,
997,
1279,
1160,
25,
198,
220,
220,
220,
... | 2.269841 | 63 |
# -*- coding: utf-8 -*-
"""
==============================================================================
@author: Nikolaos Giakoumoglou
@date: Thu May 20 18:37:25 2021
@reference: Hu, Visual Pattern Recognition by Moment Invariants
==============================================================================
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
23926,
25609,
855,
201,
198,
31,
9800,
25,
47817,
418,
8118,
461,
280,
76,
28678,
280,
201,
198,
31,
4475,
25,
26223,
1737,
1160,
1248,
25,
2718,... | 2.69258 | 283 |
"""
A lot of non-tensorflow implementation. This is mainly used for testing.
"""
import argparse
import math
import numpy as np
def neg_log_sigmoid(x):
"""Negative log sigmoid"""
return -math.log(1 / (1 + math.exp(-x)))
def compute_dcg_power2(y_score, y_true, topk):
"""Computes dcg with relevance score... | [
37811,
198,
32,
1256,
286,
1729,
12,
83,
22854,
11125,
7822,
13,
220,
770,
318,
8384,
973,
329,
4856,
13,
198,
37811,
198,
11748,
1822,
29572,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
2469,
62,
6404,
62,
... | 2.136986 | 1,752 |
import FWCore.ParameterSet.Config as cms
from IOMC.EventVertexGenerators.VtxSmearedParameters_cfi import NominalCollision4VtxSmearingParameters,VtxSmearedCommon
VtxSmeared = cms.EDProducer("BetafuncEvtVtxGenerator",
NominalCollision4VtxSmearingParameters,
VtxSmearedCommon
)
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
314,
2662,
34,
13,
9237,
13414,
16886,
8645,
2024,
13,
53,
17602,
50,
1326,
1144,
48944,
62,
66,
12463,
1330,
21198,
1292,
22667,
1166,
19,
53,
17602,
755... | 2.759615 | 104 |
previous_answer = [1] * 10
next_answer = previous_answer
if __name__ == '__main__':
N = int(input())
solve(N)
print(sum(next_answer) % 10007)
| [
3866,
1442,
62,
41484,
796,
685,
16,
60,
1635,
838,
198,
19545,
62,
41484,
796,
2180,
62,
41484,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
399,
796,
493,
7,
15414,
28955,
198,
220,
... | 2.378788 | 66 |
from ebooklib import epub
from cj.bookmaker import BookMaker, Book
from cj.bookmaker.add_title import add_title
from cj.utils.exceptions import IncorrectFormatException
from cj.utils.naming import get_file_name
| [
6738,
47179,
8019,
1330,
2462,
549,
198,
6738,
269,
73,
13,
2070,
10297,
1330,
4897,
48890,
11,
4897,
198,
6738,
269,
73,
13,
2070,
10297,
13,
2860,
62,
7839,
1330,
751,
62,
7839,
198,
6738,
269,
73,
13,
26791,
13,
1069,
11755,
1330... | 3.349206 | 63 |
from lino.projects.std.settings import *
SITE = Site(globals())
# your local settings here
DEBUG = True
| [
6738,
300,
2879,
13,
42068,
13,
19282,
13,
33692,
1330,
1635,
628,
198,
50,
12709,
796,
14413,
7,
4743,
672,
874,
28955,
198,
198,
2,
534,
1957,
6460,
994,
198,
198,
30531,
796,
6407,
198
] | 3.085714 | 35 |
import os
import signal
import traceback
from time import sleep
from multiprocessing import Process
import asyncio
from asyncio.subprocess import PIPE, create_subprocess_shell
from django.conf import settings
from core import consts
from core import models
import core.datatools.ansible
| [
11748,
28686,
198,
11748,
6737,
198,
11748,
12854,
1891,
198,
6738,
640,
1330,
3993,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
198,
11748,
30351,
952,
198,
6738,
30351,
952,
13,
7266,
14681,
1330,
350,
4061,
36,
11,
2251,
62,
7266,
... | 3.815789 | 76 |
import json
import toml
from flask import Flask, request, redirect, render_template
import requests
from urllib.parse import quote
app = Flask('authentication')
@app.route('/')
@app.route('/callback/q')
@app.route('/synchro')
| [
11748,
33918,
198,
11748,
284,
4029,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
18941,
11,
8543,
62,
28243,
198,
11748,
7007,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
9577,
198,
198,
1324,
796,
46947,
10786,
41299,
3299,
11537,
628... | 3.105263 | 76 |
from pyzabbix import ZabbixMetric, ZabbixSender
from pyzabbix.api import ZabbixAPI
import os
import json
# --- config acesso
# --- Hostname
# --- sendMetrica
# --- main
# --- inicio
if __name__ == "__main__":
main()
| [
6738,
12972,
89,
6485,
844,
1330,
1168,
6485,
844,
9171,
1173,
11,
1168,
6485,
844,
50,
2194,
198,
6738,
12972,
89,
6485,
844,
13,
15042,
1330,
1168,
6485,
844,
17614,
198,
198,
11748,
28686,
198,
11748,
33918,
628,
198,
2,
11420,
456... | 2.531915 | 94 |
import pygame
import sys
import time
# https://www.pygame.org/docs/ref/pygame.html
# https://shop.sb-components.co.uk/blogs/piarm-lessons/lesson-3-controlling-using-joystick
pygame.init()
pygame.joystick.init()
if pygame.joystick.get_count() == 0:
print("No joystics were found")
sys.exit()
joy = pygame.joy... | [
11748,
12972,
6057,
198,
11748,
25064,
198,
11748,
640,
198,
198,
2,
3740,
1378,
2503,
13,
9078,
6057,
13,
2398,
14,
31628,
14,
5420,
14,
9078,
6057,
13,
6494,
198,
2,
3740,
1378,
24643,
13,
36299,
12,
5589,
3906,
13,
1073,
13,
2724... | 2.410042 | 478 |
import getpass
import logging
import os
import pathlib
import re
import sys
import sh
from cached_property import cached_property
from kubeyard import settings
logger = logging.getLogger(__name__)
| [
11748,
651,
6603,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
302,
198,
11748,
25064,
198,
198,
11748,
427,
198,
198,
6738,
39986,
62,
26745,
1330,
39986,
62,
26745,
198,
198,
6738,
479,
549,
2959,
446,
133... | 3.416667 | 60 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('app/', views.app_view, name='app_view'),
path('api/', views.api_view_with_token, name='api'),
path('api/<date_from>/<date_to>', views.api_view_with_token, name='api_periodo'),
path('api/v2/'... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
9630,
11,
1438,
11639,
9630,
33809,
198,
220,
220,
220,
3108,
10786,
... | 2.462963 | 594 |
import twitter
import json
if __name__ == "__main__":
main()
| [
11748,
17044,
198,
11748,
33918,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.72 | 25 |
from django import template
register = template.Library()
def user_has_approved(project, user):
"""Has the given User already approved the given Project"""
return project.approvals.filter(by=user).exists()
@register.simple_tag
@register.simple_tag
@register.simple_tag
| [
6738,
42625,
14208,
1330,
11055,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
4299,
2836,
62,
10134,
62,
29137,
7,
16302,
11,
2836,
2599,
198,
220,
220,
220,
37227,
19242,
262,
1813,
11787,
1541,
6325,
262,
1813,
4935,
37811,... | 3.364706 | 85 |
import decoder
def decode(instruction):
'''Extract the modrm tuple out of the provided instruction'''
modrm = instruction[2]
if len(modrm) > 0:
modrm = decoder.decodeInteger(modrm)
return decoder.extractsib(modrm)
return None
extract = decode
reg_index = {
0 : 'eax', 1 : 'ecx', 2 :... | [
11748,
875,
12342,
198,
198,
4299,
36899,
7,
8625,
2762,
2599,
198,
220,
220,
220,
705,
7061,
11627,
974,
262,
953,
26224,
46545,
503,
286,
262,
2810,
12064,
7061,
6,
198,
220,
220,
220,
953,
26224,
796,
12064,
58,
17,
60,
198,
220,... | 2.169565 | 230 |
"""Test the Data Collection Engine."""
import pytest
from engine import emulate
from engine.models.engine import DataEngine
class TestEngine(object):
"""Define Tests."""
@pytest.mark.functional
def test_reschedule(self):
"""Test Rescheduling a Resource."""
config = {
"data_p... | [
37811,
14402,
262,
6060,
12251,
7117,
526,
15931,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
3113,
1330,
33836,
198,
6738,
3113,
13,
27530,
13,
18392,
1330,
6060,
13798,
628,
198,
4871,
6208,
13798,
7,
15252,
2599,
198,
220,
220,
220... | 2.422918 | 3,639 |
import os
import sys
from setuptools import setup
# version checking derived from https://github.com/levlaz/circleci.py/blob/master/setup.py
from setuptools.command.install import install
VERSION = '0.5.0'
TAG_ENV_VAR = 'CIRCLE_TAG'
with open("README.md", "r") as fh:
long_description = fh.read()
class VerifyVer... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
2,
2196,
10627,
10944,
422,
3740,
1378,
12567,
13,
785,
14,
2768,
75,
1031,
14,
45597,
979,
13,
9078,
14,
2436,
672,
14,
9866,
14,
40406,
13,
9078,
198,
... | 2.475667 | 637 |
import random
import pandas as pd
import numpy as np
from faker import Faker
transition_matrix=pd.read_csv('transition_matrix.csv')
transition_matrix=transition_matrix.set_index('before')
class Customer:
"""
a single customer that moves through the supermarket in a MCMC simulation.
new line
"""
... | [
11748,
4738,
220,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
277,
3110,
1330,
376,
3110,
198,
198,
7645,
653,
62,
6759,
8609,
28,
30094,
13,
961,
62,
40664,
10786,
7645,
653,
62,
6759,
8609,
... | 2.485294 | 952 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import setup
def main():
'''main setup scripts.'''
setup.main()
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
9058,
198,
198,
4299,
1388,
33529,
198,
220,
705,
7061,
12417,
9058,
14750,
2637,
7061,
198,
220,
9058,
13,
12417,... | 2.403226 | 62 |
import common_data
import re
# Establishment of custom TNSDL tokenizer.
scanner = re.Scanner([
(r"[\w_]\w*|\?", s_ident),
(r"\d+\.\d*", s_float),
(r"\d+x\d*", s_hex),
(r"/\*|\*/|//", s_comment),
(r"\d+", s_int),
(r"==|>=|<=|>(?![>=])|<(?![<=])|/=|&(?!=)|%(?!=)|&&|!|<<(?!=)|>>(?!=)", s_logic_operator),
(r"\+(?!=)|-(?!... | [
198,
11748,
2219,
62,
7890,
198,
11748,
302,
198,
198,
2,
37132,
286,
2183,
309,
8035,
19260,
11241,
7509,
13,
198,
35836,
1008,
796,
302,
13,
33351,
1008,
26933,
198,
7,
81,
17912,
59,
86,
62,
60,
59,
86,
9,
91,
59,
35379,
264,
... | 1.777202 | 386 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import logging
import os
import time
import requests
from email_notification import email_notification
from settings import settings
# LOGGING -------------------------------------------------------------------
filename = "logfile.log"
hand... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
11748,
4818,
8079,
201,
198,
11748,
18931,
201,
198,
11748,
28686,
201,
198,
11748,
640,
201,
198,
201,
... | 2.307631 | 1,258 |
#! /usr/bin/env python
#-*- coding: utf-8 -*-
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Shelter Database.
# Copyright (c) 2016 Luxembourg Institute of Science and Technology.
# All rights reserved.
#
#
#
# ***** END LICENSE BLOCK *****
__author__ = "Cedric Bonhomme"
__version__ = "$Revision: 0.1 $"
__d... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
25998,
9,
347,
43312,
38559,
24290,
9878,
11290,
25998,
9,
198,
2,
770,
2393,
318,
636,
286,
36507,
24047,
... | 2.972973 | 222 |
import smart_imports
smart_imports.all()
| [
198,
11748,
4451,
62,
320,
3742,
198,
198,
27004,
62,
320,
3742,
13,
439,
3419,
628
] | 2.75 | 16 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import httplib, urllib
try:
import json
except:
import simplejson as json
import socket
import re
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
11748,
1841,
489,
571,
11,
2956,
297,
571,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
33918,
198,
16341,
25,
19... | 2.478873 | 71 |
from django.conf.urls import url
from .views import (
plot_views,
trial_yield_views,
treatment_views,
)
# Treatment URLs
urlpatterns = [
url(
r'^treatment/$',
treatment_views['TreatmentListAPIView'].as_view(),
name='treatment_list'
),
url(
r'^treatment/create/$',... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
764,
33571,
1330,
357,
198,
220,
220,
220,
7110,
62,
33571,
11,
198,
220,
220,
220,
4473,
62,
88,
1164,
62,
33571,
11,
198,
220,
220,
220,
3513,
62,
33571,
11,
1... | 1.96662 | 719 |
#
# This file is part of BDC-Auth-Client.
# Copyright (C) 2019-2020 INPE.
#
# BDC-Auth-Client is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
"""Decorators used to integrate with BDC-Auth Provider."""
from functools import wraps
im... | [
2,
198,
2,
770,
2393,
318,
636,
286,
347,
9697,
12,
30515,
12,
11792,
13,
198,
2,
15069,
357,
34,
8,
13130,
12,
42334,
3268,
11401,
13,
198,
2,
198,
2,
347,
9697,
12,
30515,
12,
11792,
318,
1479,
3788,
26,
345,
460,
17678,
4163,... | 2.897216 | 467 |
from .randomize_template import RandomizeTemplate | [
6738,
764,
25120,
1096,
62,
28243,
1330,
14534,
1096,
30800
] | 4.9 | 10 |
#External imports
import sys
#Project internal imports
import utils
'''
DFS function. Pure backtracking
# map = map with a start for the robot
# covered = paths already covered by robot
# idx = actual position
'''
'''
Function to create an empty matrix
# x = size of lines
# y = column size
'''
'''
Print the li... | [
2,
41506,
17944,
198,
11748,
25064,
198,
198,
2,
16775,
5387,
17944,
198,
11748,
3384,
4487,
198,
198,
7061,
6,
198,
8068,
50,
2163,
13,
17129,
736,
36280,
198,
2,
3975,
220,
197,
197,
28,
3975,
351,
257,
923,
329,
262,
9379,
198,
... | 3.110345 | 145 |
#!/usr/bin/env python
"""
This file is part of the package FUNtoFEM for coupled aeroelastic simulation
and design optimization.
Copyright (C) 2015 Georgia Tech Research Corporation.
Additional copyright (C) 2015 Kevin Jacobson, Jan Kiviaho and Graeme Kennedy.
All rights reserved.
FUNtoFEM is licensed under the Apache... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
1212,
2393,
318,
636,
286,
262,
5301,
29397,
1462,
37,
3620,
329,
18064,
257,
3529,
417,
3477,
18640,
198,
392,
1486,
23989,
13,
198,
198,
15269,
357,
34,
8,
1853,
7859,
... | 2.43163 | 2,055 |
import datetime as dt
from flask_restx import Resource, Namespace, reqparse
from api_v1 import privilege_required
import requests as req
import config as conf
from models.economy.periods import get_dates_month_period
api = Namespace("periods", path="/economy/periods", description="Get previous, current or historical e... | [
11748,
4818,
8079,
355,
288,
83,
198,
6738,
42903,
62,
2118,
87,
1330,
20857,
11,
28531,
10223,
11,
43089,
29572,
198,
6738,
40391,
62,
85,
16,
1330,
11941,
62,
35827,
198,
11748,
7007,
355,
43089,
198,
11748,
4566,
355,
1013,
198,
67... | 3.442529 | 522 |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# VulnerableCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/vulnerablecode for support or download.
# See https://aboutcode.org for mor... | [
2,
198,
2,
15069,
357,
66,
8,
497,
87,
33,
3457,
13,
290,
1854,
13,
1439,
2489,
10395,
13,
198,
2,
569,
38828,
10669,
318,
257,
16028,
286,
497,
87,
33,
3457,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
1... | 2.511958 | 2,467 |
from .threesplit import threesplit
| [
6738,
764,
400,
6037,
489,
270,
1330,
294,
6037,
489,
270,
198
] | 2.916667 | 12 |
# noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(x: int, y: int):
"""
Accepts two positive int arguments and returns the sum.
The magnitude of both integers must be less than 100.
:param x: first positive integer to sum
:param y: second positive integer to sum
"""
assert... | [
2,
645,
1040,
14978,
9485,
27447,
278,
39582,
1040,
11,
20519,
3118,
1484,
14565,
628,
198,
4299,
24061,
7,
87,
25,
493,
11,
331,
25,
493,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
21699,
82,
734,
3967,
493,
7159,
290,
... | 2.857143 | 203 |
n = int(input())
if n <= 2:
print(1)
else:
f_of_n = 1
f_of_n_1 = 1
for i in range(3, n+1):
temp = f_of_n_1
f_of_n_1 = f_of_n_1 + f_of_n
f_of_n = temp
print(f_of_n_1)
| [
77,
796,
493,
7,
15414,
28955,
198,
361,
299,
19841,
362,
25,
198,
220,
220,
220,
3601,
7,
16,
8,
198,
17772,
25,
198,
220,
220,
220,
277,
62,
1659,
62,
77,
796,
352,
198,
220,
220,
220,
277,
62,
1659,
62,
77,
62,
16,
796,
3... | 1.521739 | 138 |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
1946,
12,
5304,
4946,
27470,
12052,
198,
2,
15069,
2864,
968,
20650,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,... | 2.343497 | 1,607 |
import markovify
import spacy
from spacy.lang.en.examples import sentences
# Get raw text as string.
with open('poems_data.txt', errors='ignore') as f:
text = f.read()
# Naive Build the model.
# text_model = markovify.Text(text)
# building MARKOV chains
# redefine the marovify class using spacy to build bette... | [
11748,
1317,
709,
1958,
198,
11748,
599,
1590,
198,
6738,
599,
1590,
13,
17204,
13,
268,
13,
1069,
12629,
1330,
13439,
198,
198,
2,
3497,
8246,
2420,
355,
4731,
13,
198,
4480,
1280,
10786,
7501,
5232,
62,
7890,
13,
14116,
3256,
8563,
... | 3.082759 | 145 |
from typing import Dict, List
import requests
from .base import ApiBase
class ParserExample:
""" Implementation of parsers for ApiExample """
# Parser class implements the data parsers (i.e. methods that take
# raw data, json data, obfuscated data return them in an organized form)
# Parser retrun ... | [
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
11748,
7007,
198,
198,
6738,
764,
8692,
1330,
5949,
72,
14881,
628,
198,
4871,
23042,
263,
16281,
25,
198,
220,
220,
220,
37227,
46333,
286,
13544,
364,
329,
5949,
72,
16281,
37227,
628... | 2.404313 | 742 |
import json
import numpy as np
import os
import pandas as pd
import urllib2 | [
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2956,
297,
571,
17
] | 3.125 | 24 |