content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import json
import re
import argparse
import random
from time import time
from itertools import combinations
from app import db
from util import run_sql
from util import safe_commit
from util import Timer
from util import elapsed
from app import get_db_cursor
#
# p... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
1822,
29572,
198,
11748,
4738,
198,
6738,
640,
1330,
640,
1... | 2.440997 | 3,771 |
# Generated from .\xpath\xpathgrammer\XPath.g4 by ANTLR 4.9.3
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
| [
2,
2980,
515,
422,
764,
59,
87,
6978,
59,
87,
6978,
4546,
647,
59,
55,
15235,
13,
70,
19,
416,
3537,
14990,
49,
604,
13,
24,
13,
18,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
6738,
1885,
14050,
19,
1330,
1635,
198,
6738,
33245... | 2.659091 | 88 |
__author__ = 'lsteng'
# Copyright 2018 Shaoteng Liu
# 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 ag... | [
834,
9800,
834,
796,
705,
75,
301,
1516,
6,
198,
198,
2,
15069,
2864,
220,
19413,
313,
1516,
18258,
198,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,... | 1.931467 | 2,393 |
""" Module to handle the connection process.
"""
# pylint: disable=import-error
import json
import base64
import uuid
import aiohttp
from indy import crypto, did, pairwise, non_secrets
import serializer.json_serializer as Serializer
from router.simple_router import SimpleRouter
from . import Module
from message imp... | [
37811,
19937,
284,
5412,
262,
4637,
1429,
13,
198,
37811,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
11748,
12,
18224,
198,
198,
11748,
33918,
198,
11748,
2779,
2414,
198,
11748,
334,
27112,
198,
198,
11748,
257,
952,
4023,
198,
6738... | 3.517544 | 114 |
from django.test import TestCase
from app.calc import add, substract
"""
run unit testing
"""
class CalcTest(TestCase):
""" test add 2 those number """
""" test subtract 2 those number """ | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
598,
13,
9948,
66,
1330,
751,
11,
3293,
974,
628,
198,
37811,
198,
5143,
4326,
4856,
198,
37811,
198,
4871,
2199,
66,
14402,
7,
14402,
20448,
2599,
628,
220,
220,
220,
37227,... | 3.389831 | 59 |
from flask_restful import Resource, abort
from flask import request, jsonify, make_response
import config
from controller import worker_store as ws
| [
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
15614,
198,
6738,
42903,
1330,
2581,
11,
33918,
1958,
11,
787,
62,
26209,
198,
198,
11748,
4566,
198,
6738,
10444,
1330,
8383,
62,
8095,
355,
266,
82,
628
] | 4.166667 | 36 |
#!/usr/bin/env python3
"""
Duino-Coin REST API © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duco-rest-api
Duino-Coin Team & Community 2019-2021
"""
import gevent.monkey
gevent.monkey.patch_all()
from wrapped_duco_functions import *
from Server import (
now, SAVE_TIME, POOL_DATABASE, CONFIG_WHI... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
35660,
2879,
12,
24387,
30617,
7824,
10673,
17168,
11971,
198,
5450,
1378,
646,
259,
25634,
259,
13,
785,
198,
5450,
1378,
12567,
13,
785,
14,
18218,
1140,
1456,
14,
64... | 2.387563 | 2,975 |
## @imflash217
##
## creating a new file
with open("numbers.txt", "w") as file:
for i in range(1000):
print(str(i), file=file)
##################################################################
#################################################################
import heapq
###########################... | [
2235,
2488,
320,
34167,
24591,
198,
2235,
198,
2235,
4441,
257,
649,
2393,
198,
4480,
1280,
7203,
77,
17024,
13,
14116,
1600,
366,
86,
4943,
355,
2393,
25,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
12825,
2599,
198,
220,
220,
220... | 3.902098 | 143 |
from BaseAgent import BaseAgent
import logging
import math
import numpy as np
import os
import tensorflow as tf
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
| [
6738,
7308,
36772,
1330,
7308,
36772,
198,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,... | 3.175439 | 57 |
# Classifier Evaluation incorporating similarity
#
# (C) 2015 by Mareike Picklum (mareikep@cs.uni-bremen.de)
#
# 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
#... | [
2,
5016,
7483,
34959,
29927,
26789,
198,
2,
198,
2,
357,
34,
8,
1853,
416,
36989,
522,
12346,
75,
388,
357,
11449,
522,
79,
31,
6359,
13,
35657,
12,
65,
2787,
268,
13,
2934,
8,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
... | 2.107365 | 4,182 |
import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
import pymaster as nmt
#This script showcases the use of NmtWorkspace objects to speed up the
#computation of power spectra for many pairs of fields with the same masks.
#HEALPix map resolution
nside=256
#We start by creating some synthetic masks... | [
11748,
299,
32152,
355,
45941,
198,
11748,
12035,
9078,
355,
27673,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
279,
4948,
1603,
355,
299,
16762,
198,
198,
2,
1212,
4226,
45064,
262,
779,
286,
399,
16762,
... | 2.70096 | 1,458 |
# -*- coding: utf-8 -*-
#
# Settings file for OpenSlides
#
from openslides.global_settings import * # noqa
# Use 'DEBUG = True' to get more details for server errors. Default for releases: False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
16163,
2393,
329,
4946,
11122,
1460,
198,
2,
198,
198,
6738,
9808,
75,
1460,
13,
20541,
62,
33692,
1330,
1635,
220,
1303,
645,
20402,
198,
198,
2,
5765,
7... | 2.486683 | 413 |
'''
Utility functions for other modules.
'''
import os
import sys
import re
import math
import pandas as pd
import pytricia as pt
def normalize(astr):
'no whitespace or dots in string'
return re.sub(r'(\s|\.)+', '_', astr)
def load_csv(filename):
'csv file to dataframe w/ normalized column names'
tr... | [
7061,
6,
198,
18274,
879,
5499,
329,
584,
13103,
13,
198,
7061,
6,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
10688,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
83,
26654,
355,
42975,
198,
198... | 2.087859 | 10,164 |
import json
import logging
from apps.report.worker.report_generator import ReportGeneratorAction
from apps.utils.timezone_utils import str_utc
from ..action import BaseAction
logger = logging.getLogger(__name__)
| [
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
6725,
13,
13116,
13,
28816,
13,
13116,
62,
8612,
1352,
1330,
6358,
8645,
1352,
12502,
198,
6738,
6725,
13,
26791,
13,
2435,
11340,
62,
26791,
1330,
965,
62,
315,
66,
198,
198,
6738,
114... | 3.483871 | 62 |
from __future__ import absolute_import, division, print_function
import json
import logging
import os
import pickle
import random
from typing import List
import numpy as np
import torch
from dataclasses import dataclass
from pytorch_transformers import BertTokenizer
from torch.utils.data import Dataset
from tqdm impo... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
6738,
19720,
1330,
7343,
198,
198,
11748,
299,
321... | 2.331081 | 592 |
# Copyright 2015 Metaswitch Networks
#
# 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 w... | [
2,
15069,
1853,
3395,
292,
42248,
27862,
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,
198,
2,
92... | 2.867907 | 1,075 |
class MuseumpyError(Exception):
"""
General MuseumPlus error class to provide a superclass for all other errors
"""
class MuseumPlusError(MuseumpyError):
"""
MuseumPlus error raised when an error with the communication with MuseumPlus occurs
"""
class XMLParsingError(MuseumpyError):
"""
... | [
4871,
32887,
32152,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3611,
9594,
17860,
4049,
1398,
284,
2148,
257,
2208,
4871,
329,
477,
584,
8563,
198,
220,
220,
220,
37227,
628,
198,
4871,
9594,
17860,
12331,
7... | 3.223602 | 161 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import re
from collections import OrderedDict
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import dask.array as da
import numpy as np
import pandas as pd
import xarray as xr
from fsspec.spec import Abs... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
15095,
198,
11748,
302,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
3108,
8019,
1330,
10644,
1... | 2.760823 | 1,848 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from shapely.geometry import LineString
from shapely.ops import linemerge
# get_shapes_from_osm('1257117')
# get_shapes_from_osm('1254451')
get_shapes_from_osm('1254455')
| [
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,
11748,
7007,
201,
198,
6738,
5485,
306,
13,
469,
15748,
1330,
6910,
10100,
201,
198,
6738,
5485,
306,
13,
2... | 2.333333 | 105 |
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
"""Auto-generated package that contains models used b... | [
2,
15069,
357,
66,
8,
33448,
4013,
5276,
40778,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
770,
318,
11971,
3788,
422,
4013,
5276,
40778,
3457,
11,
329,
11247,
198,
2,
290,
8733,
2800,
534,
1664,
2775,
4706,
13,
198,
2,
220,
198,
2,... | 3.08589 | 1,793 |
# coding: utf-8
# ASR post-processing corrector pred vs gold: TRAIN
import torch
from afterburner_pretrained_model import afterburner_pretrained_model
import matplotlib.pyplot as plt
from progress_bar import progress_bar
from tqdm.auto import tqdm
import logging
logging.getLogger('nemo_logger').setLevel(logging.ER... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
7054,
49,
1281,
12,
36948,
3376,
273,
2747,
3691,
3869,
25,
29125,
1268,
198,
198,
11748,
28034,
198,
6738,
706,
10899,
263,
62,
5310,
13363,
62,
19849,
1330,
706,
10899,
263,
62,
5310,
13363,... | 2.705628 | 231 |
import pandas as pd
from dateutil import parser
from pm4pymdl.objects.mdl.exporter import exporter as mdl_exporter
from pm4pymdl.objects.ocel.exporter import exporter as ocel_exporter
from sapextractor.utils.dates import timestamp_column_from_dt_tm
from pandas.core.frame import DataFrame
from sapextractor.database_conn... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
3128,
22602,
1330,
30751,
198,
6738,
9114,
19,
79,
4948,
25404,
13,
48205,
13,
9132,
75,
13,
1069,
26634,
1330,
1033,
4337,
355,
285,
25404,
62,
1069,
26634,
198,
6738,
9114,
19,
79,
4948,
... | 3.401869 | 107 |
'''
mod_peak.py
usage: python mod_peak.py narrowPeak_file dataset.dat output.dat
modify the `chipseq_peak` values to 1 if a window from narrowPeak file appears in the dataset.
'''
import sys
nps = open(sys.argv[1])
inp = open(sys.argv[2])
out = open(sys.argv[3], 'w')
inpl = inp.readlines()
npsl = nps.rea... | [
7061,
6,
198,
220,
220,
220,
953,
62,
36729,
13,
9078,
198,
220,
220,
220,
8748,
25,
21015,
953,
62,
36729,
13,
9078,
7135,
6435,
461,
62,
7753,
27039,
13,
19608,
5072,
13,
19608,
198,
220,
220,
220,
13096,
262,
4600,
35902,
41068,
... | 2.014144 | 707 |
from unittest import TestCase
from mock import Mock, patch, ANY
from samtranslator.policy_template_processor.template import Template
from samtranslator.policy_template_processor.exceptions import InvalidParameterValues, InsufficientParameterValues
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
15290,
1330,
44123,
11,
8529,
11,
15529,
198,
198,
6738,
6072,
7645,
41880,
13,
30586,
62,
28243,
62,
41341,
13,
28243,
1330,
37350,
198,
6738,
6072,
7645,
41880,
13,
30586,
62,
28243,
... | 4.464286 | 56 |
from ..mapper import PropertyMapper, ApiInterfaceBase
from ..mapper.types import Timestamp, AnyType
from .item import Item
__all__ = ['MediaShare', 'MediaShareInterface']
| [
6738,
11485,
76,
11463,
1330,
14161,
44,
11463,
11,
5949,
72,
39317,
14881,
198,
6738,
11485,
76,
11463,
13,
19199,
1330,
5045,
27823,
11,
4377,
6030,
198,
198,
6738,
764,
9186,
1330,
9097,
198,
198,
834,
439,
834,
796,
37250,
13152,
... | 3.5 | 50 |
import datetime
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from project.models import *
post_save.connect(create_profile, sender=User)
| [
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
14881,
12982,
11,
2448,
8481,
35608,
259,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
... | 3.435294 | 85 |
# The following source code was originally obtained from:
# https://github.com/tensorflow/model-optimization/blob/v0.7.0/tensorflow_model_optimization/python/core/quantization/keras/quantize.py
# ==============================================================================
# Copyright 2019 The TensorFlow Authors. All... | [
2,
383,
1708,
2723,
2438,
373,
6198,
6492,
422,
25,
198,
2,
3740,
1378,
12567,
13,
785,
14,
83,
22854,
11125,
14,
19849,
12,
40085,
1634,
14,
2436,
672,
14,
85,
15,
13,
22,
13,
15,
14,
83,
22854,
11125,
62,
19849,
62,
40085,
163... | 3.118718 | 2,308 |
# pylint: disable=R0903, C0115
from abc import ABC, abstractmethod
from typing import AbstractSet, Any, final, Mapping, Sequence
from .base import ASTNode, Span
class Type(ASTNode, ABC):
"""
This is the base class for the program's representation of types in
the type system.
Warnings
--------
... | [
2,
279,
2645,
600,
25,
15560,
28,
49,
2931,
3070,
11,
327,
486,
1314,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
27741,
7248,
11,
4377,
11,
2457,
11,
337,
5912,
11,
45835,
198,
198,
6738,
764,
8692,
... | 2.740826 | 436 |
import os
import csv
from st2common.runners.base_action import Action
__all__ = [
'ParseCSVFileAction'
]
| [
11748,
28686,
198,
11748,
269,
21370,
198,
198,
6738,
336,
17,
11321,
13,
36740,
13,
8692,
62,
2673,
1330,
7561,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
10044,
325,
7902,
53,
8979,
12502,
6,
198,
60,
628
] | 2.666667 | 42 |
import abc
import time
from ipaddress import ip_address
from ticket_auth import TicketFactory, TicketError
from .abstract_auth import AbstractAuthentication
from aiohttp import web
_REISSUE_KEY = 'aiohttp_auth.auth.TktAuthentication.reissue'
class TktAuthentication(AbstractAuthentication):
"""Ticket authenticat... | [
11748,
450,
66,
198,
11748,
640,
198,
6738,
20966,
21975,
1330,
20966,
62,
21975,
198,
6738,
7846,
62,
18439,
1330,
24014,
22810,
11,
24014,
12331,
198,
6738,
764,
397,
8709,
62,
18439,
1330,
27741,
47649,
3299,
198,
6738,
257,
952,
402... | 2.479583 | 2,204 |
# -*- coding:utf-8 -*-
"""
===========================================
@author: lmy
@time: 2020/8/19 11:12 PM
@project: brat
@file: labelMatchEngine.py
===========================================
"""
import re
MATCH_ENGINE_HANDLERS = {
'keywords': 'keywordHandler',
'length': 'lengthHandler',
... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
198,
10052,
2559,
18604,
198,
220,
2488,
9800,
25,
220,
300,
1820,
198,
220,
2488,
2435,
25,
220,
220,
220,
12131,
14,
23,
14,
1129,
1367,
25,
1065,
3122,
198,
220... | 2.748031 | 127 |
from datetime import datetime
import os
import shutil
from zipfile import ZipFile
from rdflib import Graph, Namespace, RDF, Literal, XSD, URIRef
from csv import DictReader
from rdflib.namespace import FOAF, DCTERMS
from rdflib.resource import Resource
import sys
__author__ = 'Diarmuid'
if __name__ == "__main__":
... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
6738,
374,
67,
2704,
571,
1330,
29681,
11,
28531,
10223,
11,
371,
8068,
11,
25659,
1691,
11,
1395,
10305,
11,
... | 2.60625 | 160 |
""" Stores connection info between game nodes (positions) """
from src import helper
class Connection(object):
""" Stores connection info between game nodes (positions) """
def setstartX(self, value):
""" Setter for startX with type checking """
self.startX = value
def setstartY(self, va... | [
37811,
41835,
4637,
7508,
1022,
983,
13760,
357,
1930,
1756,
8,
37227,
198,
198,
6738,
12351,
1330,
31904,
198,
198,
4871,
26923,
7,
15252,
2599,
198,
220,
220,
220,
37227,
41835,
4637,
7508,
1022,
983,
13760,
357,
1930,
1756,
8,
37227,... | 2.825758 | 264 |
#!/usr/bin/env python3
# Write a program that computes typical stats
# Count, Min, Max, Mean, Std. Dev, Median
# No, you cannot import the stats library!
import sys
import math
data = []
for x in sys.argv[1:]:
flt = float(x)
data.append(flt)
count = len(data)
#max and min
minimum = data[0]
maximum = data[0]
for... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
19430,
257,
1430,
326,
552,
1769,
7226,
9756,
198,
2,
2764,
11,
1855,
11,
5436,
11,
22728,
11,
520,
67,
13,
6245,
11,
26178,
198,
2,
1400,
11,
345,
2314,
1330,
262,
9... | 2.408421 | 475 |
import json
import os.path
import sys
from typing import List, Dict
import boto3
if __name__ == '__main__':
cli()
| [
11748,
33918,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
198,
198,
11748,
275,
2069,
18,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
537... | 2.733333 | 45 |
import hashlib
import re
from django.core.cache import cache
from django.core.paginator import InvalidPage
from django.db.models import Case
from django.db.models import CharField
from django.db.models import F
from django.db.models import IntegerField
from django.db.models import OuterRef
from django.db.models import... | [
11748,
12234,
8019,
198,
11748,
302,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
23870,
1330,
12940,
198,
6738,
42625,
14208,
13,
7295,
13,
79,
363,
20900,
1330,
17665,
9876,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
8913,
198... | 3.661765 | 340 |
# %% Import Libraries
from landlab import Component
from ...utils.decorators import use_file_name_or_kwds
import numpy as np
# %% Instantiate Object
class LandslideProbability(Component):
"""
Landlab component designed to calculate a probability of failure at
each grid node based on the in... | [
201,
198,
2,
43313,
17267,
46267,
201,
198,
6738,
1956,
23912,
1330,
35100,
201,
198,
6738,
2644,
26791,
13,
12501,
273,
2024,
1330,
779,
62,
7753,
62,
3672,
62,
273,
62,
46265,
9310,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,... | 2.2138 | 7,507 |
import asyncio
import inspect
import logging
from typing import Awaitable, List, TYPE_CHECKING, Callable, Coroutine, Optional
import naff.models.naff as naff
from naff.client.const import logger_name, MISSING
from naff.client.utils.misc_utils import wrap_partial
from naff.models.naff.tasks import Task
if TYPE_CHECKIN... | [
11748,
30351,
952,
198,
11748,
10104,
198,
11748,
18931,
198,
6738,
19720,
1330,
5851,
4548,
540,
11,
7343,
11,
41876,
62,
50084,
2751,
11,
4889,
540,
11,
2744,
28399,
11,
32233,
198,
198,
11748,
299,
2001,
13,
27530,
13,
77,
2001,
35... | 2.328921 | 3,022 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import subprocess
import tempfile
import re
from inducingSHARK.util.git import CollectGit
# def test_excluding_file_regexes(self):
# positives = [
# 'src/java/test/org/apache/commons/Test.java',
# 'test/examples/org/ap... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
11748,
850,
14681,
198,
11748,
20218,
7753,
198,
11748,
302,
198,
198,
6738,
44561,
969... | 2.05102 | 490 |
from pytest import approx
from vyperdatum.points import *
from vyperdatum.vdatum_validation import vdatum_answers
gvc = VyperCore()
data_folder = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data')
vdatum_answer = vdatum_answers[gvc.vdatum.vdatum_version]
| [
6738,
12972,
9288,
1330,
5561,
198,
198,
6738,
410,
88,
525,
19608,
388,
13,
13033,
1330,
1635,
198,
6738,
410,
88,
525,
19608,
388,
13,
85,
19608,
388,
62,
12102,
341,
1330,
410,
19608,
388,
62,
504,
86,
364,
198,
198,
70,
28435,
... | 2.391667 | 120 |
from uuid import UUID
import json
from fastapi import APIRouter, Path, Body, Depends, HTTPException, Request, Response
from fastapi.responses import StreamingResponse
from fastapi.templating import Jinja2Templates
from starlette import status
from app.api.dependencies import image_service_dep, image_file_service_dep
... | [
6738,
334,
27112,
1330,
471,
27586,
198,
11748,
33918,
198,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
10644,
11,
12290,
11,
2129,
2412,
11,
14626,
16922,
11,
19390,
11,
18261,
198,
6738,
3049,
15042,
13,
16733,
274,
1330,
431... | 3.265896 | 346 |
from typing import List, Dict, Any
from setuptools import setup, find_packages
VERSION: Dict[str, Any] = {}
with open("registrable/version.py", "r") as version_file:
exec(version_file.read(), VERSION)
setup(
name="registrable",
version=VERSION["VERSION"],
description="Python module for registering a... | [
6738,
19720,
1330,
7343,
11,
360,
713,
11,
4377,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
43717,
25,
360,
713,
58,
2536,
11,
4377,
60,
796,
23884,
198,
4480,
1280,
7203,
2301,
396,
81,
540,
14,
9641,
... | 2.770089 | 448 |
def buffer_LinearRing(ring, dist, kwArgCheck = None, debug = False, fill = 1.0, nang = 19, simp = 0.1, tol = 1.0e-10):
"""Buffer a LinearRing
This function reads in a LinearRing that exists on the surface of the Earth
and returns a [Multi]Polygon of the same LinearRing buffered by a constant
distance (... | [
4299,
11876,
62,
14993,
451,
39687,
7,
1806,
11,
1233,
11,
479,
86,
28100,
9787,
796,
6045,
11,
14257,
796,
10352,
11,
6070,
796,
352,
13,
15,
11,
299,
648,
796,
678,
11,
985,
79,
796,
657,
13,
16,
11,
284,
75,
796,
352,
13,
1... | 2.888476 | 807 |
import os
from azure_encryption_helper import Encryptor
# Create ServicePrincipalCredentials object using your SP
# You can use MSIAuthentication if running on Azure VM
if 'USE_MSI' in os.environ.keys():
from msrestazure.azure_active_directory import MSIAuthentication
credentials = MSIAuthentication(resource=... | [
11748,
28686,
198,
6738,
35560,
495,
62,
12685,
13168,
62,
2978,
525,
1330,
14711,
6012,
273,
628,
198,
2,
13610,
4809,
42904,
8521,
34,
445,
14817,
2134,
1262,
534,
6226,
198,
2,
921,
460,
779,
6579,
3539,
315,
6925,
3299,
611,
2491,... | 2.845808 | 668 |
"""
Douban OAuth support.
This adds support for Douban OAuth service. An application must
be registered first on douban.com and the settings DOUBAN_CONSUMER_KEY
and DOUBAN_CONSUMER_SECRET must be defined with they corresponding
values.
By default account id is stored in extra_data field, check OAuthBackend
class for ... | [
37811,
198,
40287,
3820,
440,
30515,
1104,
13,
198,
198,
1212,
6673,
1104,
329,
5728,
3820,
440,
30515,
2139,
13,
1052,
3586,
1276,
198,
1350,
6823,
717,
319,
3385,
272,
13,
785,
290,
262,
6460,
360,
2606,
33,
1565,
62,
10943,
50,
5... | 2.40732 | 847 |
# -*- coding: utf-8 -*-
import torch
import torch.nn.functional as F
from torch.nn import Linear, Embedding
from torch_geometric.nn import ARMAConv
from torch_geometric.data import Data
from util import timeclass,get_logger
import pandas as pd
import numpy as np
import random
import time
import copy
from process_data ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
20471,
1330,
44800,
11,
13302,
6048,
278,
198,
6738,
28034,
62,
469,
16996,
13,
20... | 2.826667 | 150 |
import io
import os
import ui
import sys
import time
import Image
import numpy
import photos
import shutil
import socket
import console
import zipfile
import ImageOps
import objc_util
import matplotlib.cm
import urllib.request
from threading import Event, Thread
from socketserver import ThreadingMixIn
from http.server ... | [
11748,
33245,
198,
11748,
28686,
198,
11748,
334,
72,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
7412,
198,
11748,
299,
32152,
198,
11748,
5205,
198,
11748,
4423,
346,
198,
11748,
17802,
198,
11748,
8624,
198,
11748,
19974,
7753,
198... | 2.384226 | 11,652 |
# !/usr/bin/python
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db import transaction
import sys
import pyexcel as pe
from core.base_permission import create_test_paciente_data
| [
2,
5145,
14,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
11748,
25064,
... | 3.411765 | 68 |
import matplotlib.pyplot as plt
from .interfaces import BaseLassoNetCV
from .utils import confidence_interval, eval_on_path
def plot_path(model, path, X_test, y_test, *, score_function=None):
"""
Plot the evolution of the model on the path, namely:
- lambda
- number of selected variables
- score
... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
764,
3849,
32186,
1330,
7308,
43,
28372,
7934,
33538,
198,
198,
6738,
764,
26791,
1330,
6628,
62,
3849,
2100,
11,
5418,
62,
261,
62,
6978,
628,
198,
4299,
7110,
62,
... | 2.47007 | 568 |
from django import forms
from captcha.fields import ReCaptchaField
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
48972,
13,
25747,
1330,
797,
19209,
11693,
15878,
628
] | 4.25 | 16 |
import logging
from typing import Any, Dict, List
from pydantic import BaseModel # pylint: disable=no-name-in-module
from tgcf.plugins import FileType, TgcfMessage, TgcfPlugin
from tgcf.utils import match
| [
11748,
18931,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
220,
1303,
279,
2645,
600,
25,
15560,
28,
3919,
12,
3672,
12,
259,
12,
21412,
198,
198,
6738,
256,
70,
12993,
13... | 3.086957 | 69 |
import numpy
data = numpy.genfromtxt(fname="housing.data")
################# Advanced
for line in data:
print(*line)
################# Reach 1
for line in data:
list = line.tolist()
strList = [str(i) for i in list]
print(strList)
| [
11748,
299,
32152,
198,
198,
7890,
796,
299,
32152,
13,
5235,
6738,
14116,
7,
69,
3672,
2625,
50028,
13,
7890,
4943,
198,
198,
14468,
2,
13435,
198,
1640,
1627,
287,
1366,
25,
198,
220,
220,
220,
3601,
46491,
1370,
8,
198,
198,
1446... | 2.747253 | 91 |
# Generated by Django 2.1.5 on 2019-02-11 16:40
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
20,
319,
13130,
12,
2999,
12,
1157,
1467,
25,
1821,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
import re
import ast
from bs4 import BeautifulSoup as soup
from urllib.request import urlopen as ureq
from .helpers.constants import INFOGRAM_LINK
| [
11748,
302,
198,
11748,
6468,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
17141,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
355,
334,
42180,
198,
198,
6738,
764,
16794,
364,
13,
9979,
1187,
1330,
24890,
10761,
2... | 3.23913 | 46 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import re
import codecs
black_list_pattern = r'[\u4e00-\u9fff]+|[\uff01-\uff5e]+|[\u201c\u201d\u300a\u300b\u3010\u3011\uff5b\uff5d\uff1b\uff1a\u3002\uff0c\u3001\uff1f]+'
white_list_pattern = r'[^\s\x21-\xE7]+'
if __name__ == '__main__':
main... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
40481,
82,
198,
198,
13424,
62,
4868,
62,
... | 1.861272 | 173 |
import sys
from math import gcd as gcd_math
from math import factorial as factorial_math
from scipy.special import perm
from scipy.special import comb
from random import randint
import data_structure_lib
import math_lib
# --------------------------------------------------
# data_structure_lib
# 二分探索
# ダイクストラ法,ワー... | [
11748,
25064,
198,
6738,
10688,
1330,
308,
10210,
355,
308,
10210,
62,
11018,
198,
6738,
10688,
1330,
1109,
5132,
355,
1109,
5132,
62,
11018,
198,
6738,
629,
541,
88,
13,
20887,
1330,
9943,
198,
6738,
629,
541,
88,
13,
20887,
1330,
19... | 2.339806 | 309 |
def read_yaml_file(filename):
"""
@parameters filename, filename of the yaml file
@returns dictionary of each parameter with the corresponding value.
"""
parameters = {}
with open(filename) as file:
lines = file.readlines()
for line in lines:
line = line.strip()
... | [
4299,
1100,
62,
88,
43695,
62,
7753,
7,
34345,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2488,
17143,
7307,
29472,
11,
29472,
286,
262,
331,
43695,
2393,
198,
220,
220,
220,
2488,
7783,
82,
22155,
286,
1123,
11507,
351,
2... | 2.142202 | 436 |
tot = 0
nomep = []
nomel = []
dadost = []
pesop = 0
pesol = 100000000000000000000 ** 10000
while True:
dadost.append(input('Nome: '))
dadost.append(float(input('Peso: ')))
tot += 1
if dadost[1] >= pesop:
if dadost[1] == pesop:
nomep.append(dadost[0])
elif dadost[1] > pesop:
nomep.clear()
... | [
83,
313,
796,
657,
198,
77,
462,
79,
796,
17635,
198,
26601,
417,
796,
17635,
198,
47984,
455,
796,
17635,
198,
12272,
404,
796,
657,
198,
12272,
349,
796,
1802,
25645,
405,
12429,
33028,
198,
4514,
6407,
25,
198,
220,
9955,
455,
13... | 2.068293 | 410 |
""" scraper.py
Handles the webscraping of the app.
Key variables
- scraper.archive == Array of the titles of old notices
- scraper.notices_5 == Array of Meetings/Practices (has ALL INFORMATION)
- scraper.notices_3 == Array of Notices (has ALL INFORMATION BUT date and location)
Each is explained further be... | [
37811,
19320,
525,
13,
9078,
198,
12885,
829,
262,
3992,
1416,
2416,
278,
286,
262,
598,
13,
198,
198,
9218,
9633,
198,
220,
220,
220,
532,
19320,
525,
13,
17474,
6624,
15690,
286,
262,
8714,
286,
1468,
19748,
198,
220,
220,
220,
53... | 2.296945 | 1,997 |
import pytest
from tests.factories import RegistrationRequestFactory
from tests.utils import get_view_for_user
@pytest.mark.django_db
@pytest.mark.django_db
| [
11748,
12972,
9288,
198,
198,
6738,
5254,
13,
22584,
1749,
1330,
24610,
18453,
22810,
198,
6738,
5254,
13,
26791,
1330,
651,
62,
1177,
62,
1640,
62,
7220,
628,
198,
31,
9078,
9288,
13,
4102,
13,
28241,
14208,
62,
9945,
628,
198,
31,
... | 3.115385 | 52 |
import mrcnn.model as modellib
import os
import sys
import cv2
import random
import numpy as np
import pandas as pd
import deeplabcut
import json
import skimage
import skimage.io
from skimage.util import img_as_ubyte, img_as_float
from skimage import morphology, measure, filters
from shutil import copyfile
from skimage... | [
11748,
285,
6015,
20471,
13,
19849,
355,
953,
695,
571,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
269,
85,
17,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
390,
68,
48... | 2.084759 | 26,121 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
13,
26791,
13,
9122,
4122,
355,
31396,
628,
628
] | 3.419355 | 31 |
from django.urls import path
from django.conf import settings
from django.contrib.staticfiles.urls import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("login", views.login_view, name="login"),
... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
12708,
16624,
13,
6371,
82,
1330,
9037,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
12708,
16624,
... | 2.914081 | 419 |
from spiketag.view import cluster_view
import numpy as np
if __name__ == '__main__':
cluview = cluster_view()
group_No = 40
sorting_status = np.random.randint(low=0, high=3, size=group_No) # 0: not ready; 1: ready; 2: done
print(sorting_status)
cluview.set_data(group_No=group_No, sorting_statu... | [
6738,
599,
1134,
316,
363,
13,
1177,
1330,
13946,
62,
1177,
198,
11748,
299,
32152,
355,
45941,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
537,
84,
1177,
796,
13946,
62,
1177,
3419,
198,
... | 2.297561 | 205 |
import configparser
import os
from compute import Config_ini
from train.utils import TrainConfig
| [
11748,
4566,
48610,
198,
11748,
28686,
198,
198,
6738,
24061,
1330,
17056,
62,
5362,
198,
6738,
4512,
13,
26791,
1330,
16835,
16934,
628
] | 4.304348 | 23 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T
#
# Copyright (c) 2016+ Buro Petr van Blokland + Claudia Mens
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
16529,
32501,
198,
2,
198,
2,
220,
220,
220,
220,
350,
317,
402,
412,
347,
440,
309,
198,
2,
198,
2,
220,
220... | 3.171429 | 245 |
import aisy_sca
from app import *
from custom.custom_models.neural_networks import *
aisy = aisy_sca.Aisy()
aisy.set_resources_root_folder(resources_root_folder)
aisy.set_database_root_folder(databases_root_folder)
aisy.set_datasets_root_folder(datasets_root_folder)
aisy.set_database_name("database_ascad.sqlite")
ai... | [
11748,
257,
13560,
62,
1416,
64,
198,
6738,
598,
1330,
1635,
198,
6738,
2183,
13,
23144,
62,
27530,
13,
710,
1523,
62,
3262,
5225,
1330,
1635,
628,
198,
198,
64,
13560,
796,
257,
13560,
62,
1416,
64,
13,
32,
13560,
3419,
198,
64,
... | 2.300412 | 243 |
from django.core.management import BaseCommand
from core.cache import rebuild_all_cache
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
7308,
21575,
198,
6738,
4755,
13,
23870,
1330,
17884,
62,
439,
62,
23870,
628
] | 4.045455 | 22 |
from tuun.backend import ProboBackend
model_config = {'name': 'simplegp', 'ls': 3.0, 'alpha': 1.5, 'sigma': 1e-5}
acqfunction_config = {'name': 'default', 'acq_str': 'ei'}
acqoptimizer_config = {'name': 'default', 'max_iter': 200}
domain_config = {'name': 'real', 'min_max': [(-5, 5)]}
f = lambda x: x[0] ** 4 - x[0] *... | [
6738,
12777,
403,
13,
1891,
437,
1330,
1041,
2127,
7282,
437,
198,
198,
19849,
62,
11250,
796,
1391,
6,
3672,
10354,
705,
36439,
31197,
3256,
705,
7278,
10354,
513,
13,
15,
11,
705,
26591,
10354,
352,
13,
20,
11,
705,
82,
13495,
103... | 2.404145 | 193 |
from jpntextgen.engine import Engine
engine = Engine()
print(engine.get_address())
print(engine.get_full_name())
print(engine.get_date())
print(engine.get_general_text())
print(engine.get_additional_info())
print(engine.get_email())
print(engine.get_url())
print(engine.get_eng_katakana())
print(engine.get_phone_numbe... | [
6738,
474,
79,
429,
2302,
5235,
13,
18392,
1330,
7117,
198,
198,
18392,
796,
7117,
3419,
198,
198,
4798,
7,
18392,
13,
1136,
62,
21975,
28955,
198,
4798,
7,
18392,
13,
1136,
62,
12853,
62,
3672,
28955,
198,
4798,
7,
18392,
13,
1136,... | 2.913907 | 151 |
#!/usr/bin/env python3
import numpy as np
import os
import time
import gym
import json
import sys
import functools
from tqdm import tqdm, tnrange
from drlnd.core.common.util import is_notebook, count_boundaries
from drlnd.core.agents.base_agent import AgentBase
from drlnd.core.common.ring_buffer import ContiguousRing... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
11550,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
1257,
310,
10141,
198,
6738,
256,
80,
360... | 3.034146 | 205 |
#!/usr/bin/env python2
#
# This script changes C++ code, CMake files and FHiCL configuration to use
# larcorealg instead of larcore for geometrye
#
# Change log:
# 20170703 (petrillo@fnal.gov)
# original version
#
import sys, re
import SerialSubstitution
from SerialSubstitution import AddProcessor, RunSubstitutor
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
198,
2,
770,
4226,
2458,
327,
4880,
2438,
11,
327,
12050,
3696,
290,
376,
17250,
5097,
8398,
284,
779,
198,
2,
300,
5605,
382,
14016,
2427,
286,
300,
5605,
382,
329,
22939,
... | 2.095581 | 2,919 |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Sphinx extension to add directives to allow files and code to include the
latest installable version of Flocker.
"""
import importlib
import os
from sphinx.directives.code import LiteralInclude
from sphinx.roles import XRefRole
from flocker import __v... | [
2,
15069,
29481,
30146,
12052,
13,
220,
4091,
38559,
24290,
2393,
329,
3307,
13,
198,
198,
37811,
198,
50,
746,
28413,
7552,
284,
751,
34819,
284,
1249,
3696,
290,
2438,
284,
2291,
262,
198,
42861,
2721,
540,
2196,
286,
1610,
12721,
1... | 3.005353 | 934 |
import argparse
import os
import json
import random
import torch
import torch.nn as nn
from torch.nn import functional as F
from torchvision import transforms
from PIL import Image
from tqdm import tqdm
import lpips
import sys
sys.path.append('.') # to run from the project root dir
import models
from thirdparty i... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
4738,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198,
6738,
28034,
10178,
1330,
31408,... | 2.545455 | 1,474 |
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""A tiny Python program to check that Python is working.
Try running this program from t... | [
2,
48443,
14629,
14,
8800,
14,
29412,
532,
926,
198,
2,
15069,
3050,
3012,
3457,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
198,
2,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,... | 3.450216 | 231 |
"""
notsosimple_project_test.py
---------------------------
Run `decu` on the mock project notsosimple_project.
"""
import os
import decu
import pytest
from subprocess import call
from util import make_teardown_fixture
PROJECT_DIR = 'notsosimple_project/'
teardown = pytest.fixture(scope='module', autouse=True)(
... | [
37811,
198,
1662,
82,
418,
320,
1154,
62,
16302,
62,
9288,
13,
9078,
198,
22369,
6329,
198,
198,
10987,
4600,
12501,
84,
63,
319,
262,
15290,
1628,
407,
82,
418,
320,
1154,
62,
16302,
13,
198,
198,
37811,
198,
198,
11748,
28686,
198... | 2.688462 | 260 |
import pandas as pd
import numpy as np
from pathlib import Path
if __name__ == '__main__':
# split_local_data_to_single_files('data/rfam_learn_local/test')
# split_local_data_to_single_files('data/rfam_learn_local/train')
# split_local_data_to_single_files('data/rfam_learn_local/validation')
# print... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3108,
8019,
1330,
10644,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1303,
6626,
62,
12001,
62,
7890,
62,... | 2.487129 | 505 |
import subprocess,sys,click
from subprocess import Popen,CREATE_NEW_CONSOLE
from selenium import webdriver
import six
from pyfiglet import figlet_format
from click_help_colors import HelpColorsGroup, HelpColorsCommand
# Coloring libraries
# Try colorama
try:
import colorama
colorama.init()
except ImportError:
... | [
11748,
850,
14681,
11,
17597,
11,
12976,
198,
6738,
850,
14681,
1330,
8099,
268,
11,
43387,
6158,
62,
13965,
62,
10943,
15821,
2538,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
11748,
2237,
198,
6738,
12972,
5647,
1616,
1330,
2... | 2.944751 | 905 |
# Copyright (c) 2012-2022, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from .. import AWSProperty
from . import boolean, network_port, positive_integer
class AlarmIdentifier(AWSProperty):
"""
Export:
"""
props = {
"Name": (str, True),
"Reg... | [
2,
15069,
357,
66,
8,
2321,
12,
1238,
1828,
11,
2940,
2631,
988,
1279,
4102,
31,
431,
988,
13,
2398,
29,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
4091,
38559,
24290,
2393,
329,
1336,
5964,
13,
628,
198,
6738,
11485,
1330,
... | 2.364437 | 568 |
# Generated by Django 2.2.6 on 2019-11-21 21:06
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
21,
319,
13130,
12,
1157,
12,
2481,
2310,
25,
3312,
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 cv2
face_data = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
cap = cv2.VideoCapture(0)
while True:
ret, img = cap.read()
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_data.detectMultiScale(gray, 1.3, 5)
for x,y,w,h in faces:
cv2.rectangle(img, (... | [
11748,
269,
85,
17,
201,
198,
201,
198,
2550,
62,
7890,
796,
269,
85,
17,
13,
34,
28966,
9487,
7483,
7203,
3099,
5605,
28966,
62,
8534,
1604,
558,
62,
12286,
13,
19875,
4943,
201,
198,
201,
198,
11128,
796,
269,
85,
17,
13,
10798,... | 1.898833 | 257 |
# Generated by Django 2.2.5 on 2020-10-16 07:38
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
20,
319,
12131,
12,
940,
12,
1433,
8753,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import os
from dotenv import load_dotenv
load_dotenv()
APP_ENV = os.getenv("APP_ENV", default="development") # IMPORTANT: set to "production" in production
APP_VERSION = os.getenv("APP_VERSION", default="v0.0.1") # update upon new releases
| [
628,
198,
11748,
28686,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
24805,
62,
1677,
53,
796,
28686,
13,
1136,
24330,
7203,
24805,
62,
1677,
53,
1600,
4277,
2625,
31267,
4943,... | 2.987805 | 82 |
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
vertices= (
(0, 0, 0),
(1, 0, 0),
(1, 1, 0),
(0, 1 ,0),
(0, 0, 1),
(1, 0, 1),
(1, 1, 1),
(0, 1, 1),
)
edges = (
(0,1),
(1,2),
(2,3),
(3,0),
(0,4),
(1,5),
(2,6),
... | [
11748,
12972,
6057,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
6738,
30672,
13,
8763,
1330,
1635,
198,
6738,
30672,
13,
8763,
52,
1330,
1635,
198,
198,
1851,
1063,
28,
357,
198,
220,
220,
220,
357,
15,
11,
657,
11,
657... | 1.562249 | 249 |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
14432,
84,
11712,
30617,
7824,
628,
220,
220,
220,
383,
14432,
84,
11712,
30617,
7824,
3769,
345,
351,
257,
3665,
11,
11282,
11,
290,
2829,
5313,
2594,
7824,
329,
... | 2.239273 | 4,731 |
from unittest import TestCase
from taguri.validator import (
authority_name_validator,
date_validator,
specific_validator,
)
# https://blogs.msdn.microsoft.com/testing123/2009/02/06/email-address-test-cases/
# Note, however, that there are cases left out because the tag URI
# grammar allows or ... | [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
7621,
9900,
13,
12102,
1352,
1330,
357,
198,
220,
220,
220,
4934,
62,
3672,
62,
12102,
1352,
11,
198,
220,
220,
220,
3128,
62,
12102,
1352,
11,
198,
220,
220,
220,
2176,
62,
12102,
... | 2.982143 | 112 |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import sys
import MySQLdb
from PyQt5.uic import loadUiType
ui,_ = loadUiType('id_gen.ui')
if __name__ == '__main__':
main()
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1635,
198,
11748,
25064,
198,
11748,
33476,
994... | 2.260417 | 96 |
#!/usr/bin/env python
#
# Copyright (c) 2013-2016, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
import sys
im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
357,
66,
8,
2211,
12,
5304,
11,
35920,
43412,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2393,
318,
9387,
739,
262,
2846,
287,
262,
7223,
38559,
24... | 3.020979 | 143 |
from typing import List
| [
6738,
19720,
1330,
7343,
198
] | 4.8 | 5 |
from ..qt_compat import QtGui, QtCore, QtWidgets
import six
import os
from collections import defaultdict
from ..core import DataModel, LabelManager
DEFAULT_DIR_KEY = "default_dir"
DEFAULT_DATA_KEY = "default_data_dir"
| [
198,
6738,
11485,
39568,
62,
5589,
265,
1330,
33734,
8205,
72,
11,
33734,
14055,
11,
33734,
54,
312,
11407,
198,
198,
11748,
2237,
198,
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
11485,
7295,
1330,
6060,
17633,
11,
36... | 3 | 79 |
# Generated from \R.g4 by ANTLR 4.9
from antlr4 import *
if __name__ is not None and "." in __name__:
from .RParser import RParser
else:
from RParser import RParser
# This class defines a complete listener for a parse tree produced by RParser.
# Enter a parse tree produced by RParser#parse.
# Exit a... | [
2,
2980,
515,
422,
3467,
49,
13,
70,
19,
416,
3537,
14990,
49,
604,
13,
24,
198,
6738,
1885,
14050,
19,
1330,
1635,
198,
361,
11593,
3672,
834,
318,
407,
6045,
290,
366,
526,
287,
11593,
3672,
834,
25,
198,
220,
220,
220,
422,
7... | 3.253615 | 1,798 |
import logging
logger = logging.getLogger(__name__)
def strict_show_toolbar_callback(request):
"""
Additional check against custom permission ``debug_toolbar.show``.
:param request: HttpRequest
:return: bool
"""
if hasattr(request, 'user') and \
request.user.has_perm('debug_toolbar.sh... | [
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4299,
7646,
62,
12860,
62,
25981,
5657,
62,
47423,
7,
25927,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15891,
2198,
10... | 2.752044 | 734 |
import re
import os
import random
import psycopg2
import requests
from .models import User
from flask import request, session
from twilio.twiml.messaging_response import MessagingResponse, Message
from . import app, db
basic_payload = {
'api_key': os.environ.get('AB_API_KEY'),
'cookie': "TestyMcTestface"
}
#P... | [
11748,
302,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
7007,
198,
6738,
764,
27530,
1330,
11787,
198,
6738,
42903,
1330,
2581,
11,
6246,
198,
6738,
665,
346,
952,
13,
4246,
320,
75,
13,
37348,
3... | 2.173659 | 2,741 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .pix3d_evaluation import Pix3DEvaluator, transform_meshes_to_camera_coord_system
| [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
198,
6738,
764,
79,
844,
18,
67,
62,
18206,
2288,
1330,
21642,
18,
7206,
2100,
84,
1352,
11,
6121,
62,
6880,
956,
62,
1462,
62,
25695,
62,
37652,
... | 3.340426 | 47 |
import paramiko
| [
11748,
5772,
12125,
628,
198
] | 3.6 | 5 |
"""
Delta E ITP.
https://kb.portrait.com/help/ictcp-color-difference-metric
"""
from ..distance import DeltaE
import math
from ... import util
class DEITP(DeltaE):
"""Delta E ITP class."""
@staticmethod
def name():
"""Name of method."""
return "itp"
@staticmethod
def distance(c... | [
37811,
198,
42430,
412,
314,
7250,
13,
198,
198,
5450,
1378,
32812,
13,
634,
12907,
13,
785,
14,
16794,
14,
713,
13155,
12,
8043,
12,
26069,
1945,
12,
4164,
1173,
198,
37811,
198,
6738,
11485,
30246,
1330,
16978,
36,
198,
11748,
10688... | 2.277778 | 288 |
#!/usr/bin/env python
try:
from mechanize import Request, urlopen, URLError, HTTPError,ProxyHandler, build_opener, install_opener, Browser
except ImportError:
print "\n[X] Please install mechanize module:"
print " http://wwwsearch.sourceforge.net/mechanize/\n"
exit()
from collections import default... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
3962,
1096,
1330,
19390,
11,
19016,
9654,
11,
37902,
2538,
81,
1472,
11,
14626,
12331,
11,
44148,
25060,
11,
1382,
62,
404,
877,
11,
2721,
62... | 3.17037 | 135 |
# @param A : list of integers
# @return a list of list of integers
| [
220,
220,
220,
1303,
2488,
17143,
317,
1058,
1351,
286,
37014,
198,
220,
220,
220,
1303,
2488,
7783,
257,
1351,
286,
1351,
286,
37014,
198
] | 3 | 25 |
from __future__ import division
from builtins import str
from past.utils import old_div
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import dictionaries as dlg_populate
import sys
import pickle
from IPython import embed as II
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
3170,
1040,
1330,
965,
198,
6738,
1613,
13,
26791,
1330,
1468,
62,
7146,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72... | 3.045977 | 87 |
__author__ = 'demi'
# Question 5: Date Converter
# Write a procedure date_converter which takes two inputs. The first is
# a dictionary and the second a string. The string is a valid date in
# the format month/day/year. The procedure should return
# the date written in the form <day> <name of month> <year>.
# For ex... | [
834,
9800,
834,
796,
705,
9536,
72,
6,
628,
198,
2,
18233,
642,
25,
7536,
35602,
353,
198,
198,
2,
19430,
257,
8771,
3128,
62,
1102,
332,
353,
543,
2753,
734,
17311,
13,
383,
717,
318,
198,
2,
257,
22155,
290,
262,
1218,
257,
47... | 2.779126 | 412 |