content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Bite 38. Using ElementTree to parse XML
import xml.etree.ElementTree as ET
# from OMDB
xmlstring = '''<?xml version="1.0" encoding="UTF-8"?>
<root response="True">
<movie title="The Prestige" year="2006" rated="PG-13" released="20 Oct 2006" runtime="130 min" genre="Drama, Mystery, Sci-Fi" director="Christopher No... | [
2,
44540,
4353,
13,
8554,
11703,
27660,
284,
21136,
23735,
198,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
2,
422,
32468,
11012,
198,
19875,
8841,
796,
705,
7061,
47934,
19875,
2196,
2625,
16,
13,
15,
1,
... | 3.068862 | 668 |
"""
Simple Flask web site
"""
# import flask
# from flask import render_template
# from flask import request
# from flask import url_for
# from flask import jsonify # For AJAX transactions
import json
import logging
import sys
# Our own modules
from letterbag import LetterBag
import find
###
# Globals
###
# app = ... | [
37811,
198,
26437,
46947,
3992,
2524,
220,
198,
37811,
198,
198,
2,
1330,
42903,
198,
2,
422,
42903,
1330,
8543,
62,
28243,
198,
2,
422,
42903,
1330,
2581,
198,
2,
422,
42903,
1330,
19016,
62,
1640,
198,
2,
422,
42903,
1330,
33918,
... | 2.595214 | 1,003 |
#####################################################################
# Task 3 : run an improved live invisibility cloak demo using:
# (a) a convex hull operation around the foreground
# (b) feathered blenidng for compositing
#####################################################################
imp... | [
29113,
29113,
4242,
2,
198,
198,
2,
15941,
513,
1058,
1057,
281,
6596,
2107,
44837,
2247,
24117,
13605,
1262,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
64,
8,
257,
24748,
87,
23644,
4905,
1088,
262,
36282,
198,
... | 2.589782 | 1,977 |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | [
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
... | 2.469149 | 940 |
import heapq
INF = 10**10
V, E, r = map(int,input().split())
adj = [[] for i in range(V)]
for e in range(E):
s, t, d = map(int,input().split())
adj[s].append((t,d))
dists = [INF for i in range(V)]
dists[r] = 0
pq = [(0, r)]
while(pq):
d, node = heapq.heappop(pq)
if (d > dists[node]):#探索の対象にする必要があるか確... | [
11748,
24575,
80,
198,
1268,
37,
796,
838,
1174,
940,
198,
198,
53,
11,
412,
11,
374,
796,
3975,
7,
600,
11,
15414,
22446,
35312,
28955,
198,
41255,
796,
16410,
60,
329,
1312,
287,
2837,
7,
53,
15437,
198,
198,
1640,
304,
287,
283... | 1.81388 | 317 |
from canoser import Struct, BytesT
from libra.account_address import Address
from libra.crypto.x25519 import X25519_PUBLIC_KEY_LENGTH
Multiaddr = BytesT()
class DiscoveryInfo(Struct):
"""
# A validator's discovery information, which describes how to dial the
# validator's node and full nodes.
... | [
6738,
460,
13416,
1330,
32112,
11,
2750,
4879,
51,
201,
198,
6738,
9195,
430,
13,
23317,
62,
21975,
1330,
17917,
201,
198,
6738,
9195,
430,
13,
29609,
78,
13,
87,
13381,
1129,
1330,
1395,
13381,
1129,
62,
5105,
32936,
62,
20373,
62,
... | 2.808664 | 554 |
# Generated by Django 2.2.24 on 2021-07-19 08:03
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1731,
319,
33448,
12,
2998,
12,
1129,
8487,
25,
3070,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
# You can find misc modules, which dont fit in anything xD
""" Userbot module for other small commands. """
from rando... | [
2,
15069,
357,
34,
8,
13130,
383,
12281,
5303,
417,
6794,
5834,
11419,
13,
198,
2,
198,
2,
49962,
739,
262,
12281,
5303,
417,
6794,
5094,
13789,
11,
10628,
352,
13,
66,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428... | 1.370511 | 132,320 |
import fnmatch, os, socket
import pickle, timer_cm, dill
import ZO
from threading import *
from tkinter import *
from PIL import ImageTk, Image
PIXEL_MULTIPLIER = 10
IMAGE_PATH = '/Users/colind/Documents/Projects/ZeroOne/ZeroOne/Graphics/Images'
# Handle the window close event
try:
# Create the root Tk obje... | [
11748,
24714,
15699,
11,
28686,
11,
17802,
198,
11748,
2298,
293,
11,
19781,
62,
11215,
11,
288,
359,
198,
198,
11748,
1168,
46,
198,
6738,
4704,
278,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
350,
4146,
1330,
7412,... | 2.779264 | 299 |
#!/usr/bin/env python
# encoding: utf-8
import os
import re
from setuptools import setup, find_packages
try:
long_description = open(rel_path('README.rst'), 'rt').read()
except IOError:
long_description = ''
setup(
name="magphysio",
version=get_version(),
packages=find_packages(),
# instal... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
628,
198,
28311,
25,
198,
220,
220,
220,
... | 2.671111 | 225 |
quotes = [
"Thousands of candles can be lighted from a single candle, "
"and the life of the candle will not be shortened. "
"Happiness never decreases by being shared.",
"Peace comes from within. Do not seek it without."
]
| [
421,
6421,
796,
685,
198,
220,
220,
220,
366,
37482,
286,
32268,
460,
307,
1657,
276,
422,
257,
2060,
26839,
11,
366,
198,
220,
220,
220,
366,
392,
262,
1204,
286,
262,
26839,
481,
407,
307,
34464,
13,
366,
198,
220,
220,
220,
366... | 3.380282 | 71 |
# -*- coding: utf-8 -*-
"""
uuid helper
"""
import os
import random
import time
import uuid
def create_uuid():
"""
Generate random string
"""
return uuid.uuid4()
def create_short_uuid():
"""
Generate random integer
"""
result = str(random.randint(0, 999999999))
return result
de... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
12303,
312,
31904,
198,
37811,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
640,
198,
11748,
334,
27112,
628,
198,
4299,
2251,
62,
12303,
312,
33529,
198,
... | 2.527919 | 197 |
from flask import render_template,request,redirect,url_for
from . import main
#from requests import get_news, search_news
from .forms import ReviewForm
from ..models import Review
#Review = review.Review
# Views
#@main.route('/')
#def index():
@main.route('/news/<int:id>')
| [
6738,
42903,
1330,
8543,
62,
28243,
11,
25927,
11,
445,
1060,
11,
6371,
62,
1640,
198,
6738,
764,
1330,
1388,
198,
2,
6738,
7007,
1330,
651,
62,
10827,
11,
2989,
62,
10827,
198,
6738,
764,
23914,
1330,
6602,
8479,
198,
6738,
11485,
... | 3.170455 | 88 |
g_key = 'AIzaSyCKWaRCRJwLO14DFafu9-U5D_uVD_8g4iY'
weather_api_key = 'da7023607babfcda2533cb107c9718b1' | [
70,
62,
2539,
796,
705,
20185,
4496,
13940,
34,
42,
33484,
7397,
49,
41,
86,
21982,
1415,
8068,
1878,
84,
24,
12,
52,
20,
35,
62,
84,
8898,
62,
23,
70,
19,
72,
56,
6,
198,
23563,
62,
15042,
62,
2539,
796,
705,
6814,
2154,
1954... | 1.672131 | 61 |
#
# PySNMP MIB module HM2-DNS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HM2-DNS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:31:23 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, 0... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
25904,
17,
12,
35,
8035,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
14,
67,
615,
4... | 2.82388 | 6,047 |
from pwn import * # NOQA
context.log_level = 'debug'
context.terminal = ['tmux', 'splitw', '-h']
binary = ELF('./example04')
libc = ELF('/lib/x86_64-linux-gnu/libc.so.6')
p = process('./example04')
gdb.attach(p)
atol_got = binary.symbols['got.atol']
numbers = binary.symbols['numbers']
offset = (atol_got - number... | [
6738,
279,
675,
1330,
1635,
220,
1303,
8005,
48,
32,
198,
198,
22866,
13,
6404,
62,
5715,
796,
705,
24442,
6,
198,
22866,
13,
23705,
282,
796,
37250,
17209,
2821,
3256,
705,
35312,
86,
3256,
705,
12,
71,
20520,
628,
628,
198,
39491,... | 2.281746 | 252 |
from book_center.bc_profiles.models.discussions import BookCenterDiscussion, BookCenterDiscussionComment
from book_center.utils.mixins import DisableAutocompleteMixin
from django import forms
| [
6738,
1492,
62,
16159,
13,
15630,
62,
5577,
2915,
13,
27530,
13,
15410,
21585,
1330,
4897,
23656,
34255,
11,
4897,
23656,
34255,
21357,
198,
6738,
1492,
62,
16159,
13,
26791,
13,
19816,
1040,
1330,
31529,
16541,
42829,
6677,
35608,
259,
... | 4.0625 | 48 |
"""
Entradas
Billetes_50000-->int-->N1
Billetes_20000-->int-->N2
Billetes_10000-->int-->N3
Billetes_5000-->int-->N4
Billetes_2000-->int-->N5
Billetes_1000-->int-->N6
Billetes_500-->int-->N7
Billetes_100-->int-->N8
Salidas
Cantidad_dinero-->float-->c_d
"""
N1=int(input("Ingrese la cantidad de billetes de 50000 "))
N2=in... | [
37811,
198,
14539,
6335,
292,
198,
33,
32512,
274,
62,
20,
2388,
46904,
600,
46904,
45,
16,
198,
33,
32512,
274,
62,
2167,
405,
46904,
600,
46904,
45,
17,
198,
33,
32512,
274,
62,
49388,
46904,
600,
46904,
45,
18,
198,
33,
32512,
... | 2.354839 | 372 |
import functools
try:
import autograd
import autograd.numpy as np
except ImportError:
autograd = None
from ...tools import bisect_sequence, unpack_singleton_sequence_return_value
from ._backend import Backend, fail_on_complex_input
| [
11748,
1257,
310,
10141,
628,
198,
28311,
25,
198,
220,
220,
220,
1330,
1960,
519,
6335,
198,
220,
220,
220,
1330,
1960,
519,
6335,
13,
77,
32152,
355,
45941,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1960,
519,
6335,
796,
6... | 3.02439 | 82 |
import os
import numpy as np
import tensorflow as tf
from tqdm import tqdm
import transformers
from tensorflow.keras.layers import Dense, Input, Dropout, LSTM
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.models import Model
from tensorflow.keras.callbacks import ModelCheckpoint, EarlyStopping, Ten... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
6121,
364,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
360,
... | 2.675136 | 1,102 |
'''
Created on October 17, 2019
@author: pashaa@mskcc.org
'''
import yaml
import sys
# an instance that reads from the defaul config.yaml file
default_config = Config()
if __name__ == '__main__':
print(default_config.get_redcap_token(instance_name="production"))
| [
7061,
6,
198,
41972,
319,
3267,
1596,
11,
13130,
198,
198,
31,
9800,
25,
279,
1077,
7252,
31,
907,
74,
535,
13,
2398,
198,
7061,
6,
198,
198,
11748,
331,
43695,
198,
11748,
25064,
628,
628,
198,
2,
281,
4554,
326,
9743,
422,
262,
... | 2.914894 | 94 |
import os
import csv
PyPoll_csv = os.path.join("..", "Resources", "election_data.csv")
candidates = ['Khan', 'Correy','Li','OTolley']
print('Election Results')
print('-------------------')
with open(PyPoll_csv) as csvfile:
csvreader = csv.reader(csvfile, delimiter=',')
csv_header = next(csvreader)
Khan=... | [
11748,
28686,
198,
11748,
269,
21370,
198,
198,
20519,
39176,
62,
40664,
796,
28686,
13,
6978,
13,
22179,
7203,
492,
1600,
366,
33236,
1600,
366,
14300,
62,
7890,
13,
40664,
4943,
198,
198,
46188,
37051,
796,
37250,
42,
7637,
3256,
705,... | 2.170904 | 708 |
import unittest
from pythonapm.instruments import monkey
from pythonapm.surfacers import Surfacers
from pythonapm.surfacers.log import LogSurfacer
from pythonapm.surfacers.mem import InMemorySurfacer
| [
11748,
555,
715,
395,
198,
198,
6738,
21015,
499,
76,
13,
259,
2536,
2886,
1330,
21657,
198,
6738,
21015,
499,
76,
13,
11793,
38942,
364,
1330,
4198,
38942,
364,
198,
6738,
21015,
499,
76,
13,
11793,
38942,
364,
13,
6404,
1330,
5972,
... | 3.206349 | 63 |
import os
from collections import defaultdict, namedtuple
from copy import deepcopy
from pprint import pprint
import lxml
import lxml.html
import lxml.etree
from graphviz import Digraph
from similarity.normalized_levenshtein import NormalizedLevenshtein
normalized_levenshtein = NormalizedLevenshtein()
TAG_NAME_ATTRI... | [
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
11,
3706,
83,
29291,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
11748,
300,
19875,
198,
11748,
300,
19875,
13,
6494,
198,
11748,
300,
19875,
13... | 2.948571 | 175 |
import pytest
from . import create_app
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
764,
1330,
2251,
62,
1324,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
628,
628,
198
] | 2.645161 | 31 |
import os
import cardio.batchflow as bf
import warnings
import numpy as np
from cardio import EcgBatch
from my_tools import calculate_old_metrics
from my_pipelines.my_pipelines import LoadEcgPipeline
from PanTompkinsAlgorithm import HilbertTransformPipeline
warnings.filterwarnings('ignore')
SIGNALS_PATH = "data\\qt-d... | [
11748,
28686,
198,
11748,
47926,
13,
43501,
11125,
355,
275,
69,
198,
11748,
14601,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
47926,
1330,
14003,
70,
33,
963,
198,
6738,
616,
62,
31391,
1330,
15284,
62,
727,
62,
4164,
10466,
198,
... | 2.687719 | 285 |
import os
import sys
import argparse
import glob
import pandas as pd
if __name__ == '__main__':
sys.exit(main())
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
15095,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
25064,
13,
37023,
7,
12417,
28955... | 2.809524 | 42 |
"""Module for interacting with analysis API"""
import inspect
from .base import JSONDict, handle_response, rate_limited
from .models import AnalysisRequest
from .session import HexpySession
class AnalysisAPI:
"""Class for working with Crimson Hexagon Analysis API.
# Example Usage
```python
>>> fro... | [
37811,
26796,
329,
24986,
351,
3781,
7824,
37811,
198,
198,
11748,
10104,
198,
198,
6738,
764,
8692,
1330,
19449,
35,
713,
11,
5412,
62,
26209,
11,
2494,
62,
10698,
198,
6738,
764,
27530,
1330,
14691,
18453,
198,
6738,
764,
29891,
1330,... | 1.9375 | 1,488 |
"""Utilities for interacting with the Jenkins CI API."""
from __future__ import unicode_literals
import json
import logging
from django.utils import six
from django.utils.six.moves.urllib.error import HTTPError
from django.utils.six.moves.urllib.parse import (quote, urlencode)
from django.utils.six.moves.urllib.requ... | [
37811,
18274,
2410,
329,
24986,
351,
262,
21835,
14514,
7824,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
26791,
1330,
2237... | 2.0332 | 3,494 |
#!/usr/bin/env python
"""
Counter the number of biomes in the world. Works only for Anvil-based world folders.
"""
import locale
import os
import sys
# local module
try:
import nbt
except ImportError:
# nbt not in search path. Let's see if it can be found in the parent folder
extrasearchpath = os.path.realpath(os.p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
31694,
262,
1271,
286,
3182,
2586,
287,
262,
995,
13,
10933,
691,
329,
1052,
2991,
12,
3106,
995,
24512,
13,
198,
37811,
198,
11748,
36693,
198,
11748,
28686,
198,
11748,
2... | 2.451677 | 507 |
#!/usr/bin/python
from mininet.net import Mininet
from mininet.node import Controller, OVSKernelAP
from mininet.cli import CLI
from mininet.link import TCLink
from mininet.log import setLogLevel
def topology():
"Create a network."
net = Mininet(controller=Controller, link=TCLink, accessPoint=OVSKernelAP)
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
949,
42504,
13,
3262,
1330,
1855,
42504,
198,
6738,
949,
42504,
13,
17440,
1330,
22741,
11,
440,
53,
18831,
7948,
2969,
198,
6738,
949,
42504,
13,
44506,
1330,
43749,
198,
6738,
94... | 2.256442 | 815 |
import os
from flask import Flask, render_template, request
from flask_bootstrap import Bootstrap
app = Flask (__name__)
Bootstrap(app)
application = app # for beanstalk
questions = [
{
"id": "1",
"question": "What are the maximum read replicas for MySQL, PostGreSQL, and MariaDB RDS?",
"a... | [
11748,
28686,
220,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
6738,
220,
42903,
62,
18769,
26418,
1330,
18892,
26418,
198,
1324,
796,
46947,
357,
834,
3672,
834,
8,
198,
36476,
26418,
7,
1324,
8,
198,
31438,
79... | 2.081514 | 687 |
import heapq
import bisect
#def minHeapify()
if __name__ == '__main__':
graph = {0: [(1, 1), (2, 2), (5, 6)], 1: [(3, 2), (0, 1)], 2: [(4, 5), (5, 3), (0, 2)], 3: [(1, 2)], 4: [(2, 5)], 5: [(0, 6), (2, 3)] }
parallel_graph = {0:[(1, 1), (2, 1), (3, 3)], 1: [(3, 2)], 2:[(3, 2),(4, 2)], 3:[(5,... | [
11748,
24575,
80,
198,
11748,
47457,
478,
198,
198,
2,
4299,
949,
1544,
499,
1958,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 1.833333 | 264 |
# Generated by Django 2.1 on 2021-07-19 19:40
import cloudinary.models
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
319,
33448,
12,
2998,
12,
1129,
678,
25,
1821,
198,
198,
11748,
6279,
3219,
13,
27530,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 3.117647 | 34 |
from .afcm import FCM, TopicManager # pylint: disable=unused-import
| [
6738,
764,
1878,
11215,
1330,
10029,
44,
11,
47373,
13511,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
11748,
198
] | 3 | 23 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import fuckcheat
import time
import random
if __name__ == '__main__':
main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
5089,
46799,
198,
11748,
640,
198,
11748,
4738,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
83... | 2.591837 | 49 |
# -*- coding: utf-8 -*-
class PWNAPIError(Exception):
"""
Base exceptions raised when PWN API causes errors
"""
class DjangoPWNError(Exception):
"""
Base exceptions raised when django-pwn application errors occur
"""
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
4871,
350,
29767,
17614,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7308,
13269,
4376,
618,
350,
29767,
7824,
5640,
8563,
198,
220,
220,
220,
... | 2.963415 | 82 |
import numpy as np
from joblib import Parallel, delayed
import pandas
from itertools import product
from libsvmdata.datasets import fetch_libsvm
from celer import LogisticRegression
from sparse_ho.models import SparseLogreg
from sparse_ho.ho import grad_search, hyperopt_wrapper
from sparse_ho.implicit_forward import I... | [
11748,
299,
32152,
355,
45941,
198,
6738,
1693,
8019,
1330,
42945,
11,
11038,
198,
11748,
19798,
292,
198,
6738,
340,
861,
10141,
1330,
1720,
198,
6738,
9195,
82,
14761,
7890,
13,
19608,
292,
1039,
1330,
21207,
62,
8019,
82,
14761,
198,... | 2.514694 | 1,191 |
#!/usr/bin/env python
from auvlib.data_tools import xtf_data, std_data, all_data
from auvlib.bathy_maps import mesh_map
import numpy as np
# # Load centered data
# std_pings_centered = std_data.mbes_ping.read_data("Data/std_pings_centered.cereal")
# # Load raw data .all file
# file_path = "/home/chs/Desktop/Sonar/D... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
257,
14795,
8019,
13,
7890,
62,
31391,
1330,
220,
742,
69,
62,
7890,
11,
14367,
62,
7890,
11,
477,
62,
7890,
198,
6738,
257,
14795,
8019,
13,
65,
10036,
62,
31803,
1330,
... | 2.310832 | 637 |
import os
import tempfile
import unittest
import matplotlib.pyplot as plt
import numpy as np
from fastestimator.test.unittest_util import is_equal, sample_system_object
from fastestimator.trace.io import ImageSaver
from fastestimator.util.data import Data
from fastestimator.util.img_data import ImgData
| [
11748,
28686,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
14162,
320,
1352,
13,
9288,
13,
403,
715,
395,
62... | 3.301075 | 93 |
"""
Multi TranslationDataset
=============================
"""
from .ted_multi import TedMultiTranslationDataset
| [
37811,
198,
198,
29800,
33322,
27354,
292,
316,
198,
4770,
25609,
28,
198,
37811,
198,
198,
6738,
764,
1513,
62,
41684,
1330,
11396,
29800,
48313,
27354,
292,
316,
198
] | 3.965517 | 29 |
'''
ECGR 5101 FINAL PROJECT
12/12/2018
REFERENCES:https://github.com/Mjrova
PROJECT TITLE: EYE MECHANISM FOR INMOOV ROBOT
PROJECT DESCRIPTION:
picam is used for the video and it is being sampled frame by frame. We identify the contour of the object in the frame using
opencv libraries and function... | [
7061,
6,
201,
198,
2943,
10761,
6885,
486,
25261,
21965,
23680,
201,
198,
1065,
14,
1065,
14,
7908,
201,
198,
2200,
24302,
24181,
1546,
25,
5450,
1378,
12567,
13,
785,
14,
44,
73,
305,
6862,
201,
198,
31190,
23680,
37977,
2538,
25,
... | 2.34301 | 1,309 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import xrange
import warnings
import logging
import keras.backend as K
from keras.callbacks import Callback, ModelCheckpoint
| [
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
2237,
13,
76,
5241,
1330,
2124,
9521,
198,
198,
11748,
14601,
198,
11748,
1893... | 3.833333 | 66 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from bottle import route, run, template
@route('/hello/<name>')
run(host='0.0.0.0', port=80)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
17,
13,
22,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
9294,
1330,
6339,
11,
1057,
11,
11055,
198,
31,
38629,
10786,
14,
31373,
14,
27,
3672,
29,
11537,
198,
5... | 2.225806 | 62 |
# -*- coding: utf-8 -*-
import gevent.monkey;gevent.monkey.patch_socket()
from gevent.pool import Pool
import codecs
import requests
from redis import Redis
from rq import Queue
from pyquery import PyQuery as pq
from bs4 import BeautifulSoup
from model import OneIssue
q = Queue(connection=Redis())
# q.enqueue_call(f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4903,
1151,
13,
49572,
26,
469,
1151,
13,
49572,
13,
17147,
62,
44971,
3419,
198,
6738,
4903,
1151,
13,
7742,
1330,
19850,
198,
11748,
40481,
82,
198,
11748,
7007... | 2.40553 | 217 |
import time
import cv2 as cv
from misc import utils
from classification.feature_classifier import FeatureClassifier
from misc.color_space import ColorSpace
from misc.model_tester import ModelTester, get_mean_accuracy
from data_io.testdata import TestData
import numpy as np
from math import sqrt
import data_io... | [
11748,
640,
201,
198,
11748,
269,
85,
17,
355,
269,
85,
201,
198,
6738,
12747,
1330,
3384,
4487,
201,
198,
6738,
17923,
13,
30053,
62,
4871,
7483,
1330,
27018,
9487,
7483,
201,
198,
6738,
12747,
13,
8043,
62,
13200,
1330,
5315,
14106,... | 2.18263 | 1,232 |
# -*- coding: utf-8 -*-
"""See log bayes factors which led to modality categorization"""
import locale
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
from .names import NEAR_ZERO, NEAR_HALF, NEAR_ONE, BIMODAL, \
NULL_MODEL
darkblue, green, r... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
6214,
2604,
15489,
274,
5087,
543,
2957,
284,
953,
1483,
17851,
1634,
37811,
198,
11748,
36693,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
80... | 2.168481 | 1,745 |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 17 13:04:03 2021
@author: Jionghao Fang
"""
import pandas as pd
import numpy as np
import random
from sklearn.preprocessing import StandardScaler
# from imblearn.over_sampling import SMOTE
from sklearn.decomposition import PCA
from sklearn.metrics import mea... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3300,
5267,
1596,
1511,
25,
3023,
25,
3070,
33448,
201,
198,
201,
198,
31,
9800,
25,
449,
295,
456,
5488,
24468,
201,
198,
37811,
201... | 2.004494 | 4,673 |
import datetime
from django.utils.translation import ugettext as _
| [
11748,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
355,
4808,
198
] | 3.578947 | 19 |
from __future__ import absolute_import
# Event types
from pypapi.papi import * # noqa: flake8 can't deal with Cython
from pypapi.papi import populate_events
populate_events()
del populate_events
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
2,
8558,
3858,
198,
6738,
279,
4464,
15042,
13,
79,
15042,
1330,
1635,
220,
220,
220,
1303,
645,
20402,
25,
781,
539,
23,
460,
470,
1730,
351,
327,
7535,
198,
198,
6738,
279,... | 3.060606 | 66 |
"""
Desenvolva um programa que leia quatro valores pelo teclado e guarde-os em uma tupla. No final, mostre:
A) Quantas vezes apareceu o valor 9
B) Em que posição foi digitado o primeiro valor 3
C) Quais foram os números pares
"""
num = (int(input('Digite um número: ')), int(input('Digite outro número: ')),int(input('D... | [
37811,
198,
5960,
268,
10396,
6862,
23781,
1430,
64,
8358,
443,
544,
627,
47756,
1188,
2850,
16176,
78,
573,
565,
4533,
304,
4860,
68,
12,
418,
795,
334,
2611,
12777,
489,
64,
13,
1400,
2457,
11,
749,
260,
25,
198,
32,
8,
16972,
2... | 2.135392 | 421 |
import enum
import pathlib
import typing as t
import dearpygui.dearpygui as dpg
from dearpygui_ext import themes
from ... import util
from ... import error as e
_ASSET_FOLDER = pathlib.Path(__file__).parent.resolve()
_THEMES_CACHE = {}
| [
11748,
33829,
198,
11748,
3108,
8019,
198,
11748,
19720,
355,
256,
198,
198,
11748,
390,
5117,
88,
48317,
13,
67,
451,
9078,
48317,
355,
288,
6024,
198,
6738,
390,
5117,
88,
48317,
62,
2302,
1330,
13460,
198,
198,
6738,
2644,
1330,
77... | 2.764045 | 89 |
# Generated by Django 2.2 on 2019-05-12 22:23
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
319,
13130,
12,
2713,
12,
1065,
2534,
25,
1954,
201,
198,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
201,
198,
201,
198
] | 2.657143 | 35 |
import managers
from flask_redis import FlaskRedis
from flask import Flask
# Instantiate and config flask
flask_app = Flask(__name__)
flask_app.config.update(
CELERY_BROKER_URL=managers.celery_config.CELERY_BROKER_URL,
CELERY_RESULT_BACKEND=managers.celery_config.CELERY_RESULT_BACKEND,
REDIS_URL=managers.c... | [
11748,
11663,
198,
6738,
42903,
62,
445,
271,
1330,
46947,
7738,
271,
198,
6738,
42903,
1330,
46947,
198,
198,
2,
24470,
9386,
290,
4566,
42903,
198,
2704,
2093,
62,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
2704,
2093,
62,
1324,
... | 2.738532 | 218 |
import nose
@nose.tools.nottest
def run_tests(script_path, test_module=None):
"""
Run tests which are contained in `test_module` for script
whose location is specified in `script_path` (typically, is
called as __file__).
"""
params = ['', script_path]
if test_module:
params.append(... | [
11748,
9686,
628,
198,
31,
77,
577,
13,
31391,
13,
77,
24879,
198,
4299,
1057,
62,
41989,
7,
12048,
62,
6978,
11,
1332,
62,
21412,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5660,
5254,
543,
389,
7763,
287,
46... | 2.640523 | 153 |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | [
2,
15069,
2864,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
198,
2,
921,
743,
407,
779,
428,
2393,
... | 2.801756 | 1,367 |
import point
"""
Embarrasingly rudimentary postscript module
The module gives you 72 pitch drawing surface on an 8 1/2 x 11
portrait type paper. It sets the ULC as x=0m y=0
it gives text, line and arrow drawing primitives
It gives a Courier font class with font metrics.
"""
color_mods = {
'red' : " 1... | [
11748,
966,
198,
198,
37811,
220,
198,
197,
31567,
3258,
2313,
306,
47381,
1281,
12048,
8265,
198,
197,
198,
197,
464,
8265,
3607,
345,
7724,
7078,
8263,
4417,
319,
281,
807,
352,
14,
17,
2124,
1367,
220,
198,
197,
634,
12907,
2099,
... | 2.406621 | 1,178 |
import sys
import os
import time
import socket
import pickle
import argparse
import datetime
import signal
sys.path.append('/usr/lib/python2.7/dist-packages/python_sdk_api/')
sys.path.append('/usr/lib/python2.7/site-packages/python_sdk_api/')
sys.path.append('/usr/local/lib/python2.7/dist-packages/python_sdk_api/')
sy... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
17802,
198,
11748,
2298,
293,
198,
11748,
1822,
29572,
198,
11748,
4818,
8079,
198,
11748,
6737,
198,
198,
17597,
13,
6978,
13,
33295,
10786,
14,
14629,
14,
8019,
14,
29412,
... | 2.538462 | 195 |
import os
import configparser
from datetime import datetime
from pyspark.sql.types import *
from pyspark.sql import SparkSession
from pyspark.sql.functions import udf
def create_spark_session():
"""
Create spark session on AWS
"""
spark = SparkSession \
.builder \
.appName("MusicHub") \... | [
11748,
28686,
198,
11748,
4566,
48610,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
279,
893,
20928,
13,
25410,
13,
19199,
1330,
1635,
198,
6738,
279,
893,
20928,
13,
25410,
1330,
17732,
36044,
198,
6738,
279,
893,
20928,
13,
254... | 2.178272 | 2,743 |
"""Constants for the Smartbroker integration."""
DOMAIN = "smartbroker"
| [
37811,
34184,
1187,
329,
262,
10880,
7957,
6122,
11812,
526,
15931,
198,
198,
39170,
29833,
796,
366,
27004,
7957,
6122,
1,
198
] | 3.318182 | 22 |
# democratic_bias = '''The Democratic Party's philosophy of modern liberalism advocates social and economic equality, along with the welfare state. It seeks to provide government regulation in the economy to promote the public interest. Environmental protection, support for organized labor, maintenance and expansion of... | [
2,
10518,
62,
65,
4448,
796,
705,
7061,
464,
4390,
3615,
338,
8876,
286,
3660,
33108,
11009,
1919,
290,
3034,
10537,
11,
1863,
351,
262,
9490,
1181,
13,
632,
12932,
284,
2148,
1230,
9001,
287,
262,
3773,
284,
7719,
262,
1171,
1393,
... | 4.892222 | 900 |
import os
from flask import Flask, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
# Init the app
app = Flask(__name__)
# Config the data base
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DB_URI', 'sqlite://')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.con... | [
11748,
28686,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
76,
5406,
42725,
1330,
9786,
42725,
628,
198,
2,
44707,
262,
598,
198,
1324,
796,
469... | 2.638132 | 257 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
try:
from Ska.Matplotlib import plot_cxctime
except ImportError:
pass
from .base import ModelComponent
from .heat import PrecomputedHeatPower
from . import tmal
class AcisDpaPower6(PrecomputedHeatPower):
"""Heating from A... | [
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
532,
766,
38559,
24290,
13,
81,
301,
198,
11748,
299,
32152,
355,
45941,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
3661,
64,
13,
19044,
29487,
8019,
1330,
7110,
62,
... | 3.009434 | 212 |
from cProfile import label
import numpy as np
import matplotlib.pyplot as plt
if __name__ == '__main__':
# nsf_report()
nsf_grouping_comp()
nsf_selection_comp()
nsf_p_comp()
nsf_gs_comp()
# nsf_gs_cost_comp() | [
198,
6738,
269,
37046,
1330,
6167,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1303,
29... | 2.257143 | 105 |
# Generated by Django 2.2.13 on 2020-07-06 10:29
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1485,
319,
12131,
12,
2998,
12,
3312,
838,
25,
1959,
198,
198,
11748,
42625,
14208,
13,
3642,
822,
13,
7353,
34239,
13,
25747,
13,
17752,
65,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,... | 2.893617 | 47 |
# Generated by Django 3.1.14 on 2022-01-15 18:42
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
1415,
319,
33160,
12,
486,
12,
1314,
1248,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.840909 | 44 |
# 784. Letter Case Permutation
# Runtime: 91 ms, faster than 19.56% of Python3 online submissions for Letter Case Permutation.
# Memory Usage: 15.6 MB, less than 16.05% of Python3 online submissions for Letter Case Permutation.
# Iteration | [
2,
767,
5705,
13,
18121,
8913,
2448,
76,
7094,
198,
198,
2,
43160,
25,
10495,
13845,
11,
5443,
621,
678,
13,
3980,
4,
286,
11361,
18,
2691,
22129,
329,
18121,
8913,
2448,
76,
7094,
13,
198,
198,
2,
14059,
29566,
25,
1315,
13,
21,
... | 3.464789 | 71 |
# Generated by Django 3.1.4 on 2021-08-04 21:40
from django.db import migrations, models
import django.utils.timezone
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
19,
319,
33448,
12,
2919,
12,
3023,
2310,
25,
1821,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
26791,
13,
2435,
11340,
628
] | 2.926829 | 41 |
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
# This is a simple example for a custom action which utters "Hello World!"
from typing import Any, Text, Dict, List
... | [
2,
770,
3696,
4909,
534,
2183,
4028,
543,
460,
307,
973,
284,
1057,
198,
2,
2183,
11361,
2438,
13,
198,
2,
198,
2,
4091,
428,
5698,
319,
703,
284,
3494,
777,
2223,
25,
198,
2,
3740,
1378,
8847,
64,
13,
785,
14,
31628,
14,
8847,
... | 2.374923 | 1,627 |
import os
from d3m import utils
try:
import d3m.__init__ as d3m_info
D3M_API_VERSION = d3m_info.__version__
except Exception:
D3M_API_VERSION = '2019.1.9'
VERSION = "0.2.0"
TAG_NAME = "{git_commit}".format(git_commit=utils.current_git_commit(os.path.dirname(__file__)), )
REPOSITORY = "https://github.com/... | [
11748,
28686,
198,
6738,
288,
18,
76,
1330,
3384,
4487,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
288,
18,
76,
13,
834,
15003,
834,
355,
288,
18,
76,
62,
10951,
198,
220,
220,
220,
360,
18,
44,
62,
17614,
62,
43717,
796,
28... | 2.110855 | 433 |
# MIT License
#
# Copyright (c) 2018-2019 Red Hat, Inc.
# 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, copy, modify, m... | [
2,
17168,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
12,
23344,
2297,
10983,
11,
3457,
13,
198,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3... | 3.018034 | 1,109 |
#!/usr/bin/env python
from math import pi
from typing import Union
import glm
from glm import dot, cross, vec3, vec2, normalize, rotate, identity, quat
from pygame import Vector3
from game.base.entity import Entity
from game.constants import EPSILON, SCREEN_DIST
class Camera(Entity):
"""
A camera whose posi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
10688,
1330,
31028,
198,
6738,
19720,
1330,
4479,
198,
198,
11748,
1278,
76,
198,
6738,
1278,
76,
1330,
16605,
11,
3272,
11,
43030,
18,
11,
43030,
17,
11,
3487,
1096,
11,
23064,
... | 2.421165 | 1,408 |
#!/usr/bin/python
import sys
import json
from ansible.module_utils import ntap_util
try:
from NaServer import *
NASERVER_AVAILABLE = True
except ImportError:
NASERVER_AVAILABLE = False
if not NASERVER_AVAILABLE:
module.fail_json(msg="The NetApp Manageability SDK library is not installed")
DOCUMENTA... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
25064,
198,
11748,
33918,
198,
6738,
220,
9093,
856,
13,
21412,
62,
26791,
1330,
299,
44335,
62,
22602,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
11013,
10697,
1330,
1635,
198... | 2.672241 | 598 |
# Enter your code here. Read input from STDIN. Print output to STDOUT
from collections import Counter
if __name__ == '__main__':
X = int( input() )
shoe_size_in_warehouse = list( map(int, input().split() ) )
size_dict = Counter(shoe_size_in_warehouse)
N = int( input() )
total_revenue = 0
... | [
2,
6062,
534,
2438,
994,
13,
4149,
5128,
422,
48571,
1268,
13,
12578,
5072,
284,
48571,
12425,
198,
6738,
17268,
1330,
15034,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
220,
220,
220,
1395,
796,
493,... | 2.586735 | 196 |
x_y=('planet' , 'range')
'''planet''', '''range'''
print ('(A) corporations spc by Ayush')
print ('Collecting Data.....')
print ('press enter...')
x = input()
print ('process completed')
print ('Type the name of the planet')
y = input()
if y == ('earth'):
print ('!')
if y == ('mars'):
print ('!')
... | [
87,
62,
88,
28,
10786,
47427,
6,
837,
705,
9521,
11537,
201,
198,
7061,
6,
47427,
7061,
3256,
705,
7061,
9521,
7061,
6,
201,
198,
4798,
19203,
7,
32,
8,
10225,
599,
66,
416,
13709,
1530,
11537,
201,
198,
4798,
19203,
31337,
278,
6... | 2.451852 | 135 |
# Authors: Pierre Ablin <pierre.ablin@inria.fr>
#
# License: MIT
import numpy as np
import numba as nb
from numba import njit
from ._utils import cg
from ._densities import Huber, Sigmoid
def solver_incremental(X, max_iter=100, batch_size=100, W_init=None,
density='huber', maxiter_cg=10, greed... | [
2,
46665,
25,
21204,
2275,
2815,
1279,
79,
31058,
13,
397,
2815,
31,
259,
7496,
13,
8310,
29,
198,
2,
198,
2,
13789,
25,
17168,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
997,
7012,
355,
299,
65,
198,
6738,
997,
7012,
1330,
2... | 2.026403 | 2,424 |
"""
distribution.py
Author: kyDoleuc04
Credit: tutorials, andrew, matt, chris lee, google
Assignment:
Write and submit a Python program (distribution.py) that computes and displays
the distribution of characters in a given sample of text.
Output of your program should look like this:
Please enter a string of text ... | [
37811,
198,
17080,
3890,
13,
9078,
198,
13838,
25,
479,
88,
35,
2305,
1229,
3023,
198,
23690,
25,
27992,
11,
290,
1809,
11,
23963,
11,
442,
2442,
443,
68,
11,
23645,
198,
198,
8021,
16747,
25,
198,
198,
16594,
290,
9199,
257,
11361,... | 2.915423 | 603 |
from datetime import datetime, timedelta
from collections import defaultdict
import itertools
import pickle
import time
import logging
logger = logging.getLogger("disempower.interval")
CREDITS = defaultdict(int) # per-user bank
INTERVALS = defaultdict(list) # per-user allowable times
BLACKOUTS = def... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
201,
198,
6738,
17268,
1330,
4277,
11600,
201,
198,
11748,
340,
861,
10141,
201,
198,
11748,
2298,
293,
201,
198,
11748,
640,
201,
198,
201,
198,
11748,
18931,
201,
198,
6404,
1362,
... | 2.274455 | 1,421 |
from __future__ import division
import scipy.optimize
import numpy as np
import cv2
# -----------------------------------------------------------------------------------------
def parse_wider_gt(dets_file_name, isEllipse=False):
# --------------------------------------------------------------------------------------... | [
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
629,
541,
88,
13,
40085,
1096,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
628,
198,
2,
16529,
22369,
12,
198,
4299,
21136,
62,
86,
1304,
62,
13655,
7,
67,
1039,... | 2.659417 | 2,575 |
from torch.optim.optimizer import Optimizer, required
import numpy as np
import torch
class SGLD(Optimizer):
"""
Barely modified version of pytorch SGD to implement SGLD
"""
def step(self):
"""
Performs a single optimization step.
"""
loss = None
for ... | [
6738,
28034,
13,
40085,
13,
40085,
7509,
1330,
30011,
7509,
11,
2672,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
628,
198,
4871,
311,
8763,
35,
7,
27871,
320,
7509,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3823... | 1.864347 | 3,708 |
from payton.scene import Scene
from payton.scene.geometry import Cube
from payton.scene.gui import info_box
scene = Scene()
cube = Cube()
cube.track_motion = True
scene.add_object("cube", cube)
scene.create_clock("forward", 0.2, move_forward)
scene.create_clock("back", 0.2, step_back_history)
scene.add_object(
... | [
6738,
1414,
1122,
13,
29734,
1330,
28315,
198,
6738,
1414,
1122,
13,
29734,
13,
469,
15748,
1330,
23315,
198,
6738,
1414,
1122,
13,
29734,
13,
48317,
1330,
7508,
62,
3524,
198,
198,
29734,
796,
28315,
3419,
628,
628,
198,
40296,
796,
... | 2.542857 | 175 |
# 239. Sliding Window Maximum
# Runtime: 2552 ms, faster than 8.82% of Python3 online submissions for Sliding Window Maximum.
# Memory Usage: 30.8 MB, less than 14.24% of Python3 online submissions for Sliding Window Maximum.
# Deque
| [
2,
32817,
13,
3454,
2530,
26580,
22246,
198,
198,
2,
43160,
25,
1679,
4309,
13845,
11,
5443,
621,
807,
13,
6469,
4,
286,
11361,
18,
2691,
22129,
329,
3454,
2530,
26580,
22246,
13,
198,
198,
2,
14059,
29566,
25,
1542,
13,
23,
10771,
... | 3.492754 | 69 |
import gensim
import _init_paths
import utils.zl_utils as zl
from numpy.random import randn
from sklearn.decomposition import sparse_encode
import numpy as np
from sklearn.decomposition import SparseCoder
import pycocotools.coco as coco
import random
import zl_config as C
n = m = 100 # dimensions of our input
input_x =... | [
11748,
308,
641,
320,
198,
11748,
4808,
15003,
62,
6978,
82,
198,
11748,
3384,
4487,
13,
48274,
62,
26791,
355,
1976,
75,
198,
6738,
299,
32152,
13,
25120,
1330,
43720,
77,
198,
6738,
1341,
35720,
13,
12501,
296,
9150,
1330,
29877,
62... | 2.666667 | 192 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2019-06-13 16:24
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
24,
319,
13130,
12,
3312,
12,
1485,
1467,
25,
1731,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
#locationHelper.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2017-2018 NV Access Limited, Babbage B.V.
"""Classes and helper functions for working with rectangles and coordinates."""
from collections impor... | [
2,
24886,
47429,
13,
9078,
198,
2,
32,
636,
286,
8504,
36259,
27850,
8798,
357,
27159,
5631,
8,
198,
2,
1212,
2393,
318,
5017,
416,
262,
22961,
3611,
5094,
13789,
13,
198,
2,
6214,
262,
2393,
27975,
45761,
329,
517,
3307,
13,
198,
... | 2.804889 | 4,459 |
import torch
class Actor(torch.nn.Module):
"""
this is the policy network
"""
| [
11748,
28034,
198,
198,
4871,
27274,
7,
13165,
354,
13,
20471,
13,
26796,
2599,
628,
197,
37811,
628,
197,
5661,
318,
262,
2450,
3127,
628,
197,
37811,
628,
198
] | 3 | 29 |
import sys
import unittest
import numpy
from pathlib import Path
from typing import Tuple, List
import trueskill
sys.path.insert(0, str(Path(__file__).parent.parent / 'autoleague'))
from bots import BotID
from leaguesettings import LeagueSettings
from match_maker import MatchMaker, TicketSystem
from ranking_system i... | [
11748,
25064,
198,
11748,
555,
715,
395,
198,
11748,
299,
32152,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
309,
29291,
11,
7343,
198,
198,
11748,
491,
947,
12728,
198,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
965,... | 3.175676 | 148 |
# -*- coding: utf-8 -*-
# @version : Python3.6
# @Time : 2017/4/21 15:56
# @Author : Jianyang-Hu
# @contact : jianyang1993@163.com
# @File : stock_csv_0421.py
# @Software: PyCharm
import numpy
from numpy import *
from datetime import datetime
#usecols=(4,5)计数从0开始
c,v = loadtxt("stocks.csv",delimiter=",",usecols... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
9641,
1058,
11361,
18,
13,
21,
198,
2,
2488,
7575,
220,
220,
220,
1058,
2177,
14,
19,
14,
2481,
1315,
25,
3980,
198,
2,
2488,
13838,
220,
1058,
40922,
17859... | 2.01476 | 813 |
#!/usr/bin/env python3
print(("str = %s" % str(str)))
print(("str = %s" % str(dir(str))))
str1 = "bytes"
print(("str1 = %s" % str1))
str2 = str1.encode()
print(("str2 = %s" % str2))
str3 = str2.decode()
print(("str3 = %s" % str3))
if str1 == str3:
print("coverted ok")
else:
print("FAIL did not covert ok")
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
4798,
7,
7203,
2536,
796,
4064,
82,
1,
4064,
965,
7,
2536,
22305,
198,
198,
4798,
7,
7203,
2536,
796,
4064,
82,
1,
4064,
965,
7,
15908,
7,
2536,
35514,
198,
198,
2536,
1... | 2.124324 | 185 |
import json
# read from string
json_data = open('./test/test.json').read()
data = json.loads(json_data)
print(data['1']['damage'])
# read from file
json_data_1 = open('./test/test.json')
data2 = json.load(json_data_1)
print(data2['1']['nameArr'])
| [
11748,
33918,
198,
198,
2,
1100,
422,
4731,
198,
17752,
62,
7890,
796,
1280,
7,
4458,
14,
9288,
14,
9288,
13,
17752,
27691,
961,
3419,
198,
7890,
796,
33918,
13,
46030,
7,
17752,
62,
7890,
8,
198,
4798,
7,
7890,
17816,
16,
6,
7131... | 2.460784 | 102 |
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Hook to install the git config for using the clang-format merge driver."""
import os
import subprocess
import sys
_VERSION = 1
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
1584,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,... | 3.388889 | 108 |
"""Equation definitions for SINDy-BVP."""
# Python Package Imports
from typing import List
# Third party imports
import numpy as np
def sturm_liouville_function(x, y, p, p_x, q, f, alpha=0, nonlinear_exp=2):
"""Second order Sturm-Liouville Function defining y'' for Lu=f.
This form is used because it is exp... | [
37811,
23588,
341,
17336,
329,
311,
12115,
88,
12,
33,
8859,
526,
15931,
198,
198,
2,
11361,
15717,
1846,
3742,
198,
6738,
19720,
1330,
7343,
198,
198,
2,
10467,
2151,
17944,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
336,
33... | 2.215398 | 1,156 |
import unittest
import datetime
from data.mongoDB import MongoDB_Context
from data.valheim_player import Player, TotalDeaths, PlayerServerStats
from mongoengine import * | [
11748,
555,
715,
395,
198,
11748,
4818,
8079,
198,
6738,
1366,
13,
76,
25162,
11012,
1330,
42591,
11012,
62,
21947,
198,
6738,
1366,
13,
2100,
9096,
62,
7829,
1330,
7853,
11,
7472,
20148,
82,
11,
7853,
10697,
29668,
198,
6738,
285,
25... | 3.695652 | 46 |
from django.core.urlresolvers import reverse
from django.http import Http404
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from problems.forms.export import ExportForm
from problems.models import ExportPackage, ExportPackageCreationTask
from problems.... | [
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
11,
367,
29281,
31077,
7738,
1060,
198,
6738,
426... | 3.949495 | 99 |
import json
import math
import os
import re
import string
from pprint import pprint
from functools import reduce
def modify_for_re(word):
"""在字符串中的(及)前面加上\, 方便转换成正则表达式"""
to_be_removed = ['(', ')', '+', '*', '^', '.', '?', '$', '|']
for signal in to_be_removed:
word = word.replace(s... | [
11748,
33918,
201,
198,
11748,
10688,
201,
198,
11748,
28686,
201,
198,
11748,
302,
201,
198,
11748,
4731,
201,
198,
201,
198,
6738,
279,
4798,
1330,
279,
4798,
201,
198,
6738,
1257,
310,
10141,
1330,
4646,
201,
198,
201,
198,
201,
19... | 1.518241 | 5,071 |
"""
Label - Name
TextEntry
Labl - Email
TextEntry
Button - Submit
"""
import Tkinter as tk
root = tk.Tk()
tk.Label(root, text="Name:", anchor="w").pack(fill="x")
tk.Entry(root).pack(fill="x")
tk.Label(root,text="Email:", anchor="w").pack(fill="x")
tk.Entry(root).pack(fill="x")
tk.Button(root,text="Submit").pack... | [
37811,
198,
33986,
532,
6530,
198,
8206,
30150,
198,
198,
17822,
75,
532,
9570,
198,
8206,
30150,
198,
198,
21864,
532,
39900,
198,
37811,
628,
198,
11748,
309,
74,
3849,
355,
256,
74,
198,
198,
15763,
796,
256,
74,
13,
51,
74,
3419... | 2.475177 | 141 |
# ------------------------------------------------------------------------
# QAHOI
# Copyright (c) 2021 Junwen Chen. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
# Copyright (c) Hitachi, Ltd. Al... | [
2,
16529,
982,
198,
2,
1195,
18429,
46,
40,
198,
2,
15069,
357,
66,
8,
33448,
7653,
21006,
12555,
13,
1439,
6923,
33876,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
685,
3826,
38559,
24290,
329,
3307,
60,
19... | 4.073864 | 176 |
# Copyright 2018 Samuel Payne sam_payne@byu.edu
# 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 ... | [
2,
220,
220,
15069,
2864,
17100,
32788,
6072,
62,
15577,
710,
31,
1525,
84,
13,
15532,
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,
42... | 2.527009 | 759 |
import pandas as pd
import time
from bs4 import BeautifulSoup
from IPython.display import display_html
from selenium import webdriver
from mysql_service import insert_day
if __name__ == "__main__":
selenium_scraper()
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
640,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
6738,
6101,
7535,
13,
13812,
1330,
3359,
62,
6494,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
48761,
62,
15271... | 3.214286 | 70 |
import os
import struct
from glob import glob
import pandas as pd
import numpy as np
from pyspectools import ftmw_analysis as fa
def parse_spectrum(filename, threshold=20.0):
""" Function to read in a blackchirp or QtFTM spectrum from file """
dataframe = pd.read_csv(
filename, delimiter="\t", names... | [
11748,
28686,
198,
11748,
2878,
198,
6738,
15095,
1330,
15095,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
279,
893,
806,
10141,
1330,
10117,
76,
86,
62,
20930,
355,
24685,
628,
198,
... | 2.008308 | 5,898 |