content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Need to split up to avoid duplication
# The below function would be used to find occurrences where the source word is in the translation text.
'''
def search_single_word(self, language, word):
# Translate single word
found_words = ""
if language == '-en':
for dict_word in se... | [
628,
198,
2,
10664,
284,
6626,
510,
284,
3368,
50124,
198,
2,
383,
2174,
2163,
561,
307,
973,
284,
1064,
40279,
810,
262,
2723,
1573,
318,
287,
262,
11059,
2420,
13,
198,
7061,
6,
198,
220,
220,
220,
825,
2989,
62,
29762,
62,
4775... | 1.95057 | 526 |
import pandas as pd
csv_file = pd.read_csv('http://archive.ics.uci.edu/ml/machine-learning-databases/communities/communities.data',header=None)
df = csv_file[[0,len(csv_file.columns)-1]]
df.columns = ['label', 'value']
grouped_by_state = df.groupby('label')
aa = grouped_by_state['value'].sum()/grouped_by_state['valu... | [
11748,
19798,
292,
355,
279,
67,
198,
198,
40664,
62,
7753,
796,
279,
67,
13,
961,
62,
40664,
10786,
4023,
1378,
17474,
13,
873,
13,
42008,
13,
15532,
14,
4029,
14,
30243,
12,
40684,
12,
19608,
18826,
14,
10709,
871,
14,
10709,
871,... | 2.589189 | 185 |
import pytest
from vetiver import mock, VetiverModel, VetiverAPI
from fastapi.testclient import TestClient
| [
11748,
12972,
9288,
198,
198,
6738,
20202,
1428,
1330,
15290,
11,
49744,
1428,
17633,
11,
49744,
1428,
17614,
198,
6738,
3049,
15042,
13,
9288,
16366,
1330,
6208,
11792,
628,
628
] | 3.7 | 30 |
import os
import struct
import sys
from __pypy__ import time
if sys.platform.startswith("linux"):
| [
11748,
28686,
198,
11748,
2878,
198,
11748,
25064,
198,
6738,
11593,
79,
4464,
88,
834,
1330,
640,
628,
198,
361,
25064,
13,
24254,
13,
9688,
2032,
342,
7203,
23289,
1,
2599,
198
] | 3.125 | 32 |
# asteroid game
from PIL import ImageFont, ImageDraw, Image
import cv2
import random
import numpy as np
import pathlib
from playsound import playsound
| [
2,
27460,
983,
220,
198,
198,
6738,
350,
4146,
1330,
7412,
23252,
11,
7412,
25302,
11,
7412,
198,
11748,
269,
85,
17,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
3108,
8019,
198,
198,
6738,
5341,
633,
1330,
5341,... | 2.233333 | 90 |
"""Python module to define and hold global variables."""
import tcod
context: tcod.context.Context # Active context.
console: tcod.console.Console # Active console.
| [
37811,
37906,
8265,
284,
8160,
290,
1745,
3298,
9633,
526,
15931,
198,
11748,
256,
19815,
198,
198,
22866,
25,
256,
19815,
13,
22866,
13,
21947,
220,
1303,
14199,
4732,
13,
198,
41947,
25,
256,
19815,
13,
41947,
13,
47581,
220,
1303,
... | 3.733333 | 45 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-22 09:05
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
22,
319,
2177,
12,
2919,
12,
1828,
7769,
25,
2713,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.690909 | 55 |
import pandas as pd
import numpy as np
from src.utils import (
load_config,
load_parameters,
)
from src.preprocessing_pipeline import impute_age
def test_impute_age():
"""Test the impute_age function"""
# Load in the test configuration & parameters
config = load_config(".env-test")
parameters... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12351,
13,
26791,
1330,
357,
198,
220,
220,
220,
3440,
62,
11250,
11,
198,
220,
220,
220,
3440,
62,
17143,
7307,
11,
198,
8,
198,
6738,
12351,
13,
3866,... | 2.128176 | 866 |
# Import necessary packages
from __future__ import print_function
import os
import sys
import cv2
import numpy as np
# Create data matrix from a list of images
# Read images from the directory
# Add the weighted eigen faces to the mean face
if __name__ == '__main__':
# Number of EigenFaces
NUM_EIGEN_FACES = 10
... | [
2,
17267,
3306,
10392,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
13610,
1366,
17593,
422,
257,
1351,
286,
4263,
... | 2.790997 | 622 |
from controllers._base_controller import app
from controllers.index_controller import *
from controllers.admin_controller import *
from controllers.user_controller import *
from controllers.api_controller import *
# FastAPIのルーティング用関数
app.add_api_route('/', index)
app.add_api_route('/admin', admin) # management view f... | [
6738,
20624,
13557,
8692,
62,
36500,
1330,
598,
198,
6738,
20624,
13,
9630,
62,
36500,
1330,
1635,
198,
6738,
20624,
13,
28482,
62,
36500,
1330,
1635,
198,
6738,
20624,
13,
7220,
62,
36500,
1330,
1635,
198,
6738,
20624,
13,
15042,
62,
... | 3.548193 | 166 |
# Copyright 2022 The T5X 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 applicable law or agreed to in writ... | [
2,
15069,
33160,
383,
309,
20,
55,
46665,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
... | 2.800776 | 6,440 |
# Web app UI
import sqlite3, config
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
from datetime import date
app = FastAPI()
templates = Jinja2Templates(directory="templates") # configuring HTML templates dirctory - display logic
@app.get("/") # all get request will be routed to t... | [
2,
5313,
598,
12454,
198,
11748,
44161,
578,
18,
11,
4566,
198,
6738,
3049,
15042,
1330,
12549,
17614,
11,
19390,
198,
6738,
3049,
15042,
13,
11498,
489,
803,
1330,
17297,
6592,
17,
12966,
17041,
198,
6738,
4818,
8079,
1330,
3128,
198,
... | 3.436975 | 119 |
# -*- coding: utf-8 -*-
# Copyright 2018-2019 Jacob M. Graving <jgraving@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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2864,
12,
23344,
12806,
337,
13,
7037,
1075,
1279,
73,
46784,
1075,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
... | 2.18154 | 6,869 |
from shutil import copyfile
import pdb
from copy import deepcopy
import os
import arrow
from io import StringIO
import re
import semver
import rdflib
from rdflib import RDFS, RDF, OWL, Namespace
from rdflib.namespace import FOAF
from SPARQLWrapper import SPARQLWrapper
from SPARQLWrapper import JSON, SELECT, INSERT, DI... | [
6738,
4423,
346,
1330,
4866,
7753,
198,
11748,
279,
9945,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
28686,
198,
11748,
15452,
198,
6738,
33245,
1330,
10903,
9399,
198,
11748,
302,
198,
198,
11748,
5026,
332,
198,
11748,
374,
67,
2... | 2.585034 | 294 |
#! /usr/bin/env python
import pandas as pd
from .clean import clean_text
""" NOTES
- Data columns:
['abstract_text',
'abstract_title',
'bibliography',
'cancelled',
'code',
'figure_legend_1',
'figure_legend_2',
'figure_title_1',
'figure_title_2',
'final_status',
'... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
764,
27773,
1330,
3424,
62,
5239,
198,
198,
37811,
5626,
1546,
198,
198,
12,
6060,
15180,
25,
198,
220,
220,
220,
37250,
397,
8709,... | 1.929178 | 353 |
from cleo import Command
from src.masonite.orm.migrations.Migration import Migration
class MigrateRollbackCommand(Command):
"""
Run migrations.
migrate:rollback
{--c|connection=default : The connection you want to run migrations on}
"""
| [
6738,
1190,
78,
1330,
9455,
198,
198,
6738,
12351,
13,
76,
888,
578,
13,
579,
13,
76,
3692,
602,
13,
44,
4254,
1330,
36991,
628,
198,
4871,
337,
42175,
26869,
1891,
21575,
7,
21575,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
... | 3.011364 | 88 |
import importlib
import logging
from collections import OrderedDict, defaultdict
from portfoliotool.utils.xmlutils import (
get_attribute, get_attributes, get_subnode, get_subnode_subnodes,
get_textnode
)
log = logging.getLogger(__name__)
| [
11748,
1330,
8019,
198,
11748,
18931,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
11,
4277,
11600,
198,
198,
6738,
2493,
9062,
5151,
970,
13,
26791,
13,
19875,
26791,
1330,
357,
198,
220,
220,
220,
651,
62,
42348,
11,
651,
62,
... | 2.942529 | 87 |
import pickle as pk
import sys
from ast import literal_eval
from datetime import datetime, timedelta
from threading import Thread
from urllib.error import URLError
from urllib.request import urlopen
import configuration as config
import logger
import requests
import tests
import utils
from flask import Flask, request
... | [
11748,
2298,
293,
355,
279,
74,
198,
11748,
25064,
198,
6738,
6468,
1330,
18875,
62,
18206,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
2956,
297,
571,
13,
18224,
1330,
37902,... | 2.662162 | 518 |
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
db = SQLAlchemy()
ma = Marshmallow()
from .user import User, UserSchema
from .sistema import Sistema, SistemaSchema
from .comando import Comando, ComandoSchema
from .blacklist_token import BlacklistToken, BlacklistTokenSchema | [
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
76,
5406,
42725,
1330,
9786,
42725,
198,
198,
9945,
796,
16363,
2348,
26599,
3419,
198,
2611,
796,
9786,
42725,
3419,
628,
198,
6738,
764,
7220,
1330,
1... | 3.406593 | 91 |
'''
Query Kowalski with cone searches centred
on CLU galaxies, searching for transients
given a set of constraints.
'''
def print_query_params(args):
'''Print a summary of the query parameters'''
print("#-----")
print("Cone search parameters:")
print(f"Search radius {args.radius} arcmin")
print(f... | [
7061,
6,
198,
20746,
509,
322,
874,
4106,
351,
27763,
15455,
1247,
445,
198,
261,
7852,
52,
27982,
11,
10342,
329,
1007,
2334,
198,
35569,
257,
900,
286,
17778,
13,
198,
7061,
6,
628,
198,
4299,
3601,
62,
22766,
62,
37266,
7,
22046,... | 2.017198 | 7,152 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Milan Ondrašovič <milan.ondrasovic@gmail.com>
#
# MIT License
#
# 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 w... | [
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,
201,
198,
2,
15069,
357,
66,
8,
33448,
21574,
440,
24631,
32790,
47297,
46195,
1279,
25433,
272,
13,
623... | 2.164215 | 4,963 |
# Copyright 2016 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.
from datetime import datetime
from gae_libs.testcase import TestCase
from libs import analysis_status
from model import result_status
from model import tri... | [
2,
15069,
1584,
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,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,
6738,... | 3.796992 | 133 |
from image_builder.api.service.image_builder_service import build_image
| [
6738,
2939,
62,
38272,
13,
15042,
13,
15271,
13,
9060,
62,
38272,
62,
15271,
1330,
1382,
62,
9060,
628,
628
] | 3.75 | 20 |
from pdb import set_trace as T
import numpy as np
from forge.blade.io import Action as Static
from forge.blade.io.action.node import NodeType
from forge.ethyr.io import utils
class ActionArgs:
'''An action argument pair'''
class Action:
'''IO class used for interacting with game actions
Used via .next to t... | [
6738,
279,
9945,
1330,
900,
62,
40546,
355,
309,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
28325,
13,
22500,
13,
952,
1330,
7561,
355,
36125,
198,
6738,
28325,
13,
22500,
13,
952,
13,
2673,
13,
17440,
1330,
19081,
6030,
198,... | 2.21773 | 2,053 |
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
357,
3826,
27975,
45761,
393,
3740,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
70,
489,
12,
18,
13,
... | 2.333333 | 51 |
import cmath
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import scipy.signal as signal
import csv
from .Periodogram import Periodogram
sns.set() | [
11748,
269,
11018,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
629,
541,
88,
13,
12683,
282,
355,
6737,
198,
11748,
269,
2137... | 3 | 58 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
| [
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,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 3.111111 | 45 |
print('hello\tworld')
print('hello\nworld')
print( len('hello world' ) )
print('hello world' [2])
my_letter_list = ['a', 'a', 'b','b', 'c']
print(my_letter_list)
print( set(my_letter_list) )
my_unique_letters = set(my_letter_list)
print(my_unique_letters)
print( len(my_unique_letters ) )
print('d' in my_uniq... | [
4798,
10786,
31373,
59,
4246,
1764,
11537,
198,
198,
4798,
10786,
31373,
59,
77,
6894,
11537,
198,
198,
4798,
7,
220,
18896,
10786,
31373,
995,
6,
220,
1267,
1267,
198,
198,
4798,
10786,
31373,
995,
6,
685,
17,
12962,
198,
198,
1820,
... | 2.469799 | 149 |
"""The builtin list implementation
Lists optimize their storage by holding certain primitive datatypes in
unwrapped form. For more information:
http://morepypy.blogspot.com/2011/10/more-compact-lists-with-list-strategies.html
"""
import operator
import sys
from rpython.rlib import debug, jit, rerased
from rpython.... | [
37811,
464,
3170,
259,
1351,
7822,
198,
198,
43,
1023,
27183,
511,
6143,
416,
4769,
1728,
20049,
4818,
265,
9497,
287,
198,
403,
29988,
1496,
1296,
13,
1114,
517,
1321,
25,
198,
198,
4023,
1378,
3549,
79,
4464,
88,
13,
35217,
13,
78... | 2.622015 | 2,680 |
from requests import post
from requests.auth import HTTPBasicAuth
| [
6738,
7007,
1330,
1281,
198,
6738,
7007,
13,
18439,
1330,
14626,
26416,
30515,
628
] | 4.785714 | 14 |
import datetime
import pygame
from mithril.controls.label import Label
from mithril.graphics.base_shapes import VerticalLine
from mithril.graphics.util_shapes import RoundedRectangle
DEFAULT_COLOR = (255, 255, 255)
DEFAULT_BORDER_COLOR = (181, 181, 181)
DEFAULT_HOVER_BORDER_COLOR = (3, 158, 211)
| [
11748,
4818,
8079,
198,
198,
11748,
12972,
6057,
198,
198,
6738,
285,
342,
22379,
13,
13716,
82,
13,
18242,
1330,
36052,
198,
6738,
285,
342,
22379,
13,
70,
11549,
13,
8692,
62,
1477,
7916,
1330,
38937,
13949,
198,
6738,
285,
342,
223... | 2.813084 | 107 |
'''
Created on Nov. 23, 2017
@author Andrew Habib
'''
'''
Currently, the spotbugs output files may contain
analysis results of more than one .java file.
This happens in cases where analyzed bug involves
more than one .java file.
'''
import json
import os
import sys
from xml.etree import cElementTree as ET
from... | [
7061,
6,
198,
198,
41972,
319,
5267,
13,
2242,
11,
2177,
198,
198,
31,
9800,
6858,
19654,
571,
198,
198,
7061,
6,
198,
198,
7061,
6,
198,
21327,
11,
262,
4136,
32965,
5072,
3696,
743,
3994,
220,
198,
20930,
2482,
286,
517,
621,
53... | 2.537079 | 445 |
import boto3
import json
import re
import requests
from yig.bot import listener, RE_MATCH_FLAG
import yig.config
@listener(r"history.<(https.*)>", RE_MATCH_FLAG)
def show_history(bot):
""":bookmark_tabs: *history chara session*
`/cc history YOUR_CHARACTER_SHEET_URL`
"""
matcher = re.match(r".*<(https.*)>"... | [
11748,
275,
2069,
18,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
7007,
198,
6738,
331,
328,
13,
13645,
1330,
24783,
11,
4526,
62,
44,
11417,
62,
38948,
198,
198,
11748,
331,
328,
13,
11250,
198,
198,
31,
4868,
877,
7,
81,
1,
... | 2.293839 | 211 |
import os
nome_arq = input()
arq = open(nome_arq, 'r')
for i in arq.readlines():
file_name = i.strip('\n').split(' ')
for j in file_name:
if os.path.exists(j):
print(j)
arq.close()
# print(file_name)
# file = open(file, 'r')
# if
# print(arq.readlines()) | [
11748,
28686,
198,
198,
77,
462,
62,
283,
80,
796,
5128,
3419,
198,
198,
283,
80,
796,
1280,
7,
77,
462,
62,
283,
80,
11,
705,
81,
11537,
198,
198,
1640,
1312,
287,
610,
80,
13,
961,
6615,
33529,
198,
220,
220,
220,
2393,
62,
... | 1.91875 | 160 |
import tweepy
from autenticadores import google_api_auth
from random import choice
import gspread
# TODO remover (?)
def google_sshet():
"""
Função simples para retornar um objeto capaz de manipular as planilhas do Google Sheets.
"""
session = google_api_auth()
ggle_cred = gspread.Client(None, sess... | [
11748,
4184,
538,
88,
198,
6738,
1960,
298,
291,
324,
2850,
1330,
23645,
62,
15042,
62,
18439,
198,
6738,
4738,
1330,
3572,
198,
11748,
308,
43639,
198,
198,
2,
16926,
46,
816,
2502,
357,
10091,
198,
4299,
23645,
62,
824,
3202,
33529,... | 2.398148 | 540 |
from sql_alchemy_db_instance import db
import pandas as pd
import sqlite3
from sqlalchemy import Column, Integer, Float
import pandas as pd
import numpy as np
from pandas import DataFrame
from flask_sqlalchemy import SQLAlchemy
| [
6738,
44161,
62,
282,
26599,
62,
9945,
62,
39098,
1330,
20613,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
44161,
578,
18,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
48436,
198,
11748,
19798,
292,
355,
279,
67,
19... | 3.171053 | 76 |
#!/usr/bin/env python3
'''Sphinx documentation builder configuration file.
For a full list of options see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
'''
import eminus
project = 'eminus'
author = 'Wanja Timm Schulze'
copyright = '2021-2022, Wanja Timm Schulze'
version = eminus.__v... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
7061,
6,
50,
746,
28413,
10314,
27098,
8398,
2393,
13,
198,
198,
1890,
257,
1336,
1351,
286,
3689,
766,
262,
10314,
25,
198,
5450,
1378,
2503,
13,
82,
746,
28413,
12,
15390,
13,
... | 2.158038 | 1,101 |
n = int(input())
nh = int(input())
vh = float(input())
sal = nh * vh
print(f'NUMBER = {n}')
print(f'SALARY = U$ {sal:.2f}')
| [
77,
796,
493,
7,
15414,
28955,
201,
198,
77,
71,
796,
493,
7,
15414,
28955,
201,
198,
85,
71,
796,
12178,
7,
15414,
28955,
201,
198,
21680,
796,
299,
71,
1635,
410,
71,
201,
198,
4798,
7,
69,
6,
41359,
13246,
796,
1391,
77,
92,
... | 1.911765 | 68 |
import jwt
from ...ports.providers import JwtProvider
| [
11748,
474,
46569,
198,
6738,
2644,
3742,
13,
15234,
4157,
1330,
449,
46569,
29495,
628
] | 3.666667 | 15 |
from invoke import task
from subprocess import run
from tasks.util.env import (
KUBECTL_BIN,
PROJ_ROOT,
)
@task
def uninstall(ctx):
"""
Uninstall uk8s
"""
rm_cmd = "sudo snap remove microk8s"
print(rm_cmd)
run(rm_cmd, shell=True, check=True)
@task
def reset(ctx):
"""
Reset t... | [
6738,
26342,
1330,
4876,
198,
6738,
850,
14681,
1330,
1057,
198,
198,
6738,
8861,
13,
22602,
13,
24330,
1330,
357,
198,
220,
220,
220,
509,
10526,
9782,
43,
62,
33,
1268,
11,
198,
220,
220,
220,
21965,
41,
62,
13252,
2394,
11,
198,
... | 2.435798 | 514 |
import numpy as np
from _main_decision._helper_functions.log_sum_exp import log_sum_exp
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4808,
12417,
62,
12501,
1166,
13557,
2978,
525,
62,
12543,
2733,
13,
6404,
62,
16345,
62,
11201,
1330,
2604,
62,
16345,
62,
11201,
628,
628
] | 2.787879 | 33 |
from .. import base
class VolumeType(base.Resource):
"""A Volume Type is the type of volume to be created."""
class VolumeTypeManager(base.ManagerWithFind):
"""Manage :class:`VolumeType` resources."""
resource_class = VolumeType
def list(self, search_opts=None, is_public=True):
"""Lists all... | [
6738,
11485,
1330,
2779,
628,
198,
4871,
14701,
6030,
7,
8692,
13,
26198,
2599,
198,
220,
220,
220,
37227,
32,
14701,
5994,
318,
262,
2099,
286,
6115,
284,
307,
2727,
526,
15931,
628,
198,
4871,
14701,
6030,
13511,
7,
8692,
13,
13511,... | 2.427807 | 374 |
import httplib2
import json
import sys
if __name__== '__main__':
print("Running Endpoint Tester....\n")
address = input("Please enter the address of the server ou want to access!")
if address == '':
address = 'http://localhost:5000'
print("Making the GET Request for /puppies...")... | [
11748,
1841,
489,
571,
17,
201,
198,
11748,
33918,
201,
198,
11748,
25064,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
855,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
3601,
7203,
28768,
5268,
4122,
309,
7834,
1106,... | 2.196929 | 1,498 |
import pynvim
import todoist
from dateutil.parser import parse
from datetime import datetime, time, timezone
from dateutil.tz import tzlocal
@pynvim.plugin
| [
11748,
279,
2047,
31124,
198,
11748,
284,
4598,
396,
198,
6738,
3128,
22602,
13,
48610,
1330,
21136,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
640,
11,
640,
11340,
198,
6738,
3128,
22602,
13,
22877,
1330,
256,
89,
12001,
628,
198,
... | 3.291667 | 48 |
# Copyright (c) 2022 PaddlePaddle 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 required by app... | [
2,
220,
220,
15069,
357,
66,
8,
33160,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
33876,
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,
... | 2.308315 | 4,197 |
"""Hackerrank Problem: https://www.hackerrank.com/challenges/np-min-and-max/problem
Task
You are given a 2-D array with dimensions N x M.
Your task is to perform the min function over axis 1 and then find the max of that.
"""
import numpy
n, m = map(int, input().split(' '))
array = []
for _ in range(n):
a = lis... | [
37811,
32833,
8056,
962,
20647,
25,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
37659,
12,
1084,
12,
392,
12,
9806,
14,
45573,
198,
198,
25714,
198,
198,
1639,
389,
1813,
257,
362,
12,
35,
7177,
351,
15225... | 2.751592 | 157 |
# Generated by Django 2.1.1 on 2018-10-03 03:16
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
16,
319,
2864,
12,
940,
12,
3070,
7643,
25,
1433,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Copyright (c) 2019 Lukas Koschmieder
import asyncio
from bqplot import Axis, Figure, LinearScale, Lines, Toolbar
from ipywidgets import Label, HBox, VBox
import logging
module_logger = logging.getLogger(__name__)
module_logger.setLevel(logging.INFO)
module_logger.addHandler(logging.StreamHandler())
| [
2,
15069,
357,
66,
8,
13130,
28102,
292,
18884,
354,
76,
798,
263,
198,
198,
11748,
30351,
952,
198,
6738,
275,
80,
29487,
1330,
38349,
11,
11291,
11,
44800,
29990,
11,
26299,
11,
16984,
5657,
198,
6738,
20966,
88,
28029,
11407,
1330,... | 3.070707 | 99 |
"""The code template to supply to the front end. This is what the user will
be asked to complete and submit for grading.
Do not include any imports.
This is not a REPL environment so include explicit 'print' statements
for any outputs you want to be displayed back to the user.
Use triple single q... | [
37811,
464,
2438,
11055,
284,
5127,
284,
262,
2166,
886,
13,
770,
318,
644,
262,
2836,
481,
198,
220,
220,
220,
307,
1965,
284,
1844,
290,
9199,
329,
43165,
13,
628,
220,
220,
220,
2141,
407,
2291,
597,
17944,
13,
628,
220,
220,
2... | 2.705446 | 404 |
try:
# Use internal aplpy
from .my_aplpy import *
except ImportError:
# Try and load the aplpy from the environment
from aplpy import *
| [
28311,
25,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
5765,
5387,
257,
489,
9078,
198,
220,
220,
220,
220,
198,
220,
220,
220,
422,
764,
1820,
62,
64,
489,
9078,
1330,
1635,
198,
220,
220,
220,
220,
198,
16341,
17267,
1233... | 2.263158 | 76 |
# Number Of Islands
if __name__ == "__main__":
sol = Solution()
grid = [
["1","1","0","0","0"],
["1","1","0","0","0"],
["0","0","1","0","0"],
["0","0","0","1","1"]
]
print(sol.numIslands(grid))
| [
2,
7913,
3226,
12010,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1540,
796,
28186,
3419,
198,
220,
220,
220,
10706,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.774834 | 151 |
#-*- coding: utf-8 -*-
#!/usr/bin/python3
#!/Author : Gibartes
from moduleInterface.defines import *
from moduleInterface.interface import ModuleComponentInterface
#from defines import *
#from interface import ModuleComponentInterface
from structureReader import structureReader as sr
#from structure... | [
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
48443,
13838,
1058,
12488,
433,
274,
198,
198,
6738,
8265,
39317,
13,
4299,
1127,
220,
220,
1330,
1635,
198,... | 2.46169 | 509 |
#!/usr/bin/env python
# Filename: rm_unCompleted_task
"""
introduction:
authors: Huang Lingcao
email:huanglingcao@gmail.com
add time: 16 October, 2019
"""
import os
dir = 'multi_inf_results'
for i in range(0,78):
if os.path.isfile(os.path.join(dir,str(i)+'.txt')):
if os.path.isfile(os.path.join(dir,str(i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
7066,
12453,
25,
42721,
62,
403,
43768,
62,
35943,
220,
198,
37811,
198,
27427,
596,
25,
198,
198,
41617,
25,
31663,
25116,
66,
5488,
198,
12888,
25,
13415,
27499,
66,
5488,
31,
1... | 2.164063 | 256 |
from allauth.account.adapter import DefaultAccountAdapter
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount import signals
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from allauth.socialaccount.models import SocialLogin
from django.conf import settings
from django... | [
6738,
477,
18439,
13,
23317,
13,
324,
3429,
1330,
15161,
30116,
47307,
198,
6738,
477,
18439,
13,
1069,
11755,
1330,
1846,
13857,
43481,
31077,
198,
6738,
477,
18439,
13,
14557,
23317,
1330,
10425,
198,
6738,
477,
18439,
13,
14557,
23317,... | 3.845679 | 162 |
"""
"""
from datetime import datetime
from typing import Optional
from bs4 import BeautifulSoup
import dateutil.parser
from pastebin_crawler.helpers import remove_beginning_slash_from_str
from pastebin_crawler.helpers.constants import Urls, PostDivName
from pastebin_crawler.services import BaseCrawlerService
| [
37811,
198,
198,
37811,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
3128,
22602,
13,
48610,
198,
198,
6738,
1613,
23497,
62,
66,
39464,
13,
1... | 3.488889 | 90 |
#!/usr/bin/python
import sys
import glob
################################################################################
# Fake Comport + Arduino simulation
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
25064,
198,
11748,
15095,
628,
198,
29113,
29113,
14468,
198,
2,
33482,
955,
634,
1343,
27634,
18640,
198
] | 5.75 | 28 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
| [
2220,
7203,
31,
65,
41319,
62,
31391,
1003,
31391,
14,
11249,
62,
4299,
82,
14,
260,
7501,
25,
4023,
13,
65,
48274,
1600,
366,
4023,
62,
17474,
4943,
198
] | 2.37931 | 29 |
# Boletim com listas compostas
'''Crie um programa que leia NOME e DUAS
NOTAS de vários alunos e guarde tudo em
uma LISTA COMPOSTA. No final, mostre um
BOLETIM contendo a MÉDIA de cada um e
permita que o usuário possa mostrar as
NOTAS de cada aluno individualmente'''
lista = []
while True:
alunos = []
notas = ... | [
2,
3248,
1616,
320,
401,
1351,
292,
36541,
292,
198,
7061,
6,
34,
5034,
23781,
1430,
64,
8358,
443,
544,
399,
13649,
304,
35480,
1921,
198,
11929,
1921,
390,
410,
6557,
380,
418,
435,
403,
418,
304,
4860,
68,
256,
12003,
795,
198,
... | 2.028481 | 632 |
# -*- coding: utf-8 -*-
'''
Functions to work with JSON
'''
from __future__ import absolute_import, unicode_literals
# Import Python libs
import json # future lint: blacklisted-module
import logging
# Import Salt libs
import salt.utils.data
import salt.utils.stringutils
# Import 3rd-party libs
from salt.ext import... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
24629,
2733,
284,
670,
351,
19449,
198,
7061,
6,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
198,
2,
... | 2.629357 | 1,492 |
from functools import wraps
from flask import session, url_for, redirect, request
__author__ = 'ibininja'
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
6738,
42903,
1330,
6246,
11,
19016,
62,
1640,
11,
18941,
11,
2581,
198,
198,
834,
9800,
834,
796,
705,
571,
259,
259,
6592,
6,
198
] | 3.272727 | 33 |
import copy
from hex_walker_constants import TIP_SERVO, MID_SERVO, ROT_SERVO, WAIST_SERVO
# NOTE: these values are ANGLES not raw pwms
# thing.rot_servo and thing.list[ROT_SERVO] are synonymous/aliases that point to the same underlying data, for both read/write
# TODO: remove normal/crouch version and make them deri... | [
11748,
4866,
198,
6738,
17910,
62,
20783,
62,
9979,
1187,
1330,
309,
4061,
62,
35009,
29516,
11,
25269,
62,
35009,
29516,
11,
371,
2394,
62,
35009,
29516,
11,
16400,
8808,
62,
35009,
29516,
198,
198,
2,
24550,
25,
777,
3815,
389,
3537... | 2.150561 | 2,763 |
""" script.py
"""
import http.server
import socketserver
from pyfiguration import conf
# Create a request handler
Handler = http.server.SimpleHTTPRequestHandler
@conf.addIntField(
field="server.port",
description="The port on which the server will start",
default=8000,
minValue=80,
maxValue=999... | [
37811,
4226,
13,
9078,
198,
37811,
198,
11748,
2638,
13,
15388,
198,
11748,
37037,
18497,
198,
198,
6738,
12972,
5647,
3924,
1330,
1013,
628,
198,
2,
13610,
257,
2581,
21360,
198,
25060,
796,
2638,
13,
15388,
13,
26437,
40717,
18453,
25... | 3.02439 | 123 |
from ..utils.database import db
from marshmallow_sqlalchemy import ModelSchema
from marshmallow import fields
| [
6738,
11485,
26791,
13,
48806,
1330,
20613,
198,
6738,
22397,
42725,
62,
25410,
282,
26599,
1330,
9104,
27054,
2611,
198,
6738,
22397,
42725,
1330,
7032,
628,
198
] | 4.148148 | 27 |
from django.test import TestCase
from ..templatetags.freight_filters import formatnumber, power10
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
11485,
11498,
489,
265,
316,
3775,
13,
19503,
432,
62,
10379,
1010,
1330,
5794,
17618,
11,
1176,
940,
628
] | 3.333333 | 30 |
import urllib.request
import json
from .models import Source,Article
#getting api key
api_key = None
#getting news base url
base_url = None
articles_url = None
def get_source(category):
'''
Function that gets json response to our url request
'''
get_source_url = base_url.format(category,api_key)
... | [
11748,
2956,
297,
571,
13,
25927,
198,
11748,
33918,
198,
6738,
764,
27530,
1330,
8090,
11,
14906,
628,
628,
198,
198,
2,
37210,
40391,
1994,
198,
15042,
62,
2539,
796,
6045,
198,
198,
2,
37210,
1705,
2779,
19016,
198,
8692,
62,
6371,... | 2.613139 | 822 |
#!/usr/bin/env python3
# Write a program that simulates random read coverage over a chromosome
# Report min, max, and average coverage
# Make variables for genome size, read number, read length
# Input values from the command line
# Note that you will not sample the ends of a chromosome very well
# So don't count the ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
19430,
257,
1430,
326,
985,
15968,
4738,
1100,
5197,
625,
257,
34348,
198,
2,
6358,
949,
11,
3509,
11,
290,
2811,
5197,
198,
2,
6889,
9633,
329,
19270,
2546,
11,
1100,
... | 2.71875 | 352 |
from twilio.rest import Client
from src.variables.config import *
| [
198,
6738,
665,
346,
952,
13,
2118,
1330,
20985,
198,
6738,
12351,
13,
25641,
2977,
13,
11250,
1330,
1635,
198
] | 3.35 | 20 |
#link https://practice.geeksforgeeks.org/problems/job-sequencing-problem-1587115620/1#
def JobScheduling(Jobs,n):
'''
:param Jobs: list of "Job" class defined in driver code, with "profit" and "deadline".
:param n: total number of jobs
:return: A list of size 2 having list[0] = count of jobs and list[1... | [
2,
8726,
3740,
1378,
39541,
13,
469,
2573,
30293,
2573,
13,
2398,
14,
1676,
22143,
14,
21858,
12,
3107,
9532,
12,
45573,
12,
1314,
5774,
1157,
3980,
1238,
14,
16,
2,
198,
198,
4299,
15768,
50,
1740,
16619,
7,
41,
8158,
11,
77,
259... | 2.033898 | 767 |
import inception_v3
if __name__ == '__main__':
model = inception_v3.InceptionV3('imagenet_test_lmdb', 'imagenet_train_lmdb', 1000)
train_proto = model.inception_v3_proto(64)
test_proto = model.inception_v3_proto(64, phase='TEST')
save_proto(train_proto, 'imagenet_train.prototxt')
save_proto(tes... | [
11748,
30839,
62,
85,
18,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2746,
796,
30839,
62,
85,
18,
13,
818,
4516,
53,
18,
10786,
320,
11286,
316,
62,
9288,
62,
75,
9132,
65,
3256,
... | 2.261146 | 157 |
# based on the keras documentation
#
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Conv1D,Activation
from keras import losses, optimizers
import keras.utils as keras_utils
import json
f = open('data_for_everything')
j = json.load(f)
# our parameters
nn_input_size = len(j[0][... | [
198,
2,
1912,
319,
262,
41927,
292,
10314,
198,
2,
220,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
11,
34872,
16,
35,
11,
25526,
341... | 2.539913 | 689 |
#
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
#
import argparse
from unet3 import cross_entropy_balanced
import tensorflow.keras.backend as K
from keras.models import load_model
from keras.layers import *
from tensorflow.python.framework import graph_io
from tensorflow.python.framewor... | [
2,
198,
2,
15069,
357,
34,
8,
33448,
8180,
10501,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
198,
2,
198,
11748,
1822,
29572,
198,
6738,
555,
316,
18,
1330,
3272,
62,
298,
28338,
62,
27753,... | 2.597246 | 581 |
import ast
import collections
import contextlib
import enum
from functools import partial
from functools import wraps
import inspect
from inspect import BoundArguments
import re
import sys
import textwrap
import traceback
import types
from dataclasses import dataclass
from dataclasses import replace
from typing import ... | [
11748,
6468,
198,
11748,
17268,
198,
11748,
4732,
8019,
198,
11748,
33829,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
11748,
10104,
198,
6738,
10104,
1330,
30149,
28100,
2886,
198,
11748,
302,
... | 3.100299 | 1,675 |
import botutils
import intutils
import sbotutils
if __name__=="__main__":
pass | [
11748,
10214,
26791,
198,
11748,
493,
26791,
198,
11748,
264,
13645,
26791,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
1208
] | 2.862069 | 29 |
MEAN = {"imagenet": [0.485, 0.456, 0.406], "cifar": [0.4914, 0.4822, 0.4465]}
STD = {"imagenet": [0.229, 0.224, 0.225], "cifar": [0.2023, 0.1994, 0.2010]}
WEIGHT_DECAY = 2e-4
LABEL_SMOOTH = 2e-1
| [
11682,
1565,
796,
19779,
320,
11286,
316,
1298,
685,
15,
13,
32642,
11,
657,
13,
29228,
11,
657,
13,
29703,
4357,
366,
66,
361,
283,
1298,
685,
15,
13,
2920,
1415,
11,
657,
13,
2780,
1828,
11,
657,
13,
2598,
2996,
48999,
198,
3214... | 1.824074 | 108 |
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework import status
impor... | [
6738,
1334,
62,
30604,
13,
41299,
3299,
1330,
23575,
47649,
3299,
11,
14392,
47649,
3299,
198,
6738,
1334,
62,
30604,
13,
1069,
11755,
1330,
2448,
3411,
21306,
798,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62... | 3.780488 | 205 |
"""
the Runner class has two main functions
1 - keeping track of episode rewards
2 - logging reward info to tensorboard
3 - saving reward history to csv
"""
import csv
import logging
import numpy as np
import tensorflow as tf
logger = logging.getLogger(__name__)
class Runner(object):
"""
Giving the runner... | [
37811,
198,
1169,
21529,
1398,
468,
734,
1388,
5499,
198,
16,
532,
5291,
2610,
286,
4471,
11530,
198,
17,
532,
18931,
6721,
7508,
284,
11192,
273,
3526,
198,
18,
532,
8914,
6721,
2106,
284,
269,
21370,
198,
37811,
198,
198,
11748,
269... | 3.447154 | 123 |
from locators import Alert as AL
| [
6738,
1179,
2024,
1330,
23276,
355,
8355,
198
] | 4.125 | 8 |
import requests
import re
import pymysql
from pyecharts import Bar, Pie, Bar3D
from lotterymodel import PeriodModel,WinningNumberModel,SalesInfoModel
# 解析开奖信息Html
# parsePage()
# 以Pie的方式展示每个数字的频率
analysisFrequency_Pie3D() | [
171,
119,
123,
11748,
7007,
198,
11748,
302,
198,
11748,
279,
4948,
893,
13976,
198,
6738,
12972,
3055,
5889,
1330,
2409,
11,
21690,
11,
2409,
18,
35,
198,
6738,
22098,
19849,
1330,
18581,
17633,
11,
16643,
768,
15057,
17633,
11,
44490,... | 2.036364 | 110 |
import torch
from torch import nn
from backbone.drn.drn import drn_a_50
if __name__ == "__main__":
conv_list = Backbone_DRNA50_in3(in_C=3)
x = torch.randn((1, 3, 320, 320))
# torch.Size([1, 3, 320, 320])
# torch.Size([1, 64, 160, 160])
# torch.Size([1, 256, 80, 80])
# torch.Size([1, 512, 40,... | [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
198,
6738,
32774,
13,
7109,
77,
13,
7109,
77,
1330,
1553,
77,
62,
64,
62,
1120,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3063,
... | 2.097222 | 216 |
import unittest
from unittest.mock import patch
from common.codebuild import CodeBuild
from common.exceptions import CodeBuildProjectNotFound
| [
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
2219,
13,
8189,
11249,
1330,
6127,
15580,
198,
6738,
2219,
13,
1069,
11755,
1330,
6127,
15580,
16775,
3673,
21077,
628
] | 3.891892 | 37 |
from db.models.build_jobs import BuildJob
builds = BuildJob.objects.select_related(
'status',
)
builds = builds.prefetch_related(
'user',
'project',
'project__user',
)
builds_details = builds.select_related('code_reference')
| [
6738,
20613,
13,
27530,
13,
11249,
62,
43863,
1330,
10934,
33308,
198,
198,
11249,
82,
796,
10934,
33308,
13,
48205,
13,
19738,
62,
5363,
7,
198,
220,
220,
220,
705,
13376,
3256,
198,
8,
198,
11249,
82,
796,
12188,
13,
3866,
69,
756... | 2.730337 | 89 |
# Import Python Libs
from __future__ import absolute_import
import logging
# Local imports
from . import utils
from . import util_which
log = logging.getLogger(__name__)
init_types_available = set([ "systemd" , "sysV"])
class init_exception(Exception):
"""Base class for exceptions in this module."""
pass... | [
2,
17267,
11361,
7980,
82,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
18931,
198,
198,
2,
10714,
17944,
198,
6738,
764,
1330,
3384,
4487,
198,
6738,
764,
1330,
7736,
62,
4758,
628,
198,
6404,
796,
18931,
13,
1136... | 3.109649 | 228 |
"""Config flow to configure Google Hangouts."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import callback
from .const import CONF_2FA, CONF_REFRESH_TOKEN, DOMAIN as HANGOUTS_DOMAIN
@callback
def configured_hang... | [
37811,
16934,
5202,
284,
17425,
3012,
24300,
5269,
526,
15931,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
198,
6738,
1363,
562,
10167,
1330,
4566,
62,
298,
1678,
198,
6738,
1363,
562,
10167,
13,
9979,
1330,
7102,
37,
62,
27630,
4146... | 1.943387 | 1,996 |
from google.appengine.api import xmpp
from google.appengine.api import users
PONDER_MSG = "Hmm. Let me think on that a bit."
TELLME_MSG = "While I'm thinking, perhaps you can answer me this: %s"
SOMEONE_ANSWERED_MSG = ("We seek those who are wise and fast. One out of two "
"is not enough. Anoth... | [
6738,
23645,
13,
1324,
18392,
13,
15042,
1330,
2124,
76,
381,
198,
6738,
23645,
13,
1324,
18392,
13,
15042,
1330,
2985,
198,
198,
47,
1340,
14418,
62,
5653,
38,
796,
366,
44217,
13,
3914,
502,
892,
319,
326,
257,
1643,
526,
198,
932... | 2.667532 | 385 |
import argparse
import os
import numpy as np
import tensorflow as tf
from data import get_split
from model import TinySleepNet
from minibatching import batch_generator
from config import config
def compute_performance(cm):
"""Computer performance metrics from confusion matrix.
It computers performance metrics ... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
1366,
1330,
651,
62,
35312,
198,
6738,
2746,
1330,
20443,
40555,
7934,
198,
6738,
949,
571,
19775,
1330,
1545... | 2.516304 | 552 |
import numpy as np
from mantraml.data import TabularDataset
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
24818,
859,
75,
13,
7890,
1330,
16904,
934,
27354,
292,
316,
198
] | 3.05 | 20 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
_SimFlowEnergyTransfer_ConvectiveHeater_Radiant_Wa... | [
2,
770,
2393,
373,
6338,
7560,
416,
12672,
3528,
357,
4023,
1378,
2503,
13,
2032,
328,
13,
2398,
737,
198,
2,
10628,
513,
13,
15,
13,
22,
198,
2,
198,
2,
2141,
407,
787,
2458,
284,
428,
2393,
4556,
345,
760,
644,
345,
389,
1804,... | 3.104628 | 497 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Data module for importing and cleaning data sets.
Import / download / cache datasets in `download` module.
Get and filter sample in `sample` module.
"""
| [
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,
37811,
201,
198,
6601,
8265,
329,
33332,
290,
12724,
1366,
5621,
13,
201,
198,
201,
198,
20939,
1220,
4321,
... | 3.028571 | 70 |
"""
Downloads the latest version of the vendor dependences, and replaces all copies of them in the repository
"""
import os
import shutil
import tempfile
from urllib.request import urlopen, Request
from libraries.scripts.updater.utils import walk_with_blacklist
from libraries.scripts.git.git_python_wrappers import comm... | [
37811,
198,
10002,
82,
262,
3452,
2196,
286,
262,
18371,
4745,
3007,
11,
290,
24020,
477,
9088,
286,
606,
287,
262,
16099,
198,
37811,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
6738,
2956,
297,
571,
13,
2... | 3.282609 | 138 |
import asyncio
from unsync import unsync
from codetiming import Timer
import time
# unsync
# Unsynchronize asyncio by using an ambient event loop, or executing in separate threads or processes.
#
# Quick Overview
# Functions marked with the @unsync decorator will behave in one of the following ways:
#
# async functio... | [
11748,
30351,
952,
198,
198,
6738,
555,
27261,
1330,
555,
27261,
198,
6738,
14873,
316,
320,
278,
1330,
5045,
263,
198,
11748,
640,
198,
198,
2,
555,
27261,
198,
2,
791,
28869,
11413,
1096,
30351,
952,
416,
1262,
281,
25237,
1785,
905... | 3.295991 | 848 |
"""The Player class stores all the functions and data related to the Player."""
from pygame import Rect
| [
37811,
464,
7853,
1398,
7000,
477,
262,
5499,
290,
1366,
3519,
284,
262,
7853,
526,
15931,
198,
198,
6738,
12972,
6057,
1330,
48599,
628,
198
] | 4.28 | 25 |
"""
"""
# Imports from libraries
from datetime import datetime
import os
import pickle
from pytups import SuperDict, TupList
from typing import Dict, Tuple
# Imports from cornflow libraries
from cornflow_client import InstanceCore
from cornflow_client.core.tools import load_json
# Imports from internal modules
from ... | [
37811,
198,
198,
37811,
198,
2,
1846,
3742,
422,
12782,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
12972,
83,
4739,
1330,
3115,
35,
713,
11,
49595,
8053,
198,
6738,
19720,
1330,
360,
... | 2.828729 | 181 |
# -*- coding: utf-8 -*-
a = 'Formulário de Login, "LogForm v0.3"'
print(f'{a:^59}')
print('#'*59)
usuarios = []
senhas = []
while True:
if not usuarios:
print('Não há usuários registrados anteriormente.\nRegistre um novo usuário!\n')
print('Registrar novo usuário?\n\t1 - SIM\n\t2 - NÃO\n\t')
se = str(input('>... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
64,
796,
705,
8479,
377,
6557,
27250,
390,
23093,
11,
366,
11187,
8479,
410,
15,
13,
18,
30543,
198,
4798,
7,
69,
6,
90,
64,
25,
61,
3270,
92,
11537,
198,
4798,
10... | 1.983498 | 303 |
#
# gemini_python
#
# primitives_ghost_spect.py
# ------------------------------------------------------------------------------
import os
import numpy as np
import math
from copy import deepcopy
import... | [
2,
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,
220,
220,
220,
220,
220,
... | 1.970621 | 58,580 |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin developers
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""
This test checks the behaviour of P2SH before and after genesis.
"""
from test_framework.test_framework import Compariso... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
2177,
383,
6185,
6505,
198,
2,
15069,
357,
66,
8,
13130,
6185,
5396,
198,
2,
4307,
6169,
739,
262,
4946,
24218,
53,
3788,
5964,
11,
766,
262,
19249,
2393,... | 3.630499 | 341 |
import os
from os import listdir
from os.path import isfile, join
import re
from path import Path
import numpy as np
import pandas as pd
from poor_trader import utils
from poor_trader.utils import quotes_range
from poor_trader.config import INDICATORS_OUTPUT_PATH
def SMMA(series, window=14):
""... | [
11748,
28686,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
28686,
13,
6978,
1330,
318,
7753,
11,
4654,
198,
11748,
302,
198,
6738,
3108,
1330,
10644,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,... | 2.30192 | 573 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Programme de vérification des référentiels AMELi
"""
__author__ = 'Frederic Laurent'
__version__ = "1.1"
__copyright__ = 'Copyright 2017, Frederic Laurent'
__license__ = "MIT"
import json
import logging
import os.path
from easy_atom import helpers
class Versio... | [
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,
220,
220,
220,
35232,
390,
410,
2634,
38763,
748,
40560,
69,
2634,
1156,
72,
1424,
3001,
3698,
72,
19... | 2.374611 | 1,284 |
from hypothesis import HealthCheck
from hypothesis import given, settings
from hypothesis.extra import numpy as hnp
from pytiff import *
import hypothesis.strategies as st
import numpy as np
import pytest
import subprocess
import tifffile
from skimage.data import coffee
# scanline integer tests
@settings(buffer_size=... | [
6738,
14078,
1330,
3893,
9787,
198,
6738,
14078,
1330,
1813,
11,
6460,
198,
6738,
14078,
13,
26086,
1330,
299,
32152,
355,
289,
37659,
198,
6738,
12972,
83,
733,
1330,
1635,
198,
11748,
14078,
13,
2536,
2397,
444,
355,
336,
198,
11748,
... | 2.420716 | 782 |
"""Motif object definition.
A single Motif object stores important values, used during the following steps of
GRAFIMO's analysis, such as motif PSSM, p-value matrix, scaling factor, offset,
motif information, etc.
"""
from grafimo.GRAFIMOException import NotValidMotifMatrixException, \
NoDataFrameException, Wro... | [
37811,
47733,
361,
2134,
6770,
13,
198,
198,
32,
2060,
6543,
361,
2134,
7000,
1593,
3815,
11,
973,
1141,
262,
1708,
4831,
286,
220,
198,
38,
3861,
37,
3955,
46,
338,
3781,
11,
884,
355,
32702,
350,
5432,
44,
11,
279,
12,
8367,
175... | 2.695442 | 1,865 |