content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django import forms
| [
6738,
42625,
14208,
1330,
5107,
201,
198,
201,
198
] | 3.111111 | 9 |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'tdzf@9g8lofi@lo$=126jrka1ydzjix^!8j)vg$6cd+kz^ei5h'
INSTALLED_APPS = [
'django.contrib.contenttypes',
'tests'
]
test_db = os.environ.get('TE... | [
11748,
28686,
198,
198,
2,
10934,
13532,
2641,
262,
1628,
588,
428,
25,
28686,
13,
6978,
13,
22179,
7,
33,
11159,
62,
34720,
11,
2644,
8,
198,
33,
11159,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
1590... | 2.082447 | 376 |
import torch.nn as nn
import torch.nn.functional as F
from .layers import GraphConvolution
| [
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
764,
75,
6962,
1330,
29681,
3103,
85,
2122,
628
] | 3.407407 | 27 |
from django.db import models
# class Person(models.Model):
# name = models.CharField(max_length=50)
# age = models.IntegerField()
# city = models.CharField(max_length=50)
# rating = models.IntegerField()
#
#
# class PersonalData(models.Model):
# name = models.CharField(max_length=50)
# mail ... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
628,
198,
2,
1398,
7755,
7,
27530,
13,
17633,
2599,
198,
2,
220,
220,
220,
220,
1438,
796,
4981,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
1120,
8,
198,
2,
220,
220,
220,
220,
2479,
... | 2.502041 | 245 |
import logging
import traceback
import sys
from .processor_work_manager import ProcessorWorkManager
class ProcessorWorker:
"""Process worker class"""
def run(self):
"""Run worker"""
while self._running:
try:
self.process()
except Exception as ex:
... | [
11748,
18931,
198,
11748,
12854,
1891,
198,
11748,
25064,
198,
198,
6738,
764,
41341,
62,
1818,
62,
37153,
1330,
32893,
12468,
13511,
198,
198,
4871,
32893,
12468,
263,
25,
198,
220,
220,
220,
37227,
18709,
8383,
1398,
37811,
628,
220,
... | 2.38 | 250 |
from email.charset import QP
from serial import Serial
from serial.tools.list_ports import comports
qPort = None
for p in list(comports()):
if p.product and 'FT232R' in p.product:
qPort = p.device
break
if not qPort:
raise Exception('No Quiet Board found')
quite = Serial(qPort, 5760... | [
6738,
3053,
13,
354,
945,
316,
1330,
1195,
47,
198,
6738,
11389,
1330,
23283,
198,
6738,
11389,
13,
31391,
13,
4868,
62,
3742,
1330,
552,
2096,
628,
198,
80,
13924,
796,
6045,
198,
1640,
279,
287,
1351,
7,
785,
3742,
3419,
2599,
220... | 2.45283 | 212 |
from setuptools import setup, find_packages
long_description = (
open("README.rst", encoding="utf-8").read()
+ "\n\n"
+ open("CHANGES.rst", encoding="utf-8").read()
)
setup(
name="more.body_model",
version="0.1dev0",
description="load_json infrastructure for Morepath",
long_description=lon... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
6511,
62,
11213,
796,
357,
198,
220,
220,
220,
1280,
7203,
15675,
11682,
13,
81,
301,
1600,
21004,
2625,
40477,
12,
23,
11074,
961,
3419,
198,
220,
220,
220,
1343,
... | 2.321361 | 529 |
from flask import abort
from flask_restful_swagger_3 import Resource, swagger
from flask_jwt_extended import jwt_required
from models.message import Messages, MessagesComment, MessagesUser
from models.user import silence_user_fields
from database.manager import db
| [
6738,
42903,
1330,
15614,
198,
6738,
42903,
62,
2118,
913,
62,
2032,
7928,
62,
18,
1330,
20857,
11,
1509,
7928,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
474,
46569,
62,
35827,
198,
6738,
4981,
13,
20500,
1330,
43534,
11,... | 4.015152 | 66 |
# Teary Expression (6508)
from net.swordie.ms.enums import Stat
camilla = 1012108
rubble = 4000022
ouch = 5160024
# Grab current fame for quest-induced defame later
fame = chr.getStat(Stat.pop)
sm.setSpeakerID(camilla)
sm.sendNext(''.join(["Hello. Is there something I can... Eeek! "
"Is that #t", repr(rubble), "#?... | [
2,
309,
451,
88,
41986,
357,
17544,
23,
8,
198,
198,
6738,
2010,
13,
30553,
494,
13,
907,
13,
268,
5700,
1330,
5133,
198,
198,
20991,
5049,
796,
8949,
17,
15711,
198,
198,
25089,
903,
796,
604,
2388,
1828,
198,
7673,
796,
642,
361... | 2.479866 | 298 |
from import_export import resources
from import_export.admin import ImportExportModelAdmin
# from import_export.admin import ImportExportActionModelAdmin
from django.contrib import admin
from .models import TimePost, Client, Project
# admin.site.register(TimePost)
@admin.register(TimePost)
# class TimePostAdmin(Imp... | [
6738,
1330,
62,
39344,
1330,
4133,
198,
6738,
1330,
62,
39344,
13,
28482,
1330,
17267,
43834,
17633,
46787,
198,
2,
422,
1330,
62,
39344,
13,
28482,
1330,
17267,
43834,
12502,
17633,
46787,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
... | 3.669643 | 112 |
from __future__ import print_function
from builtins import range
from builtins import object
import scipy.interpolate as interp
import numpy as np
import pdb
"""
This module calculates the galaxy and intrinsic alignment bias
using the flexible grid parameterisation of Joachimi and Bridle
(2010) p 6-9.
Outputs both sto... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
3170,
1040,
1330,
2837,
198,
6738,
3170,
1040,
1330,
2134,
198,
11748,
629,
541,
88,
13,
3849,
16104,
378,
355,
987,
79,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
279,
99... | 3.441441 | 111 |
import psycopg2
import re
from backend.mg import MGBackend
'''
@author: anant bhardwaj
@date: Oct 3, 2013
DataHub DB wrapper for backends (only postgres implemented)
Any new backend must implement the DataHubConnection interface
'''
class DataHubConnection:
'''
The following methods works only in superuser mo... | [
11748,
17331,
22163,
70,
17,
198,
11748,
302,
198,
198,
6738,
30203,
13,
11296,
1330,
337,
4579,
441,
437,
198,
198,
7061,
6,
198,
31,
9800,
25,
281,
415,
275,
10424,
86,
1228,
198,
31,
4475,
25,
2556,
513,
11,
2211,
198,
198,
660... | 3.357143 | 98 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from debug_toolbar.panels import Panel
from django.utils.translation import ugettext_lazy as _, ungettext
import requests.sessions
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
14257,
62,
25981,
5657,
13,
6839,
1424,
1330,
18810,
198,
6738,
42625,
14208,
13,
26791,
13,
... | 3.030303 | 66 |
from models.villain.villain import Villain
| [
6738,
4981,
13,
41082,
391,
13,
41082,
391,
1330,
9757,
391,
201,
198,
201,
198
] | 3.066667 | 15 |
t_carros = ("HRV", "Golf", "Argo")#tupla, não pode alterar o valor
l_carros = list(t_carros)
l_carros[2] = "Focus"
t_carros = tuple(l_carros)
for x in t_carros:
print(x)
input()#lista fica aberta | [
83,
62,
7718,
4951,
796,
5855,
17184,
53,
1600,
366,
38,
4024,
1600,
366,
3163,
2188,
4943,
2,
28047,
489,
64,
11,
299,
28749,
279,
1098,
8343,
283,
267,
1188,
273,
198,
75,
62,
7718,
4951,
796,
1351,
7,
83,
62,
7718,
4951,
8,
1... | 2.030303 | 99 |
#!/usr/bin/env python3
# Copyright 2022 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Utils for accessing Linux device information."""
import re
from typing impor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
33160,
383,
314,
11587,
46665,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
410,
17,
13,
15,
351,
27140,
15996,
1475,
11755,
13,
198,
2,
4091,
3740,
1378,
297,
14761,... | 2.604502 | 622 |
input = """nop +116
acc +12
acc -8
acc +34
jmp +485
acc +42
jmp +388
acc +36
nop +605
acc +17
jmp +411
acc +49
jmp +1
acc -9
jmp +289
jmp +288
jmp +74
acc +4
acc +42
jmp +258
acc +14
acc -13
nop +106
jmp +280
jmp +534
acc +41
acc +40
jmp +224
acc +43
acc +10
nop +240
jmp +211
acc +7
acc... | [
15414,
796,
37227,
77,
404,
1343,
18298,
201,
198,
4134,
1343,
1065,
201,
198,
4134,
532,
23,
201,
198,
4134,
1343,
2682,
201,
198,
73,
3149,
1343,
32642,
201,
198,
4134,
1343,
3682,
201,
198,
73,
3149,
1343,
30460,
201,
198,
4134,
... | 1.693945 | 3,947 |
# -*- encoding: utf-8 -*-
# Copyright (c) 2020 Dantali0n
#
# 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 ... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
12131,
360,
415,
7344,
15,
77,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
... | 3.564607 | 356 |
from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
| [
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
869,
62,
21812,
198,
6738,
42625,
14208,
13,
9945,
13,
26791,
1330,
6564,
864,
12331,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208... | 3.613636 | 44 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# RaiBlocks Telegram bot
# @RaiWalletBot https://t.me/RaiWalletBot
#
# Source code:
# https://github.com/SergiySW/RaiWalletBot
#
# Released under the BSD 3-Clause License
#
#
# Run by cron every hour, 1-2 minutes after distribution starts
# With new rules it can be in... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
42954,
45356,
50203,
10214,
198,
2,
2488,
49,
1872,
47152,
20630,
3740,
1378,
83,
13,
1326,
14,
49,
1872,
... | 2.875 | 424 |
# TODO: check https://en.wikipedia.org/wiki/Earley_parser
data = '''
0: 1 2 3
1: "a"
2: "b"
3: 1 1 4 2
4: 1 | 2
abaabb
baaabb
ababab
abaaab
abaabb
abaabc'''.strip()
def solve(rules, message):
"""check whether message matches r"""
queue = [(0, ['0'])]
while queue:
position, (rule, *following... | [
198,
2,
16926,
46,
25,
2198,
3740,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
8419,
1636,
62,
48610,
198,
198,
7890,
796,
705,
7061,
198,
15,
25,
352,
362,
513,
198,
16,
25,
366,
64,
1,
198,
17,
25,
366,
65,
1,
198,
18,
... | 2.19554 | 583 |
#todo / schedule/ internet connection
#todo instabot.log at api.py / instabot started at bot.py
#todo set follow followers count limit
#generate random number at server send to apps
#both check
import os
import random
import shutil
import sys
import time
import threading
import errno
import requests
... | [
2,
83,
24313,
1220,
7269,
14,
5230,
4637,
201,
198,
2,
83,
24313,
916,
397,
313,
13,
6404,
379,
40391,
13,
9078,
1220,
916,
397,
313,
2067,
379,
10214,
13,
9078,
201,
198,
2,
83,
24313,
900,
1061,
10569,
954,
4179,
201,
198,
2,
... | 2.576471 | 765 |
#!/usr/bin/python3
import subprocess,sys
## Rules
#I1 = ['''-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT''','''-A OUTPUT -j REJECT''']
I1 = ['''ufw-not-local -j DROP'''] #For testing purposes
B1 = ['''-A INPUT -p tcp --dport 53 -j DROP''']
B2 = ['''-A INPUT -p icmp -j REJECT --reject-with icmp-port-unreach... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
850,
14681,
11,
17597,
198,
198,
2235,
14252,
198,
2,
40,
16,
796,
685,
7061,
29001,
32,
16289,
30076,
532,
76,
1181,
1377,
5219,
29749,
11617,
11,
1546,
5603,
9148,
18422,
1961,
... | 2.4 | 160 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
root = TreeNode(1)
root.left = TreeNode(2)
root.right = TreeNode(3)
solution = Solution()
ans = solution.pathSum(root, 4)
for i in range(len(ans)):
print(ans[i])
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
15763,
796,
12200,
19667,
7,
16,
8,
198,
15763,
13,
9464,
796,
12200,
19667,
7,
17,
8,
198,
15763,
13,
3506,
796,
122... | 2.322222 | 90 |
import countries
import e404
import index
import search
import static_files
import timeline
if __name__ == "__main__":
run()
| [
11748,
2678,
201,
198,
11748,
304,
26429,
201,
198,
11748,
6376,
201,
198,
11748,
2989,
201,
198,
11748,
9037,
62,
16624,
201,
198,
11748,
15264,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
2... | 2.895833 | 48 |
# Copyright (c) 2021 Delbert Yip
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import os
import logging
import pandas as pd
from pathlib import Path
from typing import Dict, Any, List
import GeneralProcess.base as base
from GeneralProcess.ephys_info_filter import EphysIn... | [
2,
15069,
357,
66,
8,
33448,
4216,
4835,
575,
541,
198,
2,
198,
2,
770,
3788,
318,
2716,
739,
262,
17168,
13789,
13,
198,
2,
3740,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
36393,
198,
198,
11748,
28686,
198,
11748,
18931,
1... | 2.350137 | 2,182 |
# -*- coding: utf-8 -*-
from .cost_breakdown import CostBreakdown
from .manufacturing_expense import ManufacturingExpense
from .stock import Stock
from .factory import TableAdaptorFactory
from .me2 import ManufacturingExpense2
from .product_price import ProductPrice
from .product_cost import ProductCost
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
764,
15805,
62,
9032,
2902,
1330,
6446,
31737,
2902,
198,
6738,
764,
48119,
870,
62,
11201,
1072,
1330,
32760,
16870,
1072,
198,
6738,
764,
13578,
1330,
10500,
... | 3.731707 | 82 |
from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_processing_mode import (
v3ProcessingMode as v3ProcessingMode_,
)
__all__ = ["v3ProcessingMode"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
277,
71,
343,
13,
37540,
13,
27160,
316,
1330,
11052,
7248,
355,
4808,
11395,
7248,
198,
198,
6738,
267,
2840,
62,
69,
71,
343,
13,
26791,
1330,
11052,
7248,
628,
198,
6738,
267,
2840,
... | 2.701923 | 208 |
from django.contrib import admin
from .models import Post,ReviewRating
# Register your models here.
admin.site.register(Post)
admin.site.register(ReviewRating) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
2947,
11,
14832,
29321,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
28482,
13,
15654,
13,
30238,
7,
6307,
8,
198,
28482,
13,
15654,
13,
30238,
7,
148... | 3.577778 | 45 |
import joblib
from wickedhot import OneHotEncoder
from cd4ml.train import get_trained_model
from cd4ml.model_utils import get_target_id_features_lists
import logging
import mlflow.sklearn
import mlflow
import os
from cd4ml.utils.utils import mini_batch_eval
| [
11748,
1693,
8019,
198,
6738,
20589,
8940,
1330,
1881,
21352,
27195,
12342,
198,
6738,
22927,
19,
4029,
13,
27432,
1330,
651,
62,
35311,
62,
19849,
198,
6738,
22927,
19,
4029,
13,
19849,
62,
26791,
1330,
651,
62,
16793,
62,
312,
62,
4... | 3.25 | 80 |
# -*- coding: utf-8 -*-
"""Parses the ranking CSVs and writes them to the database."""
import csv
import logging
import os
import sys
from datetime import datetime, timezone
from functools import lru_cache
from itertools import groupby
from pathlib import Path
import pandas as pd
from django.core.management.base i... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
47,
945,
274,
262,
12759,
9429,
23266,
290,
6797,
606,
284,
262,
6831,
526,
15931,
198,
198,
11748,
269,
21370,
198,
11748,
18931,
198,
11748,
28686,
198,
11... | 2.415064 | 1,248 |
import json
import logging
import os
import threading
import uuid
import grpc
from event_store_pb2 import PublishRequest, SubscribeRequest, UnsubscribeRequest, GetRequest
from event_store_pb2_grpc import EventStoreStub
EVENT_STORE_HOSTNAME = os.getenv('EVENT_STORE_HOSTNAME', 'localhost')
EVENT_STORE_PORTNR = os.gete... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4704,
278,
198,
11748,
334,
27112,
198,
198,
11748,
1036,
14751,
198,
198,
6738,
1785,
62,
8095,
62,
40842,
17,
1330,
8525,
1836,
18453,
11,
19808,
18453,
11,
791,
7266,
12... | 2.240701 | 1,882 |
import re
from typing import Optional
def normalize_field_name(name: str, leading_undescores_prefix: Optional[str] = None) -> str:
"""
Normalize a string to take a Pythonic form.
Normalize a string to take a Pythonic form by:
- replacing leading underscores with a given (optional) prefix
- conver... | [
11748,
302,
198,
6738,
19720,
1330,
32233,
628,
198,
4299,
3487,
1096,
62,
3245,
62,
3672,
7,
3672,
25,
965,
11,
3756,
62,
917,
3798,
2850,
62,
40290,
25,
32233,
58,
2536,
60,
796,
6045,
8,
4613,
965,
25,
198,
220,
220,
220,
37227... | 2.813984 | 758 |
#!/usr/bin/env python3
from math import pi
from multiprocessing import Pool
from tempfile import NamedTemporaryFile
from subprocess import call, DEVNULL
import time
import os
import os.path as path
from shared import update_progress, plot_data
baseflags = ['--interpolate=linear', '--enable-weights']
config = {
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
10688,
1330,
31028,
198,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
198,
6738,
20218,
7753,
1330,
34441,
12966,
5551,
8979,
198,
6738,
850,
14681,
1330,
869,
11,
5550,
53,
... | 2.607143 | 224 |
#!/usr/bin/env python3
import random
for i in range(100000):print(chr(9585+random.randint(0,1)), end="")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
4738,
198,
1640,
1312,
287,
2837,
7,
3064,
830,
2599,
4798,
7,
354,
81,
7,
24,
38905,
10,
25120,
13,
25192,
600,
7,
15,
11,
16,
36911,
886,
2625,
4943,
198
] | 2.465116 | 43 |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Zyxel.ZyNOS.get_switchport
# ---------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# -----------------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
30934,
198,
2,
1168,
28391,
417,
13,
57,
88,
45,
2640,
13,
1136,
62,
31943,
634,
198,
2,
16529,
30934,
198,
2,
15069,
357,
34,
8,
4343,
12,
4626,
383,
39... | 4.53271 | 107 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
if __name__ == '__main__':
a = 077
b = a | 3
print 'a | b = %d' % b
b |= 7
print 'a|b=%d' % b
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
257,
796,
657,
3324,
198,
220,
220,
220,
275... | 1.784091 | 88 |
import sys, operator
sys.path.append('..')
from scipy.ndimage.morphology import binary_fill_holes
from configuration import Configuration
from dataset.reader import *
from dataset.folder import TrainFolder
from utility.draw import *
from net.lib.nms.cython_nms.cython_nms import cython_nms
from net.layer.mask import in... | [
11748,
25064,
11,
10088,
198,
198,
17597,
13,
6978,
13,
33295,
10786,
492,
11537,
198,
6738,
629,
541,
88,
13,
358,
9060,
13,
24503,
1435,
1330,
13934,
62,
20797,
62,
28439,
198,
6738,
8398,
1330,
28373,
198,
6738,
27039,
13,
46862,
1... | 2.232575 | 1,363 |
import cv2
import keras
from keras.applications.imagenet_utils import preprocess_input
from keras.backend.tensorflow_backend import set_session
from keras.models import Model
from keras.preprocessing import image
import matplotlib.pyplot as plt
import numpy as np
from scipy.misc import imread
import tensorflow as tf
i... | [
11748,
269,
85,
17,
198,
11748,
41927,
292,
198,
6738,
41927,
292,
13,
1324,
677,
602,
13,
320,
11286,
316,
62,
26791,
1330,
662,
14681,
62,
15414,
198,
6738,
41927,
292,
13,
1891,
437,
13,
83,
22854,
11125,
62,
1891,
437,
1330,
900... | 2.956989 | 279 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libtree(CMakePackage):
"""ldd as a tree with an option to bundle dependencies into a
... | [
2,
15069,
2211,
12,
1238,
2481,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.127424 | 1,083 |
import psycopg2
# Redownloading the models is a pain, maybe a better solution is to keep the models on the ram and transfer back and forth from video card | [
11748,
17331,
22163,
70,
17,
628,
220,
220,
220,
1303,
2297,
593,
25138,
262,
4981,
318,
257,
2356,
11,
3863,
257,
1365,
4610,
318,
284,
1394,
262,
4981,
319,
262,
15770,
290,
4351,
736,
290,
6071,
422,
2008,
2657
] | 4.076923 | 39 |
from django.urls import path, include # new
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
1303,
649,
198
] | 3.384615 | 13 |
# TODO: Utils ? like load so we don't duplicate code ?
from unittest import TestCase
from unittest.mock import patch
import pytest
from ruamel.yaml import YAML
from yaml import SafeLoader
from conda_vendor.env_yaml_from_manifest import YamlFromManifest
@pytest.fixture
| [
2,
16926,
46,
25,
7273,
4487,
5633,
588,
3440,
523,
356,
836,
470,
23418,
2438,
5633,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
11748,
12972,
9288,
198,
6738,
7422,
179... | 3.01087 | 92 |
cont=0
while cont<5:
print(cont)
cont=cont+1
else:
print('o loop while foi encerrado com sucesso.')
| [
3642,
28,
15,
198,
4514,
542,
27,
20,
25,
198,
220,
220,
220,
3601,
7,
3642,
8,
198,
220,
220,
220,
542,
28,
3642,
10,
16,
198,
17772,
25,
198,
220,
220,
220,
3601,
10786,
78,
9052,
981,
11511,
72,
551,
2189,
81,
4533,
401,
42... | 2.196078 | 51 |
"""
Spire library and API version.
"""
SPIRE_VERSION = "0.4.0"
| [
37811,
198,
4561,
557,
5888,
290,
7824,
2196,
13,
198,
37811,
198,
198,
4303,
41736,
62,
43717,
796,
366,
15,
13,
19,
13,
15,
1,
198
] | 2.461538 | 26 |
import tensorflow as tf
import utils
| [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
3384,
4487,
628,
628,
628
] | 3.230769 | 13 |
import pickle
import os
import shutil
class File_Operation:
"""This class shall be used to save the model after training and load the saved model for prediction."""
def save_model(self,model,filename):
"""
Method Name: save_model
Description: Save the model file to ... | [
11748,
2298,
293,
201,
198,
11748,
28686,
201,
198,
11748,
4423,
346,
201,
198,
201,
198,
201,
198,
4871,
9220,
62,
32180,
25,
201,
198,
220,
220,
220,
37227,
1212,
1398,
2236,
307,
973,
284,
3613,
262,
2746,
706,
3047,
290,
3440,
2... | 2.009624 | 2,286 |
from rest_framework import serializers
from roda_purchase import models
'''Aqui é onde transformamos dados em um formato que pode ser armazenado ou transmitido''' | [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
686,
6814,
62,
79,
18737,
1330,
4981,
628,
198,
7061,
6,
32,
421,
72,
38251,
319,
2934,
6121,
321,
418,
9955,
418,
795,
23781,
1296,
5549,
8358,
279,
1098,
1055,
3211,
1031,
268,
... | 3.346939 | 49 |
import setuptools
long_description = "Check full documentation [here](https://github.com/pptx704/torpedo)"
setuptools.setup(
name="mailtorpedo",
version="1.1.0",
author="Rafeed M. Bhuiyan",
author_email="rafeedm.bhuiyan@gmail.com",
description="A Python package for sending personalized emails usin... | [
11748,
900,
37623,
10141,
198,
198,
6511,
62,
11213,
796,
366,
9787,
1336,
10314,
685,
1456,
16151,
5450,
1378,
12567,
13,
785,
14,
381,
17602,
32869,
14,
13165,
9124,
78,
16725,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
220,
2... | 2.562327 | 361 |
import six
from oct.core.exceptions import OctConfigurationError
from oct.results.output import output
from oct.results.models import db, set_database
from oct.utilities.configuration import configure, get_db_uri
| [
11748,
2237,
198,
6738,
19318,
13,
7295,
13,
1069,
11755,
1330,
2556,
38149,
12331,
198,
198,
6738,
19318,
13,
43420,
13,
22915,
1330,
5072,
198,
6738,
19318,
13,
43420,
13,
27530,
1330,
20613,
11,
900,
62,
48806,
198,
6738,
19318,
13,
... | 3.857143 | 56 |
"""
In a row of trees, the i-th tree produces fruit with type tree[i].
You start at any tree of your choice, then repeatedly perform the following steps:
Add one piece of fruit from this tree to your baskets. If you cannot, stop.
Move to the next tree to the right of the current tree. If there is no tree to the rig... | [
37811,
198,
818,
257,
5752,
286,
7150,
11,
262,
1312,
12,
400,
5509,
11073,
8234,
351,
2099,
5509,
58,
72,
4083,
198,
198,
1639,
923,
379,
597,
5509,
286,
534,
3572,
11,
788,
7830,
1620,
262,
1708,
4831,
25,
198,
198,
4550,
530,
3... | 3.033003 | 606 |
import time
import numpy as np
import pytest
from neuraxle.base import BaseStep, ExecutionContext
from neuraxle.data_container import DataContainer, AbsentValuesNullObject
from neuraxle.distributed.streaming import SequentialQueuedPipeline, ParallelQueuedFeatureUnion, QueueJoiner
from neuraxle.hyperparams.space impor... | [
11748,
640,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
198,
6738,
11943,
897,
293,
13,
8692,
1330,
7308,
8600,
11,
37497,
21947,
198,
6738,
11943,
897,
293,
13,
7890,
62,
34924,
1330,
6060,
29869,
11,
49274,
... | 3.135135 | 222 |
import string
cipheren = dict(zip(list(string.ascii_lowercase), string.ascii_lowercase[::-1]))
cipherde = dict(zip(string.ascii_lowercase[::-1], list(string.ascii_lowercase)))
| [
11748,
4731,
198,
66,
541,
258,
918,
796,
8633,
7,
13344,
7,
4868,
7,
8841,
13,
292,
979,
72,
62,
21037,
7442,
828,
4731,
13,
292,
979,
72,
62,
21037,
7442,
58,
3712,
12,
16,
60,
4008,
198,
66,
10803,
2934,
796,
8633,
7,
13344,
... | 2.478873 | 71 |
from dolfin import *
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as s
eps = 0.3
g = 0.0
w0 = 0.8
dt = 1e-5
gamma = 1.0
file = File('./test.pvd')
eps = 0.3
g = 0.0
w0 = 0.8
dt = 0.01
gamma = 1.0
img = plt.imread("./img/newton.jpeg")/256
(Nx, Ny) = img.shape
print(img)
L = 100
x = np.l... | [
6738,
288,
4024,
259,
1330,
1635,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
3849,
16104,
378,
355,
264,
198,
198,
25386,
796,
657,
13,
18,
198,
70... | 2.054087 | 832 |
from kw6.reader import Reader
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("kw6").version
except DistributionNotFound:
pass
| [
6738,
479,
86,
21,
13,
46862,
1330,
25342,
198,
198,
6738,
279,
10025,
62,
37540,
1330,
651,
62,
17080,
3890,
11,
27484,
3673,
21077,
198,
28311,
25,
198,
220,
220,
220,
11593,
9641,
834,
796,
651,
62,
17080,
3890,
7203,
46265,
21,
... | 3.375 | 56 |
from __future__ import division
from matplotlib import pyplot as plt
import numpy as np
na = np.newaxis
from scipy.interpolate import griddata
import simplex, dirichlet, sampling, tests, density, timing
allfigfuncs = []
SAVING = True
# plt.interactive(False)
#################################
# Figure-Generating Fun... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
2616,
796,
45941,
13,
3605,
22704,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
1036,
... | 2.611969 | 518 |
"""
* Project Name: NAD-Logging-Service
* File Name: exception_test.py
* Programmer: Kai Prince
* Date: Sun, Nov 15, 2020
* Description: This file contains exception tests for the Logger app.
"""
import pytest
from .sample_data import exception_logs as sample_logs
@pytest.mark.parametrize("data", sample_logs)... | [
37811,
198,
1635,
4935,
6530,
25,
49204,
12,
11187,
2667,
12,
16177,
198,
1635,
9220,
6530,
25,
6631,
62,
9288,
13,
9078,
198,
1635,
6118,
647,
25,
22091,
9005,
198,
1635,
7536,
25,
3825,
11,
5267,
1315,
11,
12131,
198,
1635,
12489,
... | 2.752101 | 238 |
from typing import Optional, Dict, Any
from pyoembed import oEmbed, PyOembedException
import json
| [
6738,
19720,
1330,
32233,
11,
360,
713,
11,
4377,
198,
6738,
279,
8226,
20521,
1330,
267,
31567,
276,
11,
9485,
46,
20521,
16922,
198,
11748,
33918,
198
] | 3.62963 | 27 |
# Copyright 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
2,
15069,
12131,
8180,
10501,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 2.927438 | 3,087 |
from django.db import models
from addons.models import Category
import amo
import mkt
from mkt.webapps.models import Webapp
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
751,
684,
13,
27530,
1330,
21743,
198,
198,
11748,
716,
78,
198,
198,
11748,
285,
21841,
198,
6738,
285,
21841,
13,
12384,
18211,
13,
27530,
1330,
5313,
1324,
628,
628
] | 3.25 | 40 |
import pyqrcode
import png
from pyqrcode import QRCode
# Text which is to be converted to QR code
print("Enter text to convert")
s = input(": ")
# Name of QR code png file
print("Enter image name to save")
n = input(": ")
# Adding extension as .pnf
d = n + ".png"
# Creating QR code
url = pyqrcode.create(s)
# Saving QR... | [
11748,
12972,
80,
6015,
1098,
198,
11748,
279,
782,
198,
6738,
12972,
80,
6015,
1098,
1330,
1195,
7397,
1098,
198,
198,
2,
8255,
543,
318,
284,
307,
11513,
284,
42137,
2438,
198,
4798,
7203,
17469,
2420,
284,
10385,
4943,
198,
82,
796... | 2.776119 | 134 |
def log(funct):
"""
Logs the function.
"""
return wrapper
@log # decorator
if __name__ == '__main__':
f = log(multiply) # process and return `multipy` function.
print(f(2,5))
print(add(10, 7))
| [
4299,
2604,
7,
12543,
310,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5972,
82,
262,
2163,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1441,
29908,
198,
198,
31,
6404,
220,
220,
220,
1303,
11705,
1352,
198,
198,
3... | 2.230769 | 104 |
from _rawffi import alt as _ffi
import _rawffi
import weakref
import sys
SIMPLE_TYPE_CHARS = "cbBhHiIlLdfguzZqQPXOv?"
from _ctypes.basics import (
_CData, _CDataMeta, cdata_from_address, CArgObject, sizeof)
from _ctypes.builtin import ConvMode
from _ctypes.array import Array, byteorder
from _ctypes.pointer import... | [
6738,
4808,
1831,
487,
72,
1330,
5988,
355,
4808,
487,
72,
198,
11748,
4808,
1831,
487,
72,
198,
11748,
4939,
5420,
198,
11748,
25064,
198,
198,
48913,
16437,
62,
25216,
62,
3398,
27415,
796,
366,
21101,
33,
71,
17250,
33666,
43,
7568... | 1.930664 | 1,024 |
# -*- coding: utf-8 -*-
import os
import sys
import signal
import cassandra.cluster as cassandra_cluster
import tempfile
import testing.cassandra3
from mock import patch
from time import sleep
from shutil import rmtree
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
6737,
198,
11748,
30606,
15918,
13,
565,
5819,
355,
30606,
15918,
62,
565,
5819,
198,
11748,
20218,
7753,
198,
11748,
485... | 2.961905 | 105 |
from typing import Union, Tuple, List, Dict, Any
from easydict import EasyDict
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from ding.utils import SequenceType, REWARD_MODEL_REGISTRY
from ding.model import FCEncoder, ConvEncoder
from .base_reward_model i... | [
6738,
19720,
1330,
4479,
11,
309,
29291,
11,
7343,
11,
360,
713,
11,
4377,
198,
6738,
2562,
11600,
1330,
16789,
35,
713,
198,
198,
11748,
4738,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
4008... | 3.24 | 150 |
# ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | [
2,
38093,
25609,
855,
198,
2,
15069,
1853,
14757,
9847,
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,
... | 4.246377 | 345 |
from operator import attrgetter
from PyQt5.QtCore import Qt, QRectF, QAbstractAnimation, QPropertyAnimation, QEasingCurve
from PyQt5.QtGui import QPen, QBrush, QColor, QPainter, QFont, QFontMetricsF, QTransform
from PyQt5.QtWidgets import QGraphicsObject, QGraphicsView, QSizePolicy, QGraphicsScene
from marker_mixin i... | [
6738,
10088,
1330,
708,
81,
1136,
353,
198,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
33734,
11,
42137,
478,
37,
11,
1195,
23839,
39520,
11,
1195,
21746,
39520,
11,
1195,
36,
2313,
26628,
303,
198,
6738,
9485,
48,
83,
... | 2.905983 | 117 |
#!/usr/bin/env python3
'''
dataedit.py
menu password edit for passworddongle.py
'''
import time
import random
import getpass
import json
# all printable ascii chars, plus space, except double quote, tab, backslash
mychars="`aZ0+nM<bY1!oL>cX2@pK;dW3#qJ:eV4$rI'fU5%sH[gT6^tG]hS7&uF{iR8*vE}jQ9(wD-kP,)xC=lO.~yB_mN/ zA"
my... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
7061,
6,
198,
7890,
19312,
13,
9078,
198,
26272,
9206,
4370,
329,
9206,
67,
506,
293,
13,
9078,
198,
7061,
6,
198,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
651,
6603,
198,
... | 1.651479 | 1,690 |
import unittest
if __name__ == "__main__":
unittest.main() | [
198,
198,
11748,
555,
715,
395,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419
] | 2.310345 | 29 |
end
print factorial(5) # should output 120
| [
437,
198,
198,
4798,
1109,
5132,
7,
20,
8,
220,
220,
1303,
815,
5072,
7982,
198
] | 2.875 | 16 |
from __future__ import annotations
import signal
import subprocess
from time import sleep
from typing import Optional, Union, Tuple
from PIL.Image import Image
from pyautogui import hotkey
from sleuthdeck.deck import Action
from sleuthdeck.deck import ClickType
from sleuthdeck.deck import Key
from sleuthdeck.deck imp... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
11748,
6737,
198,
11748,
850,
14681,
198,
6738,
640,
1330,
3993,
198,
6738,
19720,
1330,
32233,
11,
4479,
11,
309,
29291,
198,
198,
6738,
350,
4146,
13,
5159,
1330,
7412,
198,
6738,
12972,
2306... | 3.725806 | 124 |
# Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Imports from this application
from app import app
# 1 column layout
# https://dash-bootstrap-components.opensource... | [
2,
1846,
3742,
422,
513,
4372,
2151,
12782,
198,
11748,
14470,
198,
11748,
14470,
62,
18769,
26418,
62,
5589,
3906,
355,
288,
15630,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
198,
11748,
14470,
62,
6494,
62,
5589,
39... | 2.551613 | 620 |
# --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file
path
data=pd.read_csv(path).rename(columns={'Total':'Total_Medals'})
data.head(10)
#Code starts here
# --------------
#Code starts here
data['Better_Event']=np.whe... | [
2,
220,
26171,
198,
2,
20939,
278,
13639,
3696,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
201,
198,
2,
15235,
286... | 2.432024 | 993 |
import random
print(random.randint(1, 100))
| [
11748,
4738,
201,
198,
201,
198,
4798,
7,
25120,
13,
25192,
600,
7,
16,
11,
1802,
4008,
201,
198
] | 2.526316 | 19 |
# -*- coding: utf-8 -*-
"""Create an application instance."""
from flask.helpers import get_debug_flag
from web.app import create_app
from web.settings import DevConfig, ProdConfig
#CONFIG = DevConfig if get_debug_flag() else ProdConfig
CONFIG = DevConfig
app = create_app(CONFIG)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
16447,
281,
3586,
4554,
526,
15931,
198,
6738,
42903,
13,
16794,
364,
1330,
651,
62,
24442,
62,
32109,
198,
198,
6738,
3992,
13,
1324,
1330,
2251,
62,
1324,
198,
... | 3.10989 | 91 |
from tracking.abstract import AbstractTracker
| [
6738,
9646,
13,
397,
8709,
1330,
27741,
35694,
628
] | 5.222222 | 9 |
# https://www.hackerrank.com/challenges/30-dictionaries-and-maps/problem
# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(input())
book = {}
for x in range(0,n):
line = input().split()
book[line[0]] = line[1]
while True:
try:
line = input().split()
name = lin... | [
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
1270,
12,
67,
2867,
3166,
12,
392,
12,
31803,
14,
45573,
198,
198,
2,
6062,
534,
2438,
994,
13,
4149,
5128,
422,
48571,
1268,
13,
12578,
5072,
284,
48571,
1... | 2.170213 | 235 |
import os
import sys
import torch
import random
import numpy as np
from torch import nn
from torch import optim
from tqdm import trange, tqdm
from collections import Counter
from datetime import datetime
from tensorboardX import SummaryWriter
from torch.utils.data import Dataset, DataLoader
import matplotlib
matplotl... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
28034,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
1330,
6436,
198,
6738,
256,
80,
36020,
1330,
491,
858,
11,
256,
80,
36020,
198,... | 2.043123 | 4,893 |
# coding: utf-8
#
# Pythonでの正規表現サンプル
#
# Update: 2018/3/21
#
import re
# 検索対象のテキスト
textdata = '''
Welcome to Infra workshop!
Kusotsui
Hikariare
Misogi
Misogi999
Misogi9999
'''.strip()
# print m.groups(0)
# メインルーチン
if __name__ == "__main__":
main()
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
11361,
30640,
27032,
255,
96,
17358,
237,
26193,
101,
163,
237,
122,
26503,
6527,
30965,
9202,
198,
2,
198,
2,
10133,
25,
2864,
14,
18,
14,
2481,
198,
2,
198,
198,
11748,
302,
198,... | 1.791667 | 144 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
"""
Caching
---------------------------
"""
import functools
from df_engine.core import Actor, Context
from df_engine.core.types import ActorStage
class OneTurnCache:
"""
Class that caches the information from the last turn.
"""
| [
37811,
198,
34,
8103,
198,
22369,
6329,
198,
198,
37811,
198,
11748,
1257,
310,
10141,
198,
198,
6738,
47764,
62,
18392,
13,
7295,
1330,
27274,
11,
30532,
198,
6738,
47764,
62,
18392,
13,
7295,
13,
19199,
1330,
27274,
29391,
628,
198,
... | 3.450704 | 71 |
import numpy as np
import elephant.spade as spade
import argparse
import yaml
from yaml import Loader
# Function to filter patterns when the output format of spade function
# is 'patterns'
def _pattern_spectrum_filter(patterns, ns_signature, spectrum, winlen):
"""
Filter to select concept which signature is s... | [
11748,
299,
32152,
355,
45941,
198,
11748,
20950,
13,
2777,
671,
355,
599,
671,
198,
11748,
1822,
29572,
198,
11748,
331,
43695,
198,
6738,
331,
43695,
1330,
8778,
263,
628,
198,
2,
15553,
284,
8106,
7572,
618,
262,
5072,
5794,
286,
5... | 1.965978 | 2,469 |
"""
Parser handles reading and interpreting the OA logfile
"""
from player import Player | [
37811,
198,
46677,
17105,
3555,
290,
35391,
262,
440,
32,
2604,
7753,
198,
37811,
198,
198,
6738,
2137,
1330,
7853
] | 4.45 | 20 |
# coding=utf-8
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
19617,
28,
40477,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 3.266667 | 30 |
# -*-coding:utf-8 -*-
'''
@File : internet_search_demo.py
@Author : HW Shen
@Date : 2020/5/26
@Desc :
'''
from ServiceOrientedChatbot.search_dialog import SearchEngine
from ServiceOrientedChatbot.utils import logger
if __name__ == '__main__':
engine = SearchEngine()
logger.debug(engi... | [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
31,
8979,
220,
220,
220,
220,
220,
220,
1058,
5230,
62,
12947,
62,
9536,
78,
13,
9078,
198,
31,
13838,
220,
220,
220,
220,
1058,
44884,
22323,
198... | 2.017241 | 348 |
from __future__ import print_function
import os
import sys
import ast
from inspect import getmembers
from fnmatch import fnmatchcase
from collections import defaultdict
from openmdao.core.system import System
from openmdao.core.problem import Problem
from openmdao.core.driver import Driver
from openmdao.solvers.solv... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
6468,
198,
198,
6738,
10104,
1330,
651,
30814,
198,
6738,
24714,
15699,
1330,
24714,
15699,
7442,
198,
6738,
17268,
1330,
4277,
11600,
1... | 2.660319 | 1,628 |
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
33448,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 3.507353 | 272 |
'''
Author: MJ.XU
Date: 2021-11-29 17:16:33
LastEditTime: 2021-12-18 23:28:25
LastEditors: MJ.XU
Description: Tech4better
FilePath: \Tutorial-HandWriting-Cls-master\model.py
Personal URL: https://www.squirrelled.cn/
'''
# pytorch related packages
import torch
import torch.nn as nn
import torch.nn.functional as F
# Mo... | [
7061,
6,
198,
13838,
25,
33974,
13,
55,
52,
198,
10430,
25,
33448,
12,
1157,
12,
1959,
1596,
25,
1433,
25,
2091,
198,
5956,
18378,
7575,
25,
33448,
12,
1065,
12,
1507,
2242,
25,
2078,
25,
1495,
198,
5956,
18378,
669,
25,
33974,
13... | 2.745902 | 122 |
import pandas as pd
import torch
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
from data.utils import get_Data, calculate_max_len, get_tokenized
from transformers import AutoTokenizer
from config import cfg, BertConfig
| [
11748,
19798,
292,
355,
279,
67,
201,
198,
201,
198,
11748,
28034,
201,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
309,
22854,
27354,
292,
316,
11,
6060,
17401,
11,
14534,
16305,
20053,
11,
24604,
1843,
16305,
20053,
201,
198,
201,
... | 3.235294 | 85 |
import os
import time
import unittest
from solr_instance import SolrInstance
from solrcloudpy import SolrCollection, SolrConnection
solrprocess = None
if __name__ == "__main__":
unittest.main()
| [
11748,
28686,
198,
11748,
640,
198,
11748,
555,
715,
395,
198,
198,
6738,
1540,
81,
62,
39098,
1330,
4294,
81,
33384,
198,
6738,
1540,
81,
17721,
9078,
1330,
4294,
81,
36307,
11,
4294,
81,
32048,
198,
198,
34453,
81,
14681,
796,
6045,... | 3.059701 | 67 |
# -*- coding: utf-8 -*-
#
# pyvinecopulib documentation build configuration file
# Sphinx extension modules
from pkg_resources import get_distribution
# -- General configuration ------------------------------------------------
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.githubpages',
'sphinx.ext.mat... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
12972,
26818,
22163,
377,
571,
10314,
1382,
8398,
2393,
198,
198,
2,
45368,
28413,
7552,
13103,
198,
6738,
279,
10025,
62,
37540,
1330,
651,
62,
17080,
3890,
... | 2.884793 | 434 |
"""
Copyright (c) 2018, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
Experiment Hyperparameters.
"""
import argparse
import os
parser = argparse.ArgumentParser(
d... | [
37811,
198,
15069,
357,
66,
8,
2864,
11,
4200,
3174,
13,
785,
11,
753,
13,
198,
1439,
2489,
10395,
13,
198,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
18,
12,
2601,
682,
198,
1114,
1336,
5964,
2420,
11,
766,
262,
... | 2.75606 | 5,239 |
from pymongo import MongoClient | [
6738,
279,
4948,
25162,
1330,
42591,
11792
] | 4.428571 | 7 |
import pytest
from django.core.management import call_command
from ....models import (
Plan,
PlanSlug,
Product,
ProductCategory,
ProductSlug,
Step,
Version,
)
@pytest.mark.django_db
| [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
869,
62,
21812,
198,
198,
6738,
19424,
27530,
1330,
357,
198,
220,
220,
220,
5224,
11,
198,
220,
220,
220,
5224,
11122,
1018,
11,
198,
220,
220,
220,
8721,
11,
... | 2.535714 | 84 |
s = "11000010001"
n = 11
print(findLength(s, n))
| [
198,
198,
82,
796,
366,
1157,
2388,
3064,
486,
1,
198,
77,
796,
1367,
198,
4798,
7,
19796,
24539,
7,
82,
11,
299,
4008,
198
] | 2.04 | 25 |
# (doesn't seem to be any official Enum support in Circuitpython)
Schedule = 1
ScoreBoard = 2 | [
2,
357,
45084,
470,
1283,
284,
307,
597,
1743,
2039,
388,
1104,
287,
13588,
29412,
8,
198,
198,
27054,
5950,
796,
352,
198,
26595,
29828,
796,
362
] | 3.481481 | 27 |
import m3u8
from typing import Tuple
# Rate variant stream by resolution, average bandwidth, and bandwidth.
# Select the best variant stream (best effort).
#
# Assumption: m3u8 object has one or more variants.
| [
11748,
285,
18,
84,
23,
198,
198,
6738,
19720,
1330,
309,
29291,
628,
198,
2,
14806,
15304,
4269,
416,
6323,
11,
2811,
19484,
11,
290,
19484,
13,
628,
198,
2,
9683,
262,
1266,
15304,
4269,
357,
13466,
3626,
737,
198,
2,
198,
2,
21... | 3.706897 | 58 |
from big_ol_pile_of_manim_imports import *
| [
6738,
1263,
62,
349,
62,
79,
576,
62,
1659,
62,
805,
320,
62,
320,
3742,
1330,
1635,
628,
198
] | 2.368421 | 19 |
import os
import logging
basedir = os.path.abspath(os.path.dirname(__file__))
| [
11748,
28686,
198,
11748,
18931,
198,
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
] | 2.645161 | 31 |
# -*- coding: utf-8 -*-
"""
validate.py - Trivial data validater
Created on December 24, 2019
@author: c0redumb
"""
# To make print working for Python2/3
from __future__ import print_function
def validate(ticker, data, begindate='1920-01-01', verbose=0):
'''
This function perform a query and extract the matc... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
12102,
378,
13,
9078,
532,
7563,
85,
498,
1366,
4938,
729,
198,
41972,
319,
3426,
1987,
11,
13130,
198,
31,
9800,
25,
269,
15,
445,
2178,
198,
37811,
198,
... | 1.869202 | 1,315 |