content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Advent of Code - Day 7 - Part One
from collections import defaultdict
from defaultlist import defaultlist
| [
2,
33732,
286,
6127,
532,
3596,
767,
532,
2142,
1881,
198,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
4277,
4868,
1330,
4277,
4868,
628,
198
] | 4.269231 | 26 |
import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
from nsmr.envs.nsmr import NSMR
from nsmr.envs.renderer import Renderer
| [
11748,
299,
32152,
355,
45941,
198,
11748,
11550,
198,
6738,
11550,
1330,
9029,
198,
6738,
11550,
13,
26791,
1330,
384,
8228,
198,
198,
6738,
299,
5796,
81,
13,
268,
14259,
13,
77,
5796,
81,
1330,
10896,
13599,
198,
6738,
299,
5796,
8... | 3 | 52 |
from django.conf import settings as django_settings
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
355,
42625,
14208,
62,
33692,
628
] | 4.076923 | 13 |
from distutils.core import setup, Extension
from Cython.Build import cythonize
extension = [Extension('server_c', ['server_c.pyx'])]
setup(ext_modules = cythonize(extension)) | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
11,
27995,
198,
6738,
327,
7535,
13,
15580,
1330,
3075,
400,
261,
1096,
198,
198,
2302,
3004,
796,
685,
11627,
3004,
10786,
15388,
62,
66,
3256,
37250,
15388,
62,
66,
13,
9078,
87,
6,
12962,
... | 2.983051 | 59 |
"""
The module sanity_check includes classes to check that train and tests are similar.
"""
from .similar_columns import SimilarColumns
__all__ = [
"SimilarColumns",
]
| [
37811,
198,
464,
8265,
34182,
62,
9122,
3407,
6097,
284,
2198,
326,
4512,
290,
5254,
389,
2092,
13,
198,
37811,
198,
198,
6738,
764,
38610,
62,
28665,
82,
1330,
11014,
39470,
82,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220... | 3.411765 | 51 |
from abc import abstractmethod, ABC
placeholders = [FormId, ResponseId]
_yt_link = 'dQw4w9WgXcQ'
yt_url = f'https://youtu.be/{_yt_link}'
| [
6738,
450,
66,
1330,
12531,
24396,
11,
9738,
628,
628,
198,
198,
5372,
10476,
796,
685,
8479,
7390,
11,
18261,
7390,
60,
628,
628,
198,
62,
20760,
62,
8726,
796,
705,
67,
48,
86,
19,
86,
24,
54,
70,
55,
66,
48,
6,
198,
20760,
... | 2.28125 | 64 |
'''
Created on Feb 24, 2019
@author: ramon
'''
from PyQt5 import QtCore, QtGui, QtWidgets
import numpy as np
from Components import Frame_Template
DEGREE = 57.2958
class Frame_Transform( Frames_Template ):
'''
classdocs
'''
def __init__(self, parent):
'''
Constructor
... | [
7061,
6,
198,
41972,
319,
3158,
1987,
11,
13130,
198,
198,
31,
9800,
25,
15770,
261,
198,
7061,
6,
628,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
198,
11748,
299,
32152,
355,
... | 2.056045 | 1,249 |
import os
import shutil
import codecs
from jinja2 import Environment, FileSystemLoader
CURRENT_PATH = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_ENVIRONMENT = Environment(loader=FileSystemLoader(os.path.join(CURRENT_PATH, 'templates')))
TEMPLATE = "report.html"
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
40481,
82,
198,
6738,
474,
259,
6592,
17,
1330,
9344,
11,
9220,
11964,
17401,
198,
198,
34,
39237,
62,
34219,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
7... | 2.833333 | 96 |
#!/usr/bin/env python
import sys
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.354839 | 31 |
# API FORMS
from django import forms | [
2,
7824,
7473,
5653,
198,
198,
6738,
42625,
14208,
1330,
5107
] | 3.363636 | 11 |
from io import StringIO
from dateutil.relativedelta import relativedelta
from django.core.management import call_command
from django.test import TestCase, override_settings
from django.utils import timezone
from hypha.apply.home.models import ApplyHomePage
from .factories import ProjectFactory, ReportConfigFactory, ... | [
6738,
33245,
1330,
10903,
9399,
198,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
48993,
1572,
12514,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
869,
62,
21812,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
... | 3.559633 | 109 |
CPT_ONEINCH_V1 = '1inch-v1'
CPT_ONEINCH_V2 = '1inch-v2'
| [
8697,
51,
62,
11651,
1268,
3398,
62,
53,
16,
796,
705,
16,
8589,
12,
85,
16,
6,
198,
8697,
51,
62,
11651,
1268,
3398,
62,
53,
17,
796,
705,
16,
8589,
12,
85,
17,
6,
198
] | 1.555556 | 36 |
#
# PySNMP MIB module ZXR10-MACPING-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZXR10-MACPING-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:48:20 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
1168,
55,
49,
940,
12,
44,
33056,
2751,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
... | 2.674347 | 5,816 |
{
"targets": [
{
"target_name": "zlib",
"type": "static_library",
"include_dirs": [
"config",
"zlib",
],
"direct_dependent_settings": {
"include_dirs": [
"zlib",
],... | [
90,
198,
220,
220,
220,
366,
83,
853,
1039,
1298,
685,
198,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
16793,
62,
3672,
1298,
366,
89,
8019,
1600,
198,
220,
220,
220... | 1.390917 | 1,123 |
from . import (
sequence,
stats
) | [
6738,
764,
1330,
357,
198,
220,
220,
220,
8379,
11,
198,
220,
220,
220,
9756,
198,
8
] | 2.411765 | 17 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
curdir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(curdir))
prodir = os.path.dirname(curdir)
sys.path.insert(0, prodir)
import warnings
warnings.filterwarnings('ignore', category=FutureWarning)
os.environ['TF_CPP... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
66,
2799,
343,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
697... | 2.536842 | 190 |
# -*- coding: utf-8 -*-
# @Time : 2020/12/1 下午11:34
# @Author : 司云中
# @File : wsgi.py
# @Software: Pycharm
# gunicorn 启动
from application import create_app
app = create_app()
celery = app.config.get('CELERY_INSTANCE') # celery -A wsgi:celery worker -l info
if __name__ == '__main__':
# 启动flask服务
app.run(host... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
1058,
12131,
14,
1065,
14,
16,
220,
10310,
233,
39355,
230,
1157,
25,
2682,
198,
2,
2488,
13838,
1058,
10263,
237,
116,
12859,
239,
40792,
198,
2,
... | 2.020619 | 194 |
# -*- coding:utf-8 -*-
from unittest import TestCase
from bambou.utils import Sha1
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
275,
4131,
280,
13,
26791,
1330,
19413,
16,
628
] | 2.65625 | 32 |
import importlib
from django.conf import settings
from is_valid import is_dict_where, is_in
LOADED_GAMES = {}
| [
11748,
1330,
8019,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
318,
62,
12102,
1330,
318,
62,
11600,
62,
3003,
11,
318,
62,
259,
628,
198,
35613,
1961,
62,
38,
29559,
796,
23884,
628,
198
] | 2.974359 | 39 |
post_body_park_info_by_name = {
"name": "Big Basin Redwoods SP"
}
park_post_body = {
"googlePlaceSearchParameters": {
"Latitude": "37.171596527103105",
"Longitude": "-122.22204589843994",
"Filter": "true",
"AvailabilitySearchParams": {
"StartDate": "8/30/2017",
... | [
7353,
62,
2618,
62,
20928,
62,
10951,
62,
1525,
62,
3672,
796,
1391,
198,
220,
220,
220,
366,
3672,
1298,
366,
12804,
32666,
2297,
39493,
6226,
1,
198,
92,
198,
198,
20928,
62,
7353,
62,
2618,
796,
1391,
198,
220,
220,
220,
366,
1... | 1.433817 | 53,564 |
from typing import cast
from neighborly.core.ecs import World
from neighborly.core.life_event import LifeEventRule
from neighborly.core.builtin.statuses import ElderStatus, AdultStatus
from neighborly.core.builtin.events import DeathEvent
from neighborly.core.time import SimDateTime
from neighborly.core.character impor... | [
6738,
19720,
1330,
3350,
198,
6738,
4780,
306,
13,
7295,
13,
721,
82,
1330,
2159,
198,
6738,
4780,
306,
13,
7295,
13,
6042,
62,
15596,
1330,
5155,
9237,
31929,
198,
6738,
4780,
306,
13,
7295,
13,
18780,
259,
13,
14269,
2664,
1330,
1... | 3.071823 | 181 |
class Event:
"""
Reference:
http://www.valuedlessons.com/2008/04/events-in-python.html
https://stackoverflow.com/questions/1092531/event-system-in-python
https://www.thecodeship.com/patterns/guide-to-python-function-decorators/
https://pythonacademy.com.br/blog/domine-decorators... | [
4871,
8558,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
20984,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2638,
1378,
2503,
13,
39728,
1203,
684,
13,
785,
14,
11528,
14,
3023,
14,
31534,
12,
259,
12,
29412,
13,
6494,
198,
... | 2.341365 | 249 |
import matplotlib.pyplot as plt
import numpy as np
from os import path
from matplotlib import cm
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28686,
1330,
3108,
198,
6738,
2603,
29487,
8019,
1330,
12067,
198
] | 3.344828 | 29 |
# pylint: skip-file
from __future__ import absolute_import, division, print_function
import datetime
import os
import shutil
import tempfile
import tornado.locale
from salt.ext.tornado.escape import utf8, to_unicode
from salt.ext.tornado.test.util import unittest, skipOnAppEngine
from salt.ext.tornado.util import uni... | [
2,
279,
2645,
600,
25,
14267,
12,
7753,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
198,
11748... | 3.23301 | 103 |
# Generated by Django 3.0.3 on 2020-08-01 14:34
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
18,
319,
12131,
12,
2919,
12,
486,
1478,
25,
2682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from mapping.models import Item, Workspace
from rest_framework import serializers
| [
6738,
16855,
13,
27530,
1330,
9097,
11,
10933,
10223,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
628,
198
] | 4.421053 | 19 |
from weakref import WeakKeyDictionary
import pytest
from mock import Mock, patch
from nameko.containers import ServiceContainer, WorkerContext
from nameko.testing.services import dummy, entrypoint_hook
from nameko_sqlalchemy.database import (
DB_URIS_KEY,
Database,
Session,
)
from sqlalchemy import Column,... | [
6738,
4939,
5420,
1330,
28788,
9218,
35,
14188,
198,
198,
11748,
12972,
9288,
198,
6738,
15290,
1330,
44123,
11,
8529,
198,
6738,
1438,
7204,
13,
3642,
50221,
1330,
4809,
29869,
11,
35412,
21947,
198,
6738,
1438,
7204,
13,
33407,
13,
30... | 3.215116 | 172 |
#
# PySNMP MIB module COLUBRIS-802DOT11-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/COLUBRIS-802DOT11-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:25:40 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
20444,
10526,
49,
1797,
12,
30863,
35,
2394,
1157,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
1... | 2.738984 | 59,050 |
from typing import Callable, Dict, Union
from django.db import models
import simplejson
from django.http import Http404
from clients.models import Card
def data_parse(data: Union[dict, str, bytes], keys_types: Dict[str, Union[Callable, str, None]], default_values: dict = None) -> list:
"""
Функиця проверки... | [
6738,
19720,
1330,
4889,
540,
11,
360,
713,
11,
4479,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
11748,
2829,
17752,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
198,
6738,
7534,
13,
27530,
1330,
5172,
... | 2.114118 | 850 |
import torch
from statistics.meters import Meter
class RFDeviation(Meter):
"""This Meter computes the standard deviation of the RF for a selection of random inputs. This approximates a
measure of the linearity of the average feature for the layer. Lower value = more simple cells, higher value = more
com... | [
11748,
28034,
198,
198,
6738,
7869,
13,
4164,
364,
1330,
46423,
628,
198,
198,
4871,
20445,
13603,
3920,
7,
44,
2357,
2599,
198,
220,
220,
220,
37227,
1212,
46423,
552,
1769,
262,
3210,
28833,
286,
262,
20445,
329,
257,
6356,
286,
473... | 3.97619 | 84 |
from immfly.settings import * # NOQA
INSTALLED_APPS += [ # NOQA
'drf_yasg',
]
| [
6738,
2296,
12254,
13,
33692,
1330,
1635,
220,
1303,
8005,
48,
32,
198,
198,
38604,
7036,
1961,
62,
2969,
3705,
15853,
685,
220,
1303,
8005,
48,
32,
198,
220,
220,
220,
705,
7109,
69,
62,
88,
292,
70,
3256,
198,
60,
198
] | 2.02381 | 42 |
from django.contrib import admin
# Register your models here.
from .models import Cart
admin.site.register(Cart)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
2,
17296,
534,
4981,
994,
13,
628,
198,
6738,
764,
27530,
1330,
13690,
628,
198,
28482,
13,
15654,
13,
30238,
7,
43476,
8,
198
] | 3.470588 | 34 |
"""Top-level package for Python Tomorrow.io API."""
from .pytomorrowio import TomorrowioV4, TomorrowioV4Sync
__author__ = """raman325"""
__email__ = "7243222+raman325@users.noreply.github.com"
__version__ = "0.1.0"
| [
37811,
9126,
12,
5715,
5301,
329,
11361,
25939,
13,
952,
7824,
526,
15931,
198,
198,
6738,
764,
9078,
39532,
6254,
952,
1330,
25939,
952,
53,
19,
11,
25939,
952,
53,
19,
28985,
198,
198,
834,
9800,
834,
796,
37227,
859,
272,
26582,
... | 2.7125 | 80 |
from django import VERSION
from django import forms
from django.urls import re_path
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from six import string_types
from .components import Dropdown
from .views import ModelToolsView
class AdminRowActionsMixin(object)... | [
6738,
42625,
14208,
1330,
44156,
2849,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
302,
62,
6978,
198,
6738,
42625,
14208,
13,
26791,
13,
49585,
395,
1806,
1330,
1317,
62,
21230,
198,
6738,
42625,
1... | 2.51341 | 522 |
from .entity_converter_interface import EntityConverterInterface
from gacha.entities import LootTableGroup, Pool
from typing import Any, Dict | [
6738,
764,
26858,
62,
1102,
332,
353,
62,
39994,
1330,
20885,
3103,
332,
353,
39317,
198,
6738,
308,
34518,
13,
298,
871,
1330,
29970,
10962,
13247,
11,
19850,
198,
6738,
19720,
1330,
4377,
11,
360,
713
] | 3.916667 | 36 |
from flask import Flask, app
from flask_restplus import Api, Resource
from server.instance import server
app, api = server.app, server.api
books_db = [
{'id':0,'title':'War and Peacce'},
{'id':1,'title':'Clean Code'}
]
@api.route('/books') | [
6738,
42903,
1330,
46947,
11,
598,
198,
6738,
42903,
62,
2118,
9541,
1330,
5949,
72,
11,
20857,
198,
6738,
4382,
13,
39098,
1330,
4382,
198,
198,
1324,
11,
40391,
796,
4382,
13,
1324,
11,
4382,
13,
15042,
198,
12106,
62,
9945,
796,
... | 2.706522 | 92 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, TZCODE SRL and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import requests
import json
import traceback
from tzdealer.hook.item import cast_to_post, cast_im... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
12131,
11,
309,
57,
34,
16820,
311,
7836,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
8... | 3.345794 | 107 |
km = float(input('De quantos kilómetros será a viagem? '))
if km <= 200:
print('A viagem custará {:.2f}€ (0.1€/km)'.format(km * 0.1))
else:
print('A visgem custará {:.2f} € (0.09€/km)'.format(km * 0.09))
| [
13276,
796,
12178,
7,
15414,
10786,
5005,
5554,
418,
8769,
10205,
4164,
4951,
1055,
6557,
257,
25357,
363,
368,
30,
705,
4008,
198,
361,
10571,
19841,
939,
25,
198,
220,
220,
220,
3601,
10786,
32,
25357,
363,
368,
9378,
283,
6557,
461... | 2.058252 | 103 |
from django.template.loader import render_to_string
from push_notifications.models import APNSDevice, GCMDevice
from structlog import get_logger
from lego.apps.feeds.models import NotificationFeed
log = get_logger()
| [
6738,
42625,
14208,
13,
28243,
13,
29356,
1330,
8543,
62,
1462,
62,
8841,
198,
198,
6738,
4574,
62,
1662,
6637,
13,
27530,
1330,
3486,
8035,
24728,
11,
20145,
12740,
1990,
501,
198,
6738,
2878,
6404,
1330,
651,
62,
6404,
1362,
198,
19... | 3.384615 | 65 |
"""Users views"""
# Django
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, HttpResponse
# Exceptions
from django.db.utils import IntegrityError
# Models
from django.contrib.auth.models import User
from... | [
37811,
14490,
5009,
37811,
198,
2,
37770,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
11,
17594,
11,
2604,
448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
17594,
62,
35827,
... | 2.656757 | 740 |
from cincan.frontend import ToolImage
| [
6738,
269,
1939,
272,
13,
8534,
437,
1330,
16984,
5159,
628
] | 3.545455 | 11 |
"""The helper functions for the visuals are defined here.
These functions provide textures or modify pygame Surfaces or Rects in ways which
are convenient to use for multiple scenes."""
import pygame
# This dict contains references to all textures which are loaded with get_texture(),
# and functions as a cache. With t... | [
37811,
464,
31904,
5499,
329,
262,
27329,
389,
5447,
994,
13,
198,
4711,
5499,
2148,
20028,
393,
13096,
12972,
6057,
4198,
32186,
393,
48599,
82,
287,
2842,
543,
198,
533,
11282,
284,
779,
329,
3294,
8188,
526,
15931,
198,
11748,
12972,... | 3.31117 | 376 |
import torch
from torch import nn
from torch.nn import functional as F
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198
] | 3.944444 | 18 |
from django.db import models
from django.db.models import Q
class ToggleableModelManager(models.Manager):
"""
For :class:`certego_saas.ext.models.ToggleableModel`.
"""
class AppSpecificModelManager(models.Manager):
"""
For :class:`certego_saas.ext.models.AppSpecificModel`.
"""
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
628,
198,
4871,
34098,
540,
17633,
13511,
7,
27530,
13,
13511,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1114,
1058,
4871,
... | 2.741071 | 112 |
from setuptools import setup
setup(name='focus',
entry_points='''[console_scripts]
focus=focus.cli:main''')
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
37635,
3256,
198,
220,
220,
220,
220,
220,
5726,
62,
13033,
28,
7061,
6,
58,
41947,
62,
46521,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.174603 | 63 |
'''
program: Simple Message Encrypter
author : akr
github : a-k-r-a-k-r
'''
#import necessary modules
import tkinter
import pyperclip
from tkinter import DISABLED,messagebox,BOTH,END
#Defining root window
root=tkinter.Tk()
root.title("Message Encrypter")
root.iconbitmap("resources/icons/encrypter.ico")
... | [
7061,
6,
198,
220,
220,
220,
1430,
25,
17427,
16000,
14711,
563,
42104,
198,
220,
220,
220,
1772,
1058,
257,
38584,
198,
220,
220,
220,
33084,
1058,
257,
12,
74,
12,
81,
12,
64,
12,
74,
12,
81,
198,
7061,
6,
198,
198,
2,
11748,
... | 2.415365 | 768 |
import pandas as pd
import numpy as np
import os
import pickle
import sys
sys.path.append('..')
from sklearn.manifold import TSNE
from sklearn.cluster import KMeans
import seaborn as sns
import matplotlib.pyplot as plt
from pathlib import Path
import logging
import configparser
import argparse
import ui_utils
import... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
492,
11537,
198,
198,
6738,
1341,
35720,
13,
805,
361,
727,
1330,
... | 2.633678 | 1,354 |
#!/usr/bin/env python3
#
##################################################################################
#
# Title : PyDBI.py
# Author : Thomas Cram, tcram@ucar.edu
# Date : 02/06/2015
# Purpose : Python module for MySQL database functions
#
# Work File : $HOME/lib/python/PyDBI.py*
# Test File : $HOME/... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
29113,
29113,
14468,
2235,
198,
2,
198,
2,
220,
220,
220,
220,
11851,
1058,
9485,
35,
3483,
13,
9078,
198,
2,
220,
220,
220,
6434,
1058,
5658,
327,
859,
11,
37096,
859,... | 3.6873 | 937 |
from tatk.policy.mle.crosswoz.mle import MLE | [
6738,
256,
265,
74,
13,
30586,
13,
76,
293,
13,
19692,
86,
8590,
13,
76,
293,
1330,
337,
2538
] | 2.315789 | 19 |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Packager testing global objects and attributes.
Please do not refer to this mod... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
1946,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
198,
2,
5964,
326,
460,
307,
1043,
... | 2.978355 | 693 |
import os
import json
import shutil
import pathlib
ROOT = pathlib.Path(__file__).parent.resolve()
CONFIG_FILE = "config.json"
DEPENDANCY_PATH = "_deps"
COMMON_PATH = "_common"
MULTI_PATH = "_multi"
class ConanFile():
""""""
packages = []
options = []
generators = []
class ConfigFile():
""""""
... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
4423,
346,
198,
11748,
3108,
8019,
198,
198,
13252,
2394,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
13,
411,
6442,
3419,
198,
10943,
16254,
62,
25664,
796,
366,
11250,
13,
1... | 2.31401 | 414 |
import os
from math import pi
from typing import Tuple
import click
import jax
import jax.numpy as jnp
from jax import random
from scipy.optimize import minimize_scalar
from diffbank.bank import Bank
from diffbank.constants import MSUN, C, G
from diffbank.utils import Array, PRNGKeyArray
from diffbank.waveforms.taylo... | [
11748,
28686,
198,
6738,
10688,
1330,
31028,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
3904,
198,
11748,
474,
897,
198,
11748,
474,
897,
13,
77,
32152,
355,
474,
37659,
198,
6738,
474,
897,
1330,
4738,
198,
6738,
629,
541,
... | 2.248527 | 2,036 |
from api_wrapper.census_api.census_api import CensusAPI
import geopandas as gpd
import os
import requests
import io
import zipfile
class CensusBoundaries(CensusAPI):
"""
API wrapper for retrieving census boundary files
Attributes
----------
year: int
The year of census data to be accessed... | [
6738,
40391,
62,
48553,
13,
66,
7314,
62,
15042,
13,
66,
7314,
62,
15042,
1330,
20962,
17614,
198,
11748,
30324,
392,
292,
355,
27809,
67,
198,
11748,
28686,
198,
11748,
7007,
198,
11748,
33245,
198,
11748,
19974,
7753,
628,
198,
4871,
... | 2.205242 | 2,251 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
import cv2
cv2_base_dir = os.path.dirname(os.path.abspath(cv2.__file__))
KEY_ESC = 27
WIN_NAME = "Capture - Face detection"
parser = argparse.ArgumentParser(
description="Code for Cascade Classifier tutorial.")
default_face = os.path.joi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
198,
11748,
269,
85,
17,
198,
198,
33967,
17,
62,
8692,
62,
1590... | 2.256257 | 839 |
import os, glob
import nibabel as nib
import numpy as np
from IPython.display import clear_output
def update_progress(progress, my_str = ''):
"""
Progress bar
"""
bar_length = 20
if isinstance(progress, int):
progress = float(progress)
if not isinstance(progress, float):
progress ... | [
11748,
28686,
11,
15095,
198,
11748,
33272,
9608,
355,
33272,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
6101,
7535,
13,
13812,
1330,
1598,
62,
22915,
628,
198,
4299,
4296,
62,
33723,
7,
33723,
11,
616,
62,
2536,
796,
10148,
2599,
... | 1.979345 | 1,404 |
from ...abc import Expression
from ..value.eventexpr import EVENT
from ..value.eventexpr import KWARGS
from ..value.eventexpr import ARG
from ..value.valueexpr import VALUE
from ..utility.context import CONTEXT
class ITEM(Expression):
"""
Get the item from a dictionary.
There are two forms:
1) Mapping form
!ITEM... | [
6738,
2644,
39305,
1330,
41986,
198,
198,
6738,
11485,
8367,
13,
15596,
31937,
1330,
49261,
198,
6738,
11485,
8367,
13,
15596,
31937,
1330,
509,
16279,
14313,
198,
6738,
11485,
8367,
13,
15596,
31937,
1330,
5923,
38,
198,
6738,
11485,
836... | 2.951691 | 207 |
from django.shortcuts import render, redirect
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import generics
from .models import Machine, Game
from .form import MachineForm, GameForm
from django.db.models import Q
from django.core.paginator import Paginator
from django.views.generic import Te... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
6738,
1334,
62,
30604,
1330,
1152,
873,
198,
6738,
764,
27530,
1330,
10850,
11,
37... | 3.961538 | 156 |
__version__ = "13.0.1"
| [
834,
9641,
834,
796,
366,
1485,
13,
15,
13,
16,
1,
198
] | 1.916667 | 12 |
import os
import stat
import shutil
import subprocess as sp
import tempfile
import re
import datetime as dt
from warnings import warn
import numpy as np
import argparse as ap
__all__ = ["get_job_logfile", "batch_sub", "batch_group", "JobArgumentParser"]
def get_job_logfile():
"""
Generate a path to use for t... | [
11748,
28686,
198,
11748,
1185,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
355,
599,
198,
11748,
20218,
7753,
198,
11748,
302,
198,
11748,
4818,
8079,
355,
288,
83,
198,
6738,
14601,
1330,
9828,
198,
11748,
299,
32152,
355,
45941,
1... | 2.245304 | 7,028 |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.autograd as autograd
import torch.nn.functional as F
import random
import os
from abc import ABC, abstractmethod
class Algorithm(ABC):
"""
Abstract class.
"""
@abstractmethod
@abstractmethod
@abstractmethod
@ab... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
28034,
13,
2306,
519,
6335,
355,
1960,
519,
6335,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
4738,
198,
... | 2.0421 | 2,019 |
import random
######## Test Cases
example = [23171, 21011, 21123, 21366, 21013, 21367]
v_pattern = [40, 30, 20, 10, 20, 30, 40]
simple_desc = [50, 40, 30, 20, 10]
simple_asc = [10, 20, 30, 40, 50]
empty = []
simple = [0, 200000]
two_hills = [30, 20, 22, 24, 26, 28, 20, 10, 0, 2, 4, 7]
max_profit_after_max_and_before... | [
11748,
4738,
628,
198,
198,
7804,
6208,
35536,
198,
20688,
796,
685,
1954,
27192,
11,
2310,
28555,
11,
2310,
10163,
11,
28658,
2791,
11,
2310,
30273,
11,
28658,
3134,
60,
198,
85,
62,
33279,
796,
685,
1821,
11,
1542,
11,
1160,
11,
8... | 2.438 | 500 |
"""Presentation exchange record."""
from os import environ
from typing import Any, Mapping
from marshmallow import fields, validate
from .....messaging.models.base_record import BaseExchangeRecord, BaseExchangeSchema
from .....messaging.valid import UUIDFour
from ..messages.pres import V20Pres
from ..messages.pres_... | [
37811,
34695,
341,
5163,
1700,
526,
15931,
198,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
19720,
1330,
4377,
11,
337,
5912,
198,
198,
6738,
22397,
42725,
1330,
7032,
11,
26571,
198,
198,
6738,
11485,
986,
37348,
3039,
13,
27530,
13,... | 2.171567 | 3,299 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from rapidsms.utils.modules import import_class
from rapidsms.log.mixin import LoggerMixin
class BackendBase(object, LoggerMixin):
"""Base class for outbound backend functionality."""
@classmethod
def find(cls, module_name):
"""
Helper f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
43907,
25,
257,
72,
40379,
28,
19,
39747,
28,
19,
2123,
1509,
28,
19,
198,
198,
6738,
4095,
2340,
907,
13,
26791,
13,
18170,
1330,
1330,
62,
4871,
198,
6738,
4095,
2340,
907,
13... | 2.789398 | 698 |
from greedysnake import GreedySnake, Direction, Signal
import time
import numpy as np
#import curses
from threading import Thread
import subprocess
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from collections import OrderedDict
import random
import configparser
from co... | [
6738,
25474,
893,
77,
539,
1330,
11955,
4716,
49795,
11,
41837,
11,
26484,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
2,
11748,
43878,
198,
6738,
4704,
278,
1330,
14122,
198,
11748,
850,
14681,
198,
11748,
11192,
273,
111... | 3.345679 | 162 |
from abc import ABC, abstractmethod
from typing import Optional, Union
from snuba.utils.metrics.types import Tags
class MetricsBackend(ABC):
"""
An abstract class that defines the interface for metrics backends.
"""
@abstractmethod
@abstractmethod
@abstractmethod
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
32233,
11,
4479,
198,
198,
6738,
3013,
22013,
13,
26791,
13,
4164,
10466,
13,
19199,
1330,
44789,
628,
198,
4871,
3395,
10466,
7282,
437,
7,
24694,
2599,
198,
220,
2... | 3.266667 | 90 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: locking_service.proto
# pylint: skip-file
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
22656,
62,
15271,
13,
1676,
1462,
198,
2,
279,
2645,
600,
25,
14267,
12,... | 2.49644 | 1,545 |
"""Copyright 2012, System Insights, 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 t... | [
37811,
15269,
2321,
11,
4482,
7088,
2337,
11,
3457,
13,
628,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13... | 3.735 | 200 |
# -*- coding: utf-8 -*-
from mockr import run_pandas_job
import pandas as pd
dataframe = pd.read_csv('ages.csv')
results = run_pandas_job(dataframe, map_fn, reduce_fn, n_chunks = 4)
print(results)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
15290,
81,
1330,
1057,
62,
79,
392,
292,
62,
21858,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
7890,
14535,
796,
279,
67,
13,
961,
62,
40664,
10786,
... | 2.337209 | 86 |
# Mobile cloud machine learning (MCML) environment
# Author: Hieunq
import gym
import numpy as np
import xlsxwriter
from xlutils.copy import copy
from gym import spaces
from gym.utils import seeding
from parameters import Parameters
# see parameters.py
parameters = Parameters()
class MCML(gym.Env):
"""
Mobil... | [
2,
12173,
6279,
4572,
4673,
357,
9655,
5805,
8,
2858,
198,
2,
6434,
25,
367,
494,
403,
80,
198,
198,
11748,
11550,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2124,
7278,
87,
16002,
198,
6738,
2124,
75,
26791,
13,
30073,
1330,
4... | 2.568627 | 306 |
# class LLNode:
# def __init__(self, val, next=None):
# self.val = val
# self.next = next
| [
2,
1398,
27140,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1188,
11,
1306,
28,
14202,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2100,
796,
1188,
198,
2,
220,
220,
220,
220,
... | 2 | 55 |
#
# (c) 2019 Kaminario Technologies, Ltd.
#
# This software is licensed solely under the terms of the Apache 2.0 license,
# the text of which is available at http://www.apache.org/licenses/LICENSE-2.0.
# All disclaimers and limitations of liability set forth in the Apache 2.0 license apply.
#
import unittest
from kme... | [
2,
198,
2,
357,
66,
8,
13130,
509,
5669,
4982,
21852,
11,
12052,
13,
198,
2,
198,
2,
770,
3788,
318,
11971,
9944,
739,
262,
2846,
286,
262,
24843,
362,
13,
15,
5964,
11,
198,
2,
262,
2420,
286,
543,
318,
1695,
379,
2638,
1378,
... | 3.068966 | 174 |
AVAILABLE_CODE_SHEETS = [
# in rough order of most to least common
'braille',
'morse',
'semaphore',
'pigpen',
'ipa',
'binary',
'ascii',
'amino',
'nato',
'nautical',
'resistor',
'elements',
'poker',
'greek',
'hebrew',
'japanese',
'scrabble',
'dv... | [
10116,
32,
4146,
17534,
62,
34,
16820,
62,
9693,
36,
32716,
796,
685,
198,
220,
220,
220,
1303,
287,
5210,
1502,
286,
749,
284,
1551,
2219,
198,
220,
220,
220,
705,
16057,
8270,
3256,
198,
220,
220,
220,
705,
4491,
325,
3256,
198,
... | 2.31794 | 2,815 |
from unittest.mock import patch, MagicMock
from axes.backends import AxesBackend
from axes.exceptions import (
AxesBackendRequestParameterRequired,
AxesBackendPermissionDenied,
)
from tests.base import AxesTestCase
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
11,
6139,
44,
735,
198,
198,
6738,
34197,
13,
1891,
2412,
1330,
12176,
274,
7282,
437,
198,
6738,
34197,
13,
1069,
11755,
1330,
357,
198,
220,
220,
220,
12176,
274,
7282,
437,
18453,
363... | 3.169014 | 71 |
import unittest
import riemann.networks as networks
| [
11748,
555,
715,
395,
198,
11748,
374,
26597,
1236,
13,
3262,
5225,
355,
7686,
628
] | 3.533333 | 15 |
from django.conf.urls import url
from dojo.product import views
urlpatterns = [
# product
url(r'^product$', views.product, name='product'),
url(r'^product/(?P<pid>\d+)$', views.view_product,
name='view_product'),
url(r'^product/(?P<pid>\d+)/edit$', views.edit_product,
name='edit_produ... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
198,
6738,
466,
7639,
13,
11167,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
1303,
220,
1720,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
11167,
... | 2.17382 | 466 |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
2,
15069,
357,
66,
8,
13130,
11,
15127,
23929,
44680,
6234,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
284... | 2.443775 | 3,984 |
import os
from urllib.parse import quote_plus
# RULES OF CONFIG:
# 1. No region specific code. Regions are defined by setting the OS environment variables appropriately to build up the
# desired behaviour.
# 2. No use of defaults when getting OS environment variables. They must all be set to the required values prior ... | [
11748,
28686,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
9577,
62,
9541,
198,
198,
2,
371,
6239,
1546,
3963,
25626,
25,
198,
2,
352,
13,
1400,
3814,
2176,
2438,
13,
47089,
389,
5447,
416,
4634,
262,
7294,
2858,
9633,
20431,
284,
13... | 2.287477 | 1,621 |
from datetime import datetime as dt
from test.splitgraph.conftest import (
_mount_elasticsearch,
_mount_mongo,
_mount_mysql,
_mount_postgres,
)
import pytest
from splitgraph.core.repository import Repository
from splitgraph.core.types import TableColumn
from splitgraph.engine import get_engine
from sp... | [
6738,
4818,
8079,
1330,
4818,
8079,
355,
288,
83,
198,
6738,
1332,
13,
35312,
34960,
13,
1102,
701,
395,
1330,
357,
198,
220,
220,
220,
4808,
14948,
62,
417,
3477,
12947,
11,
198,
220,
220,
220,
4808,
14948,
62,
76,
25162,
11,
198,
... | 2.725166 | 302 |
"""
Contains paths to locations on user's system where models and resources are
to be stored. These all live in adeft's home folder which defaults to
a directory "adeft" in a location determined by Python's `appdirs` package.
An alternative location can be specified by setting the environment variable
ADEFT_HOME in the... | [
37811,
198,
4264,
1299,
13532,
284,
7064,
319,
2836,
338,
1080,
810,
4981,
290,
4133,
389,
198,
1462,
307,
8574,
13,
2312,
477,
2107,
287,
512,
68,
701,
338,
1363,
9483,
543,
26235,
284,
198,
64,
8619,
366,
671,
701,
1,
287,
257,
... | 2.88141 | 312 |
from txros import util
from mil_misc_tools import FprintFactory
failed = False
@util.cancellableInlineCallbacks
| [
6738,
27765,
4951,
1330,
7736,
198,
6738,
1465,
62,
44374,
62,
31391,
1330,
376,
4798,
22810,
198,
198,
47904,
796,
10352,
628,
198,
31,
22602,
13,
66,
590,
297,
540,
818,
1370,
14134,
10146,
198
] | 3.285714 | 35 |
import logging
import queue
import random
import threading
import time
from django.utils.functional import cached_property
import requests
from zentral.core.stores.backends.base import BaseEventStore
logger = logging.getLogger('zentral.core.stores.backends.http')
| [
11748,
18931,
198,
11748,
16834,
198,
11748,
4738,
198,
11748,
4704,
278,
198,
11748,
640,
198,
6738,
42625,
14208,
13,
26791,
13,
45124,
1330,
39986,
62,
26745,
198,
11748,
7007,
198,
6738,
1976,
298,
1373,
13,
7295,
13,
43409,
13,
189... | 3.635135 | 74 |
from listRoom import ListRoom
from person import Person
a = ListRoom("testRoom",6, 6)
studentNames = ["Adam","Bertil"] * 18
students = [Person(x, "someTime", "") for x in studentNames]
print(students[1].name)
print(a.cols)
print(a.createSeating(students))
| [
6738,
1351,
41178,
1330,
7343,
41178,
198,
6738,
1048,
1330,
7755,
198,
198,
64,
796,
7343,
41178,
7203,
9288,
41178,
1600,
21,
11,
718,
8,
198,
50139,
36690,
796,
14631,
23159,
2430,
33,
861,
346,
8973,
1635,
1248,
198,
19149,
658,
7... | 2.855556 | 90 |
import json
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError
from django.test import TestCase
from infi.django_http_hooks.hooks.models import Hook, Callback
from infi.django_http_hooks.http_requests import send... | [
11748,
33918,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
11,
4912,
11,
2448,
3411,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
6738,
42625,
14208,
13,
9945... | 3.112069 | 232 |
import os
from pathlib import Path
PALETTE = {
'success': '#00c841',
'info': '#1976a3',
'error': '#d40000'
}
LINE = '-' * 100
ELEMENTS = [1, 0]
DEFAULT_QUANTILE = 0.05
HOME_DIR = str(Path.home())
IPDF_DATADIR = os.getenv('IPDF_DATADIR')
if not IPDF_DATADIR:
IPDF_DATADIR = os.path.join(HOME_DIR, '... | [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
47,
1847,
2767,
9328,
796,
1391,
198,
220,
220,
220,
705,
13138,
10354,
705,
2,
405,
66,
23,
3901,
3256,
198,
220,
220,
220,
705,
10951,
10354,
705,
2,
38108,
64,
18,
3256,... | 2.118812 | 202 |
from unittest import TestCase
from exercicios.ex1039 import calcula_raio
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
4208,
291,
4267,
13,
1069,
940,
2670,
1330,
5204,
64,
62,
430,
952,
628
] | 3.217391 | 23 |
from node import Node
# line = Queue(['tom', 'brown', 'kenzo', 'kim'])
# print(line.head)
| [
6738,
10139,
1330,
19081,
628,
628,
198,
2,
1627,
796,
4670,
518,
7,
17816,
39532,
3256,
705,
33282,
3256,
705,
3464,
10872,
3256,
705,
74,
320,
6,
12962,
198,
2,
3601,
7,
1370,
13,
2256,
8,
198
] | 2.540541 | 37 |
from . import *
# for sents
instance_fields = [
'words', 'word_num',
'piece_idxs', 'attention_masks', 'word_lens',
'entity_label_idxs'
]
batch_fields = [
'words', 'word_num', 'word_mask',
'piece_idxs', 'attention_masks', 'word_lens',
'entity_label_idxs'
]
Instance = namedtuple(... | [
6738,
764,
1330,
1635,
201,
198,
201,
198,
2,
329,
264,
658,
201,
198,
39098,
62,
25747,
796,
685,
201,
198,
220,
220,
220,
705,
10879,
3256,
705,
4775,
62,
22510,
3256,
201,
198,
220,
220,
220,
705,
12239,
62,
312,
34223,
3256,
7... | 2.262032 | 187 |
from mesa import Agent
class TreeCell(Agent):
"""
A tree cell.
Attributes:
x, y: Grid coordinates
condition: Can be "Fine", "On Fire", or "Burned Out"
unique_id: (x,y) tuple.
unique_id isn't strictly necessary here, but it's good
practice to give one to each ... | [
6738,
18842,
64,
1330,
15906,
201,
198,
201,
198,
201,
198,
4871,
12200,
28780,
7,
36772,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
317,
5509,
2685,
13,
201,
198,
201,
198,
220,
220,
220,
49213,
25,
201,
198,
... | 2.135417 | 480 |
import pytest
from math_utils import is_float
| [
11748,
12972,
9288,
198,
6738,
10688,
62,
26791,
1330,
318,
62,
22468,
628,
628,
628,
198
] | 3.25 | 16 |
import codenames
import paths
wordlist = codenames.WordList(
paths.WORDLIST_ENG_PATH,
[paths.DIRECTIONAL_PATH],
[paths.WIKI_100K_PATH, paths.GOOGLE_10K_ENG_PATH, paths.CUSTOM_WHITELIST],
)
board = codenames.Board(wordlist)
view = codenames.CliView(board)
glove = codenames.Glove(*paths.GLOVE_6B_300D_PATH.p... | [
11748,
14873,
268,
1047,
198,
11748,
13532,
628,
198,
4775,
4868,
796,
14873,
268,
1047,
13,
26449,
8053,
7,
198,
220,
220,
220,
13532,
13,
54,
12532,
45849,
62,
26808,
62,
34219,
11,
198,
220,
220,
220,
685,
6978,
82,
13,
17931,
23... | 2.280702 | 171 |
import pytest
from unittest.mock import MagicMock
from datacube_ows.config_utils import OWSConfigNotReady
from datacube_ows.ogc_utils import ConfigException
from datacube_ows.ows_configuration import BandIndex
@pytest.fixture
| [
11748,
12972,
9288,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
198,
6738,
4818,
330,
3266,
62,
1666,
13,
11250,
62,
26791,
1330,
440,
19416,
16934,
3673,
35474,
198,
6738,
4818,
330,
3266,
62,
1666,
13,
519,
66... | 3.178082 | 73 |
import random
import ray
from ray import tune
from ray.tune import CLIReporter
from ray.tune.schedulers import PopulationBasedTraining
from agent0.deepq.config import Config
from agent0.deepq.trainer import Trainer
from agent0.common.utils import parse_arguments
if __name__ == '__main__':
cfg = Config()
kwar... | [
11748,
4738,
198,
198,
11748,
26842,
198,
6738,
26842,
1330,
14009,
198,
6738,
26842,
13,
83,
1726,
1330,
7852,
4663,
538,
4337,
198,
6738,
26842,
13,
83,
1726,
13,
1416,
704,
377,
364,
1330,
20133,
15001,
44357,
198,
198,
6738,
5797,
... | 2.102672 | 711 |
from flask_script import Command
import time
import datetime
import flask
| [
6738,
42903,
62,
12048,
1330,
9455,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
42903,
628
] | 4.411765 | 17 |
from django.contrib import admin
from core import models
# Register your models here.
admin.site.register(models.Tag)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
4755,
1330,
4981,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
27530,
13,
24835,
8,
198
] | 3.606061 | 33 |
# remember that ord('@') trick
| [
198,
2,
3505,
326,
2760,
10786,
31,
11537,
6908,
198
] | 3.2 | 10 |
"""
Programa 052
Área de estudos.
data 23.11.2020 (Indefinida) Hs
@Autor: Abraão A. Silva
"""
maior = int()
for perg in range(1, 6):
numero = int(input(f'Digite o {perg}º número.: '))
if numero > maior:
maior = numero
print(f'O maior valor repassado foi {maior}.')
| [
37811,
198,
15167,
64,
657,
4309,
198,
127,
223,
21468,
390,
1556,
42418,
13,
198,
7890,
2242,
13,
1157,
13,
42334,
220,
220,
220,
220,
357,
5497,
891,
259,
3755,
8,
367,
82,
198,
31,
16541,
273,
25,
2275,
430,
28749,
317,
13,
237... | 2.071942 | 139 |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Defines the iPOPO decorators classes to manipulate component factory classes
:author: Thomas Calmant
:copyright: Copyright 2020, Thomas Calmant
:license: Apache License 2.0
:version: 1.0.1
..
Copyright 2020 Thomas Calmant
Licensed under the Apache Li... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
1377,
14041,
12,
27195,
7656,
25,
41002,
12,
23,
1377,
198,
37811,
198,
7469,
1127,
262,
9736,
3185,
46,
11705,
2024,
6097,
284,
18510,
7515,
8860,
6097,
198,
198,
25,
9800,
25,
5... | 2.456609 | 31,009 |
import cv2
import os
from keras.models import Sequential
from keras.layers import Dense, Conv2D, MaxPooling2D, Dropout, Flatten,BatchNormalization
import time
import numpy as np
import matplotlib.pyplot as plt
import random
from keras.preprocessing.image import ImageDataGenerator
nrClasses = 0
current_ind =... | [
11748,
269,
85,
17,
201,
198,
11748,
28686,
201,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
201,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
11,
34872,
17,
35,
11,
5436,
27201,
278,
17,
35,
11,
14258,
448,
11,
... | 2.296624 | 1,244 |
'''
October 19th 2021.
Kitty Tyree
Olympics database design for cs257 in fall 2021
'''
import csv
# MAP AN ATHLETE ID TO THE ATHLETE'S NAME
# why are we only mapping athlete id to their name? because if they competed
# in multiple games, their weight, and age and other body stats may have changed
# I am n... | [
7061,
6,
198,
220,
220,
220,
3267,
678,
400,
33448,
13,
198,
220,
220,
220,
21168,
7039,
631,
198,
220,
220,
220,
14935,
6831,
1486,
329,
50115,
28676,
287,
2121,
33448,
198,
7061,
6,
198,
198,
11748,
269,
21370,
198,
198,
2,
34645,... | 2.552689 | 2,752 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: deepaffects-realtime.proto
import sys
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_d... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
2769,
2001,
478,
82,
12,
5305,
2435,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
6738,
23645,
13,
11235,
672,
3046,
1330,
43087,
355,
4808... | 2.099236 | 9,029 |