content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Tools
http://en.wikipedia.org/wiki/Haversine_formula
ToDo: ToFix / ToTest
"""
import math
def waypoint_bearing(lat1, lon1, lat2, lon2):
"""
Calculates the bearing between 2 locations.
Method calculates the bearing between 2 locations.
@param lon1 ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
33637,
628,
198,
4023,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
23303,
690,
500,
62,
687,
4712,
19... | 2.321014 | 947 |
from django.shortcuts import render, redirect, render_to_response
from django.template.context import RequestContext
from account.views import login
from models import Course
from website.views import index
from forms import CourseForm, CourseInitialForm
from account.util import createImage
from django.core.context_pro... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
11,
8543,
62,
1462,
62,
26209,
198,
6738,
42625,
14208,
13,
28243,
13,
22866,
1330,
19390,
21947,
198,
6738,
1848,
13,
33571,
1330,
17594,
198,
6738,
4981,
1330,
20537,
198,
6... | 4.26087 | 207 |
from rx.core import ObservableBase, AnonymousObservable, typing
from rx.disposables import CompositeDisposable, \
SingleAssignmentDisposable, SerialDisposable
def delay_with_selector(self, subscription_delay=None,
delay_duration_mapper=None) -> ObservableBase:
"""Time shifts the observ... | [
6738,
374,
87,
13,
7295,
1330,
19243,
540,
14881,
11,
19200,
31310,
712,
540,
11,
19720,
198,
6738,
374,
87,
13,
6381,
1930,
2977,
1330,
49355,
7279,
1930,
540,
11,
3467,
198,
220,
220,
220,
14206,
8021,
16747,
7279,
1930,
540,
11,
... | 2.818594 | 441 |
# Testing these to see if they are palindromes
test_cases = ["A man, a plan, a canal -- Panama", "racecar", "broncos"]
| [
2,
23983,
777,
284,
766,
611,
484,
389,
6340,
521,
398,
274,
198,
9288,
62,
33964,
796,
14631,
32,
582,
11,
257,
1410,
11,
257,
29365,
1377,
23519,
1600,
220,
366,
16740,
7718,
1600,
366,
65,
1313,
6966,
8973,
198,
220,
220,
220,
... | 2.818182 | 44 |
#!/usr/bin/env python3
import hash_framework as hf
hf.config.model_dir = "/home/cipherboy/GitHub/sat/sat-competition-2018/models"
import time, sys, os, random
run = False
release = False
if '--run' in sys.argv:
run = True
if '--release' in sys.argv:
release = True
if '-h' in sys.argv or '--help' in sys.argv:... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
12234,
62,
30604,
355,
289,
69,
198,
71,
69,
13,
11250,
13,
19849,
62,
15908,
796,
12813,
11195,
14,
66,
10803,
7081,
14,
38,
270,
16066,
14,
49720,
14,
49720,
12,
... | 2.602041 | 392 |
import os
import datetime
import xxhash
import json
from flask_sqlalchemy import SQLAlchemy
from methinks.utils import str_to_date
from methinks.config import get_default_conf
db = SQLAlchemy()
def to_file(self, folderpath):
path = os.path.join(folderpath, self.filename)
with open(path, 'w') as... | [
11748,
28686,
198,
11748,
4818,
8079,
198,
11748,
31383,
17831,
198,
11748,
33918,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
198,
6738,
11248,
2973,
13,
26791,
1330,
965,
62,
1462,
62,
4475,
198,
6738,
11248,... | 2.62963 | 135 |
import functools
now()
today()
print(today.__name__)
| [
11748,
1257,
310,
10141,
198,
198,
2197,
3419,
198,
198,
40838,
3419,
198,
198,
4798,
7,
40838,
13,
834,
3672,
834,
8,
198
] | 2.434783 | 23 |
'''
point clouds estimation: transfer sparse map to dense map,
work for both depth and reflectance.
'''
import sys
sys.path.append("..")
from utils import data_provider
from utils import velo_2_cam
import numpy as np
# fetch image and point clouds: coordinates and reflectance
# project points on the image plane
de... | [
7061,
6,
198,
4122,
15114,
31850,
25,
4351,
29877,
3975,
284,
15715,
3975,
11,
198,
1818,
329,
1111,
6795,
290,
4079,
590,
13,
198,
7061,
6,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
492,
4943,
198,
6738,
3384,
4487,
... | 2.57754 | 374 |
from ogle.code_generator.code_generator import CodeGenerator
from ogle.lexer.lexer import Lexer
from ogle.parser.parser import Parser
from ogle.semantic_analyzer.semantic_analyzer import SemanticAnalyzer
| [
6738,
267,
70,
293,
13,
8189,
62,
8612,
1352,
13,
8189,
62,
8612,
1352,
1330,
6127,
8645,
1352,
198,
6738,
267,
70,
293,
13,
2588,
263,
13,
2588,
263,
1330,
17210,
263,
198,
6738,
267,
70,
293,
13,
48610,
13,
48610,
1330,
23042,
2... | 3.044776 | 67 |
# !depth first search !dfs !graph
# dict of nodes as the key and sets for the edges(children)
graph = {'A': set(['B', 'C', 'D']),
'B': set(['E', 'F']),
'C': set([]),
'D': set(['G', 'H']),
'E': set([]),
'F': set(['I', 'J']),
'G': set(['K']),
'H': set([]),
'I': set([]),
'J': set([]),
'K': ... | [
2,
5145,
18053,
717,
2989,
5145,
7568,
82,
5145,
34960,
198,
198,
2,
8633,
286,
13760,
355,
262,
1994,
290,
5621,
329,
262,
13015,
7,
17197,
8,
220,
198,
34960,
796,
1391,
6,
32,
10354,
900,
7,
17816,
33,
3256,
705,
34,
3256,
705,... | 2.529412 | 238 |
from django import forms
| [
6738,
42625,
14208,
1330,
5107,
198
] | 4.166667 | 6 |
#!/usr/bin/env python
"""Extract paired read names from FASTQ file(s).
The input file should be a valid FASTQ file(s), the output is two tabular
files - the paired read names (without suffixes), and unpaired read names
(including any unrecognised pair names).
Note that the FASTQ variant is unimportant (Sanger, Solexa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
11627,
974,
20312,
1100,
3891,
422,
376,
11262,
48,
2393,
7,
82,
737,
198,
198,
464,
5128,
2393,
815,
307,
257,
4938,
376,
11262,
48,
2393,
7,
82,
828,
262,
5072,
318,
734,
... | 2.168806 | 2,103 |
from loguru import logger
import yaml
import time
import pyaudio
import struct
import os
import sys
from vosk import Model, SpkModel, KaldiRecognizer
import json
import text2numde
from TTS import Voice
import multiprocessing
CONFIG_FILE = "config.yml"
SAMPLE_RATE = 16000
FRAME_LENGTH = 512
if __name__ == '__main_... | [
6738,
2604,
14717,
1330,
49706,
198,
11748,
331,
43695,
198,
11748,
640,
198,
11748,
12972,
24051,
198,
11748,
2878,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
410,
418,
74,
1330,
9104,
11,
1338,
74,
17633,
11,
509,
37566,
66... | 2.7875 | 160 |
# coding: utf-8
# # Dictionaries (2)
# In the last lesson we saw how to create dictionaries and how to access the different items in a dictionary by their key. We also saw how to add to and update the items in a dictionary using assignment, or the <code>dict.update()</code> method, and how to delete items using the... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
360,
2867,
3166,
357,
17,
8,
198,
198,
2,
554,
262,
938,
11483,
356,
2497,
703,
284,
2251,
48589,
3166,
290,
703,
284,
1895,
262,
1180,
3709,
287,
257,
22155,
416,
511,
199... | 3.37403 | 1,417 |
#!/usr/bin/env python
import rospy
import numpy as np
from scipy.spatial import KDTree
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
import math
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
As men... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
686,
2777,
88,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
2777,
34961,
1330,
509,
24544,
631,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
2558,... | 3.395062 | 324 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-03-09 10:31
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
23,
319,
2177,
12,
3070,
12,
2931,
838,
25,
3132,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
19... | 2.719298 | 57 |
# this file is needed for python2, delete for python3 | [
2,
428,
2393,
318,
2622,
329,
21015,
17,
11,
12233,
329,
21015,
18
] | 4.076923 | 13 |
"""
TODO write this
"""
import marshmallow_dataclass as md
from sqlalchemy import orm
from originexample import logger
from originexample.db import inject_session
from originexample.tasks import celery_app, lock
from originexample.auth import User, UserQuery
from originexample.consuming import (
GgoConsumerControl... | [
37811,
198,
51,
3727,
46,
3551,
428,
198,
37811,
198,
11748,
22397,
42725,
62,
19608,
330,
31172,
355,
45243,
198,
6738,
44161,
282,
26599,
1330,
393,
76,
198,
198,
6738,
1796,
500,
87,
1403,
1330,
49706,
198,
6738,
1796,
500,
87,
140... | 2.376494 | 502 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `spliceai_wrapper` package."""
import pytest # noqa
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
4600,
22018,
501,
1872,
62,
48553,
63,
5301,
526,
15931,
198,
198,
11748,
12972,
9288,
220,
1303,... | 2.404255 | 47 |
import argparse
import logging
import os
import pathlib
from typing import Union
logger = logging.getLogger(__name__)
def run(somearg) -> int:
"""Run app"""
try:
print(f'Some exciting argument: {somearg}')
except RuntimeError as ex:
logger.error(ex)
return 1
return 0
| [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
3108,
8019,
198,
6738,
19720,
1330,
4479,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4299,
1057,
7,
82,
296,
451,
70,
... | 2.524194 | 124 |
import os
import sys
import time
import atomac
import subprocess
if len(sys.argv) < 2:
print "Usage: bouncer.py <path_to_logic_project> (<path_to_logic_project>)"
os.exit(1)
bundleId = 'com.apple.logic10'
for project in sys.argv[1:]:
projectName = project.split('/')[-1].replace('.logicx', '')
filename... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
22037,
330,
198,
11748,
850,
14681,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
1279,
362,
25,
198,
220,
220,
220,
3601,
366,
28350,
25,
31283,
2189,
13,
9078,
1279,
... | 2.404959 | 1,936 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import colorama
colorama.init(autoreset=True)
logData = {
'': 'Location',
'': '',
'': '',
'': '',
'': '37.2',
'': '',
'': '',
}
def log_line(dic: dict, color=True):
'''
log
#### Parameters::
dic: log dict... | [
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,
4818,
8079,
198,
11748,
3124,
1689,
198,
198,
8043,
1689,
13,
15003,
7,
2306,
382,
2617,
28,
17821,
8... | 2.050293 | 1,193 |
import json
import glob
groupPost = glob.glob("rawData/*/*/*.json")
pagePost = glob.glob("rawData/*/*.json")
groupPagePost = groupPost + pagePost
for postFile in groupPagePost:
with open(postFile, "r", encoding="utf-8") as f:
valid = is_json(f)
if not valid:
print(postFile)
| [
11748,
33918,
198,
11748,
15095,
198,
198,
8094,
6307,
796,
15095,
13,
4743,
672,
7203,
1831,
6601,
15211,
15211,
15211,
13,
17752,
4943,
198,
7700,
6307,
796,
15095,
13,
4743,
672,
7203,
1831,
6601,
15211,
15211,
13,
17752,
4943,
198,
... | 2.429688 | 128 |
from otree.api import (
models,
widgets,
BaseConstants,
BaseSubsession,
BaseGroup,
BasePlayer,
Currency as c,
currency_range,
)
author = 'Daniel Parra'
doc = """
Consent
"""
| [
6738,
267,
21048,
13,
15042,
1330,
357,
198,
220,
220,
220,
4981,
11,
198,
220,
220,
220,
40803,
11,
198,
220,
220,
220,
7308,
34184,
1187,
11,
198,
220,
220,
220,
7308,
7004,
29891,
11,
198,
220,
220,
220,
7308,
13247,
11,
198,
2... | 2.393258 | 89 |
import pytest
import backend as F
if F._default_context_str == 'cpu':
parametrize_dtype = pytest.mark.parametrize("idtype", [F.int32, F.int64])
else:
# only test int32 on GPU because many graph operators are not supported for int64.
parametrize_dtype = pytest.mark.parametrize("idtype", [F.int32, F.int64])
| [
11748,
12972,
9288,
198,
11748,
30203,
355,
376,
198,
198,
361,
376,
13557,
12286,
62,
22866,
62,
2536,
6624,
705,
36166,
10354,
198,
220,
220,
220,
5772,
316,
380,
2736,
62,
67,
4906,
796,
12972,
9288,
13,
4102,
13,
17143,
316,
380,
... | 2.666667 | 120 |
import importlib
import os
import pkgutil
from typing import Any, List, Type
| [
11748,
1330,
8019,
198,
11748,
28686,
198,
11748,
279,
10025,
22602,
198,
6738,
19720,
1330,
4377,
11,
7343,
11,
5994,
628,
628,
198
] | 3.521739 | 23 |
import PySimpleGUI as PySG
lay = [ [PySG.Text("What's your name?")],
[PySG.Input()],
[PySG.Button('Ok')] ]
wd = PySG.Window('Python Simple GUI', lay)
event, values = wd.read()
print('Hello', values[0])
wd.close()
| [
11748,
9485,
26437,
40156,
355,
9485,
38475,
198,
10724,
796,
685,
220,
685,
20519,
38475,
13,
8206,
7203,
2061,
338,
534,
1438,
1701,
8,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
20519,
38475,
13,
20560,
... | 1.788235 | 170 |
import numpy as np
from . import BasePolicy
| [
11748,
299,
32152,
355,
45941,
198,
6738,
764,
1330,
7308,
36727,
628
] | 3.75 | 12 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
from models.model_utils import BigGAN as BGAN
from utils.data_utils import *
import pandas as pd
def create_model(config, char_map):
model = ScrabbleGAN(config, char_map)
model.to(config.device)
return model
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
26791,
13,
7890,
198,
6738,
4981,
13,
19849,
62,
26791,
1330,
4403,
45028,
355,
34839,
1565,
198,
6738,
... | 2.981132 | 106 |
from flask import abort
from jobbing.models.user_profile import UserProfile # noqa: E501
from jobbing.models.service import Service # noqa: E501
from jobbing.DBModels import Profile as DBProfile
from jobbing.DBModels import Service as DBService
from jobbing.login import token_required
| [
6738,
42903,
1330,
15614,
198,
198,
6738,
1693,
4623,
13,
27530,
13,
7220,
62,
13317,
1330,
11787,
37046,
220,
1303,
645,
20402,
25,
412,
33548,
198,
6738,
1693,
4623,
13,
27530,
13,
15271,
1330,
4809,
220,
1303,
645,
20402,
25,
412,
... | 3.54878 | 82 |
from collections import namedtuple
from datetime import timedelta
import factory
import pytest
from django.db.models import signals
from django.utils import timezone
from tests.factories import (
EvaluationFactory,
MethodFactory,
SubmissionFactory,
)
from tests.utils import (
get_view_for_user,
va... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
11748,
8860,
198,
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
10425,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340... | 2.084048 | 1,166 |
a=[[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]]
b=[[1,2,3,4],[3,4,5,5]]
print convArray(a[0], b[0],'full')
print convArray(a[0], b[0],'same')
print convArray(a[0], b[0],'valid')
print convMatrix(a, b,'full')
print convMatrix(a, b,'same')
print convMatrix(a, b,'valid') | [
64,
28,
30109,
16,
11,
17,
11,
18,
11,
19,
11,
20,
38430,
16,
11,
17,
11,
18,
11,
19,
11,
20,
38430,
16,
11,
17,
11,
18,
11,
19,
11,
20,
11907,
198,
65,
28,
30109,
16,
11,
17,
11,
18,
11,
19,
38430,
18,
11,
19,
11,
20,... | 1.906475 | 139 |
from sicpythontask.PythonTaskInfo import PythonTaskInfo
from sicpythontask.PythonTask import PythonTask
from sicpythontask.InputPort import InputPort
from sicpythontask.OutputPort import OutputPort
from sicpythontask.data.Int32 import Int32
from sicpythontask.data.Float32 import Float32
from sicpythontask.data.Float64 ... | [
6738,
264,
291,
79,
5272,
756,
2093,
13,
37906,
25714,
12360,
1330,
11361,
25714,
12360,
198,
6738,
264,
291,
79,
5272,
756,
2093,
13,
37906,
25714,
1330,
11361,
25714,
198,
6738,
264,
291,
79,
5272,
756,
2093,
13,
20560,
13924,
1330,
... | 3.141667 | 120 |
#!/usr/bin/env python
import argparse
import logging
import re
from sys import stdout
from Bio.SeqIO.QualityIO import FastqGeneralIterator
# avoid ugly python IOError when stdout output is piped into another program
# and then truncated (such as piping to head)
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIP... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
302,
198,
6738,
25064,
1330,
14367,
448,
198,
6738,
16024,
13,
4653,
80,
9399,
13,
35013,
9399,
1330,
12549,
80,
12218,
37787,
198... | 2.714627 | 2,509 |
import pyfiglet as figlet
import click as click
from project import Project, ApplicationRunner
# The application package manager
# get
from package import PackageManager
# print out the application name
# call the project class
# and create a new project
# call teh run class
# and run the specif... | [
11748,
12972,
5647,
1616,
355,
2336,
1616,
201,
198,
11748,
3904,
355,
3904,
201,
198,
6738,
1628,
1330,
4935,
11,
15678,
49493,
201,
198,
201,
198,
2,
383,
3586,
5301,
4706,
201,
198,
2,
651,
201,
198,
6738,
5301,
1330,
15717,
13511,... | 3.214815 | 135 |
import sys
import mock
import unittest
import os
import types
from mock import patch, Mock
docker = Mock()
docker.client = Mock()
sys.modules['docker'] = docker
from cni.kube_cni import kube_params
| [
11748,
25064,
198,
11748,
15290,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
3858,
198,
6738,
15290,
1330,
8529,
11,
44123,
198,
198,
45986,
796,
44123,
3419,
198,
45986,
13,
16366,
796,
44123,
3419,
198,
17597,
13,
18170,
... | 3.241935 | 62 |
import os
from pathlib import Path
from .settings import default
import logging
try:
if os.path.isdir(str(Path.home()) + '/ripda/'):
if not os.path.isdir(str(Path.home()) + '/ripda/blocks/'):
os.mkdir(str(Path.home()) + '/ripda/blocks/')
pass
if not os.path.isfile(str(Path... | [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
764,
33692,
1330,
4277,
198,
11748,
18931,
198,
198,
28311,
25,
198,
220,
220,
220,
611,
28686,
13,
6978,
13,
9409,
343,
7,
2536,
7,
15235,
13,
11195,
28955,
1343,
31051,
55... | 2.086957 | 322 |
"""
Amicable numbers
Let d(n) be defined as the sum of proper divisors of n
(numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and
each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22,... | [
37811,
198,
5840,
18424,
3146,
198,
198,
5756,
288,
7,
77,
8,
307,
5447,
355,
262,
2160,
286,
1774,
2659,
271,
669,
286,
299,
198,
7,
77,
17024,
1342,
621,
299,
543,
14083,
21894,
656,
299,
737,
198,
1532,
288,
7,
64,
8,
796,
27... | 2.872642 | 212 |
from .file_tracer import FileTracer
from .null_tracer import NullTracer
from .base_tracer import BaseTracer, get_tracer
| [
6738,
764,
7753,
62,
2213,
11736,
1330,
9220,
2898,
11736,
198,
6738,
764,
8423,
62,
2213,
11736,
1330,
35886,
2898,
11736,
198,
6738,
764,
8692,
62,
2213,
11736,
1330,
7308,
2898,
11736,
11,
651,
62,
2213,
11736,
198
] | 3.157895 | 38 |
from py_jwt_validator import PyJwtValidator, PyJwtException
import requests
jwt = 'eyJraWQiOiIyMjIiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoic2pvdjVKajlXLXdkblBZUDd3djZ0USIsInN1YiI6Imh0dHBzOi8vbG9naW4uc2FsZXNmb3JjZS5jb20vaWQvMDBEMXQwMDAwMDBEVUo2RUFPLzAwNTF0MDAwMDAwRHlhUEFBUyIsInpvbmVpbmZvIjoiRXVyb3BlL0R1Ymx... | [
6738,
12972,
62,
73,
46569,
62,
12102,
1352,
1330,
9485,
41,
46569,
47139,
1352,
11,
9485,
41,
46569,
16922,
198,
11748,
7007,
198,
198,
73,
46569,
796,
705,
2959,
41,
430,
54,
48,
72,
46,
72,
40,
88,
44,
73,
40,
72,
5639,
41,
1... | 1.390968 | 1,550 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------
# Constantes que voc pode utilizar nesse exerccio
# Em notao cientfica 1.0e-6 o o mesmo qoe 0.000001 (10 elevado a -6)
EPSILON = 1.0e-6
#------------------------------------------------------------------
# O import abaixo per... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
10097,
438,
198,
2,
20217,
274,
8358,
12776,
279,
1098,
7736,
528,
283,
299,
35270,
409,
263,
535,
952,
198,
2,
2295,
407,
5488,
269,
1153,
69,
3970,
352,
13,
15,... | 2.105463 | 3,167 |
"""
Handle download of NWP data from remote servers.
"""
import logging
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
from typing import Dict, List
import requests
from gribmagic.unity.configuration.constants import (
KEY_COMPRESSION,
KEY_LOCAL_FILE_PATHS,
KEY_REMOTE_FILE_PATH... | [
37811,
198,
37508,
4321,
286,
21966,
47,
1366,
422,
6569,
9597,
13,
198,
37811,
198,
11748,
18931,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
360,
71... | 2.422466 | 1,825 |
import sys
import os
import shutil
import filecmp
import json
import unittest
# Path hack. http://stackoverflow.com/questions/6323860/sibling-package-imports
sys.path.insert(0, os.path.abspath('../guacamole'))
import guacamole
if __name__ == '__main__':
unittest.main() | [
11748,
25064,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
2393,
48991,
198,
11748,
33918,
198,
11748,
555,
715,
395,
198,
198,
2,
10644,
8156,
13,
2638,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
5066,
23721,
1899,
... | 2.722772 | 101 |
# coding: utf-8
import sys
import yaml
import paramiko
import base64
import time
import keychain
import re
import console
console.clear()
# Load options
with open('devices.yaml', 'r') as file:
device_list = yaml.load(file)
hostname = device_list['device1']['host']
public_key_string = device_list['device1']['public... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
25064,
198,
11748,
331,
43695,
198,
11748,
5772,
12125,
198,
11748,
2779,
2414,
198,
11748,
640,
198,
11748,
1994,
7983,
198,
11748,
302,
198,
11748,
8624,
198,
198,
41947,
13,
20063,
3419,
... | 2.842105 | 228 |
# Flask settings
FLASK_DEBUG = True # Do not use debug mode in production
# SQLAlchemy settings
SQLALCHEMY_DATABASE_URI = 'sqlite:///db.sqlite'
SQLALCHEMY_TRACK_MODIFICATIONS = True
# Flask-Restplus settings
SWAGGER_UI_DOC_EXPANSION = 'list'
RESTPLUS_VALIDATE = True
RESTPLUS_MASK_SWAGGER = False
ERROR_404_HELP = Fa... | [
2,
46947,
6460,
198,
3697,
1921,
42,
62,
30531,
796,
6407,
220,
1303,
2141,
407,
779,
14257,
4235,
287,
3227,
198,
198,
2,
16363,
2348,
26599,
6460,
198,
17861,
1847,
3398,
3620,
56,
62,
35,
1404,
6242,
11159,
62,
47269,
796,
705,
2... | 2.571429 | 126 |
#!/usr/bin/env python
"""
Create superuser and monitoring group
"""
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.auth.models import User
from parkings.models import Monitor
from parkings.models imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
16447,
2208,
7220,
290,
9904,
1448,
198,
37811,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
... | 3.567164 | 134 |
import numpy as np
from parallelm.mlops.mlops_exception import MLOpsStatisticsException
from parallelm.mlops.stats.graph import Graph
from parallelm.mlops.stats.multi_line_graph import MultiLineGraph
from parallelm.mlops.stats.single_value import SingleValue
from parallelm.mlops.stats.table import Table
from parallelm... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
10730,
76,
13,
4029,
2840,
13,
4029,
2840,
62,
1069,
4516,
1330,
10373,
41472,
48346,
16922,
198,
6738,
10730,
76,
13,
4029,
2840,
13,
34242,
13,
34960,
1330,
29681,
198,
6738,
10730,
76,
... | 3.63 | 100 |
# terrascript/data/davidji99/split.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:27:33 UTC)
import terrascript
__all__ = [
"split_traffic_type",
"split_workspace",
]
| [
2,
8812,
15961,
14,
7890,
14,
67,
8490,
7285,
2079,
14,
35312,
13,
9078,
198,
2,
17406,
4142,
7560,
416,
4899,
14,
15883,
8189,
13,
9078,
357,
1731,
12,
19117,
12,
1238,
2481,
1315,
25,
1983,
25,
2091,
18119,
8,
198,
11748,
8812,
... | 2.571429 | 77 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core import util
from telemetry.unittest import options_for_unittests
| [
2,
15069,
1946,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
11748... | 3.635135 | 74 |
from awsflow.tools.emr import logging
from awsflow.version import __version__
def hello_world(event, context):
"""
Test function, does nothing
:param event: AWS lambdas function event
:param context: AWS lambdas function context
:return:
"""
message = 'event={} context={}'.format(event, c... | [
6738,
3253,
82,
11125,
13,
31391,
13,
368,
81,
1330,
18931,
198,
6738,
3253,
82,
11125,
13,
9641,
1330,
11593,
9641,
834,
628,
198,
4299,
23748,
62,
6894,
7,
15596,
11,
4732,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6208... | 2.840237 | 169 |
'''
Module's author : Jarry Gabriel
Date : June, July 2016
Some Algorithms was made by : Malivai Luce, Helene Piquet
This module handle different tools
'''
from pyproj import Proj, Geod
import numpy as np
# Projections
wgs84=Proj("+init=EPSG:4326")
epsg3857=Proj("+init=EPSG:3857")
g=Geod(ellps='WGS84')
... | [
7061,
6,
201,
198,
26796,
338,
1772,
1058,
449,
6532,
17371,
201,
198,
10430,
1058,
2795,
11,
2901,
1584,
201,
198,
4366,
978,
7727,
907,
373,
925,
416,
1058,
4434,
452,
1872,
6026,
344,
11,
5053,
1734,
350,
1557,
316,
201,
198,
121... | 2.068293 | 410 |
from docx import Document
| [
6738,
2205,
87,
1330,
16854,
198
] | 4.333333 | 6 |
# -*- coding: utf-8 -*-
#
#
# Copyright (C) University of Melbourne 2012
#
#
#
#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 us... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
198,
2,
15069,
357,
34,
8,
2059,
286,
14819,
2321,
198,
2,
198,
2,
198,
2,
198,
2,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
10... | 3.474286 | 350 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 2.34478 | 728 |
# import logging
# from pprint import pformat
from diana.utils.dicom import DicomLevel
def find_item_query(item):
"""
Have some information about the dixel, want to find the STUID, SERUID, INSTUID
Returns a _list_ of dictionaries with matches, retrieves any if "retrieve" flag
"""
q = {}
keys ... | [
2,
1330,
18931,
198,
2,
422,
279,
4798,
1330,
279,
18982,
198,
6738,
288,
7484,
13,
26791,
13,
67,
291,
296,
1330,
360,
291,
296,
4971,
628,
198,
4299,
1064,
62,
9186,
62,
22766,
7,
9186,
2599,
198,
220,
220,
220,
37227,
198,
220,... | 1.965608 | 756 |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA @UnusedWildImport
import os
import unittest
import numpy as np
from obspy import Trace, UTCDateTime, read
from obspy.io.ascii.core import (_determ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.148551 | 276 |
'''
MAP v-SCREEN gargle test - Shimadzu 8020 H
Date: 30/11/2020
''' | [
7061,
6,
198,
33767,
410,
12,
6173,
2200,
1677,
44671,
293,
1332,
532,
31698,
324,
27624,
4019,
1238,
367,
220,
198,
10430,
25,
1542,
14,
1157,
14,
42334,
198,
7061,
6
] | 2.193548 | 31 |
"""URL converters for the Zinnia project"""
| [
37811,
21886,
6718,
1010,
329,
262,
1168,
3732,
544,
1628,
37811,
628,
628,
628,
198
] | 3.333333 | 15 |
import logging
import os
import uuid
from typing import List
from flask import current_app
from flask.config import Config
from flask_injector import inject
from slackclient import SlackClient
from werkzeug.utils import secure_filename
from nisse.models.DTO import PrintParametersDto
from nisse.models.slack.common imp... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
334,
27112,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
42903,
1330,
1459,
62,
1324,
198,
6738,
42903,
13,
11250,
1330,
17056,
198,
6738,
42903,
62,
259,
752,
273,
1330,
8677,
198,
6738,
30... | 3.642857 | 322 |
from helpers import inputs
| [
6738,
49385,
1330,
17311,
628
] | 5.6 | 5 |
# third party
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
# relative
from . import Base
| [
2,
2368,
2151,
198,
6738,
44161,
282,
26599,
1330,
29201,
198,
6738,
44161,
282,
26599,
1330,
34142,
198,
6738,
44161,
282,
26599,
1330,
10903,
198,
198,
2,
3585,
198,
6738,
764,
1330,
7308,
628,
198
] | 3.942857 | 35 |
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from .composition_parts import Component
from .composition_parts import Identifier
from .make_copy import make_copy
| [
2,
15069,
13130,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
1174... | 3.857143 | 77 |
# HEAD
# Classes - Magic Methods - Normal Numeric Magic Methods
# DESCRIPTION
# Describes the magic methods of classes
# add, sub, mul, floordiv, div, truediv, mod,
# divmod, pow, lshift, rshift, and, or, xor
# RESOURCES
#
# https://rszalski.github.io/magicmethods/
# Normal arithmetic operators
# Now, ... | [
2,
39837,
198,
2,
38884,
532,
6139,
25458,
532,
14435,
399,
39223,
6139,
25458,
198,
2,
22196,
40165,
198,
2,
39373,
22090,
262,
5536,
5050,
286,
6097,
198,
2,
220,
220,
220,
220,
220,
220,
751,
11,
850,
11,
35971,
11,
5530,
585,
... | 2.893855 | 537 |
# Copyright 2017 Conchylicultor. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
2,
15069,
2177,
1482,
29658,
677,
586,
273,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
3... | 4.052795 | 322 |
soma = 0
print("0 para parar")
numero = int(input("Digite numero: "))
while numero != 0:
if numero %2 == 0:
soma += numero
if numero == 0:
break
print("0 para parar")
numero = int(input("Digite numero: "))
print("O total ", soma) | [
82,
6086,
796,
657,
198,
198,
4798,
7203,
15,
31215,
1582,
283,
4943,
198,
22510,
3529,
796,
493,
7,
15414,
7203,
19511,
578,
997,
3529,
25,
366,
4008,
198,
198,
4514,
997,
3529,
14512,
657,
25,
198,
220,
220,
220,
611,
997,
3529,
... | 2.218487 | 119 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: spaceone/api/power_scheduler/v1/schedule_rule.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
2272,
505,
14,
15042,
14,
6477,
62,
1416,
704,
18173,
14,
85,
16,
14,
... | 2.37697 | 17,577 |
from django.contrib import admin
from django.db.models import Model
__all__ = ["register_all"]
def register_all(models, admin_class=admin.ModelAdmin):
"""
Easily register Models to Django admin site.
::
from yourapp import models
from django_boost.admin.sites import register_all
regi... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
9104,
198,
198,
834,
439,
834,
796,
14631,
30238,
62,
439,
8973,
628,
198,
4299,
7881,
62,
439,
7,
27530,
11,
13169,
62,
4871,
28,
2... | 2.493703 | 397 |
import discord
import os
from discord.ext import commands
bot = commands.Bot(command_prefix=">")
TOKEN = os.environ.get('TOKEN')
bot.run(TOKEN)
| [
11748,
36446,
198,
11748,
28686,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
13645,
796,
9729,
13,
20630,
7,
21812,
62,
40290,
2625,
29,
4943,
198,
10468,
43959,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
10468,
43959,
11537,
198... | 2.92 | 50 |
from pathlib import Path
import pytest
import yaml
from azure.ai.ml._schema._deployment.batch.batch_deployment import BatchDeploymentSchema
from azure.ai.ml.constants import BASE_PATH_CONTEXT_KEY, BatchDeploymentOutputAction
from azure.ai.ml.entities._util import load_from_dict
from azure.ai.ml.entities import BatchDe... | [
6738,
3108,
8019,
1330,
10644,
198,
11748,
12972,
9288,
198,
11748,
331,
43695,
198,
198,
6738,
35560,
495,
13,
1872,
13,
4029,
13557,
15952,
2611,
13557,
2934,
1420,
434,
13,
43501,
13,
43501,
62,
2934,
1420,
434,
1330,
347,
963,
49322... | 2.879668 | 241 |
fun = display()
print(fun()) | [
198,
12543,
796,
3359,
3419,
198,
4798,
7,
12543,
28955
] | 2.9 | 10 |
from options.test_parser import TestParser
from models import create_model, get_model_parsing_modifier
from datasets import create_dataset, get_dataset_parsing_modifier
parser = TestParser()
model_name = parser.get_model_name()
dataset_name = parser.get_dataset_name()
print('Model name: {}'.format(model_name))
print(... | [
6738,
3689,
13,
9288,
62,
48610,
1330,
6208,
46677,
198,
6738,
4981,
1330,
2251,
62,
19849,
11,
651,
62,
19849,
62,
79,
945,
278,
62,
4666,
7483,
198,
6738,
40522,
1330,
2251,
62,
19608,
292,
316,
11,
651,
62,
19608,
292,
316,
62,
... | 2.667785 | 298 |
for i in range(11):
v = 2 ** i
print("2^%s = %s" % (i, v))
| [
1640,
1312,
287,
2837,
7,
1157,
2599,
198,
220,
220,
220,
410,
796,
362,
12429,
1312,
198,
220,
220,
220,
3601,
7203,
17,
61,
4,
82,
796,
4064,
82,
1,
4064,
357,
72,
11,
410,
4008,
198
] | 1.810811 | 37 |
#
from selenium import webdriver
from os import path
driver = webdriver.Chrome()
d = path.dirname('__file__')
index = path.join(d,'index.png')
driver.get("https://www.baidu.com/")
#
driver.maximize_window()
#
driver.save_screenshot(index)
#
driver.back()
#
driver.forward()
#
driver.refresh()
driver.qui... | [
2,
220,
198,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
28686,
1330,
3108,
628,
198,
26230,
796,
3992,
26230,
13,
1925,
5998,
3419,
198,
198,
67,
796,
3108,
13,
15908,
3672,
10786,
834,
7753,
834,
11537,
198,
9630,
796... | 2.503876 | 129 |
"""
Handles exceptions raised by Flask WebAPI.
"""
from . import status
| [
37811,
198,
12885,
829,
13269,
4376,
416,
46947,
5313,
17614,
13,
198,
37811,
198,
198,
6738,
764,
1330,
3722,
628,
628
] | 3.619048 | 21 |
#!/usr/bin/python
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
#... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
770,
2438,
318,
636,
286,
28038,
856,
11,
475,
318,
281,
4795,
7515,
13,
198,
2,
770,
1948,
2393,
39442,
11,
290,
428,
2393,
39442,
691,
11,
318,
347,
10305,
11971,
13,
198,
2,
... | 3.479798 | 594 |
# Filename: test_account.py
"""
Test the lendingclub2.accountmodule
"""
# PyTest
import pytest
# lendingclub2
from lendingclub2.account import InvestorAccount
from lendingclub2.error import LCError
| [
2,
7066,
12453,
25,
1332,
62,
23317,
13,
9078,
198,
198,
37811,
198,
14402,
262,
20983,
18664,
17,
13,
23317,
21412,
198,
37811,
198,
198,
2,
9485,
14402,
198,
11748,
12972,
9288,
198,
198,
2,
20983,
18664,
17,
198,
6738,
20983,
18664... | 3.311475 | 61 |
from config import *
from excel_handler import get_users_from_excel
from fastapi import FastAPI, HTTPException, status, Request
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from ty... | [
6738,
4566,
1330,
1635,
198,
6738,
27336,
62,
30281,
1330,
651,
62,
18417,
62,
6738,
62,
1069,
5276,
198,
6738,
3049,
15042,
1330,
12549,
17614,
11,
14626,
16922,
11,
3722,
11,
19390,
198,
6738,
3049,
15042,
13,
27171,
1574,
13,
66,
6... | 2.939683 | 315 |
###PiPlate buttons
print('sudo crontab /home/pi/grow-controller-Rpi/main/ref/crontab.cron')
'''
while True:
time.sleep(0.5) # without this time.sleep, 23% cpu usage. with 3%
if lcd.is_pressed(LCD.UP):
GPIO.output(pin1, GPIO.LOW) # on
if lcd.is_pressed(LCD.DOWN):
GPIO.output(pin1, GPIO... | [
198,
21017,
38729,
3646,
378,
12163,
628,
198,
4798,
10786,
24032,
1067,
756,
397,
1220,
11195,
14,
14415,
14,
45921,
12,
36500,
12,
49,
14415,
14,
12417,
14,
5420,
14,
66,
4298,
397,
13,
66,
1313,
11537,
628,
198,
7061,
6,
198,
451... | 2.160256 | 156 |
#!/usr/bin/python
#
import os
import subprocess
import sys
# # OLD
# def SVGMinify():
# icons_dir = './icons'
# icons_min_dir = './icons-min'
# total_icons = 0
# for icon in os.listdir(icons_dir):
# [name, ext] = icon.split('.')
# icon_min = "{}/{}.min.{}".format(icons_min_dir, name, ext)
# i = "{}/{}.{}".... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
2,
1303,
440,
11163,
198,
2,
825,
45809,
9452,
1958,
33529,
198,
2,
220,
197,
34280,
62,
15908,
796,
705,
195... | 2.099715 | 351 |
# coding: utf-8
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
2177,
3012,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
23... | 3.615044 | 226 |
from django.conf import settings
from haystack import indexes
from celery_haystack.indexes import CelerySearchIndex
from .models import PublicBody
PUBLIC_BODY_BOOSTS = settings.FROIDE_CONFIG.get("public_body_boosts", {})
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
27678,
25558,
1330,
39199,
198,
6738,
18725,
1924,
62,
71,
323,
25558,
13,
9630,
274,
1330,
15248,
1924,
18243,
15732,
198,
198,
6738,
764,
27530,
1330,
5094,
25842,
198,
198,
5... | 3.125 | 72 |
from chicago_style_clam_pizza import ChicagoStyleClamPizza
from chicago_style_cheese_pizza import ChicagoStyleCheesePizza
from chicago_style_pepperoni_pizza import ChicagoStylePepperoniPizza
from chicago_style_veggie_pizza import ChicagoStyleVeggiePizza
from ny_style_clam_pizza import NYStyleClamPizza
from ny_style_che... | [
6738,
442,
4549,
62,
7635,
62,
565,
321,
62,
79,
9990,
1330,
4842,
21466,
34,
2543,
47,
9990,
198,
6738,
442,
4549,
62,
7635,
62,
2395,
2771,
62,
79,
9990,
1330,
4842,
21466,
7376,
2771,
47,
9990,
198,
6738,
442,
4549,
62,
7635,
6... | 3.00641 | 156 |
import performance
import dislib as ds
from dislib.classification import RandomForestClassifier
if __name__ == "__main__":
main()
| [
11748,
2854,
198,
198,
11748,
595,
8019,
355,
288,
82,
198,
6738,
595,
8019,
13,
4871,
2649,
1330,
14534,
34605,
9487,
7483,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 3.285714 | 42 |
from pwn.internal.shellcode_helper import *
from ..misc.pushstr import pushstr
| [
6738,
279,
675,
13,
32538,
13,
29149,
8189,
62,
2978,
525,
1330,
1635,
198,
6738,
11485,
44374,
13,
14689,
2536,
1330,
4574,
2536,
628
] | 3.333333 | 24 |
from bundle import seeker
expected_output = '''
Source path:... Whatever
call 5 def main():
line 6 f2()
call 9 def f2():
line 10 f3()
Source path:... Whatever
call ... | [
6738,
18537,
1330,
45993,
628,
628,
628,
198,
198,
40319,
62,
22915,
796,
705,
7061,
198,
7416,
3108,
25,
986,
15935,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
869,
220,
220,
220,
220,
220,
22... | 1.544465 | 551 |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | [
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
33448,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
921,
743,
198,
2,
7330,
257,
486... | 3.268018 | 444 |
import os
import shutil
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from read import clean_read
from detrend import *
def get_effect(data, param, mean, stddev, start_index, lag=3, effect_type=1,
returning_gap=0, dropthrough=(0, 0), forcing=(None, None),
max_e... | [
11748,
28686,
198,
11748,
4423,
346,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
1100,
1330,
3424,
62,
961,
198,
6738,
10... | 2.102044 | 6,605 |
from lightning_transformers.task.nlp.multiple_choice.datasets.swag.data import ( # noqa: F401
SwagMultipleChoiceDataModule,
)
| [
6738,
14357,
62,
35636,
364,
13,
35943,
13,
21283,
79,
13,
48101,
62,
25541,
13,
19608,
292,
1039,
13,
2032,
363,
13,
7890,
1330,
357,
220,
1303,
645,
20402,
25,
376,
21844,
198,
220,
220,
220,
2451,
363,
31217,
46770,
6601,
26796,
... | 2.847826 | 46 |
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BCM)
Motor1Enable = 5
Motor1B = 24
Motor1A = 27
Motor2Enable = 17
Motor2B = 6
Motor2A = 22
#single shot script used as a warning shot
# Set up defined GPIO pins
GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
GPIO.setup(Motor1Enable,GPIO.OUT)... | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
6738,
640,
1330,
3993,
198,
198,
16960,
9399,
13,
2617,
14171,
7,
16960,
9399,
13,
2749,
44,
8,
198,
198,
34919,
16,
36695,
796,
642,
198,
34919,
16,
33,
796,
1987,
198,
34919,
16,... | 2.360434 | 369 |
import html
import markdown
import bleach
import lxml.html
from lxml.html import builder as E
TAGS = [
'p', 'img', 'em', 'strong', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul',
'li', 'br', 'hr', 'a', 'img', 'blockquote', 'b', 'i', 'u', 's', 'pre',
'code', 'table', 'thead', 'tr', 'th', 'tbody', 'td'
]
AT... | [
11748,
27711,
198,
11748,
1317,
2902,
198,
11748,
49024,
198,
11748,
300,
19875,
13,
6494,
198,
6738,
300,
19875,
13,
6494,
1330,
27098,
355,
412,
198,
198,
42197,
50,
796,
685,
198,
220,
220,
220,
705,
79,
3256,
705,
9600,
3256,
705,... | 2.096491 | 228 |
import subprocess
import os
| [
11748,
850,
14681,
198,
11748,
28686,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
628,
198
] | 2.222222 | 18 |
from ...abstractObjects.hybridShapes.line import LinePtPt
| [
201,
198,
6738,
2644,
397,
8709,
10267,
82,
13,
12114,
10236,
2484,
7916,
13,
1370,
1330,
6910,
47,
83,
47,
83,
201,
198,
201
] | 2.583333 | 24 |
# Copyright (c) 2005-2011, Enthought, Inc.
# All rights reserved.
""" Support for managing resources such as images and sounds.
Part of the TraitsGUI project of the Enthought Tool Suite.
"""
| [
2,
15069,
357,
66,
8,
5075,
12,
9804,
11,
2039,
28895,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
37811,
7929,
329,
11149,
4133,
884,
355,
4263,
290,
5238,
13,
198,
220,
220,
220,
2142,
286,
262,
4759,
896,
40156,
1628,
286... | 3.679245 | 53 |
from tkinter import *
window=Tk()
mywin=SemGrade(window)
window.title('Semestral Grade Calculator')
window.geometry("400x300+10+10")
window.mainloop() | [
6738,
256,
74,
3849,
1330,
1635,
201,
198,
201,
198,
17497,
28,
51,
74,
3419,
201,
198,
1820,
5404,
28,
13900,
42233,
7,
17497,
8,
201,
198,
17497,
13,
7839,
10786,
13900,
395,
1373,
22653,
43597,
11537,
201,
198,
17497,
13,
469,
15... | 2.661017 | 59 |
import os
import sys
import pandas as pd
from xml.etree import ElementTree as et
cwd = os.getcwd()
filepath = 'C:\\Users\\asimon\\Desktop\\Practice-' \
'Training\\p21_template_out3.xml'
if __name__ == '__main__':
df = parse_wfd_xml(filepath)
writer = pd.ExcelWriter('wfd_output.xlsx')
df.to_ex... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
355,
2123,
198,
198,
66,
16993,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
7753,
6978,
796,
705,
34,
25,
... | 2.322581 | 155 |
#!/usr/bin/env python
from setuptools import setup
# get version
from memsql_loader import __version__
setup(
name='memsql-loader',
version=__version__,
author='MemSQL',
author_email='support@memsql.com',
url='https://github.com/memsql/memsql-loader',
download_url='https://github.com/memsql/me... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
2,
651,
2196,
198,
6738,
1066,
25410,
62,
29356,
1330,
11593,
9641,
834,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
76,
5232,
... | 1.975278 | 809 |
#MNE tutorial
#Import modules
import os
import numpy as np
import mne
import re
import complexity_entropy as ce
#Import specific smodules for filtering
from numpy.fft import fft, fftfreq
from scipy import signal
from mne.time_frequency.tfr import morlet
from mne.viz import plot_filter, plot_ideal_filter
... | [
2,
44,
12161,
11808,
201,
198,
201,
198,
2,
20939,
13103,
201,
198,
11748,
28686,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
285,
710,
201,
198,
11748,
302,
201,
198,
11748,
13357,
62,
298,
28338,
355,
2906,
201,
198,
... | 2.179982 | 7,773 |
import numpy as np
import scipy as sp
| [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198
] | 2.923077 | 13 |
import os
import shutil
import json
import time
import cv2
import numpy as np
import PIL
if __name__ == '__main__' :
erode_all(True) | [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
33918,
198,
11748,
640,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
350,
4146,
220,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
6,
105... | 2.622642 | 53 |