content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
# -*- coding: utf-8 -*-
from typing import Any
from typing import Dict
from typing import Optional
from typing import Set
from unittest import TestCase
from flask import abort
from app import create_app
from app import db
from app.configuration import TestConfiguration
from app.userprofile import Permission
from ap... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
32233,
198,
6738,
19720,
1330,
5345,
198,
198,
6738,
555,
715,
395,
1330,
6208,
2... | 3.877551 | 98 |
# Copyright 2021, Peter Birch, mailto:peter@lightlogic.co.uk
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
2,
15069,
33448,
11,
5613,
47631,
11,
6920,
1462,
25,
79,
2357,
31,
2971,
6404,
291,
13,
1073,
13,
2724,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
... | 3.81768 | 181 |
# Zipfile Module
import zipfile
# Open and List
zip = zipfile.ZipFile('Archive.zip', 'r')
print(zip.namelist()) # Lists everything within zip file
# Metadata in the zip folder
for meta in zip.infolist(): # List of the metadata within zip file
print(meta)
info = zip.getinfo("purchased.txt")
# Access to files in ... | [
2,
38636,
7753,
19937,
198,
11748,
19974,
7753,
198,
198,
2,
4946,
290,
7343,
198,
13344,
796,
19974,
7753,
13,
41729,
8979,
10786,
19895,
425,
13,
13344,
3256,
705,
81,
11537,
198,
4798,
7,
13344,
13,
7402,
46331,
28955,
1303,
44968,
... | 3.037736 | 212 |
"""Recommendation Algorithm Base Class
This module is a base class for algorithms using sparse matrices
The required packages can be found in requirements.txt
"""
import pandas as pd
import numpy as np
from lenskit import batch, topn, util
from lenskit import crossfold as xf
from lenskit.algorithms import Recommende... | [
37811,
41248,
341,
978,
42289,
7308,
5016,
198,
198,
1212,
8265,
318,
257,
2779,
1398,
329,
16113,
1262,
29877,
2603,
45977,
198,
198,
464,
2672,
10392,
460,
307,
1043,
287,
5359,
13,
14116,
198,
37811,
198,
198,
11748,
19798,
292,
355,... | 2.78672 | 497 |
# -*- coding: utf-8 -*-
"""
This module implements the User functionality of TheTVDb API.
Allows to retrieve, add and delete user favorites and ratings.
See [Users API section](https://api.thetvdb.com/swagger#!/Users)
"""
from .base import TVDB | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
1212,
8265,
23986,
262,
11787,
11244,
286,
383,
6849,
43832,
7824,
13,
198,
34934,
284,
19818,
11,
751,
290,
12233,
2836,
18852,
290,
10109,
13,
198,
19... | 3.25 | 76 |
#!/usr/bin/env python
import re
from binaryninja.log import log_info
from binaryninja.architecture import Architecture
from binaryninja.function import RegisterInfo, InstructionInfo, InstructionTextToken
from binaryninja.enums import InstructionTextTokenType, BranchType, FlagRole, LowLevelILFlagCondition
from . impo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
302,
198,
198,
6738,
13934,
35073,
6592,
13,
6404,
1330,
2604,
62,
10951,
198,
6738,
13934,
35073,
6592,
13,
998,
5712,
495,
1330,
29778,
198,
6738,
13934,
35073,
6592,
13,
... | 2.96 | 175 |
import os
import paramiko
| [
11748,
28686,
198,
11748,
5772,
12125,
198
] | 3.714286 | 7 |
from brownie import ETH_ADDRESS, accounts
def test_brownie():
"""Test if the brownie module is working.
"""
acc = accounts[0]
assert type(acc.address) == str
| [
6738,
7586,
494,
1330,
35920,
62,
2885,
7707,
7597,
11,
5504,
628,
198,
4299,
1332,
62,
33282,
494,
33529,
198,
220,
220,
220,
37227,
14402,
611,
262,
7586,
494,
8265,
318,
1762,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
69... | 2.83871 | 62 |
"""
Copyright (c) 2022 Julien Posso
"""
import torch
import optuna
from config import Config
from pose_net import POSENet
from submission import SubmissionWriter
from print_results import print_training_loss, print_training_score, print_beta_tuning, print_error_distance
import os
import numpy as np
import random
if... | [
37811,
198,
15269,
357,
66,
8,
33160,
5979,
2013,
18574,
568,
198,
37811,
198,
198,
11748,
28034,
198,
11748,
2172,
9613,
198,
6738,
4566,
1330,
17056,
198,
6738,
12705,
62,
3262,
1330,
28069,
1677,
316,
198,
6738,
14498,
1330,
42641,
3... | 3.456311 | 103 |
from enum import IntEnum, unique
"""Stores the unique values for interpretting message signatures and command types.
Extra key-value pairs have been added to simply to demonstrate how to modify this file. Not all key-value pairs have not implemented.
"""
| [
6738,
33829,
1330,
2558,
4834,
388,
11,
3748,
198,
198,
37811,
1273,
2850,
262,
3748,
3815,
329,
6179,
889,
3275,
17239,
290,
3141,
3858,
13,
198,
198,
27726,
1994,
12,
8367,
14729,
423,
587,
2087,
284,
2391,
284,
10176,
703,
284,
130... | 4.431034 | 58 |
"""fontTools.misc.fixedTools.py -- tools for working with fixed numbers.
"""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
__all__ = [
"fixedToFloat",
"floatToFixed",
]
def fixedToFloat(value, precisionBits):
"""Converts a fixed-point number to a float, c... | [
37811,
10331,
33637,
13,
44374,
13,
34021,
33637,
13,
9078,
1377,
4899,
329,
1762,
351,
5969,
3146,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
11,
4112,
62,
11748,
198,
6738,
10369,
33637,
13,
4... | 2.590909 | 572 |
from action_hero.utils import PipelineAction, DebugAction
from action_hero.net import (
EmailIsValidAction,
IPIsValidIPAddressAction,
IPIsValidIPv4AddressAction,
IPIsValidIPv6AddressAction,
URLIsNotReachableAction,
URLIsReachableAction,
URLWithHTTPResponseStatusCodeAction,
)
from action_hero... | [
6738,
2223,
62,
11718,
13,
26791,
1330,
37709,
12502,
11,
31687,
12502,
198,
6738,
2223,
62,
11718,
13,
3262,
1330,
357,
198,
220,
220,
220,
9570,
3792,
47139,
12502,
11,
198,
220,
220,
220,
6101,
3792,
47139,
4061,
20231,
12502,
11,
... | 2.649739 | 1,339 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# import selenium exceptions module
from selenium.common.exceptions import *
browser = webdriver.Chrome()
browser.get("ht... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
9019,
1330,
5313,
32103,
21321,
198,
6738,
384,
119... | 3.138528 | 231 |
"""Stacker custom lookup to get a Cognito User Pool App Client Secret."""
import logging
from stacker.session_cache import get_session
TYPE_NAME = 'CognitoUserPoolAppClientSecret'
LOGGER = logging.getLogger(__name__)
def handler(value, provider, **kwargs): # pylint: disable=W0613
""" Lookup a Cognito User Pool ... | [
37811,
1273,
10735,
2183,
35847,
284,
651,
257,
26543,
10094,
11787,
19850,
2034,
20985,
3943,
526,
15931,
198,
198,
11748,
18931,
198,
6738,
8931,
263,
13,
29891,
62,
23870,
1330,
651,
62,
29891,
198,
198,
25216,
62,
20608,
796,
705,
3... | 2.57319 | 649 |
# Generated by Django 3.0.7 on 2020-11-18 11:34
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
1157,
12,
1507,
1367,
25,
2682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
r"""2018 - Day 7 Part 1: The Sum of Its Parts.
You find yourself standing on a snow-covered coastline; apparently, you landed
a little off course. The region is too hilly to see the North Pole from here,
but you do spot some Elves that seem to be trying to unpack something that
washed ashore. It's quite cold out, so y... | [
81,
37811,
7908,
532,
3596,
767,
2142,
352,
25,
383,
5060,
286,
6363,
22349,
13,
198,
198,
1639,
1064,
3511,
5055,
319,
257,
6729,
12,
32111,
43415,
26,
5729,
11,
345,
11406,
198,
64,
1310,
572,
1781,
13,
383,
3814,
318,
1165,
289,
... | 3.388693 | 1,132 |
import pytest
from riotwatcher import TftWatcher
| [
11748,
12972,
9288,
198,
198,
6738,
16352,
86,
34734,
1330,
309,
701,
54,
34734,
628
] | 3.4 | 15 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import scipy
import copy
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
198,
11748,
4866,
628,
628,
628,
198,
220,
220,
220,
220,
... | 2.538462 | 52 |
print("Hello")
1 / 0
print("world!")
| [
4798,
7203,
15496,
4943,
198,
16,
1220,
657,
198,
4798,
7203,
6894,
2474,
8,
628
] | 2.533333 | 15 |
from db_manager import db
| [
6738,
20613,
62,
37153,
1330,
20613,
198
] | 3.714286 | 7 |
'''
- Leetcode problem: 352
- Difficulty: Hard
- Brief problem description:
Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of
disjoint intervals.
For example, suppose the integers from the data stream are 1, 3, 7, 2, 6, ..., then the summary will... | [
7061,
6,
198,
12,
1004,
316,
8189,
1917,
25,
44063,
198,
198,
12,
27419,
25,
6912,
198,
198,
12,
22821,
1917,
6764,
25,
198,
198,
15056,
257,
1366,
4269,
5128,
286,
1729,
12,
31591,
37014,
257,
16,
11,
257,
17,
11,
2644,
11,
281,
... | 2.935743 | 249 |
from mongo_test.utils.dal.identity_dal import *
from mongo_test.utils.dal.object_dal import *
from mongo_test.utils.dal.detection_dal import *
from mongo_test.utils.dal.user_dal import *
from mongo_test.utils.dal.process_dal import *
from mongo_test.utils.dal.camera_dal import *
from mongo_test.utils.dal.logger_dal imp... | [
6738,
285,
25162,
62,
9288,
13,
26791,
13,
31748,
13,
738,
414,
62,
31748,
1330,
1635,
198,
6738,
285,
25162,
62,
9288,
13,
26791,
13,
31748,
13,
15252,
62,
31748,
1330,
1635,
198,
6738,
285,
25162,
62,
9288,
13,
26791,
13,
31748,
1... | 2.850299 | 167 |
# flake8: noqa
from .stdout import StdOut
| [
2,
781,
539,
23,
25,
645,
20402,
198,
6738,
764,
19282,
448,
1330,
520,
67,
7975,
198
] | 2.470588 | 17 |
# vim:fileencoding=utf-8
import os
import vim
import socket
import struct
import contextlib
fcitxsocketfile = vim.eval('s:fcitxsocketfile')
Fcitx = FcitxComm(fcitxsocketfile)
| [
2,
43907,
25,
7753,
12685,
7656,
28,
40477,
12,
23,
198,
198,
11748,
28686,
198,
11748,
43907,
198,
11748,
17802,
198,
11748,
2878,
198,
11748,
4732,
8019,
198,
198,
16072,
270,
34223,
5459,
7753,
796,
43907,
13,
18206,
10786,
82,
25,
... | 2.738462 | 65 |
# -*- coding: utf-8 -*-
__author__ = "R. Bauer"
__copyright__ = "MedPhyDO - Machbarkeitsstudien des Instituts fr Medizinische Strahlenphysik und Strahlenschutz am Klinikum Dortmund im Rahmen von Bachelor und Masterarbeiten an der TU-Dortmund / FH-Dortmund"
__credits__ = ["R.Bauer", "K.Loot"]
__license__ = "MIT"
__vers... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
49,
13,
41971,
1,
198,
834,
22163,
4766,
834,
796,
366,
9921,
2725,
88,
18227,
532,
7080,
5657,
365,
896,
19149,
2013,
748,
37931,
5500,... | 2.616216 | 185 |
# Generated by Django 3.1.2 on 2020-10-28 05:15
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
12131,
12,
940,
12,
2078,
8870,
25,
1314,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# -*- coding: utf-8 -*-
import hashlib
import base64
from Crypto.Cipher import AES
import json
from src.services.utils import Request
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12234,
8019,
198,
11748,
2779,
2414,
198,
6738,
36579,
13,
34,
10803,
1330,
34329,
198,
11748,
33918,
198,
6738,
12351,
13,
30416,
13,
26791,
1330,
19390,
628,
628
... | 3.186047 | 43 |
from tkinter import *
from placeholder import EntPlaceHold
from gradiente import GradientFrame
from tkinter import ttk, messagebox
from funcoes_sqlite import FuncsSqlite
from funcoes_txt import ArquivosTexto
import os
app = Front()
app.Iniciar()
| [
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
46076,
1330,
7232,
27271,
26807,
198,
6738,
31312,
68,
1330,
17701,
1153,
19778,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
11,
3275,
3524,
198,
6738,
1257,
1073,
274,
62,
25410,
578,
1330,
... | 3.192308 | 78 |
"""
Code for domain classes.
"""
| [
37811,
198,
10669,
329,
7386,
6097,
13,
198,
37811,
198
] | 3.3 | 10 |
import sys
import os
__all__ = []
__version__ = '0.0.1'
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '.' + '/CryptoVinaigrette'))) | [
11748,
25064,
198,
11748,
28686,
628,
198,
834,
439,
834,
796,
17635,
198,
834,
9641,
834,
796,
705,
15,
13,
15,
13,
16,
6,
628,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
... | 2.309859 | 71 |
import json
import os.path
import falcon
from app.__root__ import __path__
| [
11748,
33918,
198,
11748,
28686,
13,
6978,
198,
198,
11748,
24215,
1102,
198,
198,
6738,
598,
13,
834,
15763,
834,
1330,
11593,
6978,
834,
628
] | 3.12 | 25 |
import asyncio
import aiohttp
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(duck_search(input("> ")))
| [
11748,
30351,
952,
198,
11748,
257,
952,
4023,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
9052,
796,
30351,
952,
13,
1136,
62,
15596,
62,
26268,
3419,
198,
220,
220,
220,
9052,
13,
51... | 2.542373 | 59 |
from __future__ import annotations
from prettyqt import widgets
from prettyqt.qt import QtWidgets
QtWidgets.QStatusBar.__bases__ = (widgets.Widget,)
if __name__ == "__main__":
app = widgets.app()
dlg = widgets.MainWindow()
status_bar = StatusBar()
status_bar.set_color("black")
label = widgets.... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
2495,
39568,
1330,
40803,
198,
6738,
2495,
39568,
13,
39568,
1330,
33734,
54,
312,
11407,
628,
198,
48,
83,
54,
312,
11407,
13,
48,
19580,
10374,
13,
834,
65,
1386,
834,
796,
357,
... | 2.548913 | 184 |
# Function to clear data in instances folder before new run
import os
import shutil
| [
2,
15553,
284,
1598,
1366,
287,
10245,
9483,
878,
649,
1057,
198,
11748,
28686,
198,
11748,
4423,
346,
198
] | 4.421053 | 19 |
""" Activity commands """
from discord.ext import commands
from bot.components.logging import log_all
| [
37811,
24641,
9729,
37227,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
10214,
13,
5589,
3906,
13,
6404,
2667,
1330,
2604,
62,
439,
198
] | 4.08 | 25 |
"""Python functions to handle the ISO-14443-A protocol basics (parity and CRC)"""
# Pynfc is a python wrapper for the libnfc library
# Copyright (C) 2009 Mike Auty
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published... | [
37811,
37906,
5499,
284,
5412,
262,
19694,
12,
1415,
34938,
12,
32,
8435,
19165,
357,
1845,
414,
290,
45623,
8,
37811,
201,
198,
201,
198,
2,
220,
350,
2047,
16072,
318,
257,
21015,
29908,
329,
262,
9195,
77,
16072,
5888,
201,
198,
... | 2.597293 | 591 |
import pytest
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property
from attrs_sqlalchemy import attrs_sqlalchemy
| [
11748,
12972,
9288,
198,
11748,
44161,
282,
26599,
355,
473,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
12114,
10236,
1330,
14554,
62,
26745,
... | 3.310345 | 58 |
"""
Generate predictions for AIcrowd.
Usage:
python3 run.py
The csv file produced will be "out/predictions.csv".
"""
# flake8: noqa: E402
import os
import numpy as np
# Import functions from scripts/
from csv_utils import create_csv_submission, load_csv_data
from path import (add_src_to_path, load_json_parameters,... | [
37811,
198,
8645,
378,
16277,
329,
9552,
66,
3986,
13,
198,
198,
28350,
25,
198,
198,
29412,
18,
1057,
13,
9078,
198,
198,
464,
269,
21370,
2393,
4635,
481,
307,
366,
448,
14,
28764,
9278,
13,
40664,
1911,
198,
37811,
198,
2,
781,
... | 2.2045 | 1,511 |
DESC = f"""{__file__} - A code sample to help get you started with proceedurally generated terrain / chunkloading in Ursina.
More complex terrain can be achieved by using a more complicated function in GameWithChunkloading.get_heightmap().
Supports both Perlin Noise and Open Simplex Noise.
Written by Lyfe.
"""
TERRAIN... | [
30910,
34,
796,
277,
37811,
90,
834,
7753,
834,
92,
532,
317,
2438,
6291,
284,
1037,
651,
345,
2067,
351,
5120,
20221,
7560,
15510,
1220,
16058,
25138,
287,
37935,
1437,
13,
198,
5167,
3716,
15510,
460,
307,
8793,
416,
1262,
257,
517,... | 3.167568 | 925 |
"""CLI console script entry point."""
import clc
| [
37811,
5097,
40,
8624,
4226,
5726,
966,
526,
15931,
198,
198,
11748,
537,
66,
628,
628,
198
] | 3.176471 | 17 |
from namedivider import NameDivider
from controller.model import DivisionRequest
from controller import division_controller
if __name__ == '__main__':
test_division_controller() | [
6738,
3706,
452,
1304,
1330,
6530,
24095,
1304,
198,
6738,
10444,
13,
19849,
1330,
7458,
18453,
198,
6738,
10444,
1330,
7297,
62,
36500,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1332,
... | 4 | 46 |
from urllib.parse import urlparse
from toolkit.lib.http_tools import request_page
from bs4 import BeautifulSoup
| [
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
6738,
2891,
15813,
13,
8019,
13,
4023,
62,
31391,
1330,
2581,
62,
7700,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
628,
628,
628,
220,
220,
220,
220,
220,
220,
220,
220
... | 2.906977 | 43 |
import os
import shutil
import zipfile
from http.server import HTTPServer, CGIHTTPRequestHandler
import threading
import subprocess
import sys
import traceback
PORT = 3000
os.chdir('autoupdate')
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
19974,
7753,
198,
6738,
2638,
13,
15388,
1330,
38288,
18497,
11,
36378,
40717,
18453,
25060,
198,
11748,
4704,
278,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
... | 3.232877 | 73 |
import RPi.GPIO as GPIO
import time
import os
def home(self, max_dist=150, reset_pos=True):
"""Move axis at 1 cm/s toward the home limit.
Arguments
----------
max_dist : float
the maximum number of cm to move for homing
reset_pos : bool
if tr... | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198,
11748,
28686,
628,
220,
220,
220,
825,
1363,
7,
944,
11,
3509,
62,
17080,
28,
8628,
11,
13259,
62,
1930,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
... | 2.059158 | 1,758 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import json
from pymongo import MongoClient
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
33918,
198,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
198,... | 2.6 | 60 |
from moai.parameters.optimization.optimizers.swa import SWA as Outer
import torch
import omegaconf.omegaconf
import hydra.utils as hyu
import typing
__all__ = ['SWA']
#NOTE: modified from https://github.com/alphadl/lookahead.pytorch
| [
6738,
6941,
1872,
13,
17143,
7307,
13,
40085,
1634,
13,
40085,
11341,
13,
2032,
64,
1330,
12672,
32,
355,
35868,
198,
198,
11748,
28034,
198,
11748,
267,
28917,
7807,
69,
13,
462,
70,
7807,
69,
198,
11748,
25039,
13,
26791,
355,
2537,... | 2.95 | 80 |
#/usr/bin/env python
'''
@2018-01 by lanhin
Generate cluster json file.
Usage: python2 clustergen.py
The output file name is cluster.json
'''
import getopt
import sys
import os
# compute, RAM, bw, network
devs = [("1000000", "1048576", "1111490", "1600000"),
("10000000", "1048576", "1342177", "3200000"),
... | [
2,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
7061,
6,
198,
31,
7908,
12,
486,
220,
416,
26992,
20079,
198,
198,
8645,
378,
13946,
33918,
2393,
13,
198,
28350,
25,
21015,
17,
13946,
5235,
13,
9078,
198,
464,
5072,
2393,
1438,
... | 2.266833 | 802 |
import unittest
from xie.graphics.drawing import DrawingSystem
from xie.graphics.canvas import EncodedTextCanvasController
from xie.graphics.factory import StrokeSpec, StrokeFactory
| [
11748,
555,
715,
395,
198,
6738,
2124,
494,
13,
70,
11549,
13,
19334,
278,
1330,
40027,
11964,
198,
6738,
2124,
494,
13,
70,
11549,
13,
5171,
11017,
1330,
14711,
9043,
8206,
6090,
11017,
22130,
198,
198,
6738,
2124,
494,
13,
70,
11549... | 3.407407 | 54 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt5 import QtGui, QtWidgets, QtCore
from sharedcomponets import GUIToolKit
import logging
from simpleFOCConnector import SimpleFOCDevice | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
11,
33734,
14055,
198,
6738,
4888,
5589,
26... | 2.907692 | 65 |
#!/usr/bin/env python
# coding=utf-8
'''
###
coredump
###
echo "|/usr/bin/python /docker_host/1.py" > /proc/sys/kernel/core_pattern
### sys.stdin '' None
###
core image
container /proc/sys/kernel/core_pattern commit
image container core
macOS
###
core dump
https://favoorr.github.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
7061,
6,
198,
198,
21017,
198,
220,
220,
269,
1850,
931,
220,
198,
198,
21017,
220,
198,
220,
9809,
366,
91,
14,
14629,
14,
8800,
14,
29412,
1220,... | 2.131647 | 2,332 |
plot = Plot()
# Uneven error bars
line = Line()
line.xValues = range(6)
line.yValues = [25, 21, 30, 23, 10, 30]
line.yMins = [10, 18, 10, 10, 5, 20]
line.yMaxes = [30, 50, 40, 30, 20, 45]
line.label = "Asymmetric Errors"
line.color = "red"
line.xValues = range(len(line.yValues))
# Even error bars
line2 = Line()
line... | [
29487,
796,
28114,
3419,
198,
198,
2,
471,
710,
574,
4049,
9210,
198,
1370,
796,
6910,
3419,
198,
1370,
13,
87,
40161,
796,
2837,
7,
21,
8,
198,
1370,
13,
88,
40161,
796,
685,
1495,
11,
2310,
11,
1542,
11,
2242,
11,
838,
11,
154... | 2.297297 | 259 |
#!/usr/bin/env python
from wurst import *
from wurst.searching import *
from wurst.transformations.activity import change_exchanges_by_constant_factor
from wurst.transformations.uncertainty import rescale_exchange
from wurst.IMAGE.io import *
from wurst.IMAGE import *
from wurst.ecoinvent.electricity_markets import ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
266,
24962,
1330,
1635,
198,
6738,
266,
24962,
13,
12947,
278,
1330,
1635,
198,
198,
6738,
266,
24962,
13,
35636,
602,
13,
21797,
1330,
1487,
62,
1069,
36653,
62,
1525,
62,
9979,... | 2.436777 | 9,593 |
"""
FJTYFilt_estimator.py
Creates a vectorizer and estimated an SVM model from the files in FILE_NAMES; run a TRAIN_PROP train/test on these
then saves these
TO RUN PROGRAM:
python3 SVM_filter_estimate.py
PROGRAMMING NOTES:
1. There are no summary statistics across the experiments, as these are currently jus... | [
37811,
198,
37,
41,
9936,
37,
2326,
62,
395,
320,
1352,
13,
9078,
198,
198,
16719,
274,
257,
15879,
7509,
290,
6108,
281,
311,
15996,
2746,
422,
262,
3696,
287,
45811,
62,
45,
29559,
26,
1057,
257,
29125,
1268,
62,
4805,
3185,
4512,... | 2.138795 | 3,271 |
import sys
print("Hello, "+sys.argv[1]+"!") | [
11748,
25064,
198,
4798,
7203,
15496,
11,
43825,
17597,
13,
853,
85,
58,
16,
48688,
1,
2474,
8
] | 2.388889 | 18 |
import cv2
import pickle
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
# Function to undistorted the image
| [
11748,
269,
85,
17,
198,
11748,
2298,
293,
198,
11748,
2603,
29487,
8019,
13,
9060,
355,
29034,
9600,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
15553,
284,
3318,
396,
9741,
262,
2939,
198
] | 3.175 | 40 |
# for loop
numbers = [1, 2, 3, 4, 5]
new_list = []
for n in numbers:
add_1 = n + 1
new_list.append(add_1)
print(new_list)
# List Comprehension
new_list_comprehension = [n + 1 for n in numbers]
print(new_list_comprehension)
# Rang List Comprehension
range_list = [n * 2 for n in range(1, 5)]
print(range_list)
... | [
2,
329,
9052,
198,
77,
17024,
796,
685,
16,
11,
362,
11,
513,
11,
604,
11,
642,
60,
198,
3605,
62,
4868,
796,
17635,
198,
1640,
299,
287,
3146,
25,
198,
220,
220,
220,
751,
62,
16,
796,
299,
1343,
352,
198,
220,
220,
220,
649,... | 2.521073 | 261 |
from .iid_equal import distribute_batches_equally
| [
6738,
764,
72,
312,
62,
40496,
1330,
14983,
62,
8664,
2052,
62,
4853,
453,
198
] | 3.333333 | 15 |
from io import StringIO
import os
from pathlib import Path
import pytest
from herethere.everywhere import ConnectionConfig, runcode
from herethere.everywhere import config
code_with_definition = """
def foo(a, b):
return a + b
print(foo(1, 2))
"""
| [
6738,
33245,
1330,
10903,
9399,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
994,
8117,
13,
16833,
3003,
1330,
26923,
16934,
11,
1057,
8189,
198,
6738,
994,
8117,
13,
16833,
3003,
... | 3.180723 | 83 |
import os
import re
import joblib
import numpy as np
import pandas as pd
import traceback
from .logger import create_logger
from .ml_utils import fetch_ohlcv, normalize_position
from .agent_api import submit_prediction
agent_base_url = os.getenv('ALPHASEA_AGENT_BASE_URL')
model_id = os.getenv('ALPHASEA_MODEL_ID')
mode... | [
11748,
28686,
198,
11748,
302,
198,
11748,
1693,
8019,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12854,
1891,
198,
6738,
764,
6404,
1362,
1330,
2251,
62,
6404,
1362,
198,
6738,
764,
4029,
62,
... | 2.4 | 245 |
import cv2
import numpy as np
img1 = cv2.imread('image.tif')
img2 = cv2.imread('imglogo.png')
rows, cols, channels = img2.shape
roi = img1[0:rows, 0:cols]
img2gray = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(img2gray, 230, 255, cv2.THRESH_BINARY_INV)
mask_inv = cv2.bitwise_not(mask)
img1_bg... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
9600,
16,
796,
269,
85,
17,
13,
320,
961,
10786,
9060,
13,
49929,
11537,
198,
9600,
17,
796,
269,
85,
17,
13,
320,
961,
10786,
320,
4743,
24076,
13,
11134,
11537,
1... | 1.974638 | 276 |
from django.contrib.auth.models import User
from django import forms
from constance import config
#from constance.admin import ConstanceForm
from django.conf import settings
from .models import DeviceFamily, Firmware, Board
##############################################################################################... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
1500,
590,
1330,
4566,
198,
2,
6738,
1500,
590,
13,
28482,
1330,
4757,
590,
8479,
198,
6738,
42625,
14208,
13,
10414,
... | 2.832432 | 370 |
{"Item1":[{"from":{"sourceType":"file","value":"~/obj/api/SortingVisualizer.yml"},"to":{"sourceType":"file","value":"~/obj/api/SortingVisualizer.FrmMain.yml"},"reportedBy":{"sourceType":"file","value":"~/obj/api/SortingVisualizer.yml"},"type":"children"},{"from":{"sourceType":"file","value":"~/obj/api/SortingVisualizer... | [
4895,
7449,
16,
32509,
6738,
8351,
10459,
6030,
2404,
7753,
2430,
8367,
2404,
93,
14,
26801,
14,
15042,
14,
50,
24707,
36259,
7509,
13,
88,
4029,
13018,
1462,
8351,
10459,
6030,
2404,
7753,
2430,
8367,
2404,
93,
14,
26801,
14,
15042,
... | 3.192054 | 92,901 |
from . import auth
from flask_login import login_user,login_required,logout_user
from flask import render_template,url_for,flash,redirect,request
from .forms import SignupForm,SigninForm
from ..models import User
from .. import db
from ..email import mail_message
| [
6738,
764,
1330,
6284,
198,
6738,
42903,
62,
38235,
1330,
17594,
62,
7220,
11,
38235,
62,
35827,
11,
6404,
448,
62,
7220,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
6371,
62,
1640,
11,
34167,
11,
445,
1060,
11,
25927,
198,
6738,
7... | 3.680556 | 72 |
#
# Copyright (c) 2019, NVIDIA CORPORATION. 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 applicab... | [
2,
198,
2,
15069,
357,
66,
8,
13130,
11,
15127,
23929,
44680,
6234,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 2.899881 | 839 |
# _*_coding:utf-8_*_
# authorqq823947488
# date2019/4/24 20:12
host='localhost'
port=3306
user='root'
passwd='123'
db='flask_learn'
charset='utf8'
| [
2,
4808,
9,
62,
66,
7656,
25,
40477,
12,
23,
62,
9,
62,
198,
2,
1772,
38227,
23,
23516,
2857,
33646,
198,
2,
3128,
23344,
14,
19,
14,
1731,
1160,
25,
1065,
198,
198,
4774,
11639,
36750,
6,
198,
634,
28,
18,
20548,
198,
7220,
1... | 2.084507 | 71 |
"""
These function implement functions or other functionalities provided by the linux userspace dynamic loader
"""
| [
37811,
198,
4711,
2163,
3494,
5499,
393,
584,
10345,
871,
2810,
416,
262,
32639,
2985,
10223,
8925,
40213,
198,
37811,
198
] | 5.47619 | 21 |
from wrappers import inner_f
| [
6738,
7917,
11799,
1330,
8434,
62,
69,
198
] | 3.625 | 8 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Filip Stefanak <f.stefanak@rare-technologies.com>
# Copyright (C) 2017 Rare Technologies
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import sys
import unittest
from bounter import HashTable
long_long_max = 9223372... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
6434,
25,
24600,
28842,
461,
1279,
69,
13,
301,
891,
272,
461,
31,
430,
260,
12,
23873,
5823,
13,
785,
... | 2.823529 | 136 |
import sys
newick = ''
with open(sys.argv[1]) as f:
orig = f.read().rstrip()
orig = orig.replace('(', '(\n').replace(',', '\n,\n').replace(')', ')\n')
for line in orig.split('\n'):
fields = line.rstrip().split(':')
if len(fields) == 0:
continue
elif len(fields) == 1:
newick += fields... | [
11748,
25064,
198,
198,
3605,
624,
796,
10148,
198,
198,
4480,
1280,
7,
17597,
13,
853,
85,
58,
16,
12962,
355,
277,
25,
198,
220,
220,
220,
1796,
796,
277,
13,
961,
22446,
81,
36311,
3419,
198,
198,
11612,
796,
1796,
13,
33491,
1... | 2.068966 | 261 |
# -*- coding: utf-8 -*-
#
# Based on bitcraze example project:
# https://github.com/bitcraze/crazyflie-lib-python/blob/master/examples/step-by-step/sbs_motion_commander.py
import logging
import sys
import time
from threading import Event
import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.crazyflie.log... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
13403,
319,
1643,
66,
430,
2736,
1672,
1628,
25,
198,
2,
3740,
1378,
12567,
13,
785,
14,
2545,
66,
430,
2736,
14,
50112,
2704,
494,
12,
8019,
12,
29412,
... | 2.333333 | 531 |
from datetime import datetime
from discord.errors import NotFound
from discord import Embed
from discord_slash.utils.manage_commands import create_option, SlashCommandOptionType
from data import get_invites_by_guild_and_code
from .infrastructure import record_usage, CommandDefinition, registered_guild_and_admin_or_mo... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
36446,
13,
48277,
1330,
1892,
21077,
198,
6738,
36446,
1330,
13302,
276,
198,
6738,
36446,
62,
6649,
1077,
13,
26791,
13,
805,
496,
62,
9503,
1746,
1330,
2251,
62,
18076,
11,
26616,
... | 3.254386 | 228 |
from .coco import COCO
from .dac import DAC
datasets = {
"COCO": COCO,
"DAC": DAC
}
| [
6738,
764,
66,
25634,
1330,
327,
4503,
46,
198,
6738,
764,
67,
330,
1330,
45793,
198,
198,
19608,
292,
1039,
796,
1391,
198,
220,
220,
220,
366,
34,
4503,
46,
1298,
327,
4503,
46,
11,
198,
220,
220,
220,
366,
35,
2246,
1298,
45793... | 2 | 47 |
from typing import List
| [
6738,
19720,
1330,
7343,
628
] | 5 | 5 |
list = ['Tiago','Ivan','Henrique', 'Paulo']
nome = 'teste'
nome = input('Digite um nome: ') # Python input prompt
print(nome)
for i in range(len(list)):
if list[i] == nome:
print(nome,'is number',i + 1,'on the list')
break
else:
print(nome,'is not on the list') | [
4868,
796,
37250,
51,
29601,
41707,
40,
10438,
41707,
26055,
33865,
3256,
705,
12041,
78,
20520,
198,
77,
462,
796,
705,
9288,
68,
6,
198,
77,
462,
796,
5128,
10786,
19511,
578,
23781,
299,
462,
25,
705,
8,
1303,
11361,
5128,
6152,
... | 2.317073 | 123 |
import numpy as np
import math
import random
| [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
4738,
198
] | 3.75 | 12 |
"""
test to generate noise but failed for 2d
"""
import math
import random
maxfreq = 1/500
myfrequencies = [random.random() * maxfreq * 2 * math.pi for _ in range(5)]
myphases = [random.random() * math.pi for _ in range(5)]
x = [n for n in range(display_width)]
y = [myfunction(n, 0) for n in x]
| [
37811,
198,
9288,
284,
7716,
7838,
475,
4054,
329,
362,
67,
198,
37811,
198,
198,
11748,
10688,
198,
11748,
4738,
198,
198,
9806,
19503,
80,
796,
352,
14,
4059,
198,
1820,
69,
8897,
3976,
796,
685,
25120,
13,
25120,
3419,
1635,
3509,
... | 2.711712 | 111 |
from django.contrib import admin
from django_summernote.admin import SummernoteModelAdmin
from .models import (
Event,
EventDateAndTime,
EventDescription,
EventLocation)
# Apply summernote to all TextField in model.
admin.site.register(Event, EventAdmin)
admin.site.register(EventDescription, Som... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
62,
16345,
647,
11295,
13,
28482,
1330,
10216,
11295,
17633,
46787,
198,
198,
6738,
764,
27530,
1330,
357,
198,
220,
220,
220,
8558,
11,
198,
220,
220,
220,
8558,
... | 3.264706 | 102 |
# Generated by Django 2.2.10 on 2020-02-13 05:16
from django.db import migrations, models
import djangocms_bootstrap4.contrib.bootstrap4_link.validators
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
940,
319,
12131,
12,
2999,
12,
1485,
8870,
25,
1433,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
648,
420,
907,
62,
18769,
26418,
19,
13,
3642,
... | 2.87037 | 54 |
"""Support files for podman API implementation."""
import datetime
import re
import threading
__all__ = [
'cached_property',
'datetime_parse',
'datetime_format',
]
def datetime_parse(string):
"""Convert timestamp to datetime.
Because date/time parsing in python is still pedantically stupid,
... | [
37811,
15514,
3696,
329,
24573,
805,
7824,
7822,
526,
15931,
198,
11748,
4818,
8079,
198,
11748,
302,
198,
11748,
4704,
278,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
66,
2317,
62,
26745,
3256,
198,
220,
220,
220,
... | 2.329762 | 840 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ResourceSecretService.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
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,
20857,
23725,
16177,
13,
1676,
1462,
198,
37811,
8645,
515,
8435,
11876,
2... | 2.509001 | 18,442 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Girder plugin framework and tests adapted from Kitware Inc. source and
# documentation by the Imaging and Visualization Group, Advanced Biomedical
# Computational Science, Frederick Nation... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
220,
23837,
1082,
13877,
9355,
290,
5254,
16573,
422,
10897,
1574,
3457,
... | 2.575806 | 2,480 |
from keras.models import Sequential, load_model
from keras.layers import Dense, Dropout, Conv2D, MaxPooling2D, Activation, Flatten
from keras.optimizers import Adam
from keras.callbacks import TensorBoard
import tensorflow as tf
from tqdm import tqdm
from collections import deque
from gym.bug_env.environment import ... | [
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
11,
3440,
62,
19849,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
11,
14258,
448,
11,
34872,
17,
35,
11,
5436,
27201,
278,
17,
35,
11,
13144,
341,
11,
1610,
41769,
198,
6738,
... | 2.92068 | 353 |
# -*- coding: utf-8 -*-
'''
'''
from typing import MutableSequence, Callable
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
220,
198,
7061,
6,
198,
6738,
19720,
1330,
13859,
540,
44015,
594,
11,
4889,
540,
628,
628,
628
] | 2.4 | 35 |
from flask import Flask,render_template,request
from flask_wtf.csrf import CSRFProtect
from check_domain_result import compute
from check_traceroute import get_traceroute_result
from check_mtr import get_mtr_result
from check_ping import get_ping_result
from geo_latency_info import *
import folium
import os
import logg... | [
6738,
42903,
1330,
46947,
11,
13287,
62,
28243,
11,
25927,
198,
6738,
42903,
62,
86,
27110,
13,
6359,
41871,
1330,
9429,
32754,
41426,
198,
6738,
2198,
62,
27830,
62,
20274,
1330,
24061,
198,
6738,
2198,
62,
2213,
11736,
13192,
1330,
65... | 2.8 | 260 |
import time
import queue
import threading
import RPi.GPIO as GPIO
_GPIO_PIN = 25
pixels = Pixels()
if __name__ == '__main__':
while True:
try:
pixels.wakeup()
time.sleep(3)
pixels.listen()
time.sleep(3)
pixels.think()
time.sleep(3)
... | [
11748,
640,
198,
11748,
16834,
198,
11748,
4704,
278,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
198,
62,
16960,
9399,
62,
44032,
796,
1679,
198,
198,
79,
14810,
796,
350,
14810,
3419,
198,
198,
361,
11593,
3672,
834,
66... | 1.819149 | 282 |
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to ... | [
2235,
198,
2,
770,
3788,
373,
4166,
290,
1220,
393,
9518,
416,
7760,
1169,
261,
5834,
11,
198,
2,
12997,
284,
17453,
46133,
16945,
54,
12,
2713,
12,
34,
48,
12,
940,
3134,
351,
262,
1294,
5070,
13,
201,
198,
2,
220,
201,
198,
2,... | 1.869937 | 10,887 |
from __future__ import division, print_function
import time
import os
import configargparse
import bz2
import csv
import json
import sys
from datetime import datetime
from os import listdir
from os.path import isfile, join
import multiprocessing as mp
# STATS to be extracted :
# 1) Total number of call and text per ... | [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
4566,
853,
29572,
198,
11748,
275,
89,
17,
198,
11748,
269,
21370,
198,
11748,
33918,
198,
11748,
25064,
198,
6738,
4818,
8079,
133... | 2.720588 | 1,156 |
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
from rest_framework import status
from rest_framework.test import APIClient
from api.models import Category
category_URL = reverse('api:category-list')
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6... | 3.539474 | 76 |
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import unittest
from config import *
from youku import YoukuUsers
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
1... | 2.510417 | 96 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 13 12:12:25 2021
@author: Jordan
"""
import sys
import os
import numpy as np
import pandas as pd
import seaborn as sns
import tempfile
import gc
import re
import collections
import gzip
import bisect
import pickle
import itertools
import math
sns.... | [
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,
1737,
1511,
1105,
25,
1065,
25,
1495,
33448,
198,
198,
31,
9800,
25,
8078,
198,
37... | 1.791172 | 12,642 |
from rest_framework.routers import DefaultRouter
from .views import UserViewSet
router = DefaultRouter()
router.register('users', UserViewSet)
urlpatterns = router.urls
| [
198,
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
15161,
49,
39605,
198,
198,
6738,
764,
33571,
1330,
11787,
7680,
7248,
198,
198,
472,
353,
796,
15161,
49,
39605,
3419,
198,
472,
353,
13,
30238,
10786,
18417,
3256,
11787,
7680,
7248,
... | 3.264151 | 53 |
from donkeycar.parts.model_wrappers.Angle5FlipSharpThrottleOn import Angle5FlipSharpThrottleOn
from donkeycar.parts.model_wrappers.Angle5ifelse import Angle5ifelse
from donkeycar.parts.model_wrappers.Angle3ifelse import Angle3ifelse
from donkeycar.parts.model_wrappers.Angle3speedy import SpeedyFranklin3choices
from don... | [
6738,
50085,
7718,
13,
42632,
13,
19849,
62,
29988,
11799,
13,
13450,
293,
20,
7414,
541,
44336,
817,
305,
23296,
2202,
1330,
42375,
20,
7414,
541,
44336,
817,
305,
23296,
2202,
198,
6738,
50085,
7718,
13,
42632,
13,
19849,
62,
29988,
... | 3.138686 | 137 |
my_list = ['banana', 'strawberry', 'apple', 'watermelon', 'peach'] #a simple list
sorted_list = sorted(my_list) #python includes powerful sorting algorithms
for x in range(1,11,1): #a for loop which counts to ten
"""range takes up to three arguments: the start, which is
inclusive, the end, which is exclusive and th... | [
1820,
62,
4868,
796,
37250,
3820,
2271,
3256,
705,
301,
1831,
8396,
3256,
705,
18040,
3256,
705,
7050,
45690,
3256,
705,
431,
620,
20520,
1303,
64,
2829,
1351,
198,
82,
9741,
62,
4868,
796,
23243,
7,
1820,
62,
4868,
8,
1303,
29412,
... | 3.132979 | 188 |
# Dictionaries for base64 encoding and decoding.
encode_dict = {0:'A',1:'B',2:'C',3:'D',4:'E',5:'F',6:'G',7:'H',8:'I',9:'J',10:'K',11:'L',12:'M',13:'N',14:'O',15:'P',16:'Q',17:'R',18:'S',19:'T',20:'U',21:'V',22:'W',
23:'X',24:'Y',25:'Z',26:'a',27:'b',28:'c',29:'d',30:'e',31:'f',32:'g',33:'h',34:'i',35:'j',36:'k',... | [
2,
360,
2867,
3166,
329,
2779,
2414,
21004,
290,
39938,
13,
198,
198,
268,
8189,
62,
11600,
796,
1391,
15,
32105,
32,
3256,
16,
32105,
33,
3256,
17,
32105,
34,
3256,
18,
32105,
35,
3256,
19,
32105,
36,
3256,
20,
32105,
37,
3256,
2... | 1.832258 | 310 |
import tkinter as tk
| [
11748,
256,
74,
3849,
355,
256,
74,
628
] | 2.75 | 8 |
import os
from typing import NamedTuple
from google.oauth2.service_account import Credentials as OAuthCredentials
from .constants import OAUTH_CONFIG_PATH, OAUTH_SCOPES
| [
11748,
28686,
198,
6738,
19720,
1330,
34441,
51,
29291,
198,
198,
6738,
23645,
13,
12162,
1071,
17,
13,
15271,
62,
23317,
1330,
327,
445,
14817,
355,
440,
30515,
34,
445,
14817,
198,
198,
6738,
764,
9979,
1187,
1330,
440,
32,
24318,
6... | 3.107143 | 56 |
#!/usr/bin/python
import requests
import json
import re
import mechanize
import cookielib
import sys
from BeautifulSoup import BeautifulSoup
# Variables
engaged = False
#topic_url="https://www.kvraudio.com/forum/viewtopic.php?f=1&t=470835"
topic_url = "http://www.kvraudio.com/forum/viewtopic.php?f=1&t=492028"
#topic... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
3962,
1096,
198,
11748,
4255,
8207,
571,
198,
11748,
25064,
198,
6738,
23762,
50,
10486,
1330,
23762,
50,
10486,
628,
198,
2,
... | 1.971197 | 2,222 |
from django.apps import AppConfig
from django.db.models.signals import post_save
from django.apps import apps
from .signals import assign_season_to_all_user
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
6738,
42625,
14208,
13,
18211,
1330,
6725,
198,
6738,
764,
12683,
874,
1330,
8333,
62,
6230,
62,... | 3.340426 | 47 |
import datetime
import numpy as np
import pandas as pd
from google.oauth2 import service_account
from googleapiclient import discovery
SPREADSHEET_ID = "1otVI0JgfuBDJw8jlW_l8vHXyfo5ufJiXOqshDixazZA" # ALL-IN-ONE-LOG-2021
if __name__ == "__main__":
AccountSheet = Spreadsheet(SPREADSHEET_ID)
sheet = ... | [
11748,
4818,
8079,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
23645,
13,
12162,
1071,
17,
1330,
2139,
62,
23317,
198,
6738,
23645,
499,
291,
75,
1153,
1330,
9412,
198,
198,
4303,
15675,
9... | 2.404959 | 242 |
import telebot
import settings
import helpers
from models import User
bot = telebot.TeleBot(settings.token, parse_mode=None)
users = dict()
bot.polling()
| [
11748,
5735,
13645,
198,
11748,
6460,
198,
11748,
49385,
198,
6738,
4981,
1330,
11787,
198,
198,
13645,
796,
5735,
13645,
13,
31709,
20630,
7,
33692,
13,
30001,
11,
21136,
62,
14171,
28,
14202,
8,
198,
18417,
796,
8633,
3419,
628,
628,
... | 3.285714 | 49 |