content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
# Crie um programa que leia a idade e o sexo de vrias pessoas. A cada pessoa cadastrada, o programa dever perguntar se o usurio quer ou no continuar. No final, mostre:
# A) Quantas pessoas tem mais de 18 anos.
# B) Quantos homens foram cadastrados.
# C) Quantas mulheres tem menos de 20 anos.
maisdezoito = 0
qtdmulhere... | [
2,
327,
5034,
23781,
1430,
64,
8358,
443,
544,
257,
4686,
671,
304,
267,
1714,
78,
390,
410,
380,
292,
279,
408,
78,
292,
13,
317,
269,
4763,
279,
408,
12162,
20603,
459,
81,
4763,
11,
267,
1430,
64,
390,
332,
583,
70,
2797,
283... | 2.117276 | 793 |
import filecmp
import shutil
import tempfile
import os
from .context import entry
TEST_ENTRY = os.path.join(os.path.dirname(__file__), "test_entry.md")
TEST_ENTRY_CONTENT = """
Some content.
## A section in the content
Content that looks like frontmatter:
```
+++
but this is
not really frontmatter
+++
```
More c... | [
11748,
2393,
48991,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
28686,
198,
198,
6738,
764,
22866,
1330,
5726,
198,
198,
51,
6465,
62,
3525,
18276,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,... | 2.897436 | 117 |
import random
from PyQt5.QtCore import pyqtSignal, pyqtProperty, pyqtSlot, QObject
| [
11748,
4738,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
12972,
39568,
11712,
282,
11,
12972,
39568,
21746,
11,
12972,
39568,
38963,
11,
1195,
10267,
628
] | 2.896552 | 29 |
from training.emotional_training import emotional_training
from training.facial_training import facial_training
| [
6738,
3047,
13,
368,
25453,
62,
34409,
1330,
7016,
62,
34409,
198,
6738,
3047,
13,
69,
18150,
62,
34409,
1330,
16324,
62,
34409,
198
] | 4.666667 | 24 |
import os
from pathlib import Path
import numpy as np
# repack_fields is necessary since np 1.16 as selecting columns from a recarray returns an array with padding
# that is difficult to work with afterwards.
from numpy.lib import recfunctions as rf
from nnaps.mesa import fileio
from nnaps import __version__
def re... | [
11748,
28686,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
1128,
441,
62,
25747,
318,
3306,
1201,
45941,
352,
13,
1433,
355,
17246,
15180,
422,
257,
664,
18747,
5860,
281,
7177,
351,
24511,
... | 2.272381 | 1,575 |
#compdef deblaze.py
local arguments
arguments=(
'--version[show programs version number and exit]'
'(- * :)'{-h,--help}'[show this help message and exit]'
{-u,--url}'[URL for AMF Gateway]'
{-s,--service}'[remote service to call]'
{-m,--method}'[method to call]'
{-p,--params}'[parameters to send pipe seper... | [
2,
5589,
4299,
1915,
75,
6201,
13,
9078,
198,
198,
12001,
7159,
198,
198,
853,
2886,
16193,
198,
220,
705,
438,
9641,
58,
12860,
4056,
2196,
1271,
290,
8420,
49946,
198,
220,
29513,
12,
1635,
14373,
6,
90,
12,
71,
11,
438,
16794,
... | 2.689474 | 380 |
import random, copy
import cv2 as cv
import numpy as np
from scipy import interpolate
from .augmenter import Augmenter
| [
11748,
4738,
11,
4866,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
39555,
378,
198,
6738,
764,
559,
5154,
263,
1330,
2447,
434,
263,
198
] | 3.216216 | 37 |
from .card import Card
from .features import Number, Color, Shape, Style
from math import floor
| [
6738,
764,
9517,
1330,
5172,
198,
6738,
764,
40890,
1330,
7913,
11,
5315,
11,
25959,
11,
17738,
198,
6738,
10688,
1330,
4314,
628
] | 4.217391 | 23 |
from langpractice.utils.utils import *
import unittest
import torch.nn.functional as F
if __name__=="__main__":
unittest.main()
| [
6738,
42392,
39541,
13,
26791,
13,
26791,
1330,
1635,
198,
11748,
555,
715,
395,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
220,
220,
220,
220,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
2... | 2.705882 | 51 |
#!/usr/bin/env python3
from .entity import Entity, EntitySchema, Base
from sqlalchemy import Column, Integer, String, Sequence
from marshmallow import Schema, fields, post_load
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
764,
26858,
1330,
20885,
11,
20885,
27054,
2611,
11,
7308,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
10903,
11,
45835,
198,
6738,
22397,
42725,
1330,
10011... | 3.6 | 50 |
import torch
import torch.nn as nn
from torch.nn.utils import weight_norm
"""TCN adapted from https://github.com/locuslab/TCN"""
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
20471,
13,
26791,
1330,
3463,
62,
27237,
198,
198,
37811,
4825,
45,
16573,
422,
3740,
1378,
12567,
13,
785,
14,
75,
10901,
23912,
14,
4825,
45,
37811,
628... | 3.045455 | 44 |
'''
Author: your name
Date: 2021-04-08 17:14:41
LastEditTime: 2021-04-09 09:13:28
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \github\test\index.py
'''
#!user/bin/env python3
# -*- coding: utf-8 -*-
import psutil
cpu_info = {'user': 0, 'system': 0, 'idle': 0, 'percent': 0}
memo... | [
7061,
6,
198,
13838,
25,
534,
1438,
198,
10430,
25,
33448,
12,
3023,
12,
2919,
1596,
25,
1415,
25,
3901,
198,
5956,
18378,
7575,
25,
33448,
12,
3023,
12,
2931,
7769,
25,
1485,
25,
2078,
198,
5956,
18378,
669,
25,
4222,
900,
4586,
... | 2.401055 | 379 |
"""
n
1 1
1
n true false
LeetCode
https://leetcode-cn.com/problems/happy-number
"""
from typing import List
# hash
# for test
if __name__ == "__main__":
ins = Solution()
n = 19
print(ins.isHappy(n))
| [
37811,
198,
299,
220,
628,
628,
198,
352,
220,
220,
352,
198,
220,
352,
198,
299,
220,
2081,
220,
3991,
220,
198,
198,
3123,
316,
10669,
198,
5450,
1378,
293,
316,
8189,
12,
31522,
13,
785,
14,
1676,
22143,
14,
34191,
12,
17618,
1... | 2.294118 | 102 |
from profileHelper import ProfileHelper
from pybricks.parameters import Button, Color
from pybricks.media.ev3dev import Image, ImageFile, Font, SoundFile
# from UI.tools import Box
| [
6738,
7034,
47429,
1330,
13118,
47429,
198,
6738,
12972,
65,
23706,
13,
17143,
7307,
1330,
20969,
11,
5315,
198,
6738,
12972,
65,
23706,
13,
11431,
13,
1990,
18,
7959,
1330,
7412,
11,
7412,
8979,
11,
24060,
11,
9506,
8979,
198,
198,
2... | 3.734694 | 49 |
import os
from types import SimpleNamespace
import torch
from torch.utils.data import DataLoader
from torchvision import transforms
from PIL import Image
import numpy as np
from tensorfn import distributed as dist, nsml, get_logger
try:
from nvidia.dali.pipeline import Pipeline
from nvidia.dali im... | [
11748,
28686,
201,
198,
6738,
3858,
1330,
17427,
36690,
10223,
201,
198,
201,
198,
11748,
28034,
201,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
201,
198,
6738,
28034,
10178,
1330,
31408,
201,
198,
6738,
350,
4146,
1330,
... | 2.2118 | 661 |
#!/usr/bin/env python
# Converts moses phrase table file to HDF5 files
# Written by Bart van Merrienboer (University of Montreal)
import argparse
import cPickle
import gzip
import sys
import tables
import numpy
parser = argparse.ArgumentParser()
parser.add_argument("input",
type=argparse.FileTy... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
1482,
24040,
285,
4629,
9546,
3084,
2393,
284,
5572,
37,
20,
3696,
198,
2,
22503,
416,
13167,
5719,
4638,
15355,
2127,
263,
357,
21009,
286,
12871,
8,
198,
198,
11748,
1822,
... | 2.247863 | 1,287 |
"""
Given an array of integers arr, write a function that returns true if and
only if the number of occurrences of each value in the array is unique.
Example:
Input: arr = [1,2,2,1,1,3]
Output: true
Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two
value... | [
37811,
198,
220,
220,
220,
11259,
281,
7177,
286,
37014,
5240,
11,
3551,
257,
2163,
326,
5860,
2081,
611,
290,
220,
198,
220,
220,
220,
691,
611,
262,
1271,
286,
40279,
286,
1123,
1988,
287,
262,
7177,
318,
3748,
13,
628,
220,
220,
... | 2.690402 | 323 |
from playground.common.os import isPidAlive
from playground.common import CustomConstant as Constant
from .NetworkManager import NetworkManager, ConnectionDeviceAPI, RoutesDeviceAPI
import os, signal, time
| [
6738,
24817,
13,
11321,
13,
418,
1330,
318,
47,
312,
2348,
425,
201,
198,
6738,
24817,
13,
11321,
1330,
8562,
3103,
18797,
355,
20217,
201,
198,
6738,
764,
26245,
13511,
1330,
7311,
13511,
11,
26923,
24728,
17614,
11,
39602,
274,
24728,... | 3.46875 | 64 |
import enum
"""Declare all enumerations used in test."""
| [
11748,
33829,
198,
198,
37811,
37835,
533,
477,
27056,
602,
973,
287,
1332,
526,
15931,
628,
198
] | 3.529412 | 17 |
import os
import pandas as pd
import numpy as np
from core.dataset import dataset_fn
from core.model import model_fn, get_classification_model
from core.mmdd import trainer_object_fn
from core.muks import muks
def eval(exp_dir, exp_name, params, seed, split, sample_sizes=[10, 30, 50, 100, 500],
num_reps=... | [
11748,
28686,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4755,
13,
19608,
292,
316,
1330,
27039,
62,
22184,
198,
6738,
4755,
13,
19849,
1330,
2746,
62,
22184,
11,
651,
62,
4871,
2649... | 1.988351 | 1,631 |
import tornado.web
import json
from handlers.async_fetch import async_fetch, GET, POST
| [
11748,
33718,
13,
12384,
198,
11748,
33918,
198,
6738,
32847,
13,
292,
13361,
62,
69,
7569,
1330,
30351,
62,
69,
7569,
11,
17151,
11,
24582,
628
] | 3.384615 | 26 |
# 141,
# :09.04.20
# 17. : , ', , , , ; ;
# : , , . ' .
# , .
import names
from faker import Faker
fake = Faker()
import string
import random
customers = []
for i in range(0, 5):
customers.append(Customer(
names.get_first_name(), names.get_first_name(), names.get_first_name(),... | [
2,
25500,
11,
220,
220,
198,
2,
1058,
2931,
13,
3023,
13,
1238,
198,
2,
1596,
13,
220,
1058,
837,
46083,
220,
837,
837,
220,
220,
837,
220,
220,
2162,
2162,
198,
2,
1058,
220,
220,
837,
220,
220,
837,
220,
764,
220,
220,
705,
... | 2.250825 | 303 |
import numpy
import pytest
from openmm import unit
from pydantic import ValidationError
from absolv.models import (
DeltaG,
EquilibriumProtocol,
MinimizationProtocol,
SimulationProtocol,
State,
SwitchingProtocol,
System,
TransferFreeEnergyResult,
)
from absolv.tests import is_close
c... | [
11748,
299,
32152,
198,
11748,
12972,
9288,
198,
6738,
1280,
3020,
1330,
4326,
198,
6738,
279,
5173,
5109,
1330,
3254,
24765,
12331,
198,
198,
6738,
2352,
349,
85,
13,
27530,
1330,
357,
198,
220,
220,
220,
16978,
38,
11,
198,
220,
220... | 2.517094 | 234 |
import django_tables2 as tables
from django_tables2.utils import A
from entities.models import *
from archiv.models import *
| [
11748,
42625,
14208,
62,
83,
2977,
17,
355,
8893,
198,
6738,
42625,
14208,
62,
83,
2977,
17,
13,
26791,
1330,
317,
198,
6738,
12066,
13,
27530,
1330,
1635,
198,
6738,
3934,
452,
13,
27530,
1330,
1635,
628
] | 3.405405 | 37 |
# Generated by Django 3.0.3 on 2020-02-27 04:18
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
18,
319,
12131,
12,
2999,
12,
1983,
8702,
25,
1507,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
# -*- coding: utf-8 -*-
import multiprocessing
from gensim.models import Word2Vec
import csv
def embedding_sentences(sentences, embedding_size = 64, window = 3, min_count = 0, file_to_load = None, file_to_save = None):
'''
embeding_size Word Embedding Dimension
window : Context window
min_count : Word f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18540,
305,
919,
278,
198,
6738,
308,
641,
320,
13,
27530,
1330,
9678,
17,
53,
721,
198,
11748,
269,
21370,
198,
4299,
11525,
12083,
62,
34086,
3007,
7,
34086,
... | 2.982301 | 452 |
import itertools
import typing
from collections import defaultdict
from typing import Optional, List, Callable, Type
from hearthstone.cards import MonsterCard, CardEvent, Card
from hearthstone.events import BuyPhaseContext, EVENTS
from hearthstone.hero import EmptyHero
from hearthstone.monster_types import MONSTER_TYP... | [
11748,
340,
861,
10141,
198,
11748,
19720,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
32233,
11,
7343,
11,
4889,
540,
11,
5994,
198,
198,
6738,
3285,
400,
6440,
13,
27761,
1330,
12635,
16962,
11,
5172,
9237,
11,
5172,
... | 3.565445 | 191 |
# -------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ----------------------------------------------------------------------... | [
2,
16529,
22369,
6329,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
357,
36393,
737,
4091,
38559,
24290,
287,
262,
29924,
6808,
329,
5964,
1321,
13,
198,
2,
16529,
22369,
... | 2.98933 | 3,655 |
#! /usr/bin/env python3
###############################################################################
# File Name : l4e3.py
# Created By : Flix Chiasson (7138723)
# Creation Date : [2015-10-06 11:43]
# Last Modified : [2015-10-06 11:56]
# Description ... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
220,
220,
220,
220,
9220,
6530,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
220,
220,
220,
220,
300,
19,
68,
18,
13,
90... | 2.580488 | 205 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import string
import pandas as pd
from pandas import DataFrame
from base import BaseObject
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
628,
198,
11748,
4731,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
198,
6738,
277... | 2.958333 | 48 |
from L1TriggerConfig.CSCTFConfigProducers.CSCTFObjectKeysOnline_cfi import *
from L1TriggerConfig.DTTrackFinder.L1DTTFTSCObjectKeysOnline_cfi import *
from L1TriggerConfig.RPCTriggerConfig.L1RPCObjectKeysOnline_cfi import *
from L1TriggerConfig.GMTConfigProducers.L1MuGMTParametersKeysOnlineProd_cfi import *
from L1Trig... | [
6738,
406,
16,
48344,
16934,
13,
7902,
4177,
37,
16934,
11547,
7999,
13,
7902,
4177,
37,
10267,
40729,
14439,
62,
66,
12463,
1330,
1635,
198,
6738,
406,
16,
48344,
16934,
13,
24544,
24802,
37,
5540,
13,
43,
16,
24544,
10234,
4694,
34,... | 2.943966 | 232 |
# https://www.hackerrank.com/challenges/ctci-making-anagrams
from collections import Counter | [
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
310,
979,
12,
8601,
12,
272,
6713,
82,
198,
6738,
17268,
1330,
15034
] | 3.407407 | 27 |
n = int(input())
numbers = list(map(int, input().split()))
add, sub, mul, div = map(int, input().split())
min_num = 1e9
max_num = -1e9
dfs(numbers[0], 1)
print(max_num)
print(min_num)
| [
77,
796,
493,
7,
15414,
28955,
201,
198,
77,
17024,
796,
1351,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008,
201,
198,
2860,
11,
850,
11,
35971,
11,
2659,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
201,
198,
1084,
62... | 2.061856 | 97 |
# Generated by Django 2.2 on 2020-11-27 13:57
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
319,
12131,
12,
1157,
12,
1983,
1511,
25,
3553,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.892857 | 28 |
from typing import Tuple
import numpy as np
from numpy import ndarray
from dataclasses import dataclass, field
from scipy.linalg import block_diag
import scipy.linalg as la
from utils import rotmat2d
from JCBB import JCBB
import utils
import solution
| [
6738,
19720,
1330,
309,
29291,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
1330,
299,
67,
18747,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
629,
541,
88,
13,
75,
1292,
70,
1330,
2512,
62,
... | 3.189873 | 79 |
"""
MIT License
Copyright (c) 2020 PyKOB - MorseKOB in Python
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... | [
37811,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
12131,
9485,
42,
9864,
532,
44049,
42,
9864,
287,
11361,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
... | 2.830601 | 915 |
import requests
from bs4 import BeautifulSoup as bs4
from docx import Document as doc
from docx.shared import Cm
import sys
if len(sys.argv) != 3:
print("The format should be \n./main.py <url> <output_file_name>")
else:
url = sys.argv[1]
doc_name = sys.argv[2]
document = doc()
page = requests... | [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
275,
82,
19,
198,
6738,
2205,
87,
1330,
16854,
355,
2205,
198,
6738,
2205,
87,
13,
28710,
1330,
327,
76,
220,
198,
11748,
25064,
198,
198,
361,
18896,
7,
17597,
13,
... | 1.515 | 2,200 |
"""
https://www.codewars.com/kata/566fc12495810954b1000030/train/python
Given an pos int n,
and a digit that is < 10, d.
Square all ints from 0 - n, and return the number times d is used in the squared results.
"""
def nb_dig(n, d):
'''
results = ''
for i in range(n+1):
results += str(i * i)
... | [
37811,
198,
5450,
1378,
2503,
13,
19815,
413,
945,
13,
785,
14,
74,
1045,
14,
20,
2791,
16072,
1065,
2920,
3365,
940,
48372,
65,
49388,
1270,
14,
27432,
14,
29412,
198,
198,
15056,
281,
1426,
493,
299,
11,
220,
198,
392,
257,
16839,... | 2.250965 | 259 |
"""Demo resource strategy class."""
# pylint: disable=no-self-use,unused-argument
from typing import TYPE_CHECKING, Optional
from oteapi.models import AttrDict, DataCacheConfig, ResourceConfig, SessionUpdate
from oteapi.plugins import create_strategy
from pydantic import Field
from pydantic.dataclasses import dataclas... | [
37811,
11522,
78,
8271,
4811,
1398,
526,
15931,
198,
2,
279,
2645,
600,
25,
15560,
28,
3919,
12,
944,
12,
1904,
11,
403,
1484,
12,
49140,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
32233,
198,
198,
6738,
267,
660,
15042,
13... | 3.316667 | 120 |
# This workaround makes sure that we can import from the parent dir
import sys
sys.path.append('..')
from scrython.sets import Code
import unittest
import time
promo_khans = Code('PKTK')
khans = Code('KTK')
if __name__ == '__main__':
unittest.main() | [
2,
770,
46513,
1838,
1654,
326,
356,
460,
1330,
422,
262,
2560,
26672,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
492,
11537,
198,
198,
6738,
629,
563,
400,
261,
13,
28709,
1330,
6127,
198,
11748,
555,
715,
395,
198,
... | 2.866667 | 90 |
import re
| [
11748,
302,
201,
198,
201,
198
] | 2.166667 | 6 |
#!/usr/bin/env python3
import smtplib
import time
import configparser
config = configparser.ConfigParser()
config.read('/home/pi/Development/Python/InverterMQTT/emailcredentials.conf')
email = config['credentials']['email']
password = config['credentials']['password']
to_email = config['credentials']['to_email']
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
895,
83,
489,
571,
198,
11748,
640,
198,
11748,
4566,
48610,
198,
220,
198,
11250,
796,
4566,
48610,
13,
16934,
46677,
3419,
198,
11250,
13,
961,
10786,
14,
11195,
14,
... | 2.922764 | 246 |
#! /usr/bin/env python3
import codecs
import os.path
import shutil
import glob
import tempfile
if __name__=='__main__':
print("\nfunc1()")
func1()
print("\nfunc2()")
func2()
print("\nfunc3()")
func3()
print("\nfunc4()")
func4()
print("\nfunc5()")
func5()
print("\nfunc6()")
func6()
print(... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
40481,
82,
198,
198,
11748,
28686,
13,
6978,
198,
198,
11748,
4423,
346,
198,
198,
11748,
15095,
198,
198,
11748,
20218,
7753,
198,
198,
361,
11593,
3672,
834,
855,
... | 2.24183 | 153 |
def run(msg: str) -> None:
"""
Print the message received parameters.
"""
print(msg)
if __name__ == "__main__":
message: str = "Zero commands Python to be typed!"
run(message)
| [
4299,
1057,
7,
19662,
25,
965,
8,
4613,
6045,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12578,
262,
3275,
2722,
10007,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3601,
7,
19662,
8,
628,
198,
361,
11593,
3672,
834,... | 2.693333 | 75 |
import logging
from config.celery_configs import app
from lib.sms import client as sms_client
from lib.blockchain.pandora import Pandora
from apps.user.models import UserProfile
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
6738,
4566,
13,
7015,
88,
62,
11250,
82,
1330,
598,
198,
6738,
9195,
13,
82,
907,
1330,
5456,
355,
895,
82,
62,
16366,
198,
6738,
9195,
13,
9967,
7983,
13,
79,
392,
5799,
1330,
28518,
198,
6738,
6725,
13,
7220,
... | 3.313433 | 67 |
'''Given a valid IP address, return a defanged version of that IP address. A defanged IP address replaces every period '.' with "[.]".
Input Format
A string
Constraints
non-empty String
Output Format
replacement String
Sample Input 0
1.1.1.1
Sample Output 0
1[.]1[.]1[.]1
Sample Input 1
255.100.50.0
Sample Out... | [
7061,
6,
15056,
257,
4938,
6101,
2209,
11,
1441,
257,
825,
5102,
2196,
286,
326,
6101,
2209,
13,
317,
825,
5102,
6101,
2209,
24020,
790,
2278,
705,
2637,
351,
12878,
8183,
1911,
198,
198,
20560,
18980,
198,
198,
32,
4731,
198,
198,
... | 2.656805 | 169 |
from django.conf import settings
from django.urls import path, re_path
from django.views.static import serve
from .views import *
urlpatterns = [
re_path('^$', MainView.as_view(), name='main_view'),
path('page/<int:page>/', MainView.as_view(), name='main_view_with_page'),
re_path('^signup/$', UserRegistr... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
198,
6738,
42625,
14208,
13,
33571,
13,
12708,
1330,
4691,
198,
198,
6738,
764,
33571,
1330,
1635,
198,
198,
6371,
33279,
... | 2.59292 | 1,921 |
import numpy as np
import cv2
import os
cap = cv2.VideoCapture(0)
#model=cv2.CascadeClassifier(os.path.join("haar-cascade-files","haarcascade_frontalface_default.xml"))
smile=cv2.CascadeClassifier(os.path.join("haar-cascade-files","haarcascade_smile.xml"))
#eye=cv2.CascadeClassifier(os.path.join("haar-cascade-files",... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
198,
11128,
796,
269,
85,
17,
13,
10798,
49630,
7,
15,
8,
198,
198,
2,
19849,
28,
33967,
17,
13,
34,
28966,
9487,
7483,
7,
418,
13,
6978,
13,
22179,
... | 2.16063 | 635 |
from inspect import signature
if __name__ == '__main__':
#sig = signature(testFunction)
sig = signature(TestClass.testMethod)
for key in sig.parameters:
param = sig.parameters[key]
print(key, param, dir(param))
print(' ', param.kind)
| [
198,
6738,
10104,
1330,
9877,
220,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1303,
82,
328,
796,
9877,
7,
9288,
22203,
8,
198,
220,
220,
220,
43237,
796,
9877,
7,
14402,
9487,
13,
9288,
... | 2.447368 | 114 |
import os
import sys
from argparse import _SubParsersAction
sys.path.append(os.path.abspath(os.path.join(__file__, '..', '..')))
from vee.commands.main import get_parser
parser = get_parser()
usage = parser.format_usage().replace('usage:', '')
print('''
top-level
---------
.. _cli_vee:
``vee``
~~~~~~~
::
... | [
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
1822,
29572,
1330,
4808,
7004,
47,
945,
364,
12502,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
22179,
7,
834,
7753,
834,
11,
7... | 2.174912 | 566 |
#imports
from routing_methods import on_launch, intent_router
##############################
# Program Entry
##############################
#lambda_handler (this is like main())
| [
2,
320,
3742,
198,
6738,
28166,
62,
24396,
82,
1330,
319,
62,
35681,
11,
6824,
62,
472,
353,
198,
198,
14468,
7804,
4242,
2235,
198,
2,
6118,
21617,
198,
14468,
7804,
4242,
2235,
198,
198,
2,
50033,
62,
30281,
357,
5661,
318,
588,
... | 3.913043 | 46 |
# coding: utf-8
import os
import thriftpy
import json
import logging
from thriftpy.rpc import make_client
from xylose.scielodocument import Article, Journal
LIMIT = 1000
logger = logging.getLogger(__name__)
ratchet_thrift = thriftpy.load(
os.path.join(os.path.dirname(__file__))+'/ratchet.thrift')
articlemeta_t... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
28686,
198,
11748,
5636,
2135,
9078,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
5636,
2135,
9078,
13,
81,
14751,
1330,
787,
62,
16366,
198,
6738,
2124,
2645,
577,
13,
36216,
417,
... | 2.484642 | 293 |
from operator import sub
import numpy as np
from sklearn import metrics
from sklearn.neighbors import NearestNeighbors
from toolz import curry
def global_false_nearest_neighbors(x, lag, min_dims=1, max_dims=10, **cutoffs):
"""
Across a range of embedding dimensions $d$, embeds $x(t)$ with lag $\tau$, finds a... | [
6738,
10088,
1330,
850,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
1330,
20731,
198,
6738,
1341,
35720,
13,
710,
394,
32289,
1330,
3169,
12423,
46445,
32289,
198,
6738,
2891,
89,
1330,
34611,
628,
198,
4299,
3298,
... | 2.477284 | 2,091 |
import unittest
from unittest import IsolatedAsyncioTestCase
from websites_metrics_collector.communication import webpages_fetcher
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
1148,
50027,
42367,
952,
14402,
20448,
198,
6738,
9293,
62,
4164,
10466,
62,
33327,
273,
13,
32560,
1330,
3992,
31126,
62,
34045,
2044,
628,
198
] | 3.8 | 35 |
#!/usr/bin/python
import random
import Gnuplot # Python 2 only
from planegeometry.structures.points import Point
from planegeometry.structures.segments import Segment
gnu = Gnuplot.Gnuplot (persist = 1)
visible = True
for i in range(10):
segment = Segment(random.random(), random.random(),
random.random... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
4738,
198,
11748,
18509,
84,
29487,
220,
220,
1303,
11361,
362,
691,
198,
6738,
6614,
469,
15748,
13,
7249,
942,
13,
13033,
1330,
6252,
198,
6738,
6614,
469,
15748,
13,
7249,
942,... | 2.684028 | 288 |
from django.contrib import admin # NOQA: F401
# Register your models here.
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
220,
1303,
8005,
48,
32,
25,
376,
21844,
198,
198,
2,
17296,
534,
4981,
994,
13,
198
] | 3.08 | 25 |
import python_speech_features as psf
import soundfile as sf
# import scipy.io.wavfile as wav
import pickle as pkl
import sys
import os
import re
# linux to windows
#
if __name__ == "__main__":
audio_file = sys.argv[1]
# audio_file = r"E:/LIBRISPEECH/LibriSpeech/dev/dev-clean/1272/128104/1272-... | [
11748,
21015,
62,
45862,
62,
40890,
355,
26692,
69,
201,
198,
11748,
2128,
7753,
355,
264,
69,
201,
198,
2,
1330,
629,
541,
88,
13,
952,
13,
45137,
7753,
355,
266,
615,
201,
198,
11748,
2298,
293,
355,
279,
41582,
201,
198,
11748,
... | 2.106227 | 273 |
from pyning.combinationdict import CombinationDict
import pytest
if __name__ == '__main__':
pytest.main()
| [
6738,
12972,
768,
13,
24011,
1883,
11600,
1330,
14336,
1883,
35,
713,
198,
198,
11748,
12972,
9288,
628,
628,
628,
628,
628,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
12972,... | 2.744681 | 47 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
from bs4 import BeautifulSoup
import requests
from requests import post
from requests import codes
| [
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
6738,
7007,
1330,
1281,
198,
6738,
7007,
... | 2.052083 | 96 |
import os
import shutil
from datetime import datetime
# INPUT PARAMS
LDAP_URL = os.environ['TEST_LDAP_URL']
LDAP_BASE_DN = os.environ['TEST_LDAP_BASE_DN']
LDAP_ADMIN_DN = os.environ['TEST_LDAP_ADMIN_DN']
LDAP_ADMIN_PASSWORD = os.environ['TEST_LDAP_ADMIN_PASSWORD']
LDAP_BIND_TIMEOUT = os.environ.get('TEST_LDAP_BIND_TIM... | [
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
2,
3268,
30076,
29463,
40834,
198,
11163,
2969,
62,
21886,
796,
28686,
13,
268,
2268,
17816,
51,
6465,
62,
11163,
2969,
62,
21886,
20520,
198,
11163... | 1.946885 | 3,483 |
from concurrent.futures import ThreadPoolExecutor
from tornado.concurrent import run_on_executor
from webargs import fields
from webargs.tornadoparser import use_args
from loguru import logger
from http_utils.base import BaseHandler, MAX_THREADS
| [
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
6738,
33718,
13,
1102,
14421,
1330,
1057,
62,
261,
62,
18558,
38409,
198,
6738,
3992,
22046,
1330,
7032,
198,
6738,
3992,
22046,
13,
45910,
324,
404,
28198,
1330,
779... | 3.742424 | 66 |
# Description: DSSR block representation for a multi-state example after loading the dssr_block.py script by Thomas Holder. The x3dna-dssr executable needs to be in the PATH. Edit the path to Thomas Holder's block script.
# Source: Generated while helping Miranda Adams at U of Saint Louis.
"""
cmd.do('reinitialize;'... | [
2,
12489,
25,
220,
360,
5432,
49,
2512,
10552,
329,
257,
5021,
12,
5219,
1672,
706,
11046,
262,
288,
824,
81,
62,
9967,
13,
9078,
4226,
416,
5658,
24210,
13,
383,
2124,
18,
67,
2616,
12,
67,
824,
81,
28883,
2476,
284,
307,
287,
... | 2.536398 | 261 |
import asyncio
import logging
import binascii
import socket
import os.path
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.climate import (DOMAIN, ClimateDevice, PLATFORM_SCHEMA, STATE_IDLE, STATE_HEAT, STATE_COOL, STATE_AUTO, STATE_DRY,
SUPPORT_OPERATION_MOD... | [
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
9874,
292,
979,
72,
198,
11748,
17802,
198,
11748,
28686,
13,
6978,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
11748,
1363,
562,
10167,
13,
16794,
364,
13,
11250,
62,
12102,
341,
355... | 2.356849 | 1,942 |
from dnastorage.codec.base_conversion import convertIntToBytes,convertBytesToInt
from dnastorage.arch.builder import *
import editdistance as ed
#from dnastorage.primer.primer_util import edit_distance
from io import BytesIO
from dnastorage.util.packetizedfile import *
import math
import struct
from dnastorage.system.f... | [
6738,
288,
77,
459,
4945,
13,
19815,
721,
13,
8692,
62,
1102,
9641,
1330,
10385,
5317,
2514,
45992,
11,
1102,
1851,
45992,
2514,
5317,
198,
6738,
288,
77,
459,
4945,
13,
998,
13,
38272,
1330,
1635,
198,
11748,
4370,
30246,
355,
1225,
... | 2.777056 | 462 |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from functools import partial
import numba as nb
from numba.containers import orderedcontainer
import numpy as np
INITIAL_BUFSIZE = 5
_tuple_cache = {}
#-----------------------------------------------------------------------
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
11,
4112,
62,
11748,
198,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
198,
11748,
997,
7012,
355,
299,
65,
... | 2.967302 | 367 |
import os.path
__dir__ = os.path.split(os.path.abspath(os.path.realpath(__file__)))[0]
data_location = os.path.join(__dir__, "sources")
src = "https://github.com/lambdaconcept/minerva"
# Module version
version_str = "0.0.post260"
version_tuple = (0, 0, 260)
try:
from packaging.version import Version as V
pvers... | [
11748,
28686,
13,
6978,
198,
834,
15908,
834,
796,
28686,
13,
6978,
13,
35312,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
22305,
58,
15,
60,
198,
7890,
62,
24886,
796,
28686,
13,
6... | 2.422939 | 558 |
# GLOBAL PARAMETERS
DATASETS = ['sent140', 'nist', 'shakespeare',
'mnist', 'synthetic', 'cifar10']
TRAINERS = {'fedavg': 'FedAvgTrainer',
'fedavg4': 'FedAvg4Trainer',
'fedavg5': 'FedAvg5Trainer',
'fedavg9': 'FedAvg9Trainer',
'fedavg_imba': 'FedAvgTrainerImba',... | [
2,
10188,
9864,
1847,
29463,
2390,
2767,
4877,
198,
35,
1404,
1921,
32716,
796,
37250,
34086,
15187,
3256,
705,
77,
396,
3256,
705,
1477,
20946,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10295,
396,
3256,
... | 1.89604 | 202 |
# coding=utf-8
from argparse import ArgumentParser
import os
import model_train
from torchvision import models
if __name__ == '__main__':
args = parse_argvs()
# train_path = args.train_path
# test_path = args.test_path
# output_model_path = args.output_model_path
# num_classes = args.classes_num... | [
2,
19617,
28,
40477,
12,
23,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
28686,
198,
11748,
2746,
62,
27432,
198,
6738,
28034,
10178,
1330,
4981,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 2.621399 | 243 |
from random import randint
print('-=-'*10)
print('JOGO DO PAR OU IMPAR')
cont = 0
while True:
print('-=-' * 10)
n = int(input('Digite um valor: '))
op = str(input('Par ou impar? [P/I] ')).upper().strip()[0]
ia = randint(0, 10)
res = n + ia
print('-'*30)
print(f'Voc jogou {n} e o computador {... | [
6738,
4738,
1330,
43720,
600,
198,
4798,
10786,
12,
10779,
6,
9,
940,
8,
198,
4798,
10786,
41,
7730,
46,
8410,
29463,
47070,
30023,
1503,
11537,
198,
3642,
796,
657,
198,
4514,
6407,
25,
198,
220,
220,
220,
3601,
10786,
12,
10779,
6... | 1.890869 | 449 |
from django.core.exceptions import ValidationError
from django.shortcuts import render, get_object_or_404
from django.db import IntegrityError
from rest_framework import authentication, generics, permissions, status
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
fr... | [
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
9945,
1330,
39348,
12331,
198,
198,
673... | 3.961749 | 183 |
import imaplib, base64, os, email, re, configparser
import tkinter as tk
from tkinter import messagebox
from datetime import datetime
from email import generator
from dateutil.parser import parse
init() | [
11748,
545,
64,
489,
571,
11,
2779,
2414,
11,
28686,
11,
3053,
11,
302,
11,
4566,
48610,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
3053,
... | 3.28125 | 64 |
#
# This program is a function that displays the first 100 pentagonal numbers with 10 numbers on each line.
# A pentagonal number is defined as n(3n - 1)/2 for n = 1, 2, c , and so on.
# So, the first few numbers are 1, 5, 12, 22, ....
main()
| [
2,
198,
2,
770,
1430,
318,
257,
2163,
326,
11298,
262,
717,
1802,
28145,
27923,
3146,
351,
838,
3146,
319,
1123,
1627,
13,
198,
198,
2,
220,
317,
28145,
27923,
1271,
318,
5447,
355,
299,
7,
18,
77,
532,
352,
20679,
17,
329,
299,
... | 3.151899 | 79 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from ._0errors import *
from ._0imports import *
databases = Databases()
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
47540,
15,
48277,
1330,
1635,
198,
6738,
47540,
15,
320,
3742,
1330,
1635,
628... | 3.74 | 50 |
"""
Write a program that accepts a sequence of whitespace separated words as input and prints the words after removing all
duplicate words and sorting them alphanumerically.
Suppose the following input is supplied to the program:
hello world and practice makes perfect and hello world again
Then, the output should be:
... | [
37811,
198,
198,
16594,
257,
1430,
326,
18178,
257,
8379,
286,
13216,
10223,
11266,
2456,
355,
5128,
290,
20842,
262,
2456,
706,
10829,
477,
198,
646,
489,
5344,
2456,
290,
29407,
606,
435,
19080,
6975,
1146,
13,
198,
15979,
577,
262,
... | 3.636042 | 283 |
import os
import cv2
import json
import numpy as np
import h5py
from PIL import Image
TASK_TYPES = {1: "pick_and_place_simple",
2: "look_at_obj_in_light",
3: "pick_clean_then_place_in_recep",
4: "pick_heat_then_place_in_recep",
5: "pick_cool_then_place_in_recep",
... | [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
20,
9078,
198,
6738,
350,
4146,
1330,
7412,
198,
51,
1921,
42,
62,
9936,
47,
1546,
796,
1391,
16,
25,
366,
27729,
62,
392... | 1.858586 | 198 |
__author__ = 'bsha3l173'
import logging
import datetime
from conf import LOG_FILENAME
| [
834,
9800,
834,
796,
705,
1443,
3099,
18,
75,
25399,
6,
201,
198,
201,
198,
11748,
18931,
201,
198,
11748,
4818,
8079,
201,
198,
6738,
1013,
1330,
41605,
62,
46700,
1677,
10067,
201,
198,
201,
198
] | 2.611111 | 36 |
import os, time, pyautogui
import selenium
from selenium import webdriver
from location_reference import country_map
# STATIC SETTINGS
DPI = 125 # Scaling factor of texts and apps in display settings
screen_dims = [x / (DPI/100) for x in pyautogui.size()]
code_map = country_map()
print("International Google Searc... | [
11748,
28686,
11,
640,
11,
12972,
2306,
519,
9019,
198,
11748,
384,
11925,
1505,
198,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
4067,
62,
35790,
1330,
1499,
62,
8899,
628,
198,
2,
15486,
2149,
25823,
51,
20754,
198,
6... | 2.794562 | 662 |
"""The thomson component."""
| [
37811,
464,
294,
296,
1559,
7515,
526,
15931,
198
] | 3.222222 | 9 |
import csv
from django.contrib import admin
from django.http import HttpResponse
from .models import Student, SchoolList, Event, ShsTrack, SchoolOfficial
admin.site.register(SchoolList)
admin.site.register(ShsTrack)
| [
11748,
269,
21370,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
198,
6738,
764,
27530,
1330,
13613,
11,
3961,
8053,
11,
8558,
11,
911,
82,
24802,
11,
3961,
... | 3.343284 | 67 |
import hashlib
from itertools import islice
from aoc.util import load_input
def part1(lines):
"""
>>> part1(['abc'])
'18f47a30'
"""
door_id = lines[0].strip()
return "".join(islice(search(door_id, is_part1=True), 8))
def part2(lines, be_extra_proud=True):
"""
>>> part2(['abc'], Fal... | [
11748,
12234,
8019,
198,
6738,
340,
861,
10141,
1330,
318,
75,
501,
198,
198,
6738,
257,
420,
13,
22602,
1330,
3440,
62,
15414,
628,
198,
198,
4299,
636,
16,
7,
6615,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13163,
636,
... | 2.093023 | 387 |
import math
import random
import os
os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "1"
import numpy as np
import pygame as pg
WINDOW_SIZE = (800, 600)
FPS = 60
pg.init()
window = pg.display.set_mode(WINDOW_SIZE)
clock = pg.time.Clock()
font = pg.font.SysFont("monospace", 20)
hues = (0, 120, 240)
angles = [math.radia... | [
11748,
10688,
198,
11748,
4738,
198,
11748,
28686,
198,
418,
13,
268,
2268,
14692,
47,
56,
47109,
62,
39,
14114,
62,
40331,
15490,
62,
4805,
2662,
11571,
8973,
796,
366,
16,
1,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1297... | 2.209985 | 681 |
from flask import (
abort, Blueprint, current_app, flash, g, redirect, render_template, request,
url_for
)
import giphy_client
from werkzeug.exceptions import abort
from choosy.auth import login_required
from choosy import db
bp = Blueprint("star", __name__)
| [
6738,
42903,
1330,
357,
198,
220,
220,
220,
15614,
11,
39932,
11,
1459,
62,
1324,
11,
7644,
11,
308,
11,
18941,
11,
8543,
62,
28243,
11,
2581,
11,
198,
220,
220,
220,
19016,
62,
1640,
198,
8,
198,
11748,
308,
541,
12114,
62,
16366... | 3.091954 | 87 |
#!/usr/bin/env python3
# %%
# Assignment Pt. 1: Edit Distances
import numpy as np
from bs4 import BeautifulSoup
import math
vocabulary_file = open('../res/count_1w.txt', 'r')
lines = vocabulary_file.readlines()
vocabulary = dict()
word_count = 0
# Strips the newline character
for line in lines:
line = line.strip... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
43313,
198,
2,
50144,
34352,
13,
352,
25,
5312,
4307,
1817,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
10688,
220,
19... | 2.419212 | 1,801 |
def isacn(obj):
"""isacn(string or int) -> True|False
Validate an ACN (Australian Company Number).
http://www.asic.gov.au/asic/asic.nsf/byheadline/Australian+Company+Number+(ACN)+Check+Digit
Accepts an int, or a string of digits including any leading zeroes.
Digits may be optionally separated with... | [
4299,
318,
330,
77,
7,
26801,
2599,
198,
220,
220,
220,
37227,
271,
330,
77,
7,
8841,
393,
493,
8,
4613,
6407,
91,
25101,
628,
220,
220,
220,
3254,
20540,
281,
7125,
45,
357,
38036,
5834,
7913,
737,
198,
220,
220,
220,
2638,
1378,... | 2.148116 | 1,141 |
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
from __future__ import print_function
import optparse
import path_resolv
from path_resolv import Path
if __name__ == "__main__":
cmdopts = optparse.OptionParser(usage="%prog [options]")
cmdopts.add_option("--srcdir", default=Path("."),
help="source dire... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
21,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
2172,
29572,
198,
11748,
3108,
62,
411,
3... | 2.627168 | 346 |
import ply.lex as lex
from grease.core.indents import Indents
reserved = {
'var': 'VAR',
'if': 'IF',
'else': 'ELSE',
'scan': 'SCAN',
'print': 'PRINT',
'and': 'AND',
'or': 'OR',
'Bool': 'BOOL',
'Int': 'INT',
'Float': 'FLOAT',
'Char': 'CHAR',
'fn': 'FN',
'interface': '... | [
11748,
35960,
13,
2588,
355,
31191,
198,
6738,
35537,
13,
7295,
13,
521,
658,
1330,
1423,
658,
198,
198,
411,
8520,
796,
1391,
198,
220,
220,
220,
705,
7785,
10354,
705,
53,
1503,
3256,
198,
220,
220,
220,
705,
361,
10354,
705,
5064... | 1.795396 | 1,173 |
# _*_ coding: utf-8 _*_
from importlib import import_module
| [
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
198,
6738,
1330,
8019,
1330,
1330,
62,
21412,
628,
628,
198
] | 2.6 | 25 |
import tempfile
import pytest
import fault as f
import magma as m
from fault.verilator_utils import verilator_version
| [
11748,
20218,
7753,
198,
11748,
12972,
9288,
198,
198,
11748,
8046,
355,
277,
198,
11748,
2153,
2611,
355,
285,
198,
6738,
8046,
13,
332,
346,
1352,
62,
26791,
1330,
3326,
346,
1352,
62,
9641,
628,
198
] | 3.361111 | 36 |
from flask import session
from flask_restful import Resource
from flask_restful.reqparse import RequestParser
from bcrypt import gensalt, hashpw
from hashlib import sha256
from hmac import new as hash_mac
from os import environ
PEPPER = environ["PEPPER"].encode("utf-8")
| [
6738,
42903,
1330,
6246,
201,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
201,
198,
6738,
42903,
62,
2118,
913,
13,
42180,
29572,
1330,
19390,
46677,
201,
198,
201,
198,
6738,
275,
29609,
1330,
308,
641,
2501,
11,
12234,
79,
86,
201... | 3.065217 | 92 |
from astropy.coordinates import Angle
from astropy.time import Time
import astropy.units as u
from astropy.tests.helper import assert_quantity_allclose
from sunpy.sun import sun
| [
6738,
6468,
28338,
13,
37652,
17540,
1330,
42375,
198,
6738,
6468,
28338,
13,
2435,
1330,
3862,
198,
11748,
6468,
28338,
13,
41667,
355,
334,
198,
6738,
6468,
28338,
13,
41989,
13,
2978,
525,
1330,
6818,
62,
40972,
414,
62,
439,
19836,
... | 3.322034 | 59 |
"""Pyup.io Safety metrics collector."""
from typing import Final
from base_collectors import JSONFileSourceCollector
from source_model import Entity, SourceMeasurement, SourceResponses
| [
37811,
20519,
929,
13,
952,
11233,
20731,
22967,
526,
15931,
198,
198,
6738,
19720,
1330,
8125,
198,
198,
6738,
2779,
62,
33327,
669,
1330,
19449,
8979,
7416,
31337,
273,
198,
6738,
2723,
62,
19849,
1330,
20885,
11,
8090,
47384,
434,
11... | 4.086957 | 46 |
import json
import os
import typing
from io import IOBase
from jaf.encoders import JAFJSONEncoder
with JsonArrayFileWriter('output.json', mode=JsonArrayFileWriter.MODE__APPEND_OR_CREATE, indent=4) as j:
d = {1: 2, 2: 3, 3: 4, 4: 6}
for i in range(1000000):
j.write(d)
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
19720,
198,
6738,
33245,
1330,
314,
9864,
589,
198,
198,
6738,
474,
1878,
13,
12685,
375,
364,
1330,
449,
8579,
40386,
27195,
12342,
628,
628,
198,
4480,
449,
1559,
19182,
8979,
34379,
10786,
... | 2.428571 | 119 |
from aip import AipOcr
BAIDU_APP_ID='14490756'
BAIDU_API_KEY = 'Z7ZhXtleolXMRYYGZ59CGvRl'
BAIDU_SECRET_KEY = 'zbHgDUGmRnBfn6XOBmpS5fnr9yKer8C6'
client= AipOcr(BAIDU_APP_ID, BAIDU_API_KEY, BAIDU_SECRET_KEY)
options = {}
options["recognize_granularity"] = "big"
options["language_type"] = "CHN_ENG"
options["detect_dire... | [
6738,
257,
541,
1330,
317,
541,
46,
6098,
198,
198,
4339,
2389,
52,
62,
24805,
62,
2389,
11639,
1415,
31503,
38219,
6,
198,
4339,
2389,
52,
62,
17614,
62,
20373,
796,
705,
57,
22,
57,
71,
55,
7100,
349,
55,
13599,
26314,
38,
57,
... | 2.182203 | 236 |
import unittest
from unittest.mock import Mock
from unittest.mock import mock_open
from contextlib import contextmanager
MOCK_DATA_A = ''
MOCK_DATA_B = '{"article_idx": 0}\n{"article_idx": 1}\n" | [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
15290,
62,
9654,
198,
6738,
4732,
8019,
1330,
4732,
37153,
628,
198,
44,
11290,
62,
26947,
62,
32,
796,
10148,
... | 2.760563 | 71 |
from tkinter import *
import random
from tkinter import messagebox
s = GuessGame()
| [
6738,
256,
74,
3849,
1330,
1635,
201,
198,
11748,
4738,
201,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
201,
198,
201,
198,
82,
796,
37571,
8777,
3419,
201,
198,
201,
198
] | 2.84375 | 32 |
import configparser
import sys
from jiraparser import JiraJSONParser, TokenAuth
import requests
from requests.auth import AuthBase
""" Getting a list of issues connected to a board id (defined by configuration) and printing analysis information """
# read config
config = configparser.ConfigParser()
config.read("confi... | [
11748,
4566,
48610,
198,
11748,
25064,
198,
6738,
474,
343,
499,
28198,
1330,
449,
8704,
40386,
46677,
11,
29130,
30515,
198,
11748,
7007,
198,
6738,
7007,
13,
18439,
1330,
26828,
14881,
198,
198,
37811,
18067,
257,
1351,
286,
2428,
5884,... | 2.856546 | 718 |
# -*- coding: utf-8 -*-
import json
import requests
import logging
import csv
url = "http://localhost:10000/parse"
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
18931,
198,
11748,
269,
21370,
198,
198,
6371,
796,
366,
4023,
1378,
36750,
25,
49388,
14,
29572,
1,
628,
198
] | 2.833333 | 42 |
from __future__ import annotations
import os
import subprocess
from typing import AnyStr
from ..util import check_nonnegative
BTRFS_BIN = '/bin/btrfs'
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
6738,
19720,
1330,
4377,
13290,
198,
198,
6738,
11485,
22602,
1330,
2198,
62,
13159,
31591,
198,
198,
33,
5446,
10652,
62,
33,
1268,
796,
31051,
... | 3.297872 | 47 |
# -*- coding: utf-8 -*-
import datetime
import logging
import os
from ast import literal_eval
import numpy as np
import pandas as pd
from fooltrader.consts import CHINA_STOCK_INDEX, USA_STOCK_INDEX
from fooltrader.contract import data_contract
from fooltrader.contract import files_contract
from fooltrader.contract.f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
6468,
1330,
18875,
62,
18206,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355... | 2.018813 | 4,093 |
from django.urls import path
from . import views
# Refer to the corresponding view function for more detials of the url routes
urlpatterns = [
path('', views.getRoutes, name="index"),
path('add/', views.addJob, name="addJob" ),
path('delete/<int:id>', views.removeJob, name="removeJob" ),
path('get-jo... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
628,
198,
2,
33973,
284,
262,
11188,
1570,
2163,
329,
517,
1062,
8231,
286,
262,
19016,
11926,
198,
6371,
33279,
82,
796,
685,
220,
198,
220,
220,
220,
3108,
... | 2.860927 | 151 |