content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
from pytz import common_timezones
from django.conf import settings
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AdminPasswordChangeForm
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib... | [
11748,
28686,
198,
6738,
12972,
22877,
1330,
2219,
62,
2435,
89,
1952,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18... | 2.249907 | 2,689 |
"""
Data-driven tests for g2p.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import rdflib
import ga4gh.datamodel.genotype_phenotype as genotype_phenotype
import ga4gh.datamodel.datasets as datasets
import ga4gh.protocol as protocol
import ... | [
37811,
198,
6601,
12,
15808,
5254,
329,
308,
17,
79,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 3.122951 | 122 |
add_library('video')
| [
2860,
62,
32016,
10786,
15588,
11537,
628
] | 3.142857 | 7 |
# Added recovery lap data - counter-steering angle 1.0
#import os
import csv
#import cv2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from keras.models import Sequential
fro... | [
2,
10687,
7628,
14779,
1366,
532,
3753,
12,
4169,
1586,
9848,
352,
13,
15,
198,
198,
2,
11748,
28686,
198,
11748,
269,
21370,
198,
2,
11748,
269,
85,
17,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,... | 2.520191 | 2,303 |
from typing import Callable
| [
6738,
19720,
1330,
4889,
540,
628
] | 4.833333 | 6 |
from django.shortcuts import render,redirect
from django.http import HttpResponse
from model.community import *
from model.oss import *
from view.common import *
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from django.db.models import Sum, Count
from operator import itemgetter
from django.htt... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
445,
1060,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
2746,
13,
28158,
1330,
1635,
198,
6738,
2746,
13,
793,
1330,
1635,
198,
6738,
1570,
13,
11321,
1330,... | 3.420455 | 176 |
#Copyright [2017] [Mauro Riva <lemariva@mail.com> <lemariva.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 ... | [
2,
15269,
685,
5539,
60,
685,
44,
559,
305,
371,
12151,
1279,
293,
3876,
12151,
31,
4529,
13,
785,
29,
1279,
293,
3876,
12151,
13,
785,
37981,
198,
198,
2,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
3... | 3.632287 | 223 |
'''
Author: your name
Date: 2021-05-17 03:11:15
LastEditTime: 2021-05-18 14:46:09
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: /twitterSententAnalyse 2/data_helper.py
'''
#coding:utf-8
from ext_en import *
import sys
stops = loadStops()
X, y = getTxt()
X_feather = []... | [
7061,
6,
201,
198,
13838,
25,
534,
1438,
201,
198,
10430,
25,
33448,
12,
2713,
12,
1558,
7643,
25,
1157,
25,
1314,
201,
198,
5956,
18378,
7575,
25,
33448,
12,
2713,
12,
1507,
1478,
25,
3510,
25,
2931,
201,
198,
5956,
18378,
669,
2... | 2.285246 | 305 |
import codecs
import os
import re
import typing as tp
from satella.exceptions import ConfigurationValidationError
from .base import Descriptor, ConfigDictValue
from .registry import register_custom_descriptor
@staticmethod
@register_custom_descriptor('bool')
class Boolean(Descriptor):
"""
This value must b... | [
11748,
40481,
82,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
19720,
355,
256,
79,
198,
198,
6738,
8983,
64,
13,
1069,
11755,
1330,
28373,
7762,
24765,
12331,
198,
6738,
764,
8692,
1330,
2935,
6519,
273,
11,
17056,
35,
713,
11395,
... | 2.627644 | 1,324 |
# Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
2,
15069,
2864,
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,
921,
743,
7330... | 3.74812 | 266 |
import sys
import os
REMOVE_THESE = ["-I/usr/include", "-I/usr/include/", "-L/usr/lib", "-L/usr/lib/"]
if __name__ == "__main__":
pkg_names = []
pkg_dict = {}
commands = []
exist_check = False
for i in range(1,len(sys.argv)):
if sys.argv[i][0] == '-':
cmd = sys.argv[i]
commands.append(cmd)
if cmd=='... | [
11748,
25064,
198,
11748,
28686,
198,
198,
2200,
11770,
6089,
62,
4221,
33635,
796,
14631,
12,
40,
14,
14629,
14,
17256,
1600,
27444,
40,
14,
14629,
14,
17256,
14,
1600,
27444,
43,
14,
14629,
14,
8019,
1600,
27444,
43,
14,
14629,
14,
... | 2.157316 | 909 |
# Generated by Django 2.0.6 on 2018-06-20 10:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields
import uuid
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
21,
319,
2864,
12,
3312,
12,
1238,
838,
25,
1731,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
1420... | 3.112903 | 62 |
import subprocess
import sys
import platform
import os
finder = {"Linux": "which",
"Darwin": "which",
"Windows": "where"}
| [
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
3859,
198,
11748,
28686,
198,
198,
22805,
796,
19779,
19314,
1298,
366,
4758,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
32708,
5404,
1298,
366,
4758,
1600,
198,
220,
... | 2.571429 | 56 |
# MEDIUM
# cur records the count of "aeiou"
# cur & 1 = the records of a % 2
# cur & 2 = the records of e % 2
# cur & 4 = the records of i % 2
# cur & 8 = the records of o % 2
# cur & 16 = the records of u % 2
# seen note the index of first occurrence of cur
# a e ... | [
198,
2,
26112,
41796,
198,
2,
1090,
4406,
262,
954,
286,
366,
3609,
72,
280,
1,
198,
2,
1090,
1222,
352,
796,
262,
4406,
286,
257,
4064,
362,
198,
2,
1090,
1222,
362,
796,
262,
4406,
286,
304,
4064,
362,
198,
2,
1090,
1222,
604,... | 1.661891 | 349 |
from komandos import *
import heapq as H
if __name__ == '__main__':
mem = set()
initState = getInitialState()
randPath = []
path = []
# for i in range(140):
# move = random.choice(getMoves())
# initState = apllyMove(initState, move)
# randPath.append(move)
path = aStar... | [
6738,
479,
296,
392,
418,
1330,
1635,
198,
11748,
24575,
80,
355,
367,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1066,
796,
900,
3419,
198,
220,
220,
220,
2315,
9012,
796,
651,
2424... | 2.333333 | 159 |
# import time
# import random
# seed = 1
# list1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
# temp = random.randint(0, 25)
# count = 0
# for i in range(0,100):
# if i % 9 == 0 and i <= 81:
# print(str(i) + ':' + list... | [
2,
1330,
640,
198,
2,
1330,
4738,
198,
2,
9403,
796,
352,
198,
2,
1351,
16,
796,
37250,
32,
3256,
705,
33,
3256,
705,
34,
3256,
705,
35,
3256,
705,
36,
3256,
705,
37,
3256,
705,
38,
3256,
705,
39,
3256,
705,
40,
3256,
705,
41,... | 1.514763 | 1,795 |
import os
import time
import toml
import telegram_bot_api as api
SKRIPTPFAD = os.path.abspath(os.path.dirname(__file__))
CONFIG = config_laden()
USER = CONFIG["telegram"]["user"]
BOT = api.Bot(CONFIG["telegram"]["token"])
ANTWORTEN = ["Komme gleich", "1 Min", "5 Min"]
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
640,
198,
198,
11748,
284,
4029,
198,
198,
11748,
573,
30536,
62,
13645,
62,
15042,
355,
40391,
628,
198,
198,
18831,
32618,
7250,
37,
2885,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
1... | 2.424242 | 132 |
import base64
import logging
import json
from calendar import monthrange
import datetime
from httplib2 import Http
from json import dumps
def handle_notification(event, context):
"""Triggered from a message on a Cloud Pub/Sub topic.
Args:
event (dict): Event payload.
context (google.cloud.fun... | [
11748,
2779,
2414,
198,
11748,
18931,
198,
11748,
33918,
198,
6738,
11845,
1330,
1227,
9521,
198,
11748,
4818,
8079,
198,
6738,
1841,
489,
571,
17,
1330,
367,
29281,
198,
6738,
33918,
1330,
45514,
198,
198,
4299,
5412,
62,
1662,
2649,
7... | 2.833333 | 702 |
from attendanceTaker import Student, classDatabase
import tkinter as tk
if __name__ == "__main__":
main()
| [
6738,
14858,
51,
3110,
1330,
13613,
11,
1398,
38105,
198,
11748,
256,
74,
3849,
355,
256,
74,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
12417,
3419,
198
] | 3.205882 | 34 |
"""Top-level package for TopoJoin."""
__author__ = "DSR"
__email__ = "info@simmonsritchie.com"
__version__ = "__version__ = '0.3.1'"
| [
37811,
9126,
12,
5715,
5301,
329,
5849,
78,
18234,
526,
15931,
198,
198,
834,
9800,
834,
796,
366,
5258,
49,
1,
198,
834,
12888,
834,
796,
366,
10951,
31,
82,
8608,
684,
799,
3043,
13,
785,
1,
198,
834,
9641,
834,
796,
366,
834,
... | 2.436364 | 55 |
#!python3
"""
Predict protein pKa based on MCCE method.
http://pka.engr.ccny.cuny.edu/
Require MCCE 3.0 to work: https://anaconda.org/SalahSalah/mcce/files
"""
import asyncio
import glob
import gzip
import locale
import logging
import math
import os
import re
import shutil
import subprocess
import sys... | [
2,
0,
29412,
18,
201,
198,
37811,
201,
198,
47,
17407,
7532,
279,
37281,
1912,
319,
337,
4093,
36,
2446,
13,
201,
198,
4023,
1378,
79,
4914,
13,
1516,
81,
13,
535,
3281,
13,
66,
403,
88,
13,
15532,
14,
201,
198,
201,
198,
16844,... | 2.152466 | 892 |
# -*- coding: utf-8 -*-
"""
meraki
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
import meraki.models.custom_pie_chart_item_model
class UpdateNetworkTrafficAnalysisSettingsModel(object):
"""Implementation of the 'updateNetworkTrafficAnalysisS... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
37811,
201,
198,
220,
220,
220,
4017,
8182,
201,
198,
201,
198,
220,
220,
220,
770,
2393,
373,
6338,
7560,
329,
4017,
8182,
416,
3486,
3955,
1404,
2149,... | 2.423307 | 1,004 |
from sample_players import DataPlayer
import random
class CustomPlayer(DataPlayer):
""" Implement your own agent to play knight's Isolation
The get_action() method is the only *required* method. You can modify
the interface for get_action by adding named parameters with default
values, but the functi... | [
198,
6738,
6291,
62,
32399,
1330,
6060,
14140,
198,
11748,
4738,
198,
198,
4871,
8562,
14140,
7,
6601,
14140,
2599,
198,
220,
220,
220,
37227,
48282,
534,
898,
5797,
284,
711,
22062,
338,
1148,
21417,
628,
220,
220,
220,
383,
651,
62,... | 3.247944 | 851 |
from .base_metric import BaseMetric
from .accuracy import Accuracy
from .exact_matches import ExactMatches
from .pr_rec_f1 import PrRecF1
from .rouge_multi import RougeMulti
from .multi_ref_rouge import MultiRefRouge
from .soft_pr_rec_f1 import SoftPrRecF1
| [
6738,
764,
8692,
62,
4164,
1173,
1330,
7308,
9171,
1173,
198,
6738,
764,
4134,
23843,
1330,
33222,
198,
6738,
764,
1069,
529,
62,
6759,
2052,
1330,
1475,
529,
19044,
2052,
198,
6738,
764,
1050,
62,
8344,
62,
69,
16,
1330,
1736,
6690,
... | 2.954023 | 87 |
# Return the size of the largest sub-tree which is also a BST
import sys
sys.setrecursionlimit(1000000)
from collections import deque
# Tree Node
# Function to Build Tree
if __name__ == "__main__":
t = int(input())
for _ in range(0, t):
s = input()
root = buildTree(s)
prin... | [
628,
198,
2,
8229,
262,
2546,
286,
262,
4387,
850,
12,
21048,
543,
318,
635,
257,
44992,
628,
628,
198,
11748,
25064,
198,
17597,
13,
2617,
8344,
24197,
32374,
7,
16,
10535,
8,
198,
198,
6738,
17268,
1330,
390,
4188,
198,
198,
2,
... | 2.575758 | 132 |
import abc
from collections import OrderedDict
import time
import gtimer as gt
import numpy as np
from rlkit.core import logger, eval_util
from rlkit.data_management.env_replay_buffer import MultiTaskReplayBuffer,EnvReplayBuffer
from rlkit.data_management.path_builder import PathBuilder
from rlkit.samplers.in_place i... | [
11748,
450,
66,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
640,
198,
198,
11748,
308,
45016,
355,
308,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
374,
75,
15813,
13,
7295,
1330,
49706,
11,
5418,
62,
22602,
... | 3.065116 | 215 |
import os
import time
import csh_ldap as ldap
import login
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
640,
198,
11748,
269,
1477,
62,
335,
499,
355,
300,
67,
499,
198,
11748,
17594,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.575 | 40 |
"""
PostGIS to GDAL conversion constant definitions
"""
# Lookup to convert pixel type values from GDAL to PostGIS
GDAL_TO_POSTGIS = [None, 4, 6, 5, 8, 7, 10, 11, None, None, None, None]
# Lookup to convert pixel type values from PostGIS to GDAL
POSTGIS_TO_GDAL = [1, 1, 1, 3, 1, 3, 2, 5, 4, None, 6, 7, None, None]
# ... | [
37811,
198,
6307,
38,
1797,
284,
27044,
1847,
11315,
6937,
17336,
198,
37811,
198,
2,
6803,
929,
284,
10385,
17465,
2099,
3815,
422,
27044,
1847,
284,
2947,
38,
1797,
198,
45113,
1847,
62,
10468,
62,
32782,
38,
1797,
796,
685,
14202,
... | 2.671074 | 605 |
# coding: utf8
"""
题目链接: https://leetcode.com/problems/search-in-rotated-sorted-array-ii/description.
题目描述:
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Suppose an array sorted in ascending order is r... | [
2,
19617,
25,
3384,
69,
23,
628,
198,
37811,
198,
220,
220,
220,
16268,
95,
246,
33566,
106,
165,
241,
122,
162,
236,
98,
25,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
12947,
12,
259,
12,
10599,
515,
12,
82,
9741... | 2.816754 | 191 |
from rest_framework import serializers
from items.models import Item
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
3709,
13,
27530,
1330,
9097,
198
] | 4.6 | 15 |
"""
Unit tests for the Drycc api app.
Run the tests with "./manage.py test api"
"""
from unittest import mock
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.conf import settings
from rest_framework.authtoken.models import Token
from api.models import Domain
from api.te... | [
37811,
198,
26453,
5254,
329,
262,
22408,
535,
40391,
598,
13,
198,
198,
10987,
262,
5254,
351,
366,
19571,
805,
496,
13,
9078,
1332,
40391,
1,
198,
37811,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
42625,
14208,
13,
3642,... | 2.271245 | 2,330 |
import sys
input = sys.stdin.readline
w,h = list(map(int,input().split(" ")))
if h%2 ==0 or w%2==0:
print("0")
elif h>=w:
print(w)
else:
print(h) | [
11748,
25064,
198,
198,
15414,
796,
25064,
13,
19282,
259,
13,
961,
1370,
198,
86,
11,
71,
796,
1351,
7,
8899,
7,
600,
11,
15414,
22446,
35312,
7203,
366,
22305,
198,
198,
361,
289,
4,
17,
6624,
15,
393,
266,
4,
17,
855,
15,
25,... | 1.9875 | 80 |
"""Module for searching the database based on user-supplied queries, and
display the result to the user.
"""
from todone import backend
from todone import printers
from todone.parser import factory
def list_items(args):
"""
Print a list of todos matching given search terms.
usage: todone list [.file] [fo... | [
37811,
26796,
329,
10342,
262,
6831,
1912,
319,
2836,
12,
18608,
18511,
20743,
11,
290,
198,
13812,
262,
1255,
284,
262,
2836,
13,
198,
37811,
198,
6738,
284,
28060,
1330,
30203,
198,
6738,
284,
28060,
1330,
34654,
198,
6738,
284,
28060... | 2.869976 | 846 |
import pytest
from csp_tool.csp_analyser import get_domains_per_directive, rollup_data_by_header, \
check_unsafe_inline_used_without_domains, extract_policies_without_domains, \
check_keyword_used_without_domains, extract_policies_using_localhost
@pytest.mark.parametrize(
"header,expected_num_rows,bigges... | [
11748,
12972,
9288,
198,
6738,
269,
2777,
62,
25981,
13,
66,
2777,
62,
272,
26266,
263,
1330,
651,
62,
3438,
1299,
62,
525,
62,
12942,
425,
11,
4836,
929,
62,
7890,
62,
1525,
62,
25677,
11,
3467,
198,
220,
220,
220,
2198,
62,
1327... | 2.240506 | 237 |
'''
This module contains the Neuronaletwork class and its methods.
Created on 29.09.2019
@author: D.Ramonat
'''
import numpy as np | [
7061,
6,
198,
1212,
8265,
4909,
262,
3169,
333,
20996,
316,
1818,
1398,
290,
663,
5050,
13,
198,
198,
41972,
319,
2808,
13,
2931,
13,
23344,
198,
198,
31,
9800,
25,
360,
13,
49,
16487,
265,
198,
7061,
6,
198,
11748,
299,
32152,
35... | 2.933333 | 45 |
import logging
import pytest
from piqe_ocp_lib import __loggername__
from piqe_ocp_lib.api.monitoring.ocp_cluster_stats_prometheus import OcpClusterStatsPrometheus
logger = logging.getLogger(__loggername__)
@pytest.fixture(scope="session")
| [
11748,
18931,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
279,
25011,
68,
62,
420,
79,
62,
8019,
1330,
11593,
6404,
70,
13292,
834,
198,
6738,
279,
25011,
68,
62,
420,
79,
62,
8019,
13,
15042,
13,
41143,
278,
13,
420,
79,
62,
56... | 2.764045 | 89 |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from .base_model_ import Model
from .. import util
class AuditLogEntry(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
D... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
220,
1303,
645,
20402,
25,
376,
21844,
198,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
220... | 2.43634 | 1,563 |
import rospy
from rospy import ServiceProxy
from std_srvs.srv import (Empty, EmptyRequest, EmptyResponse)
from ExperimentOrchestrator.Architecture.Singleton import Singleton | [
11748,
686,
2777,
88,
198,
6738,
686,
2777,
88,
1330,
4809,
44148,
198,
6738,
14367,
62,
27891,
14259,
13,
27891,
85,
1330,
357,
40613,
11,
33523,
18453,
11,
33523,
31077,
8,
198,
198,
6738,
29544,
5574,
2395,
2536,
1352,
13,
19895,
5... | 3.55102 | 49 |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
import numpy as np
import matplotlib.pyplot as plt
# %%
file_list=[]
for i in range(50):
file_list.append('Ps-Pb{}.csv'.format(i))
rdata=np.ndarray((50,50,50))
rd_mean=np.ndarray((50,50))
for i in range(50):
file=np.loa... | [
2,
1675,
751,
257,
649,
2685,
11,
2099,
705,
2,
43313,
6,
198,
2,
1675,
751,
257,
649,
1317,
2902,
2685,
11,
2099,
705,
2,
43313,
685,
4102,
2902,
49946,
198,
2,
43313,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
... | 2.121166 | 652 |
# Copyright (c) 2013 Rackspace, Inc.
# Copyright (c) 2015 Catalyst IT 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 require... | [
2,
15069,
357,
66,
8,
2211,
37927,
13200,
11,
3457,
13,
198,
2,
15069,
357,
66,
8,
1853,
48238,
7283,
12052,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
7... | 2.481299 | 1,417 |
def solve_tilt(B, t):
'''
Input: B | Starting board configuration
t | Tuple t = (x, y) representing the target square
Output: M | List of moves that solves B (or None if B not solvable)
'''
M = []
##################
# YOUR CODE HERE #
##################
return M
#######... | [
4299,
8494,
62,
83,
2326,
7,
33,
11,
256,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
23412,
25,
220,
347,
930,
17962,
3096,
8398,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
930,
309,
29291,
25... | 1.688366 | 1,444 |
ad_list = {}
for line in open('input.txt', 'r').readlines():
rules = line.strip().replace('.', '').replace('contain', '').replace(',', ' ').split(' ')
master_key = None
for i in range(len(rules)):
if i == 0:
split_rule = rules[i].split(' ')
key = split_rule[0] + split_rule[1]
if key not in ad_list:
... | [
324,
62,
4868,
796,
23884,
198,
198,
1640,
1627,
287,
1280,
10786,
15414,
13,
14116,
3256,
705,
81,
27691,
961,
6615,
33529,
198,
197,
38785,
796,
1627,
13,
36311,
22446,
33491,
10786,
2637,
11,
10148,
737,
33491,
10786,
3642,
391,
3256... | 2.327935 | 247 |
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago
with DAG(
dag_id="airflow_variables_atruntime",
schedule_interval=None,
catchup=False,
start_date=days_ago(1)) as dag:
get_var_filename = BashOperator(
task_id="get_var... | [
6738,
45771,
1330,
360,
4760,
198,
6738,
45771,
13,
3575,
2024,
13,
41757,
62,
46616,
1330,
15743,
18843,
1352,
198,
6738,
45771,
13,
26791,
13,
19581,
1330,
1528,
62,
3839,
198,
198,
4480,
360,
4760,
7,
198,
220,
220,
220,
48924,
62,... | 2.639896 | 386 |
import re
import datetime
import logging
import pathlib
import datetime
import jinja2
import importlib.resources as pkg_resources
from collections import Counter
from . import templates, format_logger
from .program import sasProgram
class sasProject(object):
"""
Abstracted SAS project c... | [
11748,
302,
201,
198,
11748,
4818,
8079,
220,
201,
198,
11748,
18931,
201,
198,
11748,
3108,
8019,
201,
198,
11748,
4818,
8079,
201,
198,
11748,
474,
259,
6592,
17,
201,
198,
201,
198,
11748,
1330,
8019,
13,
37540,
355,
279,
10025,
62... | 2.330073 | 3,169 |
# ## PART 2 - read the power plant database, select different type power plant, and reference plant emission for both ccs and baseline
import pandas as pd
import sys
import json
# import time
from screen_ccs import ccs_screen
from emission_ccs import emission_aggregation_ccs
from post_process_ccs import bau_ccs_post,... | [
2,
22492,
16652,
362,
532,
1100,
262,
1176,
4618,
6831,
11,
2922,
1180,
2099,
1176,
4618,
11,
290,
4941,
4618,
25592,
329,
1111,
269,
6359,
290,
14805,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
25064,
198,
11748,
33918,
1... | 2.483712 | 7,306 |
from pygame import *
from GameSprite import GameSprite
#класс-наследник для спрайта-игрока (управляется стрелками)
| [
6738,
12972,
6057,
1330,
1635,
201,
198,
6738,
3776,
38454,
578,
1330,
3776,
38454,
578,
201,
198,
2,
31583,
30143,
16142,
21727,
21727,
12,
22177,
16142,
21727,
30143,
16843,
43666,
22177,
18849,
31583,
12466,
112,
30143,
40623,
220,
21727... | 1.45679 | 81 |
import pytest
from mock import patch
from time import sleep
from schedule import run_pending
@pytest.mark.parametrize("no_city_label_yet", [True, False])
@pytest.mark.parametrize(
"exec_sql_result, expected_post_called, expected_fct_result", [("Berlin", True, True), (None, False, False)]
)
| [
11748,
12972,
9288,
198,
6738,
15290,
1330,
8529,
198,
6738,
640,
1330,
3993,
198,
6738,
7269,
1330,
1057,
62,
79,
1571,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
3919,
62,
19205,
62,
18242,
62,
25907,
... | 2.866667 | 105 |
import inspect
from datetime import datetime
from ipaddress import IPv4Address
import pytest
from CybORG import CybORG
from CybORG.Shared.Actions import MSFAutoroute
from CybORG.Shared.Actions import SSHLoginExploit
from CybORG.Shared.Enums import SessionType, ProcessState, ProcessType, AppProtocol, Architecture, \
... | [
11748,
10104,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
20966,
21975,
1330,
25961,
19,
20231,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
5934,
65,
1581,
38,
1330,
5934,
65,
1581,
38,
198,
6738,
5934,
65,
1581,
38,
13,
248... | 3.34058 | 138 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 30 22:57:06 2020
@author: philipp
"""
# =============================================================================
# Data Prep
# =============================================================================
#with open('data/start.txt', 'r') as ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
7653,
1542,
2534,
25,
3553,
25,
3312,
12131,
198,
198,
31,
9800,
25,
872,
8908,
19... | 2.232499 | 6,671 |
__author__ = "R Devon Hjelm, Bogdan Mazoure, Florian Golemo"
__copyright__ = "Copyright (c) Microsoft Corporation and Mila - Quebec AI " \
"Institute"
__license__ = "MIT"
from flax.training.train_state import TrainState
from flax.training import checkpoints
import jax.numpy as jnp
import jax
import opt... | [
834,
9800,
834,
796,
366,
49,
36889,
367,
73,
417,
76,
11,
21555,
25604,
21625,
280,
260,
11,
4432,
666,
1514,
293,
5908,
1,
198,
834,
22163,
4766,
834,
796,
366,
15269,
357,
66,
8,
5413,
10501,
290,
4460,
64,
532,
14778,
9552,
36... | 2.151057 | 662 |
import json
import time
import pdb
import re
import traceback
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
fr... | [
11748,
33918,
198,
11748,
640,
198,
11748,
279,
9945,
198,
11748,
302,
198,
11748,
12854,
1891,
198,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
2673,
62,
38861,
133... | 2.531044 | 757 |
"""
Monitor Global.health Kubernetes pods to see if any
are stuck in Pending status for a while. If such pods are
present, notify on Slack.
IMPORTANT:
The kubernetes Python package needs to be kept in sync
with the EKS Kubernetes version. The compatibility matrix
for the client Python library is at
https://git... | [
37811,
198,
35479,
8060,
13,
13948,
12554,
527,
3262,
274,
37185,
284,
766,
611,
597,
198,
533,
7819,
287,
350,
1571,
3722,
329,
257,
981,
13,
1002,
884,
37185,
389,
198,
25579,
11,
19361,
319,
36256,
13,
198,
198,
3955,
15490,
8643,
... | 2.732651 | 879 |
# -*- coding:utf8 -*-
#
# Copyright (c) 2014 Xavier Lesa <xavierlesa@gmail.com>.
# All rights reserved.
# Distributed under the BSD license, see LICENSE
from setuptools import setup, find_packages
import sys, os
setup(name='djblog_wordpress_importer',
version='0.1',
description="Herramienta para migr... | [
2,
532,
9,
12,
19617,
25,
40477,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
30825,
11732,
64,
1279,
87,
19492,
829,
64,
31,
14816,
13,
785,
28401,
198,
2,
1849,
3237,
2489,
10395,
13,
198,
2,
4307,
6169,
739,
262... | 2.313725 | 357 |
import shlex
| [
11748,
427,
2588,
628,
628
] | 3.2 | 5 |
import re
import torch
import numpy as np
import scipy.sparse as sparse
from torch_geometric.data import Data as pyg_data
class Data(object):
r"""A plain old python object modeling a single graph with various
(optional) attributes:
Args:
x (Tensor, optional): Node feature matrix with shape :obj:... | [
11748,
302,
198,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
29877,
198,
6738,
28034,
62,
469,
16996,
13,
7890,
1330,
6060,
355,
12972,
70,
62,
7890,
628,
198,
4871,
6060,
7,
... | 2.385705 | 2,966 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Canux CHENG <canuxcheng@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including witho... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
22,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
1853,
1680,
2821,
5870,
26808,
1279,
5171,
2821,
2395,
782,
31,
14816,
13,
785,
2... | 2.833476 | 1,171 |
import random
Quit = False
while not Quit:
#Start up message to the user
print("Hello user, this program allows you to play a guessing game"\
" with the computer. The computer will select a number between 1 and"\
" your max number and you will have to guess which number the computer has"\
" select... | [
11748,
4738,
198,
198,
4507,
270,
796,
10352,
198,
198,
4514,
407,
48887,
25,
198,
220,
220,
220,
1303,
10434,
510,
3275,
284,
262,
2836,
198,
220,
220,
220,
3601,
7203,
15496,
2836,
11,
428,
1430,
3578,
345,
284,
711,
257,
25260,
9... | 2.882246 | 552 |
from .db import db
from .entity import *
from .relation import *
| [
6738,
764,
9945,
1330,
20613,
198,
6738,
764,
26858,
1330,
1635,
198,
6738,
764,
49501,
1330,
1635,
628
] | 3.666667 | 18 |
"""A package to differentiate between the "standard" `users`
module and the version with online registration
.. autosummary::
:toctree:
users
"""
| [
37811,
32,
5301,
284,
28754,
1022,
262,
366,
20307,
1,
4600,
18417,
63,
198,
21412,
290,
262,
2196,
351,
2691,
9352,
198,
198,
492,
44619,
388,
6874,
3712,
198,
220,
220,
1058,
1462,
310,
631,
25,
628,
220,
220,
220,
2985,
198,
198,... | 3.466667 | 45 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-06 14:29
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,
1157,
13,
20,
319,
2177,
12,
940,
12,
3312,
1478,
25,
1959,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
from open_alchemy import init_yaml
init_yaml("all-of-model-example-spec.yml")
| [
6738,
1280,
62,
282,
26599,
1330,
2315,
62,
88,
43695,
198,
198,
15003,
62,
88,
43695,
7203,
439,
12,
1659,
12,
19849,
12,
20688,
12,
16684,
13,
88,
4029,
4943,
198
] | 2.548387 | 31 |
from random import randint
import utils
objs = ["Rock", "Paper", "Scissor"]
computer = objs[randint(0, 2)]
playing = True
while playing:
player = input("Rock, Paper or Scissor ? ")
computer = objs[randint(0, 2)]
print(utils.getWinner(player, computer))
key = input(
"""
1. To... | [
6738,
4738,
1330,
43720,
600,
198,
11748,
3384,
4487,
198,
198,
672,
8457,
796,
14631,
19665,
1600,
366,
42950,
1600,
366,
3351,
747,
273,
8973,
198,
198,
33215,
796,
909,
8457,
58,
25192,
600,
7,
15,
11,
362,
15437,
198,
198,
17916,
... | 2.427083 | 192 |
from .Player import Player
import os
| [
6738,
764,
14140,
1330,
7853,
198,
11748,
28686,
628
] | 4.222222 | 9 |
from flask_wtf import FlaskForm
from wtforms import TextField
from wtforms.validators import Required, NumberRange, Optional
from mod_tags.models import *
| [
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
83,
23914,
1330,
8255,
15878,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
20906,
11,
7913,
17257,
11,
32233,
198,
6738,
953,
62,
31499,
13,
27530,
1330,
1635,
628
] | 3.804878 | 41 |
"""
A deployment script that accomplishes the following:
Sets up a handler for the endpoint /deploy, which when triggered on a production port:
1) Navigates into a "debug" directory, where it pulls the latest copy of Brainspell from GitHub (or clones a copy, if one doesn't already exist)
2) Starts the "debug" Brainsp... | [
37811,
198,
32,
14833,
4226,
326,
6424,
5614,
262,
1708,
25,
198,
198,
50,
1039,
510,
257,
21360,
329,
262,
36123,
1220,
2934,
1420,
11,
543,
618,
13973,
319,
257,
3227,
2493,
25,
198,
198,
16,
8,
13244,
328,
689,
656,
257,
366,
2... | 3.590674 | 386 |
from NIENV import *
# API METHODS
# self.main_widget <- access to main widget
# Ports
# self.input(index) <- access to input data
# set_output_val(index, val) <- set output data port value
# self.exec_output(index) <- executes an execution output
# self.create_new_input(type... | [
6738,
24947,
1677,
53,
1330,
1635,
198,
198,
2,
7824,
337,
36252,
50,
198,
198,
2,
2116,
13,
12417,
62,
42655,
220,
220,
220,
220,
220,
220,
220,
24293,
1895,
284,
1388,
26295,
628,
198,
2,
30824,
198,
2,
2116,
13,
15414,
7,
9630,... | 2.865169 | 267 |
from pathlib import Path
from hat.doit import common
from hat.doit.js import (build_npm,
run_eslint)
__all__ = ['task_js_build',
'task_js_check',
'task_js_deps']
build_js_dir = Path('build/js')
src_js_dir = Path('src_js')
readme_path = Path('README.rst')
def task_js... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
6877,
13,
4598,
270,
1330,
2219,
198,
6738,
6877,
13,
4598,
270,
13,
8457,
1330,
357,
11249,
62,
77,
4426,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.205047 | 317 |
import logging
import re
from .connection_manager.errors import CLIError
log = logging.getLogger(__name__)
| [
11748,
18931,
198,
11748,
302,
198,
198,
6738,
764,
38659,
62,
37153,
13,
48277,
1330,
43749,
12331,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.4375 | 32 |
import pysolr
import json
import requests
class SolrConnection(object):
'''
Connection to Solr database
'''
# The number of documents held in a core's insert queue before
# the documents in the core are automatically inserted.
QUEUE_THRESHOLD = 100
def __init__(self, url):
'''
... | [
11748,
279,
893,
349,
81,
198,
11748,
33918,
198,
11748,
7007,
198,
198,
4871,
4294,
81,
32048,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
26923,
284,
4294,
81,
6831,
198,
220,
220,
220,
705,
7061,
628,
220,
... | 2.351156 | 2,899 |
from enum import Enum
import cv2
import numpy as np
def convertScale(img, alpha, beta):
"""Add bias and gain to an image with saturation arithmetics. Unlike
cv2.convertScaleAbs, it does not take an absolute value, which would lead to
nonsensical results (e.g., a pixel at 44 with alpha = 3 and beta = -21... | [
6738,
33829,
1330,
2039,
388,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
4299,
10385,
29990,
7,
9600,
11,
17130,
11,
12159,
2599,
198,
220,
220,
220,
37227,
4550,
10690,
290,
4461,
284,
281,
2939,
351,... | 3.102041 | 196 |
# Should test if the langevin actually produces adversarial against a pretrained classifier
from adv_train.launcher import Launcher
from adv_train.model import (
DatasetType,
MnistModel,
CifarModel,
load_classifier,
load_dataset,
)
from adv_train.dynamic import Attacker
from adv_train.dataset import... | [
2,
10358,
1332,
611,
262,
300,
858,
7114,
1682,
11073,
16907,
36098,
1028,
257,
2181,
13363,
1398,
7483,
198,
6738,
1354,
62,
27432,
13,
38722,
2044,
1330,
26385,
198,
6738,
1354,
62,
27432,
13,
19849,
1330,
357,
198,
220,
220,
220,
1... | 2.913793 | 232 |
import sqlite3
if __name__ == '__main__':
dbname = "myDatabase/Sqlite_Northwind.sqlite3"
sales = [int(input("กรอกจำนวนที่สินค้าขายได้มากกว่ากี่ครั้ง : "))]
sqlQuery(dbname, sales)
| [
11748,
44161,
578,
18,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
20613,
3672,
796,
366,
1820,
38105,
14,
50,
13976,
578,
62,
14157,... | 1.302469 | 162 |
import re
import subprocess
from IPython.utils.text import SList
__all__ = (
'ish_out',
'ish_run',
)
expression_str = r'\!([^\(\[].*)'
expression = re.compile(expression_str)
assignment = re.compile(r'([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*' + expression_str)
@events.on_transform_command
| [
11748,
302,
198,
11748,
850,
14681,
198,
198,
6738,
6101,
7535,
13,
26791,
13,
5239,
1330,
311,
8053,
628,
198,
834,
439,
834,
796,
357,
198,
220,
220,
220,
705,
680,
62,
448,
3256,
198,
220,
220,
220,
705,
680,
62,
5143,
3256,
19... | 2.244275 | 131 |
"""Tests for handling setup action blocks in ModuleManager."""
from pathlib import Path
from astrality.module import ModuleManager
def test_that_setup_block_is_only_executed_once(tmpdir):
"""Setup blocks in modules should only be performed once."""
touched = Path(tmpdir, 'touched.tmp')
modules = {
... | [
37811,
51,
3558,
329,
9041,
9058,
2223,
7021,
287,
19937,
13511,
526,
15931,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
6468,
1373,
414,
13,
21412,
1330,
19937,
13511,
628,
198,
4299,
1332,
62,
5562,
62,
40406,
62,
9967,
... | 2.632813 | 384 |
from torch.nn import LSTM
from torch.autograd import Variable
import torch
import torch.nn.functional as F
from spodernet.frontend import AbstractModel
from spodernet.utils.global_config import Config
| [
6738,
28034,
13,
20471,
1330,
406,
2257,
44,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
599,
375,
1142,
316,
13,
8534,
437,
1330,
2774... | 3.491525 | 59 |
import unittest
from unittest import mock
from groupy import pagers
from groupy.api import chats
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
1448,
88,
1330,
279,
10321,
198,
6738,
1448,
88,
13,
15042,
1330,
40815,
628,
628
] | 3.482759 | 29 |
import sys
import string
from copy import deepcopy
D_OUT_FILE = 'runtime/layout.d'
JS_OUT_FILE = 'runtime/layout.js'
JS_DEF_PREFIX = '$rt_'
# Type sizes in bytes
typeSize = {
'uint8':1,
'uint16':2,
'uint32':4,
'uint64':8,
'int8':1,
'int16':2,
'int32':4,
'int64':8,
'float64':8,
... | [
11748,
25064,
198,
11748,
4731,
198,
6738,
4866,
1330,
2769,
30073,
198,
198,
35,
62,
12425,
62,
25664,
796,
705,
43282,
14,
39786,
13,
67,
6,
198,
20120,
62,
12425,
62,
25664,
796,
705,
43282,
14,
39786,
13,
8457,
6,
198,
198,
2012... | 2.091478 | 8,625 |
import os
import sys
from os.path import abspath, join
from seisflows.tools import unix
from seisflows.tools.code import call, findpath, saveobj
from seisflows.tools.config import ParameterError, custom_import, \
SeisflowsObjects, SeisflowsParameters, SeisflowsPaths
PAR = SeisflowsParameters()
PATH = SeisflowsPa... | [
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
4654,
198,
198,
6738,
384,
271,
44041,
13,
31391,
1330,
555,
844,
198,
6738,
384,
271,
44041,
13,
31391,
13,
8189,
1330,
869,
11,
1064,
6978,
11,
... | 2.100142 | 1,408 |
#! /usr/bin/env python3
import fileinput
import random
import re
from dstruct.Mention import Mention
from dstruct.Sentence import Sentence
from dstruct.Relation import Relation
from helper.dictionaries import load_dict
from helper.easierlife import get_dict_from_TSVline, no_op, TSVstring2list
# Load the gene<->hpote... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
2393,
15414,
198,
11748,
4738,
198,
11748,
302,
198,
198,
6738,
288,
7249,
13,
44,
1463,
1330,
337,
1463,
198,
6738,
288,
7249,
13,
31837,
594,
1330,
11352,
594,
19... | 1.731614 | 7,601 |
import numpy as np
from typing import Tuple
from IMLearn.metalearners.adaboost import AdaBoost
from IMLearn.learners.classifiers import DecisionStump
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from IMLearn.metrics.loss_functions import accuracy
def generate_data(n:... | [
11748,
299,
32152,
355,
45941,
198,
6738,
19720,
1330,
309,
29291,
198,
6738,
314,
5805,
451,
77,
13,
28469,
451,
2741,
13,
324,
34748,
455,
1330,
47395,
45686,
198,
6738,
314,
5805,
451,
77,
13,
35720,
364,
13,
4871,
13350,
1330,
264... | 2.495108 | 511 |
"""
FitPanel class contains fields allowing to fit models and data
:note: For Fit to be performed the user should check at least one parameter
on fit Panel window.
"""
import wx
import wx.lib.newevent
from wx.aui import AuiNotebook as Notebook
import datetime
from bumps.gui.convergence_view import Convergence... | [
37811,
198,
31805,
26639,
1398,
4909,
7032,
5086,
284,
4197,
220,
4981,
290,
220,
1366,
198,
198,
25,
11295,
25,
1114,
25048,
284,
307,
6157,
262,
2836,
815,
2198,
379,
1551,
530,
11507,
198,
220,
220,
220,
319,
4197,
18810,
4324,
13,... | 2.521327 | 633 |
from random import randint
from random_word import RandomWords
random_num_list=[]
for i in range(200):
random_num_list.append(randint(0,1000))
r = RandomWords()
random_word_list=r.get_random_words()
list_type=input("Which type of list would you like to sort and search, words or numbers?")
if lis... | [
6738,
4738,
1330,
43720,
600,
201,
198,
6738,
4738,
62,
4775,
1330,
14534,
37117,
201,
198,
201,
198,
25120,
62,
22510,
62,
4868,
28,
21737,
201,
198,
1640,
1312,
287,
2837,
7,
2167,
2599,
201,
198,
220,
220,
220,
4738,
62,
22510,
6... | 2.555556 | 351 |
'''
Cleanup all VMs (find from ZStack database). It is mainly for debuging.
@author: Youyk
'''
import threading
import time
import sys
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.config_operations as con_ops
import zstackwoodpecker.operations.net_operations a... | [
7061,
6,
198,
198,
32657,
929,
477,
569,
10128,
220,
357,
19796,
422,
1168,
25896,
6831,
737,
632,
318,
8384,
329,
14257,
278,
13,
198,
198,
31,
9800,
25,
921,
48361,
198,
7061,
6,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,... | 3.217391 | 207 |
from __future__ import annotations
from typing import Tuple, List
from random import randint
from time import perf_counter
import numpy as np
from common.util import argmax
from common.ticktack import *
def uct_search(init_state,
util_fn: Callable[[Tuple[int, ...]], float],
selection_cr... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
19720,
1330,
309,
29291,
11,
7343,
198,
6738,
4738,
1330,
43720,
600,
198,
6738,
640,
1330,
23035,
62,
24588,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2219,
13,
22602,
1330,
1822,
9... | 2.206067 | 2,703 |
from sqlalchemy.orm import backref
from sqlalchemy.orm import deferred
from db import db
from model.dataset_model import Dataset
from sqlalchemy.dialects.postgresql import JSONB
class Network(db.Model):
"""
Network data class
"""
# db table name
__tablename__ = 'network'
# rea... | [
6738,
44161,
282,
26599,
13,
579,
1330,
736,
5420,
201,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
28651,
201,
198,
201,
198,
6738,
20613,
1330,
20613,
201,
198,
6738,
2746,
13,
19608,
292,
316,
62,
19849,
1330,
16092,
292,
316,
201... | 2.600418 | 478 |
from flask import (Blueprint, flash, request, current_app, jsonify, Response)
from warden_modules import (warden_metadata,
positions_dynamic,
generatenav, specter_df,
current_path, regenerate_nav,
home_path... | [
6738,
42903,
1330,
357,
14573,
4798,
11,
7644,
11,
220,
2581,
11,
1459,
62,
1324,
11,
220,
33918,
1958,
11,
18261,
8,
198,
6738,
266,
5872,
62,
18170,
1330,
357,
904,
268,
62,
38993,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220... | 3.110913 | 1,686 |
from user import User
users = [
User(1, 'bogdan', 's3cret'),
User(2, 'georgi', "pass")
]
user_mapping = {u.username: u for u in users}
userid_mapping = {u.id: u for u in users}
| [
6738,
2836,
1330,
11787,
198,
198,
18417,
796,
685,
198,
220,
220,
220,
11787,
7,
16,
11,
705,
65,
519,
25604,
3256,
705,
82,
18,
66,
1186,
33809,
198,
220,
220,
220,
11787,
7,
17,
11,
705,
469,
2398,
72,
3256,
366,
6603,
4943,
... | 2.25 | 84 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for FFmpeg repository.
Does the following:
- Warns users that changes must be submitted via Gerrit.
- Warns users when a change is m... | [
2,
15069,
357,
66,
8,
2321,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
1... | 2.748006 | 627 |
from os.path import join
from typing import Tuple
from constants import PATH, SCREEN_HEIGHT, SCREEN_WIDTH, WHITE
from pygame import Rect, Surface, display, image, mouse
from graphics.font import Font, FontType
class Screen:
""" This class is responsible for drawing elements on the screen """
__cursor: ... | [
6738,
28686,
13,
6978,
1330,
4654,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
38491,
1330,
46490,
11,
6374,
2200,
1677,
62,
13909,
9947,
11,
6374,
2200,
1677,
62,
54,
2389,
4221,
11,
44925,
198,
6738,
12972,
6057,
1330,
48599,
... | 2.676349 | 482 |
from qoalgo.base import JoinTree, Relation, QueryGraph
| [
6738,
10662,
78,
282,
2188,
13,
8692,
1330,
15251,
27660,
11,
4718,
341,
11,
43301,
37065,
628,
628,
628
] | 3.157895 | 19 |
import time
from datetime import datetime, date, timedelta
import six as six
"""默认的时间日期格式,项目中金融时间序列等时间相关默认格式"""
K_DEFAULT_DT_FMT2 = "%Y-%m-%d"
def str_to_datetime(date_str, fmt=K_DEFAULT_DT_FMT2, fix=True):
"""
将字符串日期格式转换成datetime.datetime对象 eg. '2016-01-01' -> datetime.datetime(2016, 1, 1, 0, 0)
:param... | [
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
11,
28805,
12514,
198,
11748,
2237,
355,
2237,
628,
198,
37811,
165,
119,
246,
164,
106,
97,
21410,
33768,
114,
29785,
112,
33768,
98,
17312,
253,
43718,
120,
28156,
237,
... | 1.538617 | 2,978 |
from django.db import models
from mission.models import Vehicule, Conducteur
from users.models import User
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
4365,
13,
27530,
1330,
15118,
291,
2261,
11,
28579,
23365,
198,
6738,
2985,
13,
27530,
1330,
11787,
198,
2,
13610,
534,
4981,
994,
13,
628,
628,
198
] | 3.833333 | 36 |
"""
=========================================================================
MultiCacheTestCases.py
=========================================================================
Test cases for multicache configs
Author : Xiaoyu Yan (xy97), Eric Tang (et396)
Date : 13 April 2020
"""
import pytest
from test.sim_utils i... | [
37811,
198,
23926,
2559,
28,
198,
15237,
30562,
14402,
34,
1386,
13,
9078,
198,
23926,
2559,
28,
198,
14402,
2663,
329,
47368,
4891,
4566,
82,
198,
198,
13838,
1058,
22450,
726,
84,
10642,
357,
5431,
5607,
828,
7651,
18816,
357,
316,
... | 4.109091 | 110 |
import requests, json
from os.path import exists
from decouple import config
import logging
OPEN_WEATHER_MAP_API_URL = "https://api.openweathermap.org"
with open('cache/services.json') as json_file:
service_config = json.load(json_file)
configs = [service['configs'] for service in service_config['services'] if se... | [
11748,
7007,
11,
33918,
198,
6738,
28686,
13,
6978,
1330,
7160,
198,
6738,
875,
43846,
1330,
4566,
198,
11748,
18931,
198,
198,
3185,
1677,
62,
8845,
45226,
62,
33767,
62,
17614,
62,
21886,
796,
366,
5450,
1378,
15042,
13,
9654,
23563,
... | 3.333333 | 138 |
from typing import List
from base import version
| [
198,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
2779,
1330,
2196,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.176471 | 34 |
import re
txt = "hello world"
# Check if the string ends with 'world':
x = re.findall("world$", txt)
if x:
print("Yes, the string ends with 'world'")
else:
print("No match")
# Author: Bryan G
| [
11748,
302,
198,
198,
14116,
796,
366,
31373,
995,
1,
198,
198,
2,
6822,
611,
262,
4731,
5645,
351,
705,
6894,
10354,
198,
198,
87,
796,
302,
13,
19796,
439,
7203,
6894,
3,
1600,
256,
742,
8,
198,
361,
2124,
25,
198,
220,
220,
2... | 2.649351 | 77 |
from debug import logger
from messagetypes import MsgBase
| [
6738,
14257,
1330,
49706,
198,
6738,
2085,
363,
2963,
12272,
1330,
6997,
70,
14881,
198
] | 3.866667 | 15 |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2864,
383,
4518,
9437,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,... | 2.863366 | 505 |
import boto3
import json | [
11748,
275,
2069,
18,
198,
11748,
33918
] | 3.428571 | 7 |
# Generated by Django 3.0.6 on 2020-12-18 03:04
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
21,
319,
12131,
12,
1065,
12,
1507,
7643,
25,
3023,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |