content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Copyright 2019 Xanadu Quantum Technologies 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 agre... | [
2,
15069,
13130,
47482,
324,
84,
29082,
21852,
3457,
13,
198,
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,... | 2.021769 | 8,131 |
from enum import IntEnum, unique
@unique
@unique
| [
6738,
33829,
1330,
2558,
4834,
388,
11,
3748,
628,
198,
31,
34642,
628,
198,
31,
34642,
198
] | 3.117647 | 17 |
"""
Description:
Author: John Holl
Github: https://github.com/hzylyh
Date: 2022-03-19 13:42:16
LastEditors: John Holl
LastEditTime: 2022-03-19 15:24:12
"""
import logging
import os
from constant.constant import *
po_manager = {}
| [
37811,
198,
11828,
25,
198,
13838,
25,
1757,
11806,
198,
38,
10060,
25,
3740,
1378,
12567,
13,
785,
14,
71,
7357,
306,
71,
198,
10430,
25,
33160,
12,
3070,
12,
1129,
1511,
25,
3682,
25,
1433,
198,
5956,
18378,
669,
25,
1757,
11806,
... | 2.795181 | 83 |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 23 17:45:41 2017
@author: User
"""
hailstone_2(5) | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
26223,
5267,
2242,
1596,
25,
2231,
25,
3901,
2177,
201,
198,
201,
198,
31,
9800,
25,
11787,
201,
198,
37811,
201,
198,
220,
201,
198,... | 2 | 53 |
from datetime import datetime
from typing import List, Optional, Set
from pydantic import HttpUrl, UUID4, validator, root_validator
from datarightsprotocol.models.base import BaseModel
from datarightsprotocol.models.invariants import RequestMD, Action, Regime, RequestStatus, RequestReason, is_valid_state_reason
from d... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
5345,
198,
6738,
279,
5173,
5109,
1330,
367,
29281,
28165,
11,
471,
27586,
19,
11,
4938,
1352,
11,
6808,
62,
12102,
1352,
198,
198,
6738,
4818,
283,
2337... | 3.669903 | 103 |
from typing import Optional
from app.models.answer import Answer
from sqlalchemy.orm.session import Session
| [
6738,
19720,
1330,
32233,
198,
198,
6738,
598,
13,
27530,
13,
41484,
1330,
23998,
198,
6738,
44161,
282,
26599,
13,
579,
13,
29891,
1330,
23575,
628
] | 4.230769 | 26 |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | [
2,
15069,
357,
34,
8,
12131,
220,
3469,
54,
3080,
21852,
11,
35516,
198,
198,
2,
770,
1430,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
739,
262,
2846,
286,
262,
22961,
6708,
3529,
3611,
5094... | 2.975 | 480 |
# Generated by Django 4.0.2 on 2022-03-17 04:10
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
13,
17,
319,
33160,
12,
3070,
12,
1558,
8702,
25,
940,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
... | 3.020833 | 48 |
"""
TODO update description
based on this: https://raw.githubusercontent.com/explosion/spaCy/master/examples/deep_learning_keras.py
This example shows how to use an LSTM sentiment classification model trained
using Keras in spaCy. spaCy splits the document into sentences, and each
sentence is classified using the LSTM.... | [
37811,
198,
51,
3727,
46,
4296,
6764,
198,
3106,
319,
428,
25,
3740,
1378,
1831,
13,
12567,
43667,
13,
785,
14,
20676,
18442,
14,
2777,
64,
20418,
14,
9866,
14,
1069,
12629,
14,
22089,
62,
40684,
62,
6122,
292,
13,
9078,
198,
1212,
... | 2.712883 | 2,445 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The Project U-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
# The complete primitive sets
ffprims_f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
12131,
220,
383,
4935,
471,
12,
19591,
46665,
13,
198,
2,
198,
2,
5765,
286,
42... | 1.809524 | 525 |
#SPDX-License-Identifier: BSD-3-Clause
'''
forms.py
(C) Copyright 2020 Friedrich Luetze GmbH, J. Luelsdorf <lsd@luetze.de>
'''
from django import forms
from software.models import Release
class ReleaseAddLicenseForm(forms.ModelForm):
"""
Form, used to add or change the License a software
release uses.
... | [
2,
4303,
36227,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
18,
12,
2601,
682,
198,
7061,
6,
198,
23914,
13,
9078,
198,
198,
7,
34,
8,
15069,
12131,
46099,
6026,
316,
2736,
402,
2022,
39,
11,
449,
13,
6026,
1424,
67,
24263,
... | 2.810345 | 116 |
#!/usr/bin/env python
# vim: set sts=4 sw=4 et:
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
VERSION = "0.0.6"
setup (name = "tupelo",
description = "Random code around a card game called Tuppi",
version = VERSION,
author = "Jari Tenhunen",
author_e... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
198,
2,
43907,
25,
900,
39747,
28,
19,
1509,
28,
19,
2123,
25,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
... | 2.312312 | 333 |
#!/usr/bin/python
# author: Jan Hybs
import os
from cihpc.common.utils.files import StdoutType
from cihpc.cfg.config import global_configuration
class ProjectStepGit(object):
"""
Simple class holding git specification
Attributes
----------
repo: str
name of the repository
"""
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
1772,
25,
2365,
6707,
1443,
628,
198,
11748,
28686,
198,
6738,
269,
4449,
14751,
13,
11321,
13,
26791,
13,
16624,
1330,
520,
67,
448,
6030,
198,
6738,
269,
4449,
14751,
13,
37581,
13,
11... | 2.880734 | 109 |
import json
from shapely.geometry import shape, Point
SP_FENCE = 'shippingPointFence'
LANE = 'smfLane-0304705806.geojson'
# Load lane
with open(LANE, 'r') as f:
lane = json.load(f)
# Construct point from geolocation
point = Point(-77.5210123, 40.027551)
for feature in lane['features']:
properties = feature... | [
11748,
33918,
198,
6738,
5485,
306,
13,
469,
15748,
1330,
5485,
11,
6252,
628,
198,
4303,
62,
37,
18310,
796,
705,
1477,
4501,
12727,
37,
594,
6,
198,
25697,
36,
796,
705,
5796,
69,
43,
1531,
12,
15,
21288,
34801,
37988,
13,
469,
... | 2.534314 | 204 |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 23 21:30:36 2020
:copyright:
Jared Peacock (jpeacock@usgs.gov)
:license: MIT
"""
# =============================================================================
# Imports
# =============================================================================
from mt_metada... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
4280,
2242,
2310,
25,
1270,
25,
2623,
12131,
198,
198,
25,
22163,
4766,
25,
220,
198,
220,
220,
220,
19116,
2631,
330,
735,
357,
73,
431,... | 4.423077 | 156 |
import string
import commonware.log
from oauthlib import oauth1
from oauthlib.common import safe_string_equals
from .models import Access, Nonce, Token, REQUEST_TOKEN, ACCESS_TOKEN
DUMMY_CLIENT_KEY = u'DummyOAuthClientKeyString'
DUMMY_TOKEN = u'DummyOAuthToken'
DUMMY_SECRET = u'DummyOAuthSecret'
log = commonware.log... | [
11748,
4731,
198,
11748,
2219,
1574,
13,
6404,
198,
6738,
267,
18439,
8019,
1330,
267,
18439,
16,
198,
6738,
267,
18439,
8019,
13,
11321,
1330,
3338,
62,
8841,
62,
4853,
874,
198,
198,
6738,
764,
27530,
1330,
8798,
11,
8504,
344,
11,
... | 2.706349 | 126 |
from scoring_engine.models.setting import Setting
from tests.scoring_engine.unit_test import UnitTest
| [
6738,
9689,
62,
18392,
13,
27530,
13,
33990,
1330,
25700,
198,
198,
6738,
5254,
13,
46536,
62,
18392,
13,
20850,
62,
9288,
1330,
11801,
14402,
628
] | 4 | 26 |
import pytest
import pandas as pd
from riptable import *
sorted_codes = FastArray(
[
2,
4,
4,
3,
2,
1,
3,
2,
0,
1,
3,
4,
2,
0,
4,
3,
1,
0,
... | [
11748,
12972,
9288,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
201,
198,
6738,
374,
10257,
540,
1330,
1635,
201,
198,
201,
198,
201,
198,
82,
9741,
62,
40148,
796,
12549,
19182,
7,
201,
198,
220,
220,
220,
685,
201,
198,
... | 1.355478 | 858 |
"""
Simple lexer transform to support *regex string literals*.
>>> re'\w+'
re.compile(r'\w+', re.VERBOSE)
The string handled as *raw* and the regex is parsed with the *VERBOSE* flag
enabled so white space is ignored. If you need to set another flag use the
inline syntax ``(?...)``.
"""
import re
from io import ... | [
37811,
198,
26437,
31191,
263,
6121,
284,
1104,
1635,
260,
25636,
4731,
4187,
874,
24620,
198,
198,
33409,
302,
6,
59,
86,
10,
6,
198,
220,
220,
220,
302,
13,
5589,
576,
7,
81,
6,
59,
86,
10,
3256,
302,
13,
5959,
33,
14058,
8,
... | 2.789474 | 228 |
#def register(username, email, password, check_pass):
# if password == check_pass and 8 <= len(username) <= 20 and 8 < len(password) < 16:
# print(username, email, '\n' + 'Регистрация прошла успешно!')
# else:
# print('Предоставлены неверные данные!')
#register('sunflower', 'falone@gmail.com', '123... | [
2,
4299,
7881,
7,
29460,
11,
3053,
11,
9206,
11,
2198,
62,
6603,
2599,
198,
1303,
220,
220,
611,
9206,
6624,
2198,
62,
6603,
290,
807,
19841,
18896,
7,
29460,
8,
19841,
1160,
290,
807,
1279,
18896,
7,
28712,
8,
1279,
1467,
25,
198... | 1.756303 | 833 |
import torch
| [
11748,
28034,
198
] | 4.333333 | 3 |
import json
import urllib.request
import os
import eyed3
import re
host = input("请输入后端地址(最后不带/)\n")
url = input("请输入音乐/歌单/专辑链接\n")
if url[24] == 's':
print("url type:song")
songId = url[32:]
print("song id:" + songId)
download(songId)
elif url[24] == 'p':
print("url type:playlist")
playlistI... | [
11748,
33918,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
28686,
198,
11748,
45320,
18,
198,
11748,
302,
628,
628,
198,
4774,
796,
5128,
7203,
46237,
115,
164,
122,
241,
17739,
98,
28938,
236,
44165,
107,
28839,
108,
161,
251,
... | 1.994475 | 362 |
import sys
from . import context # noqa
from . import op # noqa
from .runtime import environment
from .runtime import migration
__version__ = "1.6.5"
sys.modules["alembic.migration"] = migration
sys.modules["alembic.environment"] = environment
| [
11748,
25064,
201,
198,
201,
198,
6738,
764,
1330,
4732,
220,
1303,
645,
20402,
201,
198,
6738,
764,
1330,
1034,
220,
1303,
645,
20402,
201,
198,
6738,
764,
43282,
1330,
2858,
201,
198,
6738,
764,
43282,
1330,
13472,
201,
198,
201,
19... | 3.023256 | 86 |
import click
import nltk
from .notion import notion
from .csv import csv
from .search import search
@click.group()
def nightshade() -> None:
"""A command suite for interacting with Rotten Tomatoes."""
pass
@click.command()
def prep() -> None:
"""
Download tokenization models for use in `search` com... | [
11748,
3904,
198,
11748,
299,
2528,
74,
198,
198,
6738,
764,
1662,
295,
1330,
9495,
198,
6738,
764,
40664,
1330,
269,
21370,
198,
6738,
764,
12947,
1330,
2989,
628,
198,
31,
12976,
13,
8094,
3419,
198,
4299,
1755,
1477,
671,
3419,
461... | 3 | 213 |
# BSD 2-CLAUSE LICENSE
# 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
# list of conditions and the following disclaimer.
# Redistributions i... | [
2,
347,
10305,
362,
12,
16827,
19108,
38559,
24290,
198,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
198,
2,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
1138,
25,
198,
198,
2,
22... | 2.531836 | 2,984 |
import numpy as np
import math
from typing import Tuple
def l2_regularization(W, reg_strength):
'''
Computes L2 regularization loss on weights and its gradient
Arguments:
W, np array - weights
reg_strength - float value
Returns:
loss, single value - l2 regularization loss
gra... | [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
19720,
1330,
309,
29291,
628,
198,
4299,
300,
17,
62,
16338,
1634,
7,
54,
11,
842,
62,
41402,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
3082,
1769,
406,
17,... | 2.627243 | 1,226 |
"""
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █... | [
37811,
198,
464,
2891,
284,
2198,
262,
11500,
393,
15582,
286,
7386,
11,
6101,
393,
10289,
13,
198,
198,
3712,
628,
198,
220,
220,
220,
23287,
20503,
8115,
22880,
245,
23287,
8115,
22880,
245,
220,
220,
23287,
8115,
22880,
245,
20503,
... | 2.128897 | 1,668 |
import sys
# a is a list
# b is a list
n,m = input().strip().split(' ')
n,m = [int(n),int(m)]
a = [int(a_temp) for a_temp in input().strip().split(' ')]
b = [int(b_temp) for b_temp in input().strip().split(' ')]
lcmOfA = LcmOfMultipleNumbers(a)
gcdOfB = GcdOfMultipleNumbers(b)
count = 0
if(gcdOfB % lcmOfA == 0):
... | [
11748,
25064,
198,
198,
2,
257,
318,
257,
1351,
198,
198,
2,
275,
318,
257,
1351,
198,
198,
77,
11,
76,
796,
5128,
22446,
36311,
22446,
35312,
10786,
705,
8,
198,
77,
11,
76,
796,
685,
600,
7,
77,
828,
600,
7,
76,
15437,
198,
... | 2.252475 | 202 |
import lzma
import json
from util import *
| [
11748,
300,
89,
2611,
198,
11748,
33918,
198,
6738,
7736,
1330,
1635,
198
] | 3.307692 | 13 |
import logging
import logging.config
import os
from django.conf import settings
| [
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
28686,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198
] | 4.210526 | 19 |
import time
from homie.support.repeating_timer import Repeating_Timer
from homie.device_base import Device_Base
from homie.node.node_base import Node_Base
from homie.node.property.property_switch import Property_Switch
from homie.node.property.property_enum import Property_Enum
import logging
logger = logging.getLo... | [
11748,
640,
198,
198,
6738,
3488,
494,
13,
11284,
13,
45956,
803,
62,
45016,
1330,
30558,
803,
62,
48801,
198,
6738,
3488,
494,
13,
25202,
62,
8692,
1330,
16232,
62,
14881,
198,
6738,
3488,
494,
13,
17440,
13,
17440,
62,
8692,
1330,
... | 3.169118 | 136 |
from flask import (
Blueprint,
Response,
render_template,
current_app,
request,
redirect,
jsonify
)
import requests
frontend = Blueprint('frontend', __name__, template_folder='templates')
headers = {'Content-type': 'application/json'}
@frontend.route('/')
@frontend.route('/country', met... | [
6738,
42903,
1330,
357,
198,
220,
220,
220,
39932,
11,
198,
220,
220,
220,
18261,
11,
198,
220,
220,
220,
8543,
62,
28243,
11,
198,
220,
220,
220,
1459,
62,
1324,
11,
198,
220,
220,
220,
2581,
11,
198,
220,
220,
220,
18941,
11,
... | 2.755556 | 135 |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry import story
class HTTPToDirectFallbackPage(page_module.Page):
"""Page that tests falling b... | [
2,
15069,
1946,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
6738,... | 3.840336 | 119 |
import numpy as np
# Use Broadcasting to create a 4 x 4 ndarray that has its first
# column full of 1s, its second column full of 2s, its third
# column full of 3s, etc..
ones = np.ones((4,4))
broadcast = np.arange(1,5).reshape(1,4)
# Do not change the name of this array.
# Please don't print anything from your code! ... | [
11748,
299,
32152,
355,
45941,
198,
198,
2,
5765,
32250,
284,
2251,
257,
604,
2124,
604,
299,
67,
18747,
326,
468,
663,
717,
198,
2,
5721,
1336,
286,
352,
82,
11,
663,
1218,
5721,
1336,
286,
362,
82,
11,
663,
2368,
198,
2,
5721,
... | 3.184 | 125 |
import copy
from django.db import models
from django.db.models.base import ModelBase
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from linguo.exceptions import MultilingualFieldError
from linguo.managers import MultilingualManager
from linguo.utils import get_real_field_nam... | [
11748,
4866,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
8692,
1330,
9104,
14881,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1... | 3.637255 | 102 |
#!/usr/bin/env python
"""Copyright (c) 2005-2017, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
15269,
357,
66,
8,
5075,
12,
5539,
11,
2059,
286,
13643,
13,
198,
3237,
2489,
10395,
13,
198,
198,
21009,
286,
13643,
1724,
262,
19477,
11,
15812,
290,
26381,
286,
262,
1... | 2.971014 | 897 |
"""
Copyright (C) 2017 University of Massachusetts Amherst.
This file is part of "xcluster"
http://github.com/iesl/xcluster
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/licen... | [
37811,
198,
15269,
357,
34,
8,
2177,
2059,
286,
10140,
1703,
372,
301,
13,
198,
1212,
2393,
318,
636,
286,
366,
87,
565,
5819,
1,
198,
4023,
1378,
12567,
13,
785,
14,
444,
75,
14,
87,
565,
5819,
198,
26656,
15385,
739,
262,
24843,... | 2.251739 | 3,738 |
import unittest
import metric_learn
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
18663,
62,
35720,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.766667 | 30 |
from .. import api, pipeline
from . import lib
from ..vendor import Qt
import pyblish.api
def install():
"""Install Photoshop-specific functionality of avalon-core.
This function is called automatically on calling `api.install(photoshop)`.
"""
print("Installing Avalon Photoshop...")
pyblish.api.... | [
6738,
11485,
1330,
40391,
11,
11523,
198,
6738,
764,
1330,
9195,
198,
6738,
11485,
85,
18738,
1330,
33734,
198,
198,
11748,
12972,
65,
1836,
13,
15042,
628,
198,
4299,
2721,
33529,
198,
220,
220,
220,
37227,
15798,
29153,
12,
11423,
112... | 2.663194 | 864 |
import os
from setuptools import setup
LONG_DESCRIPTION = """
The wq command line tool.
"""
def create_wq_namespace():
"""
Generate the wq namespace package
(not checked in, as it technically is the parent of this folder)
"""
if os.path.isdir("wq"):
return
os.makedirs("wq")
init ... | [
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
43,
18494,
62,
30910,
40165,
796,
37227,
198,
464,
266,
80,
3141,
1627,
2891,
13,
198,
37811,
628,
198,
198,
4299,
2251,
62,
86,
80,
62,
14933,
10223,
33529,
198,
220,
... | 2.368613 | 822 |
# -*- coding: utf-8 -*-
import string
for name in (s for s in dir(string) if not s.startswith('_')):
value = getattr(string, name)
# Look for byte string and unicode values
if isinstance(value, str):
print('%s=%r\n' % (name, value))
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4731,
198,
198,
1640,
1438,
287,
357,
82,
329,
264,
287,
26672,
7,
8841,
8,
611,
407,
264,
13,
9688,
2032,
342,
10786,
62,
11537,
2599,
198,
220,
220,
22... | 2.428571 | 105 |
import numpy as np
import zipfile
import os
from time import time
import matplotlib.pyplot as plt
from scipy.stats import truncnorm
import read_data_dogimage
import tensorflow as tf
from keras.models import Model
from keras.layers import Input, Dense, Conv2D, Reshape, Flatten, concatenate, UpSampling2D, Conv2DTranspo... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19974,
7753,
198,
11748,
28686,
198,
6738,
640,
1330,
640,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
34242,
1330,
40122,
27237,
198,
198,
11748,... | 2.549061 | 479 |
#!/usr/bin/python
import os
import re
import copy
from config import *
from multiPE_design_generate import Generate_MultiPE_Design, Generate_Host_Code, Generate_Connectivity_Map, Generate_MakeFile
singlePEs_evaluation_file_name = "singlePE_perf_results.log"
with open(singlePEs_evaluation_file_name, 'r') as f:
# ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
220,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
4866,
198,
6738,
4566,
1330,
1635,
198,
6738,
5021,
11401,
62,
26124,
62,
8612,
378,
1330,
2980,
378,
62,
29800,
11401,
62,
23067,
11,
2980,
37... | 2.228112 | 1,679 |
# Crie um programa que leia um número Real qualquer pelo teclado e mostre na tela a sua porção Inteira.
import math
num = float(input('Digite um número flutuante: '))
print(math.trunc(num)) | [
2,
327,
5034,
23781,
1430,
64,
8358,
443,
544,
23781,
299,
21356,
647,
78,
6416,
4140,
10819,
16176,
78,
573,
565,
4533,
304,
749,
260,
12385,
256,
10304,
257,
424,
64,
16964,
16175,
28749,
2558,
68,
8704,
13,
198,
11748,
10688,
198,
... | 2.625 | 72 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198
] | 3.444444 | 9 |
import json
import os
from hamcrest import *
from mock import patch
from pytest import mark
from pizzapy.address import Address
from pizzapy.urls import Urls, COUNTRY_USA
fixture_path = os.path.join('tests', 'fixtures', 'stores.json')
with open(fixture_path) as fp:
stores_fixture = json.load(fp)
address_param... | [
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
8891,
66,
2118,
1330,
1635,
198,
6738,
15290,
1330,
8529,
198,
6738,
12972,
9288,
1330,
1317,
198,
198,
6738,
38748,
12826,
13,
21975,
1330,
17917,
198,
6738,
38748,
12826,
13,
6371,
82,
... | 2.723183 | 578 |
import numpy as np
from menpo.shape import PointCloud
from menpo.landmark import (face_ibug_68_to_face_ibug_49,
face_ibug_68_to_face_ibug_68,
face_ibug_49_to_face_ibug_49)
from menpofit.error import euclidean_error
from menpofit.error.base import (distance_norma... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1450,
7501,
13,
43358,
1330,
6252,
18839,
198,
6738,
1450,
7501,
13,
1044,
4102,
1330,
357,
2550,
62,
571,
1018,
62,
3104,
62,
1462,
62,
2550,
62,
571,
1018,
62,
2920,
11,
198,
220,
220... | 2.282499 | 5,954 |
# -*- coding: utf-8 -*-
# import project config.py
"""
"""
import os
import logging
import argparse
from pathlib2 import Path
from dotenv import find_dotenv, load_dotenv
import retinopathy_kit.config as cfg
import retinopathy_kit.dataset.data_utils as dutils
import retinopathy_kit.features.build_features as bfeatures
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
1330,
1628,
4566,
13,
9078,
198,
37811,
198,
37811,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
6738,
3108,
8019,
17,
1330,
10644,
198,
6738,
... | 2.308264 | 2,287 |
# -*- coding: utf-8 -*-
"""A client for interacting with APICURON."""
from .api import (
Achievement,
DESCRIPTION_URL,
Description,
RESUBMISSION_URL,
Report,
Submission,
Term,
resubmit_curations,
submit_description,
)
__all__ = [
# URLs
"DESCRIPTION_URL",
"RESUBMISSION... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
32,
5456,
329,
24986,
351,
3486,
2149,
4261,
1340,
526,
15931,
198,
198,
6738,
764,
15042,
1330,
357,
198,
220,
220,
220,
45511,
11,
198,
220,
220,
220,
22... | 2.311628 | 215 |
#Code bsed on katrynchapman's ICDHierarchyParser.py
#Libraries and modules
from collections import defaultdict
import pickle
import requests
from bs4 import BeautifulSoup
import json
import copy
import requests
import re
import os
from bs4 import BeautifulSoup
import untangle
import networkx as nx
im... | [
2,
10669,
275,
36622,
319,
479,
265,
29441,
354,
499,
805,
338,
314,
8610,
39,
959,
9282,
46677,
13,
9078,
220,
201,
198,
2,
43,
11127,
290,
13103,
201,
198,
6738,
17268,
1330,
4277,
11600,
201,
198,
11748,
2298,
293,
201,
198,
1174... | 2.914063 | 128 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 16 10:34:17 2018
@author: adrian
This script creates the values for the dropdown menus and automated completion
in the GUI to load data.
Values are fetched from the database and saved in a dictionary as .npy file
"""
# ===========================... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
1526,
1467,
838,
25,
2682,
25,
1558,
2864,
198,
198,
31,
9800,
25,
512,
4484,
198,... | 2.770703 | 2,560 |
# To count the number of digits in a number.
n =input()
print(len(n)) | [
2,
1675,
954,
262,
1271,
286,
19561,
287,
257,
1271,
13,
201,
198,
77,
796,
15414,
3419,
201,
198,
4798,
7,
11925,
7,
77,
4008
] | 2.84 | 25 |
#!/usr/bin/python
# Produce documentation.
# Run this from the root directory.
# This picks up properties from ../documentation_configuration.py.
# Documentation source files for various projects (that are indicated in
# documentation_configuration.py) should be in ./PROJECT/doc.
import sys
sys.path.insert (1, '.')
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
21522,
344,
10314,
13,
198,
2,
5660,
428,
422,
262,
6808,
8619,
13,
198,
2,
770,
11103,
510,
6608,
422,
11485,
14,
22897,
341,
62,
11250,
3924,
13,
9078,
13,
198,
2,
43925,
2723,
... | 2.867027 | 925 |
#
# Copyright 2021 Ocean Protocol Foundation
# SPDX-License-Identifier: Apache-2.0
#
from copy import deepcopy
import json
import logging
import mimetypes
import pytest
from unittest.mock import MagicMock, Mock
import ipfshttpclient
from web3.main import Web3
from werkzeug.utils import get_content_type
from ocean_pro... | [
2,
198,
2,
15069,
33448,
10692,
20497,
5693,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
17007,
2963,
12272,
... | 2.939623 | 265 |
# Common library for MODtree
# Author: Taejoon Kwon (tkwon@unist.ac.kr)
import os
import gzip
filename_sp_list = 'MODtree.species_list.txt'
# TreeFam version 9 --> EnsEMBL version 69
# filename_names = 'ens69.prot2name.gz'
dirname_curr = os.path.dirname(os.path.realpath(__file__))
| [
2,
8070,
5888,
329,
19164,
21048,
198,
2,
6434,
25,
309,
3609,
73,
2049,
509,
26502,
357,
30488,
26502,
31,
403,
396,
13,
330,
13,
38584,
8,
198,
198,
11748,
28686,
198,
11748,
308,
13344,
198,
198,
34345,
62,
2777,
62,
4868,
796,
... | 2.589286 | 112 |
import versioneer
from setuptools import setup, find_packages
setup_args = dict(
name='yarnitor',
version=versioneer.get_version(),
entry_points={
'console_scripts': [
'yarnitor-background-worker = yarnitor.background.worker:main'
]
},
cmdclass=versioneer.get_cmdclass(),... | [
11748,
2196,
28153,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
62,
22046,
796,
8633,
7,
198,
220,
220,
220,
1438,
11639,
88,
1501,
2072,
3256,
198,
220,
220,
220,
2196,
28,
690,
7935,
263,
13,
11... | 2.313208 | 265 |
##
##
| [
2235,
198,
2235,
628
] | 1.75 | 4 |
from functools import reduce
sort = sorted([int(e) for e in input().split()])
print(f'{reduce(lambda t, c: t + c, sort[:len(sort) - 1])}\
{reduce(lambda t, c: t + c, sort[1:])}')
| [
6738,
1257,
310,
10141,
1330,
4646,
198,
198,
30619,
796,
23243,
26933,
600,
7,
68,
8,
329,
304,
287,
5128,
22446,
35312,
3419,
12962,
198,
198,
4798,
7,
69,
6,
90,
445,
7234,
7,
50033,
256,
11,
269,
25,
256,
1343,
269,
11,
3297,
... | 2.394737 | 76 |
from neuron import rxd
from neuron.rxd.rxdException import RxDException
from xml.etree import ElementTree as ET
import xml.dom.minidom
#species declaration with arguments [name, compartment, and initial amount]
#compartment declaration with arguments [name, size]
#reactants and products are of the form [[name,stoi... | [
6738,
43164,
1330,
374,
24954,
198,
6738,
43164,
13,
81,
24954,
13,
81,
24954,
16922,
1330,
49715,
35,
16922,
198,
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
355,
12152,
198,
11748,
35555,
13,
3438,
13,
1084,
312,
296,
628,
198,
1... | 2.637053 | 923 |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Task,Utils,Logs
from waflib.TaskGen import extension,feature,after_method
from waflib.Configure import conf
from waflib.Tools import c_preproc
SWI... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
2,
39410,
0,
2141,
407,
4370,
0,
2638,
1378,
86,
1878,
13,
13297,
8189,
13,
785,
14,
18300,
14,
31628,
14,
86,
1878,
2070,
14,
29762,
13,
... | 2.187726 | 277 |
# decklist = [villager, villager, villager, werewolf, werewolf, seer, robber, troublemaker, tanner, drunk, hunter, mason, mason, insomniac, minion, doppelganger]
# villager Just some regular person.
# werewolf: At night, opens their eyes and recognize each other. There is no killing.
# seer: At night, looks at 1 playe... | [
2,
6203,
4868,
796,
685,
41082,
3536,
11,
4489,
3536,
11,
4489,
3536,
11,
547,
18829,
11,
547,
18829,
11,
384,
263,
11,
29979,
11,
5876,
10297,
11,
25706,
1008,
11,
10785,
11,
19177,
11,
285,
888,
11,
285,
888,
11,
1035,
296,
8461... | 3.597166 | 494 |
#!/usr/bin/env python
from distutils.core import setup
setup(name='redis-dump-load',
version='0.1.1',
description='Dump and load redis databases',
author='Oleg Pudeyev',
author_email='oleg@bsdpower.com',
url='http://github.com/p/redis-dump-load',
py_modules=['redisdl'],
)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
445,
271,
12,
39455,
12,
2220,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
16,
3256,
198,
... | 2.41129 | 124 |
# -*- coding: utf-8 -*-
import logging
log = logging.getLogger('symmrpc')
from ws4py.client.geventclient import WebSocketClient
import gevent
from gevent.queue import Queue
from protocol import SymmetricRPCClient
from serdes import SerDesMsgpack
# log.debug('!sent!')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
18931,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
10786,
1837,
3020,
81,
14751,
11537,
628,
198,
6738,
266,
82,
19,
9078,
13,
16366,
13,
469,
1151,
... | 2.784314 | 102 |
#We take 2 variables with certain values:
a= 10
b= 20
# Swapping the values of the variables:
b= a + b
a= b - a
b= b - a
# Printing out to check the values:
print a
print b | [
2,
1135,
1011,
362,
9633,
351,
1728,
3815,
25,
198,
64,
28,
838,
198,
65,
28,
1160,
198,
198,
2,
2451,
5912,
262,
3815,
286,
262,
9633,
25,
198,
65,
28,
257,
1343,
275,
198,
64,
28,
275,
532,
257,
198,
65,
28,
275,
532,
257,
... | 2.777778 | 63 |
import os
import json
import logging
import torch
import numpy as np
from torch.utils.data import TensorDataset, Dataset
logging.getLogger().setLevel(logging.INFO)
DATA_PATH = os.environ["SG_DATA"]
EXP_PATH = os.environ["SG_MTL_EXP"]
BERT_LARGE_MNLI_PATH = "/datastor/xhua/Experiments/mnli_bert_large_no_transfer_see... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
309,
22854,
27354,
292,
316,
11,
16092,
292,
316,
198,
198,
6404,
2667,
13,
1136,
11... | 2.10553 | 7,505 |
import hetu as ht
from hetu import init
import numpy as np
def lstm(x, y_):
'''
LSTM model, for MNIST dataset.
Parameters:
x: Variable(hetu.gpu_ops.Node.Node), shape (N, dims)
y_: Variable(hetu.gpu_ops.Node.Node), shape (N, num_classes)
Return:
loss: Variable(hetu.gpu_ops.Node... | [
11748,
339,
28047,
355,
289,
83,
198,
6738,
339,
28047,
1330,
2315,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
300,
301,
76,
7,
87,
11,
331,
62,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
406,
2257,
44,
2746... | 1.993837 | 1,947 |
"""Module that provides iteration types that are used in evolutionary
operators to iterate through populations or communities.
"""
from abc import ABC, abstractmethod
from typing import Iterator, Optional, Union, overload
import numpy as np
from peal.community import Community
from peal.population import Population
... | [
37811,
26796,
326,
3769,
24415,
3858,
326,
389,
973,
287,
16673,
198,
3575,
2024,
284,
11629,
378,
832,
9684,
393,
5348,
13,
198,
37811,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
40806,
1352,
11,
3... | 3.28972 | 749 |
# Authors: David Mutchler, Dave Fisher, and many others before them.
print("Hello, World")
print('hi there')
print('one', 'two', 'through my shoe')
print(3 + 9)
print('3 + 9', 'versus', 3 + 9)
# DONE: After we talk together about the above, add PRINT statements that print:
# DONE: 1. A Hello message to a friend.
... | [
2,
46665,
25,
3271,
337,
7140,
1754,
11,
9935,
14388,
11,
290,
867,
1854,
878,
606,
13,
198,
198,
4798,
7203,
15496,
11,
2159,
4943,
198,
4798,
10786,
5303,
612,
11537,
198,
4798,
10786,
505,
3256,
705,
11545,
3256,
705,
9579,
616,
... | 2.875433 | 289 |
import sublime, sublime_plugin
import re
# to find on which indentation level we currently are
current_indentation_re = re.compile("^\s*")
# to leave additional new lines as is
aditional_new_lines_re = re.compile("^\s*\n+\s*\n+\s*$")
# no indentation
no_indent = re.compile("^</?(head|body)[>| ]", re.I)
# possible s... | [
11748,
41674,
11,
41674,
62,
33803,
198,
11748,
302,
198,
198,
2,
284,
1064,
319,
543,
33793,
341,
1241,
356,
3058,
389,
198,
14421,
62,
521,
298,
341,
62,
260,
796,
302,
13,
5589,
576,
7203,
61,
59,
82,
9,
4943,
198,
198,
2,
28... | 2.448187 | 386 |
from easygame import *
# V tomto priklade mame tlacidlo, ktoreho stlacenim sa odpali zvuk pistole.
## Nacitanie zvuku pistole.
gunshot = load_audio('gunshot.wav')
## Premenne o tlacidle.
button_x1 = 230 # X-ova suradnica laveho dolneho rohu.
button_y1 = 250 # Y-ova suradnica laveho dolneho rohu.
button_x2 = 570 # X-... | [
6738,
2562,
6057,
1330,
1635,
198,
198,
2,
569,
16667,
1462,
1293,
41582,
671,
285,
480,
256,
75,
46309,
5439,
11,
479,
83,
382,
8873,
336,
75,
330,
268,
320,
473,
16298,
79,
7344,
1976,
85,
2724,
11714,
2305,
13,
198,
198,
2235,
... | 1.974239 | 854 |
__all__ = ("ServerRateLimit",)
import functools
import typing
import uuid
from redis import Redis
from time import time
C_IN = typing.TypeVar("C_IN")
C_OUT = typing.TypeVar("C_OUT")
class ServerRateLimit:
"""Docs 'll come soon... (If you want docs right now you can take a look into ``__init__``)"""
secti... | [
834,
439,
834,
796,
5855,
10697,
32184,
39184,
1600,
8,
628,
198,
11748,
1257,
310,
10141,
198,
11748,
19720,
198,
11748,
334,
27112,
198,
6738,
2266,
271,
1330,
2297,
271,
198,
6738,
640,
1330,
640,
628,
198,
34,
62,
1268,
796,
19720... | 1.974138 | 2,436 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 3.111111 | 45 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
198
] | 3.166667 | 6 |
"""Content generator (just random numbers)."""
import asyncio
import random
import time
from config import CONTENT_DELAY, CONTENT_MAX_VALUE
class ContentProcessor:
"""Content processor."""
max_value = CONTENT_MAX_VALUE
delay = CONTENT_DELAY
delay_random = False
sum = 0
values = []
@clas... | [
37811,
19746,
17301,
357,
3137,
4738,
3146,
21387,
15931,
198,
11748,
30351,
952,
198,
11748,
4738,
198,
11748,
640,
198,
198,
6738,
4566,
1330,
22904,
3525,
62,
35,
3698,
4792,
11,
22904,
3525,
62,
22921,
62,
39488,
628,
198,
4871,
140... | 2.357895 | 570 |
from pathlib import Path
from typing import Any, MutableMapping
import yaml
from adam.curriculum.curriculum_utils import Phase3InstanceGroup
from adam.curriculum.phase3_curriculum import (
phase_3_one_objects_curriculum,
phase_3_one_core_objects_curriculum,
phase_3_one_stretch_objects_curriculum,
phas... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
13859,
540,
44,
5912,
198,
198,
11748,
331,
43695,
198,
198,
6738,
23197,
13,
22019,
1173,
14452,
13,
22019,
1173,
14452,
62,
26791,
1330,
18983,
18,
33384,
13247,
198,
67... | 2.70625 | 320 |
import numpy as np
import pandas as pd
#timestamp=input("Enter a timestamp: ")
start=1512031920
end=1512073980
if __name__=='__main__':
timestamp=start
stop_info=pd.read_csv("D:\\Luyu\\congestion_detector\\GTFS_sorted\\stops_sorted_sim.csv")
for b in range(int((end-start)/60-10)):
try:
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
2,
16514,
27823,
28,
15414,
7203,
17469,
257,
41033,
25,
366,
8,
198,
198,
9688,
28,
1314,
1065,
3070,
40454,
198,
437,
28,
1314,
1065,
2998,
2670,
1795,
198,
... | 2.108571 | 350 |
import pytest
from model_bakery import baker
from products.core.models import Product
from decimal import Decimal
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
2746,
62,
65,
33684,
1330,
46412,
198,
6738,
3186,
13,
7295,
13,
27530,
1330,
8721,
198,
6738,
32465,
1330,
4280,
4402,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
96... | 3.25 | 52 |
import json
from datetime import datetime
from operator import itemgetter
from os.path import dirname, join
import pytest # noqa
from city_scrapers_core.constants import COMMITTEE, PASSED
from freezegun import freeze_time
from city_scrapers.spiders.cle_city_council import CleCityCouncilSpider
freezer = freeze_time(... | [
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
4654,
198,
198,
11748,
12972,
9288,
220,
1303,
645,
20402,
198,
6738,
1748,
62,
1416,
241... | 2.832618 | 233 |
import SimpleITK as sitk
| [
11748,
17427,
2043,
42,
355,
1650,
74,
198
] | 3.125 | 8 |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
28038,
856,
198,
2,
198,
2,
28038,
856,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
739,
262,
2846,
286,
262,... | 2.094056 | 11,121 |
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import argparse
from matplotlib import pyplot as plt
from PIL import Image
from helpers import get_device, rotate_img, one_hot_embedding
#from data import dataloaders, digit_one
from train import train_model
from test import test_data
... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
628,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
67... | 3.13089 | 191 |
#!/usr/bin/env python3
import sys
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right # type: ignore
from collections import Counter, defaultdict, deque # type: ignore
from fractions import gcd # type: ignore
from heapq import heapify, heappop, heappush, heappushpop, heapreplace, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
6738,
47457,
478,
1330,
47457,
478,
11,
47457,
478,
62,
9464,
11,
47457,
478,
62,
3506,
11,
1035,
419,
11,
1035,
419,
62,
9464,
11,
1035,
419,
62,
3506,
220,
... | 2.69821 | 391 |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from .stat_utils import (blocking, correlation_coefficient,
fit_correlation_coefficient,
integrated_autocorrelation_time)
def plot_energy(local_energy, e0=None, show_variance=False):
"""... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12067,
198,
198,
6738,
764,
14269,
62,
26791,
1330,
357,
41938,
11,
16096,
62,
1073,
16814,
11,
198,
220,
... | 2.173111 | 3,414 |
import argparse
from pathlib import Path
from sys import stderr
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
25064,
1330,
336,
1082,
81,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
... | 2.581395 | 43 |
f = Foo("Indrek")
f.hello()
#hello Indrek
g = Foo("Ginger")
g.hello()
#hello Ginger
g.class_value == f.class_value
print(g.name)
#ginger
print(f.name)
#Indrek
#True
Foo("lel","Y",#is assigned to the kword parameter y in the __init__
1,2,3,4,5,6,7,"lel", #These are assigned to args, args is a tuple or list or som... | [
198,
69,
796,
36080,
7203,
5497,
37818,
4943,
198,
69,
13,
31373,
3419,
198,
2,
31373,
1423,
37818,
198,
70,
796,
36080,
7203,
38,
3889,
4943,
198,
70,
13,
31373,
3419,
198,
2,
31373,
38682,
198,
198,
70,
13,
4871,
62,
8367,
6624,
... | 2.873913 | 230 |
from curses import window
from sklearn import exceptions
import slt
# from slt import mesh
import numpy as np
import glfw
# ym = mesh.Mesh.from_file('somefile.stl')
# data = np.zeros(100 , dtype=mesh.Mesh.dtype)
# ym = mesh.Mesh(data,remove_empty_areas=False)
if not glfw.init():
raise Exception("GLFW Can no... | [
6738,
43878,
1330,
4324,
198,
6738,
1341,
35720,
1330,
13269,
198,
11748,
1017,
83,
198,
198,
2,
422,
1017,
83,
1330,
19609,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
1278,
44482,
198,
198,
2,
331,
76,
796,
19609,
13,
... | 3.272727 | 528 |
from abc import ABC, abstractmethod
from credoai.utils import NotRunError
class CredoModule(ABC):
"""
Base Class to build other modules off of.
Defines basic functions for interacting with Credo AI's Governance App
"""
@abstractmethod
def run(self):
"""
Creates self.result... | [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
2600,
78,
1872,
13,
26791,
1330,
1892,
10987,
12331,
198,
198,
4871,
327,
48454,
26796,
7,
24694,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7308,
5016,
284,
1382,
584,... | 2.330769 | 520 |
"""
Simple check that we can parse data from TaxTransactionReport files.
"""
# Copyright (c) 2019. Robert Karl. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root for license information.
import unittest
from yabc import transaction
from yabc.formats import coinbasettr
| [
37811,
198,
26437,
2198,
326,
356,
460,
21136,
1366,
422,
9241,
48720,
19100,
3696,
13,
198,
37811,
198,
2,
220,
15069,
357,
66,
8,
13130,
13,
5199,
15415,
13,
1439,
2489,
10395,
13,
198,
2,
220,
49962,
739,
262,
17168,
13789,
13,
4... | 3.936709 | 79 |
"""Add toast and bananas
Revision ID: 7508b84b248e
Revises:
Create Date: 2018-01-28 01:21:05.577259
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7508b84b248e'
down_revision = None
branch_labels = None
depends_on = None
| [
37811,
4550,
27805,
290,
35484,
198,
198,
18009,
1166,
4522,
25,
19683,
23,
65,
5705,
65,
23045,
68,
198,
18009,
2696,
25,
220,
198,
16447,
7536,
25,
2864,
12,
486,
12,
2078,
5534,
25,
2481,
25,
2713,
13,
49447,
25191,
198,
198,
378... | 2.688679 | 106 |
# encoding: utf-8
from django.db import models
from backends import backend
from settings import DEFAULT_INTERNATIONAL_PREFIX, SHORT_CODE
| [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
736,
2412,
1330,
30203,
198,
6738,
6460,
1330,
5550,
38865,
62,
1268,
31800,
29912,
62,
47,
31688,
10426,
11,
6006,
9863,
62,
34,
16... | 3.130435 | 46 |
import argparse
import json
import os
import re
import traceback
import requests
import requests.exceptions
import threading
import time
import urllib3.exceptions
from datetime import timezone, datetime
from functools import partial
from queue import Queue
from requests.adapters import HTTPAdapter
from threading import... | [
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
12854,
1891,
198,
11748,
7007,
198,
11748,
7007,
13,
1069,
11755,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,
2956,
297,
571,
18,
13,
1069,
1... | 2.814346 | 237 |
# -*- coding: utf-8 -*-
# @Time : 2019/10/24 下午5:31
# @Author : Thanlon
# @Wechat:18512152005
# @Email : thanlon@sina.com
# @File : mall.py
# @Software: PyCharm
from .. import home_bp
from flask import render_template
@home_bp.route('/v1/mall') | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
13130,
14,
940,
14,
1731,
220,
10310,
233,
39355,
230,
20,
25,
3132,
198,
2,
2488,
13838,
220,
1058,
17924,
14995,
198,
2,
2488,
... | 2.181034 | 116 |
from PySide import QtGui, QtCore
import sys
if __name__ == '__main__':
main() | [
6738,
9485,
24819,
1330,
33734,
8205,
72,
11,
33734,
14055,
198,
11748,
25064,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 2.625 | 32 |
#!/usr/bin/env python
# coding: utf-8
# # Primitive Roots
# ## About
# In modular arithmetic, a branch of number theory, a number g is a primitive root modulo n if every number a coprime to n is congruent to a power of g modulo n. That is, g is a primitive root modulo n if for every integer a coprime to n, there is ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
11460,
1800,
34341,
198,
198,
2,
22492,
7994,
220,
198,
2,
554,
26507,
34768,
11,
257,
8478,
286,
1271,
4583,
11,
257,
1271,
308,... | 2.533186 | 452 |
import os
import numpy as np
import openmdao.api as om
from scipy.interpolate import PchipInterpolator
# Openmdao component to parameterize distributed quantities for the outer shape of the wind turbine rotor blades
# Openmdao component to parameterize distributed quantities for the structural design of the ... | [
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1280,
9132,
5488,
13,
15042,
355,
39030,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
350,
35902,
9492,
16104,
1352,
628,
220,
220,
220,
1303,
4946,
9132,
5488,
... | 4.231707 | 82 |
#!/usr/bin/python3
#
# mlhub - Machine Learning Model Repository
#
# A command line tool for managing machine learning models.
#
# Copyright 2018 (c) Graham.Williams@togaware.com All rights reserved.
#
# This file is part of mlhub.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtainin... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
198,
2,
25962,
40140,
532,
10850,
18252,
9104,
1432,
13264,
198,
2,
198,
2,
317,
3141,
1627,
2891,
329,
11149,
4572,
4673,
4981,
13,
198,
2,
198,
2,
15069,
2864,
357,
66,
8,
11520,... | 2.675986 | 4,972 |
import fnmatch
import struct
from . import kickrom
from . import remusfile
import amitools.util.DataDir as DataDir
from amitools.binfmt.BinImage import (
BinImage,
Segment,
Relocations,
Reloc,
BIN_IMAGE_TYPE_HUNK,
SEGMENT_TYPE_CODE,
)
| [
11748,
24714,
15699,
198,
11748,
2878,
198,
198,
6738,
764,
1330,
4829,
398,
198,
6738,
764,
1330,
816,
385,
7753,
198,
11748,
716,
270,
10141,
13,
22602,
13,
6601,
35277,
355,
6060,
35277,
198,
6738,
716,
270,
10141,
13,
8800,
69,
16... | 2.416667 | 108 |
from enum import Enum, auto
| [
6738,
33829,
1330,
2039,
388,
11,
8295,
628
] | 3.625 | 8 |
from pathlib import Path
from dyslexia.eval.eval_utils import eval_txt_file, eval_folder
test_path = Path(__file__).resolve().parents[1]
| [
6738,
3108,
8019,
1330,
10644,
198,
6738,
13147,
2588,
544,
13,
18206,
13,
18206,
62,
26791,
1330,
5418,
62,
14116,
62,
7753,
11,
5418,
62,
43551,
198,
198,
9288,
62,
6978,
796,
10644,
7,
834,
7753,
834,
737,
411,
6442,
22446,
23743,
... | 2.978723 | 47 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Myme and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import msgprint
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
1853,
11,
2011,
1326,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,... | 1.861334 | 5,863 |