content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python3
from test_app import cache_pool
from sim.pretty import dictList2Table
if __name__ == "__main__":
test()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
201,
198,
6738,
1332,
62,
1324,
1330,
12940,
62,
7742,
201,
198,
201,
198,
6738,
985,
13,
37784,
1330,
8633,
8053,
17,
10962,
201,
198,
201,
198,
201,
198,
201,
198,
361,
... | 2.393443 | 61 |
# -*- coding: utf-8 -*-
"""Base Site class."""
from typing import ClassVar
from typing import Dict
from mrsimulator.utils.parseable import Parseable
from pydantic import validator
from .isotope import Isotope
from .tensors import AntisymmetricTensor
from .tensors import SymmetricTensor
__author__ = "Deepansh Srivast... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
14881,
14413,
1398,
526,
15931,
198,
6738,
19720,
1330,
5016,
19852,
198,
6738,
19720,
1330,
360,
713,
198,
198,
6738,
285,
3808,
320,
8927,
13,
26791,
13,
29572,
... | 2.338395 | 3,490 |
projects = {
'cmip6': {
'start_dir': '/badc/cmip6/data/cmip6',
'base': '/badc/cmip6/data',
'prefacets': 3,
'facets': 'badc cmip6 data mip_era activity_id institution_id source_id experiment_id member_id table_id variable_id grid_label version'.split(),
'facet_picks': {'ensemb... | [
42068,
796,
1391,
198,
220,
220,
220,
705,
11215,
541,
21,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
9688,
62,
15908,
10354,
31051,
14774,
66,
14,
11215,
541,
21,
14,
7890,
14,
11215,
541,
21,
3256,
198,
220,
220,
... | 2.122549 | 408 |
s = input()
answer = len(s)
k = s.count('a')
for i in range(len(s)):
cnt = 0
for j in range(k):
if s[(i+j)%len(s)] == 'b':
cnt+=1
if cnt < answer:
answer = cnt
print(answer) | [
82,
796,
5128,
3419,
198,
41484,
796,
18896,
7,
82,
8,
198,
74,
796,
264,
13,
9127,
10786,
64,
11537,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
82,
8,
2599,
198,
220,
220,
220,
269,
429,
796,
657,
198,
220,
220,
220,
329,
474,
... | 1.805085 | 118 |
# coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and sh... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
9986,
69,
1041,
7824,
628,
220,
220,
220,
22492,
28578,
770,
318,
257,
6291,
9986,
69,
1041,
4382,
543,
3578,
329,
8748,
1231,
597,
18239,
13,
383,
9986,
69,
104... | 2.881323 | 514 |
import sys
# sys.path.append(r"F:\Work\Maptor\venv\Model")
from ClassificationModel import ClassificationModel
| [
11748,
25064,
198,
2,
25064,
13,
6978,
13,
33295,
7,
81,
1,
37,
7479,
12468,
59,
44,
2373,
273,
59,
574,
85,
59,
17633,
4943,
198,
6738,
40984,
17633,
1330,
40984,
17633,
628
] | 3.393939 | 33 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/calculators/image/image_clone_calculator.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
16957,
499,
3757,
14,
9948,
3129,
2024,
14,
9060,
14,
9060,
62,
21018,
62,
9948,
3129,
1352,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
... | 2.571757 | 1,303 |
"""Abseil compiler options.
This is the source of truth for Abseil compiler options. To modify Abseil
compilation options:
(1) Edit the appropriate list in this file based on the platform the flag is
needed on.
(2) Run `<path_to_absl>/copts/generate_copts.py`.
The generated copts are consumed by configure... | [
37811,
4826,
325,
346,
17050,
3689,
13,
198,
198,
1212,
318,
262,
2723,
286,
3872,
329,
2275,
325,
346,
17050,
3689,
13,
220,
1675,
13096,
2275,
325,
346,
198,
5589,
10520,
3689,
25,
628,
220,
357,
16,
8,
5312,
262,
5035,
1351,
287,... | 2.164384 | 2,555 |
import kerastuner
from autokeras.engine import tuner as tuner_module
class Hyperband(tuner_module.AutoTuner, kerastuner.Hyperband):
"""KerasTuner Hyperband with preprocessing layer tuning."""
pass
| [
11748,
41927,
459,
38886,
198,
198,
6738,
1960,
11020,
292,
13,
18392,
1330,
6278,
263,
355,
6278,
263,
62,
21412,
628,
198,
4871,
15079,
3903,
7,
28286,
263,
62,
21412,
13,
27722,
51,
38886,
11,
41927,
459,
38886,
13,
38197,
3903,
25... | 3.104478 | 67 |
# Copyright (c) 2017 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE
"""
CLI program for managing packages
"""
import sys
from os.path import basename, dirname, exists, splitext
from pathlib import Path
import requests
from metapack import Downloa... | [
2,
15069,
357,
66,
8,
2177,
31593,
20414,
13,
770,
2393,
318,
11971,
739,
262,
2846,
286,
262,
198,
2,
17168,
13789,
11,
3017,
287,
428,
6082,
355,
38559,
24290,
198,
198,
37811,
198,
5097,
40,
1430,
329,
11149,
10392,
198,
37811,
1... | 3.077982 | 218 |
#!/usr/bin/env python
#
# MIT License
#
# (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
#
# 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 wi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
17168,
13789,
198,
2,
198,
2,
357,
34,
8,
15069,
12131,
12,
1238,
1828,
30446,
15503,
6400,
446,
14973,
7712,
18470,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
14... | 2.451166 | 7,290 |
import nuke
| [
11748,
299,
4649,
198
] | 3 | 4 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 Christopher C. Strelioff <chris.strelioff@gmail.com>
#
# Distributed under terms of the MIT license.
"""
consumer_key.py
=================
A Python 3 example of using the discogs-client with a consumer key and secret.
"""
import disc... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43907,
25,
69,
12685,
28,
40477,
12,
23,
198,
2,
198,
2,
15069,
10673,
1853,
12803,
327,
13,
520,
2411,
952,
... | 2.597278 | 1,249 |
def factorial(n):
"""
В единственной строке дано число n (2 ≤ n ≤ 109),
которое нужно факторизовать.
Выведите в порядке неубывания простые множители,
на которые раскладывается число n.
"""
prime = []
x = 2
while x * x <= n:
if n % x == 0:
prime.append(x)
... | [
4299,
1109,
5132,
7,
77,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12466,
240,
12466,
113,
43666,
18849,
22177,
21727,
20375,
38857,
16843,
22177,
22177,
25443,
117,
220,
21727,
20375,
21169,
25443,
118,
16843,
12466,
112,
1614... | 1.379603 | 353 |
import web
import socketserver
PORT = 8000
Handler = web.testHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
print("serving at port", PORT)
httpd.serve_forever()
socketserver.TCPServer.allow_resue_address=True
| [
11748,
3992,
198,
11748,
37037,
18497,
198,
15490,
796,
38055,
198,
25060,
796,
3992,
13,
9288,
40717,
18453,
25060,
198,
4023,
67,
796,
37037,
18497,
13,
4825,
3705,
18497,
7,
7203,
1600,
350,
9863,
828,
32412,
8,
198,
4798,
7203,
3129... | 3.106667 | 75 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
| [
6738,
220,
844,
27349,
62,
2118,
9078,
13,
8692,
1330,
7308,
198,
6738,
220,
844,
27349,
62,
2118,
9078,
13,
16624,
1330,
13283,
628
] | 3.375 | 24 |
import os
import numpy as np
import gym
from shadowhand_gym.pybullet import PyBullet
from gym import utils, spaces
from typing import List, Optional, Tuple, Union
from abc import ABC
def get_data_path() -> str:
"""Return the absolute data path.
Returns:
str: Absolute data path.
"""
data_pat... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11550,
198,
198,
6738,
9082,
4993,
62,
1360,
76,
13,
9078,
15065,
1616,
1330,
9485,
33481,
1616,
198,
198,
6738,
11550,
1330,
3384,
4487,
11,
9029,
198,
6738,
19720,
1330,
73... | 2.716327 | 490 |
import search
import string
from math import(cos, pi)
# A sample map problem
# sumner_map = search.UndirectedGraph(dict(
# Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18),
# Cottontown=dict(Portland=18),
# Fairfield=dict(Mitchellville=21, Portland=17),
# Mitchellville=dict(Portland=7, Fairfield... | [
11748,
2989,
198,
11748,
4731,
198,
6738,
10688,
1330,
7,
6966,
11,
31028,
8,
198,
198,
2,
317,
6291,
3975,
1917,
198,
2,
2160,
1008,
62,
8899,
796,
2989,
13,
31319,
1060,
276,
37065,
7,
11600,
7,
198,
2,
220,
220,
220,
10727,
28,... | 2.300403 | 1,984 |
import numpy as np
def get_confusion(ids1, ids2):
"""Get confusion matrix
Parameters
----------
ids1: numpy.array or list
id list in the first annotation
ids2: numpy.array or list
id list in the second annotation
Return
------
(confuse_mat, ids1_uniq, ids2_... | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
651,
62,
10414,
4241,
7,
2340,
16,
11,
220,
2340,
17,
2599,
198,
220,
220,
220,
37227,
3855,
10802,
17593,
198,
220,
220,
220,
220,
198,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,... | 1.97807 | 456 |
from replit import clear
import os
import pyfiglet
from art import logo,item,text
os.system('clear')
print(text)
print("\n")
print(logo)
print("\n")
print(" The Item Up For Auctions Is :")
print(item)
print("\n")
print("Welcome to the secret auction program.")
bids = {}
add_to_dict()
print("The highest bi... | [
6738,
2186,
270,
1330,
1598,
198,
11748,
28686,
198,
11748,
12972,
5647,
1616,
198,
6738,
1242,
1330,
11112,
11,
9186,
11,
5239,
198,
418,
13,
10057,
10786,
20063,
11537,
198,
4798,
7,
5239,
8,
198,
4798,
7203,
59,
77,
4943,
198,
4798... | 2.533333 | 270 |
import re
from collections import defaultdict
from typing import Literal, Union
from timefred import color as c
from timefred.error import EmptySheet, NoActivities
from timefred.store import store, Entry, Activity
from timefred.time.timeutils import arrows2rel_time
from timefred.time.xarrow import XArrow
# @break_on... | [
11748,
302,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
25659,
1691,
11,
4479,
198,
198,
6738,
640,
39193,
1330,
3124,
355,
269,
198,
6738,
640,
39193,
13,
18224,
1330,
33523,
3347,
316,
11,
1400,
25526,
871,
198,
6738,... | 3.681818 | 88 |
"""
Copyright (c) 2014 Dan Obermiller
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 without limitation the rights
to use, copy, modify, merge, publish, distribute,... | [
37811,
198,
15269,
357,
66,
8,
1946,
6035,
33753,
76,
4665,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,... | 3.383858 | 508 |
import gym
import torch
import json
import os
import yaml
import numpy as np
from tqdm import trange
import maml_rl.envs
from maml_rl.metalearners import MAMLTRPO
from maml_rl.baseline import LinearFeatureBaseline
from maml_rl.samplers import CurriculumTaskSampler
from maml_rl.utils.helpers import get_policy_for_env, ... | [
11748,
11550,
198,
11748,
28034,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
491,
858,
198,
198,
11748,
285,
43695,
62,
45895,
13,
268,
14259,
198,
6... | 2.412863 | 964 |
import os
import sublime
import subprocess
import re
| [
11748,
28686,
198,
11748,
41674,
198,
11748,
850,
14681,
198,
11748,
302,
198
] | 4.076923 | 13 |
""" A detector model which wraps around a feature extraction backbone, fpn, and RetinaNet
head.This allows for easy interchangeability during experimentation and a reliable way to
load saved models. """
import collections
import dataclasses
from typing import List
import yaml
import torch
import torchvision
from core... | [
37811,
317,
31029,
2746,
543,
27521,
1088,
257,
3895,
22236,
32774,
11,
277,
21999,
11,
290,
4990,
1437,
7934,
198,
2256,
13,
1212,
3578,
329,
2562,
26478,
1799,
1141,
29315,
290,
257,
9314,
835,
284,
198,
2220,
7448,
4981,
13,
37227,
... | 2.58457 | 337 |
"""Package for verifying the robustness of decision trees and their ensembles."""
| [
37811,
27813,
329,
45505,
262,
12373,
1108,
286,
2551,
7150,
290,
511,
551,
4428,
829,
526,
15931,
198
] | 4.555556 | 18 |
import os
import sys
import qdarkstyle
import darkdetect
from PyQt5 import QtWidgets, QtCore, QtGui
from app.gui.consolepanel import MainConsolePanel
from app.gui.histogrampanel import HistogramPanel
from app.gui.plottingpanel import PlottingPanel
from app.resources import resources
from app.gui.fittingpanel import F... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
10662,
21953,
7635,
198,
11748,
3223,
15255,
478,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
54,
312,
11407,
11,
33734,
14055,
11,
33734,
8205,
72,
198,
198,
6738,
598,
13,
48317,
13,
4... | 2.373169 | 1,297 |
import pytest
import sys
from os.path import dirname as d
from os.path import abspath, join
root_dir = d(d(abspath(__file__)))
sys.path.append(root_dir)
from app import create_app
@pytest.fixture
| [
11748,
12972,
9288,
198,
11748,
25064,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
355,
288,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
4654,
198,
15763,
62,
15908,
796,
288,
7,
67,
7,
397,
2777,
776,
7,
834,
7753,
834,
22... | 2.814286 | 70 |
from environments.dynamodb.migrator import IdentityMigrator
from projects.serializers import ProjectSerializer
| [
6738,
12493,
13,
67,
4989,
375,
65,
13,
76,
3692,
1352,
1330,
27207,
44,
3692,
1352,
198,
6738,
4493,
13,
46911,
11341,
1330,
4935,
32634,
7509,
628,
198
] | 4.035714 | 28 |
from .book import Book
from .chapter import Chapter
from .alpha_book import AlphabeticalBook | [
6738,
764,
2070,
1330,
4897,
198,
6738,
764,
43582,
1330,
7006,
198,
6738,
764,
26591,
62,
2070,
1330,
45695,
605,
10482
] | 4.380952 | 21 |
from itertools import compress
"""
This doesn't really seem all that useful.
"""
addresses = [
"5142 N CLARK",
"5148 N CLARK",
"5800 E 58TH",
"2122 N CLARK",
"5645 N RAVENSWOOD",
"1060 W ADDISON",
"4801 N BROADWAY",
"1039 W GRAINVILLE",
]
counts = [0, 3, 10, 4, 1, 7, 6, 1]
more5 = [n... | [
6738,
340,
861,
10141,
1330,
27413,
198,
198,
37811,
198,
1212,
1595,
470,
1107,
1283,
477,
326,
4465,
13,
198,
37811,
198,
198,
2860,
16746,
796,
685,
198,
220,
220,
220,
366,
20,
23726,
399,
7852,
14175,
1600,
198,
220,
220,
220,
... | 2.177143 | 175 |
import torch
from mmdet.core import bbox2result, bbox_mapping_back
from ..builder import DETECTORS
from .single_stage import SingleStageDetector
from .two_stage import TwoStageDetector
from ..losses import CtdetLoss
from .ctdet_decetor import ctdet_decode, post_process, merge_outputs
@DETECTORS.register_module() | [
11748,
28034,
198,
198,
6738,
8085,
15255,
13,
7295,
1330,
275,
3524,
17,
20274,
11,
275,
3524,
62,
76,
5912,
62,
1891,
198,
6738,
11485,
38272,
1330,
38267,
9782,
20673,
198,
6738,
764,
29762,
62,
14247,
1330,
14206,
29391,
11242,
9250... | 3.138614 | 101 |
# © Port Scanner- Made by Yuval Simon. For bogan.cool
import socket, subprocess, sys, time, os, threading
from colorama import Fore
| [
2,
10673,
4347,
20937,
1008,
12,
14446,
416,
10605,
2100,
11288,
13,
1114,
275,
9632,
13,
24494,
198,
198,
11748,
17802,
11,
850,
14681,
11,
25064,
11,
640,
11,
28686,
11,
4704,
278,
198,
6738,
3124,
1689,
1330,
4558,
628,
198
] | 3.292683 | 41 |
from spacy.lang.en import English
from spacy.tokens import Token
nlp = English()
# Registra la extensión de atributo del Token, "is_country", con el valor por defecto False
Token.set_extension("is_country", default=False)
# Procesa el texto y pon True para el atributo "is_country" para el token "Spain"
doc = nlp("I ... | [
6738,
599,
1590,
13,
17204,
13,
268,
1330,
3594,
198,
6738,
599,
1590,
13,
83,
482,
641,
1330,
29130,
198,
198,
21283,
79,
796,
3594,
3419,
198,
198,
2,
13811,
430,
8591,
1070,
641,
72,
18840,
390,
379,
2455,
78,
1619,
29130,
11,
... | 2.988372 | 172 |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
33160,
1058,
33,
6532,
12,
22405,
12,
12041,
25,
19935,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
4943,
198,
2,
345,
743,... | 2.780804 | 771 |
# encoding: utf-8
##################################################
# This script shows an example of comparison operators.
# First, it shows different options to create functions used to simplify your code.
# These functions are used as other functions embedded in python.
#
##########################################... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
29113,
14468,
2235,
198,
2,
770,
4226,
2523,
281,
1672,
286,
7208,
12879,
13,
198,
2,
3274,
11,
340,
2523,
1180,
3689,
284,
2251,
5499,
973,
284,
30276,
534,
2438,
13,
198,
2,
2312,
5499,
... | 3.906393 | 438 |
import time
needhelp = None
while needhelp not in ['需要', '不需要']:
needhelp = input('小精灵:您好,欢迎来到古灵阁,请问您需要帮助吗?需要or不需要?')
if needhelp == '需要':
anyhelp = None
while anyhelp not in ['1', '2', '3']:
anyhelp = input('小精灵:请问您需要什么帮助呢?1 存取款;2 货币兑换;3 咨询')
if anyhelp == '1':
... | [
11748,
640,
201,
198,
31227,
16794,
796,
6045,
201,
198,
4514,
761,
16794,
407,
287,
37250,
165,
250,
222,
17358,
223,
3256,
705,
38834,
165,
250,
222,
17358,
223,
6,
5974,
201,
198,
220,
220,
220,
761,
16794,
796,
5128,
10786,
22887,... | 0.983437 | 966 |
# Generated by Django 3.0.4 on 2020-04-19 04:53
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
19,
319,
12131,
12,
3023,
12,
1129,
8702,
25,
4310,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import io
import json
import os
import torch
from torchvision import datasets, transforms
import numpy as np
from PIL import Image
def process_image(image_path):
"""
Scales, crops, and normalizes a PIL image for a PyTorch model
:param image_path: Path to the image
:return: returns an Numpy array
... | [
11748,
33245,
198,
11748,
33918,
198,
11748,
28686,
198,
198,
11748,
28034,
198,
6738,
28034,
10178,
1330,
40522,
11,
31408,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
628,
198,
198,
4299,
1429,
62,
9060,
7,
9... | 2.620513 | 390 |
import MainAnalysis as ma
import ExpFile as exp
import MatplotlibPlotters as mp
import numpy as np
exp.setPath('23','June','2021')
ee = exp.ExpFile(25)
key, rawData, dataMinusBg, dataMinusAvg, avgPic,\
pictureFitParams, pictureFitErrors, plottedData,\
v_params, v_errs, h_params, h_errs, intRawData = \
ma.standardImage... | [
11748,
8774,
32750,
355,
17266,
198,
11748,
5518,
8979,
355,
1033,
198,
11748,
6550,
29487,
8019,
43328,
1010,
355,
29034,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11201,
13,
2617,
15235,
10786,
1954,
41707,
15749,
41707,
1238,
2481,
... | 2.347107 | 242 |
from sqlalchemy.sql import func
from project import db
class ImageTile(db.Model):
"""Describes the image tile database table and allows querying for image tile information"""
__tablename__ = 'tiles'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
z_coord = db.Column(db.Integer, nul... | [
198,
6738,
44161,
282,
26599,
13,
25410,
1330,
25439,
198,
6738,
1628,
1330,
20613,
628,
198,
198,
4871,
7412,
35103,
7,
9945,
13,
17633,
2599,
198,
220,
220,
220,
37227,
24564,
22090,
262,
2939,
17763,
6831,
3084,
290,
3578,
42517,
111... | 2.264706 | 544 |
import os
from django.contrib.messages import constants as messages
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
STATIC_DIR = os.path.join(BASE_DIR, 'static')
if not os.path.exists(STATIC_DIR):
os.makedirs(STATIC_DIR)
MEDIA_DIR = os.path.join(BASE_DIR, 'media')
if not o... | [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
37348,
1095,
1330,
38491,
355,
6218,
198,
198,
33,
11159,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
1590... | 2.178043 | 2,095 |
length_of_cake = int(input())
width_of_cake = int(input())
total_size = length_of_cake * width_of_cake
pieces_taken = ''
pieces_needed = 0
pieces_taken_int = 0
total_taken = 0
pieces_left = 0
while total_size > pieces_taken_int:
pieces_taken = input()
if pieces_taken == 'STOP':
pieces_left = total_s... | [
13664,
62,
1659,
62,
30560,
796,
493,
7,
15414,
28955,
198,
10394,
62,
1659,
62,
30560,
796,
493,
7,
15414,
28955,
198,
198,
23350,
62,
7857,
796,
4129,
62,
1659,
62,
30560,
1635,
9647,
62,
1659,
62,
30560,
198,
34154,
62,
83,
1685,... | 2.42963 | 270 |
import populationUtils
import datautils
# values for change
populationNum = 50
geneNumber = 60
index = 10 # How many full runs for the average
crossover_rate = 0.7 # Starting rates
mutation_rate = 0.9
# Values for holding population info
current_population = []
new_population = []
old_fitness = 0
new_fitness = 0
... | [
11748,
3265,
18274,
4487,
198,
11748,
1366,
26791,
198,
198,
2,
3815,
329,
1487,
198,
39748,
33111,
796,
2026,
198,
70,
1734,
15057,
796,
3126,
198,
9630,
796,
838,
220,
1303,
1374,
867,
1336,
4539,
329,
262,
2811,
198,
198,
66,
23954... | 2.941935 | 155 |
# basicpackage/foo.py
a = 10
print("inside 'basicpackage/foo.py' with a variable in it")
| [
2,
4096,
26495,
14,
21943,
13,
9078,
198,
198,
64,
796,
838,
198,
198,
4798,
7203,
48787,
705,
35487,
26495,
14,
21943,
13,
9078,
6,
351,
257,
7885,
287,
340,
4943,
628
] | 2.875 | 32 |
import numpy as np
from skimage.color import rgb2gray
| [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
1341,
9060,
13,
8043,
1330,
46140,
17,
44605,
201,
198,
201
] | 3 | 19 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2... | 3.068692 | 1,514 |
# Generated by Django 2.1.4 on 2018-12-06 19:53
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
19,
319,
2864,
12,
1065,
12,
3312,
678,
25,
4310,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# coding=utf-8
import sys
import Leap
import time
import pandas as pd
import glob
data = [[] for _ in range(51)] # 12这个数字可以改,表示有几个参数
init_time = time.time()
if __name__ == "__main__":
# main()
for i in data:
print
df = pd.DataFrame(data=data)
df = df.transpose()
df.to_csv("./CSV_1/%s.... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
25064,
198,
11748,
33927,
198,
11748,
640,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
15095,
198,
198,
7890,
796,
16410,
60,
329,
4808,
287,
2837,
7,
4349,
15437,
220,
1303,
1105,
32573,... | 1.9 | 320 |
"""
This module handles player movement and state for task 4.1 from Coding Campus 2018 Python course
(Dungeon Game)
"""
import random
import logging
import threading
from copy import copy
from dungeon_game.dungeon_map import DungeonMap
import dungeon_game.utils as utils
import dungeon_game.log as log
impor... | [
37811,
201,
198,
1212,
8265,
17105,
2137,
3356,
290,
1181,
329,
4876,
604,
13,
16,
422,
327,
7656,
25005,
2864,
11361,
1781,
201,
198,
7,
30128,
6281,
3776,
8,
201,
198,
37811,
201,
198,
201,
198,
11748,
4738,
201,
198,
11748,
18931,
... | 3.22449 | 147 |
import dask
import numpy as np
import pytest
import xarray as xr
from vcm.cubedsphere.regridz import (
_mask_weights,
regrid_vertical,
)
@pytest.mark.parametrize(
[
"p_in_shape",
"p_in_chunks",
"f_in_shape",
"f_in_chunks",
"p_out_shape",
"p_out_chunks",
... | [
11748,
288,
2093,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
2124,
18747,
355,
2124,
81,
198,
6738,
410,
11215,
13,
66,
549,
276,
2777,
1456,
13,
260,
25928,
89,
1330,
357,
198,
220,
220,
220,
4808,
27932... | 1.683186 | 565 |
# ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... | [
2,
16529,
10541,
198,
2,
532,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4946,
18,
35,
25,
7324,
13,
9654,
18,
67,
13,
2398,
220,
220,
220,
220,
220,
220,... | 3.78553 | 387 |
from datetime import date, datetime
from typing import Any, Callable, Mapping
import pytz
_SENTINEL = object()
| [
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
337,
5912,
198,
198,
11748,
12972,
22877,
198,
198,
62,
50,
3525,
1268,
3698,
796,
2134,
3419,
628,
198
] | 3.194444 | 36 |
from django.contrib import admin
from .models import Wish
admin.site.register(Wish)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
23447,
628,
198,
28482,
13,
15654,
13,
30238,
7,
54,
680,
8,
198
] | 3.222222 | 27 |
from faf_lua_editor import FAFLuaEditor
import os
if __name__ == "__main__":
# rootdirs = ["../FAForever_GitHub/units"]
# rootdirs = ["../FAForever_GitHub/projectiles"]
rootdirs = ["../FAForever_GitHub/units", "../FAForever_GitHub/projectiles"]
filepaths = []
for rootdir in rootdirs:
for su... | [
6738,
277,
1878,
62,
40211,
62,
35352,
1330,
9677,
3697,
6413,
17171,
198,
11748,
28686,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1303,
6808,
15908,
82,
796,
14631,
40720,
7708,
16351,
332,
... | 2.299569 | 1,392 |
''' This module defines the class UpdateNodesName. UpdateNodesName class is designed
to retrieve the node name and update the name on the Graphic model object.
The available methods include:
* update_protein_names
Description: retrieve names from Uniprot and update protein nodes
How to run this module
... | [
7061,
6,
770,
8265,
15738,
262,
1398,
10133,
45,
4147,
5376,
13,
10133,
45,
4147,
5376,
1398,
318,
3562,
198,
1462,
19818,
262,
10139,
1438,
290,
4296,
262,
1438,
319,
262,
43029,
2746,
2134,
13,
198,
464,
1695,
5050,
2291,
25,
198,
... | 2.394495 | 1,635 |
########
# Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | [
7804,
198,
2,
15069,
357,
66,
8,
1584,
402,
13827,
4561,
2114,
21852,
12052,
13,
1439,
2489,
10395,
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,
4... | 3.647059 | 187 |
from __future__ import absolute_import
from weblib.logs import default_logging # noqa
from grab.error import (GrabError, DataNotFound, GrabNetworkError, # noqa
GrabMisuseError, GrabTimeoutError)
from grab.upload import UploadContent, UploadFile # noqa
from grab.base import Grab # noqa
__v... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
356,
2436,
571,
13,
6404,
82,
1330,
4277,
62,
6404,
2667,
220,
1303,
645,
20402,
198,
198,
6738,
5552,
13,
18224,
1330,
357,
48400,
12331,
11,
6060,
3673,
21077,
11,
2533... | 2.783217 | 143 |
import logging
import logging.config
import multiprocessing
import os
import queue
import sqlite3
import sys
import threading
import webbrowser
import winsound
from configparser import ConfigParser
from datetime import datetime
from tkinter import Image
import cv2
import dlib
import numpy
import telegram
from PyQt5.Qt... | [
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
18540,
305,
919,
278,
198,
11748,
28686,
198,
11748,
16834,
198,
11748,
44161,
578,
18,
198,
11748,
25064,
198,
11748,
4704,
278,
198,
11748,
3992,
40259,
198,
11748,
7864,
633,
198,... | 1.562147 | 708 |
import turtle
from time import sleep
fps = 30
gravity = 10/fps
force = 5
screen = turtle.Screen()
turs = [turtle.Turtle(), turtle.Turtle()]
screen.tracer(0)
turs[0].color('black', 'red')
for tur in turs:
tur.pensize(2)
tur.hideturtle()
turs[0].goto(-150,150)
turs[1].goto(-150,160)
turs[1].clear()
for x in ... | [
11748,
28699,
198,
6738,
640,
1330,
3993,
198,
198,
29647,
796,
1542,
198,
46453,
796,
838,
14,
29647,
198,
3174,
796,
642,
198,
198,
9612,
796,
28699,
13,
23901,
3419,
198,
83,
1834,
796,
685,
83,
17964,
13,
51,
17964,
22784,
28699,
... | 2.17037 | 270 |
import requests
import random
from html import unescape
from botcommands.get_members import get_members
def get_chuck(name=None, channel_members=None):
"""{'owners': [{'uid': 'f4089cdf5fc8ebe433d5b9f49b66d619', 'username': 'pastorhudson', 'fullName': 'Ron Hudson'}],
'admins': [], 'writers': [{'uid': '7d368e... | [
11748,
7007,
198,
11748,
4738,
198,
6738,
27711,
1330,
555,
41915,
198,
6738,
10214,
9503,
1746,
13,
1136,
62,
30814,
1330,
651,
62,
30814,
628,
198,
198,
4299,
651,
62,
354,
1347,
7,
3672,
28,
14202,
11,
6518,
62,
30814,
28,
14202,
... | 2.19891 | 734 |
"""keywords command for osxphotos CLI"""
import json
import click
import yaml
import osxphotos
from .common import DB_ARGUMENT, DB_OPTION, JSON_OPTION, get_photos_db
from .list import _list_libraries
@click.command()
@DB_OPTION
@JSON_OPTION
@DB_ARGUMENT
@click.pass_obj
@click.pass_context
def keywords(ctx, cli_ob... | [
37811,
2539,
10879,
3141,
329,
28686,
87,
24729,
43749,
37811,
198,
198,
11748,
33918,
198,
198,
11748,
3904,
198,
11748,
331,
43695,
198,
198,
11748,
28686,
87,
24729,
198,
198,
6738,
764,
11321,
1330,
20137,
62,
1503,
38,
5883,
3525,
... | 2.553191 | 423 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017, 2021 by Brendt Wohlberg <brendt@ieee.org>
# All rights reserved. BSD 3-clause License.
# This file is part of the SPORCO-CUDA package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
2177,
11,
33448,
416,
19252,
83,
370,
48988,
3900,
1279,
4679,
358,
83,
31,
494,
1453,
13,
23... | 2.411444 | 367 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import numpy as np
from typing import Any, List, Tuple, Union
import torch
from detectron2.layers import interpolate
class Keypoints:
"""
Stores keypoint annotation data. GT Instances have a `gt_keypoints` property
containi... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
19720,
1330,
4377,
11,
7343,
11,
309,
29291,
11,
4479,
201,
198,
11748,
28034,
201,
198,
201,... | 2.292384 | 3,427 |
# pylint: disable=C0103,R0912
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the foll... | [
2,
279,
2645,
600,
25,
15560,
28,
34,
486,
3070,
11,
49,
2931,
1065,
201,
198,
2,
720,
35063,
3,
220,
201,
198,
2,
720,
30515,
669,
3,
201,
198,
2,
4586,
32068,
25,
720,
10430,
3,
720,
6935,
1967,
3,
720,
18009,
1166,
12,
7390... | 2.244742 | 2,615 |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from textless.data.cpc_feature_reader import CpcFeatureReader
from textless.data.hubert_feature_reader import HubertFeatureReader
from textless... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
17168,
5964,
1043,
287,
262,
198,
2,
38559,
24290,
2393,
287,
262,
6808,
8619,
286,
428,
2723,
5509,
13,
198,
198,
... | 2.978166 | 229 |
import dask.array
import h5py
import logging
import math
import numpy as np
import os
import pickle
from pytorch_pretrained_bert import BertTokenizer, BertModel
import random
import subprocess
import torch
import urllib
nonbreaking_url = (
'https://raw.githubusercontent.com/moses-smt/mosesdecoder'
'/ef028446f... | [
11748,
288,
2093,
13,
18747,
198,
11748,
289,
20,
9078,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
12972,
13165,
354,
62,
5310,
13363,
62,
4835,
1330,
2... | 2.007766 | 15,194 |
__author__ = 'argi'
import cv2
import numpy as np
| [
834,
9800,
834,
796,
705,
853,
72,
6,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
628
] | 2.47619 | 21 |
# coding: u8
from tornado.util import ObjectDict
from sqlalchemy import create_engine
from sqlalchemy import (Column, Integer, Text, String, Boolean)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm.attributes import InstrumentedAttribute
import sett... | [
2,
19617,
25,
334,
23,
198,
198,
6738,
33718,
13,
22602,
1330,
9515,
35,
713,
198,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738,
44161,
282,
26599,
1330,
357,
39470,
11,
34142,
11,
8255,
11,
10903,
11,
41146,
8,
19... | 2.809859 | 284 |
from file import File
exemple()
| [
6738,
2393,
1330,
9220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
1069,
368,
1154,
3419,
198,
220,
220
] | 1.846154 | 26 |
from django.shortcuts import render
from django.http import HttpResponse
# todolist/Homepage View
# Contact Page View
# About us Page View
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
198,
2,
284,
67,
349,
396,
14,
16060,
7700,
3582,
198,
198,
2,
14039,
7873,
3582,
198,
198,
2,
7994,
514,
7873,
3582,
... | 3.25 | 44 |
# -*- coding: utf-8 -*-
"""
We are creating a DEM contour of 25m from a provided file.
The folder paths have been change to empty quotes for privacy and flexibility.
@author: dknight2
"""
# Importing the proper modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Allow overwriting the ou... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
1135,
389,
4441,
257,
40101,
542,
454,
286,
1679,
76,
422,
257,
2810,
2393,
13,
201,
198,
464,
9483,
13532,
423,
587,
1487,
284,
6565,
13386,
329... | 2.806452 | 434 |
fig, ax = plt.subplots(figsize=(10,6))
gr1 = sns.lineplot(data=log_returns)
display(gr1)
%fs ls "/FileStore/"
%fs rm -r "/FileStore/import-stage"
#Create image and save to blob
plt.subplots(figsize=(10,6))
sns.lineplot(data=log_returns)
plt.savefig('/dbfs/FileStore/import-stage/gr2.png')
dbutils.fs.cp('d... | [
5647,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
7,
5647,
7857,
16193,
940,
11,
21,
4008,
201,
198,
2164,
16,
796,
3013,
82,
13,
1370,
29487,
7,
7890,
28,
6404,
62,
7783,
82,
8,
201,
198,
13812,
7,
2164,
16,
8,
201,
198,
201... | 2.189189 | 185 |
"""Functions shared between air and ground runtimes"""
import logging
import math
import struct
import time
from queue import Queue
from threading import Thread
from typing import Tuple
import pynmea2
from whitevest.lib.atomic_buffer import AtomicBuffer
from whitevest.lib.atomic_value import AtomicValue
from whiteves... | [
37811,
24629,
2733,
4888,
1022,
1633,
290,
2323,
1057,
22355,
37811,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
2878,
198,
11748,
640,
198,
6738,
16834,
1330,
4670,
518,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
19720,
1330,
30... | 2.286093 | 2,265 |
__version_tuple__ = (4, 3, 0, 'post.1')
__version__ = '4.3.0-post.1'
| [
834,
9641,
62,
83,
29291,
834,
796,
357,
19,
11,
513,
11,
657,
11,
705,
7353,
13,
16,
11537,
198,
834,
9641,
834,
796,
705,
19,
13,
18,
13,
15,
12,
7353,
13,
16,
6,
198
] | 1.916667 | 36 |
import re
cache_regex = re.compile(r"^v[\w-]+m[0-9a-fA-F]+$")
| [
11748,
302,
198,
198,
23870,
62,
260,
25636,
796,
302,
13,
5589,
576,
7,
81,
1,
61,
85,
58,
59,
86,
12,
48688,
76,
58,
15,
12,
24,
64,
12,
69,
32,
12,
37,
48688,
3,
4943,
628,
198
] | 1.666667 | 39 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: bin2csv.py
# Project: Sonstige_Uebungen
#-----
# Created Date: Sunday 09.02.2020, 16:47
# Author: Apop85
#-----
# Last Modified: Sunday 09.02.2020, 16:48
#-----
# Copyright (c) 2020 Apop85
# This software is published under the MIT license.
# Check http://w... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
2,
220,
198,
4242,
198,
2,
9220,
25,
9874,
17,
40664,
13,
9078,
198,
2,
4935,
25,
6295,
301,
10045,
62,
52,
... | 2.501946 | 257 |
import math
import sys
import os
import requests
from requests_toolbelt.multipart.encoder import (
MultipartEncoder,
MultipartEncoderMonitor,
)
import hashlib
import zipfile
from . import exceptions
import json
import pkg_resources
from urllib.error import HTTPError
import types
class PathBuilder(object):
... | [
11748,
10688,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
7007,
198,
6738,
7007,
62,
25981,
37976,
13,
16680,
541,
433,
13,
12685,
12342,
1330,
357,
198,
220,
220,
220,
7854,
541,
433,
27195,
12342,
11,
198,
220,
220,
220,
7854,
... | 2.40607 | 1,911 |
import inspect
import copy
from aorist import *
from aorist_recipes import programs
from common import endpoints
"""
Defining schema
"""
attributes = [
Attribute(KeyStringIdentifier("id")),
Attribute(StringIdentifier("author")),
Attribute(StringIdentifier("subreddit")),
Attribute(POSIXTimestamp("create... | [
11748,
10104,
198,
11748,
4866,
198,
6738,
257,
273,
396,
1330,
1635,
198,
6738,
257,
273,
396,
62,
8344,
18636,
1330,
4056,
198,
6738,
2219,
1330,
886,
13033,
198,
198,
37811,
198,
7469,
3191,
32815,
198,
37811,
198,
1078,
7657,
796,
... | 2.408867 | 1,218 |
"""
Register routes for the app
"""
from flask import Blueprint
from flask_restful import Api
from ridemyway import resources as r
from ridemyway.utils.response import ERRORS
v1 = Blueprint('v1', __name__)
api = Api(v1, catch_all_404s=True, errors=ERRORS)
add = api.add_resource
# Add routes here
add(r.All, '/a... | [
37811,
198,
220,
220,
220,
17296,
11926,
329,
262,
598,
198,
37811,
198,
198,
6738,
42903,
1330,
39932,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
198,
6738,
5755,
3065,
1014,
1330,
4133,
355,
374,
198,
6738,
5755,
3065,
1014,
1... | 2.054745 | 274 |
import csv
import os
from collections import OrderedDict
path = ""
csv_file_name = "Train.csv"
filter_feature_name = "UserID"
directory = "data_sets\\"
user_delimiter = ','
if not os.path.exists(directory):
os.makedirs(directory)
users = {}
features = OrderedDict()
with open(csv_file_name, 'r') as f:
first_line = f... | [
11748,
269,
21370,
198,
11748,
28686,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6978,
796,
13538,
198,
40664,
62,
7753,
62,
3672,
796,
366,
44077,
13,
40664,
1,
198,
24455,
62,
30053,
62,
3672,
796,
366,
12982,
2389,
1,
... | 2.522727 | 440 |
import os
import numpy as np
import tensorflow as tf
from tensorflow.contrib.framework.python.framework import checkpoint_utils
from src.layers.conv2d import Conv2DLayer
from src.layers.integration import IntegrationLayer
from src.layers.maxpool import MaxPoolLayer
from src.layers.functional import make_leaky_rectifie... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
13,
30604,
13,
29412,
13,
30604,
1330,
26954,
62,
26791,
198,
198,
6738,
12351,
13,
75,
6962,
13,
... | 3.514851 | 101 |
import typing as t
| [
11748,
19720,
355,
256,
198
] | 3.8 | 5 |
# -*- coding: utf-8 -*-
# The planned path the robot will take. This consists of a set of waypoints.
from collections import deque
# Construct a new planner object and set defaults.
# This method appends another planned path to the end of this
# path. The end of this path must be the same cell as the
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
383,
6027,
3108,
262,
9379,
481,
1011,
13,
770,
10874,
286,
257,
900,
286,
835,
13033,
13,
198,
6738,
17268,
1330,
390,
4188,
628,
220,
220,
220,
1303,
28407,
... | 3.47 | 100 |
#!/usr/bin/env python3
import sys
if __name__ == '__main__':
try:
rot_file(sys.argv[1])
except IndexError:
print('No filename given. Nothing to do.')
except FileNotFoundError:
print(f'Could not open "{sys.argv[1]}". Sorry about that.')
except PermissionError:
print(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5724,
62,
... | 2.572222 | 180 |
"""
@author: krakowiakpawel9@gmail.com
@site: e-smartdata.org
"""
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from dash.dependencies import Input, Output
from datetime import datetime
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLw... | [
37811,
198,
31,
9800,
25,
479,
17716,
322,
32994,
79,
707,
417,
24,
31,
14816,
13,
785,
198,
31,
15654,
25,
304,
12,
27004,
7890,
13,
2398,
198,
37811,
198,
198,
11748,
14470,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
... | 2.508333 | 360 |
# Created on 2017-8-31
# Usage: Lower Limit of Energy Requirements (LLER) for area of interest.
#--------------------------------------------------------------------------------------------------------------
#Import all necessary module dependencies
import arcpy, numpy, csv, os, string, re, shutil, glob
from arcpy.sa ... | [
2,
15622,
319,
2177,
12,
23,
12,
3132,
198,
2,
29566,
25,
16048,
27272,
286,
6682,
24422,
357,
3069,
1137,
8,
329,
1989,
286,
1393,
13,
198,
2,
10097,
3880,
26171,
198,
198,
2,
20939,
477,
3306,
8265,
20086,
198,
11748,
10389,
9078,... | 2.755507 | 908 |
"""
This module is intended to generate and confirm tokens
"""
from itsdangerous import URLSafeTimedSerializer
from blog.config import Config
def generate_confirmation_token(email):
"""Generates e-mail confirmation token"""
serializer = URLSafeTimedSerializer(Config.SECRET_KEY)
return serializer.dumps(... | [
37811,
198,
1212,
8265,
318,
5292,
284,
7716,
290,
6216,
16326,
198,
37811,
198,
198,
6738,
663,
38537,
516,
1330,
37902,
6561,
8635,
14967,
276,
32634,
7509,
198,
6738,
4130,
13,
11250,
1330,
17056,
628,
198,
4299,
7716,
62,
10414,
362... | 2.444444 | 288 |
from __future__ import annotations
import typing
from typing import Optional, List, Iterable
from collections import namedtuple
import logging
from blatann.gatt.gatts_attribute import GattsAttribute, GattsAttributeProperties
from blatann.gatt.managers import GattsOperationManager
from blatann.nrf import nrf_... | [
6738,
11593,
37443,
834,
1330,
37647,
201,
198,
11748,
19720,
201,
198,
6738,
19720,
1330,
32233,
11,
7343,
11,
40806,
540,
201,
198,
6738,
17268,
1330,
3706,
83,
29291,
201,
198,
11748,
18931,
201,
198,
201,
198,
201,
198,
6738,
21451,... | 2.499715 | 8,759 |
#!/usr/bin/env python
'''
Network interface configuration control tool.
Usage:
iftool [options] configure [--host=<host>] <template> [<destination>]
Options:
-h, --help display this message and exit.
-V, --version display version and exit.
-v, --verbose display extra o... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
26245,
7071,
8398,
1630,
2891,
13,
198,
198,
28350,
25,
198,
220,
220,
220,
611,
25981,
685,
25811,
60,
17425,
685,
438,
4774,
28,
27,
4774,
37981,
1279,
28243,
29,
685... | 2.470222 | 1,125 |
from sympy.physics.quantum.operatorset import (
operators_to_state, state_to_operators
)
from sympy.physics.quantum.cartesian import (
XOp, XKet, PxOp, PxKet, XBra, PxBra
)
from sympy.physics.quantum.state import Ket, Bra
from sympy.physics.quantum.operator import Operator
from sympy.physics.quantum.spin impo... | [
6738,
10558,
88,
13,
746,
23154,
13,
40972,
388,
13,
3575,
2024,
316,
1330,
357,
198,
220,
220,
220,
12879,
62,
1462,
62,
5219,
11,
1181,
62,
1462,
62,
3575,
2024,
198,
8,
198,
198,
6738,
10558,
88,
13,
746,
23154,
13,
40972,
388,... | 2.361905 | 210 |
from __future__ import division, print_function
import os
import torch
import pickle as pkl
from tqdm import tqdm
from PIL import Image
import numpy as np
from pdb import set_trace
from util import util
from util import obj_io
if __name__ == '__main__':
import argparse
# loading cfg file
pa... | [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
2298,
293,
355,
279,
41582,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
... | 2.121041 | 884 |
import boto3
from os import environ
from src.scripts.io_s3 import s3_download, s3_upload
from src.pipelines.pipelines import concat_csv_stage_one, concat_csv_stage_two
s3_client = boto3.client("s3")
s3_bucket = environ.get("ARTIFACT_BUCKET")
def concat_stage_one(event, context):
"""Concatenate Sagemaker predictions... | [
11748,
275,
2069,
18,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
12351,
13,
46521,
13,
952,
62,
82,
18,
1330,
264,
18,
62,
15002,
11,
264,
18,
62,
25850,
198,
6738,
12351,
13,
79,
541,
20655,
13,
79,
541,
20655,
1330,
1673,
265... | 2.556144 | 944 |
#!/usr/bin/python
#
# Parses the PLC configuration file /etc/planetlab/plc_config, which
# is bootstrapped by Boot Manager, but managed by us.
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
import os
class Config:
"""
Parses Python configuration files; al... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
23042,
274,
262,
350,
5639,
8398,
2393,
1220,
14784,
14,
47427,
23912,
14,
489,
66,
62,
11250,
11,
543,
198,
2,
318,
6297,
12044,
1496,
416,
18892,
9142,
11,
475,
5257,
416,
51... | 2.742718 | 206 |
# -*- coding: utf-8 -*-
import numpy as np
from numpy.linalg import norm
from scipy.sparse import isspmatrix as isspmatrix_np
from scipy.sparse.linalg import eigsh
from scipy.linalg import eigh
def calc_eig_res(A, M, eigvals, eigvecs):
"""
Returns the residuals of the generalized eigenvalue problem
``A *... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
2593,
198,
6738,
629,
541,
88,
13,
82,
29572,
1330,
1189,
4426,
265,
8609,
355,
1189,
442... | 2.238388 | 1,787 |
'''NXOS implementation for bgp disable/enable triggers'''
# import python
import time
# Genie Libs
from genie.libs.sdk.libs.utils.mapping import Mapping
from genie.libs.sdk.triggers.disableenable.disableenable import \
TriggerDisableEnable
# Which key to exclude for BGP Ops com... | [
7061,
6,
45,
55,
2640,
7822,
329,
275,
31197,
15560,
14,
21633,
20022,
7061,
6,
198,
198,
2,
1330,
21015,
198,
11748,
640,
198,
198,
2,
49405,
7980,
82,
198,
6738,
2429,
494,
13,
8019,
82,
13,
21282,
74,
13,
8019,
82,
13,
26791,
... | 1.85802 | 2,768 |
# EXAMPLE PYTHON MODULE
# Define some variables:
numberone = 1
ageofqueen = 78
# define some functions
# define a class
| [
2,
7788,
2390,
16437,
350,
56,
4221,
1340,
33893,
198,
2,
2896,
500,
617,
9633,
25,
198,
17618,
505,
796,
352,
198,
496,
1659,
4188,
268,
796,
8699,
628,
198,
2,
8160,
617,
5499,
628,
198,
198,
2,
8160,
257,
1398,
198
] | 2.97619 | 42 |
# ColorMixer
# A simple HSV color mixer with three sliders.
import ui
import clipboard
from random import random
from console import hud_alert
import colorsys
v = ui.load_view('ColorMixerHSV')
slider_action(v['slider1'])
if ui.get_screen_size()[1] >= 768:
# iPad
v.present('popover')
else:
# iPhone
v.p... | [
2,
5315,
35608,
263,
198,
2,
317,
2829,
18070,
53,
3124,
33938,
351,
1115,
1017,
4157,
13,
198,
198,
11748,
334,
72,
198,
11748,
47999,
198,
6738,
4738,
1330,
4738,
198,
6738,
8624,
1330,
289,
463,
62,
44598,
198,
11748,
7577,
893,
... | 2.66129 | 124 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed u... | [
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
257,
4866,
286,
262,
1378... | 2.322321 | 1,120 |
# Generated by Django 2.1.5 on 2019-03-13 20:35
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
20,
319,
13130,
12,
3070,
12,
1485,
1160,
25,
2327,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |