content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""
Reverse Polish Notation(RPN) is a mathematical notation where every operator follows all of its operands. For instance,
to add three and four, one would write "3 4 +" rather than "3 + 4". If there are multiple operations, the operator is
given immediately after its second operand; so the expression written "3 ? 4 +... | [
37811,
198,
49,
964,
325,
15945,
1892,
341,
7,
49,
13137,
8,
318,
257,
18069,
33274,
810,
790,
10088,
5679,
477,
286,
663,
1515,
1746,
13,
1114,
4554,
11,
198,
1462,
751,
1115,
290,
1440,
11,
530,
561,
3551,
366,
18,
604,
1343,
1,... | 2.695568 | 519 |
from corehq.util.urlvalidate.urlvalidate import (
PossibleSSRFAttempt,
validate_user_input_url,
)
from corehq.apps.sms.models import SMSBase
from corehq.util.metrics import metrics_counter
| [
6738,
4755,
71,
80,
13,
22602,
13,
6371,
12102,
378,
13,
6371,
12102,
378,
1330,
357,
198,
220,
220,
220,
33671,
5432,
49,
7708,
926,
1791,
11,
198,
220,
220,
220,
26571,
62,
7220,
62,
15414,
62,
6371,
11,
198,
8,
198,
198,
6738,
... | 2.739726 | 73 |
# Origins Project Choice Lists, Vocabularies, Ontologies
# choice lists and vocabularies are defined with the following design template:
# variable_label1 = value # variable_labels are lowercase, values can be strings or numbers or codes
# variable_label2 = value
# CHOICES = (
# (variable_label1, 'string_represent... | [
2,
24079,
4935,
18502,
44968,
11,
47208,
397,
934,
444,
11,
9463,
5823,
198,
2,
3572,
8341,
290,
12776,
397,
934,
444,
389,
5447,
351,
262,
1708,
1486,
11055,
25,
198,
198,
2,
7885,
62,
18242,
16,
796,
1988,
220,
220,
1303,
7885,
... | 3.23758 | 1,570 |
if last_question[bot.message.chat_id] == '%block_name%' and not got_answer:
%get_answer%
%next_blocks%
got_answer = True
| [
220,
220,
220,
611,
938,
62,
25652,
58,
13645,
13,
20500,
13,
17006,
62,
312,
60,
6624,
705,
4,
9967,
62,
3672,
4,
6,
290,
407,
1392,
62,
41484,
25,
198,
4,
1136,
62,
41484,
4,
198,
4,
19545,
62,
27372,
4,
198,
220,
220,
220,
... | 2.375 | 56 |
# Copyright (c) 2013, Carnegie Mellon University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions... | [
2,
15069,
357,
66,
8,
2211,
11,
33976,
49808,
2059,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
... | 2.699111 | 4,274 |
from .generate_eval_jobs import generate_eval_jobs
from .generate_plane_jobs import generate_plane_data
| [
6738,
764,
8612,
378,
62,
18206,
62,
43863,
1330,
7716,
62,
18206,
62,
43863,
198,
6738,
764,
8612,
378,
62,
14382,
62,
43863,
1330,
7716,
62,
14382,
62,
7890,
198
] | 3.466667 | 30 |
import logging
import os
import urllib
from time import time
from json import loads
from rain_api_core.general_util import log_context, return_timing_object, duration
from rain_api_core.view_util import make_set_cookie_headers_jwt, get_exp_time, JWT_COOKIE_NAME
from rain_api_core.aws_util import retrieve_secret
log ... | [
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
2956,
297,
571,
198,
6738,
640,
1330,
640,
198,
6738,
33918,
1330,
15989,
198,
6738,
6290,
62,
15042,
62,
7295,
13,
24622,
62,
22602,
1330,
2604,
62,
22866,
11,
1441,
62,
16514,
278,
6... | 2.494226 | 433 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import uuid
import requests
import json
from copy import copy
from datetime import datetime
from crhelper import CfnResource
from util.solution_metrics import send_metrics
logger = loggi... | [
2,
15069,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
334,
27112,
198,
1... | 3.230216 | 139 |
from solutions.FIZ import fizz_buzz_solution
| [
6738,
8136,
13,
11674,
57,
1330,
277,
6457,
62,
65,
4715,
62,
82,
2122,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
... | 1.596154 | 52 |
#!/usr/bin/env python
"""Classes to mock components for use in system testing.
The main class is the `Component`, which is intended to be used as the base
class for an object that plays the part of a separately running process.
However, a component is actually executed under the control of the
`cleversheep3.Test.PollM... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
9487,
274,
284,
15290,
6805,
329,
779,
287,
1080,
4856,
13,
198,
198,
464,
1388,
1398,
318,
262,
4600,
21950,
47671,
543,
318,
5292,
284,
307,
973,
355,
262,
2779,
198,
4871,
... | 2.57295 | 3,475 |
from django.db import connection
from django.db.models.signals import post_save
from django.dispatch import receiver
# TODO(mkurek): make this working as a decorator, example:
# @post_commit(MyModel)
# def my_handler(instance):
# ...
def post_commit(func, model, signal=post_save, single_call=True):
"""
Pos... | [
6738,
42625,
14208,
13,
9945,
1330,
4637,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
628,
198,
2,
16926,
46,
7,
28015,
495,
74,
2599,
787,... | 3.128425 | 584 |
# Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from multiprocessing import *
import sys
range4 = range(4)
job_table = {}
table = {}
# vim:sw=4:expandtab:softtabstop=4
| [
2,
15069,
1946,
3012,
3457,
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,
6738,
18540,
305,
919,
... | 2.927835 | 97 |
import numpy as np
from scipy.linalg import eig
from nengo.params import IntParam, NumberParam
from nengo.neurons import NeuronTypeParam
from nengo.synapses import SynapseParam
import nengo
from nengolib import Network
from nengolib.neurons import Tanh
from nengolib.networks.reservoir import Reservoir
__all__ = ['Ec... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
75,
1292,
70,
1330,
304,
328,
198,
198,
6738,
299,
1516,
78,
13,
37266,
1330,
2558,
22973,
11,
7913,
22973,
198,
6738,
299,
1516,
78,
13,
710,
333,
684,
1330,
3169,
44372,
... | 2.375516 | 2,181 |
# -*- coding: utf-8 -*-
#
# Copyright Contributors to the Conu project.
# SPDX-License-Identifier: MIT
#
"""
Tests for Kubernetes backend
"""
from conu.backend.k8s.utils import k8s_ports_to_metadata_ports, metadata_ports_to_k8s_ports
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
25767,
669,
284,
262,
1482,
84,
1628,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
2,
198,
198,
37811,
198,
51,
3558,
329,
... | 2.576087 | 92 |
import matplotlib.pyplot as plt
import yaml
from datetime import datetime
from collections import defaultdict
from copy import deepcopy
import itertools
import numpy as np
import torch as th
from torch.optim import Adam
import time
import numpy as np
import scipy.signal
import torch as th
import torch.nn as nn
import t... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
331,
43695,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
340,
861,
10141,
198,
11748,
... | 3.578704 | 216 |
import asyncio
from datetime import datetime
from decimal import Decimal
from tortoise import Tortoise
import pytest
@pytest.fixture(autouse=True)
| [
11748,
30351,
952,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
32465,
1330,
4280,
4402,
198,
198,
6738,
7619,
25678,
1330,
28467,
25678,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
2306,
1076,
28,
17821,
... | 3.454545 | 44 |
'''input
10
10
76
4
3
10
'''
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem B
if __name__ == '__main__':
operation_count = int(input())
incremental_value = int(input())
candidates = list()
for i in range(operation_count + 1):
result = 2 ** i + (operation_cou... | [
7061,
6,
15414,
201,
198,
940,
201,
198,
940,
201,
198,
4304,
201,
198,
19,
201,
198,
18,
201,
198,
940,
201,
198,
7061,
6,
201,
198,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
2,
... | 2.274725 | 182 |
# -*- coding: utf-8 -*-
"""These test the utils.py functions."""
import pytest
from hypothesis import given
from hypothesis.strategies import binary
from natsort.ns_enum import NSType, ns
from natsort.utils import BytesTransformer, parse_bytes_factory
@pytest.mark.parametrize(
"alg, example_func",
[
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
4711,
1332,
262,
3384,
4487,
13,
9078,
5499,
526,
15931,
198,
198,
11748,
12972,
9288,
198,
6738,
14078,
1330,
1813,
198,
6738,
14078,
13,
2536,
2397,
444,
1330,
... | 2.415966 | 238 |
"""
*minor 7th*
The minor 7th diatonic interval.
"""
from dataclasses import dataclass
from fivear.musical.scale import Diatonic
from ...simple import SimpleInterval
__all__ = ["MinorSeventh"]
@dataclass
| [
37811,
628,
220,
220,
220,
1635,
1084,
273,
767,
400,
9,
628,
220,
383,
4159,
767,
400,
2566,
265,
9229,
16654,
13,
198,
198,
37811,
198,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
1936,
283,
13,
14664,
605... | 2.881579 | 76 |
# isort:skip_file
# flake8: noqa
from .html import TEMPLATE_HTML
from .apps import TEMPLATE_APPS
from .urls import TEMPLATE_URLS
from .views import TEMPLATE_VIEWS
from .tests import TEMPLATE_TESTS
| [
2,
318,
419,
25,
48267,
62,
7753,
198,
2,
781,
539,
23,
25,
645,
20402,
198,
198,
6738,
764,
6494,
1330,
309,
3620,
6489,
6158,
62,
28656,
198,
6738,
764,
18211,
1330,
309,
3620,
6489,
6158,
62,
2969,
3705,
198,
6738,
764,
6371,
8... | 2.538462 | 78 |
import string
| [
11748,
4731,
198
] | 4.666667 | 3 |
from typing import Dict, Optional
from pydantic import BaseModel, validator
| [
6738,
19720,
1330,
360,
713,
11,
32233,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
4938,
1352,
628
] | 3.9 | 20 |
#!/usr/bin/env python3
# run in python 3.5 and after
import fire
import subprocess
import os
import re
import signal
import time
import sys
class unity(object):
"""An enhanced unity cli."""
if __name__ == '__main__':
fire.Fire(unity)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
1057,
287,
21015,
513,
13,
20,
290,
706,
198,
11748,
2046,
198,
11748,
850,
14681,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
6737,
198,
11748,
640,
198,
11748,
25064,
198,... | 2.951807 | 83 |
#
"""
Various position embedders.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import tensorflow as tf
from texar.modules.embedders.embedder_base import EmbedderBase
from texar.modules.embedders import embedder_utils
from texar.utils.mo... | [
2,
198,
37811,
198,
40009,
2292,
11525,
67,
364,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
... | 2.204521 | 3,760 |
#!/usr/bin/python3
# Converts Prom1.x rule format into Prom2.x while keeping formatting
# and comments. This does not work in general. Some valid Prom1 rules
# files might not get converted properly.
import glob
import re
for rules_file in glob.iglob('*.rules'):
name = re.match(r'(.*)\.rules', rules_file)[1]
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
1482,
24040,
10335,
16,
13,
87,
3896,
5794,
656,
10335,
17,
13,
87,
981,
5291,
33313,
198,
2,
290,
3651,
13,
770,
857,
407,
670,
287,
2276,
13,
2773,
4938,
10335,
16,
3173,
... | 2.579439 | 214 |
from tkinter import*
from tkinter import ttk
#===================FUNCTION DECLARATION==============================================================================
if __name__ == '__main__':
root=Tk()
obj=C... | [
6738,
256,
74,
3849,
1330,
9,
201,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
201,
198,
201,
198,
220,
220,
1303,
4770,
18604,
42296,
4177,
2849,
27196,
43,
1503,
6234,
23926,
25609,
855,
201,
198,
201,
198,
201,
198,
201,
198,
201... | 1.983516 | 182 |
# Copyright (c) 2010-2012 OpenStack, 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 ... | [
2,
15069,
357,
66,
8,
3050,
12,
6999,
4946,
25896,
11,
11419,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
... | 3.620805 | 298 |
import numpy as np
import os
from utils.load_data import load_c3d_file
# declare variables
path = 'D:/MoCap_Data/David/NewSession_labeled/'
file = 'NeutralTrail14.c3d'
save_folder = 'data/'
save_name = 'David_neutral_pose'
neutral_frame = 900
template_labels = ['LeftBrow1', 'LeftBrow2', 'LeftBrow3', 'LeftBrow4', 'Righ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
3384,
4487,
13,
2220,
62,
7890,
1330,
3440,
62,
66,
18,
67,
62,
7753,
198,
198,
2,
13627,
9633,
198,
6978,
796,
705,
35,
14079,
16632,
15610,
62,
6601,
14,
11006,
14,
3791... | 2.046062 | 673 |
from senseHAT.BaseTest import SenseHATBaseTest
from random import randint
| [
6738,
2565,
39,
1404,
13,
14881,
14402,
1330,
24956,
39,
1404,
14881,
14402,
198,
6738,
4738,
1330,
43720,
600,
198
] | 3.7 | 20 |
import pytest
import os
from jikken.database.config import get_config, write_default_config, JikkenConfig, read_config
@pytest.fixture()
| [
11748,
12972,
9288,
198,
11748,
28686,
198,
6738,
474,
1134,
3464,
13,
48806,
13,
11250,
1330,
651,
62,
11250,
11,
3551,
62,
12286,
62,
11250,
11,
449,
1134,
3464,
16934,
11,
1100,
62,
11250,
628,
198,
31,
9078,
9288,
13,
69,
9602,
... | 3.155556 | 45 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
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,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
from corehq.apps.cleanup.management.commands.populate_sql_model_from_couch_model import PopulateSQLCommand
| [
6738,
4755,
71,
80,
13,
18211,
13,
27773,
929,
13,
27604,
13,
9503,
1746,
13,
12924,
5039,
62,
25410,
62,
19849,
62,
6738,
62,
66,
7673,
62,
19849,
1330,
8099,
5039,
50,
48,
5639,
2002,
392,
628
] | 2.918919 | 37 |
from OpenGLCffi.GL import params
@params(api='gl', prms=[])
| [
6738,
4946,
38,
5639,
487,
72,
13,
8763,
1330,
42287,
198,
31,
37266,
7,
15042,
11639,
4743,
3256,
778,
907,
41888,
12962,
628,
198
] | 2.583333 | 24 |
from pudzu.charts import *
df = pd.read_csv("datasets/flagstriband.csv")
df = pd.concat([pd.DataFrame(df.colours.apply(list).tolist(), columns=list("TMB")), df], axis=1).set_index("colours")
FONT, SIZE = calibri, 24
fg, bg = "black", "#EEEEEE"
default_img = "https://s-media-cache-ak0.pinimg.com/736x/0d/36/e7/0d36e7a4... | [
6738,
279,
463,
27624,
13,
354,
5889,
1330,
1635,
198,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
7203,
19608,
292,
1039,
14,
32109,
301,
822,
392,
13,
40664,
4943,
198,
7568,
796,
279,
67,
13,
1102,
9246,
26933,
30094,
13,
6601,
... | 2.314607 | 534 |
# Copyright 2020 by Aaron Baker.
# All rights reserved.
# This file is part of the Nightcap Project,
# and is released under the "MIT License Agreement". Please see the LICENSE
# file that should have been included as part of this package.
# region Imports
import tempfile
import shutil
from nightcapcore import Printer
... | [
2,
15069,
12131,
416,
12139,
14372,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
770,
2393,
318,
636,
286,
262,
5265,
11128,
4935,
11,
198,
2,
290,
318,
2716,
739,
262,
366,
36393,
13789,
12729,
1911,
4222,
766,
262,
38559,
24290,
198... | 4.022222 | 90 |
import socket
from tkinter import *
ServerIP='127.0.0.1'
port = 4500
thisClient=FTPClient()
thisClient.run() | [
11748,
17802,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
198,
10697,
4061,
11639,
16799,
13,
15,
13,
15,
13,
16,
6,
198,
634,
796,
604,
4059,
628,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.074627 | 67 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: jet-to-python.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protob... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
12644,
12,
1462,
12,
29412,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
... | 2.498153 | 1,624 |
from setuptools import setup
setup(name='hackathon',
install_requires=['pandas'],
extras_require={'test': ['pytest'],},
packages=['hackathon'])
| [
6738,
900,
37623,
10141,
1330,
9058,
628,
198,
40406,
7,
3672,
11639,
31153,
12938,
3256,
198,
220,
220,
220,
220,
220,
2721,
62,
47911,
28,
17816,
79,
392,
292,
6,
4357,
220,
198,
220,
220,
220,
220,
220,
33849,
62,
46115,
34758,
6... | 2.65 | 60 |
#
# author: Paul Galatic
#
# This program is JUST for drawing a rounded rectangle.
#
import pdb
from PIL import Image, ImageDraw
from extern import *
def sub_rectangle(draw, xy, corner_radius=25, fill=(255, 255, 255)):
'''
Source: https://stackoverflow.com/questions/7787375/python-imaging-library-pil-drawin... | [
2,
198,
2,
1772,
25,
3362,
5027,
1512,
198,
2,
198,
2,
770,
1430,
318,
25848,
329,
8263,
257,
19273,
35991,
13,
198,
2,
198,
198,
11748,
279,
9945,
198,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
198,
198,
6738,
409,
759,
... | 2.14324 | 747 |
#%%
# utilities
import subprocess
import os
import matplotlib
import matplotlib.pyplot as plt
import time
import numpy as np
from numpy import linalg
import m8r as sf
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates
from tensorflow.python.ops.image_ops_impl impor... | [
2,
16626,
198,
2,
20081,
198,
11748,
850,
14681,
198,
11748,
28686,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,... | 2.156791 | 2,717 |
"""Test the analog.main module and CLI."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
try:
from unittest import mock
except ImportError:
import mock
import pytest
import analog
@pytest.fixture
def tmp_logfile(tmpdir):
"""Fixture creating ... | [
37811,
14402,
262,
15075,
13,
12417,
8265,
290,
43749,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.318442 | 873 |
'''Global Helpers'''
# pylint: disable=invalid-name,superfluous-parens,missing-docstring,wildcard-import,unused-wildcard-import
from sys import platform
import os
import sys
import re
import traceback
import webbrowser
import subprocess
from shutil import copytree, rmtree
from platform import python_version
from confi... | [
7061,
6,
22289,
10478,
364,
7061,
6,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
11,
16668,
35522,
516,
12,
11730,
82,
11,
45688,
12,
15390,
8841,
11,
21992,
9517,
12,
11748,
11,
403,
1484,
12,
21992,
9517,
12,
11... | 2.553145 | 1,383 |
from __future__ import absolute_import
from .alert import Alert
from .domain import URI, Domain
from .file import File, FileOf
from .ip_address import IPAddress
from .node import Node
from .process import Process, SysMonProc
from .registry import RegistryKey
__all__ = [
"Node",
"URI",
"Domain",
"File... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
764,
44598,
1330,
23276,
198,
6738,
764,
27830,
1330,
43975,
11,
20021,
198,
6738,
764,
7753,
1330,
9220,
11,
9220,
5189,
198,
6738,
764,
541,
62,
21975,
1330,
27966,
1860,... | 2.716129 | 155 |
import enum
__all__ = ["UpdateMode"]
| [
11748,
33829,
628,
198,
198,
834,
439,
834,
796,
14631,
10260,
19076,
8973,
198
] | 2.857143 | 14 |
# -*- coding: utf-8 -*-
#
# Convert list of Office files (.docx, .xslx, .pptx) files from
# old text encoding to Unicode.
import os
import re
import sys
import convertOffice
import osageConversion
import convertUtil
if __name__ == "__main__":
main(sys.argv)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
198,
2,
38240,
1351,
286,
4452,
3696,
20262,
15390,
87,
11,
764,
87,
6649,
87,
11,
764,
381,
17602,
8,
3696,
422,
198,
2,
1468,
2420,
21004,
284,
34371,
13,
... | 2.8 | 95 |
#-*- coding:utf-8 -*-
import time
from bs4 import BeautifulSoup
from user_agents import agents
import requests
import random
import re
def get_article(url):
'''
:param url: 指定日期的链接
:return content: 指定url的正文内容
'''
agent = random.choice(agents)
header = {'User-Agent': agent}
res = requests.g... | [
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
11748,
640,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
2836,
62,
49638,
1330,
6554,
198,
11748,
7007,
198,
11748,
4738,
198,
11748,
302,
198,
198,
4299,... | 2.227642 | 369 |
# Generated by Django 3.1.4 on 2021-01-13 17:40
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
19,
319,
33448,
12,
486,
12,
1485,
1596,
25,
1821,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
import os, json
import hdefereval
import sdm.houdini
from sdm.houdini.dialog import checkForUpdates
from sdm.houdini.shelves import addShelf
from sdm.houdini.node import applyDefaultShapesAndColors
hdefereval.executeDeferred(checkUpdates)
hdefereval.executeDeferred(addShelf)
hdefereval.executeDeferred(applyDefaultSha... | [
11748,
28686,
11,
33918,
198,
11748,
289,
4299,
567,
2100,
198,
198,
11748,
264,
36020,
13,
71,
2778,
5362,
198,
6738,
264,
36020,
13,
71,
2778,
5362,
13,
38969,
519,
1330,
2198,
1890,
4933,
19581,
198,
6738,
264,
36020,
13,
71,
2778,... | 2.854701 | 117 |
'''
@ Author: Tiexin
@ email: tiexinqin@163.com
@Data: 2019-8-14
'''
from engine.configs.parser import BaseOptions
# import engine.fsl_trainer as trainer
import engine.ssl_trainer as trainer
import sys
sys.dont_write_bytecode = True
try:
from itertools import izip as zip
except ImportError: # will be 3.x series... | [
7061,
6,
198,
31,
6434,
25,
36286,
87,
259,
198,
31,
3053,
25,
9839,
87,
259,
80,
259,
31,
24136,
13,
785,
198,
31,
6601,
25,
13130,
12,
23,
12,
1415,
198,
7061,
6,
198,
198,
6738,
3113,
13,
11250,
82,
13,
48610,
1330,
7308,
2... | 2.710227 | 176 |
#!/usr/bin/env python3
import lib
n=1
d=1
i=0
N=1000
count = 0
while i < N+1:
#print(i,str(n)+'/'+str(d),n/d)
if (lib.num_digits(n) >lib.num_digits(d)):
count += 1
#term' = 1 + 1/(1+term)
n+= d #1 + term
n,d=d,n #1/(1+term)
n+= d #1+1/(1+term)
i+=1
print(count)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
9195,
198,
77,
28,
16,
198,
67,
28,
16,
198,
72,
28,
15,
198,
45,
28,
12825,
198,
9127,
796,
657,
198,
4514,
1312,
1279,
399,
10,
16,
25,
198,
220,
1303,
4798,
7,
72... | 1.775 | 160 |
import csv
from bs4 import BeautifulSoup
import requests
# function to scrape smartybro
# Code to scrape Anycouponcode.com
# function to scrape BuzzUdemy.com
# function to scrape Comidoc.com
# function to scrape coupontry.com
# function to scrape udemycoupon.learnviral
# function to scrape Udemycoupon.clu... | [
11748,
269,
21370,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
628,
198,
2,
2163,
284,
42778,
4451,
88,
7957,
628,
198,
2,
6127,
284,
42778,
4377,
66,
10486,
261,
8189,
13,
785,
628,
198,
2,
2163,
284,
42778,
... | 3.005236 | 191 |
import threading
| [
11748,
4704,
278,
628,
628
] | 4 | 5 |
# -*- coding: utf-8 -*-
'''
default network class
给神经网络类的接口格式定义,神经网络具体需要自行添加
'''
import pickle as pkl
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
12286,
3127,
1398,
198,
163,
119,
247,
15351,
163,
119,
237,
163,
121,
239,
163,
119,
250,
163,
109,
119,
21410,
162,
236,
98,
20998,
96,
43718,
120,
2... | 1.095745 | 94 |
import json
import pprint
######### OPEN AND READ THE DATA FILE ###########
inFile = open("data/scf_data.json","r")
scf_data = json.load(inFile)
# print(scf_data)
inFile.close()
############ DATA EXPLORATION #############
# dataType = str(type(scf_data))
# print("type of data: " + dataType)
# print("dictionary keys: ... | [
11748,
33918,
198,
11748,
279,
4798,
198,
198,
7804,
2,
38303,
5357,
20832,
3336,
42865,
45811,
1303,
7804,
2235,
198,
259,
8979,
796,
1280,
7203,
7890,
14,
1416,
69,
62,
7890,
13,
17752,
2430,
81,
4943,
198,
1416,
69,
62,
7890,
796,
... | 2.745843 | 421 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-24 11:51
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
19,
319,
1584,
12,
3070,
12,
1731,
1367,
25,
4349,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
from time import sleep
import pytest
from ...utils import assert_finished, assert_obniz, assert_send, receive_json
| [
6738,
640,
1330,
3993,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
2644,
26791,
1330,
6818,
62,
43952,
11,
6818,
62,
672,
77,
528,
11,
6818,
62,
21280,
11,
3328,
62,
17752,
628
] | 3.575758 | 33 |
from flask_restplus import fields
from polylogyx.blueprints.v1.external_api import api
# Node Wrappers
node_info_wrapper = api.model('node_info_wrapper', {
'computer_name': fields.String(),
'hardware_model': fields.String(),
'hardware_serial': fields.String(),
'hardware_vendor': fields.String(),
'p... | [
6738,
42903,
62,
2118,
9541,
1330,
7032,
198,
6738,
7514,
6404,
28391,
13,
17585,
17190,
13,
85,
16,
13,
22615,
62,
15042,
1330,
40391,
198,
198,
2,
19081,
27323,
11799,
198,
17440,
62,
10951,
62,
48553,
796,
40391,
13,
19849,
10786,
... | 2.770758 | 554 |
"""
Entradas
(X,M)-->int-->valores
Salida
Nueva experiencia Monster-->int-->E
"""
#Caja negra
while True:
#Entrada
valores=input("")
(X,M)=valores.split(" ")
X=int(X)
M=int(M)
#Caja negra
if (X==0) and M==0:
break
else:
E=X*M
#Salida
print(E) | [
37811,
201,
198,
14539,
6335,
292,
201,
198,
7,
55,
11,
44,
42944,
29,
600,
46904,
2100,
2850,
201,
198,
19221,
3755,
201,
198,
45,
518,
6862,
3410,
33743,
12635,
46904,
600,
46904,
36,
201,
198,
37811,
201,
198,
2,
34,
27792,
2469,... | 1.741758 | 182 |
"""
Print out the nodes of a taxonomy
Usage:
print_nodes (-h | help)
print_nodes <taxon>... [--debug]
Options:
-h --help Prints this documentation
<taxon> A yaml file containing partial or whole taxonomy. Multiple
files will be merged.
-d --debug Print log information... | [
37811,
198,
18557,
503,
262,
13760,
286,
257,
1687,
30565,
198,
198,
28350,
25,
198,
220,
220,
220,
3601,
62,
77,
4147,
13841,
71,
930,
1037,
8,
198,
220,
220,
220,
3601,
62,
77,
4147,
1279,
19290,
261,
29,
986,
685,
438,
24442,
6... | 2.588235 | 204 |
#! -*- coding: utf-8 -*-
'''DeepLearning学習処理の実装サンプル
引数に指定する設定ファイルで指定されたパラメータに従い,DeepLearningモデルの学習を実行する実装サンプル.
設定ファイルで指定するパラメータ:
* env: 環境設定
* fifo: 学習制御用のFIFOパス
* result_dir: 結果を格納するディレクトリ
* dataset: データセット関連の設定
* dataset_name: データセット名(Preset: MNIST, CIFAR-10)
* dataset_dir: データセットを格納したディレクトリ
... | [
2,
0,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
29744,
41730,
27764,
99,
163,
123,
240,
49035,
99,
49426,
228,
49149,
253,
35318,
26503,
6527,
30965,
9202,
198,
198,
28156,
243,
46763,
108,
28618,
162,
234... | 1.712442 | 1,085 |
import streamlit as slt
from sklearn.svm import SVC,SVR
from sklearn.naive_bayes import GaussianNB
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import PolynomialFeatures
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.ens... | [
11748,
4269,
18250,
355,
1017,
83,
198,
6738,
1341,
35720,
13,
82,
14761,
1330,
311,
15922,
11,
50,
13024,
198,
6738,
1341,
35720,
13,
2616,
425,
62,
24406,
274,
1330,
12822,
31562,
32819,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
... | 3.303571 | 224 |
##############################################################################
#copyright 2012, Hamid MEDJAHED (hmedjahed@prologue.fr) Prologue #
#Licensed under the Apache License, Version 2.0 (the "License"); #
#you may not use this file except in compliance with the License. #
#You... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
22163,
4766,
2321,
11,
4345,
312,
26112,
41,
18429,
1961,
220,
357,
71,
1150,
6592,
704,
31,
1676,
75,
5119,
13,
8310,
8,
44157,
5119,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.201667 | 600 |
#!/usr/bin/env bash
#!/bin/bash
#!/bin/sh
#!/bin/sh -
from vk_api.utils import get_random_id
from vk_api import VkUpload
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
import random, requests, vk_api, os, bs4
from google_images_download import goog... | [
2,
48443,
14629,
14,
8800,
14,
24330,
27334,
198,
2,
48443,
8800,
14,
41757,
198,
2,
48443,
8800,
14,
1477,
198,
2,
48443,
8800,
14,
1477,
532,
198,
198,
6738,
410,
74,
62,
15042,
13,
26791,
1330,
651,
62,
25120,
62,
312,
198,
673... | 1.963717 | 1,571 |
from environment_models.base import BaseEnv
from airobot_utils.pusher_simulator import PusherSimulator
import numpy as np
| [
198,
6738,
2858,
62,
27530,
13,
8692,
1330,
7308,
4834,
85,
198,
6738,
257,
7058,
13645,
62,
26791,
13,
79,
34055,
62,
14323,
8927,
1330,
350,
34055,
8890,
8927,
198,
198,
11748,
299,
32152,
355,
45941,
628
] | 3.378378 | 37 |
import heckguide.wsgi
from whitenoise import WhiteNoise
application = heckguide.wsgi.application
application = WhiteNoise(application, root='/home/heckkciy/dev.heckguide.com/static') | [
11748,
22574,
41311,
13,
18504,
12397,
198,
6738,
20542,
23397,
786,
1330,
2635,
2949,
786,
198,
198,
31438,
796,
22574,
41311,
13,
18504,
12397,
13,
31438,
198,
31438,
796,
2635,
2949,
786,
7,
31438,
11,
6808,
11639,
14,
11195,
14,
258... | 3.267857 | 56 |
# function call to the transformation functions of relevance for the hpsModel
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import get_window
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
sys.path.append(os.path.join(os.path.dirname(os.pa... | [
2,
2163,
869,
284,
262,
13389,
5499,
286,
23082,
329,
262,
289,
862,
17633,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
651,
6... | 2.432562 | 2,721 |
#!/usr/bin/python
with open('works.txt', 'r') as f:
data1 = f.read(22)
print(data1)
f.seek(0, 0)
data2 = f.read(22)
print(data2)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
4480,
1280,
10786,
5225,
13,
14116,
3256,
705,
81,
11537,
355,
277,
25,
628,
220,
220,
220,
1366,
16,
796,
277,
13,
961,
7,
1828,
8,
198,
220,
220,
220,
3601,
7,
7890,
16,
8,
628,
... | 1.936709 | 79 |
import decimal
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils import timezone
| [
11748,
32465,
198,
11748,
334,
27112,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
13,
1891,
2412,
13,
8692,
13,
3575,
602,
1330,
7308,
38105,
18843,
602,
198,
6738,
42625,
14208,
13,
26791,
13... | 3.772727 | 44 |
teststring ="hello"
print(teststring) | [
9288,
8841,
796,
1,
31373,
1,
198,
4798,
7,
9288,
8841,
8
] | 3.083333 | 12 |
from insights.parsers.nfs_exports import NFSExports, NFSExportsD
from insights.tests import context_wrap
EXPORTS = """
/home/utcs/shared/ro @rhtttttttttttt(ro,sync) ins1.example.com(rw,sync,no_root_squash) ins2.example.com(rw,sync,no_root_squash)
/home/insights/shared/rw @rhtttttttttttt(rw,sync) ins1.example.com(r... | [
6738,
17218,
13,
79,
945,
364,
13,
77,
9501,
62,
1069,
3742,
1330,
399,
10652,
3109,
3742,
11,
399,
10652,
3109,
3742,
35,
198,
6738,
17218,
13,
41989,
1330,
4732,
62,
37150,
198,
198,
49864,
33002,
796,
37227,
198,
14,
11195,
14,
3... | 2.248062 | 387 |
#!/usr/bin/env python
#bbfreeze setup file for PEAT_DB distribution on Windows
#Damien Farrell, #October 2009
"""
This script can be used to create a standalone executable for
either windows or linux. It must be run on the target platform.
You will need to install bbfreeze, see http://pypi.python.org/pypi/bbf... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
201,
198,
2,
11848,
5787,
2736,
9058,
2393,
329,
18468,
1404,
62,
11012,
6082,
319,
3964,
201,
198,
2,
14550,
2013,
37568,
11,
1303,
18517,
3717,
201,
198,
201,
198,
37811,
201,
... | 2.216667 | 720 |
import collections
import random
from math import sqrt
import numpy as np
import torch
from gym.wrappers import LazyFrames
from common.utils import prep_observation_for_qnet
class PrioritizedReplayBuffer:
""" based on https://nn.labml.ai/rl/dqn, supports n-step bootstrapping and parallel environments,
remo... | [
11748,
17268,
198,
11748,
4738,
198,
6738,
10688,
1330,
19862,
17034,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
11550,
13,
29988,
11799,
1330,
406,
12582,
35439,
198,
198,
6738,
2219,
13,
26791,
1330,
3143,
62... | 2.468023 | 344 |
import logging
import aiohttp
from typing import Tuple
from controller.data.VM import VM
from controller.connectors.Connector import Connector
| [
11748,
18931,
198,
11748,
257,
952,
4023,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
10444,
13,
7890,
13,
15996,
1330,
16990,
198,
6738,
10444,
13,
8443,
669,
13,
34525,
1330,
8113,
273,
628
] | 4.142857 | 35 |
from .models import Business,Profile
from django import forms
class BusinessForm(forms.ModelForm):
"""
class BusinessForm to enable a user to register their businesses
with the application
"""
class ProfileForm(forms.ModelForm):
"""
class BusinessForm to enable a user to register their ... | [
6738,
764,
27530,
1330,
7320,
11,
37046,
198,
6738,
42625,
14208,
1330,
5107,
198,
198,
4871,
7320,
8479,
7,
23914,
13,
17633,
8479,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1398,
7320,
8479,
284,
7139,
257,
2836,
284,
788... | 3.254386 | 114 |
"""
Pre-processing for mb_graph_batch.py of oriented membranes from TomoSegMemTV output
Input: - STAR file with 3 columns:
+ _rlnMicrographName: tomogram original
+ _rlnImageName: TomoSegMemTV density map output
+ _psSegLabel: (optional) label for membrane segm... | [
37811,
628,
220,
220,
220,
3771,
12,
36948,
329,
285,
65,
62,
34960,
62,
43501,
13,
9078,
286,
25921,
43447,
422,
4186,
34049,
1533,
13579,
6849,
5072,
628,
220,
220,
220,
23412,
25,
220,
532,
25424,
2393,
351,
513,
15180,
25,
198,
... | 1.945526 | 8,940 |
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import sqlite3
from sqlite3 import Error
Sea().mainloop() | [
6738,
256,
74,
3849,
1330,
1635,
201,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
201,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
201,
198,
11748,
44161,
578,
18,
201,
198,
6738,
44161,
578,
18,
1330,
13047,
201,
198,
201,
198,
201... | 2.918367 | 49 |
# pylint: disable=C0111,R0902,R0913
# Smartsheet Python SDK.
#
# Copyright 2016 Smartsheet.com, 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/LICE... | [
2,
279,
2645,
600,
25,
15560,
28,
34,
486,
1157,
11,
49,
2931,
2999,
11,
49,
2931,
1485,
198,
2,
2439,
5889,
25473,
11361,
26144,
13,
198,
2,
198,
2,
15069,
1584,
2439,
5889,
25473,
13,
785,
11,
3457,
13,
198,
2,
198,
2,
49962,
... | 3.616279 | 258 |
import os
from urllib.request import urlretrieve
url = "https://github.com/plotly/orca/releases/download/v1.2.1/orca-1.2.1-x86_64.AppImage"
orca = '/usr/local/bin/orca'
urlretrieve(url, orca)
os.chmod(orca, 0o755)
os.system("apt install xvfb libgconf-2-4") | [
11748,
28686,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
1186,
30227,
198,
6371,
796,
366,
5450,
1378,
12567,
13,
785,
14,
29487,
306,
14,
273,
6888,
14,
260,
29329,
14,
15002,
14,
85,
16,
13,
17,
13,
16,
14,
273,
6888,
12... | 2.265487 | 113 |
from grafo_adj import *
g = Grafo([],[])
for i in ['9','8','7','2','11','5','3', '10']:
g.adiciona_vertice(i)
for i in ['7-11', '5-8', '3-11', '7-8', '8-9','11-10','11-2', '5-10']:
g.adiciona_aresta(i)
print(g)
print(g.dfs('7'))
| [
6738,
7933,
6513,
62,
41255,
1330,
1635,
198,
198,
70,
796,
7037,
6513,
26933,
38430,
12962,
198,
198,
1640,
1312,
287,
37250,
24,
41707,
23,
41707,
22,
41707,
17,
41707,
1157,
41707,
20,
41707,
18,
3256,
705,
940,
6,
5974,
198,
220,
... | 1.861538 | 130 |
from collections import Counter
import nltk
from nltk.corpus import stopwords
stopwords = set(stopwords.words('english'))
# read sentence
lines = []
for line in open('building_global_community.txt'):
# delete the blank and line feed at the begining and end
line = line.strip()
# add processed line text in... | [
6738,
17268,
1330,
15034,
198,
11748,
299,
2528,
74,
198,
6738,
299,
2528,
74,
13,
10215,
79,
385,
1330,
2245,
10879,
198,
11338,
10879,
796,
900,
7,
11338,
10879,
13,
10879,
10786,
39126,
6,
4008,
628,
198,
198,
2,
1100,
6827,
198,
... | 2.60076 | 1,052 |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2016 Mag. Christian Tanzer. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at
# ****************************************************************************
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
4793,
12,
5304,
2944,
13,
4302,
11818,
9107,
13,
1439,
2489,
10395,
198,
2,
21931,
559,
6422,
21612,
3933,
11,
317,
438,
1157,
1270,
370,
2013,
... | 2.146667 | 1,275 |
"""Various helper functions to set the dtypes."""
# ----------------------------------------------------
# Name : df2onehot.py
# Author : E.Taskesen
# Contact : erdogant@gmail.com
# github : https://github.com/erdogant/df2onehot
# Licence : MIT
# ------------------------------------------------... | [
37811,
40009,
31904,
5499,
284,
900,
262,
288,
19199,
526,
15931,
198,
2,
20368,
19351,
198,
2,
6530,
220,
220,
220,
220,
220,
220,
220,
1058,
47764,
17,
505,
8940,
13,
9078,
198,
2,
6434,
220,
220,
220,
220,
220,
1058,
412,
13,
2... | 2.649038 | 1,664 |
import random
import struct
import json
import flask
import time
import numpy as np
from collections import defaultdict
from threading import Thread
from Queue import Queue
from StringIO import StringIO
from sqlalchemy import create_engine
from flask import Flask, render_template, Response, request, stream_with_context... | [
11748,
4738,
198,
11748,
2878,
198,
11748,
33918,
198,
11748,
42903,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
4670,
518,
1330,
4670,
518,
198,
... | 2.893963 | 1,292 |
import maya.cmds as mc
createVisualizerNodes()
| [
11748,
743,
64,
13,
28758,
82,
355,
36650,
628,
198,
17953,
36259,
7509,
45,
4147,
3419,
628,
198
] | 2.833333 | 18 |
import kivy
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty, StringProperty
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.gridlayout import GridLayout
from kivy.uix.image import Image, AsyncImage
from kivy.uix.textinput import TextInput
from kivy.conf... | [
11748,
479,
452,
88,
198,
198,
6738,
479,
452,
88,
13,
1324,
1330,
2034,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
42655,
1330,
370,
17484,
198,
6738,
479,
452,
88,
13,
48310,
1330,
9515,
21746,
11,
10903,
21746,
198,
6738,
479,
4... | 2.672241 | 299 |
# -*- coding: utf-8 -*-
"""Tests for internals.py"""
from asyncio.tasks import Task
import os
import json
import sys
import unittest
import asyncio
import logging
from io import StringIO
from importlib import reload
from unittest.mock import AsyncMock, Mock, call, patch
from aiohttp.client_exceptions import ClientCon... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
1788,
874,
13,
9078,
37811,
198,
198,
6738,
30351,
952,
13,
83,
6791,
1330,
15941,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
25064,
198,
11... | 1.994553 | 11,016 |
from flask import Flask
from flask_restful import Api
from multiprocessing import Process
from heartbit import heartbit
from api_health import HealthEndPoint
from api_manifest import ManifestEndPoint
from api_metrics import MetricsEndPoint
app = Flask(__name__)
api = Api(app)
async_process = Process(
target=hea... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
198,
198,
6738,
2612,
2545,
1330,
2612,
2545,
198,
6738,
40391,
62,
13948,
1330,
3893,
12915,
12727,
198,
6738,
403... | 2.697674 | 301 |
from Field_D_SupportingClasses import *
ProgramID = "DF Word Score Sonifier v1.0"
WorkTitle = "Untitled Sonification"
Lyricist = ""
Input = DF_TextInput()
WorkTitle = Input.provideTitle()
Lyricist = Input.provideLyricist()
verses = Input.provideVerses()
positions = Input.providePositions()
scores = Input.p... | [
6738,
7663,
62,
35,
62,
15514,
278,
9487,
274,
1330,
1635,
201,
198,
201,
198,
15167,
2389,
796,
366,
8068,
9678,
15178,
6295,
7483,
410,
16,
13,
15,
1,
201,
198,
12468,
19160,
796,
366,
46332,
6295,
2649,
1,
201,
198,
31633,
1173,
... | 2.509836 | 610 |
#!/usr/bin/env python3
import gzip
import io
import os
import time
import git
from broker.config import env, logging
from broker.libs.ipfs import decrypt_using_gpg
from broker.utils import cd, is_gzip_file_empty, log, path_leaf, run
# from subprocess import CalledProcessError
def initialize_check(path):
""".g... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
308,
13344,
198,
11748,
33245,
198,
11748,
28686,
198,
11748,
640,
198,
198,
11748,
17606,
198,
198,
6738,
20426,
13,
11250,
1330,
17365,
11,
18931,
198,
6738,
20426,
13,... | 2.26055 | 1,635 |
# -*- coding: utf-8 -*-
"""Tag Matching Module
This module mirrors the Tag Matching API. It allows the user to search for tag id matches.
https://doc.cognitedata.com/0.5/#Cognite-API-Tag-Matching
"""
import cognite._utils as _utils
import cognite.config as config
from cognite.v05.dto import TagMatchingResponse
def ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
24835,
13225,
278,
19937,
198,
198,
1212,
8265,
22353,
262,
17467,
13225,
278,
7824,
13,
632,
3578,
262,
2836,
284,
2989,
329,
7621,
4686,
7466,
13,
198,
198,
545... | 2.802862 | 629 |
import StringIO
import json
import logging
import random
import urllib
import urllib2
from xml.dom import minidom
# for sending images
from PIL import Image
import multipart
# standard app engine imports
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
import webapp2
TOKEN = '119152358:... | [
11748,
10903,
9399,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
4738,
198,
11748,
2956,
297,
571,
198,
11748,
2956,
297,
571,
17,
198,
6738,
35555,
13,
3438,
1330,
949,
312,
296,
198,
198,
2,
329,
7216,
4263,
198,
6738,
350,
414... | 2.805344 | 262 |
#Faça um Programa que leia um vetor de 5 números inteiros e mostre-os.
lista=[]
for i in range(1, 6):
lista.append(int(input('Digite um número: ')))
print(lista)
| [
2,
50110,
50041,
23781,
6118,
64,
8358,
443,
544,
23781,
1569,
13165,
390,
642,
299,
21356,
647,
418,
493,
20295,
4951,
304,
749,
260,
12,
418,
13,
198,
198,
4868,
64,
28,
21737,
198,
1640,
1312,
287,
2837,
7,
16,
11,
718,
2599,
1... | 2.287671 | 73 |
from django.utils.text import slugify
from soil import DownloadBase
from corehq.apps.hqmedia.tasks import build_application_zip
from corehq.util.view_utils import absolute_reverse, json_error
from corehq.apps.domain.models import Domain
from dimagi.utils.web import json_response
from corehq.apps.domain.decorators impo... | [
6738,
42625,
14208,
13,
26791,
13,
5239,
1330,
31065,
1958,
198,
198,
6738,
9260,
1330,
10472,
14881,
198,
6738,
4755,
71,
80,
13,
18211,
13,
71,
80,
11431,
13,
83,
6791,
1330,
1382,
62,
31438,
62,
13344,
198,
6738,
4755,
71,
80,
13... | 2.968354 | 158 |
import re
import datetime
from ingestion import datasource as ds
# Provides access to coinmarketcap.com data, using the API when available,
# or web scraping when there is no public API
class CoinList(ds.DataSource):
"""Used to get a list of all the coins on coinmarketcap"""
class Ticker(CoinList):
"""Use... | [
11748,
302,
198,
11748,
4818,
8079,
198,
6738,
38382,
1330,
19395,
1668,
355,
288,
82,
628,
198,
2,
47081,
1895,
284,
10752,
10728,
11128,
13,
785,
1366,
11,
1262,
262,
7824,
618,
1695,
11,
198,
2,
393,
3992,
46743,
618,
612,
318,
6... | 3.611111 | 216 |
#create file myaperture.dat needed for source optimization
f = open("myaperture.dat",'w')
f.write(" 50.0 -0.002 0.002 -0.002 0.002")
f.close()
print("File written to disk: myaperture.dat")
| [
2,
17953,
2393,
616,
499,
861,
495,
13,
19608,
2622,
329,
2723,
23989,
198,
69,
796,
1280,
7203,
1820,
499,
861,
495,
13,
19608,
1600,
6,
86,
11537,
198,
69,
13,
13564,
7203,
2026,
13,
15,
220,
220,
220,
220,
220,
532,
15,
13,
2... | 2.426829 | 82 |
print(">>>>>> import schemas_invitation.py > Invitation ...")
from typing import List, Optional, Any
import datetime
from pydantic import BaseModel, EmailStr
# from uuid import UUID
from .schemas_choices import ItemType, InvitationStatus, InviteeType, InvitationStatusAction
from .schemas_auths import AuthsInfosBasic... | [
4798,
7203,
16471,
4211,
1330,
3897,
5356,
62,
16340,
3780,
13,
9078,
1875,
220,
10001,
3780,
35713,
8,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
4377,
198,
11748,
4818,
8079,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
... | 3.245161 | 155 |
import pytest
from signal_ocean import VesselClassFilter
from .builders import create_vessel_class
@pytest.mark.parametrize(
'name_like',
[
'matching name', 'matching', 'name', 'mat', 'me', 'ing na',
'MATCHING NAME', 'MATCHING', 'NAME', 'MAT', 'ME', 'ING NA',
'mAtchiNG NamE', 'Matchi... | [
11748,
12972,
9288,
198,
198,
6738,
6737,
62,
78,
5829,
1330,
44734,
9487,
22417,
198,
6738,
764,
50034,
1330,
2251,
62,
1158,
741,
62,
4871,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,... | 2.19883 | 171 |
# from transformers import pipeline
# generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B')
# generator("EleutherAI has", do_sample=True, min_length=50)
# [{'generated_text': 'EleutherAI has made a commitment to create new software packages for each of its major clients and has'}]
from transformers... | [
2,
422,
6121,
364,
1330,
11523,
198,
2,
17301,
796,
11523,
10786,
5239,
12,
20158,
3256,
2746,
11639,
28827,
12866,
20185,
14,
70,
457,
12,
710,
78,
12,
17,
13,
22,
33,
11537,
198,
2,
17301,
7203,
28827,
12866,
20185,
468,
1600,
466... | 2.903125 | 320 |
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from datetime import datetime
from pprint import pprint
import pytz
import locale
import sys
import process
sys.path.insert(0,'./process.py')
#set locale
locale.setlocale(locale.LC_TIME, 'id_ID.UTF-8')
#Set up credentials
scope = ["http... | [
11748,
308,
43639,
198,
6738,
267,
18439,
17,
16366,
13,
15271,
62,
23317,
1330,
4809,
30116,
34,
445,
14817,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
11748,
12972,
22877,
198,
11748,
36693,
1... | 2.758017 | 343 |
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
""" Tests for half-precision syntax quirks. """
import dace
import math
import numpy as np
from dace.transformation.dataflow import MapFusion, Vectorization
from dace.transformation.optimizer import Optimizer
N = dace.symbol('N')
def _test_... | [
2,
15069,
13130,
12,
42334,
35920,
43412,
290,
262,
9637,
34,
68,
7035,
13,
1439,
2489,
10395,
13,
198,
37811,
30307,
329,
2063,
12,
3866,
16005,
15582,
48072,
13,
37227,
198,
198,
11748,
288,
558,
198,
11748,
10688,
198,
11748,
299,
... | 2.397126 | 1,322 |