content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas
import torch
import torchvision
from piq import MultiScaleSSIMLoss
from config import RESULTS_PATH
from data_management import (
AlmostFixedMaskDataset,
CropOrPadAndResimulate,
Flatten,
Jitter,
Nor... | [
11748,
28686,
198,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
198,
11748,
28034,
198,
11748,
28034,
10178,
198,
... | 2.144192 | 3,211 |
from setuptools import setup
from versioningit import get_cmdclasses
if __name__ == "__main__":
setup(
cmdclass=get_cmdclasses(),
)
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
2196,
278,
270,
1330,
651,
62,
28758,
37724,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
9058,
7,
198,
220,
220,
220,
220,
220,
220,
220,
239... | 2.660714 | 56 |
from collections import OrderedDict
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
628
] | 4.625 | 8 |
# script for mapping Ensembl and uniprot IDs to entrez gene IDs for the source networks
# HI-union, BioPlex, QUBIC, CoFrac, Lit-BM-13
import config
import itertools
import sys
# function that returns a dict to map from uniprot or ensembl ID to a list of entrez gene IDs
# function that receives a list with the origin... | [
2,
4226,
329,
16855,
2039,
4428,
75,
290,
555,
541,
10599,
32373,
284,
920,
21107,
9779,
32373,
329,
262,
2723,
7686,
198,
2,
36210,
12,
24592,
11,
16024,
46383,
11,
1195,
10526,
2149,
11,
1766,
6732,
330,
11,
25659,
12,
12261,
12,
... | 2.219205 | 2,541 |
import sys
sys.path.append("/home/christian/Environments/social_media_api/fastapi")
from fastapi import status, HTTPException, Depends, APIRouter
from app import models, schemas, utils
from sqlalchemy.orm import Session
from app.database import get_db
router = APIRouter(
prefix= "/users",
tags=['Users']
)
@ro... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
14,
11195,
14,
43533,
666,
14,
4834,
12103,
14,
14557,
62,
11431,
62,
15042,
14,
7217,
15042,
4943,
198,
6738,
3049,
15042,
1330,
3722,
11,
14626,
16922,
11,
2129,
2412,
11,
3486,
4... | 2.874214 | 159 |
print 3,4,5
| [
4798,
513,
11,
19,
11,
20,
198
] | 1.714286 | 7 |
from utilities.dictionary_utility import DictionaryUtility
from diff.diff import Diff
from diff.operation_type import OperationType
from metamodel.element import Element
from metamodel.model import Model
| [
6738,
20081,
13,
67,
14188,
62,
315,
879,
1330,
28261,
18274,
879,
198,
6738,
814,
13,
26069,
1330,
10631,
198,
6738,
814,
13,
27184,
62,
4906,
1330,
14680,
6030,
198,
6738,
1138,
321,
375,
417,
13,
30854,
1330,
11703,
198,
6738,
1138... | 3.962264 | 53 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2018, Jianfeng Chen <jchen37@ncsu.edu>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
... | [
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,
2,
15069,
357,
34,
8,
2864,
11,
40922,
69,
1516,
12555,
1279,
73,
6607,
2718,
31,
10782,
2385,
13,
15532,
... | 2.645925 | 1,141 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012, Mike Taylor
#
# This file is part of printio released under MIT license.
# See the LICENSE for more information.
from setuptools import setup, find_packages
import printio as pkg
name = pkg.__name__
setup(name=pkg.__name__,
version=pkg.__ve... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
2321,
11,
4995,
8121,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
3601,
952,
2716,
73... | 2.352357 | 403 |
# @Time : 2019/2/12 16:10
# @Author : xufqing
from rest_framework import serializers
from ..models import Dict
class DictSerializer(serializers.ModelSerializer):
'''
字典序列化
''' | [
2,
2488,
7575,
220,
220,
220,
1058,
13130,
14,
17,
14,
1065,
1467,
25,
940,
198,
2,
2488,
13838,
220,
1058,
2124,
3046,
80,
278,
198,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
11485,
27530,
1330,
360,
713,
198,
198,... | 2.325301 | 83 |
#! /usr/bin/env python
"""
Patherator
@author: Vincent Politzer <https://github.com/vjapolitzer>
Dependencies: numpy, scipy, pillow, pypotrace, pyclipper, skimage, sklearn
TraceNFill Configuration Parameters:
mediaWidth: Width of media in mm, i.e. 200.0
mediaHeight: Height of media in mm, i.e. 200.0
alignToMed... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
47,
1032,
1352,
198,
31,
9800,
25,
18653,
2165,
10557,
1279,
5450,
1378,
12567,
13,
785,
14,
85,
73,
499,
349,
10557,
29,
198,
198,
35,
2690,
3976,
25,
299,
3215... | 2.963979 | 583 |
from keystone_plugin.testing.base import TestKeystoneBase
import requests
| [
6738,
1994,
6440,
62,
33803,
13,
33407,
13,
8692,
1330,
6208,
9218,
6440,
14881,
198,
11748,
7007,
628
] | 4.166667 | 18 |
from thyme.util.ints import uint32, uint64
# 1 Thyme coin = 1,000,000,000,000 = 1 trillion mojo.
_mojo_per_thyme = 1000000000000
_blocks_per_year = 1681920 # 32 * 6 * 24 * 365
_halflife = 3
_coins_per_block = 5
def calculate_pool_reward(height: uint32) -> uint64:
"""
Returns the pool reward at a certain bloc... | [
6738,
11906,
1326,
13,
22602,
13,
29503,
1330,
20398,
2624,
11,
20398,
2414,
198,
198,
2,
352,
31468,
1326,
10752,
796,
352,
11,
830,
11,
830,
11,
830,
11,
830,
796,
352,
12989,
6941,
7639,
13,
198,
62,
5908,
7639,
62,
525,
62,
20... | 2.606943 | 893 |
import xml.etree.ElementTree as ET
from pyposterous.error import PyposterousError
from pyposterous.models import element_map, attribute_map
class Parser(object):
"""This object is responsible for parsing the Pyposterous API data and
returning nice Python objects."""
def build_object(se... | [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
6738,
279,
4464,
6197,
516,
13,
18224,
1330,
350,
4464,
6197,
516,
12331,
198,
6738,
279,
4464,
6197,
516,
13,
27530,
1330,
5002,
62,
8899,
11,
11688,
62,
8899,
198,
... | 2.130621 | 1,868 |
from setuptools import setup
setup(
name= 'CARTdb',
version = '0.1.0',
description = 'blaCreate CART database for CAVA and gff3 output',
url = '...',
author = 'RahmanTeam',
author_email = 'rahmanlab@icr.ac.uk',
license = 'MIT',
packages=['cartdb'],
scripts=['bin/CARTdb.py','bin/cart... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
28,
705,
34,
7227,
9945,
3256,
198,
220,
220,
220,
2196,
796,
705,
15,
13,
16,
13,
15,
3256,
198,
220,
220,
220,
6764,
796,
705,
2436,
64,
16447,
... | 2.328859 | 149 |
import ctypes
from typing import Sequence, Tuple
from aecg100 import structures
_SamplingCallback = ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.c_int)
_SamplingErrorCallback = ctypes.CFUNCTYPE(None, ctypes.c_int)
class _PpgModule:
"""PPG module API implementation."""
def play_ppg_waveform(self, *waveforms: Tup... | [
11748,
269,
19199,
198,
198,
6738,
19720,
1330,
45835,
11,
309,
29291,
198,
6738,
257,
721,
70,
3064,
1330,
8573,
198,
198,
62,
16305,
11347,
47258,
796,
269,
19199,
13,
22495,
4944,
4177,
56,
11401,
7,
14202,
11,
269,
19199,
13,
66,
... | 2.497222 | 1,440 |
from antelope_core.providers.xl_dict import XlDict
from .exceptions import DuplicateSubAssembly
import os
import xlrd
def validate_sheet(sheet):
"""
checks whether the sheet includes references to unrecognized assemblies; returns the names of the
unrecognized assemblies
"""
xld = XlDict(sheet)
... | [
6738,
1885,
47329,
62,
7295,
13,
15234,
4157,
13,
87,
75,
62,
11600,
1330,
1395,
75,
35,
713,
198,
6738,
764,
1069,
11755,
1330,
49821,
5344,
7004,
49670,
198,
11748,
28686,
198,
11748,
2124,
75,
4372,
628,
198,
4299,
26571,
62,
21760... | 2.076287 | 1,088 |
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer, Dense | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
30203,
355,
509,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
34398,
11,
360,
1072
] | 3.352941 | 34 |
"""Merging firstname and lastname into fullname
Revision ID: 0ea9cc1d59dc
Revises: 5b2e98bad72a
Create Date: 2016-06-25 20:35:22.647563
"""
# revision identifiers, used by Alembic.
revision = '0ea9cc1d59dc'
down_revision = '5b2e98bad72a'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchem... | [
37811,
13102,
2667,
717,
3672,
290,
938,
3672,
656,
1336,
3672,
198,
198,
18009,
1166,
4522,
25,
657,
18213,
24,
535,
16,
67,
3270,
17896,
198,
18009,
2696,
25,
642,
65,
17,
68,
4089,
14774,
4761,
64,
198,
16447,
7536,
25,
1584,
12,... | 2.5 | 132 |
import json
from openpyxl import load_workbook
from openpyxl.cell import Cell
wb = load_workbook('抽取数据(脑区、症状、易感人群、概率)2.0.xlsx')
sheet = wb.active
# 用于存储数据的数组
list1 = []
list2 = []
list3 = []
for row in range(2, sheet.max_row + 1):
id_cell = sheet.cell(row=row, column=1)
id_text = id_cell.value
# 将表中第一列... | [
11748,
33918,
198,
198,
6738,
1280,
9078,
87,
75,
1330,
3440,
62,
1818,
2070,
198,
6738,
1280,
9078,
87,
75,
13,
3846,
1330,
12440,
198,
198,
39346,
796,
3440,
62,
1818,
2070,
10786,
162,
232,
121,
20998,
244,
46763,
108,
162,
235,
... | 1.33066 | 2,120 |
# Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 5.15.2
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore
qt_resource_data = b"\
\x00\x00\x0dB\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00@\x00\x00\... | [
2,
20857,
2134,
2438,
357,
37906,
513,
8,
201,
198,
2,
15622,
416,
25,
2134,
2438,
201,
198,
2,
15622,
416,
25,
383,
20857,
3082,
5329,
329,
33734,
2196,
642,
13,
1314,
13,
17,
201,
198,
2,
39410,
0,
1439,
2458,
925,
287,
428,
2... | 1.264264 | 9,184 |
from django.urls import path, include
from . import api
apipatterns = [
path(r'', api.index, name='ars-api'),
path(r'submit', api.submit, name='ars-submit'),
path(r'messages', api.messages, name='ars-messages'),
path(r'agents', api.agents, name='ars-agents'),
path(r'actors', api.actors, name='ars-... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
198,
198,
6738,
764,
1330,
40391,
198,
198,
499,
541,
265,
759,
82,
796,
685,
198,
220,
220,
220,
3108,
7,
81,
6,
3256,
40391,
13,
9630,
11,
1438,
11639,
945,
12,
15042,
3380... | 2.41841 | 239 |
#!/usr/bin/env python3
# Ensure environmental variables i.e. paths are set to the named the modules
from xf_fintech_python import DeviceManager, CFB76, OptionType
import sys
# Basic checking that the number of arguments are correct
if len(sys.argv) != 2:
sys.exit("Incorrect number of arguments supplied - 1 expect... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
48987,
6142,
9633,
1312,
13,
68,
13,
13532,
389,
900,
284,
262,
3706,
262,
13103,
198,
6738,
2124,
69,
62,
69,
600,
3055,
62,
29412,
1330,
16232,
13511,
11,
18551,
33,
... | 3.032407 | 864 |
import pathlib
from time import time
import cv2 as cv
import numpy as np
from keras.applications.mobilenet import MobileNet
from keras.applications.mobilenet import decode_predictions
from keras.applications.mobilenet import preprocess_input
from keras.preprocessing.image import img_to_array
from keras.preprocessing.i... | [
11748,
3108,
8019,
198,
6738,
640,
1330,
640,
198,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
1324,
677,
602,
13,
76,
25898,
268,
316,
1330,
12173,
7934,
198,
6738,
41927,
2... | 2.421687 | 332 |
"""
@FileName: inference.py
@Description: Implement inference
@Author: Ryuk
@CreateDate: 2020/05/15
@LastEditTime: 2020/05/15
@LastEditors: Please set LastEditors
@Version: v0.1
"""
from model import *
from utils import *
import torch
import matplotlib.pyplot as plt
model = VADNet()
model.load_state_dict(torch.load(... | [
37811,
198,
31,
8979,
5376,
25,
32278,
13,
9078,
198,
31,
11828,
25,
48282,
32278,
198,
31,
13838,
25,
11089,
2724,
198,
31,
16447,
10430,
25,
12131,
14,
2713,
14,
1314,
198,
31,
5956,
18378,
7575,
25,
12131,
14,
2713,
14,
1314,
198... | 2.426614 | 511 |
from wordpress_xmlrpc.base import *
from wordpress_xmlrpc.wordpress import WordPressOption
class GetOptions(AuthenticatedMethod):
"""
Retrieve list of blog options.
Parameters:
`options`: `list` of option names to retrieve; if empty, all options will be retrieved
Returns: `list` o... | [
6738,
1573,
8439,
62,
19875,
81,
14751,
13,
8692,
1330,
1635,
201,
198,
6738,
1573,
8439,
62,
19875,
81,
14751,
13,
40346,
1330,
22477,
19722,
201,
198,
201,
198,
201,
198,
4871,
3497,
29046,
7,
47649,
3474,
17410,
2599,
201,
198,
220... | 2.741935 | 279 |
import param
import random
from deap import creator, base, tools, algorithms
from Knapsack import Knapsack
def cxSet(ind1, ind2):
"""Apply a crossover operation on input sets. The first child is the
intersection of the two sets, the second child is the difference of the
two sets.
"""
temp = set(i... | [
11748,
5772,
198,
11748,
4738,
198,
6738,
390,
499,
1330,
13172,
11,
2779,
11,
4899,
11,
16113,
198,
6738,
6102,
1686,
441,
1330,
6102,
1686,
441,
628,
198,
198,
4299,
43213,
7248,
7,
521,
16,
11,
773,
17,
2599,
198,
220,
220,
220,
... | 2.852113 | 284 |
#!/usr/bin/env python3
import csv
from common import Point, STOP_LOCATIONS_CSV
'''
Reads the CSV file written by match_stops_locations creates the following
properties:
name_to_point:
A dictionary where the keys are the stop names and the values are
Point objects that represent the locations of the ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
269,
21370,
198,
6738,
2219,
1330,
6252,
11,
44934,
62,
29701,
18421,
62,
7902,
53,
198,
7061,
6,
198,
5569,
82,
262,
44189,
2393,
3194,
416,
2872,
62,
301,
2840,
62,
1794... | 2.673203 | 306 |
from .models import messages, settings
from .facebook_client import FacebookClient
| [
6738,
764,
27530,
1330,
6218,
11,
6460,
198,
6738,
764,
19024,
62,
16366,
1330,
3203,
11792,
198
] | 4.882353 | 17 |
# 实验4
import os
import tensorflow as tf
if __name__=="__main__":
app = Train()
app.train() | [
2,
10263,
106,
252,
165,
103,
234,
19,
198,
198,
11748,
28686,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
598,
796,
16835,
3419,
198,
220,
220,
220,... | 2.12766 | 47 |
# Copyright (c) 2019 Science and Technology Facilities Council
# All rights reserved.
# Modifications made as part of the fparser project are distributed
# under the following license:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... | [
2,
15069,
357,
66,
8,
13130,
5800,
290,
8987,
48939,
4281,
198,
198,
2,
1439,
2489,
10395,
13,
198,
198,
2,
3401,
6637,
925,
355,
636,
286,
262,
277,
48610,
1628,
389,
9387,
198,
2,
739,
262,
1708,
5964,
25,
198,
198,
2,
2297,
3... | 2.944896 | 1,724 |
"""Wrapper for Open Model Zoo for Anomaly tasks."""
# Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from typing import Any, Dict, Union
import cv2
import numpy as np
from openvino.model_zoo.model_api.models import SegmentationModel
from openvino.model_zoo.model_api.models.types im... | [
37811,
36918,
2848,
329,
4946,
9104,
21980,
329,
1052,
24335,
8861,
526,
15931,
198,
198,
2,
15069,
357,
34,
8,
33448,
12,
1238,
1828,
8180,
10501,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
... | 2.542789 | 1,262 |
#!/usr/bin/env python3
"""UrsaLeo LEDdebug board button demo
Capture button presses using interrupts to turn on LED's
Press CTR+C to exit"""
import time
try:
from LEDdebug import LEDdebug
except ImportError:
try:
import sys
import os
sys.path.append("..")
sys.path.append(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
52,
3808,
64,
3123,
78,
12365,
24442,
3096,
4936,
13605,
198,
220,
220,
31793,
4936,
31048,
1262,
48237,
284,
1210,
319,
12365,
338,
198,
220,
220,
4332,
34577,
10,
34,
284,... | 2.33195 | 241 |
from django.shortcuts import render, get_object_or_404
from django.views.generic import (TemplateView, DetailView,
ListView, CreateView,
UpdateView,DeleteView,FormView,)
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from ... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
357,
30800,
7680,
11,
42585,
7680,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.502924 | 171 |
# Demo: Selective Tour of the Python Standard Library
# To run this demo in IPython, use:
# from IPython.lib.demo import Demo
# stdlib_demo = Demo( path_to_this_file )
# stdlib_demo( )
# where 'path_to_this_file' is the path (as a string) to this file.
# Turning on some forwards-compat with Python 3.
f... | [
2,
34588,
25,
9683,
425,
9852,
286,
262,
11361,
8997,
10074,
201,
198,
201,
198,
2,
1675,
1057,
428,
13605,
287,
6101,
7535,
11,
779,
25,
201,
198,
2,
220,
220,
422,
6101,
7535,
13,
8019,
13,
9536,
78,
1330,
34588,
201,
198,
2,
... | 2.803663 | 9,392 |
from sys import argv;
import math;
import os;
import struct;
print("\n╔════════════╗ | made by blokatt in 2016");
print("║hex2plt v1.0║ | blokatt.net");
print("╚════════════╝ | @blokatt\n");
print("");
if (len(argv) == 1):
print("No input file!");
waitForKey();
quit();
script, inputFilenam... | [
6738,
25064,
1330,
1822,
85,
26,
201,
198,
11748,
10688,
26,
201,
198,
11748,
28686,
26,
201,
198,
11748,
2878,
26,
201,
198,
201,
198,
4798,
7203,
59,
77,
22880,
242,
31732,
31732,
31732,
31732,
31732,
31732,
22880,
245,
930,
925,
41... | 2.407542 | 1,379 |
from pykotor.resource.formats.lip.data import LIP, LIPShape, LIPKeyFrame
from pykotor.resource.formats.lip.io_binary import LIPBinaryReader, LIPBinaryWriter
from pykotor.resource.formats.lip.io_xml import LIPXMLReader, LIPXMLWriter
from pykotor.resource.formats.lip.auto import load_lip, write_lip, detect_lip
| [
6738,
12972,
74,
20965,
13,
31092,
13,
687,
1381,
13,
40712,
13,
7890,
1330,
406,
4061,
11,
406,
4061,
33383,
11,
406,
4061,
9218,
19778,
198,
6738,
12972,
74,
20965,
13,
31092,
13,
687,
1381,
13,
40712,
13,
952,
62,
39491,
1330,
40... | 2.87037 | 108 |
from pyalgotrade import strategy
from pyalgotrade import broker
from pyalgotrade.bar import Frequency
from pyalgotrade.technical import ma
from pyalgotrade.technical import cross
#from pyalgotrade import plotter
from pyalgotrade.stratanalyzer import returns
from exchange.bitmex.liveApi.livebarfeed import LiveFeed
from ... | [
6738,
12972,
14016,
313,
27585,
1330,
4811,
198,
6738,
12972,
14016,
313,
27585,
1330,
20426,
198,
6738,
12972,
14016,
313,
27585,
13,
5657,
1330,
31902,
198,
6738,
12972,
14016,
313,
27585,
13,
47944,
1330,
17266,
198,
6738,
12972,
14016,
... | 2.861538 | 260 |
import cv2
import matplotlib.pyplot as plt
image = cv2.imread("./img/meinv.png")
channels = cv2.split(image)
colors = ('b', 'g', 'r')
plt.figure() # 新建一个图像
plt.title("RGB Histogram") # 图像的标题
plt.xlabel("Bins") # X轴标签:亮度0-255
plt.ylabel("# of Pixels") # Y轴标签:某一亮度的像素数
for (channels, color) i... | [
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
9060,
796,
269,
85,
17,
13,
320,
961,
7,
1911,
14,
9600,
14,
1326,
16340,
13,
11134,
4943,
198,
354,
8961,
796,
269,
85,
17,
13,
35312,
... | 1.607973 | 301 |
"""Kata url: https://www.codewars.com/kata/557cd6882bfa3c8a9f0000c1."""
| [
37811,
42,
1045,
19016,
25,
3740,
1378,
2503,
13,
19815,
413,
945,
13,
785,
14,
74,
1045,
14,
41948,
10210,
3104,
6469,
65,
13331,
18,
66,
23,
64,
24,
69,
2388,
66,
16,
526,
15931,
628
] | 2.027778 | 36 |
# Generated by Django 3.2b1 on 2021-04-05 19:11
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
65,
16,
319,
33448,
12,
3023,
12,
2713,
678,
25,
1157,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
from tixte_foss import app
from multiprocessing import Process
import pytest
| [
6738,
256,
844,
660,
62,
69,
793,
1330,
598,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
198,
11748,
12972,
9288,
628
] | 3.545455 | 22 |
import os
import socket
from threading import Thread
from queue import Queue
from time import sleep
from pickle import load, dump
from .utils import Message, Channel
HOST = "localhost"
PORT = 5500
HOME = os.path.expanduser("~")
| [
11748,
28686,
198,
11748,
17802,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
16834,
1330,
4670,
518,
198,
6738,
640,
1330,
3993,
198,
6738,
2298,
293,
1330,
3440,
11,
10285,
198,
198,
6738,
764,
26791,
1330,
16000,
11,
11102,
198,
198... | 3.5 | 66 |
import numpy as np
import scipy as sp
from sklearn.linear_model import LassoLars as Lasso_sk
def AICc(Theta, y, gamma, sigma2):
"""
Sample size corrected Akaike information criteria
"""
m = len(y)
k = np.count_nonzero(gamma)+1 # +1 since we also fit sigma
if m-k-1 <= 0: return np.inf
mu_... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
406,
28372,
43,
945,
355,
406,
28372,
62,
8135,
198,
198,
4299,
317,
2149,
66,
7,
464,
8326,
11,
331,
11,
34236,
... | 1.841343 | 9,946 |
import configparser
header = """
events {
worker_connections 1024; ## Default: 1024
}
http {
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/ac... | [
11748,
4566,
48610,
198,
198,
25677,
796,
37227,
198,
31534,
1391,
198,
220,
220,
220,
8383,
62,
8443,
507,
220,
28119,
26,
220,
22492,
15161,
25,
28119,
198,
92,
198,
198,
4023,
1391,
198,
220,
220,
220,
2604,
62,
18982,
220,
220,
... | 2.074616 | 2,868 |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 applicable law o... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
4343,
3012,
3457,
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,
... | 2.418417 | 2,476 |
import yaml
from typing import NamedTuple, List, Union, Dict | [
11748,
331,
43695,
198,
6738,
19720,
1330,
34441,
51,
29291,
11,
7343,
11,
4479,
11,
360,
713
] | 3.529412 | 17 |
import unittest
from user import User
class TestClass(unittest.TestCase):
"""
A Test class that defines test cases for the User class.
Args:
unittest.TestCase: TestCase class that helps in creating test cases
"""
def setUp(self):
"""
Method that runs before eac... | [
11748,
555,
715,
395,
198,
6738,
2836,
1330,
11787,
198,
198,
4871,
6208,
9487,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
6208,
1398,
326,
15738,
1332,
2663,
329,
262,
11787,
1398,
... | 2.190691 | 666 |
#! /usr/bin/python3
"""A helper program to test cartesian goals for the JACO and MICO arms."""
import roslib; roslib.load_manifest('kinova_demo')
import rospy
import sys
import math
import actionlib
import kinova_msgs.msg
""" Global variable """
robot_category = 'j'
robot_category_version = 2
wrist_type = 'n'
arm... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
32,
31904,
1430,
284,
1332,
6383,
35610,
4661,
329,
262,
449,
2246,
46,
290,
337,
22707,
5101,
526,
15931,
198,
198,
11748,
686,
6649,
571,
26,
686,
6649,
571,
13,
2220,
62,
... | 2.391729 | 1,330 |
import unittest
from foundations_spec.helpers.spec import Spec
from foundations_spec.helpers import let_patch_mock_with_conditional_return
from foundations_spec.helpers.conditional_return import ConditionalReturn | [
198,
11748,
555,
715,
395,
198,
6738,
19369,
62,
16684,
13,
16794,
364,
13,
16684,
1330,
18291,
198,
6738,
19369,
62,
16684,
13,
16794,
364,
1330,
1309,
62,
17147,
62,
76,
735,
62,
4480,
62,
17561,
1859,
62,
7783,
198,
6738,
19369,
... | 3.803571 | 56 |
import subprocess
import pathlib
| [
11748,
850,
14681,
198,
11748,
3108,
8019,
198
] | 4.125 | 8 |
"""
Quest status.
"""
from muddery.server.quests.base_quest_status import BaseQuestStatus
from muddery.server.utils.localized_strings_handler import _
class Accomplished(BaseQuestStatus):
"""
The quest's objectives are accomplished.
"""
key = "ACCOMPLISHED"
name = _("Objectives Accomplished", cat... | [
37811,
198,
12166,
3722,
13,
198,
37811,
198,
198,
6738,
17492,
1082,
88,
13,
15388,
13,
421,
3558,
13,
8692,
62,
6138,
62,
13376,
1330,
7308,
12166,
19580,
198,
6738,
17492,
1082,
88,
13,
15388,
13,
26791,
13,
12001,
1143,
62,
37336,... | 2.592233 | 206 |
# The purpose of this module is to create and start a single
# JPSGateway object to be used in all of your other modules
#============================================================
from py4jps import JPSGateway
jps = JPSGateway()
jps.start()
#============================================================ | [
2,
383,
4007,
286,
428,
8265,
318,
284,
2251,
290,
923,
257,
2060,
198,
2,
449,
3705,
22628,
1014,
2134,
284,
307,
973,
287,
477,
286,
534,
584,
13103,
198,
2,
10052,
4770,
25609,
198,
6738,
12972,
19,
73,
862,
1330,
449,
3705,
22... | 4.636364 | 66 |
#!/home/bixichao/bin/python
import sys
import os
import numpy as np
'''
generate O,S,Y,A,B,PI
'''
O,S,Y,A,B,PI = generate_data('sequence1.fa')
print O#---right
print S#---right
print Y#---right
print A#---right
print B#---right
print PI#---right
| [
2,
48443,
11195,
14,
65,
844,
488,
5488,
14,
8800,
14,
29412,
220,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
7061,
6,
198,
197,
8612,
378,
440,
11,
50,
11,
56,
11,
32,
11,
33,
11,
11901,
198,
... | 2.276423 | 123 |
import os
import numpy as np
from scipy import io
from scipy.ndimage.morphology import binary_fill_holes
from skimage.draw import line
import math
def create_ground_truth_mask4d(shape, x, y):
'''
Summary:
Create 4d binary mask using linear interpolation (line) beetween x[i],y[i] and x[i+1],y[i+... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
33245,
198,
6738,
629,
541,
88,
13,
358,
9060,
13,
24503,
1435,
1330,
13934,
62,
20797,
62,
28439,
198,
6738,
1341,
9060,
13,
19334,
1330,
1627,
198,
117... | 2.023592 | 1,314 |
#!/usr/bin/python
import os, sys, json
from DNN import Connection, Neuron, Net
if not os.path.exists(sys.argv[4]):
eta = float(sys.argv[5])
alpha = float(sys.argv[6])
topology = [int(number) for number in sys.argv[7:]]
myNet = Net(topology = topology, eta = eta, alpha = alpha)
with open(sys.argv[4], mode = 'w') as... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
28686,
11,
25064,
11,
33918,
198,
6738,
360,
6144,
1330,
26923,
11,
3169,
44372,
11,
3433,
198,
361,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
17597,
13,
853,
85,
58,
19,
60,
2599,
... | 2.292035 | 339 |
import os
import torch
import struct
import numpy as np
from networks import compressor, decompressor
from utils import plot_image, save_image
class QuantizedCompressor:
"""
Quantized Compressor with Elias coding.
Code: Elias coded string is represented in 64 bit integers.
"""
def elias_dict(self... | [
11748,
28686,
198,
11748,
28034,
198,
11748,
2878,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
7686,
1330,
49395,
11,
38237,
44292,
198,
6738,
3384,
4487,
1330,
7110,
62,
9060,
11,
3613,
62,
9060,
628,
198,
4871,
16972,
1143,
7293,
4... | 2.231878 | 2,497 |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from dataclasses import dataclass
from typing import Iterable, List, Type
from pants.backend.python.rules.targets import PythonSources
from pants.core.goals.fmt import (
FmtConfigurat... | [
2,
15069,
13130,
41689,
1628,
20420,
357,
3826,
27342,
9865,
3843,
20673,
13,
9132,
737,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
3826,
38559,
24290,
737,
198,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
3... | 3.300926 | 216 |
import decimal
import functools
import math
import typing as t
from decimal import Decimal
from binance.client import Client as BinanceClient
from .. import utils
from ..data_types import (
CryptoBalance,
ExchangeOrder,
OrderTimeInForce,
OrderType,
SupportedExchanges,
)
from ..user import User
fro... | [
11748,
32465,
198,
11748,
1257,
310,
10141,
198,
11748,
10688,
198,
11748,
19720,
355,
256,
198,
6738,
32465,
1330,
4280,
4402,
198,
198,
6738,
9874,
590,
13,
16366,
1330,
20985,
355,
347,
14149,
11792,
198,
198,
6738,
11485,
1330,
3384,
... | 2.256445 | 1,474 |
import json
import numpy as np
from sklearn.tree import DecisionTreeRegressor
from sklearn.linear_model import LinearRegression
from sklearn.neural_network import MLPRegressor
from sklearn.metrics import mean_absolute_error, r2_score
from flask import Flask, render_template, request
from app import app
from app.regress... | [
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
21048,
1330,
26423,
27660,
8081,
44292,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
44800,
8081,
2234,
198,
6738,
1341,
35720,
13,
710,
1523,
62,
27349,... | 3.097436 | 195 |
#! /usr/bin/env python
import email
import getpass
import imaplib
import os
import re
import sys
import time
pattern_uid = re.compile(r"\d+ \(UID (?P<uid>\d+)\)")
detach_dir = "." # directory where to save attachments (default: current)
try:
from credentials import credentials_list
except:
credentials_list ... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
3053,
198,
11748,
651,
6603,
198,
11748,
545,
64,
489,
571,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
640,
198,
198,
33279,
62,
27112,
796,
302,
... | 1.985119 | 1,680 |
from rest_framework import serializers
from store.models import Image, Product, Tag
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
3650,
13,
27530,
1330,
7412,
11,
8721,
11,
17467,
628,
628,
198
] | 4.045455 | 22 |
# Copyright 2018-2022 Streamlit 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 applicable law or agreed to in wr... | [
2,
15069,
2864,
12,
1238,
1828,
13860,
18250,
3457,
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,
262,
13789,
... | 3.069541 | 719 |
# import the necessary packages
from .simpledatasetloader import SimpleDatasetLoader | [
2,
1330,
262,
3306,
10392,
198,
6738,
764,
14323,
10137,
265,
292,
316,
29356,
1330,
17427,
27354,
292,
316,
17401
] | 4.2 | 20 |
import numpy as np
import theano as th
from theano import tensor as T
from scaling.points import build_points, combine_points
POINTS_PER_PCT = np.array([72, 68, 85, 72]) # crit, haste, vers, mastery
# stats on a main piece (pants, in this case) at the given ilvl
BASE=470
STATS_AT_BASE = {
'stamina': 1377,
'pr... | [
11748,
299,
32152,
355,
45941,
198,
11748,
262,
5733,
355,
294,
198,
6738,
262,
5733,
1330,
11192,
273,
355,
309,
198,
6738,
20796,
13,
13033,
1330,
1382,
62,
13033,
11,
12082,
62,
13033,
198,
198,
16402,
1268,
4694,
62,
18973,
62,
47... | 1.636986 | 32,850 |
from re import S
from router_solver import *
from tabulate import tabulate
import compilador.objects.symbol as symbol
from compilador.objects.symbol import *
import compilador.objects.base_address as base_address
from compilador.objects.base_address import *
# ARCHIVO QUE AYUDA A HACER TABLAS DE OBJETOS
# SE IMPRIMEN ... | [
6738,
302,
1330,
311,
198,
6738,
20264,
62,
82,
14375,
1330,
1635,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
11748,
552,
346,
7079,
13,
48205,
13,
1837,
23650,
355,
6194,
198,
6738,
552,
346,
7079,
13,
48205,
13,
1837,
23650,
1330... | 3.029557 | 203 |
import os
from dotenv import load_dotenv
load_dotenv()
config_options = {
'development':DevConfig
} | [
11748,
28686,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
11250,
62,
25811,
796,
1391,
198,
1549,
68,
1091,
434,
10354,
13603,
16934,
198,
92
] | 2.941176 | 34 |
import os,requests, time,cv2,json
from flask import Flask, render_template,request
from flask_socketio import SocketIO, send, emit
import numpy as np
from align import AlignDlib
from base64 import b64encode
from face_detect import MTCNN
from threading import Thread
from multiprocessing import Process,Queue
from queue i... | [
11748,
28686,
11,
8897,
3558,
11,
640,
11,
33967,
17,
11,
17752,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
25927,
198,
6738,
42903,
62,
44971,
952,
1330,
47068,
9399,
11,
3758,
11,
27588,
198,
11748,
299,
32152,
355,
459... | 3.375 | 120 |
# encoding: utf-8
"""
@author: xsren
@contact: bestrenxs@gmail.com
@site: xsren.me
@version: 1.0
@license: Apache Licence
@file: utils.py
@time: 29/10/2017 5:24 PM
"""
import logging
import logging.handlers
if __name__ == '__main__':
run()
| [
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
31,
9800,
25,
2124,
82,
918,
220,
198,
31,
32057,
25,
1266,
918,
34223,
31,
14816,
13,
785,
198,
31,
15654,
25,
2124,
82,
918,
13,
1326,
198,
198,
31,
9641,
25,
352,
13,
15,
198... | 2.373832 | 107 |
from a10sdk.common.A10BaseClass import A10BaseClass
class RouteMap(A10BaseClass):
"""Class Description::
Configure route-map.
Class route-map supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param uuid: {"description": "... | [
6738,
257,
940,
21282,
74,
13,
11321,
13,
32,
940,
14881,
9487,
1330,
317,
940,
14881,
9487,
628,
198,
4871,
18956,
13912,
7,
32,
940,
14881,
9487,
2599,
198,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
9487,
12489,
3712,
198,
22... | 3.029197 | 411 |
import re
#import class7ex1a
cdp_file = 'sw1_cdp.txt'
f = open(cdp_file)
cdp_data = f.read()
f.close()
tmp_dict = {}
# find one or more "any" chars after Device ID, IP addy
tmp_dict['remote_hosts'] = re.findall(r'Device ID: (.+)', cdp_data)
tmp_dict['IPs'] = re.findall(r'IP address: (.+)', cdp_data)
# f... | [
11748,
302,
201,
198,
2,
11748,
1398,
22,
1069,
16,
64,
201,
198,
201,
198,
10210,
79,
62,
7753,
796,
705,
2032,
16,
62,
10210,
79,
13,
14116,
6,
201,
198,
69,
796,
1280,
7,
10210,
79,
62,
7753,
8,
201,
198,
10210,
79,
62,
789... | 2.303502 | 257 |
"""
CICLOS EN PYTHON Y SU USO
FOR Y WHILE
PRIMITIVO RANGE()
"""
if __name__ == "__main__":
counter = 10
while counter > 0:
print(counter)
counter -= 1
list_names = ["Alejandro", "David", "Fernando"]
for name in list_names:
print(name)
p_n = []
for n in ... | [
37811,
198,
220,
220,
220,
327,
2149,
45376,
12964,
350,
56,
4221,
1340,
575,
13558,
1294,
46,
198,
220,
220,
220,
7473,
575,
7655,
41119,
198,
220,
220,
220,
4810,
3955,
2043,
3824,
46,
371,
27746,
3419,
198,
37811,
628,
198,
198,
... | 1.992063 | 252 |
# coding=utf-8
"""Models for the ACL endpoints"""
import uuid
from consulate.models import base
class ACL(base.Model):
"""Defines the model used for an individual ACL token."""
__slots__ = ['id', 'name', 'type', 'rules']
__attributes__ = {
'id': {
'key': 'ID',
'type': uui... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
5841,
1424,
329,
262,
17382,
886,
13033,
37811,
198,
11748,
334,
27112,
198,
198,
6738,
44369,
13,
27530,
1330,
2779,
628,
198,
4871,
17382,
7,
8692,
13,
17633,
2599,
198,
220,
220,
220,
37227,... | 1.829517 | 393 |
# Generated by Django 3.0.3 on 2020-03-17 13:45
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
18,
319,
12131,
12,
3070,
12,
1558,
1511,
25,
2231,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from flask import Flask
from flask import render_template
import boto3
import os
from config import S3_BUCKET, S3_KEY, S3_SECRET
from utils import albums
app = Flask(__name__)
@app.route("/")
@app.route("/album/<album_title>")
| [
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
11748,
275,
2069,
18,
198,
198,
11748,
28686,
198,
198,
6738,
4566,
1330,
311,
18,
62,
33,
16696,
2767,
11,
311,
18,
62,
20373,
11,
311,
18,
62,
23683,
26087,
1... | 2.785714 | 84 |
#!/usr/bin/python
# doKhaiii.py
import os
import sys
import re
from khaiii import KhaiiiApi
api = KhaiiiApi()
# 전달 인자 읽기 및 파일 패스 생성
if len(sys.argv) < 3:
print("usage: doKahiii [input file to process] [output file]")
exit(1)
inputPath = sys.argv[1]
outputPath = sys.argv[2]
fileList = os.listdir(inputPath)
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
466,
33155,
1872,
4178,
13,
9078,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
302,
198,
6738,
44081,
1872,
4178,
1330,
5311,
1872,
4178,
32,
14415,
198,
198,
15042,
796,
53... | 1.581395 | 2,021 |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
2,
15069,
383,
9485,
15884,
354,
12469,
1074,
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,
262,
13789,
13,
1... | 3.115385 | 468 |
from typing import List, Set, Dict, Iterable
from corankco.kemeny_computation import KemenyComputingFactory
from corankco.dataset import Dataset
from corankco.scoringscheme import ScoringScheme
from enum import Enum, unique
@unique
| [
6738,
19720,
1330,
7343,
11,
5345,
11,
360,
713,
11,
40806,
540,
198,
6738,
1162,
962,
1073,
13,
365,
3653,
88,
62,
785,
1996,
341,
1330,
509,
8952,
88,
5377,
48074,
22810,
198,
6738,
1162,
962,
1073,
13,
19608,
292,
316,
1330,
1609... | 3.175676 | 74 |
# Generated by Django 2.1.3 on 2019-02-04 23:17
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
18,
319,
13130,
12,
2999,
12,
3023,
2242,
25,
1558,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
import os, multiprocessing
from os.path import join, isfile
import numpy as np
from PIL import Image
import scipy.ndimage
import skimage.color
import random
from sklearn.cluster import KMeans
def extract_filter_responses(opts, img):
'''
Extracts the filter responses for the given image.
[in... | [
11748,
28686,
11,
18540,
305,
919,
278,
201,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
318,
7753,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
350,
4146,
1330,
7412,
201,
198,
11748,
629,
541,
88,
13,
358,
90... | 2.245849 | 2,469 |
# -*- coding: utf-8 -*-
class TooManyMorphsError(Error):
'''raised when there are more divisions on the parsing line
than on the glossing line'''
class TooManyGlossesError(Error):
'''raised when there are more divisions on the glossing line
than on the parsing line'''
class EmptyTiersError(E... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
4871,
14190,
7085,
44,
13425,
82,
12331,
7,
12331,
2599,
198,
220,
220,
220,
705,
7061,
49309,
618,
612,
389,
517,
17397,
319,
262,
32096,
1627,
198,
220,
220,
22... | 3.108974 | 156 |
# EJ (Mercy) Emelike
# May 30, 2016
# Homework 3
#LISTS
# 1)
countries = ['Bulgaria', 'Mexico', 'Peru', 'France', 'Morocco', 'Ghana', 'Armenia']
# 2)
for country in countries:
print(country)
# 3)
countries.sort()
# 4)
print(countries[0])
#5)
print(countries[len(countries) - 2])
#6
countries.remove('Bulgaria')... | [
2,
412,
41,
357,
13102,
948,
8,
2295,
417,
522,
198,
2,
1737,
1542,
11,
1584,
198,
2,
8074,
6433,
513,
198,
198,
2,
43,
1797,
4694,
198,
2,
352,
8,
198,
9127,
1678,
796,
37250,
33481,
4563,
544,
3256,
705,
33006,
3256,
705,
5990... | 2.494318 | 880 |
## setup_mnets.py -- sets up mobile nets
##
## Copyright (C) 2016, Nicholas Carlini <nicholas@carlini.com>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in the LICENCE file in this directory.
import tensorflow as tf
import numpy as np
import os
import pickle
import gzip
import pickle
im... | [
2235,
9058,
62,
10295,
1039,
13,
9078,
1377,
5621,
510,
5175,
31720,
198,
2235,
198,
2235,
15069,
357,
34,
8,
1584,
11,
20320,
1879,
2815,
72,
1279,
77,
488,
12456,
31,
7718,
2815,
72,
13,
785,
28401,
198,
2235,
198,
2235,
770,
1430... | 2.833698 | 457 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pip install inflection
import inflection
def underscore(name='CamelCase'):
""" 骆驼表示法变成下滑线加上小写字母表示
http://inflection.readthedocs.io/en/latest/"""
return inflection.underscore(name)
if __name__ == '__main__':
print(underscore())
print(underscore('Ca... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
7347,
2721,
1167,
1564,
198,
198,
11748,
1167,
1564,
628,
198,
4299,
44810,
7,
3672,
11639,
34,
17983,
20448,
... | 2.018293 | 164 |
from discord.ext import commands
from src.config import OPERATOR_ROLE
| [
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
12351,
13,
11250,
1330,
43521,
25633,
62,
13252,
2538,
198
] | 3.888889 | 18 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
26209,
13,
2348,
541,
323,
31077,
1330,
978,... | 2.571429 | 49 |
import time
import os
import shutil
import zipfile
import json
import xml.etree.ElementTree as ET
import pandas as pd
#-----------------------------------------------------------------
def unzip_books(source_folder, dest_folder):
"""
Args:
source_folder: folder directory of downloaded gutenberg zip f... | [
11748,
640,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
19974,
7753,
198,
11748,
33918,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
10097,
12,
198,
198,
4... | 2.27031 | 4,062 |
N = int(input())
A = list(map(int, input().split()))
print(max(A) - min(A))
| [
45,
796,
493,
7,
15414,
28955,
198,
32,
796,
1351,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008,
198,
4798,
7,
9806,
7,
32,
8,
532,
949,
7,
32,
4008,
198
] | 2.30303 | 33 |
# libraries
import zipfile
from dbfread import DBF
with zipfile.ZipFile(path_to_zip_file, 'r') as zip_ref:
zip_ref.extractall(directory_to_extract_to)
for record in DBF('file.dbf'):
print(record)
if __name__ == '__main__':
main()
| [
2,
12782,
198,
11748,
19974,
7753,
198,
6738,
288,
19881,
961,
1330,
20137,
37,
628,
198,
4480,
19974,
7753,
13,
41729,
8979,
7,
6978,
62,
1462,
62,
13344,
62,
7753,
11,
705,
81,
11537,
355,
19974,
62,
5420,
25,
198,
220,
220,
220,
... | 2.445545 | 101 |
from __future__ import absolute_import
from bokeh.io import save
from bokeh.plotting import figure
from bokeh.models import TapTool, CustomJS
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from ..utils import value_to_be_present_in_datahash
im... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
1489,
365,
71,
13,
952,
1330,
3613,
198,
6738,
1489,
365,
71,
13,
29487,
889,
1330,
3785,
198,
6738,
1489,
365,
71,
13,
27530,
1330,
16880,
25391,
11,
8562,
20120,
198,
... | 3.255639 | 133 |
from . import corelib
from ctypes import *
import numpy as np
_reinhard = corelib.core.TonemapReinhard
_reinhard.argtypes = [POINTER(c_float), c_int, POINTER(c_float), c_int, c_int, c_int, c_int, c_float ]
_reinhard.restype = c_float
_aces = corelib.core.TonemapACES
_aces.argtypes = [POINTER(c_float), c_int, POINTER(... | [
6738,
764,
1330,
4755,
8019,
198,
6738,
269,
19199,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
198,
198,
62,
260,
259,
10424,
796,
4755,
8019,
13,
7295,
13,
35416,
368,
499,
3041,
259,
10424,
198,
62,
260,
259,
10424,
13,
853,
... | 2.358025 | 162 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
:mod:`minesweeper` module
:author: KROL Mikolai ; ELABDALLAH Mohammed
:date:
This module provides functions and a class for minesweeper's game's management.
"""
import random
from enum import Enum
from cell import Cell
############################################... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
25,
4666,
25,
63,
1084,
274,
732,
5723,
63,
8265,
198,
198,
25,
9800,
25,
29430,
3535,
17722,
349,
18... | 2.052103 | 3,186 |
#-*-coding:utf8-*-
import sys
import urllib
import urllib2
import urlparse
import re
from lxml import etree
if __name__ == "__main__":
main()
| [
2,
12,
9,
12,
66,
7656,
25,
40477,
23,
12,
9,
12,
198,
198,
11748,
25064,
198,
11748,
2956,
297,
571,
198,
11748,
2956,
297,
571,
17,
198,
11748,
19016,
29572,
198,
11748,
302,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
198,
361... | 2.5 | 58 |
import os
import random
import time
import math
import tensorflow as tf
from tqdm import trange
from thred.models import topical_base, ncm_utils
from thred.models.base import NMTEncoderDecoderWrapper
from thred.models.topic_aware import taware_helper
from thred.util import fs, log
from thred.util.embed import Embeddi... | [
11748,
28686,
198,
11748,
4738,
198,
11748,
640,
198,
198,
11748,
10688,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
256,
80,
36020,
1330,
491,
858,
198,
198,
6738,
294,
445,
13,
27530,
1330,
39867,
62,
8692,
11,
299,
11215,
... | 3.283333 | 120 |
import mock
import pytest
from nose.tools import assert_equal
from addons.forward.tests.utils import ForwardAddonTestCase
from tests.base import OsfTestCase
from website import settings
pytestmark = pytest.mark.django_db
| [
11748,
15290,
198,
11748,
12972,
9288,
198,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,
40496,
198,
198,
6738,
751,
684,
13,
11813,
13,
41989,
13,
26791,
1330,
19530,
4550,
261,
14402,
20448,
198,
6738,
5254,
13,
8692,
1330,
8834,
69,
... | 3.515625 | 64 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.45979 | 572 |
import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey, orm, Text, String, Boolean
from sanansaattaja.core.utils import get_date
from sanansaattaja.db.data.db_session import SqlAlchemyBase
| [
11748,
4818,
8079,
198,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
7536,
7575,
11,
8708,
9218,
11,
393,
76,
11,
8255,
11,
10903,
11,
41146,
198,
198,
6738,
5336,
504,
64,
1078,
27792,
13,
7295,
13,
26791,
1330,
651,
6... | 3.242424 | 66 |
import torchvision
import torch
import torch.nn as nn
import torch.nn.functional as F
encode_out_r = []
| [
198,
11748,
28034,
10178,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
268,
8189,
62,
448,
62,
81,
796,
17635,
628,
628
] | 3.027778 | 36 |
# https://discourse.odriverobotics.com/t/nema-enclosures-for-d5065-and-d6374-motors/830
# https://docs.odriverobotics.com/v/latest/getting-started.html
# https://docs.odriverobotics.com/v/latest/fibre_types/com_odriverobotics_ODrive.html
import numpy as np
import odrive
import time
od = odrive.find_any()
axis = od.a... | [
2,
3740,
1378,
15410,
9047,
13,
375,
38291,
672,
23891,
13,
785,
14,
83,
14,
77,
19687,
12,
268,
565,
16091,
12,
1640,
12,
67,
1120,
2996,
12,
392,
12,
67,
21,
31020,
12,
27926,
669,
14,
48341,
198,
2,
3740,
1378,
31628,
13,
375... | 2.775819 | 397 |
import json
from django.urls import reverse
from bluebottle.collect.models import CollectActivity
| [
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
4171,
10985,
293,
13,
33327,
13,
27530,
1330,
9745,
16516,
628,
628,
198
] | 3.714286 | 28 |