content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from email.mime import image
from django.shortcuts import render
from django.http import HttpResponse
from .models import Images, Location
from images.models import Images
# Create your views here.
| [
6738,
3053,
13,
76,
524,
1330,
2939,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
764,
27530,
1330,
5382,
11,
13397,
198,
198,
6738,
4263,
13,
27530,
1330,... | 3.884615 | 52 |
import os
import re
import sklearn
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
vector_parameters = [[2,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],[3,0.8],
[3,0.8],[3,0.8],[3,0.8]]
| [
11748,
28686,
198,
11748,
302,
198,
11748,
1341,
35720,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
11748,
299,
32152,
355,
45941,
220,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
1330,
309,
69,
312,
69,
38469,
75... | 2.055556 | 126 |
# -*- coding: utf-8 -*-
import unittest
from brew.utilities.efficiency import calculate_brew_house_yield
from fixtures import recipe
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
555,
715,
395,
198,
198,
6738,
9059,
13,
315,
2410,
13,
45888,
1330,
15284,
62,
11269,
62,
4803,
62,
88,
1164,
198,
6738,
34609,
1330,
8364,
628
] | 3.214286 | 42 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
201,
198,
201,
198
] | 2.909091 | 11 |
import numpy as np
from challenge import Challenge
########################################################################
# Load data #
########################################################################
################################... | [
11748,
299,
32152,
355,
45941,
198,
6738,
4427,
1330,
13879,
628,
220,
220,
220,
1303,
29113,
29113,
4242,
21017,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.835165 | 182 |
"""
Settings module
"""
settings = {
'file': None,
'autostart': True,
'min_node_width': 50,
'min_node_height': 50,
'char_width': 9,
'char_height': 10,
'ver_spacing': 200,
'margin': 20,
'draw_calls': True,
'draw_boundary': False,
'color_background': 'gray',
'color_nu... | [
37811,
628,
220,
220,
220,
16163,
8265,
198,
198,
37811,
198,
33692,
796,
1391,
198,
220,
220,
220,
705,
7753,
10354,
6045,
11,
198,
220,
220,
220,
705,
2306,
455,
433,
10354,
6407,
11,
198,
220,
220,
220,
705,
1084,
62,
17440,
62,
... | 2.178977 | 352 |
#num is also the first terms of spiral
num = 1
x = 2
final_sum = 0
for i in range(500):
#for each for number in one circle (four numbers on diagonals), the numbers increases by the same numbers (x)
#in first circle it is 3,5,7,9, increases by 2
#in second it is 13,17,21,25, increases by 4...
for i in ra... | [
2,
22510,
318,
635,
262,
717,
2846,
286,
23642,
198,
22510,
796,
352,
198,
87,
796,
362,
198,
20311,
62,
16345,
796,
657,
198,
1640,
1312,
287,
2837,
7,
4059,
2599,
198,
220,
220,
220,
1303,
1640,
1123,
329,
1271,
287,
530,
9197,
... | 2.613497 | 163 |
import torch
import torch.nn.functional as F
from torch import nn
from collagen.core import Module
from collagen.modelzoo.modules import ConvBlock
class FPNBlock(Module):
"""
Extended implementation from https://github.com/qubvel/segmentation_models.pytorch
"""
class SegmentationBlock(Module):
"""... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
1330,
299,
77,
198,
198,
6738,
45452,
13,
7295,
1330,
19937,
198,
6738,
45452,
13,
19849,
89,
2238,
13,
18170,
1330,
34872,
12235,
628,
198,
4871,
376,
... | 3.137143 | 175 |
"""Representation of a text block within the HTML canvas."""
from html import unescape
from inscriptis.html_properties import WhiteSpace
class Block:
"""The current block of text.
A block usually refers to one line of output text.
.. note::
If pre-formatted content is merged with a block, it may... | [
37811,
40171,
341,
286,
257,
2420,
2512,
1626,
262,
11532,
21978,
526,
15931,
198,
6738,
27711,
1330,
555,
41915,
198,
6738,
1035,
6519,
271,
13,
6494,
62,
48310,
1330,
2635,
14106,
628,
198,
4871,
9726,
25,
198,
220,
220,
220,
37227,
... | 2.259512 | 1,025 |
from unittest import TestCase
from cmfsapy.dimension.correction import correct_estimates, polynom_func, \
compute_mFSA_correction_coef, correct_mFSA
import numpy as np
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
12067,
9501,
12826,
13,
46156,
13,
10215,
8243,
1330,
3376,
62,
395,
26748,
11,
745,
6213,
296,
62,
20786,
11,
3467,
198,
220,
220,
220,
24061,
62,
76,
37,
4090,
62,
10215,
8243,
62... | 2.949153 | 59 |
import pytest
from graphql_relay import to_global_id
from django.contrib.auth import get_user_model
from creator.studies.models import Membership
from creator.data_reviews.factories import DataReviewFactory
from creator.ingest_runs.factories import ValidationResultsetFactory
from creator.studies.models import Study
Us... | [
11748,
12972,
9288,
198,
6738,
4823,
13976,
62,
2411,
323,
1330,
284,
62,
20541,
62,
312,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
13172,
13,
19149,
444,
13,
27530,
1330,
37939,
198... | 1.970512 | 1,153 |
import torch
import torch.nn as nn
import torch.nn.functional as F
'''
Direct Policy Gradient network.
Takes in STATE_DIM size vector, and outputs ACTIONS_DIM size vector.
Action select (sampling), and reward backprop is done in another function.
Make sure to subtract a baseline!
'''
#
# '''
# This Policy net... | [
628,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
7061,
6,
198,
13470,
7820,
17701,
1153,
3127,
13,
220,
198,
198,
51,
1124,
287,
35454,
62,
35,
3955,
25... | 2.688889 | 315 |
from __future__ import annotations
from typing import Protocol, AsyncContextManager, Iterator
MAX_ROOMS_PER_TEN_MINUTES = 50
MAX_CONNECTIONS_PER_USER = 10
MAX_CONNECTIONS_PER_ROOM = 20
SERVER_LIVENESS_EXPIRATION_SECONDS = 60 * 10
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
20497,
11,
1081,
13361,
21947,
13511,
11,
40806,
1352,
198,
198,
22921,
62,
13252,
2662,
50,
62,
18973,
62,
51,
1677,
62,
23678,
3843,
1546,
796,
2026,
198,
22921,
62,
... | 2.744186 | 86 |
#!/usr/local/Caskroom/miniconda/base/envs/music_venv/bin/pythonw
from pyo import *
s = Server().boot()
# white noise generator
n = Noise(0.5)
# Common cutoff frequency control
freq = Sig(1000)
freq.ctrl([SLMap(50, 5000, "lin", "value", 1000)], title = "Cutoff Frequency")
# Three different lowpass filters
tone = ... | [
2,
48443,
14629,
14,
12001,
14,
34,
2093,
3823,
14,
1084,
291,
13533,
14,
8692,
14,
268,
14259,
14,
28965,
62,
574,
85,
14,
8800,
14,
29412,
86,
198,
198,
6738,
279,
8226,
1330,
1635,
198,
198,
82,
796,
9652,
22446,
18769,
3419,
6... | 2.748936 | 235 |
from django.urls import path
from .views import index, qs
urlpatterns = [
path('', index, name='index_faq'),
path('qs', qs, name='qs'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
6376,
11,
10662,
82,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
6376,
11,
1438,
11639,
9630,
62,
13331,
80,
33809,
198,
220,
... | 2.508475 | 59 |
import pygame
from board import Board | [
11748,
12972,
6057,
198,
198,
6738,
3096,
1330,
5926
] | 4.222222 | 9 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
"""
I/O functions in fvecs, bvecs, ivecs formats
definition of the formats here: http://corpus-texmex.irisa.fr/
"""
... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
... | 3.242424 | 99 |
from .rot13 import Rot13
| [
6738,
764,
10599,
1485,
1330,
18481,
1485,
628
] | 3.25 | 8 |
import numpy as np
'''view Example :- Board casting hoti h es me'''
arr = np.array([5,10,15])
arr_slice= arr[0:2]
# print(arr_slice) #[5,10]
arr_slice[:]= 0
# print(arr_slice) #[0,0]
# print(arr) #[0,0,15]
'''Copy Example :- Board casting hoti h es me'''
arr_copy = np.array([5,10,15])
arr_slice2= arr_copy[0:2].... | [
11748,
299,
32152,
355,
45941,
198,
198,
7061,
6,
1177,
17934,
1058,
12,
5926,
13092,
3024,
72,
289,
1658,
502,
7061,
6,
198,
3258,
796,
45941,
13,
18747,
26933,
20,
11,
940,
11,
1314,
12962,
198,
198,
3258,
62,
48369,
28,
5240,
58,... | 2.09596 | 198 |
#
# Gunicorn (https://docs.gunicorn.org/en/stable/configure.html)
#
# Metamapper uses Gunicorn to handle web requests by default. We recommend
# spinning up a few of these and putting them behind a reverse proxy like nginx.
#
# You can override these default settings by creating your own file and referencing the
# path... | [
2,
198,
2,
6748,
291,
1211,
357,
5450,
1378,
31628,
13,
7145,
291,
1211,
13,
2398,
14,
268,
14,
31284,
14,
11250,
495,
13,
6494,
8,
198,
2,
198,
2,
3395,
321,
11463,
3544,
6748,
291,
1211,
284,
5412,
3992,
7007,
416,
4277,
13,
7... | 3.335938 | 128 |
import polyphony
import sub1
from sub3 import SUB3_GLOBAL_ARRAY, SUB3_GLOBAL_TUPLE
@polyphony.testbench
test()
| [
11748,
7514,
23021,
198,
11748,
850,
16,
198,
6738,
850,
18,
1330,
28932,
18,
62,
8763,
9864,
1847,
62,
1503,
30631,
11,
28932,
18,
62,
8763,
9864,
1847,
62,
51,
8577,
2538,
628,
628,
628,
198,
31,
35428,
23021,
13,
9288,
26968,
628... | 2.531915 | 47 |
import pytest
import requests
import json
import os
from jsonschema import validate
API_LINK = 'https://jsonplaceholder.typicode.com/posts'
TMP_FILE = 'test_jsonplaceholder.json'
@pytest.yield_fixture(scope='session', autouse=True)
def make_tmp_file():
"""Create temporary file and delete in the end of the test ... | [
11748,
12972,
9288,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
44804,
684,
2395,
2611,
1330,
26571,
628,
198,
17614,
62,
43,
17248,
796,
705,
5450,
1378,
17752,
5372,
13829,
13,
774,
16564,
1098,
13,
785,
14,
248... | 2.456036 | 671 |
# -*- coding: utf-8 -*-
#
# This module is part of the GeoTag-X PyBossa plugin.
#
# Author: Jeremy Othieno (j.othieno@gmail.com)
#
# Copyright (c) 2016 UNITAR/UNOSAT
#
# The MIT License (MIT)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
8265,
318,
636,
286,
262,
32960,
24835,
12,
55,
9485,
37310,
64,
13877,
13,
198,
2,
198,
2,
6434,
25,
11753,
440,
400,
2013,
78,
357,
73,
13,
849,
... | 2.758231 | 2,035 |
import boto, boto.ec2
import re, datetime
from dateutil import parser
from dateutil import tz
import collections
from collections import OrderedDict
import ast
from operator import add
from atlas_helper_methods import AtlasHelper
from aws_helper import AwsHelper
| [
11748,
275,
2069,
11,
275,
2069,
13,
721,
17,
198,
11748,
302,
11,
4818,
8079,
198,
6738,
3128,
22602,
1330,
30751,
198,
6738,
3128,
22602,
1330,
256,
89,
198,
11748,
17268,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
64... | 3.666667 | 72 |
'''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... | [
7061,
6,
198,
15269,
357,
34,
8,
33448,
29925,
39606,
198,
4023,
1378,
66,
36484,
18055,
13,
785,
198,
31373,
31,
66,
36484,
18055,
13,
785,
198,
198,
41972,
416,
11232,
5601,
768,
11,
11232,
34974,
628,
220,
220,
220,
770,
1430,
31... | 1.945199 | 1,989 |
"""
Interpolate using a second order Lagrange polynomial.
Based on NPSS implementation.
"""
import numpy as np
from openmdao.components.interp_util.interp_algorithm import InterpAlgorithm
class InterpLagrange2(InterpAlgorithm):
"""
Interpolate using a second order Lagrange polynomial.
"""
def __ini... | [
37811,
198,
9492,
16104,
378,
1262,
257,
1218,
1502,
21003,
9521,
745,
6213,
49070,
13,
198,
198,
15001,
319,
399,
3705,
50,
7822,
13,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1280,
9132,
5488,
13,
5589,
3906,
1... | 2.030502 | 2,131 |
import os
from collections import namedtuple
import PIL
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.logger import Logger
from kivy.properties import ListProperty
from kivy.uix.anchorlayout import AnchorLayout
from .utils import fix_android_image
MODULE_DIRECTORY = os.path.dirname(os.path.rea... | [
11748,
28686,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
350,
4146,
198,
6738,
479,
452,
88,
13,
15750,
1330,
21328,
198,
6738,
479,
452,
88,
13,
17204,
1330,
35869,
198,
6738,
479,
452,
88,
13,
6404,
1362,
1330,
5972,
... | 2.551948 | 770 |
from src.modules.papers import Paper, PaperList
| [
6738,
12351,
13,
18170,
13,
40491,
1330,
14962,
11,
14962,
8053,
198
] | 4 | 12 |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 20 18:12:59 2021
@author: Traftmine
"""
#the computer choose a number between 1 and a number x chosen by the user
import random as rm
import time as t
NUMBER_LIM = int(input("What's the limit number you're ok with? "))
Y = int(input("How many rounds do y... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3825,
7653,
1160,
1248,
25,
1065,
25,
3270,
33448,
201,
198,
201,
198,
31,
9800,
25,
309,
1617,
3810,
201,
198,
37811,
201,
198,
201,... | 2.566372 | 565 |
#! /usr/bin/env python
import sys
from setuptools import setup
import versioneer
setup_args = dict(
name = 'pyctdev',
description = 'python packaging common tasks for developers',
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
version = versioneer.get_ve... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
11748,
2196,
28153,
198,
198,
40406,
62,
22046,
796,
8633,
7,
198,
220,
220,
220,
1438,
796,
705,
9078,
310,
... | 2.488152 | 844 |
from git import base
import torch
from PIL import Image
from torchvision import transforms
from google.cloud import storage
import io
import base64
BUCKET_NAME = "cloud_fn_storage"
MODEL_FILE = "deployable_model.pt"
client = storage.Client()
bucket = client.get_bucket(BUCKET_NAME)
blob = bucket.get_blob(MODEL_FILE)
m... | [
6738,
17606,
1330,
2779,
198,
11748,
28034,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
28034,
10178,
1330,
31408,
198,
6738,
23645,
13,
17721,
1330,
6143,
198,
11748,
33245,
198,
11748,
2779,
2414,
198,
198,
33,
16696,
2767,
62,
20608,
... | 2.954545 | 154 |
import sys, os
# 为了兼容-m模式运行,我们主动将当前目录加入到sys.path,这样就能搜索本项目的的模块
sys.path.append(os.path.dirname(__file__))
from app import main
if __name__ == '__main__':
main()
| [
11748,
25064,
11,
28686,
201,
198,
2,
220,
10310,
118,
12859,
228,
17739,
120,
22522,
117,
12,
76,
162,
101,
94,
28156,
237,
32573,
238,
26193,
234,
171,
120,
234,
22755,
239,
20015,
105,
10310,
119,
27950,
101,
49546,
37605,
241,
302... | 1.272059 | 136 |
"""
Modipyd: Autotest for Python, and more
=======================================
**Modipyd** is a `Python`_ module dependency analysis and monitoring
modification framework, written by Takanori Ishikawa and licensed
under `the MIT license`_.
**This project aims to provide:**
* Automated testing tool **pyautotest**... | [
37811,
198,
5841,
541,
5173,
25,
5231,
313,
395,
329,
11361,
11,
290,
517,
198,
10052,
1421,
18604,
198,
198,
1174,
5841,
541,
5173,
1174,
318,
257,
4600,
37906,
63,
62,
8265,
20203,
3781,
290,
9904,
198,
4666,
2649,
9355,
11,
3194,
... | 3.420925 | 822 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import Config
app = Flask(__name__)
app.config.from_object(Config())
db = SQLAlchemy(app)
db.engine.execute('select 1')
| [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
198,
6738,
4566,
1330,
17056,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
11250,
13,
6738,
62,
15252,
7,
16934,
289... | 3.15873 | 63 |
# from website import score_comp | [
2,
422,
3052,
1330,
4776,
62,
5589
] | 4.571429 | 7 |
# from big_ol_pile_of_manim_imports import *
from manimlib.imports import *
from manimlib.constants import *
TEX_USE_CTEX = True
| [
2,
422,
1263,
62,
349,
62,
79,
576,
62,
1659,
62,
805,
320,
62,
320,
3742,
1330,
1635,
201,
198,
6738,
582,
320,
8019,
13,
320,
3742,
1330,
1635,
201,
198,
6738,
582,
320,
8019,
13,
9979,
1187,
1330,
1635,
201,
198,
51,
6369,
62... | 2.538462 | 52 |
from a10sdk.common.A10BaseClass import A10BaseClass
class MemberList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param status: {"type": "string", "format": "string"}
:param passive: {"type": "number", "format": "number"}
:param connect_success: {"type": "num... | [
6738,
257,
940,
21282,
74,
13,
11321,
13,
32,
940,
14881,
9487,
1330,
317,
940,
14881,
9487,
628,
198,
4871,
10239,
8053,
7,
32,
940,
14881,
9487,
2599,
198,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
1212,
1398,
857,
407,
1104,... | 3.00197 | 1,015 |
class InvalidFactorialError(RuntimeError):
"""Error generated if an invalid factorial input is given."""
def factorial(n: int) -> int:
"""Computes the factorial through a recursive algorithm.
Args:
n: A positive input value.
Raises:
InvalidFactorialError: If n is less than 0.
Re... | [
4871,
17665,
29054,
5132,
12331,
7,
41006,
12331,
2599,
198,
220,
220,
220,
37227,
12331,
7560,
611,
281,
12515,
1109,
5132,
5128,
318,
1813,
526,
15931,
628,
198,
4299,
1109,
5132,
7,
77,
25,
493,
8,
4613,
493,
25,
198,
220,
220,
2... | 2.583756 | 197 |
"""
Defines a finite product topology. This is a product topology formed by
multiplying two finite topologies.
"""
import abc
from .finite_topology import FiniteTopology
from .product_topology import ProductTopology
from typing import TypeVar, Tuple, Set, Generic
X = TypeVar('X')
Y = TypeVar('Y')
class FiniteProduct... | [
37811,
198,
7469,
1127,
257,
27454,
1720,
1353,
1435,
13,
770,
318,
257,
1720,
1353,
1435,
7042,
416,
198,
16680,
541,
3157,
734,
27454,
1353,
5823,
13,
198,
37811,
198,
11748,
450,
66,
198,
6738,
764,
69,
9504,
62,
4852,
1435,
1330,
... | 2.92515 | 334 |
from transformers import T5TokenizerFast
import torch
import torch.nn.functional as F
from lm_eval.base import LM
from lm_eval import utils
from tqdm import tqdm
### I very much dislike this solution. TODO: fix this abomination for jay-z repo
import os
import sys
from pathlib import Path
path = Path(os.path.realpath(_... | [
6738,
6121,
364,
1330,
309,
20,
30642,
7509,
22968,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
300,
76,
62,
18206,
13,
8692,
1330,
37125,
198,
6738,
300,
76,
62,
18206,
1330,
3384,
4487,
198,
6738... | 3.195946 | 148 |
from .models import Campaign
| [
6738,
764,
27530,
1330,
13718,
628
] | 5 | 6 |
#!/usr/bin/env python3.8
from user import User
from credentials import Credential
import random
import string
Process = []
#sign in user
#program running
program_run = True
#exit program
#sign up user
def signup_user(username, password):
'''
Function to sign up a user
'''
new_user = User(userna... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
23,
198,
6738,
2836,
1330,
11787,
198,
6738,
18031,
1330,
327,
445,
1843,
198,
11748,
4738,
198,
11748,
4731,
198,
198,
18709,
796,
17635,
198,
2,
12683,
287,
2836,
628,
198,
2,
2... | 2.648673 | 1,093 |
import sys
import os
import django
CHOPEN_PATH = os.path.dirname(os.path.realpath(__file__))
| [
11748,
25064,
198,
11748,
28686,
198,
11748,
42625,
14208,
198,
198,
3398,
3185,
1677,
62,
34219,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
4008,
198
] | 2.611111 | 36 |
#!/usr/bin/env python3
# Copyright (C) 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
34,
8,
13130,
383,
5565,
4946,
8090,
4935,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,... | 3.087079 | 356 |
# FootAndBall: Integrated Player and Ball Detector
# Jacek Komorowski, Grzegorz Kurzejamski, Grzegorz Sarwas
# Copyright (c) 2020 Sport Algorithmics and Gaming
from torchvision import transforms
from PIL import Image
import numpy as np
import numbers
import random
import cv2
import torchvision.transforms as transform... | [
2,
7870,
1870,
23410,
25,
35432,
7853,
290,
6932,
4614,
9250,
198,
2,
49674,
74,
32364,
273,
12079,
11,
1902,
89,
1533,
273,
89,
18132,
2736,
73,
4105,
4106,
11,
1902,
89,
1533,
273,
89,
6866,
9776,
198,
2,
15069,
357,
66,
8,
1213... | 2.490711 | 2,207 |
import pytest # noinspection PyPackageRequirements
import asyncio
from aionetworking.compatibility import (supports_task_name, get_task_name, get_current_task_name, set_task_name,
set_current_task_name, current_task)
| [
11748,
12972,
9288,
220,
220,
1303,
645,
1040,
14978,
9485,
27813,
42249,
198,
11748,
30351,
952,
198,
198,
6738,
257,
295,
316,
16090,
13,
5589,
25901,
1330,
357,
18608,
2096,
62,
35943,
62,
3672,
11,
651,
62,
35943,
62,
3672,
11,
65... | 2.40367 | 109 |
# Copyright 2020, OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
2,
15069,
12131,
11,
4946,
31709,
41935,
46665,
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.928785 | 2,008 |
from rest_framework import viewsets, status
from rest_framework.response import Response
from backend.api.models import Usuario, Miembro, Proyecto, RolProyecto, Horario
from backend.api.serializers import MiembroSerializer, HorarioSerializer
from rest_framework.decorators import action
from django.db import transaction... | [
6738,
1334,
62,
30604,
1330,
5009,
1039,
11,
3722,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
30203,
13,
15042,
13,
27530,
1330,
471,
2385,
4982,
11,
13756,
368,
7957,
11,
1041,
88,
478,
78,
11,
371,
349,
2964,
8... | 1.905217 | 4,811 |
from django.shortcuts import render
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
628,
198
] | 3.8 | 10 |
from django import forms
from wagtail.wagtailadmin.forms import WagtailAdminPageForm
| [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
266,
363,
13199,
13,
86,
363,
13199,
28482,
13,
23914,
1330,
21309,
13199,
46787,
9876,
8479,
628
] | 3.48 | 25 |
# -*- coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*-
#
# Copyright (C) 2019 Thibauld Nion
#
# This file is part of WaterOnMars (https://github.com/tibonihoo/wateronmars)
#
# WaterOnMars is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as p... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
26,
21015,
12,
521,
298,
25,
362,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
13130,
49486,
30406,
399,
295,
198,
2,
198,
2,
770,
... | 2.213938 | 1,234 |
from setuptools import setup
with open('README.rst', 'r') as f:
long_discription = f.read()
setup(
name='SWSHplotting',
version='0.0.1',
author='Jonas Freißmann',
author_email='jonas.freissmann@hs-flensburg.de',
description='Plotting package for SWSH project.',
long_discription=long_discri... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
4480,
1280,
10786,
15675,
11682,
13,
81,
301,
3256,
705,
81,
11537,
355,
277,
25,
198,
220,
220,
220,
890,
62,
15410,
2918,
796,
277,
13,
961,
3419,
198,
198,
40406,
7,
198,
220,
220,
... | 2.376344 | 279 |
"""The Ping (Socket) integration."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from .const import DOMAIN
| [
37811,
464,
34263,
357,
39105,
8,
11812,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
1363,
562,
10167,
13,
7295,
1330,
5995,
48902,
198,
198,
6738,
764,
9979,
1330,
24121,
29833,
198
] | 4.027778 | 36 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from grafo import *
global resultados_pruebas
resultados_pruebas = { "OK" : 0, "ERROR" : 0 }
def correr_prueba(caso_prueba, descripcion):
''' Comprueba la igualdad pasada por parámetro como caso_prueba y
muestra la descripción y su r... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
11748,
640,
201,
198,
6738,
7933,
6513,
1330,
1635,
201,
198,
201,
198,
20541,
1255,
22484,
62,
1050,
518,
... | 1.965363 | 895 |
""" Automatic creation of pydantic model classes from a sqlalchemy table
SEE: Copied and adapted from https://github.com/tiangolo/pydantic-sqlalchemy/blob/master/pydantic_sqlalchemy/main.py
"""
import json
import warnings
from datetime import datetime
from typing import Any, Callable, Container, Dict, List, Optional,... | [
37811,
30199,
6282,
286,
279,
5173,
5109,
2746,
6097,
422,
257,
44161,
282,
26599,
3084,
198,
198,
36078,
25,
6955,
798,
290,
16573,
422,
3740,
1378,
12567,
13,
785,
14,
83,
15483,
14057,
14,
79,
5173,
5109,
12,
25410,
282,
26599,
14,... | 2.487119 | 1,281 |
from setuptools import setup, find_packages
from patchworkdocker.meta import VERSION, DESCRIPTION, PACKAGE_NAME, EXECUTABLE_NAME
setup(
name=PACKAGE_NAME,
version=VERSION,
author="Colin Nolan",
author_email="cn580@alumni.york.ac.uk",
packages=find_packages(exclude=["tests"]),
install_requires=... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
6738,
8529,
1818,
45986,
13,
28961,
1330,
44156,
2849,
11,
22196,
40165,
11,
47035,
11879,
62,
20608,
11,
7788,
2943,
3843,
17534,
62,
20608,
198,
198,
40406,
7,
198,
... | 2.503472 | 288 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
config = {
'test': TestingConfig,
'production': Config,
'default': DevelopmentConfig
}
| [
11748,
28686,
198,
3106,
343,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
628,
628,
198,
198,
11250,
796,
1391,
198,
220,
220,
220,
705,
9288,
10354,
23983,
16934,
11,
198,
... | 2.650794 | 63 |
'''
Created on 20 Jan 2021
@author: thomasgumbricht
'''
# Standard library imports
from os import path, makedirs
from sys import exit
# Third party imports
import psycopg2
from base64 import b64encode, b64decode
import netrc
from pyproj import Proj, transform
# Package application imports
from geoimagine.anc... | [
7061,
6,
198,
41972,
319,
1160,
2365,
33448,
198,
198,
31,
9800,
25,
294,
16911,
70,
388,
1671,
30830,
198,
7061,
6,
198,
198,
2,
8997,
5888,
17944,
198,
198,
6738,
28686,
1330,
3108,
11,
285,
4335,
17062,
198,
198,
6738,
25064,
133... | 1.946681 | 18,155 |
import django
from rdflib.namespace import DC
from unittest import TestCase
from fedoralink.common_namespaces.dc import DCObject
from fedoralink.indexer.fields import IndexedTextField
django.setup()
| [
11748,
42625,
14208,
198,
6738,
374,
67,
2704,
571,
13,
14933,
10223,
1330,
6257,
198,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
11672,
6864,
676,
13,
11321,
62,
14933,
43076,
13,
17896,
1330,
6257,
10267,
198,
6738,
... | 3.238095 | 63 |
##
# Copyright : Copyright (c) MOSEK ApS, Denmark. All rights reserved.
#
# File : opt_server_sync.py
#
# Purpose : Demonstrates how to use MOSEK OptServer
# to solve optimization problem asynchronously
##
import mosek
import sys
if len(sys.argv) <= 3:
print("Missing argument, syntax is:")
... | [
2235,
198,
2,
220,
15069,
1058,
15069,
357,
66,
8,
337,
14058,
42,
5949,
50,
11,
16490,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
9220,
1058,
220,
220,
220,
220,
220,
2172,
62,
15388,
62,
27261,
13,
9078,
198,
2,
198,
2,
... | 2.452229 | 471 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 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, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
2... | 3.370221 | 497 |
#!/usr/bin/env python3
import os
import time
import json
import subprocess
WARMUPS = 8
SAMPLES = 64
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
850,
14681,
198,
198,
16279,
42422,
3705,
796,
807,
198,
49302,
6489,
1546,
796,
5598,
198,
198,
361,
11593,
3672,
... | 2.563636 | 55 |
import sys
from . import main
sys.exit(main.main())
| [
11748,
25064,
198,
198,
6738,
764,
1330,
1388,
198,
198,
17597,
13,
37023,
7,
12417,
13,
12417,
28955,
198
] | 2.842105 | 19 |
'''
Problem Statement: Assign tasks to workers so that the time it takes
to complete all the tasks is minimized given a count of workers and an
array where each element indicates the duration of a task.
Each worker must work on exactly two tasks.
'''
A = [5, 6, 1, 8, 3, 8]
A = sorted(A)
for i in range(len(A)//2):
... | [
7061,
6,
198,
40781,
21983,
25,
2195,
570,
8861,
284,
3259,
523,
326,
262,
640,
340,
2753,
198,
1462,
1844,
477,
262,
8861,
318,
49491,
1813,
257,
954,
286,
3259,
290,
281,
198,
18747,
810,
1123,
5002,
9217,
262,
9478,
286,
257,
487... | 3.081818 | 110 |
import random
from django.contrib.auth import get_user_model
from django.http import HttpResponse
from django.contrib.auth.views import PasswordResetView
UserModel = get_user_model()
| [
11748,
4738,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
33571,
1330,
... | 3.321429 | 56 |
import psycopg2
from .queries import ALL_RESIDENTIAL_FIRES, RESIDENTIAL_FIRES_BY_FDID_STATE_HAZARD
from psycopg2.extras import DictCursor
class Backend(object):
"""
Backend mixin that should be used to implement APIs to read data.
"""
def connect(self):
"""
Connect to the backend.
... | [
11748,
17331,
22163,
70,
17,
198,
198,
6738,
764,
421,
10640,
1330,
11096,
62,
19535,
25256,
12576,
62,
39776,
1546,
11,
15731,
25256,
12576,
62,
39776,
1546,
62,
17513,
62,
26009,
2389,
62,
44724,
62,
7801,
57,
9795,
198,
6738,
17331,
... | 2.5 | 426 |
import io
import os
import abc
import mimetypes
from json import dumps as jsondumps
from typing import Any, Dict, Iterable, List, Optional, Union
from hyperad.constants import (
CONTENT_TYPE, CONTENT_DISPOSITION,
APPLICATION_JSON, MULTIPART_FORM_DATA, TEXT_PLAIN,
APPLICATION_X_WWW_FORM_URLENCODED, APPLICAT... | [
11748,
33245,
198,
11748,
28686,
198,
11748,
450,
66,
198,
11748,
17007,
2963,
12272,
198,
6738,
33918,
1330,
45514,
355,
44804,
623,
8142,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
40806,
540,
11,
7343,
11,
32233,
11,
4479,
198,
... | 2.448113 | 1,484 |
# Common imports
import numpy as np
import pandas as pd
from math import *
import matplotlib.pyplot as plt
Deltax = 0.01
#set up arrays
xinitial = -5.0
xfinal = 5.0
n = ceil((xfinal-xinitial)/Deltax)
x = np.zeros(n)
for i in range(n):
x[i] = xinitial+i*Deltax
V = np.zeros(n)
# Initial conditions as compact 2-dim... | [
2,
8070,
17944,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
10688,
1330,
1635,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
35,
2120,
897,
796,
657,
13,
486,
198,
2... | 2.177122 | 271 |
try:
from unittest import mock
except ImportError:
import mock
from . import BaseTestCase
from freon.cache import Cache
from freon.backends.redis import RedisBackend
from freon.serializers.msgpack import MsgpackSerializer
@mock.patch.object(Cache, 'set')
| [
28311,
25,
198,
220,
220,
220,
422,
555,
715,
395,
1330,
15290,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1330,
15290,
198,
198,
6738,
764,
1330,
7308,
14402,
20448,
198,
198,
6738,
2030,
261,
13,
23870,
1330,
34088,
198,
6738... | 3 | 92 |
import os
APPLICATION_DEBUG = os.environ.get('APPLICATION_DEBUG', True)
APPLICATION_HOST = os.environ.get('APPLICATION_HOST', '0.0.0.0')
APPLICATION_PORT = os.environ.get('APPLICATION_PORT', 5000)
AWS_REGION = os.environ.get('AWS_REGION', 'us-east-1')
DATABASE_HOST = os.environ.get('DATABASE_HOST', 'hgpoker.c13gml6m... | [
11748,
28686,
198,
198,
2969,
31484,
6234,
62,
30531,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
2969,
31484,
6234,
62,
30531,
3256,
6407,
8,
198,
2969,
31484,
6234,
62,
39,
10892,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
2969,
31... | 2.219444 | 360 |
import random
import subprocess
import pickle
| [
11748,
4738,
198,
11748,
850,
14681,
198,
11748,
2298,
293,
628,
628
] | 4.083333 | 12 |
# https://atcoder.jp/contests/math-and-algorithm/tasks/math_and_algorithm_o
a, b = map(int, input().split())
a, b = max(a, b), min(a, b)
while b > 0:
if a > b:
a, b = b, a % b
else:
a, b = b % a, a
print(a) | [
2,
3740,
1378,
265,
66,
12342,
13,
34523,
14,
3642,
3558,
14,
11018,
12,
392,
12,
282,
42289,
14,
83,
6791,
14,
11018,
62,
392,
62,
282,
42289,
62,
78,
198,
198,
64,
11,
275,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198... | 1.909091 | 121 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Yuemeng Li
"""
from backbone import Backbone
import torch
import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
from tqdm import tqdm
from torch.nn import DataParallel
import nibabel as nib
import pdb
#######run command#######... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
10605,
368,
1516,
7455,
198,
37811,
198,
198,
6738,
32774,
1330,
5157,
15992,
198,
11748,... | 2.575342 | 219 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# LegiscanAPI.py -- Pull data from Legiscan.com API
# By Uchechukwu Uboh and Tony Pearson, IBM, 202
#
# LegiscanAPI class automates the retrival and curation of bill data for a
# particular US state. Before running this class, your Legiscan.com apikey
# needs to be an ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
2,
3564,
2304,
272,
17614,
13,
9078,
1377,
21429,
1366,
422,
3564,
2304,
272,
13,
785,
7824,
198,
2,
... | 2.264105 | 4,892 |
from flask import jsonify
from app import db
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, String, Boolean, Text | [
6738,
42903,
1330,
33918,
1958,
198,
6738,
598,
1330,
20613,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
7536,
7575,
11,
10903,
11,
41146,
11,
8255
] | 4.171429 | 35 |
#
# Copyright (C) 2019 Databricks, 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 i... | [
2,
198,
2,
15069,
357,
34,
8,
13130,
16092,
397,
23706,
11,
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,
... | 3.279883 | 343 |
#!/usr/bin/env python
"""
Python source code - replace this with a description of the code and write the code below this text.
"""
import os.path as osp
from sklearn import grid_search
from sklearn.ensemble import RandomForestClassifier
from sklearn import metrics
from sklearn.cross_validation import StratifiedKFold... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
37906,
2723,
2438,
532,
6330,
428,
351,
257,
6764,
286,
262,
2438,
290,
3551,
262,
2438,
2174,
428,
2420,
13,
198,
37811,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
... | 3.354839 | 124 |
#!/usr/bin/env python
#
# 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
# "... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
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,... | 2.714931 | 3,322 |
from unittest import TestCase
import psycopg2 as pg
import psycopg2.extensions as pg_extensions
import tests.env
import karaoke
from karaoke.queue import Queue
from karaoke.exceptions import QueueError
from tests.conftest import KaraokeTestCase
class TestQueue(KaraokeTestCase):
'''
Test some methods of the ... | [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
11748,
17331,
22163,
70,
17,
355,
23241,
198,
11748,
17331,
22163,
70,
17,
13,
2302,
5736,
355,
23241,
62,
2302,
5736,
198,
198,
11748,
5254,
13,
24330,
198,
11748,
479,
3301,
2088,
19... | 2.084806 | 849 |
import sys
import cPickle
import numpy
import matplotlib.pyplot as plt
import argparse
import pdb
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-f",
"--result-file",
type=str,
default=None)
parser.... | [
11748,
25064,
198,
11748,
269,
31686,
293,
198,
11748,
299,
32152,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
1822,
29572,
198,
198,
11748,
279,
9945,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417... | 1.786967 | 399 |
# pong-online
# https://github.com/VilhelmPrytz/pong-online
# Copyright (C) Vilhelm Prytz 2019
from components.tools import random_string
# 1 - waiting for opponent to join
# 2 - in game
| [
2,
279,
506,
12,
25119,
198,
2,
3740,
1378,
12567,
13,
785,
14,
53,
346,
33485,
47,
563,
22877,
14,
79,
506,
12,
25119,
198,
2,
15069,
357,
34,
8,
34037,
33485,
32500,
22877,
13130,
198,
198,
6738,
6805,
13,
31391,
1330,
4738,
62,... | 3.064516 | 62 |
#!/usr/bin/python
import sys, warnings
if sys.version_info[0] < 3:
warnings.warn('Need Python 3.0 for this program to run', RuntimeWarning)
else:
print('Procees as normal') | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
25064,
11,
14601,
198,
198,
361,
25064,
13,
9641,
62,
10951,
58,
15,
60,
1279,
513,
25,
198,
220,
220,
220,
14601,
13,
40539,
10786,
23037,
11361,
513,
13,
15,
329,
428,
1430,
... | 2.84375 | 64 |
from datetime import datetime
from django.core.cache import cache
from custom.icds.const import (
DATA_PULL_CACHE_KEY,
DATA_PULL_PERMITTED_END_HOUR,
DATA_PULL_PERMITTED_START_HOUR,
)
from custom.icds_reports.const import INDIA_TIMEZONE
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
42625,
14208,
13,
7295,
13,
23870,
1330,
12940,
198,
198,
6738,
2183,
13,
291,
9310,
13,
9979,
1330,
357,
198,
220,
220,
220,
42865,
62,
5105,
3069,
62,
34,
2246,
13909,
62,
20373,
11,
... | 2.460784 | 102 |
from datetime import date, datetime
print(str(datetime.today())[:4])
| [
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
4798,
7,
2536,
7,
19608,
8079,
13,
40838,
28955,
58,
25,
19,
12962,
198
] | 3 | 23 |
# -*- coding: utf-8 -*-
"""Contain schemata required by cenv-tool."""
from marshmallow import fields
from marshmallow import Schema
from marshmallow import validate
class SNPackage(Schema):
"""Contain the ``package``-section inside a ``meta.yaml``."""
name = fields.String(strict=True, required=True)
vers... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
4264,
391,
3897,
76,
1045,
2672,
416,
269,
24330,
12,
25981,
526,
15931,
198,
6738,
22397,
42725,
1330,
7032,
198,
6738,
22397,
42725,
1330,
10011,
2611,
198,
6738,... | 2.615836 | 1,364 |
import numpy as np
from matplotlib import pyplot as plt
from lmfit.models import GaussianModel as gauss_mod
from lmfit.models import VoigtModel as voigt_mod
from lmfit.models import LinearModel as lin_mod
| [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
300,
76,
11147,
13,
27530,
1330,
12822,
31562,
17633,
355,
31986,
1046,
62,
4666,
198,
6738,
300,
76,
11147,
13,
27530,
1330,
2068... | 3.153846 | 65 |
import requests
import json
import random
from . import secretKey
print(secret_key)
# TODO: get some of questions only, not all.
# TODO: present tense, verbs with "s"
# TODO: full stop of each sentence
# TODO: will print the error msg out "error:rm_answer_to_blank"
# TODO: quality of the dictionary is too low
# Loa... | [
11748,
7007,
198,
11748,
33918,
198,
11748,
4738,
198,
198,
6738,
764,
1330,
3200,
9218,
198,
198,
4798,
7,
21078,
62,
2539,
8,
198,
198,
2,
16926,
46,
25,
651,
617,
286,
2683,
691,
11,
407,
477,
13,
198,
2,
16926,
46,
25,
1944,
... | 2.642706 | 473 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 3 14:49:28 2017
@author: Arpan
Description: Use c3d trained model for prediction. To be executed after
training_model_m4.py
"""
import json
import os
import utils
import numpy as np
import h5py
import pandas as pd
import collections
import cv2
im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
5979,
220,
513,
1478,
25,
2920,
25,
2078,
2177,
198,
198,
31,
9800,
25,
943,
6839,
... | 2.442627 | 4,462 |
import argparse
from fractions import Fraction
import math
import numpy as np
import pandas as pd
from tabulate import tabulate
# Formatting function
#def format_fraction(val):
# f = Fraction(val)
# return '{:>5} {:>3} /{:>3}'.format(, f.numerator, f.denominator)
# Parse command line
parser = argparse.Argument... | [
11748,
1822,
29572,
198,
6738,
49876,
1330,
376,
7861,
198,
11748,
10688,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
198,
2,
18980,
889,
2163,
198,
2,
4... | 2.577263 | 906 |
#!/usr/bin/env python3
# This sample demonstrates how to use query parameters with a REST API
# endpoint.
# For a list of the endpoints that you can use along with the parameters that
# they accept you can view the REST API interactive help page on your
# deployment at https://<hostname>/api_doc
# You can also retriev... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
770,
6291,
15687,
703,
284,
779,
12405,
10007,
351,
257,
30617,
7824,
198,
2,
36123,
13,
198,
198,
2,
1114,
257,
1351,
286,
262,
886,
13033,
326,
345,
460,
779,
1863,
351,
2... | 3.539267 | 191 |
password = {
"password": ""#password here
} | [
28712,
796,
1391,
198,
220,
220,
220,
366,
28712,
1298,
13538,
2,
28712,
994,
198,
92
] | 2.9375 | 16 |
from typing import List, Tuple, Optional
import numpy as np
g = Graph([
[0, 1, 1, 0, 1],
[0, 0, 0, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
])
print(g.BFS())
| [
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
32233,
198,
11748,
299,
32152,
355,
45941,
628,
628,
628,
198,
70,
796,
29681,
26933,
198,
220,
220,
220,
685,
15,
11,
352,
11,
352,
11,
657,
11,
352,
4357,
198,
220,
220,
220,
685,
15,... | 1.827273 | 110 |
"""Provides key, name, description, and location for
cookiecutter apps templates
"""
__all__ = ['COOKIECUTTER_URI', 'DIRECTORY', 'CHECKOUT']
COOKIECUTTER_URI = 'https://github.com/TACC-Cloud/cc-tapis-v2-app.git'
DIRECTORY = 'default'
CHECKOUT = 'master'
| [
37811,
15946,
1460,
1994,
11,
1438,
11,
6764,
11,
290,
4067,
329,
198,
44453,
8968,
353,
6725,
24019,
198,
37811,
198,
198,
834,
439,
834,
796,
37250,
34,
15308,
40,
2943,
3843,
5781,
62,
47269,
3256,
705,
17931,
23988,
15513,
3256,
7... | 2.666667 | 96 |
# Copyright (c) 2012-2014, Max Zwiessele, James Hensman
# Licensed under the BSD 3-clause license (see LICENSE.txt)
__doc__ = """
Inference over Gaussian process latent functions
In all our GP models, the consistency propery means that we have a Gaussian
prior over a finite set of points f. This prior is
math:: N(... | [
2,
15069,
357,
66,
8,
2321,
12,
4967,
11,
5436,
1168,
86,
444,
325,
293,
11,
3700,
367,
641,
805,
198,
2,
49962,
739,
262,
347,
10305,
513,
12,
565,
682,
5964,
357,
3826,
38559,
24290,
13,
14116,
8,
198,
198,
834,
15390,
834,
79... | 2.987166 | 935 |
import datetime
import logging
import sys
from random import shuffle
logger = logging.getLogger(__name__)
if __name__ == "__main__":
run_spark(sys.argv)
| [
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
6738,
4738,
1330,
36273,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
83... | 2.810345 | 58 |
from typing import Tuple
from hypothesis import given
from gon.base import Vector
from tests.utils import implication
from . import strategies
@given(strategies.vectors)
@given(strategies.vectors)
@given(strategies.vectors_pairs)
| [
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
14078,
1330,
1813,
198,
198,
6738,
35140,
13,
8692,
1330,
20650,
198,
6738,
5254,
13,
26791,
1330,
26863,
198,
6738,
764,
1330,
10064,
628,
198,
31,
35569,
7,
2536,
2397,
444,
13,
303,
52... | 3.352113 | 71 |
# Generated by Django 3.0.10 on 2021-01-22 22:02
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
940,
319,
33448,
12,
486,
12,
1828,
2534,
25,
2999,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.840909 | 44 |
from django.conf.urls.defaults import *
from django.views.generic import DetailView, ListView
from archive.models import Catalogue, Document
urlpatterns = patterns('archive.views',
url(r'^$',
ListView.as_view(
context_object_name="catalogues",
queryset=Catalogu... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12286,
82,
1330,
1635,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
42585,
7680,
11,
7343,
7680,
198,
198,
6738,
15424,
13,
27530,
1330,
16758,
5119,
11,
16854,
198,
198,
6371,
... | 2.020478 | 586 |
text = input("Text: ")
spam = False
if("make money fast"):
spam = True
print("Spam Detected!")
elif("subscribe this"):
spam = True
print("Spam Detected!")
elif("buy now"):
spam = True
print("Spam Detected!")
elif("purchase now"):
spam = True
print("Spam Detected!")
elif(... | [
5239,
796,
5128,
7203,
8206,
25,
366,
8,
201,
198,
2777,
321,
796,
10352,
201,
198,
201,
198,
361,
7203,
15883,
1637,
3049,
1,
2599,
201,
198,
220,
220,
220,
18084,
796,
6407,
201,
198,
220,
220,
220,
3601,
7203,
4561,
321,
46497,
... | 2.258929 | 224 |
# Exercício 032
from datetime import date
ano = int(input('Digite um ano qualquer. Digite 0 para analisar o ano ATUAL '))
if ano == 0:
ano = date.today().year
if ano % 4 == 0 and ano % 100 != 0 or ano % 400 == 0:
print(f'O ano de \033[1m{ano}\033[m \033[1;32mé BISSEXTO!\033[m')
else:
print(f'O Ano de \033... | [
2,
1475,
2798,
8836,
66,
952,
657,
2624,
198,
198,
6738,
4818,
8079,
1330,
3128,
198,
198,
5733,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
281,
78,
4140,
10819,
13,
7367,
578,
657,
31215,
2037,
271,
283,
267,
281,
78,
5161,
2562... | 2.073446 | 177 |