content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
#!/usr/bin/env python3
'''RFC 2131 DHCP message structures.'''
# Copyright (c) 2018 Inocybe Technologies.
#
# 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/LICE... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
7061,
6,
41150,
362,
22042,
43729,
3275,
8573,
2637,
7061,
198,
198,
2,
15069,
357,
66,
8,
2864,
554,
13733,
1350,
21852,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
... | 3.239583 | 288 |
# encoding utf-8
import os
from dotenv import find_dotenv,load_dotenv
from requests import session
import logging
#payload for login to kaggle
payload = {
'action':'login',
'username': os.environ.get("KAGGLE_USERNAME"),
'password': os.environ.get("KAGGLE_PASSWORD")
}
def extract_data(url, file_path):
... | [
2,
21004,
3384,
69,
12,
23,
198,
11748,
28686,
198,
6738,
16605,
24330,
1330,
1064,
62,
26518,
24330,
11,
2220,
62,
26518,
24330,
198,
6738,
7007,
1330,
6246,
198,
11748,
18931,
198,
198,
2,
15577,
2220,
329,
17594,
284,
479,
9460,
29... | 2.368553 | 795 |
from django.contrib import admin
from core.models import Country, State, Address
admin.site.register(Country)
admin.site.register(State)
admin.site.register(Address)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
4755,
13,
27530,
1330,
12946,
11,
1812,
11,
17917,
198,
198,
28482,
13,
15654,
13,
30238,
7,
33921,
8,
198,
28482,
13,
15654,
13,
30238,
7,
9012,
8,
198,
28482,
13,
156... | 3.428571 | 49 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django_extensions.db.fields
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
42625,
14208,
62,
2302,
5736,
13,
9945,
13,
25747,
198,
6738,
42625,
14208,
13,
9945,
1330,
... | 2.958333 | 48 |
'''10. Write a Python program to get a string which is n (non-negative integer) copies of a given string.
Tools: input function, slicing'''
word = str(input("Type in any string or word: "))
n = int(input("Enter the number of repititions: "))
ans = ""
for i in range(n):
ans = ans + word
print(ans)
| [
7061,
6,
940,
13,
19430,
257,
11361,
1430,
284,
651,
257,
4731,
543,
318,
299,
357,
13159,
12,
31591,
18253,
8,
9088,
286,
257,
1813,
4731,
13,
198,
220,
220,
220,
20003,
25,
5128,
2163,
11,
49289,
7061,
6,
198,
198,
4775,
796,
96... | 2.962264 | 106 |
#!/usr/bin/env python
"""
Hajos utilities.
"""
from util import *
# Hajos Sum
# identify vertex
def edgesToVerts(s):
""" Turn a list of edges into a list of verticies """
o = set()
for e in s:
o.add(e[0])
o.add(e[1])
return o
# Return a list of edges that would turn kites... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
628,
198,
37811,
198,
198,
39,
1228,
418,
20081,
13,
198,
198,
37811,
628,
198,
6738,
7736,
1330,
1635,
628,
198,
2,
29399,
418,
5060,
198,
198,
2,
5911,
37423,
628,
198,
198,
4299,
13015... | 3.125828 | 453 |
i="meee"
u="you"
print(i," and ",u)
| [
198,
198,
72,
2625,
1326,
1453,
1,
198,
84,
2625,
5832,
1,
198,
198,
4798,
7,
72,
553,
290,
33172,
84,
8,
198
] | 1.695652 | 23 |
import unittest
import bigcommerce.api
from bigcommerce.connection import Connection, OAuthConnection
from bigcommerce.resources import ApiResource
from mock import MagicMock, patch, Mock
| [
11748,
555,
715,
395,
198,
198,
11748,
1263,
27061,
13,
15042,
198,
6738,
1263,
27061,
13,
38659,
1330,
26923,
11,
440,
30515,
32048,
198,
6738,
1263,
27061,
13,
37540,
1330,
5949,
72,
26198,
198,
6738,
15290,
1330,
6139,
44,
735,
11,
... | 4.106383 | 47 |
"""Defines the Movie class"""
import webbrowser
| [
37811,
7469,
1127,
262,
15875,
1398,
37811,
201,
198,
11748,
3992,
40259,
201,
198
] | 3.571429 | 14 |
# Generated by Django 3.2 on 2021-05-02 21:48
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
319,
33448,
12,
2713,
12,
2999,
2310,
25,
2780,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
# encoding=utf8
import logging # logging
from logging.handlers import TimedRotatingFileHandler
from sync_conf import log_bese_path, log_backup_count, log_msg_level
#
logfile = log_bese_path + '/logs/' + 'binlog_sync.log'
logger = logging.getLogger()
logger.setLevel(log_msg_level)
# 7
fh = TimedRotatingFileHandle... | [
2,
21004,
28,
40477,
23,
198,
198,
11748,
18931,
220,
1303,
18931,
198,
6738,
18931,
13,
4993,
8116,
1330,
5045,
276,
24864,
803,
8979,
25060,
198,
6738,
17510,
62,
10414,
1330,
2604,
62,
65,
2771,
62,
6978,
11,
2604,
62,
1891,
929,
... | 2.485714 | 245 |
"""
Copyright 2003 Mitsubishi Electric Research Laboratories All Rights
Reserved. Permission to use, copy and modify this software and its
documentation without fee for educational, research and non-profit
purposes, is hereby granted, provided that the above copyright
notice and the following... | [
37811,
628,
220,
220,
220,
220,
15069,
5816,
22424,
549,
21644,
13944,
4992,
46779,
1439,
6923,
198,
220,
220,
220,
220,
33876,
13,
220,
2448,
3411,
284,
779,
11,
4866,
290,
13096,
428,
3788,
290,
663,
198,
220,
220,
220,
220,
10314,
... | 2.387389 | 4,964 |
# flake8: noqa
from torch.nn.modules import *
from .common import Flatten, GaussianNoise, Lambda, Normalize
from .lama import LamaPooling, TemporalAttentionPooling, TemporalConcatPooling
from .pooling import (
GlobalAttnPool2d,
GlobalAvgAttnPool2d,
GlobalAvgPool2d,
GlobalConcatAttnPool2d,
GlobalCon... | [
2,
781,
539,
23,
25,
645,
20402,
198,
6738,
28034,
13,
20471,
13,
18170,
1330,
1635,
198,
198,
6738,
764,
11321,
1330,
1610,
41769,
11,
12822,
31562,
2949,
786,
11,
21114,
6814,
11,
14435,
1096,
198,
6738,
764,
75,
1689,
1330,
36187,
... | 2.44385 | 187 |
#!/usr/bin/env python3
# coding=utf-8
"""
Strategy to eliminate redundant lines.
- remove redundant lines
- calculate the correct key for a given level
"""
NORMAL_COST_PER_POWERUP = {
# level: [stardust, candy]
2.5: [ 200, 1],
4.5: [ 400, 1],
6.5: [ 600, 1],
8.5: [ 800, 1],
10.5: [ 1000, 1],
12.5:... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
37811,
198,
13290,
4338,
284,
11005,
30806,
3951,
13,
198,
12,
4781,
30806,
3951,
198,
12,
15284,
262,
3376,
1994,
329,
257,
1813,
1241,
19... | 1.779715 | 631 |
import PySimpleGUI as sg
def build_login():
""" Construye la ventana del inicio de sesion del usuario"""
layout =[[sg.T("Usuario", size=(8,1)), sg.InputText(key='-USER-')],
[sg.T("Contrasea", size=(8,1)), sg.InputText(key='-PASS-')],
[sg.Submit("LogIn", size=(15,1), pad=(0,15))],
... | [
11748,
9485,
26437,
40156,
355,
264,
70,
198,
198,
4299,
1382,
62,
38235,
33529,
198,
220,
220,
220,
37227,
4757,
622,
5948,
8591,
7435,
2271,
1619,
287,
46441,
390,
264,
274,
295,
1619,
514,
84,
4982,
37811,
628,
198,
220,
220,
220,
... | 2.200855 | 234 |
# -*- coding: utf-8 -*-
'''
Formatter class test
====================
'''
import unittest
from tests.testutils import print_testtitle, validate_with_fail
from builder.core import formatter as fm
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
8479,
1436,
1398,
1332,
198,
4770,
1421,
198,
7061,
6,
198,
198,
11748,
555,
715,
395,
198,
6738,
5254,
13,
9288,
26791,
1330,
3601,
62,
9288,
7839,
11,
... | 3.142857 | 63 |
from ._reliabili import reliability_analysis
__all__ = [
"reliability_analysis",
] | [
6738,
47540,
2411,
72,
397,
2403,
1330,
17843,
62,
20930,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
2411,
12455,
62,
20930,
1600,
198,
60
] | 3.071429 | 28 |
from functools import singledispatch
from pynasqm.trajectories.fluorescence import Fluorescence
from pynasqm.trajectories.absorption import Absorption
| [
6738,
1257,
310,
10141,
1330,
31958,
8802,
963,
198,
6738,
279,
2047,
292,
80,
76,
13,
9535,
752,
1749,
13,
35522,
48699,
1330,
34070,
48699,
198,
6738,
279,
2047,
292,
80,
76,
13,
9535,
752,
1749,
13,
46303,
1159,
1330,
13051,
273,
... | 3.431818 | 44 |
from ps2_census.enums import ResistType
from ps2_analysis.enums import DamageTargetType
from ps2_analysis.fire_groups.damage_profile import DamageLocation, DamageProfile
| [
6738,
26692,
17,
62,
66,
7314,
13,
268,
5700,
1330,
36136,
6030,
198,
198,
6738,
26692,
17,
62,
20930,
13,
268,
5700,
1330,
8995,
21745,
6030,
198,
6738,
26692,
17,
62,
20930,
13,
6495,
62,
24432,
13,
28735,
62,
13317,
1330,
8995,
1... | 3.54 | 50 |
#ModBUS Communication between Schneider EM6436 Meter and Raspberry Pi
#First beta version.
#The meter is set with the following settings
#Communication : (RS484 to RS232 to USB) - BaudRate = 19200, Parity = N, Stopbits = 1, Device ID=1 (Hardcode in meter)
#Electical Settings: APri:50, Asec: 5, VPri: 415, Vsec:415, SYS:... | [
2,
5841,
45346,
26117,
1022,
26039,
17228,
2414,
2623,
46423,
290,
24244,
13993,
198,
2,
5962,
12159,
2196,
13,
198,
2,
464,
16430,
318,
900,
351,
262,
1708,
6460,
198,
2,
30813,
3299,
1058,
357,
6998,
34137,
284,
19340,
24339,
284,
8... | 2.46609 | 2,197 |
from flask import Flask, render_template, json, request, redirect, session, jsonify
from flaskext.mysql import MySQL
from werkzeug import generate_password_hash, check_password_hash
mysql = MySQL()
app = Flask(__name__)
# randomly generated encryption & decryption key, ensures security of a communications session
app... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
33918,
11,
2581,
11,
18941,
11,
6246,
11,
33918,
1958,
198,
6738,
781,
292,
365,
742,
13,
28744,
13976,
1330,
33476,
198,
6738,
266,
9587,
2736,
1018,
1330,
7716,
62,
28712,
62,
17831... | 4.412811 | 281 |
from django.db import models
# Importamos o User do sistema para utilizar os dados dos usurios que registramos no admin do django
# (desta forma no precisamos criar uma tabela especfica no models para representar os usurios).
from django.contrib.auth.models import User
from datetime import datetime
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
220,
17267,
321,
418,
267,
11787,
466,
264,
396,
19687,
31215,
7736,
528,
283,
28686,
9955,
418,
23430,
39954,
4267,
8358,
4214,
859,
418,
645,
13169,
466,
42625,
14208,
198,
2,
2... | 3.268817 | 93 |
import json
from datetime import datetime, timedelta
from typing import Any
import jwt
from starlette.requests import Request
from starlette.responses import JSONResponse
from starlette.status import HTTP_403_FORBIDDEN
from passlib.context import CryptContext
from fastapi import Depends, Security, HTTPException
from f... | [
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
19720,
1330,
4377,
198,
198,
11748,
474,
46569,
198,
6738,
3491,
21348,
13,
8897,
3558,
1330,
19390,
198,
6738,
3491,
21348,
13,
16733,
274,
1330,
19449,
... | 3.432161 | 199 |
'''
Created on 09 Nov 2013
@author: michael
'''
import json
import urllib2
import urllib
from django.conf import settings
import facebook
def validate_access_token(access_token):
'''
Validate a Facebook access token
'''
# Get an app access token
app_token = facebook.get_app_access_token(
... | [
7061,
6,
198,
41972,
319,
7769,
5267,
2211,
198,
198,
31,
9800,
25,
285,
40302,
198,
7061,
6,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
17,
198,
11748,
2956,
297,
571,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
1... | 2.375 | 312 |
import db
from pen import Pen
from idea import Idea
MIN_ENJOYMENT = 0.5
MIN_RELEVANT = 2
MAX_DEPTH = 3
MIN_ACCEPTABLE_SCORE = 0.5
# score each of the ideas by evaluating neighbors
if __name__ == '__main__':
list_ideas(Pen())
| [
11748,
20613,
198,
6738,
3112,
1330,
7507,
198,
6738,
2126,
1330,
37560,
198,
198,
23678,
62,
1677,
41,
21414,
10979,
796,
657,
13,
20,
198,
23678,
62,
2200,
2538,
53,
8643,
796,
362,
198,
22921,
62,
46162,
4221,
796,
513,
198,
23678,... | 2.606742 | 89 |
import datetime
import pysc2.agents.myAgent.myAgent_6.config.config as config
from pysc2.agents.myAgent.myAgent_6.decisionMaker.DQN import DQN
import pysc2.agents.myAgent.myAgent_6.smart_actions as sa
import pysc2.agents.myAgent.myAgent_6.tools.handcraft_function as handcraft_function
from pysc2.env.environment impor... | [
11748,
4818,
8079,
198,
198,
11748,
279,
28349,
17,
13,
49638,
13,
1820,
36772,
13,
1820,
36772,
62,
21,
13,
11250,
13,
11250,
355,
4566,
198,
6738,
279,
28349,
17,
13,
49638,
13,
1820,
36772,
13,
1820,
36772,
62,
21,
13,
12501,
116... | 2.927419 | 124 |
# from sklearn.utils import shuffle
# import util as ut
# import os
# import pandas as pd
# import training_util as tut
# import numpy as np
# def sample_2000():
# file_paths, file_names, pose_type = ut.get_csvs_paths(
# os.path.join("5-people-csvs"))
# init = list.pop(file_paths)
# ds = pd.read_... | [
2,
422,
1341,
35720,
13,
26791,
1330,
36273,
198,
2,
1330,
7736,
355,
3384,
198,
2,
1330,
28686,
198,
2,
1330,
19798,
292,
355,
279,
67,
198,
2,
1330,
3047,
62,
22602,
355,
9732,
198,
2,
1330,
299,
32152,
355,
45941,
628,
198,
2,
... | 2.086957 | 989 |
# Copyright 2021 Google LLC. 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 applicable law or a... | [
2,
15069,
33448,
3012,
11419,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.615658 | 281 |
# python program to generate an assembly file which checks if mis-predictions
# occur In addition to this, the GHR is also filled with ones (additional
# test case) uses assembly macros
from typing import Dict, List, Union, Any
# To-Do -> Create another function which prints the includes and other
# assembler directi... | [
2,
21015,
1430,
284,
7716,
281,
10474,
2393,
543,
8794,
611,
2984,
12,
28764,
9278,
198,
2,
3051,
554,
3090,
284,
428,
11,
262,
402,
17184,
318,
635,
5901,
351,
3392,
357,
2860,
1859,
198,
2,
1332,
1339,
8,
3544,
10474,
34749,
198,
... | 3.972222 | 108 |
# Generated by Django 2.1.5 on 2019-02-14 21:45
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
20,
319,
13130,
12,
2999,
12,
1415,
2310,
25,
2231,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import datetime
import scrapy
from kingfisher_scrapy.base_spider import CompressedFileSpider
from kingfisher_scrapy.util import components, handle_http_error
| [
11748,
4818,
8079,
198,
198,
11748,
15881,
88,
198,
198,
6738,
5822,
69,
4828,
62,
1416,
2416,
88,
13,
8692,
62,
2777,
1304,
1330,
3082,
2790,
8979,
41294,
198,
6738,
5822,
69,
4828,
62,
1416,
2416,
88,
13,
22602,
1330,
6805,
11,
54... | 3.354167 | 48 |
import re
| [
11748,
302,
198
] | 3.333333 | 3 |
import pydlbot_ui as Ui
import sys
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
import time
import threading
if __name__ == '__main__':
p = threading.Thread(target=main)
p.start()
for i in range(3):
t = th... | [
11748,
279,
5173,
75,
13645,
62,
9019,
355,
471,
72,
198,
11748,
25064,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
8205,
72,
11,
33734,
14055,
11,
33734,
54,
312,
11407,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635... | 2.1 | 250 |
# -*- coding: utf-8 -*-
"""
The view of files module.
"""
from flask import Blueprint, request
from src.modules.files.files import Files
from src.utils.http_exception import BadRequestException
blueprint = Blueprint('files-deprecated', __name__)
files: Files = None
def init_app(app):
""" This will be called by... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
464,
1570,
286,
3696,
8265,
13,
198,
37811,
198,
6738,
42903,
1330,
39932,
11,
2581,
198,
198,
6738,
12351,
13,
18170,
13,
16624,
13,
16624,
1330,
13283... | 3.177778 | 135 |
"""Users views."""
# Django REST Framework
from rest_framework.viewsets import GenericViewSet
from rest_framework.mixins import (ListModelMixin,
RetrieveModelMixin,
UpdateModelMixin)
from rest_framework import status
from rest_framework.decorators i... | [
37811,
14490,
5009,
526,
15931,
198,
198,
2,
37770,
30617,
25161,
198,
6738,
1334,
62,
30604,
13,
1177,
28709,
1330,
42044,
7680,
7248,
198,
6738,
1334,
62,
30604,
13,
19816,
1040,
1330,
357,
8053,
17633,
35608,
259,
11,
198,
220,
220,
... | 2.768519 | 216 |
from __future__ import print_function
from topologylayer.functional.persistence import SimplicialComplex, persistenceForwardCohom
from topologylayer.util.process import remove_zero_bars
import torch
# first, we build our complex
s = SimplicialComplex()
# a cycle graph on vertices 1,2,3,4
# cone with vertex... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
201,
198,
6738,
1353,
1435,
29289,
13,
45124,
13,
19276,
13274,
1330,
45157,
6652,
5377,
11141,
11,
30802,
39746,
34,
1219,
296,
201,
198,
6738,
1353,
1435,
29289,
13,
22602,
13,
14681,
133... | 2.391499 | 447 |
import rospy
import threading
import importlib
from collections import deque
from custom_msgs.msg import *
# A generic subscriber class for interfacing any type of message into the GUI
| [
11748,
686,
2777,
88,
198,
11748,
4704,
278,
198,
11748,
1330,
8019,
198,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
2183,
62,
907,
14542,
13,
19662,
1330,
1635,
628,
198,
2,
317,
14276,
32944,
1398,
329,
9556,
4092,
597,
2099,
286... | 3.517857 | 56 |
import math
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
from torch.utils.data import DataLoader, random_split
from torch.utils.tensorboard import SummaryWriter
import torchvision
# from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
# from torchvision.o... | [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
11,
4738,
62,
35312,... | 2.370541 | 1,738 |
#!/usr/bin/python3
import zipfile
from pwn import * # pip3 install pwn
banner = """
____ __ __ __ ____ _ ___ __
/ __ )/ /___ _____/ /____ __ ____ ___ __/ /_____ / __ \ | / / | / /
/ __ / / __ \/ ___/ //_/ / / /_____/ __ `/ / / / __/ __ \/ /_/ ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
19974,
7753,
198,
6738,
279,
675,
1330,
1635,
1303,
7347,
18,
2721,
279,
675,
198,
198,
3820,
1008,
796,
37227,
198,
220,
220,
220,
220,
1427,
220,
11593,
220,
220,
220,
220... | 1.68206 | 563 |
from django.conf import settings
from django.utils import timezone
from .base import default_config, numeric, lowercase_alphabetic, uppercase_alphabetic
config = default_config
config.update(settings.VERIFICATION)
VERIFICATION_CODE_FIELD = 'verification_code'
VERIFICATIONS = config.get('VERIFICATIONS')
CODE_LENGTH = ... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
764,
8692,
1330,
4277,
62,
11250,
11,
35575,
11,
2793,
7442,
62,
17307,
33312,
11,
334,
39921,
589,
62,
17307,
33312,
198,
198,
... | 2.559177 | 583 |
import socket
import fcntl
import os
import time
import queue
import logging
import traceback
from .controller import Controller, ControllerTypes
from ..bluez import BlueZ
from .protocol import ControllerProtocol
from .input import InputParser
from .utils import format_msg_controller, format_msg_switch
| [
11748,
17802,
198,
11748,
277,
66,
429,
75,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
16834,
198,
11748,
18931,
198,
11748,
12854,
1891,
198,
198,
6738,
764,
36500,
1330,
22741,
11,
22741,
31431,
198,
6738,
11485,
2436,
14870,
1330,... | 4.08 | 75 |
import frappe
from datetime import datetime
# bench execute mfi_customization.mfi.patch.set_first_responded_on_issue.execute
| [
11748,
5306,
27768,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
2,
7624,
12260,
285,
12463,
62,
23144,
1634,
13,
76,
12463,
13,
17147,
13,
2617,
62,
11085,
62,
5546,
276,
62,
261,
62,
21949,
13,
41049,
198,
197,
197,
197,
198... | 3.023256 | 43 |
from __future__ import division, print_function, unicode_literals
import cocos.euclid as eu
import unittest
import copy
try:
import cPickle as pickle
except Exception:
import pickle
import io
if __name__ == '__main__':
unittest.main()
| [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
8954,
418,
13,
12496,
565,
312,
355,
304,
84,
198,
11748,
555,
715,
395,
198,
198,
11748,
4866,
198,
28311,
25,
198,
220,
220... | 2.613861 | 101 |
#!/usr/local/bin/python3
import sys
from multiprocessing import Pool
from timeit import default_timer as timer
from config import Config
from cgp.functionset import FunctionSet
from cgp.genome import Genome
import numpy as np
import numpy.random
from random import randint
from tetris_learning_environment import E... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
18,
198,
198,
11748,
25064,
198,
6738,
18540,
305,
919,
278,
1330,
19850,
198,
198,
6738,
640,
270,
1330,
4277,
62,
45016,
355,
19781,
198,
198,
6738,
4566,
1330,
17056,
198,
6738,
269,... | 3.247368 | 190 |
#!/usr/bin/env python2
import sys
sys.path.append('../../../src/')
import cgmap as cg
import mdtraj as md
import md_check as check
############################### config #####################################
input_traj = "protein.trr"
input_top = "protein.pdb"
output_traj = "protein.trr"
output_top = "protein.pdb... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
40720,
40720,
10677,
14,
11537,
198,
11748,
269,
70,
8899,
355,
269,
70,
198,
11748,
45243,
9535,
73,
355,
45243,
... | 2.239069 | 1,418 |
# -*- coding: utf-8 -*-
# Function that loads a checkpoint and rebuilds the model
import torch
from torch import nn
from collections import OrderedDict
from torchvision import datasets, transforms, models
def save_checkpoint(model, checkpoint_path, output_categories):
'''
Save the trained deep... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15553,
326,
15989,
257,
26954,
290,
17884,
82,
262,
2746,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
... | 2.394602 | 1,556 |
import copy
import torch
from torch import nn
from torch.utils.data import DataLoader
from torchtext.data import Batch
'''
def one_on_one_evaluate(participants, federated_model, grad_updates, unfiltererd_grad_updates, eval_loader, device):
val_accs = []
for i, participant in enumerate(participants):
if participa... | [
11748,
4866,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
5239,
13,
7890,
1330,
347,
963,
628,
198,
198,
7061,
6,
198,
4299,
530,
62,
261,
62,
505,
6... | 2.660107 | 559 |
from django.shortcuts import redirect, render
from django.views.generic import TemplateView
#homePage
def home(request):
if request.user.is_authenticated:
if request.user.is_teacher:
return redirect('teachers:my_jobs')
else:
return redirect('students:quiz_list')
return ... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
11,
8543,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
628,
198,
2,
11195,
9876,
198,
4299,
1363,
7,
25927,
2599,
198,
220,
220,
220,
611,
2581,
13,
7220,
13,
271... | 2.558621 | 145 |
from .rank_and_validate import BootstrappedRankAndValidate
__all__ = ["BootstrappedRankAndValidate"]
| [
6738,
764,
43027,
62,
392,
62,
12102,
378,
1330,
18892,
12044,
1496,
27520,
1870,
7762,
20540,
198,
198,
834,
439,
834,
796,
14631,
36476,
12044,
1496,
27520,
1870,
7762,
20540,
8973,
198
] | 3.1875 | 32 |
from os import read
import sys
import pegtree as pg
import csv
from pegtree.optimizer import optimize
peg = pg.grammar('yk.tpeg')
parse = pg.generate(peg)
VAR_literal = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
NAME_literal = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
VAL_literal = 'abcdefgh... | [
6738,
28686,
1330,
1100,
198,
11748,
25064,
198,
11748,
613,
13655,
631,
355,
23241,
198,
11748,
269,
21370,
198,
198,
6738,
613,
13655,
631,
13,
40085,
7509,
1330,
27183,
198,
198,
22071,
796,
23241,
13,
4546,
3876,
10786,
48361,
13,
8... | 1.925852 | 499 |
country=["Brazil","Russia","India","China","South Africa"]
capitals={"Brazil":"Brasilia","Russia":"Moscow","India":"New Delhi",
"China":"Beijing","South Africa":["Pretoria","Cape Town","Bloemfontein"]}
print(country)
print(capitals)
print(capitals["South Africa"][1])
| [
19315,
28,
14692,
39190,
2430,
16347,
2430,
21569,
2430,
14581,
2430,
14942,
5478,
8973,
198,
11128,
8321,
28,
4895,
39190,
2404,
33,
8847,
17517,
2430,
16347,
2404,
49757,
2430,
21569,
2404,
3791,
12517,
1600,
198,
366,
14581,
2404,
3856,
... | 3.214286 | 84 |
import math
import os
from PyQt5 import QtCore
from PyQt5.QtWidgets import QGridLayout, QLabel, QPushButton, QFrame, QTextEdit, QInputDialog, QSizePolicy, QAction, QMessageBox
from Core.DieClock import DieClock
from Core.WildernessTravelManager import WildernessTravelManager
from Interface.Widgets.LineEditMouseWheelE... | [
11748,
10688,
198,
11748,
28686,
198,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
41339,
32517,
11,
1195,
33986,
11,
1195,
49222,
21864,
11,
1195,
19778,
11,
... | 3.592308 | 130 |
import bottle
root = __import__("pathlib").Path(__file__).resolve().parent
bottle.TEMPLATE_PATH = [str(root / "views")]
app = bottle.default_app()
host = "127.0.0.1"
port = "65534"
from . import controller
from . import download_video
| [
11748,
9294,
198,
198,
15763,
796,
11593,
11748,
834,
7203,
6978,
8019,
11074,
15235,
7,
834,
7753,
834,
737,
411,
6442,
22446,
8000,
198,
10985,
293,
13,
51,
3620,
6489,
6158,
62,
34219,
796,
685,
2536,
7,
15763,
1220,
366,
33571,
49... | 2.767442 | 86 |
import logging
import numpy as np
__all__ = [
'generate_random_points_inside_balls',
'generate_random_point_inside_balls',
'generate_random_points_inside_ball',
'generate_random_point_inside_ball',
]
# %%
# %%
| [
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
8612,
378,
62,
25120,
62,
13033,
62,
48787,
62,
21591,
3256,
198,
220,
220,
220,
705,
8612,
378,
62,
25120,
62,
4122,
62,
... | 2.543478 | 92 |
#!/usr/bin/env python3
with open("input.txt") as f:
directions = f.read()
path1, path2 = map(lambda x: x.split(","), directions.strip().split("\n"))
pts1 = getpts(path1)
pts2 = getpts(path2)
intersections = pts1.intersection(pts2)
min_dist = None
closest = None
for i in intersections:
dist = abs(i[0])... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
198,
4480,
1280,
7203,
15414,
13,
14116,
4943,
355,
277,
25,
198,
220,
220,
220,
11678,
796,
277,
13,
961,
3419,
198,
220,
220,
220,
3108,
16,
11,
3108,
17,
796,
3975,
7,
... | 2.305263 | 190 |
import unittest
from streamlink.plugins.openrectv import OPENRECtv
| [
11748,
555,
715,
395,
198,
198,
6738,
4269,
8726,
13,
37390,
13,
9654,
2554,
85,
1330,
38303,
38827,
14981,
628
] | 3.45 | 20 |
# Generated by Django 3.1.3 on 2021-05-07 18:57
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
18,
319,
33448,
12,
2713,
12,
2998,
1248,
25,
3553,
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 |
# Script de criao do dashboard
# https://dash.plotly.com/dash-html-components
# Imports
import traceback
import pandas as pd
import plotly.express as px
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output
# Mdulos c... | [
2,
12327,
390,
269,
380,
5488,
466,
30415,
198,
2,
3740,
1378,
42460,
13,
29487,
306,
13,
785,
14,
42460,
12,
6494,
12,
5589,
3906,
198,
198,
2,
1846,
3742,
198,
11748,
12854,
1891,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
... | 3.267717 | 127 |
from rest_framework import serializers
from core.models import Prompt, CustomUser
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
4755,
13,
27530,
1330,
45965,
11,
8562,
12982,
628
] | 4.611111 | 18 |
c.Session.debug = True
c.LabApp.token = 'test'
c.LabApp.open_browser = False
c.NotebookApp.port_retries = 0
c.LabApp.workspaces_dir = './build/cypress-tests'
c.FileContentsManager.root_dir = './build/cypress-tests'
c.LabApp.quit_button = False
| [
66,
13,
36044,
13,
24442,
796,
6407,
198,
66,
13,
17822,
4677,
13,
30001,
796,
705,
9288,
6,
220,
198,
66,
13,
17822,
4677,
13,
9654,
62,
40259,
796,
10352,
198,
66,
13,
6425,
2070,
4677,
13,
634,
62,
1186,
1678,
796,
657,
220,
... | 2.5625 | 96 |
from django.contrib.gis import admin
from apps.access.models import InvitedEmail
admin.site.register(InvitedEmail, InvitedEmailAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
1330,
13169,
198,
198,
6738,
6725,
13,
15526,
13,
27530,
1330,
10001,
863,
15333,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
19904,
863,
15333,
11,
10001,
863,
15333,
46787,
8,
198
] | 3.285714 | 42 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-02 14:10
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
20,
319,
2177,
12,
940,
12,
2999,
1478,
25,
940,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.754098 | 61 |
from pyautogui import *
import pyautogui
import time
while 1:
if pyautogui.locateOnScreen('img.png', region=(150,175,350,600), grayscale=True, confidence=0.8) != None:
print("I can see it")
time.sleep(0.5)
else:
print("I am unable to see it")
time.sleep(0.5)
| [
6738,
12972,
2306,
519,
9019,
1330,
1635,
220,
198,
11748,
12972,
2306,
519,
9019,
220,
198,
11748,
640,
198,
198,
4514,
352,
25,
198,
220,
220,
220,
611,
12972,
2306,
519,
9019,
13,
75,
13369,
2202,
23901,
10786,
9600,
13,
11134,
325... | 2.188406 | 138 |
# Copyright 2020 Bradbase
import itertools
from datetime import datetime, timedelta, date
from calendar import monthrange
from harvest import Harvest
from .harvestdataclasses import *
| [
198,
2,
15069,
12131,
8114,
8692,
198,
198,
11748,
340,
861,
10141,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
3128,
198,
6738,
11845,
1330,
1227,
9521,
198,
6738,
13222,
1330,
26149,
198,
6738,
764,
9869,
4223,... | 3.978723 | 47 |
"""
Send a kill signal to a BiblioPixel process running on this
machine to abruptly kill it
DEPRECATED: use
.. code-block:: bash
$ kill -kill `bpa-pid`
"""
DESCRIPTION = """
Example:
.. code-block:: bash
$ bp kill
"""
from .. util.signal_handler import make_command
add_arguments, run = make_command('SI... | [
37811,
198,
25206,
257,
1494,
6737,
284,
257,
347,
10506,
952,
40809,
1429,
2491,
319,
428,
198,
30243,
284,
25891,
1494,
340,
198,
198,
46162,
38827,
11617,
25,
779,
198,
198,
492,
2438,
12,
9967,
3712,
27334,
628,
220,
220,
220,
720... | 2.877193 | 114 |
# Standard imports
import json
import ast
# Third party imports
import pandas as pd
from tabulate import tabulate
# Local application imports
from utils.logger import logger
if __name__ == '__main__':
data = Dataloding()
| [
2,
8997,
17944,
198,
11748,
33918,
198,
11748,
6468,
198,
198,
2,
10467,
2151,
17944,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
198,
2,
10714,
3586,
17944,
198,
6738,
3384,
4487,
13,
6404,
136... | 3.382353 | 68 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# -*- coding: utf-8 -*-
from wtforms import Form, StringField, validators
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
6738,
266,
83,
23914,
1330,
5178,
11,
10903,
15878,
11,
4938,
2024,
201,
198,
201,
198
] | 2.424242 | 33 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 24 00:44:49 2020
@author: Aanal Sonara
"""
import cv2
cap = cv2.VideoCapture(0)
while cap.isOpened():
_, frame = cap.read()
cv2.imshow("live video", frame)
k = cv2.waitKey(1) and 0xFF
if k==27:
break
cap.release()
cv2.destr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
19480,
5979,
1987,
3571,
25,
2598,
25,
2920,
12131,
201,
198,
201,
198,
31,
9800,
25,
317,
272,
282,
6295,
3301,
201,
198,
37811,
201... | 2 | 167 |
import configparser
import os
import tempfile
import urllib.request
import xml.dom.minidom
import xml.etree.ElementTree as ET
from urllib.error import HTTPError, URLError
from urllib.parse import urlparse
from bs4 import BeautifulSoup
from tinytag import TinyTag
import gevent
dir_path = os.path.dirname(os.path.realpa... | [
11748,
4566,
48610,
198,
11748,
28686,
198,
11748,
20218,
7753,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
35555,
13,
3438,
13,
1084,
312,
296,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
6738,
2956,
297,... | 2.928571 | 168 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import numpy
import torch
import torchnet
from tqdm import tqdm
from torchnet.engine import Engine
from torchnet.logger import VisdomPlotLogger, VisdomLogger
import project.deco as deco
from project.sequoder import SequenceEncoder, get_loss
if __name__... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
198,
11748,
28034,
198,
11748,
7332,
1349,
316,
198,
6738,
256,
80,
36... | 2.590674 | 193 |
# Copyright 2017 Intel Corporation
#
# 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 wri... | [
2,
15069,
2177,
8180,
10501,
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,
7330... | 3.77 | 300 |
from ipykernel.kernelbase import Kernel
from iarm.arm import Arm
import re
import warnings
import iarm.exceptions
if __name__ == '__main__':
from ipykernel.kernelapp import IPKernelApp
IPKernelApp.launch_instance(kernel_class=ArmKernel)
| [
6738,
20966,
88,
33885,
13,
33885,
8692,
1330,
32169,
198,
6738,
1312,
1670,
13,
1670,
1330,
7057,
198,
11748,
302,
198,
11748,
14601,
198,
11748,
1312,
1670,
13,
1069,
11755,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,... | 3.0875 | 80 |
#! /usr/bin/evn python
if __name__ == '__main__':
stu = Student()
stu.birth = 1991
print(stu.age)
| [
2,
0,
1220,
14629,
14,
8800,
14,
1990,
77,
21015,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
336,
84,
796,
13613,
3419,
198,
220,
220,
220,
336,
84,
13,
24280,
796,
10249,
198,
220... | 2.092593 | 54 |
from .vocab import gloveVocabulary
| [
6738,
764,
18893,
397,
1330,
29144,
53,
420,
22528,
198
] | 3.5 | 10 |
import pygame
| [
11748,
12972,
6057,
628
] | 3.75 | 4 |
from abc import ABC, abstractmethod, ABCMeta
from Visitor import Visitor
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
11,
9738,
48526,
201,
198,
6738,
6911,
2072,
1330,
6911,
2072,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.741935 | 31 |
#
# Download images from the LOC IIIF server and store them locally
#
import requests
from pathlib import Path
import shutil
import time
base = 'https://www.loc.gov/'
iiifbase = 'https://tile.loc.gov/image-services/iiif/' | [
2,
198,
2,
10472,
4263,
422,
262,
37347,
2873,
5064,
4382,
290,
3650,
606,
15726,
198,
2,
198,
11748,
7007,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
4423,
346,
198,
11748,
640,
198,
8692,
796,
705,
5450,
1378,
2503,
13,
17946,
... | 3.25 | 68 |
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list, update_water_levels
import floodsystem.flood as flood
import floodsystem.plot as plot
from datetime import datetime, timedelta
import datetime
stations = build_station_list()
update_water_levels(stations)
... | [
6738,
6947,
10057,
13,
7890,
34045,
2044,
1330,
21207,
62,
1326,
5015,
62,
46170,
198,
6738,
6947,
10057,
13,
17529,
7890,
1330,
1382,
62,
17529,
62,
4868,
11,
4296,
62,
7050,
62,
46170,
198,
11748,
6947,
10057,
13,
2704,
702,
355,
69... | 2.735169 | 472 |
import hmac, hashlib, binascii
from hashlib import sha1
from binascii import a2b_hex, b2a_hex, unhexlify
from pbkdf2_ctypes import pbkdf2_bin
from multiprocessing import Pool, Queue, cpu_count
from datetime import datetime
from time import sleep
numOfPs = cpu_count()
| [
11748,
289,
20285,
11,
12234,
8019,
11,
9874,
292,
979,
72,
198,
6738,
12234,
8019,
1330,
427,
64,
16,
198,
6738,
9874,
292,
979,
72,
1330,
257,
17,
65,
62,
33095,
11,
275,
17,
64,
62,
33095,
11,
555,
33095,
75,
1958,
198,
6738,
... | 2.755102 | 98 |
import pygame
from gui_components.gui_util import get_font, BLACK, BLUE, GRAY
| [
11748,
12972,
6057,
198,
198,
6738,
11774,
62,
5589,
3906,
13,
48317,
62,
22602,
1330,
651,
62,
10331,
11,
31963,
11,
9878,
8924,
11,
402,
30631,
628
] | 2.962963 | 27 |
"""
Remove Dups: Write code to remove duplicates from an unsorted linked list.
FOLLOW UP
How would you solve this problem if a temporary buffer is not allowed?
"""
from linkedlist import linkedlist
if __name__ == "__main__":
test_list = linkedlist(10)
test_list.top.append_to_tail(20)
test_list.... | [
37811,
198,
27914,
360,
4739,
25,
19430,
2438,
284,
4781,
14184,
16856,
422,
281,
5576,
9741,
6692,
1351,
13,
220,
198,
6080,
44765,
15958,
220,
198,
2437,
561,
345,
8494,
428,
1917,
611,
257,
8584,
11876,
318,
407,
3142,
30,
198,
378... | 2.465753 | 292 |
# -*- encoding: utf-8 -*-
import sys
sys.path.append('../')
from habet import Application, Response, Handler, errors
import json
#custom error register
#root handler
#name handler
#application setup
app = Application(some_var='my var')
app.route('/', RootHandler)
app.route('/{name}', NameHandler)
#run app
if ... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
11537,
198,
6738,
387,
11181,
1330,
15678,
11,
18261,
11,
32412,
11,
8563,
198,
11748,
33918,
628,
198,
2,
2... | 2.991667 | 120 |
"""API Django models."""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
| [
37811,
17614,
37770,
4981,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
21015,
62,
17,
62,
46... | 3.456522 | 46 |
from django.urls import path
from .views import UserLogin, UserRegister
urlpatterns = [
path("accounts/", UserRegister.as_view()),
path("login/", UserLogin.as_view()),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
11787,
47790,
11,
11787,
38804,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7203,
23317,
82,
14,
1600,
11787,
38804,
13,
292,
62,
1177,
3419... | 2.84127 | 63 |
#! /usr/bin/env python3
import argparse
from pathlib import Path
from pytorch_lightning import seed_everything
from ranking_utils.datasets.antique import ANTIQUE
from ranking_utils.datasets.fiqa import FiQA
from ranking_utils.datasets.insuranceqa import InsuranceQA
from ranking_utils.datasets.trecdl import TRECDL20... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
11748,
1822,
29572,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
12972,
13165,
354,
62,
2971,
768,
1330,
9403,
62,
37814,
198,
198,
6738,
12759,
62,
26791,
13,
19608,... | 2.986301 | 146 |
#!/usr/bin/python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Corrado Ubezio
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rig... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
220,
198,
2,
15069,
357,
66,
8,
1946,
2744,
81,
4533,
471,
1350,
89,
952,
198,
2,
220,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1... | 3.111559 | 744 |
# encoding=utf-8
import random
from collections import namedtuple
Point = namedtuple('Point', 'x y')
DIRECTIONS = {
'N': Point(0, -1),
'E': Point(1, 0),
'S': Point(0, 1),
'W': Point(-1, 0),
}
| [
2,
21004,
28,
40477,
12,
23,
198,
198,
11748,
4738,
198,
6738,
17268,
1330,
3706,
83,
29291,
628,
198,
12727,
796,
3706,
83,
29291,
10786,
12727,
3256,
705,
87,
331,
11537,
198,
198,
17931,
23988,
11053,
796,
1391,
198,
220,
220,
220,... | 2.252632 | 95 |
"""
This module allows to perform a specific extrinsic evaluation of files by a specified criteria.
Antoine Orgerit - Franois Grau - Lisa Fougeron
La Rochelle Universit - 2019-2020
"""
import langid
import json
import copy
import subprocess
from os import listdir, remove
from os.path import isfile, join
from utils.da... | [
37811,
198,
1212,
8265,
3578,
284,
1620,
257,
2176,
22820,
1040,
291,
12660,
286,
3696,
416,
257,
7368,
9987,
13,
198,
198,
13217,
42722,
1471,
1362,
270,
532,
1305,
5733,
271,
7037,
84,
532,
15378,
34296,
1362,
261,
198,
14772,
13545,
... | 2.380029 | 2,784 |
# Copyright 2021 Red Hat, Inc.
# 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 a... | [
2,
15069,
33448,
2297,
10983,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
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,... | 3.371094 | 256 |
import time, os
from openpyxl import load_workbook
from openpyxl import Workbook
from .config import * | [
11748,
640,
11,
28686,
198,
6738,
1280,
9078,
87,
75,
1330,
3440,
62,
1818,
2070,
198,
6738,
1280,
9078,
87,
75,
1330,
5521,
2070,
198,
6738,
764,
11250,
1330,
1635
] | 3.4 | 30 |
import numpy as np
# TODO: Do advanced prediction based on profiling work.
| [
11748,
299,
32152,
355,
45941,
628,
198,
2,
16926,
46,
25,
2141,
6190,
17724,
1912,
319,
31582,
670,
13,
628
] | 3.9 | 20 |
from city_scrapers_core.constants import BOARD
from city_scrapers_core.spiders import CityScrapersSpider
from city_scrapers.mixins import DetAuthorityMixin
| [
6738,
1748,
62,
1416,
2416,
364,
62,
7295,
13,
9979,
1187,
1330,
16494,
9795,
198,
6738,
1748,
62,
1416,
2416,
364,
62,
7295,
13,
2777,
4157,
1330,
2254,
3351,
2416,
364,
41294,
198,
198,
6738,
1748,
62,
1416,
2416,
364,
13,
19816,
... | 3.16 | 50 |
from common.bert_args import BertArgs
from sutime import SUTime
from parsing.nltk_nlp_utils import NLTK_NLP
from common import globals_args
from common import hand_files
parser_mode = globals_args.parser_mode
wh_words_set = {"what", "which", "whom", "who", "when", "where", "why", "how", "how many", "how large",... | [
6738,
2219,
13,
4835,
62,
22046,
1330,
22108,
42035,
201,
198,
6738,
264,
315,
524,
1330,
311,
3843,
524,
201,
198,
6738,
32096,
13,
77,
2528,
74,
62,
21283,
79,
62,
26791,
1330,
22879,
51,
42,
62,
45,
19930,
201,
198,
6738,
2219,
... | 2.407982 | 902 |
from torchtext.data.datasets_utils import (
_RawTextIterableDataset,
_wrap_split_argument,
_add_docstring_header,
_download_extract_validate,
_create_dataset_directory,
_create_data_from_csv,
)
import os
import logging
URL = 'https://drive.google.com/uc?export=download&id=0Bz8a_Dbh9QhbZVhsUnRWR... | [
6738,
28034,
5239,
13,
7890,
13,
19608,
292,
1039,
62,
26791,
1330,
357,
198,
220,
220,
220,
4808,
27369,
8206,
29993,
540,
27354,
292,
316,
11,
198,
220,
220,
220,
4808,
37150,
62,
35312,
62,
49140,
11,
198,
220,
220,
220,
4808,
28... | 2.08377 | 382 |
import os
from threading import Thread
from typing import List
from aiExchangeMessages_pb2 import SimulationID
if __name__ == "__main__":
from AIExchangeService import get_service
from aiExchangeMessages_pb2 import SimStateResponse, Control, SimulationID, VehicleID, DataRequest
from keyboard import is_p... | [
11748,
28686,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
257,
72,
3109,
3803,
36479,
1095,
62,
40842,
17,
1330,
41798,
2389,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
... | 2.658537 | 287 |
"""Generate SVG minimap."""
from aioify import wrap as aiowrap
from subprocess import Popen, PIPE
import math
import xml.etree.ElementTree as ET
from aocrecs.consts import PREDATOR_IDS, HERDABLE_IDS, HUNT_IDS, BOAR_IDS, FISH_IDS, FORAGE_ID, TC_IDS
GOLD_COLOR = '#FFC700'
STONE_COLOR = '#919191'
FOOD_COLOR = '#A5C46C'... | [
37811,
8645,
378,
45809,
10356,
499,
526,
15931,
198,
6738,
257,
952,
1958,
1330,
14441,
355,
257,
72,
322,
2416,
198,
6738,
850,
14681,
1330,
8099,
268,
11,
350,
4061,
36,
198,
11748,
10688,
198,
11748,
35555,
13,
316,
631,
13,
20180... | 2.307405 | 1,337 |
import scrapy
from scrapy.item import Field
| [
11748,
15881,
88,
198,
6738,
15881,
88,
13,
9186,
1330,
7663,
628
] | 3.75 | 12 |
import os
from datetime import datetime
from flask import render_template, request, jsonify, send_from_directory, url_for
from Application import app, db
from Application.db_operations import update_researcher_timestamp, insert_location_point_in_db, \
insert_or_update_existing_researcher, get_all_researchers_from_d... | [
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
11,
33918,
1958,
11,
3758,
62,
6738,
62,
34945,
11,
19016,
62,
1640,
198,
6738,
15678,
1330,
598,
11,
20613,
198,
6738,
15678,
1... | 2.877301 | 163 |
import tweepy
import dog
from postDog import postDog
from config import data
if __name__ == '__main__':
auth = tweepy.OAuthHandler(data["OAUTH_HANDLER_1"], data["OAUTH_HANDLER_2"])
auth.set_access_token(data["API_KEY_1"], data["API_KEY_2"])
api = tweepy.API(auth)
dogPic = dog.getDog(filename='assets... | [
11748,
4184,
538,
88,
198,
11748,
3290,
198,
6738,
1281,
32942,
1330,
1281,
32942,
198,
6738,
4566,
1330,
1366,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
220,
220,
220,
6284,
796,
4184,
538,
88,
13,
2362... | 2.478571 | 140 |