content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import json
import csv
import inspect
import os
import re
import numpy as np
import pandas as pd
import time
from sklearn.svm import SVR
from sklearn.tree import DecisionTreeRegressor
from sklearn.neighbors import KNeighborsRegressor
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor, AdaBoo... | [
11748,
33918,
198,
11748,
269,
21370,
198,
11748,
10104,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
640,
198,
198,
6738,
1341,
35720,
13,
82,
14761,
1330,
31... | 2.115918 | 2,959 |
lista = list()
impar = list()
par = list()
while True:
lista.append(int(input('Digite um valor: ')))
c = str(input('Deseja Continuar?[S/N]: ')).strip().upper()
while c not in 'SN':
c = str(input('Deseja Continuar?[S/N]: ')).strip().upper()
if c == 'N':
break
lista.sort()
for cont, valor ... | [
4868,
64,
796,
1351,
3419,
198,
320,
1845,
796,
1351,
3419,
198,
1845,
796,
1351,
3419,
198,
4514,
6407,
25,
198,
220,
220,
220,
1351,
64,
13,
33295,
7,
600,
7,
15414,
10786,
19511,
578,
23781,
1188,
273,
25,
705,
22305,
198,
220,
... | 2.161049 | 267 |
import pytest
import demistomock as demisto
from ServiceDeskPlus import Client, create_request_command, update_request_command, list_requests_command, \
linked_request_command, get_resolutions_list_command, delete_request_command, assign_request_command, \
pickup_request_command, modify_linked_request_command, ... | [
11748,
12972,
9288,
198,
11748,
1357,
396,
296,
735,
355,
1357,
396,
78,
198,
6738,
4809,
42523,
17860,
1330,
20985,
11,
2251,
62,
25927,
62,
21812,
11,
4296,
62,
25927,
62,
21812,
11,
1351,
62,
8897,
3558,
62,
21812,
11,
3467,
198,
... | 2.789655 | 5,529 |
import json
import pickle
import collections
from tf.fabric import Fabric
from pathlib import Path
from verb_form import get_verbform
# load basic BHSA data with Text-Fabric
TF = Fabric(snakemake.input, silent='deep')
bhsa = TF.load('pdp lex vt language', silent='deep')
F, L = bhsa.F, bhsa.L
# load GBI data for verb_... | [
11748,
33918,
198,
11748,
2298,
293,
198,
11748,
17268,
198,
6738,
48700,
13,
36434,
1173,
1330,
37759,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
15942,
62,
687,
1330,
651,
62,
19011,
687,
198,
198,
2,
3440,
4096,
347,
39,
4090,
... | 2.603819 | 419 |
import matplotlib.pyplot
from matplotlib.pyplot import *
import numpy
from numpy import linspace
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
198,
6738,
2603,
29487,
8019,
13,
9078,
29487,
1330,
1635,
198,
11748,
299,
32152,
198,
6738,
299,
32152,
1330,
300,
1040,
10223,
628
] | 3.266667 | 30 |
import pytest
from packerlicious import Ref, EnvVar, TemplateVar, UserVar, PackerVariable
| [
11748,
12972,
9288,
198,
198,
6738,
2353,
263,
677,
699,
1330,
6524,
11,
2039,
85,
19852,
11,
37350,
19852,
11,
11787,
19852,
11,
6400,
263,
43015,
628
] | 3.407407 | 27 |
from .base import BaseQueryStrategy
import numpy as np
import scipy
class Prototypes():
"""
This is a class for storing and computing prototypes for use within Prototypical query strategy
vettings. It may be called directly if you wanted to compute those outside of the
query strategy
"""
def _... | [
6738,
764,
8692,
1330,
7308,
20746,
13290,
4338,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
198,
198,
4871,
5038,
13567,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
318,
257,
1398,
329,
23069,
290,
14... | 2.498638 | 1,468 |
"""Python Docstring to Markdown
Attempts to parse a python document and resolve a markdown file with unique formatting.
Assumes Google's Docstring formatting.
"""
import ast
import sys
# Import the local files
from . import DocumentDocstring
from . import GoogleDocstring
from . import HtmlMarkdownBuilder
def cli... | [
37811,
37906,
14432,
8841,
284,
2940,
2902,
198,
48452,
284,
21136,
257,
21015,
3188,
290,
10568,
257,
1317,
2902,
2393,
351,
3748,
33313,
13,
220,
220,
198,
8021,
8139,
3012,
338,
14432,
8841,
33313,
13,
198,
37811,
198,
198,
11748,
64... | 2.561404 | 456 |
from .constant import POSITION_MAP, PRO_TEAM_MAP, STATS_MAP
from .utils import json_parsing
import pdb
class Roster(object):
'''Roster contains lineup and stat data for a particular scoring period'''
| [
6738,
764,
9979,
415,
1330,
28069,
17941,
62,
33767,
11,
21965,
62,
9328,
2390,
62,
33767,
11,
37889,
62,
33767,
198,
6738,
764,
26791,
1330,
33918,
62,
79,
945,
278,
198,
11748,
279,
9945,
198,
198,
4871,
371,
6197,
7,
15252,
2599,
... | 3.253968 | 63 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 2.306712 | 1,177 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 24 02:00:48 2020
@author: hiroyasu
"""
import numpy as np
import pandas as pd
import surprise as sur
from surprise import accuracy
import pickle
if __name__ == "__main__":
M = 943
N = 1682
K = 20
trainset,Y_train,Y_test = GetTrainSe... | [
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,
2892,
3158,
1987,
7816,
25,
405,
25,
2780,
12131,
198,
198,
31,
9800,
25,
23105,
3287,
27... | 2.013441 | 372 |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
2,
15069,
357,
66,
8,
33448,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845... | 3.249097 | 277 |
'''
Nd Genie Ops Object Outputs for NXOS.
'''
| [
7061,
6,
198,
399,
67,
49405,
26123,
9515,
25235,
82,
329,
42482,
2640,
13,
198,
7061,
6,
198
] | 2.611111 | 18 |
from datetime import date
from datetime import datetime
from datetime import timedelta
import json
import os
import random
import string
import time
import unittest
import warnings
from testing_context import plumage
CONFIGFILE = "test-config.json"
if __name__ == '__main__':
unittest.main(verbosity=2)
| [
6738,
220,
220,
4818,
8079,
220,
1330,
3128,
198,
6738,
220,
220,
4818,
8079,
220,
1330,
4818,
8079,
198,
6738,
220,
220,
4818,
8079,
220,
1330,
28805,
12514,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
4731,
198... | 3.168317 | 101 |
import os
import datetime
import yaml
| [
11748,
28686,
198,
11748,
4818,
8079,
198,
198,
11748,
331,
43695,
628
] | 3.333333 | 12 |
import torch
from option import parse_option
import sys
sys.path.append("..")
from main_pretrain import build_model
args = parse_option(stage='pre_train')
model, _ = build_model(args)
model.eval()
# SoCo_C4
img1 = torch.rand((2, 3, 224, 224)).cuda()
img2 = torch.rand((2, 3, 224, 224)).cuda()
bbox1 = torch.rand((2,... | [
11748,
28034,
198,
198,
6738,
3038,
1330,
21136,
62,
18076,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
492,
4943,
198,
198,
6738,
1388,
62,
5310,
3201,
1330,
1382,
62,
19849,
198,
198,
22046,
796,
21136,
62,
18076,
... | 2.249612 | 645 |
# Register the hex-bytes codec.
register_sark_codecs()
# Since some of our code can be used outside of IDA, namely the `plumbing` module
# when used in the codecs proxy, we want to allow importing specific modules outside
# IDA.
if is_in_ida():
from . import (core,
code,
exc... | [
198,
198,
2,
17296,
262,
17910,
12,
33661,
40481,
13,
198,
30238,
62,
82,
668,
62,
19815,
721,
82,
3419,
198,
198,
2,
4619,
617,
286,
674,
2438,
460,
307,
973,
2354,
286,
4522,
32,
11,
14811,
262,
4600,
489,
28149,
63,
8265,
198,
... | 2.135556 | 450 |
"""This provides Bcfg2 support for macports packages."""
import Bcfg2.Client.Tools
class MacPorts(Bcfg2.Client.Tools.PkgTool):
"""macports package support."""
name = 'MacPorts'
__execs__ = ["/opt/local/bin/port"]
__handles__ = [('Package', 'macport')]
__req__ = {'Package': ['name', 'version']}
... | [
37811,
1212,
3769,
347,
37581,
17,
1104,
329,
8352,
3742,
10392,
526,
15931,
198,
198,
11748,
347,
37581,
17,
13,
11792,
13,
33637,
628,
198,
4871,
4100,
47,
2096,
7,
33,
37581,
17,
13,
11792,
13,
33637,
13,
47,
10025,
25391,
2599,
... | 2.180639 | 1,002 |
import numpy as np
import pandas as pd
import csv
import re
import os
from fastdtw import fastdtw
from auxiliaryfunctions import *
df = pd.read_pickle('./final_cleaned.df')
#l = df['timestamp_longitude_latitude'].iloc[0]
with open('datasets/test_set_a1.csv','r') as f:
reader = csv.reader(f)
data = (list(rec)... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
269,
21370,
198,
11748,
302,
198,
11748,
28686,
198,
6738,
3049,
67,
4246,
1330,
3049,
67,
4246,
198,
6738,
37419,
12543,
2733,
1330,
1635,
628,
198,
7568,... | 2.265806 | 775 |
#!/usr/bin/env python
'''module for real time place preference test'''
import os
import sys
import time
import datetime
import copy
import threading
import queue
import argparse
import subprocess
import cv2
import skvideo.io
import numpy as np
from gpiozero import LED
from picamera import PiCamera
from picamera.array ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
21412,
329,
1103,
640,
1295,
12741,
1332,
7061,
6,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
4866,
198,
11748,
4704,
278,
... | 2.083799 | 9,833 |
from model.group import Group
| [
6738,
2746,
13,
8094,
1330,
4912,
628,
628
] | 4.125 | 8 |
# -*- coding: utf-8 -*-
"""
Tests of the neo.core.spike.Spike class
"""
try:
import unittest2 as unittest
except ImportError:
import unittest
import numpy as np
import quantities as pq
try:
from IPython.lib.pretty import pretty
except ImportError as err:
HAVE_IPYTHON = False
else:
HAVE_IPYTHON = ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
51,
3558,
286,
262,
19102,
13,
7295,
13,
2777,
522,
13,
4561,
522,
1398,
198,
37811,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
555,
715,
395,
17,
35... | 2.427007 | 274 |
import streamlit as st
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Agg')
import seaborn as sns
import altair as alt
from PIL import Image
#------------------------------------------------------------------------------------
st.set_option('deprecation.showPyplotGlobalUse', Fal... | [
11748,
4269,
18250,
355,
336,
220,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
11748... | 2.494662 | 281 |
#!/usr/bin/env python
import rospy
from std_msgs.msg import Float32
import math
from sensor_msgs.msg import Image
import cv2
import os
from cv_bridge import CvBridge
import statistics as st
import numpy as np
if __name__ == "__main__":
duration_of_entropy_calc = 2.5
try:
node = entropy_calc_topic()
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
686,
2777,
88,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
48436,
2624,
198,
11748,
10688,
198,
6738,
12694,
62,
907,
14542,
13,
19662,
1330,
7412,
198,
11748,
269,
... | 2.242775 | 346 |
"""Оценка числа Пи
Для оценки используется только генератор случайных чисел равномерно распределенных 0 до 1.
Этот метод называется методом Монте-Карло.
Wiki: https://en.wikipedia.org/wiki/Monte_Carlo_method
"""
from random import uniform
from typing import Generator, Tuple
def generate_points(number: int) -> Gen... | [
37811,
140,
252,
141,
228,
16843,
22177,
31583,
16142,
220,
141,
229,
18849,
21727,
30143,
16142,
12466,
253,
18849,
198,
198,
140,
242,
30143,
40623,
12466,
122,
141,
228,
16843,
22177,
31583,
18849,
12466,
116,
21727,
140,
123,
25443,
1... | 2.059633 | 654 |
import argparse
from pathlib import Path
import secrets
import hashlib
import os
import requests
p = 2**256 - 2**32 - 977
Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
G = [Gx, Gy]
N = 0xfffffffffffffffffffffffffffffffeba... | [
11748,
1822,
29572,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
13141,
198,
11748,
12234,
8019,
198,
11748,
28686,
198,
11748,
7007,
198,
198,
79,
796,
362,
1174,
11645,
532,
362,
1174,
2624,
532,
860,
3324,
198,
38,
87,
796,
657,
... | 2.426859 | 834 |
import json
import logging
import logging.config
import time
from collections import defaultdict
import praw
from praw.models import Submission
import usernotes
REMOVAL_FLAIR_CSS_CLASS = 'normal'
TRUSTED_REPORTER_SCORE_LIMIT = 100
rule_linkflair_mapping = {'US Internal News or Politics': 'US Internal',
... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
640,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
279,
1831,
198,
6738,
279,
1831,
13,
27530,
1330,
42641,
198,
198,
11748,
514,
1142,
6421,
198,
198,
4... | 2.05613 | 677 |
"""
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | [
37811,
198,
15069,
357,
66,
8,
13130,
8180,
10501,
628,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
921,
743,
7... | 4.219512 | 164 |
import re
import requests
from flask import request, g
from flask_login import current_user
from oh_queue import app
DOMAIN_COURSES = {}
COURSE_ENDPOINTS = {}
| [
11748,
302,
198,
198,
11748,
7007,
198,
6738,
42903,
1330,
2581,
11,
308,
198,
6738,
42903,
62,
38235,
1330,
1459,
62,
7220,
198,
198,
6738,
11752,
62,
36560,
1330,
598,
198,
198,
39170,
29833,
62,
34,
2606,
6998,
1546,
796,
23884,
19... | 2.964286 | 56 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from models import Artist
band = Artist.get(Artist.name == "MXPX")
band.delete_instance() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
4981,
1330,
18902,
198,
198,
3903,
796,
18902,
13,
1136,
7,
43020,
13,
3672,
6624,
366,
44,
27481,
55,
4943,
19... | 2.666667 | 51 |
import numpy as np
import cvxpy as cp
| [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
87,
9078,
355,
31396,
198
] | 2.714286 | 14 |
import numpy as np
from perform.constants import REAL_TYPE, R_UNIV, SUTH_TEMP
from perform.gas_model.gas_model import GasModel
# TODO: more options for passing arguments to avoid repeats in called methods
class CaloricallyPerfectGas(GasModel):
"""Class implementing all CPG-specific thermo/transport property met... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1620,
13,
9979,
1187,
1330,
32744,
62,
25216,
11,
371,
62,
4944,
3824,
11,
311,
24318,
62,
51,
39494,
198,
6738,
1620,
13,
22649,
62,
19849,
13,
22649,
62,
19849,
1330,
14345,
17633,
198,... | 2.340662 | 11,598 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from .views import StoreListView, ArticleListView, ArticlesFromStoreListView
urlpatterns = [
url(r'^stores/$', StoreListView.as_view(), name... | [
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,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
... | 2.790476 | 210 |
from . import Preprocessing
from . import LinearRegression
from . import NonLinearRegression
from . import Metrics
from . import LinearClassifier
from . import NonLinearClassifier | [
6738,
764,
1330,
3771,
36948,
198,
6738,
764,
1330,
44800,
8081,
2234,
198,
6738,
764,
1330,
8504,
14993,
451,
8081,
2234,
198,
6738,
764,
1330,
3395,
10466,
198,
6738,
764,
1330,
44800,
9487,
7483,
198,
6738,
764,
1330,
8504,
14993,
45... | 4.162791 | 43 |
from . import Bing, Google
import argparse
if __name__=="__main__":
main() | [
6738,
764,
1330,
21631,
11,
3012,
198,
11748,
1822,
29572,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 2.821429 | 28 |
import sys
import numpy as np
import pandas
import tensorflow as tf
import skflow
from sklearn import metrics
from util import *
train_dataset, train_labels = load_data()
test_dataset, _ = load_data(test=True)
# Generate a validation set.
validation_dataset = train_dataset[:VALIDATION_SIZE, ...]
validation_labels =... | [
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
1341,
11125,
198,
6738,
1341,
35720,
1330,
20731,
198,
6738,
7736,
1330,
1635,
628,
198,
27432,
62,
1960... | 2.81875 | 480 |
import select
import threading
from collections import deque
import asyncio
from pytest_cleanup import Recorder
from .functions import go_async
from .classes import Inner1, Inner2, Inner3, Inner4, Inner5, Hey
if __name__ == '__main__':
main()
| [
11748,
2922,
198,
11748,
4704,
278,
198,
6738,
17268,
1330,
390,
4188,
198,
198,
11748,
30351,
952,
628,
198,
6738,
12972,
9288,
62,
27773,
929,
1330,
3311,
2875,
198,
6738,
764,
12543,
2733,
1330,
467,
62,
292,
13361,
198,
6738,
764,
... | 3.202532 | 79 |
import os
import numpy as np
import transformers
from lm_eval.base import LM
from lm_eval import utils
from tqdm import tqdm
import sys
import cohere
# sys.path.append('/home/miles_cohere_ai/wit')
# from wit.data.encoders import OpenWebTextEncoder
from lm_eval.tokenizer import OpenWebTextEncoder
import time
# d... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
6121,
364,
198,
6738,
300,
76,
62,
18206,
13,
8692,
1330,
37125,
198,
6738,
300,
76,
62,
18206,
1330,
3384,
4487,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
1174... | 2.666032 | 1,051 |
"""
Common test fixtures and utilities
"""
import sys
from typing import Union, List
import pytest
from wystia.utils.parse import as_list
# Check if system Python version is 3.6 or greater
PY36 = sys.version_info[0:2] >= (3, 6)
@pytest.fixture(scope='session')
def mock_video_id():
"""Returns a dummy hashed vi... | [
37811,
198,
17227,
1332,
34609,
290,
20081,
198,
37811,
198,
11748,
25064,
198,
6738,
19720,
1330,
4479,
11,
7343,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
266,
88,
301,
544,
13,
26791,
13,
29572,
1330,
355,
62,
4868,
628,
198,
2... | 2.772429 | 457 |
''' Data structures '''
from typing import Union
import numpy as np
from .base import Struct
class StreamingDataFrame:
''' Streaming pd.DataFrame-like API with history. For use with numerical data types only.
TODO: fix this to use StreamingArray and allow per-column dtypes
'''
@property
class StreamingArra... | [
7061,
6,
6060,
8573,
705,
7061,
220,
198,
198,
6738,
19720,
1330,
4479,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
8692,
1330,
32112,
198,
198,
4871,
43124,
6601,
19778,
25,
198,
197,
7061,
6,
43124,
279,
67,
13,
6601,
... | 2.826367 | 311 |
from IMLearn.learners import UnivariateGaussian, MultivariateGaussian
import numpy as np
import plotly.graph_objects as go
import plotly.io as pio
import plotly.subplots as sub
pio.templates.default = "simple_white"
if __name__ == '__main__':
np.random.seed(0)
test_univariate_gaussian()
test_multivaria... | [
6738,
314,
5805,
451,
77,
13,
35720,
364,
1330,
791,
42524,
35389,
31562,
11,
7854,
42524,
35389,
31562,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7110,
306,
13,
34960,
62,
48205,
355,
467,
198,
11748,
7110,
306,
13,
952,
355,
2... | 2.830508 | 118 |
from os import walk
f = []
for (dirpath, dirnames, filenames) in walk("."):
f.extend(filenames)
break
print(f)
modulesName=[]
fileWrite=open('yourmodules.txt','w+')
for i in range(0,len(f)):
try:
print(f[i])
fileWrite.write(f[i]+'\n')
data=getFileName(f[i])
addin(d... | [
6738,
28686,
1330,
2513,
628,
198,
198,
69,
796,
17635,
198,
1640,
357,
15908,
6978,
11,
26672,
14933,
11,
1226,
268,
1047,
8,
287,
2513,
7203,
526,
2599,
198,
220,
220,
220,
277,
13,
2302,
437,
7,
10379,
268,
1047,
8,
198,
220,
2... | 2.041667 | 264 |
class TradeTracker:
"""Class dealing with the Layer two wallets"""
def __init__(self, connection):
"""Connection to Database and Crypto Link collections"""
self.connection = connection
self.dca_trader = self.connection['DcaTrader']
self.ticker_profile = self.dca_trader.coinProfi... | [
4871,
9601,
35694,
25,
198,
220,
220,
220,
37227,
9487,
7219,
351,
262,
34398,
734,
29608,
37811,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
4637,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
32048,
284,
24047,
... | 2.776978 | 139 |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
browser = webdriver.Firefox()
browser.get('https://login.aliexpress.com/')
input("登录完成了请输入")
browser.get('http://datamatrix.aliexpress.com/categorySelect.htm')
on... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
2... | 1.997196 | 1,070 |
import pandas
from sklearn.linear_model import LinearRegression
import csv
train = 'train.csv'
data_train = pandas.read_csv(train, delimiter=",")
test = 'test.csv'
names = ['buying_price','maintainence_cost','number_of_doors','number_of_seats','luggage_boot_size','safety_rating','popularity']
data_test = pandas.read_... | [
11748,
19798,
292,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
44800,
8081,
2234,
198,
11748,
269,
21370,
198,
198,
27432,
796,
705,
27432,
13,
40664,
6,
198,
7890,
62,
27432,
796,
19798,
292,
13,
961,
62,
40664,
7,
27432,
11,... | 2.328982 | 383 |
import sqlite3
import time
| [
11748,
44161,
578,
18,
198,
11748,
640,
628,
628
] | 3.333333 | 9 |
# Generated with SMOP 0.41
from libsmop import *
# location_signal_maker.m
@function
| [
2,
2980,
515,
351,
9447,
3185,
220,
657,
13,
3901,
198,
6738,
9195,
5796,
404,
1330,
1635,
198,
2,
4067,
62,
12683,
282,
62,
10297,
13,
76,
628,
198,
31,
8818,
198
] | 2.75 | 32 |
#Django
from django.db import models
#Utilities
from cride.utils.models import BetmatcherModel
| [
2,
35,
73,
14208,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
18274,
2410,
198,
6738,
1067,
485,
13,
26791,
13,
27530,
1330,
5147,
6759,
2044,
17633,
628
] | 3.129032 | 31 |
#!/usr/bin/python
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for cbuildbot_view_config."""
import json
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
15069,
357,
66,
8,
2211,
383,
18255,
1505,
7294,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
... | 2.66721 | 1,226 |
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
if __name__ == '__main__':
key = RSA.generate(2048)
print("pk.n: ",key.n)
print("pk.e: ",key.e)
print("sk.d: ",key.d)
print("sk.p: ",key.p)
print("sk.q: ",key.q)
print("sk.u: ",key.u)
| [
6738,
36579,
13,
34,
10803,
1330,
29673,
7902,
16,
62,
23621,
8905,
198,
6738,
36579,
13,
15202,
9218,
1330,
42319,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1994,
796,
42319,
13,
8612,
37... | 2.035971 | 139 |
# Copyright (C) 2019 Harvard University. All Rights Reserved. Unauthorized
# copying of this file, via any medium is strictly prohibited Proprietary and
# confidential
# Developed by Mohammad Haft-Javaherian <mhaft-javaherian@mgh.harvard.edu>,
# <7javaherian@gmail.com>.
# =========... | [
2,
15069,
357,
34,
8,
13130,
11131,
2059,
13,
1439,
6923,
33876,
13,
791,
19721,
198,
2,
23345,
286,
428,
2393,
11,
2884,
597,
7090,
318,
14084,
12244,
1041,
3448,
8527,
290,
198,
2,
15279,
198,
2,
6013,
276,
416,
29674,
9398,
701,
... | 3.319527 | 169 |
from django.contrib.auth.models import User
import pytest
import requests
from journal.models import Post
from test.test_api_auth import initialize_users, get_auth_token
@pytest.mark.django_db
@pytest.mark.django_db
@pytest.mark.django_db
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
198,
11748,
12972,
9288,
198,
11748,
7007,
198,
198,
6738,
3989,
13,
27530,
1330,
2947,
198,
6738,
1332,
13,
9288,
62,
15042,
62,
18439,
1330,
41216,
62,
18417,
... | 2.940476 | 84 |
##########################################################################
#
# Copyright (c) 2018, Matti Gruener. 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 so... | [
29113,
29113,
7804,
2235,
198,
2,
198,
2,
220,
15069,
357,
66,
8,
2864,
11,
4705,
72,
25665,
877,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2... | 3.71875 | 640 |
# Generated by Django 3.0.10 on 2021-03-01 16:03
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
940,
319,
33448,
12,
3070,
12,
486,
1467,
25,
3070,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.840909 | 44 |
from enum import Enum, unique, auto
@unique
@unique
| [
6738,
33829,
1330,
2039,
388,
11,
3748,
11,
8295,
198,
198,
31,
34642,
628,
198,
31,
34642,
628
] | 3.111111 | 18 |
import locale
import os
from enum import Enum
from typing import List, Tuple
from qtpy.QtCore import QEvent, Qt
from qtpy.QtGui import QKeyEvent, QResizeEvent
from qtpy.QtWidgets import (
QApplication,
QBoxLayout,
QCheckBox,
QComboBox,
QHBoxLayout,
QLabel,
QMessageBox,
QPushButton,
... | [
11748,
36693,
198,
11748,
28686,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
6738,
10662,
83,
9078,
13,
48,
83,
14055,
1330,
1195,
9237,
11,
33734,
198,
6738,
10662,
83,
9078,
13,
48,
83,... | 2.496904 | 646 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Sample program
"""
from xreco import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser(name='train')
parser.add_argument('dataset', choices=['mnist', 'cifar10'])
parser.add_argument('--batchsize', '-b', type=int, default=32)
args = pa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
36674,
1430,
198,
37811,
628,
198,
6738,
2124,
260,
1073,
1330,
45751,
46677,
628,
198,
361,
11593,
3672,
8... | 2.620155 | 129 |
##############################################################################
# create ensemble average for the eof pattern
# (Default the leading PDO mode)
#
# The sign is determined by spatial correlation analysis
# between an ensemble member's eof and the eof from ensemble member 1
# (Use adjust_sign to flip sign o... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
2251,
34549,
2811,
329,
262,
304,
1659,
3912,
198,
2,
357,
19463,
262,
3756,
14340,
46,
4235,
8,
198,
2,
198,
2,
383,
1051,
318,
5295,
416,
21739,
16096,
3781,
198,
2,
1022,
281,
34549,
2888,
... | 2.380919 | 2,893 |
from django.urls import path, include
from minhaapp import views
urlpatterns = [
path('', views.index),
path('new', views.CriaPresencaView.as_view(), name='presenca_new'),
path('view/<int:pk>', views.DetailPresencaView.as_view(), name='presenca_view'),
path('edit/<int:pk>', views.EditPresencaView.as_v... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
198,
6738,
949,
3099,
1324,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
9630,
828,
198,
220,
220,
220,
3108,
10786,
3... | 2.544643 | 224 |
import datetime
from collections import defaultdict
from typing import TYPE_CHECKING, DefaultDict, Dict, List
import graphene
from django.core.exceptions import ValidationError
from django.db import transaction
from django.db.utils import IntegrityError
from ....checkout.models import CheckoutLine
from ....core.permi... | [
11748,
4818,
8079,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
15161,
35,
713,
11,
360,
713,
11,
7343,
198,
198,
11748,
42463,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
... | 4.045685 | 394 |
from __future__ import annotations
from typing import TYPE_CHECKING
from openhab_creator import _
from openhab_creator.models.common import MapTransformation
from openhab_creator.models.items import (DateTime, Group, PointType,
PropertyType, String, Switch)
from openhab_creat... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
198,
198,
6738,
1280,
5976,
62,
45382,
1330,
4808,
198,
6738,
1280,
5976,
62,
45382,
13,
27530,
13,
11321,
1330,
9347,
8291,
1161,
198,
6738,
128... | 3.032967 | 182 |
# TODO:
# determine how to integrate with existing aws creds
# import settings in an intelligent manner from some json config files
# code that validates and prints all parameters in the json files for review?
# uh-oh - SSL settings - I guess we need to validate route53 DNS settings.
# major script components
# deplo... | [
2,
16926,
46,
25,
198,
2,
5004,
703,
284,
19386,
351,
4683,
3253,
82,
2600,
82,
198,
2,
1330,
6460,
287,
281,
12661,
5642,
422,
617,
33918,
4566,
3696,
198,
2,
2438,
326,
4938,
689,
290,
20842,
477,
10007,
287,
262,
33918,
3696,
3... | 3.128164 | 2,489 |
#!/usr/bin/env python3
import argparse
import json
import requests
class helmGeneratorClient:
'''
Client library for Helm charts generator API.
- endpoint for API
- host for ingress
- version 0.0.0
- registry/image
- imageTag
- application port
'''
def generate(self):
'''
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
198,
11748,
7007,
198,
198,
4871,
18030,
8645,
1352,
11792,
25,
198,
220,
705,
7061,
198,
220,
20985,
5888,
329,
28351,
15907,
17301,... | 2.717033 | 364 |
# coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
33160,
383,
28304,
1425,
774,
6455,
20655,
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... | 2.883768 | 1,497 |
# -*- coding: utf-8 -*-
from decimal import Decimal
def format_money(money_value, precision=2, thousands_separator=True):
"""Format money with comma instead of point
Ex: 1234.56 -> 1.234,56
:param money_value: Decimal or float
:return: str
"""
if isinstance(money_value, int):
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
32465,
1330,
4280,
4402,
628,
198,
198,
4299,
5794,
62,
26316,
7,
26316,
62,
8367,
11,
15440,
28,
17,
11,
4138,
62,
25512,
1352,
28,
17821,
2599,
198,
220,
220,
... | 2.528428 | 299 |
import boto3
import ConfigParser
import time
from libs.utils import cloudwatch_connection
from libs.cloudwatch import RDS
from libs.terraform import Terraform
if __name__ == "__main__":
scale()
# change_n_of_nodes (n):
# git pull
# read the var
# replace the var
# terraform plan
# terraform a... | [
11748,
275,
2069,
18,
198,
11748,
17056,
46677,
198,
11748,
640,
198,
198,
6738,
9195,
82,
13,
26791,
1330,
6279,
8340,
62,
38659,
198,
6738,
9195,
82,
13,
17721,
8340,
1330,
371,
5258,
198,
6738,
9195,
82,
13,
353,
430,
687,
1330,
... | 2.72 | 125 |
import logging
from flask import Blueprint
from flask_restful import Api
from flask_restful import Resource
| [
11748,
18931,
198,
6738,
42903,
1330,
39932,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
198,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
628
] | 4.230769 | 26 |
'''
File: sort.py
Author: Adam Pah
Description:
Sorting algorithm for a matrix with simulated annealing.
Call is:
c = ClusterMatrix(data)
(data, order) = c.deep_sort()
'''
import sys
import numpy as np
import random
import math
| [
7061,
6,
198,
8979,
25,
3297,
13,
9078,
198,
13838,
25,
7244,
350,
993,
198,
11828,
25,
220,
220,
220,
220,
198,
50,
24707,
11862,
329,
257,
17593,
351,
28590,
281,
710,
4272,
13,
198,
198,
14134,
318,
25,
220,
198,
220,
220,
220,... | 2.804598 | 87 |
"""
Similar file to action_sequences.py, except I'm removing the round threshold to
generate all action sequences.
"""
from typing import Tuple, Dict
import sys
import dill as pickle
from pluribus.games.short_deck.player import ShortDeckPokerPlayer
from pluribus.games.short_deck.state import ShortDeckPokerState
from ... | [
37811,
198,
18925,
2393,
284,
2223,
62,
3107,
3007,
13,
9078,
11,
2845,
314,
1101,
10829,
262,
2835,
11387,
284,
198,
8612,
378,
477,
2223,
16311,
13,
198,
37811,
198,
6738,
19720,
1330,
309,
29291,
11,
360,
713,
198,
11748,
25064,
19... | 2.46093 | 1,011 |
"""
SODA module
"""
from SODA_Grid import SODA_Grid
from get_nc_SODA_Grid import get_nc_SODA_Grid
from make_remap_grid_file import make_remap_grid_file
from flood import flood
| [
37811,
198,
50,
3727,
32,
8265,
198,
37811,
198,
198,
6738,
311,
3727,
32,
62,
41339,
1330,
311,
3727,
32,
62,
41339,
198,
6738,
220,
651,
62,
10782,
62,
50,
3727,
32,
62,
41339,
1330,
651,
62,
10782,
62,
50,
3727,
32,
62,
41339,
... | 2.57971 | 69 |
from django.contrib import admin
from .models.user_page_view import UserPageView
admin.site.register(UserPageView)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
13,
7220,
62,
7700,
62,
1177,
1330,
11787,
9876,
7680,
628,
198,
28482,
13,
15654,
13,
30238,
7,
12982,
9876,
7680,
8,
198
] | 3.342857 | 35 |
import RPi.GPIO as GPIO
import time
import os
GPIO.setmode(GPIO.BCM)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP) #Button to GPIO23
GPIO.setup(24, GPIO.OUT) #LED to GPIO24
GPIO.setup(25, GPIO.OUT) #LED to GPIO25
GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP) #Button to GPIO26
Connect()
| [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198,
11748,
28686,
198,
198,
16960,
9399,
13,
2617,
14171,
7,
16960,
9399,
13,
2749,
44,
8,
198,
16960,
9399,
13,
40406,
7,
1954,
11,
50143,
13,
1268,
11,
2834,
62,
929... | 2.207143 | 140 |
#!/use/bin/env python
#coding:utf-8
#Author:WuYa
import xlrd
from xlutils.copy import copy
from utils.public import *
from utils.excel_data import *
| [
2,
48443,
1904,
14,
8800,
14,
24330,
21015,
198,
2,
66,
7656,
25,
40477,
12,
23,
220,
198,
198,
2,
13838,
25,
54,
84,
56,
64,
198,
198,
11748,
220,
2124,
75,
4372,
198,
6738,
2124,
75,
26791,
13,
30073,
1330,
220,
4866,
198,
673... | 2.453125 | 64 |
__version__ = '0.29.3'
| [
834,
9641,
834,
796,
705,
15,
13,
1959,
13,
18,
6,
198
] | 1.916667 | 12 |
#!/usr/bin/env python
from __future__ import unicode_literals
from feedgen.feed import FeedGenerator
from mutagen.mp3 import MP3
from mutagen import MutagenError
from collections import OrderedDict
from PIL import Image
from dominate.tags import *
import dominate
import dateutil.parser
import mutagen.id3
import Confi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
3745,
5235,
13,
12363,
1330,
18272,
8645,
1352,
198,
6738,
4517,
11286,
13,
3149,
18,
1330,
4904,
18,
198,
6... | 3.22561 | 164 |
from functools import wraps
from pyarrow import plasma
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
12972,
6018,
1330,
16074,
628
] | 4.307692 | 13 |
from flask import request, make_response, jsonify
from werkzeug.exceptions import NotFound
from datetime import datetime
from ....data import Data
class ProductModel():
"""This class encapsulates the functions of the product model"""
def __init__(self, name, stock, min_q, category, product_id=0):
""... | [
6738,
42903,
1330,
2581,
11,
787,
62,
26209,
11,
33918,
1958,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
1892,
21077,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19424,
7890,
1330,
6060,
628,
198,
4871,
8721,
... | 2.36129 | 620 |
from . import ghwaypoints
import random
import pbge
import gears
from game.content import GHNarrativeRequest,PLOT_LIST
# When you enter a town, call this to restore the party and deal with dead/incapacitated members
| [
6738,
764,
1330,
24997,
1014,
13033,
198,
11748,
4738,
198,
11748,
279,
65,
469,
198,
11748,
28713,
198,
6738,
983,
13,
11299,
1330,
24739,
45750,
876,
18453,
11,
6489,
2394,
62,
45849,
628,
628,
628,
628,
628,
198,
220,
220,
220,
130... | 3.530303 | 66 |
# a converter set of methods for obtaining normal inputs
import rdflib
from .term_parsers import parse_gaf_file
from collections import defaultdict
import gzip
| [
2,
257,
38394,
900,
286,
5050,
329,
16727,
220,
3487,
17311,
198,
11748,
374,
67,
2704,
571,
198,
6738,
764,
4354,
62,
79,
945,
364,
1330,
21136,
62,
70,
1878,
62,
7753,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
308,
13344,
6... | 3.704545 | 44 |
import numpy as np
from matplotlib import pyplot as plt
#reference:https://matplotlib.org/1.2.1/examples/api/histogram_demo.html
if __name__ == '__main__':
main()
| [
11748,
299,
32152,
355,
45941,
220,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
220,
198,
2,
35790,
25,
5450,
1378,
6759,
29487,
8019,
13,
2398,
14,
16,
13,
17,
13,
16,
14,
1069,
12629,
14,
15042,
14,
10034,
2185... | 2.537313 | 67 |
from django.apps import AppConfig | [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934
] | 4.125 | 8 |
from graphviz import Digraph
make_graph(26)
| [
6738,
4823,
85,
528,
1330,
7367,
1470,
628,
628,
198,
15883,
62,
34960,
7,
2075,
8,
198
] | 2.823529 | 17 |
import os
import pandas as pd
import numpy as np
import json
parent_dir = 'question_8/part_2/data'
out_dir = 'question_8/part_2'
all_dirs = [ os.path.join(parent_dir,a) for a in os.listdir(parent_dir) if os.path.isdir( os.path.join(parent_dir,a) )]
os.system('python3 plot_and_save.py %s --outname %s'%(' '.join(all_d... | [
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
198,
8000,
62,
15908,
796,
705,
25652,
62,
23,
14,
3911,
62,
17,
14,
7890,
6,
198,
448,
62,
15908,
796,
705,
25652,
62,
... | 2.407895 | 152 |
if __name__ == '__main__':
bulb = Bulb()
turnOn = TurnOn(bulb)
turnOff = TurnOff(bulb)
remote = RemoteControl()
remote.submit(turnOn) # Bulb has been lit!
remote.submit(turnOff) # Darkness!
| [
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
28287,
796,
8510,
65,
3419,
628,
220,
220,
220,
1210,
2202,
796,
6756,
2202,
7,
15065,
65,
8,
198,
220,
220,
220,
1210,
9362,
796,
6... | 2.408602 | 93 |
from subprocess import Popen, PIPE
from threading import Thread
from queue import Queue
import time
import tkinter as tk
from tkinter import ttk
from .applications import Window, Page
class CommandLine(ttk.Frame):
"""
Ignore this, it is worthless.
"""
class Subprocess:
"""
Creates a secondary ... | [
6738,
850,
14681,
1330,
8099,
268,
11,
350,
4061,
36,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
16834,
1330,
4670,
518,
198,
11748,
640,
198,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
1... | 2.986577 | 149 |
import requests
import json
# dictionary for post the data and get the prediction
to_predict = {
"age": 21,
"Medu": 1,
"Fedu": 1,
"traveltime": 1,
"studytime": 1,
"failures": 3,
"famrel": 5,
"freetime": 5,
"goout": 3,
"Dalc": 3,
"Walc": 3,
"health": 3,
"abscences": 3,
"G1": 10,
"G2": 8
}
# dumps the dict into a json ... | [
11748,
7007,
198,
11748,
33918,
198,
198,
2,
22155,
329,
1281,
262,
1366,
290,
651,
262,
17724,
198,
1462,
62,
79,
17407,
796,
1391,
198,
1,
496,
1298,
2310,
11,
198,
1,
9921,
84,
1298,
352,
11,
198,
1,
37,
15532,
1298,
352,
11,
... | 2.350554 | 271 |
# This problem was asked by Microsoft.
# Implement the singleton pattern with a twist. First, instead of storing one instance, store two instances.
# And in every even call of getInstance(), return the first instance and in every odd call of getInstance(),
# return the second instance.
####
# A singleton pattern appare... | [
2,
770,
1917,
373,
1965,
416,
5413,
13,
198,
2,
48282,
262,
2060,
1122,
3912,
351,
257,
14528,
13,
3274,
11,
2427,
286,
23069,
530,
4554,
11,
3650,
734,
10245,
13,
198,
2,
843,
287,
790,
772,
869,
286,
651,
33384,
22784,
1441,
262... | 3.290456 | 241 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
"""
Client for Netbox REST API
@authors: Benoit Petit <bpetit@b0rk.in>
"""
from __main__ import main
__copyright__ = '(C) 2017 Benoit Petit'
__license__ = 'MIT'
__all__ = ['main']
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
37811,
198,
11792,
329,
3433,
3524,
30617,
7824,
198,
198,
31,
41617,
25,
3932,
30711,
4767,
270,
1279,
65,
6449,
270,
... | 2.389474 | 95 |
'''
This script will create a Boxplot with the median coverage calculated over a certain BAM file
Created on 01 Dec 2016
@author: ernesto
'''
import pandas as pd
import argparse
import matplotlib
matplotlib.use('Agg')
from ReseqTrackDB import ReseqTrackDB
#get command line arguments
#RESEQTRACK DB conn params
pa... | [
7061,
6,
198,
198,
1212,
4226,
481,
2251,
257,
8315,
29487,
351,
262,
14288,
5197,
10488,
625,
257,
1728,
347,
2390,
2393,
198,
198,
41972,
319,
5534,
4280,
1584,
198,
198,
31,
9800,
25,
220,
1142,
395,
78,
198,
198,
7061,
6,
198,
... | 2.852744 | 747 |
# #!/usr/bin/env python
#
# Provides a simple way to perform classification based on the
# curves arising from the calculated filtrations that uses a
# train test split.
import argparse
import warnings
import random
import csv
import time
from bisect import bisect_left
import glob
from tqdm import tqdm
import os
impo... | [
2,
1303,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
47081,
257,
2829,
835,
284,
1620,
17923,
1912,
319,
262,
198,
2,
23759,
21539,
422,
262,
10488,
1226,
2213,
602,
326,
3544,
257,
220,
198,
2,
4512,
1332,
6626,
13,
... | 2.594988 | 1,237 |
from MUDA import *
import simplebs
# import test
if __name__ == '__main__':
mytest()
| [
6738,
25108,
5631,
1330,
1635,
198,
11748,
2829,
1443,
198,
198,
2,
1330,
1332,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
616,
9288,
3419,
198
] | 2.705882 | 34 |
# http://www.no-ack.org/2010/12/yet-another-profiling-middleware-for.html
import os
import re
import tempfile
from cStringIO import StringIO
from django.conf import settings
import hotshot
import hotshot.stats
COMMENT_SYNTAX = ((re.compile(r'^application/(.*\+)?xml|text/html$', re.I), '<!--', '-->'),
... | [
2,
2638,
1378,
2503,
13,
3919,
12,
441,
13,
2398,
14,
10333,
14,
1065,
14,
25907,
12,
29214,
12,
5577,
4386,
12,
27171,
1574,
12,
1640,
13,
6494,
198,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
20218,
7753,
198,
198,
6738,
269,... | 2.474684 | 158 |
class PyneedException(Exception):
"""Base exception class for all errors raised by Pyneed Open Source.
These exceptions results from invalid use cases and will be reported
to the users.
"""
class FileIOException(PyneedException):
"""Raised if there is an error while doing file IO."""
| [
4871,
9485,
31227,
16922,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
6631,
1398,
329,
477,
8563,
4376,
416,
9485,
31227,
4946,
8090,
13,
198,
220,
220,
220,
2312,
13269,
2482,
422,
12515,
779,
2663,
290,
481,
307,
2098,
198,
22... | 3.686747 | 83 |
# -*- coding: utf-8 -*-
import pretty_errors
age = 1
print(len(age)) | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
2495,
62,
48277,
198,
198,
496,
796,
352,
198,
4798,
7,
11925,
7,
496,
4008
] | 2.3 | 30 |
import pytest
from bunny3.bunny import create_app
from bunny3.bunny import Bunny3
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
44915,
18,
13,
65,
16948,
1330,
2251,
62,
1324,
198,
6738,
44915,
18,
13,
65,
16948,
1330,
28683,
18,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 2.833333 | 42 |
print('Controle de terreno')
print(f'-' * 20)
largura = float(input('Digite a largura (m): '))
altura = float(input('Digite a largua (m): '))
area(largura, altura)
| [
198,
198,
4798,
10786,
4264,
18090,
390,
1059,
918,
78,
11537,
198,
4798,
7,
69,
6,
19355,
1635,
1160,
8,
198,
15521,
5330,
796,
12178,
7,
15414,
10786,
19511,
578,
257,
2552,
5330,
357,
76,
2599,
705,
4008,
198,
2501,
5330,
796,
12... | 2.515152 | 66 |
from random import *
# Init your variables here
# Put your bot name here
name = "Bender"
# Bender strategy : return the first element in the available cells.
# That always generates horizontal line in the top of the board | [
6738,
4738,
1330,
1635,
198,
198,
2,
44707,
534,
9633,
994,
220,
198,
198,
2,
5930,
534,
10214,
1438,
994,
198,
3672,
796,
366,
33,
2194,
1,
198,
198,
2,
34535,
4811,
1058,
1441,
262,
717,
5002,
287,
262,
1695,
4778,
13,
198,
2,
... | 4.035714 | 56 |
"""Read from files that have custom format"""
# open a file for reading and iterate each line
with open('./custom.txt') as f:
config = {}
for line in f:
# assign to multiple variables (tuple unpacking)
id, name = line.strip().split(' = ')
config[id] = name
for id in ["123", "213"]:
... | [
37811,
5569,
422,
3696,
326,
423,
2183,
5794,
37811,
198,
198,
2,
1280,
257,
2393,
329,
3555,
290,
11629,
378,
1123,
1627,
198,
4480,
1280,
7,
4458,
14,
23144,
13,
14116,
11537,
355,
277,
25,
198,
220,
220,
220,
4566,
796,
23884,
19... | 2.648438 | 128 |
import torch
import torch.nn as nn
from lib.ssn.ssn import ssn_iter, sparse_ssn_iter
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
6738,
9195,
13,
824,
77,
13,
824,
77,
1330,
264,
16184,
62,
2676,
11,
29877,
62,
824,
77,
62,
2676,
628,
220,
220,
220,
220,
220,
220,
220,
220,
628
] | 2.309524 | 42 |
import asyncio
from datetime import datetime
import uvloop
from abrpc import Connection, expose
from .monitoring import get_resources
from .obj import Object
uvloop.install()
class Service:
@expose()
@expose()
@expose()
@expose()
"""
@expose()
async def map_to_fs(self, name, hostn... | [
11748,
30351,
952,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
334,
85,
26268,
198,
6738,
450,
81,
14751,
1330,
26923,
11,
15651,
198,
198,
6738,
764,
41143,
278,
1330,
651,
62,
37540,
198,
6738,
764,
26801,
1330,
9515,
... | 2.463333 | 300 |