content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 30 13:09:07 2021
@author: Easin
"""
print(matchingStrings([1,2,3,4],[1,2,2,3]))
'''
There is a collection of input strings and a collection of query strings. For each query string, determine how many times it occurs in the list of input strings. Return an array ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
26223,
4280,
1542,
1511,
25,
2931,
25,
2998,
33448,
201,
198,
201,
198,
31,
9800,
25,
38647,
259,
201,
198,
37811,
201,
198,
201,
198... | 3.424437 | 311 |
cloud_config = {
"<cloud_config>"
}
email_config = {
"SEND_GRID_KEY":'<SEND_GRID_KEY>'
}
invite_url = "<invite_url>" | [
198,
17721,
62,
11250,
796,
1391,
628,
33490,
17721,
62,
11250,
24618,
628,
198,
92,
198,
198,
12888,
62,
11250,
796,
1391,
198,
220,
220,
220,
366,
50,
10619,
62,
10761,
2389,
62,
20373,
1298,
6,
27,
50,
10619,
62,
10761,
2389,
62,... | 2.081967 | 61 |
from labler.api import IImager
from PIL import Image
from PIL import ImageFile
import base64
import os
ImageFile.LOAD_TRUNCATED_IMAGES = True
| [
6738,
2248,
1754,
13,
15042,
1330,
2873,
76,
3536,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
350,
4146,
1330,
7412,
8979,
198,
11748,
2779,
2414,
198,
11748,
28686,
198,
198,
5159,
8979,
13,
35613,
62,
5446,
4944,
34,
11617,
62,
39... | 3.130435 | 46 |
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'meshmergerwidget.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
#########... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
29113,
29113,
14468,
198,
2235,
5178,
7560,
422,
3555,
12454,
2393,
705,
76,
5069,
647,
1362,
42655,
13,
9019,
6,
198,
2235,
198,
2235,
15622,
416,
25,
33734,
11787... | 3.8 | 155 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: chat.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf ... | [
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,
8537,
13,
1676,
1462,
198,
37811,
8645,
515,
8435,
11876,
2438,
526,
15931... | 2.57315 | 581 |
import numpy as np
import subprocess
from polharmonic import util, gaunt
import polharmonic.shcoeffs as sh
import matplotlib.pyplot as plt
from PIL import Image
import os
P = np.load(os.path.join(os.path.dirname(__file__), 'chcoeff_n2.npy'))
G = np.load(os.path.join(os.path.dirname(__file__), 'gaunt_l4.npy'))
class ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
850,
14681,
198,
6738,
755,
29155,
9229,
1330,
7736,
11,
308,
12968,
198,
11748,
755,
29155,
9229,
13,
1477,
1073,
14822,
82,
355,
427,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,... | 1.938005 | 2,226 |
#!/usr/bin/env python
import sys
import os
import web
import json
import urllib
import logging
import socket
import uuid
from time import time, sleep
from threading import Thread
"""
Main application that will monitor TenantUpdate threads.
"""
"""
TenantUpdate is used for updating the tenant quota list ev... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
3992,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
198,
11748,
18931,
198,
11748,
17802,
198,
11748,
334,
27112,
198,
198,
6738,
640,
1330,
... | 3.648855 | 131 |
#!/usr/bin/env python
"""
_Impl_
Scenario Implementations
"""
__all__ = []
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
62,
29710,
62,
198,
198,
3351,
39055,
48282,
602,
198,
198,
37811,
198,
834,
439,
834,
796,
17635,
198
] | 2.566667 | 30 |
# Copyright (c) 2013--2014 King's College London
# Created by the Software Development Team <http://soft-dev.org/>
#
# 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, inclu... | [
2,
15069,
357,
66,
8,
2211,
438,
4967,
2677,
338,
5535,
3576,
198,
2,
15622,
416,
262,
10442,
7712,
4816,
1279,
4023,
1378,
4215,
12,
7959,
13,
2398,
15913,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
28... | 3.851515 | 330 |
# -*- coding: utf-8 -*-
"""
gui for viscoindent, v. May-2021
with images for viscomodels
gui_Viscoindent
"""
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QSizePolicy,\
QVBoxLayout, QHBoxLayout, QLabel,\
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
48317,
329,
1490,
1073,
521,
298,
11,
410,
13,
1737,
12,
1238,
2481,
201,
198,
4480,
4263,
329,
1490,
785,
375,
1424,
201,
198,
48317,
62,
53,
... | 2.250608 | 411 |
#!/usr/bin/env python
# Copyright (C) 2015 Indeed 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 a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
34,
8,
1853,
9676,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,... | 3.848485 | 165 |
# External imports
import pandas as pd
import numpy as np
from collections import defaultdict
import networkx as nx
import logging
from operator import itemgetter
import logging
import random
import pandas as pd
from stop_words import get_stop_words
from unidecode import unidecode
from fuzzywuzzy.utils import asciidamm... | [
2,
34579,
17944,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
18931,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
11748,
... | 1.89378 | 19,149 |
from docutils import nodes
from docutils import statemachine
from docutils.parsers.rst import Directive
latex_preamble = r"""
\usepackage{mdframed}
\usepackage{tikz}
\newenvironment{jsonframe}[2]{%
\ifstrempty{#1}%
{}%
{\mdfsetup{%
skipabove=10pt,
frametitle={%
\tikz[basel... | [
6738,
2205,
26791,
1330,
13760,
198,
6738,
2205,
26791,
1330,
1185,
368,
20480,
198,
6738,
2205,
26791,
13,
79,
945,
364,
13,
81,
301,
1330,
34736,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
198,
17660,
87,
62,
79,
1476,... | 2.095238 | 336 |
#!/usr/bin/env python
import fileinput
import re
acronym = ""
for line in fileinput.input():
words = re.split('\s+', line)
for word in words:
if (len(word) > 0 and word[0] == word[0].upper()):
acronym += word[0]
print(acronym)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
2393,
15414,
198,
11748,
302,
198,
198,
330,
1313,
4948,
796,
13538,
198,
1640,
1627,
287,
2393,
15414,
13,
15414,
33529,
198,
220,
220,
220,
2456,
796,
302,
13,
35312,
107... | 2.278261 | 115 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
def cutoff(log,phi=None,sw=None,vsh=None,elbow=0.9,swaq=0.7,ax=None, plot=True):
"""cutoff [summary]
Parameters
----------
log : [type]
[description]
phi : [type], optional
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
220,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
987,
79,
16,
67,
198,
198,
4299,
45616... | 1.899957 | 2,339 |
from __future__ import absolute_import
from builtins import str
from builtins import range
from .base import BaseVnVmTest
import traffic_tests
from vn_test import *
from vm_test import *
from floating_ip import *
from policy_test import *
from compute_node_test import ComputeNodeFixture
from user_test import UserFixtur... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
3170,
1040,
1330,
965,
198,
6738,
3170,
1040,
1330,
2837,
198,
6738,
764,
8692,
1330,
7308,
53,
77,
53,
76,
14402,
198,
11748,
4979,
62,
41989,
198,
6738,
410,
77,
62,
9288,
... | 3.257862 | 318 |
# This is a client to readtags data from ID3 tags and POST the data to the mushme database
# @Author rootavish, copyright the DBMS team, 2014
import os
import sys
#To create a json to throw at the server
import json
#To encode the image into the json
import base64
#For the network capabilities
import urllib2
import ... | [
2,
770,
318,
257,
5456,
284,
1100,
31499,
1366,
422,
4522,
18,
15940,
290,
24582,
262,
1366,
284,
262,
15026,
1326,
6831,
198,
2,
2488,
13838,
6808,
615,
680,
11,
6634,
262,
20137,
5653,
1074,
11,
1946,
198,
198,
11748,
28686,
198,
... | 3.318681 | 182 |
import asyncio
from copy import copy
from time import time_ns
from brick.exceptions import ValidationError
from brick.hardware import Hardware, register_hardware
from brick.hardware.i2c import i2c_manager
from brick.hardware.base import DigitalInput, DigitalOutput
from brick.hardware.mcp import mcp230xx
MCP230XX_DEFA... | [
11748,
30351,
952,
198,
6738,
4866,
1330,
4866,
198,
6738,
640,
1330,
640,
62,
5907,
198,
6738,
17214,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
17214,
13,
10424,
1574,
1330,
28715,
11,
7881,
62,
10424,
1574,
198,
6738,
1721... | 2.533898 | 236 |
import os
import h5py
import json
import sys
sys.path.append('.')
import argparse
if __name__ == '__main__':
args = parse_arguments()
scenes = args.scenes
for scene in scenes:
try:
with open('{}/{}/metadata.json'.format(args.data_dir, scene), 'r') as f:
metadata_list =... | [
11748,
28686,
198,
11748,
289,
20,
9078,
198,
11748,
33918,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
2637,
8,
198,
11748,
1822,
29572,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
220,
220,
... | 1.935115 | 524 |
import pytest
import pennylane as qml
from pennylane import numpy as np
import qnetvo as qnet
| [
11748,
12972,
9288,
198,
11748,
22429,
2645,
1531,
355,
10662,
4029,
198,
6738,
22429,
2645,
1531,
1330,
299,
32152,
355,
45941,
198,
198,
11748,
10662,
3262,
13038,
355,
10662,
3262,
628
] | 3.096774 | 31 |
from django.shortcuts import render, get_object_or_404
from django.views.generic import ListView, DetailView
from .models import Product
from django.http import Http404
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,
42585,
7680,
198,
6738,
764,
27530,
1330,
8721,
198,
6738,
42625,
14208,
13,
... | 3.611111 | 54 |
__auther__ = "Will"
__project__ = "Prac 2"
import math
import matplotlib.pyplot as mpl
if __name__ == '__main__':
main() | [
834,
2306,
372,
834,
796,
366,
8743,
1,
198,
834,
16302,
834,
796,
366,
6836,
330,
362,
1,
198,
198,
11748,
10688,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
285,
489,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417... | 2.490196 | 51 |
from abc import ABC
from .module import Module
from .. import functional as F
from cranet import Tensor
from typing import (
Optional,
)
| [
6738,
450,
66,
1330,
9738,
198,
198,
6738,
764,
21412,
1330,
19937,
198,
6738,
11485,
1330,
10345,
355,
376,
198,
6738,
41286,
316,
1330,
309,
22854,
198,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
32233,
11,
198,
8,
628,
628,
... | 3.386364 | 44 |
import atexit
import errno
import inspect
import os
import stat
import subprocess
from threading import Thread
from uuid import uuid4
try:
import fuse # pytype: disable=import-error
except ImportError: # pragma: no cover
raise ImportError(
inspect.cleandoc(
'''
Failed to impor... | [
11748,
379,
37023,
198,
11748,
11454,
3919,
198,
11748,
10104,
198,
11748,
28686,
198,
11748,
1185,
198,
11748,
850,
14681,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
198,
28311,
25,
198,
220,
2... | 2.519435 | 283 |
"""
14499 : 주사위 굴리기
URL : https://www.acmicpc.net/problem/14499
Input #1 :
4 2 0 0 8
0 2
3 4
5 6
7 8
4 4 4 1 3 3 3 2
Output #1 :
0
0
3
0
0
8
6
3
Input #2 :
3 3 1 1 9
1 2 3
... | [
37811,
198,
220,
220,
220,
20224,
2079,
1058,
23821,
96,
120,
168,
8955,
168,
250,
226,
220,
166,
113,
112,
167,
99,
105,
166,
116,
108,
198,
220,
220,
220,
10289,
1058,
3740,
1378,
2503,
13,
330,
9383,
14751,
13,
3262,
14,
45573,
... | 1.670439 | 1,502 |
#!/usr/bin/env python
# sorry, this is very ugly, but I'm in python 2.5
import sys
sys.path.insert(0,"../..")
from ImpactDecoder import RadioTapDecoder
import dot11, ImpactPacket
from binascii import hexlify
import unittest
suite = unittest.TestLoader().loadTestsFromTestCase(TestRadioTapDecoder)
unittest.TextT... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
7926,
11,
428,
318,
845,
13400,
11,
475,
314,
1101,
287,
21015,
362,
13,
20,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
15,
553,
40720,
492,
4943,
198,
198,
673... | 2.81746 | 126 |
import os
| [
11748,
28686,
201,
198,
201,
198
] | 2.166667 | 6 |
from django.shortcuts import render, reverse
from django.views import View
from subject.models import subjectModel
from django.shortcuts import get_object_or_404
from video.models import videoModel
from line.models import lineModel
# rest framework
from django.http import Http404
from rest_framework.views import APIVie... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
9575,
198,
6738,
42625,
14208,
13,
33571,
1330,
3582,
198,
6738,
2426,
13,
27530,
1330,
2426,
17633,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
264... | 2.515528 | 805 |
class MyMeta(type):
""" Diese Metaklasse soll die Conventionen der Libary überwachen.
Conventionen: Alle Methoden und Attribute müssen klein geschrieben sein"""
# Klasse die gegen die Conventionen verstößt.
mc = MyClass(1)
print(mc.__class__.__mro__)
| [
4871,
2011,
48526,
7,
4906,
2599,
198,
220,
220,
220,
37227,
360,
444,
68,
3395,
461,
75,
21612,
523,
297,
4656,
11680,
268,
4587,
7980,
560,
6184,
120,
527,
86,
330,
831,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
11680,
26... | 2.445455 | 110 |
import unittest
from envirocar.client.api.track_api import _parse_track_df, _parse_tracks_list_df
if __name__ == '__main__':
unittest.main() | [
11748,
555,
715,
395,
198,
198,
6738,
17365,
7058,
7718,
13,
16366,
13,
15042,
13,
11659,
62,
15042,
1330,
4808,
29572,
62,
11659,
62,
7568,
11,
4808,
29572,
62,
46074,
62,
4868,
62,
7568,
198,
198,
361,
11593,
3672,
834,
6624,
705,
... | 2.607143 | 56 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.428125 | 320 |
# -*- coding: utf-8 -*- #
# Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
2,
15069,
33448,
3012,
11419,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198... | 2.997258 | 1,094 |
"""guess_rgb, guess_multiscale, guess_labels.
"""
import numpy as np
def guess_rgb(shape):
"""Guess if the passed shape comes from rgb data.
If last dim is 3 or 4 assume the data is rgb, including rgba.
Parameters
----------
shape : list of int
Shape of the data that should be checked.
... | [
37811,
5162,
408,
62,
81,
22296,
11,
4724,
62,
16680,
2304,
1000,
11,
4724,
62,
23912,
1424,
13,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
4724,
62,
81,
22296,
7,
43358,
2599,
198,
220,
220,
220,
37227,
8205,
4... | 2.491394 | 1,162 |
from compliance_checker.base import BaseCheck, BaseNCCheck, Result
import logging
logger = logging.getLogger(__name__)
from xsf_checker import __version__
| [
6738,
11846,
62,
9122,
263,
13,
8692,
1330,
7308,
9787,
11,
7308,
45,
4093,
258,
694,
11,
25414,
198,
198,
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
6738,
2124,
28202,
62,... | 3.18 | 50 |
# -*- coding: utf-8 -*-
# Copyright 2021 Google 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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
33448,
3012,
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... | 2.273636 | 2,401 |
#Podemos fazer uma análise agrupando a balneabilidade por campanha e depois salvamos o resultado também no formato csv:
import csv
# lê os dados
with open("balneabilidade.csv") as file:
beach_status_reader = csv.reader(file, delimiter=",", quotechar='"')
header, vinicius, *data = beach_status_reader
# agrupa ... | [
2,
41565,
368,
418,
277,
19178,
334,
2611,
281,
6557,
75,
786,
556,
12618,
25440,
257,
3652,
710,
14991,
312,
671,
16964,
1413,
272,
3099,
304,
1207,
10924,
24143,
321,
418,
267,
1255,
4533,
256,
4131,
2634,
76,
645,
1296,
5549,
269,
... | 2.203557 | 1,518 |
from dace import registry, InterstateEdge
from dace.properties import make_properties
from dace.transformation.interstate.loop_detection import DetectLoop
@registry.autoregister
@make_properties
class RemoveLoop(DetectLoop):
""" Unrolls a state machine for-loop into multiple states """
@staticmethod
| [
6738,
288,
558,
1330,
20478,
11,
30739,
37021,
198,
6738,
288,
558,
13,
48310,
1330,
787,
62,
48310,
198,
6738,
288,
558,
13,
7645,
1161,
13,
3849,
5219,
13,
26268,
62,
15255,
3213,
1330,
35874,
39516,
198,
198,
31,
2301,
4592,
13,
... | 3.658824 | 85 |
from markov_sentence_generator import MarkovModel
from markov_sentence_generator import SentenceGenerator
from error_correction import API_URL_BASE, correct_spelling
from sentences import Message
from itertools import chain
import random
import os
import socket
import sys
def parce_input():
"""
Чтение копуса сообще... | [
6738,
1317,
709,
62,
34086,
594,
62,
8612,
1352,
1330,
2940,
709,
17633,
198,
6738,
1317,
709,
62,
34086,
594,
62,
8612,
1352,
1330,
11352,
594,
8645,
1352,
198,
6738,
4049,
62,
10215,
8243,
1330,
7824,
62,
21886,
62,
33,
11159,
11,
... | 1.892361 | 3,168 |
from pygears.typing_common import flatten
from pygears.typing import Tuple, Unit, Uint
| [
6738,
12972,
70,
4127,
13,
774,
13886,
62,
11321,
1330,
27172,
268,
198,
6738,
12972,
70,
4127,
13,
774,
13886,
1330,
309,
29291,
11,
11801,
11,
471,
600,
628,
628,
628,
198
] | 2.90625 | 32 |
import asyncio
from datetime import datetime
from random import randint, shuffle
import common
from cogs.duelcog import item_chance_roll
from discord.ext import commands
from twython import TwythonError
class Twitter(commands.Cog):
""" Twitter Fetchers"""
@commands.command(name="trump")
async def get_tr... | [
11748,
30351,
952,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4738,
1330,
43720,
600,
11,
36273,
198,
198,
11748,
2219,
198,
6738,
269,
18463,
13,
646,
417,
66,
519,
1330,
2378,
62,
39486,
62,
2487,
198,
6738,
36446,
13,
2302... | 1.97448 | 3,605 |
# All content Copyright (C) 2018 Genomics plc
from wecall_test_drivers.base_test import BaseTest
from wecall_test_drivers.svc_driver import SVCDriver
| [
2,
1439,
2695,
15069,
357,
34,
8,
2864,
5215,
31994,
458,
66,
198,
6738,
356,
13345,
62,
9288,
62,
36702,
13,
8692,
62,
9288,
1330,
7308,
14402,
198,
6738,
356,
13345,
62,
9288,
62,
36702,
13,
21370,
66,
62,
26230,
1330,
20546,
8610... | 3.355556 | 45 |
import collections, sys, glob
p = p1()
| [
198,
11748,
17268,
11,
25064,
11,
15095,
198,
220,
220,
220,
220,
220,
220,
198,
220,
220,
198,
79,
796,
279,
16,
3419,
198
] | 2.083333 | 24 |
from sortedcontainers import SortedDict
from ..base.orderbook import OrderbookBase
from .websocket import BitbankWebsocket
from .api import BitbankApi
| [
6738,
23243,
3642,
50221,
1330,
311,
9741,
35,
713,
198,
198,
6738,
11485,
8692,
13,
2875,
2070,
1330,
8284,
2070,
14881,
198,
6738,
764,
732,
1443,
5459,
1330,
4722,
17796,
1135,
1443,
5459,
198,
6738,
764,
15042,
1330,
4722,
17796,
32... | 3.55814 | 43 |
"""
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
API-specific fixtures
"""
import pytest
from .helpers import assemble_authorization_header
API_TOKEN = 'testing-TESTING'
@pytest.fixture(scope='package')
@pytest.fixture(scope='package')
def api_client(api_app... | [
37811,
198,
25,
15269,
25,
4793,
12,
1238,
2481,
449,
420,
831,
509,
7211,
364,
354,
21184,
198,
25,
34156,
25,
31492,
347,
10305,
357,
3826,
4600,
43,
2149,
24290,
63,
2393,
329,
3307,
8,
198,
198,
17614,
12,
11423,
34609,
198,
378... | 2.939394 | 198 |
from .pos_embed import *
from .rel_multi_head import *
from .rel_bias import *
from .memory import *
from .scale import *
from .transformer_xl import *
from .loader import *
from .sequence import *
__version__ = '0.13.0'
| [
6738,
764,
1930,
62,
20521,
1330,
1635,
198,
6738,
764,
2411,
62,
41684,
62,
2256,
1330,
1635,
198,
6738,
764,
2411,
62,
65,
4448,
1330,
1635,
198,
6738,
764,
31673,
1330,
1635,
198,
6738,
764,
9888,
1330,
1635,
198,
6738,
764,
7645,
... | 3 | 74 |
import robin_stocks as robinhood
| [
11748,
3857,
259,
62,
29522,
355,
3857,
259,
2894,
198
] | 3.3 | 10 |
from articles.api.views import ArticleViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'', ArticleViewSet, base_name='articles')
urlpatterns = router.urls
| [
6738,
6685,
13,
15042,
13,
33571,
1330,
10172,
7680,
7248,
198,
6738,
1334,
62,
30604,
13,
472,
1010,
1330,
15161,
49,
39605,
198,
198,
472,
353,
796,
15161,
49,
39605,
3419,
198,
472,
353,
13,
30238,
7,
81,
6,
3256,
10172,
7680,
72... | 3.433333 | 60 |
FILE_PREFIX_NETWORK = 'network-'
| [
25664,
62,
47,
31688,
10426,
62,
12884,
33249,
796,
705,
27349,
19355,
198
] | 2.538462 | 13 |
# Python code to run State Evolution (SE) related functions for
# Sparse Regression Codes (SPARCs)
#
# 1. State evolution for general base matrix W.
# 2. Asymptotic state evolution for general base matrix W.
#
# Copyright (c) 2020 Kuan Hsieh
import numpy as np
from sparc import create_base_matrix, is_power_of_2, psk_c... | [
2,
11361,
2438,
284,
1057,
1812,
15815,
357,
5188,
8,
3519,
5499,
329,
198,
2,
1338,
17208,
3310,
2234,
44380,
357,
4303,
25793,
82,
8,
198,
2,
198,
2,
352,
13,
1812,
6954,
329,
2276,
2779,
17593,
370,
13,
198,
2,
362,
13,
1081,
... | 2.1578 | 2,218 |
import pandas as pd
import numpy as np
import sys
def clean(df):
"""
Takes a dataframe of salesforce data and maps values to a more usable format, returning a clean data set.
:param df: pandas DataFrame containing raw data
:return: df: cleaned data set - i.e. mapped to correct values
"""
... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
628,
198,
4299,
3424,
7,
7568,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
33687,
257,
1366,
14535,
286,
4200,
3174,
1366,
290,
8739,
381... | 2.243154 | 2,410 |
from keras.regularizers import *
class L1L2Lp(Regularizer):
"""Regularizer for L1, L2, and Lp regularization.
# Arguments
l1: Float; L1 regularization factor.
l2: Float; L2 regularization factor.
lp: Float; Lp regularization factor.
p: Float; Lp regularization exponent.
"""... | [
6738,
41927,
292,
13,
16338,
11341,
1330,
1635,
198,
198,
4871,
406,
16,
43,
17,
43,
79,
7,
40164,
7509,
2599,
198,
220,
220,
220,
37227,
40164,
7509,
329,
406,
16,
11,
406,
17,
11,
290,
406,
79,
3218,
1634,
13,
628,
220,
220,
2... | 2.481481 | 135 |
'''for c in range(1, 10):
print(c)
print('FIM')'''
# pode usar while ou for quando sabemos o limite da repetição
#crescente
c = 1
while c < 10:
print(c)
c += 1
print('FIM')
# while decrescente
n = int(input('Digite um número para\nCalcular seu fatorial: '))
c = n
while c > 0:
print(c)
c -= 1
# So... | [
7061,
6,
1640,
269,
287,
2837,
7,
16,
11,
838,
2599,
198,
220,
220,
220,
3601,
7,
66,
8,
198,
4798,
10786,
37,
3955,
11537,
7061,
6,
198,
2,
279,
1098,
514,
283,
981,
267,
84,
329,
627,
25440,
17463,
368,
418,
267,
1761,
578,
... | 2.08313 | 409 |
""" Train for generating LIIF, from image to implicit representation.
Config:
train_dataset:
dataset: $spec; wrapper: $spec; batch_size:
val_dataset:
dataset: $spec; wrapper: $spec; batch_size:
(data_norm):
inp: {sub: []; div: []}
gt: {sub: []; di... | [
37811,
16835,
329,
15453,
406,
3978,
37,
11,
422,
2939,
284,
16992,
10552,
13,
628,
220,
220,
220,
17056,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
19608,
292,
316,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,... | 2.432099 | 810 |
import cv2
import depthai
import numpy as np # numpy - manipulate the packet data returned by depthai
import math
from math import cos, sin, tan, pi
from paho.mqtt import client as mqtt_client
from time import sleep
import time
from scipy.optimize import minimize
import datetime
broker = '10.44.99.11'
port = 1883
pub... | [
11748,
269,
85,
17,
198,
11748,
6795,
1872,
198,
11748,
299,
32152,
355,
45941,
220,
1303,
299,
32152,
532,
18510,
262,
19638,
1366,
4504,
416,
6795,
1872,
198,
11748,
10688,
198,
6738,
10688,
1330,
8615,
11,
7813,
11,
25706,
11,
31028,... | 2.302625 | 6,133 |
#!/usr/env/python
## Import General Tools
import sys
import os
from datetime import datetime as dt
import re
from glob import glob
import numpy as np
import json
import matplotlib as mpl
mpl.use('Agg')
from matplotlib import pyplot as plt
##-------------------------------------------------------------------------
##... | [
2,
48443,
14629,
14,
24330,
14,
29412,
198,
198,
2235,
17267,
3611,
20003,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
355,
288,
83,
198,
11748,
302,
198,
6738,
15095,
1330,
15095,
198,
11748,
299,
321... | 4.245283 | 106 |
import pandas as pd
import prettytable
import time
from abc import ABC, abstractmethod
from collections import OrderedDict
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.decomposition import TruncatedSVD
from sklearn.base import BaseEstimator
from .vectorizers import BM25Vectorizer
from transf... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
2495,
11487,
198,
11748,
640,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
13... | 2.839227 | 3,620 |
"""
Multi-objective EA.
"""
import os
import array
import multiprocessing
import numpy
from deap import base
from deap import creator
from generator.helpers import *
# -------- Dataset Parameters --------
n = 100 # number of instances
m = 15 # number of attributes
# -------- GA Parameters --------
MIN_VALUE = 0 ... | [
37811,
198,
29800,
12,
15252,
425,
19814,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
7177,
198,
11748,
18540,
305,
919,
278,
198,
11748,
299,
32152,
198,
6738,
390,
499,
1330,
2779,
198,
6738,
390,
499,
1330,
13172,
628,
198,
6738,
... | 2.319932 | 1,766 |
'''
module with class definition and methods for reading and writing .grp files
Created on Jun 20, 2012
@author: David Wadden
'''
import os, re
class GRP:
'''
class to read .grp files and return a list
'''
def read(self, in_path):
'''
read a .grp file
'''
with open(in_pa... | [
7061,
6,
198,
21412,
351,
1398,
6770,
290,
5050,
329,
3555,
290,
3597,
764,
2164,
79,
3696,
198,
41972,
319,
7653,
1160,
11,
2321,
198,
31,
9800,
25,
3271,
370,
38014,
198,
7061,
6,
198,
11748,
28686,
11,
302,
198,
4871,
10863,
47,
... | 2.122378 | 572 |
import pytest
from unittest import mock
from awx.main.models import AdHocCommand, InventoryUpdate, Job, JobTemplate, ProjectUpdate
from awx.main.models.ha import Instance, InstanceGroup
from awx.main.tasks import apply_cluster_membership_policies
from awx.api.versioning import reverse
from django.utils.timezone impor... | [
11748,
12972,
9288,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
3253,
87,
13,
12417,
13,
27530,
1330,
1215,
39,
420,
21575,
11,
35772,
10260,
11,
15768,
11,
15768,
30800,
11,
4935,
10260,
198,
6738,
3253,
87,
13,
12417,
13,... | 2.492674 | 546 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import preprocessing as prep
from scipy.stats import norm
# Animated
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
11227,
341,
355,
11034,
198,
11748,
662,
36948,
355,
3143,
198,
6738,
629,
541,
88,
13,
34242,
1330,
2593,
... | 3.4 | 50 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33448,
383,
3012,
4992,
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,
... | 2.6873 | 2,504 |
"""
Copyright 2016 Disney Connected and Advanced Technologies
Licensed under the Apache License, Version 2.0 (the "Apache License")
with the following modification; you may not use this file except in
compliance with the Apache License and the following modification to it:
Section 6. Trademarks. is deleted and replace... | [
37811,
198,
15269,
1584,
8519,
8113,
276,
290,
13435,
21852,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
25189,
4891,
13789,
4943,
198,
4480,
262,
1708,
17613,
26,
345,
743,
407,
779,
428,
2... | 3.195929 | 786 |
from flask import Blueprint, render_template, abort
upload = Blueprint('upload', __name__,
template_folder='templates')
@upload.route('/upload') | [
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
11,
15614,
198,
198,
25850,
796,
39932,
10786,
25850,
3256,
11593,
3672,
834,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220... | 2.698413 | 63 |
# coding: utf-8
#
# Copyright 2019, Kurusugawa Computer 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 applicab... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
13130,
11,
18132,
385,
1018,
6909,
13851,
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,
40... | 2.730821 | 743 |
# INIT DATA
members=[
{
"id":"10001",
"firstName":"Marry",
"lastName":"Jane",
"role":"Admin",
"email":"j.marry@mail.com",
"password":"password1",
},
{
"id":"10002",
"firstName":"Tommy",
"lastName":"Miller",
"role":"Developer",... | [
2,
220,
3268,
2043,
42865,
198,
198,
30814,
41888,
198,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
312,
2404,
3064,
486,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
11085,
5376,
2404,
44,
6532,
1600,
... | 1.877358 | 212 |
from os import path
from setuptools import setup, find_packages
from biokit.version import __version__
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md")) as f:
long_description = f.read()
CLASSIFIERS = [
"Operating System :: OS Independent",
"Intended Audience :: Science... | [
6738,
28686,
1330,
3108,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
6738,
3182,
482,
270,
13,
9641,
1330,
11593,
9641,
834,
198,
198,
1456,
796,
3108,
13,
397,
2777,
776,
7,
6978,
13,
15908,
3672,
7,
83... | 1.96859 | 4,107 |
from typing import Dict
from typing import List
from typing import Any
from typing import Callable
from typing import Optional
from types import ModuleType
import os
import json
import yaml
from syncgit import _gitcmd as gitcmd
from syncgit._gitcmd import RepoInfo
from syncgit._threadsafe_dict import ThreadSafeDict
f... | [
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
4889,
540,
198,
6738,
19720,
1330,
32233,
198,
6738,
3858,
1330,
19937,
6030,
198,
198,
11748,
28686,
198,
11748,
33918,
198,... | 3.776786 | 112 |
"""
Various Python utilities.
"""
from inspect import getmembers, getmodule, isfunction, ismethod
def full_name(item):
"""Return the full name of a something passed in so it can be retrieved
later on.
"""
if isinstance(item, basestring):
return item
if ismethod(item):
module_na... | [
37811,
198,
220,
220,
220,
26386,
11361,
20081,
13,
198,
37811,
198,
6738,
10104,
1330,
651,
30814,
11,
651,
21412,
11,
318,
8818,
11,
318,
24396,
628,
198,
4299,
1336,
62,
3672,
7,
9186,
2599,
198,
220,
220,
220,
37227,
13615,
262,
... | 2.408497 | 612 |
import numpy as np
import seekpath
if __name__ == '__main__':
import os
import sys
import yaml
from phonopy import Phonopy
from phonopy.interface.phonopy_yaml import get_unitcell_from_phonopy_yaml
from phonopy.file_IO import parse_FORCE_SETS, parse_BORN
import matplotlib
if len(sys.arg... | [
11748,
299,
32152,
355,
45941,
198,
11748,
5380,
6978,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1330,
28686,
198,
220,
220,
220,
1330,
25064,
198,
220,
220,
220,
1330,
331,
43695,
198,
22... | 1.904798 | 1,334 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import torch.utils.data
import numpy
import os
MAX_VALUE = 413.5
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
11748,
28034,
13,
26791,
13,
7890,
201,
198,
11748,
299,
32152,
201,
198,
11748,
28686,
201,
198,
201,
198,
... | 2.118644 | 59 |
#encoding: utf8
from gevent import monkey; monkey.patch_socket()
import gevent
import gzip
import time
codes = [
('2900',
u'\u05de\u05e9\u05e8\u05d3 \u05d4\u05d1\u05d9\u05e0\u05d5\u05d9 \u05d5\u05d4\u05e9\u05d9\u05db\u05d5\u05df'),
('3600', u'\u05de\u05e9\u05e8\u05d3 \u05d4\u05ea\u05de\u05ea'),
('0400',
u'\u05... | [
2,
12685,
7656,
25,
3384,
69,
23,
198,
198,
6738,
4903,
1151,
1330,
21657,
26,
21657,
13,
17147,
62,
44971,
3419,
198,
11748,
4903,
1151,
198,
11748,
308,
13344,
198,
11748,
640,
198,
198,
40148,
796,
685,
198,
19203,
1959,
405,
3256,... | 1.430904 | 5,695 |
# coding: utf-8
from __future__ import print_function, unicode_literals
import tarfile
import threading
from .sutil import errdesc
from .util import Queue, fsenc
from .bos import bos
class QFile(object):
"""file-like object which buffers writes into a queue"""
class StreamTar(object):
"""construct in-memo... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
13422,
7753,
198,
11748,
4704,
278,
198,
198,
6738,
764,
82,
22602,
1330,
1931,
4372,
3798,
198,
6... | 3.317757 | 107 |
import pandas as pd
test_records = [
(1228, False, 1.0, 'QQ', 'VII', 'Pullover', 27.341917760765206, 617.516272605143, 2896.437068349862, 'AB', 0.00036614625001438027, 6.790803554896343e-05, True),
(1792, False, 1.0, 'AAT', 'X', 'Trouser', 92.06323912407882, 214.45262374753824, 2090.98... | [
11748,
19798,
292,
355,
279,
67,
198,
9288,
62,
8344,
3669,
796,
220,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1065,
2078,
11,
10352,
11,
352,
13,
15,
11,
705,
48,
48,
3256,
705,
... | 1.672691 | 498 |
from .utils import prettify, highlight
| [
6738,
764,
26791,
1330,
46442,
1958,
11,
7238,
628
] | 4.444444 | 9 |
#!/usr/bin/env python
"""
demo_leds -- demo of blink1 library showing independent LED access
"""
import time,sys
from blink1.blink1 import Blink1
try:
blink1 = Blink1()
except:
print("no blink1 found")
sys.exit()
print("fading to 255,0,0 on LED1" )
blink1.fade_to_rgb(500, 255, 0, 0, 1)
print("fading t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
9536,
78,
62,
992,
82,
1377,
13605,
286,
21019,
16,
5888,
4478,
4795,
12365,
1895,
198,
198,
37811,
198,
11748,
640,
11,
17597,
198,
6738,
21019,
16,
13,
2436,
676,
... | 2.295337 | 386 |
import torch
from metrics.base_metric import BaseMetric
| [
11748,
28034,
198,
198,
6738,
20731,
13,
8692,
62,
4164,
1173,
1330,
7308,
9171,
1173,
628,
198
] | 3.470588 | 17 |
import unittest
from typing import Callable
import numpy as np
from l5kit.random import GaussianRandomGenerator, LambdaRandomGenerator, ReplayRandomGenerator
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
19720,
1330,
4889,
540,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
300,
20,
15813,
13,
25120,
1330,
12822,
31562,
29531,
8645,
1352,
11,
21114,
6814,
29531,
8645,
1352,
11,
23635,
29531,
86... | 3.181818 | 66 |
'''
Write a program to read 6 integers (y1, m1, d1, y2, m2, and d2)
- y1 m1 and d1 are the year, month and birthday of the first friend
- y2 m2 and d2 are the year, month and second friend's birthday
Write a program to find out which friend was born first. If the first person is born first, print “1”, if the
second fri... | [
7061,
6,
198,
16594,
257,
1430,
284,
1100,
718,
37014,
357,
88,
16,
11,
285,
16,
11,
288,
16,
11,
331,
17,
11,
285,
17,
11,
290,
288,
17,
8,
198,
12,
331,
16,
285,
16,
290,
288,
16,
389,
262,
614,
11,
1227,
290,
10955,
286,
... | 2.364486 | 321 |
from datetime import datetime
from investing_algorithm_framework.core.models.model_extension import \
ModelExtension
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
14771,
62,
282,
42289,
62,
30604,
13,
7295,
13,
27530,
13,
19849,
62,
2302,
3004,
1330,
3467,
198,
220,
220,
220,
9104,
11627,
3004,
628
] | 3.617647 | 34 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 28 13:06:14 2021
@author: Denise Lanzieri
"""
import bigfile
from lenstools.simulations.nbody import NbodySnapshot
import numpy as np
a2z = lambda a: 1 / a - 1
class FastPMSnapshot(NbodySnapshot):
"""
A class that handles FastPM simulation ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
1526,
2579,
1511,
25,
3312,
25,
1415,
33448,
198,
198,
31,
9800,
25,
43596,
14730,
... | 3.465035 | 286 |
'''
Aula 25 - Operadores de comparação
'''
print(20 == 21) # False
print(20 != 21) # True
print(21 > 1) # True
print(20 == 20 and 20 != 21) # True | [
7061,
6,
198,
220,
220,
220,
317,
4712,
1679,
532,
6564,
324,
2850,
390,
552,
3301,
16175,
28749,
198,
7061,
6,
198,
198,
4798,
7,
1238,
6624,
2310,
8,
1303,
10352,
198,
4798,
7,
1238,
14512,
2310,
8,
1303,
6407,
198,
4798,
7,
248... | 2.412698 | 63 |
'''import the required packages and read the file.'''
import pandas as pd
import numpy as np
print('reading file')
data = pd.read_csv('../data/input_file_1.csv.zip', sep = ',', index_col=0, compression='zip')
print('file shape', data.shape)
'''parse column to date format'''
print('date encoding')
data['issue_d'... | [
7061,
6,
11748,
262,
2672,
10392,
290,
1100,
262,
2393,
2637,
7061,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4798,
10786,
25782,
2393,
11537,
198,
198,
7890,
796,
279,
67,
13,
961,
62,
... | 2.68285 | 1,586 |
import yaml
import os
from sys import exit
from psypose.utils import MEVA_CFG_DIR, MEVA_DATA_DIR
if __name__ == '__main__':
cfg = Config('1212')
pass
| [
11748,
331,
43695,
198,
11748,
28686,
198,
6738,
25064,
1330,
8420,
198,
6738,
17331,
3455,
13,
26791,
1330,
11948,
11731,
62,
22495,
38,
62,
34720,
11,
11948,
11731,
62,
26947,
62,
34720,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834... | 2.596774 | 62 |
from fenics import *
import numpy as np
import matplotlib.pyplot as plt
parameters["form_compiler"]["quadrature_degree"] = 4
parameters["form_compiler"]["cpp_optimize"] = True
def load_ellipsoid_data():
"""Returns 4-tuple:
mesh - the mesh,
mf - MeshFunction defining boundary markers,
numbering - dic... | [
6738,
277,
268,
873,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
17143,
7307,
14692,
687,
62,
5589,
5329,
1,
7131,
1,
421,
41909,
1300,
62,
16863,
8973,
796,
... | 2.143357 | 1,430 |
# Python stubs generated by omniidl from ..\..\..\..\..\idl\COS\CosNotification.idl
# DO NOT EDIT THIS FILE!
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
property
except NameError:
#
# Start of module "CosNotific... | [
2,
11361,
17071,
82,
7560,
416,
39030,
8461,
312,
75,
422,
11485,
59,
492,
59,
492,
59,
492,
59,
492,
59,
312,
75,
59,
34,
2640,
59,
36734,
3673,
2649,
13,
312,
75,
201,
198,
2,
8410,
5626,
48483,
12680,
45811,
0,
201,
198,
201,... | 2.696475 | 8,029 |
import threading
import logging
logger = logging.getLogger('opentsdb-py')
| [
11748,
4704,
278,
198,
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
404,
658,
9945,
12,
9078,
11537,
628
] | 3.166667 | 24 |
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.views.generic import TemplateView, RedirectView
from devroom.models import Devroom, DevroomParticipants
from exhibitor.models import Exhibitor, ExhibitorParticipants
from sabot.multiYear import getActiveYear
from sponsor.models imp... | [
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
11,
2297,
1060,
7680,
198,
198,
6738,
1614,
... | 3.862069 | 87 |
# -*- coding: utf-8 -*-
"""
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available.
* Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1635,
9368,
1087,
14573,
15708,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
12,
164,
... | 3.14845 | 613 |
from selenium import webdriver
from selenium.webdriver.common.by import By
import random
import time
# Caminho para webDriver
PATH = r'C:\Users\Lucas\Documents\Meus-projetos\Jogo-da-Forca\chromedriver.exe'
print('você pode errar seis vezes a letra.')
print('Escolha o tipo de palavra: ')
print('\n1 ... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
11748,
4738,
198,
11748,
640,
198,
198,
2,
327,
5669,
8873,
31215,
3992,
32103,
198,
34219,
796,
374,
6,
3... | 2.010036 | 1,096 |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from scheduler.utils.validation import Validation
from panopto_client.remote_recorder import RemoteRecorderManagement
import re
| [
2,
15069,
33448,
33436,
12,
2043,
11,
2059,
286,
2669,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
6738,
6038,
18173,
13,
26791,
13,
12102,
341,
1330,
3254,
24765,
198,
6738,
3425,
404,
1462,
... | 3.65 | 60 |
# -*- coding: utf-8 -*-
"""
Whiley Test
~~~~~~~~~~~
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pytest
from pygments.lexers import WhileyLexer
from pygments.token import Token
@pytest.fixture(scope='module')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
2893,
88,
6208,
198,
220,
220,
220,
220,
15116,
4907,
93,
628,
220,
220,
220,
1058,
22163,
4766,
25,
15069,
4793,
12,
1238,
2481,
416,
262,
... | 2.738739 | 111 |
import warnings
import param
import numpy as np
import holoviews as hv
import geoviews as gv
import cartopy.crs as ccrs
import datashader as ds
from PIL import Image, ImageDraw
from holoviews.core.operation import Operation
from holoviews.core.util import pd
from holoviews.element.util import split_path
from holoview... | [
11748,
14601,
198,
198,
11748,
5772,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
6039,
709,
769,
82,
355,
289,
85,
198,
11748,
4903,
709,
769,
82,
355,
308,
85,
198,
11748,
6383,
11081,
13,
66,
3808,
355,
36624,
3808,
198,
11748,
... | 2.73857 | 853 |
## Wrangle CCdata_merged and add previous grocery trip, spend and previous restaurant trip, spend or each transaction
# Change amount to float datatype and remove , if any, in the amount value
print(CCdata['Amount'].dtype)
CCdata['Amount'] = CCdata['Amount'].str.replace('\,','') # removing all , in the amount values
C... | [
2235,
15634,
9248,
12624,
7890,
62,
647,
2004,
290,
751,
2180,
16918,
5296,
11,
4341,
290,
2180,
7072,
5296,
11,
4341,
393,
1123,
8611,
198,
198,
2,
9794,
2033,
284,
12178,
4818,
265,
2981,
290,
4781,
837,
611,
597,
11,
287,
262,
20... | 2.77868 | 2,955 |
"""Tokens for one-time use"""
# Built-in
from datetime import datetime, timedelta, timezone
from secrets import token_urlsafe
# Django
from django.contrib.auth import get_user_model
from django.db.models import CharField, DateTimeField, Index
# Personal
from jklib.django.db.fields import ActiveField, ForeignKeyCasca... | [
37811,
22906,
329,
530,
12,
2435,
779,
37811,
198,
198,
2,
28477,
12,
259,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
640,
11340,
198,
6738,
13141,
1330,
11241,
62,
6371,
21230,
198,
198,
2,
37770,
198,
6738,
42625... | 2.615737 | 3,279 |
# encoding:utf-8
"""
爬取快代理的所有的ip:port,并验证是否可用
"""
from selenium import webdriver
import urllib2
import time
for i in range(10):
url = "https://www.kuaidaili.com/free/inha/"
driver = webdriver.Chrome(r"C:\Users\19663\Desktop\chromedriver.exe")
url = url + str(i + 1) + "/"
driver.get(url)
time.sleep(... | [
2,
21004,
25,
40477,
12,
23,
198,
37811,
198,
163,
230,
105,
20998,
244,
33232,
104,
47987,
49426,
228,
21410,
33699,
222,
17312,
231,
21410,
541,
25,
634,
11,
33176,
114,
165,
103,
234,
46237,
223,
42468,
28938,
99,
20998,
107,
18796... | 1.98125 | 480 |
# gemato: CLI routines
# vim:fileencoding=utf-8
# (c) 2017-2019 Michał Górny
# Licensed under the terms of 2-clause BSD license
from __future__ import print_function
import argparse
import datetime
import io
import logging
import multiprocessing
import os.path
import sys
import timeit
import gemato.exceptions
import... | [
2,
16840,
5549,
25,
43749,
31878,
198,
2,
43907,
25,
7753,
12685,
7656,
28,
40477,
12,
23,
198,
2,
357,
66,
8,
2177,
12,
23344,
38844,
41615,
402,
10205,
81,
3281,
198,
2,
49962,
739,
262,
2846,
286,
362,
12,
565,
682,
347,
10305,... | 2.564617 | 797 |
"""KafkaUtils"""
import logging
import kafka
from retrying import retry
logger = logging.getLogger()
class KafkaUtils:
"""Common kafka utils"""
@staticmethod
@retry(stop_max_attempt_number=8, wait_fixed=15000)
def wait_for_topic_status(bootstrap_servers, topic_name,
e... | [
37811,
42,
1878,
4914,
18274,
4487,
37811,
198,
11748,
18931,
198,
198,
11748,
479,
1878,
4914,
198,
6738,
1005,
14992,
1330,
1005,
563,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
3419,
628,
198,
4871,
46906,
18274,
4487,
... | 2.250784 | 319 |
# %% [markdown]
# # Python Workshop: Basics I
#
# [If you are looking for the **Python, Pycharm & packages installation guide**, [it's here.](https://www.aiismath.com/pages/python_pycharm_installation/python_pycharm_installation/)]
#
# [](https:/... | [
2,
43313,
685,
4102,
2902,
60,
198,
2,
1303,
11361,
26701,
25,
45884,
314,
198,
2,
198,
2,
685,
1532,
345,
389,
2045,
329,
262,
12429,
37906,
11,
9485,
354,
1670,
1222,
10392,
9988,
5698,
1174,
11,
685,
270,
338,
994,
8183,
7,
545... | 2.901568 | 3,444 |
"""Overlap Technical Analysis"""
___docformat__ = "numpy"
import pandas as pd
import pandas_ta as ta
def ema(s_interval: str, df_stock: pd.DataFrame, window_length: int) -> pd.DataFrame:
"""Gets exponential moving average (EMA) for stock
Parameters
----------
s_interval: str
Data interval
... | [
37811,
5886,
37796,
20671,
14691,
37811,
198,
17569,
15390,
18982,
834,
796,
366,
77,
32152,
1,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
19798,
292,
62,
8326,
355,
20486,
628,
198,
4299,
795,
64,
7,
82,
62,
3849,
2100,
... | 2.236884 | 1,887 |