content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import graphlab as gl
from models import *
path = "s3://gl-demo-usw2/predictive_service/demolab/ps-1.6"
ps = gl.deploy.predictive_service.load(path)
# Define dependencies
state = {'details_filename': '../data/talks.json',
'speakers_filename': '../data/speakers.json',
'details_sf': '../data/talks.g... | [
11748,
4823,
23912,
355,
1278,
198,
6738,
4981,
220,
1330,
1635,
628,
198,
6978,
796,
366,
82,
18,
1378,
4743,
12,
9536,
78,
12,
385,
86,
17,
14,
79,
17407,
425,
62,
15271,
14,
9536,
349,
397,
14,
862,
12,
16,
13,
21,
1,
198,
... | 2.7125 | 480 |
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import xlwt
#!gdown --id 1bb2irg5nFZhoFkpjWPQHJPBBr8FiK8l7
dataRestoran = pd.read_excel('restoran.xlsx')
print(dataRestoran)
# akan menghasilkan nilai kelayakan yang lebih bervariasi
titikPelayanan = [25, 37, 58, 65, 78, 8... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2124,
75,
46569,
198,... | 2.221311 | 854 |
# The MIT License (MIT) - Copyright (c) 2021 xesscorp
"""
Categorized collections of circuits.
"""
import sys
import pint
# Create a shortcut name for "circuitsascode".
sys.modules["casc"] = sys.modules["circuitsascode"]
# For electrical units like ohms, volts, etc.
units = pint.UnitRegistry()
if sys.version_info... | [
2,
383,
17168,
13789,
357,
36393,
8,
532,
15069,
357,
66,
8,
33448,
2124,
408,
10215,
79,
198,
198,
37811,
198,
34,
47467,
1143,
17268,
286,
24907,
13,
198,
37811,
198,
198,
11748,
25064,
198,
198,
11748,
35245,
198,
198,
2,
13610,
... | 3.149091 | 275 |
import pandas as pd
import numpy as np
import json
import datetime
import miasole_module_two as ps
import pvlib.pvsystem as pvsyst
#import shaded_miasole as ps
import interconnection as connect
import matplotlib.pyplot as plt
def align_yaxis(ax1, v1, ax2, v2):
"""adjust ax2 ylimit so that v2 in ax2 is aligned to... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
11748,
4818,
8079,
198,
11748,
285,
4448,
2305,
62,
21412,
62,
11545,
355,
26692,
198,
11748,
279,
85,
8019,
13,
79,
85,
10057,
355,
279,
85,... | 2.278859 | 2,209 |
"""PyZMQ and 0MQ version functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq.backend import zmq_version_info
VERSION_MAJOR = 16
VERSION_MINOR = 0
VERSION_PATCH = 4
VERSION_EXTRA = ""
__version__ = '%i.%i.%i' % (VERSION_MAJOR, VERSION_MINOR, VERSION_PAT... | [
37811,
20519,
57,
49215,
290,
657,
49215,
2196,
5499,
526,
15931,
198,
198,
2,
15069,
357,
34,
8,
9485,
57,
49215,
34152,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
628,
198,
6738,
1976,
76,
80,
13,
... | 2.437624 | 505 |
import json
import os
from tqdm import tqdm
def parse_book(book_data: dict) -> dict:
"""Parse book core data."""
info = {}
for param in ['isbn', 'title', 'onsale', 'price',
'language', 'pages', 'publisher']:
info[param] = book_data.get(param)
info['cover'] = f'https://images... | [
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
628,
198,
4299,
21136,
62,
2070,
7,
2070,
62,
7890,
25,
8633,
8,
4613,
8633,
25,
198,
220,
220,
220,
37227,
10044,
325,
1492,
4755,
1366,
526,
15... | 2.221837 | 1,731 |
#!/usr/bin/python3
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dis... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
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,
2,
... | 3.584775 | 289 |
import operator
import pytest
from nettlesome.terms import ContextRegister, DuplicateTermError
from nettlesome.terms import Explanation, TermSequence, means
from nettlesome.entities import Entity
from nettlesome.groups import FactorGroup
from nettlesome.predicates import Predicate
from nettlesome.quantities import Co... | [
11748,
10088,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
2010,
83,
829,
462,
13,
38707,
1330,
30532,
38804,
11,
49821,
5344,
40596,
12331,
198,
6738,
2010,
83,
829,
462,
13,
38707,
1330,
50125,
341,
11,
35118,
44015,
594,
11,
1724,
... | 3.64486 | 107 |
import _ast
import inspect
import re
import sys
import traceback
from . import closure_analyzer
from .code_emitter import CodeEmitter
DEBUG_CHECKS = True
BINOP_MAP = {
_ast.Add:"__add__",
_ast.Sub:"__sub__",
_ast.Mult:"__mul__",
_ast.BitOr:"__or__",
_ast.BitXor:"__xor__",
... | [
11748,
4808,
459,
198,
11748,
10104,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
198,
6738,
764,
1330,
16512,
62,
38200,
9107,
198,
6738,
764,
8189,
62,
368,
1967,
1330,
6127,
10161,
1967,
198,
198,
30531,
62,
5008... | 2.386863 | 4,141 |
import uuid
from sqlalchemy import Column, ForeignKey, String
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import relationship
from .base import Base
from .mixins import DateFieldsMixins
| [
11748,
334,
27112,
198,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
8708,
9218,
11,
10903,
198,
6738,
44161,
282,
26599,
13,
38969,
478,
82,
13,
7353,
34239,
13976,
1330,
471,
27586,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
2776,... | 3.55 | 60 |
# Copyright (c) 2017 The Khronos Group 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 agreed ... | [
2,
15069,
357,
66,
8,
2177,
383,
5311,
1313,
418,
4912,
3457,
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,
... | 2.405675 | 3,207 |
# Create dummy secrey key so we can use sessions
SECRET_KEY = '1234567890'
# Flask-Security config
SECURITY_URL_PREFIX = "/admin"
SECURITY_PASSWORD_HASH = "pbkdf2_sha256"
SECURITY_PASSWORD_SALT = "ATGUOHAELKiubahiughaerGOJAEGj"
SECURITY_USER_IDENTITY_ATTRIBUTES = ["name"]
# Flask-Security URLs, overridden because th... | [
2,
13610,
31548,
792,
4364,
1994,
523,
356,
460,
779,
10991,
198,
23683,
26087,
62,
20373,
796,
705,
10163,
2231,
30924,
3829,
6,
198,
198,
2,
46947,
12,
24074,
4566,
198,
23683,
4261,
9050,
62,
21886,
62,
47,
31688,
10426,
796,
12813... | 2.616541 | 266 |
"""Websocket API for mobile_app."""
import voluptuous as vol
from homeassistant.components.cloud import async_delete_cloudhook
from homeassistant.components.websocket_api import (
ActiveConnection,
async_register_command,
async_response,
error_message,
result_message,
websocket_command,
ws_... | [
37811,
1135,
1443,
5459,
7824,
329,
5175,
62,
1324,
526,
15931,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
198,
6738,
1363,
562,
10167,
13,
5589,
3906,
13,
17721,
1330,
30351,
62,
33678,
62,
17721,
25480,
198,
6738,
1363,
562,
10167... | 2.599588 | 1,456 |
#!/usr/bin/env python3
import pika
import time
import sys
import argparse
sys.path.append("lib")
from rabbitlock.mutex import Mutex
from rabbitlock.semaphore import Semaphore
# http://www.huyng.com/posts/python-performance-analysis/
parse_and_dispatch(sys.argv[1:])
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
279,
9232,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
198,
17597,
13,
6978,
13,
33295,
7203,
8019,
4943,
198,
6738,
22746,
5354,
13,
21973,
1069,
... | 2.808081 | 99 |
# Generated by Django 3.0.1 on 2020-01-02 02:40
import datetime
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
16,
319,
12131,
12,
486,
12,
2999,
7816,
25,
1821,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.972222 | 36 |
# --------------------------------------------------------
# TAFSSL
# Copyright (c) 2019 IBM Corp
# Licensed under The Apache-2.0 License [see LICENSE for details]
# --------------------------------------------------------
import numpy as np
from utils.proto_msp import ProtoMSP
import time
import pickle
from utils.mis... | [
2,
20368,
22369,
198,
2,
309,
8579,
31127,
198,
2,
15069,
357,
66,
8,
13130,
19764,
11421,
198,
2,
49962,
739,
383,
24843,
12,
17,
13,
15,
13789,
685,
3826,
38559,
24290,
329,
3307,
60,
198,
2,
20368,
22369,
198,
198,
11748,
299,
... | 3.455959 | 193 |
from .preprocess import * | [
6738,
764,
3866,
14681,
1330,
1635
] | 4.166667 | 6 |
#!/usr/bin/env python
# Returns obj_val function to be used in an optimizer
# A better and updated version of qaoa_obj.py
import networkx as nx
import numpy as np
# import matplotlib.pyplot as plt
from networkx.generators.classic import barbell_graph
import copy
import sys
import warnings
import qcommunity.modularit... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
16409,
26181,
62,
2100,
2163,
284,
307,
973,
287,
281,
6436,
7509,
198,
2,
317,
1365,
290,
6153,
2196,
286,
10662,
5488,
64,
62,
26801,
13,
9078,
198,
198,
11748,
3127,
87,
... | 2.284188 | 936 |
import cv2
from PIL import Image
import numpy as np
import random
import pytest
from ggb import GGB, CVLib
from ggb.testing import ggb_test
from ggb.testing import get_random_image, get_filled_image
@ggb_test
@ggb_test
if __name__ == '__main__':
pytest.main([__file__])
| [
11748,
269,
85,
17,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
12972,
9288,
198,
198,
6738,
308,
22296,
1330,
402,
4579,
11,
26196,
25835,
198,
6738,
308,
22296,
13,
33407,
1330,
... | 2.728155 | 103 |
# -*- coding: utf-8 -*-
"""
Tests `marc.marc_writer.py` module
"""
from contextlib import nullcontext as does_not_raise
import logging
import os
import pickle
from pymarc import Field, MARCReader, Record
import pytest
from nightshift import __title__, __version__
from nightshift.datastore import Resource
from nights... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
51,
3558,
4600,
3876,
66,
13,
3876,
66,
62,
16002,
13,
9078,
63,
8265,
198,
37811,
198,
6738,
4732,
8019,
1330,
9242,
22866,
355,
857,
62,
1662,
62,
... | 3.175439 | 114 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-02 18:17
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1485,
319,
2864,
12,
3312,
12,
2999,
1248,
25,
1558,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,... | 2.754386 | 57 |
#!/usr/bin/env python3
# coding = utf-8
import os
import unittest as ut
from mykit.wien2k.utils import get_casename, find_complex_file, get_default_r0, get_default_rmt, get_z
if __name__ == '__main__':
ut.main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
19617,
796,
3384,
69,
12,
23,
198,
198,
11748,
28686,
198,
11748,
555,
715,
395,
355,
3384,
198,
198,
6738,
616,
15813,
13,
86,
2013,
17,
74,
13,
26791,
1330,
651,
62,
34004... | 2.444444 | 90 |
from unittest import TestCase
from degiro_pit.config import Currency
from degiro_pit.nbp_api import NbpApi
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
3396,
7058,
62,
15544,
13,
11250,
1330,
20113,
198,
6738,
3396,
7058,
62,
15544,
13,
77,
46583,
62,
15042,
1330,
399,
46583,
32,
14415,
628
] | 3.114286 | 35 |
import copy
import json
import logging
import os
import time
from .rename import rename as rename_function
from django.apps import apps
from django.conf import settings
from django_rq import job
from mixmasta import mixmasta as mix
from utils.cache_helper import cache_get
# Load GADM3 from gadm app
if settings.CACHE... | [
11748,
4866,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
764,
918,
480,
1330,
36265,
355,
36265,
62,
8818,
198,
6738,
42625,
14208,
13,
18211,
1330,
6725,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 2.072336 | 2,834 |
from .sensation import Sensation
from .train import Train
| [
6738,
764,
82,
25742,
1330,
14173,
341,
198,
6738,
764,
27432,
1330,
220,
16835,
198
] | 3.933333 | 15 |
import marisa_trie
import os
import gzip
from collections import defaultdict
from nltk.tokenize import RegexpTokenizer
from cuttsum.srilm import Client
from itertools import izip
import string
from ..geo import GeoQuery
import numpy as np
import pandas as pd
from nltk.corpus import wordnet as wn
import re
... | [
11748,
1667,
9160,
62,
83,
5034,
198,
11748,
28686,
198,
11748,
308,
13344,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
797,
25636,
79,
30642,
7509,
198,
6738,
2005,
912,
388,
13,
82,
22379,
7... | 2.911504 | 113 |
import json
import os, errno
from typing import Dict
import numpy as np
import os
from sklearn.preprocessing import scale, minmax_scale
import logging
LOGGER = logging.getLogger(__name__)
def scale_features(input_folder: str, output_folder: str, op_conf: str, **kwargs):
"""
input_folder: folder which contain... | [
11748,
33918,
198,
11748,
28686,
11,
11454,
3919,
198,
6738,
19720,
1330,
360,
713,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
5046,
11,
949,
9806,
62,
9888,
198,
11748,
18931,
... | 1.819942 | 1,033 |
import time
from functools import reduce
import distogram
import utils
if __name__ == '__main__':
bench_merge()
| [
11748,
640,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
198,
11748,
1233,
21857,
198,
11748,
3384,
4487,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
7624,
62,
647,
469,
3419,
198
] | 2.926829 | 41 |
# -*- coding: utf-8 -*-
# /!\/!\/!\/!\/!\/!\/!\/!\
# Note that this is just a sample code
# You need to add this file in __init__.py
# /!\/!\/!\/!\/!\/!\/!\/!\
from odoo import exceptions, models
from odoo.http import request
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
1220,
0,
11139,
0,
11139,
0,
11139,
0,
11139,
0,
11139,
0,
11139,
0,
11139,
0,
59,
198,
2,
5740,
326,
428,
318,
655,
257,
6291,
2438,
198,
2,
921,
761,
2... | 2.43617 | 94 |
F = fib(10) # 运行到这里没有任何反映
# print(next(F))
for i in F:
print(i)
"""
yield:
1. 保存运行状态-断点, 暂停执行将生成器挂起
2. 将yield后面表达式的值, 作为返回值返回
"""
# 使用yield实现协程
import time
if __name__ == '__main__':
main()
| [
201,
198,
201,
198,
37,
796,
12900,
7,
940,
8,
220,
1303,
5525,
123,
238,
26193,
234,
26344,
108,
32573,
247,
34932,
234,
162,
110,
94,
17312,
231,
20015,
119,
19526,
243,
20998,
235,
23626,
254,
201,
198,
2,
3601,
7,
19545,
7,
37... | 1.050228 | 219 |
import os
import json
import cv2
import numpy as np
import matplotlib.pyplot as plt
import torch
if __name__ == "__main__":
# json file contains the test images
test_json_path = './test.json'
# the folder to output density map and flow maps
output_folder = './plot'
with open(test_json_path, 'r')... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
28034,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
... | 2.097701 | 522 |
from torch import nn
from fairseq.modules import TransformerEncoderLayer, TransformerDecoderLayer
class Perceptron(nn.Module):
"""
1. 是否激活 通过是否有激活层来控制,最后一层都没有激活层
"""
class LogisticModel(nn.Module):
""" 两层感知机 """
def __init__(self, args, activation=None, dropout=0.1, contain_normalize=False, *... | [
6738,
28034,
1330,
299,
77,
198,
198,
6738,
3148,
41068,
13,
18170,
1330,
3602,
16354,
27195,
12342,
49925,
11,
3602,
16354,
10707,
12342,
49925,
628,
198,
198,
4871,
2448,
984,
1313,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227... | 1.829741 | 464 |
# -*- coding: utf-8 -*-
""" flatten a 2 dimensional list into a 1 dimension list
by joining column items in a row into one item as single comma-separated string
This is useful for preparing data for a CSV writer function which requires a 1-dimensional list of rows with no columns
Alternatively, the join functional can... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
27172,
268,
257,
362,
38517,
1351,
656,
257,
352,
15793,
1351,
198,
1525,
9679,
5721,
3709,
287,
257,
5752,
656,
530,
2378,
355,
2060,
39650,
12,
25512,
515,
4731... | 3.147368 | 190 |
from __future__ import print_function, division
from collections import OrderedDict as OD
import itertools
import os
import unittest
from astropy.io import fits # FITS file I/O
from astropy.table import Table # Used in converting to pandas DataFrame
import numpy as np
import pandas as pd
import NebulaBayes
from Neb... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
355,
31245,
198,
11748,
340,
861,
10141,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
6468,
28338,
13,
952,
1330,
... | 2.308802 | 13,724 |
"""
spider.distance.metricl.rfd sub-package
__init.py__
@author: david johnson
Primitive that learns and applies random-forest-based distance metric.
defines the module index
"""
from .rfd import RFD
| [
37811,
198,
220,
220,
220,
19230,
13,
30246,
13,
4164,
1173,
75,
13,
81,
16344,
850,
12,
26495,
198,
220,
220,
220,
11593,
15003,
13,
9078,
834,
628,
220,
220,
220,
2488,
9800,
25,
21970,
45610,
1559,
628,
220,
220,
220,
11460,
1800... | 2.986667 | 75 |
import pygame, sys
from pygame.locals import *
# Aclaraciones
# Requiere "pygame" para las graficas
#
# Se grafican las figuras para una mejor comprencion pero como son coordenadas tan pequenas no se muestran bien
# (aumentando las proporciones pude verse mejo)
# pero la orden del problema no lo permite.
#
... | [
11748,
12972,
6057,
11,
25064,
201,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
201,
198,
201,
198,
2,
317,
565,
283,
49443,
274,
201,
198,
2,
9394,
13235,
366,
9078,
6057,
1,
31215,
39990,
7933,
69,
44645,
201,
198,
2,
201,... | 1.823529 | 2,210 |
#!/usr/bin/env python
import os
import sys
import json
from argparse import ArgumentParser
from mglib import obj_from_url, tab_to_matrix, AUTH_LIST, API_URL, biom_to_matrix, VERSION
prehelp = """
NAME
mg-compare-heatmap
VERSION
%s
SYNOPSIS
mg-compare-heatmap [ --help, --input <input file or stdin>, --ou... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
33918,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
285,
4743,
571,
1330,
26181,
62,
6738,
62,
6371,
11,
7400,
62,
1462,
62,
... | 2.866817 | 443 |
import settings
import cv2
from VideoTypes import imageframe, standardredditformat
import generatemovie
import generatorclient
import datetime
import os
import shutil
import videouploader
import random
import pickle
from time import sleep
videoscripts = []
| [
11748,
6460,
201,
198,
11748,
269,
85,
17,
201,
198,
6738,
7623,
31431,
1330,
2939,
14535,
11,
3210,
10748,
18982,
201,
198,
11748,
1152,
23900,
10739,
201,
198,
11748,
17301,
16366,
201,
198,
11748,
4818,
8079,
201,
198,
11748,
28686,
... | 3.309524 | 84 |
from tkinter import *
from main_window import MainWindow
if __name__ == "__main__":
root = Tk()
root.columnconfigure(0, weight=1)
root.columnconfigure(2, weight=1)
root.rowconfigure(0, weight=1)
m = MainWindow(root)
root.mainloop()
| [
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
1388,
62,
17497,
1330,
8774,
27703,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
6808,
796,
309,
74,
3419,
198,
220,
220,
220,
6808,
13,
28665,
11... | 2.480769 | 104 |
# -*- coding: utf-8 -*-
"""Read and write parameters, results and metadata to the 'sim_db' database."""
# Copyright (C) 2017-2019 Håkon Austlid Taskén <hakon.tasken@gmail.com>
# Licenced under the MIT License.
import sim_db.src_command_line_tool.commands.helpers as helpers
import sqlite3
import argparse
import subproc... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
5569,
290,
3551,
10007,
11,
2482,
290,
20150,
284,
262,
705,
14323,
62,
9945,
6,
6831,
526,
15931,
198,
2,
15069,
357,
34,
8,
2177,
12,
23344,
367,
29090,
74,
... | 2.209911 | 7,184 |
from tensorflow.python.keras.models import Input, Model
from tensorflow.python.keras.layers import Dense, Reshape, Activation, Conv2D, Conv2DTranspose
from tensorflow.python.keras.layers import BatchNormalization, Add, Embedding, Concatenate
import numpy as np
import tensorflow as tf
from tensorflow.python.keras impor... | [
6738,
11192,
273,
11125,
13,
29412,
13,
6122,
292,
13,
27530,
1330,
23412,
11,
9104,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
6122,
292,
13,
75,
6962,
1330,
360,
1072,
11,
1874,
71,
1758,
11,
13144,
341,
11,
34872,
17,
35,
11,
... | 3.194915 | 236 |
# Copyright 2017 LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
import os
from fossor.checks.check import Check
class LoadAvg(Check):
'''this Check will compare the current load average summaries against the count of ... | [
2,
15069,
2177,
27133,
10501,
13,
1439,
2489,
10395,
13,
49962,
739,
262,
347,
10305,
12,
17,
28081,
5964,
13,
198,
2,
4091,
38559,
24290,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
198,
11748,
28686,
198,
6738,
10967,
273,
13,
... | 3.618321 | 131 |
from requests import HTTPError
from urllib.parse import parse_qs
from requests.exceptions import ConnectTimeout, ReadTimeout
import pytest
import requests_mock
from app.clients.sms.firetext import get_firetext_responses, SmsClientResponseException, FiretextClientResponseException
| [
6738,
7007,
1330,
14626,
12331,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
21136,
62,
48382,
198,
6738,
7007,
13,
1069,
11755,
1330,
8113,
48031,
11,
4149,
48031,
198,
198,
11748,
12972,
9288,
198,
11748,
7007,
62,
76,
735,
198,
198,
... | 3.769231 | 78 |
import random
# names = ['Alex', 'Beth', 'Carol', 'Dave', 'Kim', 'Sam', 'Heather', 'Hank']
# students_scores = {student:random.randint(1, 100) for student in names}
# passed_students = {student:score for (student, score) in students_scores.items() if score > 59}
# print(students_scores)
# print(passed_students)
... | [
11748,
4738,
201,
198,
201,
198,
2,
3891,
796,
37250,
15309,
3256,
705,
33,
2788,
3256,
705,
9914,
349,
3256,
705,
27984,
3256,
705,
26374,
3256,
705,
16305,
3256,
705,
1544,
1032,
3256,
705,
39,
962,
20520,
201,
198,
2,
2444,
62,
1... | 2.386588 | 507 |
import pyeccodes.accessors as _
| [
11748,
279,
5948,
535,
4147,
13,
15526,
669,
355,
4808,
628
] | 3 | 11 |
"""Prepare OpenGL commands for use in templates."""
from enum import auto, Enum
from typing import Iterable, Mapping, Optional, Union
import attr
from gladiator.parse.command import Command, Type
from gladiator.prepare.enum import PreparedEnum
from gladiator.prepare.style import transform_symbol
from gladiator.optio... | [
37811,
37534,
533,
30672,
9729,
329,
779,
287,
24019,
526,
15931,
198,
198,
6738,
33829,
1330,
8295,
11,
2039,
388,
198,
6738,
19720,
1330,
40806,
540,
11,
337,
5912,
11,
32233,
11,
4479,
198,
198,
11748,
708,
81,
198,
198,
6738,
1278... | 2.787425 | 668 |
"""
This file contains all the functions used in the notebooks
under the Binary Quadratic Model section.
Prepared by Akash Narayanan B
"""
from dimod import BinaryQuadraticModel
# Task 3
linear = {'x1': 3, 'x2': -1, 'x3': 10, 'x4': 7}
quadratic = {('x1', 'x2'): 2, ('x1', 'x3'): -5, ('x2', 'x3'): 3, ('x3', 'x4'): 11... | [
37811,
198,
1212,
2393,
4909,
477,
262,
5499,
973,
287,
262,
43935,
220,
198,
4625,
262,
45755,
20648,
81,
1512,
9104,
2665,
13,
198,
198,
6719,
29190,
416,
9084,
1077,
13596,
22931,
272,
347,
198,
37811,
198,
6738,
5391,
375,
1330,
4... | 2.40411 | 146 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-09-22 13:19
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
23,
319,
2177,
12,
2931,
12,
1828,
1511,
25,
1129,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
"""
ScanObjectNN download: http://103.24.77.34/scanobjectnn/h5_files.zip
"""
import os
import sys
import glob
import h5py
import numpy as np
from torch.utils.data import Dataset
os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
if __name__ == '__main__':
train = ScanObjectNN(1024)
test = ScanObjectNN(1024, ... | [
37811,
198,
33351,
10267,
6144,
4321,
25,
2638,
1378,
15197,
13,
1731,
13,
3324,
13,
2682,
14,
35836,
15252,
20471,
14,
71,
20,
62,
16624,
13,
13344,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
15095,
198,
11748,
... | 2.484663 | 163 |
default_app_config = "sgi.recursos_humanos.apps.RecursosHumanosConfig"
| [
12286,
62,
1324,
62,
11250,
796,
366,
82,
12397,
13,
8344,
1834,
418,
62,
10734,
418,
13,
18211,
13,
6690,
1834,
418,
20490,
418,
16934,
1,
198
] | 2.62963 | 27 |
import re
import hashlib
import time
import StringIO
__version__ = '0.8'
#GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
GNTP_INFO_LINE = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
' (?P<encryptionAlgor... | [
11748,
302,
198,
11748,
12234,
8019,
198,
11748,
640,
198,
11748,
10903,
9399,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
23,
6,
198,
198,
2,
16630,
7250,
14,
27,
9641,
29,
1279,
37348,
363,
2963,
431,
29,
1279,
12685,
13168,
2348,... | 2.707618 | 4,135 |
from .backend import *
from .commands import *
check_config()
if not DB_PATH.is_file():
init_db()
init_firewall()
| [
6738,
764,
1891,
437,
1330,
1635,
198,
6738,
764,
9503,
1746,
1330,
1635,
198,
198,
9122,
62,
11250,
3419,
198,
198,
361,
407,
20137,
62,
34219,
13,
271,
62,
7753,
33529,
198,
220,
220,
220,
2315,
62,
9945,
3419,
198,
220,
220,
220,... | 2.530612 | 49 |
"""Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... | [
37811,
15269,
33160,
3012,
11419,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
743,
7330,
... | 2.190071 | 1,410 |
import json
import numpy as np
import pandas as pd
from sklearn.externals import joblib
from bld.project_paths import project_paths_join as ppj
# This list is ordered according to the item table in our paper.
PERCEIVED_CONTROL = [
"LOC_LIFES_COURSE",
"LOC_ACHIEVED_DESERVE",
"LOC_LUCK",
"LOC_OTHERS",... | [
11748,
33918,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
1069,
759,
874,
1330,
1693,
8019,
198,
198,
6738,
275,
335,
13,
16302,
62,
6978,
82,
1330,
1628,
62,
6978,
82,
... | 2.263204 | 1,136 |
import os
import sys
import time
import shutil
import argparse
import traceback
import subprocess
from . import __version__
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4423,
346,
198,
11748,
1822,
29572,
198,
11748,
12854,
1891,
198,
11748,
850,
14681,
198,
6738,
764,
1330,
11593,
9641,
834,
628
] | 3.90625 | 32 |
import os
import json
import shlex
from .cli_bash_operator import CliBashOperator
from ..config import OPEN_BUS_PIPELINES_ROOTDIR
| [
11748,
28686,
198,
11748,
33918,
198,
11748,
427,
2588,
198,
198,
6738,
764,
44506,
62,
41757,
62,
46616,
1330,
1012,
72,
33,
1077,
18843,
1352,
198,
6738,
11485,
11250,
1330,
38303,
62,
45346,
62,
47,
4061,
3698,
1268,
1546,
62,
13252,... | 3 | 44 |
#!/usr/bin/env python
# _*_ coding: utf-8 _*_
__author__: 'Patrick Wang'
__date__: '2019/2/28 14:52'
from scrapy.cmdline import execute
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# execute(["scrapy", "crawl", "jobbole"])
execute(["scrapy", "crawl", "zhihu"])
# execute(["scrapy"... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
834,
9800,
834,
25,
705,
32718,
15233,
6,
198,
834,
4475,
834,
25,
705,
23344,
14,
17,
14,
2078,
1478,
25,
4309,
... | 2.368056 | 144 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | [
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,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.697095 | 241 |
from os import remove
import shlex
from os.path import isfile, join, split, splitext
from prody.tests import TestCase, skipIf, skipUnless
from numpy.testing import *
try:
import numpy.testing.decorators as dec
except ImportError:
from numpy.testing import dec
from prody.tests.datafiles import TEMPDIR, pathDat... | [
6738,
28686,
1330,
4781,
198,
11748,
427,
2588,
198,
6738,
28686,
13,
6978,
1330,
318,
7753,
11,
4654,
11,
6626,
11,
4328,
578,
742,
198,
6738,
386,
9892,
13,
41989,
1330,
6208,
20448,
11,
14267,
1532,
11,
14267,
28042,
198,
198,
6738... | 3.065693 | 137 |
from __future__ import absolute_import
from datetime import datetime
import factory
from . import models
from talks.users.models import Collection, CollectionItem, CollectedDepartment
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
8860,
198,
198,
6738,
764,
1330,
4981,
198,
6738,
6130,
13,
18417,
13,
27530,
1330,
12251,
11,
12251,
7449,
11,
9745,
276,
36261,
... | 4.266667 | 45 |
from __future__ import unicode_literals
from django.apps import AppConfig
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.619048 | 21 |
#!/usr/bin/env python3
#
# setup.py
# From the stagger project: http://code.google.com/p/stagger/
#
# Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
9058,
13,
9078,
198,
2,
3574,
262,
20778,
1628,
25,
2638,
1378,
8189,
13,
13297,
13,
785,
14,
79,
14,
301,
7928,
14,
198,
2,
198,
2,
15069,
357,
66,
8,
3717,
12,... | 3.11071 | 831 |
#!/usr/bin/env python3
"""Calculate the value of pi using multiprocessing in Python"""
from datetime import datetime
from multiprocessing import Pool
import os
from sys import argv
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
9771,
3129,
378,
262,
1988,
286,
31028,
1262,
18540,
305,
919,
278,
287,
11361,
37811,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
18540,
305,
919,
278,
1330,
1... | 3.15493 | 71 |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33448,
383,
309,
22854,
37535,
16092,
292,
1039,
46665,
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,
77... | 2.388776 | 1,479 |
import sys
from ujson import loads, dumps
for line in sys.stdin:
obj = loads(line)
sys.stdout.write(dumps(obj['actor']))
sys.stdout.write('\n')
| [
11748,
25064,
198,
6738,
334,
17752,
1330,
15989,
11,
45514,
198,
198,
1640,
1627,
287,
25064,
13,
19282,
259,
25,
198,
220,
220,
220,
26181,
796,
15989,
7,
1370,
8,
198,
220,
220,
220,
25064,
13,
19282,
448,
13,
13564,
7,
67,
8142,... | 2.446154 | 65 |
from azure.storage.queue import (
QueueClient,
TextBase64EncodePolicy,
TextBase64DecodePolicy
)
import os, uuid, time, json
import mysql.connector
from datetime import datetime
connect_str = "DefaultEndpointsProtocol=https;AccountName=replace;AccountKey=replacewithyours;EndpointSuffix=core.win... | [
6738,
35560,
495,
13,
35350,
13,
36560,
1330,
357,
198,
220,
220,
220,
220,
220,
220,
220,
4670,
518,
11792,
11,
198,
220,
220,
220,
220,
220,
220,
220,
8255,
14881,
2414,
4834,
8189,
36727,
11,
198,
220,
220,
220,
220,
220,
220,
... | 2.714715 | 333 |
from .controllers.twitter import search | [
6738,
764,
3642,
36667,
13,
6956,
1330,
2989
] | 4.875 | 8 |
while True:
try:
print("a")
finally:
continue | [
4514,
6407,
25,
198,
220,
1949,
25,
198,
220,
220,
220,
3601,
7203,
64,
4943,
198,
220,
3443,
25,
198,
220,
220,
220,
2555
] | 2.375 | 24 |
import copy
if __name__ == '__main__':
epss = np.logspace(-10, -1, 30)
baseline_objective = augmented_objective(x0)
xis = []
for eps in epss:
xi = copy.copy(x0)
xi[4] += eps
xis.append(xi)
objs = [augmented_objective(xi) for xi in xis]
# pool = mp.Pool(mp.cpu_count())
... | [
11748,
4866,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2462,
824,
796,
45941,
13,
6404,
13200,
32590,
940,
11,
532,
16,
11,
1542,
8,
198,
220,
220,
220,
14805,
62,
15252,
425,
796,
30259... | 2 | 291 |
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
import logging
from django.db import models
from django.utils.translation import ugettext_lazy as _
from awx.main.fields import JSONBField
__all__ = ('Fact',)
logger = logging.getLogger('awx.main.models.fact')
class Fact(models.Model):
"""A model repr... | [
2,
15069,
357,
66,
8,
1584,
28038,
856,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
198,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
6... | 2.776596 | 376 |
# import multiprocessing
pidfile = 'flask_app.pid'
workers = 2
# workers = multiprocessing.cpu_count() * 2 + 1
bind = '0.0.0.0:80'
accesslog = './logs/access.log'
errorlog = './logs/error.log'
#certfile = './certs/local.cer'
#keyfile = './certs/local.key'
# user = 'ubuntu'
# group = 'ubuntu' | [
2,
1330,
18540,
305,
919,
278,
198,
198,
35317,
7753,
796,
705,
2704,
2093,
62,
1324,
13,
35317,
6,
198,
22896,
796,
362,
198,
2,
3259,
796,
18540,
305,
919,
278,
13,
36166,
62,
9127,
3419,
1635,
362,
1343,
352,
198,
21653,
796,
7... | 2.401639 | 122 |
from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from django.db.models.functions import Length
from user.models import User
from discussion.models import Thread
import uuid
from utils.siftscience import decisions_api, events_api
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12543,
2733,
1330,
22313,
19... | 3.805195 | 77 |
#
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
198,
2,
15069,
2864,
30437,
21980,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
19... | 1.901993 | 6,020 |
from .custom import *
@DATASETS.register_module(force=True) | [
6738,
764,
23144,
1330,
1635,
198,
198,
31,
35,
1404,
1921,
32716,
13,
30238,
62,
21412,
7,
3174,
28,
17821,
8
] | 2.857143 | 21 |
import os
from utilidades.consola import *
from CriptografiaModerna.menuCM import menuCM
from CriptografiaClasica.menuCC import menuCC
#DEFINICIÓN DE VARIABLES
#DEFINICIÓN DE FUNCIONES
limpiarPantalla()
iniciarMenu()
despedida()
input('')
limpiarPantalla() | [
11748,
28686,
201,
198,
6738,
7736,
312,
2367,
13,
5936,
5708,
1330,
1635,
201,
198,
6738,
327,
1968,
519,
32188,
544,
31439,
64,
13,
26272,
24187,
1330,
6859,
24187,
201,
198,
6738,
327,
1968,
519,
32188,
544,
2601,
292,
3970,
13,
26... | 2.243902 | 123 |
#!/usr/bin/env python
# coding=utf-8
# Stan 2012-03-12
from __future__ import (division, absolute_import,
print_function, unicode_literals)
import sys
import os
import logging
from importlib import import_module
from .core.types23 import *
from .core.db import getDbUri, openDbUri
from .core.r... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
2,
7299,
2321,
12,
3070,
12,
1065,
198,
198,
6738,
11593,
37443,
834,
1330,
357,
21426,
11,
4112,
62,
11748,
11,
198,
220,
220,
220,
220,
220,
220... | 2.97561 | 164 |
##############################################################################
##############################################################################
##############################################################################
###################################################... | [
198,
29113,
29113,
7804,
4242,
2235,
628,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
29113,
29113,
7804,
4242,
2235,
198,
220,
220,
220,
220,
198,
29113,
29113,
7804,
4242,
2235,
628,
220,
220,
220,
220,
220,
220,
220,
220,
1... | 6.444444 | 54 |
import torch.utils.data as data
from PIL import Image
import os
import os.path
import random
def _make_dataset(dir):
"""
Creates a 2D list of all the frames in N clips containing
M frames each.
2D List Structure:
[[frame00, frame01,...frameM] <-- clip0
[frame00, frame01,...frameM] <-- clip... | [
11748,
28034,
13,
26791,
13,
7890,
355,
1366,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
4738,
628,
198,
4299,
4808,
15883,
62,
19608,
292,
316,
7,
15908,
2599,
198,
220,
220,
220,
37... | 2.183961 | 8,953 |
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
| [
6738,
19720,
1330,
32233,
198,
6738,
10214,
420,
382,
13,
16366,
1330,
7308,
11792,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
10214,
420,
382,
13,
79,
363,
4559,
1330,
31525,
20900,
198,
6738,
10214,
420,
382,
13,
10247,
2676,
1330,
... | 4 | 54 |
# -*- coding: utf-8 -*-
__author__ = "R. Bauer"
__copyright__ = "MedPhyDO - Machbarkeitsstudien des Instituts für Medizinische Strahlenphysik und Strahlenschutz am Klinikum Dortmund im Rahmen von Bachelor und Masterarbeiten an der TU-Dortmund / FH-Dortmund"
__credits__ = ["R.Bauer", "K.Loot"]
__license__ = "MIT"
__ver... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
49,
13,
41971,
1,
198,
834,
22163,
4766,
834,
796,
366,
9921,
2725,
88,
18227,
532,
7080,
5657,
365,
896,
19149,
2013,
748,
37931,
5500,... | 1.882654 | 13,473 |
#!/usr/bin/env python
## evoware/py -- python modules for Evoware scripting
## Copyright 2014 - 2019 Raik Gruenberg
##
## 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
##
## ht... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2235,
220,
819,
322,
533,
14,
9078,
1377,
21015,
13103,
329,
4319,
322,
533,
36883,
198,
2235,
220,
220,
15069,
1946,
532,
13130,
7567,
1134,
25665,
23140,
198,
2235,
198,
2235,
220,
2... | 2.726651 | 439 |
# test.py
# a list of attributes a component should have for sure
basic = [
'merit_tag',
'styling',
'dof',
'lower',
'upper',
'lifetime',
'capex',
'opex',
'variable_cost',
'variable_income',
]
power_control = [
'positive',
'negative',
]
| [
2,
1332,
13,
9078,
198,
198,
2,
257,
1351,
286,
12608,
257,
7515,
815,
423,
329,
1654,
198,
35487,
796,
685,
198,
220,
220,
220,
705,
647,
270,
62,
12985,
3256,
198,
220,
220,
220,
705,
34365,
1359,
3256,
198,
220,
220,
220,
705,
... | 2.224806 | 129 |
import tensorflow as tf
#from tensorflow import keras
#from tensorflow.keras import backend as K
import numpy as np
#import matplotlib.pyplot as plt
from time import sleep
#=======================================================================================#
class SOMLayer(tf.keras.layers.Layer):
"""
Self-... | [
11748,
11192,
273,
11125,
355,
48700,
198,
2,
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
2,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
30203,
355,
509,
198,
11748,
299,
32152,
355,
45941,
198,
2,
11748,
2603,
29487,
8019,
13,
... | 2.699634 | 546 |
# 034_Aumentos_multiplos.py
print()
salario = float(input("Salário atual: R$"))
print()
# if (salario <= 1250):
# salario *= 1.15 # -> salario = salario * 1.15
# else:
# salario *= 1.10 # -> salario = salario * 1.10
salario = salario * 1.15 if salario<= 1250 else salario * 1.10
print(f"Seu novo salário será:... | [
2,
657,
2682,
62,
32,
1713,
418,
62,
47945,
418,
13,
9078,
198,
198,
4798,
3419,
198,
21680,
4982,
796,
12178,
7,
15414,
7203,
19221,
6557,
27250,
379,
723,
25,
371,
3,
48774,
198,
4798,
3419,
198,
2,
611,
357,
21680,
4982,
19841,
... | 2.269737 | 152 |
#
# Copyright 2020 Two Sigma Open Source, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | [
2,
198,
2,
15069,
12131,
4930,
31669,
4946,
8090,
11,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
1... | 3.631068 | 206 |
from collections import defaultdict
import numpy as np
r, c, k = map(int, input().split())
items = np.zeros((r, c), np.int32)
for _ in range(k):
y, x, v = map(int, input().split())
items[y - 1, x - 1] = v
dp = np.zeros((r, c, 4), np.int64)
for y in range(r):
for x in range(c):
dp[y, x, 0] = max(... | [
6738,
17268,
1330,
4277,
11600,
198,
11748,
299,
32152,
355,
45941,
198,
198,
81,
11,
269,
11,
479,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
23814,
796,
45941,
13,
9107,
418,
19510,
81,
11,
269,
828,
45941,
13,
600,
26... | 1.773243 | 441 |
#!/usr/bin/python2 -utt
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import numpy as np
import sys
import os
import time
from PIL import Image
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import torch.optim as optim
from tqdm import tqdm
import math
import torch.nn.functional ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
17,
532,
15318,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2506... | 2.585859 | 594 |
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2020 all rights reserved
#
# externals
import os
# superclass
from .String import String
# declaration
class EnvVar(String):
"""
A type declarator for strings whose default values are associated with an environment variable
"""
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
285,
40302,
257,
13,
70,
13,
257,
26884,
85,
6557,
89,
271,
198,
2,
29617,
39795,
198,
2,
357,
66,
8,
7795,
12,
42334,
477,
2489,
10395,
198,
2,
628,
... | 2.836735 | 147 |
from ..share.cal import parse_abs_from_rel_date
from .streams import Stream
__all__ = ["load_stream"]
def load_stream(
programme="Today",
station="r4",
broadcaster="bbc",
ymd=None,
ymd_ago=None,
**stream_opts,
):
"""
Create a `Stream` for a specific episode of a radio programme from t... | [
6738,
11485,
20077,
13,
9948,
1330,
21136,
62,
8937,
62,
6738,
62,
2411,
62,
4475,
198,
6738,
764,
5532,
82,
1330,
13860,
198,
198,
834,
439,
834,
796,
14631,
2220,
62,
5532,
8973,
628,
198,
4299,
3440,
62,
5532,
7,
198,
220,
220,
... | 2.818557 | 485 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
26171,
198,
2,
198,
2,
220,
220,
15069,
33160,
3254,
652,
13077,
198,
2,
220,
220,
15069,
2864,
12,
1238,
2481,
376,
7569,
13,
20185,
15302,
198,
2,
198,
2... | 2.337302 | 2,772 |
import numpy as np
import matplotlib.pyplot as plt
import sys
S = read_instance(sys.argv[1])
plt.hist(S.flatten(), bins=np.linspace(0, 1, 200))
plt.title("Histogram of similarity values")
plt.xlabel("Similarity")
plt.ylabel("Frequency")
plt.savefig(sys.argv[1]+"_viz2.pdf", dpi=400)
plt.close()
n = len(S)
x = np.arang... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
198,
50,
796,
1100,
62,
39098,
7,
17597,
13,
853,
85,
58,
16,
12962,
198,
489,
83,
13,
10034,
7,
50,
13,
2704,
41... | 2 | 293 |
import logging
import os
import sys
cwd = os.getcwd()
if cwd not in sys.path:
sys.path.append( cwd )
new_path = [ os.path.join( cwd, "lib" ) ]
if new_path not in sys.path:
new_path.extend( sys.path )
sys.path = new_path
from galaxy.util import parse_xml
log = logging.getLogger(__name__)
# Set a 10 minu... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
66,
16993,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
361,
269,
16993,
407,
287,
25064,
13,
6978,
25,
198,
220,
220,
220,
25064,
13,
6978,
13,
33295,
7,
269,
16993,
1267,
... | 1.894531 | 2,560 |
largura = float(input('Qual a largura da parede em metros? '))
altura = float(input('Qual a altura da parede em metros? '))
area = largura * altura
print(f'A área dessa parede é: {area}m². ')
tinta = area / 2
print(f'Será usado {tinta}L de tinta para cada metro quadrado.') | [
15521,
5330,
796,
12178,
7,
15414,
10786,
46181,
257,
2552,
5330,
12379,
279,
1144,
68,
795,
1138,
4951,
30,
705,
4008,
198,
2501,
5330,
796,
12178,
7,
15414,
10786,
46181,
257,
5988,
5330,
12379,
279,
1144,
68,
795,
1138,
4951,
30,
7... | 2.481818 | 110 |
from django.db import models
class Profile(models.Model):
"""Profile model."""
user = models.OneToOneField('user.User', on_delete=models.CASCADE)
picture = models.ImageField(
'profile picture',
upload_to='user/pictures/',
blank=True,
null=True
)
biography = models... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198,
4871,
13118,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
37046,
2746,
526,
15931,
628,
220,
220,
220,
2836,
796,
4981,
13,
3198,
2514,
3198,
15878,
10786,
7220,
13,
12982,
... | 2.642857 | 182 |
def resolve():
'''
code here
求めるものは
k番目のボールを除いた N−1個のボールから、書かれている整数が等しいような異なる2つのボールを選び出す方法
言い換えて
①同じ数から2個選ぶ組み合わせの和
②k番目のボールを除いた N−1個のボールから、K番目のボールと同じ数を選ぶ数
※選ぶボールとペアになっていた個数を数え上げて引く
①-②
'''
import collections
N = int(input())
A_list = [int(item) for ite... | [
4299,
10568,
33529,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
2438,
994,
628,
220,
220,
220,
10545,
109,
224,
1792,
223,
25748,
43266,
5641,
31676,
198,
220,
220,
220,
220,
5099,
222,
74,
45911,
103,
33566,
106,
5641,
1209,
... | 1.324895 | 474 |
import os
import pandas as pd
def runtime_input_folder(scenario, datasheet_name):
"""
Creates a SyncroSim Datasheet input folder.
Parameters
----------
scenario : Scenario
Scenario class instance.
datasheet_name : String
Name of SyncroSim Datasheet.
Returns
-------
... | [
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
4299,
19124,
62,
15414,
62,
43551,
7,
1416,
39055,
11,
19395,
25473,
62,
3672,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7921,
274,
257,
35908,
305,
8890,
16092,... | 2.525027 | 1,878 |
#! /usr/bin/env python3
# The MIT License (MIT)
#
# Copyright(c) 2021, Damien Feneyrou <dfeneyrou@gmail.com>
#
# 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 w... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
7,
66,
8,
33448,
11,
46107,
376,
1734,
88,
472,
1279,
7568,
1734,
88,
472,
31,
14816,
13,
785,
29,
198,
2... | 2.776642 | 1,370 |
# Generated by Django 3.2.3 on 2021-05-28 10:52
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
18,
319,
33448,
12,
2713,
12,
2078,
838,
25,
4309,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
s = input()
m, n = s.split(" ")
m = int(m)
n = int(n)
for ri in range(m):
for ci in range(n):
v = ( ri + 1 ) * ( ci + 1 )
print(v, end=" ")
print()
| [
82,
796,
5128,
3419,
198,
76,
11,
299,
796,
264,
13,
35312,
7203,
366,
8,
198,
76,
796,
493,
7,
76,
8,
198,
77,
796,
493,
7,
77,
8,
198,
198,
1640,
374,
72,
287,
2837,
7,
76,
2599,
198,
220,
220,
220,
329,
269,
72,
287,
28... | 1.793814 | 97 |
# !/usr/bin/python
# _ _ ____ _ _ ____ _ _ _
# | | (_) ___ ___ _ __ ___ ___ | _ \| | __ _| |_ ___ | _ \ ___ ___ ___ __ _ _ __ (_) |_(_) ___ _ __
# | | | |/ __/ _ \ '_ \/ __|/ _ \ | |_) | |/ _` | __/ _ \ | |_) / _ \/ __/ _ \ / _` | ... | [
2,
5145,
14,
14629,
14,
8800,
14,
29412,
198,
2,
220,
4808,
220,
220,
220,
220,
4808,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1427,
... | 1.958209 | 670 |