content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django.db import models
from localflavor.br.models import *
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
1179,
1604,
75,
5570,
13,
1671,
13,
27530,
1330,
1635,
628
] | 3.3 | 20 |
today = datetime.datetime.now().date()
name = data.get('name')
eventType = data.get('type')
sensorName = "sensor.{}_{}".format(eventType , name.replace(" " , "_"))
dateStr = data.get('date')
dateSplit = dateStr.split("/")
dateDay = int(dateSplit[0])
dateMonth = int(dateSplit[1])
dateYear = int(dateSplit[2])
date = ... | [
40838,
796,
4818,
8079,
13,
19608,
8079,
13,
2197,
22446,
4475,
3419,
198,
198,
3672,
796,
1366,
13,
1136,
10786,
3672,
11537,
198,
15596,
6030,
796,
1366,
13,
1136,
10786,
4906,
11537,
198,
82,
22854,
5376,
796,
366,
82,
22854,
13,
9... | 2.778203 | 523 |
import abc
from modules.shared.graphInteraction import Interaction, DrawData
from modules.shared.dialogs.edge import EdgeDialog
################
## Base class ##
################
############################
## Some common behaviours ##
############################
# Highlights nodes when mouse passes over
# Priv... | [
11748,
450,
66,
198,
198,
6738,
13103,
13,
28710,
13,
34960,
9492,
2673,
1330,
4225,
2673,
11,
15315,
6601,
198,
6738,
13103,
13,
28710,
13,
38969,
18463,
13,
14907,
1330,
13113,
44204,
198,
198,
14468,
198,
2235,
7308,
1398,
22492,
198... | 4.510949 | 137 |
#!/usr/bin/env python
"""
RS 2018/03/11: Riemann -- a geometric MCMC sampler
This package supports CTDS's investigations into geometric MCMC, as in
"information geometry", using a connection associated with the Fisher metric.
"""
class RiemannBaseError(Exception):
"""
Simple base class for Riemann exceptio... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
6998,
2864,
14,
3070,
14,
1157,
25,
220,
371,
26597,
1236,
1377,
257,
38445,
13122,
9655,
6072,
20053,
198,
198,
1212,
5301,
6971,
16356,
5258,
338,
10986,
656,
38445,
... | 3.244444 | 135 |
import copy
from tkinter import filedialog
import cv2
import numpy as np
from PIL import Image
from PIL import ImageTk
from cv2 import *
from matplotlib import pyplot as plt
from gui.operations.repeater import Repeater
colors = {"COLOR": 1,
"GREY": 0}
supported_ext = [
".jpg",
".png"
]
"""
https:... | [
11748,
4866,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
350,
4146,
1330,
7412,
51,
74,
198,
6738,
269,
85,
17,
1330,... | 1.891234 | 6,206 |
import logging
import sys
from AllInOneInstagramBot.core.plugin_loader import Plugin
logger = logging.getLogger(__name__)
class DataAnalytics(Plugin):
"""Generates a PDF analytics report of current username session data"""
| [
11748,
18931,
198,
11748,
25064,
198,
198,
6738,
1439,
818,
3198,
6310,
6713,
20630,
13,
7295,
13,
33803,
62,
29356,
1330,
42636,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4871,
6060,
377... | 3.609375 | 64 |
# 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 typing import List, Type
from .analyze import Analyze as Analyze
from .command import ( # noqa; noqa; noqa
ClientException as Clien... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
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,
198,
... | 3.398734 | 158 |
#
# 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 us... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
9387,
351,
198,
2,
428,
670,
329,
3224,
1321,
5115,
6634,
9238,
13,
198,
2,
383,
... | 3.346578 | 906 |
"""
This example demonstrates using Bluetooth SIG's Battery service as a peripheral.
The peripheral adds the service, then updates the battery level percentage periodically.
This can be used in conjunction with the nRF Connect apps to explore the functionality demonstrated
"""
import time
from blatann import Bl... | [
37811,
201,
198,
1212,
1672,
15687,
1262,
19263,
33993,
338,
23490,
2139,
355,
257,
25514,
13,
201,
198,
464,
25514,
6673,
262,
2139,
11,
788,
5992,
262,
6555,
1241,
5873,
26034,
13,
201,
198,
201,
198,
1212,
460,
307,
973,
287,
17856... | 3.05814 | 430 |
"""
Modal page
Where click on given buttons
"""
from pages.base_page import BasePage
import time
from selenium.webdriver.common.by import By
| [
37811,
198,
5841,
282,
2443,
198,
8496,
3904,
319,
1813,
12163,
198,
37811,
198,
198,
6738,
5468,
13,
8692,
62,
7700,
1330,
7308,
9876,
198,
11748,
640,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
6... | 3.404762 | 42 |
#!/usr/bin/env python
from distutils.core import setup
setup(name='mdmr',
version='1.0',
description='Multivariate distance matrix regression',
author='Javier Rasero',
author_email='jrasero.daparte@gmail.com',
url='',
license='MIT',
packages=['mdmr'],
)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
9132,
43395,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
16,
13,
15,
3256,
198,
220,
220,
220,
220... | 2.404762 | 126 |
#!/usr/bin/env python3
# Copia files nel .bak
import shutil
# Serve per la parte di gestione html in python
import cgi
import cgitb
import time
# Abilita gli errori al server web/http
cgitb.enable()
# Intestazione HTML
print("<!DOCTYPE html>")
print("""
<html>
<head>
<title>ThermoRed</title>
<meta name="GEN... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
6955,
544,
3696,
299,
417,
764,
65,
461,
198,
198,
11748,
4423,
346,
198,
198,
2,
35557,
583,
8591,
636,
68,
2566,
10521,
7935,
27711,
287,
21015,
198,
11748,
269,
12397,... | 2.60303 | 330 |
#!/usr/bin/env python
import networkx as nx
from networkx.testing import almost_equal
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
3127,
87,
355,
299,
87,
198,
6738,
3127,
87,
13,
33407,
1330,
2048,
62,
40496,
628
] | 3.346154 | 26 |
"""Implements a simple, dynamic type system for API generation.
:author: Anthony Scopatz <scopatz@gmail.com>
Introduction
============
This module provides a suite of tools for denoting, describing, and converting
between various data types and the types coming from various systems. This is
achieved by providing ca... | [
37811,
3546,
1154,
902,
257,
2829,
11,
8925,
2099,
1080,
329,
7824,
5270,
13,
198,
198,
25,
9800,
25,
9953,
1446,
404,
27906,
1279,
1416,
404,
27906,
31,
14816,
13,
785,
29,
198,
198,
21906,
198,
25609,
198,
198,
1212,
8265,
3769,
2... | 2.212985 | 20,100 |
#!/usr/bin/env python
# Filename: util.py
'''
util
@author: Andrew Philpot
@version 0.79
collection of misc utils
Usage: python util.py
Options:
\t-h, --help:\tprint help to STDOUT and quit
\t-v, --verbose:\tverbose output
'''
import sys
import inspect
import types
import getopt
import fileinput
import tempfile
impo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
7066,
12453,
25,
7736,
13,
9078,
198,
198,
7061,
6,
198,
22602,
198,
31,
9800,
25,
6858,
4543,
13059,
198,
31,
9641,
657,
13,
3720,
198,
198,
43681,
286,
12747,
3384,
4487,
198,
... | 2.196114 | 13,380 |
from query_categorizer.errors import NotAllResultsException
from query_categorizer.utils import clean_results
import fastText
import numpy as np
| [
6738,
12405,
62,
66,
47467,
7509,
13,
48277,
1330,
1892,
3237,
25468,
16922,
198,
6738,
12405,
62,
66,
47467,
7509,
13,
26791,
1330,
3424,
62,
43420,
198,
11748,
3049,
8206,
198,
11748,
299,
32152,
355,
45941,
628
] | 3.945946 | 37 |
from setuptools import setup, find_packages
from os import path
import re
project_root = path.join(path.abspath(path.dirname(__file__)))
setup(
name='dataclasses_serialization',
version=get_version(),
packages=find_packages(include=('dataclasses_serialization', 'dataclasses_serialization.*')),
... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
28686,
1330,
3108,
198,
198,
11748,
302,
198,
198,
16302,
62,
15763,
796,
3108,
13,
22179,
7,
6978,
13,
397,
2777,
776,
7,
6978,
13,
15908,
3672,
7,
834,
7753,
834... | 2.764411 | 399 |
import re
from spark_parser.scanner import GenericScanner
from owl.token import OwlbearToken
RESERVED_WORDS = re.split(
r"\s+",
"""
is as or
not and let try end bor bsl bsr div rem pow
type with self case cond bnot band true bxor
error catch begin false
import memory
primitive receive finally undefined other... | [
11748,
302,
198,
198,
6738,
9009,
62,
48610,
13,
35836,
1008,
1330,
42044,
33351,
1008,
198,
198,
6738,
39610,
13,
30001,
1330,
11960,
23160,
451,
30642,
198,
198,
19535,
1137,
53,
1961,
62,
45359,
5258,
796,
302,
13,
35312,
7,
198,
2... | 1.883878 | 2,816 |
"""
This module implements a generic SNMP Panoptes plugin that can consume enrichments for a range of device types in order
to poll those same devices.
"""
import json
import re
import time
from yahoo_panoptes.framework import metrics
from yahoo_panoptes.framework import exceptions
from yahoo_panoptes.framework import... | [
37811,
198,
1212,
8265,
23986,
257,
14276,
11346,
7378,
5961,
404,
4879,
13877,
326,
460,
15000,
22465,
902,
329,
257,
2837,
286,
3335,
3858,
287,
1502,
198,
1462,
3278,
883,
976,
4410,
13,
198,
37811,
198,
11748,
33918,
198,
11748,
302... | 2.668498 | 546 |
"""
[2016-01-15] Challenge #249 [Hard] Museum Cameras
https://www.reddit.com/r/dailyprogrammer/comments/41346z/20160115_challenge_249_hard_museum_cameras/
# Description
You run a museum, and you have a small budget - but you have to protect the museum with cameras. Given some
descriptions of rooms, can you organize t... | [
37811,
198,
58,
5304,
12,
486,
12,
1314,
60,
13879,
1303,
21626,
685,
17309,
60,
9594,
8014,
292,
198,
198,
5450,
1378,
2503,
13,
10748,
13,
785,
14,
81,
14,
29468,
23065,
647,
14,
15944,
14,
44103,
3510,
89,
14,
5304,
486,
1314,
... | 2.438477 | 1,024 |
from .string import StringFilter
from .datetime_range import DateFilter
| [
6738,
764,
8841,
1330,
10903,
22417,
198,
6738,
764,
19608,
8079,
62,
9521,
1330,
7536,
22417,
198
] | 4.235294 | 17 |
import sys
from pyramid.exceptions import ConfigurationError
from pyramid.exceptions import NotFound
from pyramid.settings import asbool
from pyramid.tweens import EXCVIEW
from pyramid.util import DottedNameResolver
import transaction
import warnings
import zope.interface
try:
from pyramid_retry import IRetryableE... | [
11748,
25064,
198,
6738,
27944,
13,
1069,
11755,
1330,
28373,
12331,
198,
6738,
27944,
13,
1069,
11755,
1330,
1892,
21077,
198,
6738,
27944,
13,
33692,
1330,
355,
30388,
198,
6738,
27944,
13,
83,
732,
641,
1330,
7788,
34,
28206,
198,
67... | 3.277174 | 1,288 |
# Generated by Django 4.0 on 2022-01-07 16:26
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
319,
33160,
12,
486,
12,
2998,
1467,
25,
2075,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.904762 | 42 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from numpy import *
from matplotlib.pyplot import *
from matplotlib.ticker import StrMethodFormatter
from mpl_toolkits import mplot3d
from os import system, path, remove
import sys
import re
# ----------------------------------------------------------------
# Running this... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
299,
32152,
1330,
1635,
198,
6738,
2603,
29487,
8019,
13,
9078,
29487,
1330,
1635,
198,
6738,
2603,
29487,
8019,
13,... | 2.210673 | 5,734 |
import sys
import requests
import json
import argparse
import time
parser = argparse.ArgumentParser(description='Collects monitoring data from Pingdom.')
parser.add_argument('-u', '--pingdom-user-name', help='The Pingdom User Name', required=True)
parser.add_argument('-p', '--pingdom-password', help='The Pingdom Passw... | [
11748,
25064,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
31337,
82,
9904,
1366,
422,
34263,
3438,
2637,
8,
198,
48610,
13,
2... | 2.694631 | 298 |
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8
import time
import logger
import subprocess
import pythoncom
from utils import GetAssocExe, GetWindowPID, SetForegroundWindow, COMDispatch
import pywinauto.application
SUPPORTED_BROWSERS = ('iexplore', 'firefox', 'chrome', 'opera', 'seamonkey')
lo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
43907,
25,
900,
2393,
12685,
7656,
28,
40477,
12,
23,
201,
198,
11748,
640,
201,
198,
11748,
49706,
201,
198,
11748,
850,
14681,
201,
198,
201,
198,
11748,
210... | 2.448179 | 357 |
# File: csvimport_connector.py
# Copyright (c) 2022 Splunk Inc.
#
# 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 appli... | [
2,
9220,
25,
269,
21370,
11748,
62,
8443,
273,
13,
9078,
198,
2,
15069,
357,
66,
8,
33160,
13341,
2954,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
... | 2.967054 | 516 |
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# formats: ipynb,py//py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.7.1
# kernelspec:
# display_name: Python 3
# ... | [
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
2685,
62,
38993,
62,
24455,
25,
477,
12095,
18558,
1009,
12095,
20189,
17805,
12095,
2213,
8459,
198,
2,
220,
220,
22... | 2.32571 | 2,536 |
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
Module wrapper for loading ASDF files.
.. note:: The API for this module is currently unstable
and may change in a future release.
"""
import numpy as np
try:
import asdf # noqa
have_asd... | [
2,
770,
318,
1280,
12,
10459,
3788,
11971,
739,
257,
347,
10305,
5964,
13,
198,
2,
4222,
766,
262,
2393,
38559,
24290,
13,
14116,
329,
3307,
13,
198,
37811,
198,
26796,
29908,
329,
11046,
7054,
8068,
3696,
13,
198,
198,
492,
3465,
3... | 2.412013 | 949 |
import logging
| [
11748,
18931,
628,
628,
628,
628,
628,
198
] | 3.125 | 8 |
"""
Compiling tex files and processing bibliography (bib) files.
"""
import subprocess
import sys
import threading
import time
import latex_suite.util
class Outcome:
"""
The outcome of compiling or processing latex and related files.
"""
UNKNOWN = -1
SUCCESS = 0
FAILURE = 1
ABORTED = 2
... | [
37811,
198,
7293,
4386,
48659,
3696,
290,
7587,
275,
45689,
357,
65,
571,
8,
3696,
13,
198,
37811,
198,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
4704,
278,
198,
11748,
640,
198,
198,
11748,
47038,
62,
2385,
578,
13,
2260... | 2.369006 | 5,756 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import numpy as np
import pandas as pd
import warnings
from xarray import conventions, Variable, Dataset, open_dataset
from xarray.core import utils, indexing
from . import TestCase, requires_... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
4732,
8019,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
... | 3.018088 | 387 |
import numpy as np
import networkx as nx
from src import get_img_data_for_2 as gi
import configparser as cp
import Visualize as vis
import Helper as hp
import LocationMapping as LM
import os
image_ids,imgs,cos_img,sorted_k = gi.get_data()
k = input("Enter the number of nearest neighbours ")
k = int(k)
fname = 'IdxI... | [
11748,
299,
32152,
355,
45941,
198,
11748,
3127,
87,
355,
299,
87,
198,
6738,
12351,
1330,
651,
62,
9600,
62,
7890,
62,
1640,
62,
17,
355,
308,
72,
198,
11748,
4566,
48610,
355,
31396,
198,
11748,
15612,
1096,
355,
1490,
198,
11748,
... | 1.942659 | 2,302 |
prsnt_game_start = 0
prsnt_game_credits = 1
prsnt_game_profile_banner_selection = 2
prsnt_game_custom_battle_designer = 3
prsnt_game_multiplayer_admin_panel = 4
prsnt_multiplayer_welcome_message = 5
prsnt_multiplayer_team_select = 6
prsnt_multiplayer_troop_select = 7
prsnt_multiplayer_item_select = 8
prsnt_multiplayer_... | [
1050,
82,
429,
62,
6057,
62,
9688,
796,
657,
198,
1050,
82,
429,
62,
6057,
62,
66,
20696,
796,
352,
198,
1050,
82,
429,
62,
6057,
62,
13317,
62,
3820,
1008,
62,
49283,
796,
362,
198,
1050,
82,
429,
62,
6057,
62,
23144,
62,
38471... | 2.449289 | 1,055 |
"""
The MIT License (MIT)
Copyright (c) 2015 Guillermo Romero Franco (AKA Gato)
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... | [
37811,
198,
464,
17168,
13789,
357,
36393,
8,
198,
198,
15269,
357,
66,
8,
1853,
1962,
4665,
5908,
38623,
22198,
357,
10206,
32,
402,
5549,
8,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
2... | 3.758621 | 319 |
from django.db import models
from djtools.fields.validators import credit_gpa_validator
STATUS = (
("Freshman","Freshman"),
("Transfer","Transfer"),
)
GPA_SCALE = (
("4.0","4.0"),
("5.0","5.0"),
("6.0","6.0"),
("7.0","7.0"),
("8.0","8.0"),
("9.0","9.0"),
("10.0","1... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
201,
198,
201,
198,
6738,
42625,
31391,
13,
25747,
13,
12102,
2024,
1330,
3884,
62,
70,
8957,
62,
12102,
1352,
201,
198,
201,
198,
35744,
2937,
796,
357,
201,
198,
220,
220,
220,
5855,
35857,
... | 1.863208 | 212 |
from db import Base
from sqlalchemy import Column, Float, Integer, String
| [
6738,
20613,
1330,
7308,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
48436,
11,
34142,
11,
10903,
628
] | 4.166667 | 18 |
import sys
import json
import logging
import cfnresponse
import boto3
from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
policyDocument = {
"Version": "2012-10-17",
"Statement": [
{"Effect": "Allow", "Action": "iot:*", "Resource": "*"},
],
}
con... | [
11748,
25064,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
269,
22184,
26209,
198,
11748,
275,
2069,
18,
198,
6738,
10214,
420,
382,
13,
1069,
11755,
1330,
20985,
12331,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
3419,
... | 2.118056 | 432 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from kivy.uix.widget import Widget
from kivy.graphics import Color, Rectangle
from kivy.uix.label import Label
from museolib.widgets.tutorials.tutoitem import TutoItem
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
42655,
1330,
370,
17484,
201,
198,
6738,
479,
452,
88,
13,
70,
11549... | 2.546512 | 86 |
# -*- coding: utf-8 -*-
# Copyright 2013 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
import unittest
from splinter import Bro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
2211,
4328,
3849,
7035,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
198,
2,
5964,
326,
... | 3.21875 | 128 |
"""Contains factories related to processes."""
| [
37811,
4264,
1299,
17590,
3519,
284,
7767,
526,
15931,
198
] | 4.7 | 10 |
"""
Ports define where each port has:
- name
- midpoint: (x, y)
- width:
- orientation: (deg) 0, 90, 180, 270.
where 0 faces east, 90 (north), 180 (west), 270 (south)
"""
from typing import Tuple
import gdsfactory as gf
from gdsfactory.component import Component
@gf.cell
def test_component_with_port(
leng... | [
37811,
198,
47,
2096,
8160,
810,
1123,
2493,
468,
25,
198,
198,
12,
1438,
198,
12,
3095,
4122,
25,
357,
87,
11,
331,
8,
198,
12,
9647,
25,
198,
12,
12852,
25,
357,
13500,
8,
657,
11,
4101,
11,
11546,
11,
20479,
13,
198,
220,
2... | 2.22619 | 420 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wot.io
import wot.ot
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
11748,
266,
313,
13,
952,
198,
11748,
266,
313,
13,
313,
628
] | 2.138889 | 36 |
#!/usr/bin/env python
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import logging
# chainer related
import chainer
from chainer import training
import numpy as np
# * -------------------- agumenting data prep -------------------- *
# * ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
2177,
25824,
21183,
2059,
357,
44592,
7285,
12242,
272,
11231,
8,
198,
2,
220,
24843,
362,
13,
15,
220,
357,
4023,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
... | 3.329759 | 373 |
"""
Created on 27 Oct 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
header:
CURLOPT_HTTPHEADER => array('Accept: application/json'),
"""
import json
from scs_core.data.json import JSONify
from scs_core.client.http_client import HTTPClient
from scs_core.sys.http_exception import HTTPException
fro... | [
37811,
198,
41972,
319,
2681,
2556,
2177,
198,
198,
31,
9800,
25,
31045,
3944,
2364,
357,
1671,
36909,
13,
6667,
2364,
31,
35782,
1073,
5773,
4234,
13,
785,
8,
198,
198,
25677,
25,
198,
34,
21886,
3185,
51,
62,
40717,
37682,
1137,
5... | 4.655738 | 305 |
"""
Contains common functions.
"""
import cv2
import numpy as np
def add_alpha_channel(img):
""" Adds alpha channel to an image.
Parameters:
img (mat): The image which will be received the alpha channel.
Returns:
mat: The image with alpha channel.
"""
gray_img = cv2.c... | [
37811,
220,
198,
4264,
1299,
2219,
5499,
13,
198,
37811,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4299,
751,
62,
26591,
62,
17620,
7,
9600,
2599,
198,
220,
220,
220,
37227,
34333,
17130,
6518,
284,
281,
... | 2.16341 | 1,126 |
from __future__ import absolute_import
from lxml import etree
XMLSyntaxError = etree.XMLSyntaxError
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
198,
55,
5805,
13940,
41641,
12331,
796,
2123,
631,
13,
55,
5805,
13940,
41641,
12331,
198
] | 3.15625 | 32 |
# -*- coding: utf-8 -*-
from .blank_func import reverse
from . import main
__version__ = "0.1.0"
__all__ = [
"reverse",
]
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
764,
27190,
62,
20786,
1330,
9575,
198,
6738,
764,
1330,
1388,
198,
198,
834,
9641,
834,
796,
366,
15,
13,
16,
13,
15,
1,
198,
834,
439,
834,
796,
685,
198,
... | 2.309091 | 55 |
# Generated by Django 1.11.6 on 2018-01-12 10:37
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
21,
319,
2864,
12,
486,
12,
1065,
838,
25,
2718,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
"""Simple script to simulate an MCMC-like routine to check for memory leaks."""
import numpy as np
import os
import psutil
import tracemalloc
from py21cmfast import initial_conditions, perturb_field, run_lightcone
tracemalloc.start()
snapshot = tracemalloc.take_snapshot()
PROCESS = psutil.Process(os.getpid())
oldmem ... | [
37811,
26437,
4226,
284,
29308,
281,
13122,
9655,
12,
2339,
8027,
284,
2198,
329,
4088,
17316,
526,
15931,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
26692,
22602,
198,
11748,
491,
330,
368,
32332,
198,
198,
6738,
... | 2.194656 | 786 |
"""Alphabetize Quiz, by Al Sweigart al@inventwithpython.com
A time-based quiz game to see how fast you can alphabetize letters.
This and other games are available at https://nostarch.com/XX
Tags: short, game, word"""
__version__ = 0
import random, time
# Set up the constants:
# (!) Try changing these constants:
QUESTI... | [
37811,
2348,
19557,
1096,
2264,
528,
11,
416,
978,
19372,
328,
433,
435,
31,
259,
1151,
4480,
29412,
13,
785,
198,
32,
640,
12,
3106,
38964,
983,
284,
766,
703,
3049,
345,
460,
24830,
1096,
7475,
13,
198,
1212,
290,
584,
1830,
389,
... | 2.856322 | 348 |
# The function get_data_home() and clear_data_home() are based on
# SciKit-Learn https://git.io/fjT70. See the 3-clause BSD license.
from io import BytesIO
from os import environ
import shutil
from pathlib import Path
from urllib.request import urlopen
import zipfile
import pandas
def get_data_home(data_home=No... | [
198,
198,
2,
383,
2163,
651,
62,
7890,
62,
11195,
3419,
290,
1598,
62,
7890,
62,
11195,
3419,
389,
1912,
319,
220,
198,
2,
10286,
20827,
12,
20238,
3740,
1378,
18300,
13,
952,
14,
69,
73,
51,
2154,
13,
4091,
262,
513,
12,
565,
6... | 2.931719 | 1,611 |
import sys
import subprocess
import os
if __name__ == "__main__":
args = sys.argv
cmd = " ".join(args[1:-2])
dataset, model_dir = args[-2], args[-1]
for fold_dir in os.listdir(model_dir):
data_fold_dir = os.path.join(data_dir, fold_dir)
model_fold_dir = os.path.join(model_dir, fold_dir)
try:
predict(mod... | [
11748,
25064,
198,
11748,
850,
14681,
198,
11748,
28686,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
22046,
796,
25064,
13,
853,
85,
198,
197,
28758,
796,
366,
27071,
22179,
7,
22046,
58,
16,
21912,
17... | 2.398936 | 188 |
"""
initial conditions for the SPH evrard collapse test
"""
import numpy
from math import *
from amuse.units import nbody_system
from amuse.units import units
from amuse.datamodel import Particles
from amuse.datamodel import ParticlesWithUnitsConverted
from amuse.ext.sobol import i4_sobol_generate
"""
Cr... | [
37811,
198,
36733,
3403,
329,
262,
6226,
39,
819,
81,
446,
9807,
1332,
198,
37811,
198,
11748,
299,
32152,
198,
198,
6738,
10688,
1330,
1635,
198,
198,
6738,
26072,
13,
41667,
1330,
299,
2618,
62,
10057,
198,
6738,
26072,
13,
41667,
1... | 3.534483 | 348 |
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import absolute_import
from ansible.plugins.callback import CallbackBase
__metaclass__ = type
class CallbackModule(CallbackBase):
"""
This callback module prints the output of the single task of the
ovirt-ova-external-... | [
2,
198,
2,
15069,
267,
53,
2265,
46665,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
628,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
9093,
856,
13,
37390,
13,
47423,
... | 2.796209 | 211 |
import math as _math
EARTH_RADIUS = 6371
| [
11748,
10688,
355,
4808,
11018,
628,
198,
17133,
4221,
62,
49,
2885,
40,
2937,
796,
718,
38056,
628,
198
] | 2.368421 | 19 |
# conversions from other unit to meters
DIST_CONVERSIONS = {
"m": 1.0,
"meter": 1.0,
"km": 1000.0,
"kilometer": 1000.0,
"mi": 1609.34,
"mile": 1609.34,
"foot": 0.3048,
"ft": 0.3048,
}
# conversions from other unit to seconds
TIME_CONVERSIONS = {
"s": 1.0,
"sec": 1.0,
"second... | [
2,
32626,
422,
584,
4326,
284,
10700,
198,
35,
8808,
62,
10943,
28884,
11053,
796,
1391,
198,
220,
220,
220,
366,
76,
1298,
352,
13,
15,
11,
198,
220,
220,
220,
366,
27231,
1298,
352,
13,
15,
11,
198,
220,
220,
220,
366,
13276,
... | 1.888889 | 288 |
from django import forms
from django.forms.models import modelform_factory, ALL_FIELDS
from library.forms import ROFormMixin
from .models import CuffDiffFile
EXPRESSION_WIDGETS = {'name': forms.TextInput(),
'sample_1': forms.TextInput(),
'sample_2': forms.TextInput()}
cdf_... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
23914,
13,
27530,
1330,
2746,
687,
62,
69,
9548,
11,
11096,
62,
11674,
3698,
5258,
198,
198,
6738,
5888,
13,
23914,
1330,
15107,
8479,
35608,
259,
198,
6738,
764,
27530,
1330,... | 2.422619 | 168 |
"""Abstract class representing an identity provider
"""
from abc import ABC, abstractmethod
from importlib import import_module
from typing import AsyncContextManager, Optional, Type
class ProviderError(Exception):
"""Any error raised by an IdentityProvider, like:
"Username too short", "Password too weak", ..... | [
37811,
23839,
1398,
10200,
281,
5369,
10131,
198,
37811,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
6738,
19720,
1330,
1081,
13361,
21947,
13511,
11,
32233,
11,
5994,
628,
198,
4... | 2.986301 | 876 |
#
# Copyright (c) 2017 Amit Green. All rights reserved.
#
@gem('Gem.DelayedFileOutput')
| [
2,
198,
2,
220,
220,
15069,
357,
66,
8,
2177,
48148,
3469,
13,
220,
1439,
2489,
10395,
13,
198,
2,
198,
31,
24090,
10786,
38,
368,
13,
13856,
16548,
8979,
26410,
11537,
198
] | 2.757576 | 33 |
"""Module with useful functions (discretise curves, ID conventions, etc) \n
Carmine Schipani, 2021
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from openseespy.opensees import *
from OpenSeesPyAssistant.ErrorHandling import *
from OpenSeesPyAssistant.Units import *
def ProgressingPercentage(max... | [
37811,
26796,
351,
4465,
5499,
357,
15410,
1186,
786,
23759,
11,
4522,
21396,
11,
3503,
8,
3467,
77,
198,
34,
1670,
500,
3059,
541,
3216,
11,
33448,
198,
37811,
198,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2... | 2.802777 | 6,769 |
# coding=utf-8
from __future__ import absolute_import, unicode_literals, division
from fcc.ast.statements.conditional import * # noqa
from fcc.ast.statements.base import * # noqa
from fcc.ast.statements.loop import * # noqa
| [
2,
19617,
28,
40477,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
11,
7297,
198,
198,
6738,
277,
535,
13,
459,
13,
14269,
3196,
13,
17561,
1859,
1330,
1635,
220,
1303,
645,
20402,
198... | 2.961039 | 77 |
import json
import os
import pytest
import yaml
@pytest.mark.service
@pytest.mark.service
def _test_produce_current_json(tmp_path, init_services_default):
"""used strictly to produce the output that needs to be checked. this should only be necessary
if you have on purpose changed configs and need to produce... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
11748,
331,
43695,
628,
198,
31,
9078,
9288,
13,
4102,
13,
15271,
628,
198,
31,
9078,
9288,
13,
4102,
13,
15271,
198,
4299,
4808,
9288,
62,
18230,
344,
62,
14421,
62,
1775... | 2.88162 | 321 |
# Copyright (c) Facebook, Inc. and its affiliates.
# This code originally from https://github.com/mapillary/OpenSfM/blob/main/opensfm/geo.py
import numpy as np
WGS84_a = 6378137.0
WGS84_b = 6356752.314245
def ecef_from_lla(lat, lon, alt):
"""
Compute ECEF XYZ from latitude, longitude and altitude.
All ... | [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
198,
2,
770,
2438,
6198,
422,
3740,
1378,
12567,
13,
785,
14,
8899,
15856,
14,
11505,
50,
69,
44,
14,
2436,
672,
14,
12417,
14,
44813,
38353,
14,
469,
78,
13,
... | 1.957138 | 3,033 |
import pyupm_grove as grove
import time
led = grove.GroveLed(2)
for x in range(0, 5):
led.on()
time.sleep(1)
led.off()
time.sleep(1)
| [
11748,
12972,
929,
76,
62,
27333,
303,
355,
7128,
303,
198,
11748,
640,
198,
198,
992,
796,
7128,
303,
13,
42921,
303,
42416,
7,
17,
8,
198,
1640,
2124,
287,
2837,
7,
15,
11,
642,
2599,
198,
197,
992,
13,
261,
3419,
198,
197,
24... | 2.123077 | 65 |
"""
Do Not Edit this file. You may and are encouraged to look at it for reference.
"""
import unittest
import dnaSequencing
if __name__ == '__main__':
unittest.main()
| [
37811,
198,
5211,
1892,
5312,
428,
2393,
13,
921,
743,
290,
389,
10085,
284,
804,
379,
340,
329,
4941,
13,
198,
37811,
198,
198,
11748,
555,
715,
395,
198,
11748,
288,
2616,
44015,
9532,
198,
198,
361,
11593,
3672,
834,
6624,
705,
8... | 3.035088 | 57 |
from django.contrib.auth.hashers import make_password
# models
from ..models.author import Author
# move request info to Author table with generated url
# args
# ModelAdmin
# request
# queryset (selected requests)
# return
# None
accept_signup_request.short_description = "allow them to be on... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
10134,
7084,
1330,
787,
62,
28712,
198,
198,
2,
4981,
198,
6738,
11485,
27530,
13,
9800,
1330,
6434,
628,
198,
2,
1445,
2581,
7508,
284,
6434,
3084,
351,
7560,
19016,
198,
2,
26498,
... | 3.009174 | 109 |
"""stck1.py - Demo of stck module
stck.py does IBM/390 and other timestamp conversions
$Date: 2008-09-01 14:51:03 +0200 (Mon, 01 Sep 2008) $
$Rev: 81 $
"""
# Copyright 2004-2008 Software AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | [
37811,
301,
694,
16,
13,
9078,
532,
34588,
286,
336,
694,
8265,
628,
220,
220,
336,
694,
13,
9078,
857,
19764,
14,
25964,
290,
584,
41033,
32626,
198,
198,
3,
10430,
25,
3648,
12,
2931,
12,
486,
1478,
25,
4349,
25,
3070,
1343,
446... | 2.482315 | 622 |
# The base game is written with the help of Python Tutorials: https://pythonspot.com/snake-with-pygame/
from pygame.locals import *
from random import randint
from snake_agent import snakeAgent
import pygame
import time
WINDOW_W = 880
WINDOW_H = 880
HUMAN = 0
AGENT_Q = 1
NEURAL_NETWORK = 2
if __name__ == "__m... | [
2,
383,
2779,
983,
318,
3194,
351,
262,
1037,
286,
11361,
36361,
82,
25,
3740,
1378,
79,
5272,
684,
13059,
13,
785,
14,
16184,
539,
12,
4480,
12,
9078,
6057,
14,
198,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
6738,
... | 2.646667 | 150 |
#!/usr/bin/env python3
from scapy.all import *
TARGET = '3.88.183.122'
NULL_DATA = b'\x00' * 48
data = b''
i = 1
while True:
pkt = IP(
dst=TARGET
) / ICMP(
type='echo-request',
id=0x1337,
seq=i
) / NULL_DATA
resp = sr1(pkt)
resp_data = resp[Raw].load.rstrip(b'\n\x... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
629,
12826,
13,
439,
1330,
1635,
198,
198,
51,
46095,
796,
705,
18,
13,
3459,
13,
24839,
13,
18376,
6,
198,
33991,
62,
26947,
796,
275,
6,
59,
87,
405,
6,
1635,
47... | 1.9 | 240 |
# Определить является ли одна строка перестановкой другой
assert mutated_string('asd', 'dsa') == True | [
2,
220,
12466,
252,
140,
123,
21169,
16843,
43666,
16843,
30143,
18849,
20375,
45367,
220,
40623,
38857,
30143,
40623,
16843,
20375,
21727,
40623,
12466,
119,
18849,
12466,
122,
43666,
22177,
16142,
220,
21727,
20375,
21169,
25443,
118,
16142... | 1.355263 | 76 |
# -*- coding: utf-8 -*-
"""
@author: d0t451
@date: 2019/4/17
@desc: fractal utils
"""
import math
import os
import time
from functools import wraps
import cv2 as cv
import numpy as np
# 用时装饰器
def screen_coordinate_to_fx_coordinate(screen_x, screen_y, screen_width, screen_height, fx_short_axis_length=4)... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
220,
220,
220,
288,
15,
83,
36330,
198,
31,
4475,
25,
220,
220,
220,
220,
220,
13130,
14,
19,
14,
1558,
198,
31,
20147,
25,
220,
220,
220... | 1.822657 | 7,150 |
from tbot.twitch_bot.var_filler import fills_vars
from tbot import utils
@fills_vars('uptime') | [
6738,
256,
13645,
13,
31844,
62,
13645,
13,
7785,
62,
69,
4665,
1330,
23816,
62,
85,
945,
198,
6738,
256,
13645,
1330,
3384,
4487,
198,
198,
31,
69,
2171,
62,
85,
945,
10786,
37623,
524,
11537
] | 2.638889 | 36 |
# Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
15069,
357,
66,
8,
1853,
8180,
4992,
290,
7712,
7517,
12052,
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,
287,
11846,
351,... | 3.456 | 250 |
from copy import copy
from datetime import datetime, timedelta
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from functools import wraps
import imp
import inspect
import logging
import os
import re
import smtplib
from sqlalchemy import event, exc
from sqlalchemy.pool import Pool
... | [
6738,
4866,
1330,
4866,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
3053,
13,
76,
524,
13,
5239,
1330,
337,
3955,
2767,
2302,
198,
6738,
3053,
13,
76,
524,
13,
16680,
541,
433,
1330,
337,
3955,
3620,
586,
5... | 2.713344 | 1,214 |
import math
import random
import string
import sys
try:
LIMIT = int(sys.argv[1])
except IndexError:
LIMIT = 200
except ValueError as e:
raise RuntimeError('invalid number') from e
with open('wordlist.txt', encoding='utf8') as f:
words = f.read().splitlines()
for i in words:
if any(j in i for j i... | [
11748,
10688,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
25064,
628,
198,
28311,
25,
198,
220,
220,
220,
27564,
2043,
796,
493,
7,
17597,
13,
853,
85,
58,
16,
12962,
198,
16341,
12901,
12331,
25,
198,
220,
220,
220,
27564,
2043,
... | 2.28103 | 854 |
# -*- coding: UTF-8 -*-
import os
del os
| [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
201,
198,
11748,
28686,
201,
198,
201,
198,
201,
198,
201,
198,
12381,
28686,
201,
198
] | 1.785714 | 28 |
class Team:
"""Immutable notion of a team."""
def __init__(self, team_id, dm):
"""
team_id: id of this team from teams.csv file
dm: DataManager from which this team comes from
"""
self.team_id = team_id
self.dm = dm
@property
| [
4871,
4816,
25,
198,
220,
220,
220,
37227,
24675,
18187,
9495,
286,
257,
1074,
526,
15931,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1074,
62,
312,
11,
288,
76,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
19... | 2.215385 | 130 |
class Error(Exception):
"""Base class"""
pass
class AdbConnectionError(Exception):
"""Raised when ADB can't connect"""
pass
class AdbPushError(Exception):
"""Raised when a file can't be pushed"""
pass
class AdbPullError(Exception):
"""Raised when a file can't be pulled"""
pass
| [
4871,
13047,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
1398,
37811,
198,
220,
220,
220,
1208,
198,
198,
4871,
1215,
65,
32048,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
21762,
1417,
618,
5984,
33,
460,
470,
2018,
37811... | 2.898148 | 108 |
#Author-Chun-Yu Ke
#Description-Creates a VGmesh component.
import adsk.core, adsk.fusion, adsk.cam, traceback
import math
import time
# Globals
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
_units = 'mm'
# Command inputs
_deltaAngle = adsk.core.DropDownCommandInput.cast(None)
_out... | [
2,
13838,
12,
1925,
403,
12,
40728,
3873,
198,
2,
11828,
12,
16719,
274,
257,
34627,
76,
5069,
7515,
13,
198,
198,
11748,
512,
8135,
13,
7295,
11,
512,
8135,
13,
69,
4241,
11,
512,
8135,
13,
20991,
11,
12854,
1891,
198,
11748,
106... | 3.142259 | 478 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import tempfile
import errno
import platform
import shutil
BUILD_SCRIPT = os.path.dirname(os.path.abspath(__file__)) + '/build-script.py'
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
20218,
7753,
198,
11748,
11454,
3919,... | 2.910891 | 101 |
import sys
import json
import datetime
import requests
import re
import signal
from urllib.parse import urlparse
from urllib.parse import parse_qs
'''
This contains utilities used by other functions in the YoutubeDataApi class, as well as a few convenience functions for data analysis.
'''
__all__ = [
'_chunker',... | [
11748,
25064,
198,
11748,
33918,
198,
11748,
4818,
8079,
198,
11748,
7007,
198,
11748,
302,
198,
11748,
6737,
198,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
21136,
62,
48382,
1... | 2.560847 | 567 |
"""
================================
Random Number Generators for LSH
================================
==============================================================================
Utility functions
==============================================================================
sample_indices Sets of uniformly d... | [
37811,
198,
10052,
198,
29531,
7913,
2980,
2024,
329,
406,
9693,
198,
10052,
198,
198,
23926,
25609,
855,
198,
18274,
879,
5499,
198,
23926,
25609,
855,
198,
39873,
62,
521,
1063,
220,
220,
220,
220,
220,
220,
21394,
286,
42096,
9387,
... | 4.602564 | 390 |
from .startup import STARTUP
from .search import SEARCH
from .track import TRACK
from .engage import ENGAGE
from .idle import IDLE
from .error import ERROR
from .shutdown import SHUTDOWN | [
6738,
764,
9688,
929,
1330,
33303,
8577,
198,
6738,
764,
12947,
1330,
7946,
31315,
198,
6738,
764,
11659,
1330,
7579,
8120,
198,
6738,
764,
1516,
496,
1330,
36924,
11879,
198,
6738,
764,
312,
293,
1330,
4522,
2538,
198,
6738,
764,
18224... | 3.576923 | 52 |
from functools import reduce
import asyncio
import re
from typing import Callable, List, Dict, Optional, Tuple
from asyncio.locks import Lock
from discord import Message, File, Embed, Colour
from discord import Member, Status
from discord import VoiceChannel, TextChannel
from discord.ext.commands import Bot
from mode... | [
6738,
1257,
310,
10141,
1330,
4646,
198,
11748,
30351,
952,
198,
11748,
302,
198,
6738,
19720,
1330,
4889,
540,
11,
7343,
11,
360,
713,
11,
32233,
11,
309,
29291,
198,
6738,
30351,
952,
13,
28860,
1330,
13656,
198,
198,
6738,
36446,
1... | 3.9 | 150 |
'''
Created on Feb 24, 2012
@author: mchrzanowski
'''
from time import time
SUM_LIMIT = 10 ** 6
LIMIT = 6 * 10 ** 4 # found through trial and error
if __name__ == '__main__':
start = time()
main()
end = time()
print "Runtime:", end - start, "seconds." | [
7061,
6,
198,
41972,
319,
3158,
1987,
11,
2321,
198,
198,
31,
9800,
25,
285,
354,
81,
15201,
12079,
198,
7061,
6,
198,
198,
6738,
640,
1330,
640,
198,
198,
50,
5883,
62,
43,
3955,
2043,
796,
838,
12429,
718,
198,
43,
3955,
2043,
... | 2.5 | 110 |
import requests
from bs4 import BeautifulSoup as bs
from datetime import datetime
import json
import sys
import time
import random
# Hard code checkout details at the bottom
# must have Ssense account
# clear cart before running bot otherwise you will get an error
# account may get flagged if ran too many times
# onl... | [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
275,
82,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4738,
628,
198,
2,
6912,
2438,
28006,
3307,
379,
26... | 3.306785 | 339 |
"""Scan and CveException classes"""
import cloudpassage.sanity as sanity
from .utility import Utility as utility
from .exceptions import CloudPassageValidation
from .http_helper import HttpHelper
class Scan(object):
"""Initializing the Scan class:
Args:
session (:class:`cloudpassage.HaloSession`): T... | [
37811,
33351,
290,
327,
303,
16922,
6097,
37811,
198,
198,
11748,
6279,
6603,
496,
13,
12807,
414,
355,
34182,
198,
6738,
764,
315,
879,
1330,
34030,
355,
10361,
198,
6738,
764,
1069,
11755,
1330,
10130,
14478,
496,
7762,
24765,
198,
67... | 2.281493 | 3,215 |
from flask import Flask
from flask import render_template
from flask import url_for
import threading
import sys
import os
import webbrowser
import time
import fire
app = Flask(__name__, static_folder='static')
@app.route('/')
if __name__ == '__main__':
main()
| [
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
42903,
1330,
19016,
62,
1640,
198,
11748,
4704,
278,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
3992,
40259,
198,
11748,
640,
198,
11748,
2046,
198,
198,... | 3.238095 | 84 |
"""
==========================================
Title: PyPlayer SleepManager
Author: @jaquielajoie
Date: 17 July 2021
Liscence: Apache 2.0
==========================================
"""
import time
"""
SleepManager is a child of MarkovPlayer
This class quantizes sleep times according to BPM
"""
| [
37811,
198,
10052,
2559,
855,
198,
11851,
25,
220,
9485,
14140,
17376,
13511,
198,
6434,
25,
2488,
6592,
421,
8207,
34944,
494,
198,
7536,
25,
220,
220,
1596,
2901,
33448,
198,
406,
2304,
594,
25,
24843,
362,
13,
15,
198,
10052,
2559,... | 3.886076 | 79 |
#-*-coding:utf-8-*-
import cv2
import matplotlib.pyplot as plt
import sys
import copy
camID = 0
capture = cv2.VideoCapture(camID)
cv2.namedWindow("camera",1)
#set FRAME_WIDTH,FRAME_HEIGHT
'''
设置摄像机分辨率的问题。
最小分辨率,宽度为4,高度为3。
以此类推应该为4的倍数或3的倍数。
你可以通过videocapture成员函数set来设置,摄像机的分辨率。
videocapture默认的情况下为64... | [
2,
12,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
201,
198,
201,
198,
11748,
269,
85,
17,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
25064,
201,
198,
11748,
4866,
201,
198,
201,
198,
... | 2.361667 | 1,200 |
from lollipop.types import Type
__all__ = [
'TypeRegistry',
]
class TypeRegistry(object):
"""Storage for type instances with ability to get type instance proxy with
delayed type resolution for implementing mutual cross-references.
Example: ::
TYPES = TypeRegistry()
PersonType = T... | [
6738,
300,
692,
42800,
13,
19199,
1330,
5994,
628,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
6030,
8081,
4592,
3256,
198,
60,
628,
198,
198,
4871,
5994,
8081,
4592,
7,
15252,
2599,
198,
220,
220,
220,
37227,
31425,
329,... | 2.442446 | 278 |
#!/usr/bin/env python
from pandas_ml.core.accessor import (_AccessorMethods, _attach_methods,
_wrap_target_pred_func,
_wrap_target_pred_noargs)
import pandas_ml.util as util
class MetricsMethods(_AccessorMethods):
"""
Accessor to ``skl... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
19798,
292,
62,
4029,
13,
7295,
13,
15526,
273,
1330,
44104,
15457,
273,
46202,
11,
4808,
47348,
62,
24396,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.16877 | 3,804 |
import unittest
from ..core import Parametric
| [
11748,
555,
715,
395,
198,
198,
6738,
11485,
7295,
1330,
25139,
19482,
628,
628,
198
] | 3.4 | 15 |
import pytest
from youtube_api.client import VideoAPI
from youtube_api.exceptions import *
@pytest.mark.parametrize(('resource_filter', 'parts', 'optional_params', 'expected_exception'), [
({'id': 1}, ('test',), {}, PartNotAllowed),
({'test': 1}, ('snippet',), {}, ... | [
11748,
12972,
9288,
198,
198,
6738,
35116,
62,
15042,
13,
16366,
1330,
7623,
17614,
198,
6738,
35116,
62,
15042,
13,
1069,
11755,
1330,
1635,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
10786,
31092,
62,
24455,
3... | 2.180258 | 233 |
#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import os
import glob
# os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import numpy as np
import fid
from scipy.misc import imread
import tensorflow as tf
import h5py
import json
tf.app.flags.DEFINE_string('image_folder','',"""Path where... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
15095,
198,
2,
28686,
13,
268,
2268,
17816,
43633,
5631,
62,
29817,
345... | 2.683077 | 650 |
grid = [[1,3,4], [2,2,3], [1,2,4]]
print(surfaceArea(grid))
| [
198,
25928,
796,
16410,
16,
11,
18,
11,
19,
4357,
685,
17,
11,
17,
11,
18,
4357,
685,
16,
11,
17,
11,
19,
11907,
198,
4798,
7,
42029,
30547,
7,
25928,
4008,
628
] | 1.878788 | 33 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'pin/$', 'pin_passcode.views.form', name='pin_form'),
url(r'pin/auth$', 'pin_passcode.views.auth', name='pin_auth'),
)
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
2291,
11,
19016,
628,
198,
6371,
33279,
82,
796,
7572,
7,
198,
220,
220,
220,
705,
3256,
198,
220,
220,
220,
19016,
7,
81,
6,
11635,
32624,
3256,
705,
11635,
62,
6603,
8... | 2.505747 | 87 |
def fahrenheit_from(celsius: int):
"""
This function takes the celsius, multiplies, divides, and adds to
convert it to fahrenheit, rounds the number to digits, and sends the
final number as a string.
"""
fahrenheit = float(celsius) * 9 / 5 + 32
fahrenheit = round(fahrenheit, 3)
... | [
4299,
277,
993,
34032,
62,
6738,
7,
5276,
82,
3754,
25,
493,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
770,
2163,
2753,
262,
269,
32495,
11,
15082,
444,
11,
36319,
11,
290,
6673,
284,
201,
198,
220,
220,
220,
... | 2.459641 | 446 |
from tsticle.node import TNode
| [
6738,
256,
301,
1548,
13,
17440,
1330,
309,
19667,
628
] | 3.2 | 10 |