content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import unittest
from typing import List
| [
11748,
555,
715,
395,
198,
6738,
19720,
1330,
7343,
628,
198
] | 3.818182 | 11 |
from flask import render_template, g
from flask_babel import _, get_locale
from . import main
@main.before_app_request
@main.route("/")
@main.route("/index")
| [
6738,
42903,
1330,
8543,
62,
28243,
11,
308,
198,
6738,
42903,
62,
65,
9608,
1330,
4808,
11,
651,
62,
17946,
1000,
198,
198,
6738,
764,
1330,
1388,
628,
198,
31,
12417,
13,
19052,
62,
1324,
62,
25927,
628,
198,
31,
12417,
13,
38629,... | 2.910714 | 56 |
import pickle
import copy
import numpy as np
import environment.collisionmodel as cm
import utiltools.thirdparty.o3dhelper as o3dh
import utiltools.robotmath as rm
import utiltools.thirdparty.p3dhelper as p3dh
if __name__ == '__main__':
import robothelper
import numpy as np
import environment.collisionmod... | [
11748,
2298,
293,
198,
11748,
4866,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2858,
13,
26000,
1166,
19849,
355,
12067,
198,
11748,
3384,
2326,
10141,
13,
17089,
10608,
13,
78,
18,
67,
2978,
525,
355,
267,
18,
34985,
198,
11748,
... | 1.664622 | 3,098 |
#!/usr/bin/env python
import unittest
import pyprimesieve
if __name__ == "__main__":
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
555,
715,
395,
198,
11748,
12972,
1050,
999,
12311,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
... | 2.477273 | 44 |
"""Balance-related functionality of `Wealth`."""
import datetime as dt
import functools
from typing import Generator, List
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats
from IPython.core.display import display
from IPython.display import Markdown
fro... | [
37811,
45866,
12,
5363,
11244,
286,
4600,
1135,
1094,
63,
526,
15931,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
1257,
310,
10141,
198,
6738,
19720,
1330,
35986,
11,
7343,
198,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
... | 2.063627 | 5,045 |
'''Move the mouse based on input from webcam. If motion is detected the mouse is moved.
This is to switch scenes in OBS (screen recording and streaming software) based on camera activity.
OBS supports automatic switching based on mouse activity, but not camera activity. This hacks around that.
Requires opencv-python, ... | [
7061,
6,
21774,
262,
10211,
1912,
319,
5128,
422,
49823,
13,
1002,
6268,
318,
12326,
262,
10211,
318,
3888,
13,
198,
1212,
318,
284,
5078,
8188,
287,
440,
4462,
357,
9612,
8296,
290,
11305,
3788,
8,
1912,
319,
4676,
3842,
13,
198,
4... | 2.706783 | 914 |
import random
import time
import sys
def retrieving_word(topic):
"""
This function is used to randomly return a word from a list based on what topic the player wants.
Paramaters
----------
topic: str
This is to store the topic the user wants to obtain the word from
R... | [
11748,
4738,
220,
201,
198,
11748,
640,
201,
198,
11748,
25064,
201,
198,
4299,
50122,
62,
4775,
7,
26652,
2599,
201,
198,
220,
220,
220,
37227,
220,
220,
201,
198,
220,
220,
220,
770,
2163,
318,
973,
284,
15456,
1441,
257,
1573,
42... | 2.524832 | 2,376 |
from datetime import datetime
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198
] | 3.538462 | 39 |
""" Implementation for the dataset and GenesisTextDataset class, which handles dataloading from ipfs
"""
# The MIT License (MIT)
# Copyright © 2021 Yuma Rao
# 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 ... | [
37811,
46333,
329,
262,
27039,
290,
18993,
8206,
27354,
292,
316,
1398,
11,
543,
17105,
4818,
282,
1170,
278,
422,
20966,
9501,
198,
37811,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
15069,
10673,
33448,
575,
7487,
48395,
198,
... | 2.170257 | 7,195 |
zoo = Zoo()
reset_zoo()
| [
628,
198,
89,
2238,
796,
21980,
3419,
628,
198,
198,
42503,
62,
89,
2238,
3419,
198
] | 1.875 | 16 |
from bson.objectid import ObjectId
import math
from Gifts.getRecommendations.Requests import findingApi
from Gifts.getRecommendations.TextClasterisation import nlp
from Gifts.getRecommendations.DB import DB
from random import shuffle
page_size = 100 # todo in constant file
def remove_similar(items, n):
"""
... | [
6738,
275,
1559,
13,
15252,
312,
1330,
9515,
7390,
198,
11748,
10688,
198,
6738,
48462,
13,
1136,
41248,
602,
13,
16844,
3558,
1330,
4917,
32,
14415,
198,
6738,
48462,
13,
1136,
41248,
602,
13,
8206,
2601,
1603,
5612,
1330,
299,
34431,
... | 2.276364 | 3,300 |
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pygogo.handlers
~~~~~~~~~~~~~~~
Log handlers
Examples:
Add a stdout handler::
>>> logger = logging.getLogger()
>>> logger.addHandler(stdout_hdlr())
>>> logger.info('hello world')
hello world
Attributes:
ENCODING (str): T... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43907,
25,
1509,
28,
19,
25,
912,
28,
19,
25,
11201,
392,
8658,
198,
198,
37811,
198,
9078,
70,
24076,
13,
4993,
8116,
198,
15116,
8728,
4907,
93,
198,
198,
11187... | 2.517156 | 3,235 |
import json
from PySimpleGUI.PySimpleGUI import Titlebar
from cryptography.fernet import Fernet
from time import sleep
import PySimpleGUI as sg
import os
| [
11748,
33918,
201,
198,
6738,
9485,
26437,
40156,
13,
20519,
26437,
40156,
1330,
11851,
5657,
201,
198,
6738,
45898,
13,
69,
1142,
316,
1330,
38982,
316,
201,
198,
6738,
640,
1330,
3993,
201,
198,
11748,
9485,
26437,
40156,
355,
264,
70... | 3.354167 | 48 |
"""
This script is a basic look at the lifecycle of a Python class. A python class
has 4 main stages:
1. Definition
2. Initialization
3. Access and Manipulation
4. Destruction
"""
print('script start')
print('class access and manipulation start')
print(basic.prop1)
print(basic.cls_method())
print('class access and m... | [
37811,
198,
1212,
4226,
318,
257,
4096,
804,
379,
262,
3868,
47510,
286,
257,
11361,
1398,
13,
220,
317,
21015,
1398,
198,
10134,
604,
1388,
9539,
25,
198,
198,
16,
13,
30396,
198,
17,
13,
20768,
1634,
198,
18,
13,
8798,
290,
35045,... | 3.392523 | 214 |
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non... | [
2235,
198,
2,
770,
3788,
373,
4166,
290,
1220,
393,
9518,
416,
7760,
1169,
261,
5834,
11,
198,
2,
12997,
284,
17453,
46133,
16945,
54,
12,
2713,
12,
34,
48,
12,
940,
3134,
351,
262,
1294,
5070,
13,
198,
2,
220,
198,
2,
471,
13,
... | 2.299073 | 24,061 |
from pandac.PandaModules import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.piratesgui.DialMeter import DialMeter
from pirates.piratesgui import PiratesGuiGlobals | [
6738,
19798,
330,
13,
47,
5282,
5841,
5028,
1330,
1635,
198,
6738,
27516,
13,
4063,
689,
8692,
1330,
20169,
9861,
672,
874,
198,
6738,
27516,
13,
4063,
689,
8692,
1330,
9297,
4374,
7509,
198,
6738,
27516,
13,
4063,
689,
48317,
13,
244... | 3.596774 | 62 |
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix | [
11748,
299,
32152,
355,
45941,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
10802,
62,
6759,
8609
] | 3.25 | 36 |
"""BIG-IQ management client
"""
from datetime import datetime, timedelta
from retry import retry
from f5sdk.logger import Logger
from f5sdk import constants
from f5sdk.utils import http_utils
from f5sdk.decorators import check_auth, add_auth_header
class ManagementClient(object):
"""A class used as a managemen... | [
37811,
3483,
38,
12,
33866,
4542,
5456,
198,
37811,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
6738,
1005,
563,
1330,
1005,
563,
198,
198,
6738,
277,
20,
21282,
74,
13,
6404,
1362,
1330,
5972,
1362,
198,... | 2.16347 | 2,190 |
from flask import Flask, request, jsonify
from flask_basicauth import BasicAuth
from textblob import TextBlob
#import pandas as pd
#from sklearn.model_selection import train_test_split
import pickle
from sklearn.linear_model import LinearRegression
import os
#esta comentado pois o modelo já foi testado e salvo em mode... | [
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
198,
6738,
42903,
62,
12093,
3970,
1071,
1330,
14392,
30515,
198,
6738,
2420,
2436,
672,
1330,
8255,
3629,
672,
198,
2,
11748,
19798,
292,
355,
279,
67,
198,
2,
6738,
1341,
35720,
1... | 2.450139 | 722 |
from exasol_integration_test_docker_environment.lib.config.log_config import log_config
| [
6738,
409,
292,
349,
62,
18908,
1358,
62,
9288,
62,
45986,
62,
38986,
13,
8019,
13,
11250,
13,
6404,
62,
11250,
1330,
2604,
62,
11250,
628
] | 3.423077 | 26 |
#!/usr/bin/env python
import os
import logging as _logging
_logger = _logging.getLogger(__name__)
master_host = "***REMOVED***"
master_user = "***REMOVED***"
master_password = "***REMOVED***"
master_db = "***REMOVED***"
slave_host = "127.0.0.1"
slave_user = "reader"
slave_password = "falcon"
slave_db = "falcon"
my... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
198,
11748,
18931,
355,
4808,
6404,
2667,
198,
62,
6404,
1362,
796,
4808,
6404,
2667,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
9866,
62,
4774,
7... | 2.294656 | 1,310 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
2864,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330... | 3.640625 | 320 |
"""
TO-DO:
add probability map layer for T-bar or cleft detection and other semantic prediction
"""
import neuroglancer as ng
import numpy as np
from chunkflow.chunk import Chunk
from chunkflow.lib.synapses import Synapses
from .base import OperatorBase
| [
37811,
198,
10468,
12,
18227,
25,
198,
2860,
12867,
3975,
7679,
329,
309,
12,
5657,
393,
1190,
701,
13326,
290,
584,
37865,
17724,
198,
37811,
198,
198,
11748,
7669,
4743,
8250,
355,
23370,
198,
11748,
299,
32152,
355,
45941,
198,
198,
... | 3.633803 | 71 |
#createdbyme
| [
2,
25598,
1525,
1326,
201
] | 2.6 | 5 |
import pandas as pd
import argparse
import pickle
import numpy as np
from bert_score import BERTScorer
parser = argparse.ArgumentParser(description='Unlabeled')
parser.add_argument('--data_path', type=str, default='./tmp/tst-summarization-baseline-predict/test_generations.txt',
help='path to data... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
1822,
29572,
198,
11748,
2298,
293,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
275,
861,
62,
26675,
1330,
347,
17395,
3351,
11934,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,... | 2.478599 | 257 |
from django.conf.urls import url, patterns
from django.contrib import admin
from .api import *
admin.autodiscover()
urlpatterns = patterns(
(r'^api/announcement/(?P<pk>\d+)/dismiss$', AnnouncementDismiss.as_view()),
(r'^api/announcements$', AnnouncementList.as_view()),
)
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
7572,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
15042,
1330,
1635,
628,
198,
28482,
13,
2306,
375,
29392,
3419,
198,
198,
6371,
33279,
82,
796,
7... | 2.572727 | 110 |
# Implementation of the TensforFlow Tutorial for Basic Classification: https://www.tensorflow.org/tutorials/keras/basic_classification
# author: tfreundo
import tensorflow as tf
# High Level TF-API
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plot
# Parameters for Debugging and tweaking... | [
2,
46333,
286,
262,
40280,
1640,
37535,
36361,
329,
14392,
40984,
25,
3740,
1378,
2503,
13,
83,
22854,
11125,
13,
2398,
14,
83,
44917,
82,
14,
6122,
292,
14,
35487,
62,
4871,
2649,
220,
198,
2,
1772,
25,
256,
19503,
41204,
198,
1174... | 3.317033 | 1,227 |
# coding=utf-8
import csv
from flask import render_template, request, redirect, abort, jsonify, url_for, session, flash, send_from_directory
from CTFd.utils import authed, judge_result, allowed_file, get_file_suffix
from CTFd.models import db, GoodBaseInfo, GoodSkuInfo, SkuProxyInfo, get_id, DisplayGoodInfo, getPlatfo... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
269,
21370,
198,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
15614,
11,
33918,
1958,
11,
19016,
62,
1640,
11,
6246,
11,
7644,
11,
3758,
62,
6738,
62,
34945,
198,
6738,
... | 2.956376 | 298 |
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | [
2,
19617,
28,
40477,
23,
198,
198,
2,
15069,
2864,
28591,
5097,
2606,
35,
13,
9858,
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.73743 | 179 |
from visdom import Visdom
def create_session(**kwargs):
"""
Creates a visdom session
Parameters
----------
kwargs : ...
Returns
-------
object
a visdom session
"""
session = Visdom(**kwargs)
session.close(None)
return session
| [
6738,
1490,
3438,
1330,
6911,
3438,
628,
198,
4299,
2251,
62,
29891,
7,
1174,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7921,
274,
257,
1490,
3438,
6246,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
... | 2.517544 | 114 |
"""
2) Kernel truncation, log-linear runtimes
=====================================================
In the previous notebook, we've seen that **simulated annealing**
could be used to define efficient coarse-to-fine solvers
of the entropic :math:`\\text{OT}_\\varepsilon` problem.
Adapting ideas from `(Schmitzer, 2016) ... | [
37811,
198,
17,
8,
32169,
40122,
341,
11,
2604,
12,
29127,
1057,
22355,
198,
10052,
4770,
1421,
28,
198,
198,
818,
262,
2180,
20922,
11,
356,
1053,
1775,
326,
12429,
14323,
4817,
281,
710,
4272,
1174,
198,
24089,
307,
973,
284,
8160,
... | 2.886331 | 4,865 |
#!/usr/bin/python
from __future__ import absolute_import, division, print_function
import importlib,os,re,sys
from robot.libraries.BuiltIn import BuiltIn,RobotNotRunningError
from robot.api import logger
from ansible import modules
from .picker2 import picker2
from ansible.cli.adhoc import AdHocCLI as mycli
from ansibl... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
11748,
1330,
8019,
11,
418,
11,
260,
11,
17597,
198,
6738,
9379,
13,
75,
11127,
13,
39582,
818,
1330,
2847... | 2.327281 | 4,571 |
import json
| [
11748,
33918,
628,
628,
628,
628
] | 3.166667 | 6 |
"""Tense analysis and detection related utilities."""
# pylint: disable=E0611
PRESENT = 'PRESENT'
PAST = 'PAST'
FUTURE = 'FUTURE'
MODAL = 'MODAL'
NORMAL = 'NORMAL'
| [
37811,
51,
1072,
3781,
290,
13326,
3519,
20081,
526,
15931,
198,
2,
279,
2645,
600,
25,
15560,
28,
36,
3312,
1157,
198,
198,
48296,
3525,
796,
705,
48296,
3525,
6,
198,
47,
11262,
796,
705,
47,
11262,
6,
198,
37,
3843,
11335,
796,
... | 2.538462 | 65 |
from thiamsu.settings.base import *
| [
6738,
294,
1789,
2385,
13,
33692,
13,
8692,
1330,
1635,
198
] | 3.272727 | 11 |
# flake8: noqa: F401
# isort: off
from finrl.exchange.common import MAP_EXCHANGE_CHILDCLASS
from finrl.exchange.exchange import Exchange
# isort: on
from finrl.exchange.bibox import Bibox
from finrl.exchange.binance import Binance
from finrl.exchange.bittrex import Bittrex
from finrl.exchange.exchange import (available... | [
2,
781,
539,
23,
25,
645,
20402,
25,
376,
21844,
198,
2,
318,
419,
25,
572,
198,
6738,
957,
45895,
13,
1069,
3803,
13,
11321,
1330,
34645,
62,
6369,
3398,
27746,
62,
3398,
26761,
31631,
198,
6738,
957,
45895,
13,
1069,
3803,
13,
1... | 2.051345 | 409 |
"""Contains the impulse response augmentation model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from data_utils.augmentor.base import AugmentorBase
from data_utils.utility import read_manifest
from data_utils.audio import AudioSegment
class Impulse... | [
37811,
4264,
1299,
262,
25278,
2882,
16339,
14374,
2746,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
1366,
... | 3.005435 | 368 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.225877 | 456 |
import torch
import os.path
from datasets.dataset_factory import get_dataset
from torch.utils.data import DataLoader
import copy
from tqdm import tqdm
| [
11748,
28034,
198,
11748,
28686,
13,
6978,
198,
6738,
40522,
13,
19608,
292,
316,
62,
69,
9548,
1330,
651,
62,
19608,
292,
316,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
11748,
4866,
198,
6738,
256,
80,
36020,
133... | 3.304348 | 46 |
# Copyright 2017-2020 object_database Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
2,
220,
220,
15069,
2177,
12,
42334,
2134,
62,
48806,
46665,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287... | 3.589109 | 202 |
#!/usr/bin/python
# coding=utf-8
from urllib import request
import json
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
6738,
2956,
297,
571,
1330,
2581,
198,
11748,
33918,
628
] | 2.846154 | 26 |
from django.forms.utils import flatatt
from django.utils import six
from django.utils.encoding import force_text, force_str
from django.utils.html import format_html
from django.utils.http import urlencode
from django.utils.safestring import mark_safe
try:
from urlparse import urlparse, parse_qs, urlunparse
except... | [
6738,
42625,
14208,
13,
23914,
13,
26791,
1330,
6228,
1078,
198,
6738,
42625,
14208,
13,
26791,
1330,
2237,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
2700,
62,
5239,
11,
2700,
62,
2536,
198,
6738,
42625,
14208,
13,
2679... | 2.412475 | 994 |
import javalang
import json
from tqdm import tqdm
import re
# def concatParentheses(code_list):
# temp_code = ''
# new_code_list = []
# for code in code_list:
# code = code.strip()
# if temp_code == '' and code != '{' and code != '}':
with open(f'./../../../../Downloads/code2comment_dat... | [
11748,
474,
9226,
648,
198,
11748,
33918,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
302,
628,
198,
2,
825,
1673,
265,
24546,
39815,
7,
8189,
62,
4868,
2599,
198,
2,
220,
220,
220,
220,
20218,
62,
8189,
796,
10148,... | 2.099819 | 551 |
import os.path
# Compatibility import
from Bcfg2.Bcfg2Py3k import ConfigParser
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
c = ConfigParser.ConfigParser()
#This needs to be configurable one day somehow
c.read(['./bcfg2.conf'])
defaults = {'database_engine':'sqlite3',
'database_name':'./dev.... | [
11748,
28686,
13,
6978,
198,
2,
46021,
1330,
198,
6738,
347,
37581,
17,
13,
33,
37581,
17,
20519,
18,
74,
1330,
17056,
46677,
198,
198,
31190,
23680,
62,
13252,
2394,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
... | 2.535097 | 1,966 |
"""This script handles test cases for the login module"""
import unittest
from flask import request, session
from app.views import create_app
class LoginTestCase(unittest.TestCase):
"""Login Feature specific Test Cases will go here"""
def setUp(self):
"""Setup test app"""
self.app = create_a... | [
37811,
1212,
4226,
17105,
1332,
2663,
329,
262,
17594,
8265,
37811,
198,
198,
11748,
555,
715,
395,
198,
6738,
42903,
1330,
2581,
11,
6246,
198,
6738,
598,
13,
33571,
1330,
2251,
62,
1324,
628,
198,
4871,
23093,
14402,
20448,
7,
403,
... | 2.229584 | 1,298 |
from django.urls import path
from .views import (testPageView, HomePageView, AboutPageView)
app_name = "pages"
urlpatterns = [
path('', HomePageView.as_view(), name="home"),
path('about/', AboutPageView.as_view(), name="about"),
path('test/', testPageView, name="test")
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
33571,
1330,
357,
9288,
9876,
7680,
11,
5995,
9876,
7680,
11,
7994,
9876,
7680,
8,
198,
198,
1324,
62,
3672,
796,
366,
31126,
1,
198,
198,
6371,
33279,
82,
796,
685,... | 2.803922 | 102 |
from operators.sourcetoredshift import SourceToRedshiftOperator
from operators.createtables import CreateTablesOperator
from operators.loadfact import FactOperator
from operators.loaddimension import DimensionOperator
__all__ = [
'SourceToRedshiftOperator',
'CreateTablesOperator'
'LoadFactOperator',
'L... | [
6738,
12879,
13,
82,
454,
66,
316,
1850,
30846,
1330,
8090,
2514,
7738,
30846,
18843,
1352,
198,
6738,
12879,
13,
20123,
316,
2977,
1330,
13610,
51,
2977,
18843,
1352,
198,
6738,
12879,
13,
2220,
22584,
1330,
19020,
18843,
1352,
198,
67... | 3.372549 | 102 |
# https://adventofcode.com/2019/day/6
import os
orbit_data = {}
with open(os.path.join(os.path.dirname(__file__), "../data.txt"), "r") as f:
for line in f:
# child > parent
relation = line.strip().split(")")
orbit_data[relation[1]] = relation[0]
print(process(orbit_data))
| [
2,
3740,
1378,
324,
1151,
1659,
8189,
13,
785,
14,
23344,
14,
820,
14,
21,
198,
198,
11748,
28686,
628,
198,
198,
42594,
62,
7890,
796,
23884,
198,
4480,
1280,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
8... | 2.343511 | 131 |
# Copyright (c) 2017 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 i... | [
2,
15069,
357,
66,
8,
2177,
8180,
10501,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
... | 3.819672 | 183 |
import cv2
import numpy as np
from pypylon import pylon
from threading import Lock
# Image event handler.
if __name__ == '__main__':
CAMERA_SERIAL = "23517286"
cam = PylonCapture(CAMERA_SERIAL)
cam.connect()
while True:
res, image = cam.grab()
if res:
image_resized = cv2.r... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
279,
4464,
15158,
1330,
279,
15158,
198,
6738,
4704,
278,
1330,
13656,
198,
198,
2,
7412,
1785,
21360,
13,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,... | 2.024793 | 242 |
# @Description: gaussianBlur.py
# @Author: 孤烟逐云zjy
# @Date: 2020/4/23 9:21
# @SoftWare: PyCharm
# @CSDN: https://blog.csdn.net/zjy123078_zjy
# @博客园: https://www.cnblogs.com/guyan-2020/
import cv2 as cv
import numpy as np
src = cv.imread("./images/raindropGirl.jpg")
# 统计时间
# getTickCount()函数返回操作系统启动到当前所经过的计时周期数
... | [
2,
2488,
11828,
25,
31986,
31562,
3629,
333,
13,
9078,
198,
2,
2488,
13838,
25,
10263,
255,
97,
163,
225,
253,
34460,
238,
12859,
239,
89,
73,
88,
198,
2,
2488,
10430,
25,
12131,
14,
19,
14,
1954,
860,
25,
2481,
198,
2,
2488,
18... | 1.612832 | 452 |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from io import BytesIO
from ansible_collections.community.general.plugins.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin... | [
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
357,
3826,
27975,
45761,
393,
3740,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
70,
489,
12,
18,
13,
15,
13,
14116,
8,
198,
198,
6738,
11593,
37443,
834,
1330,
357,
48546,
... | 2.488035 | 3,385 |
# Copyright 2012 OpenStack Foundation
#
# 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... | [
2,
15069,
2321,
4946,
25896,
5693,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
... | 2.90625 | 448 |
""" The default strategy that iterates through the whole parameter space """
from __future__ import print_function
from kernel_tuner.searchspace import Searchspace
def tune(runner, kernel_options, device_options, tuning_options):
""" Tune all instances in the parameter space
:params runner: A runner from ke... | [
37811,
383,
4277,
4811,
326,
11629,
689,
832,
262,
2187,
11507,
2272,
37227,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
9720,
62,
28286,
263,
13,
12947,
13200,
1330,
11140,
13200,
628,
198,
4299,
14009,
7,
16737... | 3.474227 | 388 |
#include <bits/stdc++.h>
using namespace std;
};
class SinglyLinkedList {
public:
SinglyLinkedListNode *head;
SinglyLinkedListNode *tail;
SinglyLinkedList() {
this->head = nullptr;
this->tail = nullptr;
}
};
void print_singly_linked_list(SinglyLinkedListN... | [
2,
17256,
1279,
9895,
14,
301,
17896,
4880,
13,
71,
29,
198,
198,
3500,
25745,
14367,
26,
198,
19629,
198,
198,
4871,
311,
4420,
11280,
276,
8053,
1391,
198,
220,
220,
220,
1171,
25,
198,
220,
220,
220,
220,
220,
220,
220,
311,
44... | 2.192857 | 840 |
#!/usr/bin/python
#
# Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
220,
15069,
6244,
12,
1238,
2481,
15142,
3115,
785,
48074,
3337,
357,
2503,
13,
65,
1416,
13,
274,
8,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
... | 2.468945 | 3,043 |
"""
double each entry in a given array recursively
E.g [1, 2, 3, 4, 5]
"""
if __name__ == '__main__':
a = [1,2,3,4,5]
print(double_entries(a))
| [
37811,
198,
220,
220,
220,
4274,
1123,
5726,
287,
257,
1813,
7177,
664,
1834,
2280,
198,
220,
220,
220,
412,
13,
70,
685,
16,
11,
362,
11,
513,
11,
604,
11,
642,
60,
198,
37811,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
8... | 2 | 83 |
""" Record class that stores {Key: List[Value]} dict
"""
import atexit
import typing as t
from collections import defaultdict
from pathlib import Path
import click
import pandas as pd
_SAVE_FN = t.Callable[[pd.DataFrame, Path], None]
class Record:
"""Available colors: black, red, green, yellow, blue, magent... | [
37811,
13266,
1398,
326,
7000,
1391,
9218,
25,
7343,
58,
11395,
48999,
8633,
198,
37811,
198,
11748,
379,
37023,
198,
11748,
19720,
355,
256,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
3904,
... | 2.668605 | 172 |
import dg
from .xmlio import XMLProtocol, Node
from .xmpp import client, Client, JabberID, XMPPError, XMPPMessage, XMPPPresence
| [
11748,
288,
70,
198,
6738,
764,
19875,
952,
1330,
23735,
19703,
4668,
11,
19081,
198,
6738,
764,
87,
76,
381,
220,
1330,
5456,
11,
20985,
11,
24404,
527,
2389,
11,
1395,
7378,
47,
12331,
11,
1395,
7378,
5868,
7589,
11,
1395,
7378,
1... | 2.804348 | 46 |
#!/usr/bin/env python
"""
Module for coordinating mpi
Author: {0} ({1})
This program is part of CADEE, the framework for
Computer-Aided Directed Evolution of Enzymes.
"""
__author__ = "Beat Amrein"
__email__ = "beat.amrein@gmail.com"
try:
from mpi4py import MPI
except ImportError:
print('mpi4py not found'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
26796,
329,
35449,
285,
14415,
198,
198,
13838,
25,
1391,
15,
92,
37913,
16,
30072,
198,
198,
1212,
1430,
318,
636,
286,
37292,
6500,
11,
262,
9355,
329,
198,
34556,
... | 2.292063 | 315 |
from email.policy import default
from email.utils import parsedate
import os
import mlflow
import mlflow.sklearn
import argparse
import time
import numpy as np
import pandas as pd
from sklearn.metrics import mean_absolute_percentage_error, mean_squared_error, mean_absolute_error,r2_score
from sklearn.model_selection i... | [
6738,
3053,
13,
30586,
1330,
4277,
198,
6738,
3053,
13,
26791,
1330,
44267,
378,
198,
11748,
28686,
198,
11748,
285,
1652,
9319,
198,
11748,
285,
1652,
9319,
13,
8135,
35720,
198,
11748,
1822,
29572,
198,
11748,
640,
220,
198,
11748,
29... | 2.708812 | 261 |
import unittest
from datetime import datetime
from unittest.mock import MagicMock
from app.main import calendar
from app.main.holiday import Holiday
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
198,
6738,
598,
13,
12417,
1330,
11845,
198,
6738,
598,
13,
12417,
13,
37689,
1330,
22770,
628,
198,
198... | 3.125 | 64 |
#!/usr/bin/env python
#########################################
# Zeitcoin AMP Class
#########################################
import sys, os, time, threading, hashlib, random
from zeitcoindb import hashtable
from zeitcoinutility import utility,encyption
from zeitcointrans import transactions
from twisted.protocols im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
29113,
7804,
2,
198,
2,
47447,
3630,
3001,
47,
5016,
198,
29113,
7804,
2,
198,
198,
11748,
25064,
11,
28686,
11,
640,
11,
4704,
278,
11,
12234,
8019,
11,
4738,
198,
6738,
41271,
270,... | 2.833554 | 757 |
# -*- coding: utf-8 -*-
import os
import unittest
from context import icsuit
from icsuit.cli.loader import findmod, importmod, listmod
class TestLoader(unittest.TestCase):
"""Unit test cases for cli.loader."""
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
4732,
1330,
220,
873,
5013,
198,
198,
6738,
220,
873,
5013,
13,
44506,
13,
29356,
1330,
1064,
4666,
11,
1... | 2.66 | 100 |
from day_03.solution import parse, part_1, part_2
| [
6738,
1110,
62,
3070,
13,
82,
2122,
1330,
21136,
11,
636,
62,
16,
11,
636,
62,
17,
628,
198
] | 2.736842 | 19 |
from flask import Blueprint
from flask import current_app
from flask import jsonify
from flask import g
from flask import request
from eth_app.db import get_connection, get_data, add_data
from eth_app.API import Api
import os
import pandas as pd
import numpy as np
API_KEY = os.getenv("API_KEY")
bp = Blueprint('api'... | [
6738,
42903,
1330,
39932,
198,
6738,
42903,
1330,
1459,
62,
1324,
198,
6738,
42903,
1330,
33918,
1958,
198,
6738,
42903,
1330,
308,
198,
6738,
42903,
1330,
2581,
198,
198,
6738,
4555,
62,
1324,
13,
9945,
1330,
651,
62,
38659,
11,
651,
... | 3.006579 | 152 |
"""Helper module"""
| [
37811,
47429,
8265,
37811,
628
] | 4.2 | 5 |
import typer
from mltk import cli
@cli.root_cli.command("commander", cls=cli.VariableArgumentParsingCommand)
def silabs_commander_command(ctx: typer.Context):
"""Silab's Commander Utility
This utility allows for accessing a Silab's embedded device via JLink.
For more details issue command: mltk c... | [
198,
11748,
1259,
525,
198,
6738,
285,
2528,
74,
1330,
537,
72,
220,
628,
198,
198,
31,
44506,
13,
15763,
62,
44506,
13,
21812,
7203,
9503,
4066,
1600,
537,
82,
28,
44506,
13,
43015,
28100,
1713,
47,
945,
278,
21575,
8,
198,
4299,
... | 2.838174 | 241 |
import tornado.template
from pypugjs import Compiler as _Compiler
from pypugjs.exceptions import CurrentlyNotSupported
from pypugjs.runtime import attrs, escape, iteration
from pypugjs.utils import process
ATTRS_FUNC = '__pypugjs_attrs'
ESCAPE_FUNC = '__pypugjs_escape'
ITER_FUNC = '__pypugjs_iter'
# Patch tornado... | [
11748,
33718,
13,
28243,
198,
198,
6738,
279,
4464,
1018,
8457,
1330,
3082,
5329,
355,
4808,
7293,
5329,
198,
6738,
279,
4464,
1018,
8457,
13,
1069,
11755,
1330,
16888,
3673,
48181,
198,
6738,
279,
4464,
1018,
8457,
13,
43282,
1330,
708... | 2.99187 | 123 |
# -*- coding: utf-8 -*-
# 签约服务
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
2,
13328,
255,
122,
163,
118,
99,
17312,
235,
27950,
94,
628
] | 1.259259 | 27 |
import argparse
import time
import parsl
from parsl.app.app import App
from parsl.tests.configs.local_threads import config
parsl.clear()
parsl.load(config)
@App('python')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--count", default="10",
... | [
11748,
1822,
29572,
198,
11748,
640,
198,
198,
11748,
13544,
75,
198,
6738,
13544,
75,
13,
1324,
13,
1324,
1330,
2034,
198,
6738,
13544,
75,
13,
41989,
13,
11250,
82,
13,
12001,
62,
16663,
82,
1330,
4566,
198,
198,
79,
945,
75,
13,
... | 2.33677 | 291 |
#attendance_file is the source file and list_file is the destination file
__author__ = "Vallisha M"
__version__ = '0.0.0'
from os import listdir
from os.path import isfile, join
import tkinter as tk
import pandas as pd
import re
from tkinter import *
from tkinter import filedialog
from tkinter.filedialog ... | [
2,
1078,
437,
590,
62,
7753,
318,
262,
2723,
2393,
290,
1351,
62,
7753,
318,
262,
10965,
2393,
201,
198,
834,
9800,
834,
796,
366,
53,
439,
19388,
337,
1,
201,
198,
834,
9641,
834,
796,
705,
15,
13,
15,
13,
15,
6,
201,
198,
20... | 2.834829 | 557 |
from mab import algs
import numpy as np
| [
6738,
285,
397,
1330,
435,
14542,
198,
11748,
299,
32152,
355,
45941,
628,
628,
628,
628,
198
] | 2.823529 | 17 |
# antioch
# Copyright (c) 1999-2019 Phil Christensen
#
# See LICENSE for details
"""
Provide testing for the codebase
"""
import pkg_resources as pkg
from antioch.core import bootstrap
from django.conf import settings
from django.db import connection | [
2,
1885,
41097,
198,
2,
15069,
357,
66,
8,
7358,
12,
23344,
4543,
49195,
198,
2,
198,
2,
4091,
38559,
24290,
329,
3307,
198,
198,
37811,
198,
15946,
485,
4856,
329,
262,
2438,
8692,
198,
37811,
198,
198,
11748,
279,
10025,
62,
37540... | 3.513889 | 72 |
# -*- encoding: utf-8 -*-
#
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp. #
#
# Authors: Svetlana Shturm <sshturm@mirantis.com>
#
# 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 t... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
3050,
12,
9804,
4946,
25896,
5693,
198,
2,
15069,
2321,
12,
6390,
19764,
11421,
13,
1303,
198,
2,
198,
2,
46665,
25,
311,
16809,
75,
2271,
911,
365... | 2.907449 | 443 |
from django import template
from django.http import Http404
from django.conf import settings
from copy import copy
register = template.Library()
REMOVE_ORDER = '<a href="{}"><i class="icon-remove"></i></a>'
sort_directions = {
'asc': {'icon':'icon-arrow-up', 'inverse': 'desc'},
'desc': {'icon':'icon-arrow-do... | [
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
4866,
1330,
4866,
198,
30238,
796,
11055,
13,
23377,
3419,
198,
198,
2200,
11770,
6089... | 2.648374 | 492 |
import re
import os
from tkinter import *
from tkinter import Tk
from tkinter.filedialog import askdirectory
import time
# todo:
# make renaming temporary, file names go back to their original after the parsing computation is done
# or find a way to parse without needing to rename (probably using regex).
rootWindow =... | [
11748,
302,
198,
11748,
28686,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
309,
74,
198,
6738,
256,
74,
3849,
13,
69,
3902,
498,
519,
1330,
1265,
34945,
198,
11748,
640,
198,
198,
2,
284,
4598,
25,
198,
2... | 2.85486 | 751 |
from django.conf.urls import url, include
from .program.views import (EpisodeView, EpisodeProgramView, EpisodePlaylistView,
ProgramListView, IndexView, EpisodesByTagView,
SearchEpisodeByTagsView, EpisodesBySearchedTagsView,
ProgramDeta... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
198,
6738,
764,
23065,
13,
33571,
1330,
357,
23758,
7680,
11,
7922,
15167,
7680,
11,
7922,
11002,
4868,
7680,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.283333 | 1,140 |
from .processors import InputExample, InputFeatures, DataProcessor, SquadFeatures
from .processors import glue_output_modes, glue_processors, glue_tasks_num_labels, glue_convert_examples_to_features
from .processors import squad_convert_examples_to_features, SquadExample, SquadV1Processor, SquadV2Processor
from .pro... | [
6738,
764,
14681,
669,
1330,
23412,
16281,
11,
23412,
23595,
11,
6060,
18709,
273,
11,
11630,
23595,
201,
198,
6738,
764,
14681,
669,
1330,
22749,
62,
22915,
62,
76,
4147,
11,
22749,
62,
14681,
669,
11,
22749,
62,
83,
6791,
62,
22510,... | 3.011236 | 178 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-20 22:06
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
16,
319,
1584,
12,
2999,
12,
1238,
2534,
25,
3312,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
from __future__ import absolute_import
from .scanner import *
from .django import *
from .celery import *
| [
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
764,
35836,
1008,
1330,
1635,
198,
6738,
764,
28241,
14208,
1330,
1635,
198,
6738,
764,
7015,
88,
1330,
1635,
628
] | 3.40625 | 32 |
import requests
from flask import request, url_for
from ..core import server
URL_JOONYOUNG = 'https://hooks.slack.com/services/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'
# https://api.slack.com/docs/messages/builder
def _send_slack_message(url, text, attachments=[]):
"""
성공여부를 리턴합니다
"""
i... | [
11748,
7007,
198,
198,
6738,
42903,
1330,
2581,
11,
19016,
62,
1640,
198,
198,
6738,
11485,
7295,
1330,
4382,
198,
198,
21886,
62,
45006,
1340,
36981,
10503,
796,
705,
5450,
1378,
25480,
82,
13,
6649,
441,
13,
785,
14,
30416,
14,
51,
... | 1.975309 | 324 |
import os
import time
import numpy as np
import tensorflow as tf
from multiprocessing import Process, Manager,freeze_support
import sys
import matplotlib.pyplot as plt
import math
sys.path.append('..')
import torch
from core.config import MachineConfig
from playground.Non_DAG_with_Energy.algorithm.random_algorithm impo... | [
11748,
28686,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
11,
9142,
11,
5787,
2736,
62,
11284,
198,
11748,
25064,
198,
11748,
2603,
29487,
... | 2.620888 | 4,165 |
"""
Sample script to demonstrate inheritance
"""
from Net2Scripting import init_logging
from Net2Scripting.net2xs import Net2XS
# Operator id 0 is System Engineer
OPERATOR_ID = 0
# Default Net2 password
OPERATOR_PWD = "net2"
# When running on the machine where Net2 is installed
NET2_SERVER = "localhost"
class MyNet... | [
37811,
198,
36674,
4226,
284,
10176,
24155,
198,
37811,
198,
198,
6738,
3433,
17,
7391,
278,
1330,
2315,
62,
6404,
2667,
198,
6738,
3433,
17,
7391,
278,
13,
3262,
17,
34223,
1330,
3433,
17,
55,
50,
198,
198,
2,
35946,
4686,
657,
318... | 2.490909 | 550 |
from django.db import migrations, models
import django.db.models.deletion
| [
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 3.26087 | 23 |
# -*- coding: utf-8 -*-
import json
import os
import re
import logging
from logging.handlers import RotatingFileHandler
from logging import getLogger
from time import sleep
from flask import Flask, url_for, render_template, request, redirect, \
jsonify, send_from_directory, send_file, Response
import gevent
from g... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
18931,
198,
6738,
18931,
13,
4993,
8116,
1330,
18481,
803,
8979,
25060,
198,
6738,
18931,
1330,
651,
11187,
1... | 2.592629 | 2,008 |
try: import cPickle as pickle
except: import pickle
from os import environ
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import itertools
from matplotlib import rc
import numpy as np
import pandas as pd
import seaborn as sns
import pickle as pkl
import functools
font = {'family': 'serif', 'se... | [
28311,
25,
1330,
269,
31686,
293,
355,
2298,
293,
198,
16341,
25,
1330,
2298,
293,
198,
6738,
28686,
1330,
551,
2268,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
11748,
2603,
29487,
8019,
1... | 2.582902 | 386 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198
] | 3.444444 | 9 |
#! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
test_colours.py
Desscription:
Unit tests for mac_colours.
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved.
"""
import ... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
6530,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
4033,
4662,
13,
9078,
198,
220,
22... | 2.561779 | 607 |
from django.test import TestCase
from pandora import Box
class MultiThreadedTests(TestCase):
"""
Please contribute a patch if you know how to easily test the multithreaded
behaviour of pandora's box.
"""
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
19798,
5799,
1330,
8315,
628,
198,
198,
4871,
15237,
16818,
276,
51,
3558,
7,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4222,
8676,
257,
8529,
611,
3... | 3.231884 | 69 |
from nornir import InitNornir
from nornir.plugins.tasks.networking import netmiko_send_command
from nornir.plugins.functions.text import print_result
from nornir_test.nornir_utilities import nornir_set_creds
if __name__ == "__main__":
main()
| [
6738,
299,
1211,
343,
1330,
44707,
45,
1211,
343,
198,
6738,
299,
1211,
343,
13,
37390,
13,
83,
6791,
13,
3262,
16090,
1330,
2010,
76,
12125,
62,
21280,
62,
21812,
198,
6738,
299,
1211,
343,
13,
37390,
13,
12543,
2733,
13,
5239,
133... | 2.747253 | 91 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import csv
import os
import logging
import gzip
__license__ = "X11"
def read_csv_as_object(path):
"""
Read CSV lines as objects.
"""
results = []
with open(path) as stream:
reader = csv.reader(stream, delimiter=",", quotecha... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
11748,
33918,
198,
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
308,
13344,
198,
198,
834,
... | 2.325175 | 286 |
# -*- coding: utf-8 -*-
"""Optimus.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1E2Wmkz43H4FgDefXwK8kyLjgGGC7y_4w
"""
import random
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
27871,
20704,
13,
541,
2047,
65,
198,
198,
38062,
4142,
7560,
416,
1623,
4820,
2870,
13,
198,
198,
20556,
2393,
318,
5140,
379,
198,
220,
220,
220,
3740,
1378,
... | 2.500527 | 949 |
from avanzapy.constants import InstrumentType
from avanzapy.stock import Stock
from avanzapy.fund import Fund
from avanzapy.bond import Bond
from avanzapy.option import Option
from avanzapy.futureforward import FutureForward
from avanzapy.certificate import Certificate
from avanzapy.warrant import Warrant
from avanzap... | [
6738,
1196,
35410,
12826,
13,
9979,
1187,
1330,
42410,
6030,
198,
198,
6738,
1196,
35410,
12826,
13,
13578,
1330,
10500,
198,
6738,
1196,
35410,
12826,
13,
10990,
1330,
7557,
198,
6738,
1196,
35410,
12826,
13,
65,
623,
1330,
12812,
198,
... | 3.650273 | 183 |
bl_info = {
"name": "Qor JSON Scene Export",
"author": "Grady O'Connell",
"blender": (2,7,6),
"version": (0,0,1),
"location": "File > Import-Export",
"description": "Import-Export Qor JSON data format (export only)",
"category": "Import-Export",
"wiki_url... | [
2436,
62,
10951,
796,
1391,
198,
220,
220,
220,
366,
3672,
1298,
220,
220,
220,
220,
220,
220,
220,
220,
366,
48,
273,
19449,
28315,
36472,
1600,
198,
220,
220,
220,
366,
9800,
1298,
220,
220,
220,
220,
220,
220,
366,
8642,
4597,
... | 2.313793 | 290 |
__author__ = 'nb254'
import sqlite3
import numpy
import csv
import sys
sys.path.append("/mnt/nb254_data/src/utils/")
#import pandas as pd
from once import once, oncecleardb, onceprintdb, onceinit
DIR = '/mnt/nb254_data/db/'
| [
834,
9800,
834,
796,
705,
46803,
24970,
6,
198,
11748,
44161,
578,
18,
198,
11748,
299,
32152,
198,
11748,
269,
21370,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
14,
76,
429,
14,
46803,
24970,
62,
7890,
14,
10677,
14,
... | 2.586207 | 87 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to convert id3 v1 tags in a mp3 file to id3 v2."""
import sys
import os
import subprocess # noqa: S404, B404 nosec
# requires tool "id3v2"
# id3v2 -l Prince/Unknown\ Album/When\ Doves\ Cry.mp3
# id3v1 tag info for Prince/Unknown Album/When Doves Cry.mp3:
# T... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
7391,
284,
10385,
4686,
18,
410,
16,
15940,
287,
257,
29034,
18,
2393,
284,
4686,
18,
410,
17,
526,
... | 2.157329 | 1,767 |
import usaddress
| [
11748,
514,
21975,
628,
198
] | 3.8 | 5 |
"""Classes for federated experiments.
Experiment classes are supposed to be, as far as possible, agnostic to models,
loss functions and optimizers. They take care of training, testing and logging.
Note on parameter/`state_dict` distinction: Currently, this implementation
treats all members of the `state_dict` as para... | [
37811,
9487,
274,
329,
28062,
515,
10256,
13,
198,
198,
20468,
3681,
6097,
389,
4385,
284,
307,
11,
355,
1290,
355,
1744,
11,
556,
43758,
284,
4981,
11,
198,
22462,
5499,
290,
6436,
11341,
13,
1119,
1011,
1337,
286,
3047,
11,
4856,
... | 2.478375 | 6,867 |
from pygorithms.algorithms.sorting.selection_sort import selection_sort
| [
6738,
12972,
7727,
907,
13,
282,
7727,
907,
13,
82,
24707,
13,
49283,
62,
30619,
1330,
6356,
62,
30619,
628
] | 3.65 | 20 |