content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""
Utility for getting information about a Minecraft user
"""
import json
from urllib.parse import urljoin
import requests
from mcadmin.exception import PublicError
_ID = 'id'
_NAME = 'name'
_MOJANG_USER_API = 'https://api.mojang.com/users/profiles/minecraft/'
class ProfileAPIError(PublicError):
"""
Raise... | [
37811,
198,
18274,
879,
329,
1972,
1321,
546,
257,
24609,
2836,
198,
37811,
198,
11748,
33918,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
22179,
198,
198,
11748,
7007,
198,
198,
6738,
36650,
28482,
13,
1069,
4516,
1330,
5094,
12... | 2.627232 | 896 |
#!/usr/bin/python3
import socket
import sys
# Create a TCP/IP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
server_address = ('localhost', 10000)
if __name__ == "__main__":
print('connecting to %s port %s' % server_address)
sock.conne... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
17802,
198,
11748,
25064,
198,
198,
2,
13610,
257,
23633,
14,
4061,
17802,
198,
82,
735,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
... | 2.821293 | 263 |
#! /usr/bin/env python3
import random
import copy
import pickle
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import find_peaks_cwt
LENGTH = 50000000
N_TRIALS = 350
selection_strength = 1
replicates = 10
window = 1000000
step = 20000
out_pre = '/Volumes/Jacob_2TB_storage/... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
4738,
198,
11748,
4866,
198,
11748,
2298,
293,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
2948... | 2.681818 | 308 |
"""
Select GUI package
"""
#
import os
import configparser
#check chiantirc for gui selection
rcfile=os.path.join(os.environ['HOME'],'.chianti/chiantirc')
rcparse=configparser.ConfigParser()
rcparse.read(rcfile)
try:
if rcparse.get('chianti','gui').lower() == 'true':
use_gui=True
else:
use_gui... | [
37811,
198,
17563,
25757,
5301,
198,
37811,
198,
198,
2,
198,
11748,
28686,
198,
11748,
4566,
48610,
198,
198,
2,
9122,
442,
3014,
1980,
329,
11774,
6356,
198,
6015,
7753,
28,
418,
13,
6978,
13,
22179,
7,
418,
13,
268,
2268,
17816,
... | 2.530351 | 313 |
import re
for _ in range(int(input())):
print('YES' if re.match(r'^[789]\d{9}$', input()) else 'NO')
| [
11748,
302,
198,
198,
1640,
4808,
287,
2837,
7,
600,
7,
15414,
28955,
2599,
198,
220,
220,
220,
3601,
10786,
43335,
6,
611,
302,
13,
15699,
7,
81,
6,
61,
58,
40401,
60,
59,
67,
90,
24,
92,
3,
3256,
5128,
28955,
2073,
705,
15285,... | 2.255319 | 47 |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | [
2,
220,
15069,
357,
66,
8,
13130,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
... | 3.100775 | 258 |
import time
import base64
import os
import io
import sys
from contextlib import redirect_stdout, redirect_stderr
import github
import jwt
import requests
from cryptography.hazmat.backends import default_backend
from nacl import encoding, public
def _encrypt_github_secret(public_key, secret_value):
"""Encrypt a U... | [
11748,
640,
198,
11748,
2779,
2414,
198,
11748,
28686,
198,
11748,
33245,
198,
11748,
25064,
198,
6738,
4732,
8019,
1330,
18941,
62,
19282,
448,
11,
18941,
62,
301,
1082,
81,
198,
198,
11748,
33084,
198,
11748,
474,
46569,
198,
11748,
7... | 2.046954 | 1,789 |
#!/usr/bin/env python3
"""
???
"""
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
198,
28358,
198,
198,
37811,
628,
198
] | 2.052632 | 19 |
from freezegun import freeze_time
from rest_framework import status, test
from waldur_core.core import utils as core_utils
from waldur_core.structure.tests import factories as structure_factories
from waldur_core.structure.tests import fixtures
from waldur_mastermind.booking import PLUGIN_NAME
from waldur_mastermind.m... | [
6738,
1479,
89,
1533,
403,
1330,
16611,
62,
2435,
198,
6738,
1334,
62,
30604,
1330,
3722,
11,
1332,
198,
198,
6738,
266,
1940,
333,
62,
7295,
13,
7295,
1330,
3384,
4487,
355,
4755,
62,
26791,
198,
6738,
266,
1940,
333,
62,
7295,
13,... | 3.519231 | 156 |
import xml.etree.ElementTree as ET
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import calendar
import time
from datetime import datetime
import pytz
from scipy import stats
from os.path import exists
# an instance of apple Health
# fname is the name of data file to be pa... | [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
8... | 3.524272 | 103 |
# coding: utf-8
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(16, GPIO.IN)
try:
while True:
print(GPIO.input(16))
if GPIO.input(16):
print('Ambiente bom')
time.sleep(0.2)
if GPIO.input(16)!=1:
print('Gás detectado')
except KeyboardInterru... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198,
198,
16960,
9399,
13,
2617,
14171,
7,
16960,
9399,
13,
2749,
44,
8,
198,
16960,
9399,
13,
40406,
7,
1433,
11,
50143,
13,
126... | 1.994186 | 172 |
#!/usr/bin/env python3
import os
import shutil
import tempfile
import unittest
from protofuzz import log
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
198,
198,
6738,
1237,
1659,
4715,
1330,
2604,
628
] | 3.085714 | 35 |
#!/usr/bin/env python
import os
import subprocess
from unittest import TestCase
from boutiques import __file__ as bfile
import boutiques as bosh
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
18222,
6368,
1330,
11593,
7753,
834,
355,
275,
7753,
198,
11748,
18222,
6368,
355,
275,... | 3.418605 | 43 |
from src import item as it
import random
import numpy as np
import os
from xml.dom import minidom
from config import config
from xml.etree.ElementTree import Element, SubElement, tostring
import progressbar
from PIL import Image
def create_matrix() -> np.ndarray:
"""
Function for creating a matrix to control ... | [
6738,
12351,
1330,
2378,
355,
340,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
35555,
13,
3438,
1330,
949,
312,
296,
198,
6738,
4566,
1330,
4566,
198,
6738,
35555,
13,
316,
631,
13,
20180,
27660,
... | 2.113911 | 9,007 |
import configs.preprocess.prep as prep
config = dict(
metapath='data/raw/chestxdet10/*.json',
images='data/raw/chestxdet10/*/*',
clear=False,
visualize=False,
result_dir='data/processed/vinbigdataVOC2012',
preprocessor=prep.preprocessor)
| [
11748,
4566,
82,
13,
3866,
14681,
13,
46012,
355,
3143,
198,
198,
11250,
796,
8633,
7,
198,
220,
220,
220,
1138,
499,
776,
11639,
7890,
14,
1831,
14,
46713,
87,
15255,
940,
15211,
13,
17752,
3256,
198,
220,
220,
220,
4263,
11639,
78... | 2.578431 | 102 |
def get_user():
"""
Get current TLS user
"""
from django.conf import settings
from tls_middleware import _tls
get_user_fn = getattr(settings, 'GET_CURRENT_USER', None)
if get_user_fn:
return get_user_fn()
return getattr(_tls, 'user', None)
| [
4299,
651,
62,
7220,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3497,
1459,
33855,
2836,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
422,
42625,
14208,
13,
10414,
1330,
6460,
198,
220,
220,
220,
422,
256,
7278,
62,
271... | 2.431034 | 116 |
import base64
import json
from fastapi import APIRouter, Depends, File, HTTPException, UploadFile
from sqlalchemy.ext.asyncio import AsyncSession
from typing import Optional
import app.crud.soft_prompt as crud
from app.api.deps import get_current_approved_user, get_session, get_current_user
from app.models.user impor... | [
11748,
2779,
2414,
198,
11748,
33918,
198,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
2129,
2412,
11,
9220,
11,
14626,
16922,
11,
36803,
8979,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
292,
13361,
952,
1330,
1081,
13361,
360... | 2.912281 | 171 |
import argparse
import sys
from gtin import (
calculate_check_digit,
validate_check_digit,
has_valid_check_digit,
append_check_digit,
get_gcp,
GTIN,
)
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
198,
11748,
25064,
198,
6738,
308,
43701,
1330,
357,
198,
220,
220,
220,
15284,
62,
9122,
62,
27003,
11,
198,
220,
220,
220,
26571,
62,
9122,
62,
27003,
11,
198,
220,
220,
220,
468,
62,
12102,
62,
9122,
62,
27003... | 2.336842 | 95 |
import os
import re
import requests
from requests.auth import HTTPBasicAuth
class NetwaveCamera:
"""A local representation of a Netwave camera"""
video_mode_50_hz = 0
video_mode_60_hz = 1
video_mode_outdoor = 2
resolution_160_x_120 = 2
resolution_320_x_240 = 8
resolution_640_x_480 = 32
... | [
11748,
28686,
198,
11748,
302,
198,
198,
11748,
7007,
198,
6738,
7007,
13,
18439,
1330,
14626,
26416,
30515,
628,
198,
4871,
3433,
19204,
35632,
25,
198,
220,
220,
220,
37227,
32,
1957,
10552,
286,
257,
3433,
19204,
4676,
37811,
628,
22... | 2.571657 | 3,133 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Manage simulation configuration data.
Configuration data is normally loaded from a yaml file. Some standard
configurations are included with this package and can be loaded by name,
for example:
>>> test_config = load_config('test')
Otherwise any ... | [
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
532,
766,
38559,
24290,
13,
81,
301,
198,
37811,
5124,
496,
18640,
8398,
1366,
13,
198,
198,
38149,
1366,
318,
7685,
9639,
422,
257,
331,
43695,
2393,
13,
2773,
3210,
19... | 2.24631 | 10,909 |
# encoding: UTF-8
#
# Copyright 2012-2013 Alejandro Autalán
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
#... | [
2,
21004,
25,
41002,
12,
23,
198,
2,
198,
2,
15069,
2321,
12,
6390,
9300,
47983,
5231,
282,
21162,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
198,
2,
739,
262,
2846,
286... | 2.298156 | 976 |
'''
May 2017
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
win = tk.Tk() # Create instance
win.title("Python GUI") # Add a title
tabControl = ttk.Notebook(win) # Create Tab ... | [
7061,
6,
198,
6747,
2177,
198,
31,
9800,
25,
37940,
10424,
317,
13,
40860,
198,
7061,
6,
198,
2,
4770,
50155,
198,
2,
17944,
198,
2,
4770,
50155,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
256,
30488,... | 2.455319 | 235 |
from wagtail.admin.edit_handlers import FieldPanel
| [
6738,
266,
363,
13199,
13,
28482,
13,
19312,
62,
4993,
8116,
1330,
7663,
26639,
628
] | 3.466667 | 15 |
from collections import defaultdict
from datetime import date
from dataclasses import asdict
from .. import github
from ..models import RepoLanguages, RepoStats
from typing import List, Set
COMMIT_WEIGHT = 0.7
ISSUE_WEIGHT = 0.2
STAR_WEIGHT = 0.1 | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
4818,
8079,
1330,
3128,
198,
6738,
4818,
330,
28958,
1330,
355,
11600,
198,
198,
6738,
11485,
1330,
33084,
198,
6738,
11485,
27530,
1330,
1432,
78,
43,
33213,
11,
1432,
78,
29668,
198,
198,
673... | 3.276316 | 76 |
import json
import logging
import os
import shutil
import time
from typing import Dict, List, Optional
import sqlalchemy as sa
from delta_node import coord, db, entity
from delta_node.serialize import bytes_to_hex, hex_to_bytes
from fastapi import (APIRouter, Depends, File, Form, HTTPException, Query,
... | [
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
640,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
198,
198,
11748,
44161,
282,
26599,
355,
473,
198,
6738,
25979,
62,
17440,
1330,
6349,
11... | 2.989691 | 291 |
import fnmatch
import os
from namer.words import generate_words_in_language
from namer.phonemes import generate_phonemes_in_language
if __name__ == "__main__":
generate_all_syllabic_structures()
generate_all_languages()
| [
11748,
24714,
15699,
198,
11748,
28686,
198,
198,
6738,
299,
2382,
13,
10879,
1330,
7716,
62,
10879,
62,
259,
62,
16129,
198,
6738,
299,
2382,
13,
746,
261,
368,
274,
1330,
7716,
62,
746,
261,
368,
274,
62,
259,
62,
16129,
628,
628,... | 2.841463 | 82 |
import os
def modified_after(first_path, second_path):
"""Returns True if first_path's mtime is higher than second_path's mtime."""
try:
first_mtime = os.stat(first_path).st_mtime
except EnvironmentError:
return False
try:
second_mtime = os.stat(second_path).st_mtime
except ... | [
11748,
28686,
198,
198,
4299,
9518,
62,
8499,
7,
11085,
62,
6978,
11,
1218,
62,
6978,
2599,
198,
220,
220,
220,
37227,
35561,
6407,
611,
717,
62,
6978,
338,
285,
2435,
318,
2440,
621,
1218,
62,
6978,
338,
285,
2435,
526,
15931,
198,... | 2.554839 | 155 |
from collection import app
from collection.forms import BookForm
from collection.documents import Book
from flask import render_template, redirect, url_for
@app.route('/books/new', methods=['GET', 'POST'])
@app.route('/books')
@app.route('/books/<int:page>')
@app.route('/books/<letter>')
@app.route('/books/<letter>/... | [
6738,
4947,
1330,
598,
198,
6738,
4947,
13,
23914,
1330,
4897,
8479,
198,
6738,
4947,
13,
15390,
2886,
1330,
4897,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
18941,
11,
19016,
62,
1640,
198,
198,
31,
1324,
13,
38629,
10786,
14,
1210... | 2.688623 | 167 |
from distutils.core import setup
setup(
name='ovirtlib4',
packages=['ovirtlib4', 'ovirtlib4.utils'],
license='Apache License 2.0',
version='1.2.1',
description='Ovirtsdk4 wrapper',
long_description=open('README.rst').read(),
author='Roni Eliezer',
author_email='reliezer@redhat.com',
url='https://githu... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
40406,
7,
198,
220,
1438,
11639,
709,
2265,
8019,
19,
3256,
198,
220,
10392,
28,
17816,
709,
2265,
8019,
19,
3256,
705,
709,
2265,
8019,
19,
13,
26791,
6,
4357,
198,
220,
5964,
11639,
25... | 2.528384 | 229 |
# -*- coding: utf-8 -*-
"""
httping module tests
"""
import pytest
from hio import help
from hio.core import http
logger = help.ogler.getLogger()
def test_http_error():
"""
Test HTTPError class
"""
error = http.HTTPError(status=400)
assert error.status == 400
assert error.reason == 'Bad R... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
4023,
278,
8265,
5254,
198,
37811,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
289,
952,
1330,
1037,
198,
6738,
289,
952,
13,
7295,
1330,
2638,
628,
198,
... | 2.1481 | 763 |
import importlib
import os
from typing import List, Set
import discord
from discord.ext import commands
from project_template import config
from project_template.utils.logger import log
bot = commands.Bot(command_prefix=config.DISCORD_BOT_COMMAND_PREFIX)
@bot.event
@bot.event
if __name__ == "__main__":
... | [
11748,
1330,
8019,
198,
11748,
28686,
198,
6738,
19720,
1330,
7343,
11,
5345,
198,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
6738,
1628,
62,
28243,
1330,
4566,
198,
6738,
1628,
62,
28243,
13,
26791,
13,
6404,
... | 3.114286 | 105 |
# -*- coding: utf-8 -*-
__version__ = '0.6.a12'
VERSION = __version__.split('.')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9641,
834,
796,
705,
15,
13,
21,
13,
64,
1065,
6,
198,
43717,
796,
11593,
9641,
834,
13,
35312,
10786,
2637,
8,
198
] | 2.131579 | 38 |
import json
from airflow_docker_helper.testing import test_client as get_client
| [
11748,
33918,
198,
198,
6738,
45771,
62,
45986,
62,
2978,
525,
13,
33407,
1330,
1332,
62,
16366,
355,
651,
62,
16366,
628,
628,
628
] | 3.583333 | 24 |
#!/usr/bin/python
import subprocess
shell_code = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh"
nopsled = '\x90' * 116
padding = 'A' * (446 - 116 - 32)
eip = '\x40\xf6\xff\xbf'
r = nopsled + shell_code... | [
2,
48443,
14629,
14,
8800,
14,
29412,
220,
198,
11748,
850,
14681,
198,
198,
29149,
62,
8189,
796,
37082,
87,
1765,
59,
87,
16,
69,
59,
87,
20,
68,
59,
87,
4531,
59,
87,
4304,
59,
87,
2919,
59,
87,
3132,
59,
25306,
15,
59,
87,... | 1.718062 | 227 |
# ------------------------------------------------------------------------
# Copyright (c) Hitachi, Ltd. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------
import argparse
from pathlib import Path
imp... | [
2,
16529,
982,
198,
2,
15069,
357,
66,
8,
7286,
14299,
11,
12052,
13,
1439,
6923,
33876,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
685,
3826,
38559,
24290,
329,
3307,
60,
198,
2,
16529,
982,
198,
11748,
18... | 3.202186 | 366 |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from abc import ABC, abstractmethod
from functools import partial
from operator import attrgetter
import os
import warnings
import numpy as np
from jax import jit, lax, local_device_count, pmap, random, vmap
from jax.core import Trac... | [
2,
15069,
25767,
669,
284,
262,
44954,
1628,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
... | 2.376549 | 8,230 |
""" Character app views module. """
from .ancestry import AncestryViewSet, SubAncestryViewSet
from .background import BackgroundViewSet
from .character_class import CharacterClassViewSet, ArchetypeViewSet, \
FeaturesAtLevelViewSet, SpellsKnownAtLevelViewSet, SpellSlotsAtLevelViewSet
from .character import Character... | [
37811,
15684,
598,
5009,
8265,
13,
37227,
198,
6738,
764,
1192,
395,
563,
1330,
31200,
563,
7680,
7248,
11,
3834,
2025,
9165,
563,
7680,
7248,
198,
6738,
764,
25249,
1330,
25353,
7680,
7248,
198,
6738,
764,
22769,
62,
4871,
1330,
15684,... | 3.537037 | 162 |
from flask_sqlalchemy import SQLAlchemy as SQLAlchemyBase
import sys
sys.path.append("..")
from models.base import set_query_property
class SQLAlchemy(SQLAlchemyBase):
""" Extensão do FLASK que integra o alchemy com o Flask-SQLAlchemy. """
def make_declarative_base(self,model_class=None, metadata=None):
... | [
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
355,
16363,
2348,
26599,
14881,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
492,
4943,
198,
198,
6738,
4981,
13,
8692,
1330,
900,
62,
22766,
62,
26745,
198,
198... | 2.625571 | 219 |
"""Pre-configured iSEE options for selection by user.
Currently user configuration is NOT IMPLEMENTED - the code is here but option
is hidden from user in the tool form. Without ``custom`` selection, this simply
returns a DEFAULT iSEE configuration (defined at the bottom of this file).
These are preconfigured iSEE pa... | [
37811,
6719,
12,
11250,
1522,
1312,
36078,
3689,
329,
6356,
416,
2836,
13,
198,
198,
21327,
2836,
8398,
318,
5626,
30023,
2538,
10979,
1961,
532,
262,
2438,
318,
994,
475,
3038,
198,
271,
7104,
422,
2836,
287,
262,
2891,
1296,
13,
917... | 2.516438 | 1,673 |
# coding=utf-8
"""Test cases for the OSM Way Parser module.
:copyright: (c) 2013 by Tim Sutton
:license: GPLv3, see LICENSE for more details.
"""
import xml
import unittest
from reporter.test.logged_unittest import LoggedTestCase
from reporter.osm_way_parser import OsmParser
from reporter.test.helpers import FIXTURE_P... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
14402,
2663,
329,
262,
7294,
44,
6378,
23042,
263,
8265,
13,
198,
25,
22163,
4766,
25,
357,
66,
8,
2211,
416,
5045,
39964,
198,
25,
43085,
25,
38644,
85,
18,
11,
766,
38559,
24290,
329,
517... | 2.170259 | 464 |
#!/usr/bin/python3
from pymongo import MongoClient
#from pssh.pssh2_client import SSHClient
import paramiko
import time
import sys
import json
import os
import subprocess
import signal
import time
import argparse
from termcolor import colored
from KnowledgeUtils import KnowledgeUtils
#
# parser = argparse.ArgumentPar... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
2,
6738,
279,
45824,
13,
79,
45824,
17,
62,
16366,
1330,
33825,
11792,
198,
11748,
5772,
12125,
198,
11748,
640,
198,
11748,
25064,
198,
1... | 2.860065 | 929 |
# -*- coding: utf-8 -*-
from zvt.recorders.common.init_data import init_main_index
init_main_index()
from .ccxt import *
from .eastmoney import *
from .joinquant import *
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
1976,
36540,
13,
8344,
6361,
13,
11321,
13,
15003,
62,
7890,
1330,
2315,
62,
12417,
62,
9630,
198,
198,
15003,
62,
12417,
62,
9630,
3419,
198,
198,
6738,
764,
53... | 2.703125 | 64 |
"""Schema validation for configuration.yaml."""
import logging
import sys
from voluptuous import Schema, ALLOW_EXTRA, Optional, Required, Any, MultipleInvalid
_LOGGER = logging.getLogger(__name__)
logging = {
Optional("level"): str,
Optional("timestamp"): bool,
Optional("console"): bool,
Optional("ext... | [
37811,
27054,
2611,
21201,
329,
8398,
13,
88,
43695,
526,
15931,
198,
11748,
18931,
198,
11748,
25064,
198,
6738,
2322,
37623,
5623,
1330,
10011,
2611,
11,
11096,
3913,
62,
13918,
3861,
11,
32233,
11,
20906,
11,
4377,
11,
20401,
44651,
... | 2.773109 | 833 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
from gaiatest import GaiaTestCase
from gaiatest.apps.system.regions.cards_view import CardsView
from gaiate... | [
2,
770,
8090,
6127,
5178,
318,
2426,
284,
262,
2846,
286,
262,
29258,
5094,
198,
2,
13789,
11,
410,
13,
362,
13,
15,
13,
1002,
257,
4866,
286,
262,
4904,
43,
373,
407,
9387,
351,
428,
198,
2,
2393,
11,
921,
460,
7330,
530,
379,
... | 3.235772 | 123 |
# coding: utf-8
"""
Experimental Looker API 3.1 Preview
This API 3.1 is in active development. Breaking changes are likely to occur to some API functions in future Looker releases until API 3.1 is officially launched and upgraded to beta status. If you have time and interest to experiment with new or modifie... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
32286,
6803,
263,
7824,
513,
13,
16,
22217,
628,
220,
220,
220,
770,
7824,
513,
13,
16,
318,
287,
4075,
2478,
13,
24942,
2458,
389,
1884,
284,
3051,
284,
617,
... | 2.351247 | 48,436 |
"""
Deserializes JSON into COMPAS objects.
"""
from ghpythonlib.componentbase import executingcomponent as component
import compas
| [
37811,
198,
5960,
48499,
4340,
19449,
656,
24301,
1921,
5563,
13,
198,
37811,
198,
6738,
308,
24831,
7535,
8019,
13,
42895,
8692,
1330,
23710,
42895,
355,
7515,
198,
198,
11748,
552,
292,
628
] | 4.030303 | 33 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Category, Post
# Register your models here.
admin.site.register(Category)
admin.site.register(Post)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
21743,
11,
2947,
198,
198,
... | 3.205882 | 68 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import os.path
import shutil
from pathlib import Path
from typing import Callable, Optional, Union
import torchvision.datasets.fo... | [
2,
15069,
357,
66,
8,
30277,
19193,
82,
11,
3457,
13,
290,
29116,
13,
198,
2,
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,
... | 2.005111 | 1,174 |
import netaddr
from core.modules.base import Program
from core.modules.console import print
class MACLookup(Program):
"""IEEE EUI (Extended Unique Identifier) lookup tool.
Both EUI-48 (used for layer 2 MAC addresses) and EUI-64 are supported.
Input parsing for EUI-48 addresses is flexible, s... | [
11748,
2010,
29851,
198,
6738,
4755,
13,
18170,
13,
8692,
1330,
6118,
198,
6738,
4755,
13,
18170,
13,
41947,
1330,
3601,
628,
198,
4871,
20582,
8567,
929,
7,
15167,
2599,
198,
220,
220,
220,
37227,
40,
31909,
4576,
40,
357,
11627,
163... | 3.068376 | 117 |
import argparse
import json
import os
import subprocess
import sys
import time
import copy
root_account = "codex"
relay_account_name = system_account("relay")
token_account_name = system_account("token")
code_account_name = system_account("code")
match_account_name = system_account("match")
bridge_account_name = syst... | [
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4866,
198,
198,
15763,
62,
23317,
796,
366,
19815,
1069,
1,
198,
198,
2411,
323,
62,
23317,
62,
3672,
796,... | 3.066667 | 150 |
__version__ = '3.3.11' | [
834,
9641,
834,
796,
705,
18,
13,
18,
13,
1157,
6
] | 2 | 11 |
"""Configuration for creating app"""
from flask import Flask, jsonify
from flask_cors import CORS
from instance.config import app_config
from app.database import SetupDB
| [
37811,
38149,
329,
4441,
598,
37811,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
198,
6738,
4554,
13,
11250,
1330,
598,
62,
11250,
198,
6738,
598,
13,
48806,
1330,
31122,
11012,
... | 4.023256 | 43 |
sbm_data_beta_crp_params = {
# number of data points (for training), N ~ unif(Nmin, Nmax)
'Nmin': 50,
'Nmax': 300,
# CRP
'alpha': .7,
'maxK': 12, # max number of clusters to generate
# SBM
'within_alpha': 6,
'within_beta': 3,
'between_alpha': 1,
'between_beta'... | [
198,
32310,
62,
7890,
62,
31361,
62,
6098,
79,
62,
37266,
796,
1391,
198,
220,
220,
220,
1303,
1271,
286,
1366,
2173,
357,
1640,
3047,
828,
399,
5299,
555,
361,
7,
45,
1084,
11,
399,
9806,
8,
198,
220,
220,
220,
705,
45,
1084,
1... | 2.103093 | 194 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""makeTextFile.py -- create text file
"""
import os
ls = os.linesep
fname = ''
# get filename
while True:
fname = raw_input('Input filename: ')
if os.path.exists(fname):
print "ERROR: '%s' already exists" % fname
else:
break
# get file cont... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
15883,
8206,
8979,
13,
9078,
1377,
2251,
2420,
2393,
198,
37811,
198,
198,
11748,
28686,
198,
198,
7278,
79... | 2.449827 | 289 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 31 00:58:20 2020
@author: joaovitor
"""
from .air import Air
from .receivers import Receiver, ReceiversGrid
from .sources import SourceChain, Source, Audio
__version__ = '0.1.0a'
__all__ = ['Air', 'Receiver', 'ReceiversGrid', 'Audio', 'Source', 'SourceChain']
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
5979,
3261,
3571,
25,
3365,
25,
1238,
12131,
198,
198,
31,
9800,
25,
2525,
64,
709,
2072,
198,
37811,
198,
198,
6738,
764,
958,
1330,
37... | 2.778761 | 113 |
from apscheduler.triggers.date import DateTrigger
from apscheduler.triggers.interval import IntervalTrigger
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.events import EVENT_JOB_MISSED, EVENT_JOB_ERROR, EVENT_JOB_EXECUTED
from pytz import timezone
from settings import Config
from d... | [
6738,
257,
862,
1740,
18173,
13,
2213,
328,
5355,
13,
4475,
1330,
7536,
48344,
198,
6738,
257,
862,
1740,
18173,
13,
2213,
328,
5355,
13,
3849,
2100,
1330,
4225,
2100,
48344,
198,
6738,
257,
862,
1740,
18173,
13,
1416,
704,
377,
364,
... | 3.294118 | 119 |
# main.py
from app import app
import views
import dashinterface
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
| [
2,
1388,
13,
9078,
198,
6738,
598,
1330,
598,
198,
11748,
5009,
198,
198,
11748,
14470,
39994,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
13,
5143,
7,
4774,
11639,
15,
13,
15,
13,
... | 2.538462 | 52 |
import unittest
from pathlib import Path
from policy_sentry.shared.arns import does_arn_match
from policy_sentry.shared.database import connect_db
home = str(Path.home())
config_directory = '/.policy_sentry/'
database_file_name = 'aws.sqlite3'
database_path = home + config_directory + database_file_name
db_session = c... | [
11748,
555,
715,
395,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
2450,
62,
82,
13000,
13,
28710,
13,
1501,
82,
1330,
857,
62,
1501,
62,
15699,
198,
6738,
2450,
62,
82,
13000,
13,
28710,
13,
48806,
1330,
2018,
62,
9945,
198,
198,... | 2.721503 | 772 |
import numpy as np
from .helpers import estimate_p_healthy_lungs
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
16794,
364,
1330,
8636,
62,
79,
62,
22796,
62,
75,
2150,
82,
628
] | 3.045455 | 22 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628
] | 2.043478 | 23 |
import arcpy
from arcpy import env
env.workspace = "C:\\TxDOT\\FederalRoads"
# desc = arcpy.Describe("tester.shp")
# shapefieldname = desc.ShapeFieldName
spatialRef = arcpy.Describe("tester.shp").spatialReference
rows = arcpy.UpdateCursor("tester.shp")
for row in rows:
geom = row.shape
wholeLen = geom.length*.0006... | [
11748,
10389,
9078,
198,
6738,
10389,
9078,
1330,
17365,
198,
198,
24330,
13,
5225,
10223,
796,
366,
34,
25,
6852,
46047,
35,
2394,
6852,
24099,
29197,
82,
1,
198,
198,
2,
1715,
796,
10389,
9078,
13,
24564,
4892,
7203,
4879,
353,
13,
... | 2.261176 | 425 |
from __future__ import unicode_literals
import unittest
import pytest
from django import VERSION
from django.utils.encoding import force_text
from autocomplete_light.example_apps.autocomplete_test_case_app.models import (
NonIntegerPk, SubGroup, CustomSchema, CustomIntegerPk, Caps)
from .case import *
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
555,
715,
395,
198,
11748,
12972,
9288,
198,
198,
6738,
42625,
14208,
1330,
44156,
2849,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
2700,
62,
5... | 3.087379 | 103 |
import os
import numpy as np
import requests
TGT_URL = os.getenv("TGT_URL", "http://localhost/transfertransfo/")
N_REQUESTS = int(os.getenv("N_REQUESTS", 5))
OUT_FILE = int(os.getenv("OUT_FILE", "confidences.npy"))
personality = [
"I am a socialbot.",
"I live on Amazon Web Service.",
"I was born during t... | [
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7007,
198,
198,
51,
19555,
62,
21886,
796,
28686,
13,
1136,
24330,
7203,
51,
19555,
62,
21886,
1600,
366,
4023,
1378,
36750,
14,
7645,
69,
861,
26084,
6513,
14,
4943,
... | 2.31339 | 1,053 |
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import numpy
a = numpy.random.randn(4,4)
a = a.astype(numpy.int32)
a_gpu = cuda.mem_alloc(a.nbytes)
cuda.memcpy_htod(a_gpu, a)
mod = SourceModule("""
#include <stdio.h>
__global__ void doublify(in... | [
11748,
12972,
66,
15339,
13,
26230,
355,
269,
15339,
198,
11748,
12972,
66,
15339,
13,
23736,
15003,
198,
6738,
12972,
66,
15339,
13,
5589,
5329,
1330,
8090,
26796,
198,
11748,
299,
32152,
198,
198,
64,
796,
299,
32152,
13,
25120,
13,
... | 1.935401 | 387 |
from speculator.features.OBV import OBV
import unittest
| [
6738,
1020,
8927,
13,
40890,
13,
9864,
53,
1330,
25334,
53,
198,
11748,
555,
715,
395,
198
] | 3.294118 | 17 |
from PIL import Image
image = Image.open('images/sleep.jpg') | [
6738,
350,
4146,
1330,
7412,
198,
198,
9060,
796,
7412,
13,
9654,
10786,
17566,
14,
42832,
13,
9479,
11537
] | 3.210526 | 19 |
import itertools
from django.template.defaultfilters import slugify
from django.utils.encoding import smart_bytes
from hashlib import sha1
import random
def get_slug(obj, title, group):
"""
used to get unique slugs
:param obj: Model Object
:param title: Title to create slug from
:param group: Model Class
:retur... | [
11748,
340,
861,
10141,
198,
6738,
42625,
14208,
13,
28243,
13,
12286,
10379,
1010,
1330,
31065,
1958,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
4451,
62,
33661,
198,
6738,
12234,
8019,
1330,
427,
64,
16,
198,
11748,
47... | 2.81201 | 383 |
from typing import Dict, List
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from regym.rl_algorithms.networks import ResizeCNNPreprocessFunction
from regym.rl_algorithms.algorithms.I2A import I2AAlgorithm, ImaginationCore, EnvironmentModel, AutoEnc... | [
6738,
19720,
1330,
360,
713,
11,
7343,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
1257,
310,
10141,
1330,
13027,
... | 2.144919 | 11,503 |
import Dice
import Scoresheet
from ManualPlayer import player
n_players = 0
while(n_players == 0):
try:
n_players = int(input("How many players? "))
except:
print("Please enter a number between 1 and 8")
n_players = 0
sheets = [Scoresheet.scoreSheet() for i in range(n_play... | [
11748,
34381,
201,
198,
11748,
44654,
25473,
201,
198,
6738,
17969,
14140,
1330,
2137,
201,
198,
201,
198,
77,
62,
32399,
796,
657,
201,
198,
4514,
7,
77,
62,
32399,
6624,
657,
2599,
201,
198,
220,
220,
220,
1949,
25,
201,
198,
220,... | 2.284848 | 330 |
import os
from typing import Any, Dict, List, Sequence, Tuple, Union
import hydra
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
from torchvision.transforms import transforms
from pytorch_lightning.metrics.classification import Accuracy
from torch.optim import Optimizer
from src.architec... | [
11748,
28686,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
45835,
11,
309,
29291,
11,
4479,
198,
198,
11748,
25039,
198,
11748,
12972,
13165,
354,
62,
2971,
768,
355,
458,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
... | 2.293037 | 1,034 |
# 53. Maximum Subarray
# Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
# DIVIDE into halves, leave the mid one as the center of the subarray
# CAVEAT:
## for the left part, start adding from the tail, cuz the subarray has to be ... | [
2,
7192,
13,
22246,
3834,
18747,
198,
2,
11259,
281,
18253,
7177,
997,
82,
11,
1064,
262,
48627,
850,
18747,
357,
38301,
379,
1551,
530,
1271,
8,
543,
468,
262,
4387,
2160,
290,
1441,
663,
2160,
13,
198,
198,
2,
360,
3824,
14114,
... | 3.636364 | 187 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.76494 | 251 |
# 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... | [
2,
220,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
220,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
220,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
220,
5115,
6634,
9238,... | 3.737037 | 270 |
# -*- coding: utf-8 -*-
from init import InitHandler
from model.users import Users
from model.notifications import Logs
from model.notifications import NotiCenter, Notification_Settings, Messages
from datetime import datetime
from datetime import timedelta
from google.appengine.ext import ndb
import logging
im... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
6738,
2315,
1330,
44707,
25060,
201,
198,
6738,
2746,
13,
18417,
1330,
18987,
201,
198,
6738,
2746,
13,
1662,
6637,
1330,
5972,
82,
201,
198,
6738,
2746,
13,
1662,
... | 3.521277 | 94 |
"""
Basket contexts.py
"""
from decimal import Decimal
from django.conf import settings
from django.shortcuts import get_object_or_404
from products.models import Product
def basket_contents(request):
"""
Contexts for basket contents
"""
basket_items = []
total = 0
product_count = 0
baske... | [
37811,
198,
33,
11715,
26307,
13,
9078,
198,
37811,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
3186... | 2.138444 | 874 |
#@ status AC
t=int(raw_input())
for time in xrange(t):
n,l,r=map(int,raw_input().split(' '))
# xk: exist k, s.t. l*k<=n<=r*k,
# namely exist k s.t. float(n/r)<=k<=float(n/l), namely int(n/l)>int((n-1)/r)
# @GET math is good
if n/l>(n-1)/r:
print 'Yes'
else:
print 'No' | [
2,
31,
3722,
7125,
201,
198,
201,
198,
83,
28,
600,
7,
1831,
62,
15414,
28955,
201,
198,
201,
198,
1640,
640,
287,
2124,
9521,
7,
83,
2599,
201,
198,
197,
77,
11,
75,
11,
81,
28,
8899,
7,
600,
11,
1831,
62,
15414,
22446,
35312... | 1.772455 | 167 |
import subprocess as sp
import pymysql
import pymysql.err
import pymysql.cursors
"""
Functions for different options
"""
# -------------------------------------------------------------------------------
# End of Functionalities
def dispatch(ch):
"""
Function that maps helper functions to ... | [
11748,
850,
14681,
355,
599,
198,
11748,
279,
4948,
893,
13976,
198,
11748,
279,
4948,
893,
13976,
13,
8056,
198,
11748,
279,
4948,
893,
13976,
13,
66,
1834,
669,
198,
198,
37811,
198,
24629,
2733,
329,
1180,
3689,
198,
37811,
628,
62... | 2.116268 | 2,176 |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymysql
import sys
import os
import path
import re
import pandas
from snownlp import SnowNLP
sys.path.append(os.path.a... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
2896,
500,
534,
2378,
31108,
994,
198,
2,
198,
2,
2094,
470,
6044,
284,
751,
534,
11523,
284,
262,
7283,
3620,
62,
47,
4061,
3698,
1268,
1546,
4634,
198,
2,
... | 2.72327 | 159 |
# -*- coding: utf-8 -*-
"""
スイッチを制御するクラス
"""
import RPi.GPIO as GPIO
import time
# スイッチ制御クラス | [
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
8943,
11482,
14777,
31090,
31758,
26344,
114,
36181,
94,
33623,
25748,
14099,
9263,
8943,
198,
37811,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
... | 1.566667 | 60 |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
2,
15069,
357,
66,
8,
33160,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845... | 2.63762 | 941 |
# Copyright (c) 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
'''Runner for pyOCD .'''
import os
import sys
from west.runners.core import ZephyrBinaryRunner, RunnerCaps, BuildConfiguration
from west import log
DEFAULT_PYOCD_GDB_PORT = 3333
class PyOcdBinaryRunner(ZephyrBinaryRunner):
'''Runner ... | [
2,
15069,
357,
66,
8,
2177,
5164,
12022,
15302,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
7061,
6,
49493,
329,
12972,
4503,
35,
764,
7061,
6,
198,
198,
11748,
28686,
198,
117... | 2.736842 | 152 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628,
628
] | 2.868421 | 38 |
#!/usr/bin/env python
"""Run benchmarks for model synthetic photometry"""
import time
import os
import glob
import argparse
from collections import OrderedDict
import numpy as np
import sncosmo
delim = 61 * "-"
# test data
ndata = 100 # make divisible by 4!
dates = np.linspace(-15., 40., ndata)
bands = np.array((nda... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
10987,
31747,
329,
2746,
18512,
2825,
15748,
37811,
198,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
15095,
198,
11748,
1822,
29572,
198,
6738,
17268,
1330,
14230,
1068,
35,
713... | 2.18871 | 620 |
from __future__ import absolute_import, division, print_function
from ansible_collections.spatiumcepa.truenas.plugins.module_utils.common import HTTPCode, HTTPResponse, \
TruenasServerError, TruenasModelError, TruenasUnexpectedResponse, strip_null_module_params
from ansible_collections.spatiumcepa.truenas.plugins.m... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
6738,
9093,
856,
62,
4033,
26448,
13,
2777,
265,
1505,
344,
8957,
13,
83,
622,
268,
292,
13,
37390,
13,
21412,
62,
26791,
13,
11321,
1330,
7154,
51,
... | 2.265766 | 1,110 |
# coding:utf-8
import json
from django.shortcuts import render, render_to_response
from django.core.urlresolvers import reverse
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth import authenticate, login, logout
from django.db.models import Q
from django.views.generic import View
from dja... | [
2,
19617,
25,
40477,
12,
23,
198,
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
8543,
62,
1462,
62,
26209,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208... | 2.265223 | 739 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import cv2
import numpy as np
class Spatial_stereo(object):
'''空间变换(缩放,平移,随机裁剪)'''
class Spatial_edge(object):
'''空间变换(旋转,缩放,随机裁剪)'''
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4871,
1338,
34961,
62,
301,
32934,
7,
15252,
2599,
... | 1.328767 | 146 |
"""
Copyright 2017 NREL
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
un... | [
37811,
198,
15269,
2177,
399,
16448,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
198,
5661,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
257... | 4.060403 | 149 |
from flask import current_app
import datetime
def mod_time(t, dt):
"""
Modify the supplied time with timedelta
Args:
t(datetime.time|datetime.datetime): The Time to modify
dt(datetime.timedelta): Difference
Returns:
time(datetime.time|datetime.datetime):... | [
6738,
42903,
1330,
1459,
62,
1324,
198,
11748,
4818,
8079,
628,
198,
4299,
953,
62,
2435,
7,
83,
11,
288,
83,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3401,
1958,
262,
14275,
640,
351,
28805,
12514,
... | 2.323197 | 1,414 |
n = int(input("Digite um número inteiro:"))
ac1 = n%10
achouadjacente = False
n = n//10
while n !=0 and not(achouadjacente):
ac2 = n%10
if ac1 == ac2:
achouadjacente = True
n = n//10
ac1 = ac2
if achouadjacente:
print("sim")
else:
print("não")
| [
77,
796,
493,
7,
15414,
7203,
19511,
578,
23781,
299,
21356,
647,
78,
493,
68,
7058,
11097,
4008,
198,
330,
16,
796,
299,
4,
940,
198,
620,
280,
41255,
12643,
68,
796,
10352,
198,
77,
796,
299,
1003,
940,
198,
4514,
299,
14512,
15... | 2 | 138 |
import unittest
import pygpe.shared.grid as grid
| [
11748,
555,
715,
395,
198,
11748,
12972,
70,
431,
13,
28710,
13,
25928,
355,
10706,
628
] | 3.125 | 16 |
import datetime
import os
from pathlib import Path
import pandas as pd
import typer
from numpy import NaN
if __name__ == "__main__":
typer.run(precipitationMatrixTransformation)
| [
11748,
4818,
8079,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
1259,
525,
198,
6738,
299,
32152,
1330,
11013,
45,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
... | 3 | 62 |
# coding: utf-8
# import openstack # noqa
# import test # noqa
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1330,
1280,
25558,
220,
1303,
645,
20402,
198,
2,
1330,
1332,
220,
1303,
645,
20402,
198
] | 2.538462 | 26 |
from django.db import models
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
628,
628
] | 3.529412 | 17 |
#!/usr/bin/env python3
from flask import Flask
from flask import render_template, request, jsonify, redirect
from api import query
app = Flask(__name__, static_folder='public')
app.config['JSON_AS_ASCII'] = False
@app.route('/', methods=['GET'])
@app.route('/flow', methods=['GET'])
@app.route('/statistic', methods... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
11,
33918,
1958,
11,
18941,
198,
6738,
40391,
1330,
12405,
198,
198,
1324,
796,
46947,
7,
834,
3672,
83... | 2.636364 | 319 |
import pygame
from globalData import *
import SpriteSheet
| [
201,
198,
11748,
12972,
6057,
201,
198,
6738,
3298,
6601,
1330,
1635,
201,
198,
11748,
33132,
3347,
316,
201,
198,
201,
198
] | 2.954545 | 22 |
# Generated by Django 3.0.4 on 2021-06-07 03:56
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
19,
319,
33448,
12,
3312,
12,
2998,
7643,
25,
3980,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from django.shortcuts import render,redirect, get_object_or_404
from django.http import HttpResponse
from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
from django.contrib import messages
from django.contrib.auth.decorators import login_required
# from django.db import IntegrityEr... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
445,
1060,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,
... | 2.500985 | 1,523 |
import numpy as np
import copy
import torch
import torchvision
from torch import nn, optim
from torchvision import transforms, datasets
from scipy.spatial.distance import pdist, squareform
from scipy.special import expit
import matplotlib.pyplot as plt
# Training Options
#=============================================... | [
11748,
299,
32152,
355,
45941,
198,
11748,
4866,
198,
11748,
28034,
198,
11748,
28034,
10178,
198,
6738,
28034,
1330,
299,
77,
11,
6436,
198,
6738,
28034,
10178,
1330,
31408,
11,
40522,
198,
6738,
629,
541,
88,
13,
2777,
34961,
13,
3024... | 3.434137 | 539 |
from bitfinex.model.bot import Bot
from bitfinex.api.data import Ticker, Candles
from bitfinex.states.states import OrderDir
if __name__ == "__main__":
find_bot_params()
| [
6738,
1643,
38125,
87,
13,
19849,
13,
13645,
1330,
18579,
198,
6738,
1643,
38125,
87,
13,
15042,
13,
7890,
1330,
309,
15799,
11,
15518,
829,
198,
6738,
1643,
38125,
87,
13,
27219,
13,
27219,
1330,
8284,
35277,
628,
628,
198,
361,
1159... | 2.919355 | 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.017597 | 2,330 |