content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import logging
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import EmailMessage, EmailMultiAlternatives
from oscar.core.loading import get_model
CommunicationEventType = get_model('communication', 'CommunicationEventType')
Email = get_model('communicati... | [
11748,
18931,
201,
198,
201,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
201,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
27530,
1330,
14413,
201,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
1330,
9570,
12837,
11,
9570,
... | 3.535714 | 112 |
# Copyright (c) 2022 PaddlePaddle Authors. 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 appli... | [
2,
15069,
357,
66,
8,
33160,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845... | 3.88172 | 186 |
# coding: utf-8
"""*****************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
37811,
17174,
17174,
4557,
35625,
198,
9,
15069,
357,
34,
8,
13130,
4527,
35902,
8987,
3457,
13,
290,
663,
34943,
13,
198,
9,
198,
9,
15540,
284,
534,
11846,
351,
777,
2846,
11,
345,
743,
779,
... | 3.29923 | 909 |
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema
from variance.models.unit import UnitModel
| [
6738,
22397,
42725,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
27722,
27054,
2611,
198,
6738,
24198,
13,
27530,
13,
20850,
1330,
11801,
17633,
628
] | 4 | 25 |
# -*- coding:utf-8 -*-
"""
Copyright 2021 Jerome DE LUCCHI
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 appli... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
15069,
33448,
33617,
5550,
406,
9598,
3398,
40,
628,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
19... | 3.55 | 200 |
# Generated by Django 2.2.1 on 2019-06-24 10:38
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
16,
319,
13130,
12,
3312,
12,
1731,
838,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import pytest
import json
from pymerkle.nodes import Node, Leaf, NODE_TEMPLATE
from pymerkle.hashing import HashEngine
h = HashEngine()
encoding = h.encoding
hash_func = h.hash
# Full binary structure (parent-child relations): 4 leaves, 7 nodes in total
leaf1 = Leaf.from_record(b'first record...', hash_func)
leaf2 ... | [
11748,
12972,
9288,
198,
11748,
33918,
198,
198,
6738,
12972,
647,
74,
293,
13,
77,
4147,
1330,
19081,
11,
14697,
11,
399,
16820,
62,
51,
3620,
6489,
6158,
198,
6738,
12972,
647,
74,
293,
13,
71,
2140,
1330,
21059,
13798,
628,
198,
... | 1.629447 | 2,839 |
#!/usr/bin/env python
#
import cgi
import wsgiref.handlers
from actingweb import actor
from actingweb import auth
from actingweb import config
import webapp2
from on_aw import on_aw_delete
import json
application = webapp2.WSGIApplication([
webapp2.Route(r'/<id><:/?>', MainPage, name='MainPage'),
], debug=True)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
11748,
269,
12397,
198,
11748,
266,
45213,
557,
69,
13,
4993,
8116,
198,
6738,
7205,
12384,
1330,
8674,
198,
6738,
7205,
12384,
1330,
6284,
198,
6738,
7205,
12384,
1330,
4566,
... | 2.93578 | 109 |
class ReverseProxied(object):
"""This middleware can be applied to add HTTP proxy support to an application
which access the WSGI environment directly.
It sets `REMOTE_ADDR`, `HTTP_HOST`, `wsgi.url_scheme` from `X-Forwarded` headers.
Also front-end server can be configured to quietly bind this to a URL ... | [
4871,
31849,
2964,
87,
798,
7,
15252,
2599,
198,
220,
220,
220,
37227,
1212,
3504,
1574,
460,
307,
5625,
284,
751,
14626,
15741,
1104,
284,
281,
3586,
198,
220,
220,
220,
543,
1895,
262,
25290,
18878,
2858,
3264,
13,
198,
220,
220,
... | 2.830986 | 284 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: FGDB driver stress testing of CreateFeature() with user set FID
# Author: Even Rouault <even dot rouault at spatialys dot com>
#
##########... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
720,
7390,
3,
198,
2,
198,
2,
4935,
25,
220,
27044,
1847,
14,
49656,
6208,
... | 3.577446 | 736 |
import pytest
from django.conf import settings
from django.contrib.auth.models import Group
from django.test import TestCase
from django_capture_on_commit_callbacks import capture_on_commit_callbacks
from guardian.shortcuts import get_groups_with_perms, get_users_with_perms
from grandchallenge.evaluation.models import... | [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
4912,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
62,
27144,
495,
... | 2.957717 | 473 |
import unittest
import torch
import pynncml as pnc
import os
| [
11748,
555,
715,
395,
198,
11748,
28034,
198,
11748,
279,
2047,
10782,
4029,
355,
279,
10782,
198,
11748,
28686,
628
] | 3.1 | 20 |
"""added presence health intent keywords
Revision ID: 2e4d69d668c6
Revises: a31d1c1d12af
Create Date: 2017-10-30 10:45:33.648982
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '2e4d69d668c6'
down_revision = 'a31d1c1d12... | [
37811,
29373,
4931,
1535,
6824,
26286,
198,
198,
18009,
1166,
4522,
25,
362,
68,
19,
67,
3388,
67,
35809,
66,
21,
198,
18009,
2696,
25,
257,
3132,
67,
16,
66,
16,
67,
1065,
1878,
198,
16447,
7536,
25,
2177,
12,
940,
12,
1270,
838,... | 2.552448 | 143 |
hide_initial_pygame_message() # to hide the initial pygame message
import PIL
from PIL import Image
import pygame
| [
198,
198,
24717,
62,
36733,
62,
9078,
6057,
62,
20500,
3419,
220,
1303,
284,
7808,
262,
4238,
12972,
6057,
3275,
198,
198,
11748,
350,
4146,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
12972,
6057,
628,
198
] | 3.243243 | 37 |
import logging
from typing import List, Any
from fungit.commands import loading
from fungit.style import Symbol
from ..shared import BoxType
from ..theme import Theme
from .navigation_box import NavBox
LOG = logging.getLogger(__name__)
# GIT_BOXES = [StateBox, StatusBox, BranchBox, CommitBox, StashBox]
NAVBO... | [
11748,
18931,
198,
6738,
19720,
1330,
7343,
11,
4377,
198,
198,
6738,
1257,
18300,
13,
9503,
1746,
1330,
11046,
198,
6738,
1257,
18300,
13,
7635,
1330,
38357,
198,
6738,
11485,
28710,
1330,
8315,
6030,
198,
6738,
11485,
43810,
1330,
26729... | 2.927711 | 166 |
import pdb
pdb.run('aaa') | [
11748,
279,
9945,
201,
198,
201,
198,
79,
9945,
13,
5143,
10786,
46071,
11537
] | 2 | 14 |
# Event: LCCS Python Fundamental Skills Workshop
# Date: May 2018
# Author: Joe English, PDST
# eMail: computerscience@pdst.ie
# Purpose: A program to demonstrate the use of lists in a turtle graphic program
from turtle import *
pensize(2) # set the pen size to 2
color("red") # set the pen colour to red
#... | [
2,
8558,
25,
406,
4093,
50,
11361,
49983,
20389,
26701,
201,
198,
2,
7536,
25,
1737,
2864,
201,
198,
2,
6434,
25,
5689,
3594,
11,
14340,
2257,
201,
198,
2,
304,
25804,
25,
9061,
4234,
31,
30094,
301,
13,
494,
201,
198,
2,
32039,
... | 2.728814 | 236 |
import sys
import os
import pytest
from tests.unit.test_constants import *
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append('././apps/')
@pytest.fixture()
def user_input_valid_test_case_1():
"""
This is a valid test case
Content-Encoding: utf-8
Content-Type: application/x-www-... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
198,
6738,
5254,
13,
20850,
13,
9288,
62,
9979,
1187,
1330,
1635,
198,
198,
15908,
62,
6978,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
... | 2.350868 | 1,901 |
# -*- coding: utf-8 -*-
import Flashlight
from math import pi
functions = {"flashlight":lambda flashlight:Flashlight.exe(flashlight)}
items = {}
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
9973,
2971,
198,
6738,
10688,
1330,
31028,
198,
198,
12543,
2733,
796,
19779,
34167,
2971,
1298,
50033,
38371,
25,
30670,
2971,
13,
13499,
7,
34167,
2971,
3816... | 3.083333 | 48 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from textwrap import... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
1946,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
1... | 3.17734 | 203 |
import linear_system_solver as lss
# write coefficient matrix A here.
A = [[1, 3, 2, -4, 3],
[-2, -1, 2, 6, 4],
[0, -1, 3, -5, 1],
[3, -4, 2, 5, -7],
[1, 2, -8, 6, 1]]
# write constant b vector here.
b = [[-3],
[19],
[-2],
[-11],
[4]]
ls = lss.LinearSystemSolver(A, b)
print(ls... | [
11748,
14174,
62,
10057,
62,
82,
14375,
355,
300,
824,
198,
198,
2,
3551,
35381,
17593,
317,
994,
13,
198,
32,
796,
16410,
16,
11,
513,
11,
362,
11,
532,
19,
11,
513,
4357,
198,
220,
220,
220,
220,
25915,
17,
11,
532,
16,
11,
... | 1.96 | 250 |
#!/usr/bin/env python
"""Eval level activity
"""
__author__ = 'Anna Kukleva'
__date__ = 'January 2019'
import os
from ute.utils.arg_pars import opt
import data_utils.FS_utils.update_argpars as fs_utils
fs_utils.update()
actions = ['add_dressing',
'add_oil',
'add_pepper',
'cut',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
36,
2100,
1241,
3842,
198,
37811,
198,
198,
834,
9800,
834,
796,
705,
31160,
509,
2724,
2768,
64,
6,
198,
834,
4475,
834,
796,
705,
21339,
13130,
6,
198,
198,
11748,
2868... | 2.041609 | 721 |
#!/usr/bin/python
# encoding: utf-8
"""
@author: Ian
@contact:yongguiluo@hotmail.com
@file: nltk_wrapper.py
@time: 2019/3/19 10:56
"""
import nltk
# from nltk.book import *
from nltk.corpus import reuters
from nltk.util import trigrams
from nltk.util import bigrams
from nltk.text import TextCollection
class NltkWrap... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
31,
9800,
25,
12930,
198,
31,
32057,
25,
88,
506,
5162,
346,
20895,
31,
8940,
4529,
13,
785,
198,
31,
7753,
25,
299,
2528,
74,
62,
... | 1.537182 | 1,022 |
"""
File: 1032.py
Title: Stream of Characters
Difficulty: Hard
URL: https://leetcode.com/problems/stream-of-characters/
"""
import unittest
from typing import List
if __name__ == "__main__":
unittest.main()
| [
37811,
198,
220,
220,
220,
9220,
25,
838,
2624,
13,
9078,
198,
220,
220,
220,
11851,
25,
13860,
286,
26813,
198,
220,
220,
220,
27419,
25,
6912,
198,
220,
220,
220,
10289,
25,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
... | 2.617978 | 89 |
"""SGP4 propagator. This is a wrapper around the PyPI SGP4 propagator.
However, this does not generate an artificial TLE. So there is no
string manipulation involved. Hence this is faster than sgp4_prop_string."""
from datetime import datetime
import numpy as np
from sgp4.model import Satellite
from sgp4.earth_g... | [
37811,
50,
16960,
19,
8928,
1352,
13,
770,
318,
257,
29908,
1088,
262,
9485,
11901,
311,
16960,
19,
8928,
1352,
13,
198,
220,
220,
2102,
11,
428,
857,
407,
7716,
281,
11666,
309,
2538,
13,
1406,
612,
318,
645,
198,
220,
220,
4731,
... | 2.103151 | 2,317 |
# MIT licence @ aiand647
from cv2 import cv2
import numpy as np
from load_model import load_yolo
from draw_boxes import put_boxes
from boxes import box_list
#setup camera input an window size
CAMERA_PORT = 0
WIDTH = 1280
HEIGHT = 720
WEIGHTS = "/{path to weight file}"
CFG = "/{path to cfg file}"
NAMES = "/{path to ... | [
2,
17168,
17098,
2488,
257,
72,
392,
33981,
198,
198,
6738,
269,
85,
17,
1330,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3440,
62,
19849,
1330,
3440,
62,
88,
14057,
198,
6738,
3197,
62,
29305,
1330,
1234,
62,
29305... | 2.324042 | 574 |
import multiprocessing
import socket
import json
from blockchain.peer import Peer
| [
11748,
18540,
305,
919,
278,
198,
11748,
17802,
198,
11748,
33918,
198,
198,
6738,
11779,
13,
33350,
1330,
41139,
628
] | 4.2 | 20 |
import uuid
from random import randint
import factory
import pytz
from django.urls import reverse
from django.utils import timezone
from factory import fuzzy
from waldur_core.structure import models as structure_models
from waldur_core.structure.tests import factories as structure_factories
from waldur_core.structure... | [
11748,
334,
27112,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
11748,
8860,
198,
11748,
12972,
22877,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
8860,
1330,
34669,
... | 3.602837 | 141 |
"""Well known exceptions."""
from routemaster_sdk.types import LabelRef, StateMachine
class UnknownLabel(ValueError):
"""Represents a label unknown in the given state machine."""
deleted = False
class DeletedLabel(UnknownLabel):
"""Represents a label deleted in the given state machine."""
deleted =... | [
37811,
5779,
1900,
13269,
526,
15931,
198,
198,
6738,
3441,
368,
1603,
62,
21282,
74,
13,
19199,
1330,
36052,
8134,
11,
1812,
37573,
628,
198,
4871,
16185,
33986,
7,
11395,
12331,
2599,
198,
220,
220,
220,
37227,
6207,
6629,
257,
6167,
... | 3.630137 | 146 |
from datetime import datetime
import time
from USBScale import DymoUSBScale
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
640,
198,
6738,
8450,
29990,
1330,
360,
4948,
78,
27155,
29990,
628,
628,
198
] | 3.636364 | 22 |
# import socket
import __future__
from __future__ import print_function
import socket
# Imports to access nugget methods
import argparse
import hashlib
import sys
from getpass import getpass
from Cryptodome.Cipher import AES
from crankycoin import *
# Import for the GUI
import Tkinter as tk
import random
import reque... | [
2,
1330,
17802,
198,
11748,
11593,
37443,
834,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
17802,
198,
198,
2,
1846,
3742,
284,
1895,
299,
1018,
1136,
5050,
198,
11748,
1822,
29572,
198,
11748,
12234,
8019,
198,
1174... | 3.536 | 125 |
import numpy as np
import inspect
import torch
import torch.nn as nn
from typing import Union, List, Tuple, Any, Dict as TDict, Iterator
from torch import Tensor
from torch.hub import load_state_dict_from_url
import hashlib
import json
from tqdm import tqdm
from os.path import join
from os import makedirs
import pynvml... | [
11748,
299,
32152,
355,
45941,
198,
11748,
10104,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
19720,
1330,
4479,
11,
7343,
11,
309,
29291,
11,
4377,
11,
360,
713,
355,
13320,
713,
11,
40806,
1352,
198,
67... | 2.343736 | 4,486 |
validade = db(db.Estoque.Ativo == True).select(db.Produto.ProdutoDescricao, db.Estoque.Lote,
db.Estoque.Validade,
join=db.Produto.on(db.Estoque.ID_Produto == db.Produto.id))
proximoAValidade = []
data = date.fromordinal(hoje.t... | [
12102,
671,
796,
20613,
7,
9945,
13,
22362,
78,
4188,
13,
2953,
23593,
6624,
6407,
737,
19738,
7,
9945,
13,
2964,
67,
9390,
13,
2964,
67,
9390,
24564,
1173,
5488,
11,
20613,
13,
22362,
78,
4188,
13,
43,
1258,
11,
198,
220,
220,
22... | 1.982262 | 451 |
# Copyright (c) Microsoft Corporation.
# Licensed under the GNU General Public License v3.0 or later.
# See License.txt in the project root for license information.
#
from .keyvault import pull_key
| [
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
393,
1568,
13,
198,
2,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
2,
198,
198,
6738,
764,
25... | 3.826923 | 52 |
import pygame
import random
| [
11748,
12972,
6057,
198,
11748,
4738,
198
] | 4 | 7 |
import unittest
import cv2
from IDCard import IDCard
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
269,
85,
17,
198,
6738,
4522,
16962,
1330,
4522,
16962,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.6 | 40 |
import sys
import numpy as np
from count_nonblack import count_nonblack
from PIL import Image as PillowImage | [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
954,
62,
13159,
13424,
1330,
954,
62,
13159,
13424,
198,
6738,
350,
4146,
1330,
7412,
355,
19770,
322,
5159
] | 3.724138 | 29 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.853659 | 164 |
import unittest
from unittest.mock import MagicMock, patch
from nasa_fevo.HttpGetterWithCache import HttpGetterWithCache
from nasa_fevo.InMemoryCache import InMemoryCache
from nasa_fevo.HttpGetter import HttpGetter
from test_data import TEST_RESP
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
11,
8529,
628,
198,
6738,
299,
15462,
62,
69,
1990,
78,
13,
43481,
3855,
353,
3152,
30562,
1330,
367,
29281,
3855,
353,
3152,
30562,
198,
198,
6738,
... | 2.761468 | 109 |
# 1. uzdevums
#Izdrukāt visas valstis vienā rindiņā. valstis = ['Latvija','Lietuva','Igaunija']
valstis = ["Latvija", "Lietuva", "Igaunija"]
for valsts1 in valstis:
print(valsts1, end=" ")
# print(valstis[0], valstis[2], valstis[3])
print()
print("==============================================")
# 2. uzdevums
#... | [
2,
352,
13,
334,
89,
7959,
5700,
198,
2,
40,
89,
67,
622,
74,
10235,
83,
23727,
1188,
301,
271,
410,
2013,
10235,
374,
521,
72,
129,
228,
10235,
13,
1188,
301,
271,
796,
37250,
24220,
85,
34655,
41707,
43,
1155,
84,
6862,
41707,
... | 2.144404 | 831 |
from bs4 import BeautifulSoup
import requests
import emailer
import time
import sys
amazon_url = input("Amazon Url : ")
currency = get_price(amazon_url)
print("\n \n")
budget = input("Your Budget (in " + currency + ") : ")
budget = float(budget)
while True:
converted_price , currency , title = Ama... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
201,
198,
11748,
7007,
201,
198,
11748,
3053,
263,
201,
198,
11748,
640,
201,
198,
11748,
25064,
220,
201,
198,
201,
198,
201,
198,
33103,
62,
6371,
796,
5128,
7203,
24888,
8799,
75,
1058,
... | 2.521073 | 261 |
import os
import shutil
compile_training_data()
| [
11748,
28686,
198,
11748,
4423,
346,
628,
198,
5589,
576,
62,
34409,
62,
7890,
3419,
198
] | 3.125 | 16 |
import pandas as pd
import datetime as dt
import os | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
28686
] | 3.1875 | 16 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import datetime
from django.db import models
from django.db import models as db
from django.utils.translation im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
... | 3.309859 | 213 |
from detectron2.layers import ShapeSpec
from detectron2.modeling.backbone.build import BACKBONE_REGISTRY
from detectron2.modeling.backbone.fpn import FPN, LastLevelMaxPool, LastLevelP6P7, LastLevelP6
from .resnet import build_cls_resnet_backbone
__all__ = ["build_retinanet_cls_resnet_fpn_backbone", ]
@BACKBONE_REGI... | [
198,
6738,
4886,
1313,
17,
13,
75,
6962,
1330,
25959,
22882,
198,
6738,
4886,
1313,
17,
13,
4666,
10809,
13,
1891,
15992,
13,
11249,
1330,
28767,
33,
11651,
62,
31553,
1797,
40405,
198,
6738,
4886,
1313,
17,
13,
4666,
10809,
13,
1891,... | 2.286611 | 478 |
#!/usr/bin/env python3
"""
Settings manager for the data tracker.
Read settings from `./config.yaml`, `../config.yaml` or from the provided path.
"""
import logging
import os
import sys
import yaml
def read_config(path: str = ""):
"""
Look for settings.yaml and parse the settings from there.
The file ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
26232,
4706,
329,
262,
1366,
30013,
13,
198,
198,
5569,
6460,
422,
4600,
19571,
11250,
13,
88,
43695,
47671,
4600,
40720,
11250,
13,
88,
43695,
63,
393,
422,
262,
2810,... | 2.28844 | 891 |
import pickle
import numpy as np
import shutil
from html4vision import Col, imagetable
from pathlib import Path
from sklearn.metrics.pairwise import cosine_similarity
from tqdm import tqdm
path_fids = Path("../../data/fiw-videos/FIW-MM/")
fn_features = "encodings.pkl"
# def process_mid():
ii = 0
for path_fid in tqd... | [
11748,
2298,
293,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4423,
346,
198,
6738,
27711,
19,
10178,
1330,
1623,
11,
3590,
316,
540,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
1341,
35720,
13,
4164,
10466,
13,
24874,
3083,... | 1.722306 | 1,995 |
import todoist
api = todoist.TodoistAPI('92f210500cb3c3adaea9e6a2f96815db5c8feeb5')
api.sync()
full_name = api.state['user']['full_name']
print(full_name)
| [
11748,
284,
4598,
396,
198,
15042,
796,
284,
4598,
396,
13,
51,
24313,
396,
17614,
10786,
5892,
69,
21536,
4059,
21101,
18,
66,
18,
324,
44705,
24,
68,
21,
64,
17,
69,
38956,
1314,
9945,
20,
66,
23,
39071,
65,
20,
11537,
198,
1504... | 2.166667 | 72 |
import datetime
import pytest
@pytest.mark.unit
| [
11748,
4818,
8079,
198,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
4102,
13,
20850,
198
] | 2.833333 | 18 |
x = 0
if 1 == 1:
x += 5
else:
x += 3
assert x == 5
y = 0
if 1 == 2:
y += 5
else:
y += 3
assert y == 3
| [
87,
796,
657,
198,
361,
352,
6624,
352,
25,
198,
220,
220,
220,
2124,
15853,
642,
198,
17772,
25,
198,
220,
220,
220,
2124,
15853,
513,
198,
198,
30493,
2124,
6624,
642,
198,
198,
88,
796,
657,
198,
361,
352,
6624,
362,
25,
198,
... | 1.80597 | 67 |
from arpoc.plugins.obl_loggers import *
from arpoc.ac.common import Effects
new_cfg = {
"logger_cfg": {
"handlers": {
"obligation_file": None
},
"loggers": {
"obligation_logger": {
"handlers": []
}
}
}
}
| [
6738,
610,
79,
420,
13,
37390,
13,
45292,
62,
6404,
5355,
1330,
1635,
198,
6738,
610,
79,
420,
13,
330,
13,
11321,
1330,
17417,
198,
198,
3605,
62,
37581,
796,
1391,
198,
220,
220,
220,
366,
6404,
1362,
62,
37581,
1298,
1391,
220,
... | 1.754386 | 171 |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018 ZhicongYan
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
17168,
13789,
198,
2,
220,
198,
2,
15069,
357,
66,
8,
2864,
10511,
291,
506,
49664,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
... | 3.314252 | 856 |
#!/usr/bin/env python
#
# Copyright 2012 Open Source Robotics Foundation
#
# 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
2321,
4946,
8090,
47061,
5693,
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,
42... | 3.140762 | 341 |
#This function adds two numbers
#This function subtracts two numbers
#This function multiplies two numbers
#This function divides two numbers
#Flag variable used for calculator termination purpose
#Initially flag is set to 0
flag = 0
#Until the user chooses option 5(Stop), calculator keeps on w... | [
2,
1212,
2163,
6673,
734,
3146,
220,
201,
198,
201,
198,
2,
1212,
2163,
34128,
82,
734,
3146,
220,
201,
198,
201,
198,
2,
1212,
2163,
15082,
444,
734,
3146,
201,
198,
201,
198,
2,
1212,
2163,
36319,
734,
3146,
201,
198,
201,
198,
... | 2.47813 | 663 |
expressions = ['(a+b)/(a+b+c)-b/(b+d)/(a+b+c)*(a+b+c+d)',
'(a+b)/(a+b+c+d)*a/(a+c)-(a+b)/(a+b+c+d)*b/(b+d)',
'(a+b)/(a+b+c+d)-b/(a+b+c+d)/d*(c+d)',
'(a+b)/(a+b+c+d)-b/(b+d)',
'(a+b)/(a+b+c+d)/b*(b+d)-(a+c)/(a+b+c+d)/a*(a+b)',
'(a+b)/(a+b+c+d)/b*(b+d)-1',
'(a+b)/(a+b+c+d)/b*(b+d)-1/(a+b+c+d)*(b+d)/d*(c+d)',
'(a+b)/(a+b+... | [
42712,
507,
796,
37250,
7,
64,
10,
65,
20679,
7,
64,
10,
65,
10,
66,
13219,
65,
29006,
65,
10,
67,
20679,
7,
64,
10,
65,
10,
66,
27493,
7,
64,
10,
65,
10,
66,
10,
67,
8,
3256,
198,
6,
7,
64,
10,
65,
20679,
7,
64,
10,
6... | 1.180934 | 17,067 |
import random
from pomdp_problems.tiger import TigerProblem, test_planner
import pomdp_py
from pomdp_py.utils.debugging import TreeDebugger
description="testing pomdp_py.utils.TreeDebugger"
if __name__ == "__main__":
run(debug_tree=True)
| [
11748,
4738,
198,
6738,
279,
296,
26059,
62,
1676,
22143,
13,
83,
8254,
1330,
17030,
40781,
11,
1332,
62,
11578,
1008,
198,
11748,
279,
296,
26059,
62,
9078,
198,
6738,
279,
296,
26059,
62,
9078,
13,
26791,
13,
24442,
2667,
1330,
1220... | 2.848837 | 86 |
import matplotlib, matplotlib.pyplot as plt
import pickle, pandas as pd
import sklearn.cluster, sklearn.preprocessing
# The NIAAA frame has been pickled before
alco2009 = pickle.load(open("alco2009.pickle", "rb"))
# States" abbreviations
states = pd.read_csv("states.csv",
names=("State", "Standar... | [
11748,
2603,
29487,
8019,
11,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2298,
293,
11,
19798,
292,
355,
279,
67,
198,
11748,
1341,
35720,
13,
565,
5819,
11,
1341,
35720,
13,
3866,
36948,
198,
198,
2,
383,
399,
35... | 2.418919 | 518 |
#!/usr/bin/python2.7
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
17,
13,
22,
198,
2,
198,
2,
15069,
2211,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
3... | 2.748363 | 7,638 |
inp = input('').split()
for i in range(0, int(inp[0])):
input('')
print(inp[1]) | [
259,
79,
796,
5128,
7,
7061,
737,
35312,
3419,
198,
1640,
1312,
287,
2837,
7,
15,
11,
493,
7,
259,
79,
58,
15,
12962,
2599,
198,
197,
15414,
7,
7061,
8,
198,
4798,
7,
259,
79,
58,
16,
12962
] | 2.051282 | 39 |
# 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.781893 | 243 |
"""
Bing (Images)
@website https://www.bing.com/images
@provide-api yes (http://datamarket.azure.com/dataset/bing/search),
max. 5000 query/month
@using-api no (because of query limit)
@results HTML (using search portal)
@stable no (HTML can change)
@parse url, title, img_src
... | [
37811,
198,
21631,
357,
29398,
8,
628,
2488,
732,
12485,
220,
220,
220,
220,
3740,
1378,
2503,
13,
4623,
13,
785,
14,
17566,
198,
2488,
15234,
485,
12,
15042,
3763,
357,
4023,
1378,
19608,
321,
668,
316,
13,
1031,
495,
13,
785,
14,
... | 2.401007 | 596 |
from .HRSC import HRSCDataset
from .transform import *
from torchvision import transforms
| [
6738,
764,
17184,
6173,
1330,
15172,
6173,
27354,
292,
316,
201,
198,
6738,
764,
35636,
1330,
1635,
201,
198,
6738,
28034,
10178,
1330,
220,
31408,
201
] | 3.576923 | 26 |
from distutils.core import setup
setup(name="message",
version="1.0",
description="发送和接受消息模块",
long_description="完整的发送和接受消息模块",
author="DeveloperLY",
author_email="coderyliu@gmail.com",
url="http://www.developerly.net",
py_modules=[
"message.send_message",
... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
3672,
2625,
20500,
1600,
198,
220,
220,
220,
220,
220,
2196,
2625,
16,
13,
15,
1600,
198,
220,
220,
220,
220,
220,
6764,
2625,
20998,
239,
34460,
223,
161,
240,
234,
162,
... | 2.054545 | 275 |
import zmq
| [
11748,
1976,
76,
80,
628
] | 2.4 | 5 |
#!/usr/bin/env python
# encoding=utf-8
"""
Copyright (c) 2021 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFT... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
28,
40477,
12,
23,
198,
37811,
198,
15269,
357,
66,
8,
33448,
43208,
21852,
1766,
1539,
43,
8671,
13,
198,
198,
9654,
35389,
1046,
318,
11971,
739,
17996,
272,
6599,
43,
41... | 2.779883 | 686 |
from typing import Optional
import os
from fastapi import Depends, FastAPI
app = FastAPI()
# inject common parameters in two endpoints using an async function
@app.get("/items/")
@app.get("/users/")
# http://127.0.0.1:11111/users/?q=1&skip=0&limit=10
if __name__ == '__main__':
print(f'INFO: Starting the... | [
6738,
19720,
1330,
32233,
198,
11748,
28686,
198,
6738,
3049,
15042,
1330,
2129,
2412,
11,
12549,
17614,
198,
198,
1324,
796,
12549,
17614,
3419,
628,
198,
2,
8677,
2219,
10007,
287,
734,
886,
13033,
1262,
281,
30351,
2163,
628,
198,
31... | 2.458537 | 205 |
# Copyright (c) 2019 Viosoft 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... | [
2,
15069,
357,
66,
8,
13130,
569,
4267,
11205,
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,
1... | 3.257206 | 451 |
#MIT License
#Copyright (c) 2017 dcolam
from __future__ import with_statement
import sys, time, os, traceback, random, time, ConfigParser, csv
from ij import IJ, ImagePlus, WindowManager
from org.sqlite import SQLiteConfig
from java.lang import Class, System
from loci.plugins.util import WindowTools as wt
from java.sql... | [
2,
36393,
13789,
198,
2,
15269,
357,
66,
8,
2177,
288,
4033,
321,
198,
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
11748,
25064,
11,
640,
11,
28686,
11,
12854,
1891,
11,
4738,
11,
640,
11,
17056,
46677,
11,
269,
21370,
198,
... | 2.361509 | 8,163 |
import math
from .BaseInteractor import _BaseInteractor
class RadiusInteractor(_BaseInteractor):
"""
Select an annulus through a 2D plot
"""
def __init__(self, base, axes, color='black', zorder=5, arc1=None,
arc2=None, theta=math.pi / 8):
"""
"""
_BaseInteract... | [
11748,
10688,
198,
198,
6738,
764,
14881,
9492,
11218,
1330,
4808,
14881,
9492,
11218,
628,
198,
4871,
48838,
9492,
11218,
28264,
14881,
9492,
11218,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9683,
281,
1529,
23515,
832,
257,
... | 1.860678 | 1,859 |
# The MIT License (MIT)
#
# Copyright (c) 2018 Carter Nelson for Adafruit Industries
#
# 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 ri... | [
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
10831,
12996,
329,
1215,
1878,
4872,
20171,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198... | 2.413711 | 2,932 |
'''
Code taken from github.com/mathbeveridge/shake
'''
import itertools
import numpy as np
from scipy import sparse
| [
7061,
6,
198,
10669,
2077,
422,
33084,
13,
785,
14,
11018,
65,
964,
3130,
14,
32431,
198,
7061,
6,
198,
198,
11748,
340,
861,
10141,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
29877,
628,
628,
198
] | 2.95122 | 41 |
from setuptools import setup
version = {}
with open('estimated_taxes/__version__.py', 'r') as f:
exec(f.read(), version)
with open('README.md', 'r') as f:
readme = f.read()
setup(
name='estimated-taxes',
version=version['__version__'],
description='Estimated taxes calculator',
long_description=r... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
9641,
796,
23884,
198,
198,
4480,
1280,
10786,
395,
15655,
62,
19290,
274,
14,
834,
9641,
834,
13,
9078,
3256,
705,
81,
11537,
355,
277,
25,
198,
220,
2452,
7,
69,
13,
961,
22784,
2196,... | 2.421053 | 285 |
"""
Base and utility classes for tseries type pandas objects.
"""
from __future__ import annotations
from datetime import datetime
from typing import (
TYPE_CHECKING,
Any,
Callable,
Sequence,
TypeVar,
cast,
final,
)
import warnings
import numpy as np
from pandas._libs import (
NaT,
... | [
37811,
198,
14881,
290,
10361,
6097,
329,
256,
25076,
2099,
19798,
292,
5563,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
4187... | 2.245536 | 5,881 |
f = open("chal15_input.txt")
total_length = 0
total_escaped_length = 0
for line in f:
full = line[:-1]
full_length = len(full)
print full
# remove the begining / end quotes
partial = full[1:-1]
partial_length = len(partial)
i = 0
while(i < len(partial)):
if partial[i] == '\... | [
69,
796,
1280,
7203,
38009,
1314,
62,
15414,
13,
14116,
4943,
198,
198,
23350,
62,
13664,
796,
657,
198,
23350,
62,
3798,
5813,
62,
13664,
796,
657,
198,
198,
1640,
1627,
287,
277,
25,
198,
220,
220,
220,
1336,
796,
1627,
58,
21912,... | 2.16285 | 393 |
# -*- coding: utf-8 -*-
"""
Created by J McCutcheon
22 Feb 2018
To analyze data from Med PC files or text/csv files and calculate/output lick parameters.
"""
# Import statements
import warnings
import matplotlib as mpl
try:
mpl.use("TkAgg")
except:
warnings.warn("Unable to set TKAgg as matplotlib backend for G... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
416,
449,
5108,
315,
40556,
198,
1828,
3158,
2864,
198,
2514,
16602,
1366,
422,
2019,
4217,
3696,
393,
2420,
14,
40664,
3696,
290,
15284,
14,
22915,
3... | 2.357273 | 1,100 |
#!/usr/bin/env python3
"""Poker Full House.
Create a function that determines whether or not a player is holding a
Full House in their hand. A hand is represented as a list of 5 cards.
A full house is defined as a pair of cards and a three-of-a-kind.
To illustrate:
* ["A", "A", "A", "K", "K"] would be a Full House
*... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
47,
11020,
6462,
2097,
13,
198,
198,
16447,
257,
2163,
326,
15947,
1771,
393,
407,
257,
2137,
318,
4769,
257,
198,
13295,
2097,
287,
511,
1021,
13,
317,
1021,
318,
79... | 2.52967 | 455 |
"""Functions that output bits of HTML like ``'<h1>Hello World</h1>'``."""
import re
import pygments.formatters
import pygments.lexers
def _id_ify(string):
r"""
>>> _id_ify("Hello There!")
'hello-there'
>>> _id_ify("??\t???!?!?!?!??????????")
'3f3f093f3f'
"""
nice_id = re.sub('[\W... | [
37811,
24629,
2733,
326,
5072,
10340,
286,
11532,
588,
7559,
6,
27,
71,
16,
29,
15496,
2159,
3556,
71,
16,
29,
6,
15506,
526,
15931,
198,
198,
11748,
302,
198,
198,
11748,
12972,
11726,
13,
18982,
1010,
198,
11748,
12972,
11726,
13,
... | 2.491055 | 1,621 |
from django.conf.urls import include, url
from django.contrib.auth import views as auth_views
from . import views
# Uncomment the next two lines to enable the admin (imports admin module
# in each app):
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
# xapi endpoints
url(r'^XAPI/', incl... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
5009,
355,
6284,
62,
33571,
198,
198,
6738,
764,
1330,
5009,
198,
198,
2,
791,
23893,
262,
1306,
734,
3951,
... | 2.461982 | 868 |
from sqlalchemy.orm import reconstructor
from .base import DbLaporanEntity
from ..mixin import MxPengaturanBase, MxCommited
| [
6738,
44161,
282,
26599,
13,
579,
1330,
31081,
273,
198,
198,
6738,
764,
8692,
1330,
360,
65,
43,
12687,
272,
32398,
198,
6738,
11485,
19816,
259,
1330,
337,
87,
47,
1516,
2541,
272,
14881,
11,
337,
87,
6935,
863,
628
] | 3.15 | 40 |
from .async_tasks import (aggregate_results,
aggregate_target_results,
create_workload_mapping_data,
configuration_recommendation,
map_workload) | [
6738,
764,
292,
13361,
62,
83,
6791,
1330,
357,
9460,
49373,
62,
43420,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19406,
62,
16793,
62,
... | 1.710345 | 145 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
project = 'YASL'
copyright = '2014-2015, The yasl developers'
master_doc = 'index'
source_suffix = '.rst'
show_authors = False
today_fmt = '%d %b %Y'
extensions = ['releases']
releases_github_path = 'yabok/yasl'
# List of patterns, relative to source directory, that ma... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
16302,
796,
705,
56,
1921,
43,
6,
198,
22163,
4766,
796,
705,
4967,
12,
4626,
11,
383,
331,
292,
75,
6505,... | 2.811828 | 186 |
from django.contrib import admin
from .models import WiKi
admin.site.register(WiKi) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
11759,
42,
72,
198,
198,
28482,
13,
15654,
13,
30238,
7,
31294,
42,
72,
8
] | 3 | 28 |
import tornado
| [
11748,
33718,
628
] | 5.333333 | 3 |
import zounds
import numpy as np
samplerate = zounds.SR22050()
BaseModel = zounds.stft(resample_to=samplerate, store_fft=True)
band = zounds.FrequencyBand(50, samplerate.nyquist)
window = zounds.HanningWindowingFunc()
@zounds.simple_in_memory_settings
if __name__ == '__main__':
app = zounds.ZoundsApp(
... | [
11748,
1976,
3733,
198,
11748,
299,
32152,
355,
45941,
198,
198,
37687,
20053,
378,
796,
1976,
3733,
13,
12562,
17572,
1120,
3419,
198,
14881,
17633,
796,
1976,
3733,
13,
301,
701,
7,
411,
1403,
62,
1462,
28,
37687,
20053,
378,
11,
36... | 2.208431 | 427 |
from django.db.models.fields.related import ForeignKey
def save_deep(obj):
"""
This function first saves all the children of the given oject
and then the object itself. It solves the error:
ValueError: save() prohibited to prevent data loss due to unsaved related object '<<foreign_object>>'.
Note: ... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
25747,
13,
5363,
1330,
8708,
9218,
198,
198,
4299,
3613,
62,
22089,
7,
26801,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
2163,
717,
16031,
477,
262,
1751,
286,
262,
1813,
2... | 2.642308 | 260 |
from django.core.management.base import BaseCommand
from catalog.constants import LANGUAGES
from catalog.models import Language
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
201,
198,
201,
198,
6738,
18388,
13,
9979,
1187,
1330,
406,
15567,
52,
25552,
201,
198,
6738,
18388,
13,
27530,
1330,
15417,
201,
198,
201,
198
] | 3.552632 | 38 |
#
# @lc app=leetcode id=507 lang=python3
#
# [507] Perfect Number
#
# https://leetcode.com/problems/perfect-number/description/
#
# algorithms
# Easy (35.03%)
# Likes: 199
# Dislikes: 531
# Total Accepted: 52.1K
# Total Submissions: 148K
# Testcase Example: '28'
#
# We define the Perfect Number is a positive int... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
35378,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
35378,
60,
16374,
7913,
198,
2,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
25833,
12,
17618,
14,... | 2.701887 | 265 |
# Values for type component of FCGIHeader
FCGI_BEGIN_REQUEST = 1
FCGI_ABORT_REQUEST = 2
FCGI_END_REQUEST = 3
FCGI_PARAMS = 4
FCGI_STDIN = 5
FCGI_STDOUT = 6
FCGI_STDERR = 7
FCGI_DATA = 8
FCGI_GET_VALUES = 9
FCGI_GET_VALUES_RESULT = 10
FCGI_UNKNOWN_TYPE = 11
# Mask for flags component of FCGIBeginRequestBody
FCGI_KEEP_C... | [
2,
27068,
329,
2099,
7515,
286,
10029,
18878,
39681,
198,
4851,
18878,
62,
33,
43312,
62,
2200,
35780,
796,
352,
198,
4851,
18878,
62,
6242,
9863,
62,
2200,
35780,
796,
362,
198,
4851,
18878,
62,
10619,
62,
2200,
35780,
796,
513,
198,... | 2.413934 | 244 |
import tensorflow as tf
from tensorflow.keras import datasets, layers, optimizers, Sequential, metrics
from tensorflow import keras
import os
import numpy as np
import sys
sys.path.append("../src")
from dopamine import Dopamine, dopamine
assert tf.__version__.startswith('2.')
tf.random.set_seed(22)
np.random.seed(2... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
40522,
11,
11685,
11,
6436,
11341,
11,
24604,
1843,
11,
20731,
198,
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
11748,
28686,
198,
11748,
299,
... | 2.464744 | 312 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/enums/notification_category.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from googl... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
279,
519,
404,
10599,
418,
14,
268,
5700,
14,
1662,
2649,
62,
22872,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
17597,
13,
... | 2.136113 | 1,991 |
from numba import njit
import numpy as np
EPS = 2 * np.finfo(np.float64).eps
@njit(cache=True)
def design_matrix(x):
"""
Build the design matrix for linear regression for
a given array of x-values.
This creates a (N, 2) matrix, where the first column are the
x values and the second contains all... | [
6738,
997,
7012,
1330,
299,
45051,
198,
11748,
299,
32152,
355,
45941,
628,
198,
36,
3705,
796,
362,
1635,
45941,
13,
69,
10951,
7,
37659,
13,
22468,
2414,
737,
25386,
628,
198,
31,
77,
45051,
7,
23870,
28,
17821,
8,
198,
4299,
1486... | 2.57632 | 1,402 |
# Copyright 2017 Google Inc.
#
# 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,
2177,
3012,
3457,
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,
198,
2,
921,
743,
... | 3.467391 | 276 |
from items import MapItem
from androguard.core.bytecodes.dvm import MapList | [
6738,
3709,
1330,
9347,
7449,
198,
6738,
290,
3828,
84,
446,
13,
7295,
13,
26327,
40148,
13,
67,
14761,
1330,
9347,
8053
] | 3.409091 | 22 |
from django.utils.translation import ugettext
from corehq.apps.userreports.sql import get_expanded_column_config
| [
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
198,
6738,
4755,
71,
80,
13,
18211,
13,
7220,
48922,
13,
25410,
1330,
651,
62,
11201,
12249,
62,
28665,
62,
11250,
628,
198
] | 3.382353 | 34 |
#Clair3 pileup parameters
REPO_NAME="Clair3"
import re
from itertools import accumulate
zstd='zstd'
default_optimizer = "Radam"
default_loss_function = "FocalLoss"
support_platform = {'ont', 'hifi','ilmn'}
min_af = 0.08
min_af_dict = {'ont':0.15, 'hifi':min_af, 'ilmn':min_af }
#as three platform training data vary in ... | [
2,
2601,
958,
18,
14540,
929,
10007,
198,
2200,
16402,
62,
20608,
2625,
2601,
958,
18,
1,
198,
11748,
302,
198,
6738,
340,
861,
10141,
1330,
29915,
198,
198,
89,
19282,
11639,
89,
19282,
6,
198,
12286,
62,
40085,
7509,
796,
366,
155... | 2.477396 | 553 |
"""Example of key derivation using Monero based on BIP44."""
import binascii
from bip_utils import (
Bip39WordsNum, Bip39MnemonicGenerator, Bip39SeedGenerator, Bip44Coins, Bip44, Monero
)
# Generate random mnemonic
mnemonic = Bip39MnemonicGenerator().FromWordsNumber(Bip39WordsNum.WORDS_NUM_24)
print(f"Mnemonic st... | [
37811,
16281,
286,
1994,
16124,
341,
1262,
2892,
3529,
1912,
319,
347,
4061,
2598,
526,
15931,
198,
198,
11748,
9874,
292,
979,
72,
198,
6738,
14141,
62,
26791,
1330,
357,
198,
220,
220,
220,
347,
541,
2670,
37117,
33111,
11,
347,
541... | 2.685714 | 630 |
from core.Controller import Controller, Utils, Request, Response, json, datetime
from models.MissionType import MissionType, or_
| [
6738,
4755,
13,
22130,
1330,
22741,
11,
7273,
4487,
11,
19390,
11,
18261,
11,
33918,
11,
4818,
8079,
198,
6738,
4981,
13,
37057,
6030,
1330,
12633,
6030,
11,
393,
62,
628,
198,
220,
220,
220,
220,
198
] | 3.675676 | 37 |
# This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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,
770,
2393,
318,
636,
286,
262,
9347,
44148,
1628,
13,
198,
2,
15069,
357,
34,
8,
2813,
31816,
2304,
1000,
1279,
4023,
1378,
296,
77,
2304,
1000,
13,
2934,
29,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
... | 2.824232 | 586 |
from django.contrib import admin
from .models import Option, Poll, Vote
@admin.register(Poll)
@admin.register(Vote)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
16018,
11,
12868,
11,
19175,
628,
198,
198,
31,
28482,
13,
30238,
7,
39176,
8,
628,
198,
31,
28482,
13,
30238,
7,
37394,
8,
198
] | 3.128205 | 39 |
from __future__ import annotations
BASH_TEMPLATE = """%(function)s()
{
local cur script coms opts com
COMPREPLY=()
_get_comp_words_by_ref -n : cur words
# for an alias, get the real script behind it
if [[ $(type -t ${words[0]}) == "alias" ]]; then
script=$(alias ${words[0]} | sed -E "s/al... | [
6738,
11593,
37443,
834,
1330,
37647,
628,
198,
33,
11211,
62,
51,
3620,
6489,
6158,
796,
37227,
4,
7,
8818,
8,
82,
3419,
198,
90,
198,
220,
220,
220,
1957,
1090,
4226,
401,
82,
2172,
82,
401,
198,
220,
220,
220,
24301,
2200,
6489... | 1.954867 | 1,130 |