content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import csv
import datetime
import os
import shutil
import sys
import argparse
from mikrotik import Mikrotik
def compare_files(f1, f2):
"""
Compare two text files. Ignore lines with '#'.
:param f1: current_file
:param f2: previous_file
:return: True - if files identical, otherwise - False. If prev... | [
11748,
269,
21370,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
198,
6738,
285,
1134,
10599,
1134,
1330,
17722,
10599,
1134,
628,
198,
4299,
8996,
62,
16624,
7,
69,
1... | 2.251012 | 741 |
"""TensorFlow utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.backend as K
from time import time
import scope.lanczos as lanczos
KE... | [
37811,
51,
22854,
37535,
20081,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
25064,
198,
11748,
299,
... | 2.567402 | 7,982 |
tipo = [
'Ação',
'FII',
'ETF'
] | [
22504,
78,
796,
685,
198,
220,
220,
220,
705,
32,
16175,
28749,
3256,
198,
220,
220,
220,
705,
37,
3978,
3256,
198,
220,
220,
220,
705,
22274,
6,
198,
60
] | 1.433333 | 30 |
import gym
import time
if __name__ == '__main__':
run()
| [
198,
11748,
11550,
198,
11748,
640,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1057,
3419,
628,
198
] | 2.461538 | 26 |
from jiminy.gym.envs.mujoco.mujoco_env import MujocoEnv
# ^^^^^ so that user gets the correct error
# message if mujoco is not installed correctly
from jiminy.gym.envs.mujoco.ant import AntEnv
from jiminy.gym.envs.mujoco.half_cheetah import HalfCheetahEnv
from jiminy.gym.envs.mujoco.hopper import HopperEnv
from jiminy.... | [
6738,
474,
320,
3541,
13,
1360,
76,
13,
268,
14259,
13,
76,
23577,
25634,
13,
76,
23577,
25634,
62,
24330,
1330,
8252,
73,
25634,
4834,
85,
198,
2,
10563,
39397,
523,
326,
2836,
3011,
262,
3376,
4049,
198,
2,
3275,
611,
285,
23577,
... | 2.465054 | 372 |
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.views.generic import TemplateView
from django.contrib.auth.mixins import LoginRequiredMixin
| [
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
7738,
1060,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
198,
6738,
42625,
14208,
13,
36... | 3.62963 | 54 |
#!/usr/bin/env python3
import os
import random
import string
from hashlib import sha256
from Toy_AE import Toy_AE
from secret import FLAG
if __name__ == "__main__":
ae = Toy_AE()
if not proof_of_work():
exit(-1)
for _ in range(4):
try:
menu()
except:
exit(-1... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
4731,
198,
6738,
12234,
8019,
1330,
427,
64,
11645,
198,
198,
6738,
10977,
62,
14242,
1330,
10977,
62,
14242,
198,
6738,
3200,
1330,
9977,... | 2.14 | 150 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | [
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,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.889474 | 190 |
import uuid
from numpy import random
from clovis_points import ActivationFunctions as af
from clovis_points import TruthTables as tt
from clovis_points.Flutes import Flutes
from testing.TestUtilities import TestUtilities
from the_historical_record.Block import Block
from the_historical_record.BlockChain import BlockC... | [
11748,
334,
27112,
198,
198,
6738,
299,
32152,
1330,
4738,
198,
198,
6738,
537,
709,
271,
62,
13033,
1330,
13144,
341,
24629,
2733,
355,
6580,
198,
6738,
537,
709,
271,
62,
13033,
1330,
14056,
51,
2977,
355,
256,
83,
198,
6738,
537,
... | 3.611111 | 90 |
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_tool_onesixtyone
# Purpose: SpiderFoot plug-in for using the onesixtyone tool.
# Tool: https://github.com/trailofbits/onesixtyone
#
# Author: <steve@binarypool.com>
#
# Crea... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
24305,
198,
2,
6530,
25,
220,
220,
220,
220,
220,
220,
220,
264,
46428,
62,
25981,
62,
1952,
19404,
505,
198,
2,
32039,
25,
220,
220,
220,
220,
12648,
1757... | 3.25463 | 216 |
import os
from paraview import simple
# -----------------------------------------------------------------------------
MODULE_PATH = os.path.dirname(os.path.abspath(__file__))
PLUGINS = [
'parflow.py'
]
FULL_PATHS = [
'/Applications/ParaView-5.6.0-1626-g52acf2f741.app/Contents/Plugins/ParFlow.so',
]
# -----... | [
11748,
28686,
198,
6738,
1582,
615,
769,
1330,
2829,
198,
198,
2,
16529,
32501,
198,
198,
33365,
24212,
62,
34219,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
198,
6489,... | 3.556818 | 176 |
from django.contrib.auth.models import User
from django.db import models
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.52381 | 21 |
# Generated by Django 3.2.3 on 2021-06-17 23:09
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
18,
319,
33448,
12,
3312,
12,
1558,
2242,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# this file stores some constants regarding MIDI-handling, etc.
# for settings which MIDI-notes trigger what functionality see settings.py
import Live
#from Live import MidiMap
#from Live.MidiMap import MapMode
DEFAULT_CHANNEL = 0
STATUS_MASK = 0xF0
CHAN_MASK = 0x0F
CC_STATUS = 0xb0
NOTEON_STATUS = 0x90
NOTEOFF_S... | [
2,
428,
2393,
7000,
617,
38491,
5115,
33439,
12,
4993,
1359,
11,
3503,
13,
198,
2,
329,
6460,
543,
33439,
12,
17815,
7616,
644,
11244,
766,
6460,
13,
9078,
198,
198,
11748,
7547,
198,
2,
6738,
7547,
1330,
7215,
72,
13912,
198,
2,
... | 2.585153 | 458 |
__all__ = [
"ATOMIC_RADII",
"KHOT_EMBEDDINGS",
"CONTINUOUS_EMBEDDINGS",
"QMOF_KHOT_EMBEDDINGS",
]
from .atomic_radii import ATOMIC_RADII
from .continuous_embeddings import CONTINUOUS_EMBEDDINGS
from .khot_embeddings import KHOT_EMBEDDINGS
from .qmof_khot_embeddings import QMOF_KHOT_EMBEDDINGS
| [
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
1404,
2662,
2149,
62,
49,
2885,
3978,
1600,
198,
220,
220,
220,
366,
42,
39,
2394,
62,
3620,
33,
1961,
35,
20754,
1600,
198,
220,
220,
220,
366,
37815,
1268,
52,
20958,
62,
3620,
... | 2.059603 | 151 |
from django import forms
| [
6738,
42625,
14208,
1330,
5107,
628
] | 4.333333 | 6 |
from builtins import hex
from builtins import str
from . import six
from . import api_requestor
from . import util
import json
| [
6738,
3170,
1040,
1330,
17910,
198,
6738,
3170,
1040,
1330,
965,
198,
198,
6738,
764,
1330,
2237,
198,
6738,
764,
1330,
40391,
62,
25927,
273,
198,
6738,
764,
1330,
7736,
198,
11748,
33918,
628
] | 3.794118 | 34 |
"""Rundown API Response Facades."""
from typing import Union
class LinesResponseFacade(dict):
"""TheRundown `GET events` response accessor."""
@property
def meta(self) -> dict:
"""Fetch `meta` key from LineResponse."""
return self.get("meta")
@property
def events(self) -> Union[l... | [
37811,
49,
41609,
7824,
18261,
13585,
2367,
526,
15931,
198,
6738,
19720,
1330,
4479,
628,
198,
4871,
26299,
31077,
47522,
671,
7,
11600,
2599,
198,
220,
220,
220,
37227,
464,
49,
41609,
4600,
18851,
2995,
63,
2882,
1895,
273,
526,
1593... | 2.408555 | 678 |
from __future__ import division, print_function
import unittest
import testing.mysqld
import testing.postgresql
from beam_nuggets.io.relational_db import SourceConfiguration
from .database import TestDatabase
| [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
555,
715,
395,
198,
198,
11748,
4856,
13,
28744,
80,
335,
198,
11748,
4856,
13,
7353,
34239,
13976,
198,
198,
6738,
15584,
62,
77,
26550,
13,
952,
13,
2411,
8... | 3.803571 | 56 |
import cv2
import sys
import pyprind
import torch
import numpy as np
import dl_modules.dataset as ds
import dl_modules.transforms as trf
import cm_modules.utils as utils
import skvideo.io as vio
from cm_modules.enhance import correct_colors
from cm_modules.utils import convert_to_cv_8bit
| [
11748,
269,
85,
17,
198,
11748,
25064,
198,
11748,
12972,
1050,
521,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
288,
75,
62,
18170,
13,
19608,
292,
316,
355,
288,
82,
198,
11748,
288,
75,
62,
18170,
13,
7645,
... | 3.052632 | 95 |
from socket import * | [
6738,
17802,
1330,
1635
] | 5 | 4 |
from django.db.models import F
from bridger import display as dp
from bridger.pandas import fields as pf
from bridger.pandas.views import PandasAPIView
from bridger.serializers import decorator
from tests.filters import PandasFilterSet
from tests.models import ModelTest
from .display import PandasDisplayConfig
| [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
376,
198,
198,
6738,
38265,
1362,
1330,
3359,
355,
288,
79,
198,
6738,
38265,
1362,
13,
79,
392,
292,
1330,
7032,
355,
279,
69,
198,
6738,
38265,
1362,
13,
79,
392,
292,
13,
33571,
1330... | 3.597701 | 87 |
__version__ = "0.18.2+melior1.1.6"
| [
834,
9641,
834,
796,
366,
15,
13,
1507,
13,
17,
10,
17694,
1504,
16,
13,
16,
13,
21,
1,
198
] | 1.75 | 20 |
'''
Created on 2016年8月4日
@author: Administrator
'''
from io import StringIO
# write to StringIO:
f = StringIO()
f.write('hello')
f.write(' ')
f.write('world!')
print(f.getvalue())
# read from StringIO:
f = StringIO('水面细风生,\n菱歌慢慢声。\n客亭临小市,\n灯火夜妆明。')
while True:
s = f.readline()
if s == '':
break
... | [
7061,
6,
198,
41972,
319,
1584,
33176,
112,
23,
17312,
230,
19,
33768,
98,
198,
198,
31,
9800,
25,
22998,
198,
7061,
6,
198,
6738,
33245,
1330,
10903,
9399,
628,
198,
2,
3551,
284,
10903,
9399,
25,
198,
69,
796,
10903,
9399,
3419,
... | 1.764398 | 191 |
# -*- coding: utf-8 -*-
"""
"""
from __future__ import unicode_literals
from __future__ import print_function
import logging
from unittest import TestCase
from unittest.mock import MagicMock
from mock import call
from p2p0mq.app.local_peer import LocalPeer
from p2p0mq.peer import Peer
from enhterm import EnhTerm
fro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
18931,
198,
6738,
... | 3.080214 | 187 |
"""portal URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | [
37811,
634,
282,
10289,
28373,
198,
198,
464,
4600,
6371,
33279,
82,
63,
1351,
11926,
32336,
284,
5009,
13,
1114,
517,
1321,
3387,
766,
25,
198,
220,
220,
220,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
268,
14,
... | 2.766393 | 488 |
import logging
import os
import requests
if __name__ == "__main__":
pass
| [
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
7007,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1208,
198
] | 2.928571 | 28 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2020-04-19 07:57
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1238,
319,
12131,
12,
3023,
12,
1129,
8753,
25,
3553,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198... | 2.709091 | 55 |
"""
Sponge Knowledge Base
Processor inheritance
"""
| [
37811,
201,
198,
4561,
14220,
20414,
7308,
201,
198,
18709,
273,
24155,
201,
198,
37811,
201,
198
] | 3.294118 | 17 |
from dagster import PipelineDefinition, OutputDefinition, lambda_solid, types
| [
6738,
48924,
1706,
1330,
37709,
36621,
11,
25235,
36621,
11,
37456,
62,
39390,
11,
3858,
628
] | 4.9375 | 16 |
# import os
# import numpy as np
# import readprm
# import readxyz
# import katom
# # I use examples.py to play with code.
# path = '/Users/moseschung/Documents/Ponder/HIPPO/test/testitems'
# atom_dict, bond_dict, angle_dict, repel_dict, disp_dict, mpole_dict, chgpen_dict, polarize_dict, chgtrn_dict = readprm.readk... | [
2,
1330,
28686,
198,
2,
1330,
299,
32152,
355,
45941,
198,
2,
1330,
1100,
1050,
76,
198,
2,
1330,
1100,
5431,
89,
198,
2,
1330,
479,
37696,
198,
198,
2,
1303,
314,
779,
6096,
13,
9078,
284,
711,
351,
2438,
13,
198,
198,
2,
3108,... | 2.415 | 600 |
from hstest.common.reflection_utils import get_stacktrace
from hstest.exception.failure_handler import get_report
from hstest.exception.outcomes import UnexpectedError
from hstest.outcomes.outcome import Outcome
| [
6738,
289,
301,
395,
13,
11321,
13,
5420,
1564,
62,
26791,
1330,
651,
62,
25558,
40546,
198,
6738,
289,
301,
395,
13,
1069,
4516,
13,
32165,
495,
62,
30281,
1330,
651,
62,
13116,
198,
6738,
289,
301,
395,
13,
1069,
4516,
13,
448,
... | 3.380952 | 63 |
# write your silhouette score unit tests here
import numpy as np
from scipy.spatial.distance import cdist
import cluster
import pytest
from sklearn.metrics import silhouette_samples, silhouette_score
def test_silhouette():
"""
Unit test of silhouette scores for each of the observations.
NOTE: Using ... | [
2,
3551,
534,
41834,
4776,
4326,
5254,
994,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
2777,
34961,
13,
30246,
1330,
269,
17080,
198,
11748,
13946,
198,
11748,
12972,
9288,
198,
198,
6738,
1341,
35720,
13,
4164,
... | 2.911846 | 363 |
"""MyST-NB package setup."""
from setuptools import find_packages, setup
# Manually finding the version so we don't need to import our module
text = open("./myst_nb/__init__.py").read()
for line in text.split("\n"):
if "__version__" in line:
break
version = line.split("= ")[-1].strip('"')
setup(
name=... | [
37811,
3666,
2257,
12,
32819,
5301,
9058,
526,
15931,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
2,
1869,
935,
4917,
262,
2196,
523,
356,
836,
470,
761,
284,
1330,
674,
8265,
198,
5239,
796,
1280,
7,
19... | 2.045079 | 1,331 |
"""
Author : Achintya Gupta
Date Created : 22-09-2020
"""
"""
Problem Statement
------------------------------------------------
Q) Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
1634 = 14 + 64 + 34 + 44
8208 = 84 + 24 + 04 + ... | [
37811,
198,
13838,
1058,
26219,
600,
3972,
42095,
198,
10430,
15622,
1058,
2534,
12,
2931,
12,
42334,
198,
37811,
198,
198,
37811,
198,
40781,
21983,
198,
47232,
198,
48,
8,
47183,
612,
389,
691,
1115,
3146,
326,
460,
307,
3194,
355,
... | 2.829167 | 240 |
#!/usr/bin/env python
#
#Copyright (C) 2011 by Venkata Pingali (pingali@gmail.com) & TCS
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
198,
2,
198,
2,
15269,
357,
34,
8,
2813,
416,
9932,
74,
1045,
34263,
7344,
357,
13886,
7344,
31,
14816,
13,
785,
8,
1222,
309,
7902,
220,
198,
2,
198,
2,
5990,
3411,
318,
29376,
... | 2.152404 | 4,534 |
"""adam.adam_2
"""
# pylint: disable=C0111
import ctypes
import functools
import operator
@decorator
| [
37811,
324,
321,
13,
324,
321,
62,
17,
198,
37811,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
34,
486,
1157,
198,
198,
11748,
269,
19199,
198,
11748,
1257,
310,
10141,
198,
11748,
10088,
628,
628,
628,
198,
31,
12501,
273,
1352,
... | 2.5 | 44 |
import os
import subprocess as sp
"""batch convert videos to a 4x4 720p version"""
#VIDEO_DIRECTORY = '/media/taylor/external/robot/Rover/trail'
#VIDEO_DIRECTORY = '/media/taylor/feynman/rover_videos/trail_scan/Videos'
VIDEO_DIRECTORY = '/media/taylor/external/robot/Rover/trail/unprocessed'
video_groups = []
... | [
11748,
28686,
198,
11748,
850,
14681,
355,
599,
628,
198,
37811,
43501,
10385,
5861,
284,
257,
604,
87,
19,
26250,
79,
2196,
37811,
628,
198,
2,
42937,
62,
17931,
23988,
15513,
796,
31051,
11431,
14,
83,
7167,
14,
22615,
14,
305,
1364... | 2.164835 | 1,820 |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import abc
from amazon_kclpy.messages import ShutdownInput
class RecordProcessorBase(object):
"""
Base class for implementing a record processor. Each RecordProcessor processes a single shard in a ... | [
2,
15069,
2864,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
11748,
450,
66,
198,
198,
6738,
716,
5168,
62,
74,
565,
9078... | 2.919979 | 1,912 |
# Copyright 2015 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
"""
Defines model components to describe transmission build-outs for the
SWITCH-Pyomo model.
SYNOPSIS
>>> from switch_mod.utilities import define_AbstractModel
>>> model = define_Ab... | [
2,
15069,
1853,
383,
14645,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
11,
543,
318,
287,
262,
38559,
24290,
2393,
13,
198,
198,
37811,
198,
198,
7469,
1127,
2746,
6805,
284,
6901,
11478,
... | 2.883744 | 5,118 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Release File wrapper.
The ReleaseFile is the overall meta data file of a :class:apt.repo.Distribution
"""
from typing import Dict, Optional, List
from .tagblock import TagBlock
from .filehash import FileHash
class ReleaseFile(TagBlock):
"""
Release File w... | [
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,
37811,
198,
26362,
9220,
29908,
13,
198,
198,
464,
13868,
8979,
318,
262,
4045,
13634,
1366,
2393,
286,
257,
... | 2.68038 | 316 |
#!/usr/bin/env python3
import asyncio
from mavsdk import System
from mavsdk.offboard import OffboardError, VelocityNedYaw
async def run():
""" Does Offboard control using velocity NED coordinates. """
drone = System()
await drone.connect(system_address="udp://:14540")
print("Waiting for drone to ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
11748,
30351,
952,
198,
198,
6738,
285,
615,
21282,
74,
1330,
4482,
198,
6738,
285,
615,
21282,
74,
13,
2364,
3526,
1330,
3242,
3526,
12331,
11,
43137,
45,
276,
56,
707,
628... | 2.297271 | 1,026 |
#coding: utf-8
#----------------------------------------------------------------
# Um programa que abre e reproduz o áudio de um arquivo MP3.
#----------------------------------------------------------------
# Tocando um MP3 - Exercício #021
#----------------------------------------------------------------
import pyg... | [
2,
66,
7656,
25,
3384,
69,
12,
23,
198,
2,
10097,
198,
2,
220,
21039,
1430,
64,
8358,
450,
260,
304,
8186,
89,
267,
6184,
94,
463,
952,
390,
23781,
610,
421,
23593,
4904,
18,
13,
198,
2,
10097,
198,
2,
220,
309,
420,
25440,
23... | 2.819876 | 322 |
from Circle import Circle
from Item import Item
import Constant as c
from GeometryMath import sub, norm
| [
6738,
16291,
1330,
16291,
198,
6738,
9097,
1330,
9097,
198,
11748,
20217,
355,
269,
198,
6738,
2269,
15748,
37372,
1330,
850,
11,
2593,
628
] | 4.375 | 24 |
from displayarray.effects import lens
from displayarray import display
from examples.videos import test_video
# Move the mouse to center the image, scroll to increase/decrease barrel, ctrl+scroll to increase/decrease zoom
m = lens.Barrel(use_bleed=False)
m.enable_mouse_control()
display(test_video, callbacks=m, block... | [
6738,
3359,
18747,
13,
34435,
1330,
10317,
198,
6738,
3359,
18747,
1330,
3359,
198,
6738,
6096,
13,
32861,
1330,
1332,
62,
15588,
198,
198,
2,
10028,
262,
10211,
284,
3641,
262,
2939,
11,
10743,
284,
2620,
14,
12501,
260,
589,
9036,
1... | 3.473684 | 95 |
"""Provides the abstract class Expression"""
from abc import ABC, abstractmethod
from functools import partialmethod
from typing import Any
from .context import ContextBase
class Expression(ABC):
"""The abstract Expression class"""
def __hash__(self) -> int:
"""Make it hashable"""
return ha... | [
37811,
15946,
1460,
262,
12531,
1398,
41986,
37811,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
1257,
310,
10141,
1330,
13027,
24396,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
764,
22866,
1330,
30532,
14881,
628,... | 2.549908 | 1,633 |
"""building.py build frameworks from mission files
"""
from __future__ import division
#print("module {0}".format(__name__))
import time
import re
import importlib
import os
from collections import deque
try:
from itertools import izip
except ImportError: #python 3 zip is same as izip
izip = zip
from ..aid... | [
37811,
16894,
13,
9078,
1382,
29251,
422,
4365,
3696,
198,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
2,
4798,
7203,
21412,
1391,
15,
92,
1911,
18982,
7,
834,
3672,
834,
4008,
198,
198,
11748,
640,
198,
11748,
302... | 2.055911 | 87,407 |
# Generated by Django 2.2.9 on 2020-02-06 09:26
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
24,
319,
12131,
12,
2999,
12,
3312,
7769,
25,
2075,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from typing import Dict
import numpy
from config import logging_configurator
from paddles.paddle_0402.config.paddle_configurator import nmist_raw_ann_config
from paddles.paddle_0402.whiteboard.from_scratch.nmist import Ann, output_training, \
initialize_gradient_weight_accumulation_matrices, initialize_bias_accum... | [
6738,
19720,
1330,
360,
713,
198,
198,
11748,
299,
32152,
198,
198,
6738,
4566,
1330,
18931,
62,
11250,
333,
1352,
198,
6738,
14098,
829,
13,
79,
37382,
62,
15,
32531,
13,
11250,
13,
79,
37382,
62,
11250,
333,
1352,
1330,
28642,
396,
... | 2.723577 | 738 |
from __future__ import unicode_literals
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
class Logger:
"""
This class is very simple and is of no use in the rest of the program except in main.py,
when it's initialized.
To log you must first import logging in the file.
Then yo... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
4871,
59... | 2.608081 | 495 |
from __future__ import print_function
import json
import os
from urllib import request, parse
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
2956,
297,
571,
1330,
2581,
11,
21136,
628,
628,
198
] | 3.769231 | 26 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
import facebook
import websites
import feeds
#import beachstatus
from event import EventVault
import logging
import datetime
import time
import locale
locale.setlocale(locale.LC_TIME, '') # locale for date, time an the infamous germ... | [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
8019,
48774,
198,
198,
11748,
23960,
198,
11748,
9293,
198,
11748,
21318,
... | 2.904494 | 178 |
#!/usr/bin/env python3
# from src.enochecker import *
import json
import secrets
from typing import Dict
from enochecker import BaseChecker, BrokenServiceException, assert_equals, run
class ExampleChecker(BaseChecker):
"""
Change the methods given here, then simply create the class and .run() it.
A few ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
422,
12351,
13,
268,
30848,
15280,
1330,
1635,
198,
11748,
33918,
198,
11748,
13141,
198,
6738,
19720,
1330,
360,
713,
198,
198,
6738,
551,
30848,
15280,
1330,
7308,
9787,
263,
... | 2.400194 | 3,096 |
import subprocess
import sys
import time
import os
##start([], open('log.out','a'), open('error.out','a'))
##stop(open('log.out','a'), open('error.out','a'))
| [
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
28686,
198,
198,
2235,
9688,
26933,
4357,
1280,
10786,
6404,
13,
448,
41707,
64,
33809,
1280,
10786,
18224,
13,
448,
41707,
64,
6,
4008,
198,
2235,
11338,
7,
9654,
... | 2.758621 | 58 |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
CONTEXT_ATTRIBUTE = getattr(settings, 'JSON_LD_CONTEXT_ATTRIBUTE', 'sd')
MODEL_ATTRIBUTE = getattr(settings, 'JSON_LD_MODEL_ATTRIBUTE', 'sd')
DEFAULT_CONTEXT = getattr(settings, 'JSON_LD_DEFAULT_CONTEXT', 'https://schema.org/'... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
12205,
525,
306,
16934,
1522,
628,
198,
10943,
32541,
62,
1404,
5446,
9865,
37780,
796,
651,
35226,
7,
33692,
11,
705,
40386,
62,
11163... | 2.554167 | 480 |
#coding=utf-8
import xlrd, json, os
from lxml import etree
path = os.path.split(os.path.realpath(__file__))[0]+"/"
data = xlrd.open_workbook(path+"numbers.xls")
table = data.sheets()[0]
nrows = table.nrows
Dict = []
for i in range(nrows ):
Arr = table.row_values(i)
Dict.append(Arr)
root = etree.Element("root")
child1... | [
2,
66,
7656,
28,
40477,
12,
23,
198,
11748,
2124,
75,
4372,
11,
33918,
11,
28686,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
6978,
796,
28686,
13,
6978,
13,
35312,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
4008,
58,
... | 2.337255 | 255 |
__all__ = ["apply","fit"] | [
834,
439,
834,
796,
14631,
39014,
2430,
11147,
8973
] | 2.777778 | 9 |
from torch2cmsis.converter import CMSISConverter
| [
6738,
28034,
17,
46406,
271,
13,
1102,
332,
353,
1330,
40773,
1797,
3103,
332,
353,
198
] | 3.0625 | 16 |
from pathlib import Path
DATA_DIR = Path(__file__).parent / "data"
| [
6738,
3108,
8019,
1330,
10644,
628,
198,
26947,
62,
34720,
796,
10644,
7,
834,
7753,
834,
737,
8000,
1220,
366,
7890,
1,
198
] | 3 | 23 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from models.SEBlock import SELayer
if __name__ == '__main__':
test() | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
26791,
13,
9122,
4122,
355,
31396,
198,
198,
6738,
4981,
13,
5188,
12235,
1330,
311,
3698,
2794,
628,
... | 3 | 61 |
import numpy as np # Import important packages
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph as pg
import glob
from PIL import Image
import os
import re
def calcscale(imv): # Defines calcscale function
"""
"""
image = imv.getProcessedImage()
scale = imv.scalemax / float(image[imv.current... | [
11748,
299,
32152,
355,
45941,
220,
1303,
17267,
1593,
10392,
198,
6738,
12972,
80,
25297,
1470,
13,
48,
83,
1330,
33734,
14055,
11,
33734,
8205,
72,
198,
11748,
12972,
80,
25297,
1470,
355,
23241,
198,
11748,
15095,
198,
6738,
350,
414... | 2.696319 | 326 |
from django.urls import re_path, path
from rest_framework.authtoken.views import obtain_auth_token
from users.views import UserOrderView, UserCreateView, UserView, UserEventView, UserCompanyView, UserAdminView, UserContactView, UserIdCompany
urlpatterns = [
re_path(r"^$", UserView.as_view(), name="user"),
pat... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
302,
62,
6978,
11,
3108,
198,
198,
6738,
1334,
62,
30604,
13,
18439,
30001,
13,
33571,
1330,
7330,
62,
18439,
62,
30001,
198,
6738,
2985,
13,
33571,
1330,
11787,
18743,
7680,
11,
11787,
16447,
7... | 2.730061 | 326 |
import time
import xgboost as xgb
from xgboost import rabit
def _fmt_metric(value, show_stdv=True):
"""format metric string"""
if len(value) == 2:
return '%s:%g' % (value[0], value[1])
elif len(value) == 3:
if show_stdv:
return '%s:%g+%g' % (value[0], value[1], value[2])
... | [
11748,
640,
198,
11748,
2124,
70,
39521,
355,
2124,
22296,
198,
6738,
2124,
70,
39521,
1330,
27998,
270,
198,
198,
4299,
4808,
69,
16762,
62,
4164,
1173,
7,
8367,
11,
905,
62,
19282,
85,
28,
17821,
2599,
198,
220,
220,
220,
37227,
1... | 2.239011 | 2,184 |
########################################################## README ###########################################################
# This file implements STDP curve and weight update rule
##############################################################################################################################
impor... | [
29113,
14468,
7804,
2235,
20832,
11682,
1303,
29113,
14468,
7804,
2235,
198,
198,
2,
770,
2393,
23986,
3563,
6322,
12133,
290,
3463,
4296,
3896,
198,
198,
29113,
29113,
29113,
14468,
7804,
4242,
2235,
628,
198,
198,
11748,
299,
32152,
355... | 5.207921 | 101 |
#!/usr/bin/env python
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
#
# 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
1584,
30446,
15503,
6400,
446,
14973,
7712,
5834,
11,
406,
13,
47,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
... | 3.450413 | 242 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'notepad4.ui'
#
# Created: Wed Dec 9 14:01:42 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attri... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
1662,
47852,
19,
13,
9019,
6,
198,
2,
198,
2,
15622,
25,
3300,
4280,
220,
860,
1478,
25,
486,
25,
3682,
18... | 2.557576 | 165 |
from pydantic import BaseModel
| [
6738,
279,
5173,
5109,
1330,
7308,
17633,
201
] | 3.875 | 8 |
from typing import Optional
import numpy as np
import torch
from delve.metrics import get_explained_variance, get_layer_saturation, get_eigenval_diversity_index, batch_cov, \
batch_mean
from delve.utils import get_layer_prop, get_training_state
def add_param_eigenvals(layer,
eig_vals... | [
6738,
19720,
1330,
32233,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
39130,
13,
4164,
10466,
1330,
651,
62,
20676,
1328,
62,
25641,
590,
11,
651,
62,
29289,
62,
82,
36921,
11,
651,
62,
68,
9324,
2100,
62,
... | 2.091827 | 1,089 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
13130,
2297,
10983,
198,
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
198,
2,
357,
3826,
27975,
45761,
393,
... | 2.799024 | 2,050 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 2.777669 | 1,021 |
"""
Transformer for machine translation (Attention Is All You Need, Vaswani et al. 2018)
Thomas Mortier
March 2022
"""
import torch
import numpy as np
class Transformer(torch.nn.Module):
""" Represents the main transformer class.
"""
| [
37811,
198,
8291,
16354,
329,
4572,
11059,
357,
8086,
1463,
1148,
1439,
921,
10664,
11,
23663,
86,
3216,
2123,
435,
13,
2864,
8,
198,
198,
22405,
10788,
959,
198,
16192,
33160,
198,
37811,
198,
11748,
28034,
198,
11748,
299,
32152,
355,... | 3.342466 | 73 |
# coding=utf-8
# manfeat.py: classifier based on manually extracted features.
from __future__ import print_function
import argparse
import os
import cPickle
import itertools
from datetime import datetime
import numpy as np
from scipy.stats import mode
from keras.optimizers import Adam
from sklearn.metrics import accu... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
582,
27594,
13,
9078,
25,
1398,
7483,
1912,
319,
14500,
21242,
3033,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
269,
31686,... | 2.254933 | 3,801 |
import pandas as pd
from datetime import date,datetime
import matplotlib.pyplot as plt
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
class Leaderboard:
'''
To maintain the leaderboard of the models
'''
def plot(self):
'''
Plot model accuracy... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
4818,
8079,
1330,
3128,
11,
19608,
8079,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
19798,
292,
13,
29487,
889,
1330,
7881,
62,
6759,
29487,
8019,
62,
1102,
332... | 2.124733 | 938 |
import logging
from utct.common.trainer_template import TrainerTemplate
import mxnet as mx
from mxnet import gluon, autograd
class Trainer(TrainerTemplate):
"""
Class, which provides training process under Gluon/MXNet framework.
Parameters:
----------
model : object
instance of Model cl... | [
11748,
18931,
198,
198,
6738,
3384,
310,
13,
11321,
13,
2213,
10613,
62,
28243,
1330,
31924,
30800,
198,
198,
11748,
285,
87,
3262,
355,
285,
87,
198,
6738,
285,
87,
3262,
1330,
1278,
84,
261,
11,
1960,
519,
6335,
628,
198,
4871,
31... | 2.133041 | 1,368 |
import logging
import colorlog
import sys
from crawlster.config import ChoiceOption
from crawlster.helpers.base import BaseHelper
class LoggingHelper(BaseHelper):
"""Logging helper that handles all the crawling logging.
Must provide the following methods:
- initialize() (inherited from BaseHelper)
... | [
11748,
18931,
198,
198,
11748,
3124,
6404,
198,
11748,
25064,
198,
198,
6738,
27318,
1706,
13,
11250,
1330,
18502,
19722,
198,
6738,
27318,
1706,
13,
16794,
364,
13,
8692,
1330,
7308,
47429,
628,
198,
4871,
5972,
2667,
47429,
7,
14881,
... | 2.726608 | 684 |
"""
Description:
Author: Jiaqi Gu (jqgu@utexas.edu)
Date: 2021-09-28 04:26:34
LastEditors: Jiaqi Gu (jqgu@utexas.edu)
LastEditTime: 2021-09-28 04:33:35
"""
from collections import OrderedDict
from typing import Dict, List, Union
import torch
from core.models.layers.activation import ReLUN
from core.models.layers.supe... | [
37811,
198,
11828,
25,
198,
13838,
25,
449,
544,
40603,
1962,
357,
73,
80,
5162,
31,
315,
1069,
292,
13,
15532,
8,
198,
10430,
25,
33448,
12,
2931,
12,
2078,
8702,
25,
2075,
25,
2682,
198,
5956,
18378,
669,
25,
449,
544,
40603,
19... | 2.803571 | 224 |
import config
from auth import auth_handler
| [
11748,
4566,
198,
6738,
6284,
1330,
6284,
62,
30281,
628
] | 4.5 | 10 |
import sys
import locale
from twisted.internet import reactor, task, threads
from twisted.python import log
from kademlia.network import Server, QuorumServer
log.startLogging(sys.stdout)
port = 5485
if(len(sys.argv) > 1):
port = int(sys.argv[1])
server = QuorumServer(ksize=3)
server.listen(port)
server.bootst... | [
11748,
25064,
198,
11748,
36693,
198,
6738,
19074,
13,
37675,
1330,
21905,
11,
4876,
11,
14390,
198,
6738,
19074,
13,
29412,
1330,
2604,
198,
6738,
479,
36920,
24660,
13,
27349,
1330,
9652,
11,
2264,
19220,
10697,
198,
198,
6404,
13,
96... | 2.77027 | 148 |
import json
"""
Train:
search, length=136208, yes_no_depends=11476
zhidao, length=135366, yes_no_depends=11273
"""
PATH = '/home/wangyongbo/2019rc/DuReader_test/data/preprocessed/trainset'
# search.train.json zhidao.train.json
def count_yesno():
"""
To count the nums of tes/no/depends in dataset
... | [
11748,
33918,
198,
198,
37811,
198,
44077,
25,
198,
220,
220,
220,
2989,
11,
4129,
28,
20809,
21315,
11,
3763,
62,
3919,
62,
10378,
2412,
28,
1157,
35435,
198,
220,
220,
220,
1976,
71,
3755,
78,
11,
4129,
28,
17059,
32459,
11,
3763,... | 2.045662 | 438 |
from __future__ import annotations
from io import BytesIO
from typing import IO, Any, List, NamedTuple
import numpy as np
import numpy.typing as npt
class PointCloudHeader(NamedTuple):
""" Class for Point Cloud header. """
version: str
fields: List[str]
size: List[int]
type: List[str]
count... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
6738,
19720,
1330,
24418,
11,
4377,
11,
7343,
11,
34441,
51,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
774,
1388... | 2.277083 | 2,797 |
import matplotlib.pyplot as plt
from matplotlib import rcParams
import numpy as np
a = []
data = np.loadtxt("text.txt")
plt.grid(True)
plt.hist(data, bins = 100)
plt.show()
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
6738,
2603,
29487,
8019,
1330,
48321,
10044,
4105,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
201,
198,
64,
796,
17635,
201,
198,
201,
198,
220,
220,... | 1.889831 | 118 |
# KartAI https://github.com/eritzyg/KartAI/
# Copyright (c) 2017 Eritz Yerga Gutierrez and Iker García Ferrero
# MIT License https://github.com/eritzyg/KartAI/blob/master/LICENSE
import Player as player
import Render as render
import StateManager as sm | [
2,
32872,
20185,
3740,
1378,
12567,
13,
785,
14,
263,
4224,
35641,
14,
42,
433,
20185,
14,
198,
2,
15069,
357,
66,
8,
2177,
412,
29574,
575,
263,
4908,
48283,
290,
314,
6122,
16364,
29690,
12880,
34785,
198,
2,
17168,
13789,
3740,
1... | 3.1625 | 80 |
# coding: utf-8
SUB_FORMATS = [".ass", ".srt", ".ssa", ".sub"]
ARCHIVE_TYPES = [".zip", ".rar", ".7z"]
VIDEO_FORMATS = [
".webm",
".mkv",
".flv",
".vob",
".ogv",
".ogg",
".drc",
".gif",
".gifv",
".mng",
".avi",
".mov",
".qt",
".wmv",
".yuv",
".rm",
"... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
50,
10526,
62,
21389,
33586,
796,
685,
1911,
562,
1600,
27071,
82,
17034,
1600,
27071,
824,
64,
1600,
27071,
7266,
8973,
198,
31315,
9306,
62,
9936,
47,
1546,
796,
685,
1911,
13344,
1600,
27... | 1.584856 | 383 |
from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from PIL import Image, ImageOps
from random import random, randint
import pdb
# Ign... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
9060,
1330,
33245,
11,
6121,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
13,... | 2.399682 | 628 |
from django.contrib.auth.models import User, Group
from rest_framework import serializers
# TODO: Create your serializers here.
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
11,
4912,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
2,
16926,
46,
25,
13610,
534,
11389,
11341,
994,
13,
198
] | 3.685714 | 35 |
import os
import pytest
from genie import create_case_lists
study_id = "test"
clinical_file_map = {'': ['FOOBAR', 'NEED']}
clinical_file_map['Testing2'] = ['test1']
clinical_file_map['Test1 Now, Please/foo'] = ['wow']
sequenced_case_list_files = create_case_lists.write_case_list_sequenced(
['test1', 'test2'], ... | [
11748,
28686,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
2429,
494,
1330,
2251,
62,
7442,
62,
20713,
198,
198,
44517,
62,
312,
796,
366,
9288,
1,
198,
198,
47367,
62,
7753,
62,
8899,
796,
1391,
7061,
25,
37250,
6080,
9864,
1503,
... | 2.41194 | 670 |
import torch.nn as nn
from torch.nn.modules.conv import _ConvNd
def basic_weight_init(slop=0, non_linearity='relu', type='kaiming_uniform'):
"""
return a weight_init method for convolution and batchnorm initialization.
convolutional layer are initialized using kaimin_uniform initialization
:param type... | [
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
20471,
13,
18170,
13,
42946,
1330,
4808,
3103,
85,
45,
67,
628,
198,
4299,
4096,
62,
6551,
62,
15003,
7,
6649,
404,
28,
15,
11,
1729,
62,
29127,
414,
11639,
260,
2290,
3... | 3 | 189 |
from django.conf.urls import url
from . import views, script_views
from . import dashboard
from common.dashboard import dashboard_view_closure
urlpatterns = [
url(r'^dashboard/$', views.dashboard, name='dashboard'),
# Script pages
dashboard.Script_Dashboard.url_view_dashboard(r'script/dashboard/$'),
d... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
764,
1330,
5009,
11,
4226,
62,
33571,
198,
6738,
764,
1330,
30415,
198,
6738,
2219,
13,
42460,
3526,
1330,
30415,
62,
1177,
62,
17966,
198,
198,
6371,
33279,
82,
796... | 2.573469 | 490 |
my_object = ObjectCreator()
print(my_object)
print(ObjectCreator)
echo(ObjectCreator)
print(hasattr(ObjectCreator, 'new_attr'))
ObjectCreator.new_attr = 'foo'
print(hasattr(ObjectCreator, 'new_attr'))
print(ObjectCreator.new_attr)
ObjectCreatorMirror = ObjectCreator
print(ObjectCreatorMirror.new_attr)
print(Object... | [
198,
198,
1820,
62,
15252,
796,
9515,
16719,
273,
3419,
198,
4798,
7,
1820,
62,
15252,
8,
198,
4798,
7,
10267,
16719,
273,
8,
628,
198,
198,
30328,
7,
10267,
16719,
273,
8,
198,
4798,
7,
10134,
35226,
7,
10267,
16719,
273,
11,
705... | 2.77931 | 145 |
import psycopg2
import pytz
from datetime import datetime
from bot.dao import Dao
from bot.feed import Feed
| [
11748,
17331,
22163,
70,
17,
198,
11748,
12972,
22877,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
10214,
13,
67,
5488,
1330,
360,
5488,
198,
6738,
10214,
13,
12363,
1330,
18272,
198
] | 3.205882 | 34 |
# -*- coding: utf-8 -*-
import json
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
628
] | 2.176471 | 17 |
import os
__author__ = 'bison'
| [
11748,
28686,
201,
198,
834,
9800,
834,
796,
705,
65,
1653,
6,
201,
198,
201,
198
] | 2.1875 | 16 |
from django.db import models
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.5625 | 16 |
import json
import logging
import os
import boto3
import database
from database import Ticket, TicketTemplate, User
logger = logging.getLogger(__name__)
BUCKET_NAME = os.environ['BUCKET_NAME']
| [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
275,
2069,
18,
198,
198,
11748,
6831,
198,
6738,
6831,
1330,
24014,
11,
24014,
30800,
11,
11787,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,... | 3.126984 | 63 |
"""Initial commit.
May be necessary to ghost this in production or do a manual migrate.
SQLite seems to be stupid and require an explicit name for each constraint
and it just won't take an empty name like all real databases.
Revision ID: c0732331a3c8
Revises: None
Create Date: 2016-09-28 15:34:30.135146
"""
# revi... | [
37811,
24243,
4589,
13,
198,
198,
6747,
307,
3306,
284,
10905,
428,
287,
3227,
393,
466,
257,
10107,
32492,
13,
198,
198,
17861,
578,
2331,
284,
307,
8531,
290,
2421,
281,
7952,
1438,
329,
1123,
32315,
198,
392,
340,
655,
1839,
470,
... | 3.228571 | 140 |
import numpy as np
import tensorflow as tf
import helpers
tf.reset_default_graph()
sess = tf.InteractiveSession()
#Vocabulary size.
PAD = 0
EOS = 1
vocab_size = 10
input_embedding_size = 20 #character length
encoder_hidden_units = 20 #num neurons
decoder_hidden_units = encoder_hidden_units * 2
#in original paper,... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
49385,
198,
198,
27110,
13,
42503,
62,
12286,
62,
34960,
3419,
220,
198,
82,
408,
796,
48700,
13,
9492,
5275,
36044,
3419,
220,
198,
198,
2,
53,
420... | 2.587206 | 3,314 |
import sys
import json
import os
import shlex
import pprint
import importlib.resources
import firebase_admin
from firebase_admin import credentials,firestore
with importlib.resources.path("src","serviceAccountKey.json") as fire_resource:
cred = credentials.Certificate(fire_resource)
firebase_admin.initialize_a... | [
11748,
25064,
198,
11748,
33918,
220,
198,
11748,
28686,
198,
11748,
427,
2588,
220,
198,
11748,
279,
4798,
198,
11748,
1330,
8019,
13,
37540,
198,
198,
11748,
2046,
8692,
62,
28482,
198,
6738,
2046,
8692,
62,
28482,
1330,
18031,
11,
64... | 2.792899 | 338 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | [
2,
220,
15069,
3648,
12,
4626,
26182,
23555,
290,
27862,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
... | 3.620513 | 195 |
from django.contrib.auth.views import get_user_model
from rest_framework import serializers
User = get_user_model()
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
33571,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
12982,
796,
651,
62,
7220,
62,
19849,
3419,
628
] | 3.371429 | 35 |
# !/usr/bin/env python2
import rospy
import rospkg
import yaml
from sensor_msgs.msg import CameraInfo
from std_msgs.msg import String
import roslaunch
import os
import argparse
from Config.config import load_config, DEFAULTS as DEFAULT_CONFIGS
import time
import Camera as cam
parser = argparse.ArgumentParser(descrip... | [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
11748,
686,
2777,
88,
198,
11748,
686,
2777,
10025,
198,
11748,
331,
43695,
198,
198,
6738,
12694,
62,
907,
14542,
13,
19662,
1330,
20432,
12360,
198,
6738,
14367,
62,
907,
1454... | 3.290984 | 244 |