content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# _*_ coding: utf-8 _*_
"""
@copyright Copyright (c) 2014 Submit Consulting
@author Angel Sullon (@asullom)
@package home
Descripcion: Implementacion de los controladores de la app home
"""
from django.utils.translation import ugettext as _
from django.shortcuts import render
from django.http import HttpRes... | [
2,
4808,
9,
62,
19617,
25,
3384,
69,
12,
23,
4808,
9,
62,
198,
37811,
198,
31,
22163,
4766,
220,
220,
15069,
357,
66,
8,
1946,
39900,
41005,
198,
31,
9800,
220,
220,
220,
220,
220,
3905,
311,
724,
261,
4275,
292,
724,
296,
8,
... | 2.722449 | 245 |
from collections import defaultdict
from msg import Message
from plyer import notification
import time
import requests
import sys
# DO NOT COMMIT FILES WITH CREDENTIALS. Modify variables below as necessary.
email = 'EMAIL'
password = 'PASSWORD'
notification_flag = True
# receivers_carriers = [('000-000-0000', 'carrie... | [
6738,
17268,
1330,
4277,
11600,
198,
6738,
31456,
1330,
16000,
198,
6738,
35960,
263,
1330,
14483,
198,
11748,
640,
198,
11748,
7007,
198,
11748,
25064,
220,
198,
198,
2,
8410,
5626,
22240,
2043,
34020,
1546,
13315,
8740,
1961,
3525,
1257... | 2.707527 | 930 |
from ._base import BodyComponent
from ..helpers import parse_int, widthParser
from ..lib import merge_dicts
__all__ = ['MjDivider']
| [
198,
6738,
47540,
8692,
1330,
12290,
21950,
198,
6738,
11485,
16794,
364,
1330,
21136,
62,
600,
11,
9647,
46677,
198,
6738,
11485,
8019,
1330,
20121,
62,
11600,
82,
628,
198,
834,
439,
834,
796,
37250,
44,
73,
24095,
1304,
20520,
628
] | 3.317073 | 41 |
import keras.backend as K | [
11748,
41927,
292,
13,
1891,
437,
355,
509
] | 3.125 | 8 |
# Copyright 2022 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,
33160,
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.418504 | 2,313 |
from .printfn import PrintFn
from .printlnfn import PrintlnFn
from .readfn import ReadFn
| [
6738,
764,
4798,
22184,
1330,
12578,
37,
77,
198,
6738,
764,
35235,
22184,
1330,
12578,
18755,
37,
77,
198,
6738,
764,
961,
22184,
1330,
4149,
37,
77,
198
] | 3.178571 | 28 |
"""
This is is a part of the DeepLearning.AI TensorFlow Developer Professional Certificate offered on Coursera.
All copyrights belong to them. I am sharing this work here to showcase the projects I have worked on
Course: Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning
... | [
201,
198,
37811,
201,
198,
1212,
318,
318,
257,
636,
286,
262,
10766,
41730,
13,
20185,
309,
22854,
37535,
23836,
18612,
27895,
4438,
319,
2734,
2655,
64,
13,
201,
198,
201,
198,
3237,
2243,
49158,
5594,
284,
606,
13,
314,
716,
7373,
... | 2.755459 | 1,145 |
"""
Copyright 2020 Fazt Community ~ All rights reserved. MIT license.
"""
from typing import List
from discord import Color, Embed, Role, TextChannel
from discord.ext.commands import Bot, Cog, Context, group, has_permissions
from .. import crud
from ..enums import GuildSetting
from ..utils import to_code_list_str
ch... | [
37811,
198,
15269,
12131,
376,
1031,
83,
8108,
5299,
1439,
2489,
10395,
13,
17168,
5964,
13,
198,
37811,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
36446,
1330,
5315,
11,
13302,
276,
11,
20934,
11,
8255,
29239,
198,
6738,
36446,
13,
... | 3.077844 | 167 |
if __name__=='__main__':main()
"""3
0 1
1 2
2 0"""
| [
201,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
12417,
3419,
201,
198,
201,
198,
37811,
18,
201,
198,
15,
352,
201,
198,
16,
362,
201,
198,
17,
657,
37811,
201,
198
] | 1.714286 | 35 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321... | 4.141463 | 205 |
import numpy as np
import os
os.chdir('C:/Users/DELL/Desktop/Luis/Pset2')
import matplotlib.pyplot as plt
import test3 as ks
ks_g = ks.K_S(Gam = 2, state='bad')
Structure, Lgrid = ks_g.r_w_update()
N = Structure['Intensive Margin Policy']
K = Structure['Optimal Choice Capital']
plt.plot(K) | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
28686,
201,
198,
418,
13,
354,
15908,
10786,
34,
14079,
14490,
14,
7206,
3069,
14,
36881,
14,
25596,
271,
14,
47,
2617,
17,
11537,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
35... | 2.388889 | 126 |
# Imports from 3rd party libraries
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_table
import plotly.express as px
import pandas as pd
# Imports from this application
from app import app... | [
2,
1846,
3742,
422,
513,
4372,
2151,
12782,
198,
11748,
14470,
198,
11748,
14470,
62,
18769,
26418,
62,
5589,
3906,
355,
288,
15630,
198,
11748,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
198,
11748,
14470,
62,
6494,
62,
5589,
39... | 2.048264 | 10,484 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='words',
version='1.0',
description='Words has two functions: verify if a given word is a palindrome, and to spell check in ptbr a word or phrase',
author='Bruno Casella',
author_email='brunocasella@gmail.com',
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
10879,
3256,
198,
220,
... | 2.35782 | 422 |
from turtle import *
from snake import *
from random import *
| [
6738,
28699,
1330,
1635,
198,
6738,
17522,
1330,
1635,
198,
6738,
4738,
1330,
1635,
628
] | 4.2 | 15 |
if __name__ == "__main__":
print(generate_nth_primes(10001)[-1:][0])
| [
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,
8612,
378,
62,
77,
400,
62,
1050,
999,
7,
3064,
486,
38381,
12,
16,
25,
7131,
15,
12962,
198
] | 2.027027 | 37 |
import logging
import numpy as np
import pandas as pd
from ConfigSpace.hyperparameters import CategoricalHyperparameter, \
UniformFloatHyperparameter, UniformIntegerHyperparameter
__author__ = "Marius Lindauer"
__license__ = "BSD"
class FeatureGroupFiltering(object):
'''
based on the selected featur... | [
11748,
18931,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
17056,
14106,
13,
49229,
17143,
7307,
1330,
327,
2397,
12409,
38197,
17143,
2357,
11,
3467,
198,
220,
220,
220,
35712,
43879,
3... | 2.140741 | 1,890 |
from django.shortcuts import render, redirect
from django.contrib.auth.models import Permission
from django.urls import reverse
def index(request):
""" A view to return the index page """
user = request.user
# Check if user has already logged in and redirect to the payment page if unpaid or to definitio... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
2448,
3411,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
628,
198,
4299,
6376,
7,
25927,
2599,
198,
... | 3.258373 | 209 |
from i2b2tools.helpers.utils import has_overlapping_phi
from i2b2tools.lib.standoff_annotations import StandoffAnnotation
from i2b2tools.converters.common import *
from lxml import etree
"""Potential Improvements:
- These conversions follow the same pattern over and over, it could
potentially be abstracted.
- LBJ out... | [
6738,
1312,
17,
65,
17,
31391,
13,
16794,
364,
13,
26791,
1330,
468,
62,
2502,
75,
5912,
62,
34846,
198,
6738,
1312,
17,
65,
17,
31391,
13,
8019,
13,
1481,
2364,
62,
34574,
602,
1330,
5751,
2364,
2025,
38983,
198,
6738,
1312,
17,
... | 2.503774 | 1,590 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import v2_512
import os
class SSD(nn.Module):
"""Single Shot Multibox Architecture
The network is composed of a base VGG network followed by the
added multibox conv layers.... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
11685,
1330,
1635,
198,
6738,
1366,
1330,
410,
17,
62,
25836,
... | 2.126718 | 1,673 |
from app.database.conn import db
from app.database.schema import Users
def test_create_get_apikey(client, session, login):
"""
레버 로그인
:param client:
:param session:
:return:
"""
key = dict(user_memo="ryan__key")
res = client.post("api/user/apikeys", json=key, headers=login)
res_bod... | [
6738,
598,
13,
48806,
13,
37043,
1330,
20613,
198,
6738,
598,
13,
48806,
13,
15952,
2611,
1330,
18987,
628,
198,
4299,
1332,
62,
17953,
62,
1136,
62,
499,
522,
88,
7,
16366,
11,
6246,
11,
17594,
2599,
198,
220,
220,
220,
37227,
198,... | 2.401674 | 239 |
import logging
import time
from brewtils import parameter, system, Plugin
__version__ = "3.0.0.dev0"
@system
if __name__ == "__main__":
main()
| [
11748,
18931,
198,
11748,
640,
198,
198,
6738,
9059,
83,
4487,
1330,
11507,
11,
1080,
11,
42636,
198,
198,
834,
9641,
834,
796,
366,
18,
13,
15,
13,
15,
13,
7959,
15,
1,
628,
198,
31,
10057,
628,
198,
198,
361,
11593,
3672,
834,
... | 2.701754 | 57 |
from tests import JsonFixture
from forecastiowrap.models import Location
| [
6738,
5254,
1330,
449,
1559,
37,
9602,
198,
6738,
11092,
72,
322,
2416,
13,
27530,
1330,
13397,
198
] | 4.055556 | 18 |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import onnx
import numpy as np
from onnx.helper import make_graph, make_model, make_tensor_value_info
import pytest
from openvino.frontend import FrontEndManager
from tests.runtime import get_runtime
# FrontEndManager sh... | [
2,
15069,
357,
34,
8,
2864,
12,
1238,
1828,
8180,
10501,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
11748,
28686,
198,
11748,
319,
77,
87,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
319... | 2.513742 | 473 |
from speaksee.data import TextField
import os, sys
sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
from data import FlickrDetectionField, FlickrControlSetField_Verb
from data.dataset import FlickrEntities
from speaksee.data import DataLoader, DictionaryDataset, RawField
from models import S... | [
6738,
2740,
3826,
13,
7890,
1330,
8255,
15878,
198,
11748,
28686,
11,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753... | 1.758208 | 6,183 |
# j'importe les modules que je vais utiliser par la suite
import datetime
import typing # typing contient des objets pour indiquer à l'éditeur de texte/code quels sont les types de variable
import requests # requests est un module qui doit être téléchargé avec pip
# c'est juste un type de variable qui ne peux c... | [
2,
474,
6,
11748,
68,
10287,
13103,
8358,
11223,
410,
15152,
7736,
5847,
1582,
8591,
18389,
198,
11748,
4818,
8079,
198,
11748,
19720,
220,
1303,
19720,
542,
1153,
748,
26181,
1039,
12797,
773,
1557,
263,
28141,
300,
6,
2634,
67,
578,
... | 2.752312 | 1,514 |
import logging
import torch.nn.functional as F
from torch.distributions import Normal
import numpy as np
import torch
from demotivational_policy_descent.agents.agent_interface import AgentInterface
from demotivational_policy_descent.agents.policy_gradient import PolicyGradient
from demotivational_policy_descent.utils.... | [
11748,
18931,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
17080,
2455,
507,
1330,
14435,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
6738,
1357,
313,
452,
864,
62,
30586,
62,
8906,
1087,... | 3.783505 | 97 |
# Generated by Django 3.2.7 on 2021-10-13 05:30
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
22,
319,
33448,
12,
940,
12,
1485,
8870,
25,
1270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
#!/usr/bin/env python3
import sys
import os
import argparse
import subprocess
import textwrap
import helpers
def parser(default_args, args):
"""Return parsed command line arguments."""
parser = argparse.ArgumentParser(
description=(
'Extracts the results of the NGWF CG optimisation steps ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
11748,
2420,
37150,
198,
11748,
49385,
628,
198,
198,
4299,
30751,
7,
12286,
62,
22046,
11,
264... | 2.151578 | 1,458 |
from rest_framework import serializers
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
628,
198
] | 4.555556 | 9 |
if __name__ == "__main__":
with open("test2.in", "r") as f:
lines = f.readlines()
data = [[int(term) for term in line.strip().split()] for line in lines]
n, m = data[0]
next, output = [], []
for i in range(1, n + 1):
next.append(data[i][0:m])
output.append(data[i][m:])
comp = [[1 for i in range(n)] for ... | [
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
4480,
1280,
7203,
9288,
17,
13,
259,
1600,
366,
81,
4943,
355,
277,
25,
198,
197,
197,
6615,
796,
277,
13,
961,
6615,
3419,
628,
197,
7890,
796,
16410,
600,
7... | 2.09068 | 397 |
# [Stone Colossus] Risen from Stone
GUWARU = 2210011
sm.setSpeakerID(GUWARU)
sm.flipDialogue()
sm.sendNext("Greetings #h0#! Can you hear me? Have you spoken with the colossus?\r\n"
"#b(It sounds like Guwaru. You tell him all about the Stone Colossus.)")
sm.flipDialogue()
sm.sendSay("The birth of this cre... | [
2,
685,
34346,
44920,
60,
371,
13254,
422,
8026,
198,
198,
38022,
16279,
52,
796,
31566,
405,
1157,
198,
198,
5796,
13,
2617,
5248,
3110,
2389,
7,
38022,
16279,
52,
8,
198,
5796,
13,
2704,
541,
41099,
3419,
198,
5796,
13,
21280,
100... | 3.291845 | 466 |
from itertools import cycle
from random import choice
from time import time
from C4Board import C4Board
from C4_MCTSAgent import C4_MCTSAgent
import matplotlib.pyplot as plt
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Connect4 Human vs AI (Monte Carlo Tree Search)')
pars... | [
6738,
340,
861,
10141,
1330,
6772,
198,
6738,
4738,
1330,
3572,
198,
6738,
640,
1330,
640,
198,
6738,
327,
19,
29828,
1330,
327,
19,
29828,
220,
198,
6738,
327,
19,
62,
44,
4177,
4090,
6783,
1330,
327,
19,
62,
44,
4177,
4090,
6783,
... | 2.987745 | 408 |
# mock
import json
from fastapi.encoders import jsonable_encoder
with open('mock.json', 'r') as f: db = json.load(f)
#
from typing import Optional
from fastapi import FastAPI, Query, HTTPException
from pydantic import BaseModel
tags_metadata = [
{
"name": "Tasks",
"description": "Tasks related fe... | [
2,
15290,
198,
11748,
33918,
198,
6738,
3049,
15042,
13,
12685,
375,
364,
1330,
33918,
540,
62,
12685,
12342,
198,
198,
4480,
1280,
10786,
76,
735,
13,
17752,
3256,
705,
81,
11537,
355,
277,
25,
20613,
796,
33918,
13,
2220,
7,
69,
8... | 2.708371 | 1,111 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/core/io/location.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _r... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
44876,
14,
7295,
14,
952,
14,
24886,
13,
1676,
1462,
198,
37811,
8645,
5... | 2.152215 | 1,603 |
year = int(input("Which year do you want to check? "))
#Rules: on every year that is evenly divisible by 4, except every year that is evenly divisible by 100, unless the year is also evenly divisible by 400`
#Ex: The year 2000:
#2000 ÷ 4 = 500 (Leap)
#2000 ÷ 100 = 20 (Not Leap)
#2000 ÷ 400 = 5 (Leap!)
#So the year 2000... | [
1941,
796,
493,
7,
15414,
7203,
13828,
614,
466,
345,
765,
284,
2198,
30,
366,
4008,
198,
2,
37766,
25,
319,
790,
614,
326,
318,
21894,
2659,
12843,
416,
604,
11,
2845,
790,
614,
326,
318,
21894,
2659,
12843,
416,
1802,
11,
4556,
... | 2.742105 | 190 |
from pvfree.settings import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1', 'testserver']
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
# PSQL_PSWD = get_secret('PSQL_PSWD', '.postgre')
DATABASES = {
'default... | [
6738,
279,
85,
5787,
13,
33692,
1330,
1635,
198,
198,
2,
10729,
4261,
9050,
39410,
25,
836,
470,
1057,
351,
14257,
2900,
319,
287,
3227,
0,
198,
30531,
796,
6407,
198,
198,
7036,
3913,
1961,
62,
39,
10892,
50,
796,
37250,
36750,
325... | 2.209205 | 239 |
import datetime
import json
from typing import Any, Callable, List, Optional, Tuple
from ee.clickhouse.client import sync_execute
from posthog.models import Team
from posthog.queries.base import BaseQuery
from posthog.queries.session_recording import DistinctId
from posthog.queries.session_recording import SessionReco... | [
11748,
4818,
8079,
198,
11748,
33918,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
7343,
11,
32233,
11,
309,
29291,
198,
198,
6738,
304,
68,
13,
12976,
4803,
13,
16366,
1330,
17510,
62,
41049,
198,
6738,
1281,
31897,
13,
27530,
13... | 2.654867 | 452 |
import numpy as np
import os
import torch
import gym
import pickle
# from ppo.PPO import PPO, Memory
# from ppo.utils import ReplayBuffer
from env_exp import SocTwoEnv
from MADDPG import Maddpg
from memory import ReplayMemory
from copy import deepcopy
import time
from torch.distributions import Categorical
import tenso... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
11550,
198,
11748,
2298,
293,
198,
2,
422,
279,
7501,
13,
10246,
46,
1330,
350,
16402,
11,
14059,
198,
2,
422,
279,
7501,
13,
26791,
1330,
23635,
28632,
... | 2.712 | 750 |
# -*- coding:utf-8 -*-
import os
def check(dirname):
"""This function creates a directory
in case it doesn't exist"""
if not os.path.exists(dirname):
os.makedirs(dirname)
return dirname
# The project directory
EVAL_DIR = os.path.dirname(os.path.realpath(__file__))
# Folder with datasets
#D... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
628,
198,
4299,
2198,
7,
15908,
3672,
2599,
198,
220,
220,
220,
37227,
1212,
2163,
8075,
257,
8619,
198,
220,
220,
220,
287,
1339,
340,
1595,
470,
2152,
... | 2.583099 | 355 |
from rest_framework.decorators import action
from rest_framework import viewsets, status
from utils.permissions import IsRememberAccount
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from .models import Device
from .serializers import DeviceSerializer
from apis.acco... | [
6738,
1334,
62,
30604,
13,
12501,
273,
2024,
1330,
2223,
198,
6738,
1334,
62,
30604,
1330,
5009,
1039,
11,
3722,
198,
6738,
3384,
4487,
13,
525,
8481,
1330,
1148,
16676,
30116,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1148,
47... | 4.481013 | 79 |
import silbot
from silbot.helper import InlineKBMarkup, inlineKBRow, inlineKBData, inlineKBUrl, replyKeyboard, replyKBRow, replyKBbutton
token = "12345:sadsfsdfsdfsd" # Put bot token here
bot = silbot.botapi.BotApi(token, "HTML")
r, response = bot.getMe()
if not response.ok:
print("Error, wrong bot Token")
... | [
11748,
3313,
13645,
198,
6738,
3313,
13645,
13,
2978,
525,
1330,
554,
1370,
22764,
9704,
929,
11,
26098,
42,
11473,
322,
11,
26098,
22764,
6601,
11,
26098,
22764,
28165,
11,
10971,
9218,
3526,
11,
10971,
42,
11473,
322,
11,
10971,
22764... | 2.673077 | 156 |
from __future__ import annotations
from jsonclasses import jsonclass
@jsonclass(validate_all_fields=True)
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
33918,
37724,
1330,
33918,
4871,
628,
198,
31,
17752,
4871,
7,
12102,
378,
62,
439,
62,
25747,
28,
17821,
8,
198
] | 3.724138 | 29 |
# Tests for the brainviewer script.
#
# These tests require the package `pytest-console-scripts`.
import os
import pytest
import tempfile
import shutil
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(THIS_DIR, os.pardir, 'test_data')
| [
2,
30307,
329,
262,
3632,
1177,
263,
4226,
13,
198,
2,
198,
2,
2312,
5254,
2421,
262,
5301,
4600,
9078,
9288,
12,
41947,
12,
46521,
44646,
198,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
11748,
20218,
7753,
198,
11748,
4423,
346... | 2.808081 | 99 |
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'sherlockAndAnagrams' function below.
#
# The function is expected to return an INTEGER.
# The function accepts STRING s as parameter.
#
if __name__ == '__main__':
# fptr = open(os.environ['OUTPUT_PATH'], 'w')
# q = int(input... | [
2,
48443,
8800,
14,
29412,
18,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
25064,
198,
198,
2,
198,
2,
13248,
262,
705,
82,
372,
5354,
1870,
2025,
6713,
82,
6,
2163,
2174,
13,
198,
2,
... | 2.520408 | 196 |
import logging
import logging.config
import datetime
from libs import os_get_env as os_lib
from libs import traf_tester as remote_libs
from configobj import ConfigObj
from argparse import ArgumentParser
logging.config.fileConfig('conf/logging.ini')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
a... | [
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
4818,
8079,
198,
6738,
9195,
82,
1330,
28686,
62,
1136,
62,
24330,
355,
28686,
62,
8019,
198,
6738,
9195,
82,
1330,
1291,
69,
62,
4879,
353,
355,
6569,
62,
8019,
82,
198,
6738,
... | 3.184564 | 298 |
from os import listdir
from os import path
import codecs
| [
6738,
28686,
1330,
1351,
15908,
198,
6738,
28686,
1330,
3108,
198,
11748,
40481,
82,
198
] | 3.8 | 15 |
from ptb import get_leaves_with_labels
from collections import Counter
def token_freq(trees):
"""
Collect token frequency statistics from trees
>>> trees = [(1, (1, (2, 'a'), (3, 'b')), (1, (1, 'c'), (2, 'd'))), \
(1, (1, (2, 'b'), (3, 'b')), (1, (1, 'c'), (2, 'a')))]
>>> token_freq(trees... | [
6738,
42975,
65,
1330,
651,
62,
293,
3080,
62,
4480,
62,
23912,
1424,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
201,
198,
4299,
11241,
62,
19503,
80,
7,
83,
6037,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
... | 2.169884 | 259 |
# -*- coding:utf-8 -*-
"""
@Author:Charles Van
@E-mail: williananjhon@hotmail.com
@Time:2019-08-12 15:18
@Project:InterView_Book
@Filename:String7.py
@description:
正则表达式引擎的设计和实施
"""
'''
题目描述:
一个简单的正则化表达式的数字和字符以及一些特殊符号组成。给定一个正在表达式r以及字符串s,
后者能匹配前者就必须满足以下几个条件:
1、如果r是以数字或字符开头,并且r的第二个字符不是“*”,那么s要匹配r,就必须以相同的数字或字母开头
... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
13838,
171,
120,
248,
28711,
6656,
198,
31,
36,
12,
4529,
25,
220,
481,
666,
272,
73,
24130,
31,
8940,
4529,
13,
785,
198,
31,
7575,
171,
120,
248,
2334... | 0.691839 | 821 |
import numpy as np
from svgpathtools import svg2paths, wsvg
from svgpathtools.path import Line, CubicBezier
import matplotlib.pyplot as pl
from matplotlib.animation import FuncAnimation
import seaborn as sns
from shutil import rmtree
from os.path import join, exists
from os import makedirs
sns.set_context('paper... | [
11748,
299,
32152,
355,
45941,
220,
198,
198,
6738,
38487,
70,
6978,
31391,
1330,
38487,
70,
17,
6978,
82,
11,
266,
21370,
70,
198,
6738,
38487,
70,
6978,
31391,
13,
6978,
1330,
6910,
11,
7070,
291,
3856,
89,
959,
198,
198,
11748,
2... | 2.900376 | 532 |
from sympy.liealgebras.weyl_group import WeylGroup
from sympy.matrices import Matrix
| [
6738,
10558,
88,
13,
14485,
282,
469,
1671,
292,
13,
732,
2645,
62,
8094,
1330,
775,
2645,
13247,
201,
198,
6738,
10558,
88,
13,
6759,
45977,
1330,
24936,
201,
198
] | 2.9 | 30 |
import unittest
from datalakebundle.table.schema.TableSchema import TableSchema
from pyspark.sql import types as t
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
4818,
282,
539,
65,
31249,
13,
11487,
13,
15952,
2611,
13,
10962,
27054,
2611,
1330,
8655,
27054,
2611,
198,
6738,
279,
893,
20928,
13,
25410,
1330,
3858,
355,
256,
628,
198,
198,
361,
11593,
3672,
834... | 2.79661 | 59 |
from django.shortcuts import render, redirect
from django.conf import settings
from django.core.files.storage import FileSystemStorage
# from os import rename, listdir
from uploads.core.models import Document
from uploads.core.forms import DocumentForm
import sys
import os
import sqlite3
sys.path.insert(0, './upload... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
35350,
1330,
9220,
11964,
31425,
198,
198,
2,
422,
28686,
1330,
36265,
11,
13... | 3.491379 | 116 |