content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# This module almost isn't required, but there are enough differences
# that we do in fact need it. Future work might add clever on-demand
# loading of the various modules.
from dxfwrite import DXFEngine as dxf
import svgwrite
| [
2,
770,
8265,
2048,
2125,
470,
2672,
11,
475,
612,
389,
1576,
5400,
198,
2,
326,
356,
466,
287,
1109,
761,
340,
13,
220,
10898,
670,
1244,
751,
14169,
319,
12,
28550,
198,
2,
11046,
286,
262,
2972,
13103,
13,
198,
198,
6738,
288,
... | 3.881356 | 59 |
from flask import Flask , jsonify , request,abort
from AI import main
import pandas as pd
import numpy as np
import datetime
import twilio_service
from pymongo import MongoClient
app = Flask(__name__)
@app.route('/verify', methods=['POST'])
if __name__ == '__main__':
app.run(debug=True) | [
6738,
42903,
1330,
46947,
837,
33918,
1958,
837,
2581,
11,
397,
419,
198,
6738,
9552,
1330,
1388,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4818,
8079,
198,
11748,
665,
346,
952,
62,
15271,
... | 2.97 | 100 |
# -*- coding: utf-8 -*-
"""
/dms/usermanagementorg/views_member_add_username.py
.. erzeugt einen einzelnen User inerhalb der Instituution
Django content Management System
Hans Rauch
hans.rauch@gmx.net
Die Programme des dms-Systems koennen frei genutzt und den spezifischen
Beduerfnissen entsprechend angepass... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
14,
67,
907,
14,
385,
2224,
5082,
2398,
14,
33571,
62,
19522,
62,
2860,
62,
29460,
13,
9078,
198,
198,
492,
1931,
2736,
1018,
83,
304,
42326,
304,
259,
1... | 2.546631 | 1,855 |
from functools import partial
from django.db import models
from django.contrib.postgres import fields
from purpleserver.core.models import OwnedEntity, uuid
| [
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
7353,
34239,
1330,
7032,
198,
198,
6738,
1308,
2374,
18497,
13,
7295,
13,
27530,
1330,
11744,
276,
32398,
11... | 3.613636 | 44 |
"""
Everything related to the admin interface of ModelMirror is located in here
"""
from django.contrib.admin import register
from django.shortcuts import redirect
from automated_logging.admin.base import ReadOnlyAdminMixin, ReadOnlyTabularInlineMixin
from automated_logging.models import ModelMirror, ModelField
clas... | [
37811,
198,
19693,
3519,
284,
262,
13169,
7071,
286,
9104,
27453,
1472,
318,
5140,
287,
994,
198,
37811,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
1330,
7881,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
198,
198,
67... | 3.144385 | 374 |
#!/usr/bin/env python
# *****************************************************************
# (C) Copyright IBM Corp. 2016, 2019. 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 Licen... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
41906,
17174,
9,
198,
2,
357,
34,
8,
15069,
19764,
11421,
13,
1584,
11,
13130,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
... | 4.032389 | 247 |
import pytest
from .exemplar_generators import EXEMPLAR_DERIVED_GENERATORS
@pytest.mark.parametrize("g", EXEMPLAR_DERIVED_GENERATORS)
def test_derived_generator_is_owner_of_its_constituent_generators(g):
"""
"""
# Sanity check that list of constituent generators is not empty
assert g.constituent_gener... | [
11748,
12972,
9288,
198,
6738,
764,
1069,
18856,
283,
62,
8612,
2024,
1330,
7788,
3620,
6489,
1503,
62,
14418,
3824,
1961,
62,
35353,
1137,
1404,
20673,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
70,
1600,
77... | 2.803468 | 173 |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %%
# %matplotlib i... | [
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
17519,
25,
20966,
2047,
65,
11,
9078,
25,
25067,
198,
2,
220,
220,
220,
220,
2420,
62,
15603,
341,
25,
198,
2,
22... | 3.035189 | 2,586 |
# Copyright 2018 Databricks, Inc.
VERSION = '1.0.0.rc0'
| [
2,
15069,
2864,
16092,
397,
23706,
11,
3457,
13,
628,
198,
43717,
796,
705,
16,
13,
15,
13,
15,
13,
6015,
15,
6,
198
] | 2.416667 | 24 |
# Copyright (c) 2021 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 appli... | [
2,
15069,
357,
66,
8,
33448,
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,
2393,
2845... | 3.545775 | 284 |
"""
Reads in current year's Arctic sea ice extent from JAXA
Website : https://ads.nipr.ac.jp/vishop/vishop-extent.html
Author : Zachary M. Labe
Date : 11 October 2016
"""
### Import modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as c
import urllib as UL
import datetime
i... | [
37811,
198,
5569,
82,
287,
1459,
614,
338,
15723,
5417,
4771,
6287,
422,
449,
25922,
32,
198,
198,
33420,
220,
220,
1058,
3740,
1378,
5643,
13,
77,
541,
81,
13,
330,
13,
34523,
14,
85,
10124,
14,
85,
10124,
12,
2302,
298,
13,
6494... | 2.282223 | 2,087 |
import csv, re, codecs, cStringIO
from pattern.web import URL, DOM
def scrape_data(dom):
'''Scrape polls data from table, return list of lists with dates and polls per candidate'''
table = dom(".data")[1]
output = []
for i, row in enumerate(table("tr")):
if i < 2:
continue
t... | [
11748,
269,
21370,
11,
302,
11,
40481,
82,
11,
269,
10100,
9399,
198,
6738,
3912,
13,
12384,
1330,
10289,
11,
24121,
198,
198,
4299,
42778,
62,
7890,
7,
3438,
2599,
198,
220,
220,
220,
705,
7061,
3351,
13484,
9231,
1366,
422,
3084,
... | 2.350835 | 419 |
import mangopay
from . import settings
mangopay.client_id = settings.MANGOPAY_CLIENT_ID
mangopay.passphrase = settings.MANGOPAY_PASSPHRASE
| [
11748,
45663,
404,
323,
198,
198,
6738,
764,
1330,
6460,
198,
198,
76,
648,
404,
323,
13,
16366,
62,
312,
796,
6460,
13,
10725,
44962,
4792,
62,
5097,
28495,
62,
2389,
198,
76,
648,
404,
323,
13,
6603,
34675,
796,
6460,
13,
10725,
... | 2.711538 | 52 |
import tensorflow as tf
import tf2lib as tl
# ==============================================================================
# = datasets =
# ==============================================================================
# =========================... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
48700,
17,
8019,
355,
256,
75,
628,
198,
2,
38093,
25609,
28,
198,
2,
796,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 3.062857 | 175 |
# Copyright 2018 The GamePad 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... | [
2,
15069,
2864,
383,
3776,
26114,
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.476839 | 367 |
import base64
import uuid
from typing import TYPE_CHECKING, Optional
from django.contrib.auth.hashers import check_password
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import gettext_lazy as _
from rest_framework import exceptions
from rest_framework.authentication import Base... | [
11748,
2779,
2414,
198,
11748,
334,
27112,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
32233,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
10134,
7084,
1330,
2198,
62,
28712,
198,
6738,
42625,
14208,
13,
7295,
13,... | 3.59292 | 226 |
from selenium import webdriver
import pyautogui
from time import sleep
#ler dados da pessoa
nome = str(input('Digite seu nome: '))
nome_user = str(input('Digite o nome do usuario: '))
email = str(input('Digite seu email: '))
senha = str(input('Digite a senha: '))
navegador = webdriver.Chrome(executable_path=r'chromed... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
11748,
12972,
2306,
519,
9019,
198,
6738,
640,
1330,
3993,
198,
198,
2,
1754,
9955,
418,
12379,
279,
408,
12162,
198,
77,
462,
796,
965,
7,
15414,
10786,
19511,
578,
384,
84,
299,
462,
... | 2.474531 | 373 |
#!/usr/bin/env python3
# lineFilter
# Dave McEwan 2020-10-03
#
# Take lines from STDIN, filter out lines, and print remaining lines on STDOUT.
# Run like:
# cat foo.txt | python lineFilter.py fileOfRegexs > bar.txt
#
# mypy --ignore-missing-imports lineFilter.py
# Standard library
import argparse
import re
import ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
1627,
22417,
198,
2,
9935,
1982,
36,
8149,
12131,
12,
940,
12,
3070,
198,
2,
198,
2,
7214,
3951,
422,
48571,
1268,
11,
8106,
503,
3951,
11,
290,
3601,
5637,
3951,
319,
... | 2.444687 | 1,374 |
import torch.utils.data as data
from PIL import Image
import os
import os.path
import numpy as np
from albumentations import (
Compose,
OneOf,
RandomBrightness,
RandomContrast,
IAAAdditiveGaussianNoise,
GaussNoise,
HorizontalFlip,
VerticalFlip
)
import random
IMG_EXTENSIONS = ('.jpg', '... | [
11748,
28034,
13,
26791,
13,
7890,
355,
1366,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
435,
65,
1713,
602,
1330,
357,
198,
220,
220,
220,
3082,
57... | 2.289871 | 1,856 |
# How wide to allow formatted cmake files
line_width = 120
# How many spaces to tab for indent
tab_size = 4
| [
2,
1374,
3094,
284,
1249,
39559,
12067,
539,
3696,
198,
1370,
62,
10394,
796,
7982,
198,
198,
2,
1374,
867,
9029,
284,
7400,
329,
33793,
198,
8658,
62,
7857,
796,
604,
198
] | 3.40625 | 32 |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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,
15069,
33448,
43208,
21852,
1766,
1539,
12052,
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... | 1.982061 | 4,125 |
r"""SPair-71k dataset"""
import json
import glob
import os
import numpy as np
import torch
from .dataset import CorrespondenceDataset
class SPairDataset(CorrespondenceDataset):
r"""Inherits CorrespondenceDataset"""
def __init__(self, benchmark, datapath, thres, device, split):
r"""SPair-71k dataset ... | [
81,
37811,
4303,
958,
12,
4869,
74,
27039,
37811,
198,
11748,
33918,
198,
11748,
15095,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
764,
19608,
292,
316,
1330,
34428,
594,
27354,
292,
3... | 2.183419 | 1,363 |
import random
import re
from oracles.oracle import Oracle
| [
11748,
4738,
198,
11748,
302,
198,
198,
6738,
393,
9928,
13,
273,
6008,
1330,
18650,
628
] | 3.75 | 16 |
'''
TauREx v2 - Development version - DO NOT DISTRIBUTE
TauREx execution code
Developers: Ingo Waldmann, Marco Rocchetto (University College London)
'''
# loading libraries
import sys
import os
import argparse
import logging
# setting some parameters to global
global MPIimport, MPIverbose, MPImaster, ... | [
7061,
6,
198,
220,
220,
220,
36849,
2200,
87,
410,
17,
532,
7712,
2196,
532,
8410,
5626,
34957,
9865,
37780,
628,
220,
220,
220,
36849,
2200,
87,
9706,
2438,
628,
220,
220,
220,
34152,
25,
554,
2188,
24261,
9038,
11,
16556,
13545,
2... | 2.232737 | 2,737 |
from netapp.netapp_object import NetAppObject
class DiagnosisAlertDefinitionInfo(NetAppObject):
"""
System Health Alert Definition
When returned as part of the output, all elements of this typedef
are reported, unless limited by a set of desired attributes
specified by the caller.
<p>
When ... | [
6738,
2010,
1324,
13,
3262,
1324,
62,
15252,
1330,
3433,
4677,
10267,
198,
198,
4871,
31549,
5958,
36420,
36621,
12360,
7,
7934,
4677,
10267,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4482,
3893,
23276,
30396,
198,
220,
220,
... | 2.538706 | 1,576 |
import argparse
import logging
from networks.vit_seg_modeling_resnet_skip import Jigsaw_ResNetV2
import os
import random
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from networks.vit_seg_modeling import VisionTransformer as ViT_seg
from networks.vit_seg_modeling import CONFIGS as CONFIGS_ViT_se... | [
11748,
1822,
29572,
198,
11748,
18931,
198,
6738,
7686,
13,
85,
270,
62,
325,
70,
62,
4666,
10809,
62,
411,
3262,
62,
48267,
1330,
449,
45636,
62,
4965,
7934,
53,
17,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
... | 2.370581 | 2,461 |
import json
import boto3
| [
11748,
33918,
198,
11748,
275,
2069,
18,
628
] | 3.25 | 8 |
from django import template
from jcms.config import AppInfo
from jcms.components.util import app_has_attr
from jcms.models import GenericMenuItem
register = template.Library()
@register.simple_tag
def get_menu_items():
"""
Gets the menu items from AppInfo and converts it to a json
:return: Json string w... | [
6738,
42625,
14208,
1330,
11055,
198,
6738,
474,
46406,
13,
11250,
1330,
2034,
12360,
198,
6738,
474,
46406,
13,
5589,
3906,
13,
22602,
1330,
598,
62,
10134,
62,
35226,
198,
6738,
474,
46406,
13,
27530,
1330,
42044,
23381,
7449,
198,
19... | 2.860697 | 201 |
from flask import Flask
from flask import request
from flask import jsonify
from flask_cors import CORS
import json
from .auth import *
import jwt
app = Flask(__name__)
CORS(app)
app.config['ENV'] = 'development'
app.config['DEBUG'] = True
app.config['TESTING'] = True
# POST: username and password, returns a token
... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
2581,
198,
6738,
42903,
1330,
33918,
1958,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
11748,
33918,
198,
6738,
764,
18439,
1330,
1635,
198,
11748,
474,
46569,
628,
198,
1324,
... | 3.060773 | 181 |
import ast
import re
from typing import Iterator, List, Tuple
pattern = r'^(?P<quote>"""|\'\'\')(.*?)(?P=quote)\n'
DOCSTRING_PATTERN = re.compile(pattern, re.DOTALL | re.MULTILINE)
AST_PATTERN = re.compile(r"<_ast\.(.+?) ")
CELL_PATTERN = re.compile(r"^# %%.*?\n", re.MULTILINE)
def ast_name(node: ast.AST) -> st... | [
11748,
6468,
198,
11748,
302,
198,
6738,
19720,
1330,
40806,
1352,
11,
7343,
11,
309,
29291,
198,
198,
33279,
796,
374,
6,
61,
7,
30,
47,
27,
22708,
29,
37811,
91,
43054,
43054,
43054,
5769,
15885,
30,
5769,
30,
47,
28,
22708,
19415... | 2.207048 | 227 |
from selenium import webdriver
import time
from urllib.parse import urlparse
import pandas as pd
from MainApp import ProgressBarThread
from webdriver_manager.firefox import GeckoDriverManager
if __name__ == '__main__':
R_Name = getRestaurantName()
driver = webdriver.Firefox(executable_path=GeckoDriverMana... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
11748,
640,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
8774,
4677,
1330,
18387,
10374,
16818,
198,
6738,
3992,
26230,
62,
37... | 3.171429 | 210 |
"""Module to run commands."""
import subprocess
import sys
class CommandParser():
"""Class to run commands."""
def __init__(self):
"""Initialize class."""
self.commands = {
"run ru": "python3 -m CardGames ru",
"run eng": "python3 -m CardGames eng",
"run te... | [
37811,
26796,
284,
1057,
9729,
526,
15931,
198,
198,
11748,
850,
14681,
198,
11748,
25064,
628,
198,
4871,
9455,
46677,
33529,
198,
220,
220,
220,
37227,
9487,
284,
1057,
9729,
526,
15931,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
... | 1.957778 | 1,350 |
# coding:utf-8
import numpy as np
import math
| [
2,
19617,
25,
40477,
12,
23,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
628,
198
] | 2.823529 | 17 |
#!/usr/bin/python
import argparse
import random
import os
import logging
from string import Template
log = logging.getLogger('generate_belief_network')
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
VARIABLE_TEMPLATE = Template("""<VARIABLE TYPE="nature">
<NAME>Node$num</NAME>
<OUTCOME>Value1</OU... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
1822,
29572,
198,
11748,
4738,
198,
11748,
28686,
198,
11748,
18931,
198,
6738,
4731,
1330,
37350,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
10786,
8612,
378,
62,
6667,
208... | 2.501353 | 1,109 |
"""
Definition of the `CameraCalibrator` class, providing all steps needed to apply
calibration and image extraction, as well as supporting algorithms.
"""
import warnings
import numpy as np
import astropy.units as u
from ctapipe.core import TelescopeComponent
from ctapipe.image.extractor import ImageExtractor
from c... | [
37811,
198,
36621,
286,
262,
4600,
35632,
9771,
2889,
1352,
63,
1398,
11,
4955,
477,
4831,
2622,
284,
4174,
198,
9948,
571,
1358,
290,
2939,
22236,
11,
355,
880,
355,
6493,
16113,
13,
198,
37811,
198,
198,
11748,
14601,
198,
11748,
29... | 2.555688 | 2,514 |
from mxnet import gluon
from mxnet.initializer import Xavier
| [
6738,
285,
87,
3262,
1330,
1278,
84,
261,
198,
6738,
285,
87,
3262,
13,
36733,
7509,
1330,
30825,
628
] | 3.263158 | 19 |
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
from typing import List, Any, Dict, Optional
@dataclass
class Statistics:
"""统计数据"""
raw_json: dict
# 发现的 url 数量
num_found_urls: int
# 扫描完成的 url 数量
# num_found_urls - num_scanned_urls 就是还没有扫描的请求数量
num_sca... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
7343,
11,
4377,
11,
360,
713,
11,
32233,
628,
198,
31,
19608,
330,
31172,
198,
4871,
1... | 1.48411 | 944 |
# -*- coding: utf-8 -*-
"""Testing :mod:`~discO.core.fitter`."""
__all__ = [
"Test_PotentialFitter",
]
##############################################################################
# IMPORTS
# BUILT-IN
from abc import abstractmethod
from collections.abc import Generator
from types import MappingProxyType
# T... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
44154,
1058,
4666,
25,
63,
93,
15410,
46,
13,
7295,
13,
69,
1967,
63,
526,
15931,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
14402,
62,
... | 2.2891 | 1,055 |
from .normalization import fused_instance_norm
| [
6738,
764,
11265,
1634,
1330,
43954,
62,
39098,
62,
27237,
198
] | 4.272727 | 11 |
import os,time
try:
import requests
except:
os.system('pip intsall requests')
ck = requests.Session()
menu()
| [
11748,
28686,
11,
2435,
198,
28311,
25,
198,
197,
11748,
7007,
198,
16341,
25,
198,
197,
418,
13,
10057,
10786,
79,
541,
493,
82,
439,
7007,
11537,
198,
197,
198,
694,
796,
7007,
13,
36044,
3419,
198,
198,
26272,
3419,
198,
197
] | 2.738095 | 42 |
#!/usr/bin/env python
# Software License Agreement (Apache License)
#
# Copyright (c) 2015, TU Delft Robotics Institute
#
# 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.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
10442,
13789,
12729,
357,
25189,
4891,
13789,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1853,
11,
309,
52,
4216,
701,
47061,
5136,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789... | 2.834297 | 519 |
import os
import os.path
import tempfile
import shutil
import json
from nose.tools import eq_
from nose.tools import with_setup
from build_pack_utils import utils
from common.integration import ErrorHelper
from common.components import BuildPackAssertHelper
from common.components import HttpdAssertHelper
from common.co... | [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
20218,
7753,
198,
11748,
4423,
346,
198,
11748,
33918,
198,
6738,
9686,
13,
31391,
1330,
37430,
62,
198,
6738,
9686,
13,
31391,
1330,
351,
62,
40406,
198,
6738,
1382,
62,
8002,
62,
... | 2.393419 | 699 |
from sklearn.datasets import load_wine
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
# データの準備
wine = load_wine()
data = wine.data
target = wine.target
# 各パラメータの試したい値を配列で指定
parameters = {
'n_estimators' : [3, 5, 10, 30, 50, 100],
'max_featur... | [
6738,
1341,
35720,
13,
19608,
292,
1039,
1330,
3440,
62,
39002,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
24846,
18243,
33538,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
198,
198,
2,
14524,
229,
6... | 1.729529 | 403 |
from typing import Dict, Optional, Any
import copy
# Type aliases
Object = Any
String = str
# Shallow purification from None on arbitrary Python Dictionaries. Returns purified dictionary.
# Shallow purification from None on arbitrary Python Objects. Returns purified deepcopy of object.
| [
6738,
19720,
1330,
360,
713,
11,
32233,
11,
4377,
198,
11748,
4866,
198,
198,
2,
5994,
47217,
198,
10267,
796,
4377,
198,
10100,
796,
965,
628,
628,
198,
2,
911,
12154,
1308,
2649,
422,
6045,
319,
14977,
11361,
360,
2867,
3166,
13,
... | 4.323529 | 68 |
import httplib
import json
import time
from pprint import pprint
# final results: 1915 / 1949 = 98%
REQUEST_DELAY = 2 # 10s
README_DIR = "READMES"
GITHUB_HOST = "raw.githubusercontent.com"
BRANCH = "master"
README_FILES = [ "README.md", "readme.md", "Readme.md", "README", "README.rst", "README.markdown", "readme.mark... | [
11748,
1841,
489,
571,
198,
11748,
33918,
198,
11748,
640,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
2,
2457,
2482,
25,
32062,
1220,
24977,
796,
9661,
4,
198,
198,
2200,
35780,
62,
35,
3698,
4792,
796,
362,
1303,
838,
82,
198... | 2.017291 | 694 |
import cv2
import numpy as np
import sys
sobelEdgeDetection(sys.argv[1])
| [
11748,
269,
85,
17,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
25064,
201,
198,
201,
198,
568,
6667,
37021,
11242,
3213,
7,
17597,
13,
853,
85,
58,
16,
12962,
201,
198
] | 2.323529 | 34 |
"""
* Assignment: Entry Test File
* Complexity: hard
* Lines of code: 15 lines
* Time: 13 min
English:
1. Skip comments (`#`) and empty lines
2. Extract from each line: ip, host and protocol and add to `result: list[dict]`
3. Each line must be a separate dict
4. Merge host names with the same IP
5.... | [
37811,
198,
9,
50144,
25,
21617,
6208,
9220,
198,
9,
19157,
414,
25,
1327,
198,
9,
26299,
286,
2438,
25,
1315,
3951,
198,
9,
3862,
25,
1511,
949,
198,
198,
15823,
25,
198,
220,
220,
220,
352,
13,
32214,
3651,
357,
63,
2,
63,
8,
... | 2.259307 | 779 |
#!/usr/bin/python3
#
# MIT License
#
# Copyright (c) 2018 Erriez
#
# 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,... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
198,
2,
17168,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
5256,
5034,
89,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
... | 3.382739 | 533 |
# -*- coding: utf-8 -*-
import testify as T
from mockify import patch
from mockify import proxy_self
if __name__ == '__main__':
T.run()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
19671,
355,
309,
198,
6738,
15290,
1958,
1330,
8529,
198,
6738,
15290,
1958,
1330,
15741,
62,
944,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
83... | 2.679245 | 53 |
import numpy as np
import datahub_core.generators as gen
from datahub_core.models import MarkovModel
RS = np.random.RandomState(13031981)
MODEL = MarkovModel(filename='./tests/client_data.json', randomstate=RS)
RESULT = gen.generate_from_model(
props={
"country": gen.country_codes(region_field='region'),
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
4818,
993,
549,
62,
7295,
13,
8612,
2024,
355,
2429,
198,
6738,
4818,
993,
549,
62,
7295,
13,
27530,
1330,
2940,
709,
17633,
198,
6998,
796,
45941,
13,
25120,
13,
29531,
9012,
7,
12952,
35175... | 2.417544 | 285 |
from django.test import TransactionTestCase
from django.contrib.auth.models import User
from django.core.files import File
from ...utils import import_data
from ...models import (
MunicipalStaffContactsUpdate,
MunicipalStaffContacts,
)
from ...update import (
update_municipal_staff_contacts,
)
from ..reso... | [
6738,
42625,
14208,
13,
9288,
1330,
45389,
14402,
20448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
7295,
13,
16624,
1330,
9220,
198,
198,
6738,
2644,
26791,
1330,
1330,
62,
7... | 3.084967 | 153 |
"""Root API route (GET /)."""
from flask import url_for
from flask_accept import accept_fallback
from keeper.api import api
from keeper.logutils import log_route
from keeper.version import get_version
from ._models import RootData, RootLinks, RootResponse
@api.route("/", methods=["GET"])
@accept_fallback
@log_rout... | [
37811,
30016,
7824,
6339,
357,
18851,
1220,
21387,
15931,
198,
198,
6738,
42903,
1330,
19016,
62,
1640,
198,
6738,
42903,
62,
13635,
1330,
2453,
62,
7207,
1891,
198,
198,
6738,
28356,
13,
15042,
1330,
40391,
198,
6738,
28356,
13,
6404,
... | 2.592896 | 366 |
#
# Copyright 2019 The FATE 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 appli... | [
2,
198,
2,
220,
15069,
13130,
383,
376,
6158,
46665,
13,
1439,
6923,
33876,
13,
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,
... | 2.924007 | 579 |
from collections import namedtuple
from copy import deepcopy
import inspect
from pathlib import Path
import re
import pytest
import numpy as np
from xarray import DataArray, Dataset, concat
from xarray.tests.test_dataset import create_test_data
import xarray.testing as xrt
from natsort import natsorted
from xbout.... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
10104,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
302,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2124,
... | 2.044371 | 4,530 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
def quant_noise(module, p, block_size):
"""
Wraps modules and applies quantization noise to the w... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
... | 2.797571 | 741 |
import psycopg2
from common import log
import os
url = os.environ.get('DATABASE_URL', "localhost")
user = os.environ.get('DATABASE_USER', "postgres")
password = os.environ.get('DATABASE_PASSWORD', "password")
port = os.environ.get('DATABASE_PASSWORD', "5432")
db = os.environ.get('DATABASE_DATABASE', "postgres")
... | [
11748,
17331,
22163,
70,
17,
198,
6738,
2219,
1330,
2604,
198,
11748,
28686,
198,
198,
6371,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
35,
1404,
6242,
11159,
62,
21886,
3256,
366,
36750,
4943,
198,
7220,
796,
28686,
13,
268,
2268,
1... | 2.496124 | 129 |
#!/usr/bin/env python3
# pylint: disable=invalid-name,redefined-outer-name
#
# Example of a secure boot bypass resulting from exposure of memory access
# operation (i2c command) via interactive U-Boot console.
#
# To run this, the -C, --companion argument must specify the use of
# I2C bus #2 on the target device (assum... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
11,
445,
18156,
12,
39605,
12,
3672,
198,
2,
198,
2,
17934,
286,
257,
5713,
6297,
17286,
7186,
422,
7111,
286,
4088,
189... | 2.446185 | 3,447 |
from myproject import db
# set up db in init.py file in myproject __file__
| [
6738,
616,
16302,
1330,
20613,
198,
2,
900,
510,
20613,
287,
2315,
13,
9078,
2393,
287,
616,
16302,
11593,
7753,
834,
628,
628
] | 3.391304 | 23 |
import os
import numpy as np
from h5py import File
from tqdm import tqdm
from .parsers.aedat import readAEDATv2_davies
from torch.utils.data.dataset import Dataset
from .type import DVSSpikeTrain
from ..utils.units import us, wunits
class INIRoshambo(Dataset):
"""INI Roshambo17 dataset from:
I.-A. Lungu, F. C... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
289,
20,
9078,
1330,
9220,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
764,
79,
945,
364,
13,
8432,
265,
1330,
1100,
32,
1961,
1404,
85,
17,
62,
67,
615,
... | 2.256368 | 1,217 |
from snitch_mcmc import *
from functions import walker_plot
from astropy.cosmology import Planck15
import numpy as np
import sys
import corner
import matplotlib.pyplot as plt
import sys
import os
from scipy.optimize import basinhopping
from scipy import interpolate
from argparse import ArgumentParser
import resource... | [
6738,
3013,
2007,
62,
76,
11215,
66,
1330,
1635,
198,
6738,
5499,
1330,
2513,
263,
62,
29487,
198,
6738,
6468,
28338,
13,
6966,
29126,
1330,
5224,
694,
1314,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
11748,
5228,
198,
... | 2.578798 | 1,764 |
if __name__ == '__main__':
i = Index()
f = file('history.txt')
fa = f.readlines()
for l in fa:
i.add(l)
print i.size()
import time
t1 = time.time()
i.find('ssh chr.ma')
print ">>>", time.time() - t1 | [
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1312,
796,
12901,
3419,
198,
220,
220,
220,
277,
796,
2393,
10786,
23569,
13,
14116,
11537,
198,
220,
220,
220,
24685,
796,
277,
13,
961,
6615,
... | 2.033058 | 121 |
# -*- coding: utf-8 -*-
"""Dash_Longevidad_Hombres.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/17MakM1OX5Mj8MO--ox4xBiK__0hzcrnm
"""
!pip install jupyter-dash -q
!pip install dash-cytoscape -q
from jupyter_dash import JupyterDash
import da... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
43041,
62,
43,
14220,
16921,
324,
62,
39,
2381,
411,
13,
541,
2047,
65,
198,
198,
38062,
4142,
7560,
416,
1623,
4820,
2870,
13,
198,
198,
20556,
2393,
318,
5140... | 1.610108 | 14,009 |
import numpy as np
import skimage.feature
import skimage.filter
from Absolute_Integrator.pre_processing import background_subtraction
from Absolute_Integrator.pre_processing import peak_width_estimation
# dictionary describing options available to tune this algorithm
options = {
"peak_width": {"purpose": "The es... | [
11748,
299,
32152,
355,
45941,
198,
11748,
1341,
9060,
13,
30053,
198,
11748,
1341,
9060,
13,
24455,
198,
198,
6738,
36532,
62,
34500,
12392,
13,
3866,
62,
36948,
1330,
4469,
62,
7266,
83,
7861,
198,
6738,
36532,
62,
34500,
12392,
13,
... | 3.218884 | 233 |
from create_environment import create_environment
from model import Actions
| [
6738,
2251,
62,
38986,
1330,
2251,
62,
38986,
198,
6738,
2746,
1330,
24439,
628
] | 5.5 | 14 |
import re
import logging
import datetime
from odoo import api, fields, models
from odoo.http import request
from odoo.exceptions import UserError
from werkzeug import urls
_logger = logging.getLogger(__name__)
odoo_request = request
try:
import iugu
except ImportError:
_logger.exception("Não é possível impor... | [
11748,
302,
198,
11748,
18931,
198,
11748,
4818,
8079,
198,
198,
6738,
16298,
2238,
1330,
40391,
11,
7032,
11,
4981,
198,
6738,
16298,
2238,
13,
4023,
1330,
2581,
198,
6738,
16298,
2238,
13,
1069,
11755,
1330,
11787,
12331,
198,
6738,
2... | 2.862595 | 131 |
"""Scan script for Sector 32 ID-C. Changes the energy of the beamline.
"""
import os
import logging
import time
from epics import PV
import math
log = logging.getLogger(__name__)
from scanlib import update_variable_dict
from aps_32id.txm import NanoTXM, new_txm
__all__ = ['move_energy', 'getVariableDict']
variabl... | [
37811,
33351,
4226,
329,
25892,
3933,
4522,
12,
34,
13,
19179,
262,
2568,
286,
262,
15584,
1370,
13,
198,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
640,
198,
6738,
2462,
873,
1330,
31392,
198,
11748,
10688,
198,... | 2.725838 | 507 |
from abc import ABC, abstractmethod
from typing import Iterator
import qiskit.circuit.library.standard_gates as gates
from qiskit import QuantumCircuit
from qrogue.game.logic.collectibles import Collectible, CollectibleType
from qrogue.util import ShopConfig
class Instruction(Collectible, ABC):
"""
Wrapper... | [
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
40806,
1352,
198,
198,
11748,
10662,
1984,
270,
13,
21170,
5013,
13,
32016,
13,
20307,
62,
70,
689,
355,
17435,
198,
6738,
10662,
1984,
270,
1330,
29082,
31560,
... | 2.765903 | 393 |
from .reranker import BaselineReranker
from .concat_passage_reranker import ConcatPassageReranker | [
6738,
764,
11751,
962,
263,
1330,
6455,
4470,
49,
263,
962,
263,
198,
6738,
764,
1102,
9246,
62,
6603,
496,
62,
11751,
962,
263,
1330,
1482,
9246,
14478,
496,
49,
263,
962,
263
] | 2.939394 | 33 |
from .Feed import *
from .FPFeed import *
| [
6738,
764,
18332,
1330,
1635,
198,
6738,
764,
5837,
18332,
1330,
1635,
198
] | 3.230769 | 13 |
__version__ = "0.0.5"
from .inspector import ImageInspector
| [
834,
9641,
834,
796,
366,
15,
13,
15,
13,
20,
1,
198,
6738,
764,
1040,
806,
273,
1330,
7412,
818,
4443,
273,
198
] | 2.608696 | 23 |
#!/usr/bin/env python3
#
# Copyright (c) 2015 - 2022, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
import subprocess
import unittest
import time
from geopmdpy import pio
from geopmdpy import topo
from integration.test import geopm_test_launcher
from integration.test import util
@util.skip_unless_msr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
220,
15069,
357,
66,
8,
1853,
532,
33160,
11,
8180,
10501,
198,
2,
220,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
18,
12,
2601,
682,
198,
2,
198,
... | 2.33414 | 1,239 |
stringReverse("Methran")
| [
198,
8841,
49,
964,
325,
7203,
44,
2788,
2596,
4943,
198
] | 2.363636 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 <+YOU OR YOUR COMPANY+>.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
220,
198,
2,
15069,
13130,
42496,
36981,
6375,
16592,
24301,
31827,
10,
28401,
198,
2,
220,
198,
2,
770,
318,
1479... | 3.233766 | 308 |
# encoding: utf-8
"""
yang/datatypes.py
Created by Thomas Mangin on 2020-09-01.
Copyright (c) 2020 Exa Networks. All rights reserved.
"""
import decimal
words = (
'bit',
'boolean',
'contact',
'container',
'default',
'description',
'enumeration',
'key',
'import',
'enum',
'... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
17859,
14,
19608,
265,
9497,
13,
9078,
198,
198,
41972,
416,
5658,
27609,
259,
319,
12131,
12,
2931,
12,
486,
13,
198,
15269,
357,
66,
8,
12131,
1475,
64,
27862,
13,
1439,
2489,
103... | 2.111665 | 1,003 |
sch = School(['王八蛋', '张三疯', '岳不群'])
q = [1, 2, 3]
# print(id(q))
p = ('a', 'x', (1, 2, 5))
# qp = q + p #产生新对象
# print(id(qp))
# print(qp)
# q += sch #原位操作,不产新的对象
# q.extend(p)
# q.extend(sch)
q.append(p)
q.append(sch)
# print(id(q))
print(q)
| [
198,
20601,
796,
3961,
7,
17816,
25581,
17739,
104,
164,
249,
233,
3256,
705,
28156,
254,
49011,
163,
244,
107,
3256,
705,
161,
110,
111,
38834,
163,
122,
97,
6,
12962,
198,
198,
80,
796,
685,
16,
11,
362,
11,
513,
60,
198,
2,
3... | 1.397727 | 176 |
#!/usr/bin/python
"""
Use a small REST server to control the turret.
"""
from importlib import import_module
import os, math, cv2
from flask import Flask, render_template, Response
from flask_socketio import SocketIO, emit
from flask_cors import CORS
from multiprocessing import Process, Queue
from adafruit_servokit imp... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
11041,
257,
1402,
30617,
4382,
284,
1630,
262,
28101,
13,
198,
37811,
198,
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
11748,
28686,
11,
10688,
11,
269,
85,
17,
198,
6738,
42903... | 2.71087 | 460 |
from __future__ import absolute_import
from __future__ import print_function
from . import losses as gandlf_losses
import copy
import inspect
import itertools
import json
import sys
import keras
from keras.engine import training as keras_training
import six
import keras.backend as K
import numpy as np
def _as_li... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
764,
1330,
9089,
355,
308,
392,
1652,
62,
22462,
274,
198,
198,
11748,
4866,
198,
11748,
10104,
198,
11748,
340,
861,
... | 2.132602 | 16,410 |
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# G... | [
2,
15069,
2321,
3232,
10442,
5693,
11,
3457,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
22961,
8829,
198,
2,
198,
2,
22961,
8829,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
739,
262,
28... | 3.191142 | 429 |
#
# PySNMP MIB module CISCO-MGX82XX-DSX3-BERT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-MGX82XX-DSX3-BERT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:50:26 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python versio... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
36159,
8220,
12,
20474,
55,
6469,
8051,
12,
5258,
55,
18,
12,
13246,
51,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
... | 2.463891 | 4,708 |
""" Payment channels processing server.
"""
# 3rd party imports
from flask import Flask
# two1 imports
from two1.bitserv.flask import Payment
from two1.wallet.two1_wallet import Wallet
app = Flask(__name__)
wallet = Wallet()
payment = Payment(app, wallet, endpoint='/payment', db_dir="/usr/src/db")
if __name__ == '__... | [
37811,
28784,
9619,
7587,
4382,
13,
198,
37811,
198,
2,
513,
4372,
2151,
17944,
198,
6738,
42903,
1330,
46947,
198,
198,
2,
734,
16,
17944,
198,
6738,
734,
16,
13,
9895,
712,
13,
2704,
2093,
1330,
28784,
198,
6738,
734,
16,
13,
4462... | 2.967742 | 124 |
#!/usr/bin/env python
from fm2md.convert import Converter
from sys import argv
path = argv[1]
converter = Converter(path)
converter.convert_map() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
277,
76,
17,
9132,
13,
1102,
1851,
1330,
35602,
353,
198,
6738,
25064,
1330,
1822,
85,
198,
198,
6978,
796,
1822,
85,
58,
16,
60,
198,
1102,
332,
353,
796,
35602,
353,
7,
697... | 2.654545 | 55 |
import base64
import os
import re
import urllib.parse
import uuid
from collections import namedtuple
from contextlib import contextmanager
from datetime import datetime, timedelta
from pathlib import Path
from typing import Any, Dict, Generator, List, Optional, Tuple, TypedDict, Union, cast
import jwt
import orjson
im... | [
11748,
2779,
2414,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
2956,
297,
571,
13,
29572,
198,
11748,
334,
27112,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
4818,
8079,
1330,
4818,
... | 2.8 | 495 |
### This file : 1) rescales all trajectories to have the same length
### 2) extracts trajectories for each runway (arrival/departure separately)
import numpy as np
import pymap3d as pm
from math import *
from scipy.interpolate import PchipInterpolator, interp1d
| [
21017,
770,
2393,
1058,
352,
8,
6811,
2040,
477,
20134,
1749,
284,
423,
262,
976,
4129,
198,
21017,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
362,
8,
32139,
20134,
1749,
329,
1123,
23443,
357,
283,
43171,
14,
10378... | 3.088889 | 90 |
# ###############################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses thi... | [
2,
1303,
29113,
29113,
7804,
4242,
2235,
198,
2,
220,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
220,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
220,
9387,
351,
428,
670,
3... | 4.50813 | 246 |
import discord
import aiohttp
import math
import psutil
from discord.ext import commands
from datetime import datetime
from config import webhooks, twitch_clientID
| [
11748,
36446,
198,
11748,
257,
952,
4023,
198,
11748,
10688,
198,
11748,
26692,
22602,
198,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4566,
1330,
3992,
25480,
82,
11,
37366,
62,
16366,
2... | 3.883721 | 43 |
from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader
from .models import Question
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
28243,
1330,
19390,
21947,
11,
40213,
198,
198,
6738,
764,
27530,
1330,
18233,
198,
198,
2,
13610,
... | 4 | 46 |
import pytest
from olympus.consts import ZERO_ACCOUNT
from olympus.pairs import UniswapV2Pair, OHM_DAI
from olympus.tokens import OHM, DAI | [
11748,
12972,
9288,
198,
198,
6738,
267,
6760,
385,
13,
1102,
6448,
1330,
1168,
34812,
62,
26861,
28270,
198,
6738,
267,
6760,
385,
13,
79,
3468,
1330,
791,
271,
86,
499,
53,
17,
47,
958,
11,
18723,
44,
62,
5631,
40,
198,
6738,
26... | 2.482143 | 56 |
from Chrome import Chrome
from PIL import ImageGrab
import keyboard
from utils import *
from Thread import ListenerForExitThread
if __name__ == '__main__':
main(acceleration=False)
| [
6738,
13282,
1330,
13282,
201,
198,
6738,
350,
4146,
1330,
7412,
48400,
201,
198,
11748,
10586,
201,
198,
6738,
3384,
4487,
1330,
1635,
201,
198,
6738,
14122,
1330,
7343,
877,
1890,
30337,
16818,
201,
198,
201,
198,
201,
198,
201,
198,
... | 3 | 66 |
# Copyright 2011-2012 Opera Software ASA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
2,
220,
220,
15069,
2813,
12,
6999,
26049,
10442,
49599,
220,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
28... | 3.252066 | 242 |
from django.contrib import admin
from .models import Comment
admin.site.register(Comment, CommentAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
18957,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
21357,
11,
18957,
46787,
8,
198
] | 3.689655 | 29 |
import json
import random
import fastapi
from fastapi import Form, status, Depends
from fastapi.responses import RedirectResponse
from fastapi.security import APIKeyCookie
from starlette.requests import Request
from starlette.templating import Jinja2Templates
from jinja2.exceptions import TemplateNotFound
from api.... | [
11748,
33918,
198,
11748,
4738,
198,
198,
11748,
3049,
15042,
198,
6738,
3049,
15042,
1330,
5178,
11,
3722,
11,
2129,
2412,
198,
6738,
3049,
15042,
13,
16733,
274,
1330,
2297,
1060,
31077,
198,
6738,
3049,
15042,
13,
12961,
1330,
7824,
... | 2.956522 | 943 |
from pathlib import Path
from tempfile import mkdtemp
from shutil import rmtree
from unittest import TestCase
import h5py
import numpy as np
from pynwb import NWBContainer
from nwbinspector import InspectorMessage, Importance, check_small_dataset_compression, check_large_dataset_compression
from nwbinspector.register... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
20218,
7753,
1330,
33480,
67,
29510,
198,
6738,
4423,
346,
1330,
374,
16762,
631,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,... | 3.382353 | 102 |
# Copyright (c) Facebook, Inc. and its affiliates.
import argparse
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import find_peaks
from fairmotion.data import bvh
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Acceleration based changepoint detection"
... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
12683,
282,
... | 2.473485 | 264 |
import torch
import torch.nn as nn
import torch.nn.functional as F
'''
Adopted from https://github.com/passalis/probabilistic_kt/blob/master/nn/pkt.py
'''
class PKTCosSim(nn.Module):
'''
Learning Deep Representations with Probabilistic Knowledge Transfer
http://openaccess.thecvf.com/content_ECCV_2018/papers/Nikolao... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
7061,
6,
198,
2782,
45256,
422,
3740,
1378,
12567,
13,
785,
14,
6603,
27315,
14,
1676,
65,
14991,
2569,
62,
21841,
... | 2.909774 | 133 |
"""
Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related docu... | [
37811,
198,
15269,
357,
66,
8,
13130,
11,
15127,
23929,
44680,
6234,
13,
1439,
2489,
10395,
13,
198,
198,
38021,
23929,
44680,
6234,
290,
663,
8240,
669,
12377,
477,
9028,
3119,
198,
392,
20622,
2489,
287,
290,
284,
428,
3788,
11,
351... | 3.426702 | 382 |
'''
Defines several common type varibles for usage in type hints.
```
from typing import Generic
from pytrickz.typevars import *
class MyMap(Generic[K, V]):
pass
```
'''
from typing import TypeVar
T = TypeVar('T')
U = TypeVar('U')
K = TypeVar('K')
V = TypeVar('V')
R... | [
7061,
6,
201,
198,
220,
220,
220,
2896,
1127,
1811,
2219,
2099,
1401,
18764,
329,
8748,
287,
2099,
20269,
13,
201,
198,
201,
198,
220,
220,
220,
7559,
63,
201,
198,
220,
220,
220,
422,
19720,
1330,
42044,
201,
198,
220,
220,
220,
... | 2.215686 | 153 |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
| [
2,
24700,
1137,
11617,
11050,
509,
2662,
6981,
26144,
532,
8410,
5626,
48483,
198,
11748,
479,
296,
392,
198,
11748,
33918,
628,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
628
] | 2.393939 | 33 |
import re
import json
TITLE_XPATH = '''//title/text()'''
IMAGE_XPATH = '''//img[@class="photo-tile-image"]/@src'''
DESCRIPTION_XPATH = '''//*[@class="zsg-content-item home-description"]/div[1]/div[1]/text()'''
PRICE_XPATH = '''//*[@class="price"]/span[@class="value"]/text()'''
BED_BATH_SIZE_XPATH = '''//*[@class="edit... | [
11748,
302,
198,
11748,
33918,
198,
198,
49560,
2538,
62,
27481,
12599,
796,
705,
7061,
1003,
7839,
14,
5239,
3419,
7061,
6,
198,
3955,
11879,
62,
27481,
12599,
796,
705,
7061,
1003,
9600,
58,
31,
4871,
2625,
23074,
12,
40927,
12,
906... | 2.094948 | 1,643 |
import sys
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import Tuple
from utils import *
# sample input from the problem
SAMPLE = r"""
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6
""".strip()
@dataclass
def run_program(program: List[Instruction]... | [
11748,
25064,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
3384,
4487,
1330,
1635,
198,
198,
2,
6291,
512... | 2.604131 | 581 |
from collections import *
# https://leetcode.com/problems/implement-stack-using-queues/
# Runtime: 44 ms, faster than 41.12% of Python3 online submissions for Implement Stack using Queues.
# Memory Usage: 13.9 MB, less than 76.44% of Python3 online submissions for Implement Stack using Queues.
... | [
6738,
17268,
1330,
1635,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
320,
26908,
12,
25558,
12,
3500,
12,
4188,
947,
14,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
43160,
25,
5846,
13845,
11,
5443,
62... | 2.787709 | 179 |