content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import math
from functools import cmp_to_key
locations = """#.#................#..............#......#......
.......##..#..#....#.#.....##...#.........#.#...
.#...............#....#.##......................
......#..####.........#....#.......#..#.....#...
.....#............#......#................#.#...
....##... | [
11748,
10688,
198,
6738,
1257,
310,
10141,
1330,
269,
3149,
62,
1462,
62,
2539,
628,
628,
628,
628,
198,
198,
17946,
602,
796,
37227,
2,
32535,
4181,
2,
2109,
16317,
2,
16317,
2,
16317,
198,
25780,
2235,
492,
2,
492,
2,
1106,
2,
3... | 3.300481 | 832 |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# hillshade.py
# Created on: 2020-01-19 18:50:09.00000
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
32284,
198,
2,
12788,
1477,
671,
13,
9078,
198,
2,
15622,
319,
25,
12131,
12,
486,
12,
1129,
1248,
25,
1120,
25,
2931,
13,
20483,
198,
2,
220,
220,
357,
... | 2.892241 | 232 |
import ast
import dataclasses
import json
import re
import sys
import typing
from sbdata.repo import find_item_by_name, Item
from sbdata.task import register_task, Arguments
from sbdata.wiki import get_wiki_sources_by_title
@dataclasses.dataclass
@register_task("Fetch Dungeon Loot")
| [
11748,
6468,
198,
11748,
4818,
330,
28958,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
19720,
198,
198,
6738,
264,
65,
7890,
13,
260,
7501,
1330,
1064,
62,
9186,
62,
1525,
62,
3672,
11,
9097,
198,
6738,
264,
65,... | 3.107527 | 93 |
import os
# Load environmental variables from .env in development stage
basedir = os.path.abspath(os.path.dirname(__file__))
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'staging': StagingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
} | [
11748,
28686,
198,
198,
2,
8778,
6142,
9633,
422,
764,
24330,
287,
2478,
3800,
198,
3106,
343,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
628,
628,
628,
198,
198,
11250,
7... | 3.263736 | 91 |
"""
===========================
Calculate SHORE scalar maps
===========================
We show how to calculate two SHORE-based scalar maps: return to origin
probability (rtop) [Descoteaux2011]_ and mean square displacement (msd)
[Wu2007]_, [Wu2008]_ on your data. SHORE can be used with any multiple b-value
dataset l... | [
37811,
198,
4770,
2559,
18604,
198,
9771,
3129,
378,
6006,
6965,
16578,
283,
8739,
198,
4770,
2559,
18604,
198,
198,
1135,
905,
703,
284,
15284,
734,
6006,
6965,
12,
3106,
16578,
283,
8739,
25,
1441,
284,
8159,
198,
1676,
65,
1799,
35... | 2.730994 | 1,197 |
from tensorflow.python.keras import backend as K
def f1_score(y_true, y_pred):
""" F1 score metric """
def recall_metric(labels, predictions):
""" Recall metric """
true_positives = K.sum(K.round(K.clip(labels * predictions, 0, 1)))
possible_positives = K.sum(K.round(K.clip(labels, 0,... | [
6738,
11192,
273,
11125,
13,
29412,
13,
6122,
292,
1330,
30203,
355,
509,
628,
198,
4299,
277,
16,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
2599,
198,
220,
220,
220,
37227,
376,
16,
4776,
18663,
37227,
628,
220,
220,
220,
8... | 2.540404 | 396 |
from veros_extra_setups.setups.wave_propagation.wave_propagation import WavePropagationSetup # noqa: F401
| [
6738,
3326,
418,
62,
26086,
62,
2617,
4739,
13,
2617,
4739,
13,
19204,
62,
22930,
363,
341,
13,
19204,
62,
22930,
363,
341,
1330,
17084,
24331,
363,
341,
40786,
220,
1303,
645,
20402,
25,
376,
21844,
198
] | 2.891892 | 37 |
"""Goal: Create a program where users can input two locations and return a restaurant as equidistant as possible between them.
This will be done by connecting with the GoogleMaps Directions and Places API.
Once a suitable establishment has been found, the program will return the establishment's name, address, phone num... | [
37811,
49045,
25,
13610,
257,
1430,
810,
2985,
460,
5128,
734,
7064,
290,
1441,
257,
7072,
355,
1602,
312,
10167,
355,
1744,
1022,
606,
13,
198,
1212,
481,
307,
1760,
416,
14320,
351,
262,
3012,
47010,
47426,
290,
37291,
7824,
13,
198... | 3.05565 | 2,947 |
#secure password generator
#written by boostOnTheBrain
import random
characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*-=+_?"
length = int(input('password length?'))
password = ''
for c in range(length):
password += random.choice(characters)
print(password)
length = in... | [
2,
22390,
9206,
17301,
201,
198,
2,
15266,
416,
5750,
2202,
464,
44687,
201,
198,
11748,
4738,
201,
198,
201,
198,
10641,
19858,
796,
366,
39305,
4299,
456,
2926,
41582,
10295,
404,
80,
81,
301,
14795,
86,
5431,
89,
24694,
32988,
1751... | 2.800905 | 221 |
import json, subprocess
from ..... pyaz_utils import get_cli_name, get_params
| [
11748,
33918,
11,
850,
14681,
198,
6738,
11485,
986,
12972,
1031,
62,
26791,
1330,
651,
62,
44506,
62,
3672,
11,
651,
62,
37266,
628
] | 3.291667 | 24 |
import asyncio
import multiprocessing
from gabriel_protocol import gabriel_pb2
from gabriel_client.websocket_client import ProducerWrapper
| [
11748,
30351,
952,
198,
11748,
18540,
305,
919,
278,
198,
6738,
308,
397,
11719,
62,
11235,
4668,
1330,
308,
397,
11719,
62,
40842,
17,
198,
6738,
308,
397,
11719,
62,
16366,
13,
732,
1443,
5459,
62,
16366,
1330,
30436,
36918,
2848,
6... | 3.27907 | 43 |
nota = float(input('Insira a pontuação: '))
computar_notas(nota) | [
201,
198,
1662,
64,
796,
12178,
7,
15414,
10786,
20376,
8704,
257,
45443,
6413,
16175,
28749,
25,
705,
4008,
220,
201,
198,
785,
1996,
283,
62,
1662,
292,
7,
1662,
64,
8,
220,
220,
220,
220,
220,
220,
220
] | 1.923077 | 39 |
from subprocess import run
| [
6738,
850,
14681,
1330,
1057,
628
] | 4.666667 | 6 |
# -*-coding:Utf-8 -*
# Copyright (c) 2012 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | [
2,
532,
9,
12,
66,
7656,
25,
18274,
69,
12,
23,
532,
9,
198,
198,
2,
15069,
357,
66,
8,
2321,
12509,
10351,
5777,
18653,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11... | 2.651731 | 1,473 |
#!/usr/bin/env python
from Bio import Entrez
import os
import argparse
import time
# =====================================================
# Takes a list of species names and queries GenBank for
# that species. If any data are in GenBank, a file is
# written that has the GenBank IDs for that species.
#
# Matt G... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
16024,
1330,
7232,
21107,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
198,
2,
46111,
4770,
1421,
198,
2,
220,
33687,
257,
1351,
286,
4693,
3891,
290,
2... | 2.737143 | 700 |
import unittest
import puremvc.patterns.observer
class ObserverTest(unittest.TestCase):
"""ObserverTest: Test Observer Pattern"""
__observerTestVar = None
def testObserverAccessors(self):
"""ObserverTest: Test Observer Accessors"""
obsrvr = puremvc.patterns.observer.Observer(None,None)
... | [
11748,
555,
715,
395,
198,
198,
11748,
5899,
76,
28435,
13,
33279,
82,
13,
672,
15388,
198,
198,
4871,
27058,
14402,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
31310,
18497,
14402,
25,
6208,
27058,
23939,
378... | 2.518742 | 827 |
#!/usr/bin/env python
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import pytest
from scribd_dl import ScribdDL
# def pytest_addoption(parser):
# parser.addoption("--driver", action="store", default="chrome", help="Type in browser type")
# parser.addopti... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
27... | 2.90566 | 159 |
import random | [
11748,
4738
] | 6.5 | 2 |
"""Test twotuple_metric."""
# pylint: disable=invalid-name
from pathlib import Path
from itertools import zip_longest
import pandas as pd
from align_benchmark.twotuple_metric import twotuple_metric
file_loc = "data/para-wh-ch2-benchmark1.xlsx"
if not Path(file_loc).exists():
raise SystemExit(f"File [{file_loc}... | [
37811,
14402,
665,
313,
29291,
62,
4164,
1173,
526,
15931,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
340,
861,
10141,
1330,
19974,
62,
6511,
395,
198,
198,
11748,
... | 2.445122 | 328 |
from collections import namedtuple
from inspect import signature
activation_func = node('ActivationFunc', activation_func=None, inplace=True)
add = node('Add', inplace=True)
add_relu = node('AddRelu', inplace=False)
bn = node('BatchNorm2d', ['num_features'], eps=1e-5, momentum=0.1, affine=True, track_running_s... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
10104,
1330,
9877,
198,
220,
220,
220,
220,
220,
220,
220,
198,
198,
48545,
62,
20786,
796,
10139,
10786,
25526,
341,
37,
19524,
3256,
14916,
62,
20786,
28,
14202,
11,
287,
5372,
28,
1782... | 2.678005 | 441 |
# @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import stack
import stack.commands
from collections import defaultdict
from collections import OrderedDict
from pathlib import Path
import json
... | [
2,
2488,
22163,
4766,
31,
198,
2,
15069,
357,
66,
8,
4793,
532,
13130,
3813,
14706,
198,
2,
1439,
2489,
10395,
13,
23881,
72,
7,
81,
8,
410,
20,
13,
87,
8931,
72,
13,
785,
198,
2,
3740,
1378,
12567,
13,
785,
14,
15156,
14706,
... | 3.474419 | 215 |
from math import isnan, sqrt, pow, floor, ceil, trunc
from math_tools import clamp | [
6738,
10688,
1330,
2125,
272,
11,
19862,
17034,
11,
7182,
11,
4314,
11,
2906,
346,
11,
40122,
198,
6738,
10688,
62,
31391,
1330,
29405
] | 3.416667 | 24 |
#!/usr/bin/env python3
import os
import requests
from selfdrive.test.process_replay.test_processes import segments
from selfdrive.test.process_replay.process_replay import CONFIGS
BASE_URL = "https://github.com/martinl/openpilot-ci/raw/master/process_replay/"
process_replay_dir = os.path.dirname(os.path.abspath(__fi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28686,
198,
11748,
7007,
198,
198,
6738,
2116,
19472,
13,
9288,
13,
14681,
62,
260,
1759,
13,
9288,
62,
14681,
274,
1330,
17894,
198,
6738,
2116,
19472,
13,
9288,
13,
14681,... | 2.378378 | 370 |
from example.dto.contact_dto import ContactCreateDto, ContactUpdateDto, ContactDetailsDto
from example.model.contact import Contact
from pf_sqlalchemy.crud.pfs_rest_helper_service import PfsRestHelperService
pfs_rest_helper_service = PfsRestHelperService(Contact)
| [
6738,
1672,
13,
67,
1462,
13,
32057,
62,
67,
1462,
1330,
14039,
16447,
35,
1462,
11,
14039,
10260,
35,
1462,
11,
14039,
24259,
35,
1462,
198,
6738,
1672,
13,
19849,
13,
32057,
1330,
14039,
198,
6738,
279,
69,
62,
25410,
282,
26599,
... | 3.256098 | 82 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'A program does that is a DJ by using feedback provided by the dancers.',
'author': 'Thomas Schaper',
'url': 'https://gitlab.com/SilentDiscoAsAService/DJFeet',
'download_url': 'https... | [
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
11250,
796,
1391,
198,
220,
220,
220,
705,
11213,
10354,
705,
32,
... | 2.386282 | 277 |
# -*- coding: utf-8 -*-
import unittest
from unittest import mock
from pastepwn.analyzers.awssessiontokenanalyzer import AWSSessionTokenAnalyzer
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
1613,
538,
675,
13,
38200,
47031,
13,
707,
824,
2521,
30001,
38200,
9107,
1330,
14356,
5432,... | 2.722222 | 72 |
import frappe
import json
from datetime import timedelta, date
| [
11748,
5306,
27768,
198,
11748,
33918,
198,
6738,
4818,
8079,
1330,
28805,
12514,
11,
3128,
198
] | 3.9375 | 16 |
"""Data acquisition system.
"""
import datetime
import os
import sys
import time
import stockdaq.data.downloader_dict
from stockdaq.logger import logger
class Acquisiter:
"""Data Acquisiter
Parameters
----------
stocklist: list of str
List of symbols of stocks of interest.
apikey_dict: d... | [
37811,
6601,
12673,
1080,
13,
198,
37811,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
198,
11748,
4283,
48539,
13,
7890,
13,
15002,
263,
62,
11600,
198,
6738,
4283,
48539,
13,
6404,
1362,
1330,
49... | 2.054705 | 3,656 |
# -*- encoding: utf-8 -*-
"""
hio.help.timing module
"""
import time
from .. import hioing
class TimerError(hioing.HioError):
"""
Generic Timer Errors
Usage:
raise TimerError("error message")
"""
class RetroTimerError(TimerError):
"""
Error due to real time being retrograded before ... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
71,
952,
13,
16794,
13,
16514,
278,
8265,
198,
198,
37811,
198,
11748,
640,
198,
198,
6738,
11485,
1330,
289,
952,
278,
628,
198,
4871,
5045,
263,
12331,
7... | 2.66811 | 2,540 |
# coding: utf-8
import pytest
from requests import HTTPError, Response
from postmarker.core import USER_AGENT, PostmarkClient
from postmarker.models.messages import MessageManager, OutboundMessageManager
from postmarker.models.triggers import TriggersManager
@pytest.mark.parametrize("klass", (PostmarkClient, Outbou... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
12972,
9288,
198,
6738,
7007,
1330,
14626,
12331,
11,
18261,
198,
198,
6738,
1281,
4102,
263,
13,
7295,
1330,
1294,
1137,
62,
4760,
3525,
11,
2947,
4102,
11792,
198,
6738,
1281,
4102,
263,
... | 3.485981 | 107 |
"""Implementation of the simple 50-line version of NOTEARS algorithm.
Defines the h function, the augmented Lagrangian, and its gradient.
Each augmented Lagrangian subproblem is minimized by L-BFGS-B from scipy.
Note: this version implements NOTEARS without l1 regularization,
i.e. lambda = 0, hence it requires n >> d... | [
37811,
3546,
32851,
286,
262,
2829,
2026,
12,
1370,
2196,
286,
5626,
17133,
50,
11862,
13,
198,
198,
7469,
1127,
262,
289,
2163,
11,
262,
30259,
21003,
36985,
666,
11,
290,
663,
31312,
13,
198,
10871,
30259,
21003,
36985,
666,
850,
45... | 2.152623 | 1,258 |
from __future__ import absolute_import
import inspect
import os
from collections import deque
from typing import Any, Optional, Callable
import torch
from laia.common.logging import get_logger
from laia.common.random import get_rng_state
_logger = get_logger(__name__)
class RollingSaver(Saver):
"""Save... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
10104,
198,
11748,
28686,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
19720,
1330,
4377,
11,
32233,
11,
4889,
540,
198,
198,
11748,
28034,
198,
198,
6738,
8591,
544,
13,... | 3.333333 | 111 |
"""
Module: 'flowlib.modules._lego' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1 - updated
from typing import Any
ENCODER_ADDR = 4
class Lego:
""""""
class Lego_Motor:
... | [
37811,
198,
26796,
25,
705,
2704,
4883,
571,
13,
18170,
13557,
1455,
78,
6,
319,
337,
20,
27782,
10080,
410,
16,
13,
19,
13,
15,
12,
31361,
198,
37811,
198,
2,
13122,
52,
25,
357,
17597,
3672,
11639,
9774,
2624,
3256,
18666,
12453,
... | 2.227273 | 220 |
from ptrlib import *
import os
HOST = os.getenv('SECCON_HOST', "localhost")
PORT = os.getenv('SECCON_PORT', "10042")
sock = Socket(HOST, int(PORT))
sock.sendlineafter("value 2: ", "help()")
sock.sendlineafter("help> ", "+")
sock.sendlineafter("--More--", "!/bin/cat /proc/self/environ")
print(sock.recvregex("SECCON\{... | [
6738,
50116,
8019,
1330,
1635,
198,
11748,
28686,
198,
198,
39,
10892,
796,
28686,
13,
1136,
24330,
10786,
23683,
10943,
62,
39,
10892,
3256,
366,
36750,
4943,
198,
15490,
796,
28686,
13,
1136,
24330,
10786,
23683,
10943,
62,
15490,
3256,... | 2.442857 | 140 |
import maya.cmds as cmds
import maya.mel as mel
| [
11748,
743,
64,
13,
28758,
82,
355,
23991,
82,
198,
11748,
743,
64,
13,
17694,
355,
7758,
628
] | 2.722222 | 18 |
""" Remove double instances of cells (and the unused vertices) """
from larlib import evalStruct
""" Generation of Struct object and transform to LAR model pair """
cubes = larCuboids([10,10,10],True)
V = cubes[0]
FV = cubes[1][-2]
CV = cubes[1][-1]
bcells = boundaryCells(CV,FV)
BV = [FV[f] for f in bcells]
VIEW(EXPLO... | [
37811,
17220,
4274,
10245,
286,
4778,
357,
392,
262,
21958,
9421,
1063,
8,
37227,
198,
6738,
300,
7063,
571,
1330,
5418,
44909,
198,
198,
37811,
16588,
286,
32112,
2134,
290,
6121,
284,
47211,
2746,
5166,
37227,
198,
66,
29080,
796,
263... | 2.328321 | 399 |
# Copyright 2014 by Kevin Wu.
# Copyright 2014 by Peter Cock.
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for online functionality of the KEGG module."""
# Builti... | [
2,
15069,
1946,
416,
7939,
18027,
13,
198,
2,
15069,
1946,
416,
5613,
23769,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
770,
2438,
318,
636,
286,
262,
8436,
404,
7535,
6082,
290,
21825,
416,
663,
198,
2,
5964,
13,
220,
4222,
766,
... | 2.746067 | 445 |
#
# verify.py: routines that handle comparison and display of expected
# vs. actual output
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Licensed to the Apache Softwar... | [
2,
198,
2,
220,
11767,
13,
9078,
25,
220,
31878,
326,
5412,
7208,
290,
3359,
286,
2938,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3691,
13,
4036,
5072,
198,
2,
198,
2,
220,
3834,
9641,
318,
257,
... | 3.150823 | 4,071 |
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CppExtension
setup(
name='syncbn_cpu',
ext_modules=[
CppExtension('syncbn_cpu', [
'operator.cpp',
'syncbn_cpu.cpp',
]),
],
cmdclass={
'build_ext': BuildExtension
})... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
28034,
13,
26791,
13,
20322,
62,
2302,
3004,
1330,
10934,
11627,
3004,
11,
327,
381,
11627,
3004,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
27261,
9374,
62,
36166,
3256,
198,
... | 2.111842 | 152 |
# -*- coding: utf-8 -*-
from typing import List
from overrides import overrides
from recc.log.logging import recc_database_logger as logger
from recc.database.struct.group_member import GroupMember
from recc.database.struct.group_join_member import (
GroupJoinGroupMember,
ProjectJoinGroupMember,
)
from recc.da... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
19720,
1330,
7343,
198,
6738,
23170,
1460,
1330,
23170,
1460,
198,
6738,
302,
535,
13,
6404,
13,
6404,
2667,
1330,
302,
535,
62,
48806,
62,
6404,
1362,
355,
... | 2.624633 | 341 |
PREFIX = '!?'
TOKEN = ''
IMAGE = 'qiskitbot'
BLACKLIST = ['']
| [
47,
31688,
10426,
796,
705,
0,
8348,
198,
10468,
43959,
796,
10148,
198,
3955,
11879,
796,
705,
80,
1984,
270,
13645,
6,
198,
9148,
8120,
45849,
796,
685,
7061,
60,
198
] | 2 | 31 |
#!/usr/bin/env python3
import openpmd_api as io
series = io.Series("LaserAccelerationRZ_opmd_plt/openpmd_%T.h5", io.Access.read_only)
assert len(series.iterations) == 3, 'improper number of iterations stored'
ii = series.iterations[20]
assert len(ii.meshes) == 7, 'improper number of meshes'
# select j_t
jt = ii.m... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1280,
4426,
67,
62,
15042,
355,
33245,
198,
198,
25076,
796,
33245,
13,
27996,
7203,
43,
6005,
12832,
7015,
341,
49,
57,
62,
404,
9132,
62,
489,
83,
14,
9654,
4426,
... | 2.962733 | 322 |
name = 'Muria'
version = '0.5.3'
author = 'Ahmad Ghulam Zakiy <https://twitter.com/xakiy>'
| [
3672,
796,
705,
23830,
544,
6,
198,
9641,
796,
705,
15,
13,
20,
13,
18,
6,
198,
9800,
796,
705,
10910,
9937,
11972,
377,
321,
32605,
7745,
220,
1279,
5450,
1378,
6956,
13,
785,
14,
87,
461,
7745,
29,
6,
198
] | 2.243902 | 41 |
from sys import stdin, setrecursionlimit
setrecursionlimit(10**7)
# Function to check all the valid way to solve the sudoku.
board = [[ int(ele) for ele in input().split() ]for i in range(9)]
ans = solveSudoku(board)
if ans is True:
print('true')
else:
print('false')
| [
6738,
25064,
1330,
14367,
259,
11,
900,
8344,
24197,
32374,
198,
2617,
8344,
24197,
32374,
7,
940,
1174,
22,
8,
628,
198,
198,
2,
15553,
284,
2198,
477,
262,
4938,
835,
284,
8494,
262,
424,
67,
11601,
13,
628,
198,
198,
3526,
796,
... | 2.848485 | 99 |
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
import logging
import math
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.f... | [
2,
15069,
357,
66,
8,
2864,
12,
25579,
11,
3203,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
42... | 2.48114 | 2,280 |
import boto3
defaultRegion = 'eu-west-1'
defaultUrl = 'https://rekognition.'+defaultRegion+'.amazonaws.com'
defaultBucket = "jsimon-public"
| [
11748,
275,
2069,
18,
198,
198,
12286,
47371,
796,
705,
12496,
12,
7038,
12,
16,
6,
198,
12286,
28165,
796,
705,
5450,
1378,
37818,
2360,
653,
2637,
10,
12286,
47371,
10,
4458,
33103,
8356,
13,
785,
6,
198,
12286,
33,
38811,
796,
36... | 2.877551 | 49 |
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import re
VERSION_PATTERN = re.compile(r"(?:HAProxy|hapee-lb) version ([^,]+)")
| [
2,
357,
34,
8,
16092,
324,
519,
11,
3457,
13,
12131,
12,
25579,
198,
2,
1439,
2489,
10395,
198,
2,
49962,
739,
45157,
1431,
347,
10305,
13789,
357,
3826,
38559,
24290,
8,
198,
11748,
302,
198,
198,
43717,
62,
47,
1404,
31800,
796,
... | 2.782609 | 69 |
import os
import time
import hashlib
import hmac
import base64
import random
import sys
import binascii
import requests
import urllib.parse
from nmtwizard.cloud_translation_framework import CloudTranslationFramework
if __name__ == "__main__":
TencentTranslateFramework().run()
| [
11748,
28686,
198,
11748,
640,
198,
11748,
12234,
8019,
198,
11748,
289,
20285,
198,
11748,
2779,
2414,
198,
11748,
4738,
198,
11748,
25064,
198,
11748,
9874,
292,
979,
72,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
13,
29572,
198,
1... | 3.445783 | 83 |
# coding: utf-8
import pprint
import re
import six
class ListRecordSetsWithLineRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
an... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
279,
4798,
198,
11748,
302,
198,
198,
11748,
2237,
628,
628,
198,
198,
4871,
7343,
23739,
50,
1039,
3152,
13949,
18453,
25,
628,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
49213,
... | 1.732683 | 7,998 |
"""
This script is responsible for disabling guest connection to shared folders
Commands used:
- defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess false
"""
from common import CLITieIn
if __name__ == '__main__':
from utils import get_argparser, get_args
parse... | [
37811,
198,
198,
1212,
4226,
318,
4497,
329,
34909,
8319,
4637,
284,
4888,
24512,
198,
198,
6935,
1746,
973,
25,
198,
198,
12,
26235,
3551,
1220,
23377,
14,
36698,
4972,
14,
11964,
38149,
14,
785,
13,
18040,
13,
82,
2022,
13,
15388,
... | 2.868421 | 190 |
import numpy as np
a = np.array(([109,15]), dtype=np.uint8)
b = np.ndarray((1,), dtype=np.uint16, buffer=a)
print(b*0.0062)
c = b.byteswap()
print(c)
print(c*0.0062) | [
11748,
299,
32152,
355,
45941,
198,
198,
64,
796,
45941,
13,
18747,
19510,
58,
14454,
11,
1314,
46570,
288,
4906,
28,
37659,
13,
28611,
23,
8,
198,
65,
796,
45941,
13,
358,
18747,
19510,
16,
11,
828,
288,
4906,
28,
37659,
13,
28611,... | 2 | 83 |
# Copyright 2017 TWO SIGMA OPEN SOURCE, LLC
#
# 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 agre... | [
2,
15069,
2177,
35288,
33993,
5673,
38303,
311,
31033,
11,
11419,
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... | 3.591837 | 294 |
import struct
| [
11748,
2878,
198
] | 4.666667 | 3 |
import torch
import itertools
from typing import List, Tuple, Dict, Generator, Iterable
from tqdm import tqdm
from G2G.model.graph_wrapper import GraphWrapper
from G2G.utils import shortest_as_adj_from_graph_wrapper
| [
11748,
28034,
198,
11748,
340,
861,
10141,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
360,
713,
11,
35986,
11,
40806,
540,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
402,
17,
38,
13,
19849,
13,
34960,
62,
485... | 3.205882 | 68 |
"""Smoother utility.
This file contains the smoothing utility functions. We have a number of
possible smoothers to choose from: windowed average, local weighted regression,
and a causal Savitzky-Golay filter.
Code is courtesy of Dmitry Shemetov, Maria Jahja, and Addison Hu.
These smoothers are all functions that tak... | [
37811,
50,
5908,
847,
10361,
13,
198,
198,
1212,
2393,
4909,
262,
32746,
722,
10361,
5499,
13,
775,
423,
257,
1271,
286,
198,
79,
4733,
32686,
82,
284,
3853,
422,
25,
4324,
276,
2811,
11,
1957,
26356,
20683,
11,
198,
392,
257,
26558... | 2.335011 | 8,943 |
import string
import random
import argparse
parser = argparse.ArgumentParser(description='generate a password with x amount of randomised ascii characters')
parser.add_argument('x', metavar='N', type=int, help='length of desired password string')
args = parser.parse_args()
x = args.x
password_characters = string.asc... | [
11748,
4731,
198,
11748,
4738,
198,
11748,
1822,
29572,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
8612,
378,
257,
9206,
351,
2124,
2033,
286,
4738,
1417,
355,
979,
72,
3435,
11537,
198,
48610,
13,
2860,... | 3.382353 | 136 |
# Copyright 2020 The Kale Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | [
2,
220,
15069,
12131,
383,
509,
1000,
46665,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 2.435409 | 6,038 |
"""
spawn FTP get and put GUIs no matter what directory I'm run from; os.getcwd is not
necessarily the place this script lives; could also hardcode path from $PP4EHOME,
or guessLocation; could also do: [from PP4E.launchmodes import PortableLauncher,
PortableLauncher('getfilegui', '%s/getfilegui.py' % mydir)()]... | [
37811,
201,
198,
48183,
45854,
651,
290,
1234,
19348,
3792,
645,
2300,
644,
8619,
314,
1101,
1057,
422,
26,
28686,
13,
1136,
66,
16993,
318,
407,
220,
201,
198,
10789,
3093,
262,
1295,
428,
4226,
3160,
26,
220,
714,
635,
1327,
8189,
... | 2.546419 | 377 |
from phiorm.models.query import query
from phiorm.util import tree
| [
6738,
872,
72,
579,
13,
27530,
13,
22766,
1330,
12405,
198,
6738,
872,
72,
579,
13,
22602,
1330,
5509,
628,
198
] | 3.285714 | 21 |
"""Unit tests for pattern.py."""
import unittest
from iast.python.default import parse, make_pattern, Num, BinOp, Add, Mult
from iast.pattern import *
from iast.pattern import match_step
if __name__ == '__main__':
unittest.main()
| [
37811,
26453,
5254,
329,
3912,
13,
9078,
526,
15931,
628,
198,
11748,
555,
715,
395,
198,
198,
6738,
1312,
459,
13,
29412,
13,
12286,
1330,
21136,
11,
787,
62,
33279,
11,
31835,
11,
20828,
18257,
11,
3060,
11,
7854,
198,
6738,
1312,
... | 2.962963 | 81 |
from __future__ import division
from __future__ import print_function
import os
from skimage import io
from torch.utils.data import Dataset
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
198,
6738,
1341,
9060,
1330,
33245,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
628
] | 3.763158 | 38 |
#!/usr/bin/env python3
###########################################
# #
# "Pype" #
# Simple file sharing server, #
# to upload and download file #
# from CLI #
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
29113,
7804,
21017,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.241221 | 655 |
from .import hgrid, auth, config # noqa | [
6738,
764,
11748,
289,
25928,
11,
6284,
11,
4566,
220,
1303,
645,
20402
] | 3.076923 | 13 |
import tests.unit.cli.commands.command_testing as command_testing
import lmctl.drivers.lm.base as lm_drivers
import lmctl.cli.commands.deployment_location as deployment_cmds
import tempfile
import shutil
import os
import json
import yaml
from unittest.mock import patch
from tests.common.simulations.lm_simulator import ... | [
11748,
5254,
13,
20850,
13,
44506,
13,
9503,
1746,
13,
21812,
62,
33407,
355,
3141,
62,
33407,
198,
11748,
300,
76,
34168,
13,
36702,
13,
75,
76,
13,
8692,
355,
300,
76,
62,
36702,
198,
11748,
300,
76,
34168,
13,
44506,
13,
9503,
... | 3.223301 | 103 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext_lazy as _
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
1258... | 2.723404 | 47 |
#!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this fi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
220,
11593,
33,
43312,
62,
43,
2149,
24290,
834,
198,
2,
15069,
357,
66,
8,
1853,
11,
1578,
1829,
5070,
11,
355,
7997,
416,
262,
198,
2,
22998,
286,
262,
2351,
15781,
261,
2306,... | 2.41489 | 3,143 |
import bc_utils
from logistic_regression import logistic_regression_2D
from nn_classification import nn_binary_classification_2D
LEARNING_RATE = 0.1
NUM_EPOCHS = 20000
bc_utils.create_output_dir()
results_file = open("output/results.txt", "w")
# Linear data
X_train, Y_train = bc_utils.generate_linear_data(300)
bc_ut... | [
11748,
47125,
62,
26791,
198,
6738,
2604,
2569,
62,
2301,
2234,
1330,
2604,
2569,
62,
2301,
2234,
62,
17,
35,
198,
6738,
299,
77,
62,
4871,
2649,
1330,
299,
77,
62,
39491,
62,
4871,
2649,
62,
17,
35,
198,
198,
2538,
1503,
15871,
6... | 2.414266 | 729 |
from unittest import TestCase
from .problem_11_1_merge_sorted_files import *
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
764,
45573,
62,
1157,
62,
16,
62,
647,
469,
62,
82,
9741,
62,
16624,
1330,
1635,
628,
198
] | 2.925926 | 27 |
# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
# Copyright 2017 FUJITSU LIMITED
#
# 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/LICE... | [
2,
357,
34,
8,
15069,
1946,
12,
5304,
30446,
15503,
6400,
446,
14973,
7712,
18470,
198,
2,
15069,
2177,
376,
52,
41,
2043,
12564,
40880,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
... | 3.819672 | 183 |
# Copyright (c) Zhixian MA <zxma_sjtu@qq.com>
# MIT license
"""
Some I/O and processing tools are provied in this utils module.
Methods
-------
reg2mat:
Read point sources list from the region file, and translate it into np.ndarray
mat2reg:
Print PS list matrix to ds9 region files
compare:
Compare detecte... | [
2,
15069,
357,
66,
8,
10511,
844,
666,
8779,
1279,
42592,
2611,
62,
82,
73,
28047,
31,
38227,
13,
785,
29,
198,
2,
17168,
5964,
198,
198,
37811,
198,
4366,
314,
14,
46,
290,
7587,
4899,
389,
899,
798,
287,
428,
3384,
4487,
8265,
... | 1.956474 | 3,607 |
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '0.0.2.dev0+g3ce8781.d20210430'
version_tuple = (0, 0, 2, 'dev0+g3ce8781', 'd20210430')
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
2393,
7560,
416,
900,
37623,
10141,
62,
1416,
76,
198,
2,
836,
470,
1487,
11,
836,
470,
2610,
287,
2196,
1630,
198,
9641,
796,
705,
15,
13,
15,
13,
17,
13,
7959,
15,
10,
70,
18,
344,
2... | 2.333333 | 84 |
import pathlib
import typing
from typing import Any, Iterable, List, Optional, Set, Union, Type
from dataclasses import dataclass, field
__all__ = ("Parameter",)
@dataclass(order=True)
if __name__ == "__main__":
pass
| [
11748,
3108,
8019,
198,
11748,
19720,
198,
198,
6738,
19720,
1330,
4377,
11,
40806,
540,
11,
7343,
11,
32233,
11,
5345,
11,
4479,
11,
5994,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
198,
834,
439,
834,
796,
... | 3.026667 | 75 |
# -*- coding: utf-8 -*-
from datetime import date, timedelta
from django.shortcuts import render
__author__ = 'codez'
from .models import Event
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
4818,
8079,
1330,
3128,
11,
28805,
12514,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
834,
9800,
834,
796,
705,
8189,
89,
6,
198,
198,
... | 2.941176 | 51 |
"""
preprocess_corpus.py
Script to preprocess corpus data
author: @justjoshtings
created: 3/31/2022
"""
from Woby_Modules.CorpusProcessor import CorpusProcessor
if __name__ == "__main__":
print("Executing preprocess_corpus.py")
main()
| [
37811,
198,
3866,
14681,
62,
10215,
79,
385,
13,
9078,
198,
7391,
284,
662,
14681,
35789,
1366,
198,
198,
9800,
25,
2488,
3137,
73,
3768,
83,
654,
198,
25598,
25,
513,
14,
3132,
14,
1238,
1828,
198,
37811,
198,
6738,
370,
26730,
62,... | 2.733333 | 90 |
import logging
logger = logging.getLogger(__name__)
import itertools
import random
from collections import OrderedDict
import functools
import numpy as np
import pandas as pd
from enum import Enum
| [
11748,
18931,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
11748,
340,
861,
10141,
198,
11748,
4738,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
11748,
1257,
310,
10141,
198,
198... | 2.702381 | 84 |
import cv2
import numpy as np
import time
from skimage.feature import hog
from sklearn.externals import joblib
from nms import nms
import argparse
# made by abhinav sagar on 7/2/2019
parser = argparse.ArgumentParser(description='To read image name')
parser.add_argument('-i', "--image", help="Path to the test image",... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
6738,
1341,
9060,
13,
30053,
1330,
40476,
198,
6738,
1341,
35720,
13,
1069,
759,
874,
1330,
1693,
8019,
198,
6738,
299,
907,
1330,
299,
907,
198,
11748,
182... | 2.218058 | 1,174 |
from collections import Counter
if __name__ == '__main__':
with open('input.txt') as input_file:
policy_pass_list = [read(line) for line in input_file]
valid_passwords = list(filter(valid, policy_pass_list))
print(len(valid_passwords))
| [
6738,
17268,
1330,
15034,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
351,
1280,
10786,
15414,
13,
14116,
11537,
355,
5128,
62,
7753,
25,
198,
220,
220,
220,
220,
220,
220,
220,
... | 2.747368 | 95 |
import sys
import random
import numpy as np
from keras.models import Sequential
from keras.layers import Conv2D, BatchNormalization
from keras.utils import to_categorical
from othello_ml import Othello, Action
from othello_ml.visualizer import Visualizer
from train import MLAgent, MLRenderer
model = Sequential([
... | [
11748,
25064,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
34872,
17,
35,
11,
347,
963,
26447,
1634,
198,
6738,
41927,
292,
... | 2.530395 | 658 |
#!/usr/bin/env python
# Copyright 2016 University of Chicago
# Licensed under the APL 2.0 license
import argparse
import subprocess
import sys
from email.mime.text import MIMEText
import psycopg2
import fsurfer.helpers
import fsurfer
VERSION = fsurfer.__version__
def email_user(workflow_id, email):
"""
E... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
1584,
2059,
286,
4842,
198,
2,
49962,
739,
262,
3486,
43,
362,
13,
15,
5964,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
6738,
3053,
13,
7... | 2.086558 | 1,964 |
import os, time
from core import execute
from core import slack
from core import utils
class VulnScan(object):
''' Scanning vulnerable service based version '''
# def conclude(self):
# #### Create beautiful HTML report for masscan
# cmd = "xsltproc -o $WORKSPACE/portscan/final-$OUTPUT.html $PL... | [
11748,
28686,
11,
640,
198,
6738,
4755,
1330,
12260,
198,
6738,
4755,
1330,
30740,
198,
6738,
4755,
1330,
3384,
4487,
198,
198,
4871,
25442,
77,
33351,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
20937,
768,
8826,
2139,
1912,
2196,
... | 2.5 | 288 |
# Time: O(n * b), n is the length of gene string, b is size of bank
# Space: O(b)
# A gene string can be represented by an 8-character long string,
# with choices from "A","C","G","T".
# Suppose we need to investigate about a mutation (mutation from "start" to "end"),
# where ONE mutation is defined as ONE single cha... | [
2,
3862,
25,
220,
440,
7,
77,
1635,
275,
828,
299,
318,
262,
4129,
286,
9779,
4731,
11,
275,
318,
2546,
286,
3331,
198,
2,
4687,
25,
440,
7,
65,
8,
198,
198,
2,
317,
9779,
4731,
460,
307,
7997,
416,
281,
807,
12,
22769,
890,
... | 3.002404 | 416 |
"""Functions for making EvoEF2 predictions."""
import ampal
import gzip
import glob
import subprocess
import multiprocessing
import os
from pathlib import Path
from benchmark import config
from sklearn.preprocessing import OneHotEncoder
import warnings
import numpy as np
import pandas as pd
def run_Evo2EF(
pdb: s... | [
37811,
24629,
2733,
329,
1642,
4319,
78,
25425,
17,
16277,
526,
15931,
198,
198,
11748,
716,
18596,
198,
11748,
308,
13344,
198,
11748,
15095,
198,
11748,
850,
14681,
198,
11748,
18540,
305,
919,
278,
198,
11748,
28686,
198,
6738,
3108,
... | 2.070493 | 2,979 |
"""Holds the chromosome class and helper functions.
Classes:
Chromosome
Functions:
valid_append(List[Path], Path)
valid_insert(List[Path], Path)
"""
class Chromosome:
"""Represents a solution to the problem.
Holds the solution and its fitness/evaluation.
"""
def __init__(self, soluti... | [
37811,
39,
10119,
262,
34348,
1398,
290,
31904,
5499,
13,
198,
198,
9487,
274,
25,
628,
220,
220,
220,
18255,
418,
462,
198,
198,
24629,
2733,
25,
628,
220,
220,
220,
4938,
62,
33295,
7,
8053,
58,
15235,
4357,
10644,
8,
198,
220,
... | 2.607595 | 237 |
import pymysql.cursors
connection = pymysql.connect(host='localhost', port=3306, user='root', passwd='root', db='python_user',
charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)
| [
11748,
279,
4948,
893,
13976,
13,
66,
1834,
669,
198,
198,
38659,
796,
279,
4948,
893,
13976,
13,
8443,
7,
4774,
11639,
36750,
3256,
2493,
28,
18,
20548,
11,
2836,
11639,
15763,
3256,
1208,
16993,
11639,
15763,
3256,
20613,
11639,
29412... | 2.191919 | 99 |
import json
from unittest.mock import mock_open, patch
import pytest
from codalib import util
def test_return_value():
"""
Test that parseVocabularySources returns a list of the correct length
where all elements are tuples.
"""
read_data = json.dumps({
'terms': [
{'name': 'fo... | [
11748,
33918,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
15290,
62,
9654,
11,
8529,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
14873,
282,
571,
1330,
7736,
628,
198,
4299,
1332,
62,
7783,
62,
8367,
33529,
198,
220,
220,
220,
37... | 2.410667 | 750 |
from utils_prm import select_cfg_file
| [
6738,
3384,
4487,
62,
1050,
76,
1330,
2922,
62,
37581,
62,
7753,
628
] | 3 | 13 |
# %% [572. *Subtree of Another Tree](https://leetcode.com/problems/subtree-of-another-tree/)
# 問題:tがsの部分木かどうかを返す
# 解法:再帰を用いる
| [
2,
43313,
685,
48724,
13,
1635,
7004,
21048,
286,
6023,
12200,
16151,
5450,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
7266,
21048,
12,
1659,
12,
29214,
12,
21048,
34729,
198,
2,
10263,
243,
237,
165,
94,
234,
171,
120,
248... | 1.52439 | 82 |
"""
iorodeo-potentiostat
---------------------
Python interface to IO Rodeo's Potentiostat Shield for the teensy 3.2 development
board.
Example
--------
.. code:: python
from potentiostat import Potentiostat
dev = Potentiostat('/dev/ttyACM0')
dev.set_curr_range('100uA')
dev.set_sample_period(10)
... | [
37811,
198,
1504,
1098,
78,
12,
13059,
298,
72,
455,
265,
198,
19351,
12,
198,
198,
37906,
7071,
284,
24418,
371,
1098,
78,
338,
6902,
298,
72,
455,
265,
10022,
329,
262,
15508,
88,
513,
13,
17,
2478,
220,
198,
3526,
13,
198,
198,... | 2.407288 | 933 |
#!/usr/bin/env python
# FTW Telecommunications Research Center Vienna (www.ftw.at)
# Dietmar Schabus (schabus@ftw.at)
# July 2014
# library imports
import datetime
import random
# imports from this project
import memory_config
import liblog
# =========================================================================... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
19446,
54,
48667,
4992,
3337,
23825,
357,
2503,
13,
701,
86,
13,
265,
8,
198,
2,
16292,
3876,
3059,
46844,
357,
20601,
46844,
31,
701,
86,
13,
265,
8,
198,
2,
2901,
1946,
... | 4.149533 | 107 |
#!/usr/bin/env python3
import argparse
import os
import shutil
import random
import ast
from os.path import basename, exists, splitext
import torch
import torch.backends.cudnn as cudnn
import numpy as np
import yaml
from core.trainers import CDTrainer
from utils.misc import OutPathGetter, Logger, register
i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
4738,
198,
11748,
6468,
198,
6738,
28686,
13,
6978,
1330,
1615,
12453,
11,
7160,
11,
4328,
578,
742,
198,
... | 2.966667 | 120 |
# Copyright 2016 AT&T Corp
# 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,
15069,
1584,
5161,
5,
51,
11421,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
42... | 3.459877 | 324 |
#!/usr/bin/env python2
"""
This script demonstates how to transform SQL logs fetched from elasticsearch into graph showing how data flows between the code and the storage
"""
from __future__ import print_function
import collections
import time
import logging
import re
from datetime import datetime
from dateutil impor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
37811,
198,
1212,
4226,
3222,
27219,
703,
284,
6121,
16363,
17259,
11351,
1740,
422,
27468,
12947,
656,
4823,
4478,
703,
1366,
15623,
1022,
262,
2438,
290,
262,
6143,
198,
37811,
198... | 2.743273 | 1,375 |
a = int(input())
b = int(input())
n = int(input())
for i in range(n, int(10e9)):
if (i % a == 0 and i % b == 0):
print(i)
break
| [
64,
796,
493,
7,
15414,
28955,
198,
65,
796,
493,
7,
15414,
28955,
198,
77,
796,
493,
7,
15414,
28955,
198,
1640,
1312,
287,
2837,
7,
77,
11,
493,
7,
940,
68,
24,
8,
2599,
198,
220,
220,
220,
611,
357,
72,
4064,
257,
6624,
657... | 1.973333 | 75 |
import os
from typing import Any, Dict, List, Tuple, Optional, Generator
from os.path import dirname, expandvars
from pathlib import Path
from .fixer import ImportStatementMap
from .import_statement import SingleImport, ImportStatement
| [
11748,
28686,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
309,
29291,
11,
32233,
11,
35986,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
4292,
85,
945,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
764,
13049... | 3.966667 | 60 |
#!/usr/bin/env python3
import argparse
import collections
import curses
import os
import random
import sys
import time
import pkg_resources
from multiprocessing import Array, Event, Process, Value
import numpy as np
import pandas as pd
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
17268,
198,
11748,
43878,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
279,
10025,
62,
37540,
198,
6738,
... | 3.2 | 90 |
# -*- coding:utf-8 -*-
Print("Hello World!")
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
18557,
7203,
15496,
2159,
2474,
8,
198
] | 2.190476 | 21 |
# Copyright 2018 D-Wave 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
15069,
2864,
360,
12,
39709,
11998,
3457,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
... | 2.360056 | 4,316 |
#-- author: @avialxee ---#--#
#from radmap import rad_helpers
from _helpers import vz_query
import numpy as np
tgss = [[1, 12, 0.003], [2, 22, 32]]
nvss = [[12, 2, 13], [12, 2, 0.2]]
#tgss = np.array(tgss)
ins = RadioMap()
#
#print(tgss)
#print(nvss)
ind = np.where(np.array(tgss) < 0.015)
tgss[ind] =0.0
print(ins.... | [
2,
438,
1772,
25,
2488,
615,
498,
87,
1453,
11420,
2,
438,
2,
198,
2,
6738,
2511,
8899,
1330,
2511,
62,
16794,
364,
198,
6738,
4808,
16794,
364,
1330,
410,
89,
62,
22766,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
25297,
8... | 2.155172 | 174 |
from chainer import backend
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
class SquaredDifference(function_node.FunctionNode):
"""Squared difference of input variables."""
def squared_difference(x1, x2):
"""Squared difference of input variables.
Args:
... | [
6738,
6333,
263,
1330,
30203,
198,
6738,
6333,
263,
1330,
2163,
62,
17440,
198,
6738,
6333,
263,
1330,
3384,
4487,
198,
6738,
6333,
263,
13,
26791,
1330,
2099,
62,
9122,
628,
198,
4871,
5056,
1144,
28813,
1945,
7,
8818,
62,
17440,
13,... | 2.140962 | 603 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-06-22 11:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
20,
319,
2177,
12,
3312,
12,
1828,
1367,
25,
2718,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.80303 | 66 |