content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import time
from collections import defaultdict
import pathlib
import os
import time
import argparse
import numpy as np
from tqdm import tqdm
from boxLCD import envs, env_map
from boxLCD.utils import A, AttrDict, args_type
import copy
import matplotlib.pyplot as plt
import itertools
from torch.utils.tensorboard import ... | [
11748,
640,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
3108,
8019,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
3091,
... | 3.298077 | 208 |
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
# https://www.crowdsupply.com/fairwaves/xtrx
from litex.build.generic_platform import *
from litex.build.xilinx import XilinxPlatform
from litex.build.openocd import OpenO... | [
2,
198,
2,
770,
2393,
318,
636,
286,
27395,
55,
12,
16635,
1371,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
33448,
23347,
429,
17337,
3876,
8344,
1279,
2704,
382,
429,
31,
268,
2633,
12,
34725,
13,
8310,
29,
198,
2,
30628,
55,
12,
... | 1.945545 | 1,818 |
#!/usr/bin/python3
from pathlib import Path
import dateutil
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
from predictor.utility import logDictArima, svld2log, msg2log
from tsstan.pltStan import setPlot
if __name__ == "__main__":
f = None
se... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
3128,
22602,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
... | 2.218126 | 651 |
#!/usr/bin/env python
""" Soma dos elementos de uma lista
Escreva a função soma_elementos que recebe como parâmetro
uma lista com números inteiros e
devolve um número inteiro correspondente à soma dos elementos da lista recebida.
"""
if __name__ == "__main__":
number = [7,8,9,15,1,2]
print(so... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
311,
6086,
23430,
5002,
418,
390,
334,
2611,
1351,
64,
220,
198,
220,
220,
220,
16319,
260,
6862,
257,
1257,
16175,
28749,
3870,
64,
62,
30854,
418,
8358,
1407,
1350,
401,
... | 2.375 | 144 |
import pygame
from character import Direction
| [
11748,
12972,
6057,
198,
6738,
2095,
1330,
41837,
628,
198
] | 4.8 | 10 |
##
# Copyright 2017 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
2235,
198,
2,
220,
15069,
2177,
19764,
11421,
13,
1439,
6923,
33876,
13,
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,
2... | 2.497313 | 2,047 |
#Distributed under the MIT License.
#See LICENSE.txt for details.
from spectre.Spectral import Mesh1D, Mesh2D, Mesh3D
from spectre.Spectral import Basis, Quadrature
try:
import cPickle as pickle # Use cPickle on Python 2.7
except ImportError:
import pickle
import numpy as np
import unittest
import random
... | [
2,
20344,
6169,
739,
262,
17168,
13789,
13,
198,
2,
6214,
38559,
24290,
13,
14116,
329,
3307,
13,
198,
198,
6738,
5444,
260,
13,
49738,
1373,
1330,
47529,
16,
35,
11,
47529,
17,
35,
11,
47529,
18,
35,
198,
6738,
5444,
260,
13,
497... | 2.867188 | 128 |
import os
import unittest
from ....BaseTestCase import BaseTestCase
from centipede.Crawler import Crawler
from centipede.PathHolder import PathHolder
from centipede.Crawler.Fs.Scene import MayaScene
from centipede.Crawler.Fs.Scene import Scene
class MayaSceneTest(BaseTestCase):
"""Test Maya Scene crawler."""
... | [
11748,
28686,
198,
11748,
555,
715,
395,
198,
6738,
19424,
14881,
14402,
20448,
1330,
7308,
14402,
20448,
198,
6738,
1247,
541,
18654,
13,
34,
39464,
1330,
20177,
1754,
198,
6738,
1247,
541,
18654,
13,
15235,
39,
19892,
1330,
10644,
39,
... | 2.597043 | 541 |
from django.contrib.auth import get_user_model
from django.db import models
from picklefield import PickledObjectField
User = get_user_model()
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
2298,
293,
3245,
1330,
12346,
992,
10267,
15878,
198,
198,
12982,
796,
651,
62,
7220,
62,
19849,
3... | 3.348837 | 43 |
#!/usr/bin/env python3
import torch
import torch.nn.functional as F
import torch.optim as optim
import psutil
from utils import *
from wrappers import *
from model import ActorCritic
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
26692,
22602,
198,
198,
6738,
3384,
4487,
1330,
1635,
198,
... | 3.444444 | 54 |
import os
import pickle
from typing import List, Union, Tuple, Any, Dict, Optional
import cv2
import numpy as np
import qrcode
from PIL import Image
from matplotlib import pyplot as plt
from pyzbar import pyzbar
from config import *
# * Filter and loader
# * Transformer
# * Photo transformation
# * Error... | [
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
19720,
1330,
7343,
11,
4479,
11,
309,
29291,
11,
4377,
11,
360,
713,
11,
32233,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10662,
6015,
1098,
198,
6738... | 3.299065 | 107 |
import json
from django import template
register = template.Library()
@register.filter
| [
11748,
33918,
198,
198,
6738,
42625,
14208,
1330,
11055,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
31,
30238,
13,
24455,
198
] | 3.791667 | 24 |
from __future__ import absolute_import
from proteus.default_n import *
from proteus import (StepControl,
TimeIntegration,
NonlinearSolvers,
LinearSolvers,
LinearAlgebraTools,
NumericalFlux)
from . import ls_consrv_p... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
5915,
385,
13,
12286,
62,
77,
1330,
1635,
198,
6738,
5915,
385,
1330,
357,
8600,
15988,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.408163 | 637 |
from django.conf.urls import url, include
from django.contrib import admin
from tastypie import api as tastypie_api
from testproj.testapp.api import BeachResource
from testproj.testapp.views import BeachList, index, json_beaches
# Tastypie
tastypie_api_v1 = tastypie_api.Api(api_name='v1')
tastypie_api_v1.register(Be... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
14854,
4464,
494,
1330,
40391,
355,
14854,
4464,
494,
62,
15042,
198,
6738,
1332,
1676,
73,
13,
9... | 2.486056 | 251 |
## Programa para produzir mensagens no kafka
## python producer.py
from confluent_kafka import SerializingProducer
from confluent_kafka.schema_registry import SchemaRegistryClient
from confluent_kafka.schema_registry.avro import AvroSerializer
import json
import re
from datetime import datetime
def delivery_report(... | [
198,
2235,
6118,
64,
31215,
990,
89,
343,
285,
641,
363,
641,
645,
479,
1878,
4914,
198,
2235,
21015,
9920,
13,
9078,
198,
198,
6738,
1013,
28216,
62,
74,
1878,
4914,
1330,
23283,
2890,
11547,
2189,
198,
6738,
1013,
28216,
62,
74,
1... | 2.479024 | 1,025 |
from Calculatefunction import*
import pandas as pd
import matplotlib.pyplot as plt
# z = np.append(ez,pz)
# seita= np.append(seita1,seita2)
# egamma=np.log10(np.append(eegamma,pegamma))
#
# plt.figure(figsize=(10, 5))
# plt.scatter(z, seita, s=5, alpha=1, marker='o', c='r')
# plt.xlim(0, 8)
# plt.ylim(0,50)
# plt.axis... | [
6738,
27131,
378,
8818,
1330,
9,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
1976,
796,
45941,
13,
33295,
7,
8471,
11,
79,
89,
8,
198,
2,
384,
5350,
28,
45941,
... | 2.10076 | 526 |
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from astropy.io import fits
hdu = fits.open("data/point-source.fits")
img = hdu[0].data
plt.imshow(img)
plt.colorbar()
| [
4,
6759,
29487,
8019,
26098,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
6468,
28338,
13,
952,
1330,
11414,
198,
198,
71,
646,
796,
11414,
13,
9654,
7203,
7890,
14,
4122... | 2.60274 | 73 |
textFile = open('./4_2-file.txt', 'r');
users = textFile.readlines();
textFile.close();
for user in users:
user = user.split(', ');
print(user[1].rstrip() + ' heeft kaartnummer: ' + user[0]);
| [
5239,
8979,
796,
1280,
7,
4458,
14,
19,
62,
17,
12,
7753,
13,
14116,
3256,
705,
81,
24036,
198,
18417,
796,
2420,
8979,
13,
961,
6615,
9783,
198,
5239,
8979,
13,
19836,
9783,
198,
198,
1640,
2836,
287,
2985,
25,
198,
220,
220,
220... | 2.421687 | 83 |
from flask import render_template
from flask import url_for
from flask import Blueprint
from mammothflaskblog.models import CarouselSlider
about_the_project = Blueprint('about_the_project', __name__)
@about_the_project.route("/about-the-project") | [
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
42903,
1330,
19016,
62,
1640,
198,
6738,
42903,
1330,
39932,
198,
6738,
44268,
2704,
2093,
14036,
13,
27530,
1330,
1879,
48355,
11122,
1304,
198,
198,
10755,
62,
1169,
62,
16302,
796,
... | 3.571429 | 70 |
import argparse
import os
from os import path
parser = argparse.ArgumentParser()
parser.add_argument('--imagesPath', type=str, help='path to images')
parser.add_argument('--tblogs', type=str, help='GCS path to tensorboard logs')
parser.add_argument('--epochs', type=int, help='Number of epochs')
parser.add_argu... | [
11748,
1822,
29572,
201,
198,
11748,
28686,
201,
198,
6738,
28686,
1330,
3108,
201,
198,
201,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
201,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
17566,
15235,
3256,
2099,
28,
25... | 2.921875 | 256 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Description:TikTokAPI
@Date :2021/01/29 13:34:54
@Author :JohnserfSeed
@version :1.0
@License :(C)Copyright 2017-2020, Liugroup-NLPR-CASIA
@Mail :johnserfseed@gmail.com
'''
import requests,json,re,os
from TikTokMulti import TikTok
if __name_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
31,
11828,
25,
51,
1134,
19042,
17614,
198,
31,
10430,
220,
220,
220,
220,
220,
220,
1058,
1238,
2481,
... | 2.183544 | 158 |
# This is your project's main settings file that can be committed to your
# repo. If you need to override a setting locally, use settings_local.py
from funfactory.settings_base import *
# Name of the top-level module where you put all your apps.
# If you did not install Playdoh with the funfactory installer script
# ... | [
2,
770,
318,
534,
1628,
338,
1388,
6460,
2393,
326,
460,
307,
5364,
284,
534,
198,
2,
29924,
13,
1002,
345,
761,
284,
20957,
257,
4634,
15726,
11,
779,
6460,
62,
12001,
13,
9078,
198,
198,
6738,
1257,
69,
9548,
13,
33692,
62,
8692... | 2.69441 | 1,610 |
#
# 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... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
... | 2.5765 | 1,183 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import math
from typing import Callable, Tuple
import torch
import torch.nn.functional as F
from colossalai.communication import broadcast
from colossalai.context import ParallelMode, seed
from colossalai.core import global_context as gpc
from colossalai.global_variable... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
10688,
198,
6738,
19720,
1330,
4889,
540,
11,
309,
29291,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20... | 3.077603 | 2,603 |
# Generated by Django 2.2.4 on 2019-10-24 12:37
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
19,
319,
13130,
12,
940,
12,
1731,
1105,
25,
2718,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
__author__ = 'juan'
import numpy as np
from Vertex import Vertex, FineVertex
from Edge import Edge
from Quad import Quad
| [
834,
9800,
834,
796,
705,
73,
7258,
6,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4643,
16886,
1330,
4643,
16886,
11,
17867,
13414,
16886,
198,
6738,
13113,
1330,
13113,
198,
6738,
20648,
1330,
20648,
628,
628,
628,
628,
628,
628,
... | 3.136364 | 44 |
import inspect
import os.path
import unittest
import sys
import os
from flask import Flask
from flask.ext.autodoc import Autodoc
| [
11748,
10104,
198,
11748,
28686,
13,
6978,
198,
11748,
555,
715,
395,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
13,
2302,
13,
2306,
375,
420,
1330,
5231,
375,
420,
628,
198
] | 3.384615 | 39 |
import sys
import os
import shutil
if len(sys.argv) < 3:
print("Arguments: <source dir> <dest dir>")
sys.exit(1)
source = sys.argv[1]
dest = sys.argv[2]
# Convert all files in source and save in dest
for path in os.listdir(source):
dest_path = dest + path + ".js"
convert(source + path, dest_path)
| [
11748,
25064,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
1279,
513,
25,
198,
197,
4798,
7203,
28100,
2886,
25,
1279,
10459,
26672,
29,
1279,
16520,
26672,
29,
4943,
198,
197,
17597,
13,
... | 2.62069 | 116 |
import socket
from threading import Thread
__author__ = "Nadav Shani"
IP = '127.0.0.1' # local machine ip
PORT = 50000 # server's port
# the max length of a msg (1020, 1020 + header_length = 1024)
MAX_MSG_LENGTH = 1020
# length of the messages is formatted to 4 -> len(4 ) = 4
HEADER_LENGTH ... | [
11748,
17802,
201,
198,
6738,
4704,
278,
1330,
14122,
201,
198,
201,
198,
201,
198,
834,
9800,
834,
796,
366,
45,
324,
615,
911,
3216,
1,
201,
198,
201,
198,
201,
198,
4061,
796,
705,
16799,
13,
15,
13,
15,
13,
16,
6,
220,
1303,... | 2.132938 | 1,181 |
import discord
import os
import dns
import asyncio
from dotenv import load_dotenv
from discord.ext import tasks, commands
# classes import
from ChannelList import ChannelList
from Help import Help
# commands import
from commands.r_help import commands_help
from commands.r_servers import commands_servers
from command... | [
11748,
36446,
198,
11748,
28686,
198,
11748,
288,
5907,
198,
11748,
30351,
952,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
6738,
36446,
13,
2302,
1330,
8861,
11,
9729,
198,
198,
2,
6097,
1330,
198,
6738,
11102,
805... | 3.121019 | 942 |
from .utils import cwd, logging, write_json
logger = logging.getLogger(__name__)
| [
6738,
764,
26791,
1330,
269,
16993,
11,
18931,
11,
3551,
62,
17752,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198
] | 2.896552 | 29 |
import click
import os
import subprocess
def convert_to_wav(input_filename, output_filename, samplerate=44100, nbits=16, nchannels=1):
"""
Converts any audio file type to pcm audio with samplerate and nbits as specified in parameters.
Conversion uses ffmpeg therefore this must be installed in the system.
... | [
11748,
3904,
198,
11748,
28686,
198,
11748,
850,
14681,
628,
198,
4299,
10385,
62,
1462,
62,
45137,
7,
15414,
62,
34345,
11,
5072,
62,
34345,
11,
6072,
20053,
378,
28,
2598,
3064,
11,
299,
9895,
28,
1433,
11,
299,
354,
8961,
28,
16,... | 2.916435 | 718 |
from testtools import TestCase
from ..systemctl import Systemctl
| [
6738,
1332,
31391,
1330,
6208,
20448,
198,
198,
6738,
11485,
10057,
34168,
1330,
4482,
34168,
628
] | 4.1875 | 16 |
f = open('./celeba_train.txt', 'r')
a = f.readlines()
print(len(a)) | [
69,
796,
1280,
7,
4458,
14,
49840,
7012,
62,
27432,
13,
14116,
3256,
705,
81,
11537,
198,
64,
796,
277,
13,
961,
6615,
3419,
198,
4798,
7,
11925,
7,
64,
4008
] | 2.16129 | 31 |
# Convert parquet file to jsonl file. Most of the scripts written in this
# project require jsonl file as input. This script helps when we need to
# convert a parquet file to a jsonl file.
import json
import pandas as pd
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from typing import Sequence, Dic... | [
2,
38240,
1582,
21108,
2393,
284,
33918,
75,
2393,
13,
4042,
286,
262,
14750,
3194,
287,
428,
198,
2,
1628,
2421,
33918,
75,
2393,
355,
5128,
13,
770,
4226,
5419,
618,
356,
761,
284,
198,
2,
10385,
257,
1582,
21108,
2393,
284,
257,
... | 2.597143 | 2,800 |
from __future__ import generators
from bike.globals import *
from bike.parsing.fastparserast import getRoot, Function, Class, Module, getModule
from bike.parsing.parserutils import generateLogicalLines, makeLineParseable, UnbalancedBracesException, generateLogicalLinesAndLineNumbers
from bike.parsing.newstuff import ge... | [
6738,
11593,
37443,
834,
1330,
27298,
198,
6738,
7161,
13,
4743,
672,
874,
1330,
1635,
198,
6738,
7161,
13,
79,
945,
278,
13,
7217,
48610,
459,
1330,
651,
30016,
11,
15553,
11,
5016,
11,
19937,
11,
651,
26796,
198,
6738,
7161,
13,
7... | 3.777174 | 184 |
from django.utils import timezone
from django.db import IntegrityError
from rest_framework import permissions, status, views
from rest_framework.response import Response
from .models import Service, Link
from .serializers import LinkSerializer
class PutLinkView(views.APIView):
"""."""
serializer_class = Lin... | [
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
9945,
1330,
39348,
12331,
198,
6738,
1334,
62,
30604,
1330,
21627,
11,
3722,
11,
5009,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
198,
6738,
764... | 2.446078 | 612 |
import os
import numpy as np
import cv2
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
epsilon = 1e-6
def convert_corner2center(boxes, cla):
""" Convert prior_boxes to (cx, cy, w, h)
representation for comparison to center-size form ground truth data.
Args:
... | [
11748,
28686,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
269,
85,
17,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
201,
198,
201,... | 2.075362 | 1,380 |
# Impacket - Collection of Python classes for working with network protocols.
#
# SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#... | [
2,
1846,
8002,
316,
532,
12251,
286,
11361,
6097,
329,
1762,
351,
3127,
19565,
13,
198,
2,
198,
2,
10729,
11335,
32,
24318,
9131,
4462,
13,
15069,
357,
34,
8,
33448,
26707,
30515,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
... | 3.419811 | 212 |
'''
API Handlers
'''
import os
import json
import urllib
import tornado.web
import logging
logger = logging.getLogger(__name__)
import core.project as project
import core.job as job
import core.resource as resource
import core.translation as translation
import core.repository as repository
class JobResourceSlug... | [
7061,
6,
198,
220,
220,
220,
7824,
7157,
8116,
198,
7061,
6,
198,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
198,
11748,
33718,
13,
12384,
198,
198,
11748,
18931,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
13... | 3.696189 | 971 |
import mxnet.gluon.nn as nn
import mxnet.gluon.rnn as rnn
| [
11748,
285,
87,
3262,
13,
70,
2290,
261,
13,
20471,
355,
299,
77,
198,
11748,
285,
87,
3262,
13,
70,
2290,
261,
13,
81,
20471,
355,
374,
20471,
198
] | 2 | 29 |
import pickle
| [
11748,
2298,
293,
628
] | 3.75 | 4 |
from typing import List
input()
numbers = list(map(int, input().split()))
print(mean(numbers))
print(median(numbers))
print(mode(numbers))
| [
6738,
19720,
1330,
7343,
628,
628,
198,
198,
15414,
3419,
198,
77,
17024,
796,
1351,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008,
198,
198,
4798,
7,
32604,
7,
77,
17024,
4008,
198,
4798,
7,
1150,
666,
7,
77,
17024,
4008,
1... | 2.788462 | 52 |
r=""
while True:
board=[['-','-','-'],['-','-','-'],['-','-','-']]
s=input().split()
if s[0]=='#':
break
if s[0]=='X':
for i in range(1,len(s)):
x=int(s[i])-1
if i%2==1:
board[x//3][x%3]='X'
else:
board[x//3][x%3]='O'
... | [
81,
33151,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
3096,
41888,
17816,
12,
3256,
29001,
41707,
19355,
4357,
17816,
12,
3256,
29001,
41707,
19355,
4357,
17816,
12,
3256,
29001,
41707,
19355,
11907,
198,
220,
220,
220,
264,
28,
1541... | 1.441247 | 417 |
# coding=utf-8
import json
json_str = '{"status": "Succeeded", "progress": 100, "createdDateTime": "2016-10-15T11:51:10.1684611Z", "lastActionDateTime": "2016-10-15T11:51:24.061298Z", "processingResult": "{\"version\":1,\"timescale\":1e+006,\"offset\":0,\"framerate\":29.97,\"width\":320,\"height\":240,\"fragments\":[... | [
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
33918,
198,
198,
17752,
62,
2536,
796,
705,
4895,
13376,
1298,
366,
50,
1229,
2707,
276,
1600,
366,
33723,
1298,
1802,
11,
366,
25598,
10430,
7575,
1298,
366,
5304,
12,
940,
12,
1314,
51... | 2.382432 | 1,867 |
from myproject.settings import BASE_DIR
from language.views_common import *
from russian.models import *
import requests
## @var words_step
# Amount of words per page in the database
words_step = 50
@login_required
## Acquisition of data on the word of the current level
# @param level Current user level
# @return N... | [
6738,
616,
16302,
13,
33692,
1330,
49688,
62,
34720,
198,
6738,
3303,
13,
33571,
62,
11321,
1330,
1635,
198,
6738,
374,
31562,
13,
27530,
1330,
1635,
198,
11748,
7007,
198,
198,
2235,
197,
31,
7785,
2456,
62,
9662,
198,
2,
197,
31264,... | 3.60034 | 588 |
import unittest
import numpy as np
import pickle
from syft.nn.linear import LinearClassifier
from syft.he.paillier import KeyPair, PaillierTensor
| [
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
198,
6738,
827,
701,
13,
20471,
13,
29127,
1330,
44800,
9487,
7483,
198,
6738,
827,
701,
13,
258,
13,
8957,
359,
959,
1330,
7383,
47,
958,
11... | 3 | 50 |
#!/usr/bin/env python
import sys
from setuptools import setup
setup(
name='xfork',
version='0.37',
description='submitting cpu-bound tasks to processes and io-bound tasks to threads',
author='Sven R. Kunze',
author_email='srkunze@mail.de',
url='https://github.com/srkunze/fork',
license='MI... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
26152,
967,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
2718,
3256,... | 2.616667 | 240 |
import sys
from functools import partial
import numpy as np
import torch
import torch.nn as nn
#from models.modeling_resnet import StdConv2d
def compute_average_flops_cost(self):
"""
A method that will be available after add_flops_counting_methods() is called
on a desired net object.
Returns ... | [
11748,
25064,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
2,
6738,
4981,
13,
4666,
10809,
62,
411,
3262,
1330,
520,
67,
3103,
8... | 2.309336 | 2,153 |
"""
.. module:: swag_client.schemas.v1
:platform: Unix
.. author:: Kevin Glisson (kglisson@netflix.com)
.. author:: Mike Grima (mgrima@netflix.com)
"""
from marshmallow import Schema, fields, validates_schema
from marshmallow.validate import Length, OneOf
from swag_client.schemas.validators import validate_fqdn
... | [
37811,
198,
492,
8265,
3712,
1509,
363,
62,
16366,
13,
1416,
4411,
292,
13,
85,
16,
198,
220,
220,
220,
1058,
24254,
25,
33501,
198,
492,
1772,
3712,
7939,
2671,
30927,
357,
74,
4743,
30927,
31,
36977,
13,
785,
8,
198,
492,
1772,
... | 3.068027 | 147 |
import logging
from logging.handlers import RotatingFileHandler
import os
import os.path
import re
import sys
from collections import namedtuple
import praw
import prawcore
from . import config, database, level, reply
### Globals ###
USER_AGENT = 'PointsBot (by u/GlipGlorp7)'
# The pattern that determines whether ... | [
11748,
18931,
198,
6738,
18931,
13,
4993,
8116,
1330,
18481,
803,
8979,
25060,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
302,
198,
11748,
25064,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
279,
1831,
198,
... | 2.369915 | 3,663 |
#!/usr/bin/env python3
"""
Trivial API reader/writer for testing
"""
import json
import logging
import argparse
import requests
import poefixer
import poefixer.extra.logger as plogger
DEFAULT_DSN='sqlite:///:memory:'
def pull_data(database_dsn, next_id, most_recent, logger):
"""Grab data from the API and i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
14824,
85,
498,
7824,
9173,
14,
16002,
329,
4856,
198,
37811,
628,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
198,
11748,
7007,
198,
198,
... | 2.308294 | 639 |
from multiprocessing import context
from django.shortcuts import render
from catalog.models import Author, Book, BookInstance
# Create your views here.
| [
6738,
18540,
305,
919,
278,
1330,
4732,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
6738,
18388,
13,
27530,
1330,
6434,
11,
4897,
11,
4897,
33384,
198,
198,
2,
13610,
534,
5009,
994,
13,
198
] | 4.052632 | 38 |
"""
A 2-dimensional vector class
>>> v1 = Vector2d(3, 4)
>>> print(v1.x, v1.y)
3.0 4.0
>>> x, y = v1
>>> x, y
(3.0, 4.0)
>>> v1
Vector2d(3.0, 4.0)
>>> v1_clone = eval(repr(v1))
>>> v1 == v1_clone
True
>>> print(v1)
(3.0, 4.0)
>>> octets = bytes(v1)
>>> octets
... | [
37811,
198,
32,
362,
12,
19577,
15879,
1398,
198,
220,
220,
220,
13163,
410,
16,
796,
20650,
17,
67,
7,
18,
11,
604,
8,
198,
220,
220,
220,
13163,
3601,
7,
85,
16,
13,
87,
11,
410,
16,
13,
88,
8,
198,
220,
220,
220,
513,
13,... | 1.916225 | 943 |
"""
An extremely dumb HTTP server intended to be a target for a Github
webhook and notify people by email when a review is added to their
inbox.
It assumes that the name of the inbox is the same as the first part of
the user's email--i.e., if an inbox is called "bob" and the domain
passed on the command line is "examp... | [
37811,
198,
2025,
4457,
13526,
14626,
4382,
5292,
284,
307,
257,
2496,
329,
257,
38994,
198,
12384,
25480,
290,
19361,
661,
416,
3053,
618,
257,
2423,
318,
2087,
284,
511,
198,
259,
3524,
13,
198,
198,
1026,
18533,
326,
262,
1438,
286... | 2.813084 | 428 |
# -*- coding: utf-8 -*-
"""A collection of methods for combining detectors
"""
# Author: Yue Zhao <zhaoy@cmu.edu>
# License: BSD 2 clause
import numpy as np
from sklearn.utils import check_array
from sklearn.utils import column_or_1d
from sklearn.utils.validation import check_is_fitted
from pyod.utils.utility import... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
32,
4947,
286,
5050,
329,
19771,
40471,
198,
37811,
198,
2,
6434,
25,
32854,
29436,
1279,
89,
3099,
726,
31,
11215,
84,
13,
15532,
29,
198,
2,
13789,
25,
347,
... | 2.447564 | 3,099 |
#!/usr/bin/env python
import connexion
from jatdb_server import encoder
from jatdb_server.data.tinydb_handler import DbApp
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
369,
12413,
295,
198,
198,
6738,
474,
265,
9945,
62,
15388,
1330,
2207,
12342,
198,
6738,
474,
265,
9945,
62,
15388,
13,
7890,
13,
44152,
9945,
62,
30281,
1330,
360,
65,
... | 2.66129 | 62 |
import sys
import os
import inspect
import collections
import functools
import argparse
import re
import pprint
from enum import Enum, EnumMeta
import time
from contextlib import contextmanager
from threading import Thread, Lock
def report_exitcode(code, name='process'):
"""
Given exit code of a process, thro... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
10104,
198,
11748,
17268,
198,
11748,
1257,
310,
10141,
198,
11748,
1822,
29572,
198,
11748,
302,
198,
11748,
279,
4798,
198,
6738,
33829,
1330,
2039,
388,
11,
2039,
388,
48526,
198,
11748,
640... | 2.406596 | 4,245 |
from _imports.sim_core.analyses import *
from _imports.sim_core.fdtd_engine import *
from _imports.sim_core.Kgen import *
from _imports.sim_core.utils import *
from _imports.ai_core.dataset_management import *
from _imports.ai_core.approximator impor... | [
6738,
4808,
320,
3742,
13,
14323,
62,
7295,
13,
272,
43710,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1330,
1635,
198,
6738,
4808,
320,
3742,
13,
14323,
62,
7295,
13,
16344,
8671,
62,
18392,
220,
220,
220,
2... | 2.023891 | 293 |
# Necessary Imports
import numpy as np
from constants import GOAL_POSITION_OF_AGENT
from src.Agent import Agent
from src.helper import parent_to_child_dict, sense_current_node, find_block_while_inference
# Our Own Inference Agent's class
# Override the execution method
| [
2,
19652,
408,
560,
1846,
3742,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
38491,
1330,
10351,
1847,
62,
37997,
17941,
62,
19238,
62,
4760,
3525,
198,
6738,
12351,
13,
36772,
1330,
15906,
198,
6738,
12351,
13,
2978,
525,
1330,
... | 3.309524 | 84 |
from flask import Flask, request, jsonify
from flask_restful import Resource, Api
from sqlalchemy import create_engine
from json import dumps
import datetime
db_connect = create_engine('sqlite:///notes.db')
app = Flask(__name__)
api = Api(app)
api.add_resource(Users, '/users')
api.add_resource(UserID, '/users/<userID... | [
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
5949,
72,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
33918,
1330,
45514,
198,
11748,
4818,
8079,
198,
198,
9945,... | 2.699571 | 233 |
# =============================================================================
# Copyright 2020 NVIDIA. All Rights Reserved.
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | [
2,
38093,
25609,
198,
2,
15069,
12131,
15127,
13,
1439,
6923,
33876,
13,
198,
2,
15069,
13130,
383,
3012,
4992,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
... | 3.884319 | 389 |
# *****************************************************************************
#
# 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,
41906,
17174,
4557,
35625,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
1... | 4.016529 | 242 |
rprice = []
price = []
niprice = []
bing = []
bingcured = []
values = []
import matplotlib.pyplot as plt
with open('output.txt',encoding = 'utf8') as oh:
for line in oh:
bing.append(line)
for i in range(1,len(bing)):
x = bing[i].split()
if len(x) > 5 and x[2] == 'sold' and x[4] == 'Enchanted':
... | [
81,
20888,
796,
17635,
198,
20888,
796,
17635,
198,
77,
541,
20970,
796,
17635,
198,
4623,
796,
17635,
198,
4623,
66,
1522,
796,
17635,
198,
27160,
796,
17635,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
4480,
1... | 2.135279 | 377 |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | [
37811,
198,
198,
45819,
47,
541,
4470,
198,
198,
15269,
357,
66,
8,
1946,
12,
5304,
284,
1443,
1050,
1279,
83,
672,
4448,
13,
34975,
3889,
16,
31,
14816,
13,
785,
29,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11... | 2.944549 | 1,064 |
"""Tests for sitemaps and sitemap index."""
from xml.etree import ElementTree
import pytest
from werkzeug.urls import url_encode
XML_NAMESPACE = "http://www.sitemaps.org/schemas/sitemap/0.9"
@pytest.mark.parametrize(
"start, size, sitemap_size", [(0, 10, 10), (123, 456, 789), (-100000, 10, 10)]
)
def test_site... | [
37811,
51,
3558,
329,
1650,
368,
1686,
290,
1650,
368,
499,
6376,
526,
15931,
198,
198,
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
198,
198,
11748,
12972,
9288,
198,
6738,
266,
9587,
2736,
1018,
13,
6371,
82,
1330,
19016,
62,
268,... | 2.410612 | 1,225 |
import os.path
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + (os.path.sep + "..") * 2)
import unittest
import itertools
import numpy as np
import pykeops
import pykeops.config
from pykeops.numpy.utils import (
squared_distances,
np_kernel,
log_np_kernel,
grad_np_kernel,
... | [
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
1343,
357,
418,
13,
6978,
13,
325,
79,
1343,
366,
... | 2.322581 | 186 |
from getpass import getpass
from webapp import app, db
import bcrypt
from webapp.models import User, Post
@app.shell_context_processor
if __name__ == '__main__':
#main()
app.run(host="0.0.0.0", port=5000)
| [
6738,
651,
6603,
1330,
651,
6603,
198,
6738,
3992,
1324,
1330,
598,
11,
20613,
198,
11748,
275,
29609,
198,
6738,
3992,
1324,
13,
27530,
1330,
11787,
11,
2947,
628,
198,
31,
1324,
13,
29149,
62,
22866,
62,
41341,
628,
198,
361,
11593,... | 2.7125 | 80 |
import json
with open('JSON_Interface_Config.json') as data:
# json_file = data.read()
# json_python = json.loads(json_file)
json_python = json.loads(data.read())
print(json_python)
| [
11748,
33918,
198,
198,
4480,
1280,
10786,
40386,
62,
39317,
62,
16934,
13,
17752,
11537,
355,
1366,
25,
198,
2,
220,
220,
33918,
62,
7753,
796,
1366,
13,
961,
3419,
198,
2,
220,
220,
33918,
62,
29412,
796,
33918,
13,
46030,
7,
1775... | 2.671233 | 73 |
from __future__ import unicode_literals
import itertools
import re
from .common import InfoExtractor
from ..compat import (
compat_b64decode,
compat_chr,
compat_ord,
compat_str,
compat_urllib_parse_unquote,
compat_zip
)
from ..utils import (
int_or_none,
parse_iso8601,
strip_or_non... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
340,
861,
10141,
198,
11748,
302,
198,
198,
6738,
764,
11321,
1330,
14151,
11627,
40450,
198,
6738,
11485,
5589,
265,
1330,
357,
198,
220,
220,
220,
8330,
62,
... | 2.381944 | 144 |
from pathlib import Path
data_path = Path(__file__).parent / "data"
| [
6738,
3108,
8019,
1330,
10644,
628,
198,
7890,
62,
6978,
796,
10644,
7,
834,
7753,
834,
737,
8000,
1220,
366,
7890,
1,
198
] | 3.043478 | 23 |
# -*- coding: utf-8 -*-
"""
test_utils.py
Copyright 2018 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
9288,
62,
26791,
13,
9078,
198,
198,
15269,
2864,
843,
411,
371,
666,
6679,
198,
198,
1212,
2393,
318,
636,
286,
266,
18,
1878,
11,
2638,
1378,
86,
18,
1... | 3.418033 | 244 |
#+
#-
#/
#*
#%
#<
#>
#<=
#>=
#+ does addition
#- does substraction
#/ does division
#* does multiplikation
#% does string interpolete or modulus
#< does less then
#> does greater then
#<= does less then equel
#>= does grester then equel
# print tihs string in words
print "I will now count my chickens:"
# pisze slowo i ... | [
2,
10,
198,
2,
12,
198,
2,
14,
198,
2,
9,
198,
2,
4,
198,
2,
27,
198,
2,
29,
198,
2,
27,
28,
198,
2,
29,
28,
198,
2,
10,
857,
3090,
198,
2,
12,
857,
3293,
7861,
198,
2,
14,
857,
7297,
198,
2,
9,
857,
15082,
1134,
341... | 2.717778 | 450 |
import json
import random
import numpy
import tensorflow as tf
with open('enwiki.features_damaging.20k_2015.tsv', 'r') as f:
res = [i.split('\t') for i in f.read().split('\n')]
new_res = []
labels = []
test_features = []
test_labels = []
for case in res:
new_case = []
for i in case[:-1]:
if i == 'F... | [
11748,
33918,
198,
11748,
4738,
198,
11748,
299,
32152,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
4480,
1280,
10786,
268,
15466,
13,
40890,
62,
11043,
3039,
13,
1238,
74,
62,
4626,
13,
912,
85,
3256,
705,
81,
11537,
355,
27... | 2.269203 | 1,393 |
from __future__ import annotations
from math import fabs
from sqlite3 import OptimizedUnicode
from typing import Any, Dict, List, Optional, Union
import os
import time
from subprocess import Popen
from pathlib import Path
from ferrite.utils.run import run, capture
import logging
logger = logging.getLogger(__name__)... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
10688,
1330,
7843,
82,
198,
6738,
44161,
578,
18,
1330,
30011,
1143,
3118,
291,
1098,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
32233,
11,
4479,
198,
198,
11748,
28686,
... | 3.526882 | 93 |
__all__ = ['ApiAuthError', 'ApiRequester', 'Audit', 'BadRequestError',
'BulkRequest', 'BulkWhoisApiError', 'BulkWhoisRecord', 'Client',
'Contact', 'EmptyApiKeyError', 'ErrorMessage', 'FileError',
'HttpApiError', 'NameServers', 'ParameterError', 'Registrant',
'RegistryData', '... | [
834,
439,
834,
796,
37250,
32,
14415,
30515,
12331,
3256,
705,
32,
14415,
16844,
7834,
3256,
705,
16353,
270,
3256,
705,
22069,
18453,
12331,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
33,
12171,
18453,
3256,
70... | 2.781711 | 339 |
import imghdr
import cv2
import os
import glob
for folder in ['train','test']:
image_path = os.path.join(os.getcwd(), (folder))
print(image_path)
for file in glob.glob(image_path + '/*.jpg'):
image = cv2.imread(file)
file_type = imghdr.what(file)
if file_type != 'jpeg':
... | [
11748,
545,
456,
7109,
198,
11748,
269,
85,
17,
198,
11748,
28686,
198,
11748,
15095,
198,
198,
1640,
9483,
287,
37250,
27432,
41707,
9288,
6,
5974,
198,
220,
220,
220,
2939,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
11... | 2.207865 | 178 |
# -*- coding: utf-8 -*-
"""Defines fixtures available to all tests."""
import pytest
from webtest import TestApp
from comport.settings import TestConfig
from comport.app import create_app
from comport.database import db as _db
from .factories import UserFactory, DepartmentFactory
@pytest.yield_fixture(scope='functi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
7469,
1127,
34609,
1695,
284,
477,
5254,
526,
15931,
198,
11748,
12972,
9288,
198,
6738,
3992,
9288,
1330,
6208,
4677,
198,
198,
6738,
552,
419,
13,
33692,
1330,
... | 3.05814 | 172 |
from __future__ import division
import numpy as np
from pycog import tasktools
import pdb
learning_rate = 5e-5
max_gradient_norm = 0.1
# =======================
# Task-related parameters
# =======================
# Conditions
conds = [11, 45, 67, 78, 90, 101, 108, 117, 124, 135, 147, 158, 180, 214]
left_rights = [-1... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12972,
66,
519,
1330,
4876,
31391,
198,
11748,
279,
9945,
198,
198,
40684,
62,
4873,
796,
642,
68,
12,
20,
198,
9806,
62,
49607,
62,
27237,
796,
657,
... | 2.356465 | 2,003 |
'''
An alternative replay memory that does not utilize HDF5 - less efficient
'''
import numpy as np
# function to sample a mini-batch
# function to store the observed experience and keep the count within the replay memory
| [
7061,
6,
198,
2025,
5559,
24788,
4088,
326,
857,
407,
17624,
5572,
37,
20,
532,
1342,
6942,
198,
7061,
6,
198,
198,
11748,
299,
32152,
355,
45941,
628,
220,
220,
220,
1303,
2163,
284,
6291,
257,
9927,
12,
43501,
628,
220,
220,
220,
... | 3.949153 | 59 |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import pandas as pd
# Make sure to install xlrd with pip3!!!
titanic = pd.read_excel(io='data/titanic/train.xlsx',
sheet_name='Sheet1',
header=0)
pretty_print("Titanic dataframe", titanic.to_string())
pretty_prin... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
198,
2,
6889,
1654,
284,
2721,
2124,
75,
4372,
351,
7347,
18,
10185,... | 2.317536 | 211 |
#!/usr/bin/env python
# mt333x_fw_dump.py - Tool to dump firmware from MT333x based device
#
# Copyright (c) 2016, David Imhoff <dimhoff.devel@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
45079,
20370,
87,
62,
44482,
62,
39455,
13,
9078,
532,
16984,
284,
10285,
18779,
422,
19308,
20370,
87,
1912,
3335,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
11,
3271,
1846,
36092,... | 3.297248 | 545 |
#!/usr/bin/env python
categories = {
1:['information_gathering',
['acccheck', 'ace-voip', 'amap', 'automater', 'braa', 'casefile', 'cdpsnarf', 'cisco-torch',
'cookie-cadger', 'copy-router-config', 'dmitry', 'dnmap', 'dnsenum', 'dnsmap', 'dnsrecon',
'dnstracer', 'dnswalk', 'dotdotpwn', 'enum4linux', 'enumiax', 'f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
66,
26129,
796,
1391,
198,
197,
16,
25,
17816,
17018,
62,
70,
25545,
3256,
220,
198,
197,
17816,
330,
535,
258,
694,
3256,
705,
558,
12,
13038,
541,
3256,
705,
321,
499,
3256,
... | 2.208431 | 2,135 |
"""
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | [
37811,
198,
15269,
12131,
383,
2944,
2611,
46665,
13,
198,
198,
1212,
2723,
2438,
318,
11971,
739,
262,
347,
10305,
12,
7635,
5964,
1043,
287,
262,
198,
43,
2149,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
198,
... | 1.993635 | 8,012 |
"""Escreva um programa que faça o computador 'pensar' em um número inteiro entre 0 e 5
e peça para o usuário tentar descobrir qual foi o número escolhido pelo computador. O programa
deverá escrever na tela se o usúario acertou ou perdeu."""
import random
from time import sleep
n = random.randint(0, 5)
u = int(input('T... | [
37811,
47051,
260,
6862,
23781,
1430,
64,
8358,
24685,
50041,
267,
2653,
7079,
705,
79,
641,
283,
6,
795,
23781,
299,
21356,
647,
78,
493,
68,
7058,
920,
260,
657,
304,
642,
198,
68,
613,
50041,
31215,
267,
514,
84,
6557,
27250,
111... | 2.369748 | 238 |
import pathlib
import setuptools
HERE = pathlib.Path(__file__).parent
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name = "easy-table",
version = "0.0.4",
author = "iz1kga",
author_email = "iz1kga@gmail.com",
description = "easy-table replacement",
lon... | [
11748,
3108,
8019,
198,
11748,
900,
37623,
10141,
198,
198,
39,
9338,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220... | 2.519164 | 287 |
"""
<your resource name> API Service Test Suite
Test cases can be run with the following:
nosetests -v --with-spec --spec-color
coverage report -m
"""
import os
import logging
from unittest import TestCase
from unittest.mock import MagicMock, patch
from flask_api import status # HTTP Status Codes
from service.mod... | [
37811,
198,
27,
14108,
8271,
1438,
29,
7824,
4809,
6208,
26264,
198,
198,
14402,
2663,
460,
307,
1057,
351,
262,
1708,
25,
198,
220,
43630,
316,
3558,
532,
85,
1377,
4480,
12,
16684,
1377,
16684,
12,
8043,
198,
220,
5197,
989,
532,
... | 2.384411 | 3,015 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-11-06 15:55
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1828,
319,
13130,
12,
1157,
12,
3312,
1315,
25,
2816,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198... | 2.890411 | 73 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
2177,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 2.537663 | 2,602 |
from keras.models import load_model
import numpy as np
import pickle as pickle
from Binary.Scripts.utils import loaddata
if __name__ == '__main__':
main()
| [
6738,
41927,
292,
13,
27530,
1330,
3440,
62,
19849,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2298,
293,
355,
2298,
293,
201,
198,
6738,
45755,
13,
7391,
82,
13,
26791,
1330,
3440,
7890,
201,
198,
201,
198,
201,
198,
... | 2.241379 | 87 |
import sys, os, pprint
path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.insert(0, path)
import sys, os, pprint
from haven.haven_results import plots_line as pl
from haven import haven_results as hr
from haven import haven_utils as hu
from haven.haven_jobs import slurm_manager as sm
import... | [
198,
11748,
25064,
11,
28686,
11,
279,
4798,
198,
6978,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
22305,
198,
17597,
13,
6978,
13,
28463,
7,
15,
... | 2.048309 | 828 |
import tensorflow as tf
model = tf.keras.models.load_model('face_mask_model.h5')
tf.saved_model.save(model,'ov_model_mask')
"""
(ov_2022_dev) C:\Users\Jonathan>mo --saved_model_dir ov_model_mask --input_shape [1,150,150,3]
#### Logs #####
Model Optimizer arguments:
Common parameters:
- Path to the Input Model... | [
11748,
11192,
273,
11125,
355,
48700,
198,
19849,
796,
48700,
13,
6122,
292,
13,
27530,
13,
2220,
62,
19849,
10786,
2550,
62,
27932,
62,
19849,
13,
71,
20,
11537,
198,
27110,
13,
82,
9586,
62,
19849,
13,
21928,
7,
19849,
4032,
709,
... | 2.481322 | 2,088 |
'''
def get_longest_sub_with_k_dist(s, k):
if not s:
return ""
elif len(s) <= k:
return s
elif k == 1:
return s[0]
distinct_char_count = 0
seen_chars = set()
candidate = None
remaining_string = None
# to keep track of where the second character occurred
firs... | [
7061,
6,
198,
4299,
651,
62,
6511,
395,
62,
7266,
62,
4480,
62,
74,
62,
17080,
7,
82,
11,
479,
2599,
198,
220,
220,
220,
611,
407,
264,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
13538,
198,
220,
220,
220,
1288,
361,
18... | 2.203209 | 748 |
import torch
import numpy as np
import pytorch_lightning
from pytorch_lightning.callbacks import Callback
from typing import List, Dict, Any, Tuple
class BaseTestTimeAugmentation(Callback):
"""
Base callback for test-time-augmentation
Attributes
----------
n: int
Number of augmentations.
... | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
13165,
354,
62,
2971,
768,
198,
6738,
12972,
13165,
354,
62,
2971,
768,
13,
13345,
10146,
1330,
4889,
1891,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
11,
4377,
11,
... | 2.11434 | 1,583 |
import h5py as h5
import numpy as np
import pandas as pd
DEFAULT_COMPRESSION = 'gzip'
DEFAULT_COMPRESSION_VALUE = 8 # 0 - 9
class HDFDataset(h5.File):
"""
Read / Write an HDF5 dataset using h5py. If HDF5 is compiled with
parallel support, this class will support parallel I/O of all supported
types... | [
11748,
289,
20,
9078,
355,
289,
20,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
7206,
38865,
62,
9858,
32761,
2849,
796,
705,
70,
13344,
6,
198,
7206,
38865,
62,
9858,
32761,
2849,
62,
39488,
... | 2.185185 | 918 |
#!/usr/bin/python
import subprocess as sp
import numpy as np, matplotlib
from scipy.stats import pearsonr
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
from scipy import stats
import textwrap
loc = sp.Popen(["pwd"],stdout=sp.PIPE).communicate()[0].decode().strip()+"/"
#pri... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
850,
14681,
355,
599,
198,
11748,
299,
32152,
355,
45941,
11,
2603,
29487,
8019,
198,
6738,
629,
541,
88,
13,
34242,
1330,
25286,
1559,
81,
198,
6759,
29487,
8019,
13,
1904,
10786... | 2.233256 | 3,434 |
import jsonlines
import json
import numpy as np
file_path = './java/codebase.jsonl'
data=[]
with open(file_path) as f:
for line in f:
line=line.strip()
js=json.loads(line)
data.append(js)
url_to_num ={}
num_to_url ={}
num = 0
for i in range(len(data)):
print("['original_string']\n")
... | [
11748,
33918,
6615,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
7753,
62,
6978,
796,
705,
19571,
12355,
14,
8189,
8692,
13,
17752,
75,
6,
198,
198,
7890,
28,
21737,
198,
4480,
1280,
7,
7753,
62,
6978,
8,
355,
277,
25... | 2.087879 | 330 |
# coding=utf-8
# Copyright 2017 Foursquare Labs Inc. All Rights Reserved.
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.goal.task_registrar import TaskRegistrar as task
from fsqio.pants.mypy.tasks.mypy_task import MypyTask
| [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
2177,
376,
4662,
421,
533,
23500,
3457,
13,
1439,
6923,
33876,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
... | 3.197674 | 86 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2018 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 b... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
15269,
357,
34,
8,
2864,
8180,
10501,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
... | 2.194627 | 8,524 |
import logging
import pytest
pytestmark = pytest.mark.usefixtures("stop_all")
@pytest.fixture(scope="module")
@pytest.fixture
| [
11748,
18931,
198,
198,
11748,
12972,
9288,
628,
198,
9078,
9288,
4102,
796,
12972,
9288,
13,
4102,
13,
1904,
69,
25506,
7203,
11338,
62,
439,
4943,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
21412,
4943,
628,
198,
31,
... | 2.711538 | 52 |