content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import os
from os.path import dirname
from unittest import TestCase
import pytest
import src.superannotate as sa
| [
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
11748,
12972,
9288,
198,
11748,
12351,
13,
16668,
34574,
378,
355,
473,
628,
198
] | 3.484848 | 33 |
import pyamg
from . import gmg_base | [
11748,
12972,
321,
70,
198,
6738,
764,
1330,
308,
11296,
62,
8692
] | 2.916667 | 12 |
"""
Code to plot average nearest neighbor distance between fish in a school as a function of group size - one line per water temperature.
"""
# imports
import sys, os
import numpy as np
import matplotlib.pyplot as plt
import pickle
from matplotlib import cm
import argparse
#argparse
# create the parser object
pars... | [
37811,
198,
10669,
284,
7110,
2811,
16936,
4780,
5253,
1022,
5916,
287,
257,
1524,
355,
257,
2163,
286,
1448,
2546,
532,
530,
1627,
583,
1660,
5951,
13,
220,
198,
37811,
198,
198,
2,
17944,
198,
11748,
25064,
11,
28686,
198,
11748,
29... | 2.447469 | 5,473 |
"""
.. module:: tools.__init__
:synopsis: This package contains tools for handling results obtained with the
main SModelS code.
"""
| [
37811,
198,
492,
8265,
3712,
4899,
13,
834,
15003,
834,
198,
220,
220,
220,
1058,
28869,
24608,
25,
770,
5301,
4909,
4899,
329,
9041,
2482,
6492,
351,
262,
198,
220,
220,
220,
220,
220,
220,
1388,
311,
17633,
50,
2438,
13,
198,
3781... | 3.272727 | 44 |
"""Author: Brandon Trabucco.
Utility class for loading and managing locations in the robot's map.
"""
import json
import math
import rospy
from rt_msgs.msg import Odom
from std_msgs.msg import Header
from geometry_msgs.msg import Pose
from geometry_msgs.msg import Point
from geometry_msgs.msg import Quaternion
from g... | [
37811,
13838,
25,
14328,
833,
397,
18863,
78,
13,
198,
18274,
879,
1398,
329,
11046,
290,
11149,
7064,
287,
262,
9379,
338,
3975,
13,
198,
37811,
628,
198,
11748,
33918,
198,
11748,
10688,
198,
11748,
686,
2777,
88,
198,
6738,
374,
83... | 3.206897 | 232 |
from rest_framework import serializers
from joplin_web.models import Folders, Notes, Tags, NoteTags, Version
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
474,
404,
2815,
62,
12384,
13,
27530,
1330,
39957,
364,
11,
11822,
11,
44789,
11,
5740,
36142,
11,
10628,
628,
628,
628,
198
] | 3.515152 | 33 |
import datetime
from app.constants import Constants as c
from app.input import InputMonthly
from app.output import OutputFactory
from app.create import CreatorUtility, SolverMIP
inp = InputMonthly()
out = OutputFactory()
solv = SolverMIP()
creator = CreatorUtility(inp, out, solv)
settings = {c.START: datetime.date(2... | [
11748,
4818,
8079,
198,
198,
6738,
598,
13,
9979,
1187,
1330,
4757,
1187,
355,
269,
198,
6738,
598,
13,
15414,
1330,
23412,
31948,
306,
198,
6738,
598,
13,
22915,
1330,
25235,
22810,
198,
6738,
598,
13,
17953,
1330,
21038,
18274,
879,
... | 2.685185 | 162 |
"""
NCL_sat_3.py
================
This script illustrates the following concepts:
- zooming into an orthographic projection
- plotting filled contour data on an orthographic map
- plotting lat/lon tick marks on an orthographic map
See following URLs to see the reproduced NCL plot & script:
- Original ... | [
37811,
198,
45,
5097,
62,
49720,
62,
18,
13,
9078,
198,
4770,
198,
198,
1212,
4226,
21290,
262,
1708,
10838,
25,
198,
220,
220,
220,
532,
1976,
30602,
656,
281,
29617,
6826,
20128,
198,
220,
220,
220,
532,
29353,
5901,
542,
454,
136... | 2.144375 | 2,071 |
from bot import db
| [
6738,
10214,
1330,
20613,
628,
628,
628,
198
] | 3.125 | 8 |
import typing
from operator import itemgetter
from http_types import HttpExchange
from jsonpath_rw import parse
from openapi_typed_2 import OpenAPIObject, convert_from_openapi, convert_to_openapi
from meeshkan.nlp.data_extractor import DataExtractor
from meeshkan.nlp.entity_extractor import EntityExtractor
from meesh... | [
11748,
19720,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
198,
6738,
2638,
62,
19199,
1330,
367,
29281,
3109,
3803,
198,
6738,
33918,
6978,
62,
31653,
1330,
21136,
198,
6738,
1280,
15042,
62,
774,
9124,
62,
17,
1330,
4946,
17614,
1026... | 3.380952 | 147 |
from flask import render_template, request
from . import main
| [
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
198,
6738,
764,
1330,
1388,
198
] | 4.428571 | 14 |
import os
import sys
import torch.nn as nn
if True:
DDLNN_HOME = os.environ['DDLNN_HOME']
meta_rule_home = '{}/src/meta_rule/'.format(DDLNN_HOME)
src_rule_home = '{}/dd_lnn/'.format(DDLNN_HOME)
sys.path.append(meta_rule_home)
sys.path.append(src_rule_home)
from lnn_operators \
impor... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
361,
6407,
25,
198,
220,
220,
220,
360,
19260,
6144,
62,
39069,
796,
28686,
13,
268,
2268,
17816,
16458,
43,
6144,
62,
39069,
20520,
628,
220,... | 2.165803 | 193 |
import moto
import boto3
| [
11748,
285,
2069,
198,
11748,
275,
2069,
18,
628
] | 2.888889 | 9 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 12 21:22:49 2021
@author: Hrishikesh Terdalkar
"""
###############################################################################
__author__ = """Hrishikesh Terdalkar"""
__email__ = 'hrishikeshrt@linuxmail.org'
__version__ = '0.0.2'
###########... | [
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
2758,
1105,
2310,
25,
1828,
25,
2920,
33448,
198,
198,
31,
9800,
25,
367,
3751... | 3.467213 | 122 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v3.1.3),
on June 24, 2019, at 16:21
If you publish work using this script please cite the PsychoPy publications:
Peirce, JW (2007) PsychoPy - Psychophysics software in Python.
Journal of Neu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1212,
6306,
373,
2727,
1262,
38955,
20519,
18,
29544,
35869,
357,
85,
18,
13,
16,
13,
18,
828,
198,
220,
... | 2.678929 | 6,198 |
from pydatastructsalgorithms import tree_list as tree
# r = tree.binary_tree(3)
# tree.insert_left(r, 4)
# tree.insert_left(r, 5)
# tree.insert_right(r, 6)
# tree.insert_right(r, 7)
# l = tree.get_left_child(r)
# tree.set_root_val(l, 9)
# tree.insert_left(l, 11)
# print(tree.get_right_child(tree.get_right_child(r)))
... | [
6738,
279,
5173,
265,
459,
1356,
21680,
7727,
907,
1330,
5509,
62,
4868,
355,
5509,
198,
198,
2,
374,
796,
5509,
13,
39491,
62,
21048,
7,
18,
8,
198,
2,
5509,
13,
28463,
62,
9464,
7,
81,
11,
604,
8,
198,
2,
5509,
13,
28463,
62... | 2.326613 | 248 |
from flask import _app_ctx_stack, jsonify
from choptop import app
| [
6738,
42903,
1330,
4808,
1324,
62,
49464,
62,
25558,
11,
33918,
1958,
198,
6738,
30506,
4852,
1330,
598,
198
] | 3.473684 | 19 |
# ----------------------- PATH ------------------------
ROOT_PATH = "."
DATA_PATH = "%s/../Datasets" % ROOT_PATH
FB15K_DATA_PATH = "%s/fb15k" % DATA_PATH
DB100K_DATA_PATH = "%s/db100k" % DATA_PATH
FB15K_SPARSE_DATA_PATH = "%s/fb15k-sparse" % DATA_PATH
LOG_PATH = "%s/log_dir" % ROOT_PATH
CHECKPOINT_PATH = "%s/checkpoi... | [
2,
41436,
6329,
46490,
220,
22369,
198,
198,
13252,
2394,
62,
34219,
796,
366,
526,
198,
26947,
62,
34219,
796,
36521,
82,
14,
40720,
27354,
292,
1039,
1,
4064,
15107,
2394,
62,
34219,
198,
26001,
1314,
42,
62,
26947,
62,
34219,
796,
... | 1.942569 | 1,985 |
from flask import Flask
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from werkzeug.serving import run_simple
from Base import Telemetric, CONFIG
__all__ = ['start_app']
__version__ = "0.1.0"
LOGGER = Telemetric.LOGGER.getChild('WebApp')
APP = Flask(__name__)
HOSTNAME = CONFIG.get('WebApp', 'HOST',... | [
6738,
42903,
1330,
46947,
198,
6738,
266,
9587,
2736,
1018,
13,
27171,
1574,
13,
6381,
8071,
2044,
1330,
3167,
8071,
2044,
34621,
1574,
198,
6738,
266,
9587,
2736,
1018,
13,
31293,
1330,
1057,
62,
36439,
198,
198,
6738,
7308,
1330,
1431... | 2.650224 | 223 |
''' testsvg.py '''
import pygal
fa4_in_packets = [24, 21, 40, 32, 21, 21, 49, 9, 21, 34, 24, 21]
fa4_out_packets = [21, 24, 21, 40, 32, 21, 21, 49, 9, 21, 34, 24]
# Create a Chart of type Line
line_chart = pygal.Line()
# Title
line_chart.title = 'Input/Output Packets and Bytes'
# X-axis labels (samples were every ... | [
7061,
6,
5254,
45119,
13,
9078,
705,
7061,
198,
198,
11748,
12972,
13528,
198,
198,
13331,
19,
62,
259,
62,
8002,
1039,
796,
685,
1731,
11,
2310,
11,
2319,
11,
3933,
11,
2310,
11,
2310,
11,
5125,
11,
860,
11,
2310,
11,
4974,
11,
... | 2.554307 | 267 |
import urllib.parse, urllib.request, json, ssl
# Authentication and API Requests
# LEARNING LAB 2 Cisco Kinetic for Cities
# The Initial login steps are the same as Learning Lab 1.
# You can skip ahead to 'LEARNING LAB 2 CODE BEGINS HERE'
#Ignore invalid Certificates
ssl._create_default_https_context = ssl._create_... | [
11748,
2956,
297,
571,
13,
29572,
11,
2956,
297,
571,
13,
25927,
11,
33918,
11,
264,
6649,
198,
198,
2,
48191,
290,
7824,
9394,
3558,
198,
198,
2,
12509,
1503,
15871,
406,
6242,
362,
220,
28289,
16645,
5139,
329,
20830,
198,
2,
383,... | 3.107488 | 828 |
import json
import uuid
import os
import docker
import time
from celery.utils.log import get_task_logger
from config import settings
from .language import LANGUAGE
from .status import ComputingStatus
logger = get_task_logger(__name__)
| [
11748,
33918,
198,
11748,
334,
27112,
198,
11748,
28686,
198,
198,
11748,
36253,
198,
11748,
640,
198,
6738,
18725,
1924,
13,
26791,
13,
6404,
1330,
651,
62,
35943,
62,
6404,
1362,
198,
6738,
4566,
1330,
6460,
198,
198,
6738,
764,
16129... | 3.414286 | 70 |
__author__ = 'heddevanderheide' | [
834,
9800,
834,
796,
705,
704,
7959,
4066,
258,
485,
6
] | 2.818182 | 11 |
from functools import partial
import logging
from typing import Callable, Any, Iterable
from collections import defaultdict
from kombu import Connection
from kombu.mixins import ConsumerMixin
from classic.components import component
from .handlers import MessageHandler, SimpleMessageHandler
from .scheme import Broke... | [
6738,
1257,
310,
10141,
1330,
13027,
198,
11748,
18931,
198,
6738,
19720,
1330,
4889,
540,
11,
4377,
11,
40806,
540,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
6738,
479,
2381,
84,
1330,
26923,
198,
6738,
479,
2381,
84,
13,
19816,
... | 3.785047 | 107 |
from cmath import exp, pi
from math import log2
vektor = [1,1,2,2,5,2,4,7] #pocitani vektor
n = len(vektor)
myPrim = exp((2j*pi)/n) #primitivni odmocnina
res = recursiveComplexFFT(n, myPrim, vektor) #rekurzivni fft
print(res)
myPrim = exp((2j*pi)/n)
res2 = iterativeComplexFFT(n, myPrim, vektor) #iterativni fft
print(r... | [
6738,
269,
11018,
1330,
1033,
11,
31028,
198,
6738,
10688,
1330,
2604,
17,
198,
198,
303,
74,
13165,
796,
685,
16,
11,
16,
11,
17,
11,
17,
11,
20,
11,
17,
11,
19,
11,
22,
60,
1303,
79,
420,
270,
3216,
1569,
74,
13165,
198,
77,... | 2.117647 | 153 |
#! /usr/bin/env python
# -*- coding:UTF-8 -*-
# pickle
try:
import cPickle as pickle
except:
import pickle
import sys
if __name__ == '__main__':
data = []
data.append(SimpleObject("pickle"))
data.append(SimpleObject("cPickle"))
data.append(SimpleObject("last"))
filename = sys.argv[1]
... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
48504,
12,
23,
532,
9,
12,
198,
198,
2,
2298,
293,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
269,
31686,
293,
355,
2298,
293,
198,
16341,
25,
1... | 2.177273 | 220 |
#!/usr/bin/env python
# -*- coding: utf-8; buffer-read-only: t -*-
__author__ = "Gregorio Ambrosio"
__contact__ = "gambrosio[at]uma.es"
__copyright__ = "Copyright 2021, Gregorio Ambrosio"
__date__ = "2021/02/22"
__license__ = "MIT"
import unittest
import os
import sys
import pandas as pd
import matplotlib.pyplot as p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
26,
11876,
12,
961,
12,
8807,
25,
256,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
25025,
40974,
12457,
4951,
952,
1,
198,
834,
... | 2.590643 | 171 |
# Differentiable Augmentation for Data-Efficient GAN Training
# Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han
# https://arxiv.org/pdf/2006.10738
import torch
import torch.nn.functional as F
from torch.distributions.dirichlet import _Dirichlet
AUGMENT_FNS = {
'color': [rand_brightness, rand_sa... | [
2,
20615,
3379,
2447,
14374,
329,
6060,
12,
36,
5632,
402,
1565,
13614,
198,
2,
1375,
782,
24767,
29436,
11,
10511,
2926,
666,
18258,
11,
29380,
5164,
11,
7653,
12,
49664,
33144,
11,
290,
10940,
9530,
198,
2,
3740,
1378,
283,
87,
45... | 2.772152 | 158 |
import re
from dataclasses import dataclass
from typing import List, Optional
def read_boards() -> List[PlayBoard]:
"""
Reading each board defined by a new line then 5 lists of 5 ints.
Given the data format, this divides equally by 6 for possible performant mapping.
"""
with open("data.txt", "r"... | [
11748,
302,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
7343,
11,
32233,
628,
628,
198,
4299,
1100,
62,
12821,
3419,
4613,
7343,
58,
11002,
29828,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1... | 2.758416 | 505 |
import os
static_path = os.path.join(os.path.dirname(__file__), "..", "static")
apiurl = "http://localhost:8000/api/%s"
local_store = os.path.join(static_path, "graphs")
local_store_url = "http://localhost:8000/static/graphs"
nodename = "lg"
nodepwd = "lg@home"
| [
11748,
28686,
198,
12708,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
492,
1600,
366,
12708,
4943,
198,
198,
15042,
6371,
796,
366,
4023,
1378,
36750,
25,
33942,
14,
150... | 2.431193 | 109 |
import sys
import numpy as np
#############################################################
### ###
### Module for Python3 ###
### * Using Numpy ( + Cupy ? ) ###
### ... | [
11748,
25064,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
201,
198,
29113,
14468,
7804,
4242,
2,
201,
198,
21017,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.804348 | 230 |
import os, pickle
import functools
def load_or_make(creator):
"""
Loads data that is pickled at filepath if filepath exists;
otherwise, calls creator(*args, **kwargs) to create the data
and pickle it at filepath.
Returns the data in either case.
Inputs:
- filepath: path to where data... | [
198,
11748,
28686,
11,
2298,
293,
198,
11748,
1257,
310,
10141,
198,
198,
4299,
3440,
62,
273,
62,
15883,
7,
45382,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8778,
82,
1366,
326,
318,
2298,
992,
379,
2393,
6978,
611,
2393... | 2.604982 | 281 |
from rest_framework import routers
from .api import AnimalViewSet
router = routers.DefaultRouter()
router.register('api/animals', AnimalViewSet, 'animals')
urlpatterns = router.urls | [
6738,
1334,
62,
30604,
1330,
41144,
198,
6738,
764,
15042,
1330,
13792,
7680,
7248,
198,
198,
472,
353,
796,
41144,
13,
19463,
49,
39605,
3419,
198,
472,
353,
13,
30238,
10786,
15042,
14,
11227,
874,
3256,
13792,
7680,
7248,
11,
705,
... | 3.388889 | 54 |
from os import replace
from typing import List, Dict, Any, Callable
import os
import re
import json
import functools
ST_UNKNOWN = "*"
ST_BOOL = "bool"
ST_INT = "integer"
ST_STR = "string"
ST_FLOAT = "float"
ST_URL = "url"
ST_DATETIME = "datetime"
REGEXP_URL = re.compile('^https?://.+$')
REGEX... | [
6738,
28686,
1330,
6330,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
11,
4377,
11,
4889,
540,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
33918,
198,
11748,
1257,
310,
10141,
628,
198,
2257,
62,
4944,
44706,
220,
796,
366,
9,
1,
... | 2.19151 | 1,013 |
from setuptools import setup
from platform import system
SYSTEM = system()
VERSION = '1.0.2'
if SYSTEM == 'Windows':
scripts = ['grebot/grebot.bat']
else:
scripts = ['grebot/grebot.sh']
setup(
name='grebot',
version=VERSION,
packages=['grebot'],
license='MIT',
long_description=open('READM... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
3859,
1330,
1080,
198,
198,
23060,
25361,
796,
1080,
3419,
198,
43717,
796,
705,
16,
13,
15,
13,
17,
6,
198,
198,
361,
36230,
6624,
705,
11209,
10354,
198,
220,
220,
220,
14750,
796,
3... | 2.637584 | 149 |
import operator
from magicgui import magicgui
OPERATOR_DICTIONARY = {
"Divide": (operator.truediv, "Measurement_Ratio"),
"Multiply": (operator.mul, "Measurement_Product"),
"Add": (operator.add, "Measurement_Sum"),
"Subtract": (operator.sub, "Measurement_Difference"),
}
measurement_math_options = list... | [
11748,
10088,
198,
198,
6738,
5536,
48317,
1330,
5536,
48317,
198,
198,
31054,
25633,
62,
35,
18379,
2849,
13153,
796,
1391,
198,
220,
220,
220,
366,
24095,
485,
1298,
357,
46616,
13,
83,
21556,
452,
11,
366,
47384,
434,
62,
29665,
95... | 2.890805 | 174 |
"""
Model classes - contains the primary objects that power pylibRETS.
"""
| [
37811,
198,
17633,
6097,
532,
4909,
262,
4165,
5563,
326,
1176,
279,
2645,
571,
2200,
4694,
13,
198,
37811,
198
] | 3.75 | 20 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='uumarrty',
version='0.0.1',
url='https://github.com/michaelremington2/uumarrty',
author='Michael Remington and Jeet Sukumaran',
... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
... | 2.634409 | 372 |
import angr
| [
11748,
281,
2164,
628
] | 3.25 | 4 |
#!/usr/bin/env python
#Boa:App:BoaApp
import wx
import matplotlib as _matplotlib
import pylab as _pylab
import _pylab_colorslider_frame as _pcf; reload(_pcf)
try: _prefs
except: _prefs = None
modules ={u'pylab_colorslider_frame': [1,
'Main frame of Application',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
33,
12162,
25,
4677,
25,
33,
12162,
4677,
201,
198,
201,
198,
11748,
266,
87,
201,
198,
11748,
2603,
29487,
8019,
355,
4808,
6759,
29487,
8019,
201,
198,
11748,
279,
2645,
39... | 2.175896 | 307 |
from Data.Drawer import Drawer
from Data.Helper import *
from Pages.PageBase import PageBase | [
6738,
6060,
13,
25302,
263,
1330,
15315,
263,
198,
6738,
6060,
13,
47429,
1330,
1635,
198,
6738,
28221,
13,
9876,
14881,
1330,
7873,
14881
] | 3.833333 | 24 |
from math import radians, sin, cos, tan
angulo = float(input('Digite o ngulo que voc deseja: '))
seno = sin(radians(angulo))
cosseno = cos(radians(angulo))
tangente = tan(radians(angulo))
print(f'O ngulo de {angulo} tem o SENO de {seno :.2f}!')
print(f'O ngulo de {angulo} tem o COSSENO de {cosseno :.2f}!')
print(f'O ... | [
6738,
10688,
1330,
2511,
1547,
11,
7813,
11,
8615,
11,
25706,
198,
648,
43348,
796,
12178,
7,
15414,
10786,
19511,
578,
267,
23370,
43348,
8358,
12776,
748,
68,
6592,
25,
705,
4008,
198,
198,
6248,
78,
796,
7813,
7,
6335,
1547,
7,
6... | 2.300613 | 163 |
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import numpy as np
app = dash.Dash()
# Creating Data
np.random.seed(42)
random_x = np.random.randint(1, 101, 100)
random_y = np.random.randint(1, 101, 100)
# everything that we are going to be inserting ... | [
11748,
14470,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
198,
11748,
14470,
62,
6494,
62,
5589,
3906,
355,
27711,
198,
11748,
7110,
306,
13,
34960,
62,
672,
8457,
355,
467,
198,
11748,
299,
32152,
355,
45941,
198,
198... | 1.40218 | 1,651 |
__author__ = 'yinjun'
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
| [
834,
9800,
834,
796,
705,
88,
259,
29741,
6,
198,
198,
2,
30396,
329,
1702,
306,
12,
25614,
1351,
13,
198,
2,
1398,
7343,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
... | 2.180556 | 72 |
"""
Faa um programa que leia o ano de nascimento de um jovem e informe, de acordo com sua idade
se ele ainda vai se alistar
se a hora de se alistar
se j passou o tempo de alistar
o programa tambm deve falar o tempo que falta ou que passou
"""
import datetime
import time
ano_nasc = int(input('Ano de Nascimento: '))
a... | [
37811,
198,
37,
7252,
23781,
1430,
64,
8358,
443,
544,
267,
281,
78,
390,
299,
3372,
3681,
78,
390,
23781,
474,
659,
76,
304,
4175,
68,
11,
390,
936,
585,
78,
401,
424,
64,
4686,
671,
198,
325,
9766,
257,
22261,
410,
1872,
384,
... | 2.393617 | 470 |
"""
A class interfce to netvlad based whole image descriptor. To use the
pre-trained network in your application use this code and unit-test
Author : Manohar Kuse <mpkuse@connect.ust.hk>
Created : 20th Aug, 2018
"""
import cv2
import numpy as np
import os
import time
import code
import argparse
impor... | [
37811,
198,
220,
220,
220,
317,
1398,
9556,
344,
284,
2010,
85,
9435,
1912,
2187,
2939,
43087,
13,
1675,
779,
262,
198,
220,
220,
220,
662,
12,
35311,
3127,
287,
534,
3586,
779,
428,
2438,
290,
4326,
12,
9288,
628,
220,
220,
220,
... | 2.396285 | 646 |
import argparse
import os
import time
## Argparser
argparser = argparse.ArgumentParser()
argparser.register('type','bool',str2bool)
argparser.register('type','slist', str2slist)
argparser.register('type','ilist', str2ilist)
# Adopted from: http://stackoverflow.com/a/8412405
def check_and_create_dir(dir_path):
... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
640,
198,
198,
2235,
20559,
48610,
198,
198,
853,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
853,
48610,
13,
30238,
10786,
4906,
41707,
30388,
3256,
2536,
17,
30388,
8,
... | 2.654545 | 165 |
# Download data, unzip, etc.
from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
import scipy.stats as st
# Set some parameters to apply to all plots. These can be overridden
# in each plot if desired
import matplotlib
# Plot size to 14" x 7"
matplotlib.rc('figure', figsize = (14, 7))
# Font... | [
2,
10472,
1366,
11,
555,
13344,
11,
3503,
13,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
34242,
355,
336,
6... | 2.826667 | 300 |
__author__ = 'croman'
from pipeline import pipe
from lxml import etree
import rdflib
ner("Mena Collection.ttl", "nif")
"""__author__ = 'croman'
from pipeline import pipe
from lxml import etree
import rdflib
def ner(datasetfile, format):
tweets = ""
tweetids = []
if format == 'xml':
dataset =... | [
834,
9800,
834,
796,
705,
66,
47119,
6,
198,
198,
6738,
11523,
1330,
12656,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
11748,
374,
67,
2704,
571,
198,
198,
1008,
7203,
44,
8107,
12251,
13,
926,
75,
1600,
366,
77,
361,
4943,
628,
... | 2.079665 | 954 |
import pandas as pd
import random
def generate_players(n_teams=128, n_countries=3, csv_file="jogadores.csv"):
"""
gerar os jogadores
0 - sarrafeiro
1 - caceteiro
2 - cordeirinho
3 - cavalheiro
4 - fair play
0 - goleiro 3
1 - defensor 7
... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
4738,
628,
198,
198,
4299,
7716,
62,
32399,
7,
77,
62,
660,
4105,
28,
12762,
11,
299,
62,
9127,
1678,
28,
18,
11,
269,
21370,
62,
7753,
2625,
73,
519,
324,
2850,
13,
40664,
1,
2599,
1... | 1.770781 | 794 |
#!/usr/bin/python
"""
Ansible module for rpm-based systems determining existing package version information in a host.
"""
from ansible.module_utils.basic import AnsibleModule
IMPORT_EXCEPTION = None
try:
import rpm # pylint: disable=import-error
except ImportError as err:
IMPORT_EXCEPTION = err # in tox te... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
2025,
82,
856,
8265,
329,
37542,
12,
3106,
3341,
13213,
4683,
5301,
2196,
1321,
287,
257,
2583,
13,
198,
37811,
198,
198,
6738,
9093,
856,
13,
21412,
62,
26791,
13,
35487,
1330,
... | 2.535099 | 755 |
# Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# 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,
15069,
1946,
5267,
78,
18687,
1984,
5693,
3337,
329,
347,
4267,
19542,
1799,
11,
24311,
52,
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,
42... | 3.022308 | 1,031 |
# -*- coding:utf-8 -*-
import logging
import re
from time import sleep
import requests
import urllib3
from app.utils.spider_utils import getHtmlTree, verifyProxyFormat
from app.utils.web_request import WebRequest
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
logging.basicConfig(level=logging.IN... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
11748,
302,
198,
6738,
640,
1330,
3993,
198,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
18,
198,
198,
6738,
598,
13,
26791,
13,
2777,
1304,
62,
26791,... | 2.32991 | 779 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param {ListNode[]} lists
# @return {ListNode}
def mergeKLists(self, lists):
lists = [i for i in lists if i]
if not lists: return None
... | [
2,
30396,
329,
1702,
306,
12,
25614,
1351,
13,
201,
2,
1398,
7343,
19667,
25,
201,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
201,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2100,
796,
2124,... | 1.853774 | 424 |
def notas(*n, show=False):
"""
-> Funo que l varias notas e retorna um dicionario com dados
:param n: L varias notas (numero indefinido)
:param show: Mostra a situao do aluno (opc)
:return: Retorna um dicionario
"""
dados = dict()
dados['total'] = len(n)
dados['maior'] = max(n)
... | [
4299,
407,
292,
46491,
77,
11,
905,
28,
25101,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
4613,
11138,
78,
8358,
300,
1401,
4448,
407,
292,
304,
1005,
1211,
64,
23781,
288,
47430,
4982,
401,
9955,
418,
198,
220,
220,
... | 1.968391 | 696 |
from nltk import sent_tokenize, word_tokenize, pos_tag, ne_chunk
sentence = 'Usually I go to the hospital when I am afraid. When I sould go there?'
sentences_splitted = sent_tokenize(sentence)
sentence_words_splitted = [word_tokenize(s) for s in sentences_splitted]
question = [ne_chunk(pos_tag(s)) for s in sentences_... | [
6738,
299,
2528,
74,
1330,
1908,
62,
30001,
1096,
11,
1573,
62,
30001,
1096,
11,
1426,
62,
12985,
11,
497,
62,
354,
2954,
198,
198,
34086,
594,
796,
705,
37887,
314,
467,
284,
262,
4436,
618,
314,
716,
7787,
13,
1649,
314,
264,
42... | 2.772242 | 281 |
#!/usr/bin/env python3
'''
translator.py: 3 address code -> TAM translator.
@author: Hugo Araujo de Sousa [2013007463]
@email: hugosousa@dcc.ufmg.br
@DCC053 - Compiladores I - UFMG
'''
# TODO: Need to handle floating point literals.
# TAM does not provide arithmetic routines for floating point!?
import argparse as... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
7061,
6,
198,
7645,
41880,
13,
9078,
25,
513,
2209,
2438,
4613,
33112,
33417,
13,
198,
31,
9800,
25,
25930,
30574,
84,
7639,
390,
311,
516,
64,
685,
1264,
6200,
22,
38380,
... | 2.144657 | 7,383 |
# encoding: utf-8
import tensorflow as tf
flags = tf.app.flags
FLAGS = flags.FLAGS
# train settings
flags.DEFINE_integer('batch_size', 40, 'the number of images in a batch.')
flags.DEFINE_integer('training_data_type', 1, '0: directly feed, 1: tfrecords')
#flags.DEFINE_string('train_tfrecords', 'data/train_caltech_ra... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
33152,
796,
48700,
13,
1324,
13,
33152,
198,
38948,
50,
796,
9701,
13,
38948,
50,
198,
198,
2,
4512,
6460,
198,
33152,
13,
7206,
29940,
62,
... | 3.031515 | 825 |
import numpy as np
import keras
import keras.layers as layers
from get_mnist import get_mnist_preproc
### --- hyperparameterrs --- ###
epochs = 48
batch_size = 64
num_classes = 10
reg = 3e-3
### --- hyperparams end --- ###
### --- setup data --- ###
traini, trainl, vali, vall, testi, testl = get_mnist_preproc()
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
41927,
292,
198,
11748,
41927,
292,
13,
75,
6962,
355,
11685,
198,
6738,
651,
62,
10295,
396,
1330,
651,
62,
10295,
396,
62,
3866,
36942,
198,
198,
21017,
11420,
8718,
17143,
2357,
3808,
11420,... | 2.309589 | 1,095 |
import config
import controller
import hwrtc
import network
import web_server
import wlan
main()
| [
11748,
4566,
198,
11748,
10444,
198,
11748,
289,
86,
17034,
66,
198,
11748,
3127,
198,
11748,
3992,
62,
15388,
198,
11748,
266,
9620,
628,
198,
198,
12417,
3419,
198
] | 3.448276 | 29 |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2016, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
#... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
2813,
12,
5304,
11,
7298,
457,
26047,
14719,
198,
2,
1439,
2489,
10395,
13,
198,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,... | 2.745763 | 6,018 |
import sys
import pathlib
from datetime import datetime
current_dir = pathlib.Path(__file__).resolve().parent
sys.path.append( str(current_dir) + '/../../' )
from app.database import BASE, ENGINE, session_scope
from app.models.todos import Todo
from app.models.users import User
if __name__ == "__main__":
generat... | [
11748,
25064,
198,
11748,
3108,
8019,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
14421,
62,
15908,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
411,
6442,
22446,
8000,
198,
17597,
13,
6978,
13,
33295,
7,
965,
7,
14421,
... | 3.036364 | 110 |
# -*- coding: UTF-8 -*-
import os
import os.path
import json
import platform
import tempfile
import logging
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
from rogue_scores.web import app
from rogue_scores.web.app import index, scores_upload, scores_json
app.app.log... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
33918,
198,
11748,
3859,
198,
11748,
20218,
7753,
198,
11748,
18931,
198,
198,
361,
3859,
13,
29412,
62,
9641,
341... | 2.846154 | 130 |
from math import factorial
n = 86
k = 8
res = factorial(n)/factorial(n-k)%1e6
print int(res)
| [
6738,
10688,
1330,
1109,
5132,
198,
198,
77,
796,
9849,
198,
74,
796,
807,
198,
198,
411,
796,
1109,
5132,
7,
77,
20679,
22584,
5132,
7,
77,
12,
74,
8,
4,
16,
68,
21,
198,
4798,
493,
7,
411,
8,
198
] | 2.317073 | 41 |
"""
Investment
created by Herman Tai 3/20/2008
"""
from math import *
TOLERANCE = 0.0000001
def number_format(num, places=0):
"""Format a number with grouped thousands and given decimal places"""
places = max(0,places)
tmp = "%.*f" % (places, num)
point = tmp.find(".")
integer = (point == -1) and... | [
37811,
198,
19070,
434,
198,
198,
25598,
416,
25028,
11144,
513,
14,
1238,
14,
11528,
198,
37811,
198,
198,
6738,
10688,
1330,
1635,
198,
51,
3535,
1137,
19240,
796,
657,
13,
2388,
8298,
198,
198,
4299,
1271,
62,
18982,
7,
22510,
11,
... | 2.486891 | 267 |
import requests
import json
from Sakurajima.models import base_models as bm
| [
11748,
7007,
198,
11748,
33918,
198,
6738,
13231,
333,
1228,
8083,
13,
27530,
1330,
2779,
62,
27530,
355,
275,
76,
628
] | 3.666667 | 21 |
"""Events separate segements of data. A model is fitted to each segment independently"""
import numpy as np
def period_range(min_date, max_date, events, index):
if index > len(events): raise InvalidPeriod('Not enough events to generate period %s' % index)
dates = []
dates.append(min_date)
if len(events... | [
37811,
37103,
4553,
384,
43547,
286,
1366,
13,
317,
2746,
318,
18235,
284,
1123,
10618,
14799,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4299,
2278,
62,
9521,
7,
1084,
62,
4475,
11,
3509,
62,
4475,
11,
2995,
11,
6376,
2599,... | 2.575037 | 673 |
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
import numpy as np
from .param_tuning import ParamTuning
| [
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
5972,
2569,
8081,
2234,
198,
6738,
1341,
35720,
13,
79,
541,
4470,
1330,
37709,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
8997,
3351,
36213,
198,
11748,
299,
32152,
355,
45941,
198,
19... | 3.788462 | 52 |
import os
os.environ['MPLCONFIGDIR'] = os.getcwd() + "/configs/"
import matplotlib
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv('medical_examination.csv')
df['overweight'] = (df['weight'] / (df['height']/100)**2).apply(lambda x: 1 if x > 25 else 0)
df['... | [
11748,
28686,
198,
418,
13,
268,
2268,
17816,
7378,
5639,
1340,
16254,
34720,
20520,
796,
28686,
13,
1136,
66,
16993,
3419,
1343,
12813,
11250,
82,
30487,
198,
11748,
2603,
29487,
8019,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
... | 2.631579 | 171 |
import pygame
from gui.guielement import GuiElement
HORIZONTAL = 0
VERTICAL = 1
| [
11748,
12972,
6057,
201,
198,
201,
198,
6738,
11774,
13,
5162,
494,
1732,
1330,
1962,
72,
20180,
201,
198,
201,
198,
39,
1581,
14887,
35830,
1847,
796,
657,
201,
198,
15858,
20151,
796,
352,
201,
198,
201,
198
] | 2.368421 | 38 |
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Naturalunit system.
The natural system comes from "setting c = 1, hbar = 1". From the computer
point of view it means that we use velocity and action instead of length and
time. Moreover instead of mass we use energy.
"""
from __future__ import division
from sympy... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
35364,
20850,
1080,
13,
198,
198,
464,
3288,
1080,
2058,
422,
366,
33990,
269,
796,
3... | 2.965116 | 602 |
import random
import uuid
import os
| [
11748,
4738,
198,
11748,
334,
27112,
198,
11748,
28686,
628
] | 3.7 | 10 |
from typing import Union
__all__ = [
'num',
]
num = Union[int, float]
| [
6738,
19720,
1330,
4479,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
22510,
3256,
198,
60,
198,
198,
22510,
796,
4479,
58,
600,
11,
12178,
60,
198
] | 2.451613 | 31 |
from pylint.reporters.json import JSONReporter
def json_reporter_handle_message(self, msg):
"""Manage message of different type and in the context of path."""
self.messages.append({
'path': msg.path,
'abspath': msg.abspath,
'line': msg.line,
'column': msg.column,
'modul... | [
6738,
279,
2645,
600,
13,
260,
1819,
1010,
13,
17752,
1330,
19449,
6207,
4337,
628,
198,
4299,
33918,
62,
260,
26634,
62,
28144,
62,
20500,
7,
944,
11,
31456,
2599,
198,
220,
220,
220,
37227,
5124,
496,
3275,
286,
1180,
2099,
290,
2... | 2.185328 | 259 |
from nltk.stem import SnowballStemmer
from nltk.stem.api import StemmerI
import nltk
import json
partstem = ParticleStemmer()
| [
6738,
299,
2528,
74,
13,
927,
1330,
7967,
1894,
1273,
368,
647,
198,
6738,
299,
2528,
74,
13,
927,
13,
15042,
1330,
520,
368,
647,
40,
198,
11748,
299,
2528,
74,
198,
11748,
33918,
198,
198,
3911,
927,
796,
2142,
1548,
1273,
368,
... | 2.653061 | 49 |
import os
from abacusevents.utils import env, lowercase_first
| [
11748,
28686,
198,
198,
6738,
450,
330,
1904,
85,
658,
13,
26791,
1330,
17365,
11,
2793,
7442,
62,
11085,
628,
628,
198
] | 3.045455 | 22 |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
2361,
25,
198
] | 2 | 24 |
from flask import Flask
import os
templates_folder = os.path.abspath("application/view/templates")
static_folder = os.path.abspath("application/view/static")
app = Flask(__name__,template_folder=templates_folder,static_folder=static_folder)
from application.controller import hello_controller | [
6738,
42903,
1330,
46947,
201,
198,
11748,
28686,
201,
198,
201,
198,
11498,
17041,
62,
43551,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7203,
31438,
14,
1177,
14,
11498,
17041,
4943,
201,
198,
12708,
62,
43551,
796,
28686,
13,
6978,
... | 3.210526 | 95 |
#Just a simple script to automate the YAML front matter in new posts
import datetime
import os
title = raw_input('\nEnter title: ')
fileName= title.replace(" ", "_").lower() + '.md'
print fileName + '\n'
text = """---
layout: project
title: {}
date: Feb 2015
thumbnail: http://devchuk.github.io/devchukV1/res/img/porti... | [
2,
5703,
257,
2829,
4226,
284,
43511,
262,
575,
2390,
43,
2166,
2300,
287,
649,
6851,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
198,
7839,
796,
8246,
62,
15414,
10786,
59,
77,
17469,
3670,
25,
705,
8,
198,
7753,
5376,
28,
3670... | 2.990991 | 222 |
# -*- coding: utf-8 -*-
'''pre load default TSP city data into database'''
from django.db.transaction import atomic
from ..models import *
import os
# Load default city data
def load_cities(cities_folder_path, delete=False):
'''
Load data files in cities_folder_path to database
if delete is True, previous da... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
3866,
3440,
4277,
309,
4303,
1748,
1366,
656,
6831,
7061,
6,
198,
198,
6738,
42625,
14208,
13,
9945,
13,
7645,
2673,
1330,
17226,
198,
198,
6738,
11485,
... | 2.140759 | 817 |
# Copyright 2019 Netskope, Inc.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. ... | [
2,
15069,
13130,
27811,
74,
3008,
11,
3457,
13,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
389,
10431,
2810,
326,
262,
198,
2,
1708,
3403,
389,
1138,
25,
198,
2,
198,
2,
352,
1... | 3.146919 | 844 |
import mysql.connector
mydb = mysql.connector.connect(
host="databaseurl",
user="username",
password="password",
database="database_name",
)
mycursor = mydb.cursor()
code = input("Enter SQL code here ")
sql = code
mycursor.execute(sql)
mydb.commit()
print(mycursor.rowcount, "record inserted.")
| [
11748,
48761,
13,
8443,
273,
198,
198,
1820,
9945,
796,
48761,
13,
8443,
273,
13,
8443,
7,
198,
220,
2583,
2625,
48806,
6371,
1600,
198,
220,
2836,
2625,
29460,
1600,
198,
220,
9206,
2625,
28712,
1600,
198,
220,
6831,
2625,
48806,
62,... | 2.90566 | 106 |
"""
URL: https://codeforces.com/problemset/problem/451/B
Author: Safiul Kabir [safiulanik at gmail.com]
Tags: implementation, sortings, *1300
"""
main()
| [
37811,
198,
21886,
25,
3740,
1378,
19815,
891,
273,
728,
13,
785,
14,
1676,
22143,
316,
14,
45573,
14,
36330,
14,
33,
198,
13838,
25,
6895,
72,
377,
28793,
343,
685,
82,
19910,
377,
272,
1134,
379,
308,
4529,
13,
785,
60,
198,
361... | 2.557377 | 61 |
from .ibm_cos import IBMCloudObjectStorageBackend as StorageBackend
| [
6738,
764,
571,
76,
62,
6966,
1330,
19764,
18839,
10267,
31425,
7282,
437,
355,
20514,
7282,
437,
198
] | 3.777778 | 18 |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 7 22:03:24 2021
@author: lankuohsing
"""
import numpy as np
import torch.utils.data as Data
import torch
from collections import OrderedDict
from torchsummary import summary
# In[]
data1=[]
labels1=[]
data2=[]
labels2=[]
with open("./dataset/4_class_data_2d.txt",'r',enc... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
4280,
220,
767,
2534,
25,
3070,
25,
1731,
33448,
198,
198,
31,
9800,
25,
300,
962,
84,
1219,
12215,
198,
37811,
198,
198,
11748,
299,
32... | 2.083876 | 1,228 |
# /usr/bin/env python
# -*- coding: utf-8 -*-
import inspect,sqlite3
# load module
from py.sheet.sheet import *
try:
# PostgreSQL
import psycopg2
except ModuleNotFoundError as e:
ErrorMessage('psycopg2')
exit()
try:
# MySQL
import pymysql
except ModuleNotFoundError as e:
ErrorMessage('My... | [
2,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
10104,
11,
25410,
578,
18,
198,
2,
3440,
8265,
220,
198,
6738,
12972,
13,
21760,
13,
21760,
1330,
1635,
19... | 3.00641 | 156 |
from TabularTrainer import *
from RandomPlayer import *
from TicTacToe import *
import matplotlib.pyplot as plt
action_to_coordinate = {0: (0, 0), 1: (0, 1), 2: (0, 2),
3: (1, 0), 4: (1, 1), 5: (1, 2),
6: (2, 0), 7: (2, 1), 8: (2, 2)}
NUM_OF_BATTLES = 10
NUM_OF_GAMES = ... | [
6738,
16904,
934,
2898,
10613,
1330,
1635,
198,
6738,
14534,
14140,
1330,
1635,
198,
6738,
309,
291,
51,
330,
2514,
68,
1330,
1635,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2673,
62,
1462,
62,
37652,
455... | 2.108911 | 202 |
import os
import sys
from core.math_tool.coordinate_system import CoordSys
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import cv2 | [
11748,
28686,
198,
11748,
25064,
198,
6738,
4755,
13,
11018,
62,
25981,
13,
37652,
4559,
62,
10057,
1330,
22819,
44387,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
294... | 2.933333 | 60 |
# -*- coding: utf-8 -*-
from .utils import exists, nlargest, removeMultiple
from .spell import Spell
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
764,
26791,
1330,
7160,
11,
299,
28209,
11,
4781,
31217,
198,
6738,
764,
46143,
1330,
11988,
628
] | 3.1875 | 32 |
# encoding: UTF-8
import cv2
import numpy as np
| [
2,
21004,
25,
41002,
12,
23,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
628,
198
] | 2.55 | 20 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
import unittest
from karura.database_api import DatabaseAPI
if __name__ == "__main__":
unittest.main()
| [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
366,
40720,
492,
30487,
4008,
198,
11748,
555,
715,
395,
198,
6738,
479,
283,
... | 2.481928 | 83 |
#!/usr/bin/python
import pandas as pd
import sys
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
25064,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.432432 | 37 |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import nameparser
import os
README = read('README.rst')
setup(name='nameparser',
packages = ['nameparser'],
description = 'A simple Python module for parsing human names into their indiv... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
28311,
25,
198,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
422,
1233,
26791,
13,
7295,
1330,
9058,
198,
11748,
1438,
48610,
198,
11748,
28686,
198,
... | 2.623557 | 433 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 4 17:41:56 2018
@author: hubert kyeremateng-boateng
"""
import numpy as np
import pandas as pd
recipes = pd.read_csv('arp_dataset.csv', header=None)
recipes.rename(columns={0: 'name'}, inplace=True)
print(np.transpose(recipes)) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
5979,
220,
604,
1596,
25,
3901,
25,
3980,
2864,
198,
198,
31,
9800,
25,
289,
84,
... | 2.4 | 125 |
import roll_dice as r #importing RollDice module
COUNT = 0 #initializing count
while True:
roll = input("Enter your choice(d/u/l/r): ").lower() #Pick your choice
if roll == 'down' or roll == 'd':
r.dice_down(r.res)
COUNT+=1
elif roll == 'up'or roll =='u':
... | [
11748,
4836,
62,
67,
501,
355,
374,
220,
220,
220,
220,
220,
220,
1303,
11748,
278,
8299,
35,
501,
8265,
220,
220,
201,
198,
34,
28270,
796,
657,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
36733,
2890,
954,
... | 1.938247 | 502 |
from flask import render_template, redirect, url_for, flash, request
from werkzeug.urls import url_parse
from flask_login import login_user, logout_user, current_user
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, DecimalField, BooleanField, SelectField, SubmitField
from wtforms.validat... | [
6738,
42903,
1330,
8543,
62,
28243,
11,
18941,
11,
19016,
62,
1640,
11,
7644,
11,
2581,
198,
6738,
266,
9587,
2736,
1018,
13,
6371,
82,
1330,
19016,
62,
29572,
198,
6738,
42903,
62,
38235,
1330,
17594,
62,
7220,
11,
2604,
448,
62,
7... | 3.317972 | 217 |
import matplotlib.pyplot as plt
import numpy as np
divisions = ['Admin', 'Development', 'Lead', 'HR']
salary = [10, 14,20, 12]
age = [28, 30, 45, 32]
index = np.arange(4)
width = 0.3
plt.bar(index, salary, width, color='green', label='Salary')
plt.bar(index+width, age, width, color='blue', label='Age')
plt.title('Di... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
7146,
3279,
796,
37250,
46787,
3256,
705,
41206,
3256,
705,
20451,
3256,
705,
17184,
20520,
198,
21680,
560,
796,
685,
940,
11,
1478,... | 2.483696 | 184 |
from string import *
import json, sys
from urllib.request import urlopen
#parameters
params1 = "<||^{tss+^=r]^/\A/+|</`[+^r]`;s.+|+s#r&sA/+|</`y_w"
params2 = ':#%:%!,"'
params3 = "-#%&!&')&:-/$,)+-.!:-::-"
params4 = params2 + params3
params_id = "j+^^=.w"
unit = [ "k", "atm"]
data1 = printable
data2 = punctuation... | [
198,
6738,
4731,
1330,
1635,
198,
11748,
33918,
11,
25064,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
628,
198,
198,
2,
17143,
7307,
198,
37266,
16,
796,
33490,
15886,
36796,
83,
824,
10,
61,
28,
81,
60,
61,
14,
59,
... | 2.139073 | 302 |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | [
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,... | 3.260745 | 349 |
#!/usr/bin/env python
# Copyright (C) 2014 Open Data ("Open Data" refers to
# one or more of the following companies: Open Data Partners LLC,
# Open Data Research LLC, or Open Data Capital LLC.)
#
# This file is part of Hadrian.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
34,
8,
1946,
220,
4946,
6060,
5855,
11505,
6060,
1,
10229,
284,
198,
2,
530,
393,
517,
286,
262,
1708,
2706,
25,
4946,
6060,
14205,
11419,
11,
198,
2,
4946,
606... | 3.685106 | 235 |