content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import random
import numpy as np
from flatland.envs.rail_env import RailEnv
from flatland.envs.rail_generators import sparse_rail_generator, complex_rail_generator
from flatland.envs.schedule_generators import sparse_schedule_generator, complex_schedule_generator
from flatland.envs.predictions import ShortestPat... | [
11748,
4738,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
6738,
6228,
1044,
13,
268,
14259,
13,
30224,
62,
24330,
1330,
12950,
4834,
85,
201,
198,
6738,
6228,
1044,
13,
268,
14259,
13,
30224,
62,
8612,
2024,
1330,
2987... | 3.116438 | 146 |
from ._cfunctions import MKL, mkl_library_name
from ._constants import *
from ._structs import sparse_matrix_t, MKL_Complex8, MKL_Complex16
import numpy as _np
import ctypes as _ctypes
from scipy import sparse as _spsparse
import warnings
import time
from numpy.ctypeslib import as_array
# Use mkl-service to check ve... | [
6738,
47540,
66,
12543,
2733,
1330,
20553,
43,
11,
33480,
75,
62,
32016,
62,
3672,
198,
6738,
47540,
9979,
1187,
1330,
1635,
198,
6738,
47540,
7249,
82,
1330,
29877,
62,
6759,
8609,
62,
83,
11,
20553,
43,
62,
5377,
11141,
23,
11,
20... | 2.27693 | 12,523 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-12 14:41
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
21,
319,
1584,
12,
2998,
12,
1065,
1478,
25,
3901,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
from .__Fundamental_63 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class SecurityBorrowedBalanceSheet(QuantConnect.Data.Fu... | [
6738,
764,
834,
24553,
6860,
62,
5066,
1330,
1635,
198,
11748,
19720,
198,
11748,
4482,
13,
9399,
198,
11748,
4482,
13,
5216,
26448,
13,
46189,
198,
11748,
4482,
198,
11748,
16972,
13313,
13,
6601,
13,
24553,
6860,
13,
29800,
5990,
2101... | 3.195564 | 2,209 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import json
from django.db import models
from django.core.validators import RegexValidator
from django.db.models.signals import pre_save
from django.dispatch import receiver
from django... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
1853,
2297,
10983,
198,
2,
49962,
739,
383,
17168,
13789,
357,
36393,
8,
198,
2,
2638,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
... | 2.517699 | 904 |
from __future__ import division
from math import atan2, cos, sin, pi
import wx
FONT = 'Helvetica'
BACKGROUND = '#FFFFFF'
NODE_FILL = '#FFEBD3'
NODE_COLOR = '#00283F'
EDGE_COLOR = '#00283F'
TEXT_COLOR = '#00283F'
NODE_WIDTH = 2
EDGE_WIDTH = 2
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
6738,
10688,
1330,
379,
272,
17,
11,
8615,
11,
7813,
11,
31028,
198,
11748,
266,
87,
198,
198,
37,
35830,
796,
705,
39,
32667,
3970,
6,
198,
31098,
46025,
796,
705,
2,
29312,
5777,
6,
... | 2.198198 | 111 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
import inspect
from .metrics import smape, wmape, mape, mse, mae, rmsse
from ..exceptions import BacktestException
from ..constants.constants import TimeSeriesSplitSchemeKeys, BacktestFitKeys
from ..constants.palette impor... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
10104,
198,
198,
6738,
764,
4164,
10466,
1330,
895,
1758,... | 2.329868 | 4,329 |
import numpy as np
import torch
import visual_plt
import utils
import pdb
import gc
from torch.nn import functional as F
import random
import os
import pickle
import time
####--------------------------------------------------------------------------------------------------------------####
####-------------------------... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
5874,
62,
489,
83,
198,
11748,
3384,
4487,
198,
11748,
279,
9945,
198,
11748,
308,
66,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198,
11748,
4738,
198,
11748,
28686... | 2.427232 | 2,240 |
numeros = [17, 24, 7, 39, 8, 51, 92]
print(filter(numero_par, numeros)) # objeto iterable
print(list(filter(numero_par, numeros)))
| [
198,
198,
77,
6975,
418,
796,
685,
1558,
11,
1987,
11,
767,
11,
5014,
11,
807,
11,
6885,
11,
10190,
60,
198,
198,
4798,
7,
24455,
7,
22510,
3529,
62,
1845,
11,
5470,
418,
4008,
220,
1303,
26181,
27206,
11629,
540,
198,
198,
4798,
... | 2.344828 | 58 |
#! python
# -*- coding: utf-8 -*-
#
# $Id: add_to_gigadial.py 158 2006-11-07 09:17:52Z sgrayban $
#
# CastPodder plugin adding a GigaDial menu of the feed in the downloads tab
#
"""
CastPodder is Copright © 2005-2006 Scott Grayban
Read the file Software_License_Agreement.txt for more info.
"""
__license__ = "GPL"
im... | [
2,
0,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
720,
7390,
25,
751,
62,
1462,
62,
70,
328,
324,
498,
13,
9078,
24063,
4793,
12,
1157,
12,
2998,
7769,
25,
1558,
25,
4309,
57,
264,
4... | 2.665116 | 430 |
# -*- coding: utf-8 -*-
from setuptools import setup
from spysort.version import version
long_description = open("README.md").read()
install_requires = ['numpy>=1.3.0', 'pandas>=0.12.0', 'scipy>=0.9.0',
'matplotlib>=1.1.0', 'sqlalchemy>=0.7',
'scikit-learn>=0.11', ]
setup(nam... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
6738,
599,
893,
419,
13,
9641,
1330,
2196,
198,
198,
6511,
62,
11213,
796,
1280,
7203,
15675,
11682,
13,
9132,
11074,
961,... | 2.125407 | 614 |
import pytesseract
from modules.helpers import *
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(name="OCR")
#OCR
| [
11748,
12972,
83,
408,
263,
529,
198,
6738,
13103,
13,
16794,
364,
1330,
1635,
198,
11748,
18931,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
8,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
... | 2.851852 | 54 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@文件 :data_constant.py
@说明 :
@时间 :2020/07/30 15:36:45
@作者 :Riven
@版本 :1.0.0
'''
DATA_DB_PATH = '/app_server/data/data_base.db'
ACCOUNT_DB_TABLE_NAME = 'account_table'
ACCOUNT_DB_TABLE_KEYS = ['phone', 'password', 'name', 'token']
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
31,
23877,
229,
20015,
114,
220,
220,
220,
220,
220,
220,
220,
1058,
7890,
62,
9979,
415,
13,
9078,
1... | 1.772222 | 180 |
from flask import request
from flask.ext import restful
from .tools import service_iden
from .api import APIException
from .service_store import service_store
from .swagger import swagger
| [
6738,
42903,
1330,
2581,
198,
6738,
42903,
13,
2302,
1330,
1334,
913,
198,
198,
6738,
764,
31391,
1330,
2139,
62,
14029,
198,
6738,
764,
15042,
1330,
7824,
16922,
198,
6738,
764,
15271,
62,
8095,
1330,
2139,
62,
8095,
198,
6738,
764,
... | 4.042553 | 47 |
import codecs
import requests
from six import iteritems
from six import BytesIO
from six.moves.urllib_parse import urljoin
from lxml.html import _nons, HTMLParser
from .py2compat import parse_headers
from .iterable import one
from .http import DEFAULT_TIMEOUT, readable_from_response, merge_setting
from .etree import ge... | [
11748,
40481,
82,
198,
11748,
7007,
198,
6738,
2237,
1330,
11629,
23814,
198,
6738,
2237,
1330,
2750,
4879,
9399,
198,
6738,
2237,
13,
76,
5241,
13,
333,
297,
571,
62,
29572,
1330,
19016,
22179,
198,
6738,
300,
19875,
13,
6494,
1330,
... | 2.266388 | 717 |
import skmob
import numpy as np
import networkx as nx
import osmnx as ox
from skmob.core.trajectorydataframe import *
###########################################################################################################
########################################## MAP-MATCHING #####################################... | [
11748,
1341,
39949,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
267,
5796,
77,
87,
355,
12018,
198,
6738,
1341,
39949,
13,
7295,
13,
9535,
752,
652,
7890,
14535,
1330,
1635,
198,
198,
29113,
291... | 3.010029 | 2,094 |
from spark_parser.scanner import GenericToken
| [
6738,
9009,
62,
48610,
13,
35836,
1008,
1330,
220,
42044,
30642,
198
] | 3.916667 | 12 |
import commands
import packetFactory
from packetFactory import SystemMessagePacket
import plugins
maintmode = False
@plugins.CommandHook("maint", "[Hanya Admin] Proxy maintenance mode", True)
@plugins.PacketHook(0x11, 0x0)
def Maint_check(context, data):
"""
:type context: ShipProxy.ShipProxy
"""
g... | [
11748,
9729,
198,
11748,
19638,
22810,
198,
6738,
19638,
22810,
1330,
4482,
12837,
47,
8317,
198,
11748,
20652,
198,
76,
2913,
14171,
796,
10352,
628,
198,
31,
37390,
13,
21575,
39,
566,
7203,
76,
2913,
1600,
12878,
39,
34183,
32053,
60... | 2.672078 | 308 |
#/usr/bin/python
from optparse import OptionParser
import os
from app import app, startup
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-e", "--env", dest="environment",
help="ENV in which bigboy will run",
default="app", metavar="ENV")
... | [
2,
14,
14629,
14,
8800,
14,
29412,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
11748,
28686,
198,
198,
6738,
598,
1330,
598,
11,
13693,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
30751,... | 2.43125 | 160 |
# Your UndergroundSystem object will be instantiated and called as such:
# obj = UndergroundSystem()
# obj.checkIn(id,stationName,t)
# obj.checkOut(id,stationName,t)
# param_3 = obj.getAverageTime(startStation,endStation) | [
198,
198,
2,
3406,
22153,
11964,
2134,
481,
307,
9113,
12931,
290,
1444,
355,
884,
25,
198,
2,
26181,
796,
22153,
11964,
3419,
198,
2,
26181,
13,
9122,
818,
7,
312,
11,
17529,
5376,
11,
83,
8,
198,
2,
26181,
13,
9122,
7975,
7,
3... | 3.231884 | 69 |
from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name ="landpageindex"),
path('proceed', views.proceed, name="proceed"),
path('authentication', views.auth, name='auth'),
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
201,
198,
6738,
764,
1330,
5009,
201,
198,
6371,
33279,
82,
796,
685,
201,
198,
220,
3108,
10786,
3256,
33571,
13,
9630,
11,
3672,
796,
1,
1044,
7700,
9630,
12340,
201,
198,
220,
3108,
1... | 2.92 | 75 |
"""
261. Maximum Connected Area
https://www.lintcode.com/problem/maximum-connected-area/description?_from=contest&&fromId=
thought:
traverse all starting point with 0, then do bfs. count while doing bfs
special case:
when entire board is 1. then return n * m
time complexity: worst case: (O(m^2 n^2))
TLE
"""
from co... | [
37811,
198,
30057,
13,
22246,
8113,
276,
9498,
198,
5450,
1378,
2503,
13,
75,
600,
8189,
13,
785,
14,
45573,
14,
47033,
12,
15236,
12,
20337,
14,
11213,
30,
62,
6738,
28,
3642,
395,
25226,
6738,
7390,
28,
198,
198,
28895,
25,
198,
... | 2.402174 | 276 |
import asyncio
import socket
from ..._errors import ProxyError
from ... import _abc as abc
DEFAULT_RECEIVE_SIZE = 65536
| [
11748,
30351,
952,
198,
11748,
17802,
198,
198,
6738,
2644,
62,
48277,
1330,
38027,
12331,
198,
198,
6738,
2644,
1330,
4808,
39305,
355,
450,
66,
198,
198,
7206,
38865,
62,
2200,
5222,
9306,
62,
33489,
796,
45021,
2623,
628
] | 3.179487 | 39 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 3.020513 | 195 |
#Algoritmo genetico basico que resuelve problemas parametricos o combinatorios
#CarlosAEH1
numeros16=[[0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1], [0, 1, 1, 0], [0, 1, 1, 1], [1, 0, 0, 0], [1, 0, 0, 1], [1, 0, 1, 0], [1, 0, 1, 1], [1, 1, 0, 0], [1, 1, 0, 1], [1, 1, 1, 0], [1, 1, ... | [
2,
2348,
7053,
270,
5908,
2429,
316,
3713,
1615,
3713,
8358,
581,
2731,
303,
1917,
292,
5772,
19482,
418,
267,
1974,
20900,
4267,
198,
2,
26886,
418,
14242,
39,
16,
198,
198,
77,
6975,
418,
1433,
28,
30109,
15,
11,
657,
11,
657,
1... | 2.460407 | 884 |
""" basic tensor operation """
from __future__ import absolute_import
import ctypes
import numpy as np
from ddls.base import check_call, LIB, c_str, c_array, _NP_2_DTYPE, _DTYPE_2_NP
class Tensor(object):
""" The sample record i/o
"""
def __init__(self, shape, type, handle = None, own_handle = False):
... | [
37811,
4096,
11192,
273,
4905,
37227,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
269,
19199,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
49427,
7278,
13,
8692,
1330,
2198,
62,
13345,
11,
45651,
11,
269,
62,... | 1.826332 | 1,595 |
if __name__ == "__main__":
print(interessante_getallen(2, 1, 10))
| [
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
220,
220,
220,
3601,
7,
600,
68,
601,
12427,
62,
1136,
439,
268,
7,
17,
11,
352,
11,
838,
4008,
201,
198,
201,
198
] | 1.95 | 40 |
from __future__ import annotations
import json
from typing import Any, List
from .Base import HasProperty
from .Node import Node, NodeSet
from .Edge import Edge, EdgeSet
from .Graph import Graph
# TODO add default styles
default_directed_styles: dict = {}
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
11748,
33918,
198,
6738,
19720,
1330,
4377,
11,
7343,
198,
198,
6738,
764,
14881,
1330,
7875,
21746,
198,
6738,
764,
19667,
1330,
19081,
11,
19081,
7248,
198,
6738,
764,
37021,
1330,
13113,
11,
... | 3.865672 | 67 |
import logging
from enum import Enum
from typing import Any, Optional
from databases import Database
from pandas import DataFrame
from bender.data_importer.importer import LiteralImporter
from bender.data_importer.local_csv import LocalCsvImporter
from bender.pipeline.factory_states import LoadedData # type: ignore
... | [
11748,
18931,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
4377,
11,
32233,
198,
198,
6738,
20083,
1330,
24047,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
198,
6738,
275,
2194,
13,
7890,
62,
320,
26634,
13,
320,
26634,... | 3.504854 | 103 |
from main import *
import matplotlib.pyplot as plt
import datetime as dt
from collections import abc
from boost_effects import *
# **KWARGS
# gear: A list of gear items which will all be equipped
# players: a list of player stats to cycle through
# potions: a list of potions to use, including divine/repot timer
# ti... | [
6738,
1388,
1330,
1635,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
4818,
8079,
355,
288,
83,
198,
6738,
17268,
1330,
450,
66,
198,
198,
6738,
5750,
62,
34435,
1330,
1635,
198,
198,
2,
12429,
42,
16279,
... | 2.756859 | 1,057 |
#
# 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,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
257,
4866,
286,
262,
13789,
379,... | 2.404512 | 6,870 |
import inspect
import itertools
import json
import operator
import pathlib
from datetime import datetime
from cogs.utils.db import all_tables
_DEFAULT_DIR = pathlib.Path('data', 'migrations')
_REVISIONS_FILE_NAME = '.revisions'
_MIN_TIMESTAMP = _format_timestamp(datetime.min)
_MAX_TIMESTAMP = _format_timestamp(datet... | [
11748,
10104,
198,
11748,
340,
861,
10141,
198,
11748,
33918,
198,
11748,
10088,
198,
11748,
3108,
8019,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
269,
18463,
13,
26791,
13,
9945,
1330,
477,
62,
83,
2977,
198,
198,
62,
... | 2.87069 | 116 |
import argparse
import gc
from copy import deepcopy
from importlib import import_module
import json
import logging
from math import inf
import os
from pathlib import Path
import random
from shutil import move
import numpy as np
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedData... | [
11748,
1822,
29572,
198,
11748,
308,
66,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
10688,
1330,
1167,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,... | 2.185339 | 4,829 |
import xml.etree.ElementTree as ET
from parserAlloy.netElement import NetElement
from parserAlloy.netRelation import NetRelation
from parserAlloy.network import Network
from parserAlloy.level import Level
from parserAlloy.railway import Railway
| [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
6738,
30751,
3237,
726,
13,
3262,
20180,
1330,
3433,
20180,
198,
6738,
30751,
3237,
726,
13,
3262,
6892,
341,
1330,
3433,
6892,
341,
198,
6738,
30751,
3237,
726,
13,
27349,
... | 3.776119 | 67 |
"""Top-level package for castillo-chan-zhou-decrypt-binary."""
__authors__ = """Joel Castillo, Ho Yin Kenneth Chan, Gary Zhou"""
__author_emails__ = """joel.castillo@nyu.edu, hyc449@nyu.edu, gz438@nyu.edu"""
__version__ = "1.0.0"
| [
37811,
9126,
12,
5715,
5301,
329,
3350,
16111,
12,
3147,
12,
38536,
12,
12501,
6012,
12,
39491,
526,
15931,
198,
198,
834,
41617,
834,
796,
37227,
9908,
417,
5833,
16111,
11,
9544,
37201,
23632,
18704,
11,
10936,
32222,
37811,
198,
834,... | 2.566667 | 90 |
from .base import *
SECRET_KEY = env('DJANGO_SECRET_KEY', default='!msi1!ep5$+8bh#5r@6zy$jv2f=t^ekyn$3@7$sgj##tz14^s6')
DEBUG = env.bool('DJANGO_DEBUG', default=True)
MEDIA_ROOT = str(APPS_DIR('media'))
| [
6738,
764,
8692,
1330,
1635,
198,
198,
23683,
26087,
62,
20373,
796,
17365,
10786,
35028,
1565,
11230,
62,
23683,
26087,
62,
20373,
3256,
4277,
11639,
0,
907,
72,
16,
0,
538,
20,
3,
10,
23,
34369,
2,
20,
81,
31,
21,
7357,
3,
73,
... | 2 | 103 |
import matplotlib
matplotlib.use('Qt4Agg')
matplotlib.interactive(True)
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, Ellipse, Circle
# register Axes3D class with matplotlib by importing Axes3D
from mpl_toolkits.mplot3d import art3d
import numpy as np
def draw_windtunnel_border(ax):
""... | [
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
48,
83,
19,
46384,
11537,
198,
6759,
29487,
8019,
13,
3849,
5275,
7,
17821,
8,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
80... | 2.243439 | 1,791 |
import numpy as np
from pathlib import Path
dataset_dir = Path(__file__).parents[2] / 'data'
| [
11748,
299,
32152,
355,
45941,
198,
6738,
3108,
8019,
1330,
10644,
198,
19608,
292,
316,
62,
15908,
796,
10644,
7,
834,
7753,
834,
737,
23743,
58,
17,
60,
1220,
705,
7890,
6,
198
] | 2.818182 | 33 |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
220,
220,
15069,
357,
66,
8,
13130,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 3.758333 | 240 |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable
import awkward as ak
from awkward._v2.index import Index
from awkward._v2._slicing impo... | [
2,
347,
10305,
513,
12,
2601,
682,
13789,
26,
766,
3740,
1378,
12567,
13,
785,
14,
36216,
15813,
12,
258,
79,
14,
707,
12378,
12,
16,
13,
15,
14,
2436,
672,
14,
12417,
14,
43,
2149,
24290,
198,
198,
6738,
11593,
37443,
834,
1330,
... | 3.178571 | 168 |
import numpy as np
import fitsio
from astropy.table import Table,join
from LSS.tabulated_cosmo import TabulatedDESI
cosmo = TabulatedDESI()
dis_dc = cosmo.comoving_radial_distance
#functions that shouldn't have any dependence on survey go here
def mknz(fcd,fcr,fout,bs=0.01,zmin=0.01,zmax=1.6):
'''
fcd is ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11414,
952,
198,
6738,
6468,
28338,
13,
11487,
1330,
8655,
11,
22179,
198,
198,
6738,
406,
5432,
13,
8658,
4817,
62,
6966,
5908,
1330,
16904,
4817,
30910,
40,
198,
6966,
5908,
796,
16904,
4817,... | 2.169759 | 1,455 |
import network as nt
import random as rn
import numpy as np
hidden_layer_count_range = range(0, 0)
hidden_layer_neuron_count_range = range(0, 0)
mini_batch_size_range = range(0, 0)
learning_rate_range = np.arange(0.0, 0.0)
regularization_rate_range = np.arange(0.0, 0.0)
training_data = []
epoch_count = 0
evaluation_d... | [
11748,
3127,
355,
299,
83,
198,
11748,
4738,
355,
374,
77,
198,
11748,
299,
32152,
355,
45941,
198,
198,
30342,
62,
29289,
62,
9127,
62,
9521,
796,
2837,
7,
15,
11,
657,
8,
198,
30342,
62,
29289,
62,
710,
44372,
62,
9127,
62,
9521... | 2.5625 | 128 |
def mod(x, y):
"""Returns the positive remainder of x divided by y"""
# In Python, this function is identical to the remainder operator.
# However, many other languages define remainders differently
assert y > 0
return x % y | [
4299,
953,
7,
87,
11,
331,
2599,
198,
220,
220,
220,
37227,
35561,
262,
3967,
17675,
286,
2124,
9086,
416,
331,
37811,
198,
220,
220,
220,
1303,
554,
11361,
11,
428,
2163,
318,
10411,
284,
262,
17675,
10088,
13,
198,
220,
220,
220,
... | 3.485714 | 70 |
import logging
import math
import struct
import traceback
import threading
import asyncio
import sys
import functools
import time
import sexpr
from naoth.utils._debug import open_connection # needed to work with python < 3.7
class SimsparkController(threading.Thread):
"""Represents the controlling class of an s... | [
11748,
18931,
198,
11748,
10688,
198,
11748,
2878,
198,
11748,
12854,
1891,
198,
11748,
4704,
278,
198,
11748,
30351,
952,
198,
11748,
25064,
198,
11748,
1257,
310,
10141,
198,
11748,
640,
198,
198,
11748,
1714,
1050,
198,
6738,
12385,
84... | 2.186603 | 11,495 |
#%%
import numpy as np
import pandas as pd
import altair as alt
import scipy.stats
from altair_saver import save
import diaux.viz
colors, palette = diaux.viz.altair_style()
alt.data_transformers.disable_max_rows()
# %%
DATA_PATH = '../../../../data/plate_reader/2021-04-16_NCM3722_glucose_titration_tecan_comparison/pro... | [
2,
16626,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
11748,
5988,
958,
355,
5988,
198,
11748,
629,
541,
88,
13,
34242,
198,
6738,
5988,
958,
62,
82,
8770,
1330,
3613,
198,
11748,
288,
544,
28... | 2.10224 | 2,054 |
import json
import signal
import sys
import time
import uuid
from dataclasses import asdict, dataclass
@dataclass
if __name__ == "__main__":
time.sleep(1)
main(GracefulKiller())
| [
11748,
33918,
198,
11748,
6737,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
334,
27112,
198,
6738,
4818,
330,
28958,
1330,
355,
11600,
11,
4818,
330,
31172,
628,
198,
198,
31,
19608,
330,
31172,
628,
198,
198,
361,
11593,
3672,
834,... | 2.742857 | 70 |
#!/usr/bin/env python
#
# clkdirpwm.py
#
# Control interface for at90usb based clock and direction to pwm board.
# Provides python module and a command line utility.
#
# Note, need to set permissions correctly to get device to respond to nonroot
# users. This required adding and rules file to udev/rules.d and adding ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
537,
74,
15908,
79,
26377,
13,
9078,
220,
198,
2,
198,
2,
6779,
7071,
329,
379,
3829,
43319,
1912,
8801,
290,
4571,
284,
279,
26377,
3096,
13,
220,
198,
2,
47081,
21015,... | 2.430225 | 1,469 |
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to ... | [
2235,
198,
2,
770,
3788,
373,
4166,
290,
1220,
393,
9518,
416,
7760,
1169,
261,
5834,
11,
198,
2,
12997,
284,
17453,
46133,
16945,
54,
12,
2713,
12,
34,
48,
12,
940,
3134,
351,
262,
1294,
5070,
13,
201,
198,
2,
220,
201,
198,
2,... | 2.679795 | 584 |
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess
# Launch a single drone.
| [
11748,
28686,
198,
198,
6738,
257,
434,
62,
9630,
62,
29412,
13,
43789,
1330,
651,
62,
26495,
62,
20077,
62,
34945,
198,
6738,
4219,
1330,
21225,
11828,
198,
6738,
4219,
62,
4951,
13,
4658,
1330,
19081,
198,
6738,
4219,
13,
4658,
1330... | 4.092593 | 54 |
import toml
from ..deployer import Deployer
from ..check_env import check_env
if __name__ == "__main__":
main() | [
11748,
284,
4029,
198,
6738,
11485,
2934,
1420,
263,
1330,
34706,
263,
198,
6738,
11485,
9122,
62,
24330,
1330,
2198,
62,
24330,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
1388,
3419
] | 3 | 38 |
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.output(17,0)
print "LED OFF" | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
16960,
9399,
13,
2617,
14171,
7,
16960,
9399,
13,
2749,
44,
8,
198,
16960,
9399,
13,
40406,
7,
1558,
11,
50143,
13,
12425,
8,
198,
16960,
9399,
13,
22915,
7,
1558,
11,
15,
8,
198... | 2.142857 | 49 |
# Copyright 2019 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | [
2,
15069,
13130,
383,
6295,
3262,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
... | 3.910314 | 223 |
import torch
from .rotations import compute_rotation_matrix_from_ortho6d, compute_rotation_matrix_from_quaternions
from .transform_ops import transform_pts
l1 = lambda diff: diff.abs()
l2 = lambda diff: diff ** 2
| [
11748,
28034,
198,
198,
6738,
764,
10599,
602,
1330,
24061,
62,
10599,
341,
62,
6759,
8609,
62,
6738,
62,
1506,
78,
21,
67,
11,
24061,
62,
10599,
341,
62,
6759,
8609,
62,
6738,
62,
421,
9205,
507,
198,
6738,
764,
35636,
62,
2840,
... | 3.027778 | 72 |
#Crie um programa que leia um numero real qualquer pelo teclado e mostre na tela a sua porção inteira
#Digite um numero: 3.222, o numero 3.222 tem a parte inteira 3
from math import trunc
n = float (input('Informe um número:'))
print ('O número que você digitou é {}, sua parte inteira é {}'.format(n, trunc(n)))
# o ... | [
2,
34,
5034,
23781,
1430,
64,
8358,
443,
544,
23781,
997,
3529,
1103,
4140,
10819,
16176,
78,
573,
565,
4533,
304,
749,
260,
12385,
256,
10304,
257,
424,
64,
16964,
16175,
28749,
493,
68,
8704,
198,
2,
19511,
578,
23781,
997,
3529,
... | 2.612745 | 204 |
import pygame, sys
pygame.init()
win = pygame.display.set_mode((400, 400))
pygame.display.set_caption("Snake Pygame")
x = 50
y = 50
width = 40
hight = 60
velocity = 10
run = True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
... | [
11748,
12972,
6057,
11,
25064,
201,
198,
201,
198,
9078,
6057,
13,
15003,
3419,
201,
198,
201,
198,
5404,
796,
12972,
6057,
13,
13812,
13,
2617,
62,
14171,
19510,
7029,
11,
7337,
4008,
201,
198,
9078,
6057,
13,
13812,
13,
2617,
62,
... | 1.681941 | 742 |
import numpy as np
import pandas as pd
def low_spread(stock_hist, price_type, num_spread=5):
""" Get the lowest historical price for input spread of records."""
return stock_hist.sort_values(by=[price_type]).head(num_spread)
def high_spread(stock_hist, price_type, num_spread=5):
""" Get the lowest histo... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
4299,
1877,
62,
43639,
7,
13578,
62,
10034,
11,
2756,
62,
4906,
11,
997,
62,
43639,
28,
20,
2599,
198,
220,
220,
220,
37227,
3497,
262,
9016,
6754,
2756,... | 2.695763 | 1,180 |
import os
import pickle
import shutil
import time
import numpy as np
from PIL import Image
import wandb
WANDB_PROJECT_ENV = os.environ.get("WANDB_PROJECT")
if WANDB_PROJECT_ENV is None:
WANDB_PROJECT = "test__" + str(round(time.time()) % 1000000)
else:
WANDB_PROJECT = WANDB_PROJECT_ENV
os.environ["WANDB_PROJE... | [
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
4423,
346,
198,
11748,
640,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
11569,
65,
198,
198,
54,
6981,
33,
62,
31190,
23680,
62,
1677,
53,
796... | 2.085714 | 735 |
import hashlib
import json
import os
import random
import shutil
import sys
import time
from datetime import timedelta
from pathlib import Path
from tarfile import TarFile
from zipfile import ZipFile
import gevent
import requests
import structlog
from cachetools.func import ttl_cache
from eth_keyfile import create_key... | [
11748,
12234,
8019,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
13422,
7753,
... | 2.622103 | 561 |
f = open('cooking-the-books.in', 'r')
T = f.readline()
nums = f.read().splitlines()
for index, num in enumerate(nums):
arr = []
arr.append(num)
for i in range(0, len(num)):
for j in range(i + 1, len(num)):
if (not(i == 0 and num[j] == '0')):
temp = num[:]
arr.append(swap(temp, i, j))
... | [
69,
796,
1280,
10786,
27916,
278,
12,
1169,
12,
12106,
13,
259,
3256,
705,
81,
11537,
198,
51,
796,
277,
13,
961,
1370,
3419,
198,
77,
5700,
796,
277,
13,
961,
22446,
35312,
6615,
3419,
198,
198,
1640,
6376,
11,
997,
287,
27056,
3... | 2.176136 | 176 |
instance = None
import importlib
import embed
from io import StringIO
import pythons.aio.irc as irc
import ast
import types
import inspect
from codeop import CommandCompiler
do_compile = CommandCompiler()
do_compile.compiler.flags |= ast.PyCF_ALLOW_TOP_LEVEL_AWAIT
import builtins
imports = []
importer = __import... | [
39098,
796,
6045,
198,
198,
11748,
1330,
8019,
628,
198,
198,
11748,
11525,
198,
6738,
33245,
1330,
10903,
9399,
198,
11748,
279,
5272,
684,
13,
64,
952,
13,
1980,
355,
220,
1980,
198,
198,
11748,
6468,
198,
11748,
3858,
198,
11748,
1... | 3.056604 | 106 |
# -*- coding: utf-8 -*-
# @Author: spencer
# @Date: 2021-01-23
# @Last Modified by: Spencer H
# @Last Modified date: 2021-01-23
# @Description:
"""
Testing script
"""
import laurel
with open('../login.txt') as f:
login_data = f.read()
username = login_data.split(',')[0]
password = login_data.split(', ')[1]
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
25,
599,
12137,
198,
2,
2488,
10430,
25,
220,
220,
33448,
12,
486,
12,
1954,
198,
2,
2488,
5956,
40499,
416,
25,
220,
220,
15971,
367,
198,
2,
2488,
... | 2.611111 | 324 |
# -*- coding: utf-8 -*-
import datapackage
import datetime
import os
import statistics
import elephant.statistics
import h5fd.plot
from h5fd.plot import RECORDING_ATTEMPTS
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import quantities as qt
from tqdm import tqdm
# adjust matpl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4818,
499,
441,
496,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
7869,
198,
11748,
20950,
13,
14269,
3969,
198,
11748,
289,
20,
16344,
13,
29487,
... | 2.111421 | 2,154 |
from selenium.webdriver.common.by import By
from PageObjects.ConfirmationPage import ConfirmPage
| [
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
198,
6738,
7873,
10267,
82,
13,
18546,
36241,
9876,
1330,
7326,
2533,
9876,
628
] | 3.535714 | 28 |
number = 0
cards = 'VISA MASTERCARD AMEX INVALID'.split()
while len(str(number)) <= 9:
try:
number = int(input('Number: '))
except ValueError:
pass
snum = str(number)
if luhn(number) and len(snum) in (13, 15, 16):
if len(str(number)) in (13, 16) and snum[0] == '4':
print('VISA')
... | [
198,
198,
17618,
796,
657,
198,
27761,
796,
705,
53,
22312,
32337,
5781,
34,
9795,
3001,
6369,
3268,
23428,
2389,
4458,
35312,
3419,
198,
4514,
18896,
7,
2536,
7,
17618,
4008,
19841,
860,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
... | 2.087591 | 274 |
from tslib import ts_query
from secrets import *
with ts_query(HOST) as ts:
print(ts.login_as_admin(PW))
print(ts.edit_virtualserver_name("TEST11"))
print("OK")
_, reply = ts.execute("help")
print(reply.decode())
| [
6738,
256,
6649,
571,
1330,
40379,
62,
22766,
198,
6738,
13141,
1330,
1635,
198,
198,
4480,
40379,
62,
22766,
7,
39,
10892,
8,
355,
40379,
25,
198,
220,
220,
220,
3601,
7,
912,
13,
38235,
62,
292,
62,
28482,
7,
47,
54,
4008,
198,
... | 2.4375 | 96 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-28 20:14
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
16,
319,
1584,
12,
2999,
12,
2078,
1160,
25,
1415,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
from boilerplate.main import M
import unittest
if __name__ == "__main__":
unittest.main() | [
6738,
36741,
6816,
13,
12417,
1330,
337,
198,
11748,
555,
715,
395,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419
] | 2.764706 | 34 |
""" Valid Number
A valid number can be split up into these components (in order):
1. A decimal number or an integer.
2. (Optional) An 'e' or 'E', followed by an integer.
A decimal number can be split up into these components (in order):
1. (Optional) A sign character (either '+' or '-' ).
2. One of t... | [
37811,
48951,
7913,
198,
32,
4938,
1271,
460,
307,
6626,
510,
656,
777,
6805,
357,
259,
1502,
2599,
628,
220,
220,
220,
352,
13,
317,
32465,
1271,
393,
281,
18253,
13,
198,
220,
220,
220,
362,
13,
357,
30719,
8,
1052,
705,
68,
6,
... | 2.465582 | 799 |
import sys
import yaml
from PyQt5 import QtWidgets, QtCore
from mainwindow import Ui_MainWindow
from create import Ui_Create_Dialog
from preview import Ui_Preview_Dialog
from msgbox import Ui_Gen_Dialog
from about import Ui_About_Dialog
from HPA_agent.funs import *
NEEDLONGER = '输入不允许长度为0!'
PUBLISHDONE = '博客内容已发布。\n请检... | [
11748,
25064,
198,
11748,
331,
43695,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
54,
312,
11407,
11,
33734,
14055,
198,
6738,
1388,
17497,
1330,
471,
72,
62,
13383,
27703,
198,
6738,
2251,
1330,
471,
72,
62,
16447,
62,
44204,
198,
6738... | 1.778231 | 735 |
import pickle
from simple_nn.nn_2_layer import NeuralNetwork
from simple_nn.FitPred import fit, predict, result
# загрузка файла с датасетом рукописных чисел - тренировочный датасет
with open('../mnist_dataset/mnist_train.csv', 'r') as file:
data_train = file.readlines()
# загрудка тестового набора данных
with op... | [
11748,
2298,
293,
198,
198,
6738,
2829,
62,
20471,
13,
20471,
62,
17,
62,
29289,
1330,
47986,
26245,
198,
198,
6738,
2829,
62,
20471,
13,
31805,
39156,
1330,
4197,
11,
4331,
11,
1255,
628,
198,
2,
12466,
115,
16142,
140,
111,
21169,
... | 1.691638 | 574 |
# flake8: noqa
from catalyst.rl.exploration import *
| [
2,
781,
539,
23,
25,
645,
20402,
198,
6738,
31357,
13,
45895,
13,
20676,
6944,
1330,
1635,
198
] | 2.944444 | 18 |
QC_HOST = 'qualichain.epu.ntua.gr'
CURR_DESIGNER_PORT = '8080'
KBZ_HOST = 'knowledgebizvpn.ddns.net'
CAREER_ADVISOR_PORT = '8000' | [
48,
34,
62,
39,
10892,
796,
705,
13255,
488,
391,
13,
538,
84,
13,
429,
6413,
13,
2164,
6,
198,
34,
31302,
62,
30910,
16284,
1137,
62,
15490,
796,
705,
1795,
1795,
6,
198,
198,
22764,
57,
62,
39,
10892,
796,
705,
45066,
42189,
8... | 1.969697 | 66 |
# Copyright (c) 2002-2011 IronPort Systems and Cisco Systems
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | [
2,
15069,
357,
66,
8,
6244,
12,
9804,
7931,
13924,
11998,
290,
28289,
11998,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
... | 2.561392 | 1,523 |
import os
import numpy as np
import h5py
import torch
import torch.utils.data as data
def get_data(opt, use_train=True, use_test=True):
"""
Load NYU_v2 or SUN rgb-d dataset in hdf5 format from disk and prepare
it for classifiers.
"""
# Load the chosen datasets path
if os.path.exists(opt.datar... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
20,
9078,
198,
11748,
28034,
198,
11748,
28034,
13,
26791,
13,
7890,
355,
1366,
628,
198,
198,
4299,
651,
62,
7890,
7,
8738,
11,
779,
62,
27432,
28,
17821,
11,
779,
... | 2.686589 | 686 |
_PATH_TO_PHOTOS = "../../datasets/facesInTheWild/"
_LABEL_MALE = "MALE"
_LABEL_FEMALE = "FEMALE"
_DEBUG = False | [
198,
62,
34219,
62,
10468,
62,
42709,
796,
366,
40720,
40720,
19608,
292,
1039,
14,
32186,
818,
464,
25946,
30487,
198,
62,
48780,
3698,
62,
44,
21358,
796,
366,
44,
21358,
1,
198,
62,
48780,
3698,
62,
37,
3620,
21358,
796,
366,
37,... | 2.196078 | 51 |
#
# Copyright (c) 2009-2019 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Given a date, determine the phase of the moon."""
from __future__ import absolute_import
import time
import math
moon_phases = ["new (totally dark)",
"waxing crescent (increasing to ... | [
2,
198,
2,
220,
220,
220,
15069,
357,
66,
8,
3717,
12,
23344,
4186,
3873,
36761,
1279,
83,
365,
36761,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
220,
220,
220,
4091,
262,
2393,
38559,
24290,
13,
14116,
329,
534,
1336,
2489,
13,
19... | 2.525386 | 453 |
import os
import soundPlayer
import serial
import time
import sys
import datetime
with open("logs.txt", "a") as f:
f.write(f"[#] STARTED - {time.time()}")
serial = serial.Serial("/dev/ttyACM0", 9600, timeout=0)
hands_up = False
delay_interval = 5
strings = [b"handsup", b"handsdown"]
vulgar = Fal... | [
11748,
28686,
201,
198,
11748,
2128,
14140,
201,
198,
11748,
11389,
201,
198,
11748,
640,
201,
198,
11748,
25064,
201,
198,
11748,
4818,
8079,
201,
198,
201,
198,
4480,
1280,
7203,
6404,
82,
13,
14116,
1600,
366,
64,
4943,
355,
277,
2... | 2.157116 | 541 |
# This script maps sequence accession numbers (e.g. 'AM947437') from
# Silva to NCBI taxon ids (e.g. '329270') by calling out to the NCBI
# eutils service.
"""
time python feed/ncbi/seq_taxon_xref.py \
feed/ncbi/accessionid_to_taxonid.tsv feed/silva/out/silva_taxonly.txt v9.tsv 20 10
"""
import sys,os
import re
i... | [
2,
770,
4226,
8739,
8379,
1895,
295,
3146,
357,
68,
13,
70,
13,
705,
2390,
24,
38652,
2718,
11537,
422,
198,
2,
23720,
284,
8823,
3483,
1687,
261,
220,
2340,
357,
68,
13,
70,
13,
705,
37967,
20233,
11537,
416,
4585,
503,
284,
262,... | 2.494898 | 784 |
import os
config_options = {
'development':DevConfig,
'production':ProdConfig,
'test':TestConfig
} | [
11748,
28686,
220,
628,
220,
220,
220,
220,
628,
198,
11250,
62,
25811,
796,
1391,
198,
1549,
68,
1091,
434,
10354,
13603,
16934,
11,
198,
6,
25493,
10354,
2964,
67,
16934,
11,
198,
470,
395,
10354,
14402,
16934,
198,
92
] | 2.675 | 40 |
"""This problem was asked by Goldman Sachs.
Given a list of numbers L, implement a method sum(i, j)
which returns the sum from the sublist L[i:j] (including i, excluding j).
For example, given L = [1, 2, 3, 4, 5], sum(1, 3) should return sum([2, 3]), which is 5.
You can assume that you can do some pre-processing.
sum... | [
37811,
1212,
1917,
373,
1965,
416,
18740,
25158,
13,
198,
15056,
257,
1351,
286,
3146,
406,
11,
3494,
257,
2446,
2160,
7,
72,
11,
474,
8,
220,
198,
4758,
5860,
262,
2160,
422,
262,
850,
4868,
406,
58,
72,
25,
73,
60,
357,
8201,
... | 3.298246 | 114 |
#!/usr/bin/env python
import numpy as np
from math import pi
from src.draw import Canvas
from fn import Fn
from matplotlib import cm
# Document configuration
cnv_conf = {
"fname": f"temp/{Fn().name()}",
"dpi": 300,
"width": 10,
"height": 15,
"bg_rgb": [(0.05, 0.05, 0.05), (0.15, 0.15, 0.15)]
}
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
10688,
1330,
31028,
198,
198,
6738,
12351,
13,
19334,
1330,
1680,
11017,
198,
6738,
24714,
1330,
37481,
198,
6738,
2603,
29487,
8019,
1330,
... | 1.921512 | 688 |
from .main import HackAssembler
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Usage: hack_assembler <filename>")
sys.exit()
hack_assembler = HackAssembler()
hack_assembler.assemble(sys.argv[1])
| [
6738,
764,
12417,
1330,
18281,
1722,
4428,
1754,
198,
198,
11748,
25064,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
611,
18896,
7,
17597,
13,
853,
85,
8,
1279,
362,
25,
198,
220,
220,
220... | 2.352381 | 105 |
# encoding: UTF-8
'''
本文件包含了CTA引擎中的策略开发用模板。
添加了一些基本的策略属性,变量。不做下单逻辑
'''
from datetime import datetime
from .ctaTemplate_4 import CtaTemplate_4
########################################################################
class CtaTemplate_5(CtaTemplate_4):
"""
add base utility
"""
className = 'CtaTemplate_5... | [
2,
21004,
25,
41002,
12,
23,
198,
7061,
6,
198,
17312,
105,
23877,
229,
20015,
114,
44293,
227,
28938,
104,
12859,
228,
4177,
32,
28156,
243,
162,
241,
236,
40792,
21410,
163,
255,
244,
45911,
98,
28156,
222,
20998,
239,
18796,
101,
... | 2.15506 | 1,838 |
'''
Created on Wednesday, 10 April 2019
@author: David
THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT!!!
XML Source: /cygdrive/c/Users/David/Documents/eaglesat/eaglesat-fprime/Svc/ActiveLogger/ActiveLoggerComponentAi.xml
'''
# Import the types this way so they do not need prefixing for execution.
from models.ser... | [
7061,
6,
198,
41972,
319,
3583,
11,
838,
3035,
13130,
198,
31,
9800,
25,
3271,
198,
198,
43559,
45811,
3180,
47044,
2662,
1404,
2149,
19807,
24700,
1137,
11617,
532,
8410,
5626,
48483,
10185,
198,
198,
55,
5805,
8090,
25,
1220,
948,
7... | 2.760602 | 731 |
import sys
import math
print isprime(int(sys.argv[1]))
| [
11748,
25064,
198,
11748,
10688,
198,
197,
198,
198,
4798,
318,
35505,
7,
600,
7,
17597,
13,
853,
85,
58,
16,
60,
4008,
198
] | 2.416667 | 24 |
import os
import errno
import json
from base_plugin import SimpleCommandPlugin
from plugins.core.player_manager_plugin import permissions, UserLevels
from packets import Packets, fly_ship_write
from utility_functions import build_packet
class Bookmarks(SimpleCommandPlugin):
"""
Plugin that allows defining pl... | [
11748,
28686,
198,
11748,
11454,
3919,
198,
11748,
33918,
198,
198,
6738,
2779,
62,
33803,
1330,
17427,
21575,
37233,
198,
6738,
20652,
13,
7295,
13,
7829,
62,
37153,
62,
33803,
1330,
21627,
11,
11787,
4971,
82,
198,
6738,
24624,
1330,
... | 1.870542 | 3,337 |
# coding:utf8
import csv
import datetime
import json
import operator
import os
import sys
from PyQt4 import QtGui, QtCore, uic
from PyQt4.QtCore import QDate, Qt, QVariant
from PyQt4.QtGui import QMessageBox
from dataProvider import DataProvider
from mainRes import Ui_MainWindow
from src import threadWorker
from src.... | [
2,
19617,
25,
40477,
23,
198,
11748,
269,
21370,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
10088,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
9485,
48,
83,
19,
1330,
33734,
8205,
72,
11,
33734,
14055,
11,
334,
2... | 2.514085 | 568 |
from src.core.constraints.DatabaseRepositoryConstraint import DatabaseRepositoryConstraint
from src.core.usecase.LeagueModel import LeagueModel
| [
6738,
12351,
13,
7295,
13,
1102,
2536,
6003,
13,
38105,
6207,
13264,
3103,
2536,
2913,
1330,
24047,
6207,
13264,
3103,
2536,
2913,
198,
6738,
12351,
13,
7295,
13,
1904,
7442,
13,
24623,
17633,
1330,
4041,
17633,
198
] | 3.891892 | 37 |
#SCRAPER: pull craiglist apartment listings into CSV file. Allows for plotting.
import pandas as pd
import pylab
import requests
import numpy as np
from bs4 import BeautifulSoup as bs4
import string
import time
import matplotlib as plt
#-------------vital functions-------------
# cleaning and parsing size and bedr... | [
2,
6173,
49,
2969,
1137,
25,
2834,
15671,
328,
4868,
7962,
26890,
656,
44189,
2393,
13,
40402,
329,
29353,
13,
628,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
279,
2645,
397,
198,
11748,
7007,
198,
11748,
299,
32152,
355,
45941... | 2.649044 | 889 |
"""calculate lensing normalization / reconstruction noises from various estimators"""
import numpy as np
from cosmoslib.utils.glquad import gauss_legendre_quadrature
#----------------------------------------------------------------------
# lensing reconstruction noise
#
#----------------------------------------------... | [
37811,
9948,
3129,
378,
10317,
278,
3487,
1634,
1220,
25056,
26782,
422,
2972,
3959,
2024,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
39385,
8019,
13,
26791,
13,
4743,
47003,
1330,
31986,
1046,
62,
1455,
437,
260,
62,
42... | 1.757592 | 1,844 |
from __future__ import absolute_import
PAIRS = {
'(': ')',
'{': '}',
'[': ']',
'<': '>',
}
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
4537,
4663,
50,
796,
1391,
198,
220,
220,
220,
29513,
10354,
705,
8,
3256,
198,
220,
220,
220,
705,
90,
10354,
705,
92,
3256,
198,
220,
220,
220,
44438,
10354,
705,
60,
3256,... | 1.929825 | 57 |
import tensorflow as tf
import functools
from baselines.common.tf_util import get_session, save_variables, load_variables
from baselines.common.tf_util import initialize
try:
from baselines.common.mpi_adam_optimizer import MpiAdamOptimizer
from mpi4py import MPI
from baselines.common.mpi_util import sync_from_root... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
1257,
310,
10141,
198,
198,
6738,
1615,
20655,
13,
11321,
13,
27110,
62,
22602,
1330,
651,
62,
29891,
11,
3613,
62,
25641,
2977,
11,
3440,
62,
25641,
2977,
198,
6738,
1615,
20655,
13,
... | 3.05102 | 196 |
# Copyright 2017 Mark van der Wilk.
#
# 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 writin... | [
2,
15069,
2177,
2940,
5719,
4587,
5187,
74,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 3.241026 | 390 |
from functools import wraps
@ints_only
add('57', 99.5)
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
31,
29503,
62,
8807,
198,
198,
2860,
10786,
3553,
3256,
7388,
13,
20,
8,
198
] | 2.478261 | 23 |
"""Provide animated GIF loops of Buienradar imagery."""
from __future__ import annotations
import asyncio
from datetime import datetime, timedelta
import logging
import aiohttp
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import CONF_NAME
from ... | [
37811,
15946,
485,
15108,
24984,
23607,
286,
9842,
2013,
6335,
283,
19506,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
30351,
952,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
18931,
1... | 2.43869 | 2,626 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import sys
import tensorflow as tf
def training(H, loss, global_step):
"""Sets up the training Ops.
Creates a summarizer to track the loss over time in TensorBoard.
Creates an opt... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
198,
... | 2.962598 | 508 |
import zipfile
import time
encrypted_filename= "secret_file.zip"
zFile = zipfile.ZipFile(encrypted_filename, "r")
passFile = open("passwords.txt", "r")
for line in passFile.readlines():
test_password = line.strip("\n").encode('utf-8')
try:
print(test_password)
zFile.extractall(pwd=test_password... | [
11748,
19974,
7753,
198,
11748,
640,
198,
43628,
62,
34345,
28,
366,
21078,
62,
7753,
13,
13344,
1,
198,
89,
8979,
796,
19974,
7753,
13,
41729,
8979,
7,
43628,
62,
34345,
11,
366,
81,
4943,
198,
198,
6603,
8979,
796,
1280,
7203,
660... | 2.335165 | 182 |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the libraryFine function below.
d1M1Y1 = input().split()
d1 = int(d1M1Y1[0])
m1 = int(d1M1Y1[1])
y1 = int(d1M1Y1[2])
d2M2Y2 = input().split()
d2 = int(d2M2Y2[0])
m2 = int(d2M2Y2[1])
y2 = int(d2M2Y2[2])
result = libraryFine(d1, m1, ... | [
2,
48443,
8800,
14,
29412,
18,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
25064,
198,
198,
2,
13248,
262,
5888,
34389,
2163,
2174,
13,
628,
198,
67,
16,
44,
16,
56,
16,
796,
5128,
22446... | 1.941489 | 188 |
# ------------------------------------------------------------------------------
# CodeHawk C Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2017-2020 Kestrel Technology LLC
#
# Permission is hereby granted, free ... | [
2,
16529,
26171,
198,
2,
6127,
39,
19301,
327,
16213,
9107,
198,
2,
6434,
25,
367,
11870,
311,
541,
2611,
198,
2,
16529,
26171,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
2177,
12,
42334,
509,
3... | 2.391367 | 2,780 |
from datetime import datetime
import nextcloud_notes_api
from nextcloud_notes_api import Note
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
1306,
17721,
62,
17815,
62,
15042,
198,
6738,
1306,
17721,
62,
17815,
62,
15042,
1330,
5740,
628,
628,
628,
628,
628,
628
] | 3.419355 | 31 |