content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Generated by Django 3.1.3 on 2020-11-23 09:25
import django.core.files.storage
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
18,
319,
12131,
12,
1157,
12,
1954,
7769,
25,
1495,
198,
198,
11748,
42625,
14208,
13,
7295,
13,
16624,
13,
35350,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.952381 | 42 |
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from apprentice_learner import views
app_name = 'apprentice_api'
urlpatterns = [
url(r'^create/$', views.create, name = "create"),
url(r'^request/(?P<agent_id>[0-9]+)/$', views.request, name="request"),
url... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
198,
198,
6738,
39252,
62,
3238,
1008,
1330,
5009,
198,
... | 2.290909 | 440 |
from config.Configuration import Configuration
import logging
class LoggingConfiguration(Configuration):
"""
Author: Ronny Friedland
Handles logging configuration
"""
CONFIG_DEFAULTS = {'loglevel':'INFO'}
def check_config(self):
"""
Check if config.ini contains logging sett... | [
6738,
4566,
13,
38149,
1330,
28373,
198,
198,
11748,
18931,
628,
198,
4871,
5972,
2667,
38149,
7,
38149,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6434,
25,
6575,
3281,
15442,
1044,
628,
220,
220,
220,
7157,
829,
18931,
839... | 2.519149 | 470 |
import dataclasses
import pprint
import sys
import ccc.oci
import oci
__cmd_name__ = 'oci'
| [
11748,
4818,
330,
28958,
198,
11748,
279,
4798,
198,
11748,
25064,
198,
198,
11748,
269,
535,
13,
1733,
198,
11748,
267,
979,
198,
198,
834,
28758,
62,
3672,
834,
796,
705,
1733,
6,
628,
628,
628
] | 2.722222 | 36 |
# Generated by Django 3.1 on 2021-06-09 14:32
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
319,
33448,
12,
3312,
12,
2931,
1478,
25,
2624,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
#!/usr/bin/env python
__author__ = "bt3"
''' Queue acts as a container for nodes (objects) that are inserted and removed according FIFO'''
if __name__ == '__main__':
queue = LinkedQueue()
print("Is the queue empty? ", queue.isEmpty())
print("Adding 0 to 10 in the queue...")
for i in range(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
834,
9800,
834,
796,
366,
18347,
18,
1,
198,
198,
7061,
6,
4670,
518,
6529,
355,
257,
9290,
329,
13760,
357,
48205,
8,
326,
389,
18846,
290,
4615,
1864,
376,
5064,
46,
7061,
6... | 2.716216 | 222 |
"""add about_me, last_seen fields to users table.
Revision ID: 04f42852fee8
Revises: 60ae9f5ea6d5
Create Date: 2018-03-27 06:43:46.542593
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '04f42852fee8'
down_revision = '60ae9f5ea6d5'
branch_labels = None
depends_... | [
37811,
2860,
546,
62,
1326,
11,
938,
62,
15898,
7032,
284,
2985,
3084,
13,
198,
198,
18009,
1166,
4522,
25,
8702,
69,
40173,
4309,
39071,
23,
198,
18009,
2696,
25,
3126,
3609,
24,
69,
20,
18213,
21,
67,
20,
198,
16447,
7536,
25,
2... | 2.515152 | 132 |
"""
This module contain various types of functions/classes to access and generate CAM.
"""
import warnings
from typing import List, Tuple, Union
import matplotlib.pyplot as plt
import nibabel as nib
import numpy as np
import torch
import torchcam
import torchvision
from src.display.cmap import parula_map
from src.fi... | [
37811,
198,
1212,
8265,
3994,
2972,
3858,
286,
5499,
14,
37724,
284,
1895,
290,
7716,
32421,
13,
198,
198,
37811,
198,
11748,
14601,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
4479,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
... | 2.16263 | 3,757 |
print "SELECT pair_email FROM users where email = %s" , '236294386@qq.com' | [
4798,
366,
46506,
5166,
62,
12888,
16034,
2985,
810,
3053,
796,
4064,
82,
1,
837,
705,
24940,
27696,
21734,
31,
38227,
13,
785,
6
] | 3.083333 | 24 |
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
import statsmodels.api as sm
from matplotlib.font_manager import FontProperties
from matplotlib.ticker import MaxNLocator
class GenerateTestPlots:
"""Generates plots using data collected during model run."""
... | [
11748,
2603,
29487,
8019,
13,
11215,
355,
12067,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
34242,
355,
9756,
198,
11748,
9756,
27530,
13,
15042,
355,
... | 2.54185 | 454 |
# arr=Arr([2,1,3,4,5,6,1,1,6,2,4,5,3,1])
# print(arr.reverse())
arr=Arr([3, -5,-1])
print(arr.minimize_flip_k_length_subarr([1,2,3]))
| [
2,
5240,
28,
3163,
81,
26933,
17,
11,
16,
11,
18,
11,
19,
11,
20,
11,
21,
11,
16,
11,
16,
11,
21,
11,
17,
11,
19,
11,
20,
11,
18,
11,
16,
12962,
198,
2,
3601,
7,
3258,
13,
50188,
28955,
198,
3258,
28,
3163,
81,
26933,
18... | 1.654321 | 81 |
# Copyright (c) 2021, Technische Universität Kaiserslautern (TUK) & National University of Sciences and Technology (NUST).
# All rights reserved.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import print_function
from __f... | [
2,
15069,
357,
66,
8,
33448,
11,
5429,
46097,
26986,
270,
11033,
83,
11611,
21572,
75,
2306,
1142,
357,
51,
15039,
8,
1222,
2351,
2059,
286,
13473,
290,
8987,
357,
45,
7759,
737,
198,
2,
1439,
2489,
10395,
13,
198,
198,
2,
770,
27... | 3.416107 | 149 |
import data.music_theory as music_data
from app.note import Note
from app.base import Base
class Chord(Base):
"""
"""
def invert_chord(self, chord, inversion = 'root'):
"""
Args:
chord (list): The notes of the chord
inversion (str): The inversion name (root, first... | [
11748,
1366,
13,
28965,
62,
1169,
652,
355,
2647,
62,
7890,
198,
6738,
598,
13,
11295,
1330,
5740,
198,
6738,
598,
13,
8692,
1330,
7308,
198,
198,
4871,
609,
585,
7,
14881,
2599,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
37227,... | 2.066536 | 511 |
from lineflow.download import cached_download
from lineflow.datasets import Seq2SeqDataset
TRAIN_EN_URL = 'https://raw.githubusercontent.com/odashi/small_parallel_enja/master/train.en'
TRAIN_JA_URL = 'https://raw.githubusercontent.com/odashi/small_parallel_enja/master/train.ja'
DEV_EN_URL = 'https://raw.githubuserco... | [
6738,
1627,
11125,
13,
15002,
1330,
39986,
62,
15002,
198,
6738,
1627,
11125,
13,
19608,
292,
1039,
1330,
1001,
80,
17,
4653,
80,
27354,
292,
316,
628,
198,
51,
3861,
1268,
62,
1677,
62,
21886,
796,
705,
5450,
1378,
1831,
13,
12567,
... | 2.7 | 240 |
from uykfe.sequence.db import DbControl
| [
198,
6738,
334,
48361,
5036,
13,
43167,
13,
9945,
1330,
360,
65,
15988,
628
] | 3 | 14 |
import warnings
warnings.simplefilter('ignore', Warning)
from whoosh_tests.tests.test_forms import *
from whoosh_tests.tests.test_inputs import *
from whoosh_tests.tests.test_whoosh_query import *
from whoosh_tests.tests.test_whoosh_backend import *
| [
11748,
14601,
198,
40539,
654,
13,
36439,
24455,
10786,
46430,
3256,
15932,
8,
198,
198,
6738,
508,
3768,
62,
41989,
13,
41989,
13,
9288,
62,
23914,
1330,
1635,
198,
6738,
508,
3768,
62,
41989,
13,
41989,
13,
9288,
62,
15414,
82,
1330... | 3.177215 | 79 |
# Generated by Django 3.2.8 on 2021-10-06 08:15
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
23,
319,
33448,
12,
940,
12,
3312,
8487,
25,
1314,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
/home/wai/anaconda3/lib/python3.6/locale.py | [
14,
11195,
14,
86,
1872,
14,
272,
330,
13533,
18,
14,
8019,
14,
29412,
18,
13,
21,
14,
17946,
1000,
13,
9078
] | 1.954545 | 22 |
from setuptools import setup, find_packages
setup(name='pkg1',
packages=find_packages(),
test_suite='nose2.collector.collector')
| [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
40406,
7,
3672,
11639,
35339,
16,
3256,
198,
220,
220,
220,
220,
220,
10392,
28,
19796,
62,
43789,
22784,
198,
220,
220,
220,
220,
220,
1332,
62,
2385,
578,
11639,
... | 2.698113 | 53 |
import numpy as np
import argparse
import cv2
if __name__ == "__main__":
ap = argparse.ArgumentParser()
ap.add_argument('-i', '--image', required=False, help='path to the image',default='./image/lego_blocks_1.png')
ap.add_argument('-m', '--method', required=False, help='Sorting method',default='left-to... | [
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
11748,
269,
85,
17,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
2471,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
19... | 2.176948 | 616 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Small GUI for getting all the info for the Home Depot survey.
from tkinter import *
master = Tk()
Label(master, text="First Name").grid(row=0)
Label(master, text="Last Name").grid(row=1)
Label(master, text="E-mail").grid(row=2)
Label(master, text="Zip Code").grid(row=3)
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
10452,
25757,
329,
1972,
477,
262,
7508,
329,
262,
5995,
30884,
5526,
13,
198,
6738,
256,
74,
3849,
1330,
1635,
628,
198,... | 2.417808 | 292 |
# Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract
# DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government
# retains certain rights in this software.
import numpy
import slycat.web.server
| [
2,
15069,
357,
66,
8,
2211,
11,
2864,
2351,
8987,
290,
14044,
23555,
286,
3837,
544,
11,
11419,
764,
4698,
262,
2846,
286,
17453,
198,
2,
5550,
12,
4535,
830,
2327,
1495,
351,
2351,
8987,
290,
14044,
23555,
286,
3837,
544,
11,
11419... | 4.108108 | 74 |
#!/usr/bin/env python
from ctypes import *
from proteus import MeshTools
from proteus import cmeshTools
from proteus.MeshAdaptPUMI import MeshAdaptPUMI
from nose.tools import eq_ as eq
from nose.tools import ok_ as ok
import os
def test_meshLoadPUMI(verbose=0):
"""Test to load serial PUMI model and mesh"""
tes... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
269,
19199,
1330,
1635,
198,
6738,
5915,
385,
1330,
47529,
33637,
198,
6738,
5915,
385,
1330,
12067,
5069,
33637,
198,
6738,
5915,
385,
13,
37031,
48003,
5105,
8895,
1330,
47529,
4... | 2.498851 | 435 |
from django import forms
from .models import Meeting, Resource | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
764,
27530,
1330,
22244,
11,
20857
] | 4.769231 | 13 |
from argparse import ArgumentParser
import numpy as np
import py360convert
import os
import cv2
from mmseg.apis import inference_segmentor, init_segmentor, show_result_pyplot, ret_result
from mmseg.core.evaluation import get_palette
from PIL import Image
import mmcv
if __name__ == '__main__':
main()
| [
6738,
1822,
29572,
1330,
45751,
46677,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
15277,
1102,
1851,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
198,
6738,
8085,
325,
70,
13,
499,
271,
1330,
32278,
62,
325,
5154,
... | 3 | 103 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from netests.constants import NOT_SET
from netests.protocols.vrf import VRF, ListVRF
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
6738,
2010,
3558,
13,
9979,
1187,
1330,
5626,
62,
28480,
198,
6738,
2010,
3558,
13,
11235,
... | 2.561404 | 57 |
"""The load unload problem. An agent is placed on a one dimensional grid world
and is tasked with loading itself up on the right side of the world and
unloading on the left. The agent can observe whether or not it is in the load or
unload block but can not tell its exact location of whether it is loaded or
unloaded. Th... | [
37811,
464,
3440,
555,
2220,
1917,
13,
1052,
5797,
318,
4624,
319,
257,
530,
38517,
10706,
995,
198,
392,
318,
23052,
351,
11046,
2346,
510,
319,
262,
826,
1735,
286,
262,
995,
290,
198,
403,
25138,
319,
262,
1364,
13,
383,
5797,
46... | 3.307692 | 546 |
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["CodeSearchSupport"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class CodeSearchSupport:
"""
CodeSearchSupport
The degree to which the server... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
277,
71,
343,
13,
37540,
13,
40148,
6781,
1330,
6127,
11964,
198,
198,
6738,
267,
2840,
62,
69,
71,
343,
13,
26791,
1330,
6127,
11964,
3103,
984,
628,
198,
834,
439,
834,
796,
14631,
10... | 2.822368 | 456 |
""" Some experiments with python ctypes """
# build the shared library using something like:
#
# ifort -shared -fPIC key_module.f90 linked_list_module.f90 tests/blah_module.f90 tests/c_pointer_test_module.f90 -o test.so
from ctypes import *
# load the shared library:
test = CDLL('test.so')
# define the procedure ... | [
198,
37811,
2773,
10256,
351,
21015,
269,
19199,
37227,
198,
198,
2,
220,
1382,
262,
4888,
5888,
1262,
1223,
588,
25,
198,
2,
198,
2,
611,
419,
532,
28710,
532,
69,
47,
2149,
1994,
62,
21412,
13,
69,
3829,
6692,
62,
4868,
62,
2141... | 2.496503 | 572 |
class DocumintErrorCause(object):
"""
Specific error cause.
"""
class DocumintError(RuntimeError):
"""
Structured Documint error.
"""
class MalformedDocumintError(RuntimeError):
"""
An error, indicated by status code, was malformed.
:ivar bytes data: Error response data.
"""... | [
4871,
14432,
388,
600,
12331,
42323,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
17377,
4049,
2728,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
14432,
388,
600,
12331,
7,
41006,
12331,
2599,
198,
220,
220,
220,
... | 2.834586 | 133 |
"""Tests for template tags of users."""
from django.test import TestCase
from geokey.categories.tests.model_factories import CategoryFactory
from ..templatetags import filter_tags
| [
37811,
51,
3558,
329,
11055,
15940,
286,
2985,
526,
15931,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
4903,
2088,
88,
13,
66,
26129,
13,
41989,
13,
19849,
62,
22584,
1749,
1330,
21743,
22810,
198,
198,
... | 3.471698 | 53 |
#-*- coding:utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
'''
最小二乘法回归
参考博客:http://blog.csdn.net/wangyangzhizhou/article/details/60133958
line 代数推导
matrixLine 矩阵推导
'''
if __name__ == '__main__':
# line()
matrixLine()
| [
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
7061,
6,
198,
17312,
222,
22887,
237,
12859,
234,
20046,
246,
373... | 1.742647 | 136 |
# -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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/licens... | [
2,
16529,
24305,
198,
2,
15069,
19764,
11421,
13,
2177,
198,
2,
220,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
705,
34156,
24036,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
1... | 2.758458 | 1,271 |
reset
set terminal postscript eps enhanced "Helvetica" 20 color
set output "velocity_field_cpu.eps"
unset logscale
set xrange [0 : 1]
set yrange [0 : 1]
set size square
set nokey
factor = 0.1
plot "velocity_cpu_128.dat" using 1:2:($3*factor):($4*factor) every 2 with vec lc 3
set output "velocity_field_gpu.eps"
un... | [
42503,
198,
2617,
12094,
1281,
12048,
304,
862,
13105,
366,
39,
32667,
3970,
1,
1160,
3124,
198,
2617,
5072,
366,
626,
11683,
62,
3245,
62,
36166,
13,
25386,
1,
198,
198,
403,
2617,
2604,
9888,
198,
198,
2617,
2124,
9521,
685,
15,
1... | 2.524444 | 225 |
#This is a mother class to get GBM and LLE data files (lle, pha and rsp)
#Author: giacomov@slac.stanford.edu
import os,sys,glob,string,errno,shutil
from GtBurst.my_fits_io import pyfits
from GtBurst.GtBurstException import GtBurstException
import ftplib, socket
import time
try:
from tkinter import *
... | [
2,
1212,
318,
257,
2802,
1398,
284,
651,
402,
12261,
290,
406,
2538,
1366,
3696,
357,
75,
293,
11,
872,
64,
290,
374,
2777,
8,
201,
198,
2,
13838,
25,
308,
9607,
296,
709,
31,
6649,
330,
13,
14192,
3841,
13,
15532,
201,
198,
201... | 2.621005 | 219 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$',
views.feed, {'page_nr': 1, 'sort': 'hot'}, name='root'),
url(r'^page/(?P<page_nr>\d+)$',
views.feed, {'sort': 'new'}, name='feed_page'),
url(r'^hot$',
views.feed, {'page_nr': 1, 'sort': 'hot'}, name='h... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
5009,
13,
12363,
... | 1.960603 | 863 |
from cony import wsgi
app = wsgi()
| [
6738,
369,
88,
1330,
266,
82,
12397,
198,
198,
1324,
796,
266,
82,
12397,
3419,
198
] | 2.25 | 16 |
import devon.maker, devon.make
from devon.tags import *
import re, os.path
# **************************************************************************************************
| [
198,
11748,
1614,
261,
13,
10297,
11,
1614,
261,
13,
15883,
198,
6738,
1614,
261,
13,
31499,
1330,
1635,
198,
11748,
302,
11,
28686,
13,
6978,
198,
198,
2,
41906,
17174,
17174,
1174,
198
] | 5.235294 | 34 |
import random
import math as m
def direct_surface(d):
""" d is the dimension of the sphere, sigma is the standard deviation of the gaussian"""
sigma=1./m.sqrt(d)
S=0
x=[0]*d
for k in range(d):
x[k]=gauss(sigma)[1]
S+=x[k]**2
for k in range... | [
11748,
4738,
198,
11748,
10688,
355,
285,
198,
198,
4299,
1277,
62,
42029,
7,
67,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
288,
318,
262,
15793,
286,
262,
16558,
11,
264,
13495,
318,
262,
3210,
28833,
286,
262,
31986,
31... | 1.74478 | 431 |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | [
2,
16529,
10541,
198,
2,
15069,
1853,
399,
712,
2271,
11998,
3457,
13,
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,
... | 3.72 | 300 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Part of pymzml test cases
"""
import os
from pymzml.file_classes.standardGzip import StandardGzip
import unittest
import random
from pymzml.spec import Spectrum, Chromatogram
import re
import struct
import test_file_paths
class StandardGzipTest(unittest.TestCase):
... | [
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,
7841,
286,
279,
4948,
89,
4029,
1332,
2663,
198,
37811,
198,
11748,
28686,
198,
6738,
279,
4948,
89,
... | 2.197222 | 360 |
import json
import time
from random import shuffle, randint
from tqdm import tqdm
| [
11748,
33918,
198,
11748,
640,
198,
198,
6738,
4738,
1330,
36273,
11,
43720,
600,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198
] | 3.458333 | 24 |
import torch
import mctorch.nn as nn
import mctorch.optim as optim
import numpy as np
torch.manual_seed(0)
# Random data with high variance in first two dimension
X = torch.diag(torch.FloatTensor([3,2,1])).matmul(torch.randn(3,200))
X -= X.mean(axis=0)
# 1. Initialize Parameter
manifold_param = nn.Para... | [
11748,
28034,
201,
198,
11748,
285,
2715,
354,
13,
20471,
355,
299,
77,
201,
198,
11748,
285,
2715,
354,
13,
40085,
355,
6436,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
13165,
354,
13,
805,
723,
62,
2882... | 2.366472 | 513 |
import zlib
s = 'hello world!hello world!hello world!hello world!'
t = zlib.compress(s.encode())
print(t)
print(bytes(zlib.decompress(t)).decode()) | [
11748,
1976,
8019,
198,
82,
796,
705,
31373,
995,
0,
31373,
995,
0,
31373,
995,
0,
31373,
995,
13679,
198,
83,
796,
1976,
8019,
13,
5589,
601,
7,
82,
13,
268,
8189,
28955,
198,
4798,
7,
83,
8,
198,
4798,
7,
33661,
7,
89,
8019,
... | 2.672727 | 55 |
import os
from socket import *
import time
os.chdir("/storage/emulated/0/Project")
s = socket(AF_INET,SOCK_STREAM)
host = "192.168.64.1"
port = 9010
s.connect((host,port))
filename = 'Text.txt'
clock_start = time.clock()
time_start = time.time()
#rb- readonly : Binary
f = open(filename, 'rb')
#1024 Buf... | [
11748,
28686,
201,
198,
6738,
17802,
1330,
1635,
201,
198,
11748,
640,
201,
198,
201,
198,
418,
13,
354,
15908,
7203,
14,
35350,
14,
368,
4817,
14,
15,
14,
16775,
4943,
201,
198,
201,
198,
82,
796,
17802,
7,
8579,
62,
1268,
2767,
... | 2.552023 | 346 |
import sys
sys.path.append('.')
from astrodbkit2.astrodb import create_database
from astrodbkit2.astrodb import Database
from simple.schema import *
from astropy.table import Table
import numpy as np
from scripts.ingests.utils import ingest_proper_motions
from astropy.coordinates import SkyCoord
import astropy.units as... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
2637,
8,
198,
6738,
6468,
305,
9945,
15813,
17,
13,
459,
305,
9945,
1330,
2251,
62,
48806,
198,
6738,
6468,
305,
9945,
15813,
17,
13,
459,
305,
9945,
1330,
24047,
198,
6738,
2829,
... | 2.586514 | 786 |
from typing import List, Union, Tuple, Optional
from labml.internal.util.colors import StyleCode
| [
6738,
19720,
1330,
7343,
11,
4479,
11,
309,
29291,
11,
32233,
198,
198,
6738,
2248,
4029,
13,
32538,
13,
22602,
13,
4033,
669,
1330,
17738,
10669,
628
] | 3.666667 | 27 |
from django.db import models
# Create your models here.
__all__ = [
'Categories',
'Article',
'Links',
'Tag'
]
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
34,
26129,
3256,
198,
220,
220,
220,
705,
14906,
3256,
198,
220,
220,
220,
705,
31815,
3... | 2.357143 | 56 |
from typing import Union # pylint: disable=unused-import
from tartiflette.constants import UNDEFINED_VALUE
from tartiflette.language.ast import StringValueNode
class USCurrency:
"""
Scalar which handles USD amounts (in format $XX.YY)
"""
@staticmethod
def parse_literal(ast: "ValueNode") -> Uni... | [
6738,
19720,
1330,
4479,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
11748,
198,
198,
6738,
35842,
361,
21348,
13,
9979,
1187,
1330,
4725,
7206,
20032,
1961,
62,
39488,
198,
6738,
35842,
361,
21348,
13,
16129,
13,
459,
13... | 2.34221 | 751 |
import komand
from .schema import GetRecordByIdInput, GetRecordByIdOutput, Input, Output, Component
# Custom imports below
from icon_kintone.util.kintone import get_record
| [
11748,
479,
296,
392,
198,
6738,
764,
15952,
2611,
1330,
3497,
23739,
48364,
20560,
11,
3497,
23739,
48364,
26410,
11,
23412,
11,
25235,
11,
35100,
198,
2,
8562,
17944,
2174,
198,
6738,
7196,
62,
74,
600,
505,
13,
22602,
13,
74,
600,
... | 3.604167 | 48 |
# -*- coding: utf-8 -*-
"""Generate all the scales in different notations.
This code has been written to test whether the user interface works.
The notations and names are approximated, as I am no expert of any other
way of spelling scales than spanish, and maybe english.
For the generation of these scales, an equal-... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
8645,
378,
477,
262,
16252,
287,
1180,
407,
602,
13,
198,
198,
1212,
2438,
468,
587,
3194,
284,
1332,
1771,
262,
2836,
7071,
2499,
13,
198,
464,
407,
602,
290,
... | 1.711873 | 4,026 |
# -*- coding: utf-8 -*-
# @Author: Xiaoyuan Yi
# @Last Modified by: Xiaoyuan Yi
# @Last Modified time: 2020-06-11 22:04:36
# @Email: yi-xy16@mails.tsinghua.edu.cn
# @Description:
'''
Copyright 2020 THUNLP Lab. All Rights Reserved.
This code is part of the online Chinese poetry generation system, Jiuge.
System URL: ht... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
25,
22450,
726,
7258,
26463,
198,
2,
2488,
5956,
40499,
416,
25,
220,
220,
22450,
726,
7258,
26463,
198,
2,
2488,
5956,
40499,
640,
25,
12131,
12,
3312... | 2.785714 | 238 |
import sys
sys.path.append('..')
from data.DBConnection import DBConnection
from data.user import User
| [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
492,
11537,
198,
6738,
1366,
13,
35,
2749,
261,
1606,
295,
1330,
360,
2749,
261,
1606,
295,
198,
6738,
1366,
13,
7220,
1330,
11787,
198,
197,
197,
197,
198,
197,
197,
197,
198,
1... | 1.985714 | 70 |
import datetime
from pathlib import Path
import subprocess
import tempfile
from typing import Tuple, Union
import openpyxl as xl
import pyarrow
from .util import assert_table_equals
# This is hard to test, since it's really an invalid Excel file
# def test_no_sheets_is_error():
# # https://openpyxl.readthedocs.... | [
11748,
4818,
8079,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
6738,
19720,
1330,
309,
29291,
11,
4479,
198,
11748,
1280,
9078,
87,
75,
355,
2124,
75,
198,
11748,
12972,
6018,
198,
6738,
764... | 2.535885 | 418 |
import os
import argparse
import numpy as np
from fr.tagc.rainet.core.util.exception.RainetException import RainetException
from fr.tagc.rainet.core.util.log.Logger import Logger
from fr.tagc.rainet.core.util.time.Timer import Timer
from fr.tagc.rainet.core.util.subprocess.SubprocessUtil import SubprocessUtil
#======... | [
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1216,
13,
12985,
66,
13,
3201,
316,
13,
7295,
13,
22602,
13,
1069,
4516,
13,
31443,
316,
16922,
1330,
10301,
316,
16922,
198,
6738,
1216,
13,
1... | 2.902567 | 1,909 |
#!/usr/bin/env python
import sys
import time
import logging
import boto3
from botocore.exceptions import ClientError
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
logging.basicConfig(level=logging.INFO,format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
lo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
18931,
198,
11748,
275,
2069,
18,
198,
6738,
10214,
420,
382,
13,
1069,
11755,
1330,
20985,
12331,
198,
6738,
26856,
13,
672,
2655,
690,
1330,
... | 2.509259 | 324 |
import argparse
from tiger_pl import Tiger
parser = argparse.ArgumentParser()
parser.add_argument("filename")
args = parser.parse_args()
print(Tiger(args.filename).execute())
| [
11748,
1822,
29572,
198,
198,
6738,
26241,
62,
489,
1330,
17030,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
7203,
34345,
4943,
198,
22046,
796,
30751,
13,
29572,
62,
22046,
3419,
19... | 3.339623 | 53 |
#!/usr/bin/env python3
from ctypes import *
import common_application_interface
import common_sensor_interface
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
269,
19199,
1330,
1635,
198,
198,
11748,
2219,
62,
31438,
62,
39994,
198,
198,
11748,
2219,
62,
82,
22854,
62,
39994,
198
] | 3.352941 | 34 |
from setuptools import setup
readme = ''
with open('README.rst') as f:
readme = f.read()
requirements = [
'aiohttp>=3.7.0,<3.8.0'
]
extras_require = {
'docs': [
'sphinx>=4.1.2',
'sphinx_rtd_theme>=0.5.2',
]
}
packages = [
'aiowowapi',
'aiowowapi.retail',
]
setup(
... | [
6738,
900,
37623,
10141,
1330,
9058,
628,
220,
220,
220,
220,
198,
961,
1326,
796,
10148,
198,
4480,
1280,
10786,
15675,
11682,
13,
81,
301,
11537,
355,
277,
25,
198,
220,
220,
220,
1100,
1326,
796,
277,
13,
961,
3419,
198,
220,
220... | 2.502664 | 563 |
# Django settings for redirect_demo project.
import os
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
gettext = lambda s: s
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends... | [
2,
37770,
6460,
329,
18941,
62,
9536,
78,
1628,
13,
198,
11748,
28686,
198,
31190,
23680,
62,
34720,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
198,
1136,
5239,
796,
... | 2.479758 | 2,149 |
"""
Hangman.
Authors: Tyler Thenell and Zachary Zdanavicius.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
# DONE: 2. Implement Hangman using your Iterative Enhancement Plan.
import random
####### Do NOT attempt this assignment before class! #######
main()
| [
37811,
198,
39,
648,
805,
13,
198,
198,
30515,
669,
25,
14886,
3244,
695,
290,
18825,
560,
1168,
25604,
615,
291,
3754,
13,
198,
37811,
220,
1303,
360,
11651,
25,
352,
13,
350,
3843,
16592,
36751,
3268,
3336,
317,
8202,
6089,
48920,
... | 3.164706 | 85 |
from __future__ import annotations
from typing import Callable, Optional, Tuple, List
from enum import Enum, Flag, auto
from threading import Thread
import datetime
import json
import websocket
class SIStatus(Enum):
"""
Status of operations on the OpenStuder gateway.
- **SIStatus.SUCCESS**: Operation was... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
19720,
1330,
4889,
540,
11,
32233,
11,
309,
29291,
11,
7343,
198,
6738,
33829,
1330,
2039,
388,
11,
19762,
11,
8295,
198,
6738,
4704,
278,
1330,
14122,
198,
11748,
4818,
8079,
198,
11748,... | 2.96273 | 15,750 |
from scipy import fft
import numpy as np
def get_fft_features(features_, s, fs, data, KF_dict, ch, f_ranges, f_band_names):
"""Get FFT features for different f_ranges. Data needs to be a batch of 1s length
Parameters
----------
features_ : dict
feature dictionary
s : dict
settings... | [
6738,
629,
541,
88,
1330,
277,
701,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
651,
62,
487,
83,
62,
40890,
7,
40890,
62,
11,
264,
11,
43458,
11,
1366,
11,
509,
37,
62,
11600,
11,
442,
11,
277,
62,
81,
6231,
11,
277,
... | 2.186684 | 766 |
from __future__ import annotations
from enum import Enum
from imports import k8s
from cdk8s import Chart
from kubeasy_sdk.deployment import Deployment
from kubeasy_sdk.utils.resource import Rendered
from kubeasy_sdk.utils.networking.service_port import ServicePort
from kubeasy_sdk.utils.collections.service_ports impo... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
17944,
1330,
479,
23,
82,
198,
6738,
22927,
74,
23,
82,
1330,
22086,
198,
198,
6738,
479,
3266,
4107,
62,
21282,
74,
13,
2934,
1420,
434,
1330,
... | 3.318966 | 116 |
import operator
import re
data = open("data", "r").read()
seconds = 2503
reindeers = map(parseDataLine, data.split("\n"))
reindeerNames = {}
for reindeer in reindeers:
reindeerNames[reindeer[0]] = 0
for second in range(seconds + 1):
inLeads = inLeadAtSecond(reindeers, second)
for inLead in inLeads:
reindeerN... | [
11748,
10088,
198,
11748,
302,
198,
198,
7890,
796,
1280,
7203,
7890,
1600,
366,
81,
11074,
961,
3419,
628,
198,
43012,
796,
8646,
18,
198,
260,
521,
47619,
796,
3975,
7,
29572,
6601,
13949,
11,
1366,
13,
35312,
7203,
59,
77,
48774,
... | 2.557692 | 208 |
from pyalgotrade import strategy
from pyalgotrade import plotter
from pyalgotrade.tools import quandl
from pyalgotrade.feed import csvfeed
import datetime
if __name__ == "__main__":
main(True)
| [
6738,
12972,
14016,
313,
27585,
1330,
4811,
198,
6738,
12972,
14016,
313,
27585,
1330,
7110,
353,
198,
6738,
12972,
14016,
313,
27585,
13,
31391,
1330,
627,
392,
75,
198,
6738,
12972,
14016,
313,
27585,
13,
12363,
1330,
269,
21370,
12363,... | 3.045455 | 66 |
#
# Tests jupyter notebooks
#
import os
import subprocess
import unittest
import nbconvert
import liionpack as lp
if __name__ == "__main__":
unittest.main()
| [
2,
198,
2,
30307,
474,
929,
88,
353,
43935,
198,
2,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
555,
715,
395,
198,
198,
11748,
299,
65,
1102,
1851,
198,
198,
11748,
7649,
295,
8002,
355,
300,
79,
628,
198,
198,
361,
11... | 2.634921 | 63 |
import frappe
from frappe.utils import now_datetime | [
198,
11748,
5306,
27768,
198,
6738,
5306,
27768,
13,
26791,
1330,
783,
62,
19608,
8079
] | 3.466667 | 15 |
from flask import Flask, render_template, request
import pickle
import pandas as pd
# app instantiation
APP = Flask(__name__)
# Load model
with open("xgb_class_1.pkl", "rb") as f:
model = pickle.load(f)
@APP.route('/')
def Home_page():
'''Landing page to the Kickstarter Prediction project'''
return rende... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
11748,
2298,
293,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
598,
9113,
3920,
198,
24805,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
2,
8778,
2746,
198,
4480,
... | 2.886525 | 141 |
#!/usr/bin/python3
# -*-coding:utf-8-*-
__author__ = "Bannings"
if __name__ == '__main__':
obj = MyQueue()
obj.push(1)
obj.push(2)
assert obj.peek() == 1
assert obj.pop() == 1
assert obj.empty() == False | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
33,
1236,
654,
1,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
19... | 2.12037 | 108 |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | [
29113,
29113,
14468,
4242,
2,
198,
2,
198,
2,
220,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
2426,
284,
2846,
290,
3403,
286,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
... | 2.845845 | 746 |
import os
import torch
import torch.nn as nn
import h5py
from collections import OrderedDict
from torchvision.datasets.utils import download_url
__all__ = ["GoogleNet"]
| [
11748,
28686,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
289,
20,
9078,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
28034,
10178,
13,
19608,
292,
1039,
13,
26791,
1330,
4321,
62,
6371,
... | 3.264151 | 53 |
import constants
base_url = 'http://websismit.manipal.edu/websis/control/StudentAcademicProfile'
url = base_url + '?productCategoryId=0905-TERM-'
base_url_details = 'http://websismit.manipal.edu/websis/control/'
url_details = base_url_details + 'ListCTPEnrollment?customTimePeriodId='
#HTML IDs to be used in first... | [
11748,
38491,
198,
198,
8692,
62,
6371,
796,
705,
4023,
1378,
732,
1443,
1042,
270,
13,
805,
8521,
13,
15532,
14,
732,
1443,
271,
14,
13716,
14,
38778,
12832,
49113,
37046,
6,
198,
6371,
796,
2779,
62,
6371,
1343,
705,
30,
11167,
27... | 2.907631 | 498 |
# Write a Python program to access and print a URL's content to the console.
from http.client import HTTPConnection
conn = HTTPConnection("example.com")
conn.request("GET", "/")
result = conn.getresponse()
# retrieves the entire contents.
contents = result.read()
print(contents)
| [
2,
19430,
257,
11361,
1430,
284,
1895,
290,
3601,
257,
10289,
338,
2695,
284,
262,
8624,
13,
198,
198,
6738,
2638,
13,
16366,
1330,
14626,
32048,
198,
37043,
796,
14626,
32048,
7203,
20688,
13,
785,
4943,
198,
37043,
13,
25927,
7203,
... | 3.662338 | 77 |
from .models import Category
| [
6738,
764,
27530,
1330,
21743,
628
] | 5 | 6 |
##Return sum of all unique elements of an array
if __name__ == "__main__":
nums = [1, 2, 3, 2]
print(unique_element(nums))
| [
2235,
13615,
2160,
286,
477,
3748,
4847,
286,
281,
7177,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
997,
82,
796,
685,
16,
11,
362,
11,
513,
11,
362,
60,
198,
220,
220,
220,
3601,
... | 2.528302 | 53 |
from numpy import uint64 as ui, arange
START = 1050
ONE = ui(1)
n = START
while n < 2**32 -1:
print(n)
with open("fromto.txt", "a") as f:
f.write("%s\t%s\n" % (n, carvedToWritten(n)))
n += 1 | [
6738,
299,
32152,
1330,
20398,
2414,
355,
334,
72,
11,
610,
858,
198,
198,
2257,
7227,
796,
47235,
198,
198,
11651,
796,
334,
72,
7,
16,
8,
198,
198,
77,
796,
33303,
198,
4514,
299,
1279,
362,
1174,
2624,
532,
16,
25,
198,
197,
... | 2.084211 | 95 |
import multiprocessing
import threading
from functools import partial
from typing import Union, TYPE_CHECKING
from copy import deepcopy
from ... import __default_host__
from ...hubble.hubio import HubIO
from ...hubble.helper import is_valid_huburi
from ...enums import GatewayProtocolType, RuntimeBackendType
from ...pa... | [
11748,
18540,
305,
919,
278,
198,
11748,
4704,
278,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
19720,
1330,
4479,
11,
41876,
62,
50084,
2751,
198,
6738,
4866,
1330,
2769,
30073,
198,
198,
6738,
2644,
1330,
11593,
12286,
62,
47... | 2.757985 | 814 |
from ukw_intelli_store.cli import main
from ukw_intelli_store.endomaterial import EndoMaterial
path_test_imd = "tests/data/imd.xlsx"
path_test_mat = "tests/data/mat.xlsx" | [
198,
6738,
334,
46265,
62,
600,
23225,
62,
8095,
13,
44506,
1330,
1388,
198,
6738,
334,
46265,
62,
600,
23225,
62,
8095,
13,
437,
296,
2273,
1330,
5268,
78,
17518,
198,
198,
6978,
62,
9288,
62,
320,
67,
796,
366,
41989,
14,
7890,
... | 2.492754 | 69 |
print("user 1")
| [
4798,
7203,
7220,
352,
4943,
198
] | 2.666667 | 6 |
from panda3d.core import PTAVecBase2f, Vec2
from Code.DebugObject import DebugObject
from Code.Globals import Globals
from Code.RenderPasses.AntialiasingFXAAPass import AntialiasingFXAAPass
from Code.RenderPasses.AntialiasingSMAAPass import AntialiasingSMAAPass
class AntialiasingManager(DebugObject):
""" The A... | [
6738,
279,
5282,
18,
67,
13,
7295,
1330,
350,
5603,
53,
721,
14881,
17,
69,
11,
38692,
17,
198,
198,
6738,
6127,
13,
27509,
10267,
1330,
31687,
10267,
198,
6738,
6127,
13,
9861,
672,
874,
1330,
40713,
874,
198,
198,
6738,
6127,
13,
... | 2.377397 | 1,460 |
#
# PySNMP MIB module CISCO-MGX82XX-RPM-RSRC-PART-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-MGX82XX-RPM-RSRC-PART-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:07:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Pytho... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
36159,
8220,
12,
20474,
55,
6469,
8051,
12,
49,
5868,
12,
6998,
7397,
12,
30709,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
4... | 2.658626 | 4,353 |
#!/usr/bin/env python3
import argparse
import os
import sys
import yaml
from pathlib import Path
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
331,
43695,
198,
6738,
3108,
8019,
1330,
10644,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834... | 2.816327 | 49 |
import random
import time
import pygame
import QuickJSON
import copy
from pathfinding.core.diagonal_movement import DiagonalMovement
from pathfinding.core.grid import Grid
from pathfinding.finder.a_star import AStarFinder
from octagon.utils import render_text, var, img, cout, mp_scene
from octagon.environment import h... | [
11748,
4738,
198,
11748,
640,
198,
11748,
12972,
6057,
198,
11748,
12029,
40386,
198,
11748,
4866,
198,
6738,
3108,
41070,
13,
7295,
13,
10989,
27923,
62,
21084,
434,
1330,
6031,
27923,
21774,
434,
198,
6738,
3108,
41070,
13,
7295,
13,
... | 3.66 | 100 |
from setuptools import setup
import os
# Get version without importing, which avoids dependency issues
setup(
name='imbox',
version=get_version(),
description="Python IMAP for Human beings",
long_description=read('README.md'),
keywords='email, IMAP, parsing emails',
author='Martin Rusev',
... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
11748,
28686,
628,
198,
2,
3497,
2196,
1231,
33332,
11,
543,
30940,
20203,
2428,
628,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
320,
3524,
3256,
198,
220,
220,
220,
2196,
28,
1136,
... | 2.565934 | 364 |
#!/usr/bin/env python3
#
# Written in 2016 by Calvin Ardi <calvin@isi.edu>
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
#
# You should have rece... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
198,
2,
22503,
287,
1584,
416,
25017,
943,
10989,
1279,
9948,
7114,
31,
23267,
13,
15532,
29,
198,
2,
198,
2,
1675,
262,
6287,
1744,
739,
1099,
11,
262,
1772,
7,
82,
... | 2.753719 | 605 |
#! /usr/bin/env python
"""
IBIS-AMI model source code, AMI file, and IBIS file configuration utility.
Original author: David Banas
Original date: February 26, 2016
This script gets called from a makefile, when any of the following need rebuilding:
* a C++ source code file
* a ``*.AMI`` file
* a ``*.IBS`` file
A... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
9865,
1797,
12,
43870,
2746,
2723,
2438,
11,
3001,
40,
2393,
11,
290,
34782,
1797,
2393,
8398,
10361,
13,
198,
198,
20556,
1772,
25,
3271,
10274,
292,
198,
198,
20... | 2.220238 | 2,856 |
'''
name.py
Common name functions
'''
import logging
from nameparser import HumanName
logging.getLogger(__name__).addHandler(logging.NullHandler())
def first_last(name):
'''
Returns name in First Last format
Args:
name(str)
Returns:
str
'''
hn = HumanName(name)
return... | [
7061,
6,
198,
3672,
13,
9078,
198,
17227,
1438,
5499,
198,
198,
7061,
6,
198,
198,
11748,
18931,
198,
6738,
1438,
48610,
1330,
5524,
5376,
198,
198,
6404,
2667,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
737,
2860,
25060,
7,
6404,
26... | 2.170648 | 586 |
from distutils.util import convert_path
import setuptools
# Load the readme
with open("README.md", "r") as fh:
long_description = fh.read()
# Load the version info
version_namespace = {}
ver_path = convert_path("recommender_metrics/version.py")
with open(ver_path) as ver_file:
exec(ver_file.read(), version_n... | [
6738,
1233,
26791,
13,
22602,
1330,
10385,
62,
6978,
198,
198,
11748,
900,
37623,
10141,
198,
198,
2,
8778,
262,
1100,
1326,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
8... | 2.78436 | 422 |
# -*- coding: utf-8 -*-
# Author: Jiajun Ren <jiajunren0522@gmail.com>
import numpy as np
from renormalizer.mps import Mpo, MpDm, ThermalProp
from renormalizer.spectra.base import SpectraTdMpsJobBase
from renormalizer.mps.mps import BraKetPair
from renormalizer.utils import CompressConfig, EvolveConfig
import os
impo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
6434,
25,
449,
544,
29741,
7152,
1279,
73,
544,
29741,
918,
2713,
1828,
31,
14816,
13,
785,
29,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
8851,
6636,
7509... | 2.776119 | 134 |
"""Handle the raw data input/output and interface with external formats."""
from obspy.core import read
from obspy.core.utcdatetime import UTCDateTime
import pandas as pd
import datetime as dt
def load_stream(path):
"""Loads a Stream object from the file at path.
Args:
path: path to the input file, ... | [
37811,
37508,
262,
8246,
1366,
5128,
14,
22915,
290,
7071,
351,
7097,
17519,
526,
15931,
198,
198,
6738,
909,
2777,
88,
13,
7295,
1330,
1100,
198,
6738,
909,
2777,
88,
13,
7295,
13,
315,
10210,
265,
8079,
1330,
18119,
10430,
7575,
198... | 2.570577 | 503 |
from datastructures.stacks import Stack
from datastructures.trees.binary_tree_node import BinaryTreeNode
| [
6738,
4818,
459,
1356,
942,
13,
301,
4595,
1330,
23881,
198,
6738,
4818,
459,
1356,
942,
13,
83,
6037,
13,
39491,
62,
21048,
62,
17440,
1330,
45755,
27660,
19667,
628
] | 3.533333 | 30 |
import os
import git
import time
import unittest
from roundabout.config import Config
from roundabout.git_client import Git, GitException
from tests import utils
| [
11748,
28686,
198,
11748,
17606,
198,
11748,
640,
198,
11748,
555,
715,
395,
198,
198,
6738,
2835,
10755,
13,
11250,
1330,
17056,
198,
6738,
2835,
10755,
13,
18300,
62,
16366,
1330,
15151,
11,
15151,
16922,
198,
6738,
5254,
1330,
3384,
... | 3.837209 | 43 |
subjects=["I", "You"]
verbs=["Play", "Love"]
objects=["Hockey","Football"]
for i in range(len(subjects)):
for j in range(len(verbs)):
for k in range(len(objects)):
sentence = "%s %s %s." % (subjects[i], verbs[j], objects[k])
print(sentence)
| [
32796,
82,
28,
14692,
40,
1600,
366,
1639,
8973,
198,
46211,
28,
14692,
11002,
1600,
366,
18565,
8973,
198,
48205,
28,
14692,
39,
8337,
2430,
37316,
8973,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
32796,
82,
8,
2599,
198,
220,
220,
2... | 2.216 | 125 |
__version__ = '1.28.0dev'
| [
834,
9641,
834,
796,
705,
16,
13,
2078,
13,
15,
7959,
6,
198
] | 2 | 13 |
from Xdmf import *
if __name__ == "__main__":
#//initialization begin
exampleMap = XdmfMap.New()
#//initialization end
#//initializationnode begin
#create attributes for each task id
#the index of the node id in the attribute is the local node id
map1Attribu... | [
6738,
1395,
36020,
69,
1330,
1635,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1003,
36733,
1634,
2221,
628,
220,
220,
220,
220,
220,
220,
220,
1672,
13912,
796,
1... | 2.110763 | 3,196 |
import gpss_pb2_grpc
| [
11748,
27809,
824,
62,
40842,
17,
62,
2164,
14751,
198
] | 2.1 | 10 |
import json
import traceback
import boto3
from boto3.dynamodb.conditions import Attr
TABLE_NAME = 'Quotes'
DAILY_RESOURCE_NAME = 'daily'
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(TABLE_NAME)
| [
11748,
33918,
198,
11748,
12854,
1891,
198,
11748,
275,
2069,
18,
198,
6738,
275,
2069,
18,
13,
67,
4989,
375,
65,
13,
17561,
1756,
1330,
3460,
81,
628,
198,
38148,
62,
20608,
796,
705,
23138,
6,
198,
5631,
33340,
62,
19535,
31033,
... | 2.666667 | 81 |
import numpy as np;
import pandas as pd
import matplotlib.pyplot as plt;
from pandas_datareader import data as web
import yfinance as yf
yf.pdr_override()
import os
import dadosCart as c
somaPal=0
somaEu=0
rentTotal=0
decisao=1
while decisao!=5:
os.system('cls')
decisao = int(input('Digite o que você deseja... | [
11748,
299,
32152,
355,
45941,
26,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
26,
198,
6738,
19798,
292,
62,
19608,
533,
5067,
1330,
1366,
355,
3992,
220,
220,
220,
198,
11748,
... | 1.663816 | 2,689 |
names = ['Juan','Pedro','Alejandro','Roberto','Enrique']
print(names[0])
print(names[1])
print(names[2])
print(names[3])
print(names[4]) | [
14933,
796,
37250,
41,
7258,
41707,
43468,
305,
41707,
37474,
47983,
41707,
15924,
1462,
41707,
4834,
33865,
20520,
198,
4798,
7,
14933,
58,
15,
12962,
198,
4798,
7,
14933,
58,
16,
12962,
198,
4798,
7,
14933,
58,
17,
12962,
198,
4798,
... | 2.566038 | 53 |