content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import logging
from abc import ABC, abstractmethod
import numpy as np
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import KFold
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
class Predictor(ABC):
"""
TODO:
"... | [
11748,
18931,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
1612,
62,
16485,
1144,
62,
18224,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
161... | 3.016529 | 121 |
import pytest
from odoo import exceptions
from pytest_tr_odoo.fixtures import env
from pytest_tr_odoo import utils
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
'''
openacademy.openacademy
'''
@pytest.mark.parametrize('test_input,expected', [
({'first_name': 'Kyle', 'last_name': 'Bogan'... | [
11748,
12972,
9288,
198,
6738,
16298,
2238,
1330,
13269,
198,
6738,
12972,
9288,
62,
2213,
62,
375,
2238,
13,
69,
25506,
1330,
17365,
198,
6738,
12972,
9288,
62,
2213,
62,
375,
2238,
1330,
3384,
4487,
628,
198,
31,
9078,
9288,
13,
69,... | 2.114602 | 1,719 |
# Generated by Django 2.2.8 on 2020-04-13 03:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
23,
319,
12131,
12,
3023,
12,
1485,
7643,
25,
2598,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14... | 3.019231 | 52 |
__all__ = ['get_fundamentus','print_csv']
from fundamentus import get_fundamentus
from fundamentus import print_csv
| [
198,
834,
439,
834,
796,
37250,
1136,
62,
10990,
3263,
385,
41707,
4798,
62,
40664,
20520,
198,
198,
6738,
14387,
385,
220,
1330,
651,
62,
10990,
3263,
385,
198,
6738,
14387,
385,
220,
1330,
3601,
62,
40664,
628,
198
] | 3.128205 | 39 |
"""
# Copyright 2022 Red Hat
#
# 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 agr... | [
37811,
198,
2,
220,
220,
220,
15069,
33160,
2297,
10983,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
284... | 2.584283 | 1,667 |
import webbrowser, os, tempfile, io, sys, time
import glob, shutil
import warnings
warnings.simplefilter('ignore')
import flask
from flask import Flask, escape, request
import processing
#need to import all the packages here in the main file because of dill-ed ipython model
import tensorflow as tf
import... | [
11748,
3992,
40259,
11,
28686,
11,
20218,
7753,
11,
33245,
11,
25064,
11,
640,
201,
198,
11748,
15095,
11,
4423,
346,
201,
198,
11748,
14601,
201,
198,
40539,
654,
13,
36439,
24455,
10786,
46430,
11537,
201,
198,
201,
198,
11748,
42903,... | 2.302096 | 811 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import shutil
import logging
import re
from datetime import datetime
from vilya.config import DOMAIN, DEVELOP_MODE
from vilya.libs import gyt
from vilya.libs.permdir import get_repo_root
from vilya.libs.text import format_md_or_rst
from vilya.lib... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
18931,
198,
11748,
302,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,... | 2.75793 | 599 |
### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | [
21017,
347,
43312,
38644,
38559,
24290,
9878,
11290,
46424,
198,
2,
198,
2,
220,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
198,
2,
220,
13096,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
13789,
... | 3.121359 | 412 |
import torch
from torch.utils import data
import numpy as np
import matplotlib.pyplot as plt
import os
import pickle
from pathlib import Path
import argparse
import convolutional_model as cm
import skimage as ski
import math
DATA_DIR = default_data_dir = Path(__file__).parent / 'data' / 'cifar-10-batches-py'
im... | [
11748,
28034,
198,
6738,
28034,
13,
26791,
1330,
1366,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
3108,
8019,
1330,
10644,
198,
... | 2.452143 | 1,400 |
# Generated by Django 3.1.7 on 2021-05-07 11:20
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
2713,
12,
2998,
1367,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
if __name__ == "__main__":
s = Stack()
s.push(1)
s.push(2)
print(s.top())
s.push(5)
print(s.size())
print(s.toString())
s.pop()
print(s.toString())
print(s.size())
| [
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
264,
796,
23881,
3419,
198,
220,
220,
220,
264,
13,
14689,
7,
16,
8,
198,
220,
220,
220,
264,
13,
14689,
7,
17,
8,
198,
220,
220,
220,
3601,
7,
... | 1.863636 | 110 |
# (C) Copyright 2017, 2019 by Rocky Bernstein
"""
CPython 2.3 bytecode opcodes
This is a like Python 2.3's opcode.py with some classification
of stack usage.
"""
import xdis.opcodes.opcode_2x as opcode_2x
from xdis.opcodes.base import (
finalize_opcodes,
format_extended_arg,
init_opdata,
update_pj2,
)... | [
2,
357,
34,
8,
15069,
2177,
11,
13130,
416,
24534,
37584,
198,
37811,
198,
8697,
7535,
362,
13,
18,
18022,
8189,
1034,
40148,
198,
198,
1212,
318,
257,
588,
11361,
362,
13,
18,
338,
1034,
8189,
13,
9078,
351,
617,
17923,
198,
1659,
... | 2.452261 | 199 |
from datetime import datetime, timezone
from main import models,statics
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
640,
11340,
198,
198,
6738,
1388,
1330,
4981,
11,
14269,
873,
628,
628,
628,
628,
198
] | 3.521739 | 23 |
# HackerRank "Write a function" Leap Year challenge
# https://www.hackerrank.com/challenges/write-a-function/problem
is_leap(1990)
| [
2,
34399,
27520,
366,
16594,
257,
2163,
1,
33927,
6280,
4427,
198,
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
13564,
12,
64,
12,
8818,
14,
45573,
628,
198,
198,
271,
62,
293,
499,
7,
19891,
8,
198
] | 3.045455 | 44 |
import json
import threading
import time
from functools import wraps
from uuid import UUID
from typing import AnyStr
def format_response(resp):
"""
Returns a str formatted response
:param resp: Requests response
:return: response text as a string, formatted as a json if valid
"""
try:
... | [
11748,
33918,
198,
11748,
4704,
278,
198,
11748,
640,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
334,
27112,
1330,
471,
27586,
198,
6738,
19720,
1330,
4377,
13290,
628,
198,
4299,
5794,
62,
26209,
7,
4363,
2599,
198,
220,
220,... | 2.780718 | 529 |
# Easy
# https://leetcode.com/problems/maximum-depth-of-binary-tree/
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# Time Complexity : O(N)
# Space Complexity : O(N) | [
2,
16789,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
47033,
12,
18053,
12,
1659,
12,
39491,
12,
21048,
14,
198,
198,
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
... | 2.371212 | 132 |
from enum import Enum
class ItemAttributeId(Enum):
"""
Derived from makemkvgui/inc/lgpl/apdefs.h
"""
Unknown = 0
Type = 1
Name = 2
LangCode = 3
LangName = 4
CodecId = 5
CodecShort = 6
CodecLong = 7
ChapterCount = 8
Duration = 9
DiskSize = 10
DiskSizeBytes = ... | [
6738,
33829,
1330,
2039,
388,
628,
198,
4871,
9097,
33682,
7390,
7,
4834,
388,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9626,
1572,
422,
787,
28015,
85,
48317,
14,
1939,
14,
75,
70,
489,
14,
499,
4299,
82,
13,
71,
198,... | 2.59481 | 501 |
from difflib import get_close_matches
from .squad_ids import SQUAD_IDS
def _parse_squad_name(team_id):
"""
Parse and clean the team's name.
To try and match requested team names with the master squad ID list, passed
names should be parsed to remove the common 'FC' and 'CF' tags, as well as
force ... | [
6738,
814,
8019,
1330,
651,
62,
19836,
62,
6759,
2052,
198,
6738,
764,
16485,
324,
62,
2340,
1330,
45880,
2885,
62,
14255,
628,
198,
4299,
4808,
29572,
62,
16485,
324,
62,
3672,
7,
15097,
62,
312,
2599,
198,
220,
220,
220,
37227,
19... | 3.074538 | 1,677 |
#!/usr/bin/env python3
from __future__ import unicode_literals
import cgi
import io
import os
import socket
import unittest
import sys
try:
from http.server import BaseHTTPRequestHandler, HTTPServer
except ImportError:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
try:
from urllib.parse i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
269,
12397,
198,
11748,
33245,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
555,
715,
395,
198,
1174... | 2.810427 | 211 |
import airbnb
import airbnb_secrets
import csv
items=1
output_filename="airbnb_chapelhill.csv"
# Set CSV Header & line format
csv_header = ['City','Latitude','Longitude','Type','Bathrooms','Bedrooms','Public Address','Localized City','Source']
api = airbnb.Api()
# api = airbnb.Api(airbnb_secrets.login, airbnb_secrets... | [
11748,
1633,
31971,
198,
11748,
1633,
31971,
62,
2363,
8004,
198,
11748,
269,
21370,
198,
198,
23814,
28,
16,
198,
22915,
62,
34345,
2625,
958,
31971,
62,
354,
499,
417,
12639,
13,
40664,
1,
198,
2,
5345,
44189,
48900,
1222,
1627,
579... | 2.436947 | 904 |
if __name__ == "__main__":
n = int(input("Enter number: "))
print("Is a Narcissistic Number" if is_narcissistic_number(n) else "Is NOT a Narcissistic Number")
| [
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
299,
796,
493,
7,
15414,
7203,
17469,
1271,
25,
366,
4008,
198,
220,
220,
220,
3601,
7203,
3792,
257,
31987,
747,
2569,
7913,
1,
611,
318,
62,
... | 2.698413 | 63 |
from PIL import Image
# import torchvision.models as models
#
# print(type(models.__dict__['resnet18']))
| [
6738,
350,
4146,
1330,
7412,
628,
198,
2,
1330,
28034,
10178,
13,
27530,
355,
4981,
198,
2,
198,
2,
3601,
7,
4906,
7,
27530,
13,
834,
11600,
834,
17816,
411,
3262,
1507,
20520,
4008,
198
] | 3.057143 | 35 |
# Generated by Django 2.1.5 on 2020-04-23 22:50
from django.db import migrations
import tinymce.models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
20,
319,
12131,
12,
3023,
12,
1954,
2534,
25,
1120,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
11748,
7009,
76,
344,
13,
27530,
628
] | 2.837838 | 37 |
# SIEL type compliance cases require a specific control code prefixes. currently: (0 to 9)D, (0 to 9)E, ML21, ML22.
COMPLIANCE_CASE_ACCEPTABLE_GOOD_CONTROL_CODES = "(^[0-9][DE].*$)|(^ML21.*$)|(^ML22.*$)"
| [
2,
25861,
3698,
2099,
11846,
2663,
2421,
257,
2176,
1630,
2438,
21231,
274,
13,
3058,
25,
357,
15,
284,
860,
8,
35,
11,
357,
15,
284,
860,
8,
36,
11,
10373,
2481,
11,
10373,
1828,
13,
198,
9858,
6489,
16868,
5222,
62,
34,
11159,
... | 2.314607 | 89 |
from jupyter_core.paths import jupyter_data_dir
import subprocess
import os
import stat
c = get_config()
c.NotebookApp.ip = '0.0.0.0'
# The port the notebook server will listen on
c.NotebookApp.port = 8888
# Whether to open in a browser after starting
c.NotebookApp.open_browser = False
# Set the Access-Control-All... | [
6738,
474,
929,
88,
353,
62,
7295,
13,
6978,
82,
1330,
474,
929,
88,
353,
62,
7890,
62,
15908,
198,
11748,
850,
14681,
198,
11748,
28686,
198,
11748,
1185,
198,
198,
66,
796,
651,
62,
11250,
3419,
198,
198,
66,
13,
6425,
2070,
467... | 2.904762 | 168 |
from django.conf import settings
from django.db import models
from django.forms import ModelForm, Textarea
from django.shortcuts import reverse
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
from django.utils import timezone
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
11,
8255,
20337,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
9575,
198,
6738,
42625,
1420... | 3.493151 | 73 |
"""
菜单序列化
@project: bright
@file: .py
@ide: PyCharm
@auth: Eric Joe
@email: whatisjava@hotmail.com
@build: 2019-09-16 10:12
@info:
"""
from apps.admin.api.common import serializers
from apps.admin.models import Menu
class MenuSerializer(serializers.ModelSerializer):
"""
菜单
"""
class MenuTreeSerializer(... | [
37811,
198,
164,
237,
250,
39355,
243,
41753,
237,
26344,
245,
44293,
244,
198,
31,
16302,
25,
6016,
198,
31,
7753,
25,
764,
9078,
198,
31,
485,
25,
9485,
1925,
1670,
198,
31,
18439,
25,
7651,
5689,
198,
31,
12888,
25,
644,
271,
1... | 2.431818 | 176 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Path hack
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from cdata.summary import * # noqa
try:
import unittest2 as unittest
except ImportError:
import unittest
if __name__ == '__main__':
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
10644,
8156,
198,
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
28686,
13,
6978,
13... | 2.423729 | 118 |
#imports
import pandas as pd
import joblib
from flask import Flask, render_template, session,Markup, redirect, url_for
from flask_bootstrap import Bootstrap
import os
#Production server
#from waitress import serve
#Form validator
from flask_wtf import FlaskForm
from wtforms import FloatField, SubmitField
... | [
2,
320,
3742,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
1693,
8019,
201,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
6246,
11,
9704,
929,
11,
18941,
11,
19016,
62,
1640,
201,
198,
6738,
42903,
62,
18769... | 2.704453 | 494 |
import random
print("\tWelcome to the Python Dice App")
flag = True
while flag:
a = dice_sides()
b = dice_number()
c = roll_dice(b,a)
sum_dice(c)
flag = roll_again()
| [
11748,
4738,
198,
4798,
7203,
59,
83,
14618,
284,
262,
11361,
34381,
2034,
4943,
198,
32109,
796,
6407,
198,
4514,
6056,
25,
198,
220,
220,
220,
257,
796,
17963,
62,
82,
1460,
3419,
198,
220,
220,
220,
275,
796,
17963,
62,
17618,
34... | 2.320988 | 81 |
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
constant = (3/2)*1.38*10**(-23)
particles_number = [0 for x in range(4)]
temperature = [0 for x in range(4)]
# X = rows, Y = columns
energy = ([[0 for y in range(4)] for x in range(4)])
for x in range(1, 4): # row
particles_number[x] = x
... | [
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
29487,
18,
67,
1330,
12176,
274,
18,
35,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
9979,
415,
796,
357,
18,
14,
17,
27493,
16,
13,
2548,
9,
940,
1174,
325... | 2.447712 | 306 |
import os, sys, copy, re
import xml.etree.ElementTree as ET
_CIMEROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..","..","..","cime")
sys.path.append(_CIMEROOT)
from CIME.utils import expect
###############################################################################
class MockCase(object):
####... | [
11748,
28686,
11,
25064,
11,
4866,
11,
302,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
62,
34,
3955,
34812,
2394,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
... | 2.384851 | 10,430 |
import torch
import numpy
| [
11748,
28034,
198,
11748,
299,
32152,
628,
628,
628,
628,
198
] | 3.090909 | 11 |
import logging
from collections import Counter, defaultdict
import math
import sys
import numpy as np
from scipy.sparse import csr_matrix
import scipy.sparse
from sklearn.utils.extmath import safe_sparse_dot
from gensim.models import Word2Vec, KeyedVectors
from spherecluster import SphericalKMeans
| [
11748,
18931,
198,
6738,
17268,
1330,
15034,
11,
4277,
11600,
198,
11748,
10688,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
82,
29572,
1330,
269,
27891,
62,
6759,
8609,
198,
11748,
629,
541,... | 3.307692 | 91 |
# #!/usr/bin/env python
# encoding: utf-8
#
# --------------------------------------------------------------------------------------------------------------------
# Name: smart_contact_manager.py
# Version: 0.0.1
# Summary: Smart Contact Manager a contact book GUI application with Python, SQLite, and PyQt.
#
# A... | [
2,
220,
1303,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
220,
21004,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
220,
16529,
3880,
19351,
198,
2,
220,
6530,
25,
4451,
62,
32057,
62,
37153,
13,
9078,
198,
2,
220,
10628,
25,
657,... | 4.135 | 200 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 14 23:32:57 2021
Author: Josef Perktold
License: BSD-3
"""
# import numpy as np
from numpy.testing import assert_allclose
import pytest
import statsmodels.sandbox.distributions.copula as cop
ev_list = [
[cop.transform_bilogistic, 0.5, 0.9, (0.25, 0.05), 0.5],
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
2365,
1478,
2242,
25,
2624,
25,
3553,
33448,
198,
198,
13838,
25,
5264,
69,
2448,
21841,
727,
198,
34156,
25,
347,
10305,
12,
18,
198,
1... | 1.962529 | 854 |
import numpy as np
class Squared(LossFunction):
"""Squared loss: L(p, y) = 0.5 * (y - p)²"""
class Logistic(LossFunction):
"""Logistic loss: L(p, y) = log(1 + exp(-yp))"""
class SquaredHinge(LossFunction):
"""Squared hinge loss: L(p, y) = max(1 - yp, 0)²"""
class Hinge(LossFunction):
"""hinge ... | [
11748,
299,
32152,
355,
45941,
628,
628,
198,
4871,
5056,
1144,
7,
43,
793,
22203,
2599,
198,
220,
220,
220,
37227,
22266,
1144,
2994,
25,
406,
7,
79,
11,
331,
8,
796,
657,
13,
20,
1635,
357,
88,
532,
279,
8,
31185,
37811,
628,
... | 2.283871 | 155 |
import unittest
import json
import os
| [
11748,
555,
715,
395,
628,
198,
11748,
33918,
198,
11748,
28686,
628,
198
] | 3.230769 | 13 |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 27 17:29:26 2020
@author: Alberto Suárez
"""
# Load packages
import numpy as np
import sys
import matplotlib.pyplot as plt
from numpy.core.shape_base import _accumulate
def generate_regular_grid(t0, delta_t, N):
"""Generates a regular grid of times.
Parameters
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
8621,
2681,
1596,
25,
1959,
25,
2075,
12131,
198,
198,
31,
9800,
25,
40649,
1778,
6557,
21107,
198,
37811,
198,
2,
8778,
10392,
198,
11748,... | 2.307929 | 4,868 |
nome = str(input('>>Seu nome completo:\n')).strip()
print('>>No seu nome há ', nome.upper().count('A'), 'letra(s) A.')
print('>>Aparece na posição ', nome.upper().find('A')+1)
print('>>A última aparição é na ', nome.upper().rfind('A') + 1) | [
77,
462,
796,
965,
7,
15414,
10786,
4211,
4653,
84,
299,
462,
1224,
1462,
7479,
77,
11537,
737,
36311,
3419,
198,
4798,
10786,
4211,
2949,
384,
84,
299,
462,
289,
6557,
46083,
299,
462,
13,
45828,
22446,
9127,
10786,
32,
33809,
705,
... | 2.27619 | 105 |
import visualpriors
import torch
from config.config import device
def mid_level_representations(input_image_tensor, representation_names):
"""
:param input_image_tensor: (batch_size, 3, 256, 256)
:param representation_names: list
:return: concatted image tensor to pass into FCN (batch_size, 8*len(re... | [
11748,
5874,
3448,
669,
198,
11748,
28034,
198,
6738,
4566,
13,
11250,
1330,
3335,
628,
198,
4299,
3095,
62,
5715,
62,
15603,
602,
7,
15414,
62,
9060,
62,
83,
22854,
11,
10552,
62,
14933,
2599,
198,
220,
220,
220,
37227,
198,
220,
2... | 2.917808 | 219 |
# -*- coding: utf-8 -*-
"""
pmutt.test_pmutt_model_statmech_nucl
Tests for pmutt module
"""
import unittest
from pmutt.statmech import nucl
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
4426,
15318,
13,
9288,
62,
4426,
15318,
62,
19849,
62,
14269,
1326,
354,
62,
28803,
565,
198,
51,
3558,
329,
9114,
15318,
8265,
198,
37811,
198,
11748,
555,
... | 2.345679 | 81 |
#########################################################################
# _________ ___. ______________________ ___
# \_ ___ \___.__.\_ |__ ___________ / _____/\______ \ \/ /
# / \ \< | | | __ \_/ __ \_ __ \/ \ ___ | _/\ /
# \ \___\___ | | \_\... | [
29113,
29113,
7804,
2,
198,
2,
220,
220,
220,
220,
2602,
62,
220,
220,
220,
220,
220,
220,
220,
11593,
44807,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4841,
25947,
220,
46444,
... | 1.949339 | 454 |
#!/usr/bin/env python3.7
""" This file contains code to carry out a simple estimate of the amount of
Fortran code 'handled' by for2py.
COMMAND-LINE INVOCATION:
python3.7 measure-coverage.py <directory with Fortran code files>
ADDING HANDLED LANGUAGE CONSTRUCTS:
As the set of language featur... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
22,
198,
198,
37811,
770,
2393,
4909,
2438,
284,
3283,
503,
257,
2829,
8636,
286,
262,
2033,
286,
198,
220,
220,
220,
6401,
2596,
2438,
705,
38788,
6,
416,
329,
17,
9078,
13,
62... | 1.870061 | 2,455 |
from collections import namedtuple
from leapp.libraries.common.config import get_env, get_all_envs
from leapp.libraries.stdlib import api
from leapp.models import EnvVar
| [
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
6738,
443,
1324,
13,
75,
11127,
13,
11321,
13,
11250,
1330,
651,
62,
24330,
11,
651,
62,
439,
62,
268,
14259,
198,
6738,
443,
1324,
13,
75,
11127,
13,
19282,
8019,
1330,
40391,
198,
6738... | 3.283019 | 53 |
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from itertools import chain
import numpy as np
from led_wabbit.models import LogisticRegressionBinary
if __name__ == '__main__':
X1 = [[0, 1, 1] for i in range(40)]
X2 = [[0, 2, 0] for i in range(40)]
X3 = [[1, 0, 1] fo... | [
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
6738,
1341,
35720,
13,
26791,
1330,
36273,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2957,
62,
86,
14229,
... | 2.132635 | 573 |
import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
b1 = tsds.load_ozone_exogenous_categorical()
df = b1.mPastData
print(b1.mExogenousDataFrame.Exog2.cat.categories)
print(b1.mExogenousDataFrame.Exog3.cat.categories)
print(b1.mExogenousDataFrame.Exog4.cat.... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
12972,
1878,
13,
16351,
2701,
13798,
355,
1960,
1659,
198,
11748,
12972,
1878,
13,
44199,
13,
4694,
62,
19608,
292,
1039,
355,
40379,
9310,
198,
198,
... | 2.416084 | 572 |
# coding=utf-8
"""UrbanTerror server info"""
# Author: zephrax http://kernelpanic.com.ar
from __future__ import unicode_literals, absolute_import, print_function, division
from sopel import web
from sopel.module import commands
from sopel.logger import get_logger
from sopel.config.types import StaticSection, Validated... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
46667,
40194,
4382,
7508,
37811,
198,
2,
6434,
25,
1976,
27446,
32040,
2638,
1378,
33885,
35843,
13,
785,
13,
283,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
4112,
62,... | 2.148282 | 3,055 |
import fpga_config
from nifpga import Session
import ntpath
configpath = input('Please enter the full filepath of your .fpgaconfig file: ')
vsfpga = fpga_config.VeriStandFPGA(configpath)
folder = ntpath.split(configpath)
read_count = vsfpga.read_packets + 1
write_count = vsfpga.write_packets + 1
read_packets = {}
writ... | [
11748,
277,
79,
4908,
62,
11250,
198,
6738,
299,
361,
79,
4908,
1330,
23575,
198,
11748,
299,
83,
6978,
198,
198,
11250,
6978,
796,
5128,
10786,
5492,
3802,
262,
1336,
2393,
6978,
286,
534,
764,
69,
6024,
7807,
5647,
2393,
25,
705,
... | 2.452045 | 1,418 |
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import platform
import subprocess
import os
from os.path import expanduser
import re
import glob
import numpy as np
from argparse import ArgumentParser, REMAINDER
from argparse import RawTextHelpFormatter
import logging
import... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
11748,
25064,
198,
11748,
3859,
198,
11748,
850,
14681,
198,
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
4292,
7220,... | 2.277315 | 8,045 |
from django.contrib import admin
from .models import Complaint, Notification
admin.site.register(Notification, NotifAdmin)
admin.site.register(Complaint, ComplaintAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
20011,
2913,
11,
42808,
628,
628,
198,
28482,
13,
15654,
13,
30238,
7,
3673,
2649,
11,
1892,
361,
46787,
8,
198,
28482,
13,
15654,
13,
30238,
7,
38143,
... | 3.571429 | 49 |
from . import unittest
import pytest
from shapely.geometry import Point, LineString, Polygon, MultiPoint, \
GeometryCollection
from shapely.wkt import loads
from shapely.geos import TopologicalError
| [
6738,
764,
1330,
555,
715,
395,
198,
11748,
12972,
9288,
198,
6738,
5485,
306,
13,
469,
15748,
1330,
6252,
11,
6910,
10100,
11,
12280,
14520,
11,
15237,
12727,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 2.746988 | 83 |
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
33448,
3012,
11419,
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,
733... | 3.223969 | 509 |
import argparse
import logging
import os
import sys
import time
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
import fsspec
import nvtabular as nvt
from nvtabular.io.shuffle import Shuffle
from nvtabular.ops import Categorify
from nvtabular.ops import Clip
from nvtabular.ops import FillMis... | [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
198,
6738,
288,
2093,
13,
17080,
6169,
1330,
20985,
198,
6738,
288,
2093,
62,
66,
15339,
1330,
10714,
34,
8322,
2246,
48375,
198,
11748,
... | 2.317742 | 3,100 |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 19 10:23:29 2021
@author: caldwell ©
"""
import pygame as pg
from random import choice
# from pprint import pprint
## --- Paramètres de jeu ------------------------------
# si on joue contre l'IA (True) ou JvJ (False)
MODE_IA = True
# la taille de la grille de jeu (lar... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
19480,
1526,
678,
838,
25,
1954,
25,
1959,
33448,
198,
198,
31,
9800,
25,
269,
1940,
4053,
10673,
198,
37811,
198,
198,
11748,
12972,
6057,
355,
... | 1.909774 | 9,720 |
from lifxlan import *
from random import randint, betavariate
from time import sleep
if __name__=="__main__":
main()
| [
6738,
3868,
87,
9620,
1330,
1635,
198,
6738,
4738,
1330,
43720,
600,
11,
731,
615,
2743,
378,
198,
6738,
640,
1330,
3993,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.97561 | 41 |
#!/usr/bin/python3
import sys;
import cgicommon;
import urllib.request, urllib.parse, urllib.error;
import cgi;
import cgitb;
import os;
import re;
import random;
CONFLICT_STRATEGY_FORCE = 0
CONFLICT_STRATEGY_DO_NOT_EMBLANKIFY = 1
CONFLICT_STRATEGY_ONLY_FILL_BLANKS = 2
CONFLICT_STRATEGY_DISCARD = 3
cgitb.enable();
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
25064,
26,
198,
11748,
269,
70,
291,
2002,
261,
26,
198,
11748,
2956,
297,
571,
13,
25927,
11,
2956,
297,
571,
13,
29572,
11,
2956,
297,
571,
13,
18224,
26,
198,
11748,
26... | 1.98 | 6,400 |
#!/usr/bin/python3
import argparse
import logging
from .problem import Problem
from .contest import Contest
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
6738,
764,
45573,
1330,
20647,
198,
6738,
764,
3642,
395,
1330,
27297,
198
] | 3.724138 | 29 |
import math
import itertools
from collections import defaultdict
flatten_iter = itertools.chain.from_iterable
# https://stackoverflow.com/a/6909532/5538273
| [
11748,
10688,
198,
11748,
340,
861,
10141,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
2704,
41769,
62,
2676,
796,
340,
861,
10141,
13,
7983,
13,
6738,
62,
2676,
540,
628,
198,
2,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
... | 3.037736 | 53 |
from flask import Flask, render_template, session, jsonify
from flask_session import Session # new style
'''
Möchte man z.B.: Objekte in der Session speichern, gibt es bei der normalen Verwendung ein Problem,
weil Flask die Session Info als JSON-String (verschlüsselt!) in einem Cookie speichert.
Es gäbe die Möglich... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
6246,
11,
33918,
1958,
198,
6738,
42903,
62,
29891,
1330,
23575,
220,
1303,
649,
3918,
198,
7061,
6,
198,
44,
9101,
354,
660,
582,
1976,
13,
33,
11207,
38764,
988,
660,
287,
4587,
2... | 2.783537 | 328 |
#***********************************************************************#
# Copyright (C) 2010-2012 Tomas Tinoco De Rubira #
# #
# This file is part of CVXPY #
# ... | [
2,
17174,
17174,
2466,
8162,
2,
198,
2,
15069,
357,
34,
8,
3050,
12,
6999,
42884,
22894,
25634,
1024,
6256,
8704,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.08733 | 1,981 |
# write-html.py
import webbrowser
if __name__ == "__main__":
main() | [
2,
3551,
12,
6494,
13,
9078,
198,
11748,
3992,
40259,
198,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
220,
220,
220,
220
] | 2.157895 | 38 |
from unittest import TestCase
from main.classes.arc_solver import ArcSolver
from main.classes.decimal_location import DecimalLocation
from main.classes.graph import Graph
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
1388,
13,
37724,
13,
5605,
62,
82,
14375,
1330,
10173,
50,
14375,
198,
6738,
1388,
13,
37724,
13,
12501,
4402,
62,
24886,
1330,
4280,
4402,
14749,
198,
6738,
1388,
13,
37724,
13,... | 3.76087 | 46 |
"""
A helper class for using TLS Lite with stdlib clients
(httplib, xmlrpclib, imaplib, poplib).
"""
from tlslite.checker import Checker
class ClientHelper:
"""This is a helper class used to integrate TLS Lite with various
TLS clients (e.g. poplib, smtplib, httplib, etc.)"""
def __init__(self,
... | [
37811,
198,
32,
31904,
1398,
329,
1262,
33855,
27395,
351,
14367,
8019,
7534,
198,
7,
2804,
489,
571,
11,
35555,
81,
79,
565,
571,
11,
545,
64,
489,
571,
11,
1461,
8019,
737,
198,
37811,
198,
198,
6738,
256,
75,
6649,
578,
13,
912... | 2.606185 | 2,199 |
import math
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from gym.envs.classic_control import rendering
from config import Config
| [
11748,
10688,
198,
11748,
11550,
198,
6738,
11550,
1330,
9029,
198,
6738,
11550,
13,
26791,
1330,
384,
8228,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11550,
13,
268,
14259,
13,
49421,
62,
13716,
1330,
14837,
198,
6738,
4566,
1330,
... | 4 | 42 |
#050_Soma_dos_pares.py
soma = 0
for c in range(1, 6):
num = int(input(f"{c}º Número: "))
if (num % 2 == 0):
soma += num
print (f"Soma = {soma}") | [
2,
28669,
62,
50,
6086,
62,
37427,
62,
79,
3565,
13,
9078,
198,
198,
82,
6086,
796,
657,
198,
1640,
269,
287,
2837,
7,
16,
11,
718,
2599,
198,
220,
220,
220,
997,
796,
493,
7,
15414,
7,
69,
1,
90,
66,
92,
36165,
399,
21356,
... | 1.829545 | 88 |
import re
import math
from .datetime_string import to_seconds, to_timedelta
import logging
import os
logger = logging.getLogger()
| [
11748,
302,
198,
11748,
10688,
198,
6738,
764,
19608,
8079,
62,
8841,
1330,
284,
62,
43012,
11,
284,
62,
16514,
276,
12514,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
3419,
628,
628
] | 3.268293 | 41 |
import pytest
from beerpy.receipe import hop_quantity, malt_composition, PILSENER_MALT, \
MUNICH_MALT
from beerpy.units.gravity import Gravity
| [
11748,
12972,
9288,
198,
198,
6738,
6099,
9078,
13,
260,
344,
3757,
1330,
1725,
62,
40972,
414,
11,
26868,
62,
785,
9150,
11,
350,
45484,
1677,
1137,
62,
44,
31429,
11,
3467,
198,
220,
220,
220,
337,
4944,
20739,
62,
44,
31429,
198,... | 2.777778 | 54 |
import mayavi.mlab as mlab
import numpy as np
import torch
import cv2
import matplotlib.pyplot as plt
box_colormap = [
[1, 1, 1],
[0, 1, 0],
[0, 1, 1],
[1, 1, 0],
]
label_dict = {0:"background", 1:"Car", 2:"Ped", 3:"Cycler", 4:"Truck"}
color_dict = {"0":[255, 255, 255], "1":[255, 255, 0], "2":[51, 153,... | [
11748,
743,
15820,
13,
4029,
397,
355,
285,
23912,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
3524,
62,
4033,
579,
499,
796,
... | 1.841058 | 6,732 |
import os
import time
import psutil
import sys
import atexit
| [
11748,
28686,
198,
11748,
640,
198,
11748,
26692,
22602,
198,
11748,
25064,
198,
11748,
379,
37023,
198
] | 3.588235 | 17 |
"""Fast Lomb-Scargle Periodograms"""
from .core import LombScargle
| [
37811,
22968,
28503,
12,
3351,
853,
293,
18581,
26836,
37811,
198,
198,
6738,
764,
7295,
1330,
28503,
3351,
853,
293,
198
] | 3.238095 | 21 |
import os.path
import mimetypes
from django.http import HttpResponse
from .utils import get_scorm_storage
import logging
logger = logging.getLogger(__name__)
def proxy_scorm_media(request, block_id, file, sha1=None):
"""
Render the media objects by proxy, as the files
must be in the same domain as the ... | [
11748,
28686,
13,
6978,
198,
11748,
17007,
2963,
12272,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
198,
6738,
764,
26791,
1330,
651,
62,
1416,
579,
62,
35350,
198,
198,
11748,
18931,
198,
198,
6404,
1362,
796,... | 2.421405 | 299 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TOPIC: Decide what to do with a field that has multiple items in it.
In this problem set you work with cities infobox data, audit it, come up with a
cleaning idea and then clean it up.
Since in the previous quiz you made a decision on which value to keep for t... | [
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,
35222,
2149,
25,
4280,
485,
644,
284,
466,
351,
257,
2214,
326,
468,
3294,
3709,
287,
340,... | 3.189091 | 275 |
import parmed
import numpy as np
from constrainmol import ConstrainedMolecule
# Load from gro/topology
system = parmed.load_file("system.top", xyz="system.gro")
system.save("unconstrained.pdb", overwrite=True)
constrained_coordinates = np.zeros(system.coordinates.shape)
unique_res = system.split()
for (res, resids)... | [
11748,
1582,
1150,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1500,
3201,
43132,
1330,
1482,
2536,
1328,
44,
2305,
23172,
198,
198,
2,
8778,
422,
7128,
14,
4852,
1435,
198,
10057,
796,
1582,
1150,
13,
2220,
62,
7753,
7203,
10... | 2.664311 | 283 |
from datetime import datetime
from scrapy.contrib.loader import ItemLoader
from scrapy.contrib.loader.processor import Join, MapCompose, Identity
from scrapy.contrib_exp.djangoitem import DjangoItem
from django_edzapp.jobs.models import Job
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
15881,
88,
13,
3642,
822,
13,
29356,
1330,
9097,
17401,
198,
6738,
15881,
88,
13,
3642,
822,
13,
29356,
13,
41341,
1330,
15251,
11,
9347,
7293,
577,
11,
27207,
198,
6738,
15881,
88,
... | 3.5 | 70 |
from comment import *
from thread import *
from site import *
from custom_user import *
| [
6738,
2912,
1330,
1635,
198,
6738,
4704,
1330,
1635,
198,
6738,
2524,
1330,
1635,
198,
6738,
2183,
62,
7220,
1330,
1635,
198
] | 4 | 22 |
# 1091
# (?:(?:w{3}\.)(?:[a-zA-Z0-9/;\?&=:\-_\$\+!\*'\(\|\\~\[\]#%\.])+[\.com|\.edu|\.gov|\.int|\.mil|\.net|\.org|\.biz|\.info|\.name|\.pro|\.aero|\.coop|\.museum|\.cat|\.jobs|\.travel|\.arpa|\.mobi|\.ac|\.ad|\.ae|\.af|\.ag|\.ai|\.al|\.am|\.an|\.ao|\.aq|\.ar|\.as|\.at|\.au|\.aw|\.az|\.ax|\.ba|\.bb|\.bd|\.be|\.bf|\.bg|\... | [
2,
838,
6420,
198,
2,
357,
27514,
7,
27514,
86,
90,
18,
32239,
2014,
7,
27514,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
14,
26,
59,
30,
5,
28,
7479,
12,
62,
59,
3,
59,
10,
0,
59,
9,
6,
59,
38016,
91,
6852,
93,
59,
58,
... | 1.643411 | 2,064 |
#!/usr/bin/env python3
"""
This module merge to xml files into one. First it checks if its sha's are the same to avoid merging of different projects an finally merge it into one called merged.xml.
"""
import sys
import argparse
from lxml import etree
import met.xmlMerger as merger
USAGE = './met-merger firstXml.xml s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
1212,
8265,
20121,
284,
35555,
3696,
656,
530,
13,
3274,
340,
8794,
611,
663,
427,
64,
338,
389,
262,
976,
284,
3368,
35981,
286,
1180,
4493,
281,
3443,
20121,
340,
6... | 3.058824 | 204 |
"""Docstring for db_config file."""
import psycopg2
import os
from instance.config import app_config
# from boto.s3.connection import S3Connection
# s3 = S3Connection(os.environ['S3_KEY'], os.environ['S3_SECRET'])
env = os.getenv("FLASK_ENV")
if not env:
url = app_config["production"].DATABASE_URL
else:
url ... | [
37811,
23579,
8841,
329,
20613,
62,
11250,
2393,
526,
15931,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
28686,
198,
6738,
4554,
13,
11250,
1330,
598,
62,
11250,
198,
2,
422,
275,
2069,
13,
82,
18,
13,
38659,
1330,
311,
18,
32048,
... | 2.685815 | 853 |
from typing import Union
from talon import Context, Module, actions, app
from talon.grammar import Phrase
import gaze_ocr
import screen_ocr # dependency of gaze-ocr
from gaze_ocr import _talon_wrappers as talon_wrappers
mod = Module()
setting_ocr_logging_dir = mod.setting(
"ocr_logging_dir",
type=str,
... | [
6738,
19720,
1330,
4479,
198,
198,
6738,
3305,
261,
1330,
30532,
11,
19937,
11,
4028,
11,
598,
198,
6738,
3305,
261,
13,
4546,
3876,
1330,
1380,
22789,
198,
198,
11748,
17841,
62,
1696,
198,
11748,
3159,
62,
1696,
220,
1303,
20203,
28... | 2.72242 | 281 |
import ast
import os
import string
from wsgiref.util import FileWrapper
from django.conf import settings
from django.contrib.staticfiles import finders
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.utils.crypto import random
from .docx import read_docx_tags, replace_doc... | [
11748,
6468,
198,
11748,
28686,
198,
11748,
4731,
198,
6738,
266,
45213,
557,
69,
13,
22602,
1330,
9220,
36918,
2848,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
12708,
16624,
1330,
1... | 3.482456 | 114 |
main()
| [
12417,
3419,
198
] | 2.333333 | 3 |
"""
This module contains functionality required for disconnected installation.
"""
import logging
import os
import tempfile
import yaml
from ocs_ci.framework import config
from ocs_ci.helpers.disconnected import get_opm_tool
from ocs_ci.ocs import constants
from ocs_ci.ocs.exceptions import NotFoundError
from ocs_ci... | [
37811,
198,
1212,
8265,
4909,
11244,
2672,
329,
28597,
9988,
13,
198,
37811,
198,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
20218,
7753,
198,
198,
11748,
331,
43695,
198,
198,
6738,
267,
6359,
62,
979,
13,
30604,
1330,
4566,
198... | 2.293339 | 4,459 |
import pytest
import rivalcfg.helpers
| [
11748,
12972,
9288,
198,
198,
11748,
8976,
37581,
13,
16794,
364,
628
] | 3.333333 | 12 |
import pytest
from dnaio import Sequence
from cutadapt.adapters import Adapter, Match, Where, LinkedAdapter
def test_issue_265():
"""Crash when accessing the matches property of non-anchored linked adapters"""
s = Sequence('name', 'AAAATTTT')
front_adapter = Adapter('GGG', where=Where.FRONT)
b... | [
11748,
12972,
9288,
198,
198,
6738,
288,
2616,
952,
1330,
45835,
198,
6738,
2005,
42552,
13,
324,
12126,
1330,
43721,
11,
13225,
11,
6350,
11,
7502,
276,
47307,
628,
628,
628,
628,
198,
198,
4299,
1332,
62,
21949,
62,
22980,
33529,
19... | 2.914573 | 199 |
# Copyright (c) 2018 The Pooch Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Calculating and checking file hashes.
"""
import hashlib
import functools
from pathlib impo... | [
2,
15069,
357,
66,
8,
2864,
383,
41778,
354,
34152,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
347,
10305,
513,
12,
2601,
682,
13789,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
18,
12,
2601,
68... | 2.530635 | 2,693 |
from django.test import TestCase
from mock import patch
from classphoto import models as classphoto_api
from classphoto import db
from classphoto import emails
from signup import models as signup_api
@patch('signup.models.sequence_model.get_current_sequence_number', lambda: 1)
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
15290,
1330,
8529,
198,
198,
6738,
1398,
23074,
1330,
4981,
355,
1398,
23074,
62,
15042,
198,
6738,
1398,
23074,
1330,
20613,
198,
6738,
1398,
23074,
1330,
7237,
198,
198,
... | 3.580247 | 81 |
import tensorflow as tf
slim = tf.contrib.slim
def block35(net, scale=1.0, activation_fn=tf.nn.relu, scope=None, reuse=None):
"""Builds the 35x35 resnet block."""
with tf.variable_scope(scope, 'Block35', [net], reuse=reuse):
with tf.variable_scope('Branch_0'):
tower_conv = slim.conv2d(net, 32, 1, scope... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
82,
2475,
796,
48700,
13,
3642,
822,
13,
82,
2475,
628,
198,
4299,
2512,
2327,
7,
3262,
11,
5046,
28,
16,
13,
15,
11,
14916,
62,
22184,
28,
27110,
13,
20471,
13,
260,
2290,
11,
8354,... | 1.843879 | 4,836 |
from fastai.vision.all import *
import re
df = pd.read_csv(Path('download/labels/train_labels.csv'), names=['name','x_p','y_p'], header=0)
imgs = DataBlock(blocks=(ImageBlock, PointBlock), get_items=get_image_files, get_y=get_focus_point, splitter=RandomSplitter(valid_pct=0.2, seed=42), batch_tfms=[*aug_transforms(siz... | [
6738,
3049,
1872,
13,
10178,
13,
439,
1330,
1635,
198,
11748,
302,
198,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
7,
15235,
10786,
15002,
14,
23912,
1424,
14,
27432,
62,
23912,
1424,
13,
40664,
33809,
3891,
28,
17816,
3672,
41707,
... | 2.444934 | 227 |
#!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 8/1/14
###Function: scatter plot zOR metrics vs. epidemic duration at state level, using the state peak retrospective classification
## one plot per season per classification period vs. epidemic durati... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
29113,
7804,
4242,
2235,
198,
21017,
37906,
11055,
198,
21017,
13838,
25,
10674,
5741,
198,
21017,
10430,
25,
807,
14,
16,
14,
1415,
198,
21017,
22203,
25,
41058,
7110,
1976,
1581,
20731,
... | 2.527791 | 2,069 |
import pandas as pd
from subprocess import call
# Generate raw data file
# call("./get_actions.sh") // Add this if you dont have the out raw data TODO: Replace this with the go script
# Do we add a count for each category a action has or ???
all_actions = open("data/actions_out/actions_raw.txt", "r")
no_ver_actions =... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
850,
14681,
1330,
869,
198,
198,
2,
2980,
378,
8246,
1366,
2393,
198,
2,
869,
7,
1911,
14,
1136,
62,
4658,
13,
1477,
4943,
3373,
3060,
428,
611,
345,
17666,
423,
262,
503,
8246,
1366,
16... | 2.729282 | 362 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2018 ASLP@NPU Ke Wang
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import sys
import librosa
import numpy as np
import soundfile as sf
from scipy.io import wavfile
MA... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
2864,
220,
7054,
19930,
31,
45,
5105,
220,
220,
220,
3873,
15233,
198,
198,
6738,
11593,
37443,
834,
1... | 2.253327 | 2,029 |
"""
vim: set enc=utf-8
Author : winterTTr
Mail : winterTTr@gmail.com
Desc : Tools for Operation on Win32 Environment variables
Module : win32export.py
"""
import win32gui
import win32con
import win32api
| [
37811,
198,
31124,
25,
900,
2207,
28,
40477,
12,
23,
198,
198,
13838,
1058,
220,
7374,
51,
2898,
198,
25804,
220,
220,
1058,
220,
7374,
51,
2898,
31,
14816,
13,
785,
198,
24564,
220,
220,
1058,
220,
20003,
329,
14680,
319,
7178,
262... | 2.917808 | 73 |
from execpeewee.builder import PeeweeModel
from execpeewee.handler import ExecPeewee
from execpeewee.mapping import PeeweeFields
__all__ = [
'PeeweeModel',
'ExecPeewee',
'PeeweeFields'
]
| [
6738,
2452,
431,
413,
1453,
13,
38272,
1330,
2631,
413,
1453,
17633,
198,
6738,
2452,
431,
413,
1453,
13,
30281,
1330,
8393,
6435,
413,
1453,
198,
6738,
2452,
431,
413,
1453,
13,
76,
5912,
1330,
2631,
413,
1453,
15878,
82,
628,
198,
... | 2.481481 | 81 |
f = lambda a, b, *c, d: None # default arg
#f = lambda a, b=1, *c, d: None # default arg for lambda not implemented
| [
69,
796,
37456,
257,
11,
275,
11,
1635,
66,
11,
288,
25,
6045,
1303,
4277,
1822,
198,
2,
69,
796,
37456,
257,
11,
275,
28,
16,
11,
1635,
66,
11,
288,
25,
6045,
1303,
4277,
1822,
329,
37456,
407,
9177,
198
] | 2.829268 | 41 |
# Generated by Django 2.2.24 on 2021-09-13 15:58
import colorfield.fields
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1731,
319,
33448,
12,
2931,
12,
1485,
1315,
25,
3365,
198,
198,
11748,
3124,
3245,
13,
25747,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 3.027778 | 36 |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SelectField, BooleanField, SubmitField
from wtforms.fields.html5 import DateField
from flask_wtf.file import FileField, FileAllowed, FileRequired
from wtforms.validators import DataRequired, ValidationError, EqualTo, Email, Length
from app.... | [
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
83,
23914,
1330,
10903,
15878,
11,
30275,
15878,
11,
9683,
15878,
11,
41146,
15878,
11,
39900,
15878,
198,
6738,
266,
83,
23914,
13,
25747,
13,
6494,
20,
1330,
7536,
15878,
... | 3.840909 | 88 |
import argparse
import os
import webbrowser
from Option import Option
from functions.Clock import Clock
from functions.shut import shut
from functions.Ipconfig import Showip
from functions.CryptoSystem import *
from functions.Nslookup import Nslookup
from functions.PortScanner import Scanport
if __name__ == "__main__... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
3992,
40259,
198,
6738,
16018,
1330,
16018,
198,
6738,
5499,
13,
44758,
1330,
21328,
198,
6738,
5499,
13,
49625,
1330,
4423,
198,
6738,
5499,
13,
40,
79,
11250,
1330,
5438,
541,
198,
67... | 3.752809 | 89 |
from django import template
from django.contrib.auth import get_permission_codename
from django.utils.translation import gettext_lazy as _
from django.utils.safestring import mark_safe
register = template.Library()
@register.simple_tag(takes_context=True)
| [
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
525,
3411,
62,
19815,
12453,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
42625,
... | 3.350649 | 77 |
DOMAIN = "https://discoin.zws.im"
VERSION = "4.0" | [
39170,
29833,
796,
366,
5450,
1378,
6381,
3630,
13,
89,
18504,
13,
320,
1,
198,
43717,
796,
366,
19,
13,
15,
1
] | 2.227273 | 22 |