content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django import forms
from .models import Feedback | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
764,
27530,
1330,
37774
] | 4.818182 | 11 |
import numpy as np
import matplotlib.pylab as plt
x = [1,2,3,4,5,6,7,8,9,10,11]
y = [0.00197234,0.0018456,0.001764,0.00168665,0.00161332,0.00154376,0.00147775,0.00141508,0.00135557,0.00129904,0.00124532]
plt.plot(x,y)
plt.title("K-Shot learning (K=10), tanh")
plt.xlabel("# Gradient Steps")
plt.ylabel("MSE")
plt.sho... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
79,
2645,
397,
355,
458,
83,
628,
198,
87,
796,
685,
16,
11,
17,
11,
18,
11,
19,
11,
20,
11,
21,
11,
22,
11,
23,
11,
24,
11,
940,
11,
1157,
60,
198,
88,
796,
... | 1.814607 | 178 |
#! /usr/local/bin/python2
from scrapy import Spider
from scrapy import Request
from scrapy.selector import Selector
from amazon_scrapy.items import AmazonScrapyItem
from datetime import datetime
from scrapy_proxies import * | [
2,
0,
1220,
14629,
14,
12001,
14,
8800,
14,
29412,
17,
198,
198,
6738,
15881,
88,
1330,
12648,
198,
6738,
15881,
88,
1330,
19390,
198,
6738,
15881,
88,
13,
19738,
273,
1330,
9683,
273,
198,
6738,
716,
5168,
62,
1416,
2416,
88,
13,
... | 3.343284 | 67 |
#
# Example 8: Evaluating expressions
#
import zero
| [
2,
198,
2,
17934,
807,
25,
26439,
11927,
14700,
198,
2,
198,
11748,
6632,
628,
628,
198
] | 3.294118 | 17 |
import argparse
import os
import torch.nn.parallel
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torch.optim import AdamW
from models.modeling.resnet import resnet101, resnet50
from dataloader.a2d_loader_diff import *
from eval import evaluate, cal_fps
from train import train
... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
28034,
13,
20471,
13,
1845,
29363,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
13,
40085,
1330,
7244... | 3.272727 | 176 |
# -*- coding:utf-8 -*-
__author__ = 'Gvammer'
import datetime
from PManager.models import PM_Task, PM_Project, Tags,PM_User, PM_Timer, listManager, ObjectTags, PM_User_PlanTime, \
PM_Milestone, PM_ProjectRoles, PM_Reminder, Release, PM_MilestoneChanges
from django.contrib.auth.models import User
from PManager.views... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
705,
38,
85,
321,
647,
6,
198,
11748,
4818,
8079,
198,
6738,
3122,
272,
3536,
13,
27530,
1330,
3122,
62,
25714,
11,
3122,
62,
16775,
11,
44789,
11,
... | 3.273764 | 263 |
import unittest
import odmlib.odm_1_3_2.model as ODM
import odmlib.odm_1_3_2.rules.metadata_schema as METADATA
| [
11748,
555,
715,
395,
198,
11748,
16298,
4029,
571,
13,
375,
76,
62,
16,
62,
18,
62,
17,
13,
19849,
355,
440,
23127,
198,
11748,
16298,
4029,
571,
13,
375,
76,
62,
16,
62,
18,
62,
17,
13,
38785,
13,
38993,
62,
15952,
2611,
355,
... | 2.285714 | 49 |
import unittest
import numpy as np
from girth.factoranalysis import principal_components_analysis as pca
from girth.factoranalysis import maximum_likelihood_factor_analysis as mlfa
from girth.common import procrustes_rotation
class TestMaximumLikelihood(unittest.TestCase):
"""Test fixture for maximum likelihoo... | [
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
308,
3333,
13,
31412,
20930,
1330,
10033,
62,
5589,
3906,
62,
20930,
355,
279,
6888,
198,
6738,
308,
3333,
13,
31412,
20930,
1330,
5415,
62,
2339,
11935,
6... | 2.4081 | 642 |
from faker import Factory as FakerFactory
import factory
from constants.nodes import NodeRoles
from db.models.clusters import Cluster
from db.models.nodes import ClusterEvent, ClusterNode, NodeGPU
fake = FakerFactory.create()
| [
6738,
277,
3110,
1330,
19239,
355,
376,
3110,
22810,
198,
198,
11748,
8860,
198,
198,
6738,
38491,
13,
77,
4147,
1330,
19081,
49,
4316,
198,
6738,
20613,
13,
27530,
13,
565,
13654,
1330,
38279,
198,
6738,
20613,
13,
27530,
13,
77,
414... | 3.65625 | 64 |
import torch
import ssl
import os
import cv2
import numpy as np
import scipy.io as sio
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn.datasets import make_s_curve
from sklearn.datasets import make_swiss_roll
from sklearn.datasets import fetch_openml
from torchvi... | [
11748,
28034,
198,
11748,
264,
6649,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
952,
355,
264,
952,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9... | 2.108375 | 8,812 |
# -*- coding: utf-8 -*-
"""
Code to plot spider plots of NLP measures.
Author: Dr Sarah E Morgan, 21/02/2021
"""
import numpy as np
import matplotlib.pyplot as plt
# adapted from: https://stackoverflow.com/questions/24659005/radar-chart-with-multiple-scales-on-multiple-axes
# function to get range from start, end a... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
10669,
284,
7110,
19230,
21528,
286,
399,
19930,
5260,
13,
198,
13838,
25,
1583,
10490,
412,
10805,
11,
2310,
14,
2999,
14,
1238,
2481,
198,
37811,
198,
198,... | 3.363636 | 176 |
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this open-source project.
""" Define the dance dataset. """
import numpy as np
import torch
import torch.utils.data
from torch.utils.data import Dataset
import pdb
| [
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
1280,
12,
10459,
1628,
13,
628,
198,
37811,
2896,
500,
262,
9280,
27039,
13,
37227,
198,
11748,
299,
... | 3.805556 | 72 |
import torch
from torch import autograd
use_cuda = torch.cuda.is_available()
float_tensor = get_tensor_type('FloatTensor')
long_tensor = get_tensor_type('LongTensor')
optimizer_dict = {'RMSprop': torch.optim.RMSprop, 'Adam': torch.optim.Adam}
| [
11748,
28034,
198,
6738,
28034,
1330,
1960,
519,
6335,
198,
198,
1904,
62,
66,
15339,
796,
28034,
13,
66,
15339,
13,
271,
62,
15182,
3419,
628,
198,
198,
22468,
62,
83,
22854,
796,
651,
62,
83,
22854,
62,
4906,
10786,
43879,
51,
228... | 2.688172 | 93 |
"""
Exercício Python 114: Crie um código em Python que teste se o site pudim está acessível pelo computador usado.
"""
import urllib.request
try:
urllib.request.urlopen("http://pudim.com.br/")
except:
print('The website is offline.')
else:
print('The website is online.') | [
37811,
198,
3109,
2798,
8836,
66,
952,
11361,
17342,
25,
327,
5034,
23781,
269,
10205,
12894,
78,
795,
11361,
8358,
1332,
68,
384,
267,
2524,
279,
463,
320,
1556,
6557,
257,
919,
8836,
626,
16176,
78,
2653,
7079,
514,
4533,
13,
198,
... | 2.62963 | 108 |
import requests
from bs4 import BeautifulSoup
all_domain = []
extract_domains()
for domain in all_domain:
print(domain)
| [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
439,
62,
27830,
796,
17635,
628,
198,
198,
2302,
974,
62,
3438,
1299,
3419,
198,
1640,
7386,
287,
477,
62,
27830,
25,
198,
220,
220,
220,
3601,
7,
27830,
8,
19... | 2.909091 | 44 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
4793,
12,
6390,
1717,
39909,
439,
10442,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
3788,
318,
11971,
355,
3417,
287,
262,
2... | 3.087774 | 319 |
"""Loads configuration (mostly directory locations) from disk or
environment variables. Can set configuration for testing purposes."""
import os
import yaml
DEFAULT_CONFIG_FILE = os.path.expanduser('~/.config/shepherd.yaml')
SHEPHERD_CONFIG_FILE = 'SHEPHERD_CONFIG_FILE'
REQUIRED_CONFIG_KEYS = 'asp_root sub_root'.sp... | [
37811,
8912,
82,
8398,
357,
29471,
8619,
7064,
8,
422,
11898,
393,
198,
38986,
9633,
13,
1680,
900,
8398,
329,
4856,
4959,
526,
15931,
198,
198,
11748,
28686,
198,
198,
11748,
331,
43695,
628,
198,
7206,
38865,
62,
10943,
16254,
62,
2... | 2.760714 | 280 |
import numpy as np
import numpy.linalg as la
import networkx as nx
class Network(nx.MultiGraph):
"""
Simplified version of panel network where everything is an elastic spring
Boundary conditions are always fixed on the bottom and free on the top
"""
def add_panel(self, k):
"""
Add a panel... | [
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
75,
1292,
70,
355,
8591,
198,
11748,
3127,
87,
355,
299,
87,
198,
198,
4871,
7311,
7,
77,
87,
13,
29800,
37065,
2599,
198,
220,
37227,
198,
220,
220,
220,
45157,
1431,
2196,... | 2.264373 | 2,035 |
from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers.activations import get_activation
from transformers.file_utils import ModelOutput
from transformers.models.electra import ElectraModel
| [
6738,
19720,
1330,
32233,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
6121,
364,
13,
15791,
602,
1330,
651,
62,
48545,
198,
6738,
6121,
364,
13... | 4.032258 | 62 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.023697 | 633 |
__author__ = "Suhas Bharadwaj (subharad)"
import logging
import multiprocessing
import re
from concurrent.futures import wait
from concurrent.futures.thread import ThreadPoolExecutor
from .connection_manager.errors import UnsupportedSeedSwitch
from .switch import Switch
# from .utility.utils import _wait_till_connec... | [
834,
9800,
834,
796,
366,
5606,
10134,
33653,
324,
86,
1228,
357,
7266,
9869,
324,
16725,
198,
198,
11748,
18931,
198,
11748,
18540,
305,
919,
278,
198,
11748,
302,
198,
6738,
24580,
13,
69,
315,
942,
1330,
4043,
198,
6738,
24580,
13,... | 2.186209 | 3,002 |
from django.urls import path
from . import views, api
urlpatterns = [
path('', views.IndexListView.as_view(), name='index'),
path('following', views.FollowingListView.as_view(), name='following'),
path("profile/<int:userId>", views.ProfileListView.as_view(), name="profile"),
path("account", views.acco... | [
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
11,
40391,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
15732,
8053,
7680,
13,
292,
62,
1177,
22784,
1438,
11639,
... | 2.864686 | 303 |
from django.urls import path
from .views import create_user
urlpatterns = [
path("add_user/", create_user, name="create_user"),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
2251,
62,
7220,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7203,
2860,
62,
7220,
14,
1600,
2251,
62,
7220,
11,
1438,
2625,
17953,
62,
7220,
12... | 2.913043 | 46 |
import scrapy
from scrapy_splash import SplashRequest
from scrapy.shell import inspect_response
from scrapy.utils.response import open_in_browser
| [
11748,
15881,
88,
198,
6738,
15881,
88,
62,
22018,
1077,
1330,
45275,
18453,
198,
6738,
15881,
88,
13,
29149,
1330,
10104,
62,
26209,
198,
6738,
15881,
88,
13,
26791,
13,
26209,
1330,
1280,
62,
259,
62,
40259,
628
] | 3.868421 | 38 |
# -*- coding: utf-8 -*-
from vulyk.models.task_types import AbstractTaskType
from vulyk.models.tasks import AbstractTask, AbstractAnswer
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
410,
2062,
74,
13,
27530,
13,
35943,
62,
19199,
1330,
27741,
25714,
6030,
198,
6738,
410,
2062,
74,
13,
27530,
13,
83,
6791,
1330,
27741,
25714,
11,
27741,
33706,
... | 3.043478 | 46 |
# 클래스
# 변수와 그것과 관련된 함수를 하나의 이름으로 정의한 것
# 클래스는 메서드, 속성, 클래스 변수, 인스턴스변수로 구성
# 덫붙여 생성자와 소멸자등의 멤버도 존재
# 클래스 정의
# class 이름 :
# 클래스 변수
# 생성자
# 함수정의(메서드)
# 파이썬에서는 생성자나 메서드 정의시 암시적으로 첫번째 매개변수가 self로 지정되어 있음
# self는 항상 객체 자기 자신을 가리키는 의미로 사용
# 클래스의 멤버변수는 생성자를 통해서 정의
# 파이썬에서는 객체로 생성된 후에도 멤버변수를 추가할 수 있음(비추)
print(HelloPyt... | [
2,
220,
169,
223,
112,
167,
252,
246,
168,
232,
97,
198,
2,
31619,
111,
222,
168,
230,
246,
168,
247,
222,
220,
166,
115,
116,
166,
110,
225,
166,
111,
120,
220,
166,
112,
222,
167,
254,
101,
167,
238,
250,
220,
47991,
101,
16... | 0.942537 | 1,340 |
import FWCore.ParameterSet.Config as cms
from DQMOffline.Hcal.HLTHcalRecHitParam_cfi import *
hcalMonitoringSequence = cms.Sequence(
hltHCALRecHitsAnalyzer
)
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
360,
48,
44,
28657,
13,
39,
9948,
13,
6581,
4221,
9948,
6690,
17889,
22973,
62,
66,
12463,
1330,
1635,
198,
198,
71,
9948,
35479,
278,
44015,
594,
796,
... | 2.5625 | 64 |
import tensorflow as tf
tf.compat.v1.enable_v2_behavior()
import wandb
import gin
import trainer
import os
import os.path as osp
import numpy as np
from absl import flags
from absl import app
from absl import logging
FLAGS = flags.FLAGS
flags.DEFINE_string('root_dir', 'safe-sac-sweeps/cube_rotate/', 'Root directory... | [
11748,
11192,
273,
11125,
355,
48700,
198,
27110,
13,
5589,
265,
13,
85,
16,
13,
21633,
62,
85,
17,
62,
46571,
3419,
198,
11748,
11569,
65,
198,
11748,
39733,
198,
11748,
21997,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
355,
267... | 3.095352 | 839 |
# coding: utf-8
"""
AVACloud API 1.17.3
AVACloud API specification # noqa: E501
OpenAPI spec version: 1.17.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ProjectInformationDto(object):
"""NOTE: This class is... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
14661,
2246,
75,
2778,
7824,
352,
13,
1558,
13,
18,
628,
220,
220,
220,
14661,
2246,
75,
2778,
7824,
20855,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,... | 2.587204 | 7,471 |
#!/usr/bin/env python3
# project linsur
# settings.py
# life
# pricing
pir = .035
vir = .030
additional_rate = .17
# span
pay = 10
death = 15
survival = 10
p_class = 'A'
if p_class == 'A':
death_compensate = 200000
survival_compensate = 50000
elif p_class == 'B':
death_compensate = 500000
survival_com... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
1628,
300,
1040,
333,
198,
2,
6460,
13,
9078,
198,
198,
2,
1204,
198,
2,
13045,
198,
4063,
796,
764,
44215,
198,
37040,
796,
764,
39101,
198,
2860,
1859,
62,
4873,
796,
764,... | 2.498559 | 347 |
import my_module as mm
import json
import sys
import requests
from bs4 import BeautifulSoup
import argparse
headers = {
'User-Agent': 'Not a bot',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
'Host': 'www.... | [
11748,
616,
62,
21412,
355,
8085,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
1822,
29572,
198,
198,
50145,
796,
1391,
198,
197,
6,
12982,
12,
36772,
10354,
705,
... | 2.895545 | 651 |
import json
from moby_distribution.spec.image_json import ImageJSON
| [
11748,
33918,
198,
198,
6738,
7251,
88,
62,
17080,
3890,
13,
16684,
13,
9060,
62,
17752,
1330,
7412,
40386,
628
] | 3.5 | 20 |
# coding=utf-8
"""
백준 1389번 : 케빈 베이컨의 6단계 법칙
"""
import sys
from collections import deque
input = sys.stdin.readline
N, M = map(int, input().split())
graph = [[] for _ in range(N+1)]
visited = [0] * (N+1)
for _ in range(M):
a, b = map(int, input().split())
graph[a].append(b)
graph[b].append(a)
min_baco... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
167,
108,
109,
168,
97,
222,
1511,
4531,
167,
110,
230,
1058,
23821,
120,
222,
167,
117,
230,
31619,
110,
254,
35975,
112,
168,
119,
101,
35975,
246,
718,
46695,
101,
166,
111,
226,
31... | 1.947761 | 268 |
r"""
Built-in instances of the VICE dataframe
atomic_number
-------------
Every element's atomic number (number of protons in the nucleus)
primordial
----------
The abundance by mass of each element in primordial gas following big bang
nucleosynthesis
solar_z
-------
The abundance by mass of each element in the sun
... | [
81,
37811,
198,
39582,
12,
259,
10245,
286,
262,
46304,
1366,
14535,
198,
198,
47116,
62,
17618,
198,
32501,
198,
6109,
5002,
338,
17226,
1271,
357,
17618,
286,
1237,
684,
287,
262,
29984,
8,
198,
198,
19795,
31223,
198,
35937,
198,
4... | 3.242424 | 297 |
from flask import render_template, Blueprint
from flask_login import login_required, current_user
from .. import app_info
from flask import request, redirect, url_for
from ..search import elastic_search as search_method
from .. import log
from .. import config
import random
index_bp = Blueprint('index', __name__)
@in... | [
6738,
42903,
1330,
8543,
62,
28243,
11,
39932,
198,
6738,
42903,
62,
38235,
1330,
17594,
62,
35827,
11,
1459,
62,
7220,
198,
6738,
11485,
1330,
598,
62,
10951,
198,
6738,
42903,
1330,
2581,
11,
18941,
11,
19016,
62,
1640,
198,
6738,
1... | 3.141243 | 177 |
from functools import partial
from warnings import warn
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd.scipy.misc import logsumexp
from autograd.scipy.stats import dirichlet
from autograd.misc.optimizers import sgd, adam
from autograd import grad
from ssm.util import one_hot, logistic, ... | [
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
14601,
1330,
9828,
198,
198,
11748,
1960,
519,
6335,
13,
77,
32152,
355,
45941,
198,
11748,
1960,
519,
6335,
13,
77,
32152,
13,
25120,
355,
299,
1050,
198,
6738,
1960,
519,
6335,
13,
141... | 2.162705 | 3,534 |
from lib2to3.pgen2 import token
import websocket
from json import loads
from requests import get
from re import search
from urllib import parse
from warnings import warn, filterwarnings
| [
6738,
9195,
17,
1462,
18,
13,
79,
5235,
17,
1330,
11241,
198,
11748,
2639,
5459,
198,
6738,
33918,
1330,
15989,
198,
6738,
7007,
1330,
651,
198,
6738,
302,
1330,
2989,
198,
6738,
2956,
297,
571,
1330,
21136,
198,
6738,
14601,
1330,
98... | 3.957447 | 47 |
kwargs_method(1, 2, 45, name='John', location='UK')
| [
628,
198,
198,
46265,
22046,
62,
24396,
7,
16,
11,
362,
11,
4153,
11,
1438,
11639,
7554,
3256,
4067,
11639,
15039,
11537,
198
] | 2.434783 | 23 |
# noinspection PyPep8
""" run with
python setup.py install; nosetests -v --nocapture tests/cm_basic/test_database.py:Test_database.test_001
nosetests -v --nocapture tests/cm_basic/test_database.py
or
nosetests -v tests/cm_basic/test_database.py
"""
from pprint import pprint
from cloudmesh_client import Cloudmesh... | [
2,
645,
1040,
14978,
9485,
47,
538,
23,
198,
37811,
1057,
351,
198,
198,
29412,
9058,
13,
9078,
2721,
26,
43630,
316,
3558,
532,
85,
1377,
77,
420,
2373,
495,
5254,
14,
11215,
62,
35487,
14,
9288,
62,
48806,
13,
9078,
25,
14402,
6... | 2.368675 | 415 |
import os, random
from flask import Flask, render_template, url_for, request, Markup, redirect
app = Flask(__name__)
@app.route('/')
@app.route('/analysis/<lat>/<lng>', methods=['GET'])
| [
11748,
28686,
11,
4738,
198,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
2581,
11,
2940,
929,
11,
18941,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
31,
1324,
13,
38629,
10786,
14,
... | 2.742857 | 70 |
ip='database-ip'
port=1234
SID='databaseSID'
username='database_username'
password='database_password'
pathSummaryStats = '/path/to/summary/stats/directory'
pathFTP = '/nfs/ftp/path/to/gwas/ftp'
| [
541,
11639,
48806,
12,
541,
6,
198,
634,
28,
1065,
2682,
198,
50,
2389,
11639,
48806,
50,
2389,
6,
198,
198,
29460,
11639,
48806,
62,
29460,
6,
198,
28712,
11639,
48806,
62,
28712,
6,
628,
198,
6978,
22093,
29668,
796,
31051,
6978,
... | 2.657895 | 76 |
import pytest
import numpy as np
from plums.dataflow.dataset import Dataset, SizedDataset, Subset, ConcatDataset
| [
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
458,
5700,
13,
7890,
11125,
13,
19608,
292,
316,
1330,
16092,
292,
316,
11,
311,
1143,
27354,
292,
316,
11,
3834,
2617,
11,
1482,
9246,
27354,
292,
316,
628,
628,... | 2.727273 | 44 |
#
# PySNMP MIB module XIO-HUB-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XIO-HUB-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:44:25 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, 0... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
1395,
9399,
12,
39,
10526,
12,
8895,
33,
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,
... | 2.540383 | 29,629 |
"""
Analytics Modules
=================
Defines common api for measuring distances between candidates.
"""
from ..data import DataSetInstance
import pandas as pd
import numpy as np
import importlib
import logging
from typing import List
ACCEPTED_TYPES = {
"linear": "linear_answers",
"multiselect": "mult... | [
37811,
198,
198,
37702,
14094,
3401,
5028,
198,
4770,
28,
198,
198,
7469,
1127,
2219,
40391,
329,
15964,
18868,
1022,
5871,
13,
198,
198,
37811,
198,
198,
6738,
11485,
7890,
1330,
6060,
7248,
33384,
198,
198,
11748,
19798,
292,
355,
279... | 2.64758 | 1,467 |
import math
import re
from typing import List, Optional
import log
from css_colors import COLORS
from datamodel import Expression, Number, Undefined, String, Symbol
from environment import global_attr
from evaluate_apply import Frame
from helper import verify_exact_callable_length, verify_min_callable_length
from prim... | [
198,
11748,
10688,
198,
11748,
302,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
11748,
2604,
198,
6738,
269,
824,
62,
4033,
669,
1330,
20444,
20673,
198,
6738,
4818,
321,
375,
417,
1330,
41986,
11,
7913,
11,
13794,
18156,
11,
10903,
... | 2.798077 | 520 |
'''
Funds views
'''
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.views.generic import ListView, DetailView
from django.urls import reverse_lazy
# from el_pagination.views import AjaxListView
from funds.models import Bank, Wallet
class BankList(ListView):
'''
Updates B... | [
7061,
6,
198,
34068,
5009,
198,
7061,
6,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
19312,
1330,
13610,
7680,
11,
10133,
7680,
11,
23520,
7680,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,
42585,
7680,
... | 2.784672 | 274 |
"""
ResNeSt for classification
Programmer: Weiming Chen
Date: 2021.3
"""
import torch
import torch.nn as nn
from dl_toolbox_cwm.model.backbone import ResNeSt
from dl_toolbox_cwm.model.neck import GlobalAveragePooling
from dl_toolbox_cwm.utils import validate_ckpt
__all__ = [
'ResNeSt50', 'ResNeSt101', 'ResNeSt200'... | [
37811,
198,
4965,
8199,
1273,
329,
17923,
198,
15167,
647,
25,
775,
320,
278,
12555,
198,
10430,
25,
33448,
13,
18,
198,
37811,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
288,
75,
62,
25981,
3524,
62,
... | 2.198295 | 2,229 |
# -*- coding: utf-8 -*-
"""
This file is run by VMProxy
(Why separate file for launching? I want to have clean global scope
in toplevel __main__ module (because that's where user scripts run), but backend's global scope
is far from clean.
I could also do python -c "from backend import VM: VM().mainloop()", but look... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1212,
2393,
318,
1057,
416,
16990,
44148,
198,
198,
7,
5195,
4553,
2393,
329,
13925,
30,
314,
765,
284,
423,
3424,
3298,
8354,
220,
198,
259,
284,
1154,
62... | 2.537721 | 623 |
import os
import sys
import numpy as np
from net import *
from chainer import serializers
import itertools
if __name__ == '__main__':
main()
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2010,
1330,
1635,
198,
6738,
6333,
263,
1330,
11389,
11341,
198,
11748,
340,
861,
10141,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
... | 3.12766 | 47 |
import io
# from typing import Any, IO, Optional
alloc_size = 512
buffer = io.StringIO(alloc_size) # Type : ignore : # FIXME: io.StringIO(alloc_size) valid in Micropython
buffer = io.BytesIO(alloc_size) # Type : ignore : # FIXME: io.BytesIO(alloc_size) valid in Micropython
| [
11748,
33245,
198,
2,
422,
19720,
1330,
4377,
11,
24418,
11,
32233,
198,
198,
32332,
62,
7857,
796,
22243,
628,
198,
22252,
796,
33245,
13,
10100,
9399,
7,
32332,
62,
7857,
8,
1303,
5994,
1058,
8856,
1058,
1303,
44855,
11682,
25,
3324... | 3.032609 | 92 |
#! /usr/bin/env python
import itertools as it
def valid_password(password):
"""Check to see if the number provided is a 6 digit number, which has two
identical adjacent digits, and in which all the numbers are ascending or
staying the same.
Parameters
----------
password : int
number... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
340,
861,
10141,
355,
340,
628,
198,
4299,
4938,
62,
28712,
7,
28712,
2599,
198,
220,
220,
220,
37227,
9787,
284,
766,
611,
262,
1271,
2810,
318,
257,
718,
16839,
1271,... | 2.838391 | 1,516 |
from unittest import TestCase
import requests_mock
from parameterized import parameterized
from hvac import Client
class TestAwsEc2Methods(TestCase):
"""Unit tests providing coverage for AWS (EC2) auth backend-related methods/routes."""
@parameterized.expand(
[
("default mount point", N... | [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
11748,
7007,
62,
76,
735,
198,
6738,
11507,
1143,
1330,
11507,
1143,
198,
198,
6738,
289,
85,
330,
1330,
20985,
628,
198,
4871,
6208,
32,
18504,
49136,
17,
46202,
7,
14402,
20448,
2599... | 2.002465 | 1,217 |
from xml.dom import minidom
from order.order import Order
class OrderList(object):
"""
This class provides a list of Order instances.
"""
def __init__(self):
"""
orders is a list of Order instances.
"""
self.orders = []
@staticmethod
def fromXml(xmlDoc, plant):
"""
A static method that creates an Or... | [
6738,
35555,
13,
3438,
1330,
949,
312,
296,
198,
6738,
1502,
13,
2875,
1330,
8284,
198,
198,
4871,
8284,
8053,
7,
15252,
2599,
198,
197,
37811,
198,
197,
1212,
1398,
3769,
257,
1351,
286,
8284,
10245,
13,
198,
197,
37811,
198,
197,
... | 2.85101 | 396 |
import binascii
with open('model.pb', "rb") as f:
print(binascii.b2a_base64(f.read(), newline=False))
| [
11748,
9874,
292,
979,
72,
198,
4480,
1280,
10786,
19849,
13,
40842,
3256,
366,
26145,
4943,
355,
277,
25,
198,
220,
220,
220,
3601,
7,
8800,
292,
979,
72,
13,
65,
17,
64,
62,
8692,
2414,
7,
69,
13,
961,
22784,
649,
1370,
28,
25... | 2.255319 | 47 |
# cook your dish here
t=int(input())
final = 0
for _ in range(t):
n=int(input())
res=-400
arr=[0]*4
a=[[0 for i in range(4)] for j in range(4)]
dic={}
dic['A']=0
dic['B']=1
dic['C']=2
dic['D']=3
for i in range(0,n):
p,k=input().split()
k=int(k)
a[dic... | [
2,
4255,
534,
9433,
994,
198,
83,
28,
600,
7,
15414,
28955,
198,
20311,
796,
657,
220,
198,
1640,
4808,
287,
2837,
7,
83,
2599,
198,
220,
220,
220,
299,
28,
600,
7,
15414,
28955,
198,
220,
220,
220,
581,
10779,
7029,
198,
220,
2... | 1.436782 | 783 |
import boto3
import requests
import numpy as np
from aws_requests_auth.aws_auth import AWSRequestsAuth
import json
import sys, os, base64, datetime, hashlib, hmac
# AWS session keys
session = boto3.Session()
credentials = session.get_credentials()
access_key=credentials.access_key
secret_key=credentials.secret_key
# ... | [
11748,
275,
2069,
18,
198,
11748,
7007,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3253,
82,
62,
8897,
3558,
62,
18439,
13,
8356,
62,
18439,
1330,
30865,
16844,
3558,
30515,
198,
11748,
33918,
198,
11748,
25064,
11,
28686,
11,
2779,... | 2.65355 | 1,169 |
from marketing_attribution_models.data import random_data
| [
6738,
7124,
62,
1078,
3890,
62,
27530,
13,
7890,
1330,
4738,
62,
7890,
628
] | 4.214286 | 14 |
#!/usr/bin/env python
import sys
import traceback
word_set = set()
if len(sys.argv) != 3:
print 'Usage: %s input output' % sys.argv[0]
sys.exit(0)
load_file("GSPC.train.clean.csv")
load_file("GSPC.dev.clean.csv")
load_file("GSPC.test.clean.csv")
glove_path = sys.argv[1]
glove_file = open(glove_path, "r")
out... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
198,
4775,
62,
2617,
796,
900,
3419,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
14512,
513,
25,
198,
220,
220,
220,
3601,
705,
28350,
25,
... | 2.284404 | 218 |
import tensorflow as tf
parallel_calls = 2
gpus = tf.config.list_physical_devices('GPU')
if gpus:
try:
tf.config.experimental.set_virtual_device_configuration(
gpus[0],
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=1024) for _ in range(parallel_calls)])
lo... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
1845,
29363,
62,
66,
5691,
796,
362,
198,
198,
31197,
385,
796,
48700,
13,
11250,
13,
4868,
62,
42854,
62,
42034,
10786,
33346,
11537,
198,
361,
27809,
385,
25,
198,
220,
220,
220,
1949,... | 2.53252 | 246 |
#/*
#* SPDX-License-Identifier: Apache-2.0
#* Copyright 2019 Western Digital Corporation or its affiliates.
#*
#* 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.apac... | [
2,
15211,
220,
201,
198,
2,
9,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
201,
198,
2,
9,
15069,
13130,
4885,
10231,
10501,
393,
663,
29116,
13,
201,
198,
2,
9,
220,
201,
198,
2,
9,
49962,
739,
262,
2484... | 2.461894 | 866 |
import netomaton as ntm
import numpy as np
class FungalGrowthModel:
"""
In this model, a network of agents are connected to eachother in a Euclidean lattice. Each agent
possesses a certain amount of "resource". An agent's resource can change by picking up resource from
a resource layer, and through th... | [
11748,
2010,
296,
13951,
355,
299,
17209,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4871,
376,
2150,
282,
38,
13046,
17633,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
554,
428,
2746,
11,
257,
3127,
286,
6554,
389,
5884,
... | 2.776177 | 1,041 |
#!/Users/riccardo/PycharmProjects/djangae-scaffold/venv/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| [
2,
48443,
14490,
14,
1173,
9517,
78,
14,
20519,
354,
1670,
16775,
82,
14,
28241,
648,
3609,
12,
1416,
2001,
727,
14,
574,
85,
14,
8800,
14,
29412,
198,
6738,
42625,
14208,
13,
7295,
1330,
4542,
198,
198,
361,
11593,
3672,
834,
6624,... | 2.746032 | 63 |
"""Change setting.value data type
Revision ID: 1274ed462010
Revises: 59729e468045
Create Date: 2018-08-21 17:12:30.058782
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1274ed462010'
down_revision = '59729e468045'
branch_labels = None
depends_on = None
| [
37811,
19400,
4634,
13,
8367,
1366,
2099,
198,
198,
18009,
1166,
4522,
25,
1105,
4524,
276,
3510,
10333,
198,
18009,
2696,
25,
642,
5607,
1959,
68,
3510,
1795,
2231,
198,
16447,
7536,
25,
2864,
12,
2919,
12,
2481,
1596,
25,
1065,
25,
... | 2.677966 | 118 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
"""
==================================
Light Gradient Based Optimization
==================================
This module is dedicated to gradient based optimization schemes when
the gradient is expensive to compute. This means that the gradient
computation is avoided as much as possible.
S... | [
37811,
220,
198,
220,
220,
220,
46111,
28,
198,
220,
220,
220,
4401,
17701,
1153,
13403,
30011,
1634,
198,
220,
220,
220,
46111,
28,
628,
220,
220,
220,
770,
8265,
318,
7256,
284,
31312,
1912,
23989,
16546,
618,
198,
220,
220,
220,
... | 2.114847 | 8,298 |
import unittest
import copy
import gc
from rpy2 import rinterface
rinterface.initr()
if __name__ == '__main__':
tr = unittest.TextTestRunner(verbosity = 2)
tr.run(suite())
| [
11748,
555,
715,
395,
198,
11748,
4866,
198,
11748,
308,
66,
198,
6738,
374,
9078,
17,
1330,
374,
39994,
198,
198,
81,
39994,
13,
15003,
81,
3419,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
22... | 2.6 | 70 |
from functools import lru_cache
import logging
from PySide6.QtCore import Qt
from PySide6.QtWidgets import (
QVBoxLayout,
QComboBox,
QWidget,
QLabel,
)
from kamyroll_gui.data_types.stream_response import StreamResponse
from kamyroll_gui.settings import Settings
from ..utils import m3u8
from ..utils.... | [
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,
11748,
18931,
198,
198,
6738,
9485,
24819,
21,
13,
48,
83,
14055,
1330,
33734,
198,
198,
6738,
9485,
24819,
21,
13,
48,
83,
54,
312,
11407,
1330,
357,
198,
220,
220,
220,
1195,... | 2.751678 | 149 |
#string
s = "I am a string"
print(type(s)) #says string
#Boolean
yes = True
print(type(yes))
no = False
print(type(no))
#list -- ordered and changeable
alpha_list = ["a", "b", "c"] #list initialization
print(type(alpha_list)) #says tuple
print(type(alpha_list[0])) #says string
alp... | [
197,
197,
197,
197,
197,
197,
197,
197,
2,
8841,
198,
198,
82,
796,
366,
40,
716,
257,
4731,
1,
198,
4798,
7,
4906,
7,
82,
4008,
197,
197,
197,
197,
197,
2,
82,
592,
4731,
628,
197,
197,
197,
197,
197,
197,
197,
197,
2,
4612... | 2.352584 | 329 |
from flask_restful import Resource, reqparse
from flask_restful import abort
from aptlyweb.resources import pyptly_api
from flask_security import login_required
| [
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
43089,
29572,
198,
6738,
42903,
62,
2118,
913,
1330,
15614,
198,
6738,
47166,
12384,
13,
37540,
1330,
12972,
457,
306,
62,
15042,
198,
6738,
42903,
62,
12961,
1330,
17594,
62,
35827,
628,
198... | 3.97561 | 41 |
from new_movies.random_data_utility import random_generator
available_movies = random_generator.generate_random_movies(movies_number=15)
| [
6738,
649,
62,
76,
20526,
13,
25120,
62,
7890,
62,
315,
879,
1330,
4738,
62,
8612,
1352,
198,
198,
15182,
62,
76,
20526,
796,
4738,
62,
8612,
1352,
13,
8612,
378,
62,
25120,
62,
76,
20526,
7,
76,
20526,
62,
17618,
28,
1314,
8,
6... | 3.088889 | 45 |
"""
Utility functions for post-processing of data generated using the DBS-Pro pipeline
"""
###########
# FILTERS #
###########
import operator
import time
import pandas as pd
import numpy as np
from itertools import combinations
from umi_tools import UMIClusterer
from typing import Union
from scipy.stats.mstats import... | [
37811,
198,
18274,
879,
5499,
329,
1281,
12,
36948,
286,
1366,
7560,
1262,
262,
360,
4462,
12,
2964,
11523,
198,
37811,
198,
198,
7804,
21017,
198,
2,
34020,
51,
4877,
1303,
198,
7804,
21017,
198,
11748,
10088,
198,
11748,
640,
198,
1... | 2.539442 | 3,372 |
from flask import Flask, render_template, request
import csv
app = Flask(__name__)
@app.route("/")
@app.route("/register", methods=["POST"])
| [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
11748,
269,
21370,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
31,
1324,
13,
38629,
7203,
14,
4943,
198,
198,
31,
1324,
13,
38629,
7203,
14,
30238,
1600,
... | 2.88 | 50 |
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from mmgen.models.architectures.singan import (SinGANMSGeneratorPE,
SinGANMultiScaleDiscriminator,
SinGANMultiScaleGenerator)
| [
2,
15069,
357,
66,
8,
4946,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
11748,
12972,
9288,
198,
11748,
28034,
198,
198,
6738,
8085,
5235,
13,
27530,
13,
998,
5712,
942,
13,
12215,
272,
1330,
357,
46200,
45028,
5653,
8645,
1352,
... | 1.929032 | 155 |
"""
Helper functions for converting to and from tensor notation
"""
from __future__ import division
import itertools
import numpy as np
mandel = ((0,0),(1,1),(2,2),(1,2),(0,2),(0,1))
mandel_mults = (1,1,1,np.sqrt(2),np.sqrt(2),np.sqrt(2))
def make_M2T():
"""
Make the tensor that goes from rank 4 Mandel to ... | [
37811,
198,
220,
5053,
525,
5499,
329,
23202,
284,
290,
422,
11192,
273,
33274,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
340,
861,
10141,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
22249,
417,
... | 2.081101 | 1,381 |
from mltrace.db.models import (
IOPointer,
Component,
ComponentRun,
PointerTypeEnum,
Tag,
Label,
component_run_output_association,
deleted_labels,
output_table,
feedback_table,
)
from mltrace.db.store import Store
__all__ = [
"Component",
"ComponentRun",
"IOPointer",... | [
6738,
25962,
40546,
13,
9945,
13,
27530,
1330,
357,
198,
220,
220,
220,
314,
3185,
78,
3849,
11,
198,
220,
220,
220,
35100,
11,
198,
220,
220,
220,
35100,
10987,
11,
198,
220,
220,
220,
7695,
3849,
6030,
4834,
388,
11,
198,
220,
2... | 2.235 | 200 |
import os
import time
from selenium.webdriver.support.select import Select
from Data.parameters import Data
from get_dir import pwd
from reuse_func import GetData
| [
11748,
28686,
198,
11748,
640,
198,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
19738,
1330,
9683,
198,
198,
6738,
6060,
13,
17143,
7307,
1330,
6060,
198,
6738,
651,
62,
15908,
1330,
279,
16993,
198,
6738,
32349,
62,
... | 3.574468 | 47 |
# -*- coding: utf-8 -*-
"""
Project : PyCoA
Date : april 2020 - march 2021
Authors : Olivier Dadoun, Julien Browaeys, Tristan Beau
Copyright ©pycoa.fr
License: See joint LICENSE file
Module : coa.display
About :
-------
An interface module to easily plot pycoa data with bokeh
"""
from coa.tools import kwargs_t... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
16775,
1058,
9485,
7222,
32,
198,
10430,
1058,
220,
220,
220,
46593,
346,
12131,
532,
9960,
33448,
198,
30515,
669,
1058,
45674,
17415,
977,
11,
5979,
2... | 3.123772 | 509 |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import argparse
import torchvision
import torchvision.transforms as transforms
import os
parser = argparse.ArgumentParser(description="Train a child net using a theta file.")
parser.add... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
1891,
2412,
13,
66,
463,
20471,
355,
269,
463,
20471,
198,
11... | 2.66985 | 733 |
# Generated by Django 3.1.7 on 2021-02-24 15:11
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
2999,
12,
1731,
1315,
25,
1157,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import math
import os
import random
import zipfile
import cPickle as pickle
import numpy as np
from six.moves import urllib
from six.moves import xrange # pylint: disable
from scipy.sparse i... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
17268,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
1997... | 2.442396 | 1,085 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import six
import unittest
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
2237,
198,
1... | 3.933333 | 45 |
"""
Provides API for running commands.
"""
import datetime
from typing import Optional
from message_bot import bot, commands, models
#
# Command dispatcher
#
_all_command_classes = {
commands.foodbot.SUPER_COMMAND: commands.foodbot.commands
}
| [
37811,
198,
15946,
1460,
7824,
329,
2491,
9729,
13,
198,
37811,
198,
198,
11748,
4818,
8079,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
3275,
62,
13645,
1330,
10214,
11,
9729,
11,
4981,
628,
198,
198,
2,
198,
2,
9455,
49952,
198,
... | 3.227848 | 79 |
import re
from collections import defaultdict
int_re = re.compile(r'-?\d+')
opcodes = {
'addr': OpCodes.addr,
'addi': OpCodes.addi,
'mulr': OpCodes.mulr,
'muli': OpCodes.muli,
'banr': OpCodes.banr,
'bani': OpCodes.bani,
'borr': OpCodes.borr,
'bori': OpCodes.bori,
'setr': OpCodes.se... | [
11748,
302,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
600,
62,
260,
796,
302,
13,
5589,
576,
7,
81,
29001,
30,
59,
67,
10,
11537,
198,
198,
404,
40148,
796,
1391,
198,
220,
220,
220,
705,
29851,
10354,
8670,
34,
4147,
13,
298... | 1.845161 | 310 |
from logging import DEBUG, INFO
import logging
if __name__ == '__main__':
main()
| [
6738,
18931,
1330,
16959,
11,
24890,
198,
11748,
18931,
220,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.966667 | 30 |
import random
from typing import List, Dict
"""
This file can be a nice home for your move logic, and to write helper functions.
We have started this for you, with a function to help remove the 'neck' direction
from the list of possible moves!
"""
# board variables
debug = True
SPACE = 0
KILL_ZONE = 1
FOOD = 2
#MY_H... | [
11748,
4738,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
198,
198,
37811,
198,
1212,
2393,
460,
307,
257,
3621,
1363,
329,
534,
1445,
9156,
11,
290,
284,
3551,
31904,
5499,
13,
198,
198,
1135,
423,
2067,
428,
329,
345,
11,
351,
257,... | 2.728451 | 1,543 |
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import wget
import zipfile
import csv
local = 0
download = 0
arquitecture = 1
if download ==1:
wget.download("https://docs.google.com/uc?export=download&id=1KIVaoiAmXkuRSBusvfKfgYZxcXHhg6VP")
wget.download("https://docs.goog... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
9060,
355,
29034,
9600,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
266,
1136,
198,
11748,
19974,
7753,
198,
11748,
269,
21370,
198,
198,
12... | 2.282759 | 2,900 |
# Flask imports
from flask import Flask, render_template, redirect, url_for, request, flash, session
from flask_login import LoginManager, UserMixin, login_user, login_required
from werkzeug.security import generate_password_hash, check_password_hash
from flask_sqlalchemy import SQLAlchemy
import forms
import org... | [
2,
46947,
17944,
201,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
18941,
11,
19016,
62,
1640,
11,
2581,
11,
7644,
11,
6246,
201,
198,
6738,
42903,
62,
38235,
1330,
23093,
13511,
11,
11787,
35608,
259,
11,
17594,
62,
7220,
... | 2.532213 | 357 |
import torch
from torch.utils.data import Subset
from misc import google_cloud
import numpy as np
import math
import shutil
import os
| [
198,
11748,
28034,
198,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
3834,
2617,
198,
6738,
12747,
1330,
23645,
62,
17721,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
4423,
346,
198,
11748,
28686,
628,
628,
628,
2... | 3.244444 | 45 |
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
from mlos.Spaces import SimpleHypergrid, CategoricalDimension, DiscreteDimension, Point
smart_cache_workload_generator_config_space = SimpleHypergrid(
name='smart_cache_workload_generator_config',
dimensions=[
Categor... | [
2,
201,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
201,
198,
2,
49962,
739,
262,
17168,
13789,
13,
201,
198,
2,
201,
198,
6738,
25962,
418,
13,
4561,
2114,
1330,
17427,
38197,
25928,
11,
327,
2397,
12409,
29271,
3004,
11,
8444,
8... | 2.332026 | 765 |
# /mpcutilities/tests/test_kepcart.py
"""
# --------------------------------------------------------------
# Oct 2018
# Payne
#
# Test the kepcart conversion funcs that are in
# /mpcutilities/mpcutilities/kepcart.py
#
# Note that kepcart needs classes that are defined in
# /mpcutilities/mpcutilities/classes.py
# The... | [
2,
1220,
3149,
8968,
2410,
14,
41989,
14,
9288,
62,
365,
14751,
433,
13,
9078,
198,
198,
37811,
198,
2,
20368,
1783,
26171,
198,
2,
2556,
2864,
198,
2,
32788,
198,
2,
198,
2,
6208,
262,
885,
14751,
433,
11315,
1257,
6359,
326,
389... | 2.047863 | 7,208 |
from typing import Dict, Optional
import posthoganalytics
from rest_framework import response, status
class AnalyticsDestroyModelMixin:
"""
DestroyModelMixin enhancement that provides reporting of when an object is deleted.
Generally this would be better off executed at the serializer level,
but del... | [
6738,
19720,
1330,
360,
713,
11,
32233,
198,
198,
11748,
1281,
71,
9632,
3400,
14094,
198,
6738,
1334,
62,
30604,
1330,
2882,
11,
3722,
628,
198,
4871,
30437,
49174,
17633,
35608,
259,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220... | 3.761062 | 113 |
import datetime
# All logging handlers configurations.
# 'propagate': False = mean is the error logs ins't duplicates to another file logs.
NOW = datetime.datetime.now()
DAY_NAME = NOW.strftime('%A').lower()
MAXIMUM_FILE_LOGS = 1024 * 1024 * 10 # 10 MB
BACKUP_COUNT = 5
LOGGING = {
'version': 1,
'disable_e... | [
11748,
4818,
8079,
198,
198,
2,
1439,
18931,
32847,
25412,
13,
198,
2,
705,
22930,
37861,
10354,
10352,
796,
1612,
318,
262,
4049,
17259,
1035,
470,
14184,
16856,
284,
1194,
2393,
17259,
13,
198,
198,
45669,
796,
4818,
8079,
13,
19608,
... | 1.951724 | 1,015 |
from setuptools import setup
setup(name='get_attribute', packages=['get_attribute'])
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
1136,
62,
42348,
3256,
10392,
28,
17816,
1136,
62,
42348,
6,
12962,
198
] | 3.44 | 25 |
#!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from pathlib import Path
from linter import run_linters, RegexpLinter
linters = [
RegexpLinter(r'WARN\s+\(',
message='CPP macros should not have a spa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
317,
300,
3849,
284,
9828,
329,
24994,
17395,
34749,
543,
389,
11266,
422,
511,
4578,
198,
2,
1351,
416,
257,
2272,
11,
543,
1012,
648,
338,
327,
10246,
2318,
9501,
319,
... | 2.41908 | 587 |
peso = float(input('Qual é o seu Peso? Kg'))
altura = float(input('Qual é a sua Altura? m'))
imc = peso / (altura ** 2)
print('O seu Indice de massa muscular é {:.1f}'.format(imc))
if imc <= 18.5:
print('Você esta abaixo do Peso!')
elif imc <= 24.9:
print('Peso ideal. Parabéns!')
elif imc <= 29.9:
print('Le... | [
12272,
78,
796,
12178,
7,
15414,
10786,
46181,
38251,
267,
384,
84,
38434,
78,
30,
509,
70,
6,
4008,
198,
2501,
5330,
796,
12178,
7,
15414,
10786,
46181,
38251,
257,
424,
64,
12344,
5330,
30,
285,
6,
4008,
198,
320,
66,
796,
32317,
... | 2.112971 | 239 |
# -*- coding: utf-8 -*-
import urllib3, requests, re, time, random, sys, argparse, colorama, os, bs4, html5lib, tqdm, cloudscraper
from bs4 import BeautifulSoup
from pathlib import Path
from banner import banner
sys.stdout.write(banner())
email=input(" \033[1;96mUDEMY EMAIL : \033[1;93m")
password=input(" ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
2956,
297,
571,
18,
11,
7007,
11,
302,
11,
640,
11,
4738,
11,
25064,
11,
1822,
29572,
11,
3124,
1689,
11,
28686,
11,
275,
82,
19,
11,
27711,
20,
8019,
11,
2... | 2.580597 | 670 |
'''
Vortex OpenSplice
This software and documentation are Copyright 2006 to TO_YEAR ADLINK
Technology Limited, its affiliated companies and licensors. All rights
reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Lice... | [
7061,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49790,
4946,
26568,
501,
198,
198,
1212,
3788,
290,
10314,
389,
15069,
4793,
284,
5390,
62,
56,
17133,
5984,
43... | 3.741036 | 251 |
from pathlib import Path
import torch
from Pipeline.data_loader_mesh import DataLoaderMesh
from Pipeline.data_gather import get_filelist_within_folder_blacklisted
from Trainer.ModelTrainer import ModelTrainer
import socket
from Models.erfh5_MeshModel import SensorMeshToFlowFrontModel
from Trainer.evaluation import Mesh... | [
6738,
3108,
8019,
1330,
10644,
198,
11748,
28034,
198,
6738,
37709,
13,
7890,
62,
29356,
62,
76,
5069,
1330,
6060,
17401,
37031,
198,
6738,
37709,
13,
7890,
62,
70,
1032,
1330,
651,
62,
7753,
4868,
62,
33479,
62,
43551,
62,
13424,
179... | 2.269551 | 1,202 |
# Crawling spider to extract books' details
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
from ..items import PerformanceComparisonItem
# Selenium code to extract books' details
from selenium import webdriver
import json
import time
if __name__ == "__m... | [
2,
327,
18771,
19230,
284,
7925,
3835,
6,
3307,
198,
198,
11748,
15881,
88,
198,
6738,
15881,
88,
13,
2815,
365,
742,
974,
669,
1330,
7502,
11627,
40450,
198,
6738,
15881,
88,
13,
2777,
4157,
1330,
327,
13132,
41294,
11,
14330,
198,
... | 2.96648 | 179 |
"""
Number Names
- Show how to spell out a number in English.
You can use a preexisting implementation or roll your own, but you should
support inputs up to at least one million (or the maximum value of your
language's default bounded integer type, if that's less). Optional:
Support for inputs other than positive integ... | [
37811,
198,
15057,
28531,
198,
12,
5438,
703,
284,
4822,
503,
257,
1271,
287,
3594,
13,
198,
1639,
460,
779,
257,
47488,
87,
9665,
7822,
393,
4836,
534,
898,
11,
475,
345,
815,
198,
11284,
17311,
510,
284,
379,
1551,
530,
1510,
357,... | 2.658228 | 316 |