content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 22 14:07:39 2016
@author: pablo
"""
""" CREATING PYTHON plasma_plume PACKAGE """
""" IMPORTING GENERAL USAGE MODULES """
from scipy.interpolate import interp1d,interp2d,griddata #1D, and 2D interpolation libraries
from scipy.integrate import odeint # Ordinary Difffer... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
2758,
2534,
1478,
25,
2998,
25,
2670,
1584,
198,
198,
31,
9800,
25,
279,
18817,
198,
37811,
198,
198,
37811,
29244,
33881,
350,
56,
4221,
... | 2.857143 | 273 |
import os
import sys
from subprocess import call
from inkpy_jinja.backends.base import PDFBackend
class OdtToPdfScriptPathNotConfigured(Exception):
"""OdtToPdf script path not found in settings"""
| [
11748,
28686,
198,
11748,
25064,
198,
6738,
850,
14681,
1330,
869,
198,
198,
6738,
16882,
9078,
62,
18594,
6592,
13,
1891,
2412,
13,
8692,
1330,
12960,
7282,
437,
628,
198,
4871,
10529,
83,
2514,
47,
7568,
7391,
15235,
3673,
16934,
1522... | 3.306452 | 62 |
# packages
import os, sys, datetime
sys.path.append("C:/BERTVision/code/torch")
from utils.collate import collate_H5_squad
from common.evaluators.H5_squad_evaluator import H5_SQUAD_Evaluator
from torch.cuda.amp import autocast
import torch
import numpy as np
from torch.utils.data import DataLoader
from tqdm.auto import... | [
2,
10392,
198,
11748,
28686,
11,
25064,
11,
4818,
8079,
198,
17597,
13,
6978,
13,
33295,
7203,
34,
14079,
13246,
6849,
1166,
14,
8189,
14,
13165,
354,
4943,
198,
6738,
3384,
4487,
13,
26000,
378,
1330,
2927,
378,
62,
39,
20,
62,
164... | 2.139812 | 1,595 |
#!/usr/bin/env python
# -*- Mode: Python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*-
# vi: set ts=4 sw=4 expandtab:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.or... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
10363,
25,
11361,
26,
269,
12,
35487,
12,
28968,
25,
604,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
26,
7400,
12,
10394,
25,
604,
532,
9,
12,
198,
2,
25357,
... | 3.251701 | 294 |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | [
2,
16529,
10541,
198,
2,
15069,
357,
66,
8,
2211,
438,
11,
629,
1134,
270,
12,
65,
952,
2478,
1074,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
... | 3.035088 | 342 |
from urllib import request
from googleapiclient.discovery import build
import gwm.auth.authenticator as auth
| [
6738,
2956,
297,
571,
1330,
2581,
198,
6738,
23645,
499,
291,
75,
1153,
13,
67,
40821,
1330,
1382,
198,
11748,
308,
26377,
13,
18439,
13,
41299,
26407,
355,
6284,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198
] | 2.975 | 40 |
#!/usr/bin/env python
#
# Author: Veronica G. Vergara L.
#
#
from .base_jobLauncher import BaseJobLauncher
if __name__ == '__main__':
print('This is the Aprun job launcher class')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
6434,
25,
44498,
402,
13,
4643,
70,
3301,
406,
13,
198,
2,
198,
2,
198,
198,
6738,
764,
8692,
62,
21858,
46182,
2044,
1330,
7308,
33308,
46182,
2044,
198,
198,
361,
1159... | 2.735294 | 68 |
pip install scikit-learn
import os
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
student_files = [doc for doc in os.listdir() if doc.endswith('.txt')]
student_notes = [open(_file, encoding='utf-8').read()
for _file in student_files]
... | [
79,
541,
2721,
629,
1134,
270,
12,
35720,
198,
11748,
28686,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
1330,
309,
69,
312,
69,
38469,
7509,
198,
6738,
1341,
35720,
13,
4164,
10466,
13,
24874,
3083,
1330,
8615,
500,
... | 2.757225 | 173 |
# Copyright (c) 2022 Jakub Vesely
# This software is published under MIT license. Full text of the license is available at https://opensource.org/licenses/MIT
import os
import hashlib
from ___basal.___logging import Logging
from ___blocks.___main_block import MainBlock
from ___basal.___planner import Planner
#pyrigh... | [
2,
220,
15069,
357,
66,
8,
33160,
25845,
549,
569,
2771,
306,
198,
2,
220,
770,
3788,
318,
3199,
739,
17168,
5964,
13,
6462,
2420,
286,
262,
5964,
318,
1695,
379,
3740,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
36393,
198,
1... | 2.46395 | 319 |
#!/usr/bin/env python
# Todo: Record and print total stats at end of run, write out to file, maybe csv.
# Todo: Option to record video and xyz
# Todo: Turn display on and off.
# Todo: conf binary options
# Todo: conf write in number option
# Todo: Think of ways to make needs_ vars more elegant, maybe a service.
# Todo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
309,
24313,
25,
13266,
290,
3601,
2472,
9756,
379,
886,
286,
1057,
11,
3551,
503,
284,
2393,
11,
3863,
269,
21370,
13,
198,
2,
309,
24313,
25,
16018,
284,
1700,
2008,
290,
... | 2.357107 | 1,977 |
# -*- coding: utf-8 -*- #
"""*********************************************************************************************"""
# FileName [ expert.py ]
# Synopsis [ the speech separation downstream wrapper ]
# Source [ Reference some code from https://github.com/funcwj/uPIT-for-speech-separation and ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
37811,
17174,
17174,
8412,
4557,
35625,
37811,
198,
2,
220,
220,
9220,
5376,
220,
220,
220,
220,
685,
5887,
13,
9078,
2361,
198,
2,
220,
220,
16065,
24608,
220,
... | 2.077405 | 5,426 |
# ============================================================================
# Adafruit PCA9685 16-Channel PWM Servo Driver
# ============================================================================
import logging
import math
import time
import pigpio
logger = logging.getLogger(__name__)
| [
2,
38093,
2559,
18604,
198,
2,
1215,
1878,
4872,
4217,
32,
24,
35978,
1467,
12,
29239,
350,
22117,
3116,
78,
12434,
198,
2,
38093,
2559,
18604,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
640,
198,
11748,
12967,
79,
952,
628,
19... | 5.321429 | 56 |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 2 22:16:47 2016
@author: jim
"""
# py_train.tsv: training data set
import sys
import pickle
import zlib
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn import ensemble
# model data str... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
1526,
220,
362,
2534,
25,
1433,
25,
2857,
1584,
198,
198,
31,
9800,
25,
474,
320,
198,
37811,
198,
198,
2,
12972,
62,
27432,
13,
912,
8... | 2.282769 | 679 |
import enum
# https://stackoverflow.com/a/51976841
class VerificationStatus(str, enum.Enum):
"""Class representing verification status enum in database."""
CREATED = "CREATED"
VERIFIED = "VERIFIED"
REJECTED = "REJECTED"
class WorkflowStatus(str, enum.Enum):
"""Class representing workflow status... | [
11748,
33829,
628,
198,
2,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
20,
24991,
3104,
3901,
198,
4871,
4643,
2649,
19580,
7,
2536,
11,
33829,
13,
4834,
388,
2599,
198,
220,
220,
220,
37227,
9487,
10200,
19637,
3722,
33829,
... | 2.081509 | 822 |
from advent10 import (
read_input,
calc_corruption_score,
calc_autocompletion_score,
calc_middle_autocompletion_score,
)
| [
6738,
19980,
940,
1330,
357,
198,
220,
220,
220,
1100,
62,
15414,
11,
198,
220,
220,
220,
42302,
62,
46260,
62,
26675,
11,
198,
220,
220,
220,
42302,
62,
2306,
42829,
24547,
62,
26675,
11,
198,
220,
220,
220,
42302,
62,
27171,
62,
... | 2.611111 | 54 |
from piece import Gobang
import time
| [
6738,
3704,
1330,
16909,
648,
201,
198,
11748,
640,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.473684 | 19 |
import json, urllib.request, random
spreadsheetID = "1gZbPx9GpNMObvXzlGRGmah1sW7nCgLIHR-QOocybwXw"
tab = 1
finalUrl = "https://spreadsheets.google.com/feeds/list/" + str(spreadsheetID) + "/1/public/values?alt=json"
with urllib.request.urlopen(finalUrl) as url:
data = json.loads(url.read().decode())
qs = "const m... | [
11748,
33918,
11,
2956,
297,
571,
13,
25927,
11,
4738,
198,
198,
43639,
21760,
2389,
796,
366,
16,
70,
57,
65,
47,
87,
24,
38,
79,
32755,
5944,
85,
55,
48274,
10761,
38,
76,
993,
16,
82,
54,
22,
77,
34,
70,
31271,
17184,
12,
4... | 2.255187 | 482 |
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
| [
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,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
6738,
42625,
14208,
13,
6381,... | 2.513158 | 76 |
import pytest
import responses
from responses import matchers
from stoplight.repo import AssignmentRepo
REPO = None
@pytest.fixture(autouse=True)
@responses.activate
@responses.activate
@responses.activate
@responses.activate
@responses.activate
@responses.activate
@responses.activate
@responses.... | [
11748,
12972,
9288,
198,
11748,
9109,
198,
6738,
9109,
1330,
2603,
3533,
198,
198,
6738,
2245,
2971,
13,
260,
7501,
1330,
50144,
6207,
78,
198,
198,
2200,
16402,
796,
6045,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
2306,
1076,
28,
... | 3.181159 | 138 |
import math as m
'''
the function joint_entropy() accepts an 2-gram data structures as an input
that is a dictionary with word pairs as keys and the probabilities
of these word pairs as values
always test your code
'''
if __name__ == "__main__":
test_joint_entropy()
| [
11748,
10688,
355,
285,
198,
198,
7061,
6,
198,
1169,
2163,
6466,
62,
298,
28338,
3419,
18178,
281,
362,
12,
4546,
1366,
8573,
355,
281,
5128,
198,
5562,
318,
257,
22155,
351,
1573,
14729,
355,
8251,
290,
262,
39522,
198,
1659,
777,
... | 3.425 | 80 |
import itertools
import numpy as np
from scipy.stats import median_absolute_deviation
def segment_times(timeseries, max_gap):
"""
Returns an N-D array where each row represents a separate segmentation of continuous data with no gaps
greater than the max gap.
"""
time_segments = []
is_contiguous... | [
11748,
340,
861,
10141,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
34242,
1330,
14288,
62,
48546,
62,
7959,
3920,
198,
198,
4299,
10618,
62,
22355,
7,
22355,
10640,
11,
3509,
62,
43554,
2599,
198,
220,
220,
220,
... | 2.187394 | 1,777 |
from . import datasets
from . import samplers
from . import filereaders
from . import imglists
try:
from .dataloader import *
except:
from torch.utils.data import DataLoader
| [
6738,
764,
1330,
40522,
198,
6738,
764,
1330,
6072,
489,
364,
198,
6738,
764,
1330,
2393,
961,
364,
198,
6738,
764,
1330,
545,
4743,
1023,
198,
28311,
25,
198,
220,
220,
220,
422,
764,
67,
10254,
1170,
263,
1330,
1635,
198,
16341,
2... | 3.192982 | 57 |
# Generated by Django 2.1.2 on 2018-12-20 03:00
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
17,
319,
2864,
12,
1065,
12,
1238,
7643,
25,
405,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# Generated by Django 2.2.1 on 2019-07-08 09:17
import datetime
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
16,
319,
13130,
12,
2998,
12,
2919,
7769,
25,
1558,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530... | 2.916667 | 48 |
#!/usr/bin/env python3
from unittest.mock import call, patch
from schmetterling.core.nio import rm_paths
@patch('schmetterling.core.nio.rmdir')
@patch('schmetterling.core.nio.rmtree')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
869,
11,
8529,
198,
198,
6738,
5513,
4164,
353,
1359,
13,
7295,
13,
77,
952,
1330,
42721,
62,
6978,
82,
628,
198,
31,
17147,
10786,
2060... | 2.460526 | 76 |
from tests.factories import MineFactory, ProjectSummaryFactory
from app.api.mines.project_summary.models.project_summary import ProjectSummary
| [
6738,
5254,
13,
22584,
1749,
1330,
11517,
22810,
11,
4935,
22093,
22810,
198,
198,
6738,
598,
13,
15042,
13,
1084,
274,
13,
16302,
62,
49736,
13,
27530,
13,
16302,
62,
49736,
1330,
4935,
22093,
628,
198
] | 4.055556 | 36 |
'''
This module allows to load texture and to sample from it
'''
import numpy as np
from vulkbare import load_image, resize_image
from vulk import vulkanobject as vo
from vulk import vulkanconstant as vc
from vulk.util import mipmap_size, mipmap_levels
class RawTexture():
"""A Raw texture is not initialized with... | [
7061,
6,
198,
1212,
8265,
3578,
284,
3440,
11743,
290,
284,
6291,
422,
340,
198,
7061,
6,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
410,
12171,
49382,
1330,
3440,
62,
9060,
11,
47558,
62,
9060,
198,
198,
6738,
410,
12171,
1330,
... | 2.229978 | 4,470 |
# Copyright 2021 Andreas Steck (steck.andi@gmail.com)
#
# 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 ... | [
2,
15069,
33448,
33728,
2441,
694,
357,
4169,
694,
13,
26800,
31,
14816,
13,
785,
8,
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,... | 3.442105 | 380 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
from app.curses_util import *
import app.fake_curses_testing
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
598,
13,
66,
46998,
62,
22602,
1330,
1635,
1... | 3.615385 | 52 |
"""
* *******************************************************
* Copyright VMware, Inc. 2016. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL ... | [
37811,
198,
9,
41906,
8412,
2466,
8162,
198,
9,
15069,
37754,
11,
3457,
13,
1584,
13,
1439,
6923,
33876,
13,
198,
9,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
9,
41906,
8412,
2466,
8162,
198,
9,
198,
9,
13954,
48778,
... | 2.282981 | 1,986 |
import string
import globals
valid_input=[1,0,True,False] # Valid Input For Boolean Functions
def input_num(input_str):
'''
(VLSI_Object)-> (Input_list,Numer Of Inputs)
'''
try:
input_list=[]
for i in input_str:
if (i in string.ascii_letters) and (i not in input_list):
... | [
11748,
4731,
198,
11748,
15095,
874,
198,
12102,
62,
15414,
41888,
16,
11,
15,
11,
17821,
11,
25101,
60,
1303,
48951,
23412,
1114,
41146,
40480,
198,
4299,
5128,
62,
22510,
7,
15414,
62,
2536,
2599,
198,
220,
220,
220,
705,
7061,
198,... | 2.146096 | 397 |
from mk2.plugins import Plugin
from mk2.events import UserInput
| [
6738,
33480,
17,
13,
37390,
1330,
42636,
198,
6738,
33480,
17,
13,
31534,
1330,
11787,
20560,
628
] | 3.823529 | 17 |
#Common functions will go in here
| [
2,
17227,
5499,
481,
467,
287,
994,
198
] | 4.25 | 8 |
# -*- coding: utf-8 -*-
# A Python calculator for operator
from sys import argv
from decimal import *
def delBlank(strs):
"""
Delete all blanks in the str.
"""
ans = ""
for e in strs:
if e != " ":
ans += e
return ans
def precede(a, b):
"""
Compare the prior of operator a and b
"""
prior = (
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
317,
11361,
28260,
329,
10088,
198,
198,
6738,
25064,
1330,
1822,
85,
198,
6738,
32465,
1330,
1635,
628,
198,
4299,
1619,
3629,
962,
7,
2536,
82,
2599,
198,
197,
37... | 1.982301 | 1,356 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 16 17:55:16 2020
Copyright 2020 by Hadrien Montanelli.
"""
# Standard library imports:
import matplotlib.pyplot as plt
import numpy as np
import scipy.integrate as intg
class RandVar:
"""
Class for representing continuous random variables i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
2556,
1467,
1596,
25,
2816,
25,
1433,
12131,
198,
198,
15269,
12131,
416,
11161,
153... | 2.123555 | 1,384 |
import os
import sys
sys.path.append("/usr/local/apps/grib_api/1.15.0/GNU/4.8.1/lib/python2.7/site-packages/gribapi")
sys.path.append("/usr/local/apps/python/2.7.8-01/lib/python2.7/site-packages")
try:
import ecmwfapi
except:
pass
import numpy as np
import tempfile
try:
from grib import GribFile
except:
... | [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
14,
14629,
14,
12001,
14,
18211,
14,
70,
822,
62,
15042,
14,
16,
13,
1314,
13,
15,
14,
16630,
52,
14,
19,
13,
23,
13,
16,
14,
8019,
14,
29412,
17,
13,
22,
... | 1.815781 | 3,143 |
PI = 3.1415926535897932384626433832795028841971693993751058209
| [
11901,
796,
513,
13,
1415,
19707,
22980,
2327,
4531,
44750,
23721,
3510,
18897,
2091,
5999,
26050,
1120,
2078,
5705,
24991,
1433,
6052,
2079,
22318,
940,
3365,
22567,
198
] | 2.25 | 28 |
import ipywidgets as widgets
from traitlets import List, Unicode
@widgets.register("bonobo-widget.bonobo")
| [
11748,
20966,
88,
28029,
11407,
355,
40803,
198,
6738,
1291,
2578,
912,
1330,
7343,
11,
34371,
628,
198,
31,
28029,
11407,
13,
30238,
7203,
4189,
20391,
12,
42655,
13,
4189,
20391,
4943,
198
] | 3.30303 | 33 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import re
from itertools import takewhile
from pyparsing import LineStart, Optional, Suppress
from regparser.citations import internal_citations
from regparser.grammar import appendix as grammar
from regparser.grammar.utils import Marker,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
18931,
198,
11748,
302,
198,
6738,
340,
861,
10141,
1330,
1011,
4514,
198,
198,
6738,
279,
4... | 2.218458 | 5,461 |
from django.apps import apps
| [
6738,
42625,
14208,
13,
18211,
1330,
6725,
628,
198
] | 3.444444 | 9 |
from flask import current_app as app
from core.utils import Utils
from main.db import MongoDB
from main.services.blacklist_helpers import BlacklistHelper
class UserService:
""" doc string for UserService """
def add_user(self, user_obj):
""" user_obj - user object """
user = self.mongo.find(... | [
6738,
42903,
1330,
1459,
62,
1324,
355,
598,
198,
198,
6738,
4755,
13,
26791,
1330,
7273,
4487,
198,
6738,
1388,
13,
9945,
1330,
42591,
11012,
198,
6738,
1388,
13,
30416,
13,
13424,
4868,
62,
16794,
364,
1330,
2619,
4868,
47429,
628,
... | 2.321888 | 466 |
# -*- coding: utf-8 -*-
import unittest
from aiostripe.error import StripeError
from aiostripe.test.helper import StripeUnitTestCase
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
257,
72,
455,
380,
431,
13,
18224,
1330,
26137,
431,
12331,
198,
6738,
257,
72,
455,
380,
431,
13,
9288,
13,
2978,
525,
13... | 2.466667 | 75 |
import pytest
| [
11748,
12972,
9288,
628,
628,
198
] | 3 | 6 |
import sys
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from model.network import GNet, DNet
from loss import LeastSquare
| [
11748,
25064,
201,
198,
11748,
28686,
201,
198,
11748,
28034,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
201,
198,
6738,
2746,
13,
27349,
1330,
402,
7934,
11,
360,
7934,
20... | 3.075472 | 53 |
# proxy module
from traitsui.editors.instance_editor import *
| [
2,
15741,
8265,
198,
6738,
12796,
9019,
13,
276,
6742,
13,
39098,
62,
35352,
1330,
1635,
198
] | 3.647059 | 17 |
import subprocess
CLIENT_IDENTIFIER = "T" + "ib" + "ia - "
| [
11748,
850,
14681,
198,
198,
5097,
28495,
62,
25256,
5064,
38311,
796,
366,
51,
1,
1343,
366,
571,
1,
1343,
366,
544,
532,
366,
628,
628,
198
] | 2.37037 | 27 |
from detectron2.evaluation import COCOEvaluator, inference_on_dataset,print_csv_format
import os.path
import json
import cv2
import numpy as np
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from de... | [
6738,
4886,
1313,
17,
13,
18206,
2288,
1330,
327,
4503,
27799,
2100,
84,
1352,
11,
32278,
62,
261,
62,
19608,
292,
316,
11,
4798,
62,
40664,
62,
18982,
198,
11748,
28686,
13,
6978,
198,
11748,
33918,
198,
11748,
269,
85,
17,
198,
11... | 2.567243 | 1,331 |
# Search key
if __name__ == '__main__':
main()
| [
2,
11140,
1994,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1388,
3419,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,... | 1.535714 | 56 |
#!/usr/bin/env python3
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for sqlite_cherry_picker.py.
These tests should be getting picked up by the PRESUBMIT.py in the parent
directory.
"""
from ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
12131,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198... | 3.011429 | 175 |
#!/usr/bin/env python
"""
___ __ __
/ _ \___ / /__ / / __ _ ___ ____
/ // / _ \/ / _ \/ _ \/ ' \/ _ `/ _ \
/____/\___/_/ .__/_//_/_/_/_/\_,_/_//_/
/_/
The MIT License (MIT)
Copyright (c) 2015 Dolphman
Permission is hereby granted, free of c... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
628,
220,
220,
46444,
220,
220,
220,
220,
220,
220,
11593,
220,
220,
220,
220,
11593,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19... | 2.578548 | 923 |
import os
import io
import tensorflow as tf
import standard_fields as fields
import cv2
import scipy
import dataset_util
flags = tf.app.flags
flags.DEFINE_string('output_path', '/share/zhui/mnt/train.tfrecord', 'tfrecord filename')
flags.DEFINE_string('tags_file_path', '/share/zhui/mnt/ramdisk/max/imlis... | [
11748,
28686,
220,
201,
198,
11748,
33245,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
220,
201,
198,
11748,
3210,
62,
25747,
355,
7032,
201,
198,
11748,
269,
85,
17,
220,
201,
198,
11748,
629,
541,
88,
201,
198,
11748,
27039,
62,... | 2.38172 | 186 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import tensorflow as tf
from .utils import positional_encoding
def scaled_dot_product_attention(q, k, v, mask):
"""Calculate the attention weight... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
4818,
8079,
... | 2.582638 | 599 |
#!python
import os, sys, string, time, BaseHTTPServer, getopt, re, subprocess, webbrowser
from operator import itemgetter
from utils import *
from classify import Classify
sys.path.append(INITIAL_UTILS)
from ruffus import *
from create_summary import *
_readlibs = []
_skipsteps = []
_cls = None
_settings = Settings(... | [
2,
0,
29412,
198,
198,
11748,
28686,
11,
25064,
11,
4731,
11,
640,
11,
7308,
6535,
28820,
18497,
11,
651,
8738,
11,
302,
11,
850,
14681,
11,
3992,
40259,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
198,
6738,
3384,
4487,
1330,
163... | 2.692308 | 234 |
import os
ANSWERS_MODEL_FOLDER = os.path.sep.join(['Projects', 'Project 3'])
ANSWERS_OUTPUT_PATH = os.path.sep.join(['gradetools', 'project_3', 'answers.json'])
NUM_ITERATIONS = 10000
TOLERANCES = dict(
mv_debt=800000000,
mv_equity=1,
wacc_mean=0.005,
wacc_std=0.002,
other=0.00001
)
DATA_DIR = o... | [
11748,
28686,
198,
198,
15037,
54,
4877,
62,
33365,
3698,
62,
37,
3535,
14418,
796,
28686,
13,
6978,
13,
325,
79,
13,
22179,
7,
17816,
16775,
82,
3256,
705,
16775,
513,
6,
12962,
198,
15037,
54,
4877,
62,
2606,
7250,
3843,
62,
34219... | 1.744715 | 1,230 |
"""
Base view
"""
import uuid
import base64
from ..views import DEFAULT_LIBRARY_NAME_PREFIX, DEFAULT_LIBRARY_DESCRIPTION, \
USER_ID_KEYWORD
from flask import request, current_app
from flask_restful import Resource
from ..models import db, User, Library, Permissions
from ..client import client
from sqlalchemy.exc i... | [
37811,
198,
14881,
1570,
198,
37811,
198,
11748,
334,
27112,
198,
11748,
2779,
2414,
198,
198,
6738,
11485,
33571,
1330,
5550,
38865,
62,
40347,
49,
13153,
62,
20608,
62,
47,
31688,
10426,
11,
5550,
38865,
62,
40347,
49,
13153,
62,
3091... | 2.161489 | 4,700 |
#!/usr/bin/env python
# coding=utf-8
import os
import hashlib
import logging
from queue import Queue
import requests
from gevent import monkey, sleep
from gevent.pool import Pool
# Do all of the default monkey patching (calls every other applicable
# function in this module).
monkey.patch_all()
CONFIG = Config()
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
11748,
28686,
198,
11748,
12234,
8019,
198,
11748,
18931,
198,
6738,
16834,
1330,
4670,
518,
198,
198,
11748,
7007,
198,
6738,
4903,
1151,
1330,
... | 3.030675 | 163 |
from flask import Flask
from .config import config
def create_app(env: str=None) -> Flask:
"""创建flask应用对象
Args:
env: 运行环境:development/testing/production
"""
if not env:
env = 'default'
app = Flask(__name__)
app.config.from_object(config[env])
config[env].init_app(app)
... | [
6738,
42903,
1330,
46947,
198,
198,
6738,
764,
11250,
1330,
4566,
628,
198,
4299,
2251,
62,
1324,
7,
24330,
25,
965,
28,
14202,
8,
4613,
46947,
25,
198,
220,
220,
220,
37227,
26344,
249,
161,
119,
118,
2704,
2093,
41753,
242,
18796,
... | 2.08805 | 159 |
import sys
import os
import time
import vk_api
import pandas as pd
from tqdm import tnrange, tqdm_notebook, tqdm
from time import sleep
import django
# указывается адрес проекта
VKData = '/home/rust/Documents/Azat/vk_crawler/code/VKData'
sys.path.insert(0, VKData)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "VKDa... | [
11748,
25064,
198,
11748,
28686,
220,
198,
11748,
640,
198,
11748,
410,
74,
62,
15042,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
256,
80,
36020,
1330,
256,
77,
9521,
11,
256,
80,
36020,
62,
11295,
2070,
11,
256,
80,
36020,
19... | 1.732093 | 2,150 |
import os
import time
from pathlib import Path
from uuid import uuid4
from git import Repo
from github import Github
org = None
def _get_openpecha_data_org(org_name=None, token=None):
"""OpenPecha github org singleton."""
global org
if org is None:
if not token:
token = os.environ.ge... | [
11748,
28686,
198,
11748,
640,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
198,
6738,
17606,
1330,
1432,
78,
198,
6738,
33084,
1330,
38994,
198,
198,
2398,
796,
6045,
628,
198,
4299,
4808,
1136,... | 2.193916 | 263 |
# The MIT License (MIT)
#
# Copyright (C) 2015 - Antoine Busque <abusque@efficios.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the ... | [
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
34,
8,
1853,
532,
3738,
42722,
5869,
4188,
1279,
46844,
4188,
31,
24531,
4267,
13,
785,
29,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
... | 3.798742 | 318 |
import io
from PIL import Image
def gen_image(name='test.png'):
"""Возвращает файл изображения."""
file = io.BytesIO()
image = Image.new('RGBA', size=(100, 100), color=(155, 0, 0))
image.save(file, 'png')
file.name = name
file.seek(0)
return file
| [
11748,
33245,
198,
198,
6738,
350,
4146,
1330,
7412,
628,
198,
4299,
2429,
62,
9060,
7,
3672,
11639,
9288,
13,
11134,
6,
2599,
198,
220,
220,
220,
37227,
140,
240,
25443,
115,
38857,
21169,
16142,
141,
231,
16142,
16843,
20375,
220,
1... | 1.992857 | 140 |
import ctypes
from ads.nonzerobasedarray import NonzeroBasedArray
| [
201,
198,
11748,
269,
19199,
201,
198,
6738,
9011,
13,
13159,
9107,
672,
839,
18747,
1330,
8504,
22570,
15001,
19182,
201,
198,
201,
198
] | 3 | 24 |
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt, QSize, pyqtSignal, pyqtSlot
from PyQt5.QtCore import pyqtSignal
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1195,
19578,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
33734,
11,
1195,
10699,
11,
12972,
39568... | 2.279412 | 68 |
import pygame
vec = pygame.math.Vector2
| [
11748,
12972,
6057,
198,
35138,
796,
12972,
6057,
13,
11018,
13,
38469,
17,
628
] | 2.928571 | 14 |
from office365.runtime.client_value import ClientValue
class ChangeNotificationCollection(ClientValue):
"""Represents a collection of resource change notifications sent to the subscriber."""
| [
6738,
2607,
24760,
13,
43282,
13,
16366,
62,
8367,
1330,
20985,
11395,
628,
198,
4871,
9794,
3673,
2649,
36307,
7,
11792,
11395,
2599,
198,
220,
220,
220,
37227,
6207,
6629,
257,
4947,
286,
8271,
1487,
19605,
1908,
284,
262,
32944,
526,... | 4.581395 | 43 |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 11 07:34:12 2020
@author: cesarzosa
"""
import pandas as pd
path_save = "./data/artwork.pickle"
df = pd.read_pickle(path_save)
serie_artistas_dup = df['artist']
artistas = pd.unique(serie_artistas_dup)
print(type(artistas)) # numpy array
print(artistas.size)
print(... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2447,
1367,
8753,
25,
2682,
25,
1065,
12131,
198,
198,
31,
9800,
25,
269,
18964,
89,
8546,
198,
37811,
198,
198,
11748,
19798,
292,
355,
... | 2.426606 | 218 |
"""This module defines shortcuts for generating WCS instances and working
with them. The bounding boxes and shapes used in this module all use
the same ordering as WCS, i.e. column major (so {ra,dec} rather than
{dec,ra}). Coordinates are assigned to pixel centers, as WCS does natively,
but bounding boxes include the w... | [
37811,
1212,
8265,
15738,
32953,
329,
15453,
45410,
10245,
290,
1762,
198,
4480,
606,
13,
383,
5421,
278,
10559,
290,
15268,
973,
287,
428,
8265,
477,
779,
198,
1169,
976,
16216,
355,
45410,
11,
1312,
13,
68,
13,
5721,
1688,
357,
568,... | 2.592975 | 3,587 |
# test code
array = [10, 5, 4, 1, 2, 3, 25]
print(merge_sort(array))
| [
628,
198,
2,
1332,
2438,
198,
18747,
796,
685,
940,
11,
642,
11,
604,
11,
352,
11,
362,
11,
513,
11,
1679,
60,
198,
4798,
7,
647,
469,
62,
30619,
7,
18747,
4008,
198
] | 2.117647 | 34 |
from brteve.brt_eve_bt817_8 import BrtEve
from brteve.brt_eve_rp2040 import BrtEveRP2040
host = BrtEveRP2040()
eve = BrtEve(host)
eve.init(resolution="1280x800", touch="goodix")
eve.ClearColorRGB(0x20, 0x40, 0x20)
eve.Clear()
eve.cmd_text(eve.lcd_width // 2, eve.lcd_height // 2, 31, eve.OPT_CENTER, "Hello world")
eve... | [
6738,
865,
660,
303,
13,
1671,
83,
62,
44655,
62,
18347,
23,
1558,
62,
23,
1330,
1709,
83,
36,
303,
198,
6738,
865,
660,
303,
13,
1671,
83,
62,
44655,
62,
81,
79,
1238,
1821,
1330,
1709,
83,
36,
303,
20031,
1238,
1821,
198,
198,... | 2.143791 | 153 |
from src.preprocess import read_dataset
from src.utils import *
import json
import numpy as np
from tqdm import tqdm
DATA_DIR = 'data/dataset/'
if __name__ == "__main__":
main()
| [
6738,
12351,
13,
3866,
14681,
1330,
1100,
62,
19608,
292,
316,
198,
6738,
12351,
13,
26791,
1330,
1635,
198,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
628,
198,
26947,
62,
... | 2.546667 | 75 |
#!/usr/bin/env python
# Copyright 2020 The Tilt Brush Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
12131,
383,
309,
2326,
39846,
46665,
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,
... | 3.442748 | 262 |
from django.db import models
from django.template.defaultfilters import slugify
from django.shortcuts import reverse
from django.conf import settings
from ordered_model.models import OrderedModel
from . import snippets
# Create your models here. | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
28243,
13,
12286,
10379,
1010,
1330,
31065,
1958,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
9575,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
614... | 4.083333 | 60 |
from app import db
from app.auth.forms import RegisterFlaskForm
from app.models import Instructors, Departments, Courses
from app.auth import bp
from app.auth.google_login import google_login_request_uri, process_google_login_callback
from app.utils.api import resource_url
from flask import render_template, redirect, ... | [
6738,
598,
1330,
20613,
198,
6738,
598,
13,
18439,
13,
23914,
1330,
17296,
7414,
2093,
8479,
198,
6738,
598,
13,
27530,
1330,
20689,
669,
11,
2129,
32514,
11,
2734,
8448,
198,
6738,
598,
13,
18439,
1330,
275,
79,
198,
6738,
598,
13,
... | 3.271795 | 195 |
from __future__ import print_function
import time
import os
import copy
import numpy as np
from . import onmt_model
import onmt
import collections
import operator
import editdistance
import sys
import itertools
PYTHON3 = sys.version_info > (3, 0)
if PYTHON3:
from itertools import zip_longest as zip_longest
else:
... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
4866,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
1330,
319,
16762,
62,
19849,
198,
11748,
319,
16762,
198,
11748,
17268,
198,
11748,
... | 2.315584 | 770 |
# Generated by Django 3.1.6 on 2021-02-15 18:38
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
21,
319,
33448,
12,
2999,
12,
1314,
1248,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import math
import numpy as np
import tensorflow as tf
import os
import time
os.environ['CUDA_VISIBLE_DEVICES'] = '2'
import tflearn
import global_constants as settings
# FEATURE_NUM = 64 #128
ACTION_EPS = 1e-6
GAMMA = 0.99
# PPO2
EPS = 0.2
| [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
28686,
198,
11748,
640,
198,
418,
13,
268,
2268,
17816,
43633,
5631,
62,
29817,
34563,
62,
39345,
34444,
20520,
796,
705,
17,
6,
19... | 2.547368 | 95 |
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file... | [
2,
15069,
13130,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
743,
407,
779,
428,
2393,
2845,
28... | 3.402299 | 261 |
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
2,
15069,
1584,
19507,
605,
12052,
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,
921,
743... | 3.255046 | 545 |
import os
import io
from datetime import datetime, timedelta
import json
import logging
import requests
import boto3
import psycopg2
logger = logging.getLogger()
logger.setLevel(logging.INFO)
BUCKET = os.getenv("S3_BUCKET")
if not BUCKET:
logger.error({"error": "no bucket env var found"})
DB_CREDENTIALS = os.ge... | [
11748,
28686,
198,
11748,
33245,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
11748,
7007,
198,
11748,
275,
2069,
18,
198,
11748,
17331,
22163,
70,
17,
198,
198,
6404,
1362,
... | 2.565957 | 705 |
# class User:
# pass
#
# user_1 = User()
# user_1.id = "001"
# user_1.username = "angela"
user_1 = User("001", "Douglas")
user_2 = User("002", "Angela")
user_1.follow(user_2)
print(user_1.followers)
print(user_1.following)
print(user_2.followers)
print(user_2.following)
| [
2,
1398,
11787,
25,
198,
2,
220,
220,
220,
220,
1208,
198,
2,
198,
2,
2836,
62,
16,
796,
11787,
3419,
198,
2,
2836,
62,
16,
13,
312,
796,
366,
8298,
1,
198,
2,
2836,
62,
16,
13,
29460,
796,
366,
8368,
64,
1,
628,
198,
7220,
... | 2.241935 | 124 |
""" Satellite Data Source """
import logging
from dataclasses import InitVar, dataclass
from functools import partial
from numbers import Number
from typing import Iterable, Optional
import dask
import numpy as np
import pandas as pd
import xarray as xr
import nowcasting_dataset.time as nd_time
from nowcasting_datase... | [
37811,
33530,
6060,
8090,
37227,
198,
11748,
18931,
198,
6738,
4818,
330,
28958,
1330,
44707,
19852,
11,
4818,
330,
31172,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
3146,
1330,
7913,
198,
6738,
19720,
1330,
40806,
540,
11,
3223... | 2.321326 | 6,274 |
from datetime import datetime
from django.core import exceptions
from django.db import models
from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.core import validators
from .helpers import format_tempo, format_run_time
class UserManager(BaseUserManager):
"""Define a model manager fo... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
7295,
1330,
13269,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
27741,
12982,
11,
7308,
12982,
1... | 2.495737 | 821 |
from django.contrib import admin
from .models import Libro, Pagina
admin.site.register(Libro)
admin.site.register(Pagina) | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
7980,
305,
11,
31525,
1437,
628,
198,
28482,
13,
15654,
13,
30238,
7,
25835,
305,
8,
198,
28482,
13,
15654,
13,
30238,
7,
47,
363,
1437,
8
] | 3.02439 | 41 |
# Variáveis com códigos de cores!
vermelho, amarelo, azul1, lilas, azul, fim = '\033[1:31m', '\033[1:33m', '\033[1:34m', '\033[1:35m', \
'\033[1:36m', '\033[m'
# ENTREGANDO DADOS SOBRE UM CONJUNTO DE NÚMEROS DIGITADOS
# Cabeçalho
print('\033[1:31m-=-\033[m' * 17)
print('\03... | [
2,
15965,
6557,
303,
271,
401,
269,
10205,
12894,
418,
390,
21758,
0,
198,
332,
17694,
8873,
11,
716,
533,
5439,
11,
35560,
377,
16,
11,
42280,
292,
11,
35560,
377,
11,
277,
320,
796,
705,
59,
44427,
58,
16,
25,
3132,
76,
3256,
... | 1.80597 | 804 |
"""
Functionality to scrape parliamentarian information from Wikipedia pages.
"""
import logging
import os
from datetime import datetime
import requests
import pandas as pd
import bs4 as bs
from .schema import schema, schema_map
from .urls import parliaments
logging.basicConfig(level=logging.INFO, format='%(asctime)... | [
37811,
198,
22203,
1483,
284,
42778,
8540,
3699,
1321,
422,
15312,
5468,
13,
198,
37811,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
7007,
198,
11748,
19798,
292,
355,
279,
67,
198,
11... | 2.972973 | 222 |
from flask import Flask, jsonify
from flask_jwt_extended import JWTManager
from flask_restful import Api
from blacklist import BLACKLIST
from resource.hotel import HotelResource, HotelResourceAll
from resource.site import SiteResource, SiteResourceAll
from resource.user import UserResource, UserResourceAll, UserLoginR... | [
6738,
42903,
1330,
46947,
11,
33918,
1958,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
449,
39386,
13511,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
198,
198,
6738,
38810,
1330,
31963,
45849,
198,
6738,
8271,
13,
8940,
... | 2.869469 | 452 |
import pygame, sys, random, json, time, os, button
from cryptography.fernet import Fernet
from threading import Thread
from time import sleep
key = "FuGxRMgLoA_lW62jYKpWoW0ieYUBMaryvlAOqp-aQpY="
f = Fernet(key)
clock = pygame.time.Clock()
pygame.init()
screen = pygame.display.set_mode((400,650))
game_font = pygame.fo... | [
11748,
12972,
6057,
11,
25064,
11,
4738,
11,
33918,
11,
640,
11,
28686,
11,
4936,
198,
6738,
45898,
13,
69,
1142,
316,
1330,
38982,
316,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
640,
1330,
3993,
198,
198,
2539,
796,
366,
41133,
... | 2.23871 | 2,015 |
#
# Copyright (c) 2021 The Markovflow Contributors.
#
# 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... | [
2,
198,
2,
15069,
357,
66,
8,
33448,
383,
2940,
709,
11125,
25767,
669,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
1... | 2.119453 | 12,440 |
import os, sys
thisdir = os.path.dirname(__file__)
libdirs = []
libdirs.append(os.path.join(thisdir, '../'))
libdirs.append(os.path.join(thisdir, '../../crypt'))
libdirs.append(os.path.join(thisdir, '../../config'))
libdirs.append(os.path.join(thisdir, '../../persist'))
for libdir in libdirs:
if libdir not in sys.... | [
11748,
28686,
11,
25064,
198,
5661,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
8,
198,
8019,
15908,
82,
796,
17635,
198,
8019,
15908,
82,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
5661,
15908,
11,
705,
40720,
... | 2.319018 | 163 |
from typing import List, Union
import rdflib
from prefixcommons.curie_util import contract_uri, expand_uri, default_curie_maps
from rdflib import Namespace, URIRef
from rdflib.namespace import RDF, RDFS, OWL
from kgx.utils.kgx_utils import get_toolkit
toolkit = get_toolkit()
m = toolkit.generator.mappings
x = set()
... | [
6738,
19720,
1330,
7343,
11,
4479,
198,
198,
11748,
374,
67,
2704,
571,
198,
6738,
21231,
9503,
684,
13,
22019,
494,
62,
22602,
1330,
2775,
62,
9900,
11,
4292,
62,
9900,
11,
4277,
62,
22019,
494,
62,
31803,
198,
6738,
374,
67,
2704,... | 2.281772 | 4,493 |
#!/usr/bin/env python
import sys
if __name__ == '__main__':
book1 = Book()
print('showing defaults:')
print(str(book1) + '\n')
book1.title = 'Animal farm'
book1.author = 'George Orwell'
book1.year = 1945
print(str(book1) + '\n')
book2 = Book('Alice in Wonderland', 'Lewis Carroll', 1... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1492,
16,
796,
4897,
3419,
198,
220,
220,
220,
3601,
10786,
1477,
7855,
... | 2.253165 | 237 |
from PythonLinearNonlinearControl.models.cartpole \
import CartPoleModel # NOQA
from PythonLinearNonlinearControl.models.first_order_lag \
import FirstOrderLagModel # NOQA
from PythonLinearNonlinearControl.models.two_wheeled \
import TwoWheeledModel # NOQA | [
6738,
11361,
14993,
451,
15419,
29127,
15988,
13,
27530,
13,
26674,
36869,
3467,
198,
220,
220,
220,
1330,
13690,
47,
2305,
17633,
220,
1303,
8005,
48,
32,
198,
6738,
11361,
14993,
451,
15419,
29127,
15988,
13,
27530,
13,
11085,
62,
287... | 3.044944 | 89 |
import numpy as np
from collections import defaultdict
from .utils import *
def semi_gradient_td0(env, pi, vfunc, vfunc_deriv, w,
gamma=1, alpha=0.1, N_episodes=1000,
ep_max_length=1000, alpha_decay=decay_none):
"""Evaluates state-value function with semi-gradient TD(0)
Based on Sutton/Barto,... | [
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
764,
26791,
1330,
1635,
628,
198,
4299,
10663,
62,
49607,
62,
8671,
15,
7,
24330,
11,
31028,
11,
410,
20786,
11,
410,
20786,
62,
1082,
452,
11,
266,
11,
... | 2.23607 | 682 |
# Return the remainder
# remainder_lambda = lambda x, y: x % y
if __name__ == "__main__":
print(remainder(1, 3))
| [
2,
8229,
262,
17675,
628,
198,
198,
2,
17675,
62,
50033,
796,
37456,
2124,
11,
331,
25,
2124,
4064,
331,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
2787,
391,
1082,
7,
16,
11,
... | 2.574468 | 47 |
#!/usr/bin/env python
"""
This is a sentence chunker based on classifier , to assertian the
worth of this method we can always evaluate the performance of the classifier by passing a trained
tagged sentence like this
>> chunker = ConsecutiveNPChunker(train_sents)
>> print chunker.evaluate(test_sents)
For training the... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
1212,
318,
257,
6827,
16058,
263,
1912,
319,
1398,
7483,
837,
284,
6818,
666,
262,
198,
9268,
286,
428,
2446,
356,
460,
1464,
13446,
262,
2854,
286,
262,
1398,
7483,
416,
... | 2.795732 | 328 |
import numpy as np
import cv2 as cv
# https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_contours/py_contours_hierarchy/py_contours_hierarchy.html
img = cv.imread('square.jpg')
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
ret,thresh = cv.threshold(gray,127,255,1)
contours,h = cv.findCon... | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
2,
3740,
1378,
9654,
33967,
12,
29412,
12,
83,
315,
305,
874,
13,
961,
83,
704,
420,
82,
13,
952,
14,
268,
14,
42861,
14,
9078,
62,
83,
44917,
82,
14,
... | 1.809353 | 834 |
from opengmcore import *
#import version
from __version__ import version
import inference
import hdf5
import sys
import types
configuration=OpengmConfiguration()
| [
6738,
1280,
39870,
7295,
1330,
1635,
198,
2,
11748,
2196,
220,
198,
6738,
11593,
9641,
834,
1330,
2196,
628,
198,
11748,
32278,
198,
11748,
289,
7568,
20,
198,
11748,
25064,
198,
11748,
3858,
198,
198,
11250,
3924,
28,
18257,
1516,
76,
... | 3.032258 | 62 |
import setka
import torch
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
import tiny_model
import test_dataset
from test_metrics import tensor_loss as loss | [
11748,
900,
4914,
198,
11748,
28034,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
... | 2.84 | 75 |
import csv
from pathlib import Path
import configure
def csv_to_md_table(input, output, align='center', brow='true', bcol='false'):
'''Converts a CSV file to a Markdown table.
* `input` - File path string
* `output` - File path string
* `align` - `'left'`, `'right'`, `'center'` (default)
* `brow` - Bold the... | [
11748,
269,
21370,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
17425,
198,
198,
4299,
269,
21370,
62,
1462,
62,
9132,
62,
11487,
7,
15414,
11,
5072,
11,
10548,
11639,
16159,
3256,
4772,
11639,
7942,
3256,
275,
4033,
11639,
9562,
6,
... | 2.333633 | 1,112 |