content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import numpy as np
import pytest
from cblearn.datasets import fetch_musician_similarity
| [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
198,
6738,
269,
903,
1501,
13,
19608,
292,
1039,
1330,
21207,
62,
14664,
6749,
62,
38610,
414,
198
] | 3.178571 | 28 |
from django.utils.decorators import method_decorator
from rest_framework import viewsets, status, generics
from rest_framework.response import Response
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from drf_yasg.utils import swa... | [
6738,
42625,
14208,
13,
26791,
13,
12501,
273,
2024,
1330,
2446,
62,
12501,
273,
1352,
198,
6738,
1334,
62,
30604,
1330,
5009,
1039,
11,
3722,
11,
1152,
873,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
306... | 3.305556 | 144 |
from mail_bug.mail_bug import MailBug
| [
6738,
6920,
62,
25456,
13,
4529,
62,
25456,
1330,
11099,
25624,
628
] | 3.25 | 12 |
# _*_coding:utf-8_*_
from django.conf import settings
import uuid, os, json, logging, time, shutil
from datetime import datetime, date
from PIL import Image, ImageFile
import mimetypes
import re
logger = logging.getLogger(__name__)
def getFileUri(fileInfo):
""" """
if fileInfo is None or fileInfo == "":
... | [
2,
4808,
9,
62,
66,
7656,
25,
40477,
12,
23,
62,
9,
62,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
11748,
334,
27112,
11,
28686,
11,
33918,
11,
18931,
11,
640,
11,
4423,
346,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
... | 2.120601 | 2,330 |
import requests
from tqdm import tqdm
from time import sleep
import os
| [
11748,
7007,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
640,
1330,
3993,
198,
11748,
28686,
628
] | 3.6 | 20 |
"""Bottle route plugins."""
from .injection_plugin import InjectionPlugin
| [
37811,
28653,
293,
6339,
20652,
526,
15931,
198,
198,
6738,
764,
259,
29192,
62,
33803,
1330,
554,
29192,
37233,
198
] | 3.75 | 20 |
from enum import Enum
from typing import List, Union
from urllib.parse import urljoin
import warnings
from airflow.exceptions import AirflowException
from airflow.providers.siafi.hooks.siafi import SIAFIHook
import requests
warnings.filterwarnings('ignore', message='Unverified HTTPS request')
| [
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
7343,
11,
4479,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
22179,
198,
11748,
14601,
198,
198,
6738,
45771,
13,
1069,
11755,
1330,
3701,
11125,
16922,
198,
6738,
45771,
13,
1... | 3.666667 | 81 |
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
| [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
11685,
628
] | 3.6 | 25 |
import backoff
import psycopg2
from psycopg2.extras import DictCursor, NamedTupleCursor
from st_library.utils.generics.connectors import ConnectorContainer
_disconnect_errors = (psycopg2.InterfaceError, psycopg2.OperationalError,)
_backoff = backoff.on_exception(backoff.expo, _disconnect_errors, max_time=30, max_tri... | [
11748,
736,
2364,
198,
11748,
17331,
22163,
70,
17,
198,
6738,
17331,
22163,
70,
17,
13,
2302,
8847,
1330,
360,
713,
34,
21471,
11,
34441,
51,
29291,
34,
21471,
198,
198,
6738,
336,
62,
32016,
13,
26791,
13,
8612,
873,
13,
8443,
669... | 2.642857 | 210 |
import gooeypie as gp
date_formats = ['28/8/20', '8/28/20', '28/08/2020', '08/28/2020', '2020-08-28',
'28-Aug-2020', 'Friday, August 28, 2020', 'Friday, 28 August, 2020',
'August 28, 2020', '28 August, 2020']
app = gp.GooeyPieApp('Time and date')
app.width = 250
label = gp.Label(app, ... | [
11748,
467,
2577,
4464,
494,
355,
27809,
198,
198,
4475,
62,
687,
1381,
796,
37250,
2078,
14,
23,
14,
1238,
3256,
705,
23,
14,
2078,
14,
1238,
3256,
705,
2078,
14,
2919,
14,
42334,
3256,
705,
2919,
14,
2078,
14,
42334,
3256,
705,
... | 2.210938 | 256 |
# https://www.w3.org/TR/filter-effects/#funcdef-grayscale
# https://www.w3.org/TR/filter-effects/#grayscaleEquivalent
# https://www.w3.org/TR/SVG/filters.html#feColorMatrixElement
import numpy as np
from . import rgb_clamp
_CONST_PART = np.array([[0.2126, 0.7152, 0.0722],
[0.2126, 0.7152, 0.... | [
2,
3740,
1378,
2503,
13,
86,
18,
13,
2398,
14,
5446,
14,
24455,
12,
34435,
31113,
20786,
4299,
12,
2164,
592,
38765,
198,
2,
3740,
1378,
2503,
13,
86,
18,
13,
2398,
14,
5446,
14,
24455,
12,
34435,
31113,
2164,
592,
38765,
23588,
2... | 2.087045 | 494 |
# Specialization: Google IT Automation with Python
# Course 01: Crash Course with Python
# Week 5 Module Part 3 Exercise 02
# Student: Shawn Solomon
# Learning Platform: Coursera.org
# Lets expand a bit on our Clothing classes from the previous in-video question. Your mission:
# Finish the "Stock_by_Material" ... | [
2,
6093,
1634,
25,
3012,
7283,
17406,
341,
351,
11361,
201,
198,
2,
20537,
5534,
25,
23653,
20537,
351,
11361,
201,
198,
2,
6119,
642,
19937,
2142,
513,
32900,
7816,
201,
198,
2,
13613,
25,
25225,
22912,
201,
198,
2,
18252,
19193,
2... | 2.668831 | 616 |
import requests
from bs4 import BeautifulSoup
if __name__ == "__main__":
print(find_word_meaning("intense"))
| [
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
19796,
62,
4775,
62,
24815,
7203,
600,
1072,
48774,
198
] | 2.9 | 40 |
# simply handles the reply for hello by the user
import re
import random
import os
import sys
import webbrowser
from random import randint
# getting the watson api functions here
PATH = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir))
sys.path.append(PATH)
MUSIC_PATH = os.path.... | [
2,
2391,
17105,
262,
10971,
329,
23748,
416,
262,
2836,
198,
11748,
302,
198,
11748,
4738,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
3992,
40259,
198,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
2,
1972,
262,
266,
1... | 3.031088 | 193 |
""" utils.py - helper functions """
import logging
import functools
import operator
from repoze.lru import lru_cache
from gevent import spawn
from gevent.subprocess import Popen, PIPE
try:
import boto3
except ImportError:
boto3 = None
def dump(app, logger):
"""
Run dump script as separate process
... | [
37811,
3384,
4487,
13,
9078,
532,
31904,
5499,
37227,
198,
198,
11748,
18931,
198,
11748,
1257,
310,
10141,
198,
11748,
10088,
198,
6738,
29924,
2736,
13,
75,
622,
1330,
300,
622,
62,
23870,
198,
6738,
4903,
1151,
1330,
10922,
198,
6738... | 2.404472 | 492 |
import colorlog
handler = colorlog.StreamHandler()
handler.setFormatter(
colorlog.ColoredFormatter(
"%(log_color)s%(levelname)s:%(name)s:%(filename)s:%(funcName)s: %(message)s"
)
)
logger = colorlog.getLogger(__name__)
logger.addHandler(handler)
| [
11748,
3124,
6404,
198,
198,
30281,
796,
3124,
6404,
13,
12124,
25060,
3419,
198,
30281,
13,
2617,
8479,
1436,
7,
198,
220,
220,
220,
3124,
6404,
13,
5216,
1850,
8479,
1436,
7,
198,
220,
220,
220,
220,
220,
220,
220,
36521,
7,
6404,... | 2.357143 | 112 |
# -*- coding: utf-8 -*-
# daemon/pidfile.py
# Part of python-daemon, an implementation of PEP 3143.
#
# Copyright 20082010 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the Python Software Foundation License, version 2 or
# la... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
33386,
14,
35317,
7753,
13,
9078,
198,
2,
2142,
286,
21015,
12,
6814,
7966,
11,
281,
7822,
286,
350,
8905,
513,
21139,
13,
198,
2,
198,
2,
15069,
220,
3648,
... | 3.482558 | 172 |
import logging
from django.db import transaction as db_transaction
from django.conf import settings
from django.utils import timezone
from django.urls import reverse_lazy
from zazi.core.utils import get_absolute_url, get_encrypted_text
from .. import api
from ..models import (
MpesaAccount,
MpesaAccountBala... | [
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
355,
20613,
62,
7645,
2673,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
6371,
82,
1... | 2.93617 | 188 |
#!/usr/bin/env python3
#JOHN Hammond method result
import requests
url = "https://pasteurize.web.ctfcompetition.com/"
req = requests.post(url,data = {
"content[]": ";new Image().src='https://webhook.site/8db05257-6ad1-44a9-979a-574c1caca5d6?asdf='+document.cookie//"
})
print(req.text)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
47118,
26649,
2446,
1255,
198,
198,
11748,
7007,
198,
198,
6371,
796,
366,
5450,
1378,
34274,
333,
1096,
13,
12384,
13,
310,
69,
5589,
15620,
13,
785,
30487,
198,
198,
42... | 2.434426 | 122 |
#!/usr/bin/python
#
# Usage: plot.py [input_file] [xlabel] [ylabel] [x] [y] [where] [where_values] [groupby]
#
# input_file: Input tsv file where the first row contains column names
# xlabel: Label for plot horizontal axis
# ylabel: Label for plot vertical axis
# x: Name of column to plot on horizontal axis
# y: Name o... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
29566,
25,
7110,
13,
9078,
685,
15414,
62,
7753,
60,
685,
87,
18242,
60,
685,
2645,
9608,
60,
685,
87,
60,
685,
88,
60,
685,
3003,
60,
685,
3003,
62,
27160,
60,
685,
8094,
... | 2.949045 | 628 |
#!/usr/bin/python
# -*- coding:UTF-8 -*-
# -----------------------------------------------------------------------#
# File Name: version.py
# Author: Junyi Li
# Mail: 4ljy@163.com
# Created Time: 2021-01-27
# Description:
# -----------------------------------------------------------------------#
__version__ = "0.2.2"
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
48504,
12,
23,
532,
9,
12,
198,
2,
16529,
26866,
2,
198,
2,
9220,
6530,
25,
2196,
13,
9078,
198,
2,
6434,
25,
7653,
48111,
7455,
198,
2,
11099,
25,
604,
75,
... | 3.764706 | 85 |
import unittest
import falcon
import falcon.testing
import app.util.json as json
from app import create_app
| [
11748,
555,
715,
395,
198,
198,
11748,
24215,
1102,
198,
11748,
24215,
1102,
13,
33407,
198,
198,
11748,
598,
13,
22602,
13,
17752,
355,
33918,
198,
6738,
598,
1330,
2251,
62,
1324,
628
] | 3.363636 | 33 |
##############################################################################
#
# Copyright (c) 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
15069,
357,
66,
8,
3717,
1168,
3008,
5693,
290,
25767,
669,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
262,
1168,
3008,
5094,
13789... | 3.917241 | 290 |
import os
import codecs
from shutil import copyfile
from gensim.models import KeyedVectors
from SPARQLWrapper import SPARQLWrapper, JSON
| [
11748,
28686,
198,
11748,
40481,
82,
198,
6738,
4423,
346,
1330,
4866,
7753,
198,
6738,
308,
641,
320,
13,
27530,
1330,
7383,
276,
53,
478,
669,
198,
6738,
6226,
1503,
9711,
36918,
2848,
1330,
6226,
1503,
9711,
36918,
2848,
11,
19449,
... | 3.255814 | 43 |
try:
from . import tiff
print("full tiff support")
except:
print("no tiff support")
try:
import hdf5
print("full hdf5 support")
except:
print("no hdf5 support")
| [
198,
28311,
25,
198,
220,
220,
220,
422,
764,
1330,
256,
733,
198,
220,
220,
220,
3601,
7203,
12853,
256,
733,
1104,
4943,
198,
16341,
25,
198,
220,
220,
220,
3601,
7203,
3919,
256,
733,
1104,
4943,
198,
198,
28311,
25,
198,
220,
... | 2.441558 | 77 |
import os
from tqdm import tqdm
import pandas as pd
from utilities.helper import get_bbox_middle_pos,drawBoundingBox
from clustering.clustering_utils import get_person_id_to_track,get_groundtruth_person_id_to_track
import cv2
from utilities.helper import *
from utilities.pandas_loader import load_csv
if _... | [
198,
11748,
28686,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
20081,
13,
2978,
525,
1330,
651,
62,
65,
3524,
62,
27171,
62,
1930,
11,
19334,
33,
9969,
14253,
198,
6738,
32966,
1... | 2.01321 | 757 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Coda plug-in
Created on Apr 20, 2009
@author: sergey
'''
import os
from zencoding import zen_core
from zencoding.settings import zen_settings
zen_core.newline = os.getenv('CODA_LINE_ENDING', zen_core.newline)
zen_core.insertion_point = '$$IP$$'
cur_line = 'hello wor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
34,
11329,
6107,
12,
259,
198,
41972,
319,
2758,
1160,
11,
3717,
198,
198,
31,
9800,
25,
1055,
3... | 2.354497 | 189 |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\world\rentable_lot_tuning.py
# Compiled at: 2014-09-09 00:07:16
# Size of source mod 2**32: 925 byte... | [
2,
34318,
2349,
21,
2196,
513,
13,
22,
13,
19,
198,
2,
11361,
18022,
8189,
513,
13,
22,
357,
2091,
5824,
8,
198,
2,
4280,
3361,
3902,
422,
25,
11361,
513,
13,
22,
13,
24,
357,
31499,
14,
85,
18,
13,
22,
13,
24,
25,
1485,
66,... | 2.505882 | 170 |
#!/usr/bin/python3
# Copyright 2018 Blade M. Doyle
# 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 a... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
15069,
2864,
11671,
337,
13,
31233,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
2... | 2.575302 | 2,397 |
# import igraph as ig
# import numpy as np
import pickle
import pandas as pd
from tqdm import tqdm
import os
import heapq
import scipy.stats as stats
from random import sample
def build_cpd_df(fp):
""" Takes 29 separate compound data files and combines them into a single pandas dataframe for ease of access
A... | [
2,
1330,
45329,
1470,
355,
45329,
198,
2,
1330,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
28686,
198,
11748,
24575,
80,
198,
11748... | 2.168969 | 4,415 |
"""
Your function should return True if both parameters are integers, and False otherwise.
"""
if __name__ == "__main__":
tests()
| [
37811,
198,
7120,
2163,
815,
1441,
6407,
611,
1111,
10007,
389,
37014,
11,
290,
10352,
4306,
13,
198,
37811,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
5254,
3419,
198
] | 3.538462 | 39 |
import os
from json import dump
from typing import List
from media import Episode, Show
from options import options
| [
11748,
28686,
198,
6738,
33918,
1330,
10285,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
2056,
1330,
7922,
11,
5438,
198,
6738,
3689,
1330,
3689,
628
] | 4.538462 | 26 |
'''
Python program to find the location of Python modulesources
'''
#Location of Python module sources:
import imp
print("Location of Python os module sources:")
print(imp.find_module('os'))
print("\nLocation of Python sys module sources:")
print(imp.find_module('datetime'))
#List of directories of specific module:
i... | [
7061,
6,
198,
37906,
1430,
284,
1064,
262,
4067,
286,
11361,
13103,
2203,
198,
7061,
6,
198,
2,
14749,
286,
11361,
8265,
4237,
25,
198,
198,
11748,
848,
198,
4798,
7203,
14749,
286,
11361,
28686,
8265,
4237,
25,
4943,
198,
4798,
7,
... | 3.447761 | 134 |
import json
import random
from flask import Blueprint
from flask import request
from flask import session
from sqlalchemy import and_
from sqlalchemy import or_
from urlparse import urlparse
# from flask import current_app
from gitRoulette import auth
from gitRoulette import models
from gitRoulette.utils import reque... | [
11748,
33918,
198,
11748,
4738,
198,
198,
6738,
42903,
1330,
39932,
198,
6738,
42903,
1330,
2581,
198,
6738,
42903,
1330,
6246,
198,
6738,
44161,
282,
26599,
1330,
290,
62,
198,
6738,
44161,
282,
26599,
1330,
393,
62,
198,
6738,
19016,
... | 3.698113 | 106 |
#
# Copyright 2020 The dNation Jsonnet Translator Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | [
2,
198,
2,
15069,
12131,
383,
288,
46108,
449,
1559,
3262,
3602,
41880,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 3.102564 | 429 |
import numpy as np
import caffe
import flowlib as fl
import os
import lmdb
from PIL import Image
VERBOSE = 0
SUBPIXELFACTOR = 4
MIN_FLOW = -4.18505
THRESHOLD = 1e8
PATCH_SIZE = 'FULL'
def read_lmdb(database_file):
"""
Read lmdb data
return content and shape
"""
db = lmdb.open(database_file, readonly=True)
w... | [
11748,
299,
32152,
355,
45941,
198,
11748,
21121,
198,
11748,
781,
4883,
571,
355,
781,
198,
11748,
28686,
198,
11748,
300,
9132,
65,
198,
6738,
350,
4146,
1330,
7412,
198,
5959,
33,
14058,
796,
657,
198,
50,
10526,
47,
10426,
37738,
... | 2.56391 | 266 |
dataset_type1 = 'IcdarDataset'
data_root1 = 'data/icdar15'
train1 = dict(
type=dataset_type1,
ann_file=f'{data_root1}/instances_training.json',
img_prefix=f'{data_root1}/imgs',
pipeline=None)
test1 = dict(
type=dataset_type1,
ann_file=f'{data_root1}/instances_validation.json',
img_prefix=f... | [
19608,
292,
316,
62,
4906,
16,
796,
705,
40,
10210,
283,
27354,
292,
316,
6,
198,
7890,
62,
15763,
16,
796,
705,
7890,
14,
291,
27455,
1314,
6,
198,
198,
27432,
16,
796,
8633,
7,
198,
220,
220,
220,
2099,
28,
19608,
292,
316,
62... | 2.074667 | 375 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
# Filename: EmNetconfProtocol.py
'''
Protocol processing section (Netconf)
'''
import traceback
import time
import json
from ncclient import manager
from ncclient import operations
import GlobalModul... | [
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,
7,
66,
8,
13130,
399,
3974,
261,
21821,
290,
44735,
10501,
201,
198,
2,
7066,
12453,
25,
2295,
... | 3.056338 | 142 |
# Created by Matthias Mueller - Intel Intelligent Systems Lab - 2020
import os
import tensorflow as tf
# This function defines a custom learning schedule.
| [
2,
15622,
416,
45524,
4448,
17768,
532,
8180,
49452,
11998,
3498,
532,
12131,
198,
198,
11748,
28686,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
628,
628,
628,
198,
2,
770,
2163,
15738,
257,
2183,
4673,
7269,
13,
198
] | 4.205128 | 39 |
import sys
import os
import dlib
import glob
from skimage import io
predictor_path = "data/shape_predictor_68_face_landmarks.dat"
faces_folder_path = "data/pics"
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor(predictor_path)
my_glob = glob.glob(os.path.join(faces_folder_path, "*.jpg")... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
288,
8019,
198,
11748,
15095,
198,
6738,
1341,
9060,
1330,
33245,
198,
198,
79,
17407,
273,
62,
6978,
796,
366,
7890,
14,
43358,
62,
79,
17407,
273,
62,
3104,
62,
2550,
62,
1044,
14306,
13,... | 2.169399 | 366 |
"""Miscellaneous functions, mainly for testing."""
from __future__ import annotations
import functools
import warnings
import numpy as np
import rasterio as rio
import geoutils
from geoutils._typing import ArrayLike
from geoutils.georaster import Raster, RasterType
def array_equal(
array1: RasterType | ArrayLi... | [
37811,
31281,
25673,
5499,
11,
8384,
329,
4856,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
1257,
310,
10141,
198,
11748,
14601,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
374,
1603,
952,
355,
374,
... | 2.524002 | 1,979 |
# UFSC - Campus Trindade
# PPGEAS - Introducao a Algoritmos
# Matuzalem Muller dos Santos
# 2019/1
# Commented code is for calculating algorithm completixy and printing variables
from random import randint
import time
import sys
if __name__ == '__main__':
array = []
random_number = 0
try:
number_... | [
2,
471,
37,
6173,
532,
25005,
833,
521,
671,
198,
2,
350,
6968,
36,
1921,
532,
11036,
66,
5488,
257,
978,
7053,
270,
16785,
198,
2,
6550,
10277,
282,
368,
47508,
23430,
28458,
198,
2,
13130,
14,
16,
198,
2,
955,
12061,
2438,
318,
... | 2.486577 | 298 |
import toml
from typing import List, Dict
from .artifact import Artifact
| [
11748,
284,
4029,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
198,
198,
6738,
764,
433,
29660,
1330,
45908,
628,
628,
628,
628,
628,
198
] | 3.36 | 25 |
# -*- coding: utf-8 -*-
"""
Author: Venkata Ramana P
<github.com/itsmepvr>
List files to an excel sheet
"""
import os, glob
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog, QMessageBox
from PyQt5.QtWidgets import *
from PyQt5.QtGui import * ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
198,
13838,
25,
9932,
74,
1045,
7431,
2271,
350,
198,
27,
12567,
13,
785,
14,
896,
76,
538,
37020,
29,
198,
8053,
3696,
284,
281,
27336,
9629,
198,
... | 2.409266 | 259 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def func(b):
if(b == 1):
raise myExcept_1
elif(b == 2):
raise myExcept_2
elif(b == 3):
return
try:
func(1)
except myExcept_1 as e:
print(f'Erro number: {e.err} message: {e.msg}')
except myExcept_2 as e:
print(f'Erro number: {e.err} message: {e.msg}')
else:
p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
4299,
25439,
7,
65,
2599,
198,
197,
361,
7,
65,
6624,
352,
2599,
198,
197,
197,
40225,
616,
30313,
62,
16,... | 2.390625 | 384 |
from ..errors import DataRequiredError, ShortCircuitSignal
from ..util import processor
__all__ = (
'required',
'optional',
)
| [
6738,
11485,
48277,
1330,
6060,
37374,
12331,
11,
10073,
31560,
5013,
11712,
282,
198,
6738,
11485,
22602,
1330,
12649,
628,
198,
834,
439,
834,
796,
357,
198,
220,
220,
220,
705,
35827,
3256,
198,
220,
220,
220,
705,
25968,
3256,
198,
... | 3.159091 | 44 |
#!/usr/bin/env python3
import sys,argparse
parser = argparse.ArgumentParser()
parser.add_argument('-foo', nargs='+', help='foo values', required=False)
args = parser.parse_args()
for foo in args.foo:
print("Foo: ",foo) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
11,
853,
29572,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
10786,
12,
21943,
3256,
299,
22046,
11639,
10,
... | 2.756098 | 82 |
from parent_class import ParentPlural
from typing import List
if __name__ == '__main__':
a = ParentPluralList()
a.print_atts() | [
6738,
2560,
62,
4871,
1330,
16774,
3646,
1523,
198,
6738,
19720,
1330,
7343,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
257,
796,
16774,
3646,
1523,
8053,
3419,
198,
220,
220,
220,
257,
13,... | 2.956522 | 46 |
import requests
from json import dump
import os
from shutil import rmtree
from tqdm import tqdm
#Collects available data from CXIDB and saves to the given directory
#out_dir: The path to the directory (which will be created) for the data files
#existing_dir:
# -1: Remove out_dir if it exists
# 0: Error if... | [
11748,
7007,
198,
6738,
33918,
1330,
10285,
198,
11748,
28686,
198,
6738,
4423,
346,
1330,
374,
16762,
631,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
2,
31337,
82,
1695,
1366,
422,
327,
55,
2389,
33,
290,
16031,
284,
... | 3.171233 | 146 |
from aiogram import types
import config
| [
6738,
257,
72,
21857,
1330,
3858,
198,
198,
11748,
4566,
628
] | 3.818182 | 11 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask
app = Flask(__name__)
app.config.from_object("config")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42903,
1330,
46947,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
11250,
13,
6738,
62,
... | 2.54 | 50 |
import sys
from argparse import ArgumentParser
import os
import pickle
import random
import worldengine.generation as geo
from worldengine.common import array_to_matrix, set_verbose, print_verbose
from worldengine.draw import draw_ancientmap_on_file, draw_biome_on_file, draw_ocean_on_file, \
draw_precipitation_on_f... | [
11748,
25064,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
11748,
995,
18392,
13,
20158,
355,
40087,
198,
6738,
995,
18392,
13,
11321,
1330,
7177,
62,
1462,
62,
6759,
8609,
... | 2.60511 | 861 |
#!/usr/bin/python
import sys
import os
servicesFolder = sys.argv[1]
projectFolders = sys.argv[2].split(',')
# projectFolders = "project1 project2".split(' ')
# servicesFolderName = "/services"
srcFolders = "src src/main src/main/java src/main/resources src/test src/test/java src/test/resources".split(
' ')
c... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
25064,
198,
11748,
28686,
628,
628,
198,
198,
30416,
41092,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
16302,
37,
727,
364,
796,
25064,
13,
853,
85,
58,
17,
4083,
35312,
7,
325... | 2.875817 | 153 |
from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib import rnn
import pandas as pd
import numpy as np
import random
import time
import os
import datetime
from tensorflow.python.client import timeline
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from sklearn.model_selection import train_t... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
1330,
374,
20471,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
11748,
299,
32152,
355,
45941,... | 2.003973 | 4,279 |
from napari.viewer import Viewer
import napari_live_recording.devices as devices
from napari_live_recording.widgets import CameraSelection
from napari_live_recording.control import Controller
from qtpy.QtWidgets import QWidget, QFormLayout, QGroupBox | [
6738,
25422,
2743,
13,
1177,
263,
1330,
3582,
263,
198,
11748,
25422,
2743,
62,
12583,
62,
8344,
1284,
13,
42034,
355,
4410,
198,
6738,
25422,
2743,
62,
12583,
62,
8344,
1284,
13,
28029,
11407,
1330,
20432,
4653,
1564,
198,
6738,
25422,... | 3.424658 | 73 |
# Deep Learning Quick Reference Chapter 8: Transfer Learning
# Mike Bernico <mike.bernico@gmail.com>
# seed random number generators before importing keras
import numpy as np
np.random.seed(42)
import tensorflow as tf
tf.set_random_seed(42)
from keras.applications.inception_v3 import InceptionV3
from keras.models im... | [
2,
10766,
18252,
12029,
20984,
7006,
807,
25,
20558,
18252,
198,
2,
4995,
6206,
3713,
1279,
76,
522,
13,
33900,
3713,
31,
14816,
13,
785,
29,
628,
198,
2,
9403,
4738,
1271,
27298,
878,
33332,
41927,
292,
198,
11748,
299,
32152,
355,
... | 3.291667 | 192 |
import torch
from torch import nn
from torch.nn import Conv2d, MaxPool2d, Flatten, Linear, Sequential
from torch.utils.tensorboard import SummaryWriter
tudui = Tudui()
print(tudui)
input = torch.ones((64, 3, 32, 32))
output = tudui(input)
print(output.shape)
writer = SummaryWriter("./logs")
writer.add_graph(tudui, ... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
20471,
1330,
34872,
17,
67,
11,
5436,
27201,
17,
67,
11,
1610,
41769,
11,
44800,
11,
24604,
1843,
198,
6738,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
3437... | 2.826446 | 121 |
from typing import Optional
from flask import url_for
from flask_sqlalchemy import BaseQuery
from ..ext import db
from ..models import Brew, BrewerProfile
def public_or_owner(query: BaseQuery, user: Optional[BrewerProfile]) -> BaseQuery:
"""Filter Brew query of all non-accessible objects.
:param query: que... | [
6738,
19720,
1330,
32233,
198,
198,
6738,
42903,
1330,
19016,
62,
1640,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
7308,
20746,
198,
198,
6738,
11485,
2302,
1330,
20613,
198,
6738,
11485,
27530,
1330,
9702,
11,
38822,
37046,
628,
198,... | 2.501425 | 351 |
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from bucketlist.models import Bucketlist, Item
from bucketlist.tests.factories import (BucketlistFactory,
UserFactory,
ItemFactor... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
198,
6738,
19236,
4868,
13,
27530,
1330,
48353,
4868,
11,
9097,
198,
6738,
... | 2.328947 | 152 |
import re
| [
11748,
302,
628,
198
] | 3 | 4 |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import json
import os
import sys
from framework.path.path import Path
from framework.file.io import read_file... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
2177,
383,
6185,
7231,
6505,
198,
2,
4307,
6169,
739,
262,
17168,
3788,
5964,
11,
766,
262,
19249,
198,
2,
2393,
27975,
45761,
393,
2638,
1378,
2503,
13,
... | 3.275168 | 149 |
import graphene
import graphql_jwt
from .resolvers import MemberResolvers
from .types import MemberType, UserType
| [
11748,
42463,
198,
11748,
4823,
13976,
62,
73,
46569,
198,
198,
6738,
764,
411,
349,
690,
1330,
10239,
4965,
349,
690,
198,
6738,
764,
19199,
1330,
10239,
6030,
11,
11787,
6030,
628,
198
] | 3.545455 | 33 |
from functools import wraps
from typing import List, Any
from cookie_manager import CookieManager
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
19720,
1330,
7343,
11,
4377,
198,
6738,
19751,
62,
37153,
1330,
39606,
13511,
628
] | 4.5 | 22 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Evan Purkhiser
# 2014 Ben Ockmore
# 2019-2020 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
1946,
220,
21523,
9330,
14636,
5847,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1946,
220,
3932,
440,
694,
... | 2.512702 | 866 |
# Spotify web application client ID
CLIENT_ID = 'your_client_id'
# Spotify web application client secret
CLIENT_SECRET = 'your_client_secret'
# Redirect URI. This can be any uri.
# Howerver, you MUST add this uri to your Spotify web app's settings.
# Application settings -> Edit Settings -> Redirect URIs.
# Add... | [
2,
26778,
3992,
3586,
5456,
4522,
201,
198,
5097,
28495,
62,
2389,
796,
705,
14108,
62,
16366,
62,
312,
6,
201,
198,
2,
26778,
3992,
3586,
5456,
3200,
201,
198,
5097,
28495,
62,
23683,
26087,
796,
705,
14108,
62,
16366,
62,
21078,
6... | 3.289256 | 121 |
import abc
| [
11748,
450,
66,
198
] | 2.75 | 4 |
from concurrent import futures
from itertools import repeat
import pathlib
from pathlib import Path
import pickle
import time
from typing import List, Tuple, Union
import cv2 as cv2
import hdbscan
import numpy as np
import pims
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
from tq... | [
6738,
24580,
1330,
25650,
198,
6738,
340,
861,
10141,
1330,
9585,
198,
11748,
3108,
8019,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
2298,
293,
198,
11748,
640,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
4479,
198,
198,
1174... | 2.422304 | 4,331 |
# This package will contain the spiders of your Scrapy project
#
# Please refer to the documentation for information on how to create and manage
# your spiders.
import scrapy
| [
2,
770,
5301,
481,
3994,
262,
26120,
286,
534,
1446,
2416,
88,
1628,
198,
2,
198,
2,
4222,
3522,
284,
262,
10314,
329,
1321,
319,
703,
284,
2251,
290,
6687,
198,
2,
534,
26120,
13,
198,
198,
11748,
15881,
88,
628
] | 4.317073 | 41 |
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
from django.dispatch import receiver
import os
import shutil
def upload_to(instance, filename):
upload_to = ""
if instance.folder:
upload_to = instance.folder.name + "/"
instance = insta... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
198,
11748,
... | 2.618182 | 220 |
# ***************************************************************** #
# #
# (C) Copyright IBM Corp. 2021 #
# #
# SPDX-License-Identifier: Apache-2.0 ... | [
2,
41906,
17174,
9,
1303,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 1.94086 | 372 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import os
import unittest
from cdm.utilities.logging import logger
from cdm.enums import CdmObjectType, CdmStatusLevel, CdmIncrementalPartitionType
from cdm.objec... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,... | 3.663265 | 196 |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
__author__ = 'andrea tramacere'
from setuptools import setup, find_packages,Extension
# from setuptools.command.install import install
# from distutils.extension import Extension
# import distutils.command.install as orig
from d... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
628,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
4112,
62,
11748,
11,
3601,
62,
8818,
198,
198,
834,
9800,
834,
796,
705,
392,
21468,
29957,
558,
260,
6,
628,
198,
6738,
900,
37623,
101... | 2.460259 | 1,082 |
"""
Module that provide a classifier template to train a model on embeddings.
With use the pathogen vs human dataset as an example. The embedding of 100k proteins come
from the protBert model.
The model is built with pytorch_ligthning, a wrapper on top of
pytorch (similar to keras with tensorflow)
Feel feel to build ... | [
37811,
198,
26796,
326,
2148,
257,
1398,
7483,
11055,
284,
4512,
257,
2746,
319,
11525,
67,
654,
13,
198,
3152,
779,
262,
3108,
6644,
3691,
1692,
27039,
355,
281,
1672,
13,
383,
11525,
12083,
286,
1802,
74,
15568,
1282,
220,
198,
6738... | 2.8 | 575 |
#Copyright 2022 Nathan Harwood
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable law or agreed to in writing, sof... | [
2,
15269,
33160,
18106,
2113,
3822,
198,
2,
198,
2,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
... | 3.296 | 250 |
# Sample BLAST parameters.
PARAMS = {
'application': 'BLASTN',
'blast_cutoff': [
None,
None
],
'database': 'manx-shearwater',
'database_length': 17465129,
'database_letters': None,
'database_name': [],
'database_sequences': 70016,
'date': '',
'dropoff_1st_pass': [... | [
2,
27565,
9878,
11262,
10007,
13,
198,
27082,
40834,
796,
1391,
198,
220,
220,
220,
705,
31438,
10354,
705,
9148,
11262,
45,
3256,
198,
220,
220,
220,
705,
39806,
62,
8968,
2364,
10354,
685,
198,
220,
220,
220,
220,
220,
220,
220,
6... | 1.498798 | 4,575 |
# -*- coding: utf-8 -*-
"""."""
import re
_UNIT_STRING_REGEX = r'^([0-9\.]+)(ml|cl|dl|l)$'
def parse_unit(unit_string):
"""."""
lower_unit_string = unit_string.lower()
match = re.match(_UNIT_STRING_REGEX, lower_unit_string)
if match:
try:
return float(match.group(1)), match.gr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
526,
15931,
198,
198,
11748,
302,
628,
198,
62,
4944,
2043,
62,
18601,
2751,
62,
31553,
6369,
796,
374,
6,
61,
26933,
15,
12,
24,
59,
8183,
10,
5769,
402... | 2.04878 | 205 |
import os
import glob
import unittest
from ..utils import testing
from ..utils import everion_keys
from ..utils.file_helper import FileHelper
from ..utils.data_aggregator import Normalization
from ..visualization.vis_properties import VisProperties
from ..data_analysis.cross_correlator import CrossCorrelator
_MHEALTH... | [
11748,
28686,
198,
11748,
15095,
198,
11748,
555,
715,
395,
198,
198,
6738,
11485,
26791,
1330,
4856,
198,
6738,
11485,
26791,
1330,
1683,
295,
62,
13083,
198,
6738,
11485,
26791,
13,
7753,
62,
2978,
525,
1330,
9220,
47429,
198,
6738,
1... | 3.096774 | 155 |
#!/usr/bin/env python3
from typing import Dict, List
try:
import matplotlib.pyplot as plt
MATPLOTLIB = True
except:
MATPLOTLIB = False
from loguru import logger
from .eval import EvalData
def plot_history(
history: Dict[str, List[EvalData]], plot_type="loss", figure_size=(20, 7)
) -> None:
"... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
220,
220,
220,
36775,
6489,
2394... | 2.426667 | 525 |
import itertools
import os
import sys
import cv2
import numpy as np
from SelectiveSearch import SelectiveSearch
images_path = "Images"
annotations = "Annotations"
cv2.setUseOptimized(True)
selective_search = SelectiveSearch()
train_images = []
train_labels = []
SS_IMG_SIZE = (224, 224)
# chunk = int(sys.argv[1])
... | [
11748,
340,
861,
10141,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
9683,
425,
18243,
1330,
9683,
425,
18243,
198,
198,
17566,
62,
6978,
796,
366,
29398,
1,
1... | 1.737717 | 1,323 |
rx = re.compile(r'\b%s\b' % r'\b|\b'.join(map(re.escape, adict)))
| [
40914,
796,
302,
13,
5589,
576,
7,
81,
6,
59,
65,
4,
82,
59,
65,
6,
4064,
374,
6,
59,
65,
91,
59,
65,
4458,
22179,
7,
8899,
7,
260,
13,
41915,
11,
512,
713,
22305,
198
] | 1.783784 | 37 |
from django.contrib import admin
from projects.models import Project
admin.site.register(Project, ProjectAdmin) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
4493,
13,
27530,
1330,
4935,
198,
198,
28482,
13,
15654,
13,
30238,
7,
16775,
11,
4935,
46787,
8
] | 4 | 28 |
from django.contrib.auth import get_user_model
from django.db import transaction
from rest_framework.exceptions import ValidationError
from ..models import OfficeBlock, OfficeFloor, OfficeFloorSection
from core.tests import CoreBaseTestCase
User = get_user_model()
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
6738,
1334,
62,
30604,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
198,
6738,
11485,
27530,
1330,
4452... | 3.684932 | 73 |
import pytest
| [
11748,
12972,
9288,
628,
628
] | 3.4 | 5 |
import argparse
import random
import ihuntapp
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build an #iHunt job app page.')
parser.add_argument('--name', "-n",
default="Unnamed job", help='Name of the job')
parser.add_argument('--description', "-d",
... | [
11748,
1822,
29572,
198,
11748,
4738,
198,
198,
11748,
1312,
35060,
1324,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
15580,
28... | 2.53913 | 805 |
import sys
import os
import csv
from tqdm import tqdm
import django
from import_util import display_inserted, display_skipped
project_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(project_dir)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
django.setup()
from core.models.asset import ... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
269,
21370,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
42625,
14208,
198,
198,
6738,
1330,
62,
22602,
1330,
3359,
62,
28463,
276,
11,
3359,
62,
8135,
3949,
198,
198,
16302,
... | 2.802139 | 187 |
ENDPOINT_URLS_ENUM = enum(
MAIN='https://api.mainnet-beta.solana.com',
DEV='https://api.devnet.solana.com',
TEST='https://api.testnet.solana.com',
)
ENDPOINT_URLS = {
"MAIN":'https://api.mainnet-beta.solana.com',
"DEV":'https://api.devnet.solana.com',
"TEST":'https://api.testnet.solana.com',
} | [
198,
1677,
6322,
46,
12394,
62,
4261,
6561,
62,
1677,
5883,
796,
33829,
7,
198,
220,
220,
220,
8779,
1268,
11639,
5450,
1378,
15042,
13,
12417,
3262,
12,
31361,
13,
34453,
2271,
13,
785,
3256,
198,
220,
220,
220,
5550,
53,
11639,
54... | 2.119205 | 151 |
import pymongo
import folium
from pymongo import MongoClient
db = MongoClient('mongodb+srv://admin:admin@cluster0-vuh1j.azure.mongodb.net/test?retryWrites=true&w=majority')
db = db.get_database('BD_EMPRESAS')
collection = db.empresas
cnpj = []
latitude = []
longitude = []
qtd_range = []
endereco = []
cnpj = db.... | [
11748,
279,
4948,
25162,
198,
11748,
5955,
1505,
628,
198,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
198,
9945,
796,
42591,
11792,
10786,
31059,
375,
65,
10,
27891,
85,
1378,
28482,
25,
28482,
31,
565,
5819,
15,
12,
85,
74... | 2.468085 | 329 |
import anasyspythontools as apt
import pytest
import glob
import os
TESTFOLDER = os.path.join(os.path.dirname(__file__),"test data")
| [
198,
11748,
281,
292,
893,
79,
5272,
756,
10141,
355,
15409,
198,
11748,
12972,
9288,
198,
11748,
15095,
198,
11748,
28686,
198,
198,
51,
6465,
37,
3535,
14418,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
... | 2.705882 | 51 |
import yaml
from yaml import Loader, Dumper
from .pathify import * | [
198,
11748,
331,
43695,
220,
198,
6738,
331,
43695,
1330,
8778,
263,
11,
360,
15829,
198,
6738,
764,
6978,
1958,
1330,
1635
] | 3.090909 | 22 |
from .template import template
from .tools import tools
from .LinearReg import LinearReg | [
6738,
764,
28243,
1330,
11055,
198,
6738,
764,
31391,
1330,
4899,
198,
6738,
764,
14993,
451,
8081,
1330,
44800,
8081
] | 4.4 | 20 |
# -*- coding:utf-8 -*-
"""
"""
import numpy as np
from hypernets.core.ops import Identity
from hypernets.core.search_space import HyperSpace, Int, Real, Choice, Bool
from hypernets.core.searcher import OptimizeDirection
from hypernets.searchers.evolution_searcher import Population, EvolutionSearcher
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
198,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
8718,
45938,
13,
7295,
13,
2840,
1330,
27207,
198,
6738,
8718,
45938,
13,
7295,
13,
12947,
62,
1... | 3.244681 | 94 |
from flask import jsonify
from flask_restful import Resource, Api
from .models import Player as PlayerModel, to_dict
api = Api()
api.add_resource(Player, '/')
| [
6738,
42903,
1330,
33918,
1958,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
5949,
72,
198,
198,
6738,
764,
27530,
1330,
7853,
355,
7853,
17633,
11,
284,
62,
11600,
198,
198,
15042,
796,
5949,
72,
3419,
198,
198,
15042,
13,
2860,... | 3.24 | 50 |
import torch
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence
from core.utils.masks import pad_mask, subsequent_mask
from core.utils.tensors import mktensor
| [
11748,
28034,
198,
6738,
28034,
13,
20471,
13,
26791,
13,
81,
20471,
1330,
14841,
62,
43167,
11,
2353,
62,
79,
29373,
62,
43167,
198,
198,
6738,
4755,
13,
26791,
13,
5356,
591,
1330,
14841,
62,
27932,
11,
8840,
62,
27932,
198,
6738,
... | 3.172414 | 58 |
import operator
import os as _os
from pathlib import Path
from string import ascii_letters
from itertools import chain, permutations
from functools import reduce
from fakeos import FakeOS
from hypothesis import given, assume, example
from hypothesis.strategies import text, sets, integers, lists, just
from filesyste... | [
11748,
10088,
198,
11748,
28686,
355,
4808,
418,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
4731,
1330,
355,
979,
72,
62,
15653,
198,
6738,
340,
861,
10141,
1330,
6333,
11,
9943,
32855,
198,
198,
6738,
1257,
310,
10141,
1330,
... | 3.723684 | 152 |
"""Utilities
===================
Various tools used in :mod:`ceed`.
"""
import re
import pathlib
from collections import deque
from typing import List, Tuple, Any, Union
__all__ = (
'fix_name', 'update_key_if_other_key', 'collapse_list_to_counts',
'get_plugin_modules', 'CeedWithID',
)
_name_pa... | [
37811,
18274,
2410,
201,
198,
4770,
18604,
201,
198,
201,
198,
40009,
4899,
973,
287,
1058,
4666,
25,
63,
2707,
44646,
201,
198,
37811,
201,
198,
11748,
302,
201,
198,
11748,
3108,
8019,
201,
198,
6738,
17268,
1330,
390,
4188,
201,
19... | 2.12963 | 2,376 |
import stripe
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.messages.views import SuccessMessageMixin
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.views.g... | [
11748,
39858,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
19816,
1040,
1330,
23093,
37374,
356... | 3.207921 | 202 |
# question 1.4 from cracking the code interview 4th ed.
'''
Write a method to decide if two strings are anagrams or not.
'''
# if we sort the two string, they should be the same
| [
2,
1808,
352,
13,
19,
422,
25407,
262,
2438,
2720,
604,
400,
1225,
13,
198,
7061,
6,
198,
16594,
257,
2446,
284,
5409,
611,
734,
13042,
389,
281,
6713,
82,
393,
407,
13,
198,
7061,
6,
198,
198,
2,
611,
356,
3297,
262,
734,
4731,... | 3.415094 | 53 |
from baremetal import *
from baremetal.signed import number_of_bits_needed
from settings import Settings
from math import log, pi
from matplotlib import pyplot as plt
import numpy as np
import sys
from math import log, ceil
from numpy import log10
#settings for 100KS/s
# hang attack decay
# fast ... | [
6738,
6247,
28469,
1330,
1635,
198,
6738,
6247,
28469,
13,
32696,
1330,
1271,
62,
1659,
62,
9895,
62,
27938,
198,
6738,
6460,
1330,
16163,
198,
6738,
10688,
1330,
2604,
11,
31028,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
4... | 2.117264 | 614 |
# This program prompts a user to enter an integer and reports whether the integer is a palindrome or not
# A number is a palindrome if its reversal is the same as itself.
main() | [
198,
2,
770,
1430,
36454,
257,
2836,
284,
3802,
281,
18253,
290,
3136,
1771,
262,
18253,
318,
257,
6340,
521,
5998,
393,
407,
198,
198,
2,
220,
317,
1271,
318,
257,
6340,
521,
5998,
611,
663,
27138,
318,
262,
976,
355,
2346,
13,
6... | 3.77551 | 49 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |