content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""uielements.py"""
import pygame
from pygame.sprite import Sprite
# Color RGB globals
BLUE = (106, 159, 181)
WHITE = (255, 255, 255)
BLACK = (0,0,0)
class MyImage(Sprite):
"""Class to set position and draw an image"""
def __init__(self, screen, img_path):
"""Initialize image and set position"""
... | [
37811,
84,
494,
3639,
13,
9078,
37811,
198,
11748,
12972,
6057,
198,
6738,
12972,
6057,
13,
34975,
578,
1330,
33132,
198,
198,
2,
5315,
25228,
15095,
874,
198,
9148,
8924,
796,
357,
15801,
11,
26422,
11,
30110,
8,
198,
12418,
12709,
7... | 2.496795 | 312 |
import subprocess as sp
data_folder = '/Users/xqu/datasets/lfw/lfw_mtcnnpy_160'
face_net_model = '/Users/xqu/datasets/pretrain/20180402-114759.pb'
output_model = '/Users/xqu/datasets/mymodels/lfw_classifier.pkl'
batch_size = 10
augment_times = 20
cmd = """python myclassifier.py TRAIN \
{} \
{} \
{} \
--batch_size {} ... | [
11748,
850,
14681,
355,
599,
198,
198,
7890,
62,
43551,
796,
31051,
14490,
14,
87,
421,
14,
19608,
292,
1039,
14,
1652,
86,
14,
1652,
86,
62,
16762,
66,
20471,
9078,
62,
14198,
6,
198,
2550,
62,
3262,
62,
19849,
796,
31051,
14490,
... | 2.523404 | 235 |
"""Data augmentation functionality. Passed as callable transformations to
Dataset classes.
The data augmentation procedures were interpreted from @weiliu89's SSD paper
http://arxiv.org/abs/1512.02325
Ellis Brown, Max deGroot
"""
import torch
import cv2
import numpy as np
import random
import math
from ... | [
37811,
6601,
16339,
14374,
11244,
13,
23228,
355,
869,
540,
38226,
284,
201,
198,
27354,
292,
316,
6097,
13,
201,
198,
201,
198,
464,
1366,
16339,
14374,
9021,
547,
16173,
422,
2488,
732,
2403,
84,
4531,
338,
21252,
3348,
201,
198,
40... | 2.432665 | 698 |
import pandas as pd
import numpy as np
import torch
from torch import nn
import os
import sys
import json
from PIL import Image
from pathlib import Path
import math
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
33918,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
3108,
8019,
1... | 3.586957 | 46 |
import hanshift
# 은/는
# 이/가
# 을/를
# 과/와
# 이다/다
# 으로/로
# 률/율
| [
11748,
289,
504,
29323,
628,
198,
2,
23821,
251,
222,
14,
167,
232,
242,
628,
198,
198,
2,
23821,
251,
112,
14,
166,
108,
222,
628,
198,
198,
2,
23821,
251,
226,
14,
167,
98,
120,
628,
198,
198,
2,
220,
166,
111,
120,
14,
168,... | 0.954023 | 87 |
# Copyright 2019 U.C. Berkeley RISE Lab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | [
2,
220,
15069,
13130,
471,
13,
34,
13,
14727,
371,
24352,
3498,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846... | 2.891892 | 296 |
import svgwrite
class ForeignObject(
svgwrite.base.BaseElement,
svgwrite.mixins.Transform,
svgwrite.container.Presentation,
):
"""Create an instance of the ForeignObject class. This class describes an add-on to svgwrite and allows arbitrary HTML code to be embedded in SVG drawings.
Args:
... | [
11748,
38487,
70,
13564,
628,
198,
4871,
8708,
10267,
7,
198,
220,
220,
220,
38487,
70,
13564,
13,
8692,
13,
14881,
20180,
11,
198,
220,
220,
220,
38487,
70,
13564,
13,
19816,
1040,
13,
41762,
11,
198,
220,
220,
220,
38487,
70,
1356... | 2.806452 | 186 |
# -*- coding: utf-8 -*-
"""
Interactive test for CollisionManager.objs_into_box
Implements click selection plus elastic box selection
Clicking anywhere will select the ball(s) under the mouse cursor
Drag a rectangle to select balls fully into rectangle
Click outside any ball to unselect
Use arrow keys to move selection... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
9492,
5275,
1332,
329,
7778,
1166,
13511,
13,
672,
8457,
62,
20424,
62,
3524,
198,
3546,
1154,
902,
3904,
6356,
5556,
27468,
3091,
6356,
198,
2601,
7958,
660... | 2.51204 | 1,412 |
import pypsa
import numpy as np
import random
import matplotlib.pyplot as plt, mpld3
random.seed(69)
network = pypsa.Network()
#Adding buses and lat and long
for i in range(8):
network.add("Bus","Bus {}".format(i))
network.buses.at[network.buses.index[0], 'x'] = 0
network.buses.at[network.buses.index[0], 'y'] = 5
... | [
11748,
12972,
862,
64,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
11,
29034,
335,
18,
198,
25120,
13,
28826,
7,
3388,
8,
198,
27349,
796,
12972,
862,
64,
13,
2... | 2.034137 | 996 |
import click
from utils import getENV, builder, verifyLinkedinURL
from scraping import scraping
from PyInquirer import style_from_dict, Token, prompt
import os
from colorama import Fore, init
import psutil
if psutil.Process(os.getpid()).parent().name() == 'cmd.exe':
init(convert=True)
style = style_from_dict({
... | [
11748,
3904,
198,
6738,
3384,
4487,
1330,
651,
1677,
53,
11,
27098,
11,
11767,
11280,
27152,
21886,
198,
6738,
46743,
1330,
46743,
198,
6738,
9485,
818,
29782,
81,
1330,
3918,
62,
6738,
62,
11600,
11,
29130,
11,
6152,
198,
11748,
28686,... | 2.70632 | 269 |
# -*- coding: utf-8 -*-
import numpy as np
import collections
from sklearn import tree
from sklearn.model_selection import GridSearchCV
from sklearn.base import is_regressor
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn.base import BaseEstimator
from sklearn.metrics im... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
17268,
198,
6738,
1341,
35720,
1330,
5509,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
24846,
18243,
33538,
198,
6738,
1... | 2.435787 | 7,405 |
"""This module loads a pre-trained ANN to predict job resource requirements for HST.
# 1 - load job metadata inputs from text file in s3
# 2 - encode strings as int/float values in numpy array
# 3 - load models and generate predictions
# 4 - return preds as json to parent lambda function
"""
import boto3
import numpy a... | [
37811,
1212,
8265,
15989,
257,
662,
12,
35311,
40126,
284,
4331,
1693,
8271,
5359,
329,
367,
2257,
13,
198,
2,
352,
532,
3440,
1693,
20150,
17311,
422,
2420,
2393,
287,
264,
18,
198,
2,
362,
532,
37773,
13042,
355,
493,
14,
22468,
3... | 3.119211 | 1,166 |
"""
A demosite with oscarapi for demo and documentation purposes
"""
from setuptools import setup, find_packages
import os
__version__ = "0.0.1"
setup(
name='oscarapi-demosite',
version=__version__,
description="Oscar API Demosite",
long_description=__doc__,
classifiers=[],
keywords='',
au... | [
37811,
198,
32,
1357,
5971,
351,
267,
13034,
15042,
329,
13605,
290,
10314,
4959,
198,
37811,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
28686,
198,
198,
834,
9641,
834,
796,
366,
15,
13,
15,
13,
16,
... | 2.432258 | 310 |
import unittest
| [
11748,
555,
715,
395,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 1.785714 | 14 |
from ..responses import ResponseMsg
from .argument import ArgSession, Argument
from ..paths import PATHS
import pandas as pd
import os, datetime
# 2021-12-11: 完成代码并进行调试
# 2021-12-11: 支持多条加入,另外加入了删除机制
SUBS_LIST = os.path.join(PATHS['data'], 'qq_subscription_list.xlsx')
# 给scheduler调用,用于查找订阅列表
| [
6738,
11485,
16733,
274,
1330,
18261,
50108,
201,
198,
6738,
764,
49140,
1330,
20559,
36044,
11,
45751,
201,
198,
6738,
11485,
6978,
82,
1330,
28748,
7998,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
28686,
11,
4818,
807... | 1.602041 | 196 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right | [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
7,
15252,
2599,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1188,
28,
15,
11,
1364,
28,
14202,
11,
826,
28,
14202,
2599,
198,
2,
220,
22... | 2.313953 | 86 |
import pytest
from unittest import mock
import os
from django.utils.timezone import now, timedelta
from awx.main.tasks import (
RunProjectUpdate, RunInventoryUpdate,
awx_isolated_heartbeat,
isolated_manager
)
from awx.main.models import (
ProjectUpdate, InventoryUpdate, InventorySource,
Instance, ... | [
11748,
12972,
9288,
198,
6738,
555,
715,
395,
1330,
15290,
198,
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
1330,
783,
11,
28805,
12514,
198,
198,
6738,
3253,
87,
13,
12417,
13,
83,
6791,
1330,
357,
198,
22... | 2.819444 | 144 |
foo # reiz: tp
if 2 + 2:
bar # reiz: tp
baz() # reiz: tp
SIMPLE_NAME_MATCH + x # reiz: tp
True + False
| [
21943,
220,
1303,
302,
528,
25,
256,
79,
198,
198,
361,
362,
1343,
362,
25,
198,
220,
220,
220,
2318,
220,
1303,
302,
528,
25,
256,
79,
198,
220,
220,
220,
275,
1031,
3419,
220,
1303,
302,
528,
25,
256,
79,
198,
198,
48913,
1643... | 1.830769 | 65 |
import torch
from abc import ABC
import torch_geometric
import torch.nn.functional as functional
from torch import LongTensor, FloatTensor
| [
11748,
28034,
198,
6738,
450,
66,
1330,
9738,
198,
11748,
28034,
62,
469,
16996,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
10345,
198,
6738,
28034,
1330,
5882,
51,
22854,
11,
48436,
51,
22854,
628
] | 4 | 35 |
from pyrsistent import pmap
from . import logger
from . import types
class Visitor:
"抽象構文木をたどり型推論を行うVisitorクラス"
def unify(t1, t2):
"型が合うように、型変数への代入をする"
if t1 == t2 and t1 in (types.Unit, types.Bool, types.Int, types.Float):
return
if types.is_fun(t1) and types.is_fun(t2):
if len(t1... | [
6738,
279,
48489,
7609,
1330,
279,
8899,
198,
6738,
764,
1330,
49706,
198,
6738,
764,
1330,
3858,
628,
198,
198,
4871,
6911,
2072,
25,
198,
220,
220,
220,
366,
162,
232,
121,
164,
109,
94,
162,
100,
233,
23877,
229,
17312,
101,
3175... | 1.705785 | 1,210 |
# coding: utf8
import os
import pytest
@pytest.fixture(params=["get_loss"])
| [
2,
19617,
25,
3384,
69,
23,
198,
198,
11748,
28686,
198,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
37266,
28,
14692,
1136,
62,
22462,
8973,
8,
628
] | 2.454545 | 33 |
import click
from src.Categorize_CLI.common.extensions import extensions
from src.Categorize_CLI.services.ext_functions import *
from colorama import init
from colorama import Fore
init()
@click.command()
@click.option("-t", "--type", type=str, help = "Type of extension", required=False)
@click.option("-p", "--path",... | [
11748,
3904,
198,
6738,
12351,
13,
34,
47467,
1096,
62,
5097,
40,
13,
11321,
13,
2302,
5736,
1330,
18366,
198,
6738,
12351,
13,
34,
47467,
1096,
62,
5097,
40,
13,
30416,
13,
2302,
62,
12543,
2733,
1330,
1635,
198,
6738,
3124,
1689,
... | 2.867742 | 620 |
import asyncio
import signal
import sys
from datetime import datetime, timedelta
import shelve
import os
import random
from aiogram import Bot, Dispatcher, types
BOT_TOKEN = os.getenv('TOKEN')
db = shelve.open(os.path.join('db', 'db'), writeback=True)
tasks_set = set(db['tasks'].keys())
bot: Bot
solving... | [
11748,
30351,
952,
201,
198,
11748,
6737,
201,
198,
11748,
25064,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
201,
198,
11748,
7497,
303,
201,
198,
11748,
28686,
201,
198,
11748,
4738,
201,
198,
201,
198,
6738,
257,
... | 1.997333 | 375 |
import numpy as np
from keras.layers import Layer
from keras.layers import InputSpec
from keras.utils import conv_utils
from keras.utils import np_utils
class RandomCropping1D(Layer):
"""Randomized cropping layer for 1D input (e.g. temporal sequence).
It crops along the time dimension (axis 1).
# Arguments... | [
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
34398,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
23412,
22882,
198,
6738,
41927,
292,
13,
26791,
1330,
3063,
62,
26791,
198,
6738,
41927,
292,
13,
26791,
1330,
... | 2.723577 | 246 |
import json
from tastypie.exceptions import TastypieError
from tastypie.http import HttpBadRequest
class CustomBadRequest(TastypieError):
'''
This exception is used to interrupt the flow of processing to immediately
return a custom HttpResponse.
Required after upgrading to django-tastypie==0.9.14
... | [
11748,
33918,
198,
198,
6738,
14854,
4464,
494,
13,
1069,
11755,
1330,
309,
459,
4464,
494,
12331,
198,
6738,
14854,
4464,
494,
13,
4023,
1330,
367,
29281,
22069,
18453,
628,
198,
4871,
8562,
22069,
18453,
7,
51,
459,
4464,
494,
12331,
... | 3.12844 | 109 |
""" Password Validation """
import csv
import bcrypt
def ex15():
""" Prompt for username and password
Attempt to look up in the csv file
Inform the user if the login attempt was successful
"""
passwords = {}
with open('module15.csv', 'r') as csv_file:
reader = csv.reader(csv_file)
... | [
37811,
30275,
3254,
24765,
37227,
198,
198,
11748,
269,
21370,
198,
11748,
275,
29609,
198,
198,
4299,
409,
1314,
33529,
198,
220,
220,
220,
37227,
45965,
329,
20579,
290,
9206,
198,
220,
220,
220,
25770,
284,
804,
510,
287,
262,
269,
... | 2.629771 | 262 |
import os
import numpy as np
import pandas as pd
from collections import defaultdict
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
if __name__ == '__main__':
path = "runs"
steps = tabulate_events(path)
pd.concat(steps.values(),keys=steps.keys()).to_csv('all_result.csv... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
11192,
273,
3526,
13,
1891,
437,
13,
15596,
62,
36948,
13,
15596,
62,
4134,
388,
8927,
1330,
... | 2.90991 | 111 |
# The MIT License (MIT)
# Copyright (c) 2018 Massachusetts Institute of Technology
#
# Authors: Cody Rude
# This software has been created in projects supported by the US National
# Science Foundation and NASA (PI: Pankratius)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this so... | [
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
15069,
357,
66,
8,
2864,
10140,
5136,
286,
8987,
198,
2,
198,
2,
46665,
25,
27035,
371,
2507,
198,
2,
770,
3788,
468,
587,
2727,
287,
4493,
4855,
416,
262,
1294,
2351,
198,
2,
5800,
5... | 2.919268 | 929 |
#!/usr/bin/env python3
# _*_ coding: utf-8 _*_
""" The tags and attributes docx2python knows how to handle.
:author: Shay Hill
:created: 3/18/2021
A lot of the information in a docx file isn't text or text attributes. Docx files
record spelling errors, revision history, etc. Docx2Python will ignore (by design)
much o... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
37811,
383,
15940,
290,
12608,
2205,
87,
17,
29412,
4206,
703,
284,
5412,
13,
198,
198,
25,
9800,
25,
34760,
33... | 2.620345 | 1,799 |
import graphene
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django_filters import FilterSet, OrderingFilter
from graphene import relay
from graphene_django import DjangoObjectType
from graphene_django.filter import DjangoFilterConnectionField
| [
11748,
42463,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
4912,
198,
6738,
42625,
14208,
62,
10379,
1010,
1330,
25853,
7248,
11,
... | 4 | 75 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=W0611, W0613, W0621, E1101
from __future__ import unicode_literals
import time
import json
from io import BytesIO
import pytest
import tabun_api as api
from tabun_api.compat import text, binary
from testutil import UserTest, load_file, form_intercept,... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
54,
3312,
1157,
11,
370,
3312,
1485,
11,
370,
3312,
2481,
11,
412,
1157,
486... | 2.742188 | 128 |
import time
import threading
import asyncio
from aiohttp import ClientSession
from aiohttp_proxy import ProxyConnector, ProxyType
| [
11748,
640,
201,
198,
11748,
4704,
278,
201,
198,
201,
198,
11748,
30351,
952,
201,
198,
201,
198,
6738,
257,
952,
4023,
1330,
20985,
36044,
201,
198,
6738,
257,
952,
4023,
62,
36436,
1330,
38027,
34525,
11,
38027,
6030,
201,
198,
201... | 3.27907 | 43 |
import os
print(os.path.realpath(__file__))
| [
11748,
28686,
201,
198,
4798,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
4008,
201,
198
] | 2.421053 | 19 |
from datetime import datetime, timedelta
srsMap = (
timedelta(hours=4),
timedelta(hours=8),
timedelta(days=1),
timedelta(days=3),
timedelta(weeks=1),
timedelta(weeks=2),
timedelta(weeks=4),
timedelta(weeks=16)
)
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
82,
3808,
13912,
796,
357,
198,
220,
220,
220,
28805,
12514,
7,
24425,
28,
19,
828,
198,
220,
220,
220,
28805,
12514,
7,
24425,
28,
23,
828,
198,
220,
220,
220,
28805,
... | 2.205357 | 112 |
from itertools import combinations
from tool.runners.python import SubmissionPy
| [
6738,
340,
861,
10141,
1330,
17790,
198,
198,
6738,
2891,
13,
36740,
13,
29412,
1330,
42641,
20519,
628
] | 4.555556 | 18 |
"""The goal of this module is to coalesce all of the logic regarding retries,
wf instance ERROR reporting, and traffic shadowing into one place.
As of this commit, the module is just a placeholder and will be fully fleshed
out soon. See REXFLOW-188.
"""
import base64
from enum import Enum
import logging
import json
im... | [
37811,
464,
3061,
286,
428,
8265,
318,
284,
46064,
344,
477,
286,
262,
9156,
5115,
1005,
1678,
11,
198,
86,
69,
4554,
33854,
6447,
11,
290,
4979,
9082,
278,
656,
530,
1295,
13,
198,
198,
1722,
286,
428,
4589,
11,
262,
8265,
318,
6... | 3.483146 | 356 |
# from datetime import datetime
# import os
# import re
# import json
# import time
# from flask import Flask, g, jsonify, make_response, request
# from flask_cors import CORS
# from flask_httpauth import HTTPBasicAuth
# from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
# from itsdangerous import B... | [
2,
422,
4818,
8079,
1330,
4818,
8079,
198,
2,
1330,
28686,
198,
2,
1330,
302,
198,
2,
1330,
33918,
198,
2,
1330,
640,
198,
2,
422,
42903,
1330,
46947,
11,
308,
11,
33918,
1958,
11,
787,
62,
26209,
11,
2581,
198,
2,
422,
42903,
6... | 2.185377 | 1,354 |
# Give this app a custom verbose name to avoid confusion
from django.apps import AppConfig
from django.conf import settings
| [
2,
13786,
428,
598,
257,
2183,
15942,
577,
1438,
284,
3368,
10802,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
628
] | 4.166667 | 30 |
from BirdSongToolbox.preprocess import multi_bpf, hilbert_module, common_average_reference_array
import numpy as np
import scipy
def spectral_pertubation_module(neural_data, fs, l_freqs, h_freqs, bad_channels=None, verbose=False,
super_verbose=False):
""" For One Chunk repeatedly ... | [
6738,
14506,
44241,
25391,
3524,
13,
3866,
14681,
1330,
5021,
62,
46583,
69,
11,
289,
346,
4835,
62,
21412,
11,
2219,
62,
23913,
62,
35790,
62,
18747,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
628,
198,
4299,
... | 2.406651 | 2,887 |
# coding=utf-8
# SI 507 F17 Project 2 - Objects
import requests
import json
import unittest
import csv
print("\n*** *** PROJECT 2 *** ***\n")
#####
# [PROBLEM 1] [250 POINTS]
print("\n***** PROBLEM 1 *****\n")
# [PROBLEM 2] [400 POINTS]
print("\n***** PROBLEM 2 *****\n")
# Subclass of Media that assumes yo... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
25861,
2026,
22,
376,
1558,
4935,
362,
532,
35832,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
555,
715,
395,
198,
11748,
269,
21370,
198,
198,
4798,
7203,
59,
77,
8162,
17202,
21965,
23680,
... | 2.669492 | 472 |
import numpy as np
from copy import deepcopy
from mushroom_rl.algorithms.value.td import TD
from mushroom_rl.utils.table import EnsembleTable
class MaxminQLearning(TD):
"""
Maxmin Q-Learning algorithm without replay memory.
"Maxmin Q-learning: Controlling the Estimation Bias of Q-learning".
Lan Q. et... | [
11748,
299,
32152,
355,
45941,
198,
6738,
4866,
1330,
2769,
30073,
198,
198,
6738,
28520,
62,
45895,
13,
282,
7727,
907,
13,
8367,
13,
8671,
1330,
13320,
198,
6738,
28520,
62,
45895,
13,
26791,
13,
11487,
1330,
2039,
15140,
10962,
628,
... | 2.456395 | 344 |
from Scouting2013.model.reusable_models import Match, OfficialMatch, Team, TeamComments, TeamPictures, ScoreResultMetric, Competition
from Scouting2013.model.models2013 import ScoreResult
| [
198,
6738,
49716,
6390,
13,
19849,
13,
260,
31979,
62,
27530,
1330,
13225,
11,
15934,
23850,
11,
4816,
11,
4816,
23903,
11,
4816,
21300,
942,
11,
15178,
23004,
9171,
1173,
11,
27348,
198,
6738,
49716,
6390,
13,
19849,
13,
27530,
6390,
... | 4.2 | 45 |
import os
import glob
import re
import ctypes.util
from subprocess import Popen, PIPE
from .env import IS_WINDOWS, IS_LINUX, IS_DARWIN, check_env_flag, check_negative_env_flag
LINUX_HOME = '/usr/local/cuda'
WINDOWS_HOME = glob.glob('C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v*.*')
if check_negative_env_fl... | [
11748,
28686,
198,
11748,
15095,
198,
11748,
302,
198,
11748,
269,
19199,
13,
22602,
198,
6738,
850,
14681,
1330,
8099,
268,
11,
350,
4061,
36,
198,
198,
6738,
764,
24330,
1330,
3180,
62,
33207,
11,
3180,
62,
34509,
31235,
11,
3180,
6... | 2.092063 | 630 |
CORS_ORIGIN_WHITELIST = [
'http://localhost:3000'
]
CORS_ALLOW_METHODS = [
'GET',
'OPTIONS'
]
CORS_ALLOW_HEADERS = [
'accept',
'accept-encoding',
'authorization',
'content-type',
'dnt',
'origin',
'user-agent',
'x-csrftoken',
'x-requested-with',
]
| [
34,
20673,
62,
1581,
3528,
1268,
62,
12418,
2043,
3698,
8808,
796,
685,
198,
220,
220,
220,
705,
4023,
1378,
36750,
25,
23924,
6,
198,
60,
198,
198,
34,
20673,
62,
7036,
3913,
62,
49273,
50,
796,
685,
198,
220,
220,
220,
705,
1885... | 1.941176 | 153 |
import json
import logging
| [
11748,
33918,
198,
11748,
18931,
628
] | 4.666667 | 6 |
print(count_good_triplets([3, 0, 1, 1, 9, 7], a=7, b=2, c=3))
print(count_good_triplets([1, 1, 2, 2, 3], a=0, b=0, c=1))
| [
198,
198,
4798,
7,
9127,
62,
11274,
62,
28461,
46916,
26933,
18,
11,
657,
11,
352,
11,
352,
11,
860,
11,
767,
4357,
257,
28,
22,
11,
275,
28,
17,
11,
269,
28,
18,
4008,
198,
4798,
7,
9127,
62,
11274,
62,
28461,
46916,
26933,
1... | 1.808824 | 68 |
"""transforms.py
Transforms to apply to plots before fitting
Each transformation takes an 2+ arguments:
xarr: ndarray
yarr: ndarray
*args: more arguments to be potentially involved in the transformations
Each transformation returns a tuple of the same length as the input containing:
+ transformed x arr... | [
37811,
7645,
23914,
13,
9078,
198,
8291,
23914,
284,
4174,
284,
21528,
878,
15830,
198,
198,
10871,
13389,
2753,
281,
362,
10,
7159,
25,
198,
220,
220,
220,
2124,
3258,
25,
299,
67,
18747,
198,
220,
220,
220,
331,
3258,
25,
299,
67,... | 2.628713 | 2,020 |
from typing import List
__author__ = 'Branden Kappes <bkappes@mines.edu>'
__project__ = 'hedm'
import os
import numpy as np
import pandas as pd
from io import StringIO
class Grains(object):
"""
Stores information about the grains output from MIDAS HEDM.
"""
grains: List[None]
@property
... | [
6738,
19720,
1330,
7343,
198,
198,
834,
9800,
834,
796,
705,
38416,
268,
509,
1324,
274,
1279,
65,
74,
1324,
274,
31,
1084,
274,
13,
15532,
29,
6,
198,
834,
16302,
834,
796,
705,
704,
76,
6,
628,
198,
11748,
28686,
198,
11748,
299... | 2.214528 | 1,473 |
from django.shortcuts import render,redirect
from .forms import UserRegistrationForm,UserUpdateForm,ProfileUpdateForm
from django.contrib.auth.decorators import login_required
from django.contrib import messages
# Create your views here.
@login_required | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
445,
1060,
198,
6738,
764,
23914,
1330,
11787,
47133,
8479,
11,
12982,
10260,
8479,
11,
37046,
10260,
8479,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1... | 3.848485 | 66 |
# img.py
#-*-coding:utf-8-*-
from __future__ import absolute_import
from datetime import datetime
import errno
from logging import getLogger
from os import path
import os
try:
from urllib.parse import quote_plus, unquote
except ImportError: # Python 2
from urllib import quote_plus, unquote
import attr
fro... | [
2,
33705,
13,
9078,
198,
2,
12,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
11454,
3919,
198,
6738,
18931,
1330... | 2.608696 | 506 |
print(part1())
print(part2()) | [
628,
198,
4798,
7,
3911,
16,
28955,
198,
4798,
7,
3911,
17,
28955
] | 2.461538 | 13 |
"""
user_management.py
"""
from ipfabric import IPFClient
from ipfabric.settings import UserMgmt
if __name__ == '__main__':
ipf = IPFClient() # Token must have User Management Permissions
# ipf = IPFClient('https://demo3.ipfabric.io/', token='token', verify=False, timeout=15)
usermgmt = UserMgmt(client=i... | [
37811,
198,
7220,
62,
27604,
13,
9078,
198,
37811,
198,
6738,
20966,
36434,
1173,
1330,
6101,
37,
11792,
198,
6738,
20966,
36434,
1173,
13,
33692,
1330,
11787,
44,
70,
16762,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
... | 2.431655 | 834 |
import os
from setuptools import setup, find_packages
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='iris-data-set',
version='1-SNAPSHOT',
use_scm_version=True,
setup_requires=['setuptools_scm', 'future'],
descr... | [
11748,
28686,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
2,
1249,
9058,
13,
9078,
284,
307,
1057,
422,
597,
3108,
198,
418,
13,
354,
15908,
7,
418,
13,
6978,
13,
27237,
6978,
7,
418,
13,
6978,
13... | 2.251046 | 239 |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
12131,
43208,
21852,
1766,
1539,
12052,
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.773978 | 1,199 |
from itertools import product
from pyomo.core import *
| [
6738,
340,
861,
10141,
1330,
1720,
198,
198,
6738,
12972,
17902,
13,
7295,
1330,
1635,
628
] | 3.5625 | 16 |
import argparse, logging, iso8601
from . import utils
from .auditclient import AuditClient
logger = logging.getLogger(__name__)
| [
11748,
1822,
29572,
11,
18931,
11,
47279,
4521,
486,
198,
6738,
764,
1330,
3384,
4487,
198,
6738,
764,
3885,
270,
16366,
1330,
46450,
11792,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.25 | 40 |
from typing import List, Sequence, cast
from ...error import GraphQLError
from ...language import (
BooleanValueNode,
EnumValueNode,
FloatValueNode,
IntValueNode,
NullValueNode,
ListValueNode,
ObjectFieldNode,
ObjectValueNode,
StringValueNode,
ValueNode,
print_ast,
)
from ..... | [
6738,
19720,
1330,
7343,
11,
45835,
11,
3350,
198,
198,
6738,
2644,
18224,
1330,
29681,
48,
2538,
81,
1472,
198,
6738,
2644,
16129,
1330,
357,
198,
220,
220,
220,
41146,
11395,
19667,
11,
198,
220,
220,
220,
2039,
388,
11395,
19667,
1... | 2.12021 | 1,331 |
# -*- coding:utf-8 -*-
'''
positive number: 9:0000 1001
negative number:-9:invert(0000 1001 - 1)=1111 0111
'''
#s=Solution()
#print(s.NumberOf1(-9))
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
24561,
1271,
171,
120,
248,
860,
25,
2388,
1802,
16,
198,
31591,
1271,
171,
120,
248,
12,
24,
25,
259,
1851,
171,
120,
230,
2388,
1802,
16,
532,
352,
171,... | 2.013514 | 74 |
#!/usr/bin/python
# Author: Sari Sabban
# Email: sari.sabban@gmail.com
# URL: https://github.com/sarisabban
#
# Created By: Sari Sabban
# Created Date: 13 January 2017
#
# Modified By: Sari Sabban
# Modified Date: 3 February 2017
import re
import itertools
import sys
from Bio.PDB import *
print 'File mus... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
6434,
25,
311,
2743,
9910,
3820,
198,
2,
9570,
25,
220,
264,
2743,
13,
82,
397,
3820,
31,
14816,
13,
785,
198,
2,
10289,
25,
220,
220,
220,
3740,
1378,
12567,
13,
785,
14,
82,
... | 1.973344 | 3,639 |
#
# PySNMP MIB module APS-MIB-JUNI (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/APS-MIB-JUNI
# Produced by pysmi-0.3.4 at Wed May 1 11:24:19 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019,... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
3486,
50,
12,
8895,
33,
12,
41,
4944,
40,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
14,
67,
615... | 3.085331 | 15,141 |
# import external libraries
import pandas as pd
import numpy as np
from scipy.stats import chi2_contingency
def cramers_v(x, y):
'''
Cramer's V helps to find the "correlation" between
categorical varibles
'''
confusion_matrix = pd.crosstab(x, y)
chi2 = chi2_contingency(confusion_matrix)[0]
... | [
2,
1330,
7097,
12782,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
34242,
1330,
33166,
17,
62,
3642,
278,
1387,
628,
198,
4299,
33070,
364,
62,
85,
7,
87,
11,
331,
2599,
19... | 2.102941 | 272 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from foo.views import FooList, FooDetail, FooListBad, FooDetailBad
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'testproj.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', incl... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
22944,
13,
33571,
1330,
36080,
8053,
11,
36080,
11242,
603,
11,
36080,
8053,
22069,
11,
36080,... | 2.337121 | 264 |
import sys
from matplotlib import pyplot
from keras.datasets import cifar10
from keras.utils.np_utils import to_categorical
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Dense
from keras.layers import Flatten
from keras. layers import ... | [
11748,
25064,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
269,
361,
283,
940,
198,
6738,
41927,
292,
13,
26791,
13,
37659,
62,
26791,
1330,
284,
62,
66,
2397,
12409,
198,
6738,
... | 3.287958 | 191 |
from ..util import numpy as np
class Weights(object):
"""
Keep track of event weight corrections, as well as any accompanying systematic
shifts via multiplicative modifiers.
"""
def add(self, name, weight, weightUp=None, weightDown=None, shift=False):
"""
Add a correction to the o... | [
6738,
11485,
22602,
1330,
299,
32152,
355,
45941,
628,
198,
4871,
775,
2337,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9175,
2610,
286,
1785,
3463,
26251,
11,
355,
880,
355,
597,
19249,
17895,
198,
220,
220,
220,
... | 2.406994 | 2,059 |
# Databricks notebook source
# MAGIC %run ../_databricks-academy-helper $lesson="1.01"
# COMMAND ----------
DA.cleanup()
DA.init(create_db=False)
DA.conclude_setup()
| [
2,
16092,
397,
23706,
20922,
2723,
198,
2,
28263,
2149,
4064,
5143,
11485,
47835,
19608,
397,
23706,
12,
330,
324,
3065,
12,
2978,
525,
720,
1203,
261,
2625,
16,
13,
486,
1,
198,
198,
2,
22240,
6981,
24200,
438,
198,
198,
5631,
13,
... | 2.560606 | 66 |
from collections import namedtuple
import functools
import tensorflow as tf
slim = tf.contrib.slim
# Conv and InvResBlock namedtuple define layers of the MobileNet architecture
# Conv defines 3x3 convolution layers
# InvResBlock defines 3x3 depthwise convolution followed by 1x1 convolution.
# stride is the stride of... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
1257,
310,
10141,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
82,
2475,
796,
48700,
13,
3642,
822,
13,
82,
2475,
198,
198,
2,
34872,
290,
10001,
4965,
12235,
3706,
83,
2929... | 2.190049 | 6,472 |
#!/usr/bin/python
import argparse
import time
import subprocess
import shlex
import sys
import collections
from zipfile import ZipFile
import numpy as np
from itertools import islice
from pystq.plots import BasicPlots, SamPlots
from pystq import SamReader, FastqReader, FastQ, Sam, Fasta, FastaReader
if __name... | [
1303,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
11748,
850,
14681,
198,
11748,
427,
2588,
198,
11748,
25064,
198,
11748,
17268,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
11748,
299,
32152,
355... | 3.088496 | 113 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
| [
198,
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
628
] | 2 | 25 |
"""
Author: Meng
Date: 2018/10/2
"""
import os
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
DRIVER_PATH = os.path.join(ROOT_PATH, 'driver')
LOGIN_URL = 'https://account.xiaomi.com/pass/serviceLogin?callback=https%3A%2F%2Forder.mi.com%2Flogin%2Fcallback%3Ffollowup%3Dhttps%253A%252F%252Fwww.mi.com%252Fseckill... | [
37811,
198,
13838,
25,
41272,
198,
10430,
25,
2864,
14,
940,
14,
17,
198,
37811,
198,
11748,
28686,
628,
198,
13252,
2394,
62,
34219,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
... | 1.621681 | 452 |
from pytube import YouTube
# Download path
SAVE_PATH = "Download/"
# url file
url_link = open('links_file.txt','r')
# iterate
for i in url_link:
try:
yt = YouTube(i)
except:
print("Connection Error")
# downloading video
try:
d_video.download(SAVE_PATH)
... | [
6738,
12972,
29302,
1330,
7444,
220,
198,
198,
2,
10472,
3108,
198,
4090,
6089,
62,
34219,
796,
366,
10002,
30487,
198,
198,
2,
19016,
2393,
198,
6371,
62,
8726,
796,
1280,
10786,
28751,
62,
7753,
13,
14116,
41707,
81,
11537,
198,
198... | 2.2 | 175 |
# Copyright (c) 2021 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel@uavcan.org>
from __future__ import annotations
import sys
import random
from typing import Optional, Union
from pathlib import Path
import logging
import pyuavcan
from ._node import... | [
2,
15069,
357,
66,
8,
33448,
471,
10116,
44565,
42727,
198,
2,
770,
3788,
318,
9387,
739,
262,
2846,
286,
262,
17168,
13789,
13,
198,
2,
6434,
25,
49612,
7385,
2013,
7204,
1279,
8957,
626,
31,
84,
615,
5171,
13,
2398,
29,
198,
198... | 2.920537 | 2,605 |
from django.contrib import admin
from django.urls import path, include
from . import views
urlpatterns = [
path('signup/', views.SignupView.as_view(), name='signup'),
path('login/', views.LoginView.as_view(), name='login'),
path('logout/', views.LogoutView.as_view(), name='logout')
] | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
12683,
929,
14,
3256,
5009,... | 2.828571 | 105 |
from abc import abstractmethod
| [
6738,
450,
66,
1330,
12531,
24396,
628
] | 4.571429 | 7 |
import subprocess
import pandas as pd
| [
11748,
850,
14681,
198,
11748,
19798,
292,
355,
279,
67,
628,
628,
628,
628
] | 3.214286 | 14 |
#El tradicional hola mundo
print('Hola Mundo!!!')
#operaciones aritmeticas
print(5 + 5)
print(10 - - 5)
print(2 * 4)
print(10 / 3)
print(7 % 2)
print(2 ** 5)
print(10 // 3)
#variables
x=10
mi_string = 'DAS'
un_string_de_multiples_lineas = '''
¡Hola!
estoy en varias
lineas '''
print(x)
print(mi_string)
print(un_string... | [
2,
9527,
2083,
291,
1538,
289,
5708,
27943,
78,
198,
4798,
10786,
39,
5708,
33324,
78,
10185,
11537,
198,
198,
2,
3575,
49443,
274,
610,
270,
15103,
292,
198,
4798,
7,
20,
1343,
642,
8,
198,
4798,
7,
940,
532,
532,
642,
8,
198,
... | 2.145161 | 248 |
# Logger names
TRAIN_LOGGER_NAME = 'train'
HYPEROPT_LOGGER_NAME = 'hyperparameter-optimization'
# Save file names
MODEL_FILE_NAME = 'model.pt'
TEST_SCORES_FILE_NAME = 'test_scores.csv'
| [
2,
5972,
1362,
3891,
198,
51,
3861,
1268,
62,
25294,
30373,
62,
20608,
796,
705,
27432,
6,
198,
42598,
18973,
3185,
51,
62,
25294,
30373,
62,
20608,
796,
705,
49229,
17143,
2357,
12,
40085,
1634,
6,
198,
198,
2,
12793,
2393,
3891,
1... | 2.447368 | 76 |
#
# * The source code in this file is developed independently by NEC Corporation.
#
# # NLCPy License #
#
# Copyright (c) 2020-2021 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... | [
2,
198,
2,
1635,
383,
2723,
2438,
287,
428,
2393,
318,
4166,
14799,
416,
41804,
10501,
13,
198,
2,
198,
2,
1303,
399,
5639,
20519,
13789,
1303,
198,
2,
198,
2,
220,
220,
220,
220,
15069,
357,
66,
8,
12131,
12,
1238,
2481,
41804,
... | 3.215986 | 588 |
import os ,random,struct,binascii,base64
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
from Crypto import Random
from Crypto.Cipher import AES
import hashlib
ob=transmit("passwordkey")
txt="hi this is a text sample for encrption"
#txt=txt.encode('UTF-8')
print(txt)
while(len(txt)%16!=0):
... | [
11748,
28686,
837,
25120,
11,
7249,
11,
8800,
292,
979,
72,
11,
8692,
2414,
198,
6738,
15709,
9078,
1330,
357,
3163,
24493,
32,
14415,
11,
23283,
13511,
8,
198,
6738,
640,
1330,
3993,
198,
6738,
36579,
1330,
14534,
198,
6738,
36579,
1... | 2.680272 | 147 |
import logging
from django.conf import settings
from smart_bookmarks.core.interfaces import (
CreatePageInterface,
PageData,
ScrapePageInterface,
)
from smart_bookmarks.core.models import Bookmark
from smart_bookmarks.core.registry import get_page_service, inject
from smart_bookmarks.scrapers.models impor... | [
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
4451,
62,
2070,
14306,
13,
7295,
13,
3849,
32186,
1330,
357,
198,
220,
220,
220,
13610,
9876,
39317,
11,
198,
220,
220,
220,
7873,
6601,
11,
198,
220,
... | 3.296552 | 145 |
from typing import Dict, Optional
import hvac
from vaultup.manifests import ManifestItem
AUTH_TYPES = {
"ldap": LdapAuthConfigManifest
}
class AuthMethodManifest(ManifestItem):
"""
Manifest entry for an auth method.
"""
| [
6738,
19720,
1330,
360,
713,
11,
32233,
198,
198,
11748,
289,
85,
330,
198,
198,
6738,
22563,
929,
13,
805,
361,
3558,
1330,
36757,
7449,
628,
198,
198,
32,
24318,
62,
9936,
47,
1546,
796,
1391,
198,
220,
220,
220,
366,
335,
499,
... | 2.793103 | 87 |
"""Pytests."""
from datacatalogtordf.uri import URI
from modelldcatnotordf.modelldcatno import (
Attribute,
Choice,
CodeElement,
CodeList,
ModelElement,
ObjectType,
Role,
SimpleType,
Specialization,
)
import pytest
from pytest_mock import MockerFixture
from rdflib.graph import Graph
... | [
37811,
20519,
41989,
526,
15931,
198,
6738,
4818,
330,
10254,
519,
83,
585,
69,
13,
9900,
1330,
43975,
198,
6738,
953,
695,
67,
9246,
1662,
585,
69,
13,
4666,
695,
67,
9246,
3919,
1330,
357,
198,
220,
220,
220,
3460,
4163,
11,
198,
... | 2.654075 | 12,098 |
"""
tests lvmspec.sky
"""
import unittest
import pdb
import numpy as np
import os
from lvmspec.frame import Frame
#from lvmspec.qa import QA_Frame, QA_Exposure, QA_Brick, QA_Prod
from lvmspec.qa.qa_frame import QA_Frame
from lvmspec.qa.qa_exposure import QA_Exposure
from lvmspec.qa.qa_brick import QA_Brick
from lvmsp... | [
37811,
198,
41989,
300,
85,
907,
43106,
13,
15688,
198,
37811,
198,
198,
11748,
555,
715,
395,
198,
11748,
279,
9945,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
300,
85,
907,
43106,
13,
14535,
1330,
25184,
... | 2.602597 | 385 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019-2021 Ramon van der Winkel.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.db import models
from django.utils import timezone
from BasisTypen.models import BoogType, TeamType, IndivWedstrijdklasse, TeamWedstrijdklass... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
220,
15069,
357,
66,
8,
13130,
12,
1238,
2481,
7431,
261,
5719,
4587,
7178,
7750,
13,
198,
2,
220,
1439,
2489,
10395,
13,
198,
2,
220,
49962,
739,
347,
10305... | 2.078793 | 14,113 |
################################################################################
# Imports
from django.conf import settings
from django.test import TestCase
from ..helperFuncsForTesting import getInfoPut, setUpHelper
from .views import ERROR, FAIL, STATUS, SUCCESS, TENANT_ALREADY_IN_PROP
############################... | [
29113,
29113,
14468,
198,
2,
1846,
3742,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
11485,
2978,
525,
24629,
6359,
1890,
44154,
1330,
651,
12360,
11588,
11,
900,
... | 2.581429 | 700 |
from cwl_utils import parser_v1_0
from re import sub
from cwlab.xls2cwl_job.read_xls import clean_string
configs = {}
cwl_document = parser_v1_0.load_document("test_files/workflows/wf_fastqc.cwl")
if isinstance(cwl_document, list):
cwl_documents = cwl_document
for cwl_document_ in cwl_documents:
if cl... | [
6738,
269,
40989,
62,
26791,
1330,
30751,
62,
85,
16,
62,
15,
198,
6738,
302,
1330,
850,
198,
6738,
269,
86,
23912,
13,
87,
7278,
17,
66,
40989,
62,
21858,
13,
961,
62,
87,
7278,
1330,
3424,
62,
8841,
198,
198,
11250,
82,
796,
2... | 2.07373 | 2,048 |
import unittest
from thunctor import Thunk, unroll
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
294,
403,
2715,
1330,
536,
2954,
11,
555,
2487,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
628
] | 2.615385 | 39 |
from .cluster_config import BaseClusterConfig
from .nodes_config import BaseTerraformConfig
from .base_infra_env_config import BaseInfraEnvConfig
from .base_entity_config import BaseEntityConfig
__all__ = [
"BaseClusterConfig",
"BaseTerraformConfig",
"BaseInfraEnvConfig",
"BaseEntityConfig"
]
| [
6738,
764,
565,
5819,
62,
11250,
1330,
7308,
2601,
5819,
16934,
198,
6738,
764,
77,
4147,
62,
11250,
1330,
7308,
15156,
430,
687,
16934,
198,
6738,
764,
8692,
62,
10745,
430,
62,
24330,
62,
11250,
1330,
7308,
18943,
430,
4834,
85,
169... | 2.943396 | 106 |
import FWCore.ParameterSet.Config as cms
from Configuration.Geometry.GeometryDD4hepExtended2021_cff import *
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
28373,
13,
10082,
15748,
13,
10082,
15748,
16458,
19,
258,
79,
11627,
1631,
1238,
2481,
62,
66,
487,
1330,
1635,
198
] | 3.142857 | 35 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import SiLABinaryTransfer_pb2 as SiLABinaryTransfer__pb2
| [
2,
2980,
515,
416,
262,
308,
49,
5662,
11361,
8435,
17050,
13877,
13,
8410,
5626,
48483,
0,
198,
11748,
1036,
14751,
198,
198,
6738,
764,
1330,
15638,
48780,
3219,
43260,
62,
40842,
17,
355,
15638,
48780,
3219,
43260,
834,
40842,
17,
... | 3.4 | 45 |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 20 13:32:20 2021
#--- Generate qsub files based on cluster column at dashboard_db_future.csv
#--- Murilo Vianna (murilodsv@gmail.com)
#--- Apr, 2021.
#--- Dev-log in: https://github.com/Murilodsv/py-jules
@author: muril
"""
# DEBUG import os; os.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2758,
1160,
1511,
25,
2624,
25,
1238,
33448,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
6329,
2980,
378,
10662,
7266,
3696,
1912,
... | 2.162594 | 1,064 |
# Copyright (c) 2021 Alethea Katherine Flowers.
# Published under the standard MIT License.
# Full text available at: https://opensource.org/licenses/MIT
"""Helpers for interactive console programs using the keyboard or gamepad."""
import time
from wintertools import keyboard
from wintertools.gamepad import gamepad
... | [
2,
15069,
357,
66,
8,
33448,
9300,
1169,
64,
32719,
30036,
13,
198,
2,
26372,
739,
262,
3210,
17168,
13789,
13,
198,
2,
6462,
2420,
1695,
379,
25,
3740,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
36393,
198,
198,
37811,
12621,
... | 4.114943 | 87 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Generated by Django 2.2.12 on 2020-04-13 16:38
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1065,
319,
12131,
12,
3023,
12,
1485,
1467,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
"""Tests for the fixes of UKESM1-0-LL."""
import iris
import pytest
from esmvalcore.cmor._fixes.cmip6.ukesm1_0_ll import AllVars, Cl, Cli, Clw
from esmvalcore.cmor._fixes.common import ClFixHybridHeightCoord
from esmvalcore.cmor.fix import Fix
@pytest.fixture
def sample_cubes():
"""Sample cubes."""
ta_cube =... | [
37811,
51,
3558,
329,
262,
13040,
286,
3482,
1546,
44,
16,
12,
15,
12,
3069,
526,
15931,
198,
11748,
4173,
271,
198,
11748,
12972,
9288,
198,
198,
6738,
1658,
76,
2100,
7295,
13,
66,
4491,
13557,
42624,
13,
11215,
541,
21,
13,
31469... | 2.402186 | 915 |
import random
import multiprocessing
from utils import log
from wordle import (
Game,
load_words,
load_answers,
get_optimal_entropies,
sort_by_entropy,
INITIAL_GUESSES,
MAX_GUESSES,
NUM_PROCESSES,
)
from typing import Optional
DEFAULT_NUM_GAMES = 2
| [
11748,
4738,
198,
11748,
18540,
305,
919,
278,
198,
6738,
3384,
4487,
1330,
2604,
198,
6738,
1573,
293,
1330,
357,
198,
220,
220,
220,
3776,
11,
198,
220,
220,
220,
3440,
62,
10879,
11,
198,
220,
220,
220,
3440,
62,
504,
86,
364,
... | 2.352459 | 122 |
import re
import time
import urllib.parse
from base64 import standard_b64encode
import cloudscraper
import requests
from bs4 import BeautifulSoup
from bot import Config
# wetransfer
WETRANSFER_API_URL = "https://wetransfer.com/api/v4/transfers"
WETRANSFER_DOWNLOAD_URL = WETRANSFER_API_URL + "/{transfer_id}/download"... | [
11748,
302,
198,
11748,
640,
198,
11748,
2956,
297,
571,
13,
29572,
198,
6738,
2779,
2414,
1330,
3210,
62,
65,
2414,
268,
8189,
198,
198,
11748,
6279,
1416,
38545,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,... | 2.510798 | 1,065 |
import time
lentree = 0
isa = 0
| [
11748,
640,
628,
198,
75,
298,
631,
796,
657,
198,
9160,
796,
657,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628
] | 2.304348 | 23 |
from datetime import datetime, date
from decimal import Decimal
import pytest # type: ignore
from requests.exceptions import ConnectionError
from investments.currency import Currency
from investments.data_providers.cbr import ExchangeRatesRUB
from investments.money import Money
test_cases = [
(datetime(2015, 1,... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
198,
6738,
32465,
1330,
4280,
4402,
198,
198,
11748,
12972,
9288,
220,
1303,
2099,
25,
8856,
198,
6738,
7007,
13,
1069,
11755,
1330,
26923,
12331,
198,
198,
6738,
11115,
13,
34415,
1330,
201... | 2.740831 | 409 |
from flask import Flask, request, jsonify
from bs4 import BeautifulSoup
import requests
app = Flask(__name__)
@app.route('/news', methods=['POST'])
# 메인 함수
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True, threaded=True) | [
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
628,
198,
198,
31,
1324,
13,
38629,
10786,
14,
10827,
3256,
505... | 2.466019 | 103 |
"""
Script to obtain fractional abundances from Aurora's reading of ADAS data.
Note that this is a calculation from atomic physics only, i.e. no transport is applied.
It is recommended to run this in IPython.
"""
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
import sys
import os
import time
from scipy.... | [
37811,
198,
7391,
284,
7330,
13390,
282,
12467,
1817,
422,
22218,
338,
3555,
286,
5984,
1921,
1366,
13,
198,
6425,
326,
428,
318,
257,
17952,
422,
17226,
11887,
691,
11,
1312,
13,
68,
13,
645,
4839,
318,
5625,
13,
198,
198,
1026,
31... | 2.458 | 1,000 |