content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import math
def cosine_lr_scheduler(
lr: float,
n_warmup: int = 0,
warmup_init_lr: float = -1,
min_lr: float = 0.0,
t_mult: float = 1.0,
lr_period_updates: float = -1,
lr_shrink: float = 0.1,
max_update: int = -1,
):
"""Cosine annealing learning rate scheduler with warmup and step ... | [
11748,
10688,
628,
198,
4299,
8615,
500,
62,
14050,
62,
1416,
704,
18173,
7,
198,
220,
220,
220,
300,
81,
25,
12178,
11,
198,
220,
220,
220,
299,
62,
31975,
929,
25,
493,
796,
657,
11,
198,
220,
220,
220,
5814,
929,
62,
15003,
6... | 2.388128 | 657 |
from typing import List
from dash.exceptions import PreventUpdate
from ..server import app
from dash.dependencies import Input, Output, State
from ..layout.layout_ids import *
from ..layout.pages import get_task_description_layout
from ..components import tools, poagraph
@app.callback(
Output(id_pangenome_hidden... | [
6738,
19720,
1330,
7343,
198,
198,
6738,
14470,
13,
1069,
11755,
1330,
31572,
10260,
198,
6738,
11485,
15388,
1330,
598,
198,
6738,
14470,
13,
45841,
3976,
1330,
23412,
11,
25235,
11,
1812,
198,
6738,
11485,
39786,
13,
39786,
62,
2340,
... | 2.741611 | 298 |
import os
import sys
# Path restructure for imports
script_dir = os.path.dirname( __file__ )
main_dir = os.path.join( script_dir, '..' )
sys.path.append( main_dir )
from web_app.app import create_app
APP = create_app() # Initializing APP
# Helpful code for development
# set FLASK_ENV=development
# set FLASK_APP=w... | [
11748,
28686,
198,
11748,
25064,
198,
198,
2,
10644,
1334,
5620,
329,
17944,
198,
12048,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
11593,
7753,
834,
1267,
198,
12417,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7,
4226,
62,... | 2.75 | 136 |
from django.shortcuts import render
from .forms import ContactForm
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
764,
23914,
1330,
14039,
8479,
198,
220,
198,
220,
220
] | 3.55 | 20 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2018 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43907,
25,
7400,
11338,
28,
19,
6482,
10394,
28,
19,
2705,
8658,
11338,
28,
19,
198,
2,
198,
2,
15069,
357,
34,
8,
1853,
12,
7908,
402,
3620,
5693,
198,
2,
198,... | 2.346145 | 8,326 |
"""Init module for lang_pref_middleware."""
__version__ = '0.3.0'
| [
37811,
31768,
8265,
329,
42392,
62,
3866,
69,
62,
27171,
1574,
526,
15931,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
18,
13,
15,
6,
198
] | 2.481481 | 27 |
import copy
import os
import sys
import importlib
import itertools
import warnings
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None
from pandas.api.types import (
is_bool_dtype,
is_categorical_dtype,
is_datetime64_any_dtype,
is_numeric_dtype,
is_object_dtype,
is... | [
11748,
4866,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
1330,
8019,
198,
11748,
340,
861,
10141,
198,
11748,
14601,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
30094,
13,
25811,
13,
14171,
... | 2.253292 | 13,747 |
import globus_sdk
CLIENT_ID = '0e37e11f-29e6-404c-86e2-d8d87d0c68ee'
client = globus_sdk.NativeAppAuthClient(CLIENT_ID)
client.oauth2_start_flow(refresh_tokens=True)
authorize_url = client.oauth2_get_authorize_url()
print('Please go to this URL and login: {0}'.format(authorize_url))
# this is to work on Python2 an... | [
11748,
15095,
385,
62,
21282,
74,
628,
198,
5097,
28495,
62,
2389,
796,
705,
15,
68,
2718,
68,
1157,
69,
12,
1959,
68,
21,
12,
26429,
66,
12,
4521,
68,
17,
12,
67,
23,
67,
5774,
67,
15,
66,
3104,
1453,
6,
198,
198,
16366,
796,... | 2.931481 | 540 |
from .base import read_grid
| [
6738,
764,
8692,
1330,
1100,
62,
25928,
198
] | 3.5 | 8 |
# https://www.unacast.com/covid19/social-distancing-scoreboard
import csv
from datetime import datetime
import requests
import time
if __name__ == '__main__':
run_unacast()
| [
2,
3740,
1378,
2503,
13,
403,
330,
459,
13,
785,
14,
66,
709,
312,
1129,
14,
14557,
12,
17080,
5077,
12,
26675,
3526,
198,
198,
11748,
269,
21370,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
7007,
198,
11748,
640,
198,
198,... | 2.8125 | 64 |
import webbrowser
from http.cookies import CookieError, Morsel, SimpleCookie
import browser_cookie3
from loguru import logger
import aiohttp
class WebsiteSource():
''' Class for handling logins to a website and reusing existing login data. '''
def __init__(self, session_cookie_domain, login_url):
'... | [
11748,
3992,
40259,
198,
6738,
2638,
13,
27916,
444,
1330,
39606,
12331,
11,
3461,
741,
11,
17427,
34,
18055,
198,
198,
11748,
6444,
62,
44453,
18,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
11748,
257,
952,
4023,
628,
198,
4871,
... | 2.52117 | 1,299 |
"""MIT License
Copyright (c) 2021 Jacopo Schiavon
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 use, copy, modify, merge, publish... | [
37811,
36393,
13789,
198,
198,
15269,
357,
66,
8,
33448,
8445,
404,
78,
3059,
544,
26982,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314,
3696,... | 3.052147 | 652 |
# Generated by Django 2.2.12 on 2020-09-16 11:46
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1065,
319,
12131,
12,
2931,
12,
1433,
1367,
25,
3510,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628,
628
] | 2.774194 | 31 |
# 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 math
from typing import Dict, List, Optional
import torch
import torch.nn as nn
from fairseq import utils
from fairseq.distributed imp... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
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,
... | 2.192397 | 3,867 |
"""
Create, configure, and define routing for a Sanic application. Implement middleware for authorization and XSS
protection.
"""
import ssl
from hashlib import sha256
from collections import OrderedDict
from sanic import Sanic
from sanic.exceptions import Forbidden
from sanic_cors import CORS
from sanic_openapi imp... | [
37811,
198,
16447,
11,
17425,
11,
290,
8160,
28166,
329,
257,
2986,
291,
3586,
13,
48282,
3504,
1574,
329,
19601,
290,
1395,
5432,
198,
42846,
13,
198,
37811,
198,
198,
11748,
264,
6649,
198,
6738,
12234,
8019,
1330,
427,
64,
11645,
1... | 2.982097 | 1,173 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198
] | 3.777778 | 9 |
import torch
import torch.utils.model_zoo as model_zoo
from urllib.parse import urlparse
| [
11748,
28034,
198,
11748,
28034,
13,
26791,
13,
19849,
62,
89,
2238,
355,
2746,
62,
89,
2238,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198
] | 3.178571 | 28 |
from sense_hat import SenseHat
import time
# Create a sense object
sense = SenseHat()
# Reduce the brightness of the LED display
sense.low_light = True
# Create variables to hold each RGB color we want to use
r = (255, 0, 0) # red
p = (204, 0, 204) # pink
o = (255, 128, 0) # orange
y = (255, 255, 0) #... | [
6738,
2565,
62,
5183,
1330,
24956,
40483,
198,
11748,
640,
198,
198,
2,
13610,
257,
2565,
2134,
198,
33819,
796,
24956,
40483,
3419,
198,
220,
220,
220,
220,
198,
2,
44048,
262,
22204,
286,
262,
12365,
3359,
198,
33819,
13,
9319,
62,
... | 1.62067 | 1,732 |
#
# This project incorporates material from the project listed above, and it
# is accessible under their original license terms (Apache License 2.0)
# ==============================================================================
import numpy as np
import tensorflow as tf
def conv_kernel_initializer(shape, dtype=None... | [
2,
198,
2,
770,
1628,
33181,
2587,
422,
262,
1628,
5610,
2029,
11,
290,
340,
198,
2,
318,
9857,
739,
511,
2656,
5964,
2846,
357,
25189,
4891,
13789,
362,
13,
15,
8,
198,
2,
38093,
25609,
28,
198,
11748,
299,
32152,
355,
45941,
198... | 2.853865 | 828 |
# Copyright (c) 2022, softwarehut and Contributors
# See license.txt
# import frappe
import unittest
| [
2,
15069,
357,
66,
8,
33160,
11,
3788,
71,
315,
290,
25767,
669,
198,
2,
4091,
5964,
13,
14116,
198,
198,
2,
1330,
5306,
27768,
198,
11748,
555,
715,
395,
198
] | 3.290323 | 31 |
import re
import os, os.path as op
import subprocess as sp
def handle_multiple_imgs(context):
"""
fslstats allows multiple nii's to be submited as the (a) input image,
(b) mask image, and (c) difference image. To accomodate multiple nii's,
create a custom-user field to build the custom_dict with arg:n... | [
11748,
302,
198,
11748,
28686,
11,
28686,
13,
6978,
355,
1034,
198,
11748,
850,
14681,
355,
599,
628,
198,
4299,
5412,
62,
48101,
62,
9600,
82,
7,
22866,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
277,
6649,
34242,
3578,
3... | 2.507212 | 1,664 |
#!/programas/python3.5/bin/python3
'''
Created on 08/10/2017
@author: ernesto
'''
import sys
import logging
from bisect import bisect_left
from functools import reduce
from operator import mul,truediv,mod
from math import gcd,pow
nivel_log = logging.ERROR
#nivel_log = logging.DEBUG
logger_cagada = None
# print... | [
2,
48443,
23065,
292,
14,
29412,
18,
13,
20,
14,
8800,
14,
29412,
18,
198,
7061,
6,
198,
41972,
319,
8487,
14,
940,
14,
5539,
198,
31,
9800,
25,
220,
1142,
395,
78,
198,
7061,
6,
198,
198,
11748,
25064,
198,
11748,
18931,
198,
6... | 2.422764 | 246 |
import unittest
from rdp import (GrammarBuilder, flatten, drop, epsilon, Terminal, Regexp, Parser)
from rdp import builtins
| [
11748,
555,
715,
395,
198,
198,
6738,
374,
26059,
1330,
357,
38,
859,
3876,
32875,
11,
27172,
268,
11,
4268,
11,
304,
862,
33576,
11,
24523,
11,
797,
25636,
79,
11,
23042,
263,
8,
198,
6738,
374,
26059,
1330,
3170,
1040,
628,
198
] | 2.953488 | 43 |
if __name__ == "__main__":
test() | [
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1332,
3419
] | 2.222222 | 18 |
import gym
import matplotlib.pyplot as plt
import numpy as np
from gym import wrappers
import pickle
theta_space = np.linspace(-1, 1, 10)
theta_dot_space = np.linspace(-10, 10, 10)
if __name__ == '__main__':
env = gym.make('Acrobot-v1')
n_games = 100
alpha = 0.1
gamma = 0.99
eps = 0
action_sp... | [
11748,
11550,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11550,
1330,
7917,
11799,
198,
11748,
2298,
293,
198,
198,
1169,
8326,
62,
13200,
796,
45941,
13,
21602,
10223,
3... | 1.945826 | 1,126 |
from __future__ import print_function
from __future__ import division
import os
import torch
import collections
from models.get_network import build_network_by_name, repvgg_model_convert
import config as cfg
import shutil
if __name__ == '__main__':
main()
# convert to MNN
# ./MNNConvert -f ONNX --mo... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
17268,
198,
6738,
4981,
13,
1136,
62,
27349,
1330,
1382,
62,
27349,
62,
1525,
62,
3672,
11,
... | 2.79558 | 181 |
import re
data = input()
pattern = r"(^|(?<=\s))-?\d+(\.\d+)?($|(?=\s))"
numbers = re.finditer(pattern, data)
result = [num.group() for num in numbers]
print(*result) | [
11748,
302,
201,
198,
201,
198,
7890,
796,
5128,
3419,
201,
198,
33279,
796,
374,
18109,
61,
91,
7,
30,
27,
28,
59,
82,
4008,
12,
30,
59,
67,
33747,
17405,
59,
67,
10,
19427,
16763,
91,
7,
30,
28,
59,
82,
4008,
1,
201,
198,
... | 2.217949 | 78 |
from django.db import models
from django.core.validators import RegexValidator
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.dispatch import receiver
from django.db.models.signals import post_save
# from django.contrib.auth.signals import user_logged_in
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
797,
25636,
47139,
1352,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,... | 3.340659 | 91 |
from django.shortcuts import redirect, render
# from django.http import HttpResponse, HttpResponseRedirect
from .models import Extentions
from .forms import ExtentionsForm, QueueForm
from django import forms
from django.contrib import messages
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
11,
8543,
198,
2,
422,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
11,
367,
29281,
31077,
7738,
1060,
198,
6738,
764,
27530,
1330,
5683,
298,
507,
198,
6738,
764,
23914,
1330,
5683... | 3.791667 | 72 |
import socket
from assertpy import assert_that
from mock import Mock, PropertyMock, call
import klimalogger
| [
11748,
17802,
198,
198,
6738,
6818,
9078,
1330,
6818,
62,
5562,
198,
6738,
15290,
1330,
44123,
11,
14161,
44,
735,
11,
869,
198,
198,
11748,
479,
2475,
11794,
1362,
628
] | 3.7 | 30 |
import math
import numpy as np
from helpers.common import preprocess
from similarity.helpers import (
get_indexed_terms,
get_term_frequencies_data,
get_inverse_frequencies,
# get_number_of_documents
)
from classifier.models import ClassifiedDocument
class DocumentSimilarityModel:
"""
Class fo... | [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
49385,
13,
11321,
1330,
662,
14681,
198,
6738,
26789,
13,
16794,
364,
1330,
357,
198,
220,
220,
220,
651,
62,
9630,
276,
62,
38707,
11,
198,
220,
220,
220,
651,
62,
4... | 2.252708 | 554 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : horovod-example.
# @File : submit.py
# @Time : 2020/7/3 10:50 上午
# @Author : yuanjie
# @Email : yuanjie@xiaomi.com
# @Software : PyCharm
# @Description :
from cloud_ml_sdk.client import CloudMlClient
from cloud_ml_sdk.m... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
16775,
220,
220,
220,
220,
220,
1058,
3076,
709,
375,
12,
20688,
13,
198,
2,
2488,
8979,
220,
220,
220,
22... | 2.111399 | 386 |
from pypy.interpreter.error import oefmt
from rpython.rtyper.lltypesystem import rffi
from rpython.rlib.rarithmetic import r_singlefloat, r_longfloat
from rpython.rlib.rbigint import rbigint
from pypy.module._cffi_backend import newtype
# Mixins to refactor type-specific codef from converter and executor classes
# (... | [
6738,
279,
4464,
88,
13,
3849,
3866,
353,
13,
18224,
1330,
267,
891,
16762,
198,
198,
6738,
374,
29412,
13,
81,
774,
525,
13,
297,
19199,
6781,
1330,
374,
487,
72,
198,
6738,
374,
29412,
13,
81,
8019,
13,
20040,
29848,
1330,
374,
... | 2.398887 | 539 |
# desc: description used for logging test results
# type dom element
# attribute: search dom element by unique attribute, i.e.: id, name, class, css_selector or xpath
# wait can specify how long script can wait after
from constants import all as c
from models.type import Type
from models.attribute import Attribute
... | [
2,
1715,
25,
6764,
973,
329,
18931,
1332,
2482,
198,
2,
2099,
2401,
5002,
198,
2,
11688,
25,
2989,
2401,
5002,
416,
3748,
11688,
11,
1312,
13,
68,
11207,
4686,
11,
1438,
11,
1398,
11,
269,
824,
62,
19738,
273,
393,
2124,
6978,
198... | 4.38835 | 103 |
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
import matplotlib.pyplot as plt
from PyQt5.QtWidgets import (QWidget, QListWidget, QVBoxLayout,
QHBoxLayout, QPushButton, QG... | [
6738,
2603,
29487,
8019,
13,
1891,
2412,
13,
1891,
437,
62,
39568,
20,
9460,
1330,
11291,
6090,
11017,
48,
5603,
1130,
355,
11291,
6090,
11017,
198,
6738,
2603,
29487,
8019,
13,
1891,
2412,
13,
1891,
437,
62,
39568,
20,
9460,
1330,
42... | 2.575163 | 153 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from widgetastic.widget import Checkbox, View, TextInput
from widgetastic.utils import Version, VersionPick
def test_empty_verpick_fails():
"""VersionPick requires a non-empty dictionary."""
with pytest.raises(ValueError):
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
26295,
3477,
13,
42655,
1330,
6822,
3524,
11,
3582,
11,
8255,
2... | 2.992806 | 139 |
import tensorflow as tf
import tensorflow_datasets as tfds
tfds.disable_progress_bar()
import math
import numpy as np
import matplotlib.pyplot as plt
import logging
logger = tf.get_logger()
logger.setLevel(logging.ERROR)
dataset, metadata = tfds.load('fashion_mnist', as_supervised=True, with_info=True)
train_datase... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
11748,
11192,
273,
11125,
62,
19608,
292,
1039,
355,
48700,
9310,
198,
27110,
9310,
13,
40223,
62,
33723,
62,
5657,
3419,
198,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
1... | 2.46744 | 1,121 |
import abc
import json
import xml.etree.ElementTree as et
# Product
# Concrete Product
# Concrete Product
# Concrete Creator
song = Song('1', 'Song name', 'Song Artist')
factory = SerializeFactory()
json_serializer = factory._get_serializer('json')
xml_serializer = factory._get_serializer('xml')
print(json_se... | [
11748,
450,
66,
198,
11748,
33918,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
2123,
198,
198,
2,
8721,
198,
198,
2,
1482,
38669,
8721,
198,
198,
2,
1482,
38669,
8721,
628,
198,
198,
2,
1482,
38669,
21038,
628,
198,
3405... | 3.139344 | 122 |
import unittest
import darwin
if __name__ == '__main__':
unittest.main()
| [
198,
11748,
555,
715,
395,
198,
11748,
288,
283,
5404,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.424242 | 33 |
#!/usr/bin/env python3.4
#
# Copyright 2016 - Google
#
# 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,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
19,
198,
2,
198,
2,
220,
220,
15069,
1584,
532,
3012,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
22... | 2.712702 | 2,165 |
"""
input defines and processes input.
This includes the map, characters, and monsters.
public classes of this file are "DTO"s, or Data Transfer Objects.
They are intended solely to convey data and contain little or
no public logic.
"""
import json
import jsonschema # type: ignore
import logging
import pathlib
impor... | [
37811,
198,
15414,
15738,
290,
7767,
5128,
13,
198,
198,
1212,
3407,
262,
3975,
11,
3435,
11,
290,
10963,
13,
198,
11377,
6097,
286,
428,
2393,
389,
366,
35,
10468,
1,
82,
11,
393,
6060,
20558,
35832,
13,
198,
2990,
389,
5292,
9944,... | 2.374575 | 2,942 |
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
PreprintFactory,
AuthUserFactory,
PreprintProviderFactory,
)
from osf.utils import permissions as osf_permissions
@pytest.mark.django_db
@pytest.mark.enable_quickfiles_creation
| [
11748,
12972,
9288,
198,
198,
6738,
40391,
13,
8692,
13,
33692,
13,
12286,
82,
1330,
7824,
62,
33,
11159,
198,
6738,
267,
28202,
62,
41989,
13,
22584,
1749,
1330,
357,
198,
220,
220,
220,
3771,
4798,
22810,
11,
198,
220,
220,
220,
2... | 2.969072 | 97 |
import eventlet
eventlet.monkey_patch()
from eventlet import wsgi
from flask import Flask, render_template
from flask_sock import Sock
app = Flask(__name__)
sock = Sock(app)
@app.route('/')
@sock.route('/echo')
if __name__ == '__main__':
wsgi.server(eventlet.listen(('', 5000)), app)
| [
11748,
1785,
1616,
198,
15596,
1616,
13,
49572,
62,
17147,
3419,
198,
198,
6738,
1785,
1616,
1330,
266,
82,
12397,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
198,
6738,
42903,
62,
82,
735,
1330,
311,
735,
198,
1324,
796,
4694... | 2.642857 | 112 |
from tkinter import Button, Entry, Frame, Label, OptionMenu, StringVar, Toplevel, messagebox
from tkinter.constants import DISABLED, NORMAL, RADIOBUTTON, RAISED, SUNKEN, TOP
import string
# ===CALLBACKS===
| [
6738,
256,
74,
3849,
1330,
20969,
11,
21617,
11,
25184,
11,
36052,
11,
16018,
23381,
11,
10903,
19852,
11,
309,
643,
626,
11,
3275,
3524,
198,
6738,
256,
74,
3849,
13,
9979,
1187,
1330,
13954,
6242,
30465,
11,
25273,
42126,
11,
33540,... | 3.072464 | 69 |
from typing import List, Optional
from dataclasses import dataclass
UserID = str
BotID = str
ChannelID = str
@dataclass
class Channel:
"""
https://api.slack.com/types/channel
"""
id: ChannelID
name: str
is_archived: bool
is_member: bool
@staticmethod
@dataclass
class User:
"""
... | [
6738,
19720,
1330,
7343,
11,
32233,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
12982,
2389,
796,
965,
198,
20630,
2389,
796,
965,
198,
29239,
2389,
796,
965,
628,
198,
31,
19608,
330,
31172,
198,
4871,
11102,
25,
1... | 2.441748 | 206 |
import FWCore.ParameterSet.Config as cms
from HeavyFlavorAnalysis.Skimming.jpsiToMuMu_SkimPath_cff import *
from HeavyFlavorAnalysis.Skimming.upsilonToMuMu_SkimPath_cff import *
from HeavyFlavorAnalysis.Skimming.bToMuMu_SkimPath_cff import *
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
14089,
7414,
5570,
32750,
13,
15739,
27428,
13,
73,
862,
72,
2514,
33239,
33239,
62,
15739,
320,
15235,
62,
66,
487,
1330,
1635,
198,
6738,
14089,
7414,
5... | 2.870588 | 85 |
import json
import os
import shutil
from typing import Optional
from generate.mcuuid import MCUUID
if __name__ == "__main__":
# Remove 'locations' and 'looking_at' folders to clean container directories
shutil.rmtree(locations_dir())
shutil.rmtree(looking_at_dir())
with open("locations.js... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
7716,
13,
23209,
12303,
312,
1330,
13122,
52,
27586,
628,
628,
628,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
... | 1.78192 | 5,365 |
#!/usr/bin/env python3
# coding=utf-8
import os
import subprocess
import requests
import yaml
import json
import sys
from pathlib import Path
from loguru import logger
from yuque import YuQue
from lake2md import lake_to_md
from dotenv import dotenv_values
user_config = dotenv_values(".env")
if __name__ =... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
7007,
198,
11748,
331,
43695,
198,
11748,
33918,
198,
11748,
25064,
198,
198,
6738,
3108,
8... | 2.695946 | 148 |
import bpy #blender module give the way to translate, access, definitions of data ans many ather utilities
import lxml #traittement du fichier gml
from mathutils import Vector
from bpy_extras.io_utils import ImportHelper
from bpy.props import StringProperty, BoolProperty, FloatProperty
from bpy.types import Ope... | [
11748,
275,
9078,
1303,
2436,
2194,
8265,
1577,
262,
835,
284,
15772,
11,
1895,
11,
17336,
286,
1366,
220,
9093,
867,
379,
372,
20081,
220,
201,
198,
11748,
300,
19875,
1303,
9535,
715,
972,
7043,
277,
488,
959,
308,
4029,
220,
201,
... | 3.371429 | 175 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
9979,
415,
13,
22973,
34184,
1187,
1330,
163... | 2.446809 | 47 |
import os
from datetime import date
from pony.orm import *
__author__ = 'Juan Manuel Bermúdez Cabrera'
db_path = os.path.join('../resources', 'Pacientes.sqlite')
db = Database("sqlite", db_path, create_db=True)
db.generate_mapping(check_tables=True, create_tables=True)
with db_session:
... | [
11748,
28686,
201,
198,
6738,
4818,
8079,
1330,
3128,
201,
198,
201,
198,
6738,
26902,
13,
579,
1330,
1635,
201,
198,
201,
198,
834,
9800,
834,
796,
705,
41,
7258,
25995,
36967,
21356,
2934,
89,
49858,
6,
201,
198,
201,
198,
9945,
6... | 2.014409 | 347 |
import random
import string
| [
11748,
4738,
201,
198,
11748,
4731,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.375 | 16 |
import os
from aoc.utils.file_reader import read_file_line
from aoc.utils.file_reader import path_join
directory_path = os.path.dirname(os.path.realpath(__file__))
input_filename = "input.txt"
"""
Each line gives the password policy and then the password. The password policy indicates the lowest and highest number o... | [
11748,
28686,
198,
198,
6738,
257,
420,
13,
26791,
13,
7753,
62,
46862,
1330,
1100,
62,
7753,
62,
1370,
198,
6738,
257,
420,
13,
26791,
13,
7753,
62,
46862,
1330,
3108,
62,
22179,
198,
198,
34945,
62,
6978,
796,
28686,
13,
6978,
13,... | 4.063545 | 299 |
# -*- coding: utf-8 -*-
"""
Queue module
This module implement a simeple queue data structrue basing on sqlite3.
Class:
TaskQueue
"""
import sqlite3
import json
import time
from .tracing import TaskTracing
from .tasklock import TaskLock
# Max try-time of queuelock to acquire the lock
QUEUE_LOCK_TRY_TIME = 10
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
34991,
8265,
198,
198,
1212,
8265,
3494,
257,
264,
524,
1154,
16834,
1366,
2878,
24508,
1615,
278,
319,
44161,
578,
18,
13,
628,
198,
9487,
25,
198,
198,
2... | 2.153787 | 1,294 |
from JumpScale import j
descr = """
tell stat aggregator to cleanup history
"""
organization = "jumpscale"
author = "kristof@incubaid.com"
license = "bsd"
version = "1.0"
category = "monitoring.aggregate"
period = 600 #always in sec
enable=False
async=False
roles = []
| [
6738,
15903,
29990,
1330,
474,
198,
198,
20147,
81,
796,
37227,
198,
33331,
1185,
13262,
1352,
284,
27425,
2106,
198,
37811,
198,
198,
9971,
1634,
796,
366,
73,
8142,
38765,
1,
198,
9800,
796,
366,
74,
1585,
1659,
31,
1939,
549,
1698,... | 2.884211 | 95 |
import pytermgui as ptg
with ptg.YamlLoader() as loader, open("sandbox/common.yaml", "r") as config:
namespace = loader.load(config)
with ptg.WindowManager() as manager:
window = ptg.Window("hello")
namespace.apply_to(window)
manager += window
| [
11748,
12972,
4354,
48317,
355,
279,
25297,
628,
198,
4480,
279,
25297,
13,
56,
43695,
17401,
3419,
355,
40213,
11,
1280,
7203,
38142,
3524,
14,
11321,
13,
88,
43695,
1600,
366,
81,
4943,
355,
4566,
25,
198,
220,
220,
220,
25745,
796,... | 2.83871 | 93 |
# accept a given amount of money in dollars and the result is change
# Available currency notes
# twenty_dollar, ten_dollar, five_dollar, one_dollar = 20, 10, 5, 1
# Available currency coins
# quarter_25cents, dime_10cents, nickel_5cents, penny_1cent = 25, 10, 5, 1
entered_currency = float(input("Enter amount to make ... | [
2,
2453,
257,
1813,
2033,
286,
1637,
287,
5054,
290,
262,
1255,
318,
1487,
198,
2,
14898,
7395,
4710,
198,
2,
8208,
62,
22569,
11,
3478,
62,
22569,
11,
1936,
62,
22569,
11,
530,
62,
22569,
796,
1160,
11,
838,
11,
642,
11,
352,
1... | 3.291925 | 483 |
# nlantau, 2020-12-01
# Day 1 of AoC
path = r"/Users/nlantau/Docs/GitHub/DT256CHT20/AoC/1.txt"
with open(path, "r") as reader:
numbs = [int(x.strip("\n")) for x in reader.readlines()]
for num in numbs:
for el in numbs:
if num + el == 2020:
print(f"num:{num} el:{el}")
print(f"{... | [
2,
299,
75,
415,
559,
11,
12131,
12,
1065,
12,
486,
198,
2,
3596,
352,
286,
27378,
34,
198,
198,
6978,
796,
374,
1,
14,
14490,
14,
21283,
415,
559,
14,
23579,
82,
14,
38,
270,
16066,
14,
24544,
11645,
3398,
51,
1238,
14,
32,
7... | 1.782759 | 290 |
from django.conf.urls import url,include
from .import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$',views.register,name ='register'),
url(r'accounts/', include('django.contrib.auth.urls')),
url(r'^home/$',views.home, name='home'),
url(r'^hood/... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
17256,
198,
6738,
764,
11748,
5009,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
198,
198,
6371,
... | 2.553785 | 251 |
# -*- coding: utf-8 -*-
# Copyright 2014 Alvaro Lopez Garcia
#
# 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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
1946,
978,
7785,
78,
22593,
18555,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
... | 3.116352 | 318 |
"""
/*
* This file is part of PySide: Python for Qt
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team <contact@pyside.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* versio... | [
37811,
198,
15211,
198,
1635,
770,
2393,
318,
636,
286,
9485,
24819,
25,
11361,
329,
33734,
198,
1635,
198,
1635,
15069,
357,
34,
8,
3717,
26182,
10501,
290,
14,
273,
663,
22347,
32590,
444,
737,
198,
1635,
198,
1635,
14039,
25,
9485,... | 3.729167 | 240 |
# Generated by Django 2.2.18 on 2021-02-18 22:05
from django.db import migrations
class Migration(migrations.Migration):
"""
Delete all existing AllowListGenerationConfiguration entries because they may contain PII prior to this change
"""
dependencies = [
('certificates', '0019_allowlistgen... | [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1507,
319,
33448,
12,
2999,
12,
1507,
2534,
25,
2713,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628,
198,
4871,
36991,
7,
76,
3692,
602,
13,
44,
4254,
2599,
198,
220,
220,... | 3.006993 | 143 |
from tensorflow import keras
from keras.models import Sequential
from keras.layers import BatchNormalization, LeakyReLU, LSTM, Dense, Dropout, Flatten, Input, concatenate
from keras.utils import plot_model
from gen_lstm_data import gen_data, gen_labels, get_data_labelled
import numpy as np
# input should be [batch_siz... | [
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
347,
963,
26447,
1634,
11,
1004,
15492,
3041,
41596,
11,
406,
2257,
44,
11,
360,
1072,
11,
1425... | 2.621483 | 391 |
import os
import sys
import requests
from bs4 import BeautifulSoup
import authenticator
AOC_INPUT_URL_PATTERN = "https://adventofcode.com/{year}/day/{day}/input"
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
11748,
16425,
1352,
198,
198,
32,
4503,
62,
1268,
30076,
62,
21886,
62,
47,
1404,
31800,
796,
366,
5450,
1378,
324,
1151,
165... | 2.641026 | 78 |
from tests.helpers.testbase import TestBase
from cerami.model import Model
from cerami.datatype import (
String,
Number,
ModelMap)
from cerami.datatype.translator import (
ModelTranslator)
| [
6738,
5254,
13,
16794,
364,
13,
9288,
8692,
1330,
6208,
14881,
198,
6738,
26074,
6277,
13,
19849,
1330,
9104,
198,
6738,
26074,
6277,
13,
19608,
265,
2981,
1330,
357,
198,
220,
220,
220,
10903,
11,
198,
220,
220,
220,
7913,
11,
198,
... | 2.928571 | 70 |
"""
Common filtering backend.
"""
import operator
from elasticsearch_dsl.query import Q
from rest_framework.filters import BaseFilterBackend
from django_elasticsearch_dsl import fields
import six
from six import string_types
from ...constants import (
TRUE_VALUES,
FALSE_VALUES,
ALL_LOOKUP_FILTERS_AND_QU... | [
37811,
198,
17227,
25431,
30203,
13,
198,
37811,
198,
198,
11748,
10088,
198,
198,
6738,
27468,
12947,
62,
67,
6649,
13,
22766,
1330,
1195,
198,
6738,
1334,
62,
30604,
13,
10379,
1010,
1330,
7308,
22417,
7282,
437,
198,
6738,
42625,
142... | 1.926415 | 14,772 |
# SPDX-FileCopyrightText: Copyright (c) 2021 Martin Stephens
#
# SPDX-License-Identifier: Unlicense
"""Loop and wait for an event.
Note that the sensor only responds to lightning and certain kinds of noise,
so unless it is stormy, there's not much to see here.
"""
import time
import board
import biffobear_as3935
# E... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
15069,
357,
66,
8,
33448,
5780,
37072,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
791,
43085,
198,
198,
37811,
39516,
290,
4043,
329,
281,
1785,
13,
198,
198,
6425,
326,
262... | 2.859848 | 528 |
from instruments.sst.sst import SST
from instruments.poemas.poemas import POEMAS
| [
6738,
12834,
13,
82,
301,
13,
82,
301,
1330,
311,
2257,
198,
6738,
12834,
13,
7501,
368,
292,
13,
7501,
368,
292,
1330,
19922,
3620,
1921,
628
] | 3.037037 | 27 |
#------------------------------------------------------------------------
# E. Nardon, 10/09/09
# Calculation of the figure of merit to compare different
# designs initially for the JET ELM coils project.
# Here we use the definition given by Yunfeng Liang at the
# JET ELM coils meeting on 27/08/09.
#------------------... | [
2,
10097,
982,
198,
2,
412,
13,
399,
19917,
11,
838,
14,
2931,
14,
2931,
198,
2,
2199,
14902,
286,
262,
3785,
286,
17004,
284,
8996,
1180,
198,
2,
9824,
7317,
329,
262,
449,
2767,
17852,
44,
41331,
1628,
13,
198,
2,
3423,
356,
7... | 4.140127 | 157 |
"""
pyart.io.uf_write
=================
Functions for writing UF files.
.. autosummary::
:toctree: generated/
:template: dev_template.rst
UFRayCreator
.. autosummary::
:toctree: generated/
write_uf
_d_to_dms
_pack_structure
"""
from __future__ import division, unicode_literals
import... | [
37811,
198,
9078,
433,
13,
952,
13,
3046,
62,
13564,
198,
4770,
28,
198,
198,
24629,
2733,
329,
3597,
471,
37,
3696,
13,
198,
198,
492,
44619,
388,
6874,
3712,
198,
220,
220,
220,
1058,
1462,
310,
631,
25,
7560,
14,
198,
220,
220,... | 2.355238 | 9,602 |
# coding: utf8
"""
Yandex.Connect Directory API module
:author: Alexeev Nick
:email: n@akolka.ru
:version: 0.01b
"""
from .base import *
from inspect import currentframe
class YandexConnectDirectory(YandexConnectBase):
""" Yandex connect directory API base class """
DOMAIN = u'https://api.directory.yandex.... | [
2,
19617,
25,
3384,
69,
23,
198,
198,
37811,
198,
56,
392,
1069,
13,
13313,
27387,
7824,
8265,
198,
25,
9800,
25,
4422,
1453,
85,
8047,
198,
25,
12888,
25,
299,
31,
461,
349,
4914,
13,
622,
198,
25,
9641,
25,
657,
13,
486,
65,
... | 2.085389 | 8,432 |
# Python program to implement client side of chat room.
import socket
import select
import sys
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
if len(sys.argv) != 3:
print ("Correct usage: script, IP address, port number")
exit()
IP_address = str(sys.argv[1])
Port = int(sys.argv[2])
serve... | [
2,
11361,
1430,
284,
3494,
5456,
1735,
286,
8537,
2119,
13,
220,
198,
11748,
17802,
220,
198,
11748,
2922,
220,
198,
11748,
25064,
220,
198,
220,
220,
198,
15388,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
... | 2.594286 | 525 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import Dict, List, Union
from botbuilder.schema import Activity, RoleTypes
from ..channels import Channels
from .authentication_configuration import AuthenticationConfiguration
from .authentication_consta... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
201,
198,
2,
49962,
739,
262,
17168,
13789,
13,
201,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
201,
198,
201,
198,
6738,
10214,
38272,
13,
15952,
2611,
1330,
... | 4.09375 | 224 |
import json
from unittest.mock import AsyncMock
import pytest
from discord_bot_eternal_dice.api.router import RouterImpl
from discord_bot_eternal_dice.model.discord_command import DiscordCommand
from discord_bot_eternal_dice.model.discord_event import DiscordEvent, CommandType
from discord_bot_eternal_dice.model.disc... | [
11748,
33918,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
1081,
13361,
44,
735,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
36446,
62,
13645,
62,
316,
35220,
62,
67,
501,
13,
15042,
13,
472,
353,
1330,
48538,
29710,
198,
6738,
36... | 2.897833 | 323 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette_driver import expected, By, Wait
from gaiatest import GaiaApps
from gaiatest.apps.base import PageRegion... | [
2,
770,
8090,
6127,
5178,
318,
2426,
284,
262,
2846,
286,
262,
29258,
5094,
198,
2,
13789,
11,
410,
13,
362,
13,
15,
13,
1002,
257,
4866,
286,
262,
4904,
43,
373,
407,
9387,
351,
428,
198,
2,
2393,
11,
921,
460,
7330,
530,
379,
... | 3.34375 | 96 |
#!/usr/bin/env python
#--coding:utf-8 --
"""
cLoops IO module.
2020-01-21: updated parseBedpe, small trick to handle too big files, such as HiC, hash(tuple)
2020-01-23: parse bed added
2020-02-19: updated json write
2020-03-04: loops to new washU long range chromatin interaction s added.
2020-04-09: updated parseIxy to... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
438,
66,
7656,
25,
40477,
12,
23,
1377,
198,
37811,
198,
66,
27654,
2840,
24418,
8265,
13,
198,
42334,
12,
486,
12,
2481,
25,
6153,
21136,
45896,
431,
11,
1402,
6908,
284,
5412,
... | 1.901627 | 17,454 |
# coding=utf-8
import logging
logging.basicConfig(level=logging.INFO)
import numpy as np
import cv2
import os
def show_lines(img):
'''
传入一个照片,画线
:param image:
:return:
'''
gray = img
# gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(gray, 127, 255, cv2.THRESH_... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
18931,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
10778,
8,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28686,
628,
198,
4299,
905,
62,
6615,... | 1.968191 | 503 |
# import the library
from max17043 import max17043
# init a variable
m = max17043()
# read and print the voltage of the battery
print(m.getVCell())
# read and print the capacity of the battery
print(m.getVoc())
# print everything about the battery and the max17043 module
print(m)
# restart the module
m.quickStart(... | [
2,
1330,
262,
5888,
198,
6738,
3509,
1558,
48768,
1330,
3509,
1558,
48768,
198,
198,
2,
2315,
257,
7885,
198,
76,
796,
3509,
1558,
48768,
3419,
198,
198,
2,
1100,
290,
3601,
262,
15004,
286,
262,
6555,
198,
4798,
7,
76,
13,
1136,
... | 3.283186 | 113 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Fri May 7 09:42:02 2010
# by: The Resource Compiler for PyQt (Qt v4.4.3)
#
# WARNING! All changes made in this file will be lost!
#
# smc: This file was copied over from the original repository
# It can be modified, but if open with a qt editor
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
20857,
2134,
2438,
198,
2,
198,
2,
15622,
25,
19480,
1737,
767,
7769,
25,
3682,
25,
2999,
3050,
198,
2,
220,
220,
220,
220,
220,
416,
25,
383,
20857,
3082,
... | 1.293549 | 4,759 |
# Copyright 2019 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
2,
15069,
13130,
383,
288,
76,
62,
13716,
46665,
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,
13... | 2.974804 | 2,937 |
# Generated by Django 2.2.11 on 2020-05-05 19:40
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1157,
319,
12131,
12,
2713,
12,
2713,
678,
25,
1821,
198,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
4262... | 3.038462 | 52 |
import albumentations as A
from albumentations.pytorch import ToTensorV2
import torchvision
| [
11748,
435,
65,
1713,
602,
355,
317,
198,
6738,
435,
65,
1713,
602,
13,
9078,
13165,
354,
1330,
1675,
51,
22854,
53,
17,
198,
11748,
28034,
10178,
198
] | 3.285714 | 28 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-08-29 01:47
# pylint: skip-file
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
16,
319,
2177,
12,
2919,
12,
1959,
5534,
25,
2857,
198,
2,
279,
2645,
600,
25,
14267,
12,
7753,
628,
198,
198,
6738,
4... | 2.407407 | 54 |
from django.db import models
from django.urls import reverse
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
2,
13610,
534,
4981,
994,
13
] | 3.666667 | 24 |
# -*- coding: utf-8 -*-
"""
A very simple word cloud analyzer, provides only word size calculation and no
layout.
------------------------------------------------------------------------------
This file is part of Skyperious - Skype chat history tool.
Released under the MIT License.
@author Erki Suurjaa... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
32,
845,
2829,
1573,
6279,
4284,
9107,
11,
3769,
691,
1573,
2546,
17952,
290,
645,
201,
198,
39786,
13,
201,
198,
201,
198,
10097,
26171,
201,
19... | 1.506586 | 8,958 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2018 Chris Pickel
#
# 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 re... | [
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,
15069,
2864,
5180,
15085,
7750,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
1... | 3.356522 | 230 |
#!/usr/bin/python
"""
Created on Wed Feb 4 15:22:58 2015
@author: adam
"""
import urllib2
import string
url = 'http://www.pythonchallenge.com/pc/def/ocr.html'
req = urllib2.Request(url)
response = urllib2.urlopen(req)
pagesrc = response.read()
cypher = "!@#$%^&*(){}[]+_<>-\n."
plaintext = pagesrc.translate(None,... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
41972,
319,
3300,
3158,
220,
604,
1315,
25,
1828,
25,
3365,
1853,
198,
198,
31,
9800,
25,
23197,
198,
37811,
198,
198,
11748,
2956,
297,
571,
17,
198,
11748,
4731,
198,
198,
637... | 2.422535 | 142 |
from adclassifier import data_process
inputpath = r'D:\adclassifier\labelled_dataset\non_political\videos'
outputpath = r'D:\adclassifier\labelled_dataset\non_political\images'
data_process.extract_frame(inputpath=inputpath, outputpath=outputpath)
| [
6738,
512,
4871,
7483,
1330,
1366,
62,
14681,
198,
198,
15414,
6978,
796,
374,
6,
35,
7479,
324,
4871,
7483,
59,
23912,
11978,
62,
19608,
292,
316,
59,
13159,
62,
23149,
59,
32861,
6,
198,
22915,
6978,
796,
374,
6,
35,
7479,
324,
... | 3.024096 | 83 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.490132 | 304 |
from django.contrib import admin
from django.urls import path, include
from django.conf import settings # necesario para agregar + static
from django.conf.urls.static import static # necesario para agregar + static
urlpatterns = [
path('admin/', admin.site.urls),
path("blog/", include('blog.urls')),
path('... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
1303,
497,
728,
4982,
31215,
556,
2301,
283,
1343,
9037,
198,
6738,
42625,
1420... | 2.910959 | 146 |
# -*- coding: utf-8 -*-
import yaml
from collections import defaultdict
from jinja2 import Template
import codecs # enforce "utf-8" coding when reading files
import os
def dict_from_collection(collection):
"""
This function is purely for debugging purpose, and is not used in this python script.
extract... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
331,
43695,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
198,
11748,
40481,
82,
220,
1303,
4605,
366,
40477,
12,
23,
1,
19617,... | 2.520867 | 3,091 |
from django.shortcuts import render, redirect
from django.http import (
HttpResponseForbidden,
Http404,
HttpResponse
)
from django.core.mail import send_mail
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.core.paginator import Paginator, EmptyPage, Pa... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
4023,
1330,
357,
198,
220,
220,
220,
367,
29281,
31077,
1890,
37978,
11,
198,
220,
220,
220,
367,
29281,
26429,
11,
198,
220,
220,
220,
367,
292... | 2.493506 | 2,618 |
import os
from vgazer.command import GetCommandOutputUtf8
from vgazer.command import RunCommand
from vgazer.config.cmake import ConfigCmake
from vgazer.exceptions import CommandError
from vgazer.exceptions import GithubApiRateLimitExceeded
from vgazer.exceptions import InstallError
fr... | [
11748,
28686,
198,
198,
6738,
410,
70,
19178,
13,
21812,
220,
220,
220,
220,
220,
220,
220,
220,
1330,
3497,
21575,
26410,
18274,
69,
23,
198,
6738,
410,
70,
19178,
13,
21812,
220,
220,
220,
220,
220,
220,
220,
220,
1330,
5660,
2157... | 2.808511 | 188 |
"""
@name: PyHouse/src/Modules/Families/Insteon/_test/test_Insteon_decoder.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com>
@copyright: (c) 2014-2017 by D. Brian Kimmel
@license: MIT License
@note: Created on Jul 18, 2014
@Summary:
Passed all 8 tests - DBK - 2017-10-08
This _test needs ... | [
37811,
198,
31,
3672,
25,
220,
220,
220,
220,
220,
9485,
18102,
14,
10677,
14,
5841,
5028,
14,
37,
321,
3922,
14,
818,
4169,
261,
47835,
9288,
14,
9288,
62,
818,
4169,
261,
62,
12501,
12342,
13,
9078,
198,
31,
9800,
25,
220,
220,
... | 2.420136 | 1,033 |
#!/usr/bin/env python
# Define a filename.
filename = "input.txt"
# Open the file as f.
# The function readlines() reads the file.
with open(filename) as f:
depths = f.readlines()
depth_counts = count_depth_changes(depths)
print()
print("depth changes", depth_counts)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
2896,
500,
257,
29472,
13,
198,
34345,
796,
366,
15414,
13,
14116,
1,
628,
198,
198,
2,
4946,
262,
2393,
355,
277,
13,
198,
2,
383,
2163,
1100,
6615,
3419,
9743,
262,
2393,... | 2.885417 | 96 |
import os
import platform
from dotenv import load_dotenv
if platform.platform().__contains__('macOS'):
print("Esecuzione su MAC!")
load_dotenv('.env.local')
else:
load_dotenv()
| [
11748,
28686,
198,
11748,
3859,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
361,
3859,
13,
24254,
22446,
834,
3642,
1299,
834,
10786,
20285,
2640,
6,
2599,
198,
220,
220,
220,
3601,
7203,
36,
2363,
10277,
7935,
424,... | 2.676056 | 71 |
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 14 19:15:47 2019
@author: Shilpa
"""
from argparse import ArgumentParser
import train
CONTENT_WEIGHT = 5
TV_WEIGHT = 1e-3
INITIAL_LR = 1e1
MAX_ITER = 1000
STYLE_WEIGHTS = [10000, 10000, 10000, 10000, 10000]
PRINT_ITERATIONS = None
IMG_SIZE = 512
BETA1 = 0... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3825,
2758,
1478,
678,
25,
1314,
25,
2857,
13130,
201,
198,
201,
198,
31,
9800,
25,
911,
346,
8957,
201,
198,
37811,
201,
198,
6738,
... | 2.270833 | 192 |
from UtilStruct import *
from amitools.vamos.AccessStruct import AccessStruct
TAG_DONE = 0
TAG_IGNORE = 1
TAG_MORE = 2
TAG_SKIP = 3
TAG_USER = 1<<31
| [
6738,
7273,
346,
44909,
1330,
1635,
198,
6738,
716,
270,
10141,
13,
85,
321,
418,
13,
15457,
44909,
1330,
8798,
44909,
198,
198,
42197,
62,
35,
11651,
796,
657,
198,
42197,
62,
16284,
6965,
796,
352,
198,
42197,
62,
23346,
796,
362,
... | 2.559322 | 59 |
import sys, os | [
11748,
25064,
11,
28686
] | 3.5 | 4 |
# Copyright 2019 IBM Corporation
#
# 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, ... | [
2,
15069,
13130,
19764,
10501,
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,
13,
198,
2,
921,
743,
73... | 1.931028 | 5,234 |