content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import xlwt
| [
11748,
2124,
75,
46569,
198
] | 2.4 | 5 |
#! /usr/bin/env python
"""WSGI server interface to mw-render and mw-zip/mw-post"""
import sys, os, time, re, shutil, StringIO
from hashlib import md5
from mwlib import myjson as json
from mwlib import log, _version
from mwlib.metabook import calc_checksum
log = log.Log('mwlib.serve')
collection_id_rex = re.compile(... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
19416,
18878,
4382,
7071,
284,
285,
86,
12,
13287,
290,
285,
86,
12,
13344,
14,
76,
86,
12,
7353,
37811,
198,
198,
11748,
25064,
11,
28686,
11,
640,
11,
302,
11,
4423... | 2.327146 | 431 |
from aiohttp import web
| [
6738,
257,
952,
4023,
1330,
3992,
628
] | 3.571429 | 7 |
# -*- coding: utf-8 -*-
# Time: 2022-03-01 15:43
# Copyright (c) 2022
# author: Euraxluo
from typing import *
from amap_distance_matrix.helper import haversine,format_loc
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
220,
198,
2,
3862,
25,
33160,
12,
3070,
12,
486,
1315,
25,
3559,
198,
2,
15069,
357,
66,
8,
33160,
198,
2,
1772,
25,
36554,
897,
2290,
78,
198,
198,
6738,
19720,
1330,
... | 2.550725 | 69 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
import csv
import datetime
AGE = "Age Category"
SEX = "Sex"
TIME = "Time"
OUTPUT_BASE = "output/"
COLS_X = [AGE, SEX, TIME, "TotalRaces"]
COLS_Y = [TIME]
#training data
TRAIN_X = "output/Y2X_train.csv"
TRAIN_Y = "output/Y2Y_train.csv"... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
10688,
198,
11748,
269,
21370,
198,
11748,
4818,
8079,
198,
198,
11879,
796,
366,
23396,
2174... | 2.031969 | 782 |
from .wrappers import SimpleClassifierWrapper
| [
6738,
764,
29988,
11799,
1330,
17427,
9487,
7483,
36918,
2848,
628
] | 4.272727 | 11 |
from bs4 import BeautifulSoup
from urllib.request import Request,urlopen
from urllib.error import HTTPError
from PyQt5 import QtCore, QtGui, QtWidgets, Qt
import sys
import threading
import datetime
import win32con
import os
import struct
import time
import pyttsx3
from win32api import *
from win32gui imp... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
201,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19390,
11,
6371,
9654,
201,
198,
6738,
2956,
297,
571,
13,
18224,
1330,
14626,
12331,
201,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
... | 2.341837 | 196 |
# SPDX-FileCopyrightText: 2021-present Ofek Lev <oss@ofek.dev>
#
# SPDX-License-Identifier: MIT
import subprocess
from textwrap import dedent as _dedent
import tomli
import tomli_w
| [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33448,
12,
25579,
3226,
988,
16042,
1279,
793,
31,
1659,
988,
13,
7959,
29,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
11748,
850,
14681,
198,
6738,
2420,
37150,
... | 2.833333 | 66 |
#define calcIncrement function
#define calcTotalSalary function
#get user inputs for salary
salary = input("Enter Salary : ")
salary = float(salary)
#get user inputs for number of years worked
years = input("Enter no of years worked : ")
years = int(years)
#calculate the increment by passing the given values to th... | [
198,
2,
13086,
42302,
15562,
434,
2163,
198,
198,
2,
13086,
42302,
14957,
19221,
560,
2163,
198,
198,
2,
1136,
2836,
17311,
329,
9588,
198,
21680,
560,
796,
5128,
7203,
17469,
46860,
1058,
366,
8,
198,
21680,
560,
796,
12178,
7,
21680... | 3.586207 | 174 |
from .newDitherStackers import *
from .newDitherStackers import *
from .maskingAlgorithmGeneralized import *
from .saveBundleData_npzFormat import *
from .numObsMetric import *
from .galaxyCountsMetric_extended import *
from .galaxyCounts_withPixelCalibration import *
from .artificialStructureCalculation import *
from ... | [
6738,
764,
3605,
35,
1555,
25896,
364,
1330,
1635,
198,
6738,
764,
3605,
35,
1555,
25896,
364,
1330,
1635,
198,
6738,
764,
27932,
278,
2348,
42289,
12218,
1143,
1330,
1635,
198,
6738,
764,
21928,
33,
31249,
6601,
62,
37659,
89,
26227,
... | 3.293233 | 133 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# anited. publish - Python package with cli to turn markdown files into ebooks
# Copyright (c) 2014 Christopher Knrndel
#
# Distributed under the MIT License
# (license terms are at http://opensource.org/licenses/MIT).
"""Setup script for easy_install and pip."""
impor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
281,
863,
13,
7715,
532,
11361,
5301,
351,
537,
72,
284,
1210,
1317,
2902,
3696,
656,
304,
12106,
19... | 2.538462 | 1,014 |
"""
main.py
Main.py responsvel por iniciar o processo o programa completamente, atravs de duas threads, uma para manter o
servidor de aplicao via flask para poder receber requisies e comunicar com o cliente, seus processos esto
detalhados em server.py e outra thread para manter o fluxo da aplicao, baseado no processo... | [
37811,
198,
12417,
13,
9078,
198,
198,
13383,
13,
9078,
220,
2424,
626,
16964,
287,
291,
12571,
267,
1429,
78,
267,
1430,
64,
1224,
83,
3263,
68,
11,
379,
4108,
82,
390,
7043,
292,
14390,
11,
334,
2611,
31215,
582,
353,
267,
198,
... | 2.934177 | 395 |
#!/usr/bin/env python
# coding: utf-8
import random
import math
import torch
import dgl
import graphgallery
from graphgallery.datasets import Planetoid
print("GraphGallery version: ", graphgallery.__version__)
print("PyTorch version: ", torch.__version__)
print("DGL version: ", dgl.__version__)
'''
Load Datasets
- co... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
4738,
198,
11748,
10688,
198,
11748,
28034,
198,
11748,
288,
4743,
198,
11748,
4823,
24460,
198,
6738,
4823,
24460,
13,
19608,
292,
1039,
13... | 2.817992 | 478 |
# Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
| [
2,
15069,
25767,
669,
284,
262,
6400,
270,
1628,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
628
] | 3.636364 | 22 |
import subprocess
import os
from setuptools import setup, find_packages
setup(
name='garden_test',
version=latest_git_tag(),
long_description=readme(),
description='Python package for testing garden',
author='Jeremy Dobbins-Bucklad',
author_email='j.american.db@gmail.com',
url='https://g... | [
11748,
850,
14681,
198,
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
70,
5872,
62,
9288,
3256,
198,
220,
220,
220,
2196,
28,
42861,
62,
18300,
... | 2.594203 | 345 |
import unittest
from lib.solutions.checkout import checkout
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
9195,
13,
82,
14191,
13,
9122,
448,
1330,
28006,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.820513 | 39 |
#!/usr/bin/env python
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from libs.imagemetadata_ui import Ui_imagemetadata
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,... | 2.402778 | 72 |
import os
import cv2
import pdb
import json
import copy
import numpy as np
import torch
from PIL import Image, ImageDraw, ImageFont
import matplotlib.pyplot as plt
import matplotlib
import math
from tqdm import tqdm
from config import system_configs
from utils import crop_image, normalize_
from external.nms import so... | [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
279,
9945,
198,
11748,
33918,
198,
11748,
4866,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
11,
7412,
23252,
198,
1174... | 3.023077 | 130 |
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#now we'll define the threaded callback function
#this will run in another threadwhen our event is detected
raw_input("Press Enter when ready\n>")
GPIO.add_event_detec... | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
16960,
9399,
13,
2617,
14171,
7,
16960,
9399,
13,
2749,
44,
8,
198,
198,
16960,
9399,
13,
40406,
7,
1954,
11,
50143,
13,
1268,
11,
2834,
62,
929,
62,
2902,
28,
16960,
9399,
13,
5... | 2.675799 | 219 |
from django.http import HttpResponse
from django.db.models import Q
from drf_yasg.utils import swagger_auto_schema
from drf_yasg.openapi import Parameter, Schema, Response, TYPE_INTEGER, TYPE_OBJECT, TYPE_STRING, IN_QUERY
from json import dumps
from .. import models
from .Public import responses_success, responses_fa... | [
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
1553,
69,
62,
88,
292,
70,
13,
26791,
1330,
1509,
7928,
62,
23736,
62,
15952,
2611,
198,
6738,
1553,
69,
... | 3.151832 | 191 |
import struct
import socket
import asyncio
import logging
import knx_stack
if __name__ == "__main__":
import sys
root = logging.getLogger()
root.setLevel(logging.DEBUG)
handler = logging.StreamHandler(sys.stdout)
root.addHandler(handler)
loop = asyncio.get_event_loop()
if len(sys.a... | [
11748,
2878,
198,
11748,
17802,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
198,
11748,
638,
87,
62,
25558,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1330,
25064,
628,
220,
22... | 2.344512 | 328 |
from autodisc.representations.static.pytorchnnrepresentation.models.encoders import EncoderBurgess
from autodisc.representations.static.pytorchnnrepresentation.models.decoders import DecoderBurgess
| [
6738,
1960,
375,
2304,
13,
15603,
602,
13,
12708,
13,
9078,
13165,
1349,
77,
15603,
341,
13,
27530,
13,
12685,
375,
364,
1330,
14711,
12342,
33,
3686,
408,
198,
6738,
1960,
375,
2304,
13,
15603,
602,
13,
12708,
13,
9078,
13165,
1349,
... | 3.491228 | 57 |
# Import OpenCV module
import cv2
# Import numpy for array operations
import numpy as np
image = cv2.imread('images/five_cubes.jpeg')
# Show the image
cv2.imshow('Image',image)
# Resize the image if it is too big, also helps to speed up the processing
image = cv2.resize(image, (600, 600))
cv2.imshow('Resized Image'... | [
2,
17267,
4946,
33538,
8265,
198,
11748,
269,
85,
17,
198,
2,
17267,
299,
32152,
329,
7177,
4560,
198,
11748,
299,
32152,
355,
45941,
628,
198,
9060,
796,
269,
85,
17,
13,
320,
961,
10786,
17566,
14,
13261,
62,
66,
29080,
13,
73,
... | 2.364748 | 1,390 |
import exastics.collect
import pathlib
import sys
import urllib.parse
if __name__ == '__main__':
github_account = sys.argv[1]
github_repository = sys.argv[2]
url_parts = (
'https',
'api.github.com',
urllib.parse.quote(f'/repos/{github_account}/{github_repository}/releases'),
... | [
11748,
409,
24232,
13,
33327,
198,
11748,
3108,
8019,
198,
11748,
25064,
198,
11748,
2956,
297,
571,
13,
29572,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
33084,
62,
23317,
796,
25064,
13,
... | 2.214008 | 257 |
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
13130,
1766,
956,
414,
3457,
13,
628,
628
] | 2.416667 | 24 |
"""Export a text file."""
from ghpythonlib.componentbase import dotnetcompiledcomponent as component
import Grasshopper, GhPython
import System
import os
import datetime
__author__ = "Nicolas Rogeau"
__laboratory__ = "IBOIS, Laboratory for Timber Construction"
__university__ = "EPFL, Ecole Polytechnique Fe... | [
37811,
43834,
257,
2420,
2393,
526,
15931,
201,
198,
201,
198,
6738,
308,
24831,
7535,
8019,
13,
42895,
8692,
1330,
16605,
3262,
5589,
3902,
42895,
355,
7515,
201,
198,
11748,
19062,
8873,
2848,
11,
11972,
37906,
201,
198,
11748,
4482,
... | 3.080882 | 136 |
from sommelier.steps.response_processing import *
from sommelier.steps.event_processing import *
| [
6738,
264,
48990,
959,
13,
20214,
13,
26209,
62,
36948,
1330,
1635,
198,
6738,
264,
48990,
959,
13,
20214,
13,
15596,
62,
36948,
1330,
1635,
198
] | 3.730769 | 26 |
import sys
from packaging.version import LegacyVersion
from skbuild.exceptions import SKBuildError
from skbuild.cmaker import get_cmake_version
from skbuild import setup
setup_requires = []
# Require pytest-runner only when running tests.
if any(arg in sys.argv for arg in ('pytest', 'test')):
setup_requires.append(... | [
11748,
25064,
198,
198,
6738,
16846,
13,
9641,
1330,
14843,
14815,
198,
6738,
1341,
11249,
13,
1069,
11755,
1330,
14277,
15580,
12331,
198,
6738,
1341,
11249,
13,
66,
10297,
1330,
651,
62,
11215,
539,
62,
9641,
198,
6738,
1341,
11249,
1... | 2.942953 | 298 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.dashboard, name='dashboard'),
path('dtcs/', views.dtcs, name='dtcs'),
]
| [
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,
42460,
3526,
11,
1438,
11639,
42460,
3526,
33809,
198,
220,
220,
220,... | 2.655738 | 61 |
from django import forms
from crits.locations.location import Location
from crits.core.handlers import get_item_names
| [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
1955,
82,
13,
17946,
602,
13,
24886,
1330,
13397,
198,
6738,
1955,
82,
13,
7295,
13,
4993,
8116,
1330,
651,
62,
9186,
62,
14933,
198
] | 3.606061 | 33 |
import pandas as pd
import numpy as np
import sys
import os
import itertools
import pandas as pd
import os
from tqdm import tqdm_notebook, tnrange
import numpy as np
import networkx as nx
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.optimize import minimize
import scipy
from sklearn import linear_... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
220,
198,
11748,
28686,
198,
11748,
340,
861,
10141,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
198,
6738,
256,
80,
36020,
1330,
... | 2.710117 | 1,028 |
#!/usr/bin/env python3
import tornado.ioloop
import tornado.web
import json
import logging
from uf.wrapper.swift_api import SwiftAPI
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
33718,
13,
1669,
11224,
198,
11748,
33718,
13,
12384,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
334,
69,
13,
48553,
13,
2032,
2135,
62,
15042,
1330,
15608,
17614,
628,
... | 2.916667 | 60 |
from rest_framework.exceptions import ValidationError
from rest_framework.fields import DateField, ChoiceField, CharField
from open.core.betterself.constants import (
BETTERSELF_LOG_INPUT_SOURCES,
WEB_INPUT_SOURCE,
)
from open.core.betterself.models.daily_productivity_log import DailyProductivityLog
from open.... | [
6738,
1334,
62,
30604,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
1334,
62,
30604,
13,
25747,
1330,
7536,
15878,
11,
18502,
15878,
11,
3178,
15878,
198,
198,
6738,
1280,
13,
7295,
13,
27903,
944,
13,
9979,
1187,
1330,
357,
... | 3.029557 | 203 |
import random
import cfg
import utils
import socket
import re
import time
from time import sleep
import sys
try:
file_c = open('chanel.txt', 'r', encoding='utf-8')
CHANEL = file_c.read()
print(f'chanel = {CHANEL}')
file_c.close()
except IOError as err:
print('Please enter your CHANEL!')
print(e... | [
11748,
4738,
198,
11748,
30218,
70,
198,
11748,
3384,
4487,
198,
11748,
17802,
198,
11748,
302,
198,
11748,
640,
198,
6738,
640,
1330,
3993,
198,
11748,
25064,
198,
198,
28311,
25,
198,
220,
220,
220,
2393,
62,
66,
796,
1280,
10786,
3... | 2.4125 | 320 |
from django.urls import path
from teams.views import TeamListView
app_name = "core"
urlpatterns = [
path("", TeamListView.as_view(), name="home"),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
3466,
13,
33571,
1330,
4816,
8053,
7680,
198,
198,
1324,
62,
3672,
796,
366,
7295,
1,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7203,
1600,
4816,
8053,
76... | 2.818182 | 55 |
import os
import subprocess
import sys
from distutils.command.build import build
from distutils.spawn import find_executable
from setuptools import setup
def parse_requirements(filename):
"""
Helper which parses requirement_?.*.txt files
:param filename: relative path, e.g. `./requirements.txt`
:retu... | [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
6738,
1233,
26791,
13,
21812,
13,
11249,
1330,
1382,
198,
6738,
1233,
26791,
13,
48183,
1330,
1064,
62,
18558,
18187,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
... | 2.585321 | 545 |
from .preprocess import SynthesizerPreprocessor
from .dataset import SynthesizerDataset, collate_synthesizer
| [
6738,
764,
3866,
14681,
1330,
26375,
956,
7509,
6719,
41341,
198,
6738,
764,
19608,
292,
316,
1330,
26375,
956,
7509,
27354,
292,
316,
11,
2927,
378,
62,
1837,
429,
956,
7509,
198
] | 3.40625 | 32 |
from web3 import Web3, IPCProvider, HTTPProvider
from web3.middleware import geth_poa_middleware
from R8Blockchain.blockchain_handler import BlockchainHandler
from hashlib import sha256
import codecs
from web3.contract import ConciseContract
if __name__ == '__main__':
eth_blockchain = EthereumBlockchain.from_ip... | [
6738,
3992,
18,
1330,
5313,
18,
11,
314,
5662,
29495,
11,
14626,
29495,
198,
6738,
3992,
18,
13,
27171,
1574,
1330,
651,
71,
62,
7501,
64,
62,
27171,
1574,
198,
6738,
371,
23,
12235,
7983,
13,
9967,
7983,
62,
30281,
1330,
29724,
250... | 2.789954 | 219 |
path = "/home/nathan/OpenPCDet/data/kitti/training/velodyne/000000.bin" | [
198,
198,
6978,
796,
12813,
11195,
14,
77,
6696,
14,
11505,
5662,
11242,
14,
7890,
14,
74,
715,
72,
14,
34409,
14,
626,
1118,
710,
14,
10535,
13,
8800,
1
] | 2.433333 | 30 |
import xlrd
import os
import sys
# rootdir = 'D://code/electric/'
rootdir = sys.argv[1]
xlrd.Book.encoding = "gbk"
sumnum=0
filenum = 0
list = os.listdir(rootdir) #
for i in range(0,len(list)):
path = os.path.join(rootdir,list[i])
if os.path.isfile(path):
print(''+path)
data = xlrd.open_workbook... | [
11748,
2124,
75,
4372,
198,
11748,
28686,
198,
11748,
25064,
198,
2,
6808,
15908,
796,
705,
35,
1378,
8189,
14,
31067,
14,
6,
198,
15763,
15908,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
87,
75,
4372,
13,
10482,
13,
12685,
7656,
7... | 2.249147 | 293 |
'''
0 Preprocess segments:
-
- specify segments you want to process
- dilate slightly the segments
- create mask for dilation.
- np.unique(my_masked_id) --> select only part with biggest uc
- eliminates ouliers too disconnected/far from main structure
'''
import numpy as np
import h5py
from scipy.ndimage import binar... | [
7061,
6,
198,
15,
3771,
14681,
17894,
25,
198,
12,
198,
12,
11986,
17894,
345,
765,
284,
1429,
198,
12,
11844,
378,
4622,
262,
17894,
198,
12,
2251,
9335,
329,
288,
10520,
13,
198,
12,
45941,
13,
34642,
7,
1820,
62,
27932,
276,
62... | 2.143791 | 612 |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from dataclasses import dataclass
import sys
from cli import arg_utils
from foundations.runner import Runner
from branch impor... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
198,
... | 4.060976 | 82 |
import requests # requests
from bs4 import BeautifulSoup
import urllib.error
import re | [
11748,
7007,
1303,
7007,
220,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
2956,
297,
571,
13,
18224,
198,
11748,
302
] | 3.625 | 24 |
from setuptools import setup
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX'
] + [
('Programming Language :: Python :: %s' % x)
for x in '2.7'.split()
]
test_requirements = [
'pytest',
'pytest-cov',
'coveralls',
... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
4871,
13350,
796,
685,
198,
220,
220,
220,
705,
5317,
1631,
7591,
1240,
7904,
34152,
3256,
198,
220,
220,
220,
705,
34156,
7904,
7294,
40,
20010,
1079,
7904,
17168,
13789,
3256,
198,
220,
... | 2.346154 | 624 |
# coding=utf-8
# Copyright 2018 The Batfish Open Source Project
#
# 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 requi... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
220,
220,
15069,
2864,
383,
6577,
11084,
4946,
8090,
4935,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
... | 3.52514 | 179 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 3 01:41:52 2020
Combines LAMMPS output files coming from a series of restarts with a * wildcard.
This works on expanded (mode scalar) fixes from LAMMPS where each line is a time.
The overlapping values of times due to restarts are averaged, but th... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
8621,
220,
513,
5534,
25,
3901,
25,
4309,
12131,
198,
198,
20575,
1127,
406,
2390,
... | 2.705603 | 1,053 |
from dataclasses import dataclass
from datetime import datetime
from typing import List, Optional
from astropy.coordinates import SkyCoord
def mid_position(start: SkyCoord, end: SkyCoord) -> SkyCoord:
"""Return the mid position between a start and end position on the sky.
The mid position is the mid posit... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
6738,
6468,
28338,
13,
37652,
17540,
1330,
5274,
7222,
585,
628,
628,
198,
4299,
3095,
62,
9150,... | 2.474474 | 999 |
"""
app
"""
from flask import Flask, render_template, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
# /// = relative path, //// = absolute path
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(... | [
37811,
198,
1324,
198,
37811,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
19016,
62,
1640,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
198,
1324,
796,
46947,
7,
834,
3672,
8... | 2.783069 | 189 |
from sqlalchemy.orm import backref
from app.models import db
| [
6738,
44161,
282,
26599,
13,
579,
1330,
736,
5420,
198,
198,
6738,
598,
13,
27530,
1330,
20613,
628
] | 3.5 | 18 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import io
import logging
import os
from six import string_types
from pydatajson.helpers import traverse_dict
from pydatajson.indicators import generate_ca... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
19... | 2.268627 | 2,040 |
from tkinter import *
import tkinter
root = Tk()
scrollbar = Scrollbar(root)
scrollbar.pack( side = RIGHT, fill=Y )
mylist = Listbox(root, yscrollcommand = scrollbar.set )
for line in range(100):
mylist.insert(END, "Line number : " + str(line))
mylist.pack( side = LEFT, fill = BOTH )
scrollbar.config( command = m... | [
6738,
256,
74,
3849,
1330,
1635,
198,
11748,
256,
74,
3849,
198,
198,
15763,
796,
309,
74,
3419,
198,
48728,
5657,
796,
17428,
5657,
7,
15763,
8,
198,
48728,
5657,
13,
8002,
7,
1735,
796,
33621,
11,
6070,
28,
56,
1267,
198,
198,
1... | 2.768 | 125 |
"""Common get functions for sisf"""
# Python
import logging
import re
# Genie
from genie.metaparser.util.exceptions import SchemaEmptyParserError
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
def get_device_tracking_policy_name_configurations(device, policy):
""" Get device-tracking policy conf... | [
37811,
17227,
651,
5499,
329,
264,
4468,
37811,
198,
198,
2,
11361,
198,
11748,
18931,
198,
11748,
302,
198,
198,
2,
49405,
198,
6738,
2429,
494,
13,
4164,
499,
28198,
13,
22602,
13,
1069,
11755,
1330,
10011,
2611,
40613,
46677,
12331,
... | 2.035575 | 4,104 |
# Advent of Code 2021 - Day: 13
# Imports (Always imports data based on the folder and file name)
from aocd import data, submit
# Solution
# Call the main function.
if __name__ == '__main__':
main() | [
2,
33732,
286,
6127,
33448,
532,
3596,
25,
1511,
198,
2,
1846,
3742,
357,
30374,
17944,
1366,
1912,
319,
262,
9483,
290,
2393,
1438,
8,
198,
6738,
257,
420,
67,
1330,
1366,
11,
9199,
198,
198,
2,
28186,
198,
198,
2,
4889,
262,
138... | 3.295082 | 61 |
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# 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 appl... | [
2,
15069,
357,
66,
8,
12131,
1001,
37861,
8987,
11419,
290,
14,
273,
663,
6708,
2403,
689,
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,... | 3.2 | 390 |
print("Modules documentation: https://docs.python.org/3/tutorial/modules.html")
print("Standard modules list: https://docs.python.org/3/py-modindex.html")
import math
print(math.pi)
from math import pi
print(pi)
from math import pi as p
print(p) | [
4798,
7203,
5841,
5028,
10314,
25,
3740,
1378,
31628,
13,
29412,
13,
2398,
14,
18,
14,
83,
44917,
14,
18170,
13,
6494,
4943,
198,
4798,
7203,
23615,
13103,
1351,
25,
3740,
1378,
31628,
13,
29412,
13,
2398,
14,
18,
14,
9078,
12,
4666... | 3.02439 | 82 |
""" Utilities for creating archives
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2020-12-06
:Copyright: 2020, Center for Reproducible Biomedical Modeling
:License: MIT
"""
from .data_model import Archive, ArchiveFile
import glob
import os
__all__ = ['build_archive_from_paths']
def build_archive_from_paths(path_pa... | [
37811,
41086,
329,
4441,
22415,
198,
198,
25,
13838,
25,
11232,
509,
3258,
1279,
74,
3258,
31,
76,
824,
76,
13,
15532,
29,
198,
25,
10430,
25,
12131,
12,
1065,
12,
3312,
198,
25,
15269,
25,
12131,
11,
3337,
329,
36551,
37369,
8436,
... | 2.407609 | 552 |
"""
This class represents the info of one commit
"""
from Change import *;
| [
37811,
198,
1212,
1398,
6870,
262,
7508,
286,
530,
4589,
198,
37811,
198,
198,
6738,
9794,
1330,
1635,
26,
198
] | 3.8 | 20 |
"""YTD precip"""
import calendar
import datetime
from pandas.io.sql import read_sql
from pyiem.util import get_autoplot_context, get_dbconn
from pyiem.plot.use_agg import plt
from pyiem.network import Table as NetworkTable
def get_description():
""" Return a dict describing how to call this plotter """
desc ... | [
37811,
56,
21016,
18812,
37811,
198,
11748,
11845,
198,
11748,
4818,
8079,
198,
198,
6738,
19798,
292,
13,
952,
13,
25410,
1330,
1100,
62,
25410,
198,
6738,
12972,
26597,
13,
22602,
1330,
651,
62,
2306,
20106,
313,
62,
22866,
11,
651,
... | 2.247608 | 1,672 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: networking/v1beta1/gateway.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | [
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,
19140,
14,
85,
16,
31361,
16,
14,
10494,
1014,
13,
1676,
1462,
198,
198,... | 2.31994 | 9,283 |
'''
@Time : 2021/9/3 9:42
@Author : ljc
@FileName: dataload.py
@Software: PyCharm
'''
import os
import json
import cv2
import numpy as np
import torch
from PIL import Image
from torchvision import transforms
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
transform = transforms.Compo... | [
7061,
6,
198,
31,
7575,
220,
220,
220,
1058,
33448,
14,
24,
14,
18,
860,
25,
3682,
198,
31,
13838,
220,
1058,
300,
48055,
198,
31,
8979,
5376,
25,
4818,
282,
1170,
13,
9078,
198,
31,
25423,
25,
9485,
1925,
1670,
198,
7061,
6,
19... | 2.492228 | 193 |
import numpy as np
import os
import skimage.io as io
import skimage.transform as trans
import numpy as np
from tensorflow.keras.models import *
from tensorflow.keras.layers import *
from tensorflow.keras.optimizers import *
from tensorflow.keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras import... | [
11748,
299,
32152,
355,
45941,
220,
198,
11748,
28686,
198,
11748,
1341,
9060,
13,
952,
355,
33245,
198,
11748,
1341,
9060,
13,
35636,
355,
1007,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
27530... | 3.241667 | 240 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" run.py
Code to run the PatchVAE on different datasets
Usage:
# Run with default arguments on mnist
python run.py
Basic VAE borrowed from
https://github.com/pytorch/examples/tree/master/vae
"""
__author__ = "Kamal Gupta"
__email__ = "kampta@cs.umd.edu"
__version__ = ... | [
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,
1057,
13,
9078,
198,
10669,
284,
1057,
262,
17106,
11731,
36,
319,
1180,
40522,
198,
198,
28350,
25,
198,
... | 2.294318 | 3,520 |
import os
import sqlite3
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Optional
from fastapi import Request
from fastapi.routing import APIRouter
from loguru import logger
ENV = os.environ.copy()
USE_MONGO_DB: bool = ENV.get('USE_MONGO_DB', 'True') == 'True'
USE_POSTGRES_DB... | [
11748,
28686,
198,
11748,
44161,
578,
18,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
198,
198,
6738,
3049,
15042,
1330,
19390,
198,
673... | 2.862816 | 277 |
# encoding: UTF-8
from __future__ import with_statement
import logging
import codecs
import csv
import os
from datetime import datetime, timedelta
from decimal import Decimal
from django.db.models import Q, Sum
from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist
... | [
2,
21004,
25,
41002,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
198,
11748,
18931,
198,
11748,
40481,
82,
198,
11748,
269,
21370,
198,
11748,
28686,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
... | 2.471813 | 1,969 |
from localground.apps.site.api.serializers.base_serializer import \
BaseSerializer, NamedSerializerMixin, ProjectSerializerMixin
from localground.apps.site.api.serializers.field_serializer import \
FieldSerializer
from django.conf import settings
from rest_framework import serializers
from localground.apps.site... | [
6738,
1957,
2833,
13,
18211,
13,
15654,
13,
15042,
13,
46911,
11341,
13,
8692,
62,
46911,
7509,
1330,
3467,
198,
220,
220,
220,
7308,
32634,
7509,
11,
34441,
32634,
7509,
35608,
259,
11,
4935,
32634,
7509,
35608,
259,
198,
6738,
1957,
... | 3.623656 | 93 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : 7_PageClass_Cookie.py
@Time : 2020-8-23 01:33:25
@Author : Recluse Xu
@Version : 1.0
@Contact : 444640050@qq.com
@Desc : Page Class
https://miyakogi.github.io/pyppeteer/reference.html#pyppeteer.page.Page.target
PagePage
'''
# here ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
31,
8979,
220,
220,
220,
1058,
220,
220,
767,
62,
9876,
9487,
62,
34,
18055,
13,
9078,
198,
31,
7575,... | 2.3 | 190 |
"""
Content negotiation selects a appropriated parser and renderer for a HTTP request.
"""
from abc import ABCMeta, abstractmethod
from .mimetypes import MimeType
| [
37811,
198,
19746,
24462,
40573,
257,
32316,
30751,
290,
9851,
11882,
329,
257,
14626,
2581,
13,
198,
37811,
198,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
6738,
764,
76,
320,
2963,
12272,
1330,
337,
524,
6030,
628,
... | 3.952381 | 42 |
import unittest
import mock
import six
import codecs
import os
import json
import logging
import shutil
import tarfile
import io
from io import BytesIO
import uuid
from docker_squash.squash import Squash
from docker_squash.errors import SquashError, SquashUnnecessaryError
from docker_squash.lib import common
if not s... | [
11748,
555,
715,
395,
198,
11748,
15290,
198,
11748,
2237,
198,
11748,
40481,
82,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
4423,
346,
198,
11748,
13422,
7753,
198,
11748,
33245,
198,
6738,
33245,
1330,
2750,
48... | 2.35266 | 2,932 |
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
| [
11748,
28034,
201,
198,
11748,
10688,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
201,
198
] | 3.074074 | 27 |
import cv2
faceCascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
#capture = cv2.VideoCapture(0)
capture = cv2.VideoCapture('Elon Musk 320.mp4')
while True:
_, frame = capture.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
#faces = faceCascade.de... | [
11748,
269,
85,
17,
201,
198,
201,
198,
2550,
34,
28966,
796,
269,
85,
17,
13,
34,
28966,
9487,
7483,
7,
33967,
17,
13,
7890,
13,
3099,
5605,
3372,
2367,
1343,
366,
3099,
5605,
28966,
62,
8534,
1604,
558,
62,
12286,
13,
19875,
494... | 2.055866 | 358 |
from setuptools import setup
import sys
if sys.version_info < (2,5):
raise NotImplementedError(
"Sorry, you need at least Python 2.5 to use cprofilev.")
VERSION = '1.0.4'
__doc__ = """\
An easier way to use cProfile.
Outputs a simpler html view of profiled stats.
Able to show stats while the code is st... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
11748,
25064,
628,
198,
361,
25064,
13,
9641,
62,
10951,
1279,
357,
17,
11,
20,
2599,
198,
220,
220,
220,
5298,
1892,
3546,
1154,
12061,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366... | 2.668269 | 416 |
# standard libraries
import os
# third party libraries
pass
# first party libraries
from . import (application, routing, static, surly, requests, responses,
utils, cookies, exceptions, middleware, )
__where__ = os.path.dirname(os.path.abspath(__file__))
__all__ = ('Application', 'application', 'routin... | [
2,
3210,
12782,
198,
11748,
28686,
198,
2,
2368,
2151,
12782,
198,
6603,
198,
2,
717,
2151,
12782,
198,
6738,
764,
1330,
357,
31438,
11,
28166,
11,
9037,
11,
969,
306,
11,
7007,
11,
9109,
11,
220,
198,
220,
220,
220,
220,
220,
220... | 3.10989 | 182 |
import sys # this is for extracting command line arguments.
activator = ''
optimizer = ''
source = ''
if len(sys.argv) == 1 or (len(sys.argv) - 1) % 2 != 0:
raise ValueError("Usage: [-s image] [-a activator] [-o optimizer]")
else:
# could this be done better?
# sure, but this works for now...
for i in... | [
11748,
25064,
1303,
428,
318,
329,
37895,
3141,
1627,
7159,
13,
198,
198,
15791,
1352,
796,
10148,
198,
40085,
7509,
796,
10148,
198,
10459,
796,
10148,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
6624,
352,
393,
357,
11925,
7,
... | 2.388721 | 2,323 |
# coding: utf-8
# Author: Leo BRUNEL
# Contact: contact@leobrunel.com
# Python modules
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import pyqtSignal
import logging
# Wizard modules
from wizard.core import assets
from wizard.core import project
from wizard.vars import ressources
# Wizard gui modules
... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
6434,
25,
19632,
11177,
4944,
3698,
198,
2,
14039,
25,
2800,
31,
293,
672,
5143,
417,
13,
785,
198,
198,
2,
11361,
13103,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
54,
312,
11407,
11,
3373... | 3.10219 | 137 |
from .BaseAgent import BaseAgent
import pandas as pd
import numpy as np
from itertools import islice | [
6738,
764,
14881,
36772,
1330,
7308,
36772,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
340,
861,
10141,
1330,
318,
75,
501
] | 3.448276 | 29 |
n = float(input())
m = float(input())
max = max(n, m)
min = min(n, m)
time = max - min
print(time // 60, time % 60)
| [
77,
796,
12178,
7,
15414,
28955,
198,
76,
796,
12178,
7,
15414,
28955,
198,
9806,
796,
3509,
7,
77,
11,
285,
8,
198,
1084,
796,
949,
7,
77,
11,
285,
8,
198,
2435,
796,
3509,
532,
949,
198,
4798,
7,
2435,
3373,
3126,
11,
640,
4... | 2.367347 | 49 |
import tensorflow as tf
import matplotlib.pyplot as plt
X = [1, 2, 3]
Y = [1, 2, 3]
W = tf.placeholder(tf.float32)
hypothesis = X * W
cost = tf.reduce_mean(tf.square(hypothesis - Y))
sess = tf.Session()
sess.run(tf.global_variables_initializer())
W_val = []
cost_val = []
for i in range(-30, 50):
feed_W = i *... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
55,
796,
685,
16,
11,
362,
11,
513,
60,
198,
56,
796,
685,
16,
11,
362,
11,
513,
60,
198,
198,
54,
796,
48700,
13,
537... | 2.127193 | 228 |
"""
.. module:: test_multisampling
:synopsis: Test multisampling strategy
.. moduleauthor:: David Eriksson <dme65@cornell.edu>
"""
from pySOT import Ackley, CandidateDYCORS, GeneticAlgorithm, \
MultiStartGradient, SyncStrategyNoConstraints, \
RBFInterpolant, CubicKernel, LinearTail, \
SymmetricLatinHyper... | [
37811,
198,
492,
8265,
3712,
1332,
62,
16680,
271,
321,
11347,
198,
220,
1058,
28869,
24608,
25,
6208,
1963,
271,
321,
11347,
4811,
198,
492,
8265,
9800,
3712,
3271,
412,
39370,
1559,
1279,
67,
1326,
2996,
31,
20772,
695,
13,
15532,
2... | 2.987421 | 159 |
import torch
import argparse
from selfplaylab.game.go import CaptureGoState, PixelCaptureGoState, GoState
from selfplaylab.game.gomoku import GoMokuState, GoMokuStateAugmented, TicTacToe, TicTacToeAugmented
from selfplaylab.game.nim import NimState
from selfplaylab.game.othello import OthelloState
from selfplaylab.play... | [
11748,
28034,
198,
11748,
1822,
29572,
198,
6738,
2116,
1759,
23912,
13,
6057,
13,
2188,
1330,
31793,
5247,
9012,
11,
11349,
49630,
5247,
9012,
11,
1514,
9012,
198,
6738,
2116,
1759,
23912,
13,
6057,
13,
19120,
11601,
1330,
1514,
44,
11... | 2.865526 | 409 |
import re
def test_version():
"""Test version string"""
from coco2customvision import __version__
version_parts = re.split("[.-]", __version__)
if __version__ != "UNKNOWN":
assert 3 <= len(version_parts), "must have at least Major.minor.patch"
assert all(
not try_parse_in... | [
11748,
302,
628,
198,
198,
4299,
1332,
62,
9641,
33529,
198,
220,
220,
220,
37227,
14402,
2196,
4731,
37811,
198,
220,
220,
220,
422,
8954,
78,
17,
23144,
10178,
1330,
11593,
9641,
834,
628,
220,
220,
220,
2196,
62,
42632,
796,
302,
... | 2.616766 | 167 |
# -*- coding: utf-8 -*-
from Pages.PageObject import PageObject
import time
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
6738,
28221,
13,
9876,
10267,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1330,
7873,
10267,
201,
198,
11748,
640,
201,
198,
201,
198
] | 2.111111 | 45 |
import requests
from bs4 import BeautifulSoup
notebook_html = requests.get('https://search.shopping.naver.com/search/all?pagingIndex=2&pagingSize=80&query=')
notebook_soup = BeautifulSoup(notebook_html.text,"html.parser")
notebook_list_box = notebook_soup.find("ul", {"class" : "list_basis"})
notebook_list = notebook_l... | [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11295,
2070,
62,
6494,
796,
7007,
13,
1136,
10786,
5450,
1378,
12947,
13,
1477,
33307,
13,
2616,
332,
13,
785,
14,
12947,
14,
439,
30,
79,
3039,
15732,
28,
17,
5,
7... | 2.539347 | 521 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
QUANDLKEY = '<Enter your Quandl APT key here>'
"""
Created on Fri Oct 5 23:24:35 2018
@author: jeff
"""
'''*************************************
#1. Import libraries and define key variables
'''
import pandas as pd
import numpy as np
import quandl
import matplotlib.pyplo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
10917,
6981,
43,
20373,
796,
705,
27,
17469,
534,
2264,
392,
75,
3486,
51,
1994,
994,
29,
6,
198,
37811,
198,
4... | 2.195589 | 1,723 |
import random
uppercase_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lowercase_letters = "abcdefghijklmnopqrstuvwxyz"
digits = "0123456789"
symbols = "!@#$%^&*()_+-=[]{}|;':,./<>?"
upper, lower, digit, symbol = True, True, True, True
all = ""
if upper :
all += uppercase_letters
if lower :
all += lo... | [
11748,
4738,
201,
198,
201,
198,
7211,
2798,
589,
62,
15653,
796,
366,
24694,
32988,
17511,
23852,
42,
31288,
45,
3185,
48,
49,
2257,
52,
30133,
34278,
57,
1,
201,
198,
21037,
7442,
62,
15653,
796,
366,
39305,
4299,
456,
2926,
41582,
... | 2.245763 | 236 |
import sqlite3
import pandas
import itertools
import networkx as nx
from gtfspy.gtfs import GTFS
from gtfspy.util import timeit
from scripts.all_to_all_settings import *
"""
AllToAllDifferenceAnalyzer calculates the difference between various summary statistics of temporal distance and number
of boardings, stores th... | [
11748,
44161,
578,
18,
198,
11748,
19798,
292,
198,
11748,
340,
861,
10141,
198,
11748,
3127,
87,
355,
299,
87,
198,
6738,
308,
27110,
2777,
88,
13,
13655,
9501,
1330,
7963,
10652,
198,
6738,
308,
27110,
2777,
88,
13,
22602,
1330,
640... | 2.500975 | 513 |
from flowsaber.api import *
def test_snakemake_workflow():
# EnvTask is the real dependent task when using conda/image option
prefix = 'tests/test_flow/snamke-demo.nosync/data'
with flowsaber.context({
"fa": f'{prefix}/genome.fa',
"fastq": [f'{prefix}/samples/{sample}' for sample in ['A.... | [
6738,
15623,
27359,
13,
15042,
1330,
1635,
628,
198,
4299,
1332,
62,
16184,
539,
15883,
62,
1818,
11125,
33529,
198,
220,
220,
220,
1303,
2039,
85,
25714,
318,
262,
1103,
10795,
4876,
618,
1262,
1779,
64,
14,
9060,
3038,
628,
198,
220... | 2.324201 | 219 |
mass = eval(input("Enter the amount of water in kilograms: "))
initial_temp = eval(input("Enter the initial temperature: "))
final_temp = eval(input("Enter the final temperature: "))
energy = mass * (final_temp - initial_temp) * 4184
print("The energy needed is {}".format(energy))
| [
22208,
796,
5418,
7,
15414,
7203,
17469,
262,
2033,
286,
1660,
287,
37075,
25,
366,
4008,
198,
36733,
62,
29510,
796,
5418,
7,
15414,
7203,
17469,
262,
4238,
5951,
25,
366,
4008,
198,
20311,
62,
29510,
796,
5418,
7,
15414,
7203,
17469... | 3.56962 | 79 |
from django.apps import AppConfig
from django.conf import settings
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
628
] | 4 | 17 |
import glob
import SimpleITK as sitk
import numpy as np
| [
11748,
15095,
198,
11748,
17427,
2043,
42,
355,
1650,
74,
198,
11748,
299,
32152,
355,
45941,
198,
220,
220
] | 3.052632 | 19 |
"""
Section 1
Multithreading - Thread (2) - Daemon, Join
Keyword - DaemonThread, Join
"""
"""
DaemonThread()
(1).
(2). ( .)
(3). -> JVM( ),
(4).
"""
import logging
import threading
#
#
if __name__ == "__main__":
# Logging format
format = "%(asctime)s: %(message)s"
l... | [
37811,
198,
16375,
352,
198,
15205,
342,
25782,
532,
14122,
357,
17,
8,
532,
9637,
7966,
11,
15251,
198,
9218,
4775,
532,
9637,
7966,
16818,
11,
15251,
198,
37811,
198,
37811,
198,
26531,
7966,
16818,
3419,
198,
7,
16,
737,
220,
220,
... | 2.259681 | 439 |
#!/usr/bin/env python3
# PURPOSE: studying function side effects
import os
os.system('clear')
orgList = [5, 3, 2, 1, 4]
print(sumList(orgList))
print(orgList)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
33079,
48933,
25,
11065,
2163,
1735,
3048,
198,
198,
11748,
28686,
198,
418,
13,
10057,
10786,
20063,
11537,
198,
198,
2398,
8053,
796,
685,
20,
11,
513,
11,
362,
11,
352... | 2.587302 | 63 |
import pandas as pd
import numpy as np
serie = pd.Series(['a', 'b', 'c', 'd', 'e'],
index=['a', 'b', 'c', 'd', 'e'],
name="Ejemplo Serie")
print(serie)
ecoli_matraz = pd.Series([0.1, 0.15, 0.19, 0.5,
0.9, 1.4, 1.8, 2.1, 2.3],
... | [
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
2655,
494,
796,
279,
67,
13,
27996,
7,
17816,
64,
3256,
705,
65,
3256,
705,
66,
3256,
705,
67,
3256,
705,
68,
6,
4357,
201,
198,
220,
... | 1.937247 | 988 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
""" Script to prepare mit67 dataset for pytorch dataloader.
"""
from typing import List, Dict, Tuple, Union, Optional
import os
import pdb
import time
import argparse
import os
import tempfile
import requests
from torchvision.datasets.utils imp... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
198,
37811,
12327,
284,
8335,
10255,
3134,
27039,
329,
12972,
13165,
354,
4818,
282,
1170,
263,
13,
198,
37811,
198,
198,
6738,
19720,
1330,
7343,
... | 2.566372 | 1,356 |
from tail.core import read_last_lines, follow_lines
__all__ = ["read_last_lines", "follow_lines"]
| [
6738,
7894,
13,
7295,
1330,
1100,
62,
12957,
62,
6615,
11,
1061,
62,
6615,
198,
198,
834,
439,
834,
796,
14631,
961,
62,
12957,
62,
6615,
1600,
366,
27780,
62,
6615,
8973,
198
] | 3 | 33 |
# Copyright 2018 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
2,
15069,
2864,
19764,
11421,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 2.060716 | 42,954 |
"""
_InsertRecoReleaseConfig_
Oracle implementation of InsertRecoReleaseConfig
"""
from WMCore.Database.DBFormatter import DBFormatter
| [
37811,
198,
62,
44402,
6690,
78,
26362,
16934,
62,
198,
198,
48625,
7822,
286,
35835,
6690,
78,
26362,
16934,
198,
198,
37811,
198,
6738,
370,
9655,
382,
13,
38105,
13,
11012,
8479,
1436,
1330,
20137,
8479,
1436,
198
] | 3.605263 | 38 |
import wave
import os
import sys
from glob import glob
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--length", type=int, default=30)
parser.add_argument("--offset", type=int, default=15)
args = parser.parse_args()
unit_time_length = args.length
start_time_offset = args.offset
output_dir =... | [
11748,
6769,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
15095,
1330,
15095,
198,
11748,
1822,
29572,
628,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
13664,
1600,
2099,
28,... | 2.487952 | 664 |
import sys
import qbittorrentapi
import json
from ui import UI
print("Connecting to qBittorrent WebUI...")
with open('config.json') as json_file:
config = json.load(json_file)
host = config['host']
username = config['username']
password = config['password']
if not host:
host = inp... | [
11748,
25064,
201,
198,
201,
198,
11748,
10662,
65,
715,
273,
1156,
15042,
201,
198,
11748,
33918,
201,
198,
6738,
334,
72,
1330,
12454,
201,
198,
201,
198,
4798,
7203,
13313,
278,
284,
10662,
33,
715,
273,
1156,
5313,
10080,
9313,
8,... | 2.556338 | 284 |
from tkinter import *
janela = Tk()
lista = []
texto1 = StringVar()
texto2 = StringVar()
texto3 = StringVar()
texto4 = StringVar()
#--------------------- PROCESSAMENTO DO COMANDO ------
#------------------------------------------------------
#---------------INSERO DOS WIDGETS ---------------
lb1 = Label(janela, te... | [
6738,
256,
74,
3849,
1330,
1635,
198,
198,
13881,
10304,
796,
309,
74,
3419,
198,
198,
4868,
64,
796,
17635,
198,
5239,
78,
16,
796,
10903,
19852,
3419,
198,
5239,
78,
17,
796,
10903,
19852,
3419,
198,
5239,
78,
18,
796,
10903,
1985... | 2.57101 | 683 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
"""
NPC
"""
"""
- Player
-
- AI
"""
__author__ = "aseruneko"
__date__ = "28 May 2020"
from main.Player import Player | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
45,
5662,
198,
37811,
198,
198,
37811,
198,
12,
7853,
198,
12,
220,
198,
12,
9552,
198,
37811,
198,... | 2.256757 | 74 |