content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import turtle
import math
import speech_recognition as sr
import re
r = sr.Recognizer()
with sr.Microphone() as source:
print('Say Something')
audio=r.listen(source)
try:
print('Google thinks you said:\n' + r.recognize_google(audio))
except:
pass
n=r.recognize_google(audio)
patterns= [... | [
11748,
28699,
198,
11748,
10688,
198,
11748,
4046,
62,
26243,
653,
355,
19677,
198,
11748,
302,
628,
628,
628,
198,
198,
81,
796,
19677,
13,
6690,
2360,
7509,
3419,
198,
4480,
19677,
13,
13031,
4862,
3419,
355,
2723,
25,
198,
220,
220... | 2.264535 | 344 |
import ply.lex as lex
keywords = {
'BREAK', 'CONST', 'CONTINUE', 'ELIF',
'ELSE', 'FOR', 'FUNC', 'GOTO',
'IF', 'RETURN', 'STRUCT', 'TYPE',
'VAR' }
operators = {
'ADD', # +
'SUB', # -
'MUL', # *
'QUO', # /
'REM', # %
'AND', # &
'OR', # |
'SHL', # <<
'SHR', # ... | [
11748,
35960,
13,
2588,
355,
31191,
198,
198,
2539,
10879,
796,
1391,
198,
220,
220,
220,
705,
40438,
10206,
3256,
705,
10943,
2257,
3256,
705,
37815,
1268,
8924,
3256,
705,
3698,
5064,
3256,
198,
220,
220,
220,
705,
3698,
5188,
3256,
... | 1.629401 | 1,136 |
from distutils.core import setup, Extension
from distutils import sysconfig
cfg_vars = sysconfig.get_config_vars()
for key, value in cfg_vars.items():
if type(value) == str:
cfg_vars[key] = value.replace('-Wstrict-prototypes', '')
cpp_args = ['-std=c++11']
ext_modules = [
Extension(
'HEAAN',
... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
11,
27995,
198,
6738,
1233,
26791,
1330,
25064,
11250,
198,
198,
37581,
62,
85,
945,
796,
25064,
11250,
13,
1136,
62,
11250,
62,
85,
945,
3419,
198,
1640,
1994,
11,
1988,
287,
30218,
70,
62,
... | 2.243781 | 402 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for checks."""
import os
from absl import app
from grr_response_core import config
from grr_response_core.lib.parsers import config_file as config_file_parsers
from grr_response_core.lib.parsers import linux_cmd_parser
from grr_response_core.lib.parsers import... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
8794,
526,
15931,
198,
198,
11748,
28686,
198,
198,
6738,
2352,
75,
1330,
598,
198,
198,
6738,
... | 2.786674 | 1,936 |
# Strategy known as "Grim Trigger" or "Grudger".
# We will cooperate repeatedly until our opponent betrays us once.
# Then, we will get angry and defect for the rest of time.
#
# In this implementation, I used the memory variable to store Grim Trigger's state of mind.
# memory is true if Grim Trigger has been wronged, ... | [
2,
20561,
1900,
355,
366,
38,
3036,
24593,
1,
393,
366,
8642,
463,
1362,
1911,
198,
2,
775,
481,
21270,
7830,
1566,
674,
6125,
731,
20477,
514,
1752,
13,
198,
2,
3244,
11,
356,
481,
651,
7954,
290,
11855,
329,
262,
1334,
286,
640,... | 3.723404 | 94 |
import os
import requests
import json
from base64 import b64encode, b64decode
# NOTE: For 'requests' to work with 'https' addrs, must use 'verify=False'
# to ignore invalid SSL certificates.
TEST_URL = 'https://10.210.39.16/jsonrpc'
# NOTE: List is used to control the order in which RPC requests are sent (order
# matte... | [
11748,
28686,
198,
11748,
7007,
198,
11748,
33918,
198,
6738,
2779,
2414,
1330,
275,
2414,
268,
8189,
11,
275,
2414,
12501,
1098,
198,
2,
24550,
25,
1114,
705,
8897,
3558,
6,
284,
670,
351,
705,
5450,
6,
751,
3808,
11,
1276,
779,
70... | 1.891815 | 4,899 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
1853,
7651,
16528,
9564,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,... | 2.940054 | 367 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from pip.req import parse_requirements
with open('README.rst') as readme_file:
readme = readme_file.read()
install_reqs = parse_requirements('requirements.txt'... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
334,
27112,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
1233... | 2.408309 | 698 |
from .typereduction import *
| [
6738,
764,
4906,
445,
8110,
1330,
1635,
201,
198
] | 3.333333 | 9 |
import discord
import datetime
from discord.ext import commands
from all import food_list
# adding cog to bot setup | [
11748,
36446,
198,
11748,
4818,
8079,
198,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
477,
1330,
2057,
62,
4868,
628,
198,
198,
2,
4375,
43072,
284,
10214,
9058
] | 3.966667 | 30 |
#
# @lc app=leetcode.cn id=198 lang=python3
#
# [198] house-robber
#
None
# @lc code=end | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
13,
31522,
4686,
28,
22337,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
22337,
60,
2156,
12,
22609,
527,
198,
2,
198,
14202,
198,
2,
2488,
44601,
2438,
28,
437
] | 2.146341 | 41 |
"""
Given a m * n matrix grid which is sorted in non-increasing order both
row-wise and column-wise.
Return the number of negative numbers in grid.
Example:
Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
Output: 8
Explanation: There are 8 negatives number in the matri... | [
37811,
198,
220,
220,
220,
11259,
257,
285,
1635,
299,
17593,
10706,
543,
318,
23243,
287,
1729,
12,
42647,
1502,
1111,
220,
198,
220,
220,
220,
5752,
12,
3083,
290,
5721,
12,
3083,
13,
220,
198,
220,
220,
220,
8229,
262,
1271,
286,... | 2.618421 | 304 |
import pandas as pd
import numpy as np
from statsmodels.formula.api import ols
import plotly_express
import plotly.graph_objs as go
from plotly.subplots import make_subplots
# Read in data
batter_data = pd.read_csv("~/Desktop/MLB_FA/Data/fg_bat_data.csv")
del batter_data['Age']
print(len(batter_data))
print(batter_dat... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
9756,
27530,
13,
687,
4712,
13,
15042,
1330,
267,
7278,
198,
11748,
7110,
306,
62,
42712,
198,
11748,
7110,
306,
13,
34960,
62,
672,
8457,
355,
467,
198,
... | 2.377922 | 4,149 |
import json
import re
import tensorflow as tf
import tensorflow_text as text
import tensorflow_hub as hub
from official.nlp.modeling import networks
from official.nlp.tools import export_tfhub_lib
from absl import app, flags
from tqdm import tqdm
from save_as_weight_from_saved_model import create_model
FLAGS = flags.F... | [
11748,
33918,
198,
11748,
302,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
5239,
355,
2420,
198,
11748,
11192,
273,
11125,
62,
40140,
355,
12575,
198,
6738,
1743,
13,
21283,
79,
13,
4666,
10809,
1330,
7... | 2.779487 | 195 |
"""
Automount utility.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
__all__ = ['AutoMounter']
class AutoMounter(object):
"""
Automount utility.
Being connected to the udiskie daemon, this component automatically
mounts newly discovered external devices. Insta... | [
37811,
198,
38062,
608,
10361,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
628,
198,
834,
439,
834,
796,
37250,
27722,
44,
6828,
20520,
628,
... | 2.621072 | 541 |
"""Beacon Python Application Configuration."""
import json
import os
from configparser import ConfigParser
from collections import namedtuple
from distutils.util import strtobool
def parse_drspaths(paths):
"""Parse handover configuration."""
return [p.strip().split(',', 2) for p in paths.split('\n') if p.spl... | [
37811,
3856,
7807,
11361,
15678,
28373,
526,
15931,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
4566,
48610,
1330,
17056,
46677,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
1233,
26791,
13,
22602,
1330,
965,
83,
672,
970... | 2.515324 | 1,403 |
"""
A collection of EOTasks for feature manipulation
"""
from .temporal_features import (
AddSpatioTemporalFeaturesTask,
AddMaxMinTemporalIndicesTask,
AddMaxMinNDVISlopeIndicesTask,
)
from .interpolation import (
InterpolationTask,
ResamplingTask,
LinearInterpolationTask,
CubicInterpolation... | [
37811,
198,
32,
4947,
286,
412,
2394,
6791,
329,
3895,
17512,
198,
37811,
198,
198,
6738,
764,
11498,
35738,
62,
40890,
1330,
357,
198,
220,
220,
220,
3060,
4561,
39485,
12966,
35738,
23595,
25714,
11,
198,
220,
220,
220,
3060,
11518,
... | 2.821978 | 455 |
# -*- coding: utf-8 -*-
# Copyright 2016 Open Permissions Platform Coalition
# 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 appl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
1584,
4946,
2448,
8481,
19193,
15135,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779... | 3.683983 | 231 |
import argparse
import os
from subprocess import check_call
import sys
import utils
PYTHON = sys.executable
parser = argparse.ArgumentParser()
parser.add_argument('--parent_dir', default='experiments/learning_rate',
help='Directory containing params.json')
parser.add_argument('--data_dir', defau... | [
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
6738,
850,
14681,
1330,
2198,
62,
13345,
198,
11748,
25064,
198,
198,
11748,
3384,
4487,
628,
198,
47,
56,
4221,
1340,
796,
25064,
13,
18558,
18187,
198,
48610,
796,
1822,
29572,
13,
2810... | 2.75841 | 327 |
""" Module for enums and constants. """
from enum import Enum
class TileType(str, Enum):
"""Enum for types of tiles in the world.
These types represent types of planetary surfaces.
"""
SPACE = " "
LUSH = "L"
ARID = "D"
AQUATIC = "W"
SOLAR = "*"
class Resource(str, Enum):
"""En... | [
37811,
19937,
329,
551,
5700,
290,
38491,
13,
37227,
198,
198,
6738,
33829,
1330,
2039,
388,
628,
198,
4871,
47870,
6030,
7,
2536,
11,
2039,
388,
2599,
198,
220,
220,
220,
37227,
4834,
388,
329,
3858,
286,
19867,
287,
262,
995,
13,
... | 2.607143 | 588 |
#!/usr/bin/env python3
"""
Generate a summary of last week's issues tagged with "topic: feature".
The summary will include a list of new and changed issues and is sent each
Monday at 0200 CE(S)T to the typing-sig mailing list. Due to limitation
with GitHub Actions, the mail is sent from a private server, currently
ma... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
8645,
378,
257,
10638,
286,
938,
1285,
338,
2428,
30509,
351,
366,
26652,
25,
3895,
1911,
198,
198,
464,
10638,
481,
2291,
257,
1351,
286,
649,
290,
3421,
2428,
... | 2.492337 | 522 |
#Datosdeentrada
print("Ingrese el Sexo (H/M):")
sexo = input()
print("Ingrese la EdadSLLB:")
#proceso
edad = int(input())
if edad>=70:
print("la vacuna es de tipo C")
if sexo=="H":
edad>=16 and edad<=69
print("la vacuna es de tipo A")
if sexo=="M":
edad>=16 and edad<=69
print("la vacuna es de tipo B")
if edad... | [
2,
27354,
418,
2934,
298,
81,
4763,
198,
4798,
7203,
27682,
260,
325,
1288,
14419,
78,
357,
39,
14,
44,
2599,
4943,
198,
8044,
78,
796,
5128,
3419,
198,
4798,
7203,
27682,
260,
325,
8591,
1717,
324,
50,
3069,
33,
25,
4943,
198,
2,... | 2.168675 | 166 |
__author__ = 'Aaron Yang'
__email__ = 'byang971@usc.edu'
__date__ = '12/24/2020 10:01 PM'
func1() | [
834,
9800,
834,
796,
705,
34451,
10998,
6,
198,
834,
12888,
834,
796,
705,
1525,
648,
24,
4869,
31,
16241,
13,
15532,
6,
198,
834,
4475,
834,
796,
705,
1065,
14,
1731,
14,
42334,
838,
25,
486,
3122,
6,
628,
198,
198,
20786,
16,
... | 2.222222 | 45 |
# class Array(Instruction):
# def __init__(self, dest, src):
# self.dest = dest
# self.src = src
| [
628,
628,
628,
198,
198,
2,
1398,
15690,
7,
6310,
2762,
2599,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2244,
11,
12351,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16520,
796,
2244,
198... | 2.083333 | 60 |
import csv
from oscar.core.loading import import_module
report_classes = import_module('reports.reports', ['ReportGenerator'])
analytics_models = import_module('analytics.models', ['ProductRecord', 'UserRecord'])
| [
11748,
269,
21370,
198,
198,
6738,
267,
13034,
13,
7295,
13,
25138,
1330,
1330,
62,
21412,
198,
13116,
62,
37724,
796,
1330,
62,
21412,
10786,
48922,
13,
48922,
3256,
37250,
19100,
8645,
1352,
6,
12962,
198,
38200,
14094,
62,
27530,
796... | 3.421875 | 64 |
from . import *
class strip_to_slot(pya.PCellDeclarationHelper):
"""
The PCell declaration for the strip_to_slot.
draft by Lukas Chrostowski july 24, 2017
based on https://www.osapublishing.org/oe/fulltext.cfm?uri=oe-21-16-19029&id=259920
"""
| [
6738,
764,
1330,
1635,
198,
198,
4871,
10283,
62,
1462,
62,
43384,
7,
79,
3972,
13,
5662,
695,
37835,
10186,
47429,
2599,
198,
220,
37227,
198,
220,
383,
4217,
695,
14305,
329,
262,
10283,
62,
1462,
62,
43384,
13,
198,
220,
4538,
41... | 2.645833 | 96 |
URL_is_Null = "The URL is null" | [
21886,
62,
271,
62,
35067,
796,
366,
464,
10289,
318,
9242,
1
] | 2.583333 | 12 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# check and return missing values in each features in the dataframe
def missing_statistics(df):
"""
This function check and return missing values in each features for a dataframe
Parameters
----------
... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
628,
198,
2,
2198,
290,
1441,
4814,
3815,
287,
1123,
3033,
... | 2.814672 | 259 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import cv2
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import YoloHelper
# In[2]:
yolo_net, yolo_output_layers, yolo_classes = YoloHelper.load_yolo('yolov3.weights','yolov3.cfg', 'coco.names')
# In[3]:
img = cv2.imread('test-image.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,... | 2.029516 | 847 |
from PIL import Image, ImageDraw
from skimage.measure import compare_ssim as ssim
from numpy import array
from pickle import loads
from flask import Flask, request
from os import path
import genetic.individual
import json
from base64 import b64decode
image_path = '/home/ubuntu/image.jpg'
individual_path = '/home/ubunt... | [
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
198,
6738,
1341,
9060,
13,
1326,
5015,
1330,
8996,
62,
824,
320,
355,
264,
14323,
198,
6738,
299,
32152,
1330,
7177,
198,
6738,
2298,
293,
1330,
15989,
198,
6738,
42903,
1330,
46947,
11,
2... | 3.011905 | 168 |
"""Views for deposit of records."""
from __future__ import absolute_import, print_function
from flask import Blueprint, redirect, render_template, url_for
from flask_login import login_required
from flask_security import current_user
from .forms import RecordForm
from .api import create_record
# define a new Flask... | [
37811,
7680,
82,
329,
14667,
286,
4406,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
198,
198,
6738,
42903,
1330,
39932,
11,
18941,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
198,
6738,
4290... | 2.782946 | 516 |
from skills_taxonomy import PROJECT_DIR
from pprint import pprint
from skills_taxonomy.utils.json_management import load_json, save_json
def input_name(class_id, informative_words):
"""Print most informative words, and then ask for
user input to assign a suitable name.
Args:
class_id(str): id for... | [
6738,
4678,
62,
19290,
30565,
1330,
21965,
23680,
62,
34720,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
4678,
62,
19290,
30565,
13,
26791,
13,
17752,
62,
27604,
1330,
3440,
62,
17752,
11,
3613,
62,
17752,
628,
198,
4299,
5128,
... | 2.522924 | 807 |
# -*- coding: utf-8 -*-
import numpy as np
from .base import DataFlow
__all__ = []
class _EmptyDataFlow(DataFlow):
"""Empty data flow.
This class is useful when constructing a data flow by merging
sources from other data flows.
"""
@property
@property
@property
@property
@p... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
8692,
1330,
6060,
37535,
198,
198,
834,
439,
834,
796,
17635,
628,
198,
4871,
4808,
40613,
6601,
37535,
7,
6601,
3753... | 2.908451 | 142 |
from os import getenv
import json
from flask import Flask, render_template, request, jsonify
from flask_mongoengine import MongoEngine
from flask_pymongo import PyMongo
from pymongo import MongoClient
| [
6738,
28686,
1330,
651,
24330,
198,
11748,
33918,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
33918,
1958,
198,
6738,
42903,
62,
76,
25162,
18392,
1330,
42591,
13798,
198,
6738,
42903,
62,
79,
4948,
25162,
1330,
94... | 3.865385 | 52 |
# --------------------------------------------------------
# MTCNN
# Licensed under The MIT License [see LICENSE for details]
# Copyright 2019 smarsu. All Rights Reserved.
# --------------------------------------------------------
import os.path as osp
import cv2
import numpy as np
from mtcnn import PNet, RNet, ONet... | [
2,
20368,
22369,
198,
2,
337,
4825,
6144,
198,
2,
49962,
739,
383,
17168,
13789,
685,
3826,
38559,
24290,
329,
3307,
60,
198,
2,
15069,
13130,
895,
945,
84,
13,
1439,
6923,
33876,
13,
198,
2,
20368,
22369,
198,
198,
11748,
28686,
13... | 2.315248 | 1,069 |
from typing import Dict, List
from jina.executors.crafters import BaseSegmenter
class JiebaSegmenter(BaseSegmenter):
"""
:class:`JiebaSegmenter` split the chinese text on the doc-level into words on the chunk-level with `jieba`.
"""
def __init__(self, mode: str = 'accurate', *args, **kwargs):
... | [
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
6738,
474,
1437,
13,
18558,
315,
669,
13,
66,
430,
47131,
1330,
7308,
41030,
434,
263,
628,
198,
4871,
449,
494,
7012,
41030,
434,
263,
7,
14881,
41030,
434,
263,
2599,
198,
220,
220,... | 2.229947 | 561 |
# -----------------------------------------------------------------------
# Use Case 2
# -----------------------------------------------------------------------
import sys
import csv
import scriptutils
import traceback
if __name__ == "__main__":
try:
assert (len(sys.argv) == 2), \
"Script requ... | [
2,
16529,
26866,
198,
2,
220,
5765,
8913,
362,
198,
2,
16529,
26866,
198,
11748,
25064,
198,
11748,
269,
21370,
198,
11748,
4226,
26791,
198,
11748,
12854,
1891,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
... | 3.125 | 240 |
# Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""\
This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O er... | [
2,
27323,
2848,
8265,
329,
4808,
45163,
11,
4955,
617,
3224,
7291,
198,
2,
9177,
287,
11361,
13,
220,
22503,
416,
3941,
449,
504,
6248,
13,
198,
198,
37811,
59,
198,
1212,
8265,
3769,
617,
517,
11361,
291,
1104,
329,
25952,
13,
198,... | 2.35641 | 3,409 |
import random
import torch
import collections
from myrl.agents.agent import Agent
from myrl.utils.memory import ReplayMemory
from myrl.models import FullyConnectedNet, get_optimizer
from myrl.utils.save import net_directory, get_filename
| [
11748,
4738,
198,
11748,
28034,
198,
11748,
17268,
198,
198,
6738,
616,
45895,
13,
49638,
13,
25781,
1330,
15906,
198,
6738,
616,
45895,
13,
26791,
13,
31673,
1330,
23635,
30871,
198,
6738,
616,
45895,
13,
27530,
1330,
40234,
13313,
276,
... | 3.809524 | 63 |
import numpy as np
from tfsnippet.dataflow import DataMapper
__all__ = ['BaseSampler', 'BernoulliSampler', 'UniformNoiseSampler']
class BaseSampler(DataMapper):
"""Base class for samplers."""
def sample(self, x):
"""
Sample array according to `x`.
Args:
x (np.ndarray): ... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
256,
9501,
77,
3974,
316,
13,
7890,
11125,
1330,
6060,
44,
11463,
198,
198,
834,
439,
834,
796,
37250,
14881,
16305,
20053,
3256,
705,
23927,
280,
15516,
16305,
20053,
3256,
705,
3118,
6933... | 2.457035 | 1,059 |
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
from checkov.common.models.enums import CheckResult, CheckCategories
check = GKENetworkPolicyEnabled()
| [
6738,
2198,
709,
13,
353,
430,
687,
13,
42116,
13,
31092,
13,
8692,
62,
31092,
62,
8367,
62,
9122,
1330,
7308,
26198,
11395,
9787,
198,
6738,
2198,
709,
13,
11321,
13,
27530,
13,
268,
5700,
1330,
6822,
23004,
11,
6822,
34,
26129,
62... | 3.654545 | 55 |
from django.contrib.auth import get_user_model
from rest_framework import filters
from rest_framework.viewsets import ModelViewSet
from pastebin.users.permissions import IsAuthenticatedOrCreate
from pastebin.users.serializers import UserSerializer
User = get_user_model()
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
1334,
62,
30604,
1330,
16628,
198,
6738,
1334,
62,
30604,
13,
1177,
28709,
1330,
9104,
7680,
7248,
198,
198,
6738,
1613,
23497,
13,
18417,
13,
52... | 3.767123 | 73 |
"""empty message
Revision ID: fbfec56d097e
Revises: 3b1f45ed96c7
Create Date: 2018-06-27 10:04:50.000959
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "fbfec56d097e"
down_revision = "3b1f45ed96c7"
branch_labels = None
depends_on = None
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
277,
19881,
721,
3980,
67,
2931,
22,
68,
198,
18009,
2696,
25,
513,
65,
16,
69,
2231,
276,
4846,
66,
22,
198,
16447,
7536,
25,
2864,
12,
3312,
12,
1983,
838,
25,
3023,
25,
1120,... | 2.392 | 125 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | [
2,
15069,
357,
34,
8,
3050,
12,
9804,
6219,
12406,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
123... | 3.389273 | 578 |
import numpy, scipy
from matplotlib.ticker import FuncFormatter
import matplotlib.colors as colors
from echem_plate_math import *
import time, pickle
from echem_plate_fcns import *
p='C:/Users/Public/Documents/EchemDropAnalyzedData/FCVdata/20130523 NiFeCoCe_3V_FCV_4835/Sample4825_x60_y65_A33B23C3D40_FCVS7.txt'
p2='C:... | [
11748,
299,
32152,
11,
629,
541,
88,
198,
6738,
2603,
29487,
8019,
13,
83,
15799,
1330,
11138,
66,
8479,
1436,
198,
11748,
2603,
29487,
8019,
13,
4033,
669,
355,
7577,
198,
6738,
304,
15245,
62,
6816,
62,
11018,
1330,
1635,
198,
11748... | 1.864397 | 1,674 |
l = lambda *x: print("%s %s %s" % x)
l(1,2,3)
| [
75,
796,
37456,
1635,
87,
25,
3601,
7203,
4,
82,
4064,
82,
4064,
82,
1,
4064,
2124,
8,
198,
75,
7,
16,
11,
17,
11,
18,
8,
198
] | 1.642857 | 28 |
from django.db import models
from django.urls import reverse
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
2,
13610,
534,
4981,
994,
13,
628
] | 3.708333 | 24 |
begin_unit
comment|'# Copyright 2013 IBM Corp.'
nl|'\n'
comment|'# Copyright 2011 OpenStack Foundation'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance... | [
27471,
62,
20850,
198,
23893,
91,
6,
2,
15069,
2211,
19764,
11421,
2637,
198,
21283,
91,
6,
59,
77,
6,
198,
23893,
91,
6,
2,
15069,
2813,
4946,
25896,
5693,
6,
198,
21283,
91,
6,
59,
77,
6,
198,
23893,
91,
6,
2,
1439,
6923,
33... | 1.9223 | 44,852 |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.2.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# --... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
17519,
25,
20966,
2047,
65,
11,
9078,
25,
25067,
1... | 2.772936 | 1,308 |
"""
hellostats sample API
author: Alex G.S.
Utils for use by the hello app such as html formatting
getting loadavg of the server and ipaddress
"""
import os, socket, re
import requests
import json
# server tools and stats
def get_ip():
"""get the ip address for the server"""
aws_url="http://169.254.169.254... | [
37811,
198,
12758,
455,
1381,
6291,
7824,
198,
9800,
25,
4422,
402,
13,
50,
13,
198,
198,
18274,
4487,
329,
779,
416,
262,
23748,
598,
884,
355,
27711,
33313,
198,
37210,
3440,
615,
70,
286,
262,
4382,
290,
20966,
21975,
198,
198,
3... | 2.222812 | 1,131 |
"""
Unit Tests for preprocess module.
"""
import sys
import math
import unittest
import argparse
import numpy
import pysam
from mixemt import phylotree
from mixemt import preprocess
# TODO: Stuff to test:
# def process_reads(samfile, var_pos, min_mq, min_bq):
# def build_em_input(samfile, refseq, phylo, args):
... | [
37811,
198,
26453,
30307,
329,
662,
14681,
8265,
13,
198,
37811,
198,
198,
11748,
25064,
198,
11748,
10688,
198,
11748,
555,
715,
395,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
198,
11748,
279,
893,
321,
198,
198,
6738,
5022,
368... | 2.753731 | 134 |
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Tests for Settings Access Permissions."""
from unittest.mock import Mock
from django.test import TestCase
from api.common.permissions.settings_access import SettingsAccessPermission
from api.iam.models import User
class SettingsAccessPermiss... | [
2,
198,
2,
15069,
33448,
2297,
10983,
3457,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
198,
37811,
51,
3558,
329,
16163,
8798,
2448,
8481,
526,
15931,
198,
6738,
555,
715,
395,
13,
76,
... | 2.641121 | 535 |
import uuid
import asyncio
import httpx
from hannah.http.mappings import HTTPTrafficMapper
REQUEST_RATE_LIMIT = 50
| [
11748,
334,
27112,
198,
11748,
30351,
952,
198,
198,
11748,
2638,
87,
198,
198,
6738,
289,
25761,
13,
4023,
13,
76,
39242,
1330,
14626,
15721,
2108,
44,
11463,
628,
198,
2200,
35780,
62,
49,
6158,
62,
43,
3955,
2043,
796,
2026,
628,
... | 2.837209 | 43 |
#!/usr/bin/env python3
import sdfield_generator
import sys
if __name__ == "__main__":
if(len(sys.argv) == 5):
sdf = sdfield_generator.SDF_Generator(str(sys.argv[1]), resolution = int(sys.argv[2]), padding = float(sys.argv[3]))
distance_array, sdf_origin, sdf_spacing, sdf_resolution = sdf.calcu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
45647,
3245,
62,
8612,
1352,
198,
11748,
25064,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
220,
628,
220,
220,
220,
611,
7,
11925,
7,
17597,
1... | 2.408 | 375 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-11-13 02:31
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1495,
319,
13130,
12,
1157,
12,
1485,
7816,
25,
3132,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198... | 2.754386 | 57 |
import argparse
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from astropy.io import fits
from astropy.modeling.models import Linear1D
from astropy.modeling.fitting import LinearLSQFitter
from miri_ramp_utils import get_ramp, get_good_ramp, fit_diffs, calc_lincor
if __name__ == "__main... | [
11748,
1822,
29572,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
6468,
28338,
13,
952,
1330,
11414,
198,
6738,
6468,
2833... | 1.882379 | 6,657 |
import FWCore.ParameterSet.Config as cms
source = cms.Source("EmptySource")
# name of DQM Source program
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
hlxdqmsource = DQMEDAnalyzer('HLXMonitor',
NBINS = cms.untracked.uint32(335), ## 10 bunch crossings per bin
Style = cms.untracked.string('BX'), ## ... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
10459,
796,
269,
907,
13,
7416,
7203,
40613,
7416,
4943,
198,
198,
2,
1438,
286,
360,
48,
44,
8090,
1430,
198,
6738,
360,
48,
5653,
712,
1063,
13,
14055,
13,
... | 2.539683 | 378 |
from queue import Queue
from generateAST import TreeNode
# tranverse the tree to find the defect node
# usually use the pattern call.value | [
6738,
16834,
1330,
4670,
518,
198,
6738,
7716,
11262,
1330,
12200,
19667,
198,
198,
2,
491,
272,
4399,
262,
5509,
284,
1064,
262,
11855,
10139,
198,
198,
2,
3221,
779,
262,
3912,
869,
13,
8367
] | 4 | 35 |
#Copyright (c) 2021, Rutwik and contributors
# For license information, please see license.txt
import frappe, json, datetime
from frappe.utils import getdate
from frappe.model.document import Document
from accounting.accounting.doctype.gl_entry.gl_entry import make_gl_entries
@frappe.whitelist(allow_guest=True)
| [
2,
15269,
357,
66,
8,
33448,
11,
21214,
20763,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
11748,
5306,
27768,
11,
33918,
11,
4818,
8079,
198,
6738,
5306,
27768,
13,
26791,
1330,
651,
4475,
198,
6... | 3.315789 | 95 |
from abc import ABC, abstractmethod
from typing import Union, Tuple, Iterable, TypeVar
from .. import ex
T = TypeVar('T', bound=IRow)
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
4479,
11,
309,
29291,
11,
40806,
540,
11,
5994,
19852,
198,
198,
6738,
11485,
1330,
409,
628,
198,
198,
51,
796,
5994,
19852,
10786,
51,
3256,
5421,
28,
4663,
322,
... | 3.159091 | 44 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import io
from setuptools import find_packages, setup
with io.open("README.rst", encoding="UTF-8") as readme_file:
readme = readme_file.read()
with io.open("CHANGELOG.rst", encoding="UTF-8") as changelog_file:
history = changelog_file.rea... | [
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,
464,
9058,
4226,
526,
15931,
198,
198,
11748,
33245,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
1... | 2.443686 | 586 |
import numpy as np
import sympy as sp
HyperbolicTangentFluidFractionSolution().DerivativeCalculator() | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
10558,
88,
355,
599,
201,
198,
201,
198,
38197,
65,
4160,
43909,
298,
37,
2290,
312,
37,
7861,
46344,
22446,
28532,
452,
876,
9771,
3129,
1352,
3419
] | 3 | 35 |
from jason.ctrnn import CTRNN
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
import random
import sys
import json
import os
import math
from util.fitness_functions import fitness_maximize_output_change, fitness_frequency_match
def simulate_ctrnn(ctrnn, stepsize=0.01, init... | [
198,
6738,
474,
888,
13,
24087,
20471,
1330,
34577,
6144,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
8071,
2052,
355,
285,
8071,
2052,
198,
11748,
299,
32152,
355,
45941,
198,
11748,... | 2.689723 | 506 |
#!/usr/bin/env python3
import codecs, json
from PokeFacts import DataPulls | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
40481,
82,
11,
33918,
198,
6738,
41163,
37,
8656,
1330,
6060,
42940,
82
] | 3 | 25 |
#!python3
try:
from .Settings import *
except Exception: # ImportError
from Settings import *
import time
from classes import Variable_Holder as VH
import math
import websocket
import json
import threading
global vars
vars = VH()
if __name__ == "__main__":
print("Main function started:\n")
if... | [
2,
0,
29412,
18,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
764,
26232,
1330,
1635,
198,
16341,
35528,
25,
220,
1303,
17267,
12331,
198,
220,
220,
220,
422,
16163,
1330,
1635,
198,
11748,
640,
198,
6738,
6097,
1330,
35748,
62,
39... | 2.521154 | 520 |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, spi
from esphome.const import CONF_ID, CONF_MAINS_FILTER, CONF_REFERENCE_RESISTANCE, \
CONF_RTD_NOMINAL_RESISTANCE, CONF_RTD_WIRES, ICON_THERMOMETER, UNIT_CELSIUS
max31865_ns = cg.esphome_ns.namespace('max318... | [
11748,
1658,
746,
462,
13,
8189,
5235,
355,
269,
70,
198,
11748,
1658,
746,
462,
13,
11250,
62,
12102,
341,
355,
269,
85,
198,
6738,
1658,
746,
462,
13,
5589,
3906,
1330,
12694,
11,
599,
72,
198,
6738,
1658,
746,
462,
13,
9979,
13... | 2.17509 | 554 |
# This file exists only so that I can do `os.path.dirname(dummy.__file__)`
| [
2,
770,
2393,
7160,
691,
523,
326,
314,
460,
466,
4600,
418,
13,
6978,
13,
15908,
3672,
7,
67,
13513,
13,
834,
7753,
834,
8,
63,
198
] | 2.777778 | 27 |
"""
`miniwdl <https://github.com/chanzuckerberg/miniwdl/>`_ is a developer toolkit and local runner for
the bioinformatics-focused `Workflow Description Language (WDL) <http://openwdl.org/>`_. This
documentation covers the Python3 ``WDL`` package facilitating parsing & static analysis of WDL
documents.
* `GitHub repo ... | [
37811,
198,
63,
1084,
14246,
25404,
1279,
5450,
1378,
12567,
13,
785,
14,
3147,
89,
12603,
3900,
14,
1084,
14246,
25404,
15913,
63,
62,
318,
257,
8517,
2891,
15813,
290,
1957,
17490,
329,
198,
1169,
13401,
259,
18982,
873,
12,
18143,
... | 2.66269 | 3,940 |
# Generated by Django 3.1.1 on 2020-10-11 20:24
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
16,
319,
12131,
12,
940,
12,
1157,
1160,
25,
1731,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# test_model.py
import numpy as np
from grabscreen import grab_screen
import cv2
import time
from alexnet import alexnet
from getkeys import key_check
import serial
arduinoSerial = serial.Serial('com4',9600)
time.sleep(1)
import random
WIDTH = 160
HEIGHT = 120
LR = 1e-3
EPOCHS = 20
MODEL_NAME = 'self-driving-car-fas... | [
2,
1332,
62,
19849,
13,
9078,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
5552,
9612,
1330,
5552,
62,
9612,
198,
11748,
269,
85,
17,
198,
11748,
640,
198,
6738,
257,
2588,
3262,
1330,
257,
2588,
3262,
198,
6738,
651,
13083,
... | 2.314159 | 226 |
#
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ap... | [
2,
198,
2,
220,
220,
220,
357,
66,
8,
15069,
1853,
30446,
15503,
12,
11869,
446,
7712,
5834,
11,
406,
13,
47,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
... | 2.566381 | 1,981 |
#!/usr/bin/env python
# $Id$
#------------------------------------------------------------------------
# NAME: grid_sizer_dialog.py -
# HISTORY: -
# 2017-07-21 leerw@ornl.gov -
# Fixing _OnCharHook for Linux.
# 2017-03-31 leerw@ornl.gov -
# Added EVT_CHAR_HOOK
# 2015-02-14 leerw@ornl.gov -
#--... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
720,
7390,
3,
198,
2,
10097,
982,
198,
2,
197,
20608,
25,
197,
197,
25928,
62,
82,
7509,
62,
38969,
519,
13,
9078,
197,
197,
197,
197,
12,
198,
2,
197,
39,
42480,
25,
197,
1... | 3.211592 | 1,432 |
""" Module to handle attributes related to the pbs jobmanager
configuration """
import os
import logging
from osg_configure.modules import utilities
from osg_configure.modules import configfile
from osg_configure.modules import validation
from osg_configure.modules.jobmanagerconfiguration import JobManagerConfigurat... | [
37811,
19937,
284,
5412,
12608,
3519,
284,
262,
279,
1443,
1693,
37153,
220,
198,
11250,
3924,
37227,
198,
198,
11748,
28686,
198,
11748,
18931,
198,
198,
6738,
28686,
70,
62,
11250,
495,
13,
18170,
1330,
20081,
198,
6738,
28686,
70,
62... | 2.353573 | 2,141 |
import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.HTMonitor_cfi import hltHTmonitoring
from DQMOffline.Trigger.JetMonitor_cfi import hltJetMETmonitoring
from DQMOffline.Trigger.TrackingMonitoring_cff import *
DisplacedJetIter2TracksMonitoringHLT = trackingMonHLT.clone()
DisplacedJetIter2TracksMonitor... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
6738,
360,
48,
44,
28657,
13,
48344,
13,
6535,
35479,
62,
66,
12463,
1330,
289,
2528,
6535,
41143,
278,
198,
6738,
360,
48,
44,
28657,
13,
48344,
13,
42273,
3... | 2.470633 | 6,640 |
import numpy as np
from scipy import special
from numpy import linalg as LA
# noisy max
'''some LDP primitives'''
# stochastic rounding (Duchi et al.)
# piecewise mechanism (Wang et al.)
# square wave (Li et al.)
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
629,
541,
88,
1330,
2041,
198,
6738,
299,
32152,
1330,
300,
1292,
70,
355,
9131,
628,
628,
198,
2,
31210,
3509,
628,
198,
7061,
6,
11246,
406,
6322,
2684,
20288,
7061,
6,
628,
198,
2,
... | 2.935897 | 78 |
import pytest
from db.models.job_type import JobType
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
20613,
13,
27530,
13,
21858,
62,
4906,
1330,
15768,
6030,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 2.727273 | 33 |
import pickle
############################################################################### | [
11748,
2298,
293,
198,
198,
29113,
29113,
7804,
4242,
21017
] | 9.4 | 10 |
# -*- coding: utf-8 -*-
from setuptools import setup, Extension
packages = [
"swig_ex2",
]
ext_modules = [
Extension(
name="_swig_ex2",
sources=["ex2.c", "ex2_wrap.c"],
),
]
setup(
name="swig_ex2",
version="1.0.0",
description="SWIG Example2",
ext_modules=ext_modules,
packages=packages,
package_dir={"sw... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
27995,
198,
198,
43789,
796,
685,
198,
197,
1,
2032,
328,
62,
1069,
17,
1600,
198,
60,
198,
198,
2302,
62,
18170,
796,
685,
... | 2.181818 | 154 |
import hashlib
import logging
import os
import threading
import time
from tkinter import *
import cv2
import numpy as np
from PIL import Image, ImageTk
from src.ImageProcessing.contouring import cnt_from_img, save_contour, save_image
class ResizingImageCanvas(Canvas):
"""
Customized Canvas that can handle d... | [
11748,
12234,
8019,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4704,
278,
198,
11748,
640,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
... | 2.005046 | 7,134 |
# -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from setuptools import setup, find_packages
# todo: add install_requires and test_requires
setup(name='hookman',
version='0.1.2',
packages=find_packages(),
test_requires = ['py.test>=2.92', 'mock'],
... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
11,
3601,
62,
8818,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198... | 2.583333 | 276 |
from app import app
"""
If Twisted's WSGI server is not desired in favor for solutions like uwsgi or gunicorn or anything similar,
the `crochet` library can execute Twisted code in an isolated thread. Be EXTREMELY careful with this solution!
Python's WSGI servers generally use threads, as does `crochet`, and/or process... | [
6738,
598,
1330,
598,
198,
37811,
198,
1532,
40006,
338,
25290,
18878,
4382,
318,
407,
10348,
287,
2661,
329,
8136,
588,
334,
18504,
12397,
393,
2485,
291,
1211,
393,
1997,
2092,
11,
198,
1169,
4600,
19915,
20043,
63,
5888,
460,
12260,
... | 3.14539 | 282 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
3050,
12,
5539,
16749,
2724,
4914,
3831,
1462,
198,
2,
220,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,... | 2.907205 | 916 |
# TCP Server
from socket import socket, AF_INET, SOCK_STREAM
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.Util import Counter
import os
class Server:
''' Shell Server '''
def str_xor(self, s1, s2):
''' Encrypt/Decrypt function '''
r... | [
2,
23633,
9652,
201,
198,
6738,
17802,
1330,
17802,
11,
12341,
62,
1268,
2767,
11,
311,
11290,
62,
2257,
32235,
201,
198,
6738,
36579,
13,
15202,
9218,
1330,
42319,
201,
198,
6738,
36579,
13,
34,
10803,
1330,
34329,
11,
29673,
7902,
1... | 2.195177 | 1,783 |
# File: infrastructure_service.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
from .ds_base_service import DSBaseService
from .ds_find_service import DSFindService
from ..model.infrastructure import Infrastructure
| [
2,
9220,
25,
6884,
62,
15271,
13,
9078,
198,
2,
198,
2,
49962,
739,
24843,
362,
13,
15,
357,
5450,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
13,
14116,
8,
198,
2,
198,
198,
6738,
764,... | 3.269231 | 78 |
# this Python file uses the following encoding: utf-8
import os # to execute shall cmds
import time # to sleep()
import redis # to interface with the queue of requests. installed with => python3 -m pip install redis
import requests # because if's simpler to use for an http query than the default python . installed w... | [
2,
428,
11361,
2393,
3544,
262,
1708,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
1303,
284,
12260,
2236,
23991,
82,
198,
11748,
640,
1303,
284,
3993,
3419,
198,
11748,
2266,
271,
1303,
284,
7071,
351,
262,
16834,
286,
7007,
... | 2.534574 | 376 |
from django.core.urlresolvers import reverse
from utilities.utils import CleanTestCase
class ViewsTest(CleanTestCase):
'''Tests for all the views in the events app'''
fixtures = [
'events.json'
]
def test_event_page_view(self):
'''Tests the context for the page that shows
all the details about a c... | [
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
198,
6738,
20081,
13,
26791,
1330,
5985,
14402,
20448,
198,
198,
4871,
29978,
14402,
7,
32657,
14402,
20448,
2599,
198,
197,
7061,
6,
51,
3558,
329,
477,
262,
500... | 2.83908 | 261 |
"""
Functions to transform firework model files to netCDF files
"""
import logging
import os
import sys
import numpy as np
import datetime
import xarray as xr
import click
import smoke.utils.utilities as utilities
from pathlib import Path
from smoke.load.parsers import *
logging.getLogger(__name__).addHandler(loggin... | [
37811,
198,
24629,
2733,
284,
6121,
2046,
1818,
2746,
3696,
284,
2010,
34,
8068,
3696,
198,
37811,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4818,
8079,
198,
11748,
2124,
1874... | 2.847134 | 471 |
from django.test import TestCase
from django.core.urlresolvers import reverse
from contact_updater import views
api_data = {
'offices': [],
'public_liaison_email': None,
'foia_libraries': [{'url': 'http://www.amtrak.com/library'}],
'simple_processing_time': 1.0,
'name': 'AMTRAK',
'common_requ... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
198,
6738,
2800,
62,
929,
67,
729,
1330,
5009,
628,
198,
15042,
62,
7890,
796,
1391,
198,
220,
220,
220,
7... | 2.319672 | 488 |
"""
Module for creating mask features
Credits:
Copyright (c) 2017-2022 Matej Aleksandrov, Matej Batič, Grega Milčinski, Domagoj Korais, Matic Lubej (Sinergise)
Copyright (c) 2017-2022 Žiga Lukšič, Devis Peressutti, Nejc Vesel, Jovan Višnjić, Anže Zupanc (Sinergise)
Copyright (c) 2019-2020 Jernej Puc, Lojze Žust (Siner... | [
37811,
198,
26796,
329,
4441,
9335,
3033,
198,
198,
42855,
25,
198,
15269,
357,
66,
8,
2177,
12,
1238,
1828,
24787,
73,
9300,
591,
392,
18657,
11,
24787,
73,
6577,
72,
46195,
11,
8547,
64,
4460,
46195,
21141,
11,
9666,
3839,
73,
509... | 2.651481 | 2,195 |
# -*- coding: utf-8 -*-
import locale
############## Manejo de archivos ##############
with open("5_with.py", "r", encoding='utf-8') as file: #With permite cerrar el archivo automaticamente cuando se ejecute el bloque
print(locale.getpreferredencoding())
# LANG environment variable
print(locale.setlocale(... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
36693,
198,
198,
7804,
4242,
2235,
42736,
7639,
390,
3934,
452,
418,
1303,
7804,
4242,
2,
198,
198,
4480,
1280,
7203,
20,
62,
4480,
13,
9078,
1600,
366,
81,
160... | 2.75 | 124 |
import sys
from PyQt5.QtWidgets import *
if __name__=='__main__':
main()
| [
11748,
25064,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1635,
628,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
628
] | 2.285714 | 35 |
"""Import handler tests."""
from pathlib import Path
from marshpy.core.constants import UNDEFINED
from marshpy.core.errors import ErrorCode
from marshpy.tag_handlers.import_handler import ImportHandler
from tests.tag_handlers.path_handler_helpers import check_path_tag
from tests.tag_handlers.path_handler_helpers impo... | [
37811,
20939,
21360,
5254,
526,
15931,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
22397,
9078,
13,
7295,
13,
9979,
1187,
1330,
4725,
7206,
20032,
1961,
198,
6738,
22397,
9078,
13,
7295,
13,
48277,
1330,
13047,
10669,
198,
6738,
... | 2.153171 | 1,025 |
import abc
import sys
import typing
from yadi import listeners
SINGLETON = 'singleton'
PROTOTYPE = 'prototype'
| [
11748,
450,
66,
198,
11748,
25064,
198,
11748,
19720,
198,
198,
6738,
331,
9189,
1330,
22054,
628,
628,
198,
50,
2751,
2538,
11357,
796,
705,
12215,
10565,
6,
198,
4805,
2394,
2394,
56,
11401,
796,
705,
38124,
6,
198
] | 2.974359 | 39 |
#!/usr/bin/env python
"""
Copyright (c) 2012 The Ohio State University.
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 req... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
220,
220,
15069,
357,
66,
8,
2321,
383,
6835,
1812,
2059,
13,
628,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198... | 3.152091 | 263 |
import numpy as np
from collections import Counter
from scipy import stats
from util import * | [
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
15034,
198,
6738,
629,
541,
88,
1330,
9756,
198,
6738,
7736,
1330,
1635
] | 4.227273 | 22 |
#!/usr/bin/python3 -S
# -*- coding: utf-8 -*-
"""
`Unit tests for cargo.clients.create_pool`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
2016 Jared Lunde © The MIT License (MIT)
http://github.com/jaredlunde
"""
import unittest
from multiprocessing import cpu_count
from ca... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
532,
50,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
4600,
26453,
5254,
329,
15892,
13,
565,
2334,
13,
17953,
62,
7742,
63,
198,
438,
9... | 2.326425 | 193 |
import polygon2cog as p2c
import unittest
import numpy as np
if __name__ == '__main__':
unittest.main()
| [
11748,
7514,
14520,
17,
66,
519,
355,
279,
17,
66,
198,
11748,
555,
715,
395,
198,
11748,
299,
32152,
355,
45941,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
555,
715,
... | 2.375 | 48 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import tensorflow as tf
from tensorflow.contrib.seq2seq.python.ops import basic_decoder
from tensorflow.python.framework import ops
from tensorflow.python.ops import nn_ops
from tensorflow.py... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
17268,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,... | 2.324271 | 1,508 |
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.spectral_norm as SpectralNorm
| [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
20471,
13,
26791,
13,
4443,
1373,
62,
27237,
355,... | 3.333333 | 45 |
"""
Afterglow Core: AJAX API endpoints
"""
url_prefix = '/ajax/'
from .app_authorizations import *
from .tokens import *
from .sessions import *
from .initialize import *
from .oauth2_providers import *
from .oauth2_clients import *
from .server_status import *
| [
37811,
198,
3260,
4743,
322,
7231,
25,
25347,
25922,
7824,
886,
13033,
198,
37811,
198,
198,
6371,
62,
40290,
796,
31051,
1228,
897,
14,
6,
198,
198,
6738,
764,
1324,
62,
9800,
4582,
1330,
1635,
198,
6738,
764,
83,
482,
641,
1330,
1... | 2.988889 | 90 |