content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# 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
#
# http://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... | 2.951027 | 633 |
# -*- coding: utf-8 -*-
"""
pypeline.core
~~~~~~~~~~~~~
this module contains all the processing method, and advanced algorithms for OCT signal processing
calibrate:
disp_comp:
sp2struct:
@phase, @intensity, @complex
despeckle: (2D, 3D, etc.)
angiograph: (2D, 3D, etc.)
@speckle_var, @
"""
# register/loa... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
79,
4464,
4470,
13,
7295,
198,
15116,
8728,
93,
198,
198,
5661,
8265,
4909,
477,
262,
7587,
2446,
11,
290,
6190,
16113,
329,
42256,
6737,
7587,
198,
1... | 2.994152 | 171 |
from homura import download
| [
6738,
3488,
5330,
1330,
4321,
198
] | 4.666667 | 6 |
import base64
import six
import uuid
from mimetypes import guess_extension, guess_type
import io
from api import app
import boto3
import logging
import botocore.exceptions
BUCKET = app.config["S3_BUCKET_NAME"]
def parse_graduation_date(date):
""" Parses graduation date string generated by frontend into suitable ... | [
11748,
2779,
2414,
198,
11748,
2237,
198,
11748,
334,
27112,
198,
6738,
17007,
2963,
12272,
1330,
4724,
62,
2302,
3004,
11,
4724,
62,
4906,
198,
11748,
33245,
198,
6738,
40391,
1330,
598,
198,
11748,
275,
2069,
18,
198,
11748,
18931,
19... | 2.227442 | 1,341 |
STRUCTURED_TYPE = 'structured'
ML_MODEL_FILE_NAME_KEY = "ML_MODEL_FILE_NAME"
ML_MODEL_FILE_NAME_VALUE = "model"
SYS_DEPLOYMENT_FILE_NAME_KEY = "SYS_DEPLOYMENT_FILE_NAME"
SYS_DEPLOYMENT_FILE_NAME_VALUE = "deployment"
STATUS_UNAVAILABLE = 'unavailable'
SUCCESS_STATUSES = ['completed', 'available', 'success']
WARNING_STA... | [
46126,
4261,
1961,
62,
25216,
796,
705,
7249,
1522,
6,
198,
5805,
62,
33365,
3698,
62,
25664,
62,
20608,
62,
20373,
796,
366,
5805,
62,
33365,
3698,
62,
25664,
62,
20608,
1,
198,
5805,
62,
33365,
3698,
62,
25664,
62,
20608,
62,
3948... | 2.584 | 250 |
# Generated by Django 2.0.3 on 2018-06-14 17:03
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
18,
319,
2864,
12,
3312,
12,
1415,
1596,
25,
3070,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
"""
Sync authorized users on Google Sites to Google Drive
"""
import pyiem.cscap_utils as util
import gdata.gauth
import gdata.sites.client as sclient
config = util.get_config()
def get_sites_client(config, site="sustainablecorn"):
"""Return an authorized sites client"""
token = gdata.gauth.OAuth2Token(
... | [
37811,
198,
28985,
10435,
2985,
319,
3012,
37034,
284,
3012,
9974,
198,
37811,
198,
11748,
12972,
26597,
13,
66,
1416,
499,
62,
26791,
355,
7736,
198,
11748,
308,
7890,
13,
4908,
1071,
198,
11748,
308,
7890,
13,
49315,
13,
16366,
355,
... | 2.52766 | 705 |
from string import ascii_uppercase as au
if __name__ == '__main__':
print(solution("KAKAO")) | [
6738,
4731,
1330,
355,
979,
72,
62,
7211,
2798,
589,
355,
35851,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
7,
82,
2122,
7203,
42,
10206,
32,
46,
48774
] | 2.552632 | 38 |
from django.db import models
from django.core.mail import send_mail
from django.contrib.auth import models as auth_models
from django.contrib.auth.base_user import AbstractBaseUser
from django.utils.translation import ugettext_lazy as _
from django.conf ... | [
6738,
42625,
14208,
13,
9945,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1330,
4981,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
220,
220,
220,
220,
220,
220,
220,
220,
220... | 2.450331 | 151 |
import torch
import lpips
# from IPython import embed
import cv2
import numpy as np
import os
from os import listdir
from os.path import isfile, join
import re
use_gpu = False # Whether to use GPU
spatial = True # Return a spatial map of perceptual distance.
# Linearly calibrated models (LPIPS)
loss_fn = lpips.LPIP... | [
11748,
28034,
198,
11748,
300,
79,
2419,
198,
2,
422,
6101,
7535,
1330,
11525,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
28686,
13,
6978,
1330,
318,
... | 1.910831 | 5,069 |
from __future__ import print_function
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
import json
# from google.auth.transport.requests import Request
# Better to use read only scope for not modifying the contents accidentally
SCOPES = ['https://www.googleapis.com/aut... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
23645,
499,
291,
75,
1153,
13,
67,
40821,
1330,
1382,
198,
6738,
23645,
62,
18439,
62,
12162,
1071,
8019,
13,
11125,
1330,
2262,
4262,
4677,
37535,
198,
11748,
33918,
198,
2,
4... | 2.539941 | 1,352 |
"""
Name: Functions for customer data
Developer: Matt Clarke
Date: Jan 1, 2020
Description: Specific functions for generating customer data including RFM scores.
"""
from lifetimes.utils import summary_data_from_transaction_data
def rfm_model(df, customer_column, date_column, monetary_column):
"""Return an RFM s... | [
37811,
198,
5376,
25,
40480,
329,
6491,
1366,
198,
45351,
25,
4705,
19635,
198,
10430,
25,
2365,
352,
11,
12131,
198,
11828,
25,
17377,
5499,
329,
15453,
6491,
1366,
1390,
20445,
44,
8198,
13,
198,
37811,
198,
198,
6738,
3868,
46874,
... | 2.691089 | 505 |
from . import api
from flask import jsonify
| [
6738,
764,
1330,
40391,
198,
6738,
42903,
1330,
33918,
1958,
628
] | 4.090909 | 11 |
sum = float(input())
counter_of_coins = 0
sum = int(sum*100)
counter_of_coins += sum // 200
sum = sum % 200
counter_of_coins += sum // 100
sum = sum % 100
counter_of_coins += sum // 50
sum = sum % 50
counter_of_coins += sum // 20
sum = sum % 20
counter_of_coins += sum // 10
sum = sum % 10
counter_of_coins += sum // 5
... | [
16345,
796,
12178,
7,
15414,
28955,
198,
198,
24588,
62,
1659,
62,
14624,
796,
657,
198,
16345,
796,
493,
7,
16345,
9,
3064,
8,
198,
24588,
62,
1659,
62,
14624,
15853,
2160,
3373,
939,
198,
16345,
796,
2160,
4064,
939,
198,
24588,
6... | 2.686747 | 166 |
from __future__ import print_function
import torch
from torch.autograd import Variable
import cv2
import time
from imutils.video import FPS, WebcamVideoStream
import argparse
parser = argparse.ArgumentParser(description='Single Shot MultiBox Detection')
parser.add_argument('--weights', default='weights/ssd_300_VOC0712... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28034,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748,
269,
85,
17,
198,
11748,
640,
198,
6738,
545,
26791,
13,
15588,
1330,
22082,
11,
5313,
20991,
10798,
12124... | 2.497143 | 700 |
INSTRS = []
with open("day5.input") as f:
INSTRS = [int(l.strip()) for l in f.readlines()]
# INSTRS = [0, 3, 0, 1, -3]
pc = 0
steps = 0
while pc >= 0 and pc < len(INSTRS):
offset = INSTRS[pc]
if offset >= 3:
INSTRS[pc] -= 1
else:
INSTRS[pc] += 1
pc += offset
steps += 1
pr... | [
38604,
6998,
796,
17635,
198,
198,
4480,
1280,
7203,
820,
20,
13,
15414,
4943,
355,
277,
25,
198,
220,
220,
220,
40589,
6998,
796,
685,
600,
7,
75,
13,
36311,
28955,
329,
300,
287,
277,
13,
961,
6615,
3419,
60,
198,
198,
2,
40589,... | 2.075472 | 159 |
import datetime
import time
import warnings
import stripe
from stripe.test.helper import (StripeResourceTest, DUMMY_PLAN)
| [
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
14601,
198,
198,
11748,
39858,
198,
6738,
39858,
13,
9288,
13,
2978,
525,
1330,
357,
1273,
380,
431,
26198,
14402,
11,
360,
5883,
26708,
62,
6489,
1565,
8,
628,
628
] | 3.315789 | 38 |
import argparse, os
from xml.dom.minidom import parse
parser = argparse.ArgumentParser()
parser.add_argument('--pom_file_path', type=str, default=None)
args = parser.parse_args()
pom_file_path = args.pom_file_path
"""
此脚本应用于修改maven pom.xml文件,可以将jsii生成的pom.xml文件转化成可进行maven发布的pom.xml文件
输入: pom_file_path
"""
if __na... | [
11748,
1822,
29572,
11,
28686,
198,
6738,
35555,
13,
3438,
13,
1084,
312,
296,
1330,
21136,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
79,
296,
62,
7753,
62,
6978,
325... | 1.816327 | 196 |
from typing import Dict, List, Union
from numpy import float64
from gdsfactory.port import Port
def flip(port: Port) -> Port:
"""Returns port copy with Flip Port orientation."""
return port.flip()
def direction_ports_from_list_ports(optical_ports: List[Port]) -> Dict[str, List[Port]]:
"""Returns a dic... | [
6738,
19720,
1330,
360,
713,
11,
7343,
11,
4479,
198,
198,
6738,
299,
32152,
1330,
12178,
2414,
198,
198,
6738,
308,
9310,
69,
9548,
13,
634,
1330,
4347,
628,
198,
4299,
14283,
7,
634,
25,
4347,
8,
4613,
4347,
25,
198,
220,
220,
2... | 2.434476 | 992 |
import tweepy
from config import create_api
# auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET")
# auth.set_access_token("ACCESS_TOKEN", "ACCESS_TOKEN_SECRET")
| [
11748,
4184,
538,
88,
201,
198,
201,
198,
6738,
4566,
1330,
2251,
62,
15042,
201,
198,
201,
198,
201,
198,
2,
6284,
796,
4184,
538,
88,
13,
23621,
1071,
25060,
7203,
10943,
50,
5883,
1137,
62,
20373,
1600,
366,
10943,
50,
5883,
1137... | 2.381579 | 76 |
from contextlib import ExitStack
from trace_cockpit.models import TraceConfig
| [
6738,
4732,
8019,
1330,
29739,
25896,
198,
198,
6738,
12854,
62,
21517,
15544,
13,
27530,
1330,
34912,
16934,
628,
628
] | 4.1 | 20 |
# -*- coding: utf-8 -*-
# Copyright 2019 ICON Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
13130,
314,
10943,
5693,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
7... | 2.388957 | 2,463 |
import django_version
import authorized
import handlers
| [
11748,
42625,
14208,
62,
9641,
198,
11748,
10435,
198,
11748,
32847,
628,
198
] | 4.461538 | 13 |
#
# Copyright (C) 2014-2021 S[&]T, The Netherlands.
#
from __future__ import absolute_import, division, print_function
__version__ = "5.1"
__copyright__ = "Copyright (C) 2014-2021 S[&]T, The Netherlands."
__all__ = ["Error", "InternalError", "Struct", "Archive", "open", "config_path"]
import os as _os
from muninn.... | [
2,
198,
2,
15069,
357,
34,
8,
1946,
12,
1238,
2481,
311,
58,
5,
60,
51,
11,
383,
12671,
13,
198,
2,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
834,
9641,
834,
796,
366,
20... | 3.055556 | 144 |
from typing import Any, Iterable, Optional
from explainaboard import feature
from explainaboard.tasks import TaskType
from explainaboard.info import SysOutputInfo
class Processor:
"""Base case for task-based processor"""
_features: feature.Features
_task_type: TaskType
| [
6738,
19720,
1330,
4377,
11,
40806,
540,
11,
32233,
198,
6738,
4727,
397,
11953,
1330,
3895,
198,
6738,
4727,
397,
11953,
13,
83,
6791,
1330,
15941,
6030,
198,
6738,
4727,
397,
11953,
13,
10951,
1330,
311,
893,
26410,
12360,
628,
198,
... | 3.594937 | 79 |
# Generated by Django 3.0.4 on 2020-03-23 02:58
from decimal import Decimal
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import jsonfield.fields
import multiselectfield.db.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
19,
319,
12131,
12,
3070,
12,
1954,
7816,
25,
3365,
198,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
11748,
42625,
14208,
13,
7295,
13,
12102,
2... | 3.282609 | 92 |
"""State Generator"""
from lesson17_projects.pen.auto_gen.data.const import A, INIT, IS, PEN, THIS
# States
from lesson18_projects.pen.auto_gen.code.states1.init_this_is_a import InitThisIsAState
from lesson18_projects.pen.auto_gen.code.states1.init_this_is import InitThisIsState
from lesson18_projects.pen.auto_gen.co... | [
37811,
9012,
35986,
37811,
198,
6738,
11483,
1558,
62,
42068,
13,
3617,
13,
23736,
62,
5235,
13,
7890,
13,
9979,
1330,
317,
11,
3268,
2043,
11,
3180,
11,
350,
1677,
11,
12680,
198,
198,
2,
1829,
198,
6738,
11483,
1507,
62,
42068,
13... | 2.277129 | 599 |
# hotkey_utils.py - bNull
#
# Some useful shortcuts for binding to hotkeys. Current output/hotkeys:
#
# [+] Bound make_dwords to Ctrl-Alt-D
# [+] Bound make_cstrings to Ctrl-Alt-A
# [+] Bound make_offset to Ctrl-Alt-O
import idaapi
import idc
import inspect
def selection_is_valid(selection, ea):
"""If the cursor... | [
2,
3024,
2539,
62,
26791,
13,
9078,
532,
275,
35067,
198,
2,
220,
198,
2,
2773,
4465,
32953,
329,
12765,
284,
3024,
13083,
13,
9236,
5072,
14,
8940,
13083,
25,
198,
2,
198,
2,
47175,
30149,
787,
62,
67,
10879,
284,
19212,
12,
2916... | 2.368381 | 1,303 |
import math
import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
testing.run_module(__name__, __file__)
| [
11748,
10688,
198,
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
198,
11748,
2237,
198,
198,
11748,
6333,
263,
198,
6738,
6333,
263,
1330,
269,
15339,
198,
6738,
6333,
263,
1330,
5499,
198,
6738,
6333,
263,
1330,
31312,
62,
9122,
... | 3.581395 | 86 |
#!/usr/bin/python
import tarfile
unsafe_filename_tar = sys.argv[1]
safe_filename_tar = "safe_path.tar"
tar = tarfile.open(safe_filename_tar)
for entry in tar:
tar.extract(entry)
tar = tarfile.open(unsafe_filename_tar)
tar.extractall()
tar.close()
tar = tarfile.open(unsafe_filename_tar)
for entry in tar:
ta... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
13422,
7753,
198,
198,
13271,
8635,
62,
34345,
62,
18870,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
21230,
62,
34345,
62,
18870,
796,
366,
21230,
62,
6978,
13,
18870,
1,
628,
198,
... | 2.634691 | 761 |
import os
import io
import sys
import setuptools
from setuptools import setup
version = "1.0.0"
with io.open('README.md', 'r', encoding='utf-8') as readme_file:
readme = readme_file.read()
if sys.argv[-1] == 'readme':
print(readme)
sys.exit()
def parse_requirements(filename):
""" load requirements... | [
11748,
28686,
198,
11748,
33245,
198,
11748,
25064,
198,
11748,
900,
37623,
10141,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
9641,
796,
366,
16,
13,
15,
13,
15,
1,
198,
198,
4480,
33245,
13,
9654,
10786,
15675,
11682,
1... | 2.522727 | 528 |
import sys
from pathlib import Path
import environ
env = environ.Env()
env_file = ".env"
# This works good enough for the console, pycharm and travis ci
TESTING = sys.argv[1:2] == ["test"] or "pytest" in sys.modules
if env.str("ENV_PATH", None):
env_file = env.str("ENV_PATH")
assert Path(env_file).is_file()
... | [
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
551,
2268,
198,
198,
24330,
796,
551,
2268,
13,
4834,
85,
3419,
198,
24330,
62,
7753,
796,
27071,
24330,
1,
198,
198,
2,
770,
2499,
922,
1576,
329,
262,
8624,
11,
12... | 2.692308 | 208 |
from .connection import LDAPConnection, Server
__all__ = ['LDAPConnection', 'Server']
__version__ = '0.4.2'
| [
6738,
764,
38659,
1330,
27178,
2969,
32048,
11,
9652,
198,
198,
834,
439,
834,
796,
37250,
11163,
2969,
32048,
3256,
705,
10697,
20520,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
19,
13,
17,
6,
198
] | 2.972973 | 37 |
"""
Example EDMC plugin.
It adds a single button to the EDMC interface that displays the number of times it has been clicked.
"""
# Copyright (c) 2020 Club Raiders Project
# https://github.com/HausReport/ClubRaiders
#
# SPDX-License-Identifier: BSD-3-Clause
import logging
import os
import tkinter as tk
from typ... | [
37811,
198,
16281,
8392,
9655,
13877,
13,
198,
1026,
6673,
257,
2060,
4936,
284,
262,
8392,
9655,
7071,
326,
11298,
262,
1271,
286,
1661,
340,
468,
587,
28384,
13,
198,
37811,
198,
198,
2,
220,
220,
15069,
357,
66,
8,
12131,
6289,
1... | 2.700104 | 1,924 |
'''
Created on Jan 16, 2014
@author: sean
'''
from __future__ import absolute_import, division, print_function
from functools import partial
import json
import logging
import os
import sys
import jinja2
from .conda_interface import PY3
from .environ import get_dict as get_environ
from .metadata import select_lines,... | [
7061,
6,
198,
41972,
319,
2365,
1467,
11,
1946,
198,
198,
31,
9800,
25,
384,
272,
198,
7061,
6,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
... | 2.362468 | 1,167 |
import argparse
from experiments.income_census.train_config import fine_tune_hyperparameters, data_hyperparameters
from experiments.income_census.train_census_no_fg_adapt_pretrain import create_no_fg_census_global_model
from experiments.income_census.train_census_utils import finetune_census
if __name__ == "__main_... | [
11748,
1822,
29572,
198,
198,
6738,
10256,
13,
12519,
62,
66,
7314,
13,
27432,
62,
11250,
1330,
3734,
62,
83,
1726,
62,
49229,
17143,
7307,
11,
1366,
62,
49229,
17143,
7307,
198,
6738,
10256,
13,
12519,
62,
66,
7314,
13,
27432,
62,
... | 2.260116 | 519 |
PRJ_PATH = "/home/junkyul/conda/gmid2"
import sys
sys.path.append(PRJ_PATH)
import os
import time
from pprint import PrettyPrinter
pp = PrettyPrinter(indent=4)
from gmid2.global_constants import *
from gmid2.basics.uai_files import read_limid, read_svo
from gmid2.basics.directed_network import DecisionNetwork
from gm... | [
4805,
41,
62,
34219,
796,
12813,
11195,
14,
73,
28898,
377,
14,
66,
13533,
14,
70,
13602,
17,
1,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
4805,
41,
62,
34219,
8,
198,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
27... | 2.265537 | 354 |
from django.shortcuts import render, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.models import User
from django.views.generic import (
ListView,
DetailView,
CreateView,
UpdateView,
DeleteView
)
from .models import Post
fro... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
19816,
1040,
1330,
23093,
37374,
35608,
259,
11,
11787,
47,
13978,
14402,
35608,
259,
198,
... | 3.083333 | 168 |
import mysql.connector
from geopy.geocoders import Nominatim
from instagram.client import InstagramAPI
import json
import urllib2
import flickr
INSTAGRAM_CLIENT_ID = '5d56eb1e594c420997c394d1dca7fcea'
INSTAGRAM_CLIENT_SECRET = 'd0d78baa1e4e4f4b8af9fd9588379968'
api = InstagramAPI(client_id=INSTAGRAM_CLIENT_ID,client_... | [
11748,
48761,
13,
8443,
273,
198,
6738,
4903,
11081,
13,
469,
420,
375,
364,
1330,
399,
6351,
265,
320,
198,
6738,
916,
6713,
13,
16366,
1330,
10767,
17614,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
17,
198,
11748,
781,
18994,
19... | 2.405797 | 414 |
from calamari_ocr.ocr.backends.ctc_decoder.ctc_decoder import CTCDecoder
import numpy as np
if __name__ == "__main__":
d = FuzzyCTCDecoder()
r = d.decode(np.array(np.transpose([[0.8, 0, 0.7, 0.2, 0.1], [0.1, 0.4, 0.2, 0.7, 0.8], [0.1, 0.6, 0.1, 0.1, 0.1]])))
print(r)
| [
6738,
35765,
2743,
62,
1696,
13,
1696,
13,
1891,
2412,
13,
310,
66,
62,
12501,
12342,
13,
310,
66,
62,
12501,
12342,
1330,
327,
4825,
10707,
12342,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
361,
11593,
3672,
834,
6624,
... | 1.868421 | 152 |
from django.forms import ModelForm
from itembase.core.models import UnitOfMeasure, VendorItem
| [
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
198,
198,
6738,
2378,
8692,
13,
7295,
13,
27530,
1330,
11801,
5189,
47384,
11,
39896,
7449,
628,
198
] | 3.730769 | 26 |
import io
import json
import tempfile
import pytest
import yaml
from yaml.parser import ParserError as YamlParserError
from pji.utils import auto_load_json, JsonLoadError
@pytest.mark.unittest
| [
11748,
33245,
198,
11748,
33918,
198,
11748,
20218,
7753,
198,
198,
11748,
12972,
9288,
198,
11748,
331,
43695,
198,
6738,
331,
43695,
13,
48610,
1330,
23042,
263,
12331,
355,
14063,
75,
46677,
12331,
198,
198,
6738,
279,
7285,
13,
26791,... | 3.126984 | 63 |
from jsonauthenticator.jsonauthenticator import JsonAuthenticator
__all__ = [JsonAuthenticator]
| [
6738,
33918,
41299,
26407,
13,
17752,
41299,
26407,
1330,
449,
1559,
47649,
26407,
198,
834,
439,
834,
796,
685,
41,
1559,
47649,
26407,
60,
198
] | 3.84 | 25 |
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
import app_config
import datetime
import logging
import requests
import shortcodes
from render_utils import make_context
from PIL import Image
from StringIO import StringIO
from functools import partial
from jinja2 import Environment, FileSystemLoader
from pymongo import Mo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
4808,
9,
62,
19617,
25,
40477,
12,
23,
4808,
9,
62,
198,
11748,
598,
62,
11250,
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
7007,
198,
11748,
1790,
40148,
198,
6738,
85... | 2.258024 | 2,368 |
# Generated by Django 2.0.7 on 2018-07-27 12:02
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
22,
319,
2864,
12,
2998,
12,
1983,
1105,
25,
2999,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.818182 | 44 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# pylint: disable=invalid-name,missing-docstring
from __future__ import absolute_import, division, print_function, unicode_literals
import... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
25,
357,
66,
8,
13130,
11,
32167,
370,
494,
364,
4275,
67,
363,
86,
494,
364,
8,
1279,
67,
363,
31,
86,
494,
364,
13,
785,
29,
198,
2,
22961,
3611,
509... | 2.509434 | 212 |
# -*- coding: utf-8 -*-
"""Revision cleaning utilties.
Copyright 2017 Google Inc.
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,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
18009,
1166,
12724,
3384,
2326,
444,
13,
198,
198,
15269,
2177,
3012,
3457,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,... | 2.152498 | 1,141 |
#!/usr/bin/env python3
#
# MIS Timetable Splitter
#
# Split a combined HTML exported Student Timetable from a common Management
# Information System (MIS) product, that shall remain nameless, into individual
# per-student files.
#
#
# Copyright 2019 Test Valley School.
#
# Licensed under the Apache License, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
201,
198,
2,
50029,
5045,
316,
540,
13341,
1967,
201,
198,
2,
201,
198,
2,
27758,
257,
5929,
11532,
29050,
13613,
5045,
316,
540,
422,
257,
2219,
8549,
201,
198,
2,
618... | 3.000803 | 1,245 |
import unittest
from covid19_icta import scrape
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
39849,
312,
1129,
62,
713,
64,
1330,
42778,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.538462 | 39 |
from .union import UnionType, UnionInfo
__all__ = ['UnionType', 'UnionInfo']
| [
6738,
764,
24592,
1330,
4479,
6030,
11,
4479,
12360,
198,
198,
834,
439,
834,
796,
37250,
38176,
6030,
3256,
705,
38176,
12360,
20520,
198
] | 3.25 | 24 |
"""
List items of
```
{
"AccountId": string,
"ClusterArn": string,
"HighSeverityCount": sum-of-critical-and-high-severity,
"Image": string,
"LastStatus": string,
"LaunchType": string,
"Region": string,
"TaskArn": string
}
```
"""
from boto3.session import Session
from botocore.exceptions import ClientEr... | [
37811,
198,
8053,
3709,
286,
198,
15506,
63,
198,
90,
198,
220,
366,
30116,
7390,
1298,
4731,
11,
198,
220,
366,
2601,
5819,
3163,
77,
1298,
4731,
11,
198,
220,
366,
11922,
50,
964,
414,
12332,
1298,
2160,
12,
1659,
12,
34666,
12,
... | 3.066667 | 300 |
import itertools
from typing import Any, Optional
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.axes_grid1 import make_axes_locatable
from receptivefield.common import estimate_rf_from_gradient
from receptivefield.image import get_default_image
from receptiv... | [
11748,
340,
861,
10141,
198,
6738,
19720,
1330,
4377,
11,
32233,
198,
198,
11748,
2603,
29487,
8019,
13,
8071,
2052,
355,
16082,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738... | 2.199725 | 2,914 |
"""Implementation of the Bukin N. 6 function as in the link below. The number of
problem dimensions is arbitrary, as well as the bounds.
https://www.sfu.ca/~ssurjano/bukin6.html
"""
from .function import Function
import torch
| [
37811,
3546,
32851,
286,
262,
36810,
259,
399,
13,
718,
2163,
355,
287,
262,
2792,
2174,
13,
383,
1271,
286,
198,
45573,
15225,
318,
14977,
11,
355,
880,
355,
262,
22303,
13,
198,
5450,
1378,
2503,
13,
82,
20942,
13,
6888,
14,
93,
... | 3.424242 | 66 |
from django.urls import path
from d2e_share_splitter.sharecontributions import views
app_name = "sharecontributions"
urlpatterns = [
# Django Ajax CRUD Operations
path("contribs/", views.ContribsView.as_view(), name="list_contribs"),
# path('contribs/log', views.ContribsLog.as_view(), name='log_contribs'... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
288,
17,
68,
62,
20077,
62,
22018,
1967,
13,
20077,
3642,
2455,
507,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
366,
20077,
3642,
2455,
507,
1,
198,
198,
6371,
33279,
82,... | 2.362989 | 281 |
# encoding: utf-8
from Storm.Localized import Strings as LocalizedStrings
from Storm.GameData import Catalog
from sys import argv, stderr
from os.path import exists
if __name__ != '__main__':
print_utf8_e('herotrivia.py is a CLI file, not a module')
exit(-1)
if len(argv) < 2:
print_utf8_e('Usage: python %... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
6738,
8865,
13,
14565,
1143,
1330,
4285,
654,
355,
10714,
1143,
13290,
654,
198,
6738,
8865,
13,
8777,
6601,
1330,
44515,
198,
6738,
25064,
1330,
1822,
85,
11,
336,
1082,
81,
198,
6738,
28686,
13... | 2.383054 | 1,133 |
import glob
from os import system
files = glob.glob("*.py") + glob.glob("cfdl/*.py")
system("python3 -m black . --line-length 79")
for file in files:
# system(f"python3 -m pybetter {file}")
system(f"python3 -m isort {file}")
__all__ = ["files"]
| [
11748,
15095,
198,
6738,
28686,
1330,
1080,
198,
198,
16624,
796,
15095,
13,
4743,
672,
7203,
24620,
9078,
4943,
1343,
15095,
13,
4743,
672,
7203,
12993,
25404,
15211,
13,
9078,
4943,
198,
10057,
7203,
29412,
18,
532,
76,
2042,
764,
137... | 2.575758 | 99 |
import json
import sys
import pandas as pd
# noinspection SpellCheckingInspection
EXAMPLE_CTRL_JSON = """######### EXAMPLE JSON: #########
{
"save_path": "./basic_stat.csv",
"data": [
{
"name": "Baseline",
"csv_path": "./similarity_score.csv",
"col_name": "baselin... | [
11748,
33918,
198,
11748,
25064,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
645,
1040,
14978,
11988,
9787,
278,
818,
31308,
198,
6369,
2390,
16437,
62,
4177,
7836,
62,
40386,
796,
37227,
7804,
2,
7788,
2390,
16437,
19449,
25,
... | 2.035165 | 455 |
import aiohttp
import datetime
import json
import logging
from .error import NeoAsyncHTTPyException
from .utils import Timer
logger = logging.getLogger(__name__)
| [
11748,
257,
952,
4023,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
764,
18224,
1330,
21227,
42367,
40717,
88,
16922,
198,
6738,
764,
26791,
1330,
5045,
263,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
1... | 3.428571 | 49 |
import os
import sys
from distutils.sysconfig import get_python_lib
from setuptools import find_packages, setup
setup(
name='arrested',
version='0.1.3',
author='Mikey Waites',
author_email='mike@oldstlabs.com',
url='https://github.com/mikeywaites/flask-arrested',
description=('A framework for ... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
1233,
26791,
13,
17597,
11250,
1330,
651,
62,
29412,
62,
8019,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
283,
2... | 2.726916 | 509 |
import inspect
import celery
from kombu import Queue, Exchange
from sqlalchemy.engine.url import URL
| [
11748,
10104,
198,
198,
11748,
18725,
1924,
198,
6738,
479,
2381,
84,
1330,
4670,
518,
11,
12516,
198,
6738,
44161,
282,
26599,
13,
18392,
13,
6371,
1330,
10289,
628
] | 3.551724 | 29 |
# Make a particles.in file for a streak line
# Continuous release from single source
from numpy import linspace
start_time = "1989-05-24T12"
num_particles = 1001
# Release point in grid coordinates
x, y = 115, 100
zmax = 200
Z = linspace(zmax, 0, num_particles)
with open("station.rls", mode="w") as f:
for z in... | [
2,
6889,
257,
13166,
13,
259,
2393,
329,
257,
15113,
1627,
198,
2,
45012,
2650,
422,
2060,
2723,
198,
198,
6738,
299,
32152,
1330,
300,
1040,
10223,
198,
198,
9688,
62,
2435,
796,
366,
25475,
12,
2713,
12,
1731,
51,
1065,
1,
198,
... | 2.45122 | 164 |
#!/usr/bin/env python
from __future__ import absolute_import, division
from math import sqrt
from scipy.optimize import brentq
from common import func1, MIN_MACH, MAX_MACH
from constants import GAMMA
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
201,
198,
201,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
201,
198,
201,
198,
6738,
10688,
1330,
19862,
17034,
201,
198,
201,
198,
6738,
629,
541,
88,
13,
40... | 2.489362 | 94 |
import json
import sys
import random
from argparse import ArgumentParser
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.optim import RMSprop
from torch.optim.lr_scheduler import StepLR
from loader import load_data, load_ontology, load_embed, load_sys_vocab, load_kb
from kb... | [
11748,
33918,
198,
11748,
25064,
198,
11748,
4738,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
28034... | 3.331395 | 172 |
from pybox.math import vec2d
from pybox.math import matrix
from pybox.math import transform | [
6738,
12972,
3524,
13,
11018,
1330,
43030,
17,
67,
198,
6738,
12972,
3524,
13,
11018,
1330,
17593,
198,
6738,
12972,
3524,
13,
11018,
1330,
6121
] | 3.64 | 25 |
#
# Memento Pi
# Utilities for dsiplaying notification on the raspberry pi
#
import time
import threading
from gpiozero import TonalBuzzer
buzzer = TonalBuzzer(23)
# play a tone on the buzzer
| [
2,
198,
2,
337,
972,
78,
13993,
198,
2,
41086,
329,
288,
13396,
17916,
14483,
319,
262,
38973,
31028,
198,
2,
628,
198,
11748,
640,
198,
11748,
4704,
278,
198,
6738,
27809,
952,
22570,
1330,
16859,
282,
48230,
263,
198,
198,
65,
471... | 3.145161 | 62 |
import torch
import torch.nn as nn
import torch.nn.functional as F
#from lib.config import cfg
#import lib.utils as utils
# h -- batch_size * cfg.MODEL.RNN_SIZE
# att_feats -- batch_size * att_num * att_feats_dim
# p_att_feats -- batch_size * att_num * cfg.ATT_HIDDEN_SIZE | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
2,
6738,
9195,
13,
11250,
1330,
30218,
70,
198,
2,
11748,
9195,
13,
26791,
355,
3384,
4487,
628,
220,
220,
220,
1303,
... | 2.544643 | 112 |
# /etc/passwd fields.
_PASSWD_FIELDS = ('login', 'password', 'uid', 'gid', 'name', 'home', 'shell')#
| [
2,
1220,
14784,
14,
6603,
16993,
7032,
13,
198,
62,
47924,
22332,
62,
11674,
3698,
5258,
796,
19203,
38235,
3256,
705,
28712,
3256,
705,
27112,
3256,
705,
70,
312,
3256,
705,
3672,
3256,
705,
11195,
3256,
705,
29149,
11537,
2,
198
] | 2.463415 | 41 |
import os
import pathlib
import tkinter as tk
class HelpWindow(tk.Toplevel):
'''
Toplevel window for displaying the help pannel
'''
| [
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
198,
4871,
10478,
27703,
7,
30488,
13,
51,
643,
626,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
309,
643,
626,
4324,
329,
19407,
262,
... | 2.314286 | 70 |
import logging
from search.models import Task, TaskSimilarityScore, TaskServiceSimilarityScore
from human_services.services.models import Service
LOGGER = logging.getLogger(__name__)
| [
11748,
18931,
198,
6738,
2989,
13,
27530,
1330,
15941,
11,
15941,
18925,
414,
26595,
11,
15941,
16177,
18925,
414,
26595,
198,
6738,
1692,
62,
30416,
13,
30416,
13,
27530,
1330,
4809,
198,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
... | 3.8 | 50 |
# coding: utf-8
import argparse
import os
import starwar
SUPPORTED_BACKEND = ('json', 'mongodb', 'mysql', 'sqlite')
def expand_path(path):
"""Return the absolute path for a given path.
Expand `~` and `.` characters, transform relative path to absolute one.
"""
if path is None:
path = 'data... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
198,
11748,
3491,
5767,
198,
198,
40331,
15490,
1961,
62,
31098,
10619,
796,
19203,
17752,
3256,
705,
31059,
375,
65,
3256,
705,
28744,
13976,
3256,
... | 2.405512 | 254 |
# Generated by Django 3.1.5 on 2021-01-29 10:34
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
20,
319,
33448,
12,
486,
12,
1959,
838,
25,
2682,
201,
198,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
201,
198,
201,
198
] | 2.485714 | 35 |
"""Definition of the WordHippoEngine."""
import argparse
from collections.abc import Callable, Iterable
from dataclasses import dataclass
from enum import IntEnum
from typing import IO, Optional
from urllib.parse import quote
import lxml.etree
import requests
from dict.colors import COLOR_HIGHLIGHT, COLOR_RESET
from ... | [
37811,
36621,
286,
262,
9678,
39,
3974,
78,
13798,
526,
15931,
198,
11748,
1822,
29572,
198,
6738,
17268,
13,
39305,
1330,
4889,
540,
11,
40806,
540,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
33829,
1330,
2558,
483... | 2.395257 | 1,518 |
"""Test the Arnoldi implementation."""
from dla.linalg import arnoldi
import numpy as np
import numpy.testing as npt
from scipy.linalg import subspace_angles
a = np.array([
[9.0, 1.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 8.0, 1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 5.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 6.0, 1.0, 0.0],
... | [
37811,
14402,
262,
21418,
72,
7822,
526,
15931,
198,
6738,
288,
5031,
13,
75,
1292,
70,
1330,
610,
77,
727,
72,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
33407,
355,
299,
457,
198,
6738,
629,
541,
88,
13,
75,
... | 1.96286 | 1,077 |
import urllib.parse, urllib.request, json, ssl
# Authentication and API Requests
# LEARNING LAB 2 Cisco Kinetic for Cities
# The Initial login steps are the same as Learning Lab 1.
# You can skip ahead to 'LEARNING LAB 2 CODE BEGINS HERE'
#Ignore invalid Certificates
ssl._create_default_https_context = ssl._create_... | [
11748,
2956,
297,
571,
13,
29572,
11,
2956,
297,
571,
13,
25927,
11,
33918,
11,
264,
6649,
198,
198,
2,
48191,
290,
7824,
9394,
3558,
198,
198,
2,
12509,
1503,
15871,
406,
6242,
362,
220,
28289,
16645,
5139,
329,
20830,
198,
2,
383,... | 3.107488 | 828 |
import pkg_resources
import requests
import pip
from gitcd.exceptions import GitcdPyPiApiException
| [
11748,
279,
10025,
62,
37540,
198,
11748,
7007,
198,
11748,
7347,
198,
6738,
17606,
10210,
13,
1069,
11755,
1330,
15151,
10210,
20519,
38729,
32,
14415,
16922,
628
] | 3.703704 | 27 |
from charlatan.helper import fetch
from random import choice, uniform
from charlatan.misc.business import CURRENCIES, CURRENCY_SYMBOLS
| [
6738,
1149,
15460,
272,
13,
2978,
525,
1330,
21207,
201,
198,
6738,
4738,
1330,
3572,
11,
8187,
201,
198,
6738,
1149,
15460,
272,
13,
44374,
13,
22680,
1330,
327,
31302,
24181,
11015,
11,
327,
31302,
45155,
62,
23060,
10744,
3535,
50,
... | 3.159091 | 44 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.testutils import TestCase, fixture
from sentry.interfaces import Query
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
1908,
563,
13,
9288,
26791,
1330,
6208,
20448,
11,
29220,
198,
6738,
1908,
563,
13,
3849,
32186,
133... | 3.23913 | 46 |
#Exercício 3
#A - 1,3,5,7,
#B 2,4,8,16,32,64
#C 0,1,4,9,16,32,49
#D 4,16,36,64
#E 1,1,2,3,5,8
#F 2,10,12,16,17,18,19
print(f'O proximo termo: 200. Nao achei uma forma logica de calcular o valor, apenas supondo que todos comecem com a leta D')
exA(5)
print('\n')
exB(7)
print('\n')
exC(8)
prin... | [
2,
3109,
2798,
8836,
66,
952,
513,
198,
198,
2,
32,
532,
352,
11,
18,
11,
20,
11,
22,
11,
198,
220,
220,
220,
220,
198,
2,
33,
362,
11,
19,
11,
23,
11,
1433,
11,
2624,
11,
2414,
198,
220,
220,
220,
220,
220,
220,
220,
220,... | 1.672489 | 229 |
# Create nodes associated with Master Controller Board of Shoelace Antenna matching network.
# 23 Jan 2012, Ted Golfinopoulos
from MDSplus import *
tree=Tree("MAGNETICS", -1) #Open model tree
#For now, do work on a test shot until design is in steady state.
s=1120125998
tree.createPulse(s) #Create a test shot
tree = ... | [
2,
13610,
13760,
3917,
351,
5599,
22741,
5926,
286,
16509,
417,
558,
3738,
13713,
12336,
3127,
13,
198,
2,
2242,
2365,
2321,
11,
11396,
19709,
259,
20338,
198,
198,
6738,
337,
5258,
9541,
1330,
1635,
198,
198,
21048,
28,
27660,
7203,
... | 2.933242 | 1,453 |
import logging
import logging.handlers
import time
from typing import Literal, List, Any
from pidal import NAME
from pidal.config import LoggingConfig
logger = logging.getLogger(NAME)
handler_map = {
"NullHandler": logging.NullHandler,
"StreamHandler": logging.StreamHandler,
"FileHandler": ... | [
11748,
18931,
198,
11748,
18931,
13,
4993,
8116,
198,
11748,
640,
198,
198,
6738,
19720,
1330,
25659,
1691,
11,
7343,
11,
4377,
198,
198,
6738,
279,
11624,
1330,
36751,
198,
6738,
279,
11624,
13,
11250,
1330,
5972,
2667,
16934,
628,
198... | 2.830508 | 236 |
import json
import re
from textwrap import dedent
def parse_gh_output(result):
"""Extract a dict of GitHub Workflow set-output variables from result's output"""
matches = re.findall(r"::set-output\s+name=(\w+)::(.*)\n", result.out)
if matches is None:
return dict()
return dict(matches)
def ... | [
11748,
33918,
198,
11748,
302,
198,
6738,
2420,
37150,
1330,
4648,
298,
628,
198,
4299,
21136,
62,
456,
62,
22915,
7,
20274,
2599,
198,
220,
220,
220,
37227,
11627,
974,
257,
8633,
286,
21722,
5521,
11125,
900,
12,
22915,
9633,
422,
1... | 2.027577 | 2,357 |
#!/usr/local/bin/python
# Code Fights Chess Board Cell Color Problem
def chessBoardCellColor(cell1, cell2):
'''
Determine if the two given cells on chess board are same color
A, C, E, G odd cells are same color as B, D, F, H even cells
'''
return get_color(cell1) == get_color(cell2)
if __name__... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
198,
2,
6127,
376,
2337,
25774,
5926,
12440,
5315,
20647,
628,
198,
4299,
19780,
29828,
28780,
10258,
7,
3846,
16,
11,
2685,
17,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
22... | 2.710938 | 128 |
# Challenge 16 Easy
| [
2,
13879,
1467,
16789,
201,
198,
201,
198
] | 2.875 | 8 |
import json
with open('pokemons.json') as file:
content = file.read() # leitura do arquivo
pokemons = json.loads(content)['results'] # o conteúdo é transformado em estrutura python equivalente, dicionário neste caso.
# acessamos a chave results que é onde contém nossa lista de pokemons
print(pokemons[... | [
11748,
33918,
628,
198,
4480,
1280,
10786,
35924,
11567,
13,
17752,
11537,
355,
2393,
25,
198,
220,
220,
220,
2695,
796,
2393,
13,
961,
3419,
220,
1303,
443,
270,
5330,
466,
610,
421,
23593,
198,
220,
220,
220,
22620,
11567,
796,
3391... | 2.738526 | 719 |
#!/usr/local/bin/python3
# ZyExpander: A Nested ZipFile Expander For ZyBooks.
# By: Michael Green
# Expands and organizes by student nested zip files that ZyBook's grading
# system uses for some reason.
import zipfile
import os
import argparse
# Goes through our argument list and pulls out the files to process along ... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
2,
40905,
16870,
4066,
25,
317,
399,
7287,
38636,
8979,
5518,
4066,
1114,
40905,
30650,
13,
198,
2,
2750,
25,
3899,
3469,
198,
2,
5518,
1746,
290,
1618,
4340,
416,
3710,
2837... | 3.858407 | 113 |
#!/usr/bin/env python
import os
import pygame
# Run like this: MapImageToDatConverter.py ..\unusedAssets\maps\brecconary.png data\maps\brecconary.dat
if __name__ == '__main__':
try:
main()
except Exception as e:
import sys
import traceback
print(traceback.format_exception(No... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
11748,
12972,
6057,
628,
198,
2,
5660,
588,
428,
25,
9347,
5159,
2514,
27354,
3103,
332,
353,
13,
9078,
11485,
59,
403,
1484,
8021,
1039,
59,
31803,
59,
4679,
... | 1.90566 | 265 |
from faker import Faker
fake = Faker() | [
6738,
277,
3110,
1330,
376,
3110,
198,
198,
30706,
796,
376,
3110,
3419
] | 3 | 13 |
from ._download import download
def titanic(directory: str):
"""downloads 'titanic.csv' in the given directory"""
download(directory, "titanic.csv",
"https://drive.google.com/file/d/"
"1LYjbHW3wyJSMzGMMCmaOFNA_RIKqxRoI/view?usp=sharing")
| [
6738,
47540,
15002,
1330,
4321,
628,
198,
4299,
5259,
26277,
7,
34945,
25,
965,
2599,
198,
220,
220,
220,
37227,
15002,
82,
705,
83,
18642,
291,
13,
40664,
6,
287,
262,
1813,
8619,
37811,
198,
220,
220,
220,
4321,
7,
34945,
11,
366,... | 2.283333 | 120 |
from array import *
fibo()
| [
6738,
7177,
1330,
1635,
198,
198,
69,
26762,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220
] | 1.782609 | 23 |
# Copyright (c) 2015 Hewlett-Packard. 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 appl... | [
2,
15069,
357,
66,
8,
1853,
30446,
15503,
12,
11869,
446,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
407,
779,
428,
... | 1.779121 | 14,895 |
import datajoint as dj
default_prefix = 'adamacs_'
if 'custom' not in dj.config:
dj.config['custom'] = {}
db_prefix = dj.config['custom'].get('database.prefix', default_prefix)
| [
11748,
1366,
73,
1563,
355,
42625,
198,
198,
12286,
62,
40290,
796,
705,
324,
11494,
82,
62,
6,
198,
198,
361,
705,
23144,
6,
407,
287,
42625,
13,
11250,
25,
198,
220,
220,
220,
42625,
13,
11250,
17816,
23144,
20520,
796,
23884,
628... | 2.80303 | 66 |
from test_utils import get_rendered_file
| [
6738,
1332,
62,
26791,
1330,
651,
62,
26238,
62,
7753,
628
] | 3.818182 | 11 |
import json
import requests
# noinspection PyUnresolvedReferences
from six.moves.urllib.parse import urljoin
from .base import AnymailBaseBackend, BasePayload
from ..exceptions import AnymailRequestsAPIError, AnymailSerializationError
from .._version import __version__
class AnymailRequestsBackend(AnymailBaseBacken... | [
11748,
33918,
198,
198,
11748,
7007,
198,
2,
645,
1040,
14978,
9485,
3118,
411,
5634,
19927,
198,
6738,
2237,
13,
76,
5241,
13,
333,
297,
571,
13,
29572,
1330,
19016,
22179,
198,
198,
6738,
764,
8692,
1330,
4377,
4529,
14881,
7282,
43... | 2.510689 | 1,684 |
# @Team:Big Data Group
# @Time:2020/7/6 16:10
# @Author:albert·bing
# @File:MysqlUtil.py
# @Software:PyCharm
# start your code
import pymysql
# 测试
host = '81.70.166.101'
# 生产
# host='172.21.0.49'
password = 'r1kJzB'
port = 3306
# 黄历数据入库
# 查询日期
# 星座日数据入库
# 星座周数据入库
# 星座月数据入库
# 星座年数据入库
# 星座详情码表入库
# 插入日历... | [
2,
2488,
15592,
171,
120,
248,
12804,
6060,
4912,
198,
2,
2488,
7575,
171,
120,
248,
42334,
14,
22,
14,
21,
1467,
25,
940,
198,
2,
2488,
13838,
171,
120,
248,
282,
4835,
9129,
4623,
198,
2,
2488,
8979,
171,
120,
248,
44,
893,
13... | 0.933852 | 514 |
#!/usr/bin/env python3
"""PyBluez advanced example l2-unreliable-client.py"""
import sys
import bluetooth
import bluetooth._bluetooth as bluez # low level bluetooth wrappers
# Create the client socket
sock = bluetooth.BluetoothSocket(bluetooth.L2CAP)
if len(sys.argv) < 4:
print("Usage: l2-unreliable-client.py ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
20519,
14573,
89,
6190,
1672,
300,
17,
12,
403,
2411,
3379,
12,
16366,
13,
9078,
37811,
198,
198,
11748,
25064,
198,
198,
11748,
48208,
16271,
198,
11748,
48208,
16271,
13557,... | 2.730769 | 494 |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... | [
2,
15069,
2864,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
198,
2,
921,
743,
407,
779,
428,
2393,
... | 2.417765 | 4,706 |
# -*- coding: utf-8 -*-
import unittest
from sdklib.http import HttpRequestContext
from sdklib.http.authorization import (
basic_authorization, x_11paths_authorization, X11PathsAuthentication, BasicAuthentication,
_get_11paths_serialized_headers
)
from sdklib.http.renderers import FormRenderer, JSONRenderer, ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
264,
34388,
8019,
13,
4023,
1330,
367,
29281,
18453,
21947,
198,
6738,
264,
34388,
8019,
13,
4023,
13,
9800,
1634,
1330,
357,
... | 2.810458 | 153 |
from kivy.uix.screenmanager import Screen
from kivy.lang import Builder
from kivy.properties import NumericProperty
from kivy.animation import Animation
from kivymd.app import MDApp
Builder.load_file('screens/titlescreen.kv')
| [
6738,
479,
452,
88,
13,
84,
844,
13,
9612,
37153,
1330,
15216,
198,
6738,
479,
452,
88,
13,
17204,
1330,
35869,
198,
6738,
479,
452,
88,
13,
48310,
1330,
399,
39223,
21746,
198,
6738,
479,
452,
88,
13,
11227,
341,
1330,
23535,
198,
... | 3 | 78 |
import abstract_parser
import os
import nltk
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
import argparse
import pandas as pd
from datetime import datetime
# TODO: read these from a file
COMMON = ['background', 'objetctive', 'objectives', 'introduction',
'methods', 'method', '... | [
11748,
12531,
62,
48610,
198,
11748,
28686,
198,
11748,
299,
2528,
74,
198,
6738,
299,
2528,
74,
13,
10215,
79,
385,
1330,
2245,
10879,
198,
6738,
299,
2528,
74,
13,
927,
13,
26634,
1330,
20890,
1273,
368,
647,
198,
11748,
1822,
29572... | 2.526984 | 315 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
13130,
2297,
10983,
198,
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
198,
2,
357,
3826,
27975,
45761,
393,
... | 2.281948 | 15,212 |